courtyard.vue 34 KB

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