courtyard.vue 34 KB

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