constants.js
17.2 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
/*
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2021-07-12 16:33:07
*/
export const TYPE_NAME = 'confType'
/**
* 前端基础数据管理对应的接口名称的key
*/
export const BaseData = {
channelType: 'channelType',
productType: 'productType'
}
/**
* 超级管理员类型
*/
export const SUPPER_ADMIN = true //
// 商户类型 - 除广汇外
export const userType = {
// 1: '员工',
// 2: '门店',
// 3: '市级经销商',
// 4: '省级经销商',
// 5: '工厂',
1: '工厂',
2: '省代',
3: '市代',
4: '门店'
}
// 商户类型 - 广汇
export const ghUserType = {
1: '员工',
2: '门店',
3: '片区',
4: '大区',
5: '总部',
6: '供应商'
}
// 商户类型 - 除广汇外
export const userTypeList = [
{
confId: 1,
confLabel: '员工'
},
{
confId: 2,
confLabel: '门店'
},
{
confId: 3,
confLabel: '市级经销商'
},
{
confId: 4,
confLabel: '省级经销商'
},
{
confId: 5,
confLabel: '工厂'
}
]
// 商户类型 - 广汇
export const ghUserTypeList = [
{
confId: 1,
confLabel: '员工'
},
{
confId: 2,
confLabel: '门店'
},
{
confId: 3,
confLabel: '片区'
},
{
confId: 4,
confLabel: '大区'
},
{
confId: 5,
confLabel: '总部'
},
{
confId: 6,
confLabel: '供应商'
}
]
// 商户分类
export const merchantClassifyList = [
{
confId: 1,
confLabel: '批发/零售商'
},
{
confId: 2,
confLabel: '4S店'
},
{
confId: 3,
confLabel: '综合汽贸店'
},
{
confId: 4,
confLabel: '综合后服务门店 '
},
{
confId: 5,
confLabel: '厂家'
},
{
confId: 6,
confLabel: '园区店'
},
{
confId: 7,
confLabel: '服务商'
},
{
confId: 8,
confLabel: '虚拟园区店'
}
]
// 商户分类 - 4S店(2)和服务商(7)- 查全部(2和7,排除园区店{id:6})
export const merchantStoreServiceList = [
{
confId: 2,
confLabel: '4S店'
},
{
confId: 7,
confLabel: '服务商'
},
{
confId: -1,
confLabel: '园区店'
}
]
// 手续费
export const deductChargeFlagObj = {
Y: '扣除手续费(按0.6%的标准)',
N: '不扣除手续费'
}
// 导流方分润手续费
export const shop4sDeductChargeFlagObj = {
Y: '导流方分润扣除手续费',
N: '导流方分润不扣除手续费'
}
// 服务商分润手续费
export const partnerDeductChargeFlagObj = {
Y: '服务商分润扣除手续费',
N: '服务商分润不扣除手续费'
}
// 品牌商
export const brandMerchantList = [
{
confId: '1',
confValue: '3M/福膜'
},
{
confId: '2',
confValue: '强生/福膜'
},
{
confId: '3',
confValue: '强生/斯帝飞'
},
{
confId: '4',
confValue: '3M/斯帝飞'
},
{
confId: '5',
confValue: '3M/今蓝'
},
{
confId: '6',
confValue: '量子/今蓝'
},
{
confId: '7',
confValue: '强生'
},
{
confId: '8',
confValue: '今蓝'
},
{
confId: '9',
confValue: '琥珀'
},
{
confId: '10',
confValue: '嘀嘀虎'
},
{
confId: '11',
confValue: '康得新'
}
]
// 分账方式
export const divisionTypeList = [
{
confId: '1',
confLabel: '线下对账'
},
{
confId: '2',
confLabel: '线上分账'
}
]
// 支付方式
// export const payTypeList = [{
// confId: '0',
// confLabel: '不升级'
// }, {
// confId: '1',
// confLabel: '线上支付'
// }, {
// confId: '2',
// confLabel: '线下支付'
// }, {
// confId: '3',
// confLabel: 'POS机收款'
// }]
export const payTypeList = [
{
confId: '1',
confLabel: '微信支付'
},
{
confId: '2',
confLabel: '4S店支付'
},
{
confId: '3',
confLabel: 'POS机收款'
}
]
// 订单类型
export const orderTypeList = [
{
confId: '1',
confLabel: '正常'
},
{
confId: '2',
confLabel: '异常'
},
{
confId: '3',
confLabel: '正常测试'
},
{
confId: '4',
confLabel: '异常测试'
},
{
confId: '5',
confLabel: '未收款'
}
]
// 分账状态
export const divisionStatusList = [
{
confId: '1',
confLabel: '待分账'
},
{
confId: '2',
confLabel: '分账中'
},
{
confId: '3',
confLabel: '分账成功'
},
{
confId: '4',
confLabel: '分账失败'
},
{
confId: '5',
confLabel: '异常'
}
]
// 提现状态
export const withdrawStatusList = [
{
confId: 1,
confLabel: '提现中'
},
{
confId: 2,
confLabel: '提现成功'
},
{
confId: 3,
confLabel: '提现失败'
}
]
// 提现渠道
export const withdrawChannelList = [
{
confId: 1,
confLabel: '小程序'
},
{
confId: 2,
confLabel: 'PC后台'
}
]
// 出库状态
export const warehouseStatusList = [
{
confId: 1,
confLabel: '待出库'
},
{
confId: 3,
confLabel: '出库中'
},
{
confId: 4,
confLabel: '出库成功'
},
{
confId: 5,
confLabel: '出库失败'
}
]
// 获取最近n个月,默认6个月
export function getCurrentSixMonth(n = 5) {
return [new Date(new Date().setMonth(new Date().getMonth() - n)), new Date()]
}
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(
newValue,
oldValue,
intergerDigit,
pointDigit,
minValue,
maxValue,
regRule
) {
var reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/
}
regRule = regRule || 'priceReg'
if (
newValue &&
((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
) {
return oldValue || ''
}
if (newValue && reg[regRule].test(newValue + '')) {
if (/\./.test(newValue)) {
newValue = newValue + ''
var interger = newValue.split('.')[0]
var point = newValue.split('.')[1]
var intergerNum =
interger.length > intergerDigit ? oldValue.split('.')[0] : interger
var pointNum =
point.length > pointDigit ? point.slice(0, pointDigit) : point
newValue = pointDigit
? intergerNum + '.' + pointNum
: newValue.split('.')[0]
} else {
newValue =
newValue.length > intergerDigit
? oldValue.slice(0, intergerDigit)
: newValue
}
return newValue
} else {
return newValue ? oldValue : ''
}
}
/**
* 时间控件-限制月份
*/
export const rangePickerOptions = {
disabledDate(date) {
console.log(date)
console.log(new Date())
if (date > new Date()) {
return true
}
return false
}
}
/**
* 时间控件-(0-30天内的日期)
*/
export const appointDays = 35
export const afterTodayOptions = {
disabledDate(date) {
if (
date < new Date(new Date().toLocaleDateString()) ||
date >
new Date(new Date().setDate(new Date().getDate() + (appointDays - 1)))
) {
return true
}
return false
}
}
// //支付方式
// export const payTypeOpts = {
// 2: '4S店支付',
// 3: 'POS机收款',
// }
// //账单状态
// export const ODDIVISIONSTATUS = {
// 1:'待分账',
// 2:'分账中',
// 3:'分账成功',
// 4:'分账失败'
// }
// // 分润计算
// export const DEDUCTCHARGEFLAG = {
// 'Y':'扣除手续费(按0.6%的标准)',
// 'N':'不扣水续费'
// }
// 财务列表-订单表-表头原始数据
export const orderTableHead = [
{
name: '序号',
id: 1,
disabled: true,
checked: true,
type: 'index',
prop: 'indexNum',
sort: 1
},
{
name: '商品资料',
id: 2,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '商品名称',
id: 3,
disabled: true,
checked: true,
prop: 'goodsName',
sort: 3
},
{
name: '商品编码',
id: 4,
disabled: false,
checked: false,
prop: 'sapCode',
sort: 4
},
{
name: '商品成本',
id: 5,
disabled: false,
checked: false,
prop: 'goodsCost',
sort: 5
},
{
name: '订单类型',
id: 6,
disabled: false,
checked: false,
prop: 'orderType',
sort: 21,
formatter: function(row, column) {
const orderTypeList = [
{
confId: '1',
confLabel: '正常'
},
{
confId: '2',
confLabel: '异常'
},
{
confId: '3',
confLabel: '正常测试'
},
{
confId: '4',
confLabel: '异常测试'
},
{
confId: '5',
confLabel: '未收款'
}
]
const o = orderTypeList.find(k => +k.confId === row.orderType)
return o ? o.confLabel : '-'
}
}
]
},
{
name: '支付资料',
id: 3,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '订单编号',
id: 2,
disabled: true,
checked: true,
prop: 'orderCode',
sort: 2
},
{
name: '交易参考号',
id: 15,
disabled: false,
prop: 'tradeNo',
sort: 12
},
{
name: '订单时间',
id: 15,
disabled: false,
prop: 'orderTimeStr',
sort: 7
},
{
name: '支付时间',
id: 15,
disabled: true,
checked: true,
prop: 'payTimeStr',
sort: 8
},
{
name: '支付方式',
id: 15,
disabled: true,
checked: true,
prop: 'payType',
sort: 9,
formatter: function(row, column) {
const payTypeOpts = {
2: '4S店支付',
3: 'POS机收款'
}
return payTypeOpts[row.payType]
}
},
{
name: '支付金额',
id: 15,
disabled: true,
checked: true,
prop: 'totalPrice',
sort: 6
},
{
name: '入账手续费',
id: 15,
disabled: false,
prop: 'serviceCharge',
sort: 10
},
{
name: '实收金额',
id: 15,
disabled: false,
prop: 'userActualIncomeMoney',
sort: 11
}
]
},
{
name: '客户资料',
id: 4,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '客户姓名',
id: 8,
disabled: true,
checked: true,
prop: 'customerName',
sort: 13
},
{
name: '手机号',
id: 9,
disabled: true,
checked: true,
prop: 'customerPhone',
sort: 14
},
{ name: '车型', id: 10, disabled: false, prop: 'carTypeStr', sort: 15 },
{ name: '车架号', id: 11, disabled: false, prop: 'standNo', sort: 16 },
{
name: '转化专员',
id: 12,
disabled: true,
checked: true,
prop: 'sellerName',
sort: 17
},
{
name: '园区名称',
id: 13,
disabled: true,
checked: true,
prop: 'yqMerchantName',
sort: 18
},
{
name: '销售顾问',
id: 14,
disabled: true,
checked: true,
prop: 'employeeName',
sort: 19
},
{
name: '4S店',
id: 15,
disabled: true,
checked: true,
prop: 'merchantName',
sort: 20
}
]
}
]
// 账单表-表头原始数据
export const billsTableHead = [
{
name: '序号',
id: 1,
disabled: true,
checked: true,
type: 'index',
prop: 'indexNum',
sort: 0
},
{
name: '对账资料',
id: 1,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '子订单编号',
id: 3,
disabled: true,
checked: true,
prop: 'orderCode',
sort: 1
},
{
name: '客户姓名',
id: 4,
disabled: true,
checked: true,
prop: 'customerName',
sort: 2
},
{
name: '支付时间',
id: 5,
disabled: true,
checked: true,
prop: 'payTimeStr',
sort: 3
},
{
name: '分账金额',
id: 6,
disabled: true,
checked: true,
prop: 'distributeMoney',
sort: 4
},
{
name: '分账方式',
id: 6,
disabled: true,
checked: true,
prop: 'divisionType',
sort: 5,
formatter: function(row, column) {
const divisionTypeList = [
{
confId: '1',
confLabel: '线下对账'
},
{
confId: '2',
confLabel: '线上分账'
}
]
const o = divisionTypeList.find(k => {
return k.confId == row.divisionType
})
return o ? o.confLabel : '-'
}
},
{
name: '分账时间',
id: 6,
disabled: true,
checked: true,
prop: 'divisionDateStr',
sort: 18
},
{
name: '账单状态',
id: 6,
disabled: true,
checked: true,
prop: 'odDivisionStatus',
sort: 19,
formatter: function(row, column) {
const ODDIVISIONSTATUS = {
1: '待分账',
2: '分账中',
3: '分账成功',
4: '分账失败'
}
return ODDIVISIONSTATUS[row.odDivisionStatus] || '-'
}
},
{
name: '分润计算',
id: 6,
disabled: false,
checked: false,
prop: 'deductChargeFlag',
sort: 20,
formatter: function(row, column) {
const DEDUCTCHARGEFLAG = {
Y: '扣除手续费(按0.6%的标准)',
N: '不扣水续费'
}
return DEDUCTCHARGEFLAG[row.deductChargeFlag] || '-'
}
}
]
},
{
name: '平台方',
id: 1,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '平台应收',
id: 2,
disabled: false,
prop: 'glProfitMoney',
sort: 6
},
{
name: '平台实收',
id: 15,
disabled: true,
checked: true,
prop: 'odGlDivisionMoney',
sort: 7
}
]
},
{
name: '流量方',
id: 1,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '4S店名称',
id: 8,
disabled: true,
checked: true,
prop: 'merchantName',
sort: 8
},
{
name: '4S店应分金额',
id: 9,
disabled: false,
prop: 'shopProfitMoney',
sort: 9
},
{
name: '4S店实分金额',
id: 10,
disabled: true,
checked: true,
prop: 'odShopDivisionMoney',
sort: 10
}
]
},
{
name: '园区店',
id: 1,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '园区名称',
id: 8,
disabled: true,
checked: true,
prop: 'yqMerchantName',
sort: 11
},
{
name: '园区应分金额',
id: 9,
disabled: false,
prop: 'yqProfitMoney',
sort: 12
},
{
name: '额外成本',
id: 10,
disabled: false,
prop: 'extraCost',
sort: 13
},
{
name: '园区毛利',
id: 10,
disabled: false,
prop: 'yqGrossProfit',
sort: 14
}
]
},
{
name: '服务商',
id: 1,
disabled: true,
prop: 'index',
checked: true,
child: [
{
name: '服务商',
id: 8,
disabled: true,
checked: true,
prop: 'franchiseeMerchantName',
sort: 15
},
{
name: '服务商应分金额',
id: 9,
disabled: true,
checked: true,
prop: 'franchiseeProfitMoney',
sort: 16
},
{
name: '服务商实分金额',
id: 10,
disabled: true,
checked: true,
prop: 'odPartnerDivisionMoney',
sort: 17
}
]
}
]