diff --git a/src/views/newMap/display/trainingDesign/gradeRules.vue b/src/views/newMap/display/trainingDesign/gradeRules.vue index f257f925b..3cba814c7 100644 --- a/src/views/newMap/display/trainingDesign/gradeRules.vue +++ b/src/views/newMap/display/trainingDesign/gradeRules.vue @@ -21,7 +21,7 @@ - + @@ -138,19 +138,15 @@ export default { this.$emit('cancel', this.source); }, commit() { + console.log('****'); const that = this; this.$refs.form.validate((valid) => { if (valid) { const scoreDetails = []; - let totalScore = 0; for (const key in this.currentStepMap) { - totalScore += this.currentStepMap[key]; scoreDetails.push({elementId: key, score: this.currentStepMap[key]}); } - if (totalScore !== this.addModel.fullMarks) { - this.$message.error('步骤分总和不等于总分!'); - return; - } else if (this.addModel.fullMarks === 0) { + if (this.addModel.fullMarks === 0) { this.$message.error('规则无评分项!'); return; } @@ -167,6 +163,13 @@ export default { }); } }); + }, + stepScoreChange(val) { + let fullMarks = 0; + for (const stepKey in this.currentStepMap) { + fullMarks += this.currentStepMap[stepKey]; + } + this.addModel.fullMarks = fullMarks; } } };