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