...
|
...
|
@@ -70,7 +70,7 @@ |
|
|
</i-upload>
|
|
|
</i-poptip>
|
|
|
</i-form-item>
|
|
|
<i-form-item label="禁用商品类型">
|
|
|
<!--<i-form-item label="禁用商品类型">
|
|
|
<checkbox-group v-model="formData.skupForbidTypeLable" @on-change="getCheckBox">
|
|
|
<checkbox label="现货" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="预售" :disabled="readonly"></checkbox>
|
...
|
...
|
@@ -78,6 +78,21 @@ |
|
|
<checkbox label="全新瑕疵" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="闪购" :disabled="readonly"></checkbox>
|
|
|
</checkbox-group>
|
|
|
</i-form-item>-->
|
|
|
<i-form-item label="可用商品类型">
|
|
|
<checkbox-group v-model="formData.skupAllowTypeLabel" @on-change="getCheckBox">
|
|
|
<checkbox label="线下店订单" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="急速发货订单" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="普通预售" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="瑕疵" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="二手" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="鉴定" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="海外现货" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="现货发货" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="现货寄存" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="闪购发货" :disabled="readonly"></checkbox>
|
|
|
<checkbox label="闪购寄存" :disabled="readonly"></checkbox>
|
|
|
</checkbox-group>
|
|
|
</i-form-item>
|
|
|
</i-form>
|
|
|
</i-modal>
|
...
|
...
|
@@ -104,6 +119,33 @@ const forbidenLabelMap = { |
|
|
3: '闪购'
|
|
|
};
|
|
|
|
|
|
const allowTypeMap = {
|
|
|
'线下店订单': '2',
|
|
|
'急速发货订单': '3',
|
|
|
'普通预售': '4',
|
|
|
'瑕疵': '5',
|
|
|
'二手' : '6',
|
|
|
'鉴定': '8',
|
|
|
'海外现货': '17',
|
|
|
'现货发货': '1-N',
|
|
|
'现货寄存': '1-Y',
|
|
|
'闪购发货': '7-N',
|
|
|
'闪购寄存': '7-Y'
|
|
|
};
|
|
|
const allowLabelMap = {
|
|
|
'2': '线下店订单',
|
|
|
'3': '急速发货订单',
|
|
|
'4': '普通预售',
|
|
|
'5': '瑕疵',
|
|
|
'6': '二手',
|
|
|
'8': '鉴定',
|
|
|
'17': '海外现货',
|
|
|
'1-N': '现货发货',
|
|
|
'1-Y': '现货寄存',
|
|
|
'7-N': '闪购发货',
|
|
|
'7-Y':'闪购寄存'
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
components: {},
|
|
|
name: 'ModalCreateCoupon',
|
...
|
...
|
@@ -129,8 +171,10 @@ export default { |
|
|
productLimitValue: '',
|
|
|
useLimitValue: 0,
|
|
|
time: ['', ''],
|
|
|
skupForbidTypeLable:[],
|
|
|
skupForbidType: ''
|
|
|
// skupForbidTypeLable:[],
|
|
|
// skupForbidType: ''
|
|
|
skupAllowTypeLabel: [],
|
|
|
skupAllowType: ''
|
|
|
},
|
|
|
ruleValidate: {
|
|
|
couponType: {required: true, validator: (rule, value, callback) => {
|
...
|
...
|
@@ -207,8 +251,10 @@ export default { |
|
|
productLimitType: 2,
|
|
|
useLimitValue: 0,
|
|
|
time: ['', ''],
|
|
|
skupForbidTypeLable:[],
|
|
|
skupForbidType: ''
|
|
|
skupAllowTypeLabel: [],
|
|
|
skupAllowType: ''
|
|
|
// skupForbidTypeLable:[],
|
|
|
// skupForbidType: ''
|
|
|
};
|
|
|
|
|
|
if (id) {
|
...
|
...
|
@@ -217,7 +263,7 @@ export default { |
|
|
id
|
|
|
});
|
|
|
|
|
|
console.log(result);
|
|
|
// console.log(result);
|
|
|
|
|
|
this.loading = false;
|
|
|
|
...
|
...
|
@@ -226,11 +272,11 @@ export default { |
|
|
const productLimits = result.data.productLimits;
|
|
|
|
|
|
this.couponToken = coupon.couponToken;
|
|
|
let skupForbidTypeLable = [];
|
|
|
if (coupon.skupForbidType) {
|
|
|
let arr = coupon.skupForbidType.split(',');
|
|
|
let skupAllowTypeLabel = [];
|
|
|
if (coupon.skupAllowType) {
|
|
|
let arr = coupon.skupAllowType.split(',');
|
|
|
for(let i = 0; i < arr.length; i++) {
|
|
|
skupForbidTypeLable.push(forbidenLabelMap[parseInt(arr[i])]);
|
|
|
skupAllowTypeLabel.push(allowLabelMap[arr[i]]);
|
|
|
}
|
|
|
}
|
|
|
initData = {
|
...
|
...
|
@@ -246,8 +292,8 @@ export default { |
|
|
productLimitValue: (productLimits || []).map(i => i.productId).join(','),
|
|
|
useLimitValue: coupon.useLimitValue,
|
|
|
time: [dayjs.unix(coupon.startTime).format('YYYY-MM-DD HH:mm:ss'), dayjs.unix(coupon.endTime).format('YYYY-MM-DD HH:mm:ss')],
|
|
|
skupForbidTypeLable: skupForbidTypeLable,
|
|
|
skupForbidType: coupon.skupForbidType
|
|
|
skupAllowTypeLabel: skupAllowTypeLabel,
|
|
|
skupAllowType: coupon.skupAllowType
|
|
|
};
|
|
|
} else {
|
|
|
result.message && this.$Message.warning(result.message);
|
...
|
...
|
@@ -269,11 +315,13 @@ export default { |
|
|
},
|
|
|
getCheckBox() { // checkbox勾选取消的监测
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < this.formData.skupForbidTypeLable.length; i++) {
|
|
|
let forbidType = this.formData.skupForbidTypeLable[i];
|
|
|
arr.push(forbidenTypeMap[forbidType]);
|
|
|
for (let i = 0; i < this.formData.skupAllowTypeLabel.length; i++) {
|
|
|
let allowType = this.formData.skupAllowTypeLabel[i];
|
|
|
arr.push(allowTypeMap[allowType]);
|
|
|
}
|
|
|
this.formData.skupForbidType = arr.join(',');
|
|
|
|
|
|
console.log(arr);
|
|
|
this.formData.skupAllowType = arr.join(',');
|
|
|
},
|
|
|
async saveData(params) {
|
|
|
if (this.allreadonly) {
|
...
|
...
|
@@ -281,7 +329,6 @@ export default { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
console.log(params);
|
|
|
const result = await api._post('/ufoPlatform/coupon/saveOrUpdateCoupon', {
|
|
|
id: params.id || void 0,
|
|
|
couponName: params.couponName,
|
...
|
...
|
@@ -296,7 +343,7 @@ export default { |
|
|
useLimitType: parseInt(params.useLimitType) >= 0 ? params.useLimitType : void 0,
|
|
|
startTime: params.time[0] ? dayjs(params.time[0]).unix() : void 0,
|
|
|
endTime: params.time[1] ? dayjs(params.time[1]).unix() : void 0,
|
|
|
skupForbidType: params.skupForbidType
|
|
|
skupAllowType: params.skupAllowType
|
|
|
});
|
|
|
|
|
|
console.log('result=', result);
|
...
|
...
|
|