Browse Source

fix: change teachingManager textbookPushManager

DESKTOP-USV654P\pc 2 weeks ago
parent
commit
f24f02107a

+ 1 - 0
src/views/educational/textbookSubscription/components/data.config.ts

@@ -542,6 +542,7 @@ export const historySchema: FormSchema[] = [
     label: '教材类型',
     component: 'ApiSelect',
     componentProps: {
+      getPopupContainer: () => document.body,
       api: getDataOption,
       params: {
         code: 'textbook_type',

+ 14 - 18
src/views/teachingManager/textbookPopManager/index.vue

@@ -15,7 +15,7 @@
   import { downloadByData } from '/@/utils/file/download';
   import { formatToDate } from '/@/utils/dateUtil';
   const selectedRowKeysList = ref<string[] | number[]>([]);
-  const [registerTable, {}] = useTable({
+  const [registerTable, { getForm }] = useTable({
     api: getTextbookIssueRecordPage,
     rowKey: 'id',
     bordered: true,
@@ -40,16 +40,17 @@
   });
   const { createMessage } = useMessage();
 
-  const handleExport = async (isAll) => {
-    let data;
-    if (isAll) {
-      data = await getTextbookIssueRecordExport({});
-    } else {
-      data = await postTextbookIssueRecordExportQuery({
-        ids: selectedRowKeysList.value,
-      });
-    }
-    downloadByData(data.data, `教材出库记录${formatToDate(new Date())}.xlsx`);
+  const handleExport = async () => {
+    const formData = getForm().getFieldsValue();
+    const data = await getTextbookIssueRecordExport(formData);
+    downloadByData(data.data, `教材出库导出${formatToDate(new Date())}.xlsx`);
+    createMessage.success('导出成功');
+  };
+
+  const handleExport1 = async () => {
+    const formData = getForm().getFieldsValue();
+    const data = await postTextbookIssueRecordExportQuery(formData);
+    downloadByData(data.data, `教材发放导出${formatToDate(new Date())}.xlsx`);
     createMessage.success('导出成功');
   };
 </script>
@@ -58,13 +59,8 @@
   <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button
-          type="primary"
-          :disabled="!selectedRowKeysList.length"
-          @click="handleExport(false)"
-          >导出指定记录</a-button
-        >
-        <a-button type="primary" @click="handleExport(true)">导出全部记录</a-button>
+        <a-button type="primary" @click="handleExport1()"> 教材发放导出 </a-button>
+        <a-button type="primary" @click="handleExport()"> 教材出库导出 </a-button>
       </template>
     </BasicTable>
   </PageWrapper>

+ 2 - 2
src/views/teachingManager/textbookPushManager/components/discountList.vue

@@ -25,12 +25,12 @@
     columns: [
       {
         title: '变更后折扣',
-        dataIndex: 'oldDiscount',
+        dataIndex: 'newDiscount',
         align: 'left',
       },
       {
         title: '变更前折扣',
-        dataIndex: 'newDiscount',
+        dataIndex: 'oldDiscount',
         align: 'left',
       },
       {

+ 5 - 5
src/views/teachingManager/textbookPushManager/index.vue

@@ -55,7 +55,7 @@
     },
 
     actionColumn: {
-      width: 140,
+      width: 100,
       title: '操作',
       dataIndex: 'action',
       slots: { customRender: 'action' },
@@ -137,10 +137,10 @@
       <template #action="{ record }">
         <TableAction
           :actions="[
-            {
-              label: '查看',
-              onClick: handleView.bind(null, record),
-            },
+            // {
+            //   label: '查看',
+            //   onClick: handleView.bind(null, record),
+            // },
             {
               label: '修改折扣',
               onClick: handleEditDiscount.bind(null, record),