overhead.vue 28 KB

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