|
@@ -1,45 +1,69 @@
|
|
|
import {Card} from 'antd';
|
|
|
import {FC} from 'react';
|
|
|
-import {Table} from '@components';
|
|
|
+import {Table, TableTools} from '@components';
|
|
|
import {ColumnsType} from 'antd/es/table';
|
|
|
import {SemiInStreamListData} from '@models';
|
|
|
import {context, pageContext, searchContext} from '../context';
|
|
|
-import {HUGE_TABLE_WIDTH, MIDDLE_TABLE_WIDTH, NORMAL_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
|
|
|
-import {getSemiManufacturesInStream} from '@apis';
|
|
|
-import {useContextSection, useQueryTableList} from '@hooks';
|
|
|
+import {
|
|
|
+ HUGE_TABLE_WIDTH,
|
|
|
+ LARGE_TABLE_WIDTH,
|
|
|
+ MIDDLE_TABLE_WIDTH,
|
|
|
+ NORMAL_TABLE_WIDTH,
|
|
|
+ SMALL_TABLE_WIDTH,
|
|
|
+} from '@utils';
|
|
|
+import {exportSemiManufacturesInStream, getSemiManufacturesInStream} from '@apis';
|
|
|
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
|
|
|
|
|
|
const columns: ColumnsType<SemiInStreamListData> = [
|
|
|
{
|
|
|
- title: '利道编号',
|
|
|
+ title: '入库编号',
|
|
|
dataIndex: 'storageCode',
|
|
|
key: 'storageCode',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
+ {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: LARGE_TABLE_WIDTH},
|
|
|
+ {title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
|
|
|
+ {
|
|
|
+ title: '入库数量',
|
|
|
+ dataIndex: 'warehousingNum',
|
|
|
+ key: 'warehousingNum',
|
|
|
+ width: SMALL_TABLE_WIDTH,
|
|
|
+ align: 'right',
|
|
|
+ },
|
|
|
{
|
|
|
- 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: NORMAL_TABLE_WIDTH},
|
|
|
- {title: '生产时间', dataIndex: 'producBatch', key: 'producBatch', width: MIDDLE_TABLE_WIDTH},
|
|
|
- {title: '数量', dataIndex: 'warehousingNum', key: 'warehousingNum', width: SMALL_TABLE_WIDTH},
|
|
|
- {title: '用户名称', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
+ {title: '生产批次', dataIndex: 'producBatch', key: 'producBatch', width: MIDDLE_TABLE_WIDTH},
|
|
|
+ {title: '操作人', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
|
|
|
{title: '入库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
|
|
|
];
|
|
|
|
|
|
const TableList: FC = function () {
|
|
|
const params = useContextSection(context, state => state[0]);
|
|
|
- const [{data, count}] = useQueryTableList({
|
|
|
+ const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
|
queryFn: getSemiManufacturesInStream,
|
|
|
params: params as any,
|
|
|
pageContext,
|
|
|
searchContext,
|
|
|
});
|
|
|
+ const [isExporting, onExport] = useTableExportEvent({
|
|
|
+ pageContext,
|
|
|
+ context,
|
|
|
+ fn: exportSemiManufacturesInStream,
|
|
|
+ });
|
|
|
|
|
|
return (
|
|
|
<Card className='table-wrapper'>
|
|
|
+ <TableTools
|
|
|
+ onRefresh={refetch}
|
|
|
+ isRefreshing={isFetching}
|
|
|
+ isExporting={isExporting}
|
|
|
+ onExport={onExport}
|
|
|
+ />
|
|
|
+
|
|
|
<Table
|
|
|
columns={columns}
|
|
|
data={data}
|