Blame view

src/pages/contract/BearCostSetting/components/BearModal/index.tsx 1.2 KB
3a63ee47   谢忠泽   add:费用承担配置
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
  import React, { useEffect, useState } from "react";
  import { Modal, Skeleton, Table } from "antd";
  
  interface Props{
      visible:boolean;//显示
      item?:BearCostSetting.Item;//行数据
      onCancel: () => void;
  }
  const { Column } = Table;
  
  const BearModal = ({visible, onCancel, item = {} as BearCostSetting.Item}:Props) => {
      const [loading, setLoading] = useState(true);
      useEffect(() => {
          setTimeout(() => {
              setLoading(false);
          }, 500);
      }, []);
      
      return (
        <Modal
          title="分摊比例"
          visible={visible}
          onCancel={onCancel}
          onOk={onCancel}
          cancelButtonProps={{ hidden: true }}
          width="30%"
          
        >
          <Skeleton
            active
            loading={loading}
          >
            <Table
              dataSource={item.shareRateItemList || []}
              rowKey={(item) => `${item.id}`}
            >
              <Column title="门店/往来单位名称" dataIndex="name" render={(t) => t || "-"} />
dc57d488   谢忠泽   fix:缴费标识:回显分摊比例精度
38
              <Column title="分摊比例" dataIndex="shareRate" render={(t) => (t && `${(t*100).toFixed(2)}%`) || "-"} />
3a63ee47   谢忠泽   add:费用承担配置
39
40
41
42
43
44
45
46
              
            </Table>
          </Skeleton>
        </Modal>
      );
  };
  
  export default BearModal;