overhead.vue 28 KB

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