Commit 65f76a12 by caoyanzhi

Merge branch 'feature/7月迭代-会员'

parents 451cfaea 49e8f3ed
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
(function() { (function() {
var src = '/component/static/import-component.js?timestrap='+ new Date().getTime(); var src = '/component/static/import-component.js?timestrap='+ new Date().getTime();
var host = window.location.host; var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host; host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'www.gicdev.com' : host;
document.write('<script src="//'+ host + src +'"><\/script>') document.write('<script src="//'+ host + src +'"><\/script>')
})() })()
</script> </script>
......
...@@ -58,6 +58,8 @@ export default { ...@@ -58,6 +58,8 @@ export default {
// 两次的uId不等 表示账号有冲突 // 两次的uId不等 表示账号有冲突
if (this.uniqueId !== uId) { if (this.uniqueId !== uId) {
this.$store.commit('changeUniqueId', uId); this.$store.commit('changeUniqueId', uId);
// 切换账号后,不缓存权限数据、菜单数据、面包屑数据
window.notCache = true;
this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请重新登录!', '登录账号变更提示', { this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请重新登录!', '登录账号变更提示', {
confirmButtonText: '重新登录', confirmButtonText: '重新登录',
cancelButtonText: '刷新页面', cancelButtonText: '刷新页面',
......
...@@ -69,6 +69,18 @@ export const getRequest = (url, params) => { ...@@ -69,6 +69,18 @@ export const getRequest = (url, params) => {
}); });
}; };
export const getRequestBlob = (url, params) => {
params.requestProject = 'member-tag';
return Vue.axios({
method: 'get',
url: `${local}/gic-member-tag-web${url}`,
data: {},
params: params,
responseType: 'blob',
headers: { 'content-type': 'application/x-www-form-urlencoded' } // "token": token
});
};
/* /*
* *
* 统一 post 请求方法 * 统一 post 请求方法
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
if (res.errorCode == 0) { if (res.errorCode == 0) {
console.log(res.result) console.log(res.result)
const { result} = res.result; const { result} = res.result;
this.groupList = result.filter(el => el.classifyName != '未分类').map(item => ({ this.groupList = result.filter(el => el.classifyName != '未分类' && el.classifyName != null).map(item => ({
...item, ...item,
edit: false edit: false
})); }));
......
...@@ -629,6 +629,106 @@ ...@@ -629,6 +629,106 @@
</div> </div>
</div> </div>
</template> </template>
<template v-if="parent.templateCode == 'tag050'">
<div class="m-b-20" :key="'tag17' + pindex">
<label class="inline-block m-r-20 label-unit" style="width: 108px;text-align: right">
最近关联时间
<el-tooltip placement="top" open-delay="100">
<div slot="content">客户与各渠道最近关联的时间,如解除之后再重新关联,最近关联时间会更新</div>
<i class="iconfont icon-xinxixianshi m-l-4" style="font-size: 14px;color: #909399"></i>
</el-tooltip>
</label>
<el-radio-group v-model="parent.radio" @change="timeRadioChange($event,parent)" class="radio-group">
<el-radio label="0">所有时间</el-radio>
<el-radio label="1">固定时段</el-radio>
<el-radio label="2">相对时段</el-radio>
</el-radio-group>
<!-- 固定时段 -->
<div class="m-t-18 w-438 p-20 border-box bg-f3f6f9" v-if="parent.radio == 1">
<el-date-picker
v-model="parent.dateRangeValue"
type="daterange"
:editable="false"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
<!-- 相对时段 -->
<div class="relative-range m-t-18 border-box" v-if="parent.radio == 2">
<div>
<div>
<label class="inline-block w-98 label-unit">时间精度
<el-popover placement="top" open-delay="100" trigger="hover">
<div >
<template v-if="tagData.isActive == 1 ">
<span style="font-weight: 600">选择【天】:</span><br />当天:选择相对时段为“当天”,那么统计的是当天凌晨至当前时间内的数据;<br />最近X天:选择相对时间段为“最近2天”,那么系统在8月1号统计的是7.30-7.31号的数据;系统在8月5号统计的是8.3-8.4号的数据;<br/>
<span style="font-weight: 600">选择【月】:</span><br />当月:选择相对时段为“当月”,那么统计的是当月1号至当前时间的数据;<br />最近X月:选择相对时间段为“最近2月”,那么系统在8月统计的是6.1-7.31号的数据;系统在9月统计的是7.1-8.31号的数据;<br />
<span style="font-weight: 600">选择【年】:</span><br />当年:选择相对时段为“当年”,那么统计的是当年1号至当前时间的数据;<br />最近X年:选择相对时间段为“最近1年”,那么系统统计的是去年1.1-12.31号的数据。
</template>
<template v-else>
<span style="font-weight: 600">选择【天】:</span><br />最近X天:选择相对时段为“最近2天”,那么系统在5号凌晨统计3-4号的数据;系统在6号凌晨统计时,统计的是4-5号的数据;<br />
<span style="font-weight: 600">选择【月】:</span><br />当月:选择相对时间段为“当月”,那么系统在8月5号凌晨进行统计时,统计的是在8.1-8.4号的数据;系统在6号凌晨统计时,统计的是在8.1-8.5号的数据;<br />最近X月:选择相对时间段为“最近2月”,那么系统在8月5号凌晨进行统计时,统计的是6.1-7.31号的数据;系统在6号凌晨统计时,统计的还是6.1-7.31号的数据;<br />
<span style="font-weight: 600">选择【年】:</span><br />当年:选择相对时间段为“当年”,那么系统在8月5号凌晨进行统计时,统计的是在当年1.1-8.4号的数据;系统在6号凌晨统计时,统计的是在当年1.1-8.5号的数据;<br />最近X年:选择相对时间段为“最近1年”,那么系统在8月5号凌晨进行统计时,统计的是在去年1.1-12.31号的数据;系统在6号凌晨统计时,统计的还是在去年1.1-12.31号的数据。
</template>
</div>
<i slot="reference" class="iconfont icon-tishi" style="color: #909399"></i>
</el-popover>
</label>
<el-radio-group v-model="parent.timeRadio" @change="timeRadioChange($event, parent)">
<el-radio label="1"></el-radio>
<el-radio label="2"></el-radio>
<el-radio label="3"></el-radio>
</el-radio-group>
</div>
<template v-if="['haobanWechatRelatedTime','onceCostTime'].includes(currentKey)">
<div class="m-t-20" v-if="parent.timeRadio!=='1'">
<label class="inline-block w-98"></label>
<el-checkbox v-model="parent.timeChecked" @change="currentDayChange($event, parent)">
{{ parent.timeRadio == 2 ? '月' : '年' }}
</el-checkbox>
</div>
</template>
<div class="m-t-20" v-else >
<label class="inline-block w-98"></label>
<el-checkbox v-model="parent.timeChecked" @change="currentDayChange($event, parent)">
当{{ parent.timeRadio == 1 ? '天' : parent.timeRadio == 2 ? '月' : '年' }}
</el-checkbox>
</div>
<div class="m-t-20">
<label class="inline-block w-98"></label>
<el-checkbox v-model="parent.timeAfterChecked" style="margin-right: 7px">
</el-checkbox>
<span>最近</span>
<!-- <el-select v-model="parent.timeSelect" placeholder="请选择" class="w-86 m-l-8" disabled>
<el-option label="最近" value="1" style="color: #303133"></el-option>
</el-select> -->
<el-input
v-model="parent.timeInput"
placeholder="请输入"
class="w-90"
@blur="value => toEditDateInput(value, parent.timeRadio, parent)"
></el-input>
<template v-if="parent.timeRadio == 1">
<label class="inline-block middle label-unit m-l-8"></label>
<label class="inline-block middle label-tip">正整数,最大730</label>
</template>
<template v-if="parent.timeRadio == 2">
<label class="inline-block middle label-unit m-l-8"></label>
<label class="inline-block middle label-tip">正整数,最大24</label>
</template>
<template v-if="parent.timeRadio == 3">
<label class="inline-block middle label-unit m-l-8"></label>
<label class="inline-block middle label-tip">正整数,最大2</label>
</template>
</div>
</div>
</div>
</div>
</template>
<!-- 17.时间属性(年月日-年月日 + 最近) --> <!-- 17.时间属性(年月日-年月日 + 最近) -->
<template v-if="parent.templateCode == 'tag017'"> <template v-if="parent.templateCode == 'tag017'">
...@@ -899,6 +999,18 @@ ...@@ -899,6 +999,18 @@
</div> </div>
</div> </div>
</template> </template>
<template v-if="parent.templateCode == 'tag040'">
<label class="inline-block m-r-20 label-unit" style="width: 108px;text-align: right">
关联渠道
<el-tooltip placement="top" open-delay="100">
<div slot="content">关联渠道为当前客户关联的线上渠道,根据关联状态实时变化</div>
<i class="iconfont icon-xinxixianshi m-l-4" style="font-size: 14px;color: #909399"></i>
</el-tooltip>
</label>
<el-radio-group v-model="parent.radioType" class="radio-group">
<el-radio v-for="item in parent.options" :key="item.key" :label="item.key">{{ item.value }}</el-radio>
</el-radio-group>
</template>
<!-- 会员标签嵌入卡券选择器 com024 --> <!-- 会员标签嵌入卡券选择器 com024 -->
<!-- v-if="parent.templateCode == 'com024'" --> <!-- v-if="parent.templateCode == 'com024'" -->
...@@ -1233,6 +1345,18 @@ export default { ...@@ -1233,6 +1345,18 @@ export default {
timeSelect: '1', // 最近/之后 timeSelect: '1', // 最近/之后
timeInput: '' timeInput: ''
}, },
tag050: {
radio: '0',
dateRangeValue: [],
// 相对时间
timeRadio: '1', // 年月日
timeChecked: false,
timeAfterChecked: false,
// timeCheckedTwo: false,
timeSelect: '1', // 最近/之后
timeInput: ''
},
// 会员分层 // 会员分层
tag021: { tag021: {
checkeditems: [], checkeditems: [],
...@@ -1299,6 +1423,10 @@ export default { ...@@ -1299,6 +1423,10 @@ export default {
recentValue: null, recentValue: null,
checkGroup: [] checkGroup: []
}, },
// 关联渠道
tag040: {
radioType: '1100',
},
cardListData: [], cardListData: [],
com024: {}, com024: {},
com025: {}, com025: {},
...@@ -2104,6 +2232,33 @@ export default { ...@@ -2104,6 +2232,33 @@ export default {
} }
break; break;
case 'tag050':
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag050') {
let templateDate = tagParams.template[0];
// 判断是那个时间段
// 固定时段
this.templateData[i].radio = templateDate.radio; // 时段
if (this.templateData[i].radio == 1) {
if (templateDate.dateRangeValue && templateDate.dateRangeValue.length) {
this.templateData[i].dateRangeValue = templateDate.dateRangeValue;
} else {
this.templateData[i].dateRangeValue = tagValue.val[0].data.value.split(',');
}
} else {
// 相对时段
this.templateData[i].timeRadio = templateDate.timeRadio; // 天 月 年
this.templateData[i].timeAfterChecked = templateDate.timeAfterChecked;
this.templateData[i].timeChecked = templateDate.timeChecked;
this.templateData[i].dateRangeValue = [];
}
// 如果有最近选项必有 timeInput
if (this.templateData[i].timeAfterChecked) {
this.templateData[i].timeInput = tagValue.time[0].value;
}
}
}
break;
case 'tag020': case 'tag020':
for (let i = 0; i < this.templateData.length; i++) { for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag020') { if (this.templateData[i].templateCode === 'tag020') {
...@@ -2277,6 +2432,10 @@ export default { ...@@ -2277,6 +2432,10 @@ export default {
getTag030Data.checkGroup = params.checkGroup; getTag030Data.checkGroup = params.checkGroup;
} }
break; break;
case 'tag040':
value = tagValue.val[0].data.value;
this.templateData[i].radioType = value;
break;
case 'tag024': case 'tag024':
const getTag024Data = this.hasTemplate('tag024'); const getTag024Data = this.hasTemplate('tag024');
...@@ -2455,6 +2614,12 @@ export default { ...@@ -2455,6 +2614,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.radio-group {
/deep/ .el-radio {
margin-right: 15px;
width: 92px;
}
}
.myTagDetail-wrap__btn { .myTagDetail-wrap__btn {
margin-top: 80px; margin-top: 80px;
} }
......
...@@ -531,7 +531,7 @@ export default { ...@@ -531,7 +531,7 @@ export default {
} }
/* 固定/相对 年月日+最近+之后 年月日+最近 年月日时分秒-年月日时分秒 */ /* 固定/相对 年月日+最近+之后 年月日+最近 年月日时分秒-年月日时分秒 */
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData[0].radio == 1) { if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code == 'tag050') && that.templateData[0].radio == 1) {
if (!that.templateData[0].dateRangeValue || !that.templateData[0].dateRangeValue.length) { if (!that.templateData[0].dateRangeValue || !that.templateData[0].dateRangeValue.length) {
that.$message.error({ message: '请选择值' }); that.$message.error({ message: '请选择值' });
return false; return false;
...@@ -542,7 +542,7 @@ export default { ...@@ -542,7 +542,7 @@ export default {
} }
} }
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015')) { if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code== 'tag050')) {
for (let k of this.templateData) { for (let k of this.templateData) {
if (!k.timeChecked && !k.timeAfterChecked && k.radio == 2) { if (!k.timeChecked && !k.timeAfterChecked && k.radio == 2) {
let tips = k.timeRadio == 1 ? '天' : k.timeRadio == 2 ? '月' : '年'; let tips = k.timeRadio == 1 ? '天' : k.timeRadio == 2 ? '月' : '年';
...@@ -564,7 +564,128 @@ export default { ...@@ -564,7 +564,128 @@ export default {
} }
} }
} }
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length === 1 && that.templateData[0].radio == 1) { if (code == 'tag050' && that.templateData.length > 0) {
switch(Number(that.templateData[0].radio)) {
case 0:
tagValue.time[0].compute = 'all';
tagValue.time[0].value = '';
that.postTemplateData.selectedVal.push('所有时间');
break;
case 1:
tagValue.time[0].compute = 'between';
tagValue.time[0].value = that.templateData[0].dateRangeValue.join(',')
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
break;
case 2:
// tagValue.time[0].compute = 'lastday';
// tagValue.time[0].value = that.templateData[0].dateRangeValue
// 天
// timeAfterChecked 最近/之后
// timeChecked 当天/年/月
if (that.templateData[0].timeRadio == 1) {
/** 同时选择
* lastdayHasToday 最近几天包含今天
* afterdayHasToday 之后几天包含今天
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastdayHasToday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput}天包含当天`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//天 当天
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'today'
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当天');
that.templateData[0].timeInput = '';
}
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 天`);
}
}
}
// 月
if (that.templateData[0].timeRadio == 2) {
/**
* lastmonthHasCurrentMonth 最近几月包含当月
* aftermonthHasCurrentMonth 之后几月包含当月
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastmonthHasCurrentMonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月包含当月`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//月 当月
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentMonth';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当月');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastmonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月`);
}
}
}
// 年
if (that.templateData[0].timeRadio == 3) {
/**
* lastyearHasCurrentYear 最近几年包含当年
* afteryearHasCurrentYear 之后几年包含当年
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastyearHasCurrentYear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年包含当年`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//年 当年
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentYear';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当年');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastyear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年`);
}
}
}
break;
}
}
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 1) {
if (that.currentComputeType == 2) { if (that.currentComputeType == 2) {
tagValue.val[0].data.compute = 'between'; tagValue.val[0].data.compute = 'between';
} else { } else {
...@@ -590,7 +711,7 @@ export default { ...@@ -590,7 +711,7 @@ export default {
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]); that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
} }
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length === 1 && that.templateData[0].radio == 2) { if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 2) {
// 天 // 天
// timeAfterChecked 最近/之后 // timeAfterChecked 最近/之后
// timeChecked 当天/年/月 // timeChecked 当天/年/月
...@@ -1039,6 +1160,10 @@ export default { ...@@ -1039,6 +1160,10 @@ export default {
that.postTemplateData.selectedVal.push(`时间范围为之后 ${ele.afterday} 天`); that.postTemplateData.selectedVal.push(`时间范围为之后 ${ele.afterday} 天`);
} }
} }
if (ele.templateCode == 'tag040') {
tagValue.val[0].data.value = ele.radioType;
that.postTemplateData.selectedVal.push(ele.options.find(item => item.key == ele.radioType).value);
}
} }
} }
...@@ -1417,10 +1542,10 @@ export default { ...@@ -1417,10 +1542,10 @@ export default {
newNum = 1; newNum = 1;
} }
// 天 // 天
if (code != 'tag020' && newNum > 365 && radio == 1) { if (code != 'tag020' && code != 'tag050' && newNum > 365 && radio == 1) {
newNum = 365; newNum = 365;
} }
if (code == 'tag020' && newNum > 730 && radio == 1) { if ((code == 'tag020' || code == 'tag050') && newNum > 730 && radio == 1) {
newNum = 730; newNum = 730;
} }
// 月 // 月
......
...@@ -598,6 +598,14 @@ ...@@ -598,6 +598,14 @@
</div> </div>
</div> </div>
</template> </template>
<!-- 单选属性 关联渠道-->
<template v-if="parent.templateCode == 'tag040'">
</template>
<!-- 最近关联时间 -->
<template v-if="parent.templateCode == 'tag020'">
</template>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -205,11 +205,11 @@ const router = new Router({ ...@@ -205,11 +205,11 @@ const router = new Router({
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const { keepAlive, componentName, fromPath } = to.meta || {}; const { keepAlive, componentName, fromPath } = to.meta || {};
if (keepAlive && fromPath.every(el => el != '/')) { if (keepAlive && Array.isArray(fromPath) && fromPath.every(el => el != '/')) {
fromPath.push('/'); fromPath.push('/');
} }
// 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存 // 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存
if (keepAlive && fromPath.every(el => el != from.path)) { if (keepAlive && Array.isArray(fromPath) && fromPath.every(el => el != from.path)) {
delCache(router.apps, componentName); delCache(router.apps, componentName);
} }
next(); next();
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
<i class="iconfont icon-shangc" /> <i class="iconfont icon-shangc" />
导入多标签值会员 导入多标签值会员
</el-button> </el-button>
<el-button type="primary" class="ghost-btn" @click="importTagValue" :limit-code="$buttonCode.importTagValueBtnCode" v-if="$getButtonLimit($buttonCode.importTagValueBtnCode)" >
<i class="iconfont icon-xiazai"/>
导出标签值
</el-button>
<el-button type="primary" class="ghost-btn" @click="exportMember"> <el-button type="primary" class="ghost-btn" @click="exportMember">
<i class="iconfont icon-xiazai" /> <i class="iconfont icon-xiazai" />
导出人群 导出人群
...@@ -90,7 +94,7 @@ import Trash from '@/components/Trash.vue'; ...@@ -90,7 +94,7 @@ import Trash from '@/components/Trash.vue';
import importDialog from './import-member-dialog.vue'; import importDialog from './import-member-dialog.vue';
import DeleteTagDialog from './delete-tag-dialog.vue'; import DeleteTagDialog from './delete-tag-dialog.vue';
/* eslint-disable */ /* eslint-disable */
import { getRequest, postForm } from '@/api/api'; import { getRequest, postForm, getRequestBlob } from '@/api/api';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
/** /**
* 通过excel导入会员的业务逻辑 2019-5-27 * 通过excel导入会员的业务逻辑 2019-5-27
...@@ -191,6 +195,31 @@ export default { ...@@ -191,6 +195,31 @@ export default {
} }
}, },
methods: { methods: {
// 导出标签值
importTagValue() {
// window.open(`http://www.gicdev.com/gic-member-tag-web/memberTag/exportMemberTag?requestProject=member-tag&tagId=${this.$route.query.tagId}&tagName=${this.$route.query.tagName}`);
// return
const paras = {
tagId: this.$route.query.tagId,
tagName: this.$route.query.tagName
}
getRequestBlob('/memberTag/exportMemberTag', paras).then(res=>{
if(res.status == '200') {
let blob = new Blob([res.data], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
});
// 3.创建一个临时的url指向blob对象
let objectUrl = window.URL.createObjectURL(blob);
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
let a = document.createElement("a");
a.setAttribute("href", objectUrl);
a.setAttribute("download", `${this.$route.query.tagName}-${new Date().toLocaleDateString()}`);
a.click();
// 5.释放这个临时的对象url
window.URL.revokeObjectURL(objectUrl);
}
})
},
// 添加和编辑标签值 // 添加和编辑标签值
addTagItem(tagItemId, tagItemName) { addTagItem(tagItemId, tagItemName) {
......
<template> <template>
<div class="group-list"> <div class="group-list" v-loading="memberGroupLoading">
<div class="search-box"> <div class="search-box">
<el-input v-model="listsParams.classifyName" clearable prefix-icon="el-icon-search" placeholder="请输入分类名称" @change="onSearch"></el-input> <el-input v-model="listsParams.classifyName" clearable prefix-icon="el-icon-search" placeholder="请输入分类名称" @change="onSearch"></el-input>
</div> </div>
...@@ -15,17 +15,15 @@ ...@@ -15,17 +15,15 @@
<i slot="reference" class="iconfont icon-gengduo icon"></i> <i slot="reference" class="iconfont icon-gengduo icon"></i>
</el-popover> </el-popover>
</li> </li>
<li > <!-- <li >
<div class="el-loading-spinner" style="width: 86%;" v-if="memberGroupLoading"> <div class="el-loading-spinner" style="width: 86%;" v-if="memberGroupLoading">
<!-- <svg viewBox="25 25 50 50" class="circular">
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
</svg> -->
<i class="el-icon-loading"></i> <i class="el-icon-loading"></i>
</div> </div>
</li> </li> -->
</ul> </ul>
<p v-if="searchTip" class="searchTip">没有找到和“{{ listsParams.classifyName }}”相关的内容</p>
<div v-if="$getButtonLimit($buttonCode.memberTagAddCateGory) && activeType == 1" class="add-category"> <div v-if="$getButtonLimit($buttonCode.memberTagAddCateGory) && activeType == 1" class="add-category">
<el-button @click="editDialog.visible = true" :limit-code="$buttonCode.memberTagAddCateGory" type="primary" class="ghost-btn add-group">新增分类</el-button> <el-button @click="editDialog.visible = true" :limit-code="$buttonCode.memberTagAddCateGory" type="primary" class="ghost-btn add-group" v-if="addType && lists.length">新增分类</el-button>
</div> </div>
<!--编辑分类--> <!--编辑分类-->
<el-dialog :title="editDialog.list.memberTagGroupClassifyId ? '编辑分类' : '新增分类'" :visible.sync="editDialog.visible" width="600px" top="30vh" :close-on-click-modal="false" @close="closeEditGroup"> <el-dialog :title="editDialog.list.memberTagGroupClassifyId ? '编辑分类' : '新增分类'" :visible.sync="editDialog.visible" width="600px" top="30vh" :close-on-click-modal="false" @close="closeEditGroup">
...@@ -51,6 +49,7 @@ export default { ...@@ -51,6 +49,7 @@ export default {
}, },
data() { data() {
return { return {
searchTip: false,
addGroupDialog: false, addGroupDialog: false,
listsParams: { listsParams: {
// type: '', // 类型 0:客户分组,1:固化分组 // type: '', // 类型 0:客户分组,1:固化分组
...@@ -67,8 +66,8 @@ export default { ...@@ -67,8 +66,8 @@ export default {
classifyName: '', classifyName: '',
list: {} list: {}
}, },
memberGroupLoading: false memberGroupLoading: false,
addType: true
}; };
}, },
...@@ -214,6 +213,17 @@ export default { ...@@ -214,6 +213,17 @@ export default {
this.memberGroupLoading = false; this.memberGroupLoading = false;
if (res.errorCode == 0) { if (res.errorCode == 0) {
const { result, totalPage } = res.result || {}; const { result, totalPage } = res.result || {};
if (this.listsParams.classifyName == '') {
this.searchTip = false;
this.addType = true;
} else if (this.listsParams.classifyName != '') {
this.addType = false;
if (result.length <= 0) {
this.searchTip = true;
}else {
this.searchTip = false;
}
}
if (pageNum == 1) { if (pageNum == 1) {
this.lists = []; this.lists = [];
} }
...@@ -245,7 +255,7 @@ export default { ...@@ -245,7 +255,7 @@ export default {
} else if (newVal == 3) { } else if (newVal == 3) {
this.$emit('second-list', 'allLevel'); this.$emit('second-list', 'allLevel');
} }
} },
} }
}; };
</script> </script>
...@@ -271,10 +281,19 @@ export default { ...@@ -271,10 +281,19 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.icon { .icon {
display: inline-block;
width: 16px;
height: 16px;
padding: 1px;
border-radius: 2px;
margin: 0 4px; margin: 0 4px;
} }
&:hover { &:hover {
color: #2F54EB; color: #2F54EB;
background: #F2F3F5;
.icon:hover {
background: RGBA(229, 230, 235, 1);
}
} }
.name-txt { .name-txt {
display: inline-block; display: inline-block;
...@@ -290,23 +309,22 @@ export default { ...@@ -290,23 +309,22 @@ export default {
overflow-y: auto; overflow-y: auto;
.active-li { .active-li {
color: #2F54EB; color: #2F54EB;
background-color: #EBEFFE; background-color: #ebeffe;
.icon { .wrap span{
color: #2f54eb; padding-left: 6px;
color: #2f54eb;
}
.icon:hover {
background: #d8defc;
} }
} }
.wrap span{ .wrap span{
padding-left: 6px; padding-left: 6px;
color: #303133; color: #303133;
} }
li:hover {
background-color: #EBEFFE;
.icon {
color: #2f54eb;
}
}
} }
.more { .more {
line-height: 26px; line-height: 26px;
text-align: center; text-align: center;
...@@ -315,4 +333,11 @@ export default { ...@@ -315,4 +333,11 @@ export default {
color: #2f54eb; color: #2f54eb;
} }
} }
.searchTip {
width: 100%;
text-align: center;
margin-top: 80%;
color: #909399;
font-size: 14px;
}
</style> </style>
...@@ -660,6 +660,7 @@ export default { ...@@ -660,6 +660,7 @@ export default {
// 获取一个标签分类下面的标签数据 // 获取一个标签分类下面的标签数据
getTagsGroupList() { getTagsGroupList() {
const tagType = this.activeTag == 'system' ? 0 : this.activeTag == 'manual' ? 1 : 2; const tagType = this.activeTag == 'system' ? 0 : this.activeTag == 'manual' ? 1 : 2;
console.log(this.searchData, 'this.searchData');
const params = { const params = {
requestProject: 'gic-member-tag-web', requestProject: 'gic-member-tag-web',
search: this.searchData || null, // 模糊查询的标签名 search: this.searchData || null, // 模糊查询的标签名
......
...@@ -1072,6 +1072,7 @@ export default { ...@@ -1072,6 +1072,7 @@ export default {
return false; return false;
} else { } else {
this.operateNumber = val; this.operateNumber = val;
console.log(val, 'val');
this.batchVisiable = true; this.batchVisiable = true;
} }
}, },
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
style="width: 260px;float: left;margin-left: 0" style="width: 260px;float: left;margin-left: 0"
v-model="memberTag" v-model="memberTag"
@keyup.native.enter="searchMemberList" @keyup.native.enter="searchMemberList"
@blur="searchMemberList" @change="searchMemberList"
@clear="allTagList" @clear="allTagList"
clearable clearable
></el-input> ></el-input>
...@@ -609,7 +609,7 @@ export default { ...@@ -609,7 +609,7 @@ export default {
try { try {
const params = { const params = {
requestProject: 'gic-member-tag-web', requestProject: 'gic-member-tag-web',
search: opt.searchName || null, // 标签名 search: opt.searchName || null || this.memberTag, // 标签名
tagLevelGroupId: opt.id || '', // 标签层级 tagLevelGroupId: opt.id || '', // 标签层级
tagType, // 标签类型 tagType, // 标签类型
showMemberCount: 1, // 覆盖人数 showMemberCount: 1, // 覆盖人数
...@@ -667,8 +667,8 @@ export default { ...@@ -667,8 +667,8 @@ export default {
}, },
// 模糊查询会员标签 // 模糊查询会员标签
searchMemberList() { searchMemberList(e) {
console.log(this.activeTag); // console.log(this.activeTag);
if (this.memberTag) { if (this.memberTag) {
this.tagName = this.memberTag; this.tagName = this.memberTag;
} else { } else {
...@@ -677,7 +677,8 @@ export default { ...@@ -677,7 +677,8 @@ export default {
// this.handTag = null; // this.handTag = null;
this.loadMemberTagList({ this.loadMemberTagList({
searchName: this.memberTag, searchName: this.memberTag,
showSearchResult: true showSearchResult: true,
id: this.groupId
}); });
this.pageNum = 1; this.pageNum = 1;
// this.handTag = null; // this.handTag = null;
......
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
localStorage.setItem('jumpThirdTag', ''); localStorage.setItem('jumpThirdTag', '');
this.$router.push({ this.$router.push({
path: '/manualTagValueEdit', path: '/manualTagValueEdit',
query: { tagId: list.tagId, type: 'manual' } query: { tagId: list.tagId,tagName: list.tagName, type: 'manual' }
}); });
}, },
deleteHandTag(list, index, e) { deleteHandTag(list, index, e) {
......
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