zhengnaiwen_citu 4 mēneši atpakaļ
vecāks
revīzija
e5ce9040e0

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

@@ -24,6 +24,7 @@
                 >
                   <template v-if="calculateConfiguration.valueCategory === 0">
                     <el-input-number
+                      size="small"
                       v-model="calculateConfiguration.value"
                       :min="calculateConfiguration.miniValue"
                       :max="calculateConfiguration.maxValue"
@@ -31,17 +32,19 @@
                     ></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>
+                    <m-table
+                      clearHeader
+                      shadow="never"
+                      :headers="[
+                        { label: '名称', prop: 'name' },
+                        { label: '值', prop: 'value' }
+                      ]"
+                      :items="calculateConfiguration.value"
+                    >
+                      <template #value="{ row }">
+                        <el-input v-model="row.value" size="small" placeholder="请输入对应的值"></el-input>
+                      </template>
+                    </m-table>
                   </template>
                 </el-form-item>
               </el-tab-pane>

+ 9 - 4
src/views/salary/solution/salarySolution/salarySolutionRulesEditParam.vue

@@ -142,20 +142,22 @@ export default {
   },
   methods: {
     setValue (item) {
+      console.log(item)
       const {
         valueCategory,
         value,
+        maxValue,
+        miniValue,
         ...obj
       } = item
       this.formValues = {
         ...obj,
+        maxValue: !maxValue ? undefined : Number(maxValue),
+        miniValue: !miniValue ? undefined : Number(miniValue),
         valueCategory,
         value: valueCategory === 0 ? value : JSON.parse(value)
       }
-      if (valueCategory === 0) {
-        this.formValues.maxValue = this.formValues.maxValue === null ? undefined : this.formValues.maxValue
-        this.formValues.miniValue = this.formValues.miniValue === null ? undefined : this.formValues.miniValue
-      }
+
       if (valueCategory !== 0) {
         this.id = 0
         this.items = JSON.parse(value).map(e => {
@@ -170,6 +172,9 @@ export default {
     onAdd () {
       this.items.push({
         name: null,
+        valueCategory: 0,
+        miniValue: null,
+        maxValue: null,
         value: null,
         index: this.id++
       })