surge_tank.vue 30 KB

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