surge_tank.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  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)" @click="pickerShow('xzq',0)">
  10. <span style="color: darkgray;">请选择行政区</span>
  11. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  12. </view>
  13. <view v-else class="uni-list-cell-db" @click="pickerShow('xzq',0)">
  14. <span style="color: black;">{{XZQValue.dictLabel}}</span>
  15. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="uni-list">
  20. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  21. <view>
  22. 小区
  23. </view>
  24. <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" @click="pickerShow('xq',0)">
  25. <span style="color: darkgray;">请选择小区</span>
  26. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  27. </view>
  28. <view v-else class="uni-list-cell-db" @click="pickerShow('xq',0)">
  29. <span style="color: black;">{{XQValue.name}}</span>
  30. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="uni-list">
  35. <view class="container">
  36. <view class="uni-list-cell-left">
  37. 楼栋
  38. </view>
  39. <view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" @click="pickerShow('ld',0)">
  40. <span style="color: darkgray;">请选择楼栋</span>
  41. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  42. </view>
  43. <view v-else class="uni-list-cell-db" @click="pickerShow('ld',0)">
  44. <span style="color: black;">{{LDValue.name}}</span>
  45. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  46. </view>
  47. </view>
  48. </view>
  49. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  50. subtitleKey="id" v-model="name"></SelectPicker>
  51. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  52. titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
  53. </view>
  54. <view class="background">
  55. <view>
  56. <view class="uni-list">
  57. <view
  58. style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
  59. {{objValue.enginClassValue}}
  60. <span
  61. style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 10px;"
  62. @click="history">历史</span>
  63. </view>
  64. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  65. <view>
  66. 施工时间
  67. </view>
  68. <view @click="openDatetimePicker('sg')">
  69. <span style="color: black;">{{time}}</span>
  70. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  71. </view>
  72. </view>
  73. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  74. <view class="uni-common-mt" style="width: 100%;">
  75. <text class="uni-title uni-common-pl">施工内容</text>
  76. <view style="width: 100%;box-sizing: border-box;">
  77. <textarea class="textarea" placeholder="请输入施工内容" maxlength="255"
  78. placeholder-style="padding: 10rpx;"
  79. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  80. auto-height v-model="projectContent"></textarea>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  86. <view class="container" style="color: #b2b2b2;">*请上传调压箱名牌照片</view>
  87. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  88. <image :src="loadImgSrc('updateimg.png')" mode=""
  89. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('Box')"
  90. v-show="reviewStatus!='1'"></image>
  91. <view v-for="(item,index) in imgBoxArr" :key="index" style="position: relative;">
  92. <view
  93. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  94. <image :src="item" mode="" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"
  95. @click="showPhoto(index,'Box')">
  96. </image>
  97. </view>
  98. <view v-else>
  99. <video :src="item" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"></video>
  100. </view>
  101. <view @click="remove(index,'Box')"
  102. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  103. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  104. </image>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  110. <view class="container" style="color: #b2b2b2;">*请上传调压箱内石粉回填照片</view>
  111. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  112. <image :src="loadImgSrc('updateimg.png')" mode=""
  113. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('Sfht')"
  114. v-show="reviewStatus!='1'"></image>
  115. <view v-for="(item,index) in imgSfhtArr" :key="index" style="position: relative;">
  116. <view
  117. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  118. <image :src="item" mode="" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"
  119. @click="showPhoto(index,'Sfht')">
  120. </image>
  121. </view>
  122. <view v-else>
  123. <video :src="item" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"></video>
  124. </view>
  125. <view @click="remove(index,'Sfht')"
  126. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  127. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  128. </image>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  133. <view class="container" style="color: #b2b2b2;">*请上传调压箱防雷接地照片</view>
  134. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  135. <image :src="loadImgSrc('updateimg.png')" mode=""
  136. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('Fljd')"
  137. v-show="reviewStatus!='1'"></image>
  138. <view v-for="(item,index) in imgFljdArr" :key="index" style="position: relative;">
  139. <view
  140. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  141. <image :src="item" mode="" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"
  142. @click="showPhoto(index,'Fljd')">
  143. </image>
  144. </view>
  145. <view v-else>
  146. <video :src="item" style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"></video>
  147. </view>
  148. <view @click="remove(index,'Fljd')"
  149. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  150. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  151. </image>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  156. <view class="container" style="color: #b2b2b2;">*请上传调压箱底腿连接照片</view>
  157. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  158. <image :src="loadImgSrc('updateimg.png')" mode=""
  159. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('Dtlj')"
  160. v-show="reviewStatus!='1'"></image>
  161. <view v-for="(item,index) in imgDtljArr" :key="index" style="position: relative;">
  162. <view
  163. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  164. <image :src="item" mode=""
  165. style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"
  166. @click="showPhoto(index,'Dtlj')">
  167. </image>
  168. </view>
  169. <view v-else>
  170. <video :src="item"
  171. style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"></video>
  172. </view>
  173. <view @click="remove(index,'Dtlj')"
  174. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  175. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  176. </image>
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
  182. <view class="container" style="color: #b2b2b2;">*请上传调压箱护栏及地面硬化(远景)照片</view>
  183. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  184. <image :src="loadImgSrc('updateimg.png')" mode=""
  185. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('Hldmyh')"
  186. v-show="reviewStatus!='1'"></image>
  187. <view v-for="(item,index) in imgHldmyhArr" :key="index" style="position: relative;">
  188. <view
  189. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  190. <image :src="item" mode=""
  191. style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"
  192. @click="showPhoto(index,'Hldmyh')">
  193. </image>
  194. </view>
  195. <view v-else>
  196. <video :src="item"
  197. style="width: 200rpx; height: 200rpx; margin: 0 12rpx;"></video>
  198. </view>
  199. <view @click="remove(index,'Hldmyh')"
  200. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  201. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  202. </image>
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. <view class="action-btn" v-show="reviewStatus!='1'">
  212. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
  213. </view>
  214. <bottom-sheet ref="refShare" :data="historyList" :TitleType="objValue.enginClassValue"></bottom-sheet>
  215. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  216. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  217. </scroll-view>
  218. </template>
  219. <script>
  220. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  221. import bottomSheet from '../../components/bottomSheet/bottomSheetMore.vue'
  222. import {
  223. getDicts
  224. } from "@/api/system/dict/data";
  225. import {
  226. getAreaList,
  227. getBuildingList,
  228. addTearOldPipe,
  229. getEnginMaterialQualityList,
  230. getEnginSpecificationsList,
  231. getRoomProjectList,
  232. getRoomProjectId,
  233. } from '@/api/common'
  234. import {
  235. getToken
  236. } from '../../utils/auth';
  237. export default {
  238. components: {
  239. SelectPicker,
  240. bottomSheet,
  241. },
  242. data() {
  243. return {
  244. headers: {
  245. Authorization: "Bearer " + getToken()
  246. },
  247. type: '',
  248. reviewStatus: '', //是否可以点击
  249. open: false,
  250. objValue: '', //上一页面传过来的值 新增接口用
  251. openDict: false,
  252. selectList: [],
  253. dictOptions: [],
  254. imgSfhtArr: [],
  255. imgFljdArr: [],
  256. imgBoxArr: [],
  257. imgDtljArr: [],
  258. imgHldmyhArr: [],
  259. videoArr: [],
  260. XQValue: {},
  261. XZQValue: {},
  262. SelectIndex: '', //选择的索引值
  263. projectValue: {
  264. 'dictValue': '0'
  265. },
  266. LevelValue: {},
  267. isOkValue: '', //分段打压是否合格
  268. isOkLabel: '', //分段打压是否合格label
  269. LDValue: {},
  270. time: '', //施工时间
  271. timeType: '', //时间类型
  272. BackfillingTime: '', //回填时间
  273. showTime: false,
  274. specificationValue: {}, //规格
  275. projectContent: '', //施工内容
  276. materialValue: {}, //材质
  277. brandValue: {}, //品牌
  278. doorValue: {}, //上门类型
  279. SelfClosValve: {}, //自闭阀类型
  280. materialList: '', //材质list
  281. XQList: '',
  282. LDList: '',
  283. progress: 0, //上传图片进度百分比
  284. loading: false,
  285. inputNumberValue: '',
  286. title: '',
  287. historyList: {} //历史数据
  288. }
  289. },
  290. created() {
  291. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  292. },
  293. onLoad(options) {
  294. if ('params' in options) {
  295. this.objValue = JSON.parse(decodeURIComponent(options.params));
  296. if (this.objValue.enginType == `old_renovation`) {
  297. this.title = '旧改工程-调压柜'
  298. } else if (this.objValue.enginType == `new_built`) {
  299. this.title = '新建工程-调压柜'
  300. }
  301. uni.setNavigationBarTitle({
  302. title: this.title
  303. })
  304. }
  305. },
  306. methods: {
  307. // 打开picker
  308. openDatetimePicker(type) {
  309. this.timeType = type;
  310. this.$refs.myPicker.show();
  311. },
  312. // 关闭picker
  313. closeDatetimePicker() {
  314. this.$refs.myPicker.hide();
  315. },
  316. handleSubmit(e) {
  317. if (this.timeType == 'ht') {
  318. this.BackfillingTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  319. } else {
  320. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  321. }
  322. },
  323. //获取当前时间
  324. traversalTime(timestamp) {
  325. //timestamp(时间戳)是整数,否则要parseInt转换
  326. let time = new Date(timestamp);
  327. let y = time.getFullYear();
  328. let m = time.getMonth() + 1;
  329. let d = time.getDate();
  330. let h = time.getHours();
  331. let mm = time.getMinutes();
  332. let s = time.getSeconds();
  333. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  334. mm) + ':' + this.addTimes(s);
  335. },
  336. addTimes(m) {
  337. return m < 10 ? '0' + m : m
  338. },
  339. //判断是否选择
  340. isEmpty(str) {
  341. return (!str || 0 === str.length);
  342. },
  343. // 显示历史弹窗
  344. handleShowSheet() {
  345. this.shareState = true;
  346. },
  347. // 隐藏历史弹窗
  348. handleHiddenShare() {
  349. this.shareState = false;
  350. },
  351. showPhoto(index, type) {
  352. let typeArr = [];
  353. let newArr = [];
  354. if (type == 'Box') {
  355. typeArr = this.imgBoxArr;
  356. } else if (type == 'Sfht') {
  357. typeArr = this.imgSfhtArr;
  358. } else if (type == 'Fljd') {
  359. typeArr = this.imgFljdArr;
  360. } else if (type == 'Dtlj') {
  361. typeArr = this.imgDtljArr;
  362. } else if (type == 'Hldmyh') {
  363. typeArr = this.imgHldmyhArr;
  364. }
  365. typeArr.forEach((item, index) => {
  366. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  367. item.substring(item.length - 4) == 'jpeg') {
  368. newArr.push(item)
  369. }
  370. });
  371. uni.previewImage({
  372. current: index,
  373. urls: newArr,
  374. })
  375. },
  376. remove(index, e) {
  377. uni.showModal({
  378. title: '提示',
  379. content: '是否删除该图片或视频',
  380. success: (res) => {
  381. if (res.confirm) {
  382. if (e == 'Box') {
  383. this.imgBoxArr.splice(index, 1)
  384. } else if (e == 'Sfht') {
  385. this.imgSfhtArr.splice(index, 1)
  386. } else if (e == 'Fljd') {
  387. this.imgFljdArr.splice(index, 1)
  388. } else if (e == 'Dtlj') {
  389. this.imgDtljArr.splice(index, 1)
  390. } else if (e == 'Hldmyh') {
  391. this.imgHldmyhArr.splice(index, 1)
  392. }
  393. }
  394. }
  395. })
  396. },
  397. choose(e) {
  398. uni.showActionSheet({
  399. title: '上传',
  400. itemList: ['图片', '视频'],
  401. success: (res) => {
  402. if (res.tapIndex == 0) {
  403. this.chooseimage(e)
  404. } else {
  405. this.choosevideo(e)
  406. }
  407. }
  408. })
  409. },
  410. chooseimage(e) {
  411. let _this = this;
  412. uni.chooseImage({
  413. sizeType: ['album', 'camera'],
  414. success(resp) {
  415. resp.tempFiles.forEach((item, index) => {
  416. const task = uni.uploadFile({
  417. url: _this.$HTTP + `/obs`,
  418. filePath: item.path,
  419. name: 'file',
  420. formData: {},
  421. header: _this.headers,
  422. success: res => {
  423. // 判断是否json字符串,将其转为json格式
  424. let data = JSON.parse(res.data);
  425. if (![200].includes(data.code)) {
  426. _this.$modal.msg(data.msg)
  427. } else {
  428. if (_this.progress === 100) {
  429. if (e == 'Box') {
  430. _this.imgBoxArr.push(data.data.url)
  431. } else if (e == 'Sfht') {
  432. _this.imgSfhtArr.push(data.data.url)
  433. } else if (e == 'Fljd') {
  434. _this.imgFljdArr.push(data.data.url)
  435. } else if (e == 'Dtlj') {
  436. _this.imgDtljArr.push(data.data.url)
  437. } else if (e == 'Hldmyh') {
  438. _this.imgHldmyhArr.push(data.data.url)
  439. }
  440. _this.$modal.msg('上传成功!')
  441. }
  442. }
  443. },
  444. fail: e => {
  445. _this.$modal.msg('上传失败!')
  446. //_this.uploadError(index, e);
  447. },
  448. complete: res => {
  449. uni.hideLoading();
  450. _this.uploading = false;
  451. }
  452. });
  453. task.onProgressUpdate(res => {
  454. _this.progress = res.progress;
  455. uni.showLoading({
  456. title: '上传中'
  457. })
  458. if (_this.progress != 100) {
  459. _this.loading = false
  460. } else {
  461. _this.loading = true
  462. }
  463. });
  464. })
  465. },
  466. })
  467. },
  468. choosevideo(e) {
  469. let _this = this;
  470. uni.chooseVideo({
  471. sourceType: ['album', 'camera'],
  472. maxDuration: 30,
  473. success(resp) {
  474. const task = uni.uploadFile({
  475. url: _this.$HTTP + `/obs`,
  476. filePath: resp.tempFilePath,
  477. name: 'file',
  478. formData: {},
  479. header: _this.headers,
  480. success: res => {
  481. // 判断是否json字符串,将其转为json格式
  482. let data = JSON.parse(res.data);
  483. if (![200].includes(res.statusCode)) {
  484. this.uploadError(index, data);
  485. } else {
  486. //上传成功
  487. if (_this.progress === 100) {
  488. if (e == 'Box') {
  489. _this.imgBoxArr.push(data.data.url)
  490. } else if (e == 'Sfht') {
  491. _this.imgSfhtArr.push(data.data.url)
  492. } else if (e == 'Fljd') {
  493. _this.imgFljdArr.push(data.data.url)
  494. } else if (e == 'Dtlj') {
  495. _this.imgDtljArr.push(data.data.url)
  496. } else if (e == 'Hldmyh') {
  497. _this.imgHldmyhArr.push(data.data.url)
  498. }
  499. _this.$modal.msg('上传成功!')
  500. }
  501. }
  502. },
  503. fail: e => {
  504. _this.$modal.msg('上传失败!')
  505. this.uploadError(index, e);
  506. },
  507. complete: res => {
  508. uni.hideLoading();
  509. _this.uploading = false;
  510. }
  511. });
  512. task.onProgressUpdate(res => {
  513. _this.progress = res.progress;
  514. uni.showLoading({
  515. title: '上传中'
  516. })
  517. if (_this.progress != 100) {
  518. _this.loading = false
  519. } else {
  520. _this.loading = true
  521. }
  522. });
  523. },
  524. })
  525. },
  526. pickerShow(e, index) {
  527. this.SelectIndex = index;
  528. this.type = e; //赋值类型
  529. if (e == 'cz') { //材质
  530. this.open = true;
  531. getEnginMaterialQualityList("民用工程", this.objValue.enginType, this.objValue.enginClassification, this
  532. .objValue.enginClassValue).then(
  533. response => {
  534. this.selectList = response.data;
  535. });
  536. } else if (e == 'gg') { //规格
  537. if (this.isEmpty(this.czggslList[index].cz.id)) {
  538. this.$modal.msg('请选择材质')
  539. // this.czggslList[index].cz = this.materialValue.id
  540. } else {
  541. this.open = true;
  542. this.selectList = this.materialList;
  543. }
  544. } else if (e == 'gczq') { //工程周期
  545. this.openDict = true;
  546. getDicts("engin_cycle").then(response => {
  547. this.dictOptions = response.data;
  548. });
  549. } else if (e == 'xzq') { //行政区
  550. if (this.isEmpty(this.projectValue.dictValue)) {
  551. this.$modal.msg('请选择工程周期')
  552. } else {
  553. this.openDict = true;
  554. getDicts("district").then(response => {
  555. this.dictOptions = response.data;
  556. });
  557. }
  558. } else if (e == 'xq') { //小区
  559. if (this.isEmpty(this.XZQValue.dictValue)) {
  560. this.$modal.msg('请选择行政区')
  561. } else {
  562. this.open = true;
  563. this.selectList = this.XQList;
  564. }
  565. } else if (e == 'ld') { //楼栋
  566. if (this.isEmpty(this.XQValue.id)) {
  567. this.$modal.msg('请选择小区')
  568. } else {
  569. this.open = true;
  570. this.selectList = this.LDList;
  571. }
  572. }
  573. },
  574. changeSelectDict(item, index) {
  575. this.openDict = false;
  576. if (this.type == 'isok') {
  577. this.isOkValue = item
  578. } else if (this.type == 'gczq') {
  579. this.projectValue = item
  580. if (!this.isEmpty(this.XQValue.id)) {
  581. //房间选完 判断 工程周期 工程周期切换
  582. this.getStatus();
  583. }
  584. } else if (this.type == 'xzq') {
  585. this.XZQValue = item;
  586. //根据行政区id获取小区数据
  587. this.XQValue = ''; //重置小区数据
  588. this.LDValue = ''; //重置楼栋数据
  589. getAreaList(item.dictValue).then(res => {
  590. this.XQList = res.data;
  591. })
  592. }
  593. },
  594. changeSelect(item, index) {
  595. this.open = false;
  596. if (this.type == 'xq') {
  597. this.XQValue = item;
  598. if (!this.isEmpty(this.projectValue.dictValue)) {
  599. //小区选完 判断 工程周期
  600. this.getStatus();
  601. }
  602. //根据小区id 获取楼栋数据
  603. this.LDValue = ''; //重置楼栋数据
  604. this.DYValue = ''; //重置单元数据
  605. this.FJValue = ''; //重置房间数据
  606. getBuildingList(item.id).then(res => {
  607. this.LDList = res.data
  608. })
  609. } else if (this.type == 'ld') {
  610. this.LDValue = item;
  611. if (!this.isEmpty(this.projectValue.dictValue)) {
  612. //楼栋选完 判断 工程周期
  613. this.getStatus();
  614. }
  615. }
  616. },
  617. //关闭弹窗
  618. close(e) {
  619. this.open = false
  620. },
  621. //关闭弹窗
  622. closeDict(e) {
  623. this.openDict = false
  624. },
  625. getStatus() {
  626. let unitId = '';
  627. let houseId = '';
  628. let buildingId = '';
  629. if (this.isEmpty(this.LDValue.id)) {
  630. buildingId = '';
  631. } else {
  632. buildingId = this.LDValue.id
  633. }
  634. let param = {
  635. areaId: this.XQValue.id, // 小区id
  636. buildingId: buildingId, // 楼宇id
  637. unitId: unitId,
  638. houseId: houseId, //传空
  639. enginCycle: this.projectValue.dictValue, // 工程周期
  640. enginType: this.objValue.enginType, //写死 上一页面传过来的
  641. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  642. }
  643. getRoomProjectId(param).then(res => {
  644. if (res.code == '200') {
  645. if (res.data != null && res.data.zEngineeringNodeBoList != null) {
  646. res.data.zEngineeringNodeBoList.forEach((item, index) => {
  647. if (this.objValue.enginClassValue == item.type) {
  648. this.reviewStatus = item.reviewStatus;
  649. if (item.reviewStatus == '1')
  650. this.$modal.msg('当前工程已结束')
  651. }
  652. })
  653. } else {
  654. this.reviewStatus = '' //置空
  655. }
  656. } else {
  657. this.$modal.msg(res.msg)
  658. this.reviewStatus = '' //置空
  659. }
  660. })
  661. },
  662. //提交数据
  663. submit() {
  664. if (this.isEmpty(this.projectValue.dictValue)) {
  665. this.$modal.msg("请选择工程周期")
  666. return
  667. }
  668. if (this.isEmpty(this.XZQValue.dictValue)) {
  669. this.$modal.msg("请选择行政区")
  670. return
  671. }
  672. if (this.isEmpty(this.XQValue.id)) {
  673. this.$modal.msg("请选择小区")
  674. return
  675. }
  676. // else if (this.isEmpty(this.LDValue.id)) {
  677. // this.$modal.msg("请选择楼栋")
  678. // }
  679. if (this.imgBoxArr.length <= 0) {
  680. this.$modal.msg('请上传调压箱名牌照片')
  681. return
  682. }
  683. if (this.imgSfhtArr.length <= 0) {
  684. this.$modal.msg('请上传调压箱内石粉回填照片')
  685. return
  686. }
  687. if (this.imgFljdArr.length <= 0) {
  688. this.$modal.msg('请上传调压箱防雷接地照片')
  689. return
  690. }
  691. if (this.imgDtljArr.length <= 0) {
  692. this.$modal.msg('请上传调压箱底腿连接照片')
  693. return
  694. }
  695. if (this.imgHldmyhArr.length <= 0) {
  696. this.$modal.msg('请上传调压箱护栏及地面硬化(远景)照片')
  697. return
  698. }
  699. if (this.loading == false) {
  700. this.$modal.msg('照片或视频未上传完毕,无法提交!')
  701. return
  702. }
  703. //提交
  704. this.onsubmit();
  705. },
  706. onsubmit() {
  707. let unitId = '';
  708. let houseId = '';
  709. let buildingId = '';
  710. if (this.isEmpty(this.LDValue.id)) {
  711. buildingId = '';
  712. } else {
  713. buildingId = this.LDValue.id
  714. }
  715. //提交
  716. let param = {
  717. district: this.XZQValue.dictValue,
  718. areaId: this.XQValue.id,
  719. buildingId: buildingId, //不必传 如果没有传 ' '
  720. unitId: unitId,
  721. houseId: houseId, //传空
  722. enginType: this.objValue.enginType, //写死 上一页面传过来的
  723. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  724. enginCycle: this.projectValue.dictValue, //工程周期
  725. zEngineeringNodeBo: {
  726. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  727. zEngineeringInfoBo: {
  728. constructTime: this.time, //施工时间
  729. remark: this.projectContent, //施工内容
  730. boxBrand: this.imgBoxArr,
  731. stonePowder: this.imgSfhtArr,
  732. lightning: this.imgFljdArr,
  733. bottomLeg: this.imgDtljArr,
  734. groundHardening: this.imgHldmyhArr,
  735. }
  736. }
  737. }
  738. uni.showLoading()
  739. addTearOldPipe(param).then(res => {
  740. if (res.code == '200') {
  741. uni.hideLoading()
  742. uni.showToast({
  743. title: res.msg,
  744. icon: 'none',
  745. //显示持续时间为 3秒
  746. duration: 2000
  747. });
  748. setTimeout(function() {
  749. uni.navigateBack();
  750. }, 1000)
  751. }
  752. })
  753. },
  754. history() {
  755. if (this.isEmpty(this.projectValue.dictValue)) {
  756. this.$modal.msg("请选择工程周期")
  757. return
  758. }
  759. if (this.isEmpty(this.XZQValue.dictValue)) {
  760. this.$modal.msg("请选择行政区")
  761. return
  762. }
  763. if (this.isEmpty(this.XQValue.id)) {
  764. this.$modal.msg("请选择小区")
  765. return
  766. }
  767. let unitId = '';
  768. let houseId = '';
  769. let buildingId = '';
  770. if (this.isEmpty(this.LDValue.id)) {
  771. buildingId = '';
  772. } else {
  773. buildingId = this.LDValue.id
  774. }
  775. let param = {
  776. areaId: this.XQValue.id, // 小区id
  777. buildingId: buildingId, // 楼宇id
  778. enginCycle: this.projectValue.dictValue, // 工程周期
  779. unitId: unitId,
  780. houseId: houseId, //传空
  781. enginType: this.objValue.enginType, //写死 上一页面传过来的
  782. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  783. }
  784. getRoomProjectId(param).then(res => {
  785. if (res.code == '200') {
  786. if (res.data != null) {
  787. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  788. res => {
  789. this.historyList = res.data
  790. if (res.data.zEngineeringNodeBo != null) {
  791. this.showHistoryList();
  792. } else {
  793. this.$modal.msg("暂无历史信息")
  794. }
  795. })
  796. } else {
  797. this.$modal.msg("暂无工程信息")
  798. }
  799. } else {
  800. this.$modal.msg(res.msg)
  801. }
  802. })
  803. },
  804. showHistoryList() {
  805. this.$refs.refShare.handleShowShare();
  806. }
  807. }
  808. }
  809. </script>
  810. <style lang="scss">
  811. .container {
  812. display: flex;
  813. align-items: center;
  814. justify-content: space-between;
  815. padding: 10px;
  816. position: relative;
  817. }
  818. .uni-list {
  819. border: 1xp solid #eee;
  820. }
  821. .to-right-icon {
  822. width: 15px;
  823. height: 15px;
  824. position: absolute;
  825. top: 50%;
  826. transform: translateY(-50%);
  827. }
  828. .text {
  829. font-size: 16px;
  830. color: #333;
  831. }
  832. .background {
  833. // border: 15px solid hsla(0, 0%, 100%, .5);
  834. background: white;
  835. background-clip: padding-box;
  836. padding: 20rpx;
  837. border-radius: 20rpx;
  838. margin: 20rpx;
  839. /*从padding开始往外面裁剪背景*/
  840. }
  841. .btn {
  842. width: 715rpx;
  843. height: 69rpx;
  844. background: #79A4F0;
  845. border-radius: 6rpx;
  846. font-size: 25rpx;
  847. font-family: Microsoft YaHei;
  848. font-weight: 400;
  849. color: #FFFFFF;
  850. line-height: 69rpx;
  851. margin-top: 40rpx;
  852. margin-bottom: 100rpx;
  853. }
  854. .number {
  855. display: flex;
  856. /* 水平居中显示子元素 */
  857. align-items: flex-start;
  858. /* 垂直居中显示子元素 */
  859. justify-content: space-between;
  860. /* 左右间距等于间距大小 */
  861. padding: 10px;
  862. /* 设置padding以提高视觉效果 */
  863. }
  864. .textarea {
  865. margin-top: 10upx;
  866. width: 100%;
  867. border: 1rpx solid red;
  868. min-height: 100upx;
  869. line-height: 20px;
  870. }
  871. .tj-btn {
  872. height: 69rpx;
  873. background: #3184f0;
  874. border-radius: 6rpx;
  875. font-size: 25rpx;
  876. font-weight: 400;
  877. color: #FFFFFF;
  878. line-height: 69rpx;
  879. margin: 40rpx 70rpx;
  880. }
  881. .sc-btn {
  882. height: 69rpx;
  883. background: #f0686b;
  884. border-radius: 6rpx;
  885. font-size: 25rpx;
  886. font-weight: 400;
  887. color: #FFFFFF;
  888. line-height: 69rpx;
  889. margin: 40rpx;
  890. }
  891. .num-style {
  892. background: #e8f4f9;
  893. margin: 20rpx;
  894. padding: 10rpx;
  895. border-radius: 20rpx;
  896. border: 1px solid #d4e3f0;
  897. }
  898. </style>