Commit d4fc7d62 by zhaopanyu

zpy 班主任选课修改

parent ef1f2373
......@@ -117,6 +117,7 @@ export default {
},
methods: {
getList() {
this.loading = true
let data = {
curriculaId: this.queryParams.curriculaName,
......@@ -131,6 +132,8 @@ export default {
if (res.code == 200) {
this.courseSelectionData = res.rows;
console.log('res.rows', res.rows);
// 更新人数/总人数
this.calculateStats();
this.total = res.total
this.loading = false
}
......@@ -144,10 +147,6 @@ export default {
getDetailInfo({ ...this.queryParams }).then(res => {
if (res.code == 200) {
this.taskNameList = res.data;
console.log('this.taskNameList', this.taskNameList);
this.taskNameList.zrs = res.data.zrs;
this.taskNameList.yxrs = res.data.yxrs;
console.log(this.taskNameList.zrs, this.taskNameList.xkrs);
// 获取最新一次的任务名称
const latestTask = this.taskNameList[0]; // 假设任务名称列表按照时间降序排列
// 设置默认选中的任务名称
......@@ -156,7 +155,7 @@ export default {
this.getList(latestTask.curriculaId);
this.getClassList(latestTask.grade);
//人数总人数
this.calculateStats();
// this.calculateStats();
// console.log('this.taskNameList', this.taskNameList);
this.grades = res.data.map(item => {
return {
......@@ -173,14 +172,17 @@ export default {
const selectedTask = this.taskNameList.find(item => item.curriculaId === selectedCurriculaId);
const selectedGrade = selectedTask.grade;
this.getClassList(selectedGrade);
this.calculateStats();
// this.calculateStats();
},
//任务名称和人数数据联动
calculateStats() {
const selectedTask = this.taskNameList.find(item => item.curriculaId === this.queryParams.curriculaName);
if (selectedTask) {
this.taskStats.total = selectedTask.zrs;
this.taskStats.selected = selectedTask.yxrs;
}
},
//班级下拉框
getClassList(grades) {
classList(grades).then(res => {
......@@ -200,6 +202,7 @@ export default {
};
this.taskStats.total = 0;
this.taskStats.selected = 0;
this.calculateStats();
this.resetForm("queryForm");
this.getList();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment