|
@@ -1,7 +1,7 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Card, Form, Button, message, Input } from 'antd';
|
|
2
|
+import { Card, Form, Button, Image, Input, message } from 'antd';
|
3
|
3
|
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
4
|
|
-import { getWithdrawalDetail, updateWithdrawal } from '@/services/withdrawal'
|
|
4
|
+import { getApplicationDetail, updateAudit } from '@/services/application'
|
5
|
5
|
import { history } from 'umi';
|
6
|
6
|
|
7
|
7
|
const { TextArea } = Input;
|
|
@@ -13,14 +13,14 @@ const goBack = () => {
|
13
|
13
|
export default (props) => {
|
14
|
14
|
const { location } = props;
|
15
|
15
|
const { id } = location.query;
|
16
|
|
- const [withdrawal, setWithdrawal] = useState();
|
17
|
|
- const [remarks, setRemarks] = useState()
|
|
16
|
+ const [application, setApplication] = useState({});
|
|
17
|
+ const [rejectReason, setRejectReason] = useState();
|
18
|
18
|
const [loading, setLoading] = useState(false)
|
19
|
19
|
|
20
|
20
|
const handleAudit = (val) => {
|
21
|
|
- if (remarks) {
|
|
21
|
+ if ((val == 2 && rejectReason) || val == 1) {
|
22
|
22
|
setLoading(true)
|
23
|
|
- updateWithdrawal(withdrawal.withdrawalId, { ...withdrawal, auditStatus: val, auditRemark: remarks }).then(() => {
|
|
23
|
+ updateAudit(id, { rejectReason: rejectReason, verifyStatus: val }).then(() => {
|
24
|
24
|
message.success('操作成功');
|
25
|
25
|
goBack()
|
26
|
26
|
setLoading(false)
|
|
@@ -33,10 +33,11 @@ export default (props) => {
|
33
|
33
|
message.success('请输入处理结果');
|
34
|
34
|
}
|
35
|
35
|
}
|
|
36
|
+
|
36
|
37
|
useEffect(() => {
|
37
|
|
- getWithdrawalDetail(id).then((res) => {
|
38
|
|
- setWithdrawal(res)
|
39
|
|
- setRemarks(res.auditRemark)
|
|
38
|
+ getApplicationDetail(id).then((res) => {
|
|
39
|
+ setApplication(res)
|
|
40
|
+ setRejectReason(res.rejectReason)
|
40
|
41
|
}).catch((err) => {
|
41
|
42
|
console.log(err.message)
|
42
|
43
|
});
|
|
@@ -45,37 +46,82 @@ export default (props) => {
|
45
|
46
|
<PageHeaderWrapper >
|
46
|
47
|
<Card>
|
47
|
48
|
<Form {...formItemLayout}>
|
48
|
|
- <FormItem label="申请人">
|
49
|
|
- {withdrawal?.userName}
|
50
|
|
- </FormItem>
|
51
|
49
|
<FormItem label="犬主">
|
52
|
|
- {withdrawal?.phone}
|
|
50
|
+ {application?.personName}
|
|
51
|
+ </FormItem>
|
|
52
|
+ <FormItem label="电话">
|
|
53
|
+ {application?.phone}
|
53
|
54
|
</FormItem>
|
54
|
55
|
<FormItem label="犬名">
|
55
|
|
- {withdrawal?.orgName}
|
|
56
|
+ {application?.petName}
|
|
57
|
+ </FormItem>
|
|
58
|
+ <FormItem label="性别">
|
|
59
|
+ {
|
|
60
|
+ application?.petSex == 1 ? '雄' :
|
|
61
|
+ application?.petSex == 2 ? '雌' : '未说明性别'
|
|
62
|
+ }
|
56
|
63
|
</FormItem>
|
57
|
64
|
<FormItem label="犬种">
|
58
|
|
- {withdrawal?.amountLeft / 100}
|
|
65
|
+ {application?.petType}
|
59
|
66
|
</FormItem>
|
60
|
67
|
<FormItem label="毛色">
|
61
|
|
- {withdrawal?.bankCard.ownerBank}
|
|
68
|
+ {application?.petColor}
|
62
|
69
|
</FormItem>
|
63
|
70
|
<FormItem label="照片">
|
64
|
|
- {withdrawal?.bankCard.cardNo}
|
|
71
|
+ <Image src={application?.img1} width={100} />
|
65
|
72
|
</FormItem>
|
66
|
73
|
<FormItem label="养狗地址">
|
67
|
|
- {withdrawal?.money / 100}
|
|
74
|
+ {application?.address}
|
|
75
|
+ </FormItem>
|
|
76
|
+ <FormItem label="免疫证号">
|
|
77
|
+ {application?.immunizationCode}
|
|
78
|
+ </FormItem>
|
|
79
|
+ <FormItem label="免疫证明">
|
|
80
|
+ <Image src={application?.immunizationImg} width={100} />
|
|
81
|
+ </FormItem>
|
|
82
|
+ <FormItem label="最近免疫日期">
|
|
83
|
+ {application?.immunizationDate}
|
|
84
|
+ </FormItem>
|
|
85
|
+ <FormItem label="申请类型">
|
|
86
|
+ {
|
|
87
|
+ application?.applyType == 'first' ? '办证' :
|
|
88
|
+ application?.applyType == 'reissue' ? '补办' :
|
|
89
|
+ application?.applyType == 'renewal' ? '续期' : ''
|
|
90
|
+ }
|
68
|
91
|
</FormItem>
|
69
|
|
- <FormItem label="处理结果">
|
|
92
|
+ {
|
|
93
|
+ application?.applyType !== 'renewal' &&
|
|
94
|
+ <FormItem label="申领方式">
|
|
95
|
+ {
|
|
96
|
+ application?.applyMethod == '1' ? '上门自取' :
|
|
97
|
+ application?.applyMethod == '2' ? '快递到家' : ''
|
|
98
|
+ }
|
|
99
|
+ </FormItem>
|
|
100
|
+ }
|
|
101
|
+ <FormItem label="付款状态">
|
70
|
102
|
{
|
71
|
|
- withdrawal?.auditStatus == 0 ?
|
72
|
|
- <TextArea placeholder='请输入处理结果(必填)' rows='3' style={{ width: '350px' }} value={remarks} onChange={(e) => setRemarks(e.target.value)} /> :
|
73
|
|
- remarks
|
|
103
|
+ application.payStatus === 0
|
|
104
|
+ ? '待支付'
|
|
105
|
+ : application.payStatus === 1
|
|
106
|
+ ? '支付中'
|
|
107
|
+ : application.payStatus === 2
|
|
108
|
+ ? '已支付' : ''
|
74
|
109
|
}
|
75
|
110
|
</FormItem>
|
|
111
|
+ {
|
|
112
|
+ application.verifyStatus != 1 &&
|
|
113
|
+ <FormItem label="驳回原因">
|
|
114
|
+ <TextArea placeholder='请输入驳回原因' rows='3'
|
|
115
|
+ style={{ width: '350px' }}
|
|
116
|
+ value={rejectReason}
|
|
117
|
+ readOnly={application.verifyStatus==2}
|
|
118
|
+ onChange={(e) => setRejectReason(e.target.value)}
|
|
119
|
+ />
|
|
120
|
+ </FormItem>
|
|
121
|
+ }
|
76
|
122
|
<FormItem label=" " colon={false}>
|
77
|
123
|
{
|
78
|
|
- withdrawal?.auditStatus == 0 &&
|
|
124
|
+ application.verifyStatus == 0 &&
|
79
|
125
|
<>
|
80
|
126
|
<Button type="primary" loading={loading} style={{ marginRight: '16px' }} onClick={() => handleAudit(1)}>
|
81
|
127
|
同意
|