courtyard.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944
  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 class="container">
  174. <text>负责人</text>
  175. <text>{{user.nickName}}</text>
  176. </view>
  177. <view class="container">
  178. <text>负责人联系电话</text>
  179. <text>{{user.phonenumber}}</text>
  180. </view> -->
  181. </view>
  182. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  183. <view class="container" style="color: gainsboro;">*请上传照片</view>
  184. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  185. <image src="/static/images/chooseimg.png" mode=""
  186. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="choose()"></image>
  187. <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
  188. <view
  189. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ">
  190. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  191. @click="showPhoto(index)">
  192. </image>
  193. </view>
  194. <view v-else>
  195. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  196. </view>
  197. <view @click="remove(index)"
  198. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  199. <uni-icons type="close" color="darkgray" size="18"></uni-icons>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. <view class="action-btn">
  207. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  208. </view>
  209. <bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
  210. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  211. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  212. </view>
  213. </template>
  214. <script>
  215. import SelectPicker from '../../../components/selectPicker/select_picker.vue'
  216. import bottomSheet from '../../../components/bottomSheet/bottomSheet.vue'
  217. import uniIcons from '../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  218. import {
  219. getDicts
  220. } from "@/api/system/dict/data";
  221. import {
  222. getAreaList,
  223. getBuildingList,
  224. addTearOldPipe,
  225. getEnginMaterialQualityList,
  226. getEnginSpecificationsList,
  227. getRoomProjectList,
  228. getRoomProjectId,
  229. } from '@/api/common'
  230. import {
  231. getToken
  232. } from '../../../utils/auth';
  233. import {
  234. getUserProfile
  235. } from "@/api/system/user"
  236. export default {
  237. components: {
  238. SelectPicker,
  239. uniIcons,
  240. bottomSheet,
  241. },
  242. data() {
  243. return {
  244. headers: {
  245. Authorization: "Bearer " + getToken()
  246. },
  247. user: {
  248. nickName: "",
  249. phonenumber: "",
  250. email: "",
  251. sex: ""
  252. },
  253. type: '',
  254. open: false,
  255. objValue: '', //上一页面传过来的值 新增接口用
  256. openDict: false,
  257. selectList: [],
  258. dictOptions: [],
  259. imgArr: [],
  260. XQValue: {},
  261. XZQValue: {},
  262. projectValue: {},
  263. LevelValue: {},
  264. isOkValue: '', //分段打压是否合格
  265. isOkLabel: '', //分段打压是否合格label
  266. LDValue: {},
  267. time: '', //施工时间
  268. timeType: '', //时间类型
  269. BackfillingTime: '', //回填时间
  270. showTime: false,
  271. specificationValue: {}, //规格
  272. projectContent: '', //施工内容
  273. materialValue: {}, //材质
  274. brandValue: {}, //品牌
  275. doorValue: {}, //上门类型
  276. SelfClosValve: {}, //自闭阀类型
  277. materialList: '', //材质list
  278. XQList: '',
  279. LDList: '',
  280. progress: 0, //上传图片进度百分比
  281. loading: false,
  282. inputNumberValue: '',
  283. title: '',
  284. historyList: {} //历史数据
  285. }
  286. },
  287. created() {
  288. this.getUser();
  289. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  290. },
  291. onLoad(options) {
  292. if ('params' in options) {
  293. this.objValue = JSON.parse(decodeURIComponent(options.params));
  294. if (this.objValue.enginType == `old_renovation`) {
  295. this.title = '旧改工程-庭院'
  296. } else if (this.objValue.enginType == `new_built`) {
  297. this.title = '新建工程-庭院'
  298. }
  299. uni.setNavigationBarTitle({
  300. title: this.title
  301. })
  302. }
  303. },
  304. methods: {
  305. getUser() {
  306. getUserProfile().then(response => {
  307. this.user = response.data.user
  308. })
  309. },
  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. }
  574. },
  575. changeSelectDict(item, index) {
  576. this.openDict = false;
  577. if (this.type == 'isok') {
  578. this.isOkValue = item
  579. } else if (this.type == 'gczq') {
  580. this.projectValue = item
  581. } else if (this.type == 'xzq') {
  582. this.XZQValue = item;
  583. //根据行政区id获取小区数据
  584. this.XQValue = ''; //重置小区数据
  585. this.LDValue = ''; //重置楼栋数据
  586. getAreaList(item.dictValue).then(res => {
  587. this.XQList = res.data;
  588. })
  589. }
  590. },
  591. changeSelect(item, index) {
  592. // this.index = index;
  593. // this.address = item.communityName;
  594. this.open = false;
  595. if (this.type == 'cz') {
  596. this.materialValue = item;
  597. this.specificationValue = ''; //重置规格
  598. //根据材质ID 获取规格数据
  599. getEnginSpecificationsList(item.id).then(res => {
  600. this.materialList = res.data
  601. })
  602. } else if (this.type == 'gg') {
  603. this.specificationValue = item;
  604. } else if (this.type == 'xq') {
  605. this.XQValue = item;
  606. //根据小区id 获取楼栋数据
  607. this.LDValue = ''; //重置楼栋数据
  608. this.DYValue = ''; //重置单元数据
  609. this.FJValue = ''; //重置房间数据
  610. getBuildingList(item.id).then(res => {
  611. this.LDList = res.data
  612. // console.log("楼栋=", res)
  613. })
  614. } else if (this.type == 'ld') {
  615. this.LDValue = 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. }
  640. // else if (this.isEmpty(this.LDValue.id)) {
  641. // this.$modal.msg("请选择楼栋")
  642. // }
  643. if (this.objValue.enginClassValue == '回填' && this.isEmpty(this.BackfillingTime)) {
  644. this.$modal.msg("请选择回填时间")
  645. return
  646. }
  647. if (this.objValue.enginClassValue == '打压' && this.isEmpty(this.isOkValue)) {
  648. this.$modal.msg("请选择分段打压是否合格")
  649. return
  650. }
  651. if (this.isEmpty(this.materialValue.id)) {
  652. this.$modal.msg("请选择材质")
  653. return
  654. }
  655. if (this.isEmpty(this.specificationValue.id)) {
  656. this.$modal.msg("请选择规格")
  657. return
  658. }
  659. if (this.isEmpty(this.inputNumberValue)) {
  660. this.$modal.msg("请输入数量")
  661. return
  662. }
  663. if (this.imgArr.length <= 0) {
  664. this.$modal.msg('请上传照片或视频')
  665. return
  666. }
  667. if (this.loading == false) {
  668. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  669. return
  670. }
  671. //提交
  672. this.onsubmit();
  673. },
  674. onsubmit() {
  675. let unitId = '';
  676. let houseId = '';
  677. let buildingId = '';
  678. if (this.isEmpty(this.LDValue.id)) {
  679. buildingId = '';
  680. } else {
  681. buildingId = this.LDValue.id
  682. }
  683. //提交
  684. let param = {
  685. district: this.XZQValue.dictValue,
  686. areaId: this.XQValue.id,
  687. buildingId: buildingId, //不必传 如果没有传 ' '
  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. })
  725. },
  726. history() {
  727. if (this.isEmpty(this.projectValue.dictValue)) {
  728. this.$modal.msg("请选择工程周期")
  729. return
  730. }
  731. if (this.isEmpty(this.XZQValue.dictValue)) {
  732. this.$modal.msg("请选择行政区")
  733. return
  734. }
  735. if (this.isEmpty(this.XQValue.id)) {
  736. this.$modal.msg("请选择小区")
  737. return
  738. }
  739. // if (this.isEmpty(this.LDValue.id)) {
  740. // this.$modal.msg("请选择楼栋")
  741. // }
  742. // if (this.isEmpty(this.DYValue.id)) {
  743. // this.$modal.msg("请选择单元")
  744. // }
  745. // if (this.isEmpty(this.FJValue.id)) {
  746. // this.$modal.msg("请选择房间")
  747. // } else {
  748. else {
  749. let unitId = '';
  750. let houseId = '';
  751. let buildingId = '';
  752. if (this.isEmpty(this.LDValue.id)) {
  753. buildingId = '';
  754. } else {
  755. buildingId = this.LDValue.id
  756. }
  757. let param = {
  758. areaId: this.XQValue.id, // 小区id
  759. buildingId: buildingId, // 楼宇id
  760. enginCycle: this.projectValue.dictValue, // 工程周期
  761. unitId: unitId,
  762. houseId: houseId, //传空
  763. enginType: this.objValue.enginType, //写死 上一页面传过来的
  764. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  765. }
  766. getRoomProjectId(param).then(res => {
  767. if (res.code == '200') {
  768. if (res.data != null) {
  769. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  770. res => {
  771. this.historyList = res.data
  772. if (res.data.zEngineeringNodeBo != null) {
  773. this.showHistoryList();
  774. } else {
  775. this.$modal.msg("暂无历史信息")
  776. }
  777. })
  778. } else {
  779. this.$modal.msg("暂无工程信息")
  780. }
  781. } else {
  782. this.$modal.msg(res.msg)
  783. }
  784. })
  785. }
  786. },
  787. showHistoryList() {
  788. this.$refs.refShare.handleShowShare();
  789. }
  790. }
  791. }
  792. </script>
  793. <style>
  794. .container {
  795. display: flex;
  796. margin-left: 10px;
  797. margin-top: 10px;
  798. margin-right: 10px;
  799. align-items: flex-start;
  800. justify-content: space-between;
  801. }
  802. .text {
  803. font-size: 16px;
  804. color: #333;
  805. }
  806. .background {
  807. border: 15px solid hsla(0, 0%, 100%, .5);
  808. background: white;
  809. background-clip: padding-box;
  810. padding-left: 5px;
  811. padding-right: 10px;
  812. /*从padding开始往外面裁剪背景*/
  813. }
  814. .btn {
  815. margin-top: 40px;
  816. margin-right: 20px;
  817. margin-bottom: 120px;
  818. margin-left: 20px;
  819. height: 45px;
  820. }
  821. .number {
  822. display: flex;
  823. /* 水平居中显示子元素 */
  824. align-items: flex-start;
  825. /* 垂直居中显示子元素 */
  826. justify-content: space-between;
  827. /* 左右间距等于间距大小 */
  828. padding: 10px;
  829. /* 设置padding以提高视觉效果 */
  830. }
  831. .textarea {
  832. margin-top: 10upx;
  833. width: 100%;
  834. border: 1rpx solid red;
  835. min-height: 100upx;
  836. line-height: 20px;
  837. }
  838. </style>