zhengnaiwen_citu 2 месяцев назад
Родитель
Сommit
b22c93cd15

+ 11 - 4
src/views/salary/solution/salaryCoefficient/salarySolutionParam.vue

@@ -120,14 +120,21 @@ export default {
           versionType: 1 // 系数变化
         },
         performanceSolutionDetailRespCategoryVos: this.items.map(e => {
-          e.calculateConfigurations = e.calculateConfigurations.map(item => {
+          const { calculateConfigurations, ...obj } = e
+          const _calculateConfigurations = calculateConfigurations.map(item => {
             if (item.valueCategory !== 0) {
-              item.value = JSON.stringify(item.value)
-              return item
+              const { value, ...rest } = item
+              return {
+                value: JSON.stringify(item.value),
+                ...rest
+              }
             }
             return item
           })
-          return e
+          return {
+            calculateConfigurations: _calculateConfigurations,
+            ...obj
+          }
         })
       }
       try {

+ 3 - 3
src/views/sandbox/sandboxAdd.vue

@@ -124,12 +124,12 @@ export default {
       if (this.active === 3) {
         // 开始计算 调用保存接口
         this.loading = true
-        const success = await this.$refs.sandboxParamRefs.onSave()
+        const performanceSolutionId = await this.$refs.sandboxParamRefs.onSave()
         this.loading = false
-        if (!success) {
+        if (!performanceSolutionId) {
           return
         }
-        this.performanceSolutionId = success.performanceSolutionId
+        this.performanceSolutionId = performanceSolutionId
       }
       this.active++
       this.ref.init && this.ref.init(this.descriptionValues[this.active - 1].id)

+ 12 - 5
src/views/sandbox/sandboxParam.vue

@@ -109,19 +109,26 @@ export default {
           versionType: 1 // 系数变化
         },
         performanceSolutionDetailRespCategoryVos: this.items.map(e => {
-          e.calculateConfigurations = e.calculateConfigurations.map(item => {
+          const { calculateConfigurations, ...obj } = e
+          const _calculateConfigurations = calculateConfigurations.map(item => {
             if (item.valueCategory !== 0) {
-              item.value = JSON.stringify(item.value)
-              return item
+              const { value, ...rest } = item
+              return {
+                value: JSON.stringify(item.value),
+                ...rest
+              }
             }
             return item
           })
-          return e
+          return {
+            calculateConfigurations: _calculateConfigurations,
+            ...obj
+          }
         })
       }
       try {
         const { data } = await saveSalaryParamForSandbox(query)
-        return data
+        return data.performanceSolutionId
       } catch (error) {
         this.$message.error(error)
       }