bottom_leg.vue 23 KB

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