newoverhead.vue 28 KB

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