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 {Button, Col, Form, Row} from "antd";
import {createSearchForm} from "@/utils/createForm";
import ExportFile from "@/components/Custom/ExportFile";
import {DownloadOutlined} from "@ant-design/icons";
export interface PurchaseSearchProps {
form: any,
allFormData: any[];
valChange: (values: any) => void;
selectedRowKeys?: number[];
mergeConfirm?: (values: any) => void;
checkConfirm?: (values?: number[]) => void;
exportData: any;
tabKey?: '981' | '980'
tab?: '0' | '2' | '10' | '15' | '20' | '90'
}
const PurchaseList: React.FC<PurchaseSearchProps> = (props) => {
const {
form, allFormData, valChange, selectedRowKeys, mergeConfirm,
checkConfirm, exportData, tabKey, tab
} = props;
return (
<Form form={form} onValuesChange={valChange} style={{ borderBottom: '1px solid #f3f4f3' }}>
<Row gutter={10} >
{allFormData?.length > 0 && allFormData.map(item => (
<Col {...item.layout} key={item.name} className="pos_aline">
{createSearchForm(item)}
</Col>
))}
<Col style={{flex: 1, padding: 10}} className="pos_end">
{tabKey ==='981' && (
<>
<Button
disabled={selectedRowKeys?.length === 0 || tab === '10'}
type="primary" onClick={mergeConfirm}
>合并</Button>
<Button
style={{margin: '0 10px'}}
disabled={selectedRowKeys?.length === 0 || tab === '2'}
type="primary" danger onClick={() => checkConfirm?.(selectedRowKeys)}
>撤销</Button>
</>
)}
{/* <ExportFile */}
{/* name="设备类告警" */}
{/* url="/warehouse-service/purchase-material/export" */}
{/* data={exportData} */}
{/* ><Button type="primary" icon={<DownloadOutlined />}>导出</Button> */}
{/* </ExportFile> */}
</Col>
</Row>
</Form>
);
};
export default PurchaseList;