Commit 6e6f7172 by xiaohai

分组详情页完成

parent 860f2042
......@@ -3,21 +3,21 @@
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<div class="right-box">
<!-- <div class="memberGroupDetail-wrap__head">
<div class="memberGroupDetail-wrap__head">
<p class="m-b-20"><span class="group-name">{{groupName}}</span><span class="font-10 real-time inline-block m-l-8">{{!!groupIsRealTime? '实时':''}}</span></p>
<div>
<span>筛选标签</span>
<div class="inline-block tag-cell-wrap">
<template v-for="(item,index) in selectedTagData">
<span v-if="index != 0" class="p-lr-18">并且</span>
<span class="tag-cell inline-block border-box color-606266">
<span >{{item.name}}</span>
<span >【选择:{{item.value}}</span>
<span v-if="index != 0" class="p-lr-18" :key="index">并且</span>
<span class="tag-cell inline-block border-box color-606266" :key="index+item.tagValueId">
<span >{{item.tagName}}</span>
<span v-if="item.tagParams">【选择:{{item.tagParams.selectedVal.join(",")}}</span>
</span>
</template>
</div>
</div>
</div> -->
</div>
<div class="memberGroupDetail-wrap__info">
<span>覆盖人数{{total}}人</span>
<span class="fr inline-block middle"><el-button type="primary" icon="el-icon-setting " @click="showDefined"></el-button></span>
......@@ -267,42 +267,11 @@
groupName: '分组名称',
groupIsRealTime: 1,
// 分组中已选标签
selectedTagData: [
{
id: 1,
name: '有车一族',
value: '233',
isRealTime: 0,
},
{
id: 2,
name: '有车一族',
value: '233',
isRealTime: 1,
},
{
id: 2,
name: '有车一族',
value: '233,有车一族,有车一族,有车一族,有车一族',
isRealTime: 1,
},
{
id: 2,
name: '有车一族',
value: '233,有车一族,有车一族,有车一族,有车一族',
isRealTime: 1,
},
{
id: 2,
name: '有车一族',
value: '233,有车一族,有车一族,有车一族,有车一族',
isRealTime: 1,
}
],
selectedTagData: [],
// memberGroupDetailData 表格
sortableFlag: false, // 表格可排序
memberGroupDetailData:[],
memberGroupDetailDataBack: [],
// 分页参数
currentPage: 1,
pageSize: 20,
......@@ -334,7 +303,7 @@
filters: {
formatTimeYMD(time) {
if (time) {
if (time && time > 0) {
let arr = time.toString().split('');
const y = arr.splice(0, 4).join('');
const m = arr.splice(0, 2).join('');
......@@ -345,7 +314,7 @@
}
},
formatTimeHMS(time) {
if (time) {
if (time && time > 0) {
let arr = time.toString().split('');
arr.splice(0, 8);
const h = arr.splice(0, 2).join('');
......@@ -360,6 +329,29 @@
methods: {
/**
* 获取分组的标签明细
*/
getTagValueDtoList() {
let that = this;
let memberTagGroupId = that.$route.query.memberTagGroupId;
let params = {
memberTagGroupId
};
getRequest('/member-tag-group/findOneDetial.json', params)
.then(res => {
console.log(res, 'tagValueDtoList');
let list = res.data.result.tagValueDtoList;
list.forEach(li => {
li.tagParams && (li.tagParams = JSON.parse(li.tagParams));
});
that.selectedTagData = list;
})
.catch(e => {
console.log(e, 'error of getTagValueDtoList');
});
},
/**
* 弹层显示
*/
showDefined() {
......@@ -379,17 +371,16 @@
*/
confirmUserDefined(data) {
const that = this;
console.log(data);
that.selectedUserDefined = data;
that.showUserDefined = false;
// 修改已选字段对象
that.selectedFields = [];
that.memberFields.forEach(function(ele,index){
if (that.selectedUserDefined.indexOf(ele.code) != -1) {
that.selectedFields.push(ele)
that.selectedFields.push(ele);
}
})
});
that.getGroupDetail();
},
/**
......@@ -397,6 +388,8 @@
*/
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.pageSize = val;
this.getGroupDetail();
},
/**
......@@ -404,6 +397,8 @@
*/
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.currentPage = val;
this.getGroupDetail();
},
/**
......@@ -431,8 +426,7 @@
* 点击信息跳转分组详情
*/
linkDetail(memberId) {
// this.$router.push({ path:'/wechatmemberDetail',query: {'memberId': memberId}});
window.location.href = `${window.location.origin}/member/#/wechatmemberDetail?memberId=ff8080816668174d01667beadcb80275&channel=wxMember`;
window.location.href = `${window.location.origin}/member/#/wechatmemberDetail?memberId=${memberId}&channel=wxMember`;
},
/**
......@@ -444,10 +438,8 @@
memberId: memberId
}
that.singleInfo = '';
postJson('/api-member/load-member-single-info',para)
that.axios.post(`${that.baseUrl}/api-member/load-member-single-info?requestProject='memberTag'`, para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
const resData = res.data
if (resData.errorCode == 0) {
// showMsg.showmsg('保存成功','success')
......@@ -459,20 +451,16 @@
cardNo: !!ret.cardNo ? ret.cardNo : '无会员卡',
mainStoreName: !!ret.mainStoreName ? ret.mainStoreName : '主门店未知',
};
console.log(that.singleInfo)
return;
}
errMsg.errorMsg(resData)
errMsg.errorMsg(resData);
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
},
/**
......@@ -499,7 +487,6 @@
}
})
console.log(that.selectedFields)
return;
}
errMsg.errorMsg(resData)
......@@ -524,9 +511,10 @@
}
},
mounted() {
this.getTagValueDtoList();
// 获取自定义字段
this.getGroupDetail();
this.getFieldsList();
this.getGroupDetail();
},
components: {
navCrumb,
......
......@@ -326,6 +326,12 @@
if (resData.errorCode == 1) {
that.groupTableData.splice(index,1);
return;
} else if (resData.errorCode == 200003) {
that.$confirm(`该分组正在被活动使用,无法删除!`, '提示', {
confirmButtonText: '确定',
type: 'warning'
});
return;
}
errMsg.errorMsg(resData);
})
......
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