|
@@ -2,46 +2,65 @@ import {FC} from 'react';
|
|
|
import {ColumnsType} from 'antd/es/table';
|
|
|
import {FinishProductListStreamOutListData} from '@models';
|
|
|
import {Card} from 'antd';
|
|
|
-import {Table} from '@components';
|
|
|
+import {Table, TableTools} from '@components';
|
|
|
import {context, pageContext, searchContext} from '../context';
|
|
|
import {HUGE_TABLE_WIDTH, MIDDLE_TABLE_WIDTH, NORMAL_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
|
|
|
-import {getFinishProductOutStreamList} from '@apis';
|
|
|
-import {useContextSection, useQueryTableList} from '@hooks';
|
|
|
+import {getFinishProductOutStreamExport, getFinishProductOutStreamList} from '@apis';
|
|
|
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
|
|
|
|
|
|
const columns: ColumnsType<FinishProductListStreamOutListData> = [
|
|
|
{
|
|
|
- title: '利道编号',
|
|
|
+ title: '出库单ID',
|
|
|
+ dataIndex: 'deliveryId',
|
|
|
+ key: 'deliveryId',
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出库编号',
|
|
|
dataIndex: 'storageCode',
|
|
|
key: 'storageCode',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
+ {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: MIDDLE_TABLE_WIDTH},
|
|
|
+ {title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
|
|
|
+ {title: '出库数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH, align: 'right'},
|
|
|
+ {title: '出库人', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
+ {title: '所属公司', dataIndex: 'companyName', key: 'companyName', width: HUGE_TABLE_WIDTH},
|
|
|
+ {title: '客户名称', dataIndex: 'customerName', key: 'customerName', width: HUGE_TABLE_WIDTH},
|
|
|
+ {title: '出库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
|
|
|
{
|
|
|
- title: 'wbs编号',
|
|
|
+ title: 'WBS编号',
|
|
|
dataIndex: 'wbs',
|
|
|
key: 'wbs',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
- {title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
|
|
|
- {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: MIDDLE_TABLE_WIDTH},
|
|
|
- {title: '出库数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH},
|
|
|
- {title: '用户名称', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
- {title: '出库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
|
|
|
- {title: '公司名称', dataIndex: 'companyName', key: 'companyName', width: NORMAL_TABLE_WIDTH},
|
|
|
- {title: '客户名称', dataIndex: 'customerName', key: 'customerName', width: NORMAL_TABLE_WIDTH},
|
|
|
];
|
|
|
|
|
|
const TableList: FC = function () {
|
|
|
const params = useContextSection(context, state => state[0]);
|
|
|
|
|
|
- const [{data, count}] = useQueryTableList({
|
|
|
+ const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
|
queryFn: getFinishProductOutStreamList,
|
|
|
- params: params as any,
|
|
|
+ params,
|
|
|
pageContext,
|
|
|
searchContext,
|
|
|
});
|
|
|
|
|
|
+ const [isExporting, onExport] = useTableExportEvent({
|
|
|
+ pageContext,
|
|
|
+ context,
|
|
|
+ fn: getFinishProductOutStreamExport,
|
|
|
+ });
|
|
|
+
|
|
|
return (
|
|
|
<Card className='table-wrapper'>
|
|
|
+ <TableTools
|
|
|
+ isExporting={isExporting}
|
|
|
+ onExport={onExport}
|
|
|
+ isRefreshing={isFetching}
|
|
|
+ onRefresh={refetch}
|
|
|
+ />
|
|
|
+
|
|
|
<Table
|
|
|
columns={columns}
|
|
|
data={data}
|