overhead.vue 26 KB

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