李志伟 2 年 前
コミット
69ddfa9987
共有5 個のファイルを変更した196 個の追加100 個の削除を含む
  1. 7
    3
      config/routes.js
  2. 51
    53
      src/pages/certificateIssuance/index.jsx
  3. 115
    42
      src/pages/certificateIssuance/issuance.jsx
  4. 2
    2
      src/pages/examine/index.jsx
  5. 21
    0
      src/services/application.js

+ 7
- 3
config/routes.js ファイルの表示

@@ -64,7 +64,6 @@ export default [
64 64
     path: '/applicationList/detail.jsx',
65 65
     name: '申请详情',
66 66
     hideInMenu: true,
67
-    icon: 'apartment',
68 67
     component: '@/pages/applicationList/detail.jsx',
69 68
   },
70 69
   {
@@ -77,7 +76,6 @@ export default [
77 76
     path: '/examine/detail.jsx',
78 77
     name: '犬证审核',
79 78
     hideInMenu: true,
80
-    icon: 'apartment',
81 79
     component: '@/pages/examine/detail.jsx',
82 80
   },
83 81
   {
@@ -86,10 +84,16 @@ export default [
86 84
     icon: 'IdcardOutlined',
87 85
     component: '@/pages/certificateIssuance',
88 86
   },
87
+  {
88
+    path: '/certificateIssuance/issuance.jsx',
89
+    name: '证件发放详情',
90
+    hideInMenu: true,
91
+    component: '@/pages/certificateIssuance/issuance.jsx',
92
+  },
89 93
   
90 94
   {
91 95
     path: '/userList',
92
-    name: '用户注册列表',
96
+    name: '犬主列表',
93 97
     icon: 'SolutionOutlined',
94 98
     component: '@/pages/userList',
95 99
   },

+ 51
- 53
src/pages/certificateIssuance/index.jsx ファイルの表示

@@ -1,10 +1,10 @@
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 { getMakeList } from '@/services/application'
7
+import { history } from 'umi';
8 8
 
9 9
 const { RangePicker } = DatePicker;
10 10
 
@@ -13,86 +13,91 @@ const formatterTime = (val) => {
13 13
 };
14 14
 
15 15
 export default (props) => {
16
-  const initDate = useRef(moment())
17 16
   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 };
17
+  const goDetail = (id) => {
18
+    history.push(`certificateIssuance/issuance.jsx?id=${id}`);
37 19
   }
38 20
   const columns = [
39
-    
40 21
     {
41 22
       title: '证件号',
42
-      dataIndex: 'userName',
43
-      key: 'userName',
23
+      dataIndex: 'originCardNo',
24
+      key: 'originCardNo',
44 25
       search: true,
45 26
     },
46 27
     {
47 28
       title: '犬主',
48
-      dataIndex: 'userName',
49
-      key: 'userName',
29
+      dataIndex: 'personName',
30
+      key: 'personName',
50 31
       search: true,
51 32
     },
52 33
     {
53 34
       title: '犬名',
54
-      dataIndex: 'userName',
55
-      key: 'userName',
35
+      dataIndex: 'petName',
36
+      key: 'petName',
56 37
       search: true,
57 38
     },
58 39
     {
59 40
       title: '申领方式',
60
-      dataIndex: 'userName',//快递到家,上门自取
61
-      key: 'userName',
41
+      dataIndex: 'applyMethod',
42
+      key: 'applyMethod',
62 43
       search: true,
44
+      render: (_, record) => {
45
+        return record.applyMethod === 1
46
+          ? '上门自取'
47
+          : record.applyMethod === 2
48
+            ? '快递到家' : ''
49
+      },
50
+      valueType: 'select',
51
+      valueEnum: {
52
+        1: { text: '上门自取' },
53
+        2: { text: '快递到家' },
54
+      },
63 55
     },
64 56
     {
65 57
       title: '申请时间',
66 58
       dataIndex: 'createDate',
67 59
       key: 'createDate',
68 60
       render: (t) => formatterTime(t),
69
-      renderFormItem: (_, record) => <RangePicker defaultValue={[initDate.current, initDate.current]} placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
61
+      renderFormItem: (_, record) => <RangePicker placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
70 62
     },
71 63
     {
72
-      title: '状态',
73
-      dataIndex: 'userName',
74
-      key: 'userName',
75
-      search: true,//待发放 已发放
64
+      title: '制证状态',
65
+      dataIndex: 'makeStatus',
66
+      key: 'makeStatus',
67
+      search: true,// 
68
+      render: (_, record) => {
69
+        return record.makeStatus === 0
70
+          ? '待发放'
71
+          : record.makeStatus === 1
72
+            ? '已发放' : ''
73
+      },
74
+      valueType: 'select',
75
+      valueEnum: {
76
+        0: { text: '待发放' },
77
+        1: { text: '已发放' },
78
+      },
76 79
     },
77 80
     {
78 81
       title: '发放人',
79
-      dataIndex: 'userName',
80
-      key: 'userName',
81
-      search: true,//待发放 已发放
82
+      dataIndex: 'makeUserName',
83
+      key: 'makeUserName',
84
+      search: true,
82 85
     },
83 86
     {
84 87
       title: '发放时间',
85
-      dataIndex: 'createDate',
86
-      key: 'createDate',
87
-      render: (t) => formatterTime(t),
88
-      renderFormItem: (_, record) => <RangePicker defaultValue={[initDate.current, initDate.current]} placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
88
+      dataIndex: 'makeDate',
89
+      key: 'makeDate',
90
+      render: (t) => t != '-' ? formatterTime(t) : '-',
91
+      renderFormItem: (_, record) => <RangePicker placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
89 92
     },
90 93
     {
91 94
       title: '操作',
92 95
       valueType: 'option',
93 96
       width: 160,
94 97
       render: (_, record) => [
95
-        <Button key={1} style={{ padding: 0 }} type="link">
98
+        <Button key={1} style={{ padding: 0 }} type="link"
99
+          onClick={() => goDetail(record.applyId)}
100
+        >
96 101
           发放
97 102
         </Button>
98 103
       ],
@@ -105,16 +110,9 @@ export default (props) => {
105 110
       <PageTable
106 111
         actionRef={actionRef}
107 112
         columns={columns}
108
-        request={getList}
113
+        request={getMakeList}
109 114
         options={false}
110
-        search={{
111
-          defaultCollapsed: false
112
-        }}
113
-        form={{ ignoreRules: false }}
114
-        manualRequest={true}
115
-        revalidateOnFocus={false}
116
-        beforeSearchSubmit={handleBeforSearch}
117
-        rowKey="formId"
115
+        rowKey="applyId"
118 116
       />
119 117
     </PageHeaderWrapper>
120 118
   )

+ 115
- 42
src/pages/certificateIssuance/issuance.jsx ファイルの表示

@@ -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
               </>

+ 2
- 2
src/pages/examine/index.jsx ファイルの表示

@@ -3,7 +3,7 @@ import moment from 'moment';
3 3
 import { DatePicker, Button } from 'antd';
4 4
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
5 5
 import PageTable from '@/components/PageTable'
6
-import { getApplicationList } from '@/services/application'
6
+import { getAuditList } from '@/services/application'
7 7
 import { history } from 'umi';
8 8
 
9 9
 
@@ -110,7 +110,7 @@ export default (props) => {
110 110
       <PageTable
111 111
         actionRef={actionRef}
112 112
         columns={columns}
113
-        request={getApplicationList}
113
+        request={getAuditList}
114 114
         options={false}
115 115
         rowKey="applyId"
116 116
       />

+ 21
- 0
src/services/application.js ファイルの表示

@@ -21,9 +21,30 @@ export const updateMake = (id, data) => request(`/application/${id}/make`, { met
21 21
  */
22 22
 export const getApplicationList = (params) => request('/application', { params });
23 23
 
24
+/**
25
+ * 查询审核列表
26
+ * @param {*} params
27
+ * @returns
28
+ */
29
+ export const getAuditList = (params) => request('/application?process=1', { params });
30
+
31
+ /**
32
+ * 查询发证列表
33
+ * @param {*} params
34
+ * @returns
35
+ */
36
+ export const getMakeList = (params) => request('/application?process=2', { params });
37
+
24 38
 /**
25 39
  * 查询申请详情
26 40
  * @param {*} params
27 41
  * @returns
28 42
  */
29 43
 export const getApplicationDetail = (id) => request(`/application/${id}`);
44
+
45
+/**
46
+ * 随机生成证件号
47
+ * @param {*} params
48
+ * @returns
49
+ */
50
+ export const getCardNo = () => request('/card/next');