newcourtyard.vue 28 KB

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