Commit 3eb41270 by Kyle_Li

新增2种标签模板

parent c5d5546f
......@@ -26,7 +26,7 @@
<!-- <script src="//web-1251519181.file.myqcloud.com/components/datepicker.2.0.00.js"></script> -->
<script src="//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.11.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.02.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.11.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/selector.1.1.95.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js"></script>
......
......@@ -661,6 +661,20 @@
</div>
</template>
<!-- 核心流失 tag022 -->
<template v-if="parent.templateCode == 'tag022'">
<div class="m-b-20" :key="'tag022' + pindex">
<div class="checkboxOption-wrap__body__checkAll border-box tag-mode">
<el-checkbox :indeterminate="parent.isIndeterminate" v-model="parent.checkAll" @change="handleCheckAllChange($event, parent)">全选</el-checkbox>
</div>
<div class="checkboxOption-wrap__body__options border-box tag-options">
<el-checkbox-group v-model="parent.checkeditems" @change="handleCheckedCitiesChange">
<el-checkbox v-for="(item, index) in parent.options" :label="item.memberTagGradeId" :key="item.memberTagGradeId + index">{{item.aliasName}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<!-- 嵌入商品选择器 -->
<div v-if="parent.templateCode == 'com022'">
<vue-gic-goods-selector ref="selector" @changelist="changelist"></vue-gic-goods-selector>
......@@ -698,6 +712,32 @@
</div>
</div>
</template>
<!-- 会员标签嵌入卡券选择器 com024 -->
<!-- v-if="parent.templateCode == 'com024'" -->
<div v-if="parent.templateCode == 'com024'">
<div style="margin-bottom:20px">
<el-select v-model="expiration" style="width:90px;">
<el-option label="1" value="1"></el-option>
<el-option label="2" value="2"></el-option>
<el-option label="3" value="3"></el-option>
<el-option label="4" value="4"></el-option>
<el-option label="5" value="5"></el-option>
<el-option label="6" value="6"></el-option>
<el-option label="7" value="7"></el-option>
</el-select>
天后过期
</div>
<vue-gic-card
ref="gicCard"
@reciver-card-list="reciverCardList"
:disabledList="disabledList"
:cardLimit="cardLimit"
:cardType="cardType"
:tag-list="tagList"
:type="1">
</vue-gic-card>
</div>
</div>
</div>
</template>
......@@ -945,6 +985,14 @@ export default {
options: [],
compute: 'in'
},
// 核心流失
tag022: {
checkeditems: [],
isIndeterminate: false,
checkAll: false,
options: [],
compute: 'in'
},
// 商品选择器
com022: {
......@@ -967,7 +1015,13 @@ export default {
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
}
},
cardListData: []
cardListData: [],
com024: {},
expiration: '1',
cardParams: {
startTime: '',
endTime: ''
}
};
},
watch: {
......@@ -1027,7 +1081,7 @@ export default {
},
handleCheckedCitiesChange(value) {
this.templateData.forEach(item => {
if (item.templateCode == 'tag001' || item.templateCode == 'tag013' || item.templateCode == 'tag021') {
if (item.templateCode == 'tag001' || item.templateCode == 'tag013' || item.templateCode == 'tag021' || item.templateCode == 'tag022') {
let checkedCount = value.length;
item.checkAll = checkedCount === item.options.length;
item.isIndeterminate = checkedCount > 0 && checkedCount < item.options.length;
......@@ -1205,6 +1259,24 @@ export default {
}
});
}
if (data.templateCode == 'tag022') {
this.axios.get(`${this.baseUrl}/gic-member-tag-web/memberTagGrade/coreLoss?requestProject=gic-member-tag-web`).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode === 1) {
this.templateData[0].options = [{
memberTagGradeId: result && result.length ? result[0].memberTagGradeId : '',
aliasName: '是'
}];
}
});
}
if (data.templateCode == 'com024') { // 修改组件内参数
this.$nextTick(_ => {
this.$refs.gicCard[0].sdate = this.cardParams.startTime
this.$refs.gicCard[0].edate = this.cardParams.endTime
this.$refs.gicCard[0].getCardList()
})
}
/**
* 这里处理编辑回显数据
......@@ -1478,9 +1550,10 @@ export default {
break;
case 'tag021':
case 'tag022':
value = tagValue.val[0].data.value.split(' ');
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag021') {
if (this.templateData[i].templateCode === 'tag021' || this.templateData[i].templateCode === 'tag022') {
this.templateData[i].checkeditems = value;
}
}
......@@ -1721,8 +1794,9 @@ export default {
// 卡券
case 'com023':
case 'com024':
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'com023') {
if (this.templateData[i].templateCode === 'com023' || this.templateData[i].templateCode === 'com024') {
value = tagValue.val[0].data.value.split(' ');
selectVal = tagParams.selectedVal.split(' ');
selectVal.forEach((el, ix) => {
......@@ -1732,6 +1806,7 @@ export default {
});
});
}
this.templateData[i].templateCode === 'com024' && (this.expiration = tagValue.time[0].value)
}
break;
......@@ -1787,7 +1862,7 @@ export default {
}
},
create() {
created() {
this.templateObj = {};
let host = window.location.origin;
if (host.indexOf('localhost') != '-1') {
......@@ -1795,6 +1870,14 @@ export default {
} else {
this.baseUrl = host;
}
let date1 = new Date();
let dateStr1 = date1.toLocaleDateString().replace(/\//g, '-').replace(/-(\d)(?!\d)/g, '-0$1');
date1.setMonth(date1.getMonth() - 3);
let dateStr2 = date1.toLocaleDateString().replace(/\//g, '-').replace(/-(\d)(?!\d)/g, '-0$1');
this.cardParams = {
startTime: dateStr2,
endTime: dateStr1,
}
},
mounted() {
// 存在id
......
......@@ -448,6 +448,18 @@ export default {
returnFlag = false;
}
}
if (code === 'tag022' && that.templateData.length === 1) {
tagValue.val[0].data.compute = that.templateData[0].compute;
const checkeditems = this.templateData[0].checkeditems.map(el => el);
this.templateData[0].options.forEach((ele, index) =>{
if (checkeditems.indexOf(ele.memberTagGradeId) != -1) {
this.postTemplateData.selectedVal.push(ele.aliasName);
itemArr.push(ele.memberTagGradeId);
}
});
this.templateData[0].checkeditems = itemArr;
tagValue.val[0].data.value = itemArr.join(' ');
}
/**
* 商品选择必选
......@@ -1002,13 +1014,23 @@ export default {
*/
if (this.templateData.length) {
if (code === 'com023') {
if (code === 'com023' || code === 'com024') {
tagValue.val[0].data.compute = this[code].postCompute;
tagValue.val[0].data.dealKey = "card";
tagValue.val[0].data.key = this.currentKey;
tagValue.val[0].data.value = this.cardListData.map(el => el.coupCardId).join(' ');
this.postTemplateData.selectedVal = this.cardListData.map(el => el.cardName).join(' ');
}
code === 'com024' &&
(tagValue = {
...tagValue,
time: [
{
type: 'afterday',
value: this.expiration
}
]
})
}
......@@ -1102,7 +1124,7 @@ export default {
if (val) {
item.checkeditems = [];
item.options.forEach(function(el, index) {
if (item.templateCode === 'tag021') {
if (item.templateCode === 'tag021' || item.templateCode === 'tag022') {
item.checkeditems.push(el.memberTagGradeId);
} else {
item.checkeditems.push(el.key);
......@@ -1956,8 +1978,9 @@ export default {
// 卡券
case 'com023':
case 'com024':
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'com023') {
if (this.templateData[i].templateCode === 'com023' || this.templateData[i].templateCode === 'com024') {
value = tagValue.val[0].data.value.split(' ');
selectVal = tagParams.selectedVal.split(' ');
selectVal.forEach((el, ix) => {
......@@ -1967,6 +1990,7 @@ export default {
});
});
}
this.templateData[i].templateCode === 'com024' && (this.expiration = tagValue.time[0].value)
}
break;
......
......@@ -14,7 +14,7 @@ export const aliasNames = [
{ name: '核心沉睡', title: '会员近一年,消费次数≥3次,消费总额≥3倍商户近一年会员平均客单价且消费休眠天数为181-366天'},
{ name: '潜力沉睡', title: '除核心会员、普通会员、未消费会员之外的其他会员且消费休眠天数为181-366天' },
{ name: '普通沉睡', title: '会员历史累计消费,消费次数等于1且消费休眠天数为181-366天' },
{ name: '核心流失', title: '会员近一年,消费次数≥3次,消费总额≥3倍商户去年会员平均客单价且消费休眠天数>366天'},
{ name: '核心流失', title: '曾经是核心活跃、核心休眠、核心沉睡的会员,现在却流失为潜力会员的人群。'},
{ name: '潜力流失', title: '除核心会员、普通会员、未消费会员之外的其他会员且消费休眠天数>366天' },
{ name: '普通流失', title: '会员历史累计消费,消费次数等于1且消费休眠天数>366天' },
{ name: '有微信未消费会员', title: '会员历史累计消费,消费次数等于0' },
......
......@@ -490,7 +490,7 @@ export default {
return;
}
if (list === 'all') {
this.params.memberTagGroupClassifyId = '0';
this.params.memberTagGroupClassifyId = '';
this.isRecommend = false;
this.isTagRecommend = false;
this.currentPage = 1;
......@@ -880,7 +880,7 @@ export default {
isRealTime: 1,
effectiveStatus: this.statusSelect,
requestProject: 'gic-member-tag-web',
memberTagGroupClassifyId: '0'
memberTagGroupClassifyId: ''
};
},
mounted() {
......
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