考核成绩管理删除与批量删除功能

dev_2022-05-11
e 3 years ago
parent d3aba5705a
commit 7c532a4b68
  1. 19
      src/pages/achievement/ass/index.vue

@ -154,14 +154,14 @@ export default {
this.avg = res.avgScore this.avg = res.avgScore
this.total = res.peopleNum this.total = res.peopleNum
let list = res.page.records; let list = res.page.records;
if (res.page.records.length){ if (list.length > 0){
this.assessmentId = res.page.records[0].assessmentId; this.assessmentId = res.page.records[0].assessmentId;
}
let score = 0; let score = 0;
list.map(n => { list.map(n => {
n.class = this.className; n.class = this.className;
score += n.score; score += n.score;
}); });
}
this.listData = list; this.listData = list;
this.getChart(); this.getChart();
} }
@ -221,7 +221,6 @@ export default {
}) })
.then(() => { .then(() => {
let ids = [row.reportId] let ids = [row.reportId]
console.log(ids)
this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => { this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
@ -233,18 +232,16 @@ export default {
}, },
delAllData() { delAllData() {
if (this.multipleSelection.length != "") { if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return `reportId=${item.reportId}`;
});
let delList1 = newArr.map(item => {
return `recordId=${item.reportId}`;
});
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?${delList.join("&")}&${delList1.join("&")}`).then(res => { let newArr = this.multipleSelection;
let ids = []
for (var i=0;i<newArr.length;i++){
ids.push(newArr[i].reportId)
}
this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {

Loading…
Cancel
Save