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