indoor.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. <template>
  2. <view>
  3. <view class="background">
  4. <view class="uni-list">
  5. <view class="container">
  6. <view>
  7. 工程周期
  8. </view>
  9. <view v-if="this.isEmpty(this.projectValue.dictValue)" style="margin-top: 10;"
  10. @click="pickerShow('gczq')">
  11. <span style="color: darkgray;">请选择工程周期</span>
  12. </view>
  13. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gczq')">
  14. <span style="color: black;">{{projectValue.dictLabel}}</span>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="uni-list">
  19. <view class="container">
  20. <view>
  21. 行政区
  22. </view>
  23. <view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
  24. @click="pickerShow('xzq')">
  25. <span style="color: darkgray;">请选择行政区</span>
  26. </view>
  27. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
  28. <span style="color: black;">{{XZQValue.dictLabel}}</span>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="uni-list">
  33. <view class="container">
  34. <view>
  35. 小区
  36. </view>
  37. <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  38. @click="pickerShow('xq')">
  39. <span style="color: darkgray;">请选择小区</span>
  40. </view>
  41. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
  42. <span style="color: black;">{{XQValue.name}}</span>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="uni-list">
  47. <view class="container">
  48. <view class="uni-list-cell-left">
  49. 楼栋
  50. </view>
  51. <view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  52. @click="pickerShow('ld')">
  53. <span style="color: darkgray;">请选择楼栋</span>
  54. </view>
  55. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
  56. <span style="color: black;">{{LDValue.name}}</span>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="uni-list" style="margin-top: 10;">
  61. <view class="container">
  62. <view class="uni-list-cell-left">
  63. 单元
  64. </view>
  65. <view v-if="this.isEmpty(this.DYValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  66. @click="pickerShow('dy')">
  67. <span style="color: darkgray;">请选择单元</span>
  68. </view>
  69. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
  70. <span style="color: black;">{{DYValue.name}}</span>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="uni-list">
  75. <view class="container">
  76. <view class="uni-list-cell-left">
  77. 房间
  78. </view>
  79. <view v-if="this.isEmpty(this.FJValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
  80. @click="pickerShow('fj')">
  81. <span style="color: darkgray;">请选择房间</span>
  82. </view>
  83. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
  84. <span style="color: black;">{{FJValue.name}}</span>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="container">
  89. <view class="title">是否按照施工图纸施工</view>
  90. <span style="color: black;">{{this.form}}</span>
  91. <switch style="transform: scale(0.6,0.6);" @change="switchChange" checked="isChick" />
  92. </view>
  93. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  94. subtitleKey="id" v-model="name"></SelectPicker>
  95. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  96. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  97. </view>
  98. <!--拆旧管-->
  99. <view class="background">
  100. <view v-if="objValue.enginClassValue=='拆旧管'">
  101. <view class="uni-list">
  102. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  103. 拆旧管
  104. <span
  105. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  106. @click="history">历史</span>
  107. </view>
  108. <view class="container" style="margin-bottom: 20PX;">
  109. <view>
  110. 腐蚀等级
  111. </view>
  112. <view v-if="this.isEmpty(this.LevelValue.dictValue)" style="margin-top: 10;"
  113. @click="pickerShow('fsdj')">
  114. <span style="color: darkgray;">请选择腐蚀等级</span>
  115. </view>
  116. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fsdj')">
  117. <span style="color: black;">{{LevelValue.dictLabel}}</span>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <!--立杠-->
  123. <view v-else-if="objValue.enginClassValue=='立杠'">
  124. <view class="uni-list" style="margin-bottom: 20px;">
  125. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  126. 立杠
  127. <span
  128. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  129. @click="history">历史</span>
  130. </view>
  131. <view class="container">
  132. <view>
  133. 材 质
  134. </view>
  135. <view v-if="this.isEmpty(this.materialValue.id)" style="margin-top: 10;"
  136. @click="pickerShow('cz')">
  137. <span style="color: darkgray;">请选择材质</span>
  138. </view>
  139. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
  140. <span style="color: black;">{{materialValue.name}}</span>
  141. </view>
  142. </view>
  143. <view class="container">
  144. <view>
  145. 规 格
  146. </view>
  147. <view v-if="this.isEmpty(this.specificationValue.id)" style="margin-top: 10;"
  148. @click="pickerShow('gg')">
  149. <span style="color: darkgray;">请选择规格</span>
  150. </view>
  151. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg')">
  152. <span style="color: black;">{{specificationValue.name}}</span>
  153. </view>
  154. </view>
  155. <view class="container">
  156. <text>数 量</text>
  157. <input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
  158. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  159. </view>
  160. </view>
  161. </view>
  162. <!--挂表-->
  163. <view v-else-if="objValue.enginClassValue=='挂表'">
  164. <view class="uni-list" style="margin-bottom: 20px;">
  165. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  166. 挂表
  167. <span
  168. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  169. @click="history">历史</span>
  170. </view>
  171. <view class="container">
  172. <view>
  173. 品 牌
  174. </view>
  175. <view v-if="this.isEmpty(this.brandValue.dictValue)" style="margin-top: 10;"
  176. @click="pickerShow('brand')">
  177. <span style="color: darkgray;">请选择品牌</span>
  178. </view>
  179. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('brand')">
  180. <span style="color: black;">{{brandValue.dictLabel}}</span>
  181. </view>
  182. </view>
  183. <view class="container">
  184. <text>数 量</text>
  185. <input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
  186. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  187. </view>
  188. </view>
  189. </view>
  190. <!--表后管-->
  191. <view v-else-if="objValue.enginClassValue=='表后管'">
  192. <view class="uni-list" style="margin-bottom: 20px;">
  193. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  194. 表后管
  195. <span
  196. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  197. @click="history">历史</span>
  198. </view>
  199. <view class="container">
  200. <view>
  201. 材 质
  202. </view>
  203. <view v-if="this.isEmpty(this.materialValue.id)" style="margin-top: 10;"
  204. @click="pickerShow('cz')">
  205. <span style="color: darkgray;">请选择材质</span>
  206. </view>
  207. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
  208. <span style="color: black;">{{materialValue.name}}</span>
  209. </view>
  210. </view>
  211. <view class="container">
  212. <view>
  213. 规 格
  214. </view>
  215. <view v-if="this.isEmpty(this.specificationValue.id)" style="margin-top: 10;"
  216. @click="pickerShow('gg')">
  217. <span style="color: darkgray;">请选择规格</span>
  218. </view>
  219. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg')">
  220. <span style="color: black;">{{specificationValue.name}}</span>
  221. </view>
  222. </view>
  223. <view class="container">
  224. <text>数 量</text>
  225. <input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
  226. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  227. </view>
  228. </view>
  229. </view>
  230. <!--阀管-->
  231. <view v-else-if="objValue.enginClassValue=='阀管'">
  232. <view class="uni-list" style="margin-bottom: 20px;">
  233. <view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
  234. 阀管
  235. <span
  236. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 15px;"
  237. @click="history">历史</span>
  238. </view>
  239. <view class="container">
  240. <view>
  241. 上门类型
  242. </view>
  243. <view v-if="this.isEmpty(this.doorValue.dictValue)" style="margin-top: 10;"
  244. @click="pickerShow('door')">
  245. <span style="color: darkgray;">请选择上门类型</span>
  246. </view>
  247. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('door')">
  248. <span style="color: black;">{{doorValue.dictLabel}}</span>
  249. </view>
  250. </view>
  251. <view class="container">
  252. <view>
  253. 自闭阀类型
  254. </view>
  255. <view v-if="this.isEmpty(this.SelfClosValve.dictValue)" style="margin-top: 10;"
  256. @click="pickerShow('zbf')">
  257. <span style="color: darkgray;">请选择自闭阀类型</span>
  258. </view>
  259. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('zbf')">
  260. <span style="color: black;">{{SelfClosValve.dictLabel}}</span>
  261. </view>
  262. </view>
  263. <view class="container">
  264. <view>
  265. 材 质
  266. </view>
  267. <view v-if="this.isEmpty(this.materialValue.id)" style="margin-top: 10;"
  268. @click="pickerShow('cz')">
  269. <span style="color: darkgray;">请选择材质</span>
  270. </view>
  271. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
  272. <span style="color: black;">{{materialValue.name}}</span>
  273. </view>
  274. </view>
  275. <view class="container">
  276. <view>
  277. 规 格
  278. </view>
  279. <view v-if="this.isEmpty(this.specificationValue.id)" style="margin-top: 10;"
  280. @click="pickerShow('gg')">
  281. <span style="color: darkgray;">请选择规格</span>
  282. </view>
  283. <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg')">
  284. <span style="color: black;">{{specificationValue.name}}</span>
  285. </view>
  286. </view>
  287. <view class="container">
  288. <text>数 量</text>
  289. <input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
  290. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  291. </view>
  292. </view>
  293. </view>
  294. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  295. <view class="container" style="color: gainsboro;">*请上传照片</view>
  296. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  297. <image src="/static/images/chooseimg.png" mode=""
  298. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="choose()"></image>
  299. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  300. <view
  301. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ">
  302. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  303. @click="showPhoto(index)">
  304. </image>
  305. </view>
  306. <view v-else>
  307. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  308. </view>
  309. <view @click="remove(index)"
  310. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  311. <uni-icons type="close" color="darkgray" size="18"></uni-icons>
  312. </view>
  313. </view>
  314. </view>
  315. </view>
  316. </view>
  317. <view class="action-btn">
  318. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  319. </view>
  320. <bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
  321. </view>
  322. </template>
  323. <script>
  324. import SelectPicker from '../../../components/selectPicker/select_picker.vue'
  325. import bottomSheet from '../../../components/bottomSheet/bottomSheet.vue'
  326. import uniIcons from '../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  327. import {
  328. getDicts
  329. } from "@/api/system/dict/data";
  330. import {
  331. getAreaList,
  332. getBuildingList,
  333. getUnitList,
  334. getHousesList,
  335. addTearOldPipe,
  336. getEnginMaterialQualityList,
  337. getEnginSpecificationsList,
  338. getRoomProjectList,
  339. getRoomProjectId,
  340. } from '@/api/common'
  341. import {
  342. getToken
  343. } from '../../../utils/auth';
  344. export default {
  345. components: {
  346. SelectPicker,
  347. uniIcons,
  348. bottomSheet
  349. },
  350. data() {
  351. return {
  352. headers: {
  353. Authorization: "Bearer " + getToken()
  354. },
  355. type: '',
  356. open: false,
  357. objValue: '', //上一页面传过来的值 新增接口用
  358. openDict: false,
  359. selectList: [],
  360. dictOptions: [],
  361. imgArr: [],
  362. XQValue: {},
  363. XZQValue: {},
  364. projectValue: {},
  365. LevelValue: {},
  366. LDValue: {},
  367. DYValue: {},
  368. FJValue: {},
  369. FSValue: {},
  370. specificationValue: {}, //规格
  371. materialValue: {}, //材质
  372. brandValue: {}, //品牌
  373. doorValue: {}, //上门类型
  374. SelfClosValve: {}, //自闭阀类型
  375. materialList: '', //材质list
  376. XQList: '',
  377. LDList: '',
  378. DYList: '',
  379. FJList: '',
  380. progress: 0, //上传图片进度百分比
  381. loading: false,
  382. isCheck: true, //是否按照施工图纸施工
  383. inputNumberValue: '',
  384. title: '',
  385. historyList: {} //历史数据
  386. }
  387. },
  388. created() {
  389. },
  390. onLoad(options) {
  391. if ('params' in options) {
  392. this.objValue = JSON.parse(decodeURIComponent(options.params));
  393. if (this.objValue.enginType == `old_renovation`) {
  394. this.title = '旧改工程-室内'
  395. } else if (this.objValue.enginType == `new_built`) {
  396. this.title = '新建工程-室内'
  397. }
  398. uni.setNavigationBarTitle({
  399. title: this.title
  400. })
  401. }
  402. },
  403. methods: {
  404. //判断是否选择
  405. isEmpty(str) {
  406. return (!str || 0 === str.length);
  407. },
  408. // 显示历史弹窗
  409. handleShowSheet() {
  410. this.shareState = true;
  411. },
  412. // 隐藏历史弹窗
  413. handleHiddenShare() {
  414. this.shareState = false;
  415. },
  416. showPhoto(index) {
  417. uni.previewImage({
  418. current: index,
  419. urls: this.imgArr,
  420. })
  421. },
  422. remove(index) {
  423. uni.showModal({
  424. title: '提示',
  425. content: '是否删除该图片或视频?',
  426. success: (res) => {
  427. if (res.confirm) {
  428. this.imgArr.splice(index, 1)
  429. console.log('this.imgarr', this.imgArr)
  430. if (this.imgArr.length <= 0) {
  431. this.photo = true;
  432. }
  433. }
  434. }
  435. })
  436. },
  437. choose() {
  438. let _this = this;
  439. uni.showActionSheet({
  440. title: '上传',
  441. itemList: ['图片', '视频'],
  442. success: (res) => {
  443. console.log(res)
  444. if (res.tapIndex == 0) {
  445. this.chooseimage()
  446. } else {
  447. this.choosevideo()
  448. }
  449. }
  450. })
  451. },
  452. chooseimage() {
  453. let _this = this;
  454. console.log('图片', _this.headers)
  455. uni.chooseImage({
  456. sizeType: ['album', 'camera'],
  457. success(resp) {
  458. resp.tempFiles.forEach((item, index) => {
  459. const task = uni.uploadFile({
  460. url: _this.$HTTP + `/obs`,
  461. filePath: item.path,
  462. name: 'file',
  463. formData: {},
  464. header: _this.headers,
  465. success: res => {
  466. // 判断是否json字符串,将其转为json格式
  467. console.log("结果", res)
  468. // let data = _this.$u.test.jsonString(res
  469. // .data) ? JSON.parse(res.data) : res.data;
  470. let data = JSON.parse(res.data);
  471. if (![200].includes(data.code)) {
  472. // this.uploadError(index, data);
  473. _this.$modal.msg(data.msg)
  474. } else {
  475. if (_this.progress === 100) {
  476. console.log('_this.progress', _this.progress)
  477. //console.log('data----', data)data
  478. console.log('res--', res)
  479. _this.imgArr.push(data.data.url)
  480. console.log('imgArr', _this.imgArr)
  481. _this.$modal.msg('上传成功!')
  482. _this.photo = false;
  483. }
  484. }
  485. },
  486. fail: e => {
  487. console.log(e)
  488. _this.$modal.msg('上传失败!')
  489. //_this.uploadError(index, e);
  490. },
  491. complete: res => {
  492. uni.hideLoading();
  493. _this.uploading = false;
  494. }
  495. });
  496. task.onProgressUpdate(res => {
  497. _this.progress = res.progress;
  498. console.log('onProgressUpdate', res)
  499. console.log('task.onProgressUpdate', _this.progress)
  500. uni.showLoading({
  501. title: '上传中'
  502. })
  503. if (_this.progress != 100) {
  504. _this.loading = false
  505. console.log('_this.loading false', _this.loading)
  506. } else {
  507. _this.loading = true
  508. console.log('_this.loading true', _this.loading)
  509. }
  510. });
  511. })
  512. },
  513. })
  514. },
  515. choosevideo() {
  516. let _this = this;
  517. console.log('视频')
  518. uni.chooseVideo({
  519. sourceType: ['album', 'camera'],
  520. maxDuration: 30,
  521. success(resp) {
  522. const task = uni.uploadFile({
  523. url: _this.$HTTP + `/obs`,
  524. filePath: resp.tempFilePath,
  525. name: 'file',
  526. formData: {},
  527. header: _this.headers,
  528. success: res => {
  529. // 判断是否json字符串,将其转为json格式
  530. let data = JSON.parse(res.data);
  531. if (![200].includes(res.statusCode)) {
  532. this.uploadError(index, data);
  533. } else {
  534. //上传成功
  535. if (_this.progress === 100) {
  536. console.log('_this.progress', _this.progress)
  537. _this.imgArr.push(data.data.url)
  538. console.log('imgArr', _this.imgArr)
  539. _this.$modal.msg('上传成功!')
  540. _this.photo = false;
  541. }
  542. }
  543. },
  544. fail: e => {
  545. _this.$modal.msg('上传失败!')
  546. this.uploadError(index, e);
  547. },
  548. complete: res => {
  549. uni.hideLoading();
  550. _this.uploading = false;
  551. }
  552. });
  553. task.onProgressUpdate(res => {
  554. _this.progress = res.progress;
  555. console.log('onProgressUpdate', res)
  556. uni.showLoading({
  557. title: '上传中'
  558. })
  559. if (_this.progress != 100) {
  560. _this.loading = false
  561. console.log('_this.loading false', _this.loading)
  562. } else {
  563. _this.loading = true
  564. console.log('_this.loading true', _this.loading)
  565. }
  566. });
  567. },
  568. })
  569. },
  570. pickerShow(e) {
  571. this.type = e; //赋值类型
  572. if (e == 'door') { //上门类型
  573. this.openDict = true;
  574. getDicts("visit_type").then(response => {
  575. this.dictOptions = response.data;
  576. });
  577. } else if (e == 'zbf') { //自闭阀类型
  578. this.openDict = true;
  579. getDicts("self_closing_valve_type").then(response => {
  580. this.dictOptions = response.data;
  581. });
  582. } else if (e == 'brand') { //品牌
  583. this.openDict = true;
  584. getDicts("brand").then(response => {
  585. this.dictOptions = response.data;
  586. });
  587. } else if (e == 'cz') { //材质
  588. this.open = true;
  589. getEnginMaterialQualityList("民用工程").then(response => {
  590. this.selectList = response.data;
  591. });
  592. } else if (e == 'gg') { //规格
  593. if (this.isEmpty(this.materialValue.id)) {
  594. this.$modal.msg('请选择材质')
  595. } else {
  596. this.open = true;
  597. this.selectList = this.materialList;
  598. }
  599. } else if (e == 'fsdj') {
  600. //腐蚀等级
  601. this.openDict = true;
  602. //腐蚀等级
  603. getDicts("corrosion_level").then(response => {
  604. this.dictOptions = response.data;
  605. });
  606. } else if (e == 'gczq') { //工程周期
  607. this.openDict = true;
  608. getDicts("engin_cycle").then(response => {
  609. this.dictOptions = response.data;
  610. });
  611. } else if (e == 'xzq') { //行政区
  612. if (this.isEmpty(this.projectValue.dictValue)) {
  613. this.$modal.msg('请选择工程周期')
  614. } else {
  615. this.openDict = true;
  616. getDicts("district").then(response => {
  617. this.dictOptions = response.data;
  618. });
  619. }
  620. //this.selectList = this.dictOptions;
  621. } else if (e == 'xq') { //小区
  622. if (this.isEmpty(this.XZQValue.dictValue)) {
  623. this.$modal.msg('请选择行政区')
  624. } else {
  625. this.open = true;
  626. this.selectList = this.XQList;
  627. }
  628. } else if (e == 'ld') { //楼栋
  629. if (this.isEmpty(this.XQValue.id)) {
  630. this.$modal.msg('请选择小区')
  631. } else {
  632. this.open = true;
  633. this.selectList = this.LDList;
  634. }
  635. } else if (e == 'dy') { //单元
  636. if (this.isEmpty(this.LDValue.id)) {
  637. this.$modal.msg('请选择楼栋')
  638. } else {
  639. this.open = true;
  640. this.selectList = this.DYList;
  641. }
  642. } else if (e == 'fj') { //房间
  643. if (this.isEmpty(this.DYValue.id)) {
  644. this.$modal.msg('请选择单元')
  645. } else {
  646. this.open = true;
  647. this.selectList = this.FJList;
  648. }
  649. }
  650. },
  651. switchChange(e) {
  652. //'switch 发生 change 事件,携带值为', e.detail.value)
  653. this.isCheck = e.detail.value;
  654. },
  655. changeSelectDict(item, index) {
  656. this.openDict = false;
  657. if (this.type == 'door') {
  658. this.doorValue = item
  659. } else if (this.type == 'zbf') {
  660. this.SelfClosValve = item
  661. } else if (this.type == 'brand') {
  662. this.brandValue = item
  663. } else if (this.type == 'gczq') {
  664. this.projectValue = item
  665. } else if (this.type == 'xzq') {
  666. this.XZQValue = item;
  667. //根据行政区id获取小区数据
  668. this.XQValue = ''; //重置小区数据
  669. this.LDValue = ''; //重置楼栋数据
  670. this.DYValue = ''; //重置单元数据
  671. this.FJValue = ''; //重置房间数据
  672. getAreaList(item.dictValue).then(res => {
  673. this.XQList = res.data;
  674. })
  675. } else {
  676. this.LevelValue = item;
  677. }
  678. },
  679. changeSelect(item, index) {
  680. // this.index = index;
  681. // this.address = item.communityName;
  682. this.open = false;
  683. if (this.type == 'cz') {
  684. this.materialValue = item;
  685. this.specificationValue = ''; //重置规格
  686. //根据材质ID 获取规格数据
  687. getEnginSpecificationsList(item.id).then(res => {
  688. this.materialList = res.data
  689. })
  690. } else if (this.type == 'gg') {
  691. this.specificationValue = item;
  692. } else if (this.type == 'xq') {
  693. this.XQValue = item;
  694. //根据小区id 获取楼栋数据
  695. this.LDValue = ''; //重置楼栋数据
  696. this.DYValue = ''; //重置单元数据
  697. this.FJValue = ''; //重置房间数据
  698. getBuildingList(item.id).then(res => {
  699. this.LDList = res.data
  700. // console.log("楼栋=", res)
  701. })
  702. } else if (this.type == 'ld') {
  703. this.LDValue = item;
  704. //根据楼栋ID 获取单元数据
  705. this.DYValue = ''; //重置单元数据
  706. this.FJValue = ''; //重置房间数据
  707. getUnitList(item.id).then(res => {
  708. this.DYList = res.data
  709. // console.log("单元=", res)
  710. })
  711. } else if (this.type == 'dy') {
  712. this.DYValue = item;
  713. //根据单元数据 获取房间数据
  714. this.FJValue = ''; //重置房间数据
  715. getHousesList(item.id).then(res => {
  716. this.FJList = res.data
  717. // console.log("房间=", res)
  718. })
  719. } else if (this.type == 'fj') {
  720. this.FJValue = item;
  721. }
  722. },
  723. //关闭弹窗
  724. close(e) {
  725. this.open = false
  726. },
  727. //关闭弹窗
  728. closeDict(e) {
  729. this.openDict = false
  730. },
  731. //提交数据
  732. submit() {
  733. if (this.isEmpty(this.projectValue.dictValue)) {
  734. this.$modal.msg("请选择工程周期")
  735. } else if (this.isEmpty(this.XZQValue.dictValue)) {
  736. this.$modal.msg("请选择行政区")
  737. } else if (this.isEmpty(this.XQValue.id)) {
  738. this.$modal.msg("请选择小区")
  739. } else if (this.isEmpty(this.LDValue.id)) {
  740. this.$modal.msg("请选择楼栋")
  741. } else if (this.isEmpty(this.DYValue.id)) {
  742. this.$modal.msg("请选择单元")
  743. } else if (this.isEmpty(this.FJValue.id)) {
  744. this.$modal.msg("请选择房间")
  745. } else if (this.objValue.enginClassValue == '拆旧管') {
  746. if (this.isEmpty(this.LevelValue.dictValue)) {
  747. this.$modal.msg("请选择腐蚀等级") //拆旧管 判断腐蚀等级
  748. } else {
  749. this.onsubmit();
  750. }
  751. } else if (this.objValue.enginClassValue == '立杠') {
  752. //立杠 判断 材质 规格 数量
  753. if (this.isEmpty(this.materialValue.id)) {
  754. this.$modal.msg("请选择材质")
  755. } else if (this.isEmpty(this.specificationValue.id)) {
  756. this.$modal.msg("请选择规格")
  757. } else if (this.isEmpty(this.inputNumberValue)) {
  758. this.$modal.msg("请输入数量")
  759. } else {
  760. this.onsubmit();
  761. }
  762. } else if (this.objValue.enginClassValue == '挂表') {
  763. //挂表 判断 品牌 数量
  764. if (this.isEmpty(this.brandValue.dictValue)) {
  765. this.$modal.msg("请选择品牌")
  766. } else if (this.isEmpty(this.inputNumberValue)) {
  767. this.$modal.msg("请输入数量")
  768. } else {
  769. this.onsubmit();
  770. }
  771. } else if (this.objValue.enginClassValue == '表后管') {
  772. //表后管 判断 材质 规格 数量 (为必须有一张照片和一个视频)
  773. if (this.isEmpty(this.materialValue.id)) {
  774. this.$modal.msg("请选择材质")
  775. } else if (this.isEmpty(this.specificationValue.id)) {
  776. this.$modal.msg("请选择规格")
  777. } else if (this.isEmpty(this.inputNumberValue)) {
  778. this.$modal.msg("请输入数量")
  779. } else if (this.imgArr.length <= 0) {
  780. this.$modal.msg('请上传照片或视频')
  781. } else if (this.loading == false) {
  782. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  783. } else {
  784. const hasImage = this.imgArr.some(item => item.endsWith('.jpg') || item.endsWith('.png') || item
  785. .endsWith('.jpeg'));
  786. const hasVideo = this.imgArr.some(item => item.endsWith('.mp4') || item.endsWith('.avi') || item
  787. .endsWith('.mov'));
  788. if (hasImage && hasVideo) {
  789. //表后管 特殊 提交
  790. let param = {
  791. district: this.XZQValue.dictValue,
  792. areaId: this.XQValue.id,
  793. buildingId: this.LDValue.id,
  794. unitId: this.DYValue.id,
  795. houseId: this.FJValue.id,
  796. enginType: this.objValue.enginType, //写死 上一页面传过来的
  797. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  798. enginCycle: this.projectValue.dictValue, //工程周期
  799. zEngineeringNodeBo: {
  800. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  801. zEngineeringInfoBo: {
  802. constructAccordingDrawings: this.isCheck, //是否按图纸施工
  803. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  804. zEngineeringMaterialBo: [{
  805. materialQuality: this.materialValue.id, //材质
  806. specifications: this.specificationValue.id, //规格
  807. number: this.inputNumberValue //数量
  808. }]
  809. }
  810. }
  811. }
  812. addTearOldPipe(param).then(res => {
  813. if (res.code == '200') {
  814. uni.showToast({
  815. title: res.msg,
  816. icon: 'none',
  817. //显示持续时间为 1秒
  818. duration: 1000
  819. });
  820. uni.navigateBack();
  821. }
  822. })
  823. } else {
  824. this.$modal.msg('请至少上传一张照片和一个视频')
  825. }
  826. }
  827. } else if (this.objValue.enginClassValue == '阀管') {
  828. //阀管 判断 材质 规格 数量
  829. if (this.isEmpty(this.doorValue.dictValue)) {
  830. this.$modal.msg("请选择上门类型")
  831. } else if (this.isEmpty(this.SelfClosValve.dictValue)) {
  832. this.$modal.msg("请选择自闭阀类型")
  833. } else if (this.isEmpty(this.materialValue.id)) {
  834. this.$modal.msg("请选择材质")
  835. } else if (this.isEmpty(this.specificationValue.id)) {
  836. this.$modal.msg("请选择规格")
  837. } else if (this.isEmpty(this.inputNumberValue)) {
  838. this.$modal.msg("请输入数量")
  839. } else {
  840. this.onsubmit();
  841. }
  842. }
  843. },
  844. onsubmit() {
  845. if (this.imgArr.length <= 0) {
  846. this.$modal.msg('请上传照片或视频')
  847. } else if (this.loading == false) {
  848. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  849. } else {
  850. //提交
  851. let param = ';'
  852. if (this.objValue.enginClassValue == '拆旧管') { //拆旧管
  853. param = {
  854. district: this.XZQValue.dictValue,
  855. areaId: this.XQValue.id,
  856. buildingId: this.LDValue.id,
  857. unitId: this.DYValue.id,
  858. houseId: this.FJValue.id,
  859. enginType: this.objValue.enginType, //写死 上一页面传过来的
  860. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  861. enginCycle: this.projectValue.dictValue, //工程周期
  862. zEngineeringNodeBo: {
  863. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  864. zEngineeringInfoBo: {
  865. constructAccordingDrawings: this.isCheck, //是否按图纸施工
  866. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  867. zEngineeringMaterialBo: [{
  868. corrosionLevel: this.LevelValue.dictValue //腐蚀等级
  869. }]
  870. }
  871. }
  872. }
  873. //this.onsubmit(param)
  874. } else if (this.objValue.enginClassValue == '立杠') { //立杠
  875. param = {
  876. district: this.XZQValue.dictValue,
  877. areaId: this.XQValue.id,
  878. buildingId: this.LDValue.id,
  879. unitId: this.DYValue.id,
  880. houseId: this.FJValue.id,
  881. enginType: this.objValue.enginType, //写死 上一页面传过来的
  882. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  883. enginCycle: this.projectValue.dictValue, //工程周期
  884. zEngineeringNodeBo: {
  885. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  886. zEngineeringInfoBo: {
  887. constructAccordingDrawings: this.isCheck, //是否按图纸施工
  888. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  889. zEngineeringMaterialBo: [{
  890. materialQuality: this.materialValue.id, //材质
  891. specifications: this.specificationValue.id, //规格
  892. number: this.inputNumberValue //数量
  893. }]
  894. }
  895. }
  896. }
  897. } else if (this.objValue.enginClassValue == '挂表') { //挂表
  898. param = {
  899. district: this.XZQValue.dictValue,
  900. areaId: this.XQValue.id,
  901. buildingId: this.LDValue.id,
  902. unitId: this.DYValue.id,
  903. houseId: this.FJValue.id,
  904. enginType: this.objValue.enginType, //写死 上一页面传过来的
  905. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  906. enginCycle: this.projectValue.dictValue, //工程周期
  907. zEngineeringNodeBo: {
  908. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  909. zEngineeringInfoBo: {
  910. constructAccordingDrawings: this.isCheck, //是否按图纸施工
  911. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  912. zEngineeringMaterialBo: [{
  913. brand: this.brandValue.dictValue, //品牌
  914. number: this.inputNumberValue //数量
  915. }]
  916. }
  917. }
  918. }
  919. } else if (this.objValue.enginClassValue == '阀管') { //自闭阀
  920. param = {
  921. district: this.XZQValue.dictValue,
  922. areaId: this.XQValue.id,
  923. buildingId: this.LDValue.id,
  924. unitId: this.DYValue.id,
  925. houseId: this.FJValue.id,
  926. enginType: this.objValue.enginType, //写死 上一页面传过来的
  927. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  928. enginCycle: this.projectValue.dictValue, //工程周期
  929. zEngineeringNodeBo: {
  930. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  931. zEngineeringInfoBo: {
  932. constructAccordingDrawings: this.isCheck, //是否按图纸施工
  933. zEngiineeringPhotoBoList: this.imgArr, //照片集合
  934. zEngineeringMaterialBo: [{
  935. visitType: this.doorValue.dictValue, //上门类型
  936. selfClosingValveType: this.SelfClosValve.dictValue, //自闭阀类型
  937. materialQuality: this.materialValue.id, //材质
  938. specifications: this.specificationValue.id, //规格
  939. number: this.inputNumberValue //数量
  940. }]
  941. }
  942. }
  943. }
  944. }
  945. addTearOldPipe(param).then(res => {
  946. if (res.code == '200') {
  947. uni.showToast({
  948. title: res.msg,
  949. icon: 'none',
  950. //显示持续时间为 3秒
  951. duration: 2000
  952. });
  953. setTimeout(function() {
  954. uni.navigateBack();
  955. }, 1000)
  956. }
  957. })
  958. }
  959. },
  960. history() {
  961. if (this.isEmpty(this.projectValue.dictValue)) {
  962. this.$modal.msg("请选择工程周期")
  963. } else if (this.isEmpty(this.XZQValue.dictValue)) {
  964. this.$modal.msg("请选择行政区")
  965. } else if (this.isEmpty(this.XQValue.id)) {
  966. this.$modal.msg("请选择小区")
  967. } else if (this.isEmpty(this.LDValue.id)) {
  968. this.$modal.msg("请选择楼栋")
  969. } else if (this.isEmpty(this.DYValue.id)) {
  970. this.$modal.msg("请选择单元")
  971. } else if (this.isEmpty(this.FJValue.id)) {
  972. this.$modal.msg("请选择房间")
  973. } else {
  974. let param = {
  975. areaId: this.XQValue.id, // 小区id
  976. buildingId: this.LDValue.id, // 楼宇id
  977. unitId: this.DYValue.id, // 单元id
  978. houseId: this.FJValue.id, // 房间id
  979. enginCycle: this.projectValue.dictValue // 工程周期
  980. }
  981. getRoomProjectId(param).then(res => {
  982. if (res.code == '200') {
  983. if (res.data != null) {
  984. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(res => {
  985. this.historyList = res.data
  986. if (res.data.zEngineeringNodeBo != null) {
  987. this.showHistoryList();
  988. } else {
  989. this.$modal.msg("暂无历史信息")
  990. }
  991. })
  992. } else {
  993. this.$modal.msg("暂无工程信息")
  994. }
  995. } else {
  996. this.$modal.msg(res.msg)
  997. }
  998. })
  999. }
  1000. },
  1001. showHistoryList() {
  1002. this.$refs.refShare.handleShowShare();
  1003. }
  1004. }
  1005. }
  1006. </script>
  1007. <style>
  1008. .container {
  1009. display: flex;
  1010. margin-left: 10px;
  1011. margin-top: 10px;
  1012. margin-right: 10px;
  1013. align-items: flex-start;
  1014. justify-content: space-between;
  1015. }
  1016. .text {
  1017. font-size: 16px;
  1018. color: #333;
  1019. }
  1020. .background {
  1021. border: 15px solid hsla(0, 0%, 100%, .5);
  1022. background: white;
  1023. background-clip: padding-box;
  1024. /*从padding开始往外面裁剪背景*/
  1025. }
  1026. .btn {
  1027. margin-top: 40px;
  1028. margin-right: 20px;
  1029. margin-bottom: 120px;
  1030. margin-left: 20px;
  1031. height: 45px;
  1032. }
  1033. .number {
  1034. display: flex;
  1035. /* 水平居中显示子元素 */
  1036. align-items: flex-start;
  1037. /* 垂直居中显示子元素 */
  1038. justify-content: space-between;
  1039. /* 左右间距等于间距大小 */
  1040. padding: 10px;
  1041. /* 设置padding以提高视觉效果 */
  1042. }
  1043. </style>