newoverhead.vue 28 KB

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