소스 검색

审核列表

李志伟 2 년 전
부모
커밋
cac4312072
4개의 변경된 파일150개의 추가작업 그리고 77개의 파일을 삭제
  1. 11
    7
      src/pages/applicationList/detail.jsx
  2. 9
    3
      src/pages/applicationList/index.jsx
  3. 69
    23
      src/pages/examine/detail.jsx
  4. 61
    44
      src/pages/examine/index.jsx

+ 11
- 7
src/pages/applicationList/detail.jsx 파일 보기

@@ -57,7 +57,7 @@ export default (props) => {
57 57
             {application?.immunizationCode}
58 58
           </FormItem>
59 59
           <FormItem label="免疫证明">
60
-            <Image src={application?.immunizationImg} />
60
+            <Image src={application?.immunizationImg} width={100} />
61 61
           </FormItem>
62 62
           <FormItem label="最近免疫日期">
63 63
             {application?.immunizationDate}
@@ -69,6 +69,15 @@ export default (props) => {
69 69
                   application?.applyType == 'renewal' ? '续期' : ''
70 70
             }
71 71
           </FormItem>
72
+          {
73
+            application?.applyType !== 'renewal' &&
74
+            <FormItem label="申领方式">
75
+              {
76
+                application?.applyMethod == '1' ? '上门自取' :
77
+                  application?.applyMethod == '2' ? '快递到家' : ''
78
+              }
79
+            </FormItem>
80
+          }
72 81
           <FormItem label="付款状态">
73 82
             {
74 83
               application.payStatus === 0
@@ -82,12 +91,7 @@ export default (props) => {
82 91
           {/* <FormItem label="狗证有效期">
83 92
            2021-1-5~2022-1-5
84 93
           </FormItem>
85
-          <FormItem label="申领方式">
86
-            {
87
-              application?.applyMethod == '1' ? '上门自取' :
88
-                application?.applyMethod == '2' ? '快递到家' : ''
89
-            }
90
-          </FormItem>
94
+          //判断是否为续期
91 95
           <FormItem label="快递公司">
92 96
             <Input type="text" value='极兔快递' style={{ width: '350px' }} />
93 97
           </FormItem>

+ 9
- 3
src/pages/applicationList/index.jsx 파일 보기

@@ -15,7 +15,7 @@ const formatterTime = (val) => {
15 15
 
16 16
 export default (props) => {
17 17
   const actionRef = useRef();
18
-  const goDetail=(id)=>{
18
+  const goDetail = (id) => {
19 19
     history.push(`applicationList/detail.jsx?id=${id}`);
20 20
   }
21 21
   const columns = [
@@ -25,6 +25,12 @@ export default (props) => {
25 25
       key: 'personName',
26 26
       search: true,
27 27
     },
28
+    {
29
+      title: '犬名',
30
+      dataIndex: 'petName',
31
+      key: 'petName',
32
+      search: true,
33
+    },
28 34
     {
29 35
       title: '申请时间',
30 36
       dataIndex: 'createDate',
@@ -68,7 +74,6 @@ export default (props) => {
68 74
       valueType: 'select',
69 75
       valueEnum: {
70 76
         0: { text: '待支付' },
71
-        1: { text: '支付中' },
72 77
         2: { text: '已支付' },
73 78
       },
74 79
     },
@@ -97,7 +102,8 @@ export default (props) => {
97 102
       valueType: 'option',
98 103
       width: 160,
99 104
       render: (_, record) => [
100
-        <Button key={1} style={{ padding: 0 }} type="link" onClick={()=>goDetail(record.applyId)}>
105
+        <Button key={1} style={{ padding: 0 }} type="link"
106
+          onClick={() => goDetail(record.applyId)}>
101 107
           详情
102 108
         </Button>
103 109
       ],

+ 69
- 23
src/pages/examine/detail.jsx 파일 보기

@@ -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
                   同意

+ 61
- 44
src/pages/examine/index.jsx 파일 보기

@@ -1,10 +1,11 @@
1 1
 import React, { useRef } from 'react'
2
-import { useModel } from 'umi';
3 2
 import moment from 'moment';
4 3
 import { DatePicker, Button } from 'antd';
5 4
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 5
 import PageTable from '@/components/PageTable'
7
-import { getList } from '@/services/work'
6
+import { getApplicationList } from '@/services/application'
7
+import { history } from 'umi';
8
+
8 9
 
9 10
 const { RangePicker } = DatePicker;
10 11
 
@@ -13,33 +14,21 @@ const formatterTime = (val) => {
13 14
 };
14 15
 
15 16
 export default (props) => {
16
-  const initDate = useRef(moment())
17 17
   const actionRef = useRef();
18
-  const { initialState } = useModel('@@initialState');
19
-
20
-  const handleBeforSearch = (params) => {
21
-    const { createDate, ...others } = params;
22
-
23
-    let start, end, orgId;
24
-    if (!createDate || createDate.length < 1) {
25
-      // 默认时间是今天
26
-      start = moment().format('YYYY-MM-DD')
27
-      end = start
28
-    } else {
29
-      start = moment(createDate[0]).format('YYYY-MM-DD')
30
-      end = moment(createDate[1]).format('YYYY-MM-DD')
31
-    }
32
-    if (initialState.currentUser.orgId) {
33
-      orgId = initialState.currentUser.orgId
34
-      return { ...others, start, end, orgId };
35
-    }
36
-    return { ...others, start, end };
18
+  const goDetail = (id) => {
19
+    history.push(`examine/detail.jsx?id=${id}`);
37 20
   }
38 21
   const columns = [
39 22
     {
40
-      title: '申请人',
41
-      dataIndex: 'userName',
42
-      key: 'userName',
23
+      title: '犬主',
24
+      dataIndex: 'personName',
25
+      key: 'personName',
26
+      search: true,
27
+    },
28
+    {
29
+      title: '犬名',
30
+      dataIndex: 'petName',
31
+      key: 'petName',
43 32
       search: true,
44 33
     },
45 34
     {
@@ -47,33 +36,68 @@ export default (props) => {
47 36
       dataIndex: 'createDate',
48 37
       key: 'createDate',
49 38
       render: (t) => formatterTime(t),
50
-      renderFormItem: (_, record) => <RangePicker defaultValue={[initDate.current, initDate.current]} placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
39
+      renderFormItem: (_, record) => <RangePicker placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
40
+    },
41
+    {
42
+      title: '订单状态',
43
+      dataIndex: 'payStatus',
44
+      key: 'payStatus',
45
+      search: true,//已支付 待支付
46
+      render: (_, record) => {
47
+        return record.payStatus === 0
48
+          ? '待支付'
49
+          : record.payStatus === 1
50
+            ? '支付中'
51
+            : record.payStatus === 2
52
+              ? '已支付' : ''
53
+      },
54
+      valueType: 'select',
55
+      valueEnum: {
56
+        0: { text: '待支付' },
57
+        2: { text: '已支付' },
58
+      },
51 59
     },
52 60
     {
53 61
       title: '审核状态',
54
-      dataIndex: 'userName',
55
-      key: 'userName',
62
+      dataIndex: 'verifyStatus',
63
+      key: 'verifyStatus',
56 64
       search: true,
65
+      render: (_, record) => {
66
+        return record.verifyStatus === 0
67
+          ? '待审核'
68
+          : record.verifyStatus === 1
69
+            ? '审核通过'
70
+            : record.verifyStatus === 2
71
+              ? '审核驳回' : ''
72
+      },
73
+      valueType: 'select',
74
+      valueEnum: {
75
+        0: { text: '待审核' },
76
+        1: { text: '审核通过' },
77
+        2: { text: '审核驳回' },
78
+      },
57 79
     },
58 80
     {
59 81
       title: '审核人',
60
-      dataIndex: 'userName',
61
-      key: 'userName',
82
+      dataIndex: 'verifyUser',
83
+      key: 'verifyUser',
62 84
       search: true,
63 85
     },
64 86
     {
65 87
       title: '审核时间',
66
-      dataIndex: 'createDate',
67
-      key: 'createDate',
68
-      render: (t) => formatterTime(t),
69
-      renderFormItem: (_, record) => <RangePicker defaultValue={[initDate.current, initDate.current]} placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
88
+      dataIndex: 'verifyDate',
89
+      key: 'verifyDate',
90
+      render: (t) => t != '-' ? formatterTime(t) : '-',
91
+      renderFormItem: (_, record) => <RangePicker format='YYYY-MM-DD' />
70 92
     },
71 93
     {
72 94
       title: '操作',
73 95
       valueType: 'option',
74 96
       width: 160,
75 97
       render: (_, record) => [
76
-        <Button key={1} style={{ padding: 0 }} type="link">
98
+        <Button key={1} style={{ padding: 0 }} type="link"
99
+          onClick={() => goDetail(record.applyId)}
100
+        >
77 101
           详情
78 102
         </Button>
79 103
       ],
@@ -86,16 +110,9 @@ export default (props) => {
86 110
       <PageTable
87 111
         actionRef={actionRef}
88 112
         columns={columns}
89
-        request={getList}
113
+        request={getApplicationList}
90 114
         options={false}
91
-        search={{
92
-          defaultCollapsed: false
93
-        }}
94
-        form={{ ignoreRules: false }}
95
-        manualRequest={true}
96
-        revalidateOnFocus={false}
97
-        beforeSearchSubmit={handleBeforSearch}
98
-        rowKey="formId"
115
+        rowKey="applyId"
99 116
       />
100 117
     </PageHeaderWrapper>
101 118
   )