|
@@ -3,7 +3,7 @@
|
|
|
<SemesterTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
|
|
|
<BasicTable class="w-3/4 xl:w-4/5" @register="registerTable" :searchInfo="searchInfo">
|
|
|
<template #toolbar>
|
|
|
- <a-button type="primary">导出</a-button>
|
|
|
+ <a-button type="primary" @click="handleExport">导出</a-button>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
<TableAction
|
|
@@ -33,14 +33,20 @@
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import FormEdit from './edit.vue';
|
|
|
import SemesterTree from './components/SemesterTree.vue';
|
|
|
- import { getWfTextbookClaimDistributePage } from '/@/services/apis/WfTextbookClaimController';
|
|
|
+ import {
|
|
|
+ getWfTextbookClaimDistributePage,
|
|
|
+ postWfTextbookClaimClaimRecordsExportQuery,
|
|
|
+ } from '/@/services/apis/WfTextbookClaimController';
|
|
|
import FormDetail from './components/detail.vue';
|
|
|
+ import { formatToDate } from '/@/utils/dateUtil';
|
|
|
+ import { downloadByData } from '/@/utils/file/download';
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
const searchInfo = reactive<Recordable>({});
|
|
|
const [registerModal, { openModal }] = useModal();
|
|
|
const [registerDetailModal, { openModal: openDetailModal }] = useModal();
|
|
|
|
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
+ const [registerTable, { reload, getForm }] = useTable({
|
|
|
api: getWfTextbookClaimDistributePage,
|
|
|
title: '教材申领记录',
|
|
|
rowKey: 'id',
|
|
@@ -62,6 +68,7 @@
|
|
|
fixed: 'right',
|
|
|
},
|
|
|
});
|
|
|
+ const { createMessage } = useMessage();
|
|
|
const handleSend = (record: any) => {
|
|
|
openModal(true, {
|
|
|
isUpdate: false,
|
|
@@ -88,6 +95,12 @@
|
|
|
searchInfo.baseSemesterId = item.baseSemesterId;
|
|
|
reload();
|
|
|
};
|
|
|
+ const handleExport = async () => {
|
|
|
+ const formData = getForm().getFieldsValue();
|
|
|
+ const data = await postWfTextbookClaimClaimRecordsExportQuery(formData);
|
|
|
+ downloadByData(data.data, `教材申领导出${formatToDate(new Date())}.xlsx`);
|
|
|
+ createMessage.success('导出成功');
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less"></style>
|