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. }
  280. },
  281. created() {
  282. this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
  283. },
  284. onLoad(options) {
  285. if ('params' in options) {
  286. this.objValue = JSON.parse(decodeURIComponent(options.params));
  287. if (this.objValue.enginType == `old_renovation`) {
  288. this.title = '旧改工程-庭院'
  289. } else if (this.objValue.enginType == `new_built`) {
  290. this.title = '新建工程-庭院'
  291. }
  292. uni.setNavigationBarTitle({
  293. title: this.title
  294. })
  295. }
  296. },
  297. methods: {
  298. // 打开picker
  299. openDatetimePicker(type) {
  300. this.timeType = type;
  301. this.$refs.myPicker.show();
  302. },
  303. // 关闭picker
  304. closeDatetimePicker() {
  305. this.$refs.myPicker.hide();
  306. },
  307. handleSubmit(e) {
  308. if (this.timeType == 'ht') {
  309. this.BackfillingTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  310. } else {
  311. this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  312. }
  313. },
  314. //获取当前时间
  315. traversalTime(timestamp) {
  316. //timestamp(时间戳)是整数,否则要parseInt转换
  317. let time = new Date(timestamp);
  318. let y = time.getFullYear();
  319. let m = time.getMonth() + 1;
  320. let d = time.getDate();
  321. let h = time.getHours();
  322. let mm = time.getMinutes();
  323. let s = time.getSeconds();
  324. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  325. mm) + ':' + this.addTimes(s);
  326. },
  327. addTimes(m) {
  328. return m < 10 ? '0' + m : m
  329. },
  330. //判断是否选择
  331. isEmpty(str) {
  332. return (!str || 0 === str.length);
  333. },
  334. // 显示历史弹窗
  335. handleShowSheet() {
  336. this.shareState = true;
  337. },
  338. // 隐藏历史弹窗
  339. handleHiddenShare() {
  340. this.shareState = false;
  341. },
  342. showPhoto(index, type) {
  343. let typeArr = [];
  344. let newArr = [];
  345. if (type == 'gspsdcl') {
  346. typeArr = this.imgGuanArr;
  347. } else if (type == 'gdsgjl') {
  348. typeArr = this.imgPipelineArr;
  349. } else {
  350. typeArr = this.imgArr;
  351. }
  352. typeArr.forEach((item, index) => {
  353. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  354. item.substring(item.length - 4) == 'jpeg') {
  355. newArr.push(item)
  356. }
  357. });
  358. uni.previewImage({
  359. current: index,
  360. urls: newArr,
  361. })
  362. },
  363. remove(index, type) {
  364. let content = '';
  365. if (type == 'video') {
  366. content = '是否删除该视频?'
  367. } else {
  368. content = '是否删除该图片?'
  369. }
  370. uni.showModal({
  371. title: '提示',
  372. content: content,
  373. success: (res) => {
  374. if (res.confirm) {
  375. if (type == 'video') {
  376. this.videoArr.splice(index, 1)
  377. } else if (type == 'gspsdcl') {
  378. this.imgGuanArr.splice(index, 1)
  379. } else if (type == 'ggyj') {
  380. this.imgArr.splice(index, 1)
  381. } else if (type == 'gdsgjl') {
  382. this.imgPipelineArr.slice(index, 1)
  383. }
  384. }
  385. }
  386. })
  387. },
  388. choose(e) {
  389. let _this = this;
  390. if (e == 'video') {
  391. this.choosevideo()
  392. } else {
  393. this.chooseimage(e)
  394. }
  395. },
  396. chooseimage(e) {
  397. let _this = this;
  398. uni.chooseImage({
  399. sourceType: this.objValue.enginType == `old_renovation` ? ['camera'] : ['album', 'camera'],
  400. success(resp) {
  401. resp.tempFiles.forEach((item, index) => {
  402. const task = uni.uploadFile({
  403. url: _this.$HTTP + `/obs`,
  404. filePath: item.path,
  405. name: 'file',
  406. formData: {},
  407. header: _this.headers,
  408. success: res => {
  409. // 判断是否json字符串,将其转为json格式
  410. let data = JSON.parse(res.data);
  411. if (![200].includes(data.code)) {
  412. _this.$modal.msg(data.msg)
  413. } else {
  414. if (_this.progress === 100) {
  415. if (e == 'ggyj') {
  416. _this.imgArr.push(data.data.url)
  417. } else if (e == 'gspsdcl') {
  418. _this.imgGuanArr.push(data.data.url)
  419. } else if (e == 'gdsgjl') {
  420. _this.imgPipelineArr.push(data.data.url)
  421. }
  422. _this.$modal.msg('上传成功!')
  423. }
  424. }
  425. },
  426. fail: e => {
  427. _this.$modal.msg('上传失败!')
  428. //_this.uploadError(index, e);
  429. },
  430. complete: res => {
  431. uni.hideLoading();
  432. _this.uploading = false;
  433. }
  434. });
  435. task.onProgressUpdate(res => {
  436. _this.progress = res.progress;
  437. uni.showLoading({
  438. title: '上传中'
  439. })
  440. if (_this.progress != 100) {
  441. _this.loading = false
  442. } else {
  443. _this.loading = true
  444. }
  445. });
  446. })
  447. },
  448. })
  449. },
  450. choosevideo() {
  451. let _this = this;
  452. uni.chooseVideo({
  453. sourceType: this.objValue.enginType == `old_renovation` ? ['camera'] : ['album', 'camera'],
  454. maxDuration: 30,
  455. success(resp) {
  456. const task = uni.uploadFile({
  457. url: _this.$HTTP + `/obs`,
  458. filePath: resp.tempFilePath,
  459. name: 'file',
  460. formData: {},
  461. header: _this.headers,
  462. success: res => {
  463. // 判断是否json字符串,将其转为json格式
  464. let data = JSON.parse(res.data);
  465. if (![200].includes(res.statusCode)) {
  466. this.uploadError(index, data);
  467. } else {
  468. //上传成功
  469. if (_this.progress === 100) {
  470. _this.videoArr.push(data.data.url)
  471. _this.$modal.msg('上传成功!')
  472. }
  473. }
  474. },
  475. fail: e => {
  476. _this.$modal.msg('上传失败!')
  477. this.uploadError(index, e);
  478. },
  479. complete: res => {
  480. uni.hideLoading();
  481. _this.uploading = false;
  482. }
  483. });
  484. task.onProgressUpdate(res => {
  485. _this.progress = res.progress;
  486. uni.showLoading({
  487. title: '上传中'
  488. })
  489. if (_this.progress != 100) {
  490. _this.loading = false
  491. } else {
  492. _this.loading = true
  493. }
  494. });
  495. },
  496. })
  497. },
  498. pickerShow(e, index) {
  499. this.SelectIndex = index;
  500. this.type = e; //赋值类型
  501. if (e == 'cz') { //材质
  502. this.open = true;
  503. getEnginMaterialQualityList("民用工程", this.objValue.enginType, this.objValue.enginClassification, this
  504. .objValue.enginClassValue).then(
  505. response => {
  506. this.selectList = response.data;
  507. });
  508. } else if (e == 'gg') { //规格
  509. if (this.isEmpty(this.czggslList[index].cz.id)) {
  510. this.$modal.msg('请选择材质')
  511. // this.czggslList[index].cz = this.materialValue.id
  512. } else {
  513. this.open = true;
  514. this.selectList = this.materialList;
  515. }
  516. } else if (e == 'gczq') { //工程周期
  517. this.openDict = true;
  518. getDicts("engin_cycle").then(response => {
  519. this.dictOptions = response.data;
  520. });
  521. } else if (e == 'xzq') { //行政区
  522. if (this.isEmpty(this.projectValue.dictValue)) {
  523. this.$modal.msg('请选择工程周期')
  524. } else {
  525. this.openDict = true;
  526. getDicts("district").then(response => {
  527. this.dictOptions = response.data;
  528. });
  529. }
  530. } else if (e == 'xq') { //小区
  531. // if (this.isEmpty(this.XZQValue.dictValue)) {
  532. // this.$modal.msg('请选择行政区')
  533. //
  534. // } else {
  535. //根据行政区id获取小区数据
  536. // getAreaList('').then(res => {
  537. // this.XQList = res.data;
  538. // this.open = true;
  539. // this.selectList = this.XQList;
  540. // })
  541. // }
  542. if (this.isEmpty(this.XZQValue.dictValue)) {
  543. getAreaList('').then(res => {
  544. this.XQList = res.data;
  545. this.open = true;
  546. this.selectList = this.XQList;
  547. })
  548. } else {
  549. this.open = true;
  550. this.selectList = this.XQList;
  551. }
  552. } else if (e == 'ld') { //楼栋
  553. if (this.isEmpty(this.XQValue.id)) {
  554. this.$modal.msg('请选择小区')
  555. } else {
  556. this.open = true;
  557. this.selectList = this.LDList;
  558. }
  559. }
  560. },
  561. changeSelectDict(item, index) {
  562. this.openDict = false;
  563. if (this.type == 'isok') {
  564. this.isOkValue = item
  565. } else if (this.type == 'gczq') {
  566. this.projectValue = item
  567. if (!this.isEmpty(this.XQValue.id)) {
  568. //房间选完 判断 工程周期 工程周期切换
  569. this.getStatus();
  570. }
  571. } else if (this.type == 'xzq') {
  572. this.XZQValue = item;
  573. //根据行政区id获取小区数据
  574. this.XQValue = ''; //重置小区数据
  575. this.LDValue = ''; //重置楼栋数据
  576. getAreaList(item.dictValue).then(res => {
  577. this.XQList = res.data;
  578. })
  579. }
  580. },
  581. changeSelect(item, index) {
  582. this.open = false;
  583. if (this.type == 'cz') {
  584. this.materialValue = item;
  585. this.specificationValue = ''; //重置规格
  586. this.czggslList[this.SelectIndex].gg.id = ''
  587. this.czggslList[this.SelectIndex].gg.name = ''
  588. //根据材质ID 获取规格数据
  589. getEnginSpecificationsList(item.id).then(res => {
  590. this.materialList = res.data
  591. this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
  592. this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
  593. })
  594. } else if (this.type == 'gg') {
  595. this.specificationValue = item;
  596. this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
  597. this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
  598. } else if (this.type == 'xq') {
  599. this.XZQValue = {
  600. dictValue: item.district,
  601. dictLabel: item.districtName
  602. };
  603. this.XQValue = item;
  604. if (!this.isEmpty(this.projectValue.dictValue)) {
  605. //小区选完 判断 工程周期
  606. this.getStatus();
  607. }
  608. //根据小区id 获取楼栋数据
  609. this.LDValue = ''; //重置楼栋数据
  610. this.DYValue = ''; //重置单元数据
  611. this.FJValue = ''; //重置房间数据
  612. getBuildingList(item.id).then(res => {
  613. this.LDList = res.data
  614. })
  615. } else if (this.type == 'ld') {
  616. this.LDValue = item;
  617. if (!this.isEmpty(this.projectValue.dictValue)) {
  618. //楼栋选完 判断 工程周期
  619. this.getStatus();
  620. }
  621. }
  622. },
  623. //关闭弹窗
  624. close(e) {
  625. this.open = false
  626. },
  627. //关闭弹窗
  628. closeDict(e) {
  629. this.openDict = false
  630. },
  631. getStatus() {
  632. let unitId = '';
  633. let houseId = '';
  634. let buildingId = '';
  635. if (this.isEmpty(this.LDValue.id)) {
  636. buildingId = '';
  637. } else {
  638. buildingId = this.LDValue.id
  639. }
  640. let param = {
  641. areaId: this.XQValue.id, // 小区id
  642. buildingId: buildingId, // 楼宇id
  643. unitId: unitId,
  644. houseId: houseId, //传空
  645. enginCycle: this.projectValue.dictValue, // 工程周期
  646. enginType: this.objValue.enginType, //写死 上一页面传过来的
  647. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  648. }
  649. getRoomProjectId(param).then(res => {
  650. if (res.code == '200') {
  651. if (res.data != null && res.data.zEngineeringNodeBoList != null) {
  652. res.data.zEngineeringNodeBoList.forEach((item, index) => {
  653. if (this.objValue.enginClassValue == item.type) {
  654. this.reviewStatus = item.reviewStatus;
  655. if (item.reviewStatus == '1')
  656. this.$modal.msg('当前工程已结束')
  657. }
  658. })
  659. } else {
  660. this.reviewStatus = '' //置空
  661. }
  662. } else {
  663. this.$modal.msg(res.msg)
  664. this.reviewStatus = '' //置空
  665. }
  666. })
  667. },
  668. //提交数据
  669. submit(e) {
  670. this.tempState = e == 'submit' ? '' : '99'
  671. if (this.isEmpty(this.projectValue.dictValue)) {
  672. this.$modal.msg("请选择工程周期")
  673. return
  674. }
  675. if (this.isEmpty(this.XZQValue.dictValue)) {
  676. this.$modal.msg("请选择行政区")
  677. return
  678. }
  679. if (this.isEmpty(this.XQValue.id)) {
  680. this.$modal.msg("请选择小区")
  681. return
  682. }
  683. // else if (this.isEmpty(this.LDValue.id)) {
  684. // this.$modal.msg("请选择楼栋")
  685. // }
  686. try {
  687. this.czggslList.forEach((list) => {
  688. if (this.isEmpty(list.cz.id)) {
  689. this.$modal.msg('材质不能为空')
  690. throw new Error('End Loop')
  691. }
  692. if (this.isEmpty(list.gg.id)) {
  693. this.$modal.msg('规格不能为空')
  694. throw new Error('End Loop')
  695. }
  696. if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
  697. this.$modal.msg("请输入米数")
  698. throw new Error('End Loop')
  699. }
  700. })
  701. } catch (e) {
  702. if (e.message === 'End Loop') throw e
  703. }
  704. this.zEngineeringMaterialBo = [];
  705. this.czggslList.forEach((list) => {
  706. this.zEngineeringMaterialBo.push({
  707. materialQuality: list.cz.id,
  708. specifications: list.gg.id,
  709. number: list.sl.inputIntegerNumberValue + (list.sl.inputDecimalNumberValue == '' ?
  710. '' : "." + list.sl.inputDecimalNumberValue)
  711. })
  712. })
  713. // if (this.imgPipelineArr.length <= 0) {
  714. // this.$modal.msg('请上传管道施工记录照片')
  715. // return
  716. // }
  717. if (e == 'submit') {
  718. if (this.imgGuanArr.length <= 0) {
  719. this.$modal.msg('请上传管上皮深度测量照片')
  720. return
  721. }
  722. if (this.imgArr.length <= 0) {
  723. this.$modal.msg('请上传管沟远景照片')
  724. return
  725. }
  726. if (this.videoArr.length <= 0) {
  727. this.$modal.msg('请上传视频')
  728. return
  729. }
  730. }
  731. // if (this.loading == false) {
  732. // this.$modal.msg('照片或视频未上传完毕,无法提交!')
  733. // return
  734. // }
  735. //提交
  736. this.onsubmit();
  737. },
  738. onsubmit() {
  739. let unitId = '';
  740. let houseId = '';
  741. let buildingId = '';
  742. if (this.isEmpty(this.LDValue.id)) {
  743. buildingId = '';
  744. } else {
  745. buildingId = this.LDValue.id
  746. }
  747. //提交
  748. let param = {
  749. district: this.XZQValue.dictValue,
  750. areaId: this.XQValue.id,
  751. buildingId: buildingId, //不必传 如果没有传 ' '
  752. unitId: unitId,
  753. houseId: houseId, //传空
  754. enginType: this.objValue.enginType, //写死 上一页面传过来的
  755. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  756. enginCycle: this.projectValue.dictValue, //工程周期
  757. zEngineeringNodeBo: {
  758. type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
  759. zEngineeringInfoBo: {
  760. state: this.tempState,
  761. ductalEpithelium: this.imgGuanArr, //照片集合
  762. //constructionRecords: this.imgPipelineArr,
  763. trenchProspect: this.imgArr,
  764. video: this.videoArr,
  765. constructTime: this.time, //施工时间
  766. remark: this.projectContent, //施工内容
  767. zEngineeringMaterialBo: this.zEngineeringMaterialBo
  768. }
  769. }
  770. }
  771. uni.showLoading()
  772. addTearOldPipe(param).then(res => {
  773. if (res.code == '200') {
  774. uni.hideLoading()
  775. uni.showToast({
  776. title: res.msg,
  777. icon: 'none',
  778. //显示持续时间为 3秒
  779. duration: 2000
  780. });
  781. setTimeout(function() {
  782. uni.navigateBack();
  783. }, 1000)
  784. }
  785. })
  786. },
  787. history() {
  788. this.projectContent = '';
  789. this.imgGuanArr = [];
  790. this.imgArr = [];
  791. this.videoArr = [];
  792. this.zEngineeringMaterialBo = [];
  793. this.czggslList = [];
  794. if (this.isEmpty(this.projectValue.dictValue)) {
  795. this.$modal.msg("请选择工程周期")
  796. return
  797. }
  798. if (this.isEmpty(this.XZQValue.dictValue)) {
  799. this.$modal.msg("请选择行政区")
  800. return
  801. }
  802. if (this.isEmpty(this.XQValue.id)) {
  803. this.$modal.msg("请选择小区")
  804. return
  805. }
  806. let unitId = '';
  807. let houseId = '';
  808. let buildingId = '';
  809. if (this.isEmpty(this.LDValue.id)) {
  810. buildingId = '';
  811. } else {
  812. buildingId = this.LDValue.id
  813. }
  814. let param = {
  815. areaId: this.XQValue.id, // 小区id
  816. buildingId: buildingId, // 楼宇id
  817. enginCycle: this.projectValue.dictValue, // 工程周期
  818. unitId: unitId,
  819. houseId: houseId, //传空
  820. enginType: this.objValue.enginType, //写死 上一页面传过来的
  821. enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
  822. }
  823. getRoomProjectId(param).then(res => {
  824. if (res.code == '200') {
  825. if (res.data != null) {
  826. getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
  827. res => {
  828. this.historyList = res.data
  829. if (res.data.zEngineeringNodeBo != null) {
  830. //this.showHistoryList();
  831. if (res.data.zEngineeringNodeBo.reviewStatus == '1') {
  832. this.$modal.msg("当前步骤以审核通过请谨慎!")
  833. } else if (res.data.zEngineeringNodeBo.reviewStatus == '99') {
  834. let dataJson = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0];
  835. this.projectContent = dataJson.remark;
  836. this.time = dataJson.constructTime;
  837. this.imgGuanArr = dataJson.ductalEpithelium;
  838. this.imgArr = dataJson.trenchProspect;
  839. this.videoArr = dataJson.video;
  840. this.zEngineeringMaterialBo = dataJson.zEngineeringMaterialBo;
  841. this.zEngineeringMaterialBo.forEach((item) => {
  842. this.czggslList.push({
  843. cz: {
  844. id: item.materialQuality,
  845. name: item.materialQualityName
  846. },
  847. gg: {
  848. id: item.specifications,
  849. name: item.specificationsName
  850. },
  851. sl: {
  852. inputIntegerNumberValue: this.getIntegerPart(item.number, 0),
  853. inputDecimalNumberValue: this.getIntegerPart(item.number, 1)
  854. }
  855. })
  856. })
  857. } else {
  858. this.czggslList.push({
  859. cz: {
  860. id: '',
  861. name: ''
  862. },
  863. gg: {
  864. id: '',
  865. name: ''
  866. },
  867. sl: {
  868. inputIntegerNumberValue: '',
  869. inputDecimalNumberValue: ''
  870. }
  871. });
  872. this.$modal.msg("暂无暂存信息")
  873. }
  874. } else {
  875. this.$modal.msg("暂无历史信息")
  876. this.czggslList.push({
  877. cz: {
  878. id: '',
  879. name: ''
  880. },
  881. gg: {
  882. id: '',
  883. name: ''
  884. },
  885. sl: {
  886. inputIntegerNumberValue: '',
  887. inputDecimalNumberValue: ''
  888. }
  889. });
  890. }
  891. })
  892. } else {
  893. this.czggslList.push({
  894. cz: {
  895. id: '',
  896. name: ''
  897. },
  898. gg: {
  899. id: '',
  900. name: ''
  901. },
  902. sl: {
  903. inputIntegerNumberValue: '',
  904. inputDecimalNumberValue: ''
  905. }
  906. });
  907. this.$modal.msg("暂无工程信息")
  908. }
  909. } else {
  910. this.$modal.msg(res.msg)
  911. }
  912. })
  913. },
  914. getIntegerPart(numStr, i) {
  915. return numStr.toString().split('.')[i] == undefined ? '0' : numStr.toString().split('.')[i];
  916. },
  917. showHistoryList() {
  918. this.$refs.refShare.handleShowShare();
  919. }
  920. }
  921. }
  922. </script>
  923. <style lang="scss">
  924. .container {
  925. display: flex;
  926. align-items: center;
  927. justify-content: space-between;
  928. padding: 10px;
  929. position: relative;
  930. }
  931. .uni-list {
  932. border: 1xp solid #eee;
  933. }
  934. .to-right-icon {
  935. width: 15px;
  936. height: 15px;
  937. position: absolute;
  938. top: 50%;
  939. transform: translateY(-50%);
  940. }
  941. .text {
  942. font-size: 16px;
  943. color: #333;
  944. }
  945. .background {
  946. // border: 15px solid hsla(0, 0%, 100%, .5);
  947. background: white;
  948. background-clip: padding-box;
  949. padding: 20rpx;
  950. border-radius: 20rpx;
  951. margin: 20rpx;
  952. /*从padding开始往外面裁剪背景*/
  953. }
  954. .btn {
  955. width: 715rpx;
  956. height: 69rpx;
  957. background: #79A4F0;
  958. border-radius: 6rpx;
  959. font-size: 25rpx;
  960. font-family: Microsoft YaHei;
  961. font-weight: 400;
  962. color: #FFFFFF;
  963. line-height: 69rpx;
  964. margin-top: 40rpx;
  965. margin-bottom: 100rpx;
  966. }
  967. .number {
  968. display: flex;
  969. /* 水平居中显示子元素 */
  970. align-items: flex-start;
  971. /* 垂直居中显示子元素 */
  972. justify-content: space-between;
  973. /* 左右间距等于间距大小 */
  974. padding: 10px;
  975. /* 设置padding以提高视觉效果 */
  976. }
  977. .textarea {
  978. margin-top: 10upx;
  979. width: 100%;
  980. border: 1rpx solid red;
  981. min-height: 100upx;
  982. line-height: 20px;
  983. }
  984. .tj-btn {
  985. height: 69rpx;
  986. background: #3184f0;
  987. border-radius: 6rpx;
  988. font-size: 25rpx;
  989. font-weight: 400;
  990. color: #FFFFFF;
  991. line-height: 69rpx;
  992. margin: 40rpx 70rpx;
  993. }
  994. .sc-btn {
  995. height: 69rpx;
  996. background: #f0686b;
  997. border-radius: 6rpx;
  998. font-size: 25rpx;
  999. font-weight: 400;
  1000. color: #FFFFFF;
  1001. line-height: 69rpx;
  1002. margin: 40rpx;
  1003. }
  1004. .num-style {
  1005. background: #e8f4f9;
  1006. margin: 20rpx;
  1007. padding: 10rpx;
  1008. border-radius: 20rpx;
  1009. border: 1px solid #d4e3f0;
  1010. }
  1011. </style>