bottom_leg.vue 28 KB

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