index.tsx
1.98 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
56
57
58
59
60
61
import React from "react";
import { Card, Table } from "antd";
import { PageHeaderWrapper } from "@ant-design/pro-layout";
import { createStore } from "@/hooks/moz";
import store from "./useStore";
import Filter from "./components/Filter";
import { CompanyRelationListVO } from "@/pages/finance/CompanyRelationAuth/api";
const { Column } = Table;
export const { Provider, useStore } = createStore(store);
function CompanyRelationAuth() {
const {
selected,
loading,
setSelectedRelation,
} = useStore();
const rowSelection = {
onChange: (selectedRowKeys: React.Key[], selectedRows: CompanyRelationListVO[]) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
setSelectedRelation([...selectedRows]);
},
getCheckboxProps: (record: CompanyRelationListVO) => ({
name: String(record.compId),
}),
};
return (
<PageHeaderWrapper title="往来单位关系设置">
<Card>
<Filter />
<Table
rowKey="compId"
dataSource={selected}
pagination={false}
loading={loading}
rowSelection={{
type: "checkbox",
...rowSelection,
}}
>
<Column title="单位名称" dataIndex="compName" />
<Column title="简称" dataIndex="compShortName" />
<Column title="类型" dataIndex="compTypeName" />
<Column title="发票要求" dataIndex="beforeReimburse" render={(before) => `支付${before ? "前" : "后"}`} />
<Column title="发票金额要求比例" dataIndex="billAmountRatio" render={(ratio) => `${ratio}%`} />
<Column title="支持结算方式" dataIndex="settleMethodNames" render={(way) => way || "--"} />
<Column title="对账周期" dataIndex="accountCheckPeriod" render={(date) => (date ? `${date}日` : "--")} />
</Table>
</Card>
</PageHeaderWrapper>
);
}
export default () => (
<Provider>
<CompanyRelationAuth />
</Provider>
);