newcourtyard.vue 29 KB

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