bottom_leg.vue 23 KB

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