overhead.vue 27 KB

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