ChargeModal.tsx
2.51 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
74
75
76
77
78
79
80
81
82
import React, { useEffect } from 'react';
import { Form, Button, InputNumber, Modal, Input } from 'antd';
import PmsSelect from '@/pages/pms/comonents/PmsSelect';
import ImageUpload from '@/pages/pms/comonents/ImageUpload';
import {ListVO} from '../api';
const Item = Form.Item;
interface Props {
visible?: boolean,
onCancel: Function,
item?: ListVO
}
export default function Index(props: Props) {
const { visible, onCancel, item } = props;
const [form] = Form.useForm();
useEffect(() => {
if (visible && item?.id) {
form.setFieldsValue({
supplierName: item.supplierName,
amount: item.amount,
shopName: item.shopName
});
}
if (!visible) {
form.resetFields();
}
}, [visible]);
const onSave = () => {
const params = {id: item?.id};
console.log(params);
};
return (
<Modal
title="预付款充值申请"
open={visible}
maskClosable={false}
onCancel={() => onCancel()}
footer={[
<Button onClick={() => onCancel()}>取消</Button>,
<Button type="primary" htmlType="submit" onClick={() => onSave()}>提交申请</Button>
]}
>
<Form
form={form}
labelCol={{ span: 7 }}
wrapperCol={{ span: 12 }}
>
<Item label="往来单位" name="supplierName">
<Input disabled />
</Item>
<Item label="往来单位类型" name="shopName">
<Input disabled />
</Item>
<Item label="账户余额" name="amount">
<InputNumber style={{ width: '100%' }} addonAfter="元" disabled />
</Item>
<Item label="充值金额" name="awaitAmount" rules={[{ required: true, message: "请填写金额" }]}>
<InputNumber style={{ width: '100%' }} addonAfter="元" />
</Item>
<Item label="账户到账金额" name="awaitAmount" rules={[{ required: true, message: "请填写金额" }]}>
<InputNumber style={{ width: '100%' }} addonAfter="元" disabled />
</Item>
<Item label="结算门店" name="shopName" rules={[{ required: true, message: "请选择推办角色" }]}>
<Input disabled />
</Item>
<Item label="发票金额要求比例" name="role">
<Input disabled />
</Item>
<Item label="结算方式" name="role" rules={[{ required: true, message: "请选择结算方式" }]}>
<PmsSelect />
</Item>
<Item label="附件" name="files">
<ImageUpload max={5} />
</Item>
</Form>
</Modal>
);
}