overhead.vue 28 KB

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