Lou
2024-02-19 7bd85d5a6d9b2586387cbcff1cdcadfc6c1c95a6
subPackage/label/check.vue
@@ -97,7 +97,9 @@
   } from "@/api/place/place.js"
   import {
      savePlaceCheck
      savePlaceCheck,
      getPlaceCheckDetail,
      updatePlaceCheck
   } from "@/api/reporting/reporting.js"
   export default {
@@ -148,17 +150,59 @@
            ],
            time: Number(new Date()),
            showSelectDate: false,
            dangerCount: 0 //隐患项数量
            dangerCount: 0, //隐患项数量
            isEdit: false
         }
      },
      onLoad(option) {
         this.info.houseCode = uni.getStorageSync("siteInfo").houseCode;
         this.info.placeName = uni.getStorageSync("siteInfo").name;
         this.getItem();
      async onLoad(option) {
         await this.getItem();
         if (option.taskId) {
            this.isEdit = true;
            this.getDetail(option.taskId)
         } else {
            this.info.houseCode = uni.getStorageSync("siteInfo").houseCode;
            this.info.placeName = uni.getStorageSync("siteInfo").name;
         }
      },
      methods: {
         getDetail(id) {
            getPlaceCheckDetail({
               taskId: id
            }).then(res => {
               let data = res.data;
               for (let i = 0, ii = this.questionList.length; i < ii; i++) {
                  for (let k = 0, kk = this.questionList[i].children.length; k < kk; k++) {
                     for (let j = 0, jj = data.taskPlaceRecordVOList.length; j < jj; j++) {
                        if (this.questionList[i].children[k].id == data.taskPlaceRecordVOList[j].itemId) {
                           let children = this.questionList[i]
                           children.children[k].state = data.taskPlaceRecordVOList[j].state;
                           if (data.taskPlaceRecordVOList[j].imageUrls) {
                              children.children[k].urls = this.$setImageUrl(data.taskPlaceRecordVOList[j]
                                 .imageUrls, 2);
                           }
                           children.children[k].remark = data.taskPlaceRecordVOList[j].remark || "";
                           this.$set(this.questionList, i, children)
                        }
                     }
                  }
               }
               this.info.remark = data.remark;
               if (data.signaturePath) {
                  this.signatureUrl = this.$setFullUrl(data.signaturePath);
                  this.info.signaturePath = data.signaturePath;
               }
               this.form.images = this.$setImageUrl(data.imageUrls, 2)
            })
         },
         getItem() {
            getPlaceCheckItem().then(res => {
               let data = res.data;
@@ -328,18 +372,34 @@
            this.info.taskPlaceRecordVOList = this.getSelected()
            this.info.status = 1;
            savePlaceCheck(this.info).then(res => {
               uni.hideLoading();
               uni.showToast({
                  icon: 'success',
                  title: '提交成功',
                  success() {
                     setTimeout(() => {
                        uni.navigateBack();
                     }, 300)
                  }
            if (this.isEdit) {
               updatePlaceCheck(this.info).then(res => {
                  uni.hideLoading();
                  uni.showToast({
                     icon: 'success',
                     title: '提交成功',
                     success() {
                        setTimeout(() => {
                           uni.navigateBack();
                        }, 300)
                     }
                  })
               })
            })
            } else {
               savePlaceCheck(this.info).then(res => {
                  uni.hideLoading();
                  uni.showToast({
                     icon: 'success',
                     title: '提交成功',
                     success() {
                        setTimeout(() => {
                           uni.navigateBack();
                        }, 300)
                     }
                  })
               })
            }
         },
         previewImg() {