李志伟 3 年之前
父節點
當前提交
69ddfa9987

+ 7
- 3
config/routes.js 查看文件

64
     path: '/applicationList/detail.jsx',
64
     path: '/applicationList/detail.jsx',
65
     name: '申请详情',
65
     name: '申请详情',
66
     hideInMenu: true,
66
     hideInMenu: true,
67
-    icon: 'apartment',
68
     component: '@/pages/applicationList/detail.jsx',
67
     component: '@/pages/applicationList/detail.jsx',
69
   },
68
   },
70
   {
69
   {
77
     path: '/examine/detail.jsx',
76
     path: '/examine/detail.jsx',
78
     name: '犬证审核',
77
     name: '犬证审核',
79
     hideInMenu: true,
78
     hideInMenu: true,
80
-    icon: 'apartment',
81
     component: '@/pages/examine/detail.jsx',
79
     component: '@/pages/examine/detail.jsx',
82
   },
80
   },
83
   {
81
   {
86
     icon: 'IdcardOutlined',
84
     icon: 'IdcardOutlined',
87
     component: '@/pages/certificateIssuance',
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
     path: '/userList',
95
     path: '/userList',
92
-    name: '用户注册列表',
96
+    name: '犬主列表',
93
     icon: 'SolutionOutlined',
97
     icon: 'SolutionOutlined',
94
     component: '@/pages/userList',
98
     component: '@/pages/userList',
95
   },
99
   },

+ 51
- 53
src/pages/certificateIssuance/index.jsx 查看文件

1
 import React, { useRef } from 'react'
1
 import React, { useRef } from 'react'
2
-import { useModel } from 'umi';
3
 import moment from 'moment';
2
 import moment from 'moment';
4
 import { DatePicker, Button } from 'antd';
3
 import { DatePicker, Button } from 'antd';
5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
 import PageTable from '@/components/PageTable'
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
 const { RangePicker } = DatePicker;
9
 const { RangePicker } = DatePicker;
10
 
10
 
13
 };
13
 };
14
 
14
 
15
 export default (props) => {
15
 export default (props) => {
16
-  const initDate = useRef(moment())
17
   const actionRef = useRef();
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
   const columns = [
20
   const columns = [
39
-    
40
     {
21
     {
41
       title: '证件号',
22
       title: '证件号',
42
-      dataIndex: 'userName',
43
-      key: 'userName',
23
+      dataIndex: 'originCardNo',
24
+      key: 'originCardNo',
44
       search: true,
25
       search: true,
45
     },
26
     },
46
     {
27
     {
47
       title: '犬主',
28
       title: '犬主',
48
-      dataIndex: 'userName',
49
-      key: 'userName',
29
+      dataIndex: 'personName',
30
+      key: 'personName',
50
       search: true,
31
       search: true,
51
     },
32
     },
52
     {
33
     {
53
       title: '犬名',
34
       title: '犬名',
54
-      dataIndex: 'userName',
55
-      key: 'userName',
35
+      dataIndex: 'petName',
36
+      key: 'petName',
56
       search: true,
37
       search: true,
57
     },
38
     },
58
     {
39
     {
59
       title: '申领方式',
40
       title: '申领方式',
60
-      dataIndex: 'userName',//快递到家,上门自取
61
-      key: 'userName',
41
+      dataIndex: 'applyMethod',
42
+      key: 'applyMethod',
62
       search: true,
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
       title: '申请时间',
57
       title: '申请时间',
66
       dataIndex: 'createDate',
58
       dataIndex: 'createDate',
67
       key: 'createDate',
59
       key: 'createDate',
68
       render: (t) => formatterTime(t),
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
       title: '发放人',
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
       title: '发放时间',
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
       title: '操作',
94
       title: '操作',
92
       valueType: 'option',
95
       valueType: 'option',
93
       width: 160,
96
       width: 160,
94
       render: (_, record) => [
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
         </Button>
102
         </Button>
98
       ],
103
       ],
105
       <PageTable
110
       <PageTable
106
         actionRef={actionRef}
111
         actionRef={actionRef}
107
         columns={columns}
112
         columns={columns}
108
-        request={getList}
113
+        request={getMakeList}
109
         options={false}
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
     </PageHeaderWrapper>
117
     </PageHeaderWrapper>
120
   )
118
   )

+ 115
- 42
src/pages/certificateIssuance/issuance.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
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
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
-import { getWithdrawalDetail, updateWithdrawal } from '@/services/withdrawal'
4
+import { getApplicationDetail, updateMake, getCardNo } from '@/services/application'
5
 import { history } from 'umi';
5
 import { history } from 'umi';
6
 
6
 
7
-const { TextArea } = Input;
8
 const FormItem = Form.Item;
7
 const FormItem = Form.Item;
9
 const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
8
 const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
10
 const goBack = () => {
9
 const goBack = () => {
13
 export default (props) => {
12
 export default (props) => {
14
   const { location } = props;
13
   const { location } = props;
15
   const { id } = location.query;
14
   const { id } = location.query;
16
-  const [withdrawal, setWithdrawal] = useState();
17
-  const [remarks, setRemarks] = useState()
15
+  const [application, setApplication] = useState({});
18
   const [loading, setLoading] = useState(false)
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
     else {
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
   useEffect(() => {
53
   useEffect(() => {
37
-    getWithdrawalDetail(id).then((res) => {
38
-      setWithdrawal(res)
39
-      setRemarks(res.auditRemark)
54
+    getApplicationDetail(id).then((res) => {
55
+      setApplication(res)
40
     }).catch((err) => {
56
     }).catch((err) => {
41
       console.log(err.message)
57
       console.log(err.message)
42
     });
58
     });
45
     <PageHeaderWrapper    >
61
     <PageHeaderWrapper    >
46
       <Card>
62
       <Card>
47
         <Form {...formItemLayout}>
63
         <Form {...formItemLayout}>
48
-          <FormItem label="申请人">
49
-            {withdrawal?.userName}
50
-          </FormItem>
51
           <FormItem label="犬主">
64
           <FormItem label="犬主">
52
-            {withdrawal?.phone}
65
+            {application?.personName}
66
+          </FormItem>
67
+          <FormItem label="电话">
68
+            {application?.phone}
53
           </FormItem>
69
           </FormItem>
54
           <FormItem label="犬名">
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
           </FormItem>
78
           </FormItem>
57
           <FormItem label="犬种">
79
           <FormItem label="犬种">
58
-            {withdrawal?.amountLeft / 100}
80
+            {application?.petType}
59
           </FormItem>
81
           </FormItem>
60
           <FormItem label="毛色">
82
           <FormItem label="毛色">
61
-            {withdrawal?.bankCard.ownerBank}
83
+            {application?.petColor}
62
           </FormItem>
84
           </FormItem>
63
           <FormItem label="照片">
85
           <FormItem label="照片">
64
-            {withdrawal?.bankCard.cardNo}
86
+            <Image src={application?.img1} width={100} />
65
           </FormItem>
87
           </FormItem>
66
           <FormItem label="养狗地址">
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
           </FormItem>
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
           </FormItem>
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
           </FormItem>
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
           </FormItem>
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
           <FormItem label=" " colon={false}>
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
                 </Button>
165
                 </Button>
93
               </>
166
               </>

+ 2
- 2
src/pages/examine/index.jsx 查看文件

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

+ 21
- 0
src/services/application.js 查看文件

21
  */
21
  */
22
 export const getApplicationList = (params) => request('/application', { params });
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
  * @param {*} params
40
  * @param {*} params
27
  * @returns
41
  * @returns
28
  */
42
  */
29
 export const getApplicationDetail = (id) => request(`/application/${id}`);
43
 export const getApplicationDetail = (id) => request(`/application/${id}`);
44
+
45
+/**
46
+ * 随机生成证件号
47
+ * @param {*} params
48
+ * @returns
49
+ */
50
+ export const getCardNo = () => request('/card/next');