实训 评分代码调整
This commit is contained in:
parent
402eb691d1
commit
718c69c04b
@ -43,7 +43,7 @@
|
|||||||
width="200"
|
width="200"
|
||||||
>
|
>
|
||||||
<template v-if="addModel.memberId==scope.row.memberId" slot-scope="scope">
|
<template v-if="addModel.memberId==scope.row.memberId" slot-scope="scope">
|
||||||
<el-input-number v-model="currentStepMap['step' + scope.row.id]" style="width:145px" :min="0" size="mini" :step="1" />
|
<el-input-number v-model="currentStepMap[scope.row.id]" style="width:145px" :min="0" size="mini" :step="1" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -134,17 +134,17 @@ export default {
|
|||||||
},
|
},
|
||||||
changeMember(memberId) {
|
changeMember(memberId) {
|
||||||
const currentStepMap = {};
|
const currentStepMap = {};
|
||||||
|
this.allstepList.forEach(each=>{
|
||||||
|
if (each.memberId == memberId) {
|
||||||
|
currentStepMap[each.id] = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
if (this.gradeRulesMap[memberId]) {
|
if (this.gradeRulesMap[memberId]) {
|
||||||
this.addModel.fullMarks = this.gradeRulesMap[memberId].fullMarks;
|
this.addModel.fullMarks = this.gradeRulesMap[memberId].fullMarks;
|
||||||
this.gradeRulesMap[memberId].details.forEach(each=>{
|
this.gradeRulesMap[memberId].details.forEach(each=>{
|
||||||
currentStepMap['step' + each.elementId] = each.score;
|
currentStepMap[each.elementId] = each.score;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.allstepList.forEach(each=>{
|
|
||||||
if (each.memberId == memberId) {
|
|
||||||
currentStepMap['step' + each.id] = 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.addModel.fullMarks = '';
|
this.addModel.fullMarks = '';
|
||||||
this.addModel.details = [];
|
this.addModel.details = [];
|
||||||
}
|
}
|
||||||
@ -178,6 +178,20 @@ export default {
|
|||||||
gradeRulesList.push(that.addModel);
|
gradeRulesList.push(that.addModel);
|
||||||
}
|
}
|
||||||
if (that.addModel.details.length > 0) {
|
if (that.addModel.details.length > 0) {
|
||||||
|
let result = false;
|
||||||
|
gradeRulesList.forEach(gradeRules=>{
|
||||||
|
let total = 0;
|
||||||
|
gradeRules.details.forEach(detail=>{
|
||||||
|
total += detail.score || 0;
|
||||||
|
});
|
||||||
|
if (total !== gradeRules.fullMarks) {
|
||||||
|
result = result || true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (result) {
|
||||||
|
that.$message.error('步骤分总和不等于总分');
|
||||||
|
return;
|
||||||
|
}
|
||||||
that.loading = true;
|
that.loading = true;
|
||||||
updateTrainingGradeRules(that.trainingId, gradeRulesList).then(resp => {
|
updateTrainingGradeRules(that.trainingId, gradeRulesList).then(resp => {
|
||||||
that.loading = false;
|
that.loading = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user