overhead.vue 29 KB

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