Commit 28c105c9 by Kyle_Li

update: 新增单笔消费商品数量的标签种类

parent 5f57228e
......@@ -686,6 +686,33 @@
<!-- <vue-gic-selector ref="selector" @changelist="changelist"></vue-gic-selector> -->
</div>
<div v-if="parent.templateCode == 'com025'">
<div class="m-b-20" :key="'tag2' + pindex">
商品数量
<el-select v-model="parent.symbol" placeholder="请选择" style="width: 100px;margin:0 10px">
<el-option
v-for="item in parent.options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div style="display: inline-block" v-if="parent.symbol == '区间'">
<el-input :value="parent.numRange[0]" @input="v => $set(parent.numRange, 0, onInputNum(v))" @keyup.native="handleNumRangeEnd($event)" class="select-wrap-input" style="width: 100px;margin-right: 0;" placeholder="请输入数字"></el-input>
<label>-</label>
<el-input :value="parent.numRange[1]" @input="v => $set(parent.numRange, 1, onInputNum(v))" @keyup.native="handleNumRangeEnd($event)" class="select-wrap-input" style="width: 100px;margin-right: 10px;" placeholder="请输入数字"></el-input>
</div>
<div style="display: inline-block" v-if="parent.symbol != '区间'">
<el-input :value="parent.num" @input="v => $set(parent, 'num', onInputNum(v))" @keyup.native="handleNumRangeEnd($event)" class="select-wrap-input" style="width: 100px;margin-right: 10px;" placeholder="请输入数字"></el-input>
</div>
</div>
<p style="margin-bottom:15px">已选商品</p>
<vue-gic-goods-selector ref="selector" @changelist="changelist"></vue-gic-goods-selector>
</div>
<!-- 标签值 / 固定时间 / 之后时间 tag024 -->
<template v-if="parent.templateCode == 'tag024'">
<div class="m-b-20" :key="'tag24' + pindex">
......@@ -1023,6 +1050,7 @@ export default {
},
cardListData: [],
com024: {},
com025: {},
expiration: '1',
cardParams: {
startTime: '',
......@@ -1215,8 +1243,12 @@ export default {
for (let key in data) {
if (data.templateCode == 'com023') {
this[data.templateCode][key] = data[key];
} else if (data.templateCode == 'com025') {
this.com001[key] = data[key];
this.com022[key] = data[key];
} else {
this[data.templateCode][key] = data[key];
}
this[data.templateCode][key] = data[key];
}
// 如果是城市
if (data.templateCode === 'tag010') {
......@@ -1252,6 +1284,8 @@ export default {
setTimeout(_ => {
this.templateData.push(this[data.templateCode]);
}, 200);
} else if (data.templateCode == 'com025') {
this.templateData.push({ ...this.com001, ...this.com022 });
} else {
this.templateData.push(this[data.templateCode]);
}
......@@ -1493,6 +1527,7 @@ export default {
// 回显数据
let tagValue = JSON.parse(this.templateDataList.tagValue);
let tagParams = JSON.parse(this.templateDataList.tagParams);
console.log(tagParams, tagValue)
let value = null;
let selectVal = null;
let checkedCount = null;
......@@ -1835,6 +1870,24 @@ export default {
}
break;
case 'com025':
if (tagParams.selectedVal[0].indexOf('区间') != -1) {
// 存在区间
this.templateData[0].symbol = '区间';
this.templateData[0].numRange = tagValue.val[0].data.value.split(',');
} else if (tagParams.template[0].symbol == void 0) {
this.templateData[0].symbol = '区间';
this.templateData[0].numRange = tagParams.template[0].numRange;
} else {
this.templateData[0].symbol = tagParams.template[0].symbol;
this.templateData[0].num = tagValue.val[0].data.value;
}
this.$nextTick(() => {
this.$refs.selector[0].conditions = JSON.parse(JSON.stringify(tagParams.conditionList));
})
break;
// case 'tag021':
// value = tagValue.val[0].data.value.split(' ');
// for (let i = 0; i < this.templateData.length; i++) {
......
......@@ -787,6 +787,50 @@ export default {
}
}
/* com025 单笔消费商品数量 */
if (code === 'com025') {
const { symbol, num, numRange } = that.templateData[0];
tagValue.val[0].data.compute = symbol == '区间' ? 'between' : symbol;
if (symbol != '区间') {
if (!num) {
this.$message.warning({
message: '请完善区间值!'
});
return false;
}
tagValue.val[0].data.value = num;
} else {
if (!numRange[0] || !numRange[1]) {
this.$message.warning({
message: '请完善区间值!'
});
return false;
}
tagValue.val[0].data.value = `${numRange[0]},${numRange[1]}`;
}
let computeSymbol = tagValue.val[0].data.compute == 'between' ? '区间' : tagValue.val[0].data.compute;
this.postTemplateData.selectedVal.push(`${computeSymbol}${tagValue.val[0].data.value}`);
await this.confirmSelector();
if (!this.com022.selectList || !this.com022.selectList.length) {
this.$message.warning('商品选择器未选择条件!')
return false;
}
console.log(this.com022.conditionsList);
tagValue.val.push({
type: 'data', //类型
data: {
key: this.currentKey,
compute: this[code].postCompute,
value: this.com022.finalId,
dealKey: 'goodsSeletor'
}
})
let abbr = this.translateAbbrinfo(this.com022.abbrInfo);
this.postTemplateData.selectedVal.push(abbr.join(' '));
this.postTemplateData.conditionList = this.com022.conditionsList;
}
/* 属于/不属于+ 选项 */
if (that.templateData.length == 2) {
......
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