diff --git a/src/components/drawers/ExportScore.vue b/src/components/drawers/ExportScore.vue index c93283bb..bb9c9edb 100644 --- a/src/components/drawers/ExportScore.vue +++ b/src/components/drawers/ExportScore.vue @@ -254,6 +254,16 @@ export default { console.log("查询导入状态", res); if (res.data.code === 200) { if (res.data.data.status !== "START") { + if(res.data.data.status === "SUCCESS"){ + state.addLoading = false; + state.fileList = []; + state.uploadpercent = -1; + message.destroy(); + message.error(`当前开课暂无作业,无法导入成绩`); + clearInterval(timer); + clearTimeout(timeouts); + return; + } i++; if (i === 1) { message.destroy(); diff --git a/src/components/student/TableStudent.vue b/src/components/student/TableStudent.vue index 305eb789..001f2e2d 100644 --- a/src/components/student/TableStudent.vue +++ b/src/components/student/TableStudent.vue @@ -162,9 +162,9 @@ :style="{ display: hideshow ? 'none' : 'block' }" >
-
+
批量结业
diff --git a/src/views/report/ReportProject.vue b/src/views/report/ReportProject.vue index 67aa4507..cfc9323b 100644 --- a/src/views/report/ReportProject.vue +++ b/src/views/report/ReportProject.vue @@ -263,14 +263,25 @@ export default { headers: { token: Cookies.get("token"), }, - }).then( - (res) => { - downLoad(res.data, "项目详情.xlsx"); - }, - (err) => { - message.error(err); - } - ); + }).then((res) => { + const reader = new FileReader(); + reader.onload = function(e) { + try { + const result = JSON.parse(e.target.result); + if (result.status === 200 || result.success) { + // 下载文件 + downLoad(res.data, "项目详情.xlsx"); + } else { + message.error(result.message); + } + } catch (error) { + downLoad(res.data, "项目详情.xlsx"); + } + }; + reader.readAsText(res.data); + }).catch((error) => { + message.error(error.response ? error.response.data.message : error.toString()); + }); } else { const params = {}; params.status = state.status; @@ -291,19 +302,25 @@ export default { headers: { token: Cookies.get("token"), }, - }).then( - (res) => { - if(res.data.status && res.data.status == 600){ - message.error(res.data.message); - }else{ + }).then((res) => { + const reader = new FileReader(); + reader.onload = function(e) { + try { + const result = JSON.parse(e.target.result); + if (result.status === 200 || result.success) { + // 下载文件 + downLoad(res.data, "项目详情.xlsx"); + } else { + message.error(result.message); + } + } catch (error) { downLoad(res.data, "项目详情.xlsx"); } - - }, - (err) => { - message.error(err); - } - ); + }; + reader.readAsText(res.data); + }).catch((error) => { + message.error(error.response ? error.response.data.message : error.toString()); + }); } }; // 表格数据