constants.js
4.47 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
/*
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2021-01-20 11:24:55
*/
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
// import { BASE_DATA_URL } from '@/api/sys.base'
export const TYPE_NAME = 'confType'
/**
* 后台提供一个接 通过类型获取对应数据
* 此处定义类型
*/
// export const ConfigType = {
// STATION: 'STATION_TYPE',
// POST: 'POST_TYPE',
// SUBSYS: 'SUBSYSTEM_TYPE'
// }
/**
* 前端基础数据管理对应的接口名称的key
*/
export const BaseData = {
channelType: 'channelType',
productType: 'productType'
}
/**
* 注册类型
*/
export const RegistType = {
BY_SELF: '1', // 自注册
BY_ADMIN: '2' // 管理员创建
}
/**
* 前端免登录验证接口名
*/
// export const LogExternals = [
// 'fims.user.login', // 登录
// 'fims.user.register', // 注册
// 'fims.configuration.from.conftype', // 基础数据
// 'fims.role.list' // 角色列表
// ]
/**
* 登录来源
*/
// export const LOGIN_TYPE = 1 // 1pc,2小程序
/**
* 超级管理员类型
*/
export const SUPPER_ADMIN = true //
/**
* 职务置灰选项
*/
// export const POST_DISABLED = ['2001', '2002', '2003'] // 总经理 仓库 部门经理
// 商户类型 - 除广汇外
export const userType = {
1: '员工',
2: '门店',
3: '市级经销商',
4: '省级经销商',
5: '工厂'
}
// 商户类型 - 广汇
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: '园区店'
}]
// 品牌商
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: '嘀嘀虎'
}]
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var reg = {
priceReg: /^\d[\d\.]*$/,
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) {
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
}
}