bottom_leg.vue 27 KB

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