|
@@ -1,31 +1,31 @@
|
|
import {FC} from 'react';
|
|
import {FC} from 'react';
|
|
import {RawMaterialOutStreamListData} from '@models';
|
|
import {RawMaterialOutStreamListData} from '@models';
|
|
import {ColumnsType} from 'antd/es/table';
|
|
import {ColumnsType} from 'antd/es/table';
|
|
-import {Table} from '@components';
|
|
|
|
|
|
+import {Table, TableTools} from '@components';
|
|
import {context, pageContext, searchContext} from '../context';
|
|
import {context, pageContext, searchContext} from '../context';
|
|
import {Card} from 'antd';
|
|
import {Card} from 'antd';
|
|
-import {HUGE_TABLE_WIDTH, MIDDLE_TABLE_WIDTH, NORMAL_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
|
|
|
|
-import {getRawOutList} 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 {exportRawOut, getRawOutList} from '@apis';
|
|
|
|
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
|
|
|
|
|
|
const columns: ColumnsType<RawMaterialOutStreamListData> = [
|
|
const columns: ColumnsType<RawMaterialOutStreamListData> = [
|
|
{
|
|
{
|
|
- title: '利道编号',
|
|
|
|
|
|
+ title: '出库编号',
|
|
dataIndex: 'storageCode',
|
|
dataIndex: 'storageCode',
|
|
key: 'storageCode',
|
|
key: 'storageCode',
|
|
width: NORMAL_TABLE_WIDTH,
|
|
width: NORMAL_TABLE_WIDTH,
|
|
},
|
|
},
|
|
- {
|
|
|
|
- title: 'wbs编号',
|
|
|
|
- dataIndex: 'wbs',
|
|
|
|
- key: 'wbs',
|
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
title: '物料编号',
|
|
title: '物料编号',
|
|
dataIndex: 'wllbCode',
|
|
dataIndex: 'wllbCode',
|
|
key: 'wllbCode',
|
|
key: 'wllbCode',
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
|
|
|
+ width: LARGE_TABLE_WIDTH,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '物料名称',
|
|
title: '物料名称',
|
|
@@ -34,22 +34,23 @@ const columns: ColumnsType<RawMaterialOutStreamListData> = [
|
|
width: HUGE_TABLE_WIDTH,
|
|
width: HUGE_TABLE_WIDTH,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '供应商名称',
|
|
|
|
- dataIndex: 'supplierName',
|
|
|
|
- key: 'supplierName',
|
|
|
|
|
|
+ title: '领用部门',
|
|
|
|
+ dataIndex: 'department',
|
|
|
|
+ key: 'department',
|
|
width: NORMAL_TABLE_WIDTH,
|
|
width: NORMAL_TABLE_WIDTH,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '连番号',
|
|
|
|
- dataIndex: 'serial',
|
|
|
|
- key: 'serial',
|
|
|
|
- width: SMALL_TABLE_WIDTH,
|
|
|
|
|
|
+ title: '库位名称',
|
|
|
|
+ dataIndex: 'storageLocationName',
|
|
|
|
+ key: 'storageLocationName',
|
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '类型',
|
|
|
|
- dataIndex: 'type',
|
|
|
|
- key: 'type',
|
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
|
|
|
+ title: '出库数量',
|
|
|
|
+ dataIndex: 'num',
|
|
|
|
+ key: 'num',
|
|
|
|
+ width: SMALL_TABLE_WIDTH,
|
|
|
|
+ align: 'right',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '出库用户',
|
|
title: '出库用户',
|
|
@@ -57,18 +58,6 @@ const columns: ColumnsType<RawMaterialOutStreamListData> = [
|
|
key: 'userName',
|
|
key: 'userName',
|
|
width: NORMAL_TABLE_WIDTH,
|
|
width: NORMAL_TABLE_WIDTH,
|
|
},
|
|
},
|
|
- {
|
|
|
|
- title: '领用部门',
|
|
|
|
- dataIndex: 'department',
|
|
|
|
- key: 'department',
|
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '库位名称',
|
|
|
|
- dataIndex: 'storageLocationName',
|
|
|
|
- key: 'storageLocationName',
|
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
title: '出库日期',
|
|
title: '出库日期',
|
|
dataIndex: 'scrq',
|
|
dataIndex: 'scrq',
|
|
@@ -76,25 +65,52 @@ const columns: ColumnsType<RawMaterialOutStreamListData> = [
|
|
width: MIDDLE_TABLE_WIDTH,
|
|
width: MIDDLE_TABLE_WIDTH,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '出库数量',
|
|
|
|
- dataIndex: 'num',
|
|
|
|
- key: 'num',
|
|
|
|
|
|
+ title: '供应商名称',
|
|
|
|
+ dataIndex: 'supplierName',
|
|
|
|
+ key: 'supplierName',
|
|
|
|
+ width: HUGE_TABLE_WIDTH,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '连番号',
|
|
|
|
+ dataIndex: 'serial',
|
|
|
|
+ key: 'serial',
|
|
width: SMALL_TABLE_WIDTH,
|
|
width: SMALL_TABLE_WIDTH,
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: 'WBS编号',
|
|
|
|
+ dataIndex: 'wbs',
|
|
|
|
+ key: 'wbs',
|
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '类型',
|
|
|
|
+ dataIndex: 'type',
|
|
|
|
+ key: 'type',
|
|
|
|
+ width: NORMAL_TABLE_WIDTH,
|
|
|
|
+ },
|
|
];
|
|
];
|
|
|
|
|
|
const TableList: FC = function () {
|
|
const TableList: FC = function () {
|
|
const params = useContextSection(context, state => state[0]);
|
|
const params = useContextSection(context, state => state[0]);
|
|
|
|
|
|
- const [{data, count}] = useQueryTableList({
|
|
|
|
|
|
+ const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
queryFn: getRawOutList,
|
|
queryFn: getRawOutList,
|
|
params,
|
|
params,
|
|
pageContext,
|
|
pageContext,
|
|
searchContext,
|
|
searchContext,
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ const [isExporting, onExport] = useTableExportEvent({pageContext, context, fn: exportRawOut});
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<Card className='table-wrapper'>
|
|
<Card className='table-wrapper'>
|
|
|
|
+ <TableTools
|
|
|
|
+ isExporting={isExporting}
|
|
|
|
+ onExport={onExport}
|
|
|
|
+ isRefreshing={isFetching}
|
|
|
|
+ onRefresh={refetch}
|
|
|
|
+ />
|
|
|
|
+
|
|
<Table
|
|
<Table
|
|
data={data}
|
|
data={data}
|
|
count={count}
|
|
count={count}
|