|
@@ -72,6 +72,36 @@ export default (props) => {
|
72
|
72
|
if (applyType == 'renewal' || applyType == 'reissue') {
|
73
|
73
|
getDogInfoFunction(petId)
|
74
|
74
|
getCardLicenseInfo(petId).then((res) => {
|
|
75
|
+ console.log("🚀 ~ file: index.jsx ~ line 75 ~ getCardLicenseInfo ~ res", res)
|
|
76
|
+ setIsOrgState(res.isOrg)
|
|
77
|
+
|
|
78
|
+ if (res.isOrg) {
|
|
79
|
+ setOrgState([{
|
|
80
|
+ value: false,
|
|
81
|
+ text: '个人',
|
|
82
|
+ checked: false,
|
|
83
|
+ },
|
|
84
|
+ {
|
|
85
|
+ value: true,
|
|
86
|
+ text: '企业',
|
|
87
|
+ checked: true,
|
|
88
|
+
|
|
89
|
+ }])
|
|
90
|
+ } else {
|
|
91
|
+ setOrgState([{
|
|
92
|
+ value: true,
|
|
93
|
+ text: '个人',
|
|
94
|
+ checked: true,
|
|
95
|
+ },
|
|
96
|
+ {
|
|
97
|
+ value: false,
|
|
98
|
+ text: '企业',
|
|
99
|
+ checked: false,
|
|
100
|
+
|
|
101
|
+ }])
|
|
102
|
+ }
|
|
103
|
+
|
|
104
|
+
|
75
|
105
|
setRenewalAndReissue({ ...renewalAndReissue, ...res })
|
76
|
106
|
})
|
77
|
107
|
}
|
|
@@ -134,50 +164,57 @@ export default (props) => {
|
134
|
164
|
|
135
|
165
|
// ...dogDate,
|
136
|
166
|
const formSubmit = (value) => {
|
137
|
|
-
|
138
|
|
- if (applyType == 'renewal' || applyType == 'reissue') {
|
139
|
|
-
|
140
|
|
- getApplicationList({ pageSize: 500 }).then((e) => {
|
141
|
|
- console.log('e', e);
|
142
|
|
- const array = e.records
|
143
|
|
- for (let i = 0; i < array.length; i++) {
|
144
|
|
- if (array[i].petId == formData.petId) {
|
145
|
|
- if (array[i].status == 1) {
|
146
|
|
- console.log('支付过了',);
|
147
|
|
- Taro.showToast({
|
148
|
|
- title: '申请成功,等待审核',
|
149
|
|
- icon: 'none',
|
150
|
|
- duration: 1000
|
151
|
|
- })
|
152
|
|
- setTimeout(() => {
|
153
|
|
- Taro.navigateBack({
|
154
|
|
- delta: 1
|
|
167
|
+ if (applyType == 'reissue') {
|
|
168
|
+ console.log("🚀 ~ file: index.jsx ~ line 201 ~ getApplicationList ~ applyType", applyType, value.applyMethod)
|
|
169
|
+ if (value.applyMethod) {
|
|
170
|
+ getApplicationList({ pageSize: 500 }).then((e) => {
|
|
171
|
+ const array = e.records
|
|
172
|
+ for (let i = 0; i < array.length; i++) {
|
|
173
|
+ if (array[i].petId == formData.petId) {
|
|
174
|
+ if (array[i].status == 1) {
|
|
175
|
+ console.log('支付过了',);
|
|
176
|
+ Taro.showToast({
|
|
177
|
+ title: '申请成功,等待审核',
|
|
178
|
+ icon: 'none',
|
|
179
|
+ duration: 1000
|
155
|
180
|
})
|
156
|
|
- }, 1000);
|
|
181
|
+ setTimeout(() => {
|
|
182
|
+ Taro.navigateBack({
|
|
183
|
+ delta: 1
|
|
184
|
+ })
|
|
185
|
+ }, 1000);
|
157
|
186
|
|
158
|
|
- return;
|
|
187
|
+ return;
|
|
188
|
+ } else {
|
|
189
|
+ console.log('没有支付',);
|
|
190
|
+ other(value);
|
|
191
|
+ return;
|
|
192
|
+ }
|
159
|
193
|
} else {
|
160
|
|
- console.log('没有支付',);
|
|
194
|
+ console.log('没有这个订单',);
|
161
|
195
|
other(value);
|
162
|
196
|
return;
|
163
|
197
|
}
|
164
|
|
- } else {
|
165
|
|
- console.log('没有这个订单',);
|
166
|
|
- other(value);
|
167
|
|
- return;
|
168
|
198
|
}
|
169
|
|
- }
|
170
|
199
|
|
171
|
|
- })
|
172
|
200
|
|
|
201
|
+ })
|
|
202
|
+
|
|
203
|
+ } else {
|
|
204
|
+ console.log("🚀 ~ file: index.jsx ~ line 201 ~ getApplicationList ~ applyType", applyType, value.applyMethod)
|
|
205
|
+
|
|
206
|
+ Taro.showToast({
|
|
207
|
+ title: '请选择申领方式',
|
|
208
|
+ icon: 'none',
|
|
209
|
+ duration: 1000
|
|
210
|
+ })
|
|
211
|
+ }
|
173
|
212
|
} else {
|
|
213
|
+ if (applyType == 'renewal' || applyType == 'reissue') {
|
174
|
214
|
|
175
|
|
- getApplicationList({ pageSize: 500 }).then((e) => {
|
176
|
|
- console.log('开始',);
|
|
215
|
+ getApplicationList({ pageSize: 500 }).then((e) => {
|
|
216
|
+ const array = e.records
|
177
|
217
|
|
178
|
|
- console.log('e', e);
|
179
|
|
- const array = e.records
|
180
|
|
- if (array.length > 0) {
|
181
|
218
|
for (let i = 0; i < array.length; i++) {
|
182
|
219
|
if (array[i].petId == formData.petId) {
|
183
|
220
|
if (array[i].status == 1) {
|
|
@@ -192,28 +229,78 @@ export default (props) => {
|
192
|
229
|
delta: 1
|
193
|
230
|
})
|
194
|
231
|
}, 1000);
|
|
232
|
+
|
195
|
233
|
return;
|
196
|
234
|
} else {
|
197
|
235
|
console.log('没有支付',);
|
198
|
|
- goPayPage(value)
|
199
|
|
-
|
|
236
|
+ other(value);
|
200
|
237
|
return;
|
201
|
238
|
}
|
202
|
239
|
} else {
|
203
|
|
- console.log('没有这个订单-----------',);
|
|
240
|
+ console.log('没有这个订单',);
|
|
241
|
+ other(value);
|
|
242
|
+ return;
|
|
243
|
+ }
|
|
244
|
+ }
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+ })
|
|
248
|
+
|
|
249
|
+ } else {
|
|
250
|
+ if (value.applyMethod) {
|
|
251
|
+
|
|
252
|
+ getApplicationList({ pageSize: 500 }).then((e) => {
|
|
253
|
+ console.log('开始',);
|
|
254
|
+ console.log('e', e);
|
|
255
|
+ const array = e.records
|
|
256
|
+ if (array.length > 0) {
|
|
257
|
+ for (let i = 0; i < array.length; i++) {
|
|
258
|
+ if (array[i].petId == formData.petId) {
|
|
259
|
+ if (array[i].status == 1) {
|
|
260
|
+ console.log('支付过了',);
|
|
261
|
+ Taro.showToast({
|
|
262
|
+ title: '申请成功,等待审核',
|
|
263
|
+ icon: 'none',
|
|
264
|
+ duration: 1000
|
|
265
|
+ })
|
|
266
|
+ setTimeout(() => {
|
|
267
|
+ Taro.navigateBack({
|
|
268
|
+ delta: 1
|
|
269
|
+ })
|
|
270
|
+ }, 1000);
|
|
271
|
+ return;
|
|
272
|
+ } else {
|
|
273
|
+ console.log('没有支付',);
|
|
274
|
+ goPayPage(value)
|
|
275
|
+ return;
|
|
276
|
+ }
|
|
277
|
+ } else {
|
|
278
|
+ console.log('没有这个订单-----------',);
|
|
279
|
+ goPayPage(value)
|
|
280
|
+
|
|
281
|
+ return;
|
|
282
|
+ }
|
|
283
|
+
|
|
284
|
+ }
|
|
285
|
+ } else {
|
204
|
286
|
goPayPage(value)
|
205
|
287
|
|
206
|
|
- return;
|
207
|
288
|
}
|
208
|
289
|
|
209
|
|
- }
|
|
290
|
+
|
|
291
|
+ })
|
210
|
292
|
} else {
|
211
|
|
- goPayPage(value)
|
|
293
|
+ Taro.showToast({
|
|
294
|
+ title: '请选择申领方式',
|
|
295
|
+ icon: 'none',
|
|
296
|
+ duration: 1000
|
|
297
|
+ })
|
212
|
298
|
|
213
|
299
|
}
|
|
300
|
+ }
|
|
301
|
+
|
214
|
302
|
|
215
|
303
|
|
216
|
|
- })
|
217
|
304
|
|
218
|
305
|
}
|
219
|
306
|
}
|
|
@@ -307,21 +394,31 @@ export default (props) => {
|
307
|
394
|
|
308
|
395
|
})
|
309
|
396
|
}
|
310
|
|
-
|
311
|
|
- const orgState = [
|
312
|
|
- {
|
313
|
|
- value: false,
|
314
|
|
- text: '个人',
|
315
|
|
- checked: true,
|
316
|
|
- },
|
317
|
|
- {
|
318
|
|
- value: true,
|
319
|
|
- text: '企业',
|
320
|
|
- checked: false,
|
321
|
|
-
|
322
|
|
- },
|
323
|
|
-
|
324
|
|
- ]
|
|
397
|
+ const [orgState, setOrgState] = useState([{
|
|
398
|
+ value: false,
|
|
399
|
+ text: '个人',
|
|
400
|
+ checked: false,
|
|
401
|
+ },
|
|
402
|
+ {
|
|
403
|
+ value: true,
|
|
404
|
+ text: '企业',
|
|
405
|
+ checked: false,
|
|
406
|
+
|
|
407
|
+ }])
|
|
408
|
+
|
|
409
|
+ // const orgState = [
|
|
410
|
+ // {
|
|
411
|
+ // value: false,
|
|
412
|
+ // text: '个人',
|
|
413
|
+ // checked: true,
|
|
414
|
+ // },
|
|
415
|
+ // {
|
|
416
|
+ // value: true,
|
|
417
|
+ // text: '企业',
|
|
418
|
+ // checked: false,
|
|
419
|
+ // },
|
|
420
|
+
|
|
421
|
+ // ]
|
325
|
422
|
|
326
|
423
|
|
327
|
424
|
|
|
@@ -360,22 +457,6 @@ export default (props) => {
|
360
|
457
|
|
361
|
458
|
})
|
362
|
459
|
|
363
|
|
- // let rules = {
|
364
|
|
- // petId: [{ required: true, message: '请填写狗狗名称' }],
|
365
|
|
- // petSex: [{ type: 'number', required: true, message: '请填写狗狗性别' }],
|
366
|
|
- // petBirthday: [{ required: true, message: '请选择狗狗生日' }],
|
367
|
|
- // petColor: [{ required: true, message: '请选择狗狗毛色' }],
|
368
|
|
- // petType: [{ required: true, message: '请选择犬种类别' }],
|
369
|
|
- // img1: [{ required: true, message: '请上传狗狗照片' }],
|
370
|
|
- // immunizationDate: [{ required: true, message: '请上输入最近免疫时间' }],
|
371
|
|
- // immunizationCode: [{ required: true, message: '请输入免疫证号' }],
|
372
|
|
- // immunizationImg: [{ required: true, message: '请上传免疫图片' }],
|
373
|
|
-
|
374
|
|
- // address: [{ required: true, message: '请输入详细地址' }],
|
375
|
|
-
|
376
|
|
- // }
|
377
|
|
-
|
378
|
|
-
|
379
|
460
|
return (
|
380
|
461
|
<>
|
381
|
462
|
<AuthProfile />
|
|
@@ -458,7 +539,7 @@ export default (props) => {
|
458
|
539
|
{
|
459
|
540
|
!isOrgState ? <></> : <>
|
460
|
541
|
<FormItem title='企业名称' required >
|
461
|
|
- <Input name='orgName' placeholder='请输入企业名称' />
|
|
542
|
+ <Input name='orgName' placeholder='请输入企业名称' value={renewalAndReissue?.orgName} />
|
462
|
543
|
</FormItem>
|
463
|
544
|
<FormItem title='营业执照' >
|
464
|
545
|
<uploader name='orgLicense' onFile={handleFile} />
|