|
@@ -1,10 +1,9 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Card, Form, Button, message, Input } from 'antd';
|
|
2
|
+import { Card, Form, Button, message, Input, Image } from 'antd';
|
3
|
3
|
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
4
|
|
-import { getWithdrawalDetail, updateWithdrawal } from '@/services/withdrawal'
|
|
4
|
+import { getApplicationDetail, updateMake, getCardNo } from '@/services/application'
|
5
|
5
|
import { history } from 'umi';
|
6
|
6
|
|
7
|
|
-const { TextArea } = Input;
|
8
|
7
|
const FormItem = Form.Item;
|
9
|
8
|
const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
|
10
|
9
|
const goBack = () => {
|
|
@@ -13,30 +12,47 @@ const goBack = () => {
|
13
|
12
|
export default (props) => {
|
14
|
13
|
const { location } = props;
|
15
|
14
|
const { id } = location.query;
|
16
|
|
- const [withdrawal, setWithdrawal] = useState();
|
17
|
|
- const [remarks, setRemarks] = useState()
|
|
15
|
+ const [application, setApplication] = useState({});
|
18
|
16
|
const [loading, setLoading] = useState(false)
|
19
|
|
-
|
20
|
|
- const handleAudit = (val) => {
|
21
|
|
- if (remarks) {
|
22
|
|
- setLoading(true)
|
23
|
|
- updateWithdrawal(withdrawal.withdrawalId, { ...withdrawal, auditStatus: val, auditRemark: remarks }).then(() => {
|
24
|
|
- message.success('操作成功');
|
25
|
|
- goBack()
|
26
|
|
- setLoading(false)
|
27
|
|
- }).catch(err => {
|
28
|
|
- console.log(err.message)
|
29
|
|
- setLoading(false)
|
30
|
|
- })
|
|
17
|
+ //需要改一下
|
|
18
|
+ const handleMake = () => {
|
|
19
|
+ if (application.originCardNo) {
|
|
20
|
+ if (
|
|
21
|
+ (application.applyMethod == 2
|
|
22
|
+ && application.trackingType
|
|
23
|
+ && application.trackingNo)
|
|
24
|
+ || application.applyMethod == 1) {
|
|
25
|
+ setLoading(true)
|
|
26
|
+ var data = {
|
|
27
|
+ cardNo: application.originCardNo,
|
|
28
|
+ makeStatus: application.makeStatus,
|
|
29
|
+ trackingType: application.trackingType,
|
|
30
|
+ trackingNo: application.trackingNo
|
|
31
|
+ }
|
|
32
|
+ updateMake(id, data).then(() => {
|
|
33
|
+ message.success('操作成功');
|
|
34
|
+ goBack()
|
|
35
|
+ setLoading(false)
|
|
36
|
+ }).catch(err => {
|
|
37
|
+ console.log(err.message)
|
|
38
|
+ setLoading(false)
|
|
39
|
+ })
|
|
40
|
+ } else {
|
|
41
|
+ message.success('请输入快递信息');
|
|
42
|
+ }
|
31
|
43
|
}
|
32
|
44
|
else {
|
33
|
|
- message.success('请输入处理结果');
|
|
45
|
+ message.success('请输入证件号');
|
34
|
46
|
}
|
35
|
47
|
}
|
|
48
|
+ const handleCardNo = () => {
|
|
49
|
+ getCardNo().then((res) => {
|
|
50
|
+ setApplication({ ...application, originCardNo: res })
|
|
51
|
+ })
|
|
52
|
+ }
|
36
|
53
|
useEffect(() => {
|
37
|
|
- getWithdrawalDetail(id).then((res) => {
|
38
|
|
- setWithdrawal(res)
|
39
|
|
- setRemarks(res.auditRemark)
|
|
54
|
+ getApplicationDetail(id).then((res) => {
|
|
55
|
+ setApplication(res)
|
40
|
56
|
}).catch((err) => {
|
41
|
57
|
console.log(err.message)
|
42
|
58
|
});
|
|
@@ -45,49 +61,106 @@ export default (props) => {
|
45
|
61
|
<PageHeaderWrapper >
|
46
|
62
|
<Card>
|
47
|
63
|
<Form {...formItemLayout}>
|
48
|
|
- <FormItem label="申请人">
|
49
|
|
- {withdrawal?.userName}
|
50
|
|
- </FormItem>
|
51
|
64
|
<FormItem label="犬主">
|
52
|
|
- {withdrawal?.phone}
|
|
65
|
+ {application?.personName}
|
|
66
|
+ </FormItem>
|
|
67
|
+ <FormItem label="电话">
|
|
68
|
+ {application?.phone}
|
53
|
69
|
</FormItem>
|
54
|
70
|
<FormItem label="犬名">
|
55
|
|
- {withdrawal?.orgName}
|
|
71
|
+ {application?.petName}
|
|
72
|
+ </FormItem>
|
|
73
|
+ <FormItem label="性别">
|
|
74
|
+ {
|
|
75
|
+ application?.petSex == 1 ? '雄' :
|
|
76
|
+ application?.petSex == 2 ? '雌' : '未说明性别'
|
|
77
|
+ }
|
56
|
78
|
</FormItem>
|
57
|
79
|
<FormItem label="犬种">
|
58
|
|
- {withdrawal?.amountLeft / 100}
|
|
80
|
+ {application?.petType}
|
59
|
81
|
</FormItem>
|
60
|
82
|
<FormItem label="毛色">
|
61
|
|
- {withdrawal?.bankCard.ownerBank}
|
|
83
|
+ {application?.petColor}
|
62
|
84
|
</FormItem>
|
63
|
85
|
<FormItem label="照片">
|
64
|
|
- {withdrawal?.bankCard.cardNo}
|
|
86
|
+ <Image src={application?.img1} width={100} />
|
65
|
87
|
</FormItem>
|
66
|
88
|
<FormItem label="养狗地址">
|
67
|
|
- {withdrawal?.money / 100}
|
|
89
|
+ {application?.address}
|
|
90
|
+ </FormItem>
|
|
91
|
+ <FormItem label="免疫证号">
|
|
92
|
+ {application?.immunizationCode}
|
|
93
|
+ </FormItem>
|
|
94
|
+ <FormItem label="免疫证明">
|
|
95
|
+ <Image src={application?.immunizationImg} width={100} />
|
68
|
96
|
</FormItem>
|
69
|
|
- <FormItem label="领取方式">
|
70
|
|
- {withdrawal?.money / 100}
|
|
97
|
+ <FormItem label="最近免疫日期">
|
|
98
|
+ {application?.immunizationDate}
|
|
99
|
+ </FormItem>
|
|
100
|
+ <FormItem label="申请类型">
|
|
101
|
+ {
|
|
102
|
+ application?.applyType == 'first' ? '办证' :
|
|
103
|
+ application?.applyType == 'reissue' ? '补办' :
|
|
104
|
+ application?.applyType == 'renewal' ? '续期' : ''
|
|
105
|
+ }
|
71
|
106
|
</FormItem>
|
72
|
|
- <FormItem label="快递公司">
|
|
107
|
+ {
|
|
108
|
+ application?.applyType !== 'renewal' &&
|
|
109
|
+ <FormItem label="申领方式">
|
|
110
|
+ {
|
|
111
|
+ application?.applyMethod == '1' ? '上门自取' :
|
|
112
|
+ application?.applyMethod == '2' ? '快递到家' : ''
|
|
113
|
+ }
|
|
114
|
+ </FormItem>
|
|
115
|
+ }
|
|
116
|
+ <FormItem label="付款状态">
|
73
|
117
|
{
|
74
|
|
- withdrawal?.auditStatus == 0 ?
|
75
|
|
- <TextArea placeholder='请输入处理结果(必填)' rows='3' style={{ width: '350px' }} value={remarks} onChange={(e) => setRemarks(e.target.value)} /> :
|
76
|
|
- remarks
|
|
118
|
+ application.payStatus === 0
|
|
119
|
+ ? '待支付'
|
|
120
|
+ : application.payStatus === 1
|
|
121
|
+ ? '支付中'
|
|
122
|
+ : application.payStatus === 2
|
|
123
|
+ ? '已支付' : ''
|
77
|
124
|
}
|
78
|
125
|
</FormItem>
|
79
|
|
- <FormItem label="快递单号">
|
|
126
|
+ <FormItem label="证件号">
|
|
127
|
+ <Input
|
|
128
|
+ value={application.originCardNo}
|
|
129
|
+ style={{ width: '350px' }}
|
|
130
|
+ readOnly={application?.makeStatus != 0}
|
|
131
|
+ placeholder='请输入证件号或者点击自动生成(必填)'
|
|
132
|
+ onChange={e => setApplication({ ...application, originCardNo: e.target.value })} />
|
80
|
133
|
{
|
81
|
|
- withdrawal?.auditStatus == 0 ?
|
82
|
|
- <TextArea placeholder='请输入处理结果(必填)' rows='3' style={{ width: '350px' }} value={remarks} onChange={(e) => setRemarks(e.target.value)} /> :
|
83
|
|
- remarks
|
|
134
|
+ application?.makeStatus == 0 &&
|
|
135
|
+ <Button type="link" onClick={() => handleCardNo()}>
|
|
136
|
+ 自动生成
|
|
137
|
+ </Button>
|
84
|
138
|
}
|
85
|
139
|
</FormItem>
|
|
140
|
+ {
|
|
141
|
+ application.applyMethod == 2 && <>
|
|
142
|
+ <FormItem label="快递公司">
|
|
143
|
+ <Input value={application.trackingType}
|
|
144
|
+ style={{ width: '350px' }}
|
|
145
|
+ placeholder='请输入快递公司(必填)'
|
|
146
|
+ readOnly={application?.makeStatus != 0}
|
|
147
|
+ onChange={e => setApplication({ ...application, trackingType: e.target.value })} />
|
|
148
|
+ </FormItem>
|
|
149
|
+ <FormItem label="快递单号">
|
|
150
|
+ <Input value={application.trackingNo}
|
|
151
|
+ style={{ width: '350px' }}
|
|
152
|
+ placeholder='请输入快递单号(必填)'
|
|
153
|
+ readOnly={application?.makeStatus != 0}
|
|
154
|
+ onChange={e => setApplication({ ...application, trackingNo: e.target.value })} />
|
|
155
|
+ </FormItem>
|
|
156
|
+ </>
|
|
157
|
+ }
|
86
|
158
|
<FormItem label=" " colon={false}>
|
87
|
159
|
{
|
88
|
|
- withdrawal?.auditStatus == 0 &&
|
|
160
|
+ application?.makeStatus == 0 &&
|
89
|
161
|
<>
|
90
|
|
- <Button type="primary" loading={loading} style={{ marginRight: '16px' }} onClick={() => handleAudit(1)}>
|
|
162
|
+ <Button type="primary" loading={loading}
|
|
163
|
+ style={{ marginRight: '16px' }} onClick={() => handleMake()}>
|
91
|
164
|
发放
|
92
|
165
|
</Button>
|
93
|
166
|
</>
|