indoor.vue 38 KB

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