overhead.vue 28 KB

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