|
@@ -7,6 +7,7 @@
|
|
|
import { baseDownloadFileUrl } from '/@/utils/file/download';
|
|
|
import { useLoading } from '/@/components/Loading';
|
|
|
import { postBaseNewStudentScoreImport } from '/@/services/apis/BaseNewStudentController';
|
|
|
+ import { jsonToSheetXlsx } from '/@/components/Excel';
|
|
|
|
|
|
const errMsg = ref('');
|
|
|
const { createMessage } = useMessage();
|
|
@@ -26,11 +27,18 @@
|
|
|
const beforeUpload = async (e) => {
|
|
|
try {
|
|
|
openFullLoading();
|
|
|
- await postBaseNewStudentScoreImport({
|
|
|
+ const data = await postBaseNewStudentScoreImport({
|
|
|
file: e,
|
|
|
- enrollmentPlanId: modelRef.value.enrollmentPlanId,
|
|
|
+ treeId: modelRef.value.enrollmentPlanId,
|
|
|
});
|
|
|
createMessage.success('导入成功');
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ jsonToSheetXlsx({
|
|
|
+ data,
|
|
|
+ filename: '成绩出错记录.xlsx',
|
|
|
+ });
|
|
|
+ errMsg.value = '导入数据有误,请查看附件';
|
|
|
+ }
|
|
|
} catch (err: any) {
|
|
|
errMsg.value = err;
|
|
|
} finally {
|