薪资方案模块 配置野纤生丝标准的获取接口联调,数据处理+保存配置野纤的接口联调
3个文件已修改
110 ■■■■■ 已修改文件
src/views/employeeSalary/salaryPlan/components/SilkSetDialog.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/addDialog.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/employeeSalary/salaryPlan/components/SilkSetDialog.vue
@@ -7,11 +7,11 @@
       :model="form" 
       label-width="300px"
        label-position="top">
        <el-form-item label="请选择野纤包含那几个生丝标准:" prop="purchaseTypeList">
              <el-checkbox-group v-model="form.purchaseTypeList">
        <el-form-item label="请选择野纤包含那几个生丝标准:" prop="wildSilkList">
              <el-checkbox-group v-model="form.wildSilkList">
                <el-checkbox
                  v-for="item in silkSetList"
                  :label="item.id"
                  :label="item.value"
                  :key=item.id
                  >{{ item.value }}</el-checkbox
                >
@@ -43,11 +43,11 @@
      islook: false,
      silkSetList:getDataByType('silkSet'),
      form: {
        purchaseTypeList:[1],
        wildSilkList:['野纤'],
      },
      rules: {
        // 采购类型
        purchaseTypeList: [
        wildSilkList: [
          { required: true, message: "请选择", trigger: ["blur",'change'] },
        ],
      },
@@ -70,8 +70,7 @@
    onSubmit() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('confirmValueSave',this.form,1)
          this.shutdown()
          this.$emit('confirmValueSave',this.form,9)
        }
      });
    },
src/views/employeeSalary/salaryPlan/components/addDialog.vue
@@ -142,7 +142,7 @@
                    v-if="item.type == 2"
                    class="el-icon-setting margin_left_5px cursor_pointer"
                    style="font-size: 18px; color: gray"
                    @click="handleConstSetShow(2)"
                    @click="handleConstSetShow(10)"
                  ></i>
                </div>
              </div>
@@ -181,15 +181,15 @@
    <SilkSetDialog
      ref="silkSetDialog"
      @confirmValueSave="confirmValueSave"
      :editRow="form"
      :editRow="{wildSilkList:wildSilkList}"
      title="配置"
    ></SilkSetDialog>
    <ConstantSetDialog
      ref="constantSetDialog"
      @confirmValueSave="confirmValueSave"
      :constType="constType"
      :editRow="form"
      :title="constType == 2 ? '配置' : '输入'"
      :editRow="constType == 10?{absenteeism:absenteeism}:form"
      :title="constType == 10 ? '配置' : '输入'"
    ></ConstantSetDialog>
  </div>
</template>
@@ -225,9 +225,11 @@
        salaryFormula: "",
        salaryFormulaHtml: "",
        error: "",
        purchaseTypeList: [1],
        cycle: "1",
      },
      // 满勤奖设置
      absenteeism:1,
      // 设置野纤的生丝标准
      wildSilkList: ['野纤'],
      activeName: 1,
      formulaName: [
        {
@@ -337,6 +339,8 @@
  computed: {},
  created() {
    this.handleGetBomKindDictList();
    this.handleGetBomKindDictList(9);
    this.handleGetBomKindDictList(10);
    this.getSelectDataList();
  },
  mounted() {},
@@ -363,8 +367,6 @@
          salaryFormula: "",
          salaryFormulaHtml: "",
          error: "",
          purchaseTypeList: [1],
          cycle: "1",
        };
        this.$nextTick(() => {
          this.$refs["form"].resetFields();
@@ -375,8 +377,7 @@
              : "";
            this.form.salaryFormulaHtml = "";
            this.form.salaryFormula = "";
            this.form.purchaseTypeList = [1];
            let arr = salaryFormula ? salaryFormula.split(",") : [];
            let arr = salaryFormula ? salaryFormula.split(",") : [];
            this.getSalaryFormulaHtml(arr);
          }
        });
@@ -418,7 +419,7 @@
          name +
          "</span>";
      }
      this.form.salaryFormula = this.form.salaryFormula + name + ",";
      this.form.salaryFormula = this.form.salaryFormula + name + ",";
      this.form.salaryFormulaHtml = this.form.salaryFormulaHtml + string;
      this.$forceUpdate();
    },
@@ -426,7 +427,7 @@
      let salaryFormula = this.form.salaryFormula
              ? this.form.salaryFormula
              : "";
      let arr = salaryFormula.split(",");
      let arr = salaryFormula.split(",");
      arr = arr.splice(0, arr.length - 1);
      arr = arr.splice(0, arr.length - 1);
      this.form.salaryFormulaHtml = "";
@@ -437,7 +438,7 @@
      if (this.form.salaryFormula) {
        let string = true;
        let isString = "+-*/";
        let arr = this.form.salaryFormula.split(",");
        let arr = this.form.salaryFormula.split(",");
        arr = arr.splice(0, arr.length - 1);
        for (let i = 0; i < arr.length; i++) {
          if (arr[i] != "") {
@@ -494,10 +495,16 @@
      }
    },
    confirmValueSave(form, type) {
      if (type == 1) {
        this.form.purchaseTypeList = form.purchaseTypeList;
      } else if (type == 2) {
        this.form.cycle = form.cycle + "";
      if (type == 9) {
        this.wildSilkList = form.wildSilkList;
        this.handleConfirmSave([
          {name:this.wildSilkList.join(',')}
        ],type)
      } else if (type == 10) {
        this.absenteeism = form.absenteeism + "";
        this.handleConfirmSave([
          {name:this.absenteeism}
        ],type)
      } else if (type == 3) {
        this.formulaClick(
          {
@@ -511,11 +518,15 @@
    },
    // 野纤数量
    handleSlikSetShow() {
      this.handleGetBomKindDictList(9);
      this.$refs.silkSetDialog.islook = true;
    },
    // 满勤奖
    handleConstSetShow(val) {
      this.constType = val;
      if(val==10){
        this.handleGetBomKindDictList(10);
      }
      this.$refs.constantSetDialog.islook = true;
    },
    // 单位
@@ -523,24 +534,46 @@
      this.handleGetBomKindDictList();
      this.$refs.editDialog.editDialogVisible = true;
    },
    handleConfirmSave(dataList) {
      saveSalaryType({
        type: 8,
        values: dataList,
      }).then((res) => {
    handleConfirmSave(dataList,val) {
      let params={}
      if(val==9||val==10){
        params={
          type: val,
          values: dataList,
        }
      }else{
        params={
          type: 8,
          values: dataList,
        }
      }
      saveSalaryType(params).then((res) => {
        if (res.code == 200) {
          this.$message({
            message: "操作成功!",
            type: "success",
          });
          this.$refs.editDialog.editDialogVisible = false;
          this.handleGetBomKindDictList();
          if(val==9){
            this.$refs.silkSetDialog.islook = false;
          }else  if(val==10){
            this.$refs.constantSetDialog.islook = false;
          }else{
            this.$refs.editDialog.editDialogVisible = false;
          }
          this.handleGetBomKindDictList(val?val:'');
        }
      });
    },
    handleGetBomKindDictList() {
      getSalaryTypeList({ type: 8 }).then((res) => {
        this.unitList = res.data;
    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(','):['野纤']
        }else if(val==10){
          this.absenteeism=(res.data&&res.data.length>0)?res.data[0].name:1
        }else{
          this.unitList = res.data;
        }
      });
    },
    getSelectDataList() {
@@ -570,13 +603,9 @@
            return true;
          }
          let form = JSON.parse(JSON.stringify(this.form));
          let arr = form.salaryFormula.split(",");
          let arr = form.salaryFormula.split(",");
          arr = arr.splice(0, arr.length - 1);
          form.salaryFormula = arr.join(",");
          if (form.purchaseTypeList.length == 0) {
            this.$message.error("请点击野纤数量配置生丝标准!");
            return true;
          }
          form.salaryFormula = arr.join(",");
          let workTypes = [];
          if (form.workTypes && form.workTypes.length > 0) {
            for (let i in form.workTypes) {
src/views/employeeSalary/salaryPlan/index.vue
@@ -117,7 +117,7 @@
                  }
                }
                let salaryFormulaValue=''
                salaryFormulaValue=item.salaryFormula?item.salaryFormula.split(",").join(''):[]
                salaryFormulaValue=item.salaryFormula?item.salaryFormula.split(",").join(''):[]
                return {
                  ...item,
                  workTypeNames:workTypeNames,