Explorar el Código

fix: 核查健壮性增加

梦辉 hace 3 meses
padre
commit
ee478074fe

+ 4 - 3
src/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue

@@ -89,8 +89,8 @@ export default {
           indicatorInput: indicateItem.indicatorInput,
           indicatorInputBody: indicateItem.indicatorInputBody,
           auditor: uni.getStorageSync("userInfo").realName,
-          auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult).value,
-          auditScore: this.checkGoalColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditScore).value,
+          auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult) && this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult).value,
+          auditScore: this.checkGoalColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditScore) && this.checkGoalColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditScore).value,
           auditRemark: this.formStates[indicateItem.uuid].auditRemark,
           //文件上传字段
           expandStr: this.formStates[indicateItem.uuid].fileList.map(item => item.uuid).join(','),
@@ -99,7 +99,8 @@ export default {
       ]).then(res => {
         if (res.code === 0) {
           this.$toast('核查成功')
-          window.location.reload()
+        }else {
+          this.$toast('核查失败' + res.msg)
         }
       })
     },

+ 18 - 15
src/subPages/pages/commitment/commitmentDetail/index.vue

@@ -12,7 +12,9 @@ export default {
     return {
       actionSheetShow: false,
       currentStep: 0,
-      batchCheckForm:{}
+      batchCheckForm:{
+        fileList:[]
+      }
     };
   },
   computed: {
@@ -29,15 +31,7 @@ export default {
     },
     indicatorList:{
       get() {
-        return this.$store.state.template.indicatorList.map(item => {
-          if (item.indicatorInputBody) {
-            item.indicatorInputBody = item.indicatorInputBody.replace('&', item.inputBody + item.inputSegment)
-          }
-          return {
-            ...item,
-            selectValue: item.selectValue || 0
-          }
-        })
+        return this.$store.state.template.indicatorList
       },
       set(value) {
         this.$store.commit('template/setIndicatorList', value)
@@ -92,16 +86,25 @@ export default {
       const result = []
       this.indicatorList.forEach(item => {
         result.push({
-          ...item,
-          ...this.batchCheckForm
+          "uuid": item.item,
+          "promiseId": item.promiseId,
+          "indicatorId": item.indicatorId,
+          "indicatorInput": item.indicatorInput,
+          "indicatorInputBody": item.indicatorInputBody,
+          "auditor": uni.getStorageSync("userInfo").realName,
+          "auditResult": this.batchCheckForm.auditResult,
+          "auditScore": this.batchCheckForm.auditScore,
+          "auditRemark": this.batchCheckForm.auditRemark,
+          "expandStr": this.batchCheckForm.fileList.map(item => item.uuid).join(','),
         })
       })
-      (result).then( async res => {
+      editVerifyTask(result).then( async res => {
         if (res.code === 0) {
           this.$toast('核查成功')
           this.actionSheetShow = false
           await this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
-          window.location.reload()
+        }else{
+          this.$toast('核查失败' + res.msg)
         }
       })
     }
@@ -148,7 +151,7 @@ export default {
             <template #footer>
               <view style="margin: 16px;">
                 <van-button round block type="info" @click="handlePrevStep">上一步</van-button>
-                <van-button round block type="info" @click="onCheckResultSubmit">核查确认</van-button>
+                <van-button style="margin-top: 20px" round block type="info" @click="onCheckResultSubmit">核查确认</van-button>
               </view>
             </template>
           </CommitmentConfirmForm>

+ 12 - 11
src/subPages/pages/commitment/components/commitmentConfirmForm/index.vue

@@ -3,23 +3,24 @@ import {uploadFile} from "@/api/commitment";
 import {v4 as uuidv4} from "uuid";
 
 export default {
-  props:{
-    value:{
+  props: {
+    value: {
       type: Object,
-      default: ()=>{}
+      default: () => {
+      }
     }
   },
-  computed:{
-    formStates:{
-      get(){
+  computed: {
+    formStates: {
+      get() {
         return this.value
       },
-      set(value){
+      set(value) {
         this.$emit('input', value)
       }
     }
   },
-  data(){
+  data() {
     return {
       checkResultColumns: [
         {
@@ -53,7 +54,7 @@ export default {
       checkScorePopupVisible: false,
     }
   },
-  methods:{
+  methods: {
     handleCheckResultConfirm(value) {
       this.formStates.auditResult = value.text
       this.checkResultPopupVisible = false
@@ -76,8 +77,8 @@ export default {
         file: file
       }).then(res => {
         if (res.code === 0) {
-              this.formStates.fileList.push({
-                uuid: res.data,
+          this.formStates.fileList.push({
+            uuid: res.data,
             url: URL.createObjectURL(file.file)
           })
         }