Blame view

src/pages/pms/transfer/transferPool/comonents/StorageTable.tsx 1.54 KB
36b33b40   jiangwei   集团调拨
1
  import React from 'react';
c57f271b   jiangwei   调拨池调整
2
  import { Table } from 'antd';
59be970d   jiangwei   调拨代码结构重构
3
4
  import {useStore} from '../index';
  import {PoolItem} from '../api';
36b33b40   jiangwei   集团调拨
5
6
  
  const {Column} = Table;
d9c374fd   jiangwei   配件调拨调整
7
8
  export default function Index(props: {out?:boolean}) {
    const {out} = props;
c57f271b   jiangwei   调拨池调整
9
    const {data, loading, setListItem, setAnalysisVisible} = useStore();
36b33b40   jiangwei   集团调拨
10
  
487b337e   jiangwei   调拨申请调运方式,门店接口调式
11
    const analysis = (r:PoolItem, dt:number) => {
d9c374fd   jiangwei   配件调拨调整
12
      setListItem({type: out ? 6 : 7, detailType: dt, _item: r});
36b33b40   jiangwei   集团调拨
13
14
15
16
17
      setAnalysisVisible(true);
    };
  
    return (
      <>
36b33b40   jiangwei   集团调拨
18
19
20
21
        <Table
          dataSource={data}
          loading={loading}
          pagination={false}
b55e03e0   jiangwei   调拨池模块
22
          rowKey={r => `${r.id}`}
d56d0456   jiangwei   根据1.11需求修改
23
          scroll={{y: 500}}
36b33b40   jiangwei   集团调拨
24
        >
d9c374fd   jiangwei   配件调拨调整
25
          <Column title={out ? "调出库房" : "调入库房"} dataIndex="name" />
9c4c170d   jiangwei   fix
26
          <Column title="动态库销比" dataIndex="ratio" render={t => (t ? t.toFixed(2) : '--')} />
36b33b40   jiangwei   集团调拨
27
28
          <Column title="调出池配件品种" dataIndex="transferKind" />
          <Column title="调出池配件数量" dataIndex="transferCnt" />
d9c374fd   jiangwei   配件调拨调整
29
30
31
32
          {out ? 
            <Column title="调入库房分析" render={(r:PoolItem) => <a onClick={() => analysis(r, 7)}>查看</a>} />
          : 
            <Column title="调出库房分析" render={(r:PoolItem) => <a onClick={() => analysis(r, 6)}>查看</a>} />}
487b337e   jiangwei   调拨申请调运方式,门店接口调式
33
34
35
          <Column title="配件分析" render={(r:PoolItem) => <a onClick={() => analysis(r, 5)}>查看</a>} />
          <Column title="车系分析" render={(r:PoolItem) => <a onClick={() => analysis(r, 3)}>查看</a>} />
          <Column title="工单分析" render={(r:PoolItem) => <a onClick={() => analysis(r, 8)}>查看</a>} />
36b33b40   jiangwei   集团调拨
36
37
38
39
        </Table>
      </>
    );
  }