Blame view

src/pages/finance/CompanyRelationAuth/index.tsx 1.98 KB
38c0cdfa   zhaofeng   往来单位关系设置修改新增、删除
1
  import React from "react";
e93c2e09   zhaofeng   bugfix
2
  import { Card, Table } from "antd";
38c0cdfa   zhaofeng   往来单位关系设置修改新增、删除
3
4
5
  import { PageHeaderWrapper } from "@ant-design/pro-layout";
  import { createStore } from "@/hooks/moz";
  import store from "./useStore";
38c0cdfa   zhaofeng   往来单位关系设置修改新增、删除
6
  import Filter from "./components/Filter";
e93c2e09   zhaofeng   bugfix
7
  import { CompanyRelationListVO } from "@/pages/finance/CompanyRelationAuth/api";
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
8
9
10
11
12
13
  
  const { Column } = Table;
  
  export const { Provider, useStore } = createStore(store);
  
  function CompanyRelationAuth() {
da267386   zhaofeng   批量删除
14
15
16
    const {
      selected,
      loading,
da267386   zhaofeng   批量删除
17
      setSelectedRelation,
da267386   zhaofeng   批量删除
18
    } = useStore();
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
19
  
da267386   zhaofeng   批量删除
20
21
22
23
24
25
    const rowSelection = {
      onChange: (selectedRowKeys: React.Key[], selectedRows: CompanyRelationListVO[]) => {
        console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
        setSelectedRelation([...selectedRows]);
      },
      getCheckboxProps: (record: CompanyRelationListVO) => ({
da267386   zhaofeng   批量删除
26
27
28
        name: String(record.compId),
      }),
    };
fd16749f   zhaofeng   往来单位关系设置
29
  
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
30
    return (
d4fcc555   zhaofeng   delete
31
      <PageHeaderWrapper title="往来单位关系设置">
38c0cdfa   zhaofeng   往来单位关系设置修改新增、删除
32
        <Card>
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
33
          <Filter />
da267386   zhaofeng   批量删除
34
35
36
37
38
39
40
41
42
43
          <Table
            rowKey="compId"
            dataSource={selected}
            pagination={false}
            loading={loading}
            rowSelection={{
              type: "checkbox",
              ...rowSelection,
            }}
          >
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
44
45
46
            <Column title="单位名称" dataIndex="compName" />
            <Column title="简称" dataIndex="compShortName" />
            <Column title="类型" dataIndex="compTypeName" />
fd16749f   zhaofeng   往来单位关系设置
47
48
49
50
            <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}日` : "--")} />
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
51
52
          </Table>
        </Card>
cc26d1fc   张志伟   🎉 重新构建项目,解决项目过大的问题
53
54
55
56
      </PageHeaderWrapper>
    );
  }
  
38c0cdfa   zhaofeng   往来单位关系设置修改新增、删除
57
58
59
60
61
  export default () => (
    <Provider>
      <CompanyRelationAuth />
    </Provider>
  );