courtyard.vue 31 KB

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