courtyard.vue 29 KB

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