index.tsx
2.12 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
62
63
64
65
66
67
68
69
70
71
72
73
import React, { useEffect, useState } from "react";
import { Card, Steps, Table, Tabs } from "antd";
import { PageHeaderWrapper } from "@ant-design/pro-layout";
import { createStore } from "@/hooks/moz";
import store from "./useStore";
import SelectCorrespondenceUnits from "./components/SelectCorrespondenceUnits";
import RelationshipSettings from "./components/RelationshipSettings";
import { CompanyRelationListVO } from "@/pages/finance/CompanyRelationAuth/api";
const { Column } = Table;
const { TabPane } = Tabs;
export const { Provider, useStore } = createStore(store);
function CompanyRelationCreate(props) {
const pathParams = props.location.state || {};
const { Step } = Steps;
const [current, setCurrent] = useState<number>(0);
const {
selected,
// loading,
selectedRelation,
setSelectedRelation,
submitLoading,
setSubmitLoading,
// setLoading,
companyParams,
setCompanyParams,
} = useStore();
useEffect(() => {
setCompanyParams({ ...pathParams });
}, []);
const rowSelection = {
onChange: (selectedRowKeys: React.Key[], selectedRows: CompanyRelationListVO[]) => {
setSelectedRelation([...selectedRows]);
},
getCheckboxProps: (record: CompanyRelationListVO) => ({
name: String(record.compId),
}),
};
return (
<PageHeaderWrapper title="往来单位关系设置">
<Card>
<Steps type="navigation" current={current} className="site-navigation-steps">
<Step title="选择往来单位" />
<Step title="关系设置" />
</Steps>
<Tabs
style={{ marginTop: 40 }}
activeKey={String(current)}
tabBarStyle={{ display: "hidden" }}
renderTabBar={() => <div />}
>
<TabPane key="0">
<SelectCorrespondenceUnits onNext={() => setCurrent(current + 1)} />
</TabPane>
<TabPane key="1">
<RelationshipSettings onPrevious={() => setCurrent(0)} />
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
);
}
export default (props) => (
<Provider>
<CompanyRelationCreate {...props} />
</Provider>
);