Commit 2bff20bf by crushh

update: 消费触发配置

parent 1c649d65
......@@ -886,34 +886,13 @@ export default {
// 全部则不传该字段
// 单笔订单触发 或 累计消费订单触发
if (this.form.effectType == 0) {
if (this.form.effectAction === 'consume' && this.form.consum_type == 1) {
if (this.form.effectAction === 'consume') {
// 门店
let consumeObj = {
store_mode: this.consumeChecked.store ? 1 : 0,
consumerStoreType: this.form.consumerStoreType,
order_store: this.consumeChecked.store ? (this.form.consumerStoreType === 0 ? this.form.order_store : this.form.order_store_new) : ''
};
consumeObj.consum_type = 1;
// 勾选消费金额 --不填代表没有上下限,不传该字段
if (this.consumeChecked.cost) {
if (this.form.lowest_cost) {
consumeObj['lowest_cost'] = this.form.lowest_cost;
}
if (this.form.max_cost) {
consumeObj['max_cost'] = this.form.max_cost;
}
}
// 勾选消费件数
if (this.consumeChecked.count) {
if (this.form.lowest_cost_count) {
consumeObj['lowest_cost_count'] = this.form.lowest_cost_count;
}
if (this.form.max_cost_count) {
consumeObj['max_cost_count'] = this.form.max_cost_count;
}
}
// 勾选消费商品
if (this.consumeChecked.good && this.xxSysp.goodsFilterId) {
consumeObj.goods_filter_id = this.xxSysp.goodsFilterId;
......@@ -922,38 +901,45 @@ export default {
filterAbbrInfo: this.xxSysp.filterAbbrInfo
});
}
// 处理适用商品折扣 未勾选不传这个对象
if (this.discount_limit.flag) {
const discount_limit = { ...this.discount_limit };
delete discount_limit.flag;
consumeObj.discount_limit = JSON.stringify(discount_limit);
}
// 支付方式
if (this.consumeChecked.payment) {
params.gic_payment_list = JSON.stringify(this.allList.filter(i => this.checkList.includes(i.payCode)));
params.gic_payment_flag = this.paymentFlag;
if (this.form.consum_type == 1) {
consumeObj.consum_type = 1;
// 勾选消费金额 --不填代表没有上下限,不传该字段
if (this.consumeChecked.cost) {
if (this.form.lowest_cost) {
consumeObj['lowest_cost'] = this.form.lowest_cost;
}
if (this.form.max_cost) {
consumeObj['max_cost'] = this.form.max_cost;
}
}
// 勾选消费件数
if (this.consumeChecked.count) {
if (this.form.lowest_cost_count) {
consumeObj['lowest_cost_count'] = this.form.lowest_cost_count;
}
if (this.form.max_cost_count) {
consumeObj['max_cost_count'] = this.form.max_cost_count;
}
}
// 处理适用商品折扣 未勾选不传这个对象
if (this.discount_limit.flag) {
const discount_limit = { ...this.discount_limit };
delete discount_limit.flag;
consumeObj.discount_limit = JSON.stringify(discount_limit);
}
// 支付方式
if (this.consumeChecked.payment) {
params.gic_payment_list = JSON.stringify(this.allList.filter(i => this.checkList.includes(i.payCode)));
params.gic_payment_flag = this.paymentFlag;
} else {
params.gic_payment_flag = 0;
}
} else {
params.gic_payment_flag = 0;
}
// 消费
params = Object.assign(params, consumeObj); // 合并消费触发数据
} else if (this.form.effectAction === 'consume' && this.form.consum_type == 2) {
// 门店
let consumeObj = {
store_mode: this.consumeChecked.store ? 1 : 0,
consumerStoreType: this.form.consumerStoreType,
order_store: this.consumeChecked.store ? (this.form.consumerStoreType === 0 ? this.form.order_store : this.form.order_store_new) : ''
};
consumeObj.consum_type = 2;
consumeObj['lowest_cost'] = this.form.lowest_cost;
// 勾选消费商品
if (this.consumeChecked.good && this.xxSysp.goodsFilterId) {
consumeObj.goods_filter_id = this.xxSysp.goodsFilterId;
consumeObj.goodsSearchDetail = JSON.stringify({
conditionList: this.isEdit ? this.xxSysp.conditionList_copy : this.xxSysp.conditionList, // 编辑保存备份数据
filterAbbrInfo: this.xxSysp.filterAbbrInfo
});
consumeObj.gift_flag = this.form.gift_flag;
consumeObj.consum_type = 2;
consumeObj['lowest_cost'] = this.form.lowest_cost;
if (this.consumeChecked.good && this.xxSysp.goodsFilterId) {
consumeObj.gift_flag = this.form.gift_flag;
}
}
params = Object.assign(params, consumeObj); // 合并消费触发数据
}
......@@ -1087,9 +1073,6 @@ export default {
// console.log(this.gradeList )
});
}
if (!isInit) {
this.form.consum_type = 1;
}
},
// 消费触发
handleLowestCost() {
......
......@@ -264,8 +264,6 @@ export default {
}
},
consumType(val) {
console.log('-------consumType');
console.log(val);
this.list.forEach(el => {
this.delItem(el);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment