data.js
6.34 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
const commodityObj = {
searchFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '商品编码',
name: 'type',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '品牌方',
name: 'brandMerchantName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '供应方',
name: 'supplierName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '产品类型',
name: 'proType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'typeList'
},
{
label: '使用门店',
name: 'merchantIdList',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList'
},
{
label: '所属分类',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'goodsCategoryList'
}
]
}
const editCommodityObj = {
editRule: {
goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
// goodsCode: [{ required: true, message: '请选择所属系列', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择所属分类', trigger: 'change' }],
position: [{ required: true, message: '请选择适用部位', trigger: 'change' }],
convertedValue: [{ required: true, message: '请输入比例换算', trigger: 'change' }],
deductionStandard: [{ required: true, message: '请输入扣减标准', trigger: 'change' }],
sellPrice: [{ required: true, message: '请输入售价', trigger: 'change' }],
minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }],
giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }],
productCost: [{ required: true, message: '请输入产品成本', trigger: 'change' }],
// warningValue: [{ required: true, message: '请输入库存预警下限', trigger: 'change' }],
// warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
warrantyPeriod: [{ required: true, message: '请输入质保年限', trigger: 'change' }]
},
editFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 50
},
{
label: '商品编码',
name: 'type',
type: 'input',
maxlength: 50
},
{
label: '所属分类',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'goodsCategoryList',
changeAttr: function(val, targetItem, that) {
let labelList = ['适用部位', '扣减标准', '产品类型', '质保年限']
let jpLabelList = ['比例换算']
let baseLabelList = ['售价', '最低售价', '产品成本']
let unitLabelList = ['库存下限预警', '库存上限预警']
let txt = targetItem.optionList.find(k => k.categoryType == val)?.categoryName || ''
that.changeFormAttr('editFormData', 'isHide', labelList, txt != '自建商品-太阳膜')
that.changeFormAttr('editFormData', 'isHide', jpLabelList, txt == '自建商品-精品')
that.changeFormAttr('editFormData', 'append', baseLabelList, txt == '自建商品-精品' ? '元/件' : '元/车')
that.changeFormAttr('editFormData', 'append', unitLabelList, txt == '自建商品-精品' ? '件' : '米')
if (txt != '自建商品-太阳膜') {
that.changeFormAttr('editFormData', 'isHide', baseLabelList, !(txt != '自建商品-太阳膜'))
}
that.editForm.baseProductFlag = 'N'
that.editForm.upgradeProductFlag = 'Y'
that.handleCheckChange('Y', 'upgradeProductFlag')
that.handleCheckChange('N', 'baseProductFlag')
}
},
{
label: '品牌方',
name: 'brandMerchantName',
type: 'input',
maxlength: 20
},
{
label: '供应方',
name: 'supplierName',
type: 'input',
maxlength: 20
},
{
label: '适用部位',
name: 'position',
type: 'select',
isHide: true,
optionList: [],
optionId: 'positionValue',
optionLabel: 'positionName',
optionsName: 'goodsPosList'
},
{
label: '比例换算',
name: 'convertedValue',
type: 'slot',
addHtml: 'convertedValue',
isHide: true
},
{
label: '扣减标准',
name: 'deductionStandard',
type: 'slot',
addHtml: 'deductionStandard',
placeholder: '请输入米数',
isHide: true
},
{
label: '产品类型',
name: '',
type: 'slot',
addHtml: 'productFlag',
isHide: true,
tips: '说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
},
{
label: '售价',
name: 'sellPrice',
type: 'input',
isHide: true,
append: '元/件'
},
{
label: '最低售价',
name: 'minSellPrice',
type: 'input',
isHide: true,
append: '元/件'
},
{
label: '赠送成本',
name: 'giftCost',
type: 'input',
isHide: true,
append: '元/车'
},
{
label: '产品成本',
name: 'productCost',
type: 'input',
isHide: true,
append: '元/件'
},
{
label: '库存下限预警',
name: 'warningValue',
type: 'input',
append: '米'
},
{
label: '库存上限预警',
name: 'warningValueMax',
type: 'input',
append: '米'
},
{
label: '质保年限',
name: 'warrantyPeriod',
type: 'input',
isHide: true
}
],
merchantEditFormData: [
// {
// label: '使用门店列表',
// name: 'merchantList',
// addHtml: 'selectMerchant',
// style: {
// 'margin-bottom': '10px'
// }
// },
{
// label: '',
name: '',
addHtml: 'merchantTable'
}
]
}
export default {
commodityObj,
editCommodityObj
}