Commit a4fdc237 by caoyanzhi

Merge branch 'dev' of http://115.159.76.241/memberTag/memberTag-web into dev-dingdang

parents ce296e1d ffaeb011
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,6 +18,7 @@
"element-ui": "^2.3.9",
"file-saver": "^1.3.8",
"tinymce": "^4.8.3",
"vant": "^1.6.13",
"vue": "^2.5.2",
"vue-clipboard2": "^0.2.0",
"vue-router": "^3.0.1",
......
<template>
<div class="birth-select">
<div class="start-date date-block">
<el-select v-model="startVal[0]" style="width: 100px" placeholder="月份" @change="handleStartMonthChange">
<el-option v-for="item in MonthList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
<span class="space"></span>
<el-select v-model="startVal[1]" style="width: 100px" placeholder="日期" @change="handleStartDateChange">
<el-option v-for="item in startDateList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
</div>
<span class="range"></span>
<div class="end-date date-block">
<el-select v-model="endVal[0]" style="width: 100px" placeholder="月份" @change="handleEndMonthChange">
<el-option v-for="item in MonthList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
<span class="space"></span>
<el-select v-model="endVal[1]" style="width: 100px" placeholder="日期" @change="handleEndDateChange">
<el-option v-for="item in endDateList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
</div>
</div>
</template>
<script>
export default {
name: 'GicSelect',
props: {
dateval: [String, Array]
},
data() {
return {
startVal: ['', ''],
endVal: ['', ''],
// 月份
MonthList: [
{ key: 1, value: '01', label: '1月' },
{ key: 2, value: '02', label: '2月' },
{ key: 3, value: '03', label: '3月' },
{ key: 4, value: '04', label: '4月' },
{ key: 5, value: '05', label: '5月' },
{ key: 6, value: '06', label: '6月' },
{ key: 7, value: '07', label: '7月' },
{ key: 8, value: '08', label: '8月' },
{ key: 9, value: '09', label: '9月' },
{ key: 10, value: '10', label: '10月' },
{ key: 11, value: '11', label: '11月' },
{ key: 12, value: '12', label: '12月' }
],
// 日期
daysList: [['01', '03', '05', '07', '08', '10', '12'], ['02'], ['04', '06', '09', '11']],
startDateList: [
{ key: 1, value: '01', label: '1日' },
{ key: 2, value: '02', label: '2日' },
{ key: 3, value: '03', label: '3日' },
{ key: 4, value: '04', label: '4日' },
{ key: 5, value: '05', label: '5日' },
{ key: 6, value: '06', label: '6日' },
{ key: 7, value: '07', label: '7日' },
{ key: 8, value: '08', label: '8日' },
{ key: 9, value: '09', label: '9日' },
{ key: 10, value: '10', label: '10日' },
{ key: 11, value: '11', label: '11日' },
{ key: 12, value: '12', label: '12日' },
{ key: 13, value: '13', label: '13日' },
{ key: 14, value: '14', label: '14日' },
{ key: 15, value: '15', label: '15日' },
{ key: 16, value: '16', label: '16日' },
{ key: 17, value: '17', label: '17日' },
{ key: 18, value: '18', label: '18日' },
{ key: 19, value: '19', label: '19日' },
{ key: 20, value: '20', label: '20日' },
{ key: 21, value: '21', label: '21日' },
{ key: 22, value: '22', label: '22日' },
{ key: 23, value: '23', label: '23日' },
{ key: 24, value: '24', label: '24日' },
{ key: 25, value: '25', label: '25日' },
{ key: 26, value: '26', label: '26日' },
{ key: 27, value: '27', label: '27日' },
{ key: 28, value: '28', label: '28日' },
{ key: 29, value: '29', label: '29日' },
{ key: 30, value: '30', label: '30日' },
{ key: 31, value: '31', label: '31日' }
],
endDateList: [
{ key: 1, value: '01', label: '1日' },
{ key: 2, value: '02', label: '2日' },
{ key: 3, value: '03', label: '3日' },
{ key: 4, value: '04', label: '4日' },
{ key: 5, value: '05', label: '5日' },
{ key: 6, value: '06', label: '6日' },
{ key: 7, value: '07', label: '7日' },
{ key: 8, value: '08', label: '8日' },
{ key: 9, value: '09', label: '9日' },
{ key: 10, value: '10', label: '10日' },
{ key: 11, value: '11', label: '11日' },
{ key: 12, value: '12', label: '12日' },
{ key: 13, value: '13', label: '13日' },
{ key: 14, value: '14', label: '14日' },
{ key: 15, value: '15', label: '15日' },
{ key: 16, value: '16', label: '16日' },
{ key: 17, value: '17', label: '17日' },
{ key: 18, value: '18', label: '18日' },
{ key: 19, value: '19', label: '19日' },
{ key: 20, value: '20', label: '20日' },
{ key: 21, value: '21', label: '21日' },
{ key: 22, value: '22', label: '22日' },
{ key: 23, value: '23', label: '23日' },
{ key: 24, value: '24', label: '24日' },
{ key: 25, value: '25', label: '25日' },
{ key: 26, value: '26', label: '26日' },
{ key: 27, value: '27', label: '27日' },
{ key: 28, value: '28', label: '28日' },
{ key: 29, value: '29', label: '29日' },
{ key: 30, value: '30', label: '30日' },
{ key: 31, value: '31', label: '31日' }
]
};
},
methods: {
//
handleMonthValue(position, val) {
const WM = this.daysList.findIndex((item, i) => {
return item.includes(val);
});
if (position == 'start') {
this.handleChangeData(this.startDateList, WM);
} else if (position == 'end') {
this.handleChangeData(this.endDateList, WM);
}
},
handleChangeData(data, inx) {
const length = data.length; // 31 29 30
if (inx == 0) {
// 31天
this.handleLength(length, data, 0);
} else if (inx == 2) {
// 如果升级 30天
this.handleLength(length, data, 1);
} else {
// 29天
this.handleLength(length, data, 2);
}
},
handleLength(length, data, days) {
if (length == 31) {
if (days == 0) {
return;
} else if (days == 1) {
data.pop();
} else if (days == 2) {
data.splice(29, 2);
}
} else if (length == 30) {
if (days == 0) {
data.push({ key: 31, value: '31', label: '31日' });
} else if (days == 1) {
return;
} else if (days == 2) {
data.splice(29, 1);
}
} else if (length == 29) {
if (days == 0) {
data.push({ key: 30, value: '30', label: '30日' });
data.push({ key: 31, value: '31', label: '31日' });
} else if (days == 1) {
data.push({ key: 30, value: '30', label: '30日' });
} else if (days == 2) {
return;
}
}
},
// 开始月份
handleStartMonthChange(val) {
this.handleMonthValue('start', val);
this.handleDate();
this.$emit('change');
},
handleStartDateChange(val) {
this.handleDate();
this.$emit('change');
},
handleEndMonthChange(val) {
this.handleMonthValue('end', val);
this.handleDate();
this.$emit('change');
},
handleEndDateChange(val) {
this.handleDate();
this.$emit('change');
},
handleDate() {
if (!this.startVal[0] || !this.startVal[0] || !this.endVal[0] || !this.endVal[1]) {
return;
}
const start = this.startVal.join('');
const end = this.endVal.join('');
if (start - end > 0) {
this.$message.warning('开始生日日期不能大于结束日期');
this.$emit('update:dateval', '');
return;
}
const value = [start, end];
this.$emit('update:dateval', value);
},
// 回显数据
replay(start, end) {
this.startVal[0] = start.slice(0, 2);
this.startVal[1] = start.slice(2, 4);
this.endVal[0] = end.slice(0, 2);
this.endVal[1] = end.slice(2, 4);
}
},
created() {
if (this.dateval[0] && this.dateval[1]) {
this.replay(this.dateval[0], this.dateval[1]);
}
}
};
</script>
<style lang="scss" scoped>
.birth-select {
.date-block {
display: inline-block;
.space {
display: inline-block;
width: 10px;
}
}
.range {
display: inline-block;
vertical-align: middle;
width: 30px;
height: 32px;
line-height: 32px;
font-size: 12px;
text-align: center;
}
}
</style>
......@@ -31,7 +31,8 @@ Vue.use(vueGicAsideMenu);
Vue.use(vueGicHeader); */
// Vue.use(vueGicDatepicker);
Vue.config.productionTip = false;
Vue.config.devtools = true;
// Vue.config.productionTip = true;
// Vue.use(ElementUI, { size: 'large' });
Vue.use(VueAxios, axios);
Vue.axios.defaults.withCredentials = true; // 跨域cookie访问
......@@ -87,3 +88,5 @@ new Vue({
components: { App },
template: '<App/>'
});
console.log(Vue.config);
\ No newline at end of file
......@@ -65,3 +65,41 @@ export const memberGroupList = params =>
method: 'get',
params: params
});
// 会员分组分类 新增 编辑 memberTagGroupClassifyId 新增不需要,编辑需要
export const memberGroupModify = params =>
request({
url: '/member-tag-group-classify/save',
method: 'get',
params: params
});
// 会员分组删除分类
export const memberGroupDelete = params =>
request({
url: '/member-tag-group-classify/delete',
method: 'get',
params: params
});
export const recommendGroupList = () =>
request({
url: '/member-tag-group-recommend/list?requestProject=gic-member-tag-web',
method: 'get'
});
// 推荐会员分组-列表
export const recommendList = params =>
request({
url: '/member-tag-group-recommend/group',
method: 'get',
params: params
});
// 会员分组查列表第二级别
export const findSecondMemberList = params =>
request({
url: '/member-tag-group/findList.json',
method: 'get',
params: params
});
import request from './index';
// 会员 /memberTag/getTagById
export const getTagType = params =>
request({
url: '/memberTag/getTagById',
method: 'get',
params: params
});
// 获取模板
export const findWidget = params =>
request({
url: '/memberTag/findWidget',
method: 'get',
params: params
});
export const findOndJson = params =>
request({
url: '/member-tag-value/findOne.json',
method: 'get',
params
});
......@@ -120,10 +120,11 @@ export function export_table_to_excel(id) {
function formatJson(jsonData) {
console.log(jsonData)
}
export function export_json_to_excel(th, jsonData, defaultTitle) {
/* original data */
console.log(jsonData);
var data = jsonData;
data.unshift(th);
var ws_name = "SheetJS";
......
......@@ -2366,6 +2366,7 @@ export default {
// 获取 columnKey
// if (!!resData.result.columnKey) {
that.currentKey = resData.result.columnKey;
console.log(resData.result);
// }else {
// that.currentKey = resData.result.tagId;
// }
......
......@@ -23,9 +23,9 @@
<el-form-item label="标签描述" prop="tagDescribe" class="w-560">
<el-input :disabled="!tagEditFlag" class="w-447" type="textarea" v-model="ruleForm.tagDescribe" style="height: 96px;" @focus="focus('tagDescribe', 200)" @keyup.native="value => toInput(value)">
</el-input>
<template
><label class="input-label textarea-label">{{ inputNumObj.tagDescribe }}/200</label></template
>
<template>
<label class="input-label textarea-label">{{ inputNumObj.tagDescribe }}/200</label>
</template>
</el-form-item>
<el-form-item label="" class="font-0">
<el-button type="primary" @click.stop="confirmSave('ruleForm')" v-if="tagEditFlag">保存</el-button>
......@@ -88,21 +88,7 @@
>
删除
</el-button>
<!-- <el-popover
v-if="!scope.row.editAble && scope.row.status != 5"
placement="top"
width="160"
v-model="scope.row.popVisible">
<p style="line-height: 1.5; padding: 10px 10px 20px;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancelDelTag(scope.$index,scope.row)">取消</el-button>
<el-button type="primary" size="mini" @click="toDelTag(scope.$index,scope.row)">确定</el-button>
</div> -->
<!-- <el-button slot="reference" class="p-l-20" type="text">
删除
</el-button> -->
<!-- <el-button type="text" size="small" class="" @click="confirmDel(scope.$index,scope.row)">删除</el-button> -->
<!-- </el-popover> -->
<el-button v-if="scope.row.status == 5" type="text" size="small" class="">删除中</el-button>
<el-button v-if="scope.row.editAble" type="text" @click.stop="confirmEdit(scope.$index, scope.row)">确认</el-button>
......@@ -124,8 +110,6 @@
@selectIndex="setSelectIndex"
@clearOldData="clearOldData"
>
<!-- :failHead="scope.row.header"
:failData="scope.row.data" -->
</upload-excel-component>
</template>
<template v-if="excelExistIndex == scope.$index && !!currentExcelHeader.length">
......@@ -135,21 +119,6 @@
<div class="flex-1">
<span class="p-r-8 color-303133">{{ currentExcelName }}</span
><span class="p-l-8 border-l-dcdfe6 color-1890ff excel-upload__del" @click.stop="clearOldData(scope.$index, scope.row)">删除</span>
<!-- <el-popover
v-if="!scope.row.editAble"
placement="top"
width="160"
v-model="scope.row.popVisible">
<p style="line-height: 1.5; padding: 10px 10px 20px;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancelDelTag(scope.$index,scope.row)">取消</el-button>
<el-button type="primary" size="mini" @click="toDelCate(scope.$index,scope.row)">确定</el-button>
</div>
<el-button slot="reference" class="p-l-20" type="text">
删除
</el-button>
<el-button slot="reference" type="text" size="small" :disabled="!scope.row.enterpriseId? true: false" class="">删除</el-button>
</el-popover> -->
</div>
<div class="flex-1 color-909399 font-12 m-t-05">已导入会员 {{ currentExcelData.length }}</div>
</div>
......@@ -160,11 +129,7 @@
<el-table-column label=" " width="220px" class-name="no-right-border">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.optType">清空标签历史标记会员</el-checkbox>
<!-- <el-tooltip class="item" effect="light" content="" placement="top">
<div slot="content">勾选此选项之后,此前被本标签标记的会员将移除此标签,此标签标记会员以本次导入为准。
</div>
<i class="el-icon-question"></i>
</el-tooltip> -->
<el-popover placement="top-end" width="200" trigger="hover">
<span>勾选后,此前被该标签标记的会员将移除此标签,此标签标记会员以本次导入为准。</span>
<i slot="reference" class="iconfont icon-xinxixianshi"></i>
......@@ -185,23 +150,6 @@
</div>
</div>
<vue-gic-footer></vue-gic-footer>
<!-- 保存 -->
<!-- <div class="manualTagEdit-wrap__footer">
<el-button @click.stop="cancelSave">取消</el-button>
<el-button type="primary" @click.stop="confirmSave">保存</el-button>
</div> -->
<!-- 上传后弹窗 -->
<!-- <el-dialog
title="提示"
:visible.sync="uploadedVisible"
width="30%"
:before-close="handleClose">
<p></p>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="uploadedVisible = false">确 定</el-button>
</span>
</el-dialog> -->
</div>
</template>
<script>
......@@ -233,16 +181,10 @@ export default {
tagLevelGroupId: [{ required: true, message: '请选择所属分类', trigger: 'blur' }]
},
optionsTwo: [
// {
// value: '1',
// label: '二级分类'
// }
],
optionsThree: [
// {
// value: '1',
// label: '未分类'
// }
],
inputNumObj: {
tagName: 0,
......@@ -258,15 +200,7 @@ export default {
currentExcelData: [], // 当前上传 excel 内容的数据
currentExcelHeader: [], // 当前上传 excel 标题的数据
tagValTableData: [
// {
// tagItemId: 1,
// tagItemName: '标签值1',
// inputValue: '', // 编辑输入框的值
// editAble: false, // 是否在编辑
// optType: true, // 是否选择清空已有标签
// status: 0, // 记录上传的状态
// popVisible: false
// },
],
// 上传后
uploadedVisible: false,
......@@ -751,16 +685,16 @@ export default {
const that = this
require.ensure([], () => {
const { export_json_to_excel } = require('@/vendor/Export2Excel')
const tHeader = ['mobile','cardNum'];
const filterVal = ['mobile','cardNum'];
const tHeader = ['手机号','卡号'];
const filterVal = ['手机号','卡号'];
const list = [
{
cardNum: "jhdm2018071315",
mobile: "17098078224"
卡号: "jhdm2018071315",
手机号: "17098078224"
},
{
cardNum: "jhdm20180608000000003",
mobile: "13100000055"
卡号: "jhdm20180608000000003",
手机号: "13100000055"
}
];
if (!list.length) {
......
<template>
<div class="group-list">
<ul>
<li></li>
</ul>
<div class="member-group">
<i class="icon-list el-icon-caret-top icon-transform" :class="expendClass" @click="handleExpend"></i>
我的会员分组
<i class="el-icon-plus icon-right icon-list" @click="addGroupDialog = true"></i>
</div>
<el-collapseTransition>
<ul class="lists" v-show="expendTxt == '展开'">
<li v-for="(list, i) in lists" :key="i" class="member-list" :class="{ 'active-li': i == currentIndex }" @click="handleChangeIndex(i, list)">
<span v-show="!list.edit">{{ list.classifyName }}</span>
<el-input style="width: 100px;" size="mini" v-show="list.edit" v-model="list.classifyName" @keyup.native.enter="modifyName(list)" />
<div class="oper-area">
<i class="el-icon-edit icon-list icon-list-oper" @click="editGroupName(list)"></i>
<i class="icon-list el-icon-circle-close icon-list-oper" @click="deleteGroupName(list)"></i>
</div>
</li>
</ul>
</el-collapseTransition>
<div class="recommend-list" :class="{ 'recommend-active': active }" @click="getRecommendList">
推荐会员分组
</div>
<el-dialog :title="title" :visible.sync="addGroupDialog" width="320px" top="30vh" :close-on-click-modal="false">
<div>
分组名称:
<el-input style="width: 200px;" placeholder="请输入分组名称" v-model="groupName" :maxlength="10" clearable></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addGroupDialog = false">取 消</el-button>
<el-button type="primary" @click="handleGroupDialog">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Vue from 'vue';
import { CollapseTransition } from 'element-ui';
import { memberGroupList, memberGroupModify, memberGroupDelete } from '@/request/api';
Vue.component(CollapseTransition.name, CollapseTransition);
export default {
name: 'group-list',
data() {
return {
lists: [],
addGroupDialog: false,
expendTxt: '展开',
groupName: '',
title: '新增分组名称',
currentIndex: -1,
active: false
};
},
computed: {
expendClass() {
if (this.expendTxt != '展开') {
return 'is-caret';
} else {
return '';
}
}
},
methods: {
handleChangeIndex(i, list) {
this.active = false;
this.currentIndex = i;
// 第二级的分组数据
this.$emit('second-list', list);
},
/**
* 修改和删除分组
*/
editGroupName(list) {
if (!this.operatorName(list)) {
return;
}
list.edit = true;
},
// 删除
deleteGroupName(list) {
if (!this.operatorName(list)) {
return;
}
this.$confirm('是否删除分组名称?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
// 删除操作
this.excludeName(list);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
excludeName(list) {
const param = {
requestProject: 'gic-member-tag-web',
memberTagGroupClassifyId: list.memberTagGroupClassifyId
};
memberGroupDelete(param).then(res => {
if (res.errorCode == 1) {
this.getMemberGroupList();
this.$message({
type: 'success',
message: '删除成功!'
});
}
});
},
// 修改分组名称
modifyName(list) {
if (!list.classifyName) {
this.$message({
message: `分组名称不能为空!`,
type: 'warning',
duration: 2000
});
return;
}
const param = {
requestProject: 'gic-member-tag-web',
classifyName: list.classifyName,
memberTagGroupClassifyId: list.memberTagGroupClassifyId
};
memberGroupModify(param).then(res => {
if (res.errorCode == 1) {
list.edit = false;
this.getMemberGroupList();
this.$message({
type: 'success',
message: '修改成功',
duration: 2000
});
}
});
},
operatorName(list) {
if (list.memberTagGroupClassifyId == '0') {
this.$message({
message: `${list.classifyName}的不能操作`,
type: 'warning',
duration: 2000
});
return false;
}
return true;
},
/**
* 新增会员分组分类
*/
handleGroupDialog() {
if (!this.groupName) {
this.$message({
type: 'warning',
message: '分组名称不能为空'
});
return;
}
const param = {
requestProject: 'gic-member-tag-web',
classifyName: this.groupName
};
memberGroupModify(param).then(res => {
if (res.errorCode == 1) {
this.getMemberGroupList();
this.addGroupDialog = false;
this.$message({
type: 'success',
message: '添加成功'
});
}
});
},
/**
* 会员分组分类
*/
getMemberGroupList() {
memberGroupList({
requestProject: 'gic-member-tag-web'
}).then(res => {
if (res.errorCode === 1) {
this.lists = res.result.map(el => ({
...el,
edit: false
}));
}
});
},
// 收起
handleExpend() {
this.expendTxt = this.expendTxt === '展开' ? '收起' : '展开';
},
getRecommendList() {
this.active = true;
this.currentIndex = -1;
this.$emit('getRecommend');
}
},
beforeMount() {
this.getMemberGroupList();
}
};
</script>
<style lang="scss" scoped>
.group-list {
padding-top: 20px;
.recommend-list {
margin-top: 10px;
padding-left: 37px;
line-height: 30px;
font-size: 14px;
font-weight: bold;
color: #303133;
cursor: pointer;
}
}
.member-group {
padding: 5px 10px 20px 20px;
font-size: 14px;
color: #303133;
font-weight: bold;
cursor: pointer;
.icon-right {
float: right;
}
.icon-list {
color: #c0c4cc;
}
}
.member-list {
height: 32px;
line-height: 32px;
padding-left: 37px;
font-size: 14px;
color: #606266;
cursor: pointer;
&:hover {
background-color: #f3f6f9;
.oper-area {
display: inline;
}
}
.oper-area {
display: none;
float: right;
margin-right: 10px;
}
}
.active-li {
background-color: #f3f6f9;
}
.icon-list-oper {
color: #c0c4cc;
margin: 0 3px;
}
.icon-transform {
transition: transform 0.3s;
transform: rotate(180deg);
&.is-caret {
transform: rotate(0deg);
}
}
.recommend-active {
background-color: #f3f6f9;
}
</style>
......@@ -3,9 +3,11 @@
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<!-- 左边的会员分组 -->
<div class="group-list"></div>
<div class="left-box">
<group-list @getRecommend="getRecommend" @second-list="getsecondList"></group-list>
</div>
<!-- 右边的表格 -->
<div class="right-box">
<div class="right-box" v-show="!isRecommend">
<div class="common-wrap__opt">
<el-input class="w-220 m-r-8" placeholder="请输入关键字搜索人群" prefix-icon="el-icon-search" v-model="tagSearch" clearable @clear="clearSearch" @keyup.enter.native="searchEnterFun"> </el-input>
<el-select v-model="statusSelect" @change="searchByStatus" placeholder="请选择" class="w-220 m-l-0">
......@@ -13,10 +15,18 @@
<el-option :key="1" label="有效" :value="1"> </el-option>
<el-option key="" label="全部" value=""> </el-option>
</el-select>
<el-button type="primary" @click="toAddGroup" class="fr">新增分组</el-button>
<div class="batch-option">
<el-select v-model="batchSelect" @change="batchHandleSelect" style="width: 150px;" placeholder="批量操作" class="w-220 m-l-0">
<el-option :key="0" label="失效" :value="0"> </el-option>
<el-option :key="1" label="删除" :value="1"> </el-option>
<el-option :key="2" label="修改所属分类" :value="2"> </el-option>
</el-select>
<el-button type="primary" @click="toAddGroup" class="fr">新增分组</el-button>
</div>
</div>
<div class="common-wrap__table m-t-20">
<el-table v-loading="loading" :row-class-name="setRowClassName" ref="multipleTable" :data="groupTableData" tooltip-effect="dark" style="width: 100%">
<el-table v-loading="loading" :row-class-name="setRowClassName" ref="multipleTable" :data="groupTableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column label="分组名称" width="150px">
<template slot-scope="scope">
<el-popover placement="top-start" width="200" trigger="hover">
......@@ -63,7 +73,13 @@
><!-- width="150px" -->
<template slot="header">
覆盖人数
<i class="el-icon-more"></i>
<el-popover placement="top-start" width="200" trigger="hover">
<div>
默认显示上次页面缓存人数,可点击刷新按钮查看当页分组最新人数。
</div>
<el-button type="text" @click="getGroupList">刷新</el-button>
<i slot="reference" class="el-icon-more icon-transform-nine"></i>
</el-popover>
</template>
<template slot-scope="scope">
......@@ -92,7 +108,7 @@
</el-table-column>
<el-table-column label="操作" width="257px">
<template slot-scope="scope">
<el-button type="text" size="small" class="p-r-12" v-if="scope.row.effectiveStatus == 1" @click="toInvalid(scope.row)">失效</el-button>
<!-- <el-button type="text" size="small" class="p-r-12" v-if="scope.row.effectiveStatus == 1" @click="toInvalid(scope.row)">失效</el-button> -->
<router-link
:to="{
path: '/memberGroupDetail',
......@@ -110,11 +126,11 @@
class="edit-btn el-button--text p-r-12"
>编辑</router-link
>
<el-button type="text" size="small" class="p-r-12" @click="toDelTag(scope.row, scope.$index)">删除</el-button>
<!-- <el-button type="text" size="small" class="p-r-12" @click="toDelTag(scope.row, scope.$index)">删除</el-button>
<el-popover placement="top" width="50" trigger="hover">
刷新覆盖人数
<el-button slot="reference" type="text" size="small" @click="refreshGroup(scope.row)">刷新</el-button>
</el-popover>
</el-popover> -->
</template>
</el-table-column>
</el-table>
......@@ -133,6 +149,14 @@
</el-pagination>
</div>
</div>
<div class="right-box recommend-box" v-show="isRecommend">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane :label="item.recommendName" :name="item.recommendName" v-for="item in recommendItems" :key="item.tagGroupRecommendId">
<recommend-table :data="recommendData"></recommend-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
<vue-gic-footer></vue-gic-footer>
</div>
......@@ -146,17 +170,26 @@ import errMsg from '@/common/js/error';
import timeFormat from '@/common/js/timeFormat';
import { _debounce } from '@/common/js/public';
import { getRequest } from '@/api/api';
import { memberGroupList } from '@/request/api';
import { recommendList, recommendGroupList, findSecondMemberList } from '@/request/api';
import GroupList from './group-list';
import RecommendTable from './recommend-table';
// import { memberGroupList } from '@/request/api';
// import groupTransfer from '@/components/groupTransfer';
export default {
name: 'memberGroupList',
components: {
// groupTransfer,
navCrumb
navCrumb,
GroupList,
RecommendTable
},
data() {
return {
dialogVisible: true,
isRecommend: false,
recommendItems: [],
recommendData: [], // 推荐分组的数据
activeName: '',
// 面包屑参数
navpath: [
{
......@@ -185,12 +218,13 @@ export default {
total: 0,
groupSetShow: false,
loading: false,
statusSelect: ''
statusSelect: '',
batchSelect: ''
};
},
created() {
this.loading = true;
this.getMemberGroupList();
// this.getMemberGroupList();
},
filters: {
formatTimeYMD(data) {
......@@ -221,6 +255,89 @@ export default {
}
},
methods: {
// 会员分组二级
getsecondList(list) {
const param = {
pageNum: 1,
pageSize: 20,
requestProject: 'gic-member-tag-web',
memberTagGroupClassifyId: list.memberTagGroupClassifyId
};
findSecondMemberList(param).then(res => {
if (res.errorCode == 1) {
this.groupTableData = res.result.result.map(el => ({
...el,
createTime: timeFormat.timeToDateTime(el.createTime)
}));
} else {
this.groupTableData = [];
}
}).catch(err => {
console.log(err);
});
},
// 切换推荐分组
handleTabClick(instance) {
let tabId = this.checkTabIndex(instance);
if (tabId) {
this.getRecommendList(tabId);
}
},
// 查找列表请求需要的id
checkTabIndex(instance) {
let index = this.recommendItems.findIndex(el => el.recommendName == instance.name);
if (index >= 0) {
return this.recommendItems[index].tagGroupRecommendId;
}
},
// 推荐分组
getRecommend() {
this.isRecommend = true;
recommendGroupList().then(res => {
if (res.errorCode == 1) {
this.recommendItems = res.result;
if (this.recommendItems && this.recommendItems.length) {
this.activeName = this.recommendItems[0].recommendName;
// 查第一个列表的数据
this.getRecommendList(this.recommendItems[0].tagGroupRecommendId);
} else {
this.recommendItems = [];
}
}
}).catch(err => {
console.log(err);
});
},
/**
* 推荐分组列
*/
getRecommendList(id) {
const param = {
tagGroupRecommendId: id,
requestProject: 'gic-member-tag-web',
};
recommendList(param).then(res => {
if (res.errorCode == 1) {
this.recommendData = res.result;
} else {
this.recommendData = [];
}
}).catch(err => {
console.log(err);
});
},
// 勾选框全选
handleSelectionChange() {
},
/**
* 批量操作
*/
batchHandleSelect(val) {
},
setRowClassName({ row, rowIndex }) {
// console.log(row, rowIndex);
},
......@@ -228,8 +345,7 @@ export default {
*
*/
showGroupSet() {
const that = this;
that.groupSetShow = true;
this.groupSetShow = true;
},
/**
......@@ -243,17 +359,15 @@ export default {
* 新增分组
*/
toAddGroup() {
const that = this;
that.changeRoute('/memberGroupEdit');
this.changeRoute('/memberGroupEdit');
},
/**
* 搜索分组清空
*/
clearSearch() {
const that = this;
that.currentPage = 1;
that.getGroupList();
this.currentPage = 1;
this.getGroupList();
},
/**
......@@ -498,16 +612,6 @@ export default {
message: error.message
});
});
},
/**
* 会员分组分类
*/
getMemberGroupList() {
memberGroupList({
requestProject: 'gic-member-tag-web'
}).then(res => {
console.log(res);
});
}
},
mounted() {
......@@ -526,4 +630,21 @@ export default {
height: 18px;
line-height: 18px;
}
.right-content {
display: flex;
.left-box {
flex: 0 0 200px;
background-color: #fff;
border-right: 1px solid rgba(220,223,230,1);
}
.right-box {
flex: 1;
.batch-option {
float: right;
.fr {
margin-left: 10px;
}
}
}
}
</style>
<template>
<el-table :data="tableData">
<el-table-column label="查看详情" type="expand" width="200"> </el-table-column>
<el-table-column prop="groupName" label="分组名称"> </el-table-column>
<el-table-column prop="describle" label="分组描述"> </el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="createMemberGroup(scope)">创建会员分组</el-button>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
name: 'recommend-table',
props: {
data: Array
},
data() {
return {
tableData: []
};
},
watch: {
data: {
immediate: true,
handler(newval) {
this.tableData = newval;
}
}
},
methods: {
createMemberGroup(list) {
console.log(list);
}
}
};
</script>
......@@ -909,6 +909,7 @@ export default {
let newTempVal = newTemp.val[0];
let newTime = newTemp.time;
that.currentComputeType = parseInt(newTempVal.compute.computeType);
// 计算控件
if (parseInt(newTempVal.compute.computeType) === 0 && !!newTempVal.compute.computeWidgetId) {
that.getTemplateCodeById(newTempVal.compute.computeWidgetId);
......@@ -956,6 +957,7 @@ export default {
if (resData.errorCode == 1) {
// 返回字段否追加对应 模板数据对象上
for (let key in resData.result) {
console.log(that[resData.result.templateCode][key], resData.result[key]);
that[resData.result.templateCode][key] = resData.result[key];
}
// 如果是城市
......@@ -981,6 +983,7 @@ export default {
return false;
}
that.templateData.push(that[resData.result.templateCode]);
// 获取已存数据
that.getExistData(that.tagData.tagId);
if (resData.result.templateCode === 'tag009' || resData.result.templateCode === 'tag010') {
......@@ -1147,6 +1150,7 @@ export default {
// 获取 columnKey
that.currentKey = resData.result.columnKey;
let templateObj = resData.result.template;
if (!!templateObj) {
that.checkTagTemplate(templateObj.templateContent);
}
......
......@@ -104,21 +104,25 @@ export default {
},
async loadMemberTagList(opt) {
const params = {
requestProject: 'gic-member-tag-web',
search: opt.searchName || null, // 标签名
tagLevelGroupId: opt.id || 0, // 标签层级
tagType: opt.type || null, // 标签类型
pageNum: this.pageNum,
pageSize: this.pageSize
};
const Data = await getMemberTagList(params);
if (Data.result.result && Data.result.result.length) {
this.memberTagList = Data.result.result;
this.total = Data.result.totalCount;
} else {
this.memberTagList = [];
this.total = 0;
try {
const params = {
requestProject: 'gic-member-tag-web',
search: opt.searchName || null, // 标签名
tagLevelGroupId: opt.id || 0, // 标签层级
tagType: opt.type || null, // 标签类型
pageNum: this.pageNum,
pageSize: this.pageSize
};
const Data = await getMemberTagList(params);
if (Data.result.result && Data.result.result.length) {
this.memberTagList = Data.result.result;
this.total = Data.result.totalCount;
} else {
this.memberTagList = [];
this.total = 0;
}
} catch (e) {
console.log(e);
}
},
......@@ -131,8 +135,27 @@ export default {
// 当前页码改变
handleCurrentChange(val) {
this.pageNum = val;
this.loadMemberTagList({});
const param = this.JudgeIsHandTag();
console.log(param);
this.loadMemberTagList(param);
},
/**
* 判断是否是手工标签
*/
JudgeIsHandTag() {
let param = null;
let keys = Object.keys(this.middleWareVariable);
// 长度大于0就表示 有手工标签的值
if (keys.length) {
param = {
id: this.middleWareVariable.id,
type: this.middleWareVariable.type == 1 ? 1 : 0
};
}
console.log(param);
return param;
},
// 模糊查询会员标签
searchMemberList() {
this.loadMemberTagList({
......@@ -141,6 +164,13 @@ export default {
},
// 一级标签
handleFristTag(list) {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({
id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1
......@@ -157,6 +187,7 @@ export default {
if (list.handTag == 1) {
const hangObj = {
name: list.name,
type: 1,
id: list.id
};
localStorage.setItem('groupId', JSON.stringify(hangObj));
......@@ -168,7 +199,6 @@ export default {
},
// 删除手工
deleteHandTag(id) {
console.log(id);
this.loadMemberTagList({
id: id,
type: 1 // 手工标签传1
......@@ -177,11 +207,14 @@ export default {
},
beforeMount() {
// 一二三级都需要一个变量来保存自己的信息 在切换页码和数量的时候也要传参数过去
this.middleWareVariable = {};
this.handTag = null;
this.groupId = '';
this.getTagList();
if (localStorage.getItem('groupId')) {
const hangObj = JSON.parse(localStorage.getItem('groupId'));
this.middleWareVariable = JSON.parse(JSON.stringify(hangObj));
this.loadMemberTagList({
tagType: 1,
id: hangObj.id
......@@ -201,6 +234,13 @@ export default {
// 处理二级标签
this.$on('handle-second-tag', list => {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({
id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1
......@@ -212,6 +252,13 @@ export default {
});
// 处理三级标签
this.$on('handle-third-tag', list => {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({
id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1
......
......@@ -34,7 +34,11 @@
<div class="dialog-box">
<p class="tag-name">{{ dialogData.tagName }}</p>
<p class="tag-desc">根据会员信息扩展字段统计而来</p>
<div class="tag-value">
<p class="tag-desc">标签值设置</p>
<!-- 所有标签的配置项 -->
<tag-config-options v-if="optionFlag" :tagId="tagId" ref="tagConfig"> </tag-config-options>
<!-- <div class="tag-value">
<p>标签值设置</p>
<div class="tag-area"></div>
<p>时间范围</p>
......@@ -43,7 +47,7 @@
<el-option v-for="item in TimeOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</div>
</div>
</div> -->
<div class="tag-mode">
<p>营销方式</p>
......@@ -52,7 +56,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
<el-button type="primary" @click="confirmOptions">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -60,13 +64,15 @@
<script>
import TagMode from '@/components/tag/tag-mode';
import TagConfigOptions from '@/components/tag/tag-config-options';
import { delThirdHandTag } from '@/request/api';
export default {
name: 'tag-container',
components: {
TagMode
TagMode,
TagConfigOptions
},
props: {
......@@ -88,15 +94,24 @@ export default {
tableData: [],
dialogVisible: false,
dialogData: {},
TimeOptions: []
TimeOptions: [],
optionFlag: false,
tagId: ''
};
},
methods: {
handleClose() {
this.optionFlag = false;
},
// 添加标签 弹框里面操作
addTag(list) {
this.dialogData = list;
this.dialogVisible = !this.dialogVisible;
if (list.tagId) {
this.optionFlag = true;
this.tagId = list.tagId;
this.dialogVisible = !this.dialogVisible;
}
},
editHandTag(list) {
this.$router.push({
......@@ -133,6 +148,13 @@ export default {
.catch(err => {
console.log(err);
});
},
/**
*
*/
confirmOptions() {
console.log(this.$refs.tagConfig.getTemplateData());
}
},
......
......@@ -36,3 +36,8 @@
.el-popover {
min-width: 100px;
}
.icon-transform-nine {
transition: transform .3s;
transform: rotate(-90deg);
color: #c0c4cc;
}
\ No newline at end of file
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