courtyard.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  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. getAreaList('').then(res => {
  533. this.XQList = res.data;
  534. this.open = true;
  535. this.selectList = this.XQList;
  536. })
  537. } else {
  538. getAreaList(this.XZQValue.dictValue).then(res => {
  539. this.XQList = res.data;
  540. this.selectList = this.XQList;
  541. this.open = true;
  542. })
  543. }
  544. } else if (e == 'ld') { //楼栋
  545. if (this.isEmpty(this.XQValue.id)) {
  546. this.$modal.msg('请选择小区')
  547. } else {
  548. getBuildingList(this.XQValue.id).then(res => {
  549. this.LDList = res.data
  550. this.selectList = this.LDList;
  551. this.open = true;
  552. })
  553. }
  554. }
  555. },
  556. changeSelectDict(item, index) {
  557. this.openDict = false;
  558. if (this.type == 'isok') {
  559. this.isOkValue = item
  560. } else if (this.type == 'gczq') {
  561. this.projectValue = item
  562. if (!this.isEmpty(this.XQValue.id)) {
  563. //房间选完 判断 工程周期 工程周期切换
  564. this.getStatus();
  565. }
  566. } else if (this.type == 'xzq') {
  567. this.XZQValue = item;
  568. //根据行政区id获取小区数据
  569. this.XQValue = ''; //重置小区数据
  570. this.LDValue = ''; //重置楼栋数据
  571. }
  572. },
  573. changeSelect(item, index) {
  574. this.open = false;
  575. if (this.type == 'cz') {
  576. this.materialValue = item;
  577. this.specificationValue = ''; //重置规格
  578. this.czggslList[this.SelectIndex].gg.id = ''
  579. this.czggslList[this.SelectIndex].gg.name = ''
  580. //根据材质ID 获取规格数据
  581. getEnginSpecificationsList(item.id).then(res => {
  582. this.materialList = res.data
  583. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  584. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  585. })
  586. } else if (this.type == 'gg') {
  587. this.specificationValue = item;
  588. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  589. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  590. } else if (this.type == 'xq') {
  591. this.XZQValue = {
  592. dictValue: item.district,
  593. dictLabel: item.districtName
  594. };
  595. this.XQValue = item;
  596. if (!this.isEmpty(this.projectValue.dictValue)) {
  597. //小区选完 判断 工程周期
  598. this.getStatus();
  599. }
  600. //根据小区id 获取楼栋数据
  601. this.LDValue = ''; //重置楼栋数据
  602. this.DYValue = ''; //重置单元数据
  603. this.FJValue = ''; //重置房间数据
  604. } else if (this.type == 'ld') {
  605. this.LDValue = item;
  606. if (!this.isEmpty(this.projectValue.dictValue)) {
  607. //楼栋选完 判断 工程周期
  608. this.getStatus();
  609. }
  610. }
  611. },
  612. //关闭弹窗
  613. close(e) {
  614. this.open = false
  615. },
  616. //关闭弹窗
  617. closeDict(e) {
  618. this.openDict = false
  619. },
  620. getStatus() {
  621. let unitId = '';
  622. let houseId = '';
  623. let buildingId = '';
  624. if (this.isEmpty(this.LDValue.id)) {
  625. buildingId = '';
  626. } else {
  627. buildingId = this.LDValue.id
  628. }
  629. let param = {
  630. areaId: this.XQValue.id, // 小区id
  631. buildingId: buildingId, // 楼宇id
  632. unitId: unitId,
  633. houseId: houseId, //传空
  634. enginCycle: this.projectValue.dictValue, // 工程周期
  635. enginType: this.objValue.enginType, //写死 上一页面传过来的
  636. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  637. }
  638. getRoomProjectId(param).then(res => {
  639. if (res.code == '200') {
  640. if (res.data != null && res.data.zEngineeringNodeBoList != null) {
  641. res.data.zEngineeringNodeBoList.forEach((item, index) => {
  642. if (this.objValue.enginClassValue == item.type) {
  643. this.reviewStatus = item.reviewStatus;
  644. if (item.reviewStatus == '1')
  645. this.$modal.msg('当前工程已结束')
  646. }
  647. })
  648. } else {
  649. this.reviewStatus = '' //置空
  650. }
  651. } else {
  652. this.$modal.msg(res.msg)
  653. this.reviewStatus = '' //置空
  654. }
  655. })
  656. },
  657. //提交数据
  658. submit(e) {
  659. this.tempState = e == 'submit' ? '' : '99'
  660. if (this.isEmpty(this.projectValue.dictValue)) {
  661. this.$modal.msg("请选择工程周期")
  662. return
  663. }
  664. if (this.isEmpty(this.XZQValue.dictValue)) {
  665. this.$modal.msg("请选择行政区")
  666. return
  667. }
  668. if (this.isEmpty(this.XQValue.id)) {
  669. this.$modal.msg("请选择小区")
  670. return
  671. }
  672. // else if (this.isEmpty(this.LDValue.id)) {
  673. // this.$modal.msg("请选择楼栋")
  674. // }
  675. if (e == 'submit') {
  676. try {
  677. this.czggslList.forEach((list) => {
  678. if (this.isEmpty(list.cz.id)) {
  679. this.$modal.msg('材质不能为空')
  680. throw new Error('End Loop')
  681. }
  682. if (this.isEmpty(list.gg.id)) {
  683. this.$modal.msg('规格不能为空')
  684. throw new Error('End Loop')
  685. }
  686. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  687. this.$modal.msg("请输入米数")
  688. throw new Error('End Loop')
  689. }
  690. })
  691. } catch (e) {
  692. if (e.message === 'End Loop') throw e
  693. }
  694. }
  695. this.zEngineeringMaterialBo = [];
  696. this.czggslList.forEach((list) => {
  697. this.zEngineeringMaterialBo.push({
  698. materialQuality: list.cz.id,
  699. specifications: list.gg.id,
  700. number: list.sl.inputIntegerNumberValue + (list.sl.inputDecimalNumberValue == '' ?
  701. '' : "." + list.sl.inputDecimalNumberValue)
  702. })
  703. })
  704. console.log("====", this.zEngineeringMaterialBo)
  705. // if (this.imgPipelineArr.length <= 0) {
  706. // this.$modal.msg('请上传管道施工记录照片')
  707. // return
  708. // }
  709. if (e == 'submit') {
  710. if (this.imgGuanArr.length <= 0) {
  711. this.$modal.msg('请上传管上皮深度测量照片')
  712. return
  713. }
  714. if (this.imgArr.length <= 0) {
  715. this.$modal.msg('请上传管沟远景照片')
  716. return
  717. }
  718. if (this.videoArr.length <= 0) {
  719. this.$modal.msg('请上传视频')
  720. return
  721. }
  722. }
  723. // if (this.loading == false) {
  724. // this.$modal.msg('照片或视频未上传完毕,无法提交!')
  725. // return
  726. // }
  727. //提交
  728. this.onsubmit();
  729. },
  730. onsubmit() {
  731. let unitId = '';
  732. let houseId = '';
  733. let buildingId = '';
  734. if (this.isEmpty(this.LDValue.id)) {
  735. buildingId = '';
  736. } else {
  737. buildingId = this.LDValue.id
  738. }
  739. //提交
  740. let param = {
  741. district: this.XZQValue.dictValue,
  742. areaId: this.XQValue.id,
  743. buildingId: buildingId, //不必传 如果没有传 ' '
  744. unitId: unitId,
  745. houseId: houseId, //传空
  746. enginType: this.objValue.enginType, //写死 上一页面传过来的
  747. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  748. enginCycle: this.projectValue.dictValue, //工程周期
  749. zEngineeringNodeBo: {
  750. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  751. zEngineeringInfoBo: {
  752. state: this.tempState,
  753. ductalEpithelium: this.imgGuanArr, //照片集合
  754. //constructionRecords: this.imgPipelineArr,
  755. trenchProspect: this.imgArr,
  756. video: this.videoArr,
  757. constructTime: this.time, //施工时间
  758. remark: this.projectContent, //施工内容
  759. zEngineeringMaterialBo: this.zEngineeringMaterialBo
  760. }
  761. }
  762. }
  763. uni.showLoading()
  764. addTearOldPipe(param).then(res => {
  765. if (res.code == '200') {
  766. uni.hideLoading()
  767. uni.showToast({
  768. title: res.msg,
  769. icon: 'none',
  770. //显示持续时间为 3秒
  771. duration: 2000
  772. });
  773. setTimeout(function() {
  774. uni.navigateBack();
  775. }, 1000)
  776. }
  777. })
  778. },
  779. history() {
  780. this.projectContent = '';
  781. this.imgGuanArr = [];
  782. this.imgArr = [];
  783. this.videoArr = [];
  784. this.zEngineeringMaterialBo = [];
  785. this.czggslList = [];
  786. if (this.isEmpty(this.projectValue.dictValue)) {
  787. this.$modal.msg("请选择工程周期")
  788. return
  789. }
  790. if (this.isEmpty(this.XZQValue.dictValue)) {
  791. this.$modal.msg("请选择行政区")
  792. return
  793. }
  794. if (this.isEmpty(this.XQValue.id)) {
  795. this.$modal.msg("请选择小区")
  796. return
  797. }
  798. let unitId = '';
  799. let houseId = '';
  800. let buildingId = '';
  801. if (this.isEmpty(this.LDValue.id)) {
  802. buildingId = '';
  803. } else {
  804. buildingId = this.LDValue.id
  805. }
  806. let param = {
  807. areaId: this.XQValue.id, // 小区id
  808. buildingId: buildingId, // 楼宇id
  809. enginCycle: this.projectValue.dictValue, // 工程周期
  810. unitId: unitId,
  811. houseId: houseId, //传空
  812. enginType: this.objValue.enginType, //写死 上一页面传过来的
  813. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  814. }
  815. getRoomProjectId(param).then(res => {
  816. if (res.code == '200') {
  817. if (res.data != null) {
  818. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  819. res => {
  820. this.historyList = res.data
  821. if (res.data.zEngineeringNodeBo != null) {
  822. //this.showHistoryList();
  823. if (res.data.zEngineeringNodeBo.reviewStatus == '1') {
  824. this.$modal.msg("当前步骤以审核通过请谨慎!")
  825. } else if (res.data.zEngineeringNodeBo.reviewStatus == '99') {
  826. let dataJson = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0];
  827. this.projectContent = dataJson.remark;
  828. this.time = dataJson.constructTime;
  829. this.imgGuanArr = dataJson.ductalEpithelium;
  830. this.imgArr = dataJson.trenchProspect;
  831. this.videoArr = dataJson.video;
  832. this.zEngineeringMaterialBo = dataJson.zEngineeringMaterialBo;
  833. this.zEngineeringMaterialBo.forEach((item) => {
  834. this.czggslList.push({
  835. cz: {
  836. id: item.materialQuality,
  837. name: item.materialQualityName
  838. },
  839. gg: {
  840. id: item.specifications,
  841. name: item.specificationsName
  842. },
  843. sl: {
  844. inputIntegerNumberValue: this.isEmpty(item.number) ? '' : this.getIntegerPart(item.number, 0),
  845. inputDecimalNumberValue: this.isEmpty(item.number) ? '' : this.getIntegerPart(item.number, 1)
  846. }
  847. })
  848. })
  849. } else {
  850. this.czggslList.push({
  851. cz: {
  852. id: '',
  853. name: ''
  854. },
  855. gg: {
  856. id: '',
  857. name: ''
  858. },
  859. sl: {
  860. inputIntegerNumberValue: '',
  861. inputDecimalNumberValue: ''
  862. }
  863. });
  864. this.$modal.msg("暂无暂存信息")
  865. }
  866. } else {
  867. this.$modal.msg("暂无历史信息")
  868. this.czggslList.push({
  869. cz: {
  870. id: '',
  871. name: ''
  872. },
  873. gg: {
  874. id: '',
  875. name: ''
  876. },
  877. sl: {
  878. inputIntegerNumberValue: '',
  879. inputDecimalNumberValue: ''
  880. }
  881. });
  882. }
  883. })
  884. } else {
  885. this.czggslList.push({
  886. cz: {
  887. id: '',
  888. name: ''
  889. },
  890. gg: {
  891. id: '',
  892. name: ''
  893. },
  894. sl: {
  895. inputIntegerNumberValue: '',
  896. inputDecimalNumberValue: ''
  897. }
  898. });
  899. this.$modal.msg("暂无工程信息")
  900. }
  901. } else {
  902. this.$modal.msg(res.msg)
  903. }
  904. })
  905. },
  906. getIntegerPart(numStr, i) {
  907. if (numStr != null && numStr != undefined && numStr != '') {
  908. return numStr.toString().split('.')[i] == undefined ? '0' : numStr.toString().split('.')[i];
  909. }
  910. },
  911. showHistoryList() {
  912. this.$refs.refShare.handleShowShare();
  913. }
  914. }
  915. }
  916. </script>
  917. <style lang="scss">
  918. .container {
  919. display: flex;
  920. align-items: center;
  921. justify-content: space-between;
  922. padding: 10px;
  923. position: relative;
  924. }
  925. .uni-list {
  926. border: 1xp solid #eee;
  927. }
  928. .to-right-icon {
  929. width: 15px;
  930. height: 15px;
  931. position: absolute;
  932. top: 50%;
  933. transform: translateY(-50%);
  934. }
  935. .text {
  936. font-size: 16px;
  937. color: #333;
  938. }
  939. .background {
  940. // border: 15px solid hsla(0, 0%, 100%, .5);
  941. background: white;
  942. background-clip: padding-box;
  943. padding: 20rpx;
  944. border-radius: 20rpx;
  945. margin: 20rpx;
  946. /*从padding开始往外面裁剪背景*/
  947. }
  948. .btn {
  949. width: 715rpx;
  950. height: 69rpx;
  951. background: #79A4F0;
  952. border-radius: 6rpx;
  953. font-size: 25rpx;
  954. font-family: Microsoft YaHei;
  955. font-weight: 400;
  956. color: #FFFFFF;
  957. line-height: 69rpx;
  958. margin-top: 40rpx;
  959. margin-bottom: 100rpx;
  960. }
  961. .number {
  962. display: flex;
  963. /* 水平居中显示子元素 */
  964. align-items: flex-start;
  965. /* 垂直居中显示子元素 */
  966. justify-content: space-between;
  967. /* 左右间距等于间距大小 */
  968. padding: 10px;
  969. /* 设置padding以提高视觉效果 */
  970. }
  971. .textarea {
  972. margin-top: 10upx;
  973. width: 100%;
  974. border: 1rpx solid red;
  975. min-height: 100upx;
  976. line-height: 20px;
  977. }
  978. .tj-btn {
  979. height: 69rpx;
  980. background: #3184f0;
  981. border-radius: 6rpx;
  982. font-size: 25rpx;
  983. font-weight: 400;
  984. color: #FFFFFF;
  985. line-height: 69rpx;
  986. margin: 40rpx 70rpx;
  987. }
  988. .sc-btn {
  989. height: 69rpx;
  990. background: #f0686b;
  991. border-radius: 6rpx;
  992. font-size: 25rpx;
  993. font-weight: 400;
  994. color: #FFFFFF;
  995. line-height: 69rpx;
  996. margin: 40rpx;
  997. }
  998. .num-style {
  999. background: #e8f4f9;
  1000. margin: 20rpx;
  1001. padding: 10rpx;
  1002. border-radius: 20rpx;
  1003. border: 1px solid #d4e3f0;
  1004. }
  1005. </style>