courtyard.vue 28 KB

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