|
@@ -2,7 +2,7 @@ import {FC} from 'react';
|
|
|
import {ColumnsType} from 'antd/es/table';
|
|
|
import {FinishProductListStreamInListData} 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,
|
|
@@ -11,33 +11,34 @@ import {
|
|
|
NORMAL_TABLE_WIDTH,
|
|
|
SMALL_TABLE_WIDTH,
|
|
|
} from '@utils';
|
|
|
-import {getFinishProductInStreamList} from '@apis';
|
|
|
-import {useContextSection, useQueryTableList} from '@hooks';
|
|
|
+import {getFinishProductInStreamExport, getFinishProductInStreamList} from '@apis';
|
|
|
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
|
|
|
|
|
|
const columns: ColumnsType<FinishProductListStreamInListData> = [
|
|
|
{
|
|
|
- title: '利道编号',
|
|
|
+ title: '入库单编号',
|
|
|
dataIndex: 'storageCode',
|
|
|
key: 'storageCode',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
- {
|
|
|
- title: 'wbs编号',
|
|
|
- dataIndex: 'wbs',
|
|
|
- key: 'wbs',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
+
|
|
|
+ {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: LARGE_TABLE_WIDTH},
|
|
|
{title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
|
|
|
- {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: NORMAL_TABLE_WIDTH},
|
|
|
{title: '生产批次', dataIndex: 'producBatch', key: 'producBatch', width: MIDDLE_TABLE_WIDTH},
|
|
|
- {title: '数量', dataIndex: 'capacity', key: 'capacity', width: SMALL_TABLE_WIDTH},
|
|
|
- {title: '用户名称', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
+ {title: '数量', dataIndex: 'capacity', key: 'capacity', width: SMALL_TABLE_WIDTH, align: 'right'},
|
|
|
+ {title: '操作人', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
{
|
|
|
- title: '库位编号',
|
|
|
+ title: '库位名称',
|
|
|
dataIndex: 'storageLocationCode',
|
|
|
key: 'storageLocationCode',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: 'WBS编号',
|
|
|
+ dataIndex: 'wbs',
|
|
|
+ key: 'wbs',
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
|
+ },
|
|
|
{title: '入库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
|
|
|
{title: '连番号', dataIndex: 'serial', key: 'serial', width: SMALL_TABLE_WIDTH},
|
|
|
{title: '属性', dataIndex: 'attribute', key: 'attribute', width: LARGE_TABLE_WIDTH},
|
|
@@ -46,15 +47,27 @@ const columns: ColumnsType<FinishProductListStreamInListData> = [
|
|
|
const TableList: FC = function () {
|
|
|
const params = useContextSection(context, state => state[0]);
|
|
|
|
|
|
- const [{data, count}] = useQueryTableList({
|
|
|
+ const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
|
queryFn: getFinishProductInStreamList,
|
|
|
params,
|
|
|
pageContext,
|
|
|
searchContext,
|
|
|
});
|
|
|
+ const [isExporting, onExport] = useTableExportEvent({
|
|
|
+ pageContext,
|
|
|
+ context,
|
|
|
+ fn: getFinishProductInStreamExport,
|
|
|
+ });
|
|
|
|
|
|
return (
|
|
|
<Card className='table-wrapper'>
|
|
|
+ <TableTools
|
|
|
+ onRefresh={refetch}
|
|
|
+ isRefreshing={isFetching}
|
|
|
+ onExport={onExport}
|
|
|
+ isExporting={isExporting}
|
|
|
+ />
|
|
|
+
|
|
|
<Table
|
|
|
columns={columns}
|
|
|
data={data}
|