diff --git a/src/pages/achievement/ass/index.vue b/src/pages/achievement/ass/index.vue index 63a19de..88aecf6 100644 --- a/src/pages/achievement/ass/index.vue +++ b/src/pages/achievement/ass/index.vue @@ -154,14 +154,14 @@ export default { this.avg = res.avgScore this.total = res.peopleNum let list = res.page.records; - if (res.page.records.length){ - this.assessmentId = res.page.records[0].assessmentId; - } - let score = 0; - list.map(n => { - n.class = this.className; - score += n.score; - }); + if (list.length > 0){ + this.assessmentId = res.page.records[0].assessmentId; + let score = 0; + list.map(n => { + n.class = this.className; + score += n.score; + }); + } this.listData = list; this.getChart(); } @@ -221,7 +221,6 @@ export default { }) .then(() => { let ids = [row.reportId] - console.log(ids) this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => { util.successMsg("删除成功"); this.getData(); @@ -233,18 +232,16 @@ export default { }, delAllData() { 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("确定要删除吗?", "提示", { type: "warning" }) .then(() => { - this.$post(`${this.api.deleteReport}?${delList.join("&")}&${delList1.join("&")}`).then(res => { + let newArr = this.multipleSelection; + let ids = [] + for (var i=0;i { util.successMsg("删除成功"); this.getData(); }).catch(res => {