|
|
@@ -1,7 +1,7 @@
|
|
|
import {FC} from 'react';
|
|
|
import {WarehousingListData} from '@models';
|
|
|
import {ColumnsType} from 'antd/es/table';
|
|
|
-import {Table} from '@components';
|
|
|
+import {Table, TableTools} from '@components';
|
|
|
import {context, pageContext, searchContext} from '../context';
|
|
|
import {Card} from 'antd';
|
|
|
import {
|
|
|
@@ -11,22 +11,16 @@ import {
|
|
|
NORMAL_TABLE_WIDTH,
|
|
|
SMALL_TABLE_WIDTH,
|
|
|
} from '@utils';
|
|
|
-import {getWarehousingFlowList} from '@apis';
|
|
|
-import {useContextSection, useQueryTableList} from '@hooks';
|
|
|
+import {exportWarehousing, getWarehousingFlowList} from '@apis';
|
|
|
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
|
|
|
|
|
|
const columns: ColumnsType<WarehousingListData> = [
|
|
|
{
|
|
|
- title: '采购单编号',
|
|
|
+ title: '入库单编号',
|
|
|
dataIndex: 'storageCode',
|
|
|
key: 'storageCode',
|
|
|
width: MIDDLE_TABLE_WIDTH,
|
|
|
},
|
|
|
- {
|
|
|
- title: 'wbs编号',
|
|
|
- dataIndex: 'wbs',
|
|
|
- key: 'wbs',
|
|
|
- width: MIDDLE_TABLE_WIDTH,
|
|
|
- },
|
|
|
{
|
|
|
title: '物料编号',
|
|
|
dataIndex: 'wllbCode',
|
|
|
@@ -45,18 +39,6 @@ const columns: ColumnsType<WarehousingListData> = [
|
|
|
key: 'supplierName',
|
|
|
width: LARGE_TABLE_WIDTH,
|
|
|
},
|
|
|
- {
|
|
|
- title: '连番号',
|
|
|
- dataIndex: 'serial',
|
|
|
- key: 'serial',
|
|
|
- width: SMALL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '生产日期',
|
|
|
- dataIndex: 'producDate',
|
|
|
- key: 'producDate',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
{
|
|
|
title: '生产批次',
|
|
|
dataIndex: 'producDate',
|
|
|
@@ -70,28 +52,22 @@ const columns: ColumnsType<WarehousingListData> = [
|
|
|
width: SMALL_TABLE_WIDTH,
|
|
|
},
|
|
|
{
|
|
|
- title: '类型',
|
|
|
- dataIndex: 'type',
|
|
|
- key: 'type',
|
|
|
- width: SMALL_TABLE_WIDTH,
|
|
|
+ title: '库位名称',
|
|
|
+ dataIndex: 'storageLocationName',
|
|
|
+ key: 'storageLocationName',
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
{
|
|
|
- title: '用户名称',
|
|
|
+ title: '操作人',
|
|
|
dataIndex: 'userName',
|
|
|
key: 'userName',
|
|
|
width: NORMAL_TABLE_WIDTH,
|
|
|
},
|
|
|
{
|
|
|
- title: '部门',
|
|
|
- dataIndex: 'departmentName',
|
|
|
- key: 'departmentName',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '库位名称',
|
|
|
- dataIndex: 'storageLocationName',
|
|
|
- key: 'storageLocationName',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
+ title: '类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ key: 'type',
|
|
|
+ width: SMALL_TABLE_WIDTH,
|
|
|
},
|
|
|
{
|
|
|
title: '入库日期',
|
|
|
@@ -99,20 +75,44 @@ const columns: ColumnsType<WarehousingListData> = [
|
|
|
key: 'scrq',
|
|
|
width: MIDDLE_TABLE_WIDTH,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: 'WBS编号',
|
|
|
+ dataIndex: 'wbs',
|
|
|
+ key: 'wbs',
|
|
|
+ width: MIDDLE_TABLE_WIDTH,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '连番号',
|
|
|
+ dataIndex: 'serial',
|
|
|
+ key: 'serial',
|
|
|
+ width: SMALL_TABLE_WIDTH,
|
|
|
+ },
|
|
|
];
|
|
|
|
|
|
const TableList: FC = function () {
|
|
|
const params = useContextSection(context, state => state[0]);
|
|
|
|
|
|
- const [{data, count}] = useQueryTableList({
|
|
|
+ const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
|
queryFn: getWarehousingFlowList,
|
|
|
params,
|
|
|
pageContext,
|
|
|
searchContext,
|
|
|
});
|
|
|
+ const [isExporting, onExport] = useTableExportEvent({
|
|
|
+ pageContext,
|
|
|
+ context,
|
|
|
+ fn: exportWarehousing,
|
|
|
+ });
|
|
|
|
|
|
return (
|
|
|
<Card className='table-wrapper'>
|
|
|
+ <TableTools
|
|
|
+ onRefresh={refetch}
|
|
|
+ isRefreshing={isFetching}
|
|
|
+ isExporting={isExporting}
|
|
|
+ onExport={onExport}
|
|
|
+ />
|
|
|
+
|
|
|
<Table
|
|
|
data={data}
|
|
|
count={count}
|