Lou
2024-01-16 db8e416fec0ab844026eb7bc91d9f59a457f4e6e
subPackage/label/bail.vue
@@ -67,7 +67,9 @@
<script>
   import uploadMixin from "@/mixin/uploadMixin";
   import {
      saveBailReporting
      saveBailReporting,
      getBailReportingDetail,
      updateBailReporting
   } from "@/api/reporting/reporting";
   export default {
      mixins: [uploadMixin],
@@ -131,10 +133,18 @@
               }
            },
            showSelectDate: false,
            applyTime: Number(new Date())
            applyTime: Number(new Date()),
            status: "",
            isEdit: false
         }
      },
      onLoad(option) {
         if (option.id) {
            this.isEdit = true;
            this.getDetail(option.id)
         }
         let siteInfo = uni.getStorageSync("siteInfo");
         let userInfo = uni.getStorageSync("userInfo");
         this.$set(this.info, "houseCode", siteInfo.houseCode);
@@ -150,6 +160,29 @@
      },
      methods: {
         getDetail(id) {
            getBailReportingDetail({
               taskId: id
            }).then(res => {
               if (res.code == 200) {
                  for (let i in this.info) {
                     this.info[i] = res.data[i]
                  }
                  this.info.reportType = 1;
                  this.status = data.confirmFlag;
                  if (res.data.applyTime) {
                     this.applyTime = Number(new Date(res.data.applyTime))
                  }
                  this.form.images = this.$setImageUrl(data.locationImageUrls, 2);
                  this.info.locationImageUrls = data.locationImageUrls;
                  this.info.id = data.id;
                  this.info.taskId = data.taskId;
               }
            })
         },
         getLocation() {
            uni.chooseLocation({
@@ -195,20 +228,40 @@
         sumitInfo() {
            this.$refs.form.validate().then(valid => {
               this.checkImages();
               saveBailReporting(this.info).then(res => {
                  uni.showToast({
                     icon: 'success',
                     title: '提交成功',
                     success() {
                        setTimeout(() => {
                           // this.$u.func.globalNavigator("", "navBack")
                           uni.navigateBack()
                        }, 1000)
                     }
                  })
               })
               if (this.isEdit) {
                  this.info.status = 1;
                  this.updateRequest()
               } else {
                  this.addRequest()
               }
            })
         },
         addRequest() {
            saveBailReporting(this.info).then(res => {
               uni.showToast({
                  icon: 'success',
                  title: '提交成功'
               })
               setTimeout(() => {
                  uni.navigateBack()
               }, 300)
            })
         },
         updateRequest() {
            updateBailReporting(this.info).then(res => {
               uni.showToast({
                  icon: 'success',
                  title: '保存成功'
               })
               setTimeout(() => {
                  uni.navigateBack()
               }, 300)
            })
         },
         navigatorPage() {
            this.$u.func.globalNavigator('bailList', "navTo")
         }