newoverhead.vue 31 KB

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