|
|
@@ -1,86 +0,0 @@
|
|
|
-import {FC} from 'react';
|
|
|
-import {Card} from 'antd';
|
|
|
-import {Table, TableTools} from '@components';
|
|
|
-import {context, pageContext, searchContext} from '../context';
|
|
|
-import {SemiDrawListData} from '@models';
|
|
|
-import {
|
|
|
- NORMAL_TABLE_WIDTH,
|
|
|
- MIDDLE_TABLE_WIDTH,
|
|
|
- SMALL_TABLE_WIDTH,
|
|
|
-} from '@utils';
|
|
|
-import {ColumnsType} from 'antd/es/table';
|
|
|
-import {getSemiManufacturesDrawList} from '@apis';
|
|
|
-import {useContextSection, useQueryTableList} from '@hooks';
|
|
|
-
|
|
|
-const columns: ColumnsType<SemiDrawListData> = [
|
|
|
- {
|
|
|
- title: '要货单编号',
|
|
|
- dataIndex: 'askGoodsId',
|
|
|
- key: 'askGoodsId',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '物料编号',
|
|
|
- dataIndex: 'materialCode',
|
|
|
- key: 'materialCode',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '物料名称',
|
|
|
- dataIndex: 'materialName',
|
|
|
- key: 'materialName',
|
|
|
- width: MIDDLE_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {title: '数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH},
|
|
|
- {
|
|
|
- title: '生产订单号',
|
|
|
- dataIndex: 'productionCode',
|
|
|
- key: 'productionCode',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '要料部门',
|
|
|
- dataIndex: 'department',
|
|
|
- key: 'department',
|
|
|
- width: NORMAL_TABLE_WIDTH,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- dataIndex: 'type',
|
|
|
- key: 'type',
|
|
|
- render(_, {type}) {
|
|
|
- return type === '0' ? '未出库' : '已出库';
|
|
|
- },
|
|
|
- width: SMALL_TABLE_WIDTH,
|
|
|
- },
|
|
|
-];
|
|
|
-
|
|
|
-const TableList: FC = function () {
|
|
|
- const params = useContextSection(context, state => state[0]);
|
|
|
-
|
|
|
- const [{data, count, isFetching}, {refetch}] = useQueryTableList({
|
|
|
- queryFn: getSemiManufacturesDrawList,
|
|
|
- params,
|
|
|
- pageContext,
|
|
|
- searchContext,
|
|
|
- });
|
|
|
-
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Card className='table-wrapper'>
|
|
|
- <TableTools onRefresh={refetch} isRefreshing={isFetching} />
|
|
|
-
|
|
|
- <Table
|
|
|
- data-testid='product_draw_table'
|
|
|
- data={data}
|
|
|
- columns={columns}
|
|
|
- count={count}
|
|
|
- pageContext={pageContext}
|
|
|
- searchContext={searchContext}
|
|
|
- />
|
|
|
- </Card>
|
|
|
- </>
|
|
|
- );
|
|
|
-};
|
|
|
-
|
|
|
-export default TableList;
|