courtyard.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <scroll-view>
  3. <view class="background">
  4. <view class="uni-list">
  5. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  6. <view>
  7. 行政区
  8. </view>
  9. <view v-if="this.isEmpty(this.XZQValue.dictValue)" @click="pickerShow('xzq',0)">
  10. <span style="color: darkgray;">请选择行政区</span>
  11. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  12. </view>
  13. <view v-else class="uni-list-cell-db" @click="pickerShow('xzq',0)">
  14. <span style="color: black;">{{XZQValue.dictLabel}}</span>
  15. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="uni-list">
  20. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  21. <view>
  22. 小区
  23. </view>
  24. <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" @click="pickerShow('xq',0)">
  25. <span style="color: darkgray;">请选择小区</span>
  26. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  27. </view>
  28. <view v-else class="uni-list-cell-db" @click="pickerShow('xq',0)">
  29. <span style="color: black;">{{XQValue.name}}</span>
  30. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="uni-list">
  35. <view class="container">
  36. <view class="uni-list-cell-left">
  37. 楼栋
  38. </view>
  39. <view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" @click="pickerShow('ld',0)">
  40. <span style="color: darkgray;">请选择楼栋</span>
  41. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  42. </view>
  43. <view v-else class="uni-list-cell-db" @click="pickerShow('ld',0)">
  44. <span style="color: black;">{{LDValue.name}}</span>
  45. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  46. </view>
  47. </view>
  48. </view>
  49. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  50. subtitleKey="id" v-model="name"></SelectPicker>
  51. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  52. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  53. </view>
  54. <view class="background">
  55. <view>
  56. <view class="uni-list">
  57. <view
  58. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  59. {{objValue.enginClassValue}}
  60. <span
  61. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 10px;"
  62. @click="history">历史</span>
  63. </view>
  64. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  65. <view>
  66. 施工时间
  67. </view>
  68. <view @click="openDatetimePicker('sg')">
  69. <span style="color: black;">{{time}}</span>
  70. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  71. </view>
  72. </view>
  73. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  74. <view class="uni-common-mt" style="width: 100%;">
  75. <text class="uni-title uni-common-pl">施工内容</text>
  76. <view style="width: 100%;box-sizing: border-box;">
  77. <textarea class="textarea" placeholder="请输入施工内容" maxlength="255"
  78. placeholder-style="padding: 10rpx;"
  79. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  80. auto-height v-model="projectContent"></textarea>
  81. </view>
  82. </view>
  83. </view>
  84. <view v-for="(a,index) in czggslList" :key="index" class="num-style">
  85. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  86. <view>
  87. 材质
  88. </view>
  89. <view class="uni-list-cell-db" @click="pickerShow('cz',index)">
  90. <span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</span>
  91. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  92. </view>
  93. </view>
  94. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  95. <view>
  96. 规格
  97. </view>
  98. <view class="uni-list-cell-db" @click="pickerShow('gg',index)">
  99. <span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</span>
  100. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  101. </view>
  102. </view>
  103. <!-- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  104. <text>数量</text>
  105. <input class="uni-input" type="number" v-model="a.sl" placeholder="请填写数量" maxlength="11"
  106. style="margin-left: 10px;text-align: right;"></input>
  107. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  108. </view> -->
  109. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  110. <text>米 数</text>
  111. <!-- style="margin-left: 10px;text-align: right;" -->
  112. <view style="display: flex; justify-content: right; width: 70%;">
  113. <input class="uni-input" type="number" v-model="a.sl.inputIntegerNumberValue"
  114. maxlength="6"
  115. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  116. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  117. <input class="uni-input" type="number" v-model="a.sl.inputDecimalNumberValue"
  118. maxlength="1"
  119. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  120. </view>
  121. </view>
  122. <button v-if="index!=0" @click="this.czggslList.splice(index,1)" class="sc-btn">删除</button>
  123. </view>
  124. <button @click="this.czggslList.push({cz:{id: '',name: ''},gg:{id: '',name: ''},sl: {
  125. inputIntegerNumberValue: '',
  126. inputDecimalNumberValue: ''
  127. }})" class="tj-btn">添加</button>
  128. </view>
  129. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  130. <view class="container" style="color: #b2b2b2;">*请上传管道施工记录照片</view>
  131. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  132. <image :src="loadImgSrc('updateimg.png')" mode=""
  133. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('gdsgjl')"
  134. v-show="reviewStatus!='1'"></image>
  135. <view v-for="(item,index) in imgPipelineArr" :key="index" style="position: relative;">
  136. <view
  137. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  138. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  139. @click="showPhoto(index,'gdsgjl')">
  140. </image>
  141. </view>
  142. <view v-else>
  143. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  144. </view>
  145. <view @click="remove(index,'gdsgjl')"
  146. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  147. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  148. </image>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  154. <view class="container" style="color: #b2b2b2;">*请上传管上皮深度测量照片</view>
  155. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  156. <image :src="loadImgSrc('updateimg.png')" mode=""
  157. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('gspsdcl')"
  158. v-show="reviewStatus!='1'"></image>
  159. <view v-for="(item,index) in imgGuanArr" :key="index" style="position: relative;">
  160. <view
  161. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  162. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  163. @click="showPhoto(index,'gspsdcl')">
  164. </image>
  165. </view>
  166. <view v-else>
  167. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  168. </view>
  169. <view @click="remove(index,'gspsdcl')"
  170. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  171. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  172. </image>
  173. </view>
  174. </view>
  175. </view>
  176. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  177. <view class="container" style="color: #b2b2b2;">*请上传管沟远景照片</view>
  178. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  179. <image :src="loadImgSrc('updateimg.png')" mode=""
  180. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('ggyj')"
  181. v-show="reviewStatus!='1'"></image>
  182. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  183. <view
  184. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  185. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  186. @click="showPhoto(index,'ggyj')">
  187. </image>
  188. </view>
  189. <view v-else>
  190. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  191. </view>
  192. <view @click="remove(index,'ggyj')"
  193. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  194. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  195. </image>
  196. </view>
  197. </view>
  198. </view>
  199. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  200. <view class="container" style="color: #b2b2b2;">*请上传视频</view>
  201. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  202. <image :src="loadImgSrc('updateimg.png')" mode=""
  203. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('video')"
  204. v-show="reviewStatus!='1'"></image>
  205. <view v-for="(item,index) in videoArr" :key="index" style="position: relative;">
  206. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  207. <view @click="remove(index,'video')"
  208. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  209. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  210. </image>
  211. </view>
  212. </view>
  213. </view>
  214. </view>
  215. </view>
  216. </view>
  217. </view>
  218. </view>
  219. <view class="action-btn" v-show="reviewStatus!='1'">
  220. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  221. </view>
  222. <bottom-sheet ref="refShare" :data="historyList" :TitleType="objValue.enginClassValue"></bottom-sheet>
  223. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  224. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  225. </scroll-view>
  226. </template>
  227. <script>
  228. import SelectPicker from '../../../components/selectPicker/select_picker.vue'
  229. import bottomSheet from '../../../components/bottomSheet/bottomSheetMore.vue'
  230. import {
  231. getDicts
  232. } from "@/api/system/dict/data";
  233. import {
  234. getAreaList,
  235. getBuildingList,
  236. addTearOldPipe,
  237. getEnginMaterialQualityList,
  238. getEnginSpecificationsList,
  239. getRoomProjectList,
  240. getRoomProjectId,
  241. } from '@/api/common'
  242. import {
  243. getToken
  244. } from '../../../utils/auth';
  245. export default {
  246. components: {
  247. SelectPicker,
  248. bottomSheet,
  249. },
  250. data() {
  251. return {
  252. headers: {
  253. Authorization: "Bearer " + getToken()
  254. },
  255. zEngineeringMaterialBo: [], //给后台传的值 用料列表
  256. czggslList: [{
  257. cz: {
  258. id: '',
  259. name: ''
  260. },
  261. gg: {
  262. id: '',
  263. name: ''
  264. },
  265. sl: {
  266. inputIntegerNumberValue: '',
  267. inputDecimalNumberValue: ''
  268. }
  269. }, ],
  270. type: '',
  271. reviewStatus: '', //是否可以点击
  272. open: false,
  273. objValue: '', //上一页面传过来的值 新增接口用
  274. openDict: false,
  275. selectList: [],
  276. dictOptions: [],
  277. imgArr: [],
  278. imgGuanArr: [],
  279. imgPipelineArr: [],
  280. videoArr: [],
  281. XQValue: {},
  282. XZQValue: {},
  283. SelectIndex: '', //选择的索引值
  284. projectValue: {
  285. 'dictValue': '0'
  286. },
  287. LevelValue: {},
  288. isOkValue: '', //分段打压是否合格
  289. isOkLabel: '', //分段打压是否合格label
  290. LDValue: {},
  291. time: '', //施工时间
  292. timeType: '', //时间类型
  293. BackfillingTime: '', //回填时间
  294. showTime: false,
  295. specificationValue: {}, //规格
  296. projectContent: '', //施工内容
  297. materialValue: {}, //材质
  298. brandValue: {}, //品牌
  299. doorValue: {}, //上门类型
  300. SelfClosValve: {}, //自闭阀类型
  301. materialList: '', //材质list
  302. XQList: '',
  303. LDList: '',
  304. progress: 0, //上传图片进度百分比
  305. loading: false,
  306. inputNumberValue: '',
  307. title: '',
  308. historyList: {} //历史数据
  309. }
  310. },
  311. created() {
  312. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  313. },
  314. onLoad(options) {
  315. if ('params' in options) {
  316. this.objValue = JSON.parse(decodeURIComponent(options.params));
  317. if (this.objValue.enginType == `old_renovation`) {
  318. this.title = '旧改工程-庭院'
  319. } else if (this.objValue.enginType == `new_built`) {
  320. this.title = '新建工程-庭院'
  321. }
  322. uni.setNavigationBarTitle({
  323. title: this.title
  324. })
  325. }
  326. },
  327. methods: {
  328. // 打开picker
  329. openDatetimePicker(type) {
  330. this.timeType = type;
  331. this.$refs.myPicker.show();
  332. },
  333. // 关闭picker
  334. closeDatetimePicker() {
  335. this.$refs.myPicker.hide();
  336. },
  337. handleSubmit(e) {
  338. if (this.timeType == 'ht') {
  339. this.BackfillingTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  340. } else {
  341. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  342. }
  343. },
  344. //获取当前时间
  345. traversalTime(timestamp) {
  346. //timestamp(时间戳)是整数,否则要parseInt转换
  347. let time = new Date(timestamp);
  348. let y = time.getFullYear();
  349. let m = time.getMonth() + 1;
  350. let d = time.getDate();
  351. let h = time.getHours();
  352. let mm = time.getMinutes();
  353. let s = time.getSeconds();
  354. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  355. mm) + ':' + this.addTimes(s);
  356. },
  357. addTimes(m) {
  358. return m < 10 ? '0' + m : m
  359. },
  360. //判断是否选择
  361. isEmpty(str) {
  362. return (!str || 0 === str.length);
  363. },
  364. // 显示历史弹窗
  365. handleShowSheet() {
  366. this.shareState = true;
  367. },
  368. // 隐藏历史弹窗
  369. handleHiddenShare() {
  370. this.shareState = false;
  371. },
  372. showPhoto(index, type) {
  373. let typeArr = [];
  374. if (type == 'gspsdcl') {
  375. typeArr = this.imgGuanArr;
  376. } else if (type == 'gdsgjl') {
  377. typeArr = this.imgPipelineArr;
  378. } else {
  379. typeArr = this.imgArr;
  380. }
  381. uni.previewImage({
  382. current: index,
  383. urls: typeArr,
  384. })
  385. },
  386. remove(index, type) {
  387. let content = '';
  388. if (type == 'video') {
  389. content = '是否删除该视频?'
  390. } else {
  391. content = '是否删除该图片?'
  392. }
  393. uni.showModal({
  394. title: '提示',
  395. content: content,
  396. success: (res) => {
  397. if (res.confirm) {
  398. if (type == 'video') {
  399. this.videoArr.splice(index, 1)
  400. } else if (type == 'gspsdcl') {
  401. this.imgGuanArr.splice(index, 1)
  402. } else if (type == 'ggyj') {
  403. this.imgArr.splice(index, 1)
  404. } else if (type == 'gdsgjl') {
  405. this.imgPipelineArr.slice(index, 1)
  406. }
  407. }
  408. }
  409. })
  410. },
  411. choose(e) {
  412. let _this = this;
  413. if (e == 'video') {
  414. this.choosevideo()
  415. } else {
  416. this.chooseimage(e)
  417. }
  418. },
  419. chooseimage(e) {
  420. let _this = this;
  421. uni.chooseImage({
  422. sizeType: ['album', 'camera'],
  423. success(resp) {
  424. resp.tempFiles.forEach((item, index) => {
  425. const task = uni.uploadFile({
  426. url: _this.$HTTP + `/obs`,
  427. filePath: item.path,
  428. name: 'file',
  429. formData: {},
  430. header: _this.headers,
  431. success: res => {
  432. // 判断是否json字符串,将其转为json格式
  433. let data = JSON.parse(res.data);
  434. if (![200].includes(data.code)) {
  435. _this.$modal.msg(data.msg)
  436. } else {
  437. if (_this.progress === 100) {
  438. if (e == 'ggyj') {
  439. _this.imgArr.push(data.data.url)
  440. } else if (e == 'gspsdcl') {
  441. _this.imgGuanArr.push(data.data.url)
  442. } else if (e == 'gdsgjl') {
  443. _this.imgPipelineArr.push(data.data.url)
  444. }
  445. _this.$modal.msg('上传成功!')
  446. }
  447. }
  448. },
  449. fail: e => {
  450. _this.$modal.msg('上传失败!')
  451. //_this.uploadError(index, e);
  452. },
  453. complete: res => {
  454. uni.hideLoading();
  455. _this.uploading = false;
  456. }
  457. });
  458. task.onProgressUpdate(res => {
  459. _this.progress = res.progress;
  460. uni.showLoading({
  461. title: '上传中'
  462. })
  463. if (_this.progress != 100) {
  464. _this.loading = false
  465. } else {
  466. _this.loading = true
  467. }
  468. });
  469. })
  470. },
  471. })
  472. },
  473. choosevideo() {
  474. let _this = this;
  475. uni.chooseVideo({
  476. sourceType: ['album', 'camera'],
  477. maxDuration: 30,
  478. success(resp) {
  479. const task = uni.uploadFile({
  480. url: _this.$HTTP + `/obs`,
  481. filePath: resp.tempFilePath,
  482. name: 'file',
  483. formData: {},
  484. header: _this.headers,
  485. success: res => {
  486. // 判断是否json字符串,将其转为json格式
  487. let data = JSON.parse(res.data);
  488. if (![200].includes(res.statusCode)) {
  489. this.uploadError(index, data);
  490. } else {
  491. //上传成功
  492. if (_this.progress === 100) {
  493. _this.videoArr.push(data.data.url)
  494. _this.$modal.msg('上传成功!')
  495. }
  496. }
  497. },
  498. fail: e => {
  499. _this.$modal.msg('上传失败!')
  500. this.uploadError(index, e);
  501. },
  502. complete: res => {
  503. uni.hideLoading();
  504. _this.uploading = false;
  505. }
  506. });
  507. task.onProgressUpdate(res => {
  508. _this.progress = res.progress;
  509. uni.showLoading({
  510. title: '上传中'
  511. })
  512. if (_this.progress != 100) {
  513. _this.loading = false
  514. } else {
  515. _this.loading = true
  516. }
  517. });
  518. },
  519. })
  520. },
  521. pickerShow(e, index) {
  522. this.SelectIndex = index;
  523. this.type = e; //赋值类型
  524. if (e == 'cz') { //材质
  525. this.open = true;
  526. getEnginMaterialQualityList("民用工程", this.objValue.enginType, this.objValue.enginClassification).then(
  527. response => {
  528. this.selectList = response.data;
  529. });
  530. } else if (e == 'gg') { //规格
  531. if (this.isEmpty(this.czggslList[index].cz.id)) {
  532. this.$modal.msg('请选择材质')
  533. // this.czggslList[index].cz = this.materialValue.id
  534. } else {
  535. this.open = true;
  536. this.selectList = this.materialList;
  537. }
  538. } else if (e == 'gczq') { //工程周期
  539. this.openDict = true;
  540. getDicts("engin_cycle").then(response => {
  541. this.dictOptions = response.data;
  542. });
  543. } else if (e == 'xzq') { //行政区
  544. if (this.isEmpty(this.projectValue.dictValue)) {
  545. this.$modal.msg('请选择工程周期')
  546. } else {
  547. this.openDict = true;
  548. getDicts("district").then(response => {
  549. this.dictOptions = response.data;
  550. });
  551. }
  552. //this.selectList = this.dictOptions;
  553. } else if (e == 'xq') { //小区
  554. if (this.isEmpty(this.XZQValue.dictValue)) {
  555. this.$modal.msg('请选择行政区')
  556. } else {
  557. this.open = true;
  558. this.selectList = this.XQList;
  559. }
  560. } else if (e == 'ld') { //楼栋
  561. if (this.isEmpty(this.XQValue.id)) {
  562. this.$modal.msg('请选择小区')
  563. } else {
  564. this.open = true;
  565. this.selectList = this.LDList;
  566. }
  567. }
  568. },
  569. changeSelectDict(item, index) {
  570. this.openDict = false;
  571. if (this.type == 'isok') {
  572. this.isOkValue = item
  573. } else if (this.type == 'gczq') {
  574. this.projectValue = item
  575. if (!this.isEmpty(this.XQValue.id)) {
  576. //房间选完 判断 工程周期 工程周期切换
  577. this.getStatus();
  578. }
  579. } else if (this.type == 'xzq') {
  580. this.XZQValue = item;
  581. //根据行政区id获取小区数据
  582. this.XQValue = ''; //重置小区数据
  583. this.LDValue = ''; //重置楼栋数据
  584. getAreaList(item.dictValue).then(res => {
  585. this.XQList = res.data;
  586. })
  587. }
  588. },
  589. changeSelect(item, index) {
  590. this.open = false;
  591. if (this.type == 'cz') {
  592. this.materialValue = item;
  593. this.specificationValue = ''; //重置规格
  594. this.czggslList[this.SelectIndex].gg.id = ''
  595. this.czggslList[this.SelectIndex].gg.name = ''
  596. //根据材质ID 获取规格数据
  597. getEnginSpecificationsList(item.id).then(res => {
  598. this.materialList = res.data
  599. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  600. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  601. })
  602. } else if (this.type == 'gg') {
  603. this.specificationValue = item;
  604. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  605. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  606. } else if (this.type == 'xq') {
  607. this.XQValue = item;
  608. if (!this.isEmpty(this.projectValue.dictValue)) {
  609. //小区选完 判断 工程周期
  610. this.getStatus();
  611. }
  612. //根据小区id 获取楼栋数据
  613. this.LDValue = ''; //重置楼栋数据
  614. this.DYValue = ''; //重置单元数据
  615. this.FJValue = ''; //重置房间数据
  616. getBuildingList(item.id).then(res => {
  617. this.LDList = res.data
  618. })
  619. } else if (this.type == 'ld') {
  620. this.LDValue = item;
  621. if (!this.isEmpty(this.projectValue.dictValue)) {
  622. //楼栋选完 判断 工程周期
  623. this.getStatus();
  624. }
  625. }
  626. },
  627. //关闭弹窗
  628. close(e) {
  629. this.open = false
  630. },
  631. //关闭弹窗
  632. closeDict(e) {
  633. this.openDict = false
  634. },
  635. getStatus() {
  636. let unitId = '';
  637. let houseId = '';
  638. let buildingId = '';
  639. if (this.isEmpty(this.LDValue.id)) {
  640. buildingId = '';
  641. } else {
  642. buildingId = this.LDValue.id
  643. }
  644. let param = {
  645. areaId: this.XQValue.id, // 小区id
  646. buildingId: buildingId, // 楼宇id
  647. unitId: unitId,
  648. houseId: houseId, //传空
  649. enginCycle: this.projectValue.dictValue, // 工程周期
  650. enginType: this.objValue.enginType, //写死 上一页面传过来的
  651. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  652. }
  653. getRoomProjectId(param).then(res => {
  654. if (res.code == '200') {
  655. if (res.data != null && res.data.zEngineeringNodeBoList != null) {
  656. res.data.zEngineeringNodeBoList.forEach((item, index) => {
  657. if (this.objValue.enginClassValue == item.type) {
  658. this.reviewStatus = item.reviewStatus;
  659. if (item.reviewStatus == '1')
  660. this.$modal.msg('当前工程已结束')
  661. }
  662. })
  663. } else {
  664. this.reviewStatus = '' //置空
  665. }
  666. } else {
  667. this.$modal.msg(res.msg)
  668. this.reviewStatus = '' //置空
  669. }
  670. })
  671. },
  672. //提交数据
  673. submit() {
  674. if (this.isEmpty(this.projectValue.dictValue)) {
  675. this.$modal.msg("请选择工程周期")
  676. return
  677. }
  678. if (this.isEmpty(this.XZQValue.dictValue)) {
  679. this.$modal.msg("请选择行政区")
  680. return
  681. }
  682. if (this.isEmpty(this.XQValue.id)) {
  683. this.$modal.msg("请选择小区")
  684. return
  685. }
  686. // else if (this.isEmpty(this.LDValue.id)) {
  687. // this.$modal.msg("请选择楼栋")
  688. // }
  689. try {
  690. this.czggslList.forEach((list) => {
  691. if (this.isEmpty(list.cz.id)) {
  692. this.$modal.msg('材质不能为空')
  693. throw new Error('End Loop')
  694. }
  695. if (this.isEmpty(list.gg.id)) {
  696. this.$modal.msg('规格不能为空')
  697. throw new Error('End Loop')
  698. }
  699. // if (this.isEmpty(list.sl)) {
  700. // this.$modal.msg('数量不能为空')
  701. // throw new Error('End Loop')
  702. // }
  703. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  704. this.$modal.msg("请输入米数")
  705. throw new Error('End Loop')
  706. }
  707. })
  708. } catch (e) {
  709. if (e.message === 'End Loop') throw e
  710. }
  711. this.zEngineeringMaterialBo = [];
  712. this.czggslList.forEach((list) => {
  713. this.zEngineeringMaterialBo.push({
  714. materialQuality: list.cz.id,
  715. specifications: list.gg.id,
  716. number: list.sl.inputIntegerNumberValue + (list.sl.inputDecimalNumberValue == '' ?
  717. '' : "." + list.sl.inputDecimalNumberValue)
  718. })
  719. })
  720. if (this.imgGuanArr.length <= 0) {
  721. this.$modal.msg('请上传管上皮深度测量照片')
  722. return
  723. }
  724. if (this.imgArr.length <= 0) {
  725. this.$modal.msg('请上传管沟远景照片')
  726. return
  727. }
  728. if (this.videoArr.length <= 0) {
  729. this.$modal.msg('请上传视频')
  730. return
  731. }
  732. if (this.loading == false) {
  733. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  734. return
  735. }
  736. //提交
  737. this.onsubmit();
  738. },
  739. onsubmit() {
  740. let unitId = '';
  741. let houseId = '';
  742. let buildingId = '';
  743. if (this.isEmpty(this.LDValue.id)) {
  744. buildingId = '';
  745. } else {
  746. buildingId = this.LDValue.id
  747. }
  748. //提交
  749. let param = {
  750. district: this.XZQValue.dictValue,
  751. areaId: this.XQValue.id,
  752. buildingId: buildingId, //不必传 如果没有传 ' '
  753. unitId: unitId,
  754. houseId: houseId, //传空
  755. enginType: this.objValue.enginType, //写死 上一页面传过来的
  756. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  757. enginCycle: this.projectValue.dictValue, //工程周期
  758. zEngineeringNodeBo: {
  759. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  760. zEngineeringInfoBo: {
  761. ductalEpithelium: this.imgGuanArr, //照片集合
  762. trenchProspect: this.imgArr,
  763. video: this.videoArr,
  764. constructTime: this.time, //施工时间
  765. remark: this.projectContent, //施工内容
  766. zEngineeringMaterialBo: this.zEngineeringMaterialBo
  767. }
  768. }
  769. }
  770. uni.showLoading()
  771. addTearOldPipe(param).then(res => {
  772. if (res.code == '200') {
  773. uni.hideLoading()
  774. uni.showToast({
  775. title: res.msg,
  776. icon: 'none',
  777. //显示持续时间为 3秒
  778. duration: 2000
  779. });
  780. setTimeout(function() {
  781. uni.navigateBack();
  782. }, 1000)
  783. }
  784. })
  785. },
  786. history() {
  787. if (this.isEmpty(this.projectValue.dictValue)) {
  788. this.$modal.msg("请选择工程周期")
  789. return
  790. }
  791. if (this.isEmpty(this.XZQValue.dictValue)) {
  792. this.$modal.msg("请选择行政区")
  793. return
  794. }
  795. if (this.isEmpty(this.XQValue.id)) {
  796. this.$modal.msg("请选择小区")
  797. return
  798. }
  799. let unitId = '';
  800. let houseId = '';
  801. let buildingId = '';
  802. if (this.isEmpty(this.LDValue.id)) {
  803. buildingId = '';
  804. } else {
  805. buildingId = this.LDValue.id
  806. }
  807. let param = {
  808. areaId: this.XQValue.id, // 小区id
  809. buildingId: buildingId, // 楼宇id
  810. enginCycle: this.projectValue.dictValue, // 工程周期
  811. unitId: unitId,
  812. houseId: houseId, //传空
  813. enginType: this.objValue.enginType, //写死 上一页面传过来的
  814. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  815. }
  816. getRoomProjectId(param).then(res => {
  817. if (res.code == '200') {
  818. if (res.data != null) {
  819. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  820. res => {
  821. this.historyList = res.data
  822. if (res.data.zEngineeringNodeBo != null) {
  823. this.showHistoryList();
  824. } else {
  825. this.$modal.msg("暂无历史信息")
  826. }
  827. })
  828. } else {
  829. this.$modal.msg("暂无工程信息")
  830. }
  831. } else {
  832. this.$modal.msg(res.msg)
  833. }
  834. })
  835. },
  836. showHistoryList() {
  837. this.$refs.refShare.handleShowShare();
  838. }
  839. }
  840. }
  841. </script>
  842. <style lang="scss">
  843. .container {
  844. display: flex;
  845. align-items: center;
  846. justify-content: space-between;
  847. padding: 10px;
  848. position: relative;
  849. }
  850. .uni-list {
  851. border: 1xp solid #eee;
  852. }
  853. .to-right-icon {
  854. width: 15px;
  855. height: 15px;
  856. position: absolute;
  857. top: 50%;
  858. transform: translateY(-50%);
  859. }
  860. .text {
  861. font-size: 16px;
  862. color: #333;
  863. }
  864. .background {
  865. // border: 15px solid hsla(0, 0%, 100%, .5);
  866. background: white;
  867. background-clip: padding-box;
  868. padding: 20rpx;
  869. border-radius: 20rpx;
  870. margin: 20rpx;
  871. /*从padding开始往外面裁剪背景*/
  872. }
  873. .btn {
  874. width: 715rpx;
  875. height: 69rpx;
  876. background: #79A4F0;
  877. border-radius: 6rpx;
  878. font-size: 25rpx;
  879. font-family: Microsoft YaHei;
  880. font-weight: 400;
  881. color: #FFFFFF;
  882. line-height: 69rpx;
  883. margin-top: 40rpx;
  884. margin-bottom: 100rpx;
  885. }
  886. .number {
  887. display: flex;
  888. /* 水平居中显示子元素 */
  889. align-items: flex-start;
  890. /* 垂直居中显示子元素 */
  891. justify-content: space-between;
  892. /* 左右间距等于间距大小 */
  893. padding: 10px;
  894. /* 设置padding以提高视觉效果 */
  895. }
  896. .textarea {
  897. margin-top: 10upx;
  898. width: 100%;
  899. border: 1rpx solid red;
  900. min-height: 100upx;
  901. line-height: 20px;
  902. }
  903. .tj-btn {
  904. height: 69rpx;
  905. background: #3184f0;
  906. border-radius: 6rpx;
  907. font-size: 25rpx;
  908. font-weight: 400;
  909. color: #FFFFFF;
  910. line-height: 69rpx;
  911. margin: 40rpx 70rpx;
  912. }
  913. .sc-btn {
  914. height: 69rpx;
  915. background: #f0686b;
  916. border-radius: 6rpx;
  917. font-size: 25rpx;
  918. font-weight: 400;
  919. color: #FFFFFF;
  920. line-height: 69rpx;
  921. margin: 40rpx;
  922. }
  923. .num-style {
  924. background: #e8f4f9;
  925. margin: 20rpx;
  926. padding: 10rpx;
  927. border-radius: 20rpx;
  928. border: 1px solid #d4e3f0;
  929. }
  930. </style>