bottom_leg.vue 23 KB

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