newoverhead.vue 27 KB

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