newcourtyard.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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. if (res.tapIndex == 0) {
  385. this.chooseimage(e)
  386. } else {
  387. this.choosevideo(e)
  388. }
  389. }
  390. })
  391. },
  392. chooseimage(e) {
  393. let _this = this;
  394. uni.chooseImage({
  395. sizeType: ['album', 'camera'],
  396. success(resp) {
  397. resp.tempFiles.forEach((item, index) => {
  398. const task = uni.uploadFile({
  399. url: _this.$HTTP + `/obs`,
  400. filePath: item.path,
  401. name: 'file',
  402. formData: {},
  403. header: _this.headers,
  404. success: res => {
  405. // 判断是否json字符串,将其转为json格式
  406. // let data = _this.$u.test.jsonString(res
  407. // .data) ? JSON.parse(res.data) : res.data;
  408. let data = JSON.parse(res.data);
  409. if (![200].includes(data.code)) {
  410. // this.uploadError(index, data);
  411. _this.$modal.msg(data.msg)
  412. } else {
  413. if (_this.progress === 100) {
  414. if (e == 'other') {
  415. _this.imgArr.push(data.data.url)
  416. } else if (e == 'sfht') {
  417. _this.stonePowderArr.push(data.data.url)
  418. } else if (e == 'jsdps') {
  419. _this.warningtTapeArr.push(data.data.url)
  420. } else if (e == 'hth') {
  421. _this.photosAfterArr.push(data.data.url)
  422. }
  423. _this.$modal.msg('上传成功!')
  424. _this.photo = false;
  425. }
  426. }
  427. },
  428. fail: e => {
  429. _this.$modal.msg('上传失败!')
  430. //_this.uploadError(index, e);
  431. },
  432. complete: res => {
  433. uni.hideLoading();
  434. _this.uploading = false;
  435. }
  436. });
  437. task.onProgressUpdate(res => {
  438. _this.progress = res.progress;
  439. uni.showLoading({
  440. title: '上传中'
  441. })
  442. if (_this.progress != 100) {
  443. _this.loading = false
  444. } else {
  445. _this.loading = true
  446. }
  447. });
  448. })
  449. },
  450. })
  451. },
  452. choosevideo(e) {
  453. let _this = this;
  454. uni.chooseVideo({
  455. sourceType: ['album', 'camera'],
  456. maxDuration: 30,
  457. success(resp) {
  458. const task = uni.uploadFile({
  459. url: _this.$HTTP + `/obs`,
  460. filePath: resp.tempFilePath,
  461. name: 'file',
  462. formData: {},
  463. header: _this.headers,
  464. success: res => {
  465. // 判断是否json字符串,将其转为json格式
  466. let data = JSON.parse(res.data);
  467. if (![200].includes(res.statusCode)) {
  468. this.uploadError(index, data);
  469. } else {
  470. //上传成功
  471. if (_this.progress === 100) {
  472. if (e == 'other') {
  473. _this.imgArr.push(data.data.url)
  474. } else if (e == 'sfht') {
  475. _this.stonePowderArr.push(data.data.url)
  476. } else if (e == 'jsdps') {
  477. _this.warningtTapeArr.push(data.data.url)
  478. } else if (e == 'hth') {
  479. _this.photosAfterArr.push(data.data.url)
  480. }
  481. _this.$modal.msg('上传成功!')
  482. _this.photo = false;
  483. }
  484. }
  485. },
  486. fail: e => {
  487. _this.$modal.msg('上传失败!')
  488. this.uploadError(index, e);
  489. },
  490. complete: res => {
  491. uni.hideLoading();
  492. _this.uploading = false;
  493. }
  494. });
  495. task.onProgressUpdate(res => {
  496. _this.progress = res.progress;
  497. uni.showLoading({
  498. title: '上传中'
  499. })
  500. if (_this.progress != 100) {
  501. _this.loading = false
  502. } else {
  503. _this.loading = true
  504. }
  505. });
  506. },
  507. })
  508. },
  509. pickerShow(e) {
  510. this.type = e; //赋值类型
  511. if (e == 'cz') { //材质
  512. this.open = true;
  513. getEnginMaterialQualityList("民用工程", this.objValue.enginType, this.objValue.enginClassification, this
  514. .objValue.enginClassValue).then(
  515. response => {
  516. this.selectList = response.data;
  517. });
  518. } else if (e == 'gg') { //规格
  519. if (this.isEmpty(this.materialValue.id)) {
  520. this.$modal.msg('请选择材质')
  521. } else {
  522. this.open = true;
  523. this.selectList = this.materialList;
  524. }
  525. } else if (e == 'gczq') { //工程周期
  526. this.openDict = true;
  527. getDicts("engin_cycle").then(response => {
  528. this.dictOptions = response.data;
  529. });
  530. } else if (e == 'xzq') { //行政区
  531. if (this.isEmpty(this.projectValue.dictValue)) {
  532. this.$modal.msg('请选择工程周期')
  533. } else {
  534. this.openDict = true;
  535. getDicts("district").then(response => {
  536. this.dictOptions = response.data;
  537. });
  538. }
  539. //this.selectList = this.dictOptions;
  540. } else if (e == 'xq') { //小区
  541. if (this.isEmpty(this.XZQValue.dictValue)) {
  542. getAreaList('').then(res => {
  543. this.XQList = res.data;
  544. this.open = true;
  545. this.selectList = this.XQList;
  546. })
  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. }
  559. },
  560. changeSelectDict(item, index) {
  561. this.openDict = false;
  562. if (this.type == 'isok') {
  563. this.isOkValue = item
  564. } else if (this.type == 'gczq') {
  565. this.projectValue = item
  566. if (!this.isEmpty(this.XQValue.id)) {
  567. //房间选完 判断 工程周期 工程周期切换
  568. this.getStatus();
  569. }
  570. } else if (this.type == 'xzq') {
  571. this.XZQValue = item;
  572. //根据行政区id获取小区数据
  573. this.XQValue = ''; //重置小区数据
  574. this.LDValue = ''; //重置楼栋数据
  575. getAreaList(item.dictValue).then(res => {
  576. this.XQList = res.data;
  577. })
  578. }
  579. },
  580. changeSelect(item, index) {
  581. // this.index = index;
  582. // this.address = item.communityName;
  583. this.open = false;
  584. if (this.type == 'cz') {
  585. this.materialValue = item;
  586. this.specificationValue = ''; //重置规格
  587. //根据材质ID 获取规格数据
  588. getEnginSpecificationsList(item.id).then(res => {
  589. this.materialList = res.data
  590. })
  591. } else if (this.type == 'gg') {
  592. this.specificationValue = item;
  593. } else if (this.type == 'xq') {
  594. this.XZQValue = {
  595. dictValue: item.district,
  596. dictLabel: item.districtName
  597. };
  598. this.XQValue = item;
  599. if (!this.isEmpty(this.projectValue.dictValue)) {
  600. //小区选完 判断 工程周期
  601. this.getStatus();
  602. }
  603. //根据小区id 获取楼栋数据
  604. this.LDValue = ''; //重置楼栋数据
  605. this.DYValue = ''; //重置单元数据
  606. this.FJValue = ''; //重置房间数据
  607. getBuildingList(item.id).then(res => {
  608. this.LDList = res.data
  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. uni.showLoading()
  738. addTearOldPipe(param).then(res => {
  739. if (res.code == '200') {
  740. uni.hideLoading()
  741. uni.showToast({
  742. title: res.msg,
  743. icon: 'none',
  744. //显示持续时间为 3秒
  745. duration: 2000
  746. });
  747. setTimeout(function() {
  748. uni.navigateBack();
  749. }, 1000)
  750. }
  751. })
  752. },
  753. history() {
  754. if (this.isEmpty(this.projectValue.dictValue)) {
  755. this.$modal.msg("请选择工程周期")
  756. return
  757. }
  758. if (this.isEmpty(this.XZQValue.dictValue)) {
  759. this.$modal.msg("请选择行政区")
  760. return
  761. }
  762. if (this.isEmpty(this.XQValue.id)) {
  763. this.$modal.msg("请选择小区")
  764. return
  765. }
  766. let unitId = '';
  767. let houseId = '';
  768. let buildingId = '';
  769. if (this.isEmpty(this.LDValue.id)) {
  770. buildingId = '';
  771. } else {
  772. buildingId = this.LDValue.id
  773. }
  774. let param = {
  775. areaId: this.XQValue.id, // 小区id
  776. buildingId: buildingId, // 楼宇id
  777. enginCycle: this.projectValue.dictValue, // 工程周期
  778. unitId: unitId,
  779. houseId: houseId, //传空
  780. enginType: this.objValue.enginType, //写死 上一页面传过来的
  781. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  782. }
  783. getRoomProjectId(param).then(res => {
  784. if (res.code == '200') {
  785. if (res.data != null) {
  786. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  787. res => {
  788. this.historyList = res.data
  789. if (res.data.zEngineeringNodeBo != null) {
  790. this.showHistoryList();
  791. } else {
  792. this.$modal.msg("暂无历史信息")
  793. }
  794. })
  795. } else {
  796. this.$modal.msg("暂无工程信息")
  797. }
  798. } else {
  799. this.$modal.msg(res.msg)
  800. }
  801. })
  802. },
  803. showHistoryList() {
  804. this.$refs.refShare.handleShowShare();
  805. }
  806. }
  807. }
  808. </script>
  809. <style lang="scss">
  810. .container {
  811. display: flex;
  812. align-items: center;
  813. justify-content: space-between;
  814. padding: 10px;
  815. position: relative;
  816. }
  817. .uni-list {
  818. border: 1xp solid #eee;
  819. }
  820. .to-right-icon {
  821. width: 15px;
  822. height: 15px;
  823. position: absolute;
  824. top: 50%;
  825. transform: translateY(-50%);
  826. }
  827. .text {
  828. font-size: 16px;
  829. color: #333;
  830. }
  831. .background {
  832. // border: 15px solid hsla(0, 0%, 100%, .5);
  833. background: white;
  834. background-clip: padding-box;
  835. padding: 20rpx;
  836. border-radius: 20rpx;
  837. margin: 20rpx;
  838. /*从padding开始往外面裁剪背景*/
  839. }
  840. .btn {
  841. width: 715rpx;
  842. height: 69rpx;
  843. background: #79A4F0;
  844. border-radius: 6rpx;
  845. font-size: 25rpx;
  846. font-family: Microsoft YaHei;
  847. font-weight: 400;
  848. color: #FFFFFF;
  849. line-height: 69rpx;
  850. margin-top: 40rpx;
  851. margin-bottom: 100rpx;
  852. }
  853. .number {
  854. display: flex;
  855. /* 水平居中显示子元素 */
  856. align-items: flex-start;
  857. /* 垂直居中显示子元素 */
  858. justify-content: space-between;
  859. /* 左右间距等于间距大小 */
  860. padding: 10px;
  861. /* 设置padding以提高视觉效果 */
  862. }
  863. .textarea {
  864. margin-top: 10upx;
  865. width: 100%;
  866. border: 1rpx solid red;
  867. min-height: 100upx;
  868. line-height: 20px;
  869. }
  870. </style>