courtyard.vue 29 KB

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