李志伟 2 years ago
parent
commit
c4d69bfce1

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

@@ -81,7 +81,7 @@ export default (props) => {
81 81
         footer={null}
82 82
       >
83 83
         <Form {...formItemLayout} onFinish={Submit} form={form}>
84
-          <FormItem label="卡号前缀" name="prefix" rules={[{ required: true, message: '请输入' }]}>
84
+          <FormItem label="卡号前缀" name="prefix" rules={[{ required: true, message: '请输入卡号前缀' }]}>
85 85
             <Input placeholder="请输入卡号前缀" />
86 86
           </FormItem>
87 87
           <FormItem label="生成数量" name="num" tooltip='生成数建议1~1000' rules={[{ required: true, message: '请输入正整数' }]}>

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