bottom_leg.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  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="3"
  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="2"
  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. let param = {
  342. district: this.XZQValue.dictValue,
  343. areaId: this.XQValue.id,
  344. buildingId: this.LDValue.id,
  345. unitId: this.DYValue.id,
  346. enginType: this.objValue.enginType, //写死 上一页面传过来的
  347. enginClassification: this.objValue
  348. .enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  349. enginCycle: this.projectValue.dictValue, //工程周期
  350. zEngineeringNodeBo: {
  351. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  352. zEngineeringInfoBo: {
  353. constructTime: this.time, //施工时间
  354. beforeBottom: this.imgArr1, //照片集合
  355. legBackfilling: this.imgArr2, //照片集合
  356. inferiorSulcus: this.imgArr3, //照片集合
  357. zEngineeringMaterialBo: [{
  358. number: this.inputNumberValue //米数
  359. }]
  360. }
  361. }
  362. }
  363. addTearOldPipe(param).then(res => {
  364. if (res.code == '200') {
  365. uni.showToast({
  366. title: res.msg,
  367. icon: 'none',
  368. //显示持续时间为 3秒
  369. duration: 2000
  370. });
  371. setTimeout(function() {
  372. uni.navigateBack();
  373. }, 1000)
  374. }
  375. })
  376. //提交接口执行逻辑
  377. }
  378. },
  379. // 显示历史弹窗
  380. handleShowSheet() {
  381. this.shareState = true;
  382. },
  383. // 隐藏历史弹窗
  384. handleHiddenShare() {
  385. this.shareState = false;
  386. },
  387. showPhoto(index, type) {
  388. if (type == 1) {
  389. uni.previewImage({
  390. current: index,
  391. urls: this.imgArr1,
  392. })
  393. } else if (type == 2) {
  394. uni.previewImage({
  395. current: index,
  396. urls: this.imgArr2,
  397. })
  398. } else {
  399. uni.previewImage({
  400. current: index,
  401. urls: this.imgArr3,
  402. })
  403. }
  404. },
  405. remove(index, type) {
  406. if (type == 1) {
  407. uni.showModal({
  408. title: '提示',
  409. content: '是否删除该图片或视频?',
  410. success: (res) => {
  411. if (res.confirm) {
  412. this.imgArr1.splice(index, 1)
  413. }
  414. }
  415. })
  416. } else if (type == 2) {
  417. uni.showModal({
  418. title: '提示',
  419. content: '是否删除该图片或视频?',
  420. success: (res) => {
  421. if (res.confirm) {
  422. this.imgArr2.splice(index, 1)
  423. }
  424. }
  425. })
  426. } else {
  427. uni.showModal({
  428. title: '提示',
  429. content: '是否删除该图片或视频?',
  430. success: (res) => {
  431. if (res.confirm) {
  432. this.imgArr3.splice(index, 1)
  433. }
  434. }
  435. })
  436. }
  437. },
  438. choose() {
  439. let _this = this;
  440. uni.showActionSheet({
  441. title: '上传',
  442. itemList: ['图片', '视频'],
  443. success: (res) => {
  444. if (res.tapIndex == 0) {
  445. this.chooseimage()
  446. } else {
  447. this.choosevideo()
  448. }
  449. }
  450. })
  451. },
  452. chooseimage(type) {
  453. let _this = this;
  454. uni.chooseImage({
  455. sizeType: ['album', 'camera'],
  456. success(resp) {
  457. resp.tempFiles.forEach((item, index) => {
  458. const task = uni.uploadFile({
  459. url: _this.$HTTP + `/obs`,
  460. filePath: item.path,
  461. name: 'file',
  462. formData: {},
  463. header: _this.headers,
  464. success: res => {
  465. // 判断是否json字符串,将其转为json格式
  466. let data = JSON.parse(res.data);
  467. if (![200].includes(data.code)) {
  468. _this.$modal.msg(data.msg)
  469. } else {
  470. if (_this.progress === 100) {
  471. if (type == 1) {
  472. _this.imgArr1.push(data.data.url)
  473. } else if (type == 2) {
  474. _this.imgArr2.push(data.data.url)
  475. } else {
  476. _this.imgArr3.push(data.data.url)
  477. }
  478. _this.$modal.msg('上传成功!')
  479. }
  480. }
  481. },
  482. fail: e => {
  483. _this.$modal.msg('上传失败!')
  484. },
  485. complete: res => {
  486. uni.hideLoading();
  487. _this.uploading = false;
  488. }
  489. });
  490. task.onProgressUpdate(res => {
  491. _this.progress = res.progress;
  492. uni.showLoading({
  493. title: '上传中'
  494. })
  495. if (_this.progress != 100) {
  496. _this.loading = false
  497. } else {
  498. _this.loading = true
  499. }
  500. });
  501. })
  502. },
  503. })
  504. },
  505. pickerShow(e) {
  506. this.type = e; //赋值类型
  507. if (e == 'xzq') { //行政区
  508. if (this.isEmpty(this.projectValue.dictValue)) {
  509. this.$modal.msg('请选择工程周期')
  510. } else {
  511. this.openDict = true;
  512. getDicts("district").then(response => {
  513. this.dictOptions = response.data;
  514. });
  515. }
  516. } else if (e == 'xq') { //小区
  517. if (this.isEmpty(this.XZQValue.dictValue)) {
  518. this.$modal.msg('请选择行政区')
  519. } else {
  520. this.open = true;
  521. this.selectList = this.XQList;
  522. }
  523. } else if (e == 'ld') { //楼栋
  524. if (this.isEmpty(this.XQValue.id)) {
  525. this.$modal.msg('请选择小区')
  526. } else {
  527. this.open = true;
  528. this.selectList = this.LDList;
  529. }
  530. } else if (e == 'dy') { //单元
  531. if (this.isEmpty(this.LDValue.id)) {
  532. this.$modal.msg('请选择楼栋')
  533. } else {
  534. this.open = true;
  535. this.selectList = this.DYList;
  536. }
  537. } else if (e == 'fj') { //房间
  538. if (this.isEmpty(this.DYValue.id)) {
  539. this.$modal.msg('请选择单元')
  540. } else {
  541. this.open = true;
  542. this.selectList = this.FJList;
  543. }
  544. }
  545. },
  546. changeSelectDict(item, index) {
  547. this.openDict = false;
  548. if (this.type == 'xzq') {
  549. this.XZQValue = item;
  550. //根据行政区id获取小区数据
  551. this.XQValue = ''; //重置小区数据
  552. this.LDValue = ''; //重置楼栋数据
  553. this.DYValue = ''; //重置单元数据
  554. getAreaList(item.dictValue).then(res => {
  555. this.XQList = res.data;
  556. })
  557. }
  558. },
  559. changeSelect(item, index) {
  560. this.open = false;
  561. if (this.type == 'xq') {
  562. this.XQValue = item;
  563. //根据小区id 获取楼栋数据
  564. this.LDValue = ''; //重置楼栋数据
  565. this.DYValue = ''; //重置单元数据
  566. getBuildingList(item.id).then(res => {
  567. this.LDList = res.data
  568. })
  569. } else if (this.type == 'ld') {
  570. this.LDValue = item;
  571. //根据楼栋ID 获取单元数据
  572. this.DYValue = ''; //重置单元数据
  573. if (!this.isEmpty(this.projectValue.dictValue)) {
  574. //选完 判断 工程周期
  575. this.getStatus();
  576. }
  577. getUnitList(item.id).then(res => {
  578. this.DYList = res.data
  579. })
  580. } else if (this.type == 'dy') {
  581. this.DYValue = item;
  582. if (!this.isEmpty(this.projectValue.dictValue)) {
  583. //选完 判断 工程周期
  584. this.getStatus();
  585. }
  586. }
  587. },
  588. //关闭弹窗
  589. close(e) {
  590. this.open = false
  591. },
  592. //关闭弹窗
  593. closeDict(e) {
  594. this.openDict = false
  595. },
  596. history() {
  597. if (this.isEmpty(this.projectValue.dictValue)) {
  598. this.$modal.msg("请选择工程周期")
  599. return
  600. }
  601. if (this.isEmpty(this.XZQValue.dictValue)) {
  602. this.$modal.msg("请选择行政区")
  603. return
  604. }
  605. if (this.isEmpty(this.XQValue.id)) {
  606. this.$modal.msg("请选择小区")
  607. return
  608. }
  609. if (this.isEmpty(this.LDValue.id)) {
  610. this.$modal.msg("请选择楼栋")
  611. return
  612. }
  613. let unitId = '';
  614. let houseId = '';
  615. if (this.isEmpty(this.DYValue.id)) {
  616. unitId = '';
  617. } else {
  618. unitId = this.DYValue.id
  619. }
  620. let param = {
  621. areaId: this.XQValue.id, // 小区id
  622. buildingId: this.LDValue.id, // 楼宇id
  623. unitId: unitId, // 单元id
  624. enginCycle: this.projectValue.dictValue, // 工程周期
  625. enginType: this.objValue.enginType, //写死 上一页面传过来的 新建/旧改
  626. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  627. }
  628. getRoomProjectId(param).then(res => {
  629. if (res.code == '200') {
  630. if (res.data != null) {
  631. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  632. res => {
  633. this.historyList = res.data
  634. if (res.data.zEngineeringNodeBo != null) {
  635. this.showHistoryList();
  636. } else {
  637. this.$modal.msg("暂无历史信息")
  638. }
  639. })
  640. } else {
  641. this.$modal.msg("暂无工程信息")
  642. }
  643. } else {
  644. this.$modal.msg(res.msg)
  645. }
  646. })
  647. },
  648. showHistoryList() {
  649. this.$refs.refShare.handleShowShare();
  650. }
  651. }
  652. }
  653. </script>
  654. <style lang="scss">
  655. .container {
  656. display: flex;
  657. align-items: center;
  658. justify-content: space-between;
  659. padding: 10px;
  660. position: relative;
  661. }
  662. .uni-list {
  663. border: 1xp solid #eee;
  664. }
  665. .to-right-icon {
  666. width: 15px;
  667. height: 15px;
  668. position: absolute;
  669. top: 50%;
  670. transform: translateY(-50%);
  671. }
  672. .text {
  673. font-size: 16px;
  674. color: #333;
  675. }
  676. .background {
  677. // border: 15px solid hsla(0, 0%, 100%, .5);
  678. background: white;
  679. background-clip: padding-box;
  680. padding: 20rpx;
  681. border-radius: 20rpx;
  682. margin: 20rpx;
  683. /*从padding开始往外面裁剪背景*/
  684. }
  685. .btn {
  686. width: 715rpx;
  687. height: 69rpx;
  688. background: #79A4F0;
  689. border-radius: 6rpx;
  690. font-size: 25rpx;
  691. font-family: Microsoft YaHei;
  692. font-weight: 400;
  693. color: #FFFFFF;
  694. line-height: 69rpx;
  695. margin-top: 40rpx;
  696. margin-bottom: 100rpx;
  697. }
  698. .number {
  699. display: flex;
  700. /* 水平居中显示子元素 */
  701. align-items: flex-start;
  702. /* 垂直居中显示子元素 */
  703. justify-content: space-between;
  704. /* 左右间距等于间距大小 */
  705. padding: 10px;
  706. /* 设置padding以提高视觉效果 */
  707. }
  708. .textarea {
  709. margin-top: 10upx;
  710. width: 100%;
  711. border: 1rpx solid red;
  712. min-height: 100upx;
  713. line-height: 20px;
  714. }
  715. </style>