courtyard.vue 26 KB

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