fuliqi
2024-03-12 48197e551b770df9348648ce2188402703774f53
Merge remote-tracking branch 'origin/master'
1个文件已修改
26 ■■■■■ 已修改文件
src/views/system/check-template/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/check-template/index.vue
@@ -106,7 +106,7 @@
        <el-form-item label="模板名称" prop="templateName">
          <el-input v-model="form.templateName" placeholder="请输入模板名称" />
        </el-form-item>
        <el-form-item label="考核规则">
        <el-form-item label="考核规则" prop="tempRuleFormList">
          <div class="row-warp">
            <div class="row" v-for="(form) in tempRuleFormList">
              <div class="row-left">
@@ -211,6 +211,9 @@
      form: {},
      // 表单校验
      rules: {
        templateName: [
          { required: true, message: "模板名称不能为空", trigger: "blur" }
        ],
        adjustCoefficient: [
          { required: true, message: "调整系数不能为空", trigger: "blur" }
        ],
@@ -231,14 +234,14 @@
      this.tempRuleFormList = this.tempRuleFormList.filter(item => item !== form)
    },
    nextAdd() {
      if (this.tempRuleFormList.length === 0) {
        this.tempRuleFormList.push({"ruleId": null, "adjustCoefficient": null})
      } else {
        this.ruleFormList.push(this.tempRuleForm);
        this.tempRuleFormList.push(this.tempRuleForm);
        this.tempRuleForm = {};
      }
      // if (this.tempRuleFormList.length === 0) {
      //   this.tempRuleFormList.push({"ruleId": null, "weight": null})
      // } else {
      //   this.ruleFormList.push(this.tempRuleForm);
      //   this.tempRuleFormList.push(this.tempRuleForm);
      //   this.tempRuleForm = {};
      // }
      this.tempRuleFormList.push({"ruleId": null, "weight": null})
    },
    // 考核规则下拉数据
    selectCheckRule() {
@@ -307,6 +310,7 @@
      getCheckTemplate(id).then(response => {
        this.form = response.data;
        this.tempRuleFormList = this.form.ruleFormList;
        this.ruleFormList = this.form.ruleFormList;
        this.open = true;
        this.title = "修改考核模板";
      });
@@ -315,11 +319,13 @@
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.ruleFormList = this.ruleFormList;
          this.form.ruleFormList = this.tempRuleFormList;
          if (this.form.id != null) {
            updateCheckTemplate(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.tempRuleFormList = [];
              this.form = {};
              this.getList();
            });
          } else {