courtyard.vue 31 KB

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