| | |
| | | <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"> |
| | |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | templateName: [ |
| | | { required: true, message: "模板名称不能为空", trigger: "blur" } |
| | | ], |
| | | adjustCoefficient: [ |
| | | { required: true, message: "调整系数不能为空", trigger: "blur" } |
| | | ], |
| | |
| | | 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() { |
| | |
| | | getCheckTemplate(id).then(response => { |
| | | this.form = response.data; |
| | | this.tempRuleFormList = this.form.ruleFormList; |
| | | this.ruleFormList = this.form.ruleFormList; |
| | | this.open = true; |
| | | this.title = "修改考核模板"; |
| | | }); |
| | |
| | | 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 { |