浏览代码

参数配置

zhengnaiwen_citu 6 月之前
父节点
当前提交
f8426a0a07
共有 1 个文件被更改,包括 31 次插入3 次删除
  1. 31 3
      src/views/salary/solution/salaryCoefficient/salarySolutionParam.vue

+ 31 - 3
src/views/salary/solution/salaryCoefficient/salarySolutionParam.vue

@@ -15,13 +15,33 @@
                 :name="item.category"
               >
                 <el-form-item
-                  label-width="250px"
+                  label-width="100px"
                   v-for="(calculateConfiguration, index) in item.calculateConfigurations"
                   :key="index"
                   :label="calculateConfiguration.name"
                   class="mt-3"
                 >
-                  <el-input-number v-model="calculateConfiguration.value" :min="0" :step="0.1"></el-input-number>
+                  <template v-if="calculateConfiguration.valueCategory === 0">
+                    <el-input-number
+                      v-model="calculateConfiguration.value"
+                      :min="calculateConfiguration.minValue ? Number(calculateConfiguration.minValue) : undefined"
+                      :max="calculateConfiguration.maxValue ? Number(calculateConfiguration.maxValue) : undefined"
+                      :step="0.1"
+                    ></el-input-number>
+                  </template>
+                  <template v-else>
+                    <m-card shadow="never">
+                      <el-form-item
+                        v-for="(item, index) in calculateConfiguration.value"
+                        :key="index"
+                        :label="item.name"
+                        label-width="100px"
+                        class="mt-3"
+                      >
+                        <el-input v-model="item.value" placeholder="请输入对应的值"></el-input>
+                      </el-form-item>
+                    </m-card>
+                  </template>
                 </el-form-item>
               </el-collapse-item>
             </el-collapse>
@@ -60,7 +80,15 @@ export default {
           performanceSolutionId: item.performanceSolutionId
         })
 
-        this.items = data.performanceSolutionDetailRespCategoryVos
+        this.items = data.performanceSolutionDetailRespCategoryVos.map(e => {
+          e.calculateConfigurations = e.calculateConfigurations.map(item => {
+            if (item.valueCategory !== 0) {
+              item.value = JSON.parse(item.value)
+            }
+            return item
+          })
+          return e
+        })
         this.activeNames = this.items.map(item => item.category)
       } catch (error) {
         this.$message.error(error)