courtyard.vue 31 KB

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