courtyard.vue 31 KB

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