Browse Source

Merge branch 'master' of http://git.ycjcjy.com/pet_identity/pc-admin

张延森 2 years ago
parent
commit
01c9cc0736

+ 1
- 1
src/components/SettingRow/index.jsx View File

@@ -26,7 +26,7 @@ const SettingRow = (props) => {
26 26
   };
27 27
   return (
28 28
     <div style={{ marginBottom:'16px' }}>
29
-      {value.title}:
29
+      <span style={{width:'120px', display:'inline-block', textAlign:'right'}}>{value.title}</span>
30 30
       <Input style={{ width: '200px',marginRight:value.desc?'16px':'0' }} value={val} onChange={handleChange} onInput={handleInput} />
31 31
       {value.desc?'('+value.desc+')':''}
32 32
       <Button

+ 4
- 5
src/pages/cardNoList/index.jsx View File

@@ -1,4 +1,3 @@
1
-import { history } from 'umi';
2 1
 import { useRef,useState } from 'react';
3 2
 import { Button, Modal, message, Image,Form,Input, InputNumber } from 'antd';
4 3
 import { PlusOutlined } from '@ant-design/icons';
@@ -82,11 +81,11 @@ export default (props) => {
82 81
         footer={null}
83 82
       >
84 83
         <Form {...formItemLayout} onFinish={Submit} form={form}>
85
-          <FormItem label="卡号前缀" name="prefix" rules={[{ required: true, message: '请输入' }]}>
86
-            <Input placeholder="请输入" />
84
+          <FormItem label="卡号前缀" name="prefix" rules={[{ required: true, message: '请输入卡号前缀' }]}>
85
+            <Input placeholder="请输入卡号前缀" />
87 86
           </FormItem>
88
-          <FormItem label="生成数量" name="num" tooltip='生成数建议至多1000' rules={[{ required: true, message: '请输入正整数' }]}>
89
-            <InputNumber style={{width:'100%'}} min={1} placeholder="请输入" />
87
+          <FormItem label="生成数量" name="num" tooltip='生成数建议1~1000' rules={[{ required: true, message: '请输入正整数' }]}>
88
+            <InputNumber style={{width:'100%'}} min={1} max={1000} placeholder="请输入制卡数量1~1000" />
90 89
           </FormItem>
91 90
           <FormItem label=" " colon={false}>
92 91
             <Button type="default" onClick={onCancel}>

+ 1
- 1
src/pages/certificateIssuance/index.jsx View File

@@ -98,7 +98,7 @@ export default (props) => {
98 98
         <Button key={1} style={{ padding: 0 }} type="link"
99 99
           onClick={() => goDetail(record.applyId)}
100 100
         >
101
-          发
101
+          发
102 102
         </Button>
103 103
       ],
104 104
     },

+ 20
- 18
src/pages/certificateIssuance/issuance.jsx View File

@@ -14,20 +14,21 @@ export default (props) => {
14 14
   const { id } = location.query;
15 15
   const [application, setApplication] = useState({});
16 16
   const [loading, setLoading] = useState(false)
17
+  const [form] = Form.useForm();
17 18
   //需要改一下
18
-  const handleMake = () => {
19
-    if (application.originCardNo) {
19
+  const handleMake = (value) => {
20
+    if (value.originCardNo) {
20 21
       if (
21 22
         (application.applyMethod == 2
22
-          && application.trackingType
23
-          && application.trackingNo)
23
+          && value.trackingType
24
+          && value.trackingNo)
24 25
         || application.applyMethod == 1) {
25 26
         setLoading(true)
26 27
         var data = {
27
-          cardNo: application.originCardNo,
28
+          cardNo: value.originCardNo,
28 29
           makeStatus: application.makeStatus,
29
-          trackingType: application.trackingType,
30
-          trackingNo: application.trackingNo
30
+          trackingType: value.trackingType,
31
+          trackingNo: value.trackingNo
31 32
         }
32 33
         updateMake(id, data).then(() => {
33 34
           message.success('操作成功');
@@ -47,6 +48,7 @@ export default (props) => {
47 48
   }
48 49
   useEffect(() => {
49 50
     getApplicationDetail(id).then((res) => {
51
+      form.setFieldsValue(res);
50 52
       setApplication(res)
51 53
     }).catch((err) => {
52 54
       console.log(err.message)
@@ -55,7 +57,7 @@ export default (props) => {
55 57
   return (
56 58
     <PageHeaderWrapper    >
57 59
       <Card>
58
-        <Form {...formItemLayout}>
60
+        <Form {...formItemLayout} onFinish={handleMake} form={form}>
59 61
           <FormItem label="犬主">
60 62
             {application?.personName}
61 63
           </FormItem>
@@ -118,29 +120,28 @@ export default (props) => {
118 120
                     ? '已支付' : ''
119 121
             }
120 122
           </FormItem>
121
-          <FormItem label="证件号">
123
+          <FormItem label="证件号" name='originCardNo' rules={[{ required: true, message: '请输入证件号' }]}>
122 124
             <Input
123
-              value={application.originCardNo}
124 125
               style={{ width: '350px' }}
125 126
               readOnly={application?.makeStatus != 0}
126 127
               placeholder='请输入证件号(必填)'
127
-              onChange={e => setApplication({ ...application, originCardNo: e.target.value })} />
128
+            />
128 129
           </FormItem>
129 130
           {
130 131
             application.applyMethod == 2 && <>
131
-              <FormItem label="快递公司">
132
-                <Input value={application.trackingType}
132
+              <FormItem label="快递公司" name='trackingType' rules={[{ required: true, message: '请输入快递公司' }]}>
133
+                <Input
133 134
                   style={{ width: '350px' }}
134 135
                   placeholder='请输入快递公司(必填)'
135 136
                   readOnly={application?.makeStatus != 0}
136
-                  onChange={e => setApplication({ ...application, trackingType: e.target.value })} />
137
+                 />
137 138
               </FormItem>
138
-              <FormItem label="快递单号">
139
-                <Input value={application.trackingNo}
139
+              <FormItem label="快递单号" name='trackingNo' rules={[{ required: true, message: '请输入快递公司' }]}>
140
+                <Input
140 141
                   style={{ width: '350px' }}
141 142
                   placeholder='请输入快递单号(必填)'
142 143
                   readOnly={application?.makeStatus != 0}
143
-                  onChange={e => setApplication({ ...application, trackingNo: e.target.value })} />
144
+                />
144 145
               </FormItem>
145 146
             </>
146 147
           }
@@ -149,7 +150,8 @@ export default (props) => {
149 150
               application?.makeStatus == 0 &&
150 151
               <>
151 152
                 <Button type="primary" loading={loading}
152
-                  style={{ marginRight: '16px' }} onClick={() => handleMake()}>
153
+                htmlType="Submit"
154
+                  style={{ marginRight: '16px' }}>
153 155
                   发放
154 156
                 </Button>
155 157
               </>

+ 34
- 17
src/pages/examine/detail.jsx View File

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Card, Form, Button, Image, Input, message } from 'antd';
2
+import { Card, Form, Button, Image, Input, message, Radio, Modal } from 'antd';
3 3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4 4
 import { getApplicationDetail, updateAudit, getPetCardNo } from '@/services/application'
5 5
 import { history } from 'umi';
@@ -15,6 +15,7 @@ export default (props) => {
15 15
   const { id } = location.query;
16 16
   const [application, setApplication] = useState({});
17 17
   const [rejectReason, setRejectReason] = useState();
18
+  const [examineType, SetExamineType] = useState(1);
18 19
   const [loading, setLoading] = useState(false)
19 20
 
20 21
   const getAudit = (val) => {
@@ -28,29 +29,44 @@ export default (props) => {
28 29
       setLoading(false)
29 30
     })
30 31
   }
31
-  const handleAudit = (val) => {
32
-    if ((val == 2 && rejectReason) || val == 1) {
33
-      if (val == 1 && application.applyType == 'first') {
32
+  const handleAudit = () => {
33
+    if ((examineType == 2 && rejectReason) || examineType == 1) {
34
+      if (examineType == 1 && application.applyType == 'first') {
34 35
         getPetCardNo(application.petId).then((res) => {
35 36
           if (!res) {
36
-            getAudit(val);
37
+            getAudit(examineType);
37 38
           } else {
38
-            message.info('该宠物已有犬证,请驳回犬主申请');
39
+            message.info('该宠物已有犬证,请拒绝犬主办证申请');
39 40
           }
40 41
         })
41 42
       } else {
42
-        getAudit(val);
43
+        getAudit(examineType);
43 44
       }
44 45
     }
45 46
     else {
46 47
       message.success('请输入处理结果');
47 48
     }
48 49
   }
50
+  //列表切换通知状态方法
51
+  const handleOK = (record, data) => {
52
+    const title = examineType == 1
53
+      ? '您确定要通过该申请吗'
54
+      : '您确定要拒绝该申请吗';
55
+    Modal.confirm({
56
+      title: title,
57
+      okText: '确认',
58
+      cancelText: '取消',
59
+      onOk() {
60
+        handleAudit()
61
+      },
62
+    });
63
+  };
49 64
 
50 65
   useEffect(() => {
51 66
     getApplicationDetail(id).then((res) => {
52 67
       setApplication(res)
53 68
       setRejectReason(res.rejectReason)
69
+      if (res.verifyStatus == 2) { SetExamineType(2) }
54 70
     }).catch((err) => {
55 71
       console.log(err.message)
56 72
     });
@@ -121,8 +137,14 @@ export default (props) => {
121 137
                     ? '已支付' : ''
122 138
             }
123 139
           </FormItem>
140
+          <FormItem label="审核意见">
141
+            <Radio.Group onChange={e =>{if(application.verifyStatus==0)SetExamineType(e.target.value)}} value={examineType}>
142
+              <Radio value={1}>同意</Radio>
143
+              <Radio value={2}>拒绝</Radio>
144
+            </Radio.Group>
145
+          </FormItem>
124 146
           {
125
-            application.verifyStatus != 1 &&
147
+            application.verifyStatus != 1 && 
126 148
             <FormItem label="驳回原因">
127 149
               <TextArea placeholder='请输入驳回原因' rows='3'
128 150
                 style={{ width: '350px' }}
@@ -135,16 +157,11 @@ export default (props) => {
135 157
           <FormItem label=" " colon={false}>
136 158
             {
137 159
               application.verifyStatus == 0 &&
138
-              <>
139
-                <Button type="primary" loading={loading} style={{ marginRight: '16px' }} onClick={() => handleAudit(1)}>
140
-                  同意
141
-                </Button>
142
-                <Button type="primary" loading={loading} style={{ marginRight: '16px' }} onClick={() => handleAudit(2)}>
143
-                  拒绝
144
-                </Button>
145
-              </>
160
+              <Button type="primary" loading={loading} style={{ marginRight: '16px' }} onClick={handleOK}>
161
+                确定
162
+              </Button>
146 163
             }
147
-            <Button type="default" onClick={() => goBack()}>
164
+            <Button type="default" onClick={goBack}>
148 165
               返回
149 166
             </Button>
150 167
           </FormItem>