newoverhead.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  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: 60,
  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. getAreaList(this.XZQValue.dictValue).then(res => {
  489. this.XQList = res.data;
  490. this.selectList = this.XQList;
  491. this.open = true;
  492. })
  493. }
  494. } else if (e == 'ld') { //楼栋
  495. if (this.isEmpty(this.XQValue.id)) {
  496. this.$modal.msg('请选择小区')
  497. } else {
  498. getBuildingList(this.XQValue.id).then(res => {
  499. this.LDList = res.data
  500. this.selectList = this.LDList;
  501. this.open = true;
  502. })
  503. }
  504. } else if (e == 'dy') { //单元
  505. if (this.isEmpty(this.LDValue.id)) {
  506. this.$modal.msg('请选择楼栋')
  507. } else {
  508. getUnitList(this.LDValue.id).then(res => {
  509. this.DYList = res.data
  510. this.selectList = this.DYList;
  511. this.open = true;
  512. })
  513. }
  514. }
  515. },
  516. changeSelectDict(item, index) {
  517. this.openDict = false;
  518. if (this.type == 'isok') {
  519. this.isOkValue = item
  520. } else if (this.type == 'gczq') {
  521. this.projectValue = item
  522. if (!this.isEmpty(this.LDValue.id)) {
  523. // 工程周期切换
  524. this.getStatus();
  525. }
  526. } else if (this.type == 'xzq') {
  527. this.XZQValue = item;
  528. //根据行政区id获取小区数据
  529. this.XQValue = ''; //重置小区数据
  530. this.LDValue = ''; //重置楼栋数据
  531. this.DYValue = ''; //重置单元数据
  532. }
  533. },
  534. changeSelect(item, index) {
  535. // this.index = index;
  536. // this.address = item.communityName;
  537. this.open = false;
  538. if (this.type == 'cz') {
  539. this.materialValue = item;
  540. this.specificationValue = ''; //重置规格
  541. this.czggslList[this.SelectIndex].gg.id = ''
  542. this.czggslList[this.SelectIndex].gg.name = ''
  543. //根据材质ID 获取规格数据
  544. getEnginSpecificationsList(item.id).then(res => {
  545. this.materialList = res.data
  546. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  547. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  548. })
  549. } else if (this.type == 'gg') {
  550. this.specificationValue = item;
  551. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  552. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  553. } else if (this.type == 'xq') {
  554. this.XZQValue = {
  555. dictValue: item.district,
  556. dictLabel: item.districtName
  557. };
  558. this.XQValue = item;
  559. //根据小区id 获取楼栋数据
  560. this.LDValue = ''; //重置楼栋数据
  561. this.DYValue = ''; //重置单元数据
  562. this.FJValue = ''; //重置房间数据
  563. } else if (this.type == 'ld') {
  564. this.LDValue = item;
  565. if (!this.isEmpty(this.projectValue.dictValue)) {
  566. this.getStatus();
  567. }
  568. //根据楼栋ID 获取单元数据
  569. this.DYValue = ''; //重置单元数据
  570. this.FJValue = ''; //重置房间数据
  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. if (e == 'submit') {
  640. try {
  641. this.czggslList.forEach((list) => {
  642. if (this.isEmpty(list.cz.id)) {
  643. this.$modal.msg('材质不能为空')
  644. throw new Error('End Loop')
  645. }
  646. if (this.isEmpty(list.gg.id)) {
  647. this.$modal.msg('规格不能为空')
  648. throw new Error('End Loop')
  649. }
  650. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  651. this.$modal.msg("请输入米数")
  652. throw new Error('End Loop')
  653. }
  654. })
  655. } catch (e) {
  656. if (e.message === 'End Loop') throw e
  657. }
  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. if (numStr != null && numStr != undefined && numStr != '') {
  855. return numStr.toString().split('.')[i] == undefined ? '0' : numStr.toString().split('.')[i];
  856. }
  857. },
  858. showHistoryList() {
  859. this.$refs.refShare.handleShowShare();
  860. }
  861. }
  862. }
  863. </script>
  864. <style lang="scss">
  865. .container {
  866. display: flex;
  867. align-items: center;
  868. justify-content: space-between;
  869. padding: 10px;
  870. position: relative;
  871. }
  872. .uni-list {
  873. border: 1xp solid #eee;
  874. }
  875. .to-right-icon {
  876. width: 15px;
  877. height: 15px;
  878. position: absolute;
  879. top: 50%;
  880. transform: translateY(-50%);
  881. }
  882. .text {
  883. font-size: 16px;
  884. color: #333;
  885. }
  886. .background {
  887. // border: 15px solid hsla(0, 0%, 100%, .5);
  888. background: white;
  889. background-clip: padding-box;
  890. padding: 20rpx;
  891. border-radius: 20rpx;
  892. margin: 20rpx;
  893. /*从padding开始往外面裁剪背景*/
  894. }
  895. .btn {
  896. width: 715rpx;
  897. height: 69rpx;
  898. background: #79A4F0;
  899. border-radius: 6rpx;
  900. font-size: 25rpx;
  901. font-family: Microsoft YaHei;
  902. font-weight: 400;
  903. color: #FFFFFF;
  904. line-height: 69rpx;
  905. margin-top: 40rpx;
  906. margin-bottom: 100rpx;
  907. }
  908. .number {
  909. display: flex;
  910. /* 水平居中显示子元素 */
  911. align-items: flex-start;
  912. /* 垂直居中显示子元素 */
  913. justify-content: space-between;
  914. /* 左右间距等于间距大小 */
  915. padding: 10px;
  916. /* 设置padding以提高视觉效果 */
  917. }
  918. .textarea {
  919. margin-top: 10upx;
  920. width: 100%;
  921. border: 1rpx solid red;
  922. min-height: 100upx;
  923. line-height: 20px;
  924. }
  925. .tj-btn {
  926. height: 69rpx;
  927. background: #3184f0;
  928. border-radius: 6rpx;
  929. font-size: 25rpx;
  930. font-weight: 400;
  931. color: #FFFFFF;
  932. line-height: 69rpx;
  933. margin: 40rpx 70rpx;
  934. }
  935. .sc-btn {
  936. height: 69rpx;
  937. background: #f0686b;
  938. border-radius: 6rpx;
  939. font-size: 25rpx;
  940. font-weight: 400;
  941. color: #FFFFFF;
  942. line-height: 69rpx;
  943. margin: 40rpx;
  944. }
  945. .num-style {
  946. background: #e8f4f9;
  947. margin: 20rpx;
  948. padding: 10rpx;
  949. border-radius: 20rpx;
  950. border: 1px solid #d4e3f0;
  951. }
  952. </style>