bottom_leg.vue 27 KB

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