李志伟 2 年前
父节点
当前提交
115c663d8d

+ 12
- 1
config/routes.js 查看文件

@@ -90,7 +90,18 @@ export default [
90 90
     hideInMenu: true,
91 91
     component: '@/pages/certificateIssuance/issuance.jsx',
92 92
   },
93
-  
93
+  {
94
+    path: '/cardList',
95
+    name: '证件列表',
96
+    icon: 'IdcardOutlined',
97
+    component: '@/pages/cardList',
98
+  },
99
+  {
100
+    path: '/cardList/detail.jsx',
101
+    name: '证件详情',
102
+    hideInMenu: true,
103
+    component: '@/pages/cardList/detail.jsx',
104
+  },
94 105
   {
95 106
     path: '/userList',
96 107
     name: '犬主列表',

+ 70
- 0
src/pages/cardList/detail.jsx 查看文件

@@ -0,0 +1,70 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Card, Form, Button, Image } from 'antd';
3
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
+import { getCardDetail } from '@/services/card'
5
+import { history } from 'umi';
6
+
7
+const FormItem = Form.Item;
8
+const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
9
+const goBack = () => {
10
+  history.goBack();
11
+};
12
+export default (props) => {
13
+  const { location } = props;
14
+  const { id } = location.query;
15
+  const [card, setCard] = useState({});
16
+
17
+  useEffect(() => {
18
+    getCardDetail(id).then((res) => {
19
+      setCard(res)
20
+    }).catch((err) => {
21
+      console.log(err.message)
22
+    });
23
+  }, [id])
24
+  return (
25
+    <PageHeaderWrapper    >
26
+      <Card>
27
+        <Form {...formItemLayout}>
28
+          <FormItem label="证件号">
29
+            {card?.cardNo}
30
+          </FormItem>
31
+          <FormItem label="犬主">
32
+            {card?.personName}
33
+          </FormItem>
34
+          <FormItem label="电话">
35
+            {card?.phone}
36
+          </FormItem>
37
+          <FormItem label="犬名">
38
+            {card?.petName}
39
+          </FormItem>
40
+          <FormItem label="性别">
41
+            {
42
+              card?.petSex == 1 ? '雄' :
43
+                card?.petSex == 2 ? '雌' : '未说明性别'
44
+            }
45
+          </FormItem>
46
+          <FormItem label="犬种">
47
+            {card?.petType}
48
+          </FormItem>
49
+          <FormItem label="毛色">
50
+            {card?.petColor}
51
+          </FormItem>
52
+          <FormItem label="照片">
53
+            <Image src={card?.petImg1} width={100} />
54
+          </FormItem>
55
+          <FormItem label="养狗地址">
56
+            {card?.address}
57
+          </FormItem>
58
+          <FormItem label="狗证有效期">
59
+          {card?.startDate+'~'+card?.expireDate}
60
+          </FormItem>
61
+          <FormItem label=" " colon={false}>
62
+            <Button type="default" onClick={() => goBack()}>
63
+              返回
64
+            </Button>
65
+          </FormItem>
66
+        </Form>
67
+      </Card>
68
+    </PageHeaderWrapper>
69
+  );
70
+};

+ 64
- 0
src/pages/cardList/index.jsx 查看文件

@@ -0,0 +1,64 @@
1
+import React, { useRef } from 'react'
2
+import { Button } from 'antd';
3
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
+import PageTable from '@/components/PageTable'
5
+import { getCardList } from '@/services/card'
6
+import { history } from 'umi';
7
+
8
+export default (props) => {
9
+  const actionRef = useRef();
10
+  const goDetail = (id) => {
11
+    history.push(`cardList/detail.jsx?id=${id}`);
12
+  }
13
+  const columns = [
14
+    {
15
+      title: '证件号',
16
+      dataIndex: 'cardNo',
17
+      key: 'cardNo',
18
+      search: true,
19
+    },
20
+    {
21
+      title: '犬主',
22
+      dataIndex: 'personName',
23
+      key: 'personName',
24
+      search: true,
25
+    },
26
+    {
27
+      title: '犬名',
28
+      dataIndex: 'petName',
29
+      key: 'petName',
30
+      search: true,
31
+    },
32
+    {
33
+      title: '有效期',
34
+      dataIndex: 'createDate',
35
+      key: 'createDate',
36
+      render: (t, record) => record.startDate + (record.expireDate!=null?'~' + record.expireDate:''),
37
+      search:false
38
+    },
39
+    {
40
+      title: '操作',
41
+      valueType: 'option',
42
+      width: 160,
43
+      render: (_, record) => [
44
+        <Button key={1} style={{ padding: 0 }} type="link"
45
+          onClick={() => goDetail(record.cardId)}
46
+        >
47
+          详情
48
+        </Button>
49
+      ],
50
+    },
51
+  ]
52
+
53
+  return (
54
+    <PageHeaderWrapper>
55
+      <PageTable
56
+        actionRef={actionRef}
57
+        columns={columns}
58
+        request={getCardList}
59
+        options={false}
60
+        rowKey="cardId"
61
+      />
62
+    </PageHeaderWrapper>
63
+  )
64
+}

+ 0
- 6
src/pages/certificateIssuance/issuance.jsx 查看文件

@@ -137,12 +137,6 @@ export default (props) => {
137 137
               </Button>
138 138
             }
139 139
           </FormItem>
140
-          {
141
-            application?.makeStatus != 0 &&
142
-            <FormItem label="证件有效期">
143
-              {application?.makeDate}
144
-            </FormItem>
145
-          }
146 140
           {
147 141
             application.applyMethod == 2 && <>
148 142
               <FormItem label="快递公司">

+ 26
- 27
src/pages/dashboard/components/OrgSummary.jsx 查看文件

@@ -6,9 +6,8 @@ const lineOption = {
6 6
   tooltip: {
7 7
     trigger: 'axis',
8 8
     axisPointer: {
9
-      type: 'shadow'
9
+      type: 'cross'
10 10
     },
11
-    // formatter: (params) => `人次: ${params[0].data.value || 0}`
12 11
   },
13 12
 
14 13
   grid: {
@@ -24,7 +23,6 @@ const lineOption = {
24 23
 
25 24
   xAxis: {
26 25
     type: 'category',
27
-
28 26
   },
29 27
 
30 28
   dataset: [
@@ -36,6 +34,7 @@ const lineOption = {
36 34
   series: [
37 35
     {
38 36
       type: 'line',
37
+      name: '申请数',
39 38
       datasetIndex: 0,
40 39
       itemStyle: {
41 40
         normal: {
@@ -45,51 +44,51 @@ const lineOption = {
45 44
           }
46 45
         }
47 46
       }
48
-    },    
47
+    },
49 48
   ]
50 49
 }
51 50
 export default (props) => {
52 51
   const [loading, setLoading] = useState(false)
53 52
   const [list, setList] = useState([
54 53
     {
55
-      date:'2022-9-9',
56
-      value:20
54
+      date: '2022-9-9',
55
+      value: 20
57 56
     },
58 57
     {
59
-      date:'2022-9-10',
60
-      value:205
58
+      date: '2022-9-10',
59
+      value: 205
61 60
     },
62 61
     {
63
-      date:'2022-9-11',
64
-      value:200
62
+      date: '2022-9-11',
63
+      value: 200
65 64
     },
66 65
     {
67
-      date:'2022-9-12',
68
-      value:210
66
+      date: '2022-9-12',
67
+      value: 210
69 68
     },
70 69
     {
71
-      date:'2022-9-13',
72
-      value:10
70
+      date: '2022-9-13',
71
+      value: 10
73 72
     },
74 73
     {
75
-      date:'2022-9-14',
76
-      value:50
74
+      date: '2022-9-14',
75
+      value: 50
77 76
     },
78 77
     {
79
-      date:'2022-9-15',
80
-      value:80
78
+      date: '2022-9-15',
79
+      value: 80
81 80
     },
82 81
     {
83
-      date:'2022-9-16',
84
-      value:27
82
+      date: '2022-9-16',
83
+      value: 27
85 84
     },
86 85
     {
87
-      date:'2022-9-19',
88
-      value:99
86
+      date: '2022-9-19',
87
+      value: 99
89 88
     },
90 89
     {
91
-      date:'2022-9-20',
92
-      value:5
90
+      date: '2022-9-20',
91
+      value: 5
93 92
     },
94 93
   ])
95 94
 
@@ -100,7 +99,7 @@ export default (props) => {
100 99
       source: list
101 100
     }
102 101
   }
103
-  
102
+
104 103
   const queryList = useCallback(() => {
105 104
     // setLoading(true)
106 105
 
@@ -114,13 +113,13 @@ export default (props) => {
114 113
     //   setLoading(false)
115 114
     // })
116 115
   }, [])
117
-  
116
+
118 117
   useEffect(() => {
119 118
     queryList()
120 119
   }, [])
121 120
 
122 121
   return (
123
-    <Card title='近期提交趋势统计' loading={loading} bodyStyle={{height: 600}}>
122
+    <Card title='近期提交趋势统计' loading={loading} bodyStyle={{ height: 600 }}>
124 123
       <Echart option={option} />
125 124
     </Card>
126 125
   )

+ 84
- 49
src/pages/dashboard/components/ReportList.jsx 查看文件

@@ -1,30 +1,11 @@
1 1
 import moment from 'moment'
2 2
 import { Card, List, Badge, Space, Carousel } from 'antd'
3
-import { useCallback, useEffect, useMemo, useState } from 'react'
4
-// import { getList } from '@/services/work'
5
-import { random } from '@/utils/number'
6
-
7
-const colorList = [
8
-  '#a8071a',
9
-  '#ad2102',
10
-  '#ad4e00',
11
-  '#ad6800',
12
-  '#ad8b00',
13
-  '#5b8c00',
14
-  '#237804',
15
-  '#006d75',
16
-  '#0050b3',
17
-  '#10239e',
18
-  '#391085',
19
-  '#9e1068',
20
-]
3
+import { useEffect, useMemo, useState } from 'react'
21 4
 
22 5
 const Avatar = (props) => {
23 6
   const style = useMemo(() => {
24
-    let r = random(0, colorList.length)
25
-    if (r >= 12) r = 0;
26
-    const color = colorList[r];
27
-
7
+    const color = props.item.status == 'first' ? '#C5E0A9' :
8
+    props.item.status == 'renewal' ? '#87C5ED' : '#E9CB99';
28 9
     return {
29 10
       background: color,
30 11
       color: '#fff',
@@ -43,13 +24,9 @@ const Avatar = (props) => {
43 24
 const Content = (props) => {
44 25
   const { item } = props;
45 26
 
46
-  const abnormal = item.antigenIsNormal === 0 || item.nucleicIsNormal === 0
47
-  const status = abnormal ? 'error' : 'success'
48
-
49 27
   return (
50 28
     <Space size="large">
51
-      <span><Badge status={status} /> { abnormal ? '异常' : '正常' }</span>
52
-      <span>{moment(item.createDate).format('HH:mm')}</span>
29
+      <span>{moment(item.createDate).format('YYYY-MM-DD HH:mm')}</span>
53 30
     </Space>
54 31
   )
55 32
 }
@@ -58,28 +35,86 @@ const showNum = 8;
58 35
 
59 36
 export default (props) => {
60 37
   const [loading, setLoading] = useState(false)
61
-  const [list, setList] = useState([])
62 38
   const [disabled, setDisabled] = useState(false)
63
-
64
-  const queryList = useCallback(() => {
65
-    // setLoading(true)
66
-    // getList(
67
-    //   {
68
-    //     pageSize: 50, // 过多会很卡
69
-    //     start: moment().format('YYYY-MM-DD'),
70
-    //     end: moment().format('YYYY-MM-DD'),
71
-    //     isAll: true
72
-    //   }).then(res => {
73
-    //     setLoading(false)
74
-    //     setList((res.records || []).reverse())
75
-    //   }).catch(er => {
76
-    //     setLoading(false)
77
-    //   })
78
-  }, [])
79
-
80
-  useEffect(() => {
81
-    queryList()
82
-  }, [])
39
+  const [list, setList] = useState([
40
+    {
41
+      orgName: '办证',
42
+      status: 'first',
43
+      userName: '俏如来',
44
+      formId: 0,
45
+      createDate: '2021-5-6 11:22:50'
46
+    },
47
+    {
48
+      orgName: '续期',
49
+      status: 'renewal',
50
+      userName: '雪山银燕',
51
+      formId: 1,
52
+      createDate: '2021-5-9 11:22:50'
53
+    },
54
+    {
55
+      orgName: '补办',
56
+      status: 'reissue',
57
+      userName: '史艳文',
58
+      formId: 2,
59
+      createDate: '2021-5-5 11:22:50'
60
+    },
61
+    {
62
+      orgName: '办证',
63
+      status: 'first',
64
+      userName: '南宫恨',
65
+      formId: 3,
66
+      createDate: '2021-5-7 11:22:50'
67
+    },
68
+    {
69
+      orgName: '补办',
70
+      status: 'reissue',
71
+      userName: '神蛊温皇',
72
+      formId: 4,
73
+      createDate: '2021-5-15 11:22:50'
74
+    },
75
+    {
76
+      orgName: '办证',
77
+      status: 'first',
78
+      userName: '燕驼龙',
79
+      formId: 5,
80
+      createDate: '2021-5-6 11:22:50'
81
+    },
82
+    {
83
+      orgName: '办证',
84
+      status: 'first',
85
+      userName: '忆无心',
86
+      formId: 6,
87
+      createDate: '2021-5-6 11:22:50'
88
+    },
89
+    {
90
+      orgName: '补办',
91
+      status: 'reissue',
92
+      userName: '史艳文',
93
+      formId: 7,
94
+      createDate: '2021-5-6 11:22:50'
95
+    },
96
+    {
97
+      orgName: '续期',
98
+      status: 'renewal',
99
+      userName: '宫本武藏',
100
+      formId: 8,
101
+      createDate: '2021-5-6 11:22:50'
102
+    },
103
+    {
104
+      orgName: '办证',
105
+      status: 'first',
106
+      userName: '素还真',
107
+      formId: 9,
108
+      createDate: '2021-5-6 11:22:50'
109
+    },
110
+    {
111
+      orgName: '续期',
112
+      status: 'renewal',
113
+      userName: '元邪皇',
114
+      formId: 10,
115
+      createDate: '2021-5-6 11:22:50'
116
+    },
117
+  ])
83 118
 
84 119
   useEffect(() => {
85 120
     setDisabled(!list || list.length <= showNum)
@@ -103,7 +138,7 @@ export default (props) => {
103 138
               <div key={item.formId} style={{ display: 'flex' }}>
104 139
                 <List.Item>
105 140
                   <List.Item.Meta
106
-                    avatar={<Avatar>{item.orgName.substring(0,1)}</Avatar>}
141
+                    avatar={<Avatar item={item}>{item.orgName.substring(0, 1)}</Avatar>}
107 142
                     title={item.userName}
108 143
                     con
109 144
                     description={item.orgName}

+ 10
- 38
src/pages/userList/index.jsx 查看文件

@@ -4,7 +4,7 @@ import moment from 'moment';
4 4
 import { DatePicker, Button } from 'antd';
5 5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 6
 import PageTable from '@/components/PageTable'
7
-import { getList } from '@/services/work'
7
+import { getPersonList } from '@/services/person'
8 8
 
9 9
 const { RangePicker } = DatePicker;
10 10
 
@@ -13,40 +13,19 @@ const formatterTime = (val) => {
13 13
 };
14 14
 
15 15
 export default (props) => {
16
-  const initDate = useRef(moment())
17
-  const actionRef = useRef();
18
-  const { initialState } = useModel('@@initialState');
19
-
20
-  const handleBeforSearch = (params) => {
21
-    const { createDate, ...others } = params;
22 16
 
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 };
37
-  }
38
-  const columns = [
39
-    
17
+  const actionRef = useRef();
18
+  const columns = [    
40 19
     {
41 20
       title: '姓名',
42
-      dataIndex: 'userName',
43
-      key: 'userName',
21
+      dataIndex: 'nickName',
22
+      key: 'nickName',
44 23
       search: true,
45 24
     },
46 25
     {
47 26
       title: '手机号',
48
-      dataIndex: 'userName',
49
-      key: 'userName',
27
+      dataIndex: 'phone',
28
+      key: 'phone',
50 29
       search: true,
51 30
     },
52 31
     {
@@ -54,7 +33,7 @@ export default (props) => {
54 33
       dataIndex: 'createDate',
55 34
       key: 'createDate',
56 35
       render: (t) => formatterTime(t),
57
-      renderFormItem: (_, record) => <RangePicker defaultValue={[initDate.current, initDate.current]} placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
36
+      renderFormItem: (_, record) => <RangePicker placeholder={['开始日期', '结束日期']} format='YYYY-MM-DD' />
58 37
     },
59 38
   ]
60 39
 
@@ -63,16 +42,9 @@ export default (props) => {
63 42
       <PageTable
64 43
         actionRef={actionRef}
65 44
         columns={columns}
66
-        request={getList}
45
+        request={getPersonList}
67 46
         options={false}
68
-        search={{
69
-          defaultCollapsed: false
70
-        }}
71
-        form={{ ignoreRules: false }}
72
-        manualRequest={true}
73
-        revalidateOnFocus={false}
74
-        beforeSearchSubmit={handleBeforSearch}
75
-        rowKey="formId"
47
+        rowKey="personId"
76 48
       />
77 49
     </PageHeaderWrapper>
78 50
   )

+ 15
- 0
src/services/card.js 查看文件

@@ -0,0 +1,15 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 查询犬证列表
5
+ * @param {*} params
6
+ * @returns
7
+ */
8
+ export const getCardList = (params) => request('/card', { params });
9
+
10
+ /**
11
+ * 查询犬证详情
12
+ * @param {*} params
13
+ * @returns
14
+ */
15
+export const getCardDetail = (id) => request(`/card/${id}`);

+ 8
- 0
src/services/person.js 查看文件

@@ -0,0 +1,8 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 查询犬主列表
5
+ * @param {*} params
6
+ * @returns
7
+ */
8
+ export const getPersonList = (params) => request('/person', { params });