bottom_leg.vue 26 KB

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