courtyard.vue 28 KB

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