PrudectModal.vue
33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
<template>
<a-modal
:title="title"
:width="1000"
:centered="true"
:visible="visible"
:maskClosable="false"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
cancelText="关闭"
style="top: 20px"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-card class="card" title="" :bordered="false">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="产品编号:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['productNo', validatorRules.productNo]" placeholder="请输入产品编号" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="业务线:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择业务线"
v-decorator="['businessChannelNo', validatorRules.businessChannelNos]"
>
<a-select-option
v-for="(item, index) in businessChannelList"
:key="index + 'businessChannelNos'"
:value="item.businessChannelNo"
>{{ item.businessChannelName }}</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="产品种类:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }">
<a-radio-group :disabled="onlyread"
v-decorator="['productClass', validatorRules.productClass]"
@change="handleChangeProductClass"
>
<a-radio :value="1"> 额度类 </a-radio>
<a-radio :value="2"> 一次性放款 </a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card class="card" title="产品基础信息" :bordered="false">
<a-row :gutter="24">
<template v-if="!!model.id">
<a-col :span="12">
<a-form-item label="产品编号:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
v-decorator="['productNo', validatorRules.productNo]"
placeholder="请输入产品编号"
readonly="true"
/>
</a-form-item>
</a-col>
</template>
<a-col :span="12">
<a-form-item label="产品名称:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['productName', validatorRules.productName]" placeholder="请输入产品名称" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="产品类型:"
v-if="ifProductClass == 1"
:labelCol="labelCol"
:wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }"
>
<a-radio-group v-decorator="['productType', validatorRules.productType]" @change="handleChangeClassity">
<a-radio :value="2"> 分期类产品 </a-radio>
<a-radio :value="1"> 非分期类产品 </a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="产品简介:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }">
<a-textarea rows="2" placeholder="请输入产品简介" v-decorator="['description']" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" v-if="ifProductClass == 1">
<a-col :span="12">
<a-form-item label="客户类型:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 16 } }">
<a-select v-decorator="['userType', validatorRules.userType]" placeholder="请选择">
<a-select-option :value="1">个人</a-select-option>
<a-select-option :value="2">企业</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" v-else-if="ifProductClass == 2">
<a-col :span="12">
<a-form-item label="客户类型:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 16 } }">
<a-select
mode="multiple"
v-decorator="['userType', validatorRules.userType]"
placeholder="请选择"
@change="duo"
>
<a-select-option :value="1">个人</a-select-option>
<a-select-option :value="2">企业</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="是否有放款限额" :labelCol="{ span: 7 }" :wrapperCol="{ span: 12 }">
<a-radio-group @change="handleChange" v-decorator="['limitMoneyFlag', validatorRules.limitMoneyFlag]">
<a-radio :value="1"> 是 </a-radio>
<a-radio :value="2"> 否 </a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" v-if="isLimitType == 1">
<a-col :span="12">
<a-form-item
label="放款最低限额(元):"
:labelCol="{ xs: { span: 8 }, sm: { span: 7 } }"
:wrapperCol="wrapperCol"
>
<a-input v-decorator="['minLimitMoney', {}]" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="放款最高限额(元):"
:labelCol="{ xs: { span: 8 }, sm: { span: 7 } }"
:wrapperCol="wrapperCol"
>
<a-input v-decorator="['maxLimitMoney', {}]" />
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card class="card" title="账单及还款方式" :bordered="false" v-if="ifProductClass == 1">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="账单期限:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['term', validatorRules.term]" />
</a-form-item>
</a-col>
<a-col :span="12" v-if="isLimitClassity == 1">
<a-form-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-decorator="['termType', {}]">
<a-select-option :value="1">日</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" v-if="isLimitClassity == 2">
<a-form-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-decorator="['termType', {}]">
<a-select-option :value="2">月</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="还款方式:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }">
<a-select v-decorator="['repaymentType', validatorRules.repaymentType]" placeholder="请选择">
<a-select-option value="">请选择</a-select-option>
<a-select-option :value="1" v-if="isLimitClassity == 2">等额本息</a-select-option>
<a-select-option :value="2" v-if="isLimitClassity == 2">先息后本</a-select-option>
<a-select-option :value="5" v-if="isLimitClassity == 2">等额本金</a-select-option>
<a-select-option :value="3" v-if="isLimitClassity == 1">到期还本付息(算头算尾)</a-select-option>
<a-select-option :value="4" v-if="isLimitClassity == 1">到期还本付息(算头不算尾)</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<!-- <a-row :gutter="24" v-if="isLimitClassity == 2"> -->
<!-- <a-col :span="10">
<a-form-item label="分期设置:" :labelCol="{xs: { span: 8 }, sm: { span: 5 }}" :wrapperCol="{xs: { span: 8 }, sm: { span: 18 }}">
<a-input
v-decorator="[ 'username',{} ]"
/>
</a-form-item>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="还款日" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }">
<a-select v-decorator="['repaymentDayType', {}]" placeholder="请选择">
<a-select-option value="">请选择</a-select-option>
<a-select-option :value="1">起息日的每月对日(29/30/31统一设置为28日)</a-select-option>
<a-select-option :value="2">起息日的每月对日(29/30/31若无对应则为月末)</a-select-option>
<a-select-option :value="3">固定日</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item
label="1"
:labelCol="{ xs: { span: 8 }, sm: { span: 0 } }"
:wrapperCol="{ xs: { span: 8 }, sm: { span: 12 } }"
>
<a-input v-decorator="['repaymentDay', {}]" addonAfter="日" />
</a-form-item>
</a-col>
</a-row>
<!--
<a-row :gutter="24">
<a-col :span="24">
<a-form-item label="起息日设置:" :labelCol="{xs: { span: 8 }, sm: { span: 2 }}" :wrapperCol="{xs: { span: 8 }, sm: { span: 22 }}">
<a-radio-group v-decorator="['radio-group']">
<a-radio value="a">
放款日、到期日都计息
</a-radio>
<a-radio value="b">
放款日不计息,到期日当日计息
</a-radio>
<a-radio value="b">
放款日计息,到期日不计息
</a-radio>
</a-radio-group>
</a-form-item>
</a-form-item>
</a-col>
</a-row> -->
<!-- <a-row :gutter="24">
<a-col :span="12">
<a-form-item label="是否出账单:" :labelCol="{ xs: { span: 8 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 8 }, sm: { span: 19 } }">
<a-radio-group v-decorator="['billOut', validatorRules.billOut]">
<a-radio :value="1">
是
</a-radio>
<a-radio :value="2">
否
</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="提前出账单天数:" :labelCol="{ xs: { span: 8 }, sm: { span: 7 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['billOutDays', {}]" addonAfter='日' />
</a-form-item>
</a-col>
</a-row> -->
<a-row :gutter="24" v-if="isLimitClassity == 1">
<a-col :span="12">
<a-form-item
label="最小计息天数:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-input v-decorator="['minInterestDay', validatorRules.minInterestDay]" addonAfter="日" />
</a-form-item>
</a-col>
</a-row>
<!-- <a-row :gutter="24">
<a-col :span="12">
<a-form-item label="回购标志:" :labelCol="labelCol" :wrapperCol="{ xs: { span: 8 }, sm: { span: 20 } }">
<a-radio-group v-decorator="['buybackFlag', validatorRules.buybackFlag]" @change="handleChangeBuyback">
<a-radio :value="1">
是
</a-radio>
<a-radio :value="2">
否
</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row> -->
<!-- <a-row :gutter="24" v-if="isLimitBuyBack == 1">
<a-col :span="12">
<a-form-item label="回购主体:" :labelCol="{ xs: { span: 8 }, sm: { span: 4 } }" :wrapperCol="wrapperCol">
<a-select v-decorator="['buybackMerchant', {}]" placeholder="请选择">
<a-select-option value="">请选择</a-select-option>
<a-select-option :value="1">好运邦</a-select-option>
<a-select-option :value="2">千方小贷</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="逾期回购天数:" :labelCol="{ xs: { span: 8 }, sm: { span: 5 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['buybackOverdueDays', {}]" addonAfter='日' />
</a-form-item>
</a-col>
</a-row> -->
</a-card>
<a-card class="card" title="账单及还款方式" :bordered="false" v-if="ifProductClass == 2">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="账单期限" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['term', validatorRules.term]" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="账单类型" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择账单类型"
v-decorator="['termType', validatorRules.termType]"
>
<a-select-option :value="1">日</a-select-option>
<a-select-option :value="2">月</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="还款方式" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择还款方式"
v-decorator="['repaymentType', validatorRules.repaymentType]"
>
<a-select-option :value="1">等额本息</a-select-option>
<a-select-option :value="2">先息后本</a-select-option>
<a-select-option :value="5">等额本金</a-select-option>
<a-select-option :value="3">一次性还本付息(算头算尾)</a-select-option>
<a-select-option :value="4">一次性还本付息(算头不算尾)</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="还款日" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择还款方式"
v-decorator="['repaymentDayType', validatorRules.repaymentDayType]"
@change="hkChange"
>
<a-select-option :value="4">放款日对日前一日</a-select-option>
<a-select-option :value="3">固定日</a-select-option>
<a-select-option :value="1">起息日的每月对日(29/30/31统一设置为28日)</a-select-option>
<a-select-option :value="2">起息日的每月对日(29/30/31若无对应则为月末)</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item
label="1"
:labelCol="{ xs: { span: 4 }, sm: { span: 0 } }"
:wrapperCol="{ xs: { span: 4 }, sm: { span: 12 } }"
>
<a-input v-if="hkr == 3" v-decorator="['repaymentDay', validatorRules.repaymentDay]" addonAfter="日" />
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card class="card" title="息费信息" :bordered="false">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item
label="产品正常利率:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-input v-decorator="['interestRate', validatorRules.interestRate]" addonAfter="%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="产品罚息利率:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-input v-decorator="['penaltyRate', validatorRules.penaltyRate]" addonAfter="%" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="15">
<a-form-item label="产品费用:" :labelCol="{ xs: { span: 8 }, sm: { span: 5 } }" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
:mode="multiple"
placeholder="请选择产品费用"
v-decorator="['charges', validatorRules.charges]"
@change="wufeiyong"
>
<a-select-option :value="0">无费用</a-select-option>
<a-select-option
v-for="(item, index) in chargeList"
:key="index + 'chargeList'"
:value="item.chargeNo"
>
{{ item.chargeName }}</a-select-option
>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card class="card" title="资金方信息" :bordered="false">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="资金方:" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-select
@change="shop"
style="width: 100%"
placeholder="请选择资金方"
v-decorator="['fundNo', validatorRules.fundNo]"
>
<a-select-option v-for="(item, index) in fundList" :key="index" :value="item.fundNo">
{{ item.fundName }}</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="资金方产品:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-select
style="width: 100%"
placeholder="请选择资金方产品"
v-decorator="['fundProductNo', validatorRules.fundProductNo]"
>
<a-select-option v-for="(item, index) in shoping" :key="index" :value="item.fundProductNo">
{{ item.productName }}</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item label="资金方复利率:" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['fundCompoundRate', validatorRules.fundCompoundRate]" addonAfter='%' />
</a-form-item>
</a-col> -->
</a-row>
<!-- <a-row :gutter="24">
<a-col :span="12">
<a-form-item label="资金方利率:" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['fundInterestRate', validatorRules.fundInterestRate]" addonAfter='%' />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="资金方罚息利率:" :labelCol="{ xs: { span: 8 }, sm: { span: 6 } }" :wrapperCol="wrapperCol">
<a-input v-decorator="['fundPenaltyRate', validatorRules.fundPenaltyRate]" addonAfter='%' />
</a-form-item>
</a-col>
</a-row> -->
</a-card>
<a-card class="card" title="合同配置信息" :bordered="false">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item
label="授信协议类合同:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-select
mode="multiple"
style="width: 100%"
placeholder="请选择授信协议类合同"
v-decorator="['contractAuthorizationNos', validatorRules.contractAuthorizationNos]"
>
<a-select-option
v-for="(item, index) in contractTemplateList"
v-if="item.contractTemplateType == 2"
:key="index + 'contractTemplateType1'"
:value="item.contractTemplateNo"
>{{ item.contractTemplateName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="用信协议类合同:"
:labelCol="{ xs: { span: 8 }, sm: { span: 6 } }"
:wrapperCol="wrapperCol"
>
<a-select
mode="multiple"
style="width: 100%"
placeholder="请选择用信协议类合同"
v-decorator="['contractCreditNos', validatorRules.contractCreditNos]"
>
<a-select-option
v-for="(item, index) in contractTemplateList"
v-if="item.contractTemplateType == 3"
:key="index + 'contractTemplateType2'"
:value="item.contractTemplateNo"
>{{ item.contractTemplateName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-card>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { preProductGetData, postAction, saveProduct, updateProduct, getFundProductSelect } from '@/api/configApi'
export default {
name: 'PasswordModal',
data() {
return {
visible: false,
confirmLoading: false,
confirmDirty: false,
title: '',
onlyread:false,
shoping: [],
isLimitType: 2,
multiple: 'multiple',
thisUserType: '',
ifProductClass: 1,
validatorRules: {
productNo: {
rules: [
{
required: true,
message: '请输入产品编号',
},
],
},
businessChannelNos: {
rules: [
{
required: true,
message: '请选择业务渠道',
},
],
},
productName: {
rules: [
{
required: true,
message: '请输入产品名称',
},
],
},
billOut: {
rules: [
{
required: true,
message: '请选择是否出账单',
},
],
},
minInterestDay: {
rules: [
{
required: true,
message: '请填写最小计息天数',
},
],
},
interestRate: {
rules: [
{
required: true,
message: '请填写产品正常利率',
},
],
},
// contractAuthorizationNos: {
// rules: [
// {
// required: true,
// message: '请选择授信协议类合同'
// }
// ]
// },
// contractCreditNos: {
// rules: [
// {
// required: true,
// message: '请选择用信协议类合同'
// }
// ]
// },
fundInterestRate: {
rules: [
{
required: true,
message: '请填写资金方利率',
},
],
},
fundPenaltyRate: {
rules: [
{
required: true,
message: '请填写资金方罚息利率',
},
],
},
fundCompoundRate: {
rules: [
{
required: true,
message: '请填写资金方复利率',
},
],
},
fundNo: {
rules: [
{
required: true,
message: '请选择资金方',
},
],
},
charges: {
rules: [
{
required: true,
message: '请选择产品费用',
},
],
},
penaltyRate: {
rules: [
{
required: true,
message: '请填写产品罚息利率',
},
],
},
buybackFlag: {
rules: [
{
required: true,
message: '请选择回购标示',
},
],
},
repaymentTemplateNo: {
rules: [
{
required: true,
message: '请选择还款模板',
},
],
},
type: {
rules: [
{
required: true,
message: '请选择产品分类',
},
],
},
userType: {
rules: [
{
required: true,
message: '请选择客户类型',
},
],
},
fundProductNo: {
rules: [
{
required: true,
message: '请选择资金方产品',
},
],
},
limitMoneyFlag: {
rules: [
{
required: true,
message: '请选择是否有放款限额',
},
],
},
term: {
rules: [
{
required: true,
message: '请输入账单期限',
},
],
},
repaymentType: {
rules: [
{
required: true,
message: '请选择还款方式',
},
],
},
confirmpassword: {
rules: [
{
required: true,
message: '请重新输入登陆密码!',
},
{
validator: this.compareToFirstPassword,
},
],
},
term: {
rules: [
{
required: true,
message: '请填写账单期限',
},
],
},
repaymentType: {
rules: [
{
required: true,
message: '请填写还款方式',
},
],
},
},
model: {},
labelCol: {
xs: { span: 8 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 8 },
sm: { span: 12 },
},
form: this.$form.createForm(this),
chargeList: [],
fundList: [],
contractTemplateList: [],
businessChannelList: [],
repaymentTemplateList: [],
isLimitClassity: 1,
isLimitBuyBack: 1,
thisLength: '',
hkr: 0,
}
},
created() {
this.initData()
// this.businessChannelData();
},
mounted() {
this.businessChannelData()
},
methods: {
handleChangeBuyback(value) {
this.isLimitBuyBack = value.target.value
},
handleChangeClassity(value) {
this.isLimitClassity = value.target.value
this.form.setFieldsValue({
termType: '',
})
},
handleChange(value) {
this.isLimitType = value.target.value
},
handleChangeProductClass(value) {
this.ifProductClass = value.target.value
// this.validatorRules.userType = ''
this.form.setFieldsValue({
userType: [],
})
},
hkChange(value) {
this.hkr = value
},
wufeiyong(value) {
console.log(value)
// if (value.indexOf(0) >= 0) {
// console.log("111")
// this.multiple = ""
// } else {
// this.multiple = 'multiple'
// }
if (value == 0) {
console.log('111')
this.multiple = ''
} else {
this.multiple = 'multiple'
}
},
initData() {
preProductGetData().then((res) => {
this.chargeList = res.result.chargeList
this.fundList = res.result.fundList
this.contractTemplateList = res.result.contractTemplateList
this.repaymentTemplateList = res.result.repaymentTemplateList
})
},
duo(value) {
if (value.length >= 2) {
this.thisLength = 4
} else {
this.thisLength = value[0]
}
},
businessChannelData() {
//业务渠道
let _p = {
pageNo: 1,
pageSize: 10000,
params: {},
}
postAction('/config/admin/queryBusinessChannelList', _p).then((res) => {
this.businessChannelList = res.result.records.filter((item) => item.status == 1)
})
},
edit(record) {
this.model = record
console.log(this.model)
if (this.model.userType == 4) {
this.model.userType = [1, 2]
this.thisLength = 4
}
if (this.model.productClass == 2) {
this.ifProductClass = 2
}
if (this.model.charges == '') {
this.model.charges = [0]
}
this.isLimitClassity = record.termType
this.isLimitType = record.limitMoneyFlag
this.thisUserType = record.userType
// alert(record.userType)
this.form.resetFields()
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(record)
})
},
add() {
this.model = {}
this.form.resetFields()
this.visible = true
this.onlyread = false
this.$nextTick(() => {
this.form.setFieldsValue()
})
},
shop(value) {
// console.log(value)
getFundProductSelect({ fundNo: value }).then((res) => {
if (res.status.statusCode == 0) {
this.shoping = res.result
} else {
}
})
},
close() {
this.$emit('close')
this.visible = false
this.disableSubmit = false
this.selectedRole = []
},
handleSubmit() {
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
let formData = values,
promiseFn,
arr = []
for (let i = 0; i < this.chargeList.length; i++) {
for (let j = 0; j < formData.charges.length; j++) {
if (formData.charges[j] == this.chargeList[i].chargeNo) {
let obj = {
chargeNo: this.chargeList[i].chargeNo,
chargeVersion: this.chargeList[i].chargeVersion,
}
arr.push(obj)
}
}
}
formData.charges = arr
if (this.ifProductClass == 2) {
formData.userType = this.thisLength
}
for (var i = 0; i < this.fundList.length; i++) {
if (formData.fundNo == this.fundList[i].fundNo) {
formData.fundName = this.fundList[i].fundName
}
}
formData.productVersion = this.model.productVersion
if (!!this.model.id) {
//编辑
promiseFn = updateProduct(formData)
} else {
promiseFn = saveProduct(formData)
}
promiseFn
.then((res) => {
if (res.status.statusCode == 0) {
this.$message.success(res.status.statusReason)
this.$emit('ok')
} else {
this.$message.warning(res.status.statusReason)
}
})
.finally(() => {
this.confirmLoading = false
this.close()
})
}
})
},
handleCancel() {
this.close()
},
},
}
</script>