소스 검색

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

张延森 3 년 전
부모
커밋
01c9cc0736

+ 1
- 1
src/components/SettingRow/index.jsx 파일 보기

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

+ 4
- 5
src/pages/cardNoList/index.jsx 파일 보기

1
-import { history } from 'umi';
2
 import { useRef,useState } from 'react';
1
 import { useRef,useState } from 'react';
3
 import { Button, Modal, message, Image,Form,Input, InputNumber } from 'antd';
2
 import { Button, Modal, message, Image,Form,Input, InputNumber } from 'antd';
4
 import { PlusOutlined } from '@ant-design/icons';
3
 import { PlusOutlined } from '@ant-design/icons';
82
         footer={null}
81
         footer={null}
83
       >
82
       >
84
         <Form {...formItemLayout} onFinish={Submit} form={form}>
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
           </FormItem>
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
           </FormItem>
89
           </FormItem>
91
           <FormItem label=" " colon={false}>
90
           <FormItem label=" " colon={false}>
92
             <Button type="default" onClick={onCancel}>
91
             <Button type="default" onClick={onCancel}>

+ 1
- 1
src/pages/certificateIssuance/index.jsx 파일 보기

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

+ 20
- 18
src/pages/certificateIssuance/issuance.jsx 파일 보기

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

+ 34
- 17
src/pages/examine/detail.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
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
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
 import { getApplicationDetail, updateAudit, getPetCardNo } from '@/services/application'
4
 import { getApplicationDetail, updateAudit, getPetCardNo } from '@/services/application'
5
 import { history } from 'umi';
5
 import { history } from 'umi';
15
   const { id } = location.query;
15
   const { id } = location.query;
16
   const [application, setApplication] = useState({});
16
   const [application, setApplication] = useState({});
17
   const [rejectReason, setRejectReason] = useState();
17
   const [rejectReason, setRejectReason] = useState();
18
+  const [examineType, SetExamineType] = useState(1);
18
   const [loading, setLoading] = useState(false)
19
   const [loading, setLoading] = useState(false)
19
 
20
 
20
   const getAudit = (val) => {
21
   const getAudit = (val) => {
28
       setLoading(false)
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
         getPetCardNo(application.petId).then((res) => {
35
         getPetCardNo(application.petId).then((res) => {
35
           if (!res) {
36
           if (!res) {
36
-            getAudit(val);
37
+            getAudit(examineType);
37
           } else {
38
           } else {
38
-            message.info('该宠物已有犬证,请驳回犬主申请');
39
+            message.info('该宠物已有犬证,请拒绝犬主办证申请');
39
           }
40
           }
40
         })
41
         })
41
       } else {
42
       } else {
42
-        getAudit(val);
43
+        getAudit(examineType);
43
       }
44
       }
44
     }
45
     }
45
     else {
46
     else {
46
       message.success('请输入处理结果');
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
   useEffect(() => {
65
   useEffect(() => {
51
     getApplicationDetail(id).then((res) => {
66
     getApplicationDetail(id).then((res) => {
52
       setApplication(res)
67
       setApplication(res)
53
       setRejectReason(res.rejectReason)
68
       setRejectReason(res.rejectReason)
69
+      if (res.verifyStatus == 2) { SetExamineType(2) }
54
     }).catch((err) => {
70
     }).catch((err) => {
55
       console.log(err.message)
71
       console.log(err.message)
56
     });
72
     });
121
                     ? '已支付' : ''
137
                     ? '已支付' : ''
122
             }
138
             }
123
           </FormItem>
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
             <FormItem label="驳回原因">
148
             <FormItem label="驳回原因">
127
               <TextArea placeholder='请输入驳回原因' rows='3'
149
               <TextArea placeholder='请输入驳回原因' rows='3'
128
                 style={{ width: '350px' }}
150
                 style={{ width: '350px' }}
135
           <FormItem label=" " colon={false}>
157
           <FormItem label=" " colon={false}>
136
             {
158
             {
137
               application.verifyStatus == 0 &&
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
             </Button>
166
             </Button>
150
           </FormItem>
167
           </FormItem>