courtyard.vue 28 KB

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