You need to sign in or sign up before continuing.
Commit 24684014 by 黑潮

update: 储值触发

parent d404fde7
......@@ -19,7 +19,7 @@ export default {
creatorId: '',
code: '1001',
loading: false,
effectActionOptions: [{ value: 'subscribe', label: '关注触发' }, { value: 'authentication', label: '认证触发' }, { value: 'consume', label: '消费触发' }, { value: 'upgrade', label: '会员卡升级触发' }, { value: 'degrade', label: '会员卡降级触发' }], // eslint-disable-line
effectActionOptions: [{ value: 'subscribe', label: '关注触发' }, { value: 'authentication', label: '认证触发' }, { value: 'consume', label: '消费触发' }, { value: 'upgrade', label: '会员卡升级触发' }, { value: 'stored', label: '储值触发' }, ], // eslint-disable-line
marketingTimesTypeOptions: [{ value: 0, label: '总共触发' }, { value: 1, label: '每天触发' }, { value: 2, label: '每周触发' }, { value: 3, label: '每月触发' }, { value: 4, label: '每年触发' }, { value: -1, label: '无限次触发' }], // eslint-disable-line
execDateType: [
{ label: '每天', value: 1 },
......@@ -79,7 +79,9 @@ export default {
lowest_cost_count: '',
max_cost_count: '',
// store_mode: 0,
order_store: ''
order_store: '',
storedLowest: 0,
storedMax: 0
},
template: {
headerColor: '#173177',
......@@ -146,6 +148,7 @@ export default {
count: false, // 消费件数
good: false // 消费商品
},
storedChecked: false,
discount_limit: { type: 1, count: undefined, flag: false } // 适用商品折扣
};
},
......@@ -390,6 +393,13 @@ export default {
}
});
}
if (this.form.effectAction === 'stored' && result.effectTriggerJson) {
let cost = JSON.parse(result.effectTriggerJson) || {};
this.storedChecked = true;
this.form.storedLowest = cost.lowest_cost;
this.form.storedMax = cost.max_cost;
}
}
if (!this.form.templateUseEnable) return;
let template = null;
......@@ -620,6 +630,17 @@ export default {
return;
}
}
// 如果是储值触发
if (this.form.effectAction === 'stored') {
if (this.storedChecked && !this.form.storedLowest && !this.form.storedMax) {
this.$tips({ type: 'warning', message: '请填写储值金额区间值' });
return;
}
if (this.storedChecked && this.form.storedLowest && this.form.storedMax && this.form.storedLowest > this.form.storedMax) {
this.$tips({ type: 'warning', message: '储值金额区间值填写错误' });
return;
}
}
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
......@@ -703,6 +724,9 @@ export default {
}
params = Object.assign(params, consumeObj); // 合并消费触发数据
}
if (this.form.effectAction === 'stored' && this.storedChecked) {
params.effectTriggerJson = JSON.stringify({ lowest_cost: this.form.storedLowest || 0, max_cost: this.form.storedMax || 0 });
}
params.marketingActivityId = this.form.marketingActivityId || ''; // 否 String 营销场景
// 如果适用人群-人群筛选器可编辑:需要调用await this.$refs.threshold.triggerPeopleSet(); 强制触发回显,否则数据保存有错误
// await this.triggerPeopleSet();
......
......@@ -187,6 +187,30 @@
</el-select>
</el-form-item>
</section>
<!-- 储值触发配置 -->
<section class="dm-form__wrap" v-if="form.effectType == 0 && form.effectAction === 'stored'">
<h3 class="dm-title__label">
储值触发配置
<i class="dm-title__label--icon iconfont icon-xinxixianshi"></i>
<span class="gray fz13">仅适用于线下单笔充值场景;消费、退款等不会触发</span>
</h3>
<p class="fz14 gray mb20 ml10">同时满足以下条件即可触发</p>
<el-form-item>
<div class="no_label_form_label">
<el-checkbox class="el-form-item__label align-left" :disabled="!isAdd" v-model="storedChecked">储值金额</el-checkbox>
<div>
<span class="fz14 gray" v-show="!storedChecked">任意储值金额</span>
<div v-show="storedChecked">
<el-input-number :disabled="!isAdd" controls-position="right" min="" :max="1000000" style="width:150px;" v-model="form.storedLowest"></el-input-number>
<span class="ml5 mr5"></span>
<el-input-number :disabled="!isAdd" controls-position="right" min="" :max="1000000" style="width:150px;" v-model="form.storedMax"></el-input-number>
<span class="pl5"></span>
<el-popover placement="right" title="" width="200" trigger="hover" content="最大值最小值可选填其一或两个都填写,包含边界值"><i class="el-icon-info ml5 gray" slot="reference"></i></el-popover>
</div>
</div>
</div>
</el-form-item>
</section>
<!-- 营销次数配置 重复 -->
<section class="dm-form__wrap" v-if="form.effectType == 1">
<h3 class="dm-title__label">
......
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