Commit e13daa17 by 王志慧

commit

1 parent b0a736bb
......@@ -56,6 +56,9 @@ background: transparent !important;
.color-58{
color: #5850ff;
}
.color-9{
color: #999999;
}
.flex-start{
align-items: flex-start;
display: flex;
......@@ -70,10 +73,19 @@ background: transparent !important;
align-items: center;
justify-content: space-between;
}
.flex-satrt{
display: flex;
align-items: flex-start;
}
.font-20{
font-size: 20px;
}
.font-14{
font-size: 14px;
}
\ No newline at end of file
.font-16{
font-size: 16px;
}
.hand{
cursor: pointer;
}
\ No newline at end of file
......@@ -13,4 +13,5 @@ import _button from '@/components/glsx-button/index'
Vue.component('glsx-button', _button)
Vue.component('search-form', () => import('./search-form/index.vue'))
Vue.component('basic-dialog', () => import('./basic-dialog/index.vue'))
Vue.component('rule-form', () => import('./rule-form/index.vue'))
\ No newline at end of file
Vue.component('rule-form', () => import('./rule-form/index.vue'))
Vue.component('layout-row', () => import('./layout-row/index.vue'))
\ No newline at end of file
<template>
<div>
<template v-for="(list, id) in tableData">
<div class="layout-wrap" :key="id">
<el-row :gutter="30">
<template v-for="(params, index) in layoutParams">
<el-col :span="12" :key="index">
<div class="label-wrap">
<label>{{ params.label }}</label>
<span>{{ list[params.prop]? list[params.prop]: '--'}}</span>
</div>
</el-col>
</template>
</el-row>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'layout-row',
props: {
//获取的数据
layoutData: {
type: Array,
default: () => []
},
layoutParams: {
type: Array,
default: () => []
},
isHidden: {
type: Boolean,
default: false
}
},
computed: {
tableData() {
return this.isHidden ? this.layoutData : this.layoutData.slice(0, 1)
}
},
created() {}
}
</script>
<style scoped lang="scss">
.layout-wrap {
padding: 20px 0;
box-sizing: border-box;
background: #f5f5f5;
margin-bottom:10px;
.el-row {
&:last-child {
margin-bottom: -20px;
}
.el-col {
margin-bottom: 16px;
}
.label-wrap {
display: flex;
align-items: center;
margin: 0 10%;
min-width: 80%;
label {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
text-align: right;
min-width: 30%;
display: inline-block;
}
span {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
text-align: left;
max-width: 228px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
}
}
}
</style>
\ No newline at end of file
......@@ -107,7 +107,25 @@ const staticRoutes = Object.freeze([
path: "/guestGroup/detail/:id",
component: resolve => require([`@/views/guestGroup/detail.vue`], resolve),
meta: {}
}
},
{
name: 'crowdManage',
path: "/crowdManage/index",
component: resolve => require([`@/views/crowdManage/index.vue`], resolve),
meta: {}
},
{
name: 'crowdAdd',
path: "/crowdManage/crowdAdd",
component: resolve => require([`@/views/crowdManage/crowdAdd.vue`], resolve),
meta: {}
},
{
name: 'crowdDetail',
path: "/crowdManage/crowdDetail:id",
component: resolve => require([`@/views/crowdManage/crowdDetail.vue`], resolve),
meta: {}
},
])
export default staticRoutes
// {
......
......@@ -34,7 +34,8 @@ button {
// 子系统不设外边距
.scrm-sub-client-container {
padding: 0 20px 20px 40px;
padding: 0 20px 20px 20px;
box-sizing: border-box;
}
.el-table .cell {
......
<template>
<div class="scrm-sub-client-container">
<div class="head-container">
<div class="head-container-title color-3 font-20"> {{describeData[id-1].name}}</div>
<div class="head-container-content color-6 font-14">{{ describeData[id-1].info }}</div>
<div class="head-container-title color-3 font-20">人群名称</div>
<div class="head-container-content color-6 font-14">{{ describe }}</div>
<!-- <div class="reminder font-14 color-3">企业标签 | 自动更新</div> -->
<div class="back color-58 font-14" @click="goBack">返回人群管理</div>
</div>
......
......@@ -85,7 +85,7 @@
</span>
<span>在潜在意向客户中,未加企微的客户</span>
<!-- &nbsp;&nbsp;&gt;&gt;-->
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel == 4">
<button class="btn" @click.stop="toGuideCompanyWechat" v-if="accountLevel == 4">
引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
......@@ -131,7 +131,7 @@
<span class="person-text">人</span>
</span>
<span>在基盘客户中,未加企微的客户</span>
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel == 4">
<button class="btn" @click.stop="toGuideCompanyWechat" v-if="accountLevel == 4">
引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
......
......@@ -13,66 +13,66 @@
<img src="@/assets/clientDetail/defaultAvator.png" alt="" v-else />
</div>
<p>
<span>客户名称</span>
<span>客户名称:</span>
<el-tooltip effect="dark" :content="leftPanelInfo.customerName" placement="top">
<span class="ellipsis-1">
<span>
<!-- {{ leftPanelInfo.customerName }} -->
{{ beautySub(leftPanelInfo.customerName) }}
<span class="pure-blue-text">{{ leftPanelInfo.type == 1 ? '@微信' : leftPanelInfo.type == 2 ? '@企微' : '' }}</span>
</span>
<label class="pure-blue-text">{{ leftPanelInfo.type == 1 ? '@微信' : leftPanelInfo.type == 2 ? '@企微' : '' }}</label>
</span>
</el-tooltip>
</p>
<p>
<span>联系电话</span>
<span>联系电话:</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span>
</p>
<!-- <p>
<span>微信号</span>
<span class="ellipsis-1">{{ leftPanelInfo.weChatId || '待完善' }}</span>
</p> -->
<p>
<span>性别</span>
<span>证件号码:</span>
<span class="ellipsis-1">341189199508293021</span>
</p>
<p>
<span>性别:</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span>
</p>
<p>
<span>企业简称</span>
<span>企业简称:</span>
<span class="ellipsis-1">{{ leftPanelInfo.corpName || '待完善' }}</span>
</p>
<p>
<span>职务</span>
<span>职务:</span>
<span class="ellipsis-1">{{ leftPanelInfo.position || '待完善' }}</span>
</p>
<p v-if="leftPanelInfo.type == 2">
<span>类型</span>
<span>类型:</span>
<span class="ellipsis-1">{{ leftPanelInfo.type == 1 ? '微信用户' : leftPanelInfo.type == 2 ? '企微用户' : '' }}</span>
</p>
<p>
<span>是否加企微</span>
<span>是否加企微:</span>
<!-- 1-是,2-否 -->
<span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span>
</p>
<p>
<span>当前状态</span>
<span>当前状态:</span>
<span>{{ leftPanelInfo.status == -1 ? '删除好友' : leftPanelInfo.status == 0 ? '正常' : '' }}</span>
</p>
<p>
<span>所属渠道</span>
<span>所属渠道:</span>
<el-tooltip effect="dark" :content="leftPanelInfo.sourceChannel" placement="top">
<span class="ellipsis-1">{{ leftPanelInfo.sourceChannel }}</span>
</el-tooltip>
</p>
<p>
<span>添加来源</span>
<span>添加来源:</span>
<el-tooltip effect="dark" :content="leftPanelInfo.addWay | toLabel" placement="top">
<span class="ellipsis-1">{{ leftPanelInfo.addWay | toLabel }}</span>
</el-tooltip>
</p>
<p>
<span>添加时间</span>
<span>添加时间:</span>
<span>{{ leftPanelInfo.addTime }}</span>
</p>
</div>
......@@ -81,52 +81,91 @@
<span class="tabItemText" :class="{ activeItemText: currentIndex == 1 }" @click="tabClick(1)">概况</span>
<span class="tabItemText" :class="{ activeItemText: currentIndex == 2 }" @click="tabClick(2)">标签信息</span>
</div>
<template v-if="currentIndex == 1">
<!-- <p><span>标签信息</span></p>
<div class="tagsWrap">
<span class="tag ellipsis-1" v-for="item in tagsList" :key="item.labelId" :title="item.labelValue">{{ item.labelValue }}</span>
添加标签 仅对该客户的跟进员工可见(要有登录信息)1--商户 2--员工
<span class="tag addTag" @click="btnClick('create')" v-if="userType == 2">添加</span>
</div> -->
<p>
<span>车辆信息</span>
<span>{{ vehicleTableData.length || 0 }}辆</span>
</p>
<!--1. 车辆信息表 -->
<!-- :row-style="{ height: 88 + 'px' }" -->
<GLTable :hasNum="false" :tableData="vehicleTableData" :hasPage="false" :tableParams="vehicleTableParams" :headerStyle="{ height: '54px' }">
<span slot="standNo" slot-scope="scope">
<span>{{ myStandNo(scope.scope.standNo) }}</span>
</span>
</GLTable>
<p>
<span>跟进员工</span>
<span>{{ employTableList.length || 0 }}人</span>
</p>
<!--2. 员工跟进表 -->
<GLTable :hasNum="false" :tableData="employTableList" :hasPage="false" :tableParams="employTableParams" :headerStyle="{ height: '54px' }">
<span slot="addWay" slot-scope="scope">
<span>{{ scope.scope.addWay | toLabel }}</span>
</span>
<span slot="addType" slot-scope="scope">
<span>{{ addTypeToLable(scope.scope.addType) }}</span>
</span>
</GLTable>
<p>
<span>所属群聊</span>
<span>{{ clientGroupTableList.length || 0 }}个</span>
</p>
<GLTable :hasNum="false" :tableData="clientGroupTableList" :hasPage="false" :tableParams="clientGroupTableParams" :headerStyle="{ height: '54px' }">
<span slot="groupName" slot-scope="scope">
<span>{{ scope.scope.groupName || '群聊(默认)' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="goDetail(scope.scope.id, scope.scope.groupName)">详情</el-button>
<template v-if="currentIndex === 1">
<div class="general-wrap">
<div class="public-text">
<div class="public-text-info font-16 flex">
车辆信息
<span class="font-14 color-58">{{ vehicleTableData.length || 0 }}辆</span>
</div>
<div class="expande-button" v-if="expande" @click="expandeClick(false, 'expande')">
<span class="font-14 color-58">收起</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
<div class="expande-button" @click="expandeClick(true, 'expande')" v-if="vehicleTableData.length > 1 && !expande">
<span class="font-14 color-58">更多车辆</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
</div>
</GLTable>
<layout-row class="layout-detail" :layoutData="vehicleTableData" :layoutParams="vehicleTableParams" :isHidden="expande"></layout-row>
<template v-if="deviceTableData.length > 0">
<div class="public-text">
<div class="public-text-info font-16 flex">
设备信息
<span class="font-14 color-58">{{ deviceTableData.length || 0 }}辆</span>
</div>
<div class="expande-button" v-if="deviceExpande" @click="expandeClick(false, 'deviceExpande')">
<span class="font-14 color-58">收起</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
<div class="expande-button" @click="expandeClick(true, 'deviceExpande')" v-if="deviceTableData.length > 1 && !deviceExpande">
<span class="font-14 color-58">更多设备</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
</div>
<layout-row class="layout-detail" :layoutData="deviceTableData" :layoutParams="deviceTableParams" :isHidden="deviceExpande"></layout-row>
</template>
<template v-if="guaranteeTableData.length > 0">
<div class="public-text">
<div class="public-text-info font-16 flex">
保单信息
<span class="font-14 color-58">{{ guaranteeTableData.length || 0 }}辆</span>
</div>
<div class="expande-button" v-if="guaranteeExpande" @click="expandeClick(false, 'guaranteeExpande')">
<span class="font-14 color-58">收起</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
<div class="expande-button" @click="expandeClick(true, 'guaranteeExpande')" v-if="guaranteeTableData.length > 1 && !guaranteeExpande">
<span class="font-14 color-58">更多设备</span>
<i class="el-icon-arrow-down color-58"></i>
</div>
</div>
<layout-row class="layout-detail" :layoutData="guaranteeTableData" :layoutParams="guaranteeTableParams" :isHidden="guaranteeExpande"></layout-row>
</template>
<div class="public-text">
<div class="public-text-info font-16 flex">
员工跟进
<span class="font-14 color-58">{{ employTableList.length || 0 }}人</span>
</div>
</div>
<!--2. 员工跟进表 -->
<GLTable :hasNum="false" class="table" :tableData="employTableList" :hasPage="false" :tableParams="employTableParams" :headerStyle="{ height: '54px' }">
<span slot="addWay" slot-scope="scope">
<span>{{ scope.scope.addWay | toLabel }}</span>
</span>
<span slot="addType" slot-scope="scope">
<span>{{ addTypeToLable(scope.scope.addType) }}</span>
</span>
</GLTable>
<div class="public-text">
<div class="public-text-info font-16 flex">
所属群聊
<span class="font-14 color-58">{{ clientGroupTableList.length || 0 }}个</span>
</div>
</div>
<GLTable class="table" :hasNum="false" :tableData="clientGroupTableList" :hasPage="false" :tableParams="clientGroupTableParams" :headerStyle="{ height: '54px' }">
<span slot="groupName" slot-scope="scope">
<span>{{ scope.scope.groupName || '群聊(默认)' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="goDetail(scope.scope.id, scope.scope.groupName)">详情</el-button>
</div>
</GLTable>
</div>
</template>
<div v-show="currentIndex == 2" class="clientTagsWrap">
<div style="height: 40px"></div>
<div style="height: 20px"></div>
<!-- //提示面板组件 -->
<tip-panel panelWidth="666px" panelMinHeight="45px" :panelContent="panelContent"></tip-panel>
<!-- v-if="userType == 2" -->
......@@ -207,82 +246,138 @@ export default {
data() {
return {
sloading: false,
expande: false, //车辆
deviceExpande: false, //设备
guaranteeExpande: false, //保单
panelContent: '说明:标签信息包含跟进员工标记的企业标签和自店标签,以及通过大数据算法生成的系统标签',
url: url,
leftPanelInfo: {},
labelIdList: [], //存放用户被标记标签的id
tagsList: [
// { labelName: '一般', labelId: 1 },
// { name: '初次沟通', id: 2 }
],
tagsList: [],
vehicleTableData: [],
vehicleTableParams: {
listName: 'vehicleInfoList',
tableOption: false,
tableColumns: [
{
label: '车架号(后6位)',
prop: 'standNo',
addHtml: 'standNo',
minWidth: '120'
},
{
label: '车牌号',
prop: 'vehicleNo',
minWidth: '100'
},
{
label: '车辆品牌',
prop: 'vehicleBrand',
minWidth: '100'
},
{
label: '车系',
prop: 'vehicleTrain',
width: 160,
line: 2
},
{
label: '车型',
prop: 'vehicleType',
width: 160,
line: 2
},
{
label: '年款',
prop: 'vehicleModelYear',
minWidth: '100'
},
{
label: '购车价格',
prop: 'vehiclePrice',
minWidth: '100',
formatter: cellValue => {
return cellValue.vehiclePrice || ''
}
},
{
label: '购车时间',
prop: 'buyTime',
minWidth: '120'
},
{
label: '保险开始时间',
prop: 'insBgnTime',
minWidth: '120'
},
{
label: '保险到期时间',
prop: 'insEndTime',
minWidth: '120'
},
{
label: '最近保养时间',
prop: 'maintRecTime',
minWidth: '120'
}
]
},
vehicleTableParams: [
{
label: '车架号:',
prop: 'standNo',
addHtml: 'standNo'
},
{
label: '车牌号:',
prop: 'vehicleNo'
},
{
label: '发动机号:',
prop: 'vehicleBrand'
},
{
label: '车辆品牌:',
prop: 'vehicleBrand'
},
{
label: '车系:',
prop: 'vehicleTrain'
},
{
label: '车型:',
prop: 'vehicleType'
},
{
label: '车身颜色:',
prop: 'vehicleType'
},
{
label: '购车价格:',
prop: 'vehiclePrice'
},
{
label: '购车时间:',
prop: 'buyTime'
},
{
label: '最近保养时间:',
prop: 'maintRecTime'
},
{
label: '保险开始时间:',
prop: 'insBgnTime'
},
{
label: '保险到期时间:',
prop: 'insEndTime'
}
],
deviceTableData: [],
deviceTableParams: [
{
label: '设备号(SN/IMEI):',
prop: 'standNo',
addHtml: 'standNo'
},
{
label: '设备流量卡(ICCID):',
prop: 'vehicleNo'
},
{
label: '设备类型:',
prop: 'vehicleBrand'
},
{
label: '设备型号:',
prop: 'vehicleBrand'
},
{
label: '验证码:',
prop: 'vehicleTrain'
},
{
label: '批次号:',
prop: 'vehicleType'
},
{
label: '绑定车辆(车架号):',
prop: 'vehicleType'
},
{
label: '设备激活时间:',
prop: 'vehiclePrice'
}
],
guaranteeTableData: [], //保单
guaranteeTableParams: [
{
label: '保单号:',
prop: 'standNo',
addHtml: 'standNo'
},
{
label: '产品名称:',
prop: 'vehicleNo'
},
{
label: '服务期限:',
prop: 'vehicleBrand'
},
{
label: '服务公司:',
prop: 'vehicleBrand'
},
{
label: '保险生效时间:',
prop: 'vehicleTrain'
},
{
label: '保险到期时间:',
prop: 'vehicleType'
},
{
label: '保险提单时间:',
prop: 'vehicleType'
},
{
label: '绑定车辆:',
prop: 'vehiclePrice'
}
],
//员工跟进
employTableParams: {
listName: 'staffFollows',
......@@ -428,6 +523,9 @@ export default {
console.log(this.tagsParams, 'kkkk')
},
methods: {
expandeClick(value, data) {
this[data] = value
},
closePanel() {
this.isFirstShow = false
},
......@@ -516,7 +614,8 @@ export default {
this.userid = res.userid
this.staffId = res.staffId
this.leftPanelInfo = res.info
this.vehicleTableData = res.vehicleInfoList || []
// this.vehicleTableData = res.vehicleInfoList || []
this.vehicleTableData = [{}] || []
this.employTableList = res.staffFollows || []
this.clientGroupTableList = res.customerBases || []
this.tagsList = res.labels || []
......@@ -724,10 +823,12 @@ export default {
width: 100%;
margin-top: 20px;
.leftWrap {
width: 240px;
width: 275px;
min-height: calc(100vh - 92px);
background-color: #fff;
box-sizing: border-box;
padding:0 20px;
box-sizing: border-box;
.avator {
margin: 0 auto;
margin-top: 40px;
......@@ -742,9 +843,10 @@ export default {
}
}
p {
padding-left: 20px;
position: relative;
margin-top: 20px;
display:flex;
span:first-child {
display: inline-block;
// height: 20px;
......@@ -752,29 +854,29 @@ export default {
font-weight: 600;
color: #333333;
line-height: 20px;
min-width:90px;
text-align:right;
}
span:nth-child(2) {
position: absolute;
left: 100px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
max-width: 140px;
max-width: 146px;
}
}
}
.rightWrap {
margin-left: 20px;
width: calc(100% - 260px);
margin-left: 12px;
width: calc(100% - 287px);
box-sizing: border-box;
background-color: #fff;
padding: 20px;
position: relative;
// padding: 20px;
// position: relative;
.choseRow {
position: absolute;
// position: absolute;
width: 100%;
left: 0;
top: 0;
......@@ -970,5 +1072,41 @@ export default {
}
}
}
.general-wrap {
margin: 0 0 20px 0;
.public-text {
width: 100%;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
padding: 0 20px;
box-sizing: border-box;
position: relative;
margin-bottom: 20px;
&-info {
font-size: 16px;
font-weight: 500;
color: #333333;
span {
margin-left: 8px;
}
}
.expande-button {
position: absolute;
right: 20px;
top: 0;
.el-icon-arrow-down {
font-size: 10px;
margin-left: 7px;
}
}
}
.layout-detail {
margin: 0 20px;
}
.table{
margin-bottom:10px;
}
}
}
</style>
......@@ -20,8 +20,8 @@
</el-tooltip>
<!-- <span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span> -->
<span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : scope.scope.type == null ? '' :''}}</span>
<span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : scope.scope.type == null ? '' : '' }}</span>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
......@@ -486,5 +486,6 @@ export default {
background-color: #fff !important;
}
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="container" id="container">
<div>
<div class="title">创建人群</div>
<div class="info-box">
<el-form :model="groupForm" :rules="groupRules" ref="groupForm" label-width="118px">
<div class="el-form-line">
<el-form-item label="人群名称:" prop="groupName">
<el-input v-model.trim="groupForm.groupName" size="small" placeholder="请输入人群名称" maxlength="30"></el-input>
</el-form-item>
<span class="limited">最多30个字符</span>
</div>
<div class="el-form-line">
<el-form-item label="人群描述:" prop="groupNameRule">
<el-input v-model.trim="groupForm.groupName" size="small" placeholder="请输入人群描述" maxlength="30"></el-input>
</el-form-item>
<span class="limited">最多30个字符</span>
</div>
<div class="el-form-line">
<el-form-item label="标签筛选:" prop="groupNameRule" class="label-word">
<div class="flex">
<div class="font-14 color-58 mr2 hand">人群规则说明</div>
<div class="font-14 color-58 hand">人群规则逻辑</div>
</div>
</el-form-item>
</div>
</el-form>
<div class="label-wrap">
<div :class="{ 'fixed-box': true, is_fixed: isFixed, is_pb: isDom }" id="boxFixed">
<template v-if="this.selectedArray.length > 0">
<div class="select-label-wrap font-14 flex-satrt" id="tagBox">
<div class="select-label color-3">已选标签:</div>
<div class="flex">
<div class="selects" v-for="(selectTag, index) in selectedArray" :key="index">
<template v-if="selectTag.labelGroupName.name.length + selectTag.combination.length <= 20">
<div class="label-group-name color-3 hand" @click="labelFilter(selectTag)">
<span class="color-9">{{ selectTag.labelGroupName.name }}:</span>
{{ selectTag.combinationtext }}
<i class="el-icon-close" @click.stop="closeTag(selectTag, index)"></i>
</div>
</template>
<template v-else>
<el-tooltip placement="top">
<div slot="content" class="tooltip-text">{{ selectTag.labelGroupName.name }}:{{ selectTag.combination }}</div>
<div class="label-group-name color-3 hand" style="padding-right: 60px" @click="labelFilter(selectTag)">
<span class="color-9">{{ selectTag.labelGroupName.name }}:</span>
{{ selectTag.combinationtext }}
<div class="select-num">+{{ selectTag.children.length }}</div>
<i class="el-icon-close" @click.stop="closeTag(selectTag, index)"></i>
</div>
</el-tooltip>
</template>
</div>
</div>
</div>
</template>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="tagsPartFormList" @setTableHeightEvent="setTableHeightEvent" labelWidth="54px">
<span class="inline-b" slot="form-slot">
<el-button @click="resetTable" plain>重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<div class="expande-button-wrap" v-if="isFixed">
<div class="expande-button" @click="expandeClick" v-if="!expande && isDom">
<i class="el-icon-arrow-down"></i>
<span>展开</span>
</div>
<div class="expande-button" @click="expandeClick" v-if="expande && isDom">
<i class="el-icon-arrow-up"></i>
<span>收起</span>
</div>
</div>
</div>
<div class="pageContent">
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="tagsManage" :hasNum="false" :tableTotal="tableTotal" :tableData="tableData" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" @refreshTable="refreshTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="labelGroup" slot-scope="scope">
<span>{{ scope.scope.labelGroup.name }}</span>
</span>
<span slot="labelList" slot-scope="scope">
<div class="allTagsWrap flex">
<template v-for="(item, index) in scope.scope.labelList">
<span :class="['label', 'color-3', 'white-hide', 'mt10', item.checked ? 'isChecked' : '']" :key="index" @click="selectTag(item, index)">
{{ item.name }}
<template v-if="item.checked">
<img src="@/assets/clientDetail/select-icon.png" class="select-icon" alt />
</template>
</span>
</template>
</div>
</span>
</GLTable>
</div>
</div>
</div>
</div>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/tagsManage'
export default {
name: 'crowdAdd',
data() {
return {
isFixed: true,
offsetTop: 0,
expande: false,
isDom: false,
tableData: [],
isReload: true,
groupForm: {
groupName: ''
},
groupRules: {
groupName: [{ required: true, message: '请输入人群名称', trigger: 'blur' }]
},
searchForm: {},
tagsPartFormList: [
{
type: 'select',
prop: 'labelTreeReq.labelTypesStr',
label: '标签组',
placeholder: '请选择标签组类型',
options: [
{
label: '企业标签',
value: '企业标签'
},
{
label: '自店标签',
value: '自店标签'
},
{
label: '系统标签',
value: '系统标签'
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'labelTreeReq.labelGroupName',
label: '搜索',
placeholder: '请输入标签名称',
clearable: true
}
],
page: {},
tableTotal: '',
pageConf: { pageSize: 'labelTreeReq.pageSize', pageNum: 'labelTreeReq.pageNum', totalCount: 'labelGroupCount' },
tableParams: {
listName: 'labelTreeRets',
tableColumns: [
{
label: '标签组',
prop: 'labelGroup',
addHtml: 'labelGroup',
width: 180
},
{
label: '标签组类型',
prop: 'labelType',
width: 180
},
{
label: '标签',
prop: 'labelList',
addHtml: 'labelList',
align: 'center'
}
]
},
selectedArray: []
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType
}
this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': 2 }
this.page[this.pageConf.pageNum] = 1
this.page[this.pageConf.pageSize] = 10
//获取标签数据
this.getLabelData()
},
watch: {
selectedArray: function () {
this.$nextTick(function () {
//条件重置
document.getElementById('tagBox').style.height = 'auto'
if (!this.expande || !this.isFixed) {
//获取当前元素的高
let height = document.getElementById('tagBox').offsetHeight
if (height > 127) {
document.getElementById('tagBox').style.height = 128 + 'px'
this.isDom = true
} else {
document.getElementById('tagBox').style.height = 'auto'
this.isDom = false
}
}
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
//初始化数据
window.addEventListener('scroll', this.initHeight, true)
this.$nextTick(() => {
this.offsetTop = document.querySelector('#boxFixed').offsetTop
})
},
methods: {
refreshTable(page) {
console.log(page)
this.page = page
this.getLabelData()
},
expandeClick() {
this.expande = !this.expande
if (this.expande) {
document.getElementById('tagBox').style.height = 'auto'
} else {
document.getElementById('tagBox').style.height = 128 + 'px'
}
},
initHeight() {
var scrollTop = document.querySelector('#container').scrollTop
this.isFixed = scrollTop > this.offsetTop ? true : false
document.getElementById('tagBox').style.height = 'auto'
let height = document.getElementById('tagBox').offsetHeight
if (!this.isFixed) {
//条件重置
if (height > 127) {
this.expande = true
this.isDom = true
} else {
this.expande = false
this.isDom = false
}
}
},
//获取标签数据
getLabelData() {
let params = {
...this.searchForm,
...this.page
}
getTableList(params).then(res => {
res.labelTreeRets.forEach(item => {
item.labelList.forEach(label => {
label.checked = false
})
})
this.tableData = res.labelTreeRets
this.tableTotal = res.labelGroupCount
this.getHistoryLabel()
})
},
//已选择标签状态保存
getHistoryLabel() {
let selectId = []
if (this.selectedArray.length > 0) {
for (let i = 0; i < this.selectedArray.length; i++) {
for (let k = 0; k < this.selectedArray[i].children.length; k++) {
selectId.push(this.selectedArray[i].children[k].id)
}
}
for (let m = 0; m < this.tableData.length; m++) {
for (let n = 0; n < this.tableData[m].labelList.length; n++) {
if (selectId.indexOf(this.tableData[m].labelList[n].id) != -1) {
this.tableData[m].labelList[n].checked = true
}
}
}
}
},
//选择标签
selectTag(data) {
this.tableData.forEach(item => {
item.labelList.forEach(label => {
if (label.id == data.id) {
label.checked = !label.checked
this.selectedLabelFn(item, data)
}
})
})
},
// 添加已选标签
selectedLabelFn(groupData, data) {
if (this.selectedArray.length > 0) {
for (let i = 0; i < this.selectedArray.length; i++) {
if (this.selectedArray[i].labelGroupName.name == groupData.labelGroup.name) {
if (data.checked) {
this.selectedArray[i].children.push(data)
} else {
for (let k = 0; k < this.selectedArray[i].children.length; k++) {
if (this.selectedArray[i].children[k].id == data.id) {
this.selectedArray[i].children.splice(k--, 1)
}
}
}
}
}
if (!this.selectedArray.some(tag => tag.labelGroupName.name == groupData.labelGroup.name)) {
this.selectedArray.push({
labelGroupName: groupData.labelGroup,
children: [data]
})
}
} else {
this.selectedArray.push({
labelGroupName: groupData.labelGroup,
children: [data]
})
}
this.handleLabel()
},
//处理已选标签
handleLabel() {
for (let i = 0; i < this.selectedArray.length; i++) {
let array = []
if (this.selectedArray[i].children.length == 0) {
this.selectedArray.splice(i--, 1)
}
for (let j = 0; j < this.selectedArray[i].children.length; j++) {
array.push(this.selectedArray[i].children[j].name)
}
this.selectedArray[i].combination = array.join('、')
let length = 20 - this.selectedArray[i].labelGroupName.name.length
console.log(this.selectedArray[i].combination)
this.selectedArray[i].combinationtext = this.selectedArray[i].combination.substring(0, length)
this.$set(this.selectedArray, i, this.selectedArray[i])
}
console.log(this.selectedArray)
},
//删除选中标签
closeTag(data, index) {
this.selectedArray.splice(index, 1)
this.tableData.forEach(t => {
if (t.labelGroup.id == data.labelGroupName.id) {
t.labelList.forEach(m => {
m.checked = false
})
}
})
//条件重置
document.getElementById('tagBox').style.height = 'auto'
let height = document.getElementById('tagBox').offsetHeight
if (height > 127) {
document.getElementById('tagBox').style.height = 128 + 'px'
this.isDom = true
} else {
document.getElementById('tagBox').style.height = 'auto'
this.isDom = false
}
},
//标签组搜索
labelFilter(data) {},
//搜索表格
searchTable() {
this.$refs.tagsManage.refreshTable()
},
//重置表格
resetTable() {
// this.isReload = false
this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel }
this.$refs.tagsManage.refreshTable()
// this.$nextTick(() => {
// this.isReload = true
// })
}
},
destroyed() {
window.removeEventListener('scroll', this.initHeight)
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
height: calc(100vh - 150px);
overflow-y: auto;
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
&::after {
content: '';
}
}
.info-box {
width: 100%;
padding: 30px 0;
box-sizing: border-box;
.el-form {
width: 100%;
height: 246px;
box-sizing: border-box;
border-bottom: 1px solid #d8d8d8;
padding: 0 30px;
}
.el-form-line {
margin-bottom: 20px;
.label-word {
/deep/ .el-form-item__content {
line-height: 20px;
}
/deep/ .el-form-item__label {
line-height: 20px;
}
}
.el-input {
width: 415px;
}
/deep/ .el-form-item {
margin-bottom: 6px !important;
}
/deep/ .el-form-item__error {
color: #f56c6c;
font-size: 12px;
line-height: 1;
padding-top: 30px;
position: absolute;
top: 100%;
left: 0;
}
}
.limited {
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 17px;
margin-left: 118px;
margin-bottom: 20px;
margin-top: -20px;
}
.mr2 {
margin-right: 20px;
}
.label-wrap {
margin-top: 32px;
width: 100%;
.fixed-box {
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 0 30px;
}
.is_fixed {
width: calc(100vw - 250px);
position: fixed;
top: 60px;
z-index: 999;
padding: 20px 30px 20px 30px;
}
.is_pb {
padding: 20px 30px 52px 30px !important;
}
.select-label-wrap {
margin-bottom: 20px;
overflow: hidden;
.select-label {
line-height: 26px;
height: 26px;
white-space: nowrap;
}
.selects {
height: 26px;
background: #ffffff;
border: 1px solid rgba(232, 232, 234, 1);
border-radius: 4px;
margin-right: 4px;
margin-bottom: 4px;
position: relative;
display: flex;
align-items: center;
flex-wrap: nowrap;
.label-group-name {
max-width: 533px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 8px;
padding-right: 30px;
color: #666666;
box-sizing: border-box;
.select-num {
line-height: 18px;
height: 18px;
background: #ffffff;
border-radius: 2px;
border: 1px solid #e7e7e9;
padding: 0 4px;
position: absolute;
right: 27px;
margin-left: 20px;
top: 2px;
}
}
// .label {
// padding: 3px 8px;
// background: #fafbfe;
// border: 1px solid rgba(232, 232, 234, 1);
// border-radius: 4px;
// margin-right: 4px;
// }
.el-icon-close {
position: absolute;
right: 8px;
margin-left: 10px;
}
}
}
/deep/ .search-form {
padding: 0 0 2px 0;
}
.pageContent {
padding: 0 30px;
}
.expande-button-wrap {
position: absolute;
bottom: 16px;
left: 50%;
transform: translateX(-50%);
z-index: 99;
.expande-button {
color: $btnBlue;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 16px;
font-weight: 400;
color: $btnBlue;
line-height: 20px;
}
}
}
}
.allTagsWrap {
.label {
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
text-align: center;
margin-right: 4px;
margin-top: 4px;
position: relative;
padding: 3px 8px;
box-sizing: border-box;
display: inline-block;
cursor: pointer;
}
.isChecked {
border: 1px solid #5850ff !important;
color: #5850ff;
.select-icon {
width: 16px;
height: 16px;
position: absolute;
top: 0;
right: 0;
}
}
}
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: $btnBlue;
}
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.tooltip-text {
line-height: 18px;
}
</style>
<template>
<div>
</div>
</template>
<script >
export default {
data() {
return {
}
}
}
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!