zhengnaiwen_citu 6 місяців тому
батько
коміт
b056fb5bdb

+ 1 - 0
src/views/salary/solution/salarySolution/salarySolutionRules.vue

@@ -119,6 +119,7 @@ export default {
       }
     },
     async onSure () {
+      console.log(this.$refs)
       // 验证
       Promise.all(this.$refs.salarySolutionRulesEditRefs.map(e => e.valid())).then(async data => {
         try {

+ 7 - 1
src/views/salary/solution/salarySolution/salarySolutionRulesEdit.vue

@@ -122,7 +122,9 @@ export default {
     valid () {
       return new Promise((resolve, reject) => {
         const check = this.items.every(e => {
-          console.log(111, this.$refs[`salarySolutionRulesEditParamRefs${e.index}`].valid())
+          if (!this.$refs[`salarySolutionRulesEditParamRefs${e.index}`]) {
+            return true
+          }
           return this.$refs[`salarySolutionRulesEditParamRefs${e.index}`].valid()
         })
         if (!check) {
@@ -154,6 +156,10 @@ export default {
     },
     getValue () {
       const calculateConfigurations = this.items.map(e => {
+        if (!this.$refs[`salarySolutionRulesEditParamRefs${e.index}`]) {
+          const { index, ...obj } = e
+          return obj
+        }
         return this.$refs[`salarySolutionRulesEditParamRefs${e.index}`].getValue()
       })
       return {