|
@@ -1,12 +1,19 @@
|
|
|
<script setup lang="ts">
|
|
|
import BasicModal from '/@/components/Modal/src/BasicModal.vue';
|
|
|
- import { useModal } from '/@/components/Modal';
|
|
|
+ import { useModal, useModalInner } from '/@/components/Modal';
|
|
|
import Upload from '/@/components/Form/src/components/Upload.vue';
|
|
|
import { ref } from 'vue';
|
|
|
- import { postBaseClassCourseImport } from '/@/services/apis/BaseClassCourseController';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { baseDownloadFileUrl } from '/@/utils/file/download';
|
|
|
- const [modalRegister, { closeModal }] = useModal();
|
|
|
+ import { baseDownloadFileUrl, downloadByData } from '/@/utils/file/download';
|
|
|
+ import {
|
|
|
+ postWfTextbookSubscriptionInstockroomExcelImport,
|
|
|
+ postWfTextbookSubscriptionTextbookSubscriptionExportQuery,
|
|
|
+ } from '/@/services/apis/WfTextbookSubscriptionController';
|
|
|
+ import { formatToDate } from '/@/utils/dateUtil';
|
|
|
+ const wfTextbookSubscriptionId = ref('');
|
|
|
+ const [modalRegister, { closeModal }] = useModalInner((data) => {
|
|
|
+ wfTextbookSubscriptionId.value = data.wfTextbookSubscriptionId;
|
|
|
+ });
|
|
|
const errMsg = ref('');
|
|
|
const folderId = ref('');
|
|
|
const { createMessage } = useMessage();
|
|
@@ -16,7 +23,10 @@
|
|
|
};
|
|
|
const handleSubmit = async () => {
|
|
|
try {
|
|
|
- await postBaseClassCourseImport({ file: data.value }, 'none');
|
|
|
+ await postWfTextbookSubscriptionInstockroomExcelImport(
|
|
|
+ { wfTextbookSubscriptionId: wfTextbookSubscriptionId.value, file: data.value },
|
|
|
+ 'none',
|
|
|
+ );
|
|
|
createMessage.success('导入成功');
|
|
|
folderId.value = '';
|
|
|
closeModal();
|
|
@@ -30,9 +40,16 @@
|
|
|
closeModal();
|
|
|
};
|
|
|
const handleDownLoad = async () => {
|
|
|
- await baseDownloadFileUrl(
|
|
|
- 'https://zhxy.cqtlzjzx.com/minio/static/resources/%E7%8F%AD%E7%BA%A7%E8%AF%BE%E7%A8%8B%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx',
|
|
|
- '班级课表导入模板.xlsx',
|
|
|
+ const data = await postWfTextbookSubscriptionTextbookSubscriptionExportQuery({
|
|
|
+ wfTextbookSubscriptionId: wfTextbookSubscriptionId.value,
|
|
|
+ });
|
|
|
+
|
|
|
+ await downloadByData(
|
|
|
+ data.data,
|
|
|
+ `${wfTextbookSubscriptionId.value}征订记录${formatToDate(
|
|
|
+ new Date(),
|
|
|
+ 'YYYY-MM-DD-HH-mm-ss',
|
|
|
+ )}.xlsx`,
|
|
|
);
|
|
|
};
|
|
|
</script>
|
|
@@ -48,9 +65,9 @@
|
|
|
>
|
|
|
<div class="flex flex-col mt-[24px]">
|
|
|
<div class="flex flex-col">
|
|
|
- <span class="text-[16px] text-[1000]">1、 下载导入模板</span>
|
|
|
+ <span class="text-[16px] text-[1000]">1、 导出当前征订数据</span>
|
|
|
<a-button type="primary" class="w-[110px] mt-[12px]" @click="handleDownLoad">
|
|
|
- 下载模板</a-button
|
|
|
+ 导出</a-button
|
|
|
>
|
|
|
</div>
|
|
|
<div class="mt-[12px]">
|