haoxuan
2024-04-29 caeb71b06d19a8ffd854c19e5e4b58f7180cdce8
src/views/employeeSalary/salaryPlan/components/addDialog.vue
@@ -35,9 +35,9 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="salaryType" label="薪资类型">
        <el-form-item prop="salaryTypeId" label="薪资类型">
          <el-select
            v-model="form.salaryType"
            v-model="form.salaryTypeId"
            style="width: calc(100% - 40px)"
            placeholder="请选择车间"
          >
@@ -45,7 +45,7 @@
              v-for="item in unitList"
              :key="item.id"
              :label="item.name"
              :value="item.name"
              :value="item.id"
            >
            </el-option>
          </el-select>
@@ -169,7 +169,7 @@
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="cancel" @click="cancelMethod()">取消</el-button>
        <el-button type="primary" @click="submitForm('form')">确 定</el-button>
        <el-button type="primary" :loading="isAddloading" @click="submitForm('form')">确 定</el-button>
      </span>
    </el-dialog>
    <BomDialog
@@ -221,15 +221,15 @@
      form: {
        name: "",
        workTypes: [],
        salaryType: "",
        salaryTypeId: null,
        salaryFormula: "",
        salaryFormulaHtml: "",
        error: "",
      },
      // 满勤奖设置
      absenteeism:1,
      absenteeism:{value:1,id:null},
      // 设置野纤的生丝标准
      wildSilkList: ['野纤'],
      wildSilkList: {value:'野纤',id:null},
      activeName: 1,
      formulaName: [
        {
@@ -325,7 +325,7 @@
            trigger: ["blur", "change"],
          },
        ],
        salaryType: [
        salaryTypeId: [
          { required: true, message: "请选择", trigger: ["blur", "change"] },
        ],
        salaryFormulaHtml: [
@@ -334,6 +334,7 @@
      },
      unitList: [],
      constType: "",
      isAddloading: false,
    };
  },
  computed: {},
@@ -363,7 +364,7 @@
        this.form = {
          name: "",
          workTypes: [],
          salaryType: "",
          salaryTypeId: null,
          salaryFormula: "",
          salaryFormulaHtml: "",
          error: "",
@@ -496,14 +497,20 @@
    },
    confirmValueSave(form, type) {
      if (type == 9) {
        this.wildSilkList = form.wildSilkList;
        let wildSilkList = form.wildSilkList;
        this.handleConfirmSave([
          {name:this.wildSilkList.join(',')}
          {
            name:wildSilkList.join(','),
            id:this.wildSilkList.id
          }
        ],type)
      } else if (type == 10) {
        this.absenteeism = form.absenteeism + "";
        let absenteeism = form.absenteeism + "";
        this.handleConfirmSave([
          {name:this.absenteeism}
          {
            name:absenteeism,
            id:this.absenteeism.id
          }
        ],type)
      } else if (type == 3) {
        this.formulaClick(
@@ -547,6 +554,7 @@
          values: dataList,
        }
      }
      this.isAddloading = true;
      saveSalaryType(params).then((res) => {
        if (res.code == 200) {
          this.$message({
@@ -562,14 +570,33 @@
          }
          this.handleGetBomKindDictList(val?val:'');
        }
        this.isAddloading = false;
      }).catch(() => {
                setTimeout(() => {
                  this.isAddloading = false;
                }, 3000);
      });
    },
    handleGetBomKindDictList(val) {
      getSalaryTypeList({ type: val?val:8 }).then((res) => {
        if(val==9){
          this.wildSilkList=(res.data&&res.data.length>0)?res.data[0].name.split(','):['野纤']
          // 野纤的生丝标准配置
          this.wildSilkList=(res.data&&res.data.length>0)?{
            ...res.data[0],
            value:res.data[0].name.split(',')||[]
          }:{
            id:null,
            value:['野纤']
          }
        }else if(val==10){
          this.absenteeism=(res.data&&res.data.length>0)?res.data[0].name:1
          // 考勤配置
          this.absenteeism=(res.data&&res.data.length>0)?{
            ...res.data[0],
            value:res.data[0].name||1
          }:{
            id:null,
            value:1
          }
        }else{
          this.unitList = res.data;
        }