index.tsx
2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Table } from 'antd';
import * as api from './api';
import Column from 'antd/lib/table/Column';
import Filter from './components/Filter';
import moment from 'moment';
import usePagination from '@/hooks/usePagination';
import RenderGoodsSpec from '@/pages/capital/components/RenderGoodsSpec';
import { AssetTypeEnum } from '@/pages/capital/entity';
export default function SpecConfig() {
const { list, loading, paginationConfig, setParams, innerParams, setLoading } = usePagination(api.getDateApi, { status: 1 });
return (
<PageHeaderWrapper title="库存池查询">
<Card>
<Filter setParams={setParams} innerParams={innerParams} />
<Table
dataSource={list}
loading={loading}
pagination={paginationConfig}
rowKey="poolId"
size="small"
>
<Column title="物品名称" dataIndex="name" />
<Column title="物品编码" dataIndex="code" />
<Column title="唯一标识" dataIndex="uniqueCode" />
<Column
title="型号规格"
dataIndex="specList"
width="16%"
ellipsis
render={(text, record) => <RenderGoodsSpec specList={text} />}
/>
<Column
title="物品类型"
dataIndex="type"
render={(value) => (
<span>{AssetTypeEnum[value]}</span>
)}
/>
<Column title="资产归属门店" dataIndex="assetShopName" />
<Column title="使用门店" dataIndex="useShopName" />
<Column title="是否代管" dataIndex="agent" render={t => (t ? "是" : "否")} />
<Column title="库存数量" dataIndex="storageNum" render={(t, record: api.ListItems) => `${t || 0}${record.unit}`} />
<Column title="管理员工" dataIndex="staffName" />
<Column title="入库时间" dataIndex="storageTime" render={(t) => t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} />
<Column title="领用时间" dataIndex="receiveTime" render={(t) => t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} />
{/* <Column title="采购单价金额(元)" dataIndex="unitPrice" /> */}
</Table>
</Card>
</PageHeaderWrapper>
);
}