newoverhead.vue 26 KB

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