courtyard.vue 26 KB

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