courtyard.vue 29 KB

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