Commit 0f0f3470 by 前端

Merge branch 'v1.2.1' into 'master'

V1.2.1

See merge request !2
2 parents 912eda4d 134d362a
Showing 51 changed files with 4935 additions and 1178 deletions
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7",
"echarts": "^5.2.0", "echarts": "^5.2.0",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<img src="./assets/logo.png" alt="" srcset="" /> <img src="./assets/logo.png" alt="" srcset="" />
</div> --> </div> -->
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd"> <keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd,guestGroupDetail,group,viewCustomers">
<router-view></router-view> <router-view></router-view>
</keep-alive> </keep-alive>
</div> </div>
......
...@@ -6,29 +6,50 @@ ...@@ -6,29 +6,50 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http3 } from '@/main'
// const url = 'http://192.168.3.193:8395/rop-scrm-entmicro/router'
//获取数据概览上方的数据 /rop-scrm-datahub //获取数据概览上方的数据 /rop-scrm-datahub
export function getDataOverview(params){ export function getDataOverview(params) {
params.method='entmicro.api.Customer.customer.view.data' params.method = 'entmicro.api.Customer.customer.view.data'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
//获取数据概览下方柱状图的数据 //获取数据概览下方柱状图的数据
export function getDataOverviewBarMap(params){ export function getDataOverviewBarMap(params) {
params.method='entmicro.api.customer.view.chart' params.method = 'entmicro.api.customer.view.chart'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
//客户分群列表接口
export function getCustomerList(params) {
params.method = 'entmicro.api.customer.cluster.page'
return http3({
url:'/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//客户分群列表导出
export function customerClusterListExport(params) {
params.method = 'entmicro.api.customer.customerClusterListExport'
return http3({
url:'/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http2,http3 } from '@/main'
export function getTableList (params){ export function getTableList (params){
params.method='entmicro.api.customer.base.page' params.method='entmicro.api.customer.base.page'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
} }
export function syncCustomerBase(params){ export function syncCustomerBase(params){
params.method='entmicro.api.synchro.syncCustomerBase' params.method='entmicro.api.synchro.syncCustomerBase'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
} }
export function getTableDetail(params){ export function getTableDetail(params){
params.method='entmicro.api.customer.base.detail' params.method='entmicro.api.customer.base.detail'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
} }
export function getClientTableDetail(params){ export function getClientTableDetail(params){
params.method='entmicro.api.customer.detail' params.method='entmicro.api.customer.detail'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
// 客户群的客户列表获取分页数据接口 // 客户群的客户列表获取分页数据接口
export function getDetailTableList(params){ export function getDetailTableList(params){
params.method='entmicro.api.customer.base.cust.page' params.method='entmicro.api.customer.base.cust.page'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -57,3 +57,106 @@ ...@@ -57,3 +57,106 @@
}) })
} }
/*
未授权时,打开进入页面即弹出提示。 触发条件:跟企业微信相关且该账户暂未绑定企业微信时提示
*/
export function getStatus(params) {
params.method = 'scrm.api.work.wechat.access.status'
return http3({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
/*
跟进员工
*/
// POST /router/entmicro.api.customer.base.staff.page/1.0.0
export function getDetailStaffTableList(params){
params.method='entmicro.api.customer.base.staff.page'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
/*
退群客户
*/
export function getDetailQuitTableList(params){
params.method='entmicro.api.customer.base.quit.cust.page'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
/*
潜在客户
*/
export function getDetailPotentialTableList(params){
params.method='entmicro.api.customer.base.potential.cust.page'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//客户群管理(群聊管理)导出
export function clientGroupExportApi(params){
params.method=`entmicro.api.customer.base.list.export`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
// 全部客户导出
export function clientExportApi(params){
params.method=`entmicro.api.customer.base.cust.export`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
//跟进员工导出
export function followEmployeeExportApi(params){
params.method=`entmicro.api.customer.base.staff.export`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
//退群客户导出
export function leaveGroupExportApi(params){
params.method=`entmicro.api.customer.base.quit.export`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
//潜在客户导出
export function potentialClientExportApi(params){
params.method=`entmicro.api.customer.base.potential.export`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
\ No newline at end of file \ No newline at end of file
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http, http3 } from '@/main'
// const url = 'http://192.168.3.181:9636/rop-scrm-datahub/router'
//const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf' //const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf'
//获取客户列表内容 //获取客户列表内容
// const GETCLIENTTABLELIST = params => { // const GETCLIENTTABLELIST = params => {
// return http({ // return http({
...@@ -23,82 +23,96 @@ ...@@ -23,82 +23,96 @@
// 获取客户详情单用户标签 // 获取客户详情单用户标签
// params.method='datahub.api.label.querylabeltree' // params.method='datahub.api.label.querylabeltree'
export function getSingleClientTag(params){ export function getSingleClientTag(params) {
params.method='scrm.api.datahub.user.getuserlabel' params.method = 'scrm.api.datahub.user.getuserlabel'
return http({ return http({
url: '/rop-scrm-datahub/router', url: '/rop-scrm-datahub/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export function getAllTagTree (params){ export function getAllTagTree(params) {
params.method='scrm.api.datahub.label.querylabeltree' // params.method='scrm.api.datahub.label.querylabeltree'
return http({ params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
url: '/rop-scrm-datahub/router', return http({
method: 'POST', url: '/rop-scrm-datahub/router',
data: params, method: 'POST',
sign: true, data: params,
returnAll:true sign: true,
returnAll: true
})
})
} }
// /router/datahub.api.user.addUserLabel/1.0.0 // /router/datahub.api.user.addUserLabel/1.0.0
// 用户添加标签 //编辑用户标签(包含标签新增列表和删除列表)
export function addSingleClientTag (params){
params.method='scrm.api.datahub.user.addUserLabel' export function addSingleClientTag(params) {
return http({ params.method = 'scrm.api.datahub.user.editUserLabel'
url: '/rop-scrm-datahub/router', return http({
method: 'POST', url: '/rop-scrm-datahub/router',
data: params, method: 'POST',
sign: true, data: params,
returnAll:true sign: true,
returnAll: true
})
})
} }
export function getTableList (params){ export function getTableList(params) {
params.method='entmicro.api.customer.page' params.method = 'entmicro.api.customer.page'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop" // params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
// params.timestamp=new Date().getTime() // params.timestamp=new Date().getTime()
// +'?method=org.ore.api.customer.page' // +'?method=org.ore.api.customer.page'
return http({ return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function syncCustomer(params) {
params.method = 'entmicro.api.synchro.syncCustomer'
return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
}
export function syncCustomer(params){
params.method='entmicro.api.synchro.syncCustomer'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
} }
export function getTableDetail(params){ export function getTableDetail(params) {
params.method='entmicro.api.customer.detail' params.method = 'entmicro.api.customer.detail'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop" // params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
/*获取来源字典的 /*获取来源字典的
*/ */
export function getDictionaryFun(params){ export function getDictionaryFun(params) {
params.method='entmicro.api.common.dictdata.list' params.method = 'entmicro.api.common.dictdata.list'
return http({ return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
// entmicro.api.customer.list.export
//客户信息管理导出
export function clientManageExportApi(params) {
params.method = `entmicro.api.customer.customerListExport`
return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'GET', method: 'GET',
data: params, data: params,
sign: true sign: true
}) })
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,13 +6,15 @@ ...@@ -6,13 +6,15 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http2, http3 } from '@/main'
const URL = '/rop-scrm-entmicro/router' const URL = '/rop-scrm-entmicro/router'
const PATH = 'entmicro.api.one.template.' const PATH = 'entmicro.api.one.template.'
const WURL = '/rop-scrm-wechat/router'
const PATH2 = 'entmicro.api.group.'
const templateList = params => { const templateList = params => {
params.method = `${PATH}page` params.method = `${PATH}page`
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -22,7 +24,7 @@ const templateList = params => { ...@@ -22,7 +24,7 @@ const templateList = params => {
const insert = params => { const insert = params => {
params.method = `${PATH}insert` params.method = `${PATH}insert`
return http({ return http3({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -32,7 +34,7 @@ const insert = params => { ...@@ -32,7 +34,7 @@ const insert = params => {
const update = params => { const update = params => {
params.method = `${PATH}update` params.method = `${PATH}update`
return http({ return http3({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -42,7 +44,7 @@ const update = params => { ...@@ -42,7 +44,7 @@ const update = params => {
const detail = params => { const detail = params => {
params.method = `${PATH}detail` params.method = `${PATH}detail`
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -52,7 +54,7 @@ const detail = params => { ...@@ -52,7 +54,7 @@ const detail = params => {
const status = params => { const status = params => {
params.method = `${PATH}status` params.method = `${PATH}status`
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -62,7 +64,7 @@ const status = params => { ...@@ -62,7 +64,7 @@ const status = params => {
const listDepartmentTree = params => { const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree' params.method = 'entmicro.api.department.listDepartmentTree'
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -72,7 +74,7 @@ const listDepartmentTree = params => { ...@@ -72,7 +74,7 @@ const listDepartmentTree = params => {
const nameVaild = params => { const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid' params.method = 'entmicro.api.one.template.name.valid'
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -82,7 +84,7 @@ const nameVaild = params => { ...@@ -82,7 +84,7 @@ const nameVaild = params => {
const updateNameVaild = params => { const updateNameVaild = params => {
params.method = 'entmicro.api.one.template.name.update.valid' params.method = 'entmicro.api.one.template.name.update.valid'
return http({ return http3({
url: URL, url: URL,
method: 'GET', method: 'GET',
data: params, data: params,
...@@ -90,6 +92,45 @@ const updateNameVaild = params => { ...@@ -90,6 +92,45 @@ const updateNameVaild = params => {
}) })
} }
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http3({
url: WURL,
method: 'POST',
data: params,
sign: true
})
}
//一客一群详情页
const getListApi = params => {
params.method = `${PATH}page`
return http3({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerList = params => {
params.method = `${PATH2}template.customer.page`
return http3({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getFollower = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
templateList, templateList,
...@@ -99,5 +140,9 @@ export default { ...@@ -99,5 +140,9 @@ export default {
update, update,
listDepartmentTree, listDepartmentTree,
nameVaild, nameVaild,
updateNameVaild getStatus,
updateNameVaild,
getListApi,
customerList,
getFollower
} }
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http3 } from '@/main'
//计算是第几次接触该页面 //计算是第几次接触该页面
export function getLoginCount (params){ export function getLoginCount (params){
params.method='entmicro.api.common.findLoginCount' params.method='entmicro.api.common.findLoginCount'
return http({ return http3({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -6,65 +6,98 @@ ...@@ -6,65 +6,98 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http } from '@/main' import { http, http3 } from '@/main'
// const url = 'http://192.168.3.181:9636/rop-scrm-datahub/router'
export function getTableList(params) {
// params.method='scrm.api.datahub.label.querylabeltree'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
export function getTableList (params){ })
params.method='scrm.api.datahub.label.querylabeltree' }
return http({ //计算表格上面的数量
url: '/rop-scrm-datahub/router', export function getTableTagNum(params) {
method: 'POST', // params.method='scrm.api.datahub.label.queryLabelCount'
data: params, params.method = 'scrm.api.datahub.labelgroup.queryLabelCount'
sign: true
return http({
}) url: '/rop-scrm-datahub/router',
} method: 'POST',
//计算表格上面的数量 data: params,
export function getTableTagNum(params){ sign: true
params.method='scrm.api.datahub.label.queryLabelCount'
})
return http({ }
url: '/rop-scrm-datahub/router',
method: 'POST', export function newAddTag(params) {
data: params, // params.method='scrm.api.datahub.label.addlabel'
sign: true params.method = 'scrm.api.datahub.labelgroup.addLabel'
return http({
}) url: '/rop-scrm-datahub/router',
} method: 'POST',
// /router/datahub.api.label.addlabel/1.0.0 data: params,
export function newAddTag(params){ sign: true,
params.method='scrm.api.datahub.label.addlabel' returnAll: true
return http({ })
url: '/rop-scrm-datahub/router', }
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//修改标签 //修改标签
export function updateTag(params){ export function updateTag(params) {
params.method='scrm.api.datahub.label.updatelabel' // params.method='scrm.api.datahub.label.updatelabel'
return http({ params.method = 'scrm.api.datahub.labelgroup.updateLabel'
url: '/rop-scrm-datahub/router', return http({
method: 'POST', url: '/rop-scrm-datahub/router',
data: params, method: 'POST',
sign: true, data: params,
returnAll:true sign: true,
returnAll: true
}) })
} }
//获取单条数据labelList数组 //获取单条数据labelList数组
export function queryLabelListByGroupId(params){ export function queryLabelListByGroupId(params) {
params.method='scrm.api.datahub.label.queryLabelListByGroupId' // params.method='scrm.api.datahub.label.queryLabelListByGroupId'
return http({ params.method = 'scrm.api.datahub.labelgroup.queryLabelListByGroupId'
url: '/rop-scrm-datahub/router', return http({
method: 'POST', url: '/rop-scrm-datahub/router',
data: params, method: 'POST',
sign: true, data: params,
returnAll:true sign: true,
returnAll: true
})
}
})
}
// 查看客户
export function getCustomersList(params) {
params.method = 'entmicro.api.customer.getCustomerPageByTag'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//根据groupId查询标签列表
export function getLabelList(params) {
params.method = 'scrm.api.datahub.labelgroup.queryLabelDetailByGroupId'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 根据标签获取客户列表导出
export function exportLabelList(params) {
params.method = 'entmicro.api.customer.customerPageByTagExport'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
\ No newline at end of file \ No newline at end of file
@import '@/styles/variables.scss';
.el-tag { .el-tag {
color: #666!important; color: #666!important;
font-size: 14px!important; font-size: 14px!important;
...@@ -5,7 +6,7 @@ height: 26px; ...@@ -5,7 +6,7 @@ height: 26px;
line-height: 26px; line-height: 26px;
} }
.el-tag.el-tag--info { .el-tag.el-tag--info {
background: #fafbfe !important; background: transparent !important;
border: 1px solid #e8e8ea !important; border: 1px solid #e8e8ea !important;
border-radius: 4px; border-radius: 4px;
color: #666; color: #666;
...@@ -25,4 +26,54 @@ background: transparent !important; ...@@ -25,4 +26,54 @@ background: transparent !important;
border-radius: 4px; border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3); background-color: rgba(144, 147, 153, 0.3);
} }
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: $btnBlue;
font-size: 16px;
}
.white-hide{
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.color-6{
color:#666666;
}
.color-3{
color:#333333;
}
.color-71{
color: #717171;
}
.color-58{
color: #5850ff;
}
.flex-start{
align-items: flex-start;
display: flex;
}
.flex{
display:flex;
align-items: center;
flex-wrap: wrap;
}
.flex-between{
display:flex;
align-items: center;
justify-content: space-between;
}
.font-20{
font-size: 20px;
}
.font-14{
font-size: 14px;
}
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { message } from '../plugins/element.js'
// import { Message, MessageBox, Loading } from 'element-ui'; // import { Message, MessageBox, Loading } from 'element-ui';
// import moment from 'moment' // import moment from 'moment'
let loadingInstance = '' let loadingInstance = ''
export const Util = { export const Util = {
getExplorer: function() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
},
exportFn:function(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
},
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
...@@ -26,7 +62,7 @@ export const Util = { ...@@ -26,7 +62,7 @@ export const Util = {
*/ */
isSpecialLetter: function (str) { isSpecialLetter: function (str) {
let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"); let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]");
return reg.test(str); return reg.test(str);//true/false
}, },
/** /**
...@@ -116,10 +152,57 @@ export const Util = { ...@@ -116,10 +152,57 @@ export const Util = {
} }
return n return n
},
/**
* 处理输入框只能输入30个字符,一个汉字2个字符,字母数字1个字符,超过截取最大数量字符
*/
cutMaxCharStr:function(e){//e为传入字符串
let str = e
var len = 0
var singleNum = 0
var doubleNum = 0
for (var i = 0; i < e.length; i++) {
var c = e.charCodeAt(i)
//单字节加1
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
len++
} else {
len += 2
}
}
if (len > 30) {
message.error('字数已达上限')
var subLen = 0
var subLen1 = 0
var subLen2 = 0
for (var v = 0; v < e.length; v++) {
var ch = e.charCodeAt(v)
//单字节
if ((ch >= 0x0001 && ch <= 0x007e) || (0xff60 <= ch && ch <= 0xff9f)) {
singleNum += 1
subLen1++
} else {
doubleNum += 2
subLen2++
}
if (singleNum + doubleNum >= 30) {
subLen = subLen1 + subLen2
console.log(subLen1, subLen2, subLen)
console.log(singleNum, singleNum, '单双数')
break
}
}
return str.substr(0, subLen)
}
return str
} }
} }
export const validationTel = Util.validationTel; export const validationTel = Util.validationTel;
export const checkPhone = Util.checkPhone; export const checkPhone = Util.checkPhone;
export const getExplorer=Util.getExplorer;
export const exportFn=Util.exportFn;
export const cutMaxCharStr=Util.cutMaxCharStr;
<template> <template>
<div> <div>
<el-dialog <el-dialog :title="title" :visible.sync="isVisible" :before-close="handleClose" :close-on-click-modal="false" :width="width" :show-close="isShowCloseBtn" :destroy-on-close="isDestroyClose" class="app-dialog">
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
:show-close="isShowCloseBtn"
class="app-dialog"
>
<!-- :modal-append-to-body="false" <!-- :modal-append-to-body="false"
:append-to-body="true"--> :append-to-body="true"-->
<div class="container"> <div class="container">
...@@ -18,12 +10,7 @@ ...@@ -18,12 +10,7 @@
<div slot="footer"> <div slot="footer">
<slot name="btn-front"></slot> <slot name="btn-front"></slot>
<el-button size="small" @click="handleClose" v-if="isHasCancelBtn">取消</el-button> <el-button size="small" @click="handleClose" v-if="isHasCancelBtn">取消</el-button>
<el-button <el-button type="primary" size="small" @click="handleConfirm" :loading="btnLoading">{{ btnOkLabel }}</el-button>
type="primary"
size="small"
@click="handleConfirm"
:loading="btnLoading"
>{{ btnOkLabel }}</el-button>
<!-- isShowThirdBtn 产品说暂时不要这个按钮--> <!-- isShowThirdBtn 产品说暂时不要这个按钮-->
<!-- <el-button v-if="false" @click="btnClick">创建标签</el-button> --> <!-- <el-button v-if="false" @click="btnClick">创建标签</el-button> -->
...@@ -44,6 +31,10 @@ export default { ...@@ -44,6 +31,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isDestroyClose: {
type: Boolean,
default: false
},
isShowThirdBtn: { isShowThirdBtn: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -64,7 +55,7 @@ export default { ...@@ -64,7 +55,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isHasCancelBtn:{ isHasCancelBtn: {
type: Boolean, type: Boolean,
default: true default: true
} }
...@@ -89,8 +80,8 @@ export default { ...@@ -89,8 +80,8 @@ export default {
padding: 20px 20px 10px; padding: 20px 20px 10px;
} }
.el-dialog__footer { .el-dialog__footer {
padding-top:16px ; padding-top: 16px;
padding-bottom: 16px; padding-bottom: 16px;
background: #fff; background: #fff;
} }
.el-dialog__body { .el-dialog__body {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<el-form-item v-for="(item, index) in ruleData" :key="index" :label="item.label" :prop="item.prop || ''" :class="item.class" v-show="!item.hidden"> <el-form-item v-for="(item, index) in ruleData" :key="index" :label="item.label" :prop="item.prop || ''" :class="item.class" v-show="!item.hidden">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="item.type === 'input'"> <template v-if="item.type === 'input'">
<el-input v-if="item.clickFunc" :type="item.inputText || 'text'" :readonly="item.readonly || false" @click.native="item.clickFunc" :class="item.clickFunc ? 'pointer' : ''" :ref="item.ref" v-model="ruleForm[item.prop]" @input="update($event)"></el-input> <el-input v-if="item.clickFunc" :type="item.inputText || 'text'" :readonly="item.readonly || false" :disabled="item.disabled || false" @click.native="item.clickFunc" :class="item.clickFunc ? 'pointer' : ''" :placeholder="item.placeholder || '请输入'" :ref="item.ref" v-model.trim="ruleForm[item.prop]" @keyup.native="ruleForm[item.prop]=update($event)"></el-input>
<el-input v-else :type="item.inputText || 'text'" :readonly="item.readonly || false" :disabled="item.disabled || false" v-model="ruleForm[item.prop]" :maxlength="item.maxlength" :minlength="item.minlength" :placeholder="item.placeholder || '请输入'" :show-password="item.showPassword || false" :clearable="item.clearable" :show-word-limit="item.showWordLimit || false"></el-input> <el-input v-else :type="item.inputText || 'text'" :readonly="item.readonly || false" :disabled="item.disabled || false" v-model.trim="ruleForm[item.prop]" :maxlength="item.maxlength" :minlength="item.minlength" :placeholder="item.placeholder || '请输入'" :show-password="item.showPassword || false" :clearable="item.clearable" :show-word-limit="item.showWordLimit || false"></el-input>
</template> </template>
<template v-else-if="item.type == 'select'"> <template v-else-if="item.type == 'select'">
<el-select v-if="item.visibleFunc" v-model="ruleForm[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="item.filterable || false" @change="selectChange" @visible-change="item.visibleFunc"> <el-select v-if="item.visibleFunc" v-model="ruleForm[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="item.filterable || false" @change="selectChange" @visible-change="item.visibleFunc">
...@@ -89,7 +89,8 @@ export default { ...@@ -89,7 +89,8 @@ export default {
this.$emit('radioChange', event, prop) this.$emit('radioChange', event, prop)
}, },
update(e) { update(e) {
this.$forceUpdate() // this.$forceUpdate()
return this.$Utils.cutMaxCharStr(e.target.value)
} }
} }
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<div class="firstRowBtn" v-if="!expande && isShowBtns && isNeedThreeBtns"> <div class="firstRowBtn" v-if="!expande && isShowBtns && isNeedThreeBtns">
<el-button plain @click="resetTable" size="small">重置</el-button> <el-button plain @click="resetTable" size="small">重置</el-button>
<el-button type="primary" @click="searchTable" size="small">查询</el-button> <el-button type="primary" @click="searchTable" size="small">查询</el-button>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" --> <!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" -->
<!-- <el-button type="primary" @click="syncClick" :loading="ploading" size="small" >同步数据</el-button> --> <!-- <el-button type="primary" @click="syncClick" :loading="ploading" size="small" >同步数据</el-button> -->
</div> </div>
...@@ -46,17 +47,7 @@ ...@@ -46,17 +47,7 @@
<slot name="form-slot"></slot> <slot name="form-slot"></slot>
</template> </template>
</el-form-item> </el-form-item>
<!-- <el-form-item>
<template>
<slot name="formsearch-slot"></slot>
</template>
</el-form-item> -->
</div> </div>
<!-- <div class="rightBottomBtn">
<el-button plain @click="resetTable" size="small">重置</el-button>
<el-button type="primary" @click="searchTable" size="small">查询</el-button>
<el-button type="primary" @click="syncClick" :loading="ploading" size="small" v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)">同步数据</el-button>
</div> -->
</el-form> </el-form>
</div> </div>
</template> </template>
...@@ -92,6 +83,10 @@ export default { ...@@ -92,6 +83,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isThreeRowShow:{
type: Boolean,
default: false
},
merchantModel: { merchantModel: {
type: Number, type: Number,
default: 1 default: 1
...@@ -123,8 +118,9 @@ export default { ...@@ -123,8 +118,9 @@ export default {
//调用默认时间(30天) //调用默认时间(30天)
this.getPassMonthFormatDate() this.getPassMonthFormatDate()
} }
this.$nextTick(()=>{
var sf = document.getElementById('searchForm') var sf = document.getElementById('searchForm')
// this.$nextTick(() => { console.log(sf.clientWidth,'555')
if (sf.clientWidth < 1280 && this.isHasSyncBtn) { if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
console.log(sf.clientWidth, 'sf') console.log(sf.clientWidth, 'sf')
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px' document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
...@@ -132,16 +128,26 @@ export default { ...@@ -132,16 +128,26 @@ export default {
if (sf.clientWidth < 952 && this.isHasSyncBtn) { if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false this.isShowBtns = false
} }
let lineHeight = 75 //75
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) { if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
// console.log('第一次searchForm高度', document.getElementById('searchForm').offsetHeight) console.log('第一次searchForm高度', document.getElementById('searchForm').offsetHeight)
this.expande = false this.expande = false
this.needShowExpande = true this.needShowExpande = true
} else { } else {
this.needShowExpande = false this.needShowExpande = false
this.expande = true this.expande = true
} }
if( sf.clientWidth< 840 && this.isThreeRowShow){
document.querySelector('.itemWidth').style.minHeight= document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
})
//有数据不算表格高度,没数据算高度 //有数据不算表格高度,没数据算高度
// setTimeout(() => { // setTimeout(() => {
// this.$emit('setTableHeightEvent') // this.$emit('setTableHeightEvent')
...@@ -209,12 +215,15 @@ export default { ...@@ -209,12 +215,15 @@ export default {
syncClick() { syncClick() {
this.$emit('syncClick') this.$emit('syncClick')
}, },
handleExport(){
this.$emit('handleExport')
},
expandeClick() { expandeClick() {
this.expande = !this.expande this.expande = !this.expande
setTimeout(() => { // setTimeout(() => {
this.$emit('setTableHeightEvent') // this.$emit('setTableHeightEvent')
}, 200) // }, 200)
}, },
//时间选择器显示默认一月的时间 //时间选择器显示默认一月的时间
/* 获取过去时间,并传值给现在时间 */ /* 获取过去时间,并传值给现在时间 */
...@@ -256,8 +265,9 @@ export default { ...@@ -256,8 +265,9 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/styles/variables.scss';
.search-form { .search-form {
padding: 18px 25px 0 0; padding: 18px 0 0 0;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
min-height: 50px; min-height: 50px;
...@@ -271,11 +281,11 @@ export default { ...@@ -271,11 +281,11 @@ export default {
right: 52px; right: 52px;
z-index: 1; z-index: 1;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 10px;
} }
} }
.itemWidth { .itemWidth {
max-width: 1050px; max-width: 1027px;
min-width: 660px; min-width: 660px;
} }
.expande-button-wrap { .expande-button-wrap {
...@@ -284,7 +294,7 @@ export default { ...@@ -284,7 +294,7 @@ export default {
right: 0; right: 0;
z-index: 99; z-index: 99;
.expande-button { .expande-button {
color: #5850ff; color: $btnBlue;
cursor: pointer; cursor: pointer;
i { i {
height: 8px; height: 8px;
...@@ -293,7 +303,7 @@ export default { ...@@ -293,7 +303,7 @@ export default {
height: 20px; height: 20px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #5850ff; color: $btnBlue;
line-height: 20px; line-height: 20px;
} }
} }
...@@ -314,6 +324,9 @@ export default { ...@@ -314,6 +324,9 @@ export default {
.el-select { .el-select {
width: 215px; width: 215px;
} }
.el-select>.el-input{
width: 215px;
}
.el-form-item__content { .el-form-item__content {
width: 100%; width: 100%;
} }
......
<template>
<div>
<div class="initPanel" :style="{ width: panelWidth, minHeight: panelMinHeight }">
{{ panelContent }}
<img src="@/assets/tagsManage/Shape.png" alt="" />
<i class="el-icon-close" v-if="isShowCloseBtn" @click="closeInitPanel"></i>
</div>
</div>
</template>
<script>
export default {
props: {
panelWidth: {
type: String,
default: ''
},
panelMinHeight: {
type: String,
default: '20px'
},
panelContent: {
type: String,
default: '请传入面板内容'
},
isShowCloseBtn:{
type:Boolean,
default:false
}
},
data() {
return {}
},
methods: {
closeInitPanel() {
this.$emit('closePanel')
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.initPanel {
position: relative;
margin-bottom: 20px;
box-sizing: border-box;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
padding: 10px 38px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
img {
position: absolute;
left: 16px;
top: 13px;
}
i {
position: absolute;
top: 14px;
right: 18px;
width: 9px;
height: 9px;
cursor: pointer;
}
}
</style>
...@@ -19,7 +19,7 @@ export const fetchConfig = function (isEnv = true) { ...@@ -19,7 +19,7 @@ export const fetchConfig = function (isEnv = true) {
} }
// https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base // https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config // https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config
return new Http({request:{timeout:3000}}).get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config') return new Http({request:{timeout:3000}}).get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config2')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -29,6 +29,7 @@ Vue.config.productionTip = false ...@@ -29,6 +29,7 @@ Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.use(glsxTable); Vue.use(glsxTable);
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.size = 'small'
// Vue.prototype.btn_size = 'mini' // Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants Vue.prototype.$Constants = Constants
Vue.prototype.$Utils = Util Vue.prototype.$Utils = Util
...@@ -41,4 +42,6 @@ Object.keys(filters).forEach(key => { ...@@ -41,4 +42,6 @@ Object.keys(filters).forEach(key => {
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params)
export const http3 = params => Vue.prototype.$http3(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
...@@ -18,11 +18,18 @@ const staticRoutes = Object.freeze([ ...@@ -18,11 +18,18 @@ const staticRoutes = Object.freeze([
meta: {} meta: {}
}, },
{ {
name: 'clientDataOverview',
path: "/clientDataOverview/group/:id",
component: resolve => require([`@/views/clientDataOverview/group.vue`], resolve),
meta: {}
},
{
name: 'clientManage', name: 'clientManage',
path: "/clientManage/index", path: "/clientManage/index",
component: resolve => require([`@/views/clientManage/index.vue`], resolve), component: resolve => require([`@/views/clientManage/index.vue`], resolve),
meta: {} meta: {}
}, },
{ {
name: 'clientDetail', name: 'clientDetail',
path: "/clientManage/clientDetail", path: "/clientManage/clientDetail",
...@@ -54,6 +61,12 @@ const staticRoutes = Object.freeze([ ...@@ -54,6 +61,12 @@ const staticRoutes = Object.freeze([
meta: {} meta: {}
}, },
{ {
name: 'viewCustomers',
path: "/tagsManage/viewCustomers/:info/:type",
component: resolve => require([`@/views/tagsManage/viewCustomers.vue`], resolve),
meta: {},
},
{
name: 'expand', name: 'expand',
path: "/expand/index", path: "/expand/index",
component: resolve => require([`@/views/expand/index.vue`], resolve), component: resolve => require([`@/views/expand/index.vue`], resolve),
...@@ -88,47 +101,53 @@ const staticRoutes = Object.freeze([ ...@@ -88,47 +101,53 @@ const staticRoutes = Object.freeze([
path: "/guestGroup/add/:id", path: "/guestGroup/add/:id",
component: resolve => require([`@/views/guestGroup/add.vue`], resolve), component: resolve => require([`@/views/guestGroup/add.vue`], resolve),
meta: {} meta: {}
},
{
name: 'guestDetail',
path: "/guestGroup/detail/:id",
component: resolve => require([`@/views/guestGroup/detail.vue`], resolve),
meta: {}
} }
]) ])
export default staticRoutes export default staticRoutes
// { // {
// path: "/clientMassTexting", // path: "/clientMassTexting",
// name: "clientMassTexting", // name: "clientMassTexting",
// meta: { title: "客户群发" }, // meta: { title: "客户群发" },
// hidden: true, // hidden: true,
// keepAlive: false, // keepAlive: false,
// component: () => import("../views/clientMassTexting/index.vue"), // component: () => import("../views/clientMassTexting/index.vue"),
// }, // },
// { // {
// path: "/clientMassTexting/addMassTexting", // path: "/clientMassTexting/addMassTexting",
// name: "addMassTexting", // name: "addMassTexting",
// meta: { title: "新增群发" }, // meta: { title: "新增群发" },
// hidden: true, // hidden: true,
// keepAlive: false, // keepAlive: false,
// component: () => import("../views/clientMassTexting/addMassTexting.vue"), // component: () => import("../views/clientMassTexting/addMassTexting.vue"),
// }, // },
// { // {
// path: "/clientMassTexting/detailMassTexting", // path: "/clientMassTexting/detailMassTexting",
// name: "detailMassTexting", // name: "detailMassTexting",
// meta: { title: "群发详情" }, // meta: { title: "群发详情" },
// hidden: true, // hidden: true,
// keepAlive: false, // keepAlive: false,
// component: () => import("../views/clientMassTexting/detailMassTexting.vue"), // component: () => import("../views/clientMassTexting/detailMassTexting.vue"),
// }, // },
// { // {
// path: "/clientPartGroup", // path: "/clientPartGroup",
// name: "clientPartGroup", // name: "clientPartGroup",
// meta: { title: "客户分群" }, // meta: { title: "客户分群" },
// hidden: true, // hidden: true,
// keepAlive: false, // keepAlive: false,
// component: () => import("../views/clientPartGroup/index.vue"), // component: () => import("../views/clientPartGroup/index.vue"),
// }, // },
// { // {
// path: "/crowdCircleImage", // path: "/crowdCircleImage",
// name: "crowdCircleImage", // name: "crowdCircleImage",
// meta: { title: "人群圈像" }, // meta: { title: "人群圈像" },
// hidden: true, // hidden: true,
// keepAlive: false, // keepAlive: false,
// component: () => import("../views/clientPartGroup/crowdCircleImage.vue"), // component: () => import("../views/clientPartGroup/crowdCircleImage.vue"),
// }, // },
\ No newline at end of file \ No newline at end of file
...@@ -12,13 +12,18 @@ import 'glsx-components/dist/glsx-components.css' ...@@ -12,13 +12,18 @@ import 'glsx-components/dist/glsx-components.css'
let routes = [] let routes = []
let router = null let router = null
let instance = null let instance = null
// http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3
export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch const { response, request,request2,request3, request4,sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
//Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) //Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
.green-text { .green-text {
color: #00A854; color: #00A854;
} }
.gray-text{
color:#666666;
margin-left:6px;
}
.red-text { .red-text {
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
} }
...@@ -22,7 +25,7 @@ ...@@ -22,7 +25,7 @@
} }
} }
.pure-blue-text{ .pure-blue-text{
color:$btnBlue; color:$btnBlue!important;
} }
.green { .green {
background-color: #00A854; background-color: #00A854;
......
@import './variables.scss'; @import './variables.scss';
@import './common.scss'; @import './common.scss';
@import './resetelement.scss'; @import './resetelement.scss';
body,
html {
body,html{ width: 100%;
width:100%; height: 100%;
margin: 0;
height:100%; padding: 0;
margin:0;
padding:0;
overflow: hidden; overflow: hidden;
background-color: $bgColor; background-color: $bgColor;
}
}
// #app {
#app { // height: 100%;
height: 100%; // overflow: auto;
overflow: auto; // }
// html, body, #app {
} // width: 100%;
// height: 100%;
// html, body, #app { // }
// width: 100%;
// height: 100%;
// }
// 默认去掉所有p元素的上下边距 // 默认去掉所有p元素的上下边距
p{ p {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
} }
button{
button {
border: none; border: none;
&:hover{ &:hover {
cursor: pointer; cursor: pointer;
} }
} }
// 子系统不设外边距
.scrm-sub-client-container{ // 子系统不设外边距
padding: 0 20px 20px 40px; .scrm-sub-client-container {
} padding: 0 20px 20px 40px;
.el-table .cell{ }
.el-table .cell {
// line-height: 20px!important; // line-height: 20px!important;
}
\ No newline at end of file \ No newline at end of file
}
\ No newline at end of file \ No newline at end of file
...@@ -21,59 +21,8 @@ ...@@ -21,59 +21,8 @@
line-height: 28px; line-height: 28px;
} }
// .el-dialog__footer { /deep/ .el-input__inner:focus{border-color:$btnBlue!important;}
// .el-button+.el-button {
// margin-left: 20px;
// }
// .el-button {
// font-size: 14px;
// font-weight: 400;
// padding: 9px 21px;
// background: $btnBlue;
// border-radius: 4px;
// }
// .el-button:first-child {
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid #999999;
// box-sizing: border-box;
// font-weight: 600;
// color: #999999;
// &:hover{
// border-color: $btnBlue;
// color: $btnBlue;
// }
// }
// .el-button:nth-child(2){
// // height: 32px;
// background: $btnBlue;
// border: 1px solid $btnBlue;
// color: #fff;
// border:1px solid $btnBlue;
// &:hover{
// background-color: $lightBtnBlue;
// border:1px solid $lightBtnBlue;
// }
// }
// .el-button:nth-child(3){
// background: #ffffff;
// border: 1px solid #999999;
// box-sizing: border-box;
// font-weight: 600;
// color: #999999;
// &:hover{
// border-color: $btnBlue;
// color: $btnBlue;
// }
// }
// }
/deep/ .el-input__inner:focus{border-color:$borderBlue!important;}
/deep/.el-range-editor.is-active, /deep/.el-range-editor.is-active,
.el-range-editor.is-active:hover { .el-range-editor.is-active:hover {
border-color: $borderBlue; border-color: $btnBlue;
} }
// /deep/.el-table__fixed-right{
// height: 100% !important;
// }
\ No newline at end of file \ No newline at end of file
$bgColor:#F4F5FA; $bgColor:#F4F5FA;
$btnBlue:#5850ff; $btnBlue:#5850ff;
$borderBlue:#5850ff;
$lightBtnBlue:#9994FF; $lightBtnBlue:#9994FF;
import { Message } from 'element-ui'
let util = {}
util.cloneText = function (message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function (sign = '-') {
let day = new Date();
let month = day.getMonth() + 1;
let date = day.getDate();
if (month < 10) month = '0' + month;
if (date < 10) date = '0' + date;
var s = day.getFullYear() + sign + month + sign + date;
return s;
}
util.getBeforeMonth = function (days) {
let month = new Date().getMonth() + 1;
let year = new Date().getFullYear();
let arr = new Array();
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1;
month = month + 12;
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
}
return arr;
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function (time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function (dateStr, separator) {
if (!separator) {
separator = "-";
}
var dateArr = dateStr.split(separator);
var year = parseInt(dateArr[0]);
var month;
//处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) {
month = parseInt(dateArr[1].substring(1));
} else {
month = parseInt(dateArr[1]);
}
var day = parseInt(dateArr[2]);
var date = new Date(year, month - 1, day);
return date;
}
util.getDay = function (num, str = '-') {
var today = new Date();
var nowTime = today.getTime();
var ms = 24 * 3600 * 1000 * num;
today.setTime(parseInt(nowTime + ms));
var oYear = today.getFullYear();
var oMoth = (today.getMonth() + 1).toString();
if (oMoth.length <= 1) oMoth = '0' + oMoth;
var oDay = today.getDate().toString();
if (oDay.length <= 1) oDay = '0' + oDay;
return oYear + str + oMoth + str + oDay;
}
util.openUrl = function (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image();
// 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous");
image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
var context = canvas.getContext("2d");
context.drawImage(image, 0, 0, image.width, image.height);
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件
};
image.src = imgsrc;
}
export default util
\ No newline at end of file \ No newline at end of file
<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="reminder font-14 color-3">企业标签 | 自动更新</div> -->
<div class="back color-58 font-14" @click="goBack">返回人群管理</div>
</div>
<div class="main-container">
<div class="main-container-head flex-between">
<div class="main-container-head-title color-3 font-20">
全部客户
<span class="main-container-head-number font-14">{{ totalCount }}个</span>
</div>
<el-button type="primary" class="export flex" @click="handleExport()">导出</el-button>
</div>
<GLTable ref="groupRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :noDataImg="url" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<span slot="customerName" class="flex-center" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip>
<span style="font-size: 12px" :class="[scope.scope.type == 1 ? 'pure-blue-text' : '', scope.scope.type == 2 ? 'pure-yello-text' : '']">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
</span>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
<div v-if="idx == 0">
<span>{{ list.nickName }}</span>
<span class="smallFontSize" :class="[list.type == 1 ? 'pure-green-text' : '', list.type == 2 ? 'pure-yello-text' : '']">@{{ list.corpName }}</span>
</div>
<span v-if="idx == 1">
<el-popover placement="right-start" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<div style="padding-bottom:3px !important" v-for="(i, index) in scope.scope.nickNameList" :key="index">
<span>{{ i.nickName }}</span>
<span style="height: 20px;font-size: 12px; letter-spacing: 0; line-height: 20px; font-weight: 400;margin-left:2px" :class="[i.type == 1 ? 'pure-green-text' : '', i.type == 2 ? 'pure-yello-text' : '']">@{{ i.corpName }}</span>
</div>
<img class="imgEll" src="@/assets/tagsManage/ellipsis.png" alt="" slot="reference" />
</el-popover>
</span>
</div>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import { getCustomerList, customerClusterListExport } from '@/api/modules/clientDataOverview'
import url from '@/assets/empty.png'
export default {
name: 'group',
data() {
return {
getListApi: getCustomerList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableSearchForm: {},
id: this.$route.params.id ? this.$route.params.id : '',
totalCount: '',
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: '120'
},
{
label: '企微名称',
prop: 'nickNameList',
addHtml: 'nickNameList',
minWidth: 200
},
{
label: '联系电话',
prop: 'customerPhone',
minWidth: '110'
},
{
label: '车牌号',
prop: 'carNumber'
},
{
label: '车架号(后6位)',
prop: 'carVin',
minWidth: '110'
},
{
label: '车系',
prop: 'audi',
line: 2
},
{
label: '跟进员工',
prop: 'followStaff',
// addHtml: 'followStaff',
minWidth: 140
},
{
label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoinName',
width: 100
},
{
label: '添加时间',
prop: 'addTime',
width: 150
}
]
},
describeData: [
{
name: '潜在意向客户',
info: '无购车且无其他交易行为的所有客户'
},
{
name: '潜在意向客户(已加企微客户)',
info: '在潜在意向客户中,已加企微的客户'
},
{
name: '潜在意向客户(未加企微客户)',
info: '在潜在意向客户中,未加企微的客户'
},
{
name: '基盘客户',
info: '有购车或其他交易行为的所有客户'
},
{
name: '基盘客户(已加企微客户)',
info: '在基盘客户中,已加企微的客户'
},
{
name: '基盘客户(未加企微客户)',
info: '在基盘客户中,未加企微的客户'
},
{
name: '新车客户',
info: '购车时间3个月的客户'
},
{
name: '车险待续保客户',
info: '近一个月内车险即将到期的客户'
},
{
name: '新车待首保客户',
info: '购车时间5~7个月内,且无保养记录的客户'
},
{
name: '沉默客户',
info: '超过180天未到店的客户'
}
],
url: url,
//describeData: ['无购车且无其他交易行为的所有客户', '在潜在意向客户中,已加企微的客户', '在潜在意向客户中,未加企微的客户', '有购车或其他交易行为的所有客户', '在基盘客户中,已加企微的客户', '在基盘客户中,未加企微的客户', '购车时间3个月的客户', '近一个月内车险即将到期的客户', '购车时间5~7个月内,且无保养记录的客户', '超过180天未到店的客户']
}
},
created() {
let { id } = this
this.init(id)
},
computed: {
describe() {
let id = this.id - 1
return this.describeData[id]
}
},
methods: {
init(id) {
this.tableSearchForm = {
crowdId: id
}
// this.getTotalCount()
},
//导出
handleExport() {
var params = {
crowdId: this.id,
pageSize: 10,
pageNum: 1
}
customerClusterListExport(params).then(res => {
this.$Utils.exportFn(res)
})
},
setTableFinishFun() {
this.totalCount = this.$refs.groupRef.total
this.$refs.groupRef.data.length ? (this.$refs.groupRef.tableHeightValues = '') : this.$refs.groupRef.setTableHeightFun()
},
goBack() {
this.$router.replace({ path: '/clientDataOverview/index' })
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.expandImg {
display: flex;
justify-content: center;
.smallFontSize {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.imgEll {
margin-left: 6.5px;
cursor: pointer;
// margin-bottom:3px;
}
}
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.scrm-sub-client-container {
.head-container {
position: relative;
margin-bottom: 10px;
width: 100%;
height: 112px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
padding: 20px;
box-sizing: border-box;
&-title {
font-weight: 500;
line-height: 20px;
letter-spacing: 1px;
margin-bottom: 10px;
}
&-content {
font-weight: 400;
line-height: 20px;
width: calc(100% - 156px);
}
.back {
font-weight: 400;
line-height: 22px;
padding: 5px 16px;
border-radius: 4px;
border: 1px solid $btnBlue;
position: absolute;
right: 20px;
top: 20px;
color: $btnBlue;
cursor: pointer;
}
}
.main-container {
width: 100%;
height: 100%;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
padding: 20px;
box-sizing: border-box;
.main-container-head {
margin-bottom: 20px;
&-title {
font-weight: 500;
line-height: 20px;
letter-spacing: 1px;
}
&-number {
color: $btnBlue;
margin-left: 6px;
font-weight: 400;
line-height: 20px;
}
.export {
width: 74px;
height: 32px;
box-sizing: border-box;
// font-weight: 400;
padding: 6px 23px;
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid rgba(105, 105, 105, 0.3);
}
}
}
.pure-blue-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="topmsg"> <div class="topmsg">
<div class="leftPieEcharts"> <div class="leftPieEcharts">
<span class="title">客户总数</span> <span class="title">客户总数</span>
<span class="subtitle" v-if="accountLevel==4">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span> <span class="subtitle" v-if="accountLevel == 4">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span>
<span class="subtitle" v-else>企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重</span> <span class="subtitle" v-else>企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重</span>
<span class="clientTotal"> <span class="clientTotal">
<!-- 可以动态跑数字 --> <!-- 可以动态跑数字 -->
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<div class="itembox"> <div class="itembox">
<div class="no-buy"> <div class="no-buy">
<div class="no-buy-total item"> <GLButton class="no-buy-total item" @click="goto(1)" fn="人群客户列表" mode="div">
<span>潜在意向客户数</span> <span>潜在意向客户数</span>
<span>无购车且无其他交易行为的所有客户</span> <span>无购车且无其他交易行为的所有客户</span>
<span v-if="!isEmptyObj"> <span v-if="!isEmptyObj">
...@@ -63,10 +63,11 @@ ...@@ -63,10 +63,11 @@
<!-- <i class="vertical-line"></i> --> <!-- <i class="vertical-line"></i> -->
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data> <no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
</div> </GLButton>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<div class="rightWrap"> <div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap"> <GLButton class="inCompanyWechatNum item smallWrap" @click="goto(2)" fn="人群客户列表" mode="div">
<span>已加企微客户数</span> <span>已加企微客户数</span>
<span> <span>
{{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }} {{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }}
...@@ -74,22 +75,25 @@ ...@@ -74,22 +75,25 @@
</span> </span>
<span>在潜在意向客户中,已加企微的客户</span> <span>在潜在意向客户中,已加企微的客户</span>
<!-- <i class="horizontal-line"></i> --> <!-- <i class="horizontal-line"></i> -->
</div> </GLButton>
<el-divider></el-divider> <el-divider></el-divider>
<div class="outCompanyWechatNum item smallWrap"> <GLButton class="outCompanyWechatNum item smallWrap" @click="goto(3)" fn="人群客户列表" mode="div">
<span>未加企微客户数</span> <span>未加企微客户数</span>
<span> <span>
{{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }} {{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span> <span class="person-text">人</span>
</span> </span>
<span>在潜在意向客户中,未加企微的客户</span> <span>在潜在意向客户中,未加企微的客户</span>
<!-- &nbsp;&nbsp;&gt;&gt;--> <!-- &nbsp;&nbsp;&gt;&gt;-->
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4">引流企微 <i class="el-icon-d-arrow-right"></i></button> <button class="btn" @click.stop="toGuideCompanyWechat" v-if="accountLevel == 4">
</div> 引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
</GLButton>
</div> </div>
</div> </div>
<div class="buy"> <div class="buy">
<div class="buy-total item"> <GLButton class="buy-total item" @click="goto(4)" fn="人群客户列表" mode="div">
<!-- <span>购买(存档)客户数</span> --> <!-- <span>购买(存档)客户数</span> -->
<span>基盘客户数</span> <span>基盘客户数</span>
<span>有购车或其他交易行为的所有客户</span> <span>有购车或其他交易行为的所有客户</span>
...@@ -106,10 +110,10 @@ ...@@ -106,10 +110,10 @@
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data> <no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
<!-- <i class="vertical-line"></i> --> <!-- <i class="vertical-line"></i> -->
</div> </GLButton>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<div class="rightWrap"> <div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap"> <GLButton class="inCompanyWechatNum item smallWrap" @click="goto(5)" fn="人群客户列表" mode="div">
<span>已加企微客户数</span> <span>已加企微客户数</span>
<span> <span>
{{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }} {{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }}
...@@ -118,17 +122,20 @@ ...@@ -118,17 +122,20 @@
<span>在基盘客户中,已加企微的客户</span> <span>在基盘客户中,已加企微的客户</span>
<!-- <button class="btn">企微魔方&gt;&gt;</button> --> <!-- <button class="btn">企微魔方&gt;&gt;</button> -->
<!-- <i class="horizontal-line"></i> --> <!-- <i class="horizontal-line"></i> -->
</div> </GLButton>
<el-divider></el-divider> <el-divider></el-divider>
<div class="outCompanyWechatNum item smallWrap"> <GLButton class="outCompanyWechatNum item smallWrap" @click="goto(6)" fn="人群客户列表" mode="div">
<span>未加企微客户数</span> <span>未加企微客户数</span>
<span> <span>
{{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }} {{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span> <span class="person-text">人</span>
</span> </span>
<span>在基盘客户中,未加企微的客户</span> <span>在基盘客户中,未加企微的客户</span>
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4" >引流企微 <i class="el-icon-d-arrow-right"></i></button> <button class="btn" @click.stop="toGuideCompanyWechat" v-if="accountLevel == 4">
</div> 引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
</GLButton>
</div> </div>
</div> </div>
</div> </div>
...@@ -136,15 +143,17 @@ ...@@ -136,15 +143,17 @@
<div class="middlemsg"> <div class="middlemsg">
<h3 class="pageSubTitle">客户分群</h3> <h3 class="pageSubTitle">客户分群</h3>
<div class="itembox"> <div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index"> <template v-for="(item, index) in titles">
<p>{{ item.name }}</p> <GLButton class="item" @click="goto(item.id)" fn="人群客户列表" mode="div" :key="index">
<p>{{ item.subName }}</p> <p>{{ item.name }}</p>
<p> <p>{{ item.subName }}</p>
{{ item.num | overThousandFilter }} <p>
<span class="person-text">人</span> {{ item.num | overThousandFilter }}
</p> <span class="person-text">人</span>
<img :src="item.url" alt="" /> </p>
</div> <img :src="item.url" alt="" />
</GLButton>
</template>
</div> </div>
</div> </div>
<h3 class="pageSubTitle">客户增长趋势</h3> <h3 class="pageSubTitle">客户增长趋势</h3>
...@@ -211,8 +220,8 @@ export default { ...@@ -211,8 +220,8 @@ export default {
}, },
data() { data() {
return { return {
isCloseShowNumTag:false, isCloseShowNumTag: false,
isReload:true, isReload: true,
isShowModal: false, isShowModal: false,
isHasCustomerCountBanner: false, isHasCustomerCountBanner: false,
topDataObj: { topDataObj: {
...@@ -235,25 +244,29 @@ export default { ...@@ -235,25 +244,29 @@ export default {
name: '新车客户数', name: '新车客户数',
subName: '购车时间3个月的客户', subName: '购车时间3个月的客户',
num: 0, num: 0,
url: url1 url: url1,
id: 7
}, },
{ {
name: '车险待续保客户数', name: '车险待续保客户数',
subName: '近一个月内车险即将到期的客户', subName: '近一个月内车险即将到期的客户',
num: 0, num: 0,
url: url2 url: url2,
id: 8
}, },
{ {
name: '新车待首保客户数', name: '新车待首保客户数',
subName: '购车时间5~7个月内,且无保养记录的客户', subName: '购车时间5~7个月内,且无保养记录的客户',
num: 0, num: 0,
url: url3 url: url3,
id: 9
}, },
{ {
name: '沉默客户数', name: '沉默客户数',
subName: '超过180天未到店的客户', subName: '超过180天未到店的客户',
num: 0, num: 0,
url: url4 url: url4,
id: 10
} }
], ],
isNoBuyUp: 0, //默认环比为增 isNoBuyUp: 0, //默认环比为增
...@@ -268,17 +281,18 @@ export default { ...@@ -268,17 +281,18 @@ export default {
dialogVisible: false, dialogVisible: false,
//只有门店可以引流企微 //只有门店可以引流企微
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店 accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
userType: 0 //1是商户,2是员工
} }
}, },
mounted() { mounted() {
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
var that =this; var that = this
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
that.isReload=false that.isReload = false
that.$nextTick(() => { that.$nextTick(() => {
that.isReload=true that.isReload = true
}); })
}) })
}, },
computed: { computed: {
...@@ -301,9 +315,10 @@ export default { ...@@ -301,9 +315,10 @@ export default {
} }
}, },
async created() { async created() {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType
} }
// 掉两个数据接口 // 掉两个数据接口
...@@ -312,7 +327,6 @@ export default { ...@@ -312,7 +327,6 @@ export default {
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner; //先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于0,继续显示banner; //不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于0,继续显示banner;
this.getDataOverviewBarMapFun() this.getDataOverviewBarMapFun()
}, },
methods: { methods: {
...@@ -427,11 +441,11 @@ export default { ...@@ -427,11 +441,11 @@ export default {
this.isBuyUp = res.purchaseUp this.isBuyUp = res.purchaseUp
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner; //先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于等于0,继续显示banner; //不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于等于0,继续显示banner;
console.log(this.accountLevel,this.isShowModal,this.topDataObj.customerCount,'myData') console.log(this.accountLevel, this.isShowModal, this.topDataObj.customerCount, 'myData')
if(this.isShowModal && this.accountLevel!==4){ if (this.isShowModal && this.accountLevel !== 4) {
this.isShowModal=false; //关掉引导层 this.isShowModal = false //关掉引导层
} }
if (this.isShowModal && this.accountLevel==4) { if (this.isShowModal && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true this.isHasCustomerCountBanner = true
this.$nextTick(() => { this.$nextTick(() => {
$('img[usemap]').rwdImageMaps() $('img[usemap]').rwdImageMaps()
...@@ -442,7 +456,7 @@ export default { ...@@ -442,7 +456,7 @@ export default {
}, 1000) }, 1000)
} else if (!this.isShowModal && this.topDataObj.customerCount > 0) { } else if (!this.isShowModal && this.topDataObj.customerCount > 0) {
this.isHasCustomerCountBanner = false this.isHasCustomerCountBanner = false
} else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel==4) { } else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true this.isHasCustomerCountBanner = true
this.$nextTick(() => { this.$nextTick(() => {
$('img[usemap]').rwdImageMaps() $('img[usemap]').rwdImageMaps()
...@@ -486,7 +500,7 @@ export default { ...@@ -486,7 +500,7 @@ export default {
}, },
clickThirty() { clickThirty() {
this.timeGap = 30 this.timeGap = 30
this.isCloseShowNumTag=true this.isCloseShowNumTag = true
if (Object.keys(this.thirtyDayStorage).length == 0) { if (Object.keys(this.thirtyDayStorage).length == 0) {
this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据 this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据
} else { } else {
...@@ -496,7 +510,7 @@ export default { ...@@ -496,7 +510,7 @@ export default {
}, },
clickSeven() { clickSeven() {
this.timeGap = 7 this.timeGap = 7
this.isCloseShowNumTag=false this.isCloseShowNumTag = false
if (Object.keys(this.sevenDayStorage).length == 0) { if (Object.keys(this.sevenDayStorage).length == 0) {
this.getDataOverviewBarMapFun() //重新掉一遍接口 this.getDataOverviewBarMapFun() //重新掉一遍接口
} else { } else {
...@@ -508,6 +522,12 @@ export default { ...@@ -508,6 +522,12 @@ export default {
this.isShowModal = false this.isShowModal = false
// 允许页面滚动: // 允许页面滚动:
document.body.style.overflow = 'visible' document.body.style.overflow = 'visible'
},
//跳转到人群客户列表
goto(id) {
console.log(this.userType)
if (this.userType == 2) return
this.$router.push('/clientDataOverview/group/' + id)
} }
} }
} }
...@@ -568,6 +588,7 @@ export default { ...@@ -568,6 +588,7 @@ export default {
} }
.bannerWrapBox { .bannerWrapBox {
width: 100%; width: 100%;
min-width: 1050px;
// position: relative; // position: relative;
// .inTimeBtn { // .inTimeBtn {
// position: absolute; // position: absolute;
...@@ -595,6 +616,7 @@ export default { ...@@ -595,6 +616,7 @@ export default {
} }
.topmsg { .topmsg {
display: flex; display: flex;
min-width: 1050px;
.leftPieEcharts { .leftPieEcharts {
position: relative; position: relative;
background-color: #fff; background-color: #fff;
...@@ -727,7 +749,7 @@ export default { ...@@ -727,7 +749,7 @@ export default {
} }
.itembox { .itembox {
width: calc(100% - 372px); width: calc(100% - 372px);
min-width: 500px;
.item { .item {
// border: 1px solid rgba(121, 121, 121, 1); // border: 1px solid rgba(121, 121, 121, 1);
height: 119px; height: 119px;
...@@ -738,6 +760,7 @@ export default { ...@@ -738,6 +760,7 @@ export default {
height: 238px; height: 238px;
width: 50%; width: 50%;
position: relative; position: relative;
cursor: pointer;
> span { > span {
position: absolute; position: absolute;
&:first-child { &:first-child {
...@@ -829,7 +852,9 @@ export default { ...@@ -829,7 +852,9 @@ export default {
.rightWrap { .rightWrap {
width: 48%; width: 48%;
margin-left: 20px; margin-left: 20px;
cursor: pointer;
position: relative; position: relative;
.smallWrap { .smallWrap {
position: relative; position: relative;
> span { > span {
...@@ -867,7 +892,7 @@ export default { ...@@ -867,7 +892,7 @@ export default {
padding: 6px 20px; padding: 6px 20px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
background-color: #fff; background-color: #fff;
color: #6861ff; color: #6861ff;
font-size: 14px; font-size: 14px;
...@@ -897,6 +922,7 @@ export default { ...@@ -897,6 +922,7 @@ export default {
} }
} }
.middlemsg { .middlemsg {
min-width: 1050px;
.itembox { .itembox {
display: flex; display: flex;
width: 100%; width: 100%;
...@@ -910,11 +936,12 @@ export default { ...@@ -910,11 +936,12 @@ export default {
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// border: 1px solid rgba(121, 121, 121, 1); // border: 1px solid rgba(121, 121, 121, 1);
cursor: pointer;
&:not(:first-child) { &:not(:first-child) {
margin-left: 20px; margin-left: 20px;
} }
&:hover { &:hover {
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
} }
p { p {
position: absolute; position: absolute;
...@@ -958,6 +985,7 @@ export default { ...@@ -958,6 +985,7 @@ export default {
.bottommsg { .bottommsg {
position: relative; position: relative;
width: 100%; width: 100%;
min-width: 1050px;
height: 578px; height: 578px;
background-color: #fff; background-color: #fff;
.timeDuring { .timeDuring {
...@@ -1052,12 +1080,12 @@ export default { ...@@ -1052,12 +1080,12 @@ export default {
color: #999999; color: #999999;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
color: $btnBlue; color: $btnBlue;
} }
} }
.activeDayIcon { .activeDayIcon {
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
color: $btnBlue; color: $btnBlue;
} }
} }
......
...@@ -43,35 +43,27 @@ ...@@ -43,35 +43,27 @@
</p> </p>
</div> </div>
<div class="rightWrap"> <div class="rightWrap">
<p> <div class="choseRow">
<span>全部客户</span> <div class="choseItem" :class="{ activeItem: currentIndex == index }" v-for="(item, index) in titles" :key="index" @click="tabClick(index)">
<span>{{ clientTableDataNum || 0 }}个</span> <span>
</p> {{ item.name }}
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent"> <template>({{ item.personNum || 0 }})个</template>
<span class="inline-b" slot="form-slot"> </span>
<el-button plain @click="resetTable">重置</el-button> </div>
<el-button type="primary" @click="searchTable">查询</el-button> </div>
</span> <template v-if="currentIndex == 0">
</search-form> <client ref="childComp" :url="url" @goDetail="goDetail" ></client>
<!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 --> </template>
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url"> <template v-if="currentIndex == 1">
<span slot="customerName" class="flex-center" slot-scope="scope"> <follow-employee ref="childComp" :url="url" ></follow-employee>
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top"> </template>
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span> <template v-if="currentIndex == 2">
</el-tooltip> <leave-group-client ref="childComp" :url="url" @goDetail="goDetail"></leave-group-client>
</template>
<template v-if="currentIndex == 3">
<potential-client ref="childComp" :url="url"></potential-client>
</template>
<span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span>
</span>
<span slot="joinScene" slot-scope="scope">
<span>{{ scope.scope.joinScene == 1 ? '直接邀请入群' : scope.scope.joinScene == 2 ? '通过邀请链接入群' : scope.scope.joinScene == 3 ? '通过扫描群二维码入群' : '' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span>
</template>
</GLTable>
<basic-dialog title="" width="547px" :isVisible="dialogVisible" btnOkLabel="我知道了" :isHasCancelBtn="false" @confirmDialog="handleConfirm" @closeDialog="handleClose"> <basic-dialog title="" width="547px" :isVisible="dialogVisible" btnOkLabel="我知道了" :isHasCancelBtn="false" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<div class="content-body"> <div class="content-body">
<p>该客户暂无员工跟进,无法查看该客户详情,</p> <p>该客户暂无员工跟进,无法查看该客户详情,</p>
...@@ -84,133 +76,53 @@ ...@@ -84,133 +76,53 @@
</template> </template>
<script> <script>
import { getTableDetail, getDetailTableList, getClientTableDetail } from '@/api/modules/clientGroupManage' import { getTableDetail, getClientTableDetail } from '@/api/modules/clientGroupManage'
import client from '@/views/clientGroupManage/components/client.vue'
import followEmployee from '@/views/clientGroupManage/components/followEmployee.vue'
import leaveGroupClient from '@/views/clientGroupManage/components/leaveGroupClient.vue'
import potentialClient from '@/views/clientGroupManage/components/potentialClient.vue'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
export default { export default {
name: 'clientGroupDetail', name: 'clientGroupDetail',
components: {
client,
followEmployee,
leaveGroupClient,
potentialClient
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
groupName: this.$route.query.groupName, // ['全部客户', '跟进员工', '退群客户', '潜在客户']
url: url, titles: [
leftPanelList: {},
searchForm: {},
searchFormTable: {},
clientGroupFormList: [
{ {
type: 'daterange', name: '全部客户',
prop: 'daterange', personNum: 0
label: '入群时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
}, },
{ {
type: 'select', name: '跟进员工',
prop: 'customerSex', personNum: 0
label: '性别',
placeholder: '请选择性别',
options: [
{
label: '全部',
value: null
},
{
label: '男',
value: 1
},
{
label: '女',
value: 2
},
{
label: '未知',
value: 0
}
]
}, },
{ {
type: 'input', name: '退群客户',
inputType: 'text', personNum: 0
prop: 'groupNickName',
label: '本群昵称',
placeholder: '请输入本群昵称'
}, },
{ {
type: 'input', name: '潜在客户',
inputType: 'text', personNum: 0
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, currentIndex: 0,
tableParams: { groupName: this.$route.query.groupName,
// btnId: new Date().getTime() + parseInt(Math.random() * 1000), url: url,
listName: 'data', leftPanelList: {},
tableColumns: [
{
label: '本群昵称',
prop: 'groupNickName'
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: 100
},
{
label: '手机号码',
prop: 'customerPhone'
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{
label: '入群方式',
prop: 'joinScene',
addHtml: 'joinScene'
},
{
label: '邀请人',
prop: 'invitorName'
},
{
label: '入群时间',
prop: 'joinTime',
width: 95
}
],
tableOption: {
width: 80,
btnList: [
{
name: '详情',
pType: 'detail'
}
]
}
},
getListApi: getDetailTableList,
clientTableDataNum: 0,
flushTime: false flushTime: false
} }
}, },
created() { created() {
this.getTableDetail() this.getTableDetail()
this.searchForm = {
id: this.$route.query.id
}
},
mounted() {
// this.$nextTick(() => {
// this.searchTable()
// })
}, },
// watch: { // watch: {
// 'searchForm.daterange':{ // 'searchForm.daterange':{
// deep: true, // deep: true,
...@@ -226,54 +138,30 @@ export default { ...@@ -226,54 +138,30 @@ export default {
// }, // },
methods: { methods: {
// getTotal(num) {
// if (this.currentIndex == 0) {
// this.$set(this.titles[0], 'personNum', num)
// }
// },
tabClick(index) {
this.currentIndex = index
},
async getTableDetail(id = this.$route.query.id) { async getTableDetail(id = this.$route.query.id) {
const res = await getTableDetail({ id: id }) const res = await getTableDetail({ id: id,pageNum:1,pageSize:10 })
console.log('获取客户群数据', res) console.log('获取客户群数据', res)
if (!res) { if (!res) {
return false return false
} }
this.leftPanelList = res this.leftPanelList = res
this.$set(this.titles[0], 'personNum', res.allCount)
this.$set(this.titles[1], 'personNum', res.staffCount)
this.$set(this.titles[2], 'personNum', res.quitCount)
this.$set(this.titles[3], 'personNum', res.potentialCount)
}, },
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// console.log(this.searchForm,'数据')
// console.log(this.searchForm.daterange,this.searchForm.id,this.searchFormTable,'时间选择器')
// console.log(this.searchForm)
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
resolve()
})
},
setTableHeightEvent() {
this.$refs.clientGroupDetail.setTableHeightFun()
},
setTableFinishFun(content) {
//content是第一页的数据
console.log(content)
this.clientTableDataNum = this.$refs.clientGroupDetail.total
//接收到的数据为空
if (!this.$refs.clientGroupDetail.data.length) {
this.$refs.clientGroupDetail.setTableHeightFun()
}
},
goBack() { goBack() {
this.$router.push({ path: '/clientGroupManage/index' }) this.$router.push({ path: '/clientGroupManage/index' })
}, },
//搜索表格
searchTable() {
this.$refs.clientGroupDetail.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = { id: this.$route.query.id }
this.$refs.clientGroupDetail.refreshTable()
},
handleClose() { handleClose() {
this.dialogVisible = !this.dialogVisible this.dialogVisible = !this.dialogVisible
}, },
...@@ -389,32 +277,50 @@ export default { ...@@ -389,32 +277,50 @@ export default {
} }
} }
.rightWrap { .rightWrap {
position: relative;
margin-left: 20px; margin-left: 20px;
width: calc(100% - 260px); width: calc(100% - 260px);
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
> p { padding-top: 50px;
height: 20px; .choseRow {
line-height: 20px; position: absolute;
margin-bottom: 10px; width: 100%;
span { left: 0;
vertical-align: middle; top: 0;
} display: flex;
span:first-child { background-color: $bgColor;
font-size: 18px; z-index: 10;
font-weight: 400; .choseItem {
color: #333333; height: 40px;
line-height: 40px;
width: 180px;
box-sizing: border-box;
background: #ffffff;
text-align: center;
border: 1px solid #eeedff;
cursor: pointer;
&:first-child {
border-left: 0;
}
span {
font-weight: 400;
font-size: 14px;
color: #37383a;
}
} }
span:nth-child(2) { .activeItem {
margin-left: 6px; border-radius: 4px 4px 0 0;
font-size: 14px; span {
font-weight: 400; color: $btnBlue;
color: $btnBlue; font-weight: 600;
height: 20px; }
line-height: 20px; box-sizing: border-box;
border-bottom: 0 !important;
} }
} }
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 20px;
} }
...@@ -438,7 +344,7 @@ export default { ...@@ -438,7 +344,7 @@ export default {
} }
} }
} }
/deep/ .el-dialog__header { /deep/ .el-dialog__header {
border: 0; border: 0;
} }
/deep/ .el-dialog__body { /deep/ .el-dialog__body {
......
<template>
<div class="scrm-sub-client-container">
<div class="header">
<div class="vehicleGroupName">
<span>{{ groupName }}</span>
</div>
<button class="backBtn" @click="goBack">返回客户群管理</button>
</div>
<div class="content">
<div class="leftWrap">
<div class="avator">
<img src="@/assets/clientDetail/defaultAvator.png" alt="" />
</div>
<p>
<span>群主</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostName }}</span>
</p>
<p>
<span>群主手机</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostPhone }}</span>
</p>
<p>
<span>群主邮箱</span>
<el-tooltip class="item" :content="leftPanelList.groupHostEmail" placement="top">
<span class="ellipsis-1">{{ leftPanelList.groupHostEmail }}</span>
</el-tooltip>
</p>
<!-- <p>
<span>群主部门</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostDepart }}</span>
</p> -->
<p>
<span>群管理员</span>
<el-tooltip class="item" :content="leftPanelList.groupAdmin" placement="top">
<span class="ellipsis-1">{{ leftPanelList.groupAdmin }}</span>
</el-tooltip>
</p>
<p>
<span>创建时间</span>
<el-tooltip class="item" :content="leftPanelList.createDate" placement="top">
<span class="ellipsis-1">{{ leftPanelList.createDate }}</span>
</el-tooltip>
</p>
</div>
<div class="rightWrap">
<p>
<span>全部客户</span>
<span>{{ clientTableDataNum || 0 }}个</span>
</p>
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<el-button type="primary">导出</el-button>
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 -->
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
<span slot="customerName" class="flex-center" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip>
<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 == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span>
</span>
<span slot="joinScene" slot-scope="scope">
<span>{{ scope.scope.joinScene == 1 ? '直接邀请入群' : scope.scope.joinScene == 2 ? '通过邀请链接入群' : scope.scope.joinScene == 3 ? '通过扫描群二维码入群' : '' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span>
</template>
</GLTable>
<basic-dialog title="" width="547px" :isVisible="dialogVisible" btnOkLabel="我知道了" :isHasCancelBtn="false" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<div class="content-body">
<p>该客户暂无员工跟进,无法查看该客户详情,</p>
<p class="bottomText">赶紧去加好友吧!</p>
</div>
</basic-dialog>
</div>
</div>
</div>
</template>
<script>
import { getTableDetail, getDetailTableList, getClientTableDetail } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientGroupDetail',
data() {
return {
dialogVisible: false,
groupName: this.$route.query.groupName,
url: url,
leftPanelList: {},
searchForm: {},
searchFormTable: {},
clientGroupFormList: [
{
type: 'daterange',
prop: 'daterange',
label: '入群时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'select',
prop: 'customerSex',
label: '性别',
placeholder: '请选择性别',
options: [
{
label: '全部',
value: null
},
{
label: '男',
value: 1
},
{
label: '女',
value: 2
},
{
label: '未知',
value: 0
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'groupNickName',
label: '本群昵称',
placeholder: '请输入本群昵称'
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '本群昵称',
prop: 'groupNickName'
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
minWidth: 100
},
{
label: '手机号码',
prop: 'customerPhone'
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{
label: '入群方式',
prop: 'joinScene',
addHtml: 'joinScene'
},
{
label: '邀请人',
prop: 'invitorName'
},
{
label: '入群时间',
prop: 'joinTime',
width: 120
}
],
tableOption: {
width: 80,
btnList: [
{
name: '详情',
pType: 'detail'
}
]
}
},
getListApi: getDetailTableList,
clientTableDataNum: 0,
flushTime: false
}
},
created() {
this.getTableDetail()
this.searchForm = {
id: this.$route.query.id
}
},
mounted() {
// this.$nextTick(() => {
// this.searchTable()
// })
},
// watch: {
// 'searchForm.daterange':{
// deep: true,
// // immediate:true,
// handler(val) {
// console.log('val值:',val)
// if(val){
// console.log('7777777777777')
// this.searchTable()
// }
// }
// }
// },
methods: {
async getTableDetail(id = this.$route.query.id) {
const res = await getTableDetail({ id: id })
console.log('获取客户群数据', res)
if (!res) {
return false
}
this.leftPanelList = res
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// console.log(this.searchForm,'数据')
// console.log(this.searchForm.daterange,this.searchForm.id,this.searchFormTable,'时间选择器')
// console.log(this.searchForm)
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
resolve()
})
},
setTableHeightEvent() {
this.$refs.clientGroupDetail.setTableHeightFun()
},
setTableFinishFun(content) {
//content是第一页的数据
console.log(content)
this.clientTableDataNum = this.$refs.clientGroupDetail.total
//接收到的数据为空
// if (!this.$refs.clientGroupDetail.data.length) {
// this.$refs.clientGroupDetail.setTableHeightFun()
// }
this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun()
},
goBack() {
this.$router.push({ path: '/clientGroupManage/index' })
},
//搜索表格
searchTable() {
this.$refs.clientGroupDetail.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = { id: this.$route.query.id }
this.$refs.clientGroupDetail.refreshTable()
},
handleClose() {
this.dialogVisible = !this.dialogVisible
},
handleConfirm() {
this.handleClose()
},
goDetail(id) {
// 接口通过了跳转
getClientTableDetail({ oneId: id }).then(res => {
if (res.code == '0') {
if (!res.data) {
this.dialogVisible = true
return false
}
this.$router.push({
path: '/clientManage/clientDetail',
query: {
id: id
}
})
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 72px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.vehicleGroupName {
margin-left: 26px;
height: 20px;
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.backBtn {
margin-right: 20px;
height: 32px;
font-size: 14px;
background: $btnBlue;
color: #fff;
border-radius: 4px;
padding: 0 20px;
border: none;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.content {
display: flex;
width: 100%;
margin-top: 20px;
.leftWrap {
width: 240px;
// height: 877px;
min-height: 270px; //calc(100vh - 92px);
background-color: #fff;
box-sizing: border-box;
.avator {
margin: 0 auto;
margin-top: 40px;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
p {
padding-left: 20px;
position: relative;
margin-top: 20px;
span:first-child {
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 600;
color: #333333;
line-height: 20px;
}
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: 131px;
}
}
}
.rightWrap {
margin-left: 20px;
width: calc(100% - 260px);
box-sizing: border-box;
background-color: #fff;
padding: 20px;
> p {
height: 20px;
line-height: 20px;
margin-bottom: 10px;
span {
vertical-align: middle;
}
span:first-child {
font-size: 18px;
font-weight: 400;
color: #333333;
}
span:nth-child(2) {
margin-left: 6px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
height: 20px;
line-height: 20px;
}
}
.el-button + .el-button {
margin-left: 20px;
}
// .el-button {
// font-size: 14px;
// font-weight: 400;
// padding: 9px 21px;
// background: $btnBlue;
// border-radius: 4px;
// border: none;
// }
// .el-button:first-child {
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid #999999;
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
}
}
/deep/ .el-dialog__header {
border: 0;
}
/deep/ .el-dialog__body {
border-bottom: 1px solid #e6e6e6;
padding: 0px 65px 35px;
min-height: 0;
.container {
font-size: 18px;
text-align: center;
font-weight: 400;
color: #333333;
.bottomText {
margin-top: 10px;
}
}
}
/deep/ .el-dialog__footer {
text-align: center;
padding-top: 15px;
padding-bottom: 15px;
}
}
</style>
<template> <template>
<div class="sub-container"> <div class="sub-container">
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent"> <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :isThreeRowShow="true" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span> </span>
</search-form> </search-form>
<!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 --> <!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 -->
...@@ -13,7 +14,8 @@ ...@@ -13,7 +14,8 @@
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span> <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip> </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 ? '@企微' :''}}</span> -->
</span> </span>
<span slot="customerSex" slot-scope="scope"> <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span> <span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span>
...@@ -29,7 +31,7 @@ ...@@ -29,7 +31,7 @@
</template> </template>
<script> <script>
import { getDetailTableList } from '@/api/modules/clientGroupManage' import { getDetailTableList,clientExportApi } from '@/api/modules/clientGroupManage'
export default { export default {
props: { props: {
url: { url: {
...@@ -98,16 +100,19 @@ export default { ...@@ -98,16 +100,19 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '本群昵称', label: '本群昵称',
prop: 'groupNickName' prop: 'groupNickName',
minWidth:120
}, },
{ {
label: '客户名称', label: '客户名称',
prop: 'customerName', prop: 'customerName',
addHtml: 'customerName' addHtml: 'customerName',
minWidth: 150
}, },
{ {
label: '手机号码', label: '手机号码',
prop: 'customerPhone' prop: 'customerPhone',
minWidth:120
}, },
{ {
label: '性别', label: '性别',
...@@ -117,16 +122,18 @@ export default { ...@@ -117,16 +122,18 @@ export default {
{ {
label: '入群方式', label: '入群方式',
prop: 'joinScene', prop: 'joinScene',
addHtml: 'joinScene' addHtml: 'joinScene',
minWidth:120
}, },
{ {
label: '邀请人', label: '邀请人',
prop: 'invitorName' prop: 'invitorName',
minWidth:120
}, },
{ {
label: '入群时间', label: '入群时间',
prop: 'joinTime', prop: 'joinTime',
width: 95 width: 140
} }
], ],
tableOption: { tableOption: {
...@@ -149,16 +156,31 @@ export default { ...@@ -149,16 +156,31 @@ export default {
} }
}, },
methods: { methods: {
getParams(){
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.beginTime = this.searchForm.daterange[0]
// this.searchFormTable.endTime = this.searchForm.daterange[1]
// delete this.searchFormTable.daterange
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// resolve()
// })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) this.searchFormTable = this.getParams()
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
resolve() resolve()
}) })
}, },
...@@ -169,13 +191,20 @@ export default { ...@@ -169,13 +191,20 @@ export default {
//content是第一页的数据 //content是第一页的数据
console.log(content) console.log(content)
this.clientTableDataNum = this.$refs.clientGroupDetail.total this.clientTableDataNum = this.$refs.clientGroupDetail.total
this.$emit('getTotal',this.clientTableDataNum) // this.$emit('getTotal',this.clientTableDataNum)
//接收到的数据为空 //接收到的数据为空
// if (!this.$refs.clientGroupDetail.data.length) { // if (!this.$refs.clientGroupDetail.data.length) {
// this.$refs.clientGroupDetail.setTableHeightFun() // this.$refs.clientGroupDetail.setTableHeightFun()
// } // }
this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun() this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun()
}, },
//导出
handleExport(){
var params = this.getParams()
clientExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.clientGroupDetail.refreshTable() this.$refs.clientGroupDetail.refreshTable()
......
<template> <template>
<div class="sub-container"> <div class="sub-container">
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent"> <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :isThreeRowShow="true" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span> </span>
</search-form> </search-form>
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url"> <GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
</template> </template>
<script> <script>
// import { getDetailTableList } from '@/api/modules/clientGroupManage' import { getDetailStaffTableList,followEmployeeExportApi } from '@/api/modules/clientGroupManage'
export default { export default {
props: { props: {
url: { url: {
...@@ -92,16 +93,19 @@ export default { ...@@ -92,16 +93,19 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '本群昵称', label: '本群昵称',
prop: 'groupNickName' prop: 'groupNickName',
minWidth:120
}, },
{ {
label: '员工名称', label: '员工名称',
prop: 'customerName', prop: 'staffName',
minWidth: 150
}, },
{ {
label: '手机号码', label: '手机号码',
prop: 'customerPhone' prop: 'customerPhone',
minWidth:120
}, },
{ {
label: '性别', label: '性别',
...@@ -111,21 +115,23 @@ export default { ...@@ -111,21 +115,23 @@ export default {
{ {
label: '入群方式', label: '入群方式',
prop: 'joinScene', prop: 'joinScene',
addHtml: 'joinScene' addHtml: 'joinScene',
minWidth:120
}, },
{ {
label: '邀请人', label: '邀请人',
prop: 'invitorName' prop: 'invitorName',
minWidth:120
}, },
{ {
label: '入群时间', label: '入群时间',
prop: 'joinTime', prop: 'joinTime',
width: 95 width: 140
} }
] ]
}, },
getListApi: '', getListApi: getDetailStaffTableList,
clientTableDataNum: 0 clientTableDataNum: 0
} }
}, },
...@@ -135,16 +141,31 @@ export default { ...@@ -135,16 +141,31 @@ export default {
} }
}, },
methods: { methods: {
getParams(){
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) // this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) { // if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0] // this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1] // this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange // delete this.searchFormTable.daterange
} else { // } else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime // if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
} // }
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve() resolve()
}) })
}, },
...@@ -155,13 +176,20 @@ export default { ...@@ -155,13 +176,20 @@ export default {
//content是第一页的数据 //content是第一页的数据
console.log(content) console.log(content)
this.clientTableDataNum = this.$refs.clientGroupDetail.total this.clientTableDataNum = this.$refs.clientGroupDetail.total
this.$emit('getTotal',this.clientTableDataNum) // this.$emit('getTotal',this.clientTableDataNum)
//接收到的数据为空 //接收到的数据为空
// if (!this.$refs.clientGroupDetail.data.length) { // if (!this.$refs.clientGroupDetail.data.length) {
// this.$refs.clientGroupDetail.setTableHeightFun() // this.$refs.clientGroupDetail.setTableHeightFun()
// } // }
this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun() this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun()
}, },
//导出
handleExport(){
var params = this.getParams()
followEmployeeExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.clientGroupDetail.refreshTable() this.$refs.clientGroupDetail.refreshTable()
......
<template> <template>
<div class="sub-container"> <div class="sub-container">
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent"> <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :isThreeRowShow="true" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span> </span>
</search-form> </search-form>
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url"> <GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span> <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip> </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> </span>
<span slot="customerSex" slot-scope="scope"> <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span> <span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span>
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
</template> </template>
<script> <script>
// import { getDetailTableList } from '@/api/modules/clientGroupManage' import { getDetailQuitTableList,leaveGroupExportApi } from '@/api/modules/clientGroupManage'
export default { export default {
props: { props: {
url: { url: {
...@@ -96,16 +97,19 @@ export default { ...@@ -96,16 +97,19 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '本群昵称', label: '本群昵称',
prop: 'groupNickName' prop: 'groupNickName',
minWidth:120
}, },
{ {
label: '客户名称', label: '客户名称',
prop: 'customerName', prop: 'customerName',
addHtml: 'customerName' addHtml: 'customerName',
minWidth: 150
}, },
{ {
label: '手机号码', label: '手机号码',
prop: 'customerPhone' prop: 'customerPhone',
minWidth:120
}, },
{ {
label: '性别', label: '性别',
...@@ -115,16 +119,18 @@ export default { ...@@ -115,16 +119,18 @@ export default {
{ {
label: '入群方式', label: '入群方式',
prop: 'joinScene', prop: 'joinScene',
addHtml: 'joinScene' addHtml: 'joinScene',
minWidth:120
}, },
{ {
label: '邀请人', label: '邀请人',
prop: 'invitorName' prop: 'invitorName',
minWidth:120
}, },
{ {
label: '入群时间', label: '入群时间',
prop: 'joinTime', prop: 'joinTime',
width: 95 width: 140
} }
], ],
tableOption: { tableOption: {
...@@ -137,7 +143,7 @@ export default { ...@@ -137,7 +143,7 @@ export default {
] ]
} }
}, },
getListApi: '', getListApi: getDetailQuitTableList,
clientTableDataNum: 0 clientTableDataNum: 0
} }
}, },
...@@ -147,16 +153,31 @@ export default { ...@@ -147,16 +153,31 @@ export default {
} }
}, },
methods: { methods: {
getParams(){
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) // this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) { // if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0] // this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1] // this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange // delete this.searchFormTable.daterange
} else { // } else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime // if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
} // }
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve() resolve()
}) })
}, },
...@@ -173,6 +194,13 @@ export default { ...@@ -173,6 +194,13 @@ export default {
// } // }
this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun() this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun()
}, },
//导出
handleExport(){
var params = this.getParams()
leaveGroupExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.clientGroupDetail.refreshTable() this.$refs.clientGroupDetail.refreshTable()
......
<template> <template>
<div class="sub-container"> <div class="sub-container">
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent"> <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :isThreeRowShow="true" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span> </span>
</search-form> </search-form>
<!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 --> <!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 -->
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span> <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip> </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> </span>
<span slot="customerSex" slot-scope="scope"> <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span> <span>{{ scope.scope.customerSex == 2 ? '女' : scope.scope.customerSex == 1 ? '男' : '未知' }}</span>
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
</template> </template>
<script> <script>
import { getDetailTableList } from '@/api/modules/clientGroupManage' import { getDetailPotentialTableList,potentialClientExportApi } from '@/api/modules/clientGroupManage'
export default { export default {
props: { props: {
url: { url: {
...@@ -52,43 +53,36 @@ export default { ...@@ -52,43 +53,36 @@ export default {
} }
} }
}, },
{ // {
type: 'select', // type: 'select',
prop: 'customerSex', // prop: 'customerSex',
label: '性别', // label: '性别',
placeholder: '请选择性别', // placeholder: '请选择性别',
options: [ // options: [
{ // {
label: '全部', // label: '全部',
value: null // value: null
}, // },
{ // {
label: '男', // label: '男',
value: 1 // value: 1
}, // },
{ // {
label: '女', // label: '女',
value: 2 // value: 2
}, // },
{ // {
label: '未知', // label: '未知',
value: 0 // value: 0
} // }
] // ]
}, // },
{ {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'groupNickName', prop: 'groupNickName',
label: '本群昵称', label: '本群昵称',
placeholder: '请输入本群昵称' placeholder: '请输入本群昵称'
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
...@@ -100,20 +94,15 @@ export default { ...@@ -100,20 +94,15 @@ export default {
label: '本群昵称', label: '本群昵称',
prop: 'groupNickName' prop: 'groupNickName'
}, },
{ // {
label: '客户名称', // label: '手机号码',
prop: 'customerName', // prop: 'customerPhone'
addHtml: 'customerName' // },
}, // {
{ // label: '性别',
label: '手机号码', // prop: 'customerSex',
prop: 'customerPhone' // addHtml: 'customerSex'
}, // },
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{ {
label: '入群方式', label: '入群方式',
prop: 'joinScene', prop: 'joinScene',
...@@ -126,20 +115,20 @@ export default { ...@@ -126,20 +115,20 @@ export default {
{ {
label: '入群时间', label: '入群时间',
prop: 'joinTime', prop: 'joinTime',
width: 95 width: 140
} }
], ],
tableOption: { // tableOption: {
width: 80, // width: 80,
btnList: [ // btnList: [
{ // {
name: '详情', // name: '详情',
pType: 'detail' // pType: 'detail'
} // }
] // ]
} // }
}, },
getListApi: getDetailTableList, getListApi: getDetailPotentialTableList,
clientTableDataNum: 0 clientTableDataNum: 0
} }
}, },
...@@ -149,16 +138,31 @@ export default { ...@@ -149,16 +138,31 @@ export default {
} }
}, },
methods: { methods: {
getParams(){
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) // this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) { // if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0] // this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1] // this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange // delete this.searchFormTable.daterange
} else { // } else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime // if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
} // }
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve() resolve()
}) })
}, },
...@@ -175,6 +179,13 @@ export default { ...@@ -175,6 +179,13 @@ export default {
// } // }
this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun() this.$refs.clientGroupDetail.data.length ? (this.$refs.clientGroupDetail.tableHeightValues = '') : this.$refs.clientGroupDetail.setTableHeightFun()
}, },
//导出
handleExport(){
var params = this.getParams()
potentialClientExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.clientGroupDetail.refreshTable() this.$refs.clientGroupDetail.refreshTable()
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<!-- <p class="pageTitle">客户群管理</p> --> <!-- <p class="pageTitle">客户群管理</p> -->
<div class="pageContent"> <div class="pageContent">
<search-form class="searchTop border-shadow" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable" @syncClick="syncClick"> <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable" @handleExport="handleExport" @syncClick="syncClick">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)"允许所有人同步 --> <!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)"允许所有人同步 -->
<!-- <el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button> --> <!-- <el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button> -->
</span> </span>
...@@ -19,8 +20,10 @@ ...@@ -19,8 +20,10 @@
</span> </span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> --> <!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span> <span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">
<!-- <GLButton @click="goDetail(scope.scope.id, scope.scope.custGroupName)" fn="客户群详情" type="text">详情</GLButton> --> {{scope.scope.delFlag == '0' ? '详情' : scope.scope.delFlag == '-1' ? '' : ''}}
</span>
<!-- <GLButton @click="goDetail(scope.scope.id, scope.scope.custGroupName)" fn="客户群详情" type="text">详情</GLButton> -->
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -29,7 +32,7 @@ ...@@ -29,7 +32,7 @@
</template> </template>
<script> <script>
import { getTableList, syncCustomerBase } from '@/api/modules/clientGroupManage' import { getTableList, syncCustomerBase, getStatus, clientGroupExportApi } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
export default { export default {
name: 'clientGroupManage', name: 'clientGroupManage',
...@@ -39,7 +42,9 @@ export default { ...@@ -39,7 +42,9 @@ export default {
isReload: true, isReload: true,
url: url, url: url,
sloading: false, sloading: false,
searchForm: {}, searchForm: {
},
searchFormTable: {}, searchFormTable: {},
clientGroupFormList: [ clientGroupFormList: [
{ {
...@@ -56,8 +61,8 @@ export default { ...@@ -56,8 +61,8 @@ export default {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'custGroupName', prop: 'custGroupName',
label: '客户群名称', label: '群聊名称',
placeholder: '请输入客户群名称' placeholder: '请输入群聊名称'
}, },
{ {
type: 'input', type: 'input',
...@@ -72,6 +77,46 @@ export default { ...@@ -72,6 +77,46 @@ export default {
prop: 'groupAdminName', prop: 'groupAdminName',
label: '管理员', label: '管理员',
placeholder: '请输入管理员' placeholder: '请输入管理员'
},
{
type: 'select',
prop: 'creationMethod',
label: '创建方式',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '手动拉群',
value: 1
},
{
label: '一客一群',
value: 2
}
]
},
{
type: 'select',
prop: 'delFlag',
label: '群聊状态',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '正常',
value: 0
},
{
label: '已解散',
value: -1
}
]
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
...@@ -80,11 +125,11 @@ export default { ...@@ -80,11 +125,11 @@ export default {
listName: 'data', listName: 'data',
tableColumns: [ tableColumns: [
{ {
label: '客户群名称', label: '群聊名称',
prop: 'custGroupName', prop: 'custGroupName',
minWidth: 160 minWidth: 160
}, },
{ {
label: '当前成员总数', label: '当前成员总数',
prop: 'allMembers', prop: 'allMembers',
minWidth: 140 minWidth: 140
...@@ -97,12 +142,12 @@ export default { ...@@ -97,12 +142,12 @@ export default {
{ {
label: '当日新增入群客户数', label: '当日新增入群客户数',
prop: 'newCustomerCount', prop: 'newCustomerCount',
minWidth: 160 minWidth: 150
}, },
{ {
label: '当日新增退群客户数', label: '当日新增退群客户数',
prop: 'delCustomerCount', prop: 'delCustomerCount',
minWidth: 160 minWidth: 150
}, },
{ {
label: '当前跟进员工数', label: '当前跟进员工数',
...@@ -110,11 +155,6 @@ export default { ...@@ -110,11 +155,6 @@ export default {
minWidth: 140 minWidth: 140
}, },
{ {
label: '创建方式',
prop: 'creationMethod',
minWidth: 140
},
{
label: '群主', label: '群主',
prop: 'groupHostName' prop: 'groupHostName'
}, },
...@@ -123,13 +163,29 @@ export default { ...@@ -123,13 +163,29 @@ export default {
prop: 'groupAdminName' prop: 'groupAdminName'
}, },
{ {
label: '创建方式',
prop: 'creationMethod',
formatter: cellValue => {
return cellValue.creationMethod == 1 ? '手动拉群' : cellValue.creationMethod == 2 ? '一客一群' : ''
},
minWidth: 140
},
{
label: '群聊状态',
prop: 'delFlag',
width: 95,
formatter: cellValue => {
return cellValue.delFlag == 0 ? '正常' : cellValue.delFlag == -1 ? '已解散' : ''
},
},
{
label: '创建时间', label: '创建时间',
prop: 'addTime', prop: 'addTime',
width: 95 width: 140
} }
], ],
tableOption: { tableOption: {
width: 170, width: 170
// btnList: [ // btnList: [
// { // {
// name: '详情', // name: '详情',
...@@ -145,9 +201,9 @@ export default { ...@@ -145,9 +201,9 @@ export default {
flushTime: false flushTime: false
} }
}, },
activated () { // activated() {
this.searchTable(); // this.searchTable()
}, // },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
...@@ -166,8 +222,38 @@ export default { ...@@ -166,8 +222,38 @@ export default {
// } // }
// } // }
// }, // },
mounted() {}, beforeDestroy() {
this.$message.closeAll()
},
mounted() {
this.wxTips()
},
methods: { methods: {
jumpWx() {
this.$history.push('/settings/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
},
syncClick() { syncClick() {
let _this = this let _this = this
_this.sloading = true _this.sloading = true
...@@ -182,8 +268,9 @@ export default { ...@@ -182,8 +268,9 @@ export default {
}) })
.catch(err => { .catch(err => {
_this.sloading = false _this.sloading = false
}).finally(()=>{ })
_this.sloading=false; .finally(() => {
_this.sloading = false
}) })
}, },
setTableHeightEvent() { setTableHeightEvent() {
...@@ -202,19 +289,42 @@ export default { ...@@ -202,19 +289,42 @@ export default {
// } // }
this.$refs.clientGroupManage.data.length ? (this.$refs.clientGroupManage.tableHeightValues = '') : this.$refs.clientGroupManage.setTableHeightFun() this.$refs.clientGroupManage.data.length ? (this.$refs.clientGroupManage.tableHeightValues = '') : this.$refs.clientGroupManage.setTableHeightFun()
}, },
//导出
handleExport() {
var params = this.getParams()
clientGroupExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
searchTable() { searchTable() {
this.$refs.clientGroupManage.refreshTable() this.$refs.clientGroupManage.refreshTable()
}, },
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
console.log('params',params)
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.beginTime = this.searchForm.daterange[0]
// this.searchFormTable.endTime = this.searchForm.daterange[1]
// delete this.searchFormTable.daterange
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// resolve()
// })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) this.searchFormTable = this.getParams()
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
resolve() resolve()
}) })
}, },
...@@ -253,13 +363,31 @@ export default { ...@@ -253,13 +363,31 @@ export default {
letter-spacing: 1px; letter-spacing: 1px;
} }
.pageContent { .pageContent {
.glsx-table {
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
padding: 6px 20px 30px; padding: 6px 20px 30px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
// min-width: 1300px; // min-width: 1300px;
background-color: #fff; background-color: #fff;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 10px;
} }
} }
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: $btnBlue;
font-size: 16px;
}
} }
</style> </style>
...@@ -19,19 +19,37 @@ ...@@ -19,19 +19,37 @@
<span> <span>
<!-- {{ leftPanelInfo.customerName }} --> <!-- {{ leftPanelInfo.customerName }} -->
{{ beautySub(leftPanelInfo.customerName) }} {{ beautySub(leftPanelInfo.customerName) }}
<span style="color: #5850ff">{{ leftPanelInfo.type == 1 ? '@微信' : leftPanelInfo.type == 2 ? '@企微' : '' }}</span> <span class="pure-blue-text">{{ leftPanelInfo.type == 1 ? '@微信' : leftPanelInfo.type == 2 ? '@企微' : '' }}</span>
</span> </span>
</span> </span>
</el-tooltip> </el-tooltip>
</p> </p>
<p> <div class="newStyle">
<span class="WechatName">企微名称</span>
<div class="nameListItem">
<div v-for="(item, index) in nickNameList" :key="index" style="margin-bottom:5px">
<el-tooltip effect="dark" placement="top">
<div class="qiweiItem" slot="content">
<span class="qiweiItemNick">{{ item.nickName }}</span>
<span class="qiweiItemCrop" :class="[item.type == 1 ? 'pure-green-text' : '', item.type == 2 ? 'pure-yello-text' : '']">@{{ item.corpName }}</span>
</div>
<div class="qiweiItem" :class="[item.type == 1 ? 'pure-green-text' : '', item.type == 2 ? 'pure-yello-text' : '']">
<span class="qiweiItemNick">{{ item.nickName }}</span>
<span class="qiweiItemCrop" :class="[item.type == 1 ? 'pure-green-text' : '', item.type == 2 ? 'pure-yello-text' : '']">@{{ item.corpName }}</span>
</div>
</el-tooltip>
</div>
</div>
</div>
<p style="margin-top:15px">
<span>联系电话</span> <span>联系电话</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span> <span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span>
</p> </p>
<p> <!-- <p>
<span>微信号</span> <span>微信号</span>
<span class="ellipsis-1">{{ leftPanelInfo.weChatId || '待完善' }}</span> <span class="ellipsis-1">{{ leftPanelInfo.weChatId || '待完善' }}</span>
</p> </p> -->
<p> <p>
<span>性别</span> <span>性别</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span> <span class="ellipsis-1">{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span>
...@@ -48,30 +66,32 @@ ...@@ -48,30 +66,32 @@
<span>类型</span> <span>类型</span>
<span class="ellipsis-1">{{ leftPanelInfo.type == 1 ? '微信用户' : leftPanelInfo.type == 2 ? '企微用户' : '' }}</span> <span class="ellipsis-1">{{ leftPanelInfo.type == 1 ? '微信用户' : leftPanelInfo.type == 2 ? '企微用户' : '' }}</span>
</p> </p>
<p v-if="leftPanelInfo.isJoin == 1"> <p>
<span>是否加企微</span> <span>是否加企微</span>
<!-- 1-是,2-否 --> <!-- 1-是,2-否 -->
<span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span> <span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span>
</p> </p>
<p>
<span>添加时间</span>
<span>{{ leftPanelInfo.addTime }}</span>
</p>
<p> <p>
<span>当前状态</span> <span>当前状态</span>
<span>{{ leftPanelInfo.status == -1 ? '删除好友' : leftPanelInfo.status == 0 ? '正常' : '' }}</span> <span>{{ leftPanelInfo.status == -1 ? '删除好友' : leftPanelInfo.status == 0 ? '正常' : '' }}</span>
</p> </p>
<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>
<el-tooltip effect="dark" :content="leftPanelInfo.addWay | toLabel" placement="top"> <el-tooltip effect="dark" :content="leftPanelInfo.addWay | toLabel" placement="top">
<span class="ellipsis-1">{{ leftPanelInfo.addWay | toLabel }}</span> <span class="ellipsis-1">{{ leftPanelInfo.addWay | toLabel }}</span>
</el-tooltip> </el-tooltip>
</p> </p>
<p> <p>
<span>渠道来源</span> <span>添加时间</span>
<el-tooltip effect="dark" :content="leftPanelInfo.sourceChannel" placement="top"> <span>{{ leftPanelInfo.addTime }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.sourceChannel }}</span>
</el-tooltip>
</p> </p>
</div> </div>
<div class="rightWrap"> <div class="rightWrap">
...@@ -124,9 +144,11 @@ ...@@ -124,9 +144,11 @@
</GLTable> </GLTable>
</template> </template>
<div v-show="currentIndex == 2" class="clientTagsWrap"> <div v-show="currentIndex == 2" class="clientTagsWrap">
<div style="height:40px"></div> <div style="height: 40px"></div>
<!-- //提示面板组件 -->
<tip-panel panelWidth="666px" panelMinHeight="45px" :panelContent="panelContent"></tip-panel>
<!-- v-if="userType == 2" --> <!-- v-if="userType == 2" -->
<el-button type="primary" class="addTagBtn" size="small" @click="btnClick('create')" v-if="userType == 2" >添加标签</el-button> <el-button type="primary" class="addTagBtn" size="small" @click="btnClick('create')" v-if="userType == 2">设置标签</el-button>
<GLTable ref="clientTagsListRef" :hasNum="false" :noDataImg="url" noDataText="客户暂无已添加的标签" :tableData="clientTagsList" :hasPage="false" :tableParams="tagsParams" :headerStyle="{ height: '54px' }"> <GLTable ref="clientTagsListRef" :hasNum="false" :noDataImg="url" noDataText="客户暂无已添加的标签" :tableData="clientTagsList" :hasPage="false" :tableParams="tagsParams" :headerStyle="{ height: '54px' }">
<span slot="labelGroupInfo" slot-scope="scope"> <span slot="labelGroupInfo" slot-scope="scope">
<span>{{ scope.scope.labelGroupInfo.labelGroupName }}</span> <span>{{ scope.scope.labelGroupInfo.labelGroupName }}</span>
...@@ -154,28 +176,38 @@ ...@@ -154,28 +176,38 @@
</div> </div>
</div> </div>
</div> </div>
<basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isShowThirdBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose"> <basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isDestroyClose="true" :btnLoading="sloading" :isShowThirdBtn="true" :isShowCloseBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot> <slot>
<p class="dialogSubTitle">企业标签</p> <p class="hint-text color-6">
<div class="companyRowData" v-for="(item, index) in companyTagsList" :key="index"> <span class="color-3">说明:</span>
<span :title="item.labelGroup.name">{{ item.labelGroup.name }}</span> 仅支持企业标签
<div class="tagsBox"> <span v-if="merchantModel == 1">和自店标签</span>
<span v-for="(i, j) in item.labelList" :key="j" class="ellipsis-1" :class="{ activeTag: i.checked }" :title="i.name" @click="checkNewTag(i.checked, j, item.labelList, i.original)">{{ i.name }}</span> 进行人工维护和设置
</div> </p>
</div> <p class="hint-text mg10">系统标签通过大数据算法进行自动更新,不支持人工维护和编辑</p>
<div class="labels-wrap" v-for="(group, index) in allTagsList" :key="index">
<template v-if="merchantModel == 1 && accountLevel == 4"> <template v-if="(merchantModel == 2 && group.labelType != '自店标签') || merchantModel == 1">
<p class="dialogSubTitle">自店标签</p> <div class="label-wrap">
<div class="ownShopRowData" v-for="(xItem, xIndex) in ownShopTagsList" :key="xIndex"> <div class="label-group-name">{{ group.labelType }}</div>
<span :title="xItem.labelGroup.name">{{ xItem.labelGroup.name }}</span> <div class="labels" v-for="(labels, ids) in group.children" :key="ids">
<div class="tagsBox"> <div class="label-name white-hide color-71 mt10">{{ labels.labelGroup.name }}:</div>
<span v-for="(m, n) in xItem.labelList" :key="n" class="ellipsis-1" :class="{ activeTag: m.checked }" :title="m.name" @click="checkNewTag(m.checked, n, xItem.labelList, m.original)">{{ m.name }}</span> <div class="label-value flex">
</div> <template v-for="(label, i) in labels.labelList">
<div :class="['label', 'color-3', 'white-hide', 'mt10', label.checked ? 'isChecked' : '']" :style="{ width: label.name.length > 10 ? '145px' : auto }" :key="label.id" @click="choose(index, ids, i)">
<template v-if="label.name.length < 10">{{ label.name }}</template>
<el-tooltip class="item" :content="label.name" placement="top" v-else>
<span>{{ label.name }}</span>
</el-tooltip>
<template v-if="label.checked">
<img src="@/assets/clientDetail/select-icon.png" class="select-icon" alt />
</template>
</div>
</template>
</div>
</div>
</div>
</template>
</div> </div>
</template>
<!-- 这里btn-behind插槽莫名失效了,原因:??? -->
<!-- <el-button slot="behind" @click="goNewTag">没找到需要的标签,创建新标签</el-button> -->
</slot> </slot>
</basic-dialog> </basic-dialog>
</div> </div>
...@@ -183,12 +215,20 @@ ...@@ -183,12 +215,20 @@
<script> <script>
import { getAllTagTree, getSingleClientTag, addSingleClientTag, getTableDetail } from '@/api/modules/clientManage' import { getAllTagTree, getSingleClientTag, addSingleClientTag, getTableDetail } from '@/api/modules/clientManage'
import url from "@/assets/clientDetail/noDataBox.png" import tipPanel from '@/components/tipPanel/index.vue'
import url from '@/assets/clientDetail/noDataBox.png'
export default { export default {
name: 'clientDetail', name: 'clientDetail',
components: {
tipPanel
},
data() { data() {
return { return {
url:url, isShowTooltip: false,
remark: '' ,
sloading: false,
panelContent: '说明:标签信息包含跟进员工标记的企业标签和自店标签,以及通过大数据算法生成的系统标签',
url: url,
leftPanelInfo: {}, leftPanelInfo: {},
labelIdList: [], //存放用户被标记标签的id labelIdList: [], //存放用户被标记标签的id
tagsList: [ tagsList: [
...@@ -312,7 +352,7 @@ export default { ...@@ -312,7 +352,7 @@ export default {
listName: 'customerBases', listName: 'customerBases',
tableColumns: [ tableColumns: [
{ {
label: '客户群名称', label: '群聊名称',
prop: 'groupName', prop: 'groupName',
addHtml: 'groupName' addHtml: 'groupName'
}, },
...@@ -347,6 +387,7 @@ export default { ...@@ -347,6 +387,7 @@ export default {
//标签信息的内容 //标签信息的内容
currentIndex: 1, currentIndex: 1,
clientTagsList: [], clientTagsList: [],
nickNameList: [],
tagsParams: { tagsParams: {
listName: 'labelInfos', listName: 'labelInfos',
tableOption: false, tableOption: false,
...@@ -358,6 +399,14 @@ export default { ...@@ -358,6 +399,14 @@ export default {
width: '160' width: '160'
}, },
{ {
label: '标签组类型',
prop: 'labelGroupInfo',
formatter: cellValue => {
return cellValue.labelGroupInfo.labelGroupType
},
width: '160'
},
{
label: '已打标签', label: '已打标签',
prop: 'labelInfoList', prop: 'labelInfoList',
addHtml: 'labelInfoList', addHtml: 'labelInfoList',
...@@ -366,7 +415,7 @@ export default { ...@@ -366,7 +415,7 @@ export default {
] ]
}, },
//弹窗数据 //弹窗数据
tagsDialogTitle: '添加标签', tagsDialogTitle: '设置标签',
tagsVisible: false, tagsVisible: false,
companyTagsList: [], companyTagsList: [],
...@@ -379,7 +428,8 @@ export default { ...@@ -379,7 +428,8 @@ export default {
merchantModel: 1, //集团:1,门店:2 merchantModel: 1, //集团:1,门店:2
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店 accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
userType: 0, //1是商户,2是员工 userType: 0, //1是商户,2是员工
userid: 0 //小龙需要用户id userid: 0, //小龙需要用户id
staffId: 0
} }
}, },
...@@ -392,19 +442,28 @@ export default { ...@@ -392,19 +442,28 @@ export default {
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType this.userType = this.$globalState.session.userType
} }
this.id = this.$route.query.id ? this.$route.query.id : ''
this.getPageDetail() this.getPageDetail()
//舍弃调用小龙的获取单用户标签的接口 //舍弃调用小龙的获取单用户标签的接口
// this.getSingleClientTag(this.$route.query.id, this.merchantId) // this.getSingleClientTag(this.$route.query.id, this.merchantId)
console.log(this.tagsParams, 'kkkk') console.log(this.tagsParams, 'kkkk')
}, },
methods: { methods: {
tabClick(index){ onMouseEnter (str) {
// if (!this.$refs.memberOrderRef.data.length) { // const tag = this.$refs[str]
// this.$refs.memberOrderRef.setTableHeightFun() // const parentWidth = tag.parentNode.offsetWidth // 获取元素父级可视宽度
// } // const contentWidth = tag.offsetWidth // 获取元素可视宽度
this.currentIndex=index // this.isShowTooltip = contentWidth <= parentWidth
if(this.currentIndex ==2 && this.clientTagsList.length<=0){ console.log(111)
this.$refs.clientTagsListRef.setTableHeightFun()
},
closePanel() {
this.isFirstShow = false
},
tabClick(index) {
this.currentIndex = index
if (this.currentIndex == 2 && this.clientTagsList.length <= 0) {
this.$refs.clientTagsListRef.setTableHeightFun()
} }
}, },
showTagArray(list) { showTagArray(list) {
...@@ -451,7 +510,7 @@ export default { ...@@ -451,7 +510,7 @@ export default {
getSingleClientTag(oneId = 14120314541863, merchantId = 10001001) { getSingleClientTag(oneId = 14120314541863, merchantId = 10001001) {
let param = { let param = {
'req.oneId': oneId, 'req.oneId': oneId,
'req.merchantId': merchantId, 'req.merchantIdsStr': merchantId,
'req.edition': this.merchantModel 'req.edition': this.merchantModel
} }
getSingleClientTag(param) getSingleClientTag(param)
...@@ -484,6 +543,7 @@ export default { ...@@ -484,6 +543,7 @@ export default {
return false return false
} }
this.userid = res.userid this.userid = res.userid
this.staffId = res.staffId
this.leftPanelInfo = res.info this.leftPanelInfo = res.info
this.vehicleTableData = res.vehicleInfoList || [] this.vehicleTableData = res.vehicleInfoList || []
this.employTableList = res.staffFollows || [] this.employTableList = res.staffFollows || []
...@@ -491,6 +551,7 @@ export default { ...@@ -491,6 +551,7 @@ export default {
this.tagsList = res.labels || [] this.tagsList = res.labels || []
this.labelIdList = (res.labels || []).map(item => item.labelId) this.labelIdList = (res.labels || []).map(item => item.labelId)
this.clientTagsList = res.labelInfos || [] this.clientTagsList = res.labelInfos || []
this.nickNameList = res.nickNameList || []
}, },
goNewTag() { goNewTag() {
this.$router.push({ path: '/tagsManage/index' }) this.$router.push({ path: '/tagsManage/index' })
...@@ -504,7 +565,7 @@ export default { ...@@ -504,7 +565,7 @@ export default {
console.log(pType, scope) console.log(pType, scope)
switch (pType) { switch (pType) {
case 'create': case 'create':
this.tagsDialogTitle = '添加标签' this.tagsDialogTitle = '设置标签'
this.getAllTags() this.getAllTags()
// this.handleClose(); // this.handleClose();
break break
...@@ -514,40 +575,41 @@ export default { ...@@ -514,40 +575,41 @@ export default {
} }
}, },
getAllTags() { getAllTags() {
getAllTagTree({ 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel }) getAllTagTree({ 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel, 'labelTreeReq.pageNum': 1, 'labelTreeReq.pageSize': 3000 })
.then(res => { .then(res => {
if (res.code == 0) { if (res.code == 0) {
console.log(res.data.labelTreeRets, '标签树') let allTagsList = [
let companyArr = res.data.labelTreeRets.filter(item => item.labelType == '企业标签') {
companyArr.forEach(item => labelType: '',
item.labelList.forEach(ele => { children: []
ele.checked = false },
ele.original = false {
}) labelType: '',
) children: []
}
let ownShopArr = res.data.labelTreeRets.filter(ele => ele.labelType == '自店标签') ]
ownShopArr.forEach(item => res.data.labelTreeRets.forEach(labels => {
item.labelList.forEach(ele => { labels.labelList.forEach(ele => {
ele.checked = false ele.checked = false
ele.original = false ele.original = false
}) this.labelIdList.forEach(id => {
) if (id == ele.id) {
// console.log(companyArr, ownShopArr, '企业标签自店标签')
this.companyTagsList = companyArr
this.ownShopTagsList = ownShopArr
this.allTagsList = [...this.companyTagsList, ...this.ownShopTagsList]
this.allTagsList.forEach(item =>
item.labelList.forEach(ele => {
for (let i = 0; i < this.labelIdList.length; i++) {
if (ele.id == this.labelIdList[i]) {
ele.checked = true ele.checked = true
ele.original = true ele.old = 1
} }
} })
}) })
) if (labels.labelType == '企业标签') {
allTagsList[0].labelType = '企业标签'
allTagsList[0].children.push(labels)
} else if (labels.labelType == '自店标签') {
allTagsList[1].labelType = '自店标签'
allTagsList[1].children.push(labels)
}
})
this.allTagsList = allTagsList
// console.log(this.allTagsList, ' this.allTagsList')
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }
...@@ -558,49 +620,62 @@ export default { ...@@ -558,49 +620,62 @@ export default {
this.handleClose() this.handleClose()
}, },
handleConfirm() { handleConfirm() {
//后台要求循环掉接口 this.sloading = true
//满足条件进行提交 let labelIdAddList = [] // 新增的标签
this.submitTagsList.forEach((item, index) => { let labelIdDelList = [] //取消的标签
let param = { this.allTagsList.forEach(labels => {
'req.OneId': this.$route.query.id, labels.children.forEach(ele => {
'req.labelGroupId': item.labelGroup.id, ele.labelList.forEach(tag => {
'req.edition': this.merchantModel, if (tag.old == '1' && !tag.checked) {
'req.merchantId': this.merchantId, labelIdDelList.push(tag.id)
'req.staffId': this.userid }
// 'req.labelIdList': item.labelList.map(ele => ele.id) if (!tag.old && tag.checked) {
} labelIdAddList.push(tag.id)
var ids = item.labelList.map(ele => ele.id)
param['req.labelIdList'] = ids
console.log(param, '参数')
addSingleClientTag(param)
.then(res => {
if (res.data.code == 0) {
if (index == this.submitTagsList.length - 1) {
this.$message.success('添加成功')
this.handleClose()
// this.getSingleClientTag(this.$route.query.id, this.merchantId)
this.getPageDetail() //刷新当前页面
}
} else {
this.$message.error(res.data.message)
} }
}) })
.catch(err => { })
console.error(err, '错误捕获')
})
}) })
let param = {
'req.OneId': this.id,
'req.merchantId': this.merchantId,
'req.uuId': this.userid,
'req.staffId': this.staffId,
'req.labelIdAddList': labelIdAddList,
'req.labelIdDelList': labelIdDelList
}
addSingleClientTag(param)
.then(res => {
console.log(param)
if (res.data.code == 0) {
this.sloading = false
this.$message.success('设置成功')
this.handleClose()
// this.getSingleClientTag(this.id, this.merchantId)
this.getPageDetail() //刷新当前页面
} else {
this.sloading = false
this.$message.error(res.data.message)
}
})
.catch(err => {
this.sloading = false
console.error(err, '错误捕获')
})
.finally(() => {
this.sloading = false
})
}, },
handleClose() { handleClose() {
if (this.tagsVisible) { // if (this.tagsVisible) {
this.companyTagsList = [] // this.companyTagsList = []
this.ownShopTagsList = [] // this.ownShopTagsList = []
} // }
// this.roleForm.tagsList = [] //取消时清空新增标签 // console.log('进来')
this.tagsVisible = !this.tagsVisible this.tagsVisible = !this.tagsVisible
}, },
checkNewTag(checked, j, arr, original = false) { checkNewTag(checked, j, arr, original = false) {
//需要后台告知是否后台提供选中标签的标志 //打开弹窗就是选中的,不许去选中,不是一开始就选中的,可以去选中
if (checked && original) { if (checked && original) {
return false return false
} }
...@@ -615,7 +690,7 @@ export default { ...@@ -615,7 +690,7 @@ export default {
return { return {
...item, ...item,
labelList: item.labelList.filter(e => { labelList: item.labelList.filter(e => {
if (e.checked && !original) { if (e.checked && !e.original) {
return e return e
} }
}) })
...@@ -630,6 +705,9 @@ export default { ...@@ -630,6 +705,9 @@ export default {
console.log('选中', _arr) console.log('选中', _arr)
this.submitTagsList = _arr this.submitTagsList = _arr
},
choose(index1, index2, index3) {
this.allTagsList[index1].children[index2].labelList[index3].checked = !this.allTagsList[index1].children[index2].labelList[index3].checked
} }
} }
} }
...@@ -638,7 +716,57 @@ export default { ...@@ -638,7 +716,57 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
@import '@/styles/resetelement.scss'; @import '@/styles/resetelement.scss';
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.newStyle {
display: flex;
font-size: 14px;
margin: 20px 0;
.nameListItem {
display: flex;
flex-direction: column;
margin-left: 22px;
.qiweiItem {
max-width: 132px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.qiweiItemNick {
height: 20px;
font-size: 14px;
color: #666666;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.qiweiItemCrop {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
}
}
.WechatName {
font-weight: 600;
color: #333333;
line-height: 20px;
margin-left: 20px;
height: 20px;
}
}
.overHidden {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.scrm-sub-client-container { .scrm-sub-client-container {
.header { .header {
display: flex; display: flex;
...@@ -759,7 +887,7 @@ export default { ...@@ -759,7 +887,7 @@ export default {
} }
} }
.addTagBtn { .addTagBtn {
margin-bottom: 10px; margin-bottom: 10px;
} }
// 处理客户标签的样式 // 处理客户标签的样式
.clientTagsWrap { .clientTagsWrap {
...@@ -838,7 +966,7 @@ export default { ...@@ -838,7 +966,7 @@ export default {
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
border-radius: 4px; border-radius: 4px;
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
...@@ -865,66 +993,59 @@ export default { ...@@ -865,66 +993,59 @@ export default {
/deep/.app-dialog { /deep/.app-dialog {
.el-dialog__body { .el-dialog__body {
.container { .container {
padding: 20px 72px 20px 68px; padding: 32px 74px;
} }
} }
} }
.dialogSubTitle { .hint-text {
margin-bottom: 10px; font-size: 12px;
height: 20px; font-weight: 400;
// color: #666;
line-height: 18px;
}
.mg10 {
margin-left: 38px;
}
.mt10 {
margin-top: 10px;
}
.labels-wrap {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #717171; color: #333333;
line-height: 20px; line-height: 20px;
&:not(:first-child) { margin-top: 20px;
margin-top: 20px; .label-group-name {
} margin-bottom: 2px;
} font-weight: 600;
.companyRowData,
.ownShopRowData {
display: flex;
// margin-top: 10px;
> span {
margin-right: 10px;
min-width: 82px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 20px;
text-align: right;
max-width: 82px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
} }
.tagsBox { .labels {
display: flex; .label-name {
flex-wrap: wrap;
justify-content: flex-start;
> span {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
padding: 0 10px;
box-sizing: border-box; box-sizing: border-box;
min-width: 82px; font-weight: 400;
}
.label {
height: 26px; height: 26px;
line-height: 26px; background: #fafbfe;
border-radius: 4px; border-radius: 4px;
border: 1px solid #e8e8ea; border: 1px solid #e8e8ea;
line-height: 26px;
text-align: center; text-align: center;
font-size: 14px; margin-right: 10px;
font-weight: 400; position: relative;
color: #666666; padding: 0 16px;
max-width: 245px; box-sizing: border-box;
cursor: pointer; cursor: pointer;
background: #fafbfe;
} }
.activeTag { .isChecked {
border: 1px solid $borderBlue; border: 1px solid #5850ff !important;
color: $btnBlue; .select-icon {
width: 16px;
height: 16px;
position: absolute;
top: 0;
right: 0;
}
} }
} }
} }
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<!-- <p class="pageTitle">客户管理</p> --> <!-- <p class="pageTitle">客户管理</p> -->
<div class="pageContent"> <div class="pageContent">
<search-form :ploading="sloading" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @resetTable="resetTable" @searchTable="searchTable" @syncClick="syncClick"> <search-form :ploading="sloading" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @resetTable="resetTable" @searchTable="searchTable" @handleExport="handleExport" @syncClick="syncClick">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" 不做判定了, 允许所有人同步 --> <!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" 不做判定了, 允许所有人同步 -->
<!-- <el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button> --> <!-- <el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button> -->
</span> </span>
...@@ -15,27 +16,29 @@ ...@@ -15,27 +16,29 @@
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams"> <GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams">
<span slot="customerName" class="flex-center" slot-scope="scope"> <span slot="customerName" class="flex-center" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top"> <el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span> <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left;">{{ scope.scope.customerName }}</span>
</el-tooltip> </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 ? '@企微' : '' }}</span> -->
<span class="pure-blue-text" style="font-size:12px">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : scope.scope.type == null ? '' : '' }}</span>
</span> </span>
<span slot="customerSex" slot-scope="scope"> <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : '女' }}</span> <span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
</span> </span>
<div slot="followStaff" class="entmicro" slot-scope="scope"> <div slot="followStaff" class="entmicro" slot-scope="scope">
<div class="entmicro-tag" v-for="(tag, idx) in followList(scope.scope.followStaff)" :key="idx"> <div class="entmicro-tag" v-for="(tag, idx) in followList(scope.scope.followStaff)" :key="idx">
<el-tooltip effect="dark" :content="tag" placement="top"> <el-tooltip effect="dark" :content="tag" placement="top">
<el-tag type="info" class="ellipsis-1" v-if="idx < 3" :disable-transitions="false"> <el-tag type="info" class="ellipsis-1" v-if="idx < 2" :disable-transitions="false">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ tag }} {{ tag }}
</el-tag> </el-tag>
</el-tooltip> </el-tooltip>
<el-tag type="info" v-if="followList(scope.scope.followStaff).length > 3 && idx == 3"> <el-tag type="info" v-if="followList(scope.scope.followStaff).length > 2 && idx == 2">
<el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"> <el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<div slot="reference">...({{ followList(scope.scope.followStaff).length }})</div> <div slot="reference">...({{ followList(scope.scope.followStaff).length }})</div>
<div class="entmicro-hover"> <div class="entmicro-hover" >
<el-tag type="info" style="margin-right: 10px; margin-bottom: 10px" v-for="(i, index) in followList(scope.scope.followStaff)" :key="index" :disable-transitions="false"> <el-tag type="info" style="margin-right: 10px; margin-bottom: 10px" v-for="(i, index) in followList(scope.scope.followStaff)" :key="index" :disable-transitions="false">
<i class="el-icon-user-solid" style="color: #75acff"></i> <i class="el-icon-user-solid" style="color: #75acff"></i>
<!-- {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} --> <!-- {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} -->
...@@ -46,7 +49,24 @@ ...@@ -46,7 +49,24 @@
</el-tag> </el-tag>
</div> </div>
</div> </div>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
<div v-if="idx == 0">
<span>{{ list.nickName }}</span>
<span class="smallFontSize" :class="[list.type == 1 ? 'pure-green-text' : '', list.type == 2 ? 'pure-yello-text' : '']">@{{ list.corpName }}</span>
</div>
<span v-if="idx == 1">
<el-popover placement="right-start" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<div v-for="(i, index) in scope.scope.nickNameList" :key="index" style="padding-bottom:3px !important">
<span>{{ i.nickName }}</span>
<span style="height: 20px; font-size: 12px; letter-spacing: 0; line-height: 20px; font-weight: 400;margin-left:2px" :class="[i.type == 1 ? 'pure-green-text' : '', i.type == 2 ? 'pure-yello-text' : '']">@{{ i.corpName }}</span>
</div>
<img class="imgEll" src="@/assets/tagsManage/ellipsis.png" alt="" slot="reference" />
</el-popover>
</span>
</div>
</div>
<span slot="customerPhone" slot-scope="scope"> <span slot="customerPhone" slot-scope="scope">
<span>{{ scope.scope.customerPhone == 'null' ? '' : scope.scope.customerPhone }}</span> <span>{{ scope.scope.customerPhone == 'null' ? '' : scope.scope.customerPhone }}</span>
</span> </span>
...@@ -79,11 +99,10 @@ ...@@ -79,11 +99,10 @@
</template> </template>
<script> <script>
import { getTableList, getDictionaryFun, syncCustomer } from '@/api/modules/clientManage' import { getTableList, getDictionaryFun, syncCustomer, clientManageExportApi } from '@/api/modules/clientManage'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
export default { export default {
name: 'clientManage', name: 'clientManage',
// inject: ['reload'],
data() { data() {
return { return {
isReload: true, isReload: true,
...@@ -146,7 +165,7 @@ export default { ...@@ -146,7 +165,7 @@ export default {
{ {
type: 'select', type: 'select',
prop: 'addWay', prop: 'addWay',
label: '来源', label: '添加来源',
placeholder: '请选择当前来源', placeholder: '请选择当前来源',
options: [] //this.$Constants.SOURCE_OPTION options: [] //this.$Constants.SOURCE_OPTION
}, },
...@@ -161,8 +180,8 @@ export default { ...@@ -161,8 +180,8 @@ export default {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'customerPhone', prop: 'customerPhone',
label: '手机号', label: '联系电话',
placeholder: '请输入手机号' placeholder: '联系电话'
}, },
{ {
type: 'input', type: 'input',
...@@ -177,12 +196,18 @@ export default { ...@@ -177,12 +196,18 @@ export default {
prop: 'followStaff', prop: 'followStaff',
label: '跟进员工', label: '跟进员工',
placeholder: '请输入跟进员工' placeholder: '请输入跟进员工'
},
{
type: 'input',
inputType: 'text',
prop: 'nickName',
label: '企微名称',
placeholder: '请输入企微名称'
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: { tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data', listName: 'data',
// tableOption: true, // tableOption: true,
tableOption: false, tableOption: false,
...@@ -199,7 +224,13 @@ export default { ...@@ -199,7 +224,13 @@ export default {
minWidth: 150 minWidth: 150
}, },
{ {
label: '手机号', label: '企微名称',
prop: 'nickNameList',
addHtml: 'nickNameList',
minWidth: 200
},
{
label: '联系电话',
prop: 'customerPhone', prop: 'customerPhone',
addHtml: 'customerPhone', addHtml: 'customerPhone',
minWidth: 110 minWidth: 110
...@@ -217,17 +248,6 @@ export default { ...@@ -217,17 +248,6 @@ export default {
minWidth: 120 minWidth: 120
}, },
{ {
label: '来源',
prop: 'addWay',
addHtml: 'addWay',
minWidth: 100
},
{
label: '渠道来源',
prop: 'sourceChannel',
width: 100
},
{
label: '是否加企微', //1. 加入,0.未加入 label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoin', prop: 'isJoin',
addHtml: 'isJoin', addHtml: 'isJoin',
...@@ -240,9 +260,20 @@ export default { ...@@ -240,9 +260,20 @@ export default {
minWidth: 100 minWidth: 100
}, },
{ {
label: '所属渠道',
prop: 'sourceChannel',
width: 120
},
{
label: '添加来源',
prop: 'addWay',
addHtml: 'addWay',
minWidth: 100
},
{
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime',
width: 98 width: 150
}, },
{ {
label: '操作', label: '操作',
...@@ -274,6 +305,15 @@ export default { ...@@ -274,6 +305,15 @@ export default {
} }
this.getDictionaryFun() this.getDictionaryFun()
}, },
// filters:{
// // 截取@后面的文字
// cutText(str){
// let index = str.lastIndexOf("\@")
// start = str.substring(0,index)
// res = str.substring(index+1,str.length)
// return
// }
// },
methods: { methods: {
followList(str) { followList(str) {
if (!str) { if (!str) {
...@@ -300,17 +340,31 @@ export default { ...@@ -300,17 +340,31 @@ export default {
// } // }
this.$refs.clientManage.data.length ? (this.$refs.clientManage.tableHeightValues = '') : this.$refs.clientManage.setTableHeightFun() this.$refs.clientManage.data.length ? (this.$refs.clientManage.tableHeightValues = '') : this.$refs.clientManage.setTableHeightFun()
}, },
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() { beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.beginTime = this.searchForm.daterange[0]
// this.searchFormTable.endTime = this.searchForm.daterange[1]
// delete this.searchFormTable.daterange
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// resolve()
// })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) this.searchFormTable = this.getParams()
console.log(this.searchFormTable.daterange, '时间')
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve() resolve()
}) })
}, },
...@@ -346,6 +400,13 @@ export default { ...@@ -346,6 +400,13 @@ export default {
return curElement.label return curElement.label
}, },
//导出
handleExport() {
var params = this.getParams()
clientManageExportApi(params).then(res => {
this.$Utils.exportFn(res)
})
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.clientManage.refreshTable() this.$refs.clientManage.refreshTable()
...@@ -395,6 +456,29 @@ export default { ...@@ -395,6 +456,29 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
@import '@/styles/resetelement.scss'; @import '@/styles/resetelement.scss';
.expandImg {
display: flex;
justify-content: center;
.smallFontSize {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.imgEll {
margin-left: 6.5px;
cursor: pointer;
// margin-bottom:3px;
}
}
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.scrm-sub-client-container { .scrm-sub-client-container {
.pageTitle { .pageTitle {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -412,17 +496,20 @@ export default { ...@@ -412,17 +496,20 @@ export default {
// min-width: 1300px; // min-width: 1300px;
background-color: #fff; background-color: #fff;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 10px;
} }
.searchTop { .searchTop {
// margin-bottom: 20px; // margin-bottom: 20px;
} }
// .glsx-table { .glsx-table {
// margin-top: 20px; // /deep/ .el-table__fixed {
// /deep/ .el-table__fixed { // height: 100% !important; //设置高优先,以覆盖内联样式
// height: 100% !important; //设置高优先,以覆盖内联样式 // }
// } /deep/ .el-table__fixed,
// } /deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
.entmicro { .entmicro {
// overflow: hidden; // overflow: hidden;
...@@ -449,7 +536,11 @@ export default { ...@@ -449,7 +536,11 @@ export default {
font-size: 14px; font-size: 14px;
} }
} }
.entmicro-tag + .entmicro-tag {
margin-top: 4px;
}
} }
.el-tag { .el-tag {
// margin-right: 10px; // margin-right: 10px;
max-width: 110px; max-width: 110px;
......
...@@ -11,25 +11,58 @@ ...@@ -11,25 +11,58 @@
<span>企业主体信息需要认证,才可使用该功能。</span> <span>企业主体信息需要认证,才可使用该功能。</span>
</div> </div>
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px"> <el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px">
<el-form-item label="组名" prop="orgName"> <el-form-item label="自定义群名" prop="groupName">
<el-input <el-input
v-model="basicForm.orgName" v-model.trim="basicForm.groupName"
size="small" size="small"
placeholder="为群聊设置一个组名" placeholder="为群聊设个自定义组名,如“VIP服务群”"
maxlength="10" maxlength="10"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="群聊名称" prop="groupName"> <el-form-item label="群聊命名规则" prop="groupNameRule">
<el-input <el-radio-group
size="small" v-model="basicForm.groupNameRule"
v-model="basicForm.groupName" style="line-height: 40px; font-size: 14px; max-width: 600px;"
placeholder="设置群聊名称前缀,如新车售后一组" >
maxlength="10" <el-radio v-for="(rule, index) in nameRules" :label="rule.id" :key="index">
></el-input> {{ rule.rule }}
<div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div> <span class="rule-tips">{{rule.tips}}</span>
</el-radio>
</el-radio-group>
<!-- <div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div> -->
</el-form-item> </el-form-item>
<el-form-item prop="userList"> <el-form-item prop="followList">
<label slot="label" class="required">默认成员</label> <label slot="label" class="required">跟进专员</label>
<el-button size="small" @click="openFollow">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="label-text">
已选择
<span>{{ basicForm.followList ? basicForm.followList.length : 0 }}</span>
人
</span>
<div :key="followkey" class="sale-select" v-show="basicForm.followList.length">
<div class="el-input-tag input-tag-wrapper">
<div style="max-height: 64px">
<el-tag
v-for="(tag, idx) in basicForm.followList"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="removeFollow(idx)"
>
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
<!-- <div class="form-tips">必须配置至少1个跟进专员</div> -->
</el-form-item>
<el-form-item>
<label slot="label">默认成员</label>
<el-button size="small" @click="openMembers"> <el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
选择成员 选择成员
...@@ -39,9 +72,9 @@ ...@@ -39,9 +72,9 @@
<span>{{ basicForm.userList ? basicForm.userList.length : 0 }}</span> <span>{{ basicForm.userList ? basicForm.userList.length : 0 }}</span>
人 人
</span> </span>
<div :key="key" class="sale-select" v-show="basicForm.userList"> <div :key="key" class="sale-select" v-show="basicForm.userList.length">
<div class="el-input-tag input-tag-wrapper"> <div class="el-input-tag input-tag-wrapper">
<div style="max-height: 64px;"> <div style="max-height: 64px">
<el-tag <el-tag
v-for="(tag, idx) in basicForm.userList" v-for="(tag, idx) in basicForm.userList"
:key="idx" :key="idx"
...@@ -56,7 +89,6 @@ ...@@ -56,7 +89,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-tips">必须配置2个及以上成员</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 编辑入群欢迎语 --> <!-- 编辑入群欢迎语 -->
...@@ -87,95 +119,122 @@ ...@@ -87,95 +119,122 @@
</div> </div>
<basic-dialog <basic-dialog
:title="'选择成员'" :title="'选择成员'"
:width="'712px'" :width="'1142px'"
:isVisible="membersVisible" :isVisible="membersVisible"
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="handleClose" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers <!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
v-if="membersVisible" <SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :followData="followData"></SelectMember>
:key="key"
:selectData.sync="selectData"
ref="membersForm"
></SelectMembers>
</basic-dialog> </basic-dialog>
<!-- <SelectMember ref="membersForm"></SelectMember> -->
<select-follow @selectTable="selectTable" ref="selectEmpForm"></select-follow>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from 'vue'
// import WelcomeWords from './components/welcomeWords.vue' // import WelcomeWords from './components/welcomeWords.vue'
import SelectMembers from './components/selectMembers.vue' import SelectMember from './components/selectMember.vue'
import SelectFollow from './components/selectFollow.vue'
// import Preview from './components/preview.vue' // import Preview from './components/preview.vue'
export default { export default {
name: 'guestGroupAdd', name: 'guestGroupAdd',
components: { components: {
// WelcomeWords, // WelcomeWords,
SelectMembers SelectMember,
SelectFollow
// Preview // Preview
}, },
data() { data() {
const validatorUser = (rule, value, callback) => { const validatorUser = (rule, value, callback) => {
if (!this.$route.params.id) { console.log(this.basicForm.userList)
if (this.$refs.membersForm) this.basicForm.userList = this.$refs.membersForm.innerTags const followList = this.basicForm.followList
if (this.basicForm.userList) { let userList = []
if (this.basicForm.userList.length < 2) { if (this.basicForm.userList && this.basicForm.userList.length) {
callback(new Error('至少配置2个及以上成员')) userList = this.basicForm.followList.concat(this.basicForm.userList)
} else {
callback()
}
} else {
callback(new Error('请选择默认成员'))
}
} else { } else {
if (value) { userList = this.basicForm.followList
if (value.length < 2) {
callback(new Error('至少配置2个及以上成员'))
} else {
callback()
}
} else {
callback(new Error('请选择默认成员'))
}
} }
} console.log(userList)
const nameVaild = (rule, value, callback) => { if (!this.basicForm.followList.length) {
console.log(this.$route.params.id) callback(new Error('请选择跟进专员'))
if (value) { } else {
const params = { console.log(this.basicForm.followList)
templateName: value if (userList.length < 2) {
} this.$message({
let api = 'nameVaild' type: 'error',
if (this.$route.params.id) { message: '必须配置2个及以上成员'
params.id = this.$route.params.id })
api = 'updateNameVaild' // callback(new Error('必须配置2个及以上成员'))
} else {
callback()
} }
this.$apis.groupGuest[api](params).then(res => {
if (res) {
callback(new Error('群聊名称不可重复'))
} else {
callback()
}
})
} }
} }
// const nameVaild = (rule, value, callback) => {
// console.log(this.$route.params.id)
// if (value) {
// const params = {
// templateName: value
// }
// let api = 'nameVaild'
// if (this.$route.params.id) {
// params.id = this.$route.params.id
// api = 'updateNameVaild'
// }
// this.$apis.groupGuest[api](params).then(res => {
// if (res) {
// callback(new Error('群聊名称不可重复'))
// } else {
// callback()
// }
// })
// }
// }
return { return {
eventBus: new Vue(), eventBus: new Vue(),
basicForm: {}, basicForm: {
followList: [],
userList: [],
groupNameRule: 1
},
nameRules: [
{
rule: '车系+客户昵称+自定义群名',
tips: '(车系/客户昵称自动填充,例:“奥迪A6Carr_VIP服务群”)',
id: 1
},
{
rule: '车系+车牌号+自定义群名',
tips: '(车系/客户昵称自动填充,例:“日产轩逸粤B·1V566_VIP服务群”)',
id: 2
},
{
rule: '自定义群名',
id: 0
}
],
basicRules: { basicRules: {
orgName: [{ required: true, message: '请输入组名', trigger: 'change' }], groupName: [
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'change' }, { required: true, message: '请输入群聊名称', trigger: 'change' }
{ validator: nameVaild, trigger: 'blur' }], // { validator: nameVaild, trigger: 'blur' }
userList: [ ],
groupNameRule: [{ required: true, message: '请选择群聊命名规则', trigger: 'change' }],
followList: [
// { required: true, message: '请选择默认成员', trigger: 'change' }, // { required: true, message: '请选择默认成员', trigger: 'change' },
{ validator: validatorUser, trigger: 'blur' } { validator: validatorUser, trigger: 'change' }
] ]
}, },
membersVisible: false, membersVisible: false,
key: new Date(), key: new Date(),
followkey: new Date(),
previewFlag: false, previewFlag: false,
selectData: [], selectData: [],
editStatus: false followData: [],
editStatus: false,
// 跟进专员
followVisible: false
} }
}, },
watch: { watch: {
...@@ -185,6 +244,12 @@ export default { ...@@ -185,6 +244,12 @@ export default {
}, },
deep: true deep: true
} }
// membersVisible(val) {
// console.log(val)
// if (!val) {
// this.$refs.membersForm.resetSearch()
// }
// }
}, },
mounted() { mounted() {
if (this.$route.params) { if (this.$route.params) {
...@@ -199,41 +264,42 @@ export default { ...@@ -199,41 +264,42 @@ export default {
methods: { methods: {
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
// if (this.membersVisible && this.$route.params.id) { },
// this.$nextTick(() => { openFollow() {
// this.key = new Date() const checkMember = this.basicForm.userList.length ? this.basicForm.userList.map(i => i.id) : []
// console.log(this.$refs.membersForm) this.$refs.selectEmpForm.init(this.basicForm.followList, checkMember)
// this.$refs.membersForm.selectTable(this.basicForm.userList)
// if (this.basicForm.userList && this.basicForm.userList.length != 0) {
// this.basicForm.userList.map(item => {
// if (item.masterStatus == 1) {
// this.selectData = this.basicForm.userList
// }
// })
// }
// })
// }
}, },
handleSubmit() { handleSubmit() {
// const previewList = this.$refs.welcome.previewList
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
const params = { const params = {
// attachmentList: this.$refs.welcome.previewList, groupName: this.basicForm.groupName,
orgName: this.basicForm.orgName, groupNameRule: this.basicForm.groupNameRule
groupName: this.basicForm.groupName
} }
// if (this.$refs.welcome.previewList) params.attachmentList = this.$refs.welcome.previewList const followList = this.basicForm.followList.map(item => {
params.userList = this.basicForm.userList.map(item => {
return { return {
staffId: item.staffId staffId: item.staffId,
staffName: item.staffName,
follow: 1
} }
}) })
let memberList = []
if (this.basicForm.userList && this.basicForm.userList.map.length) {
memberList = this.basicForm.userList.map(i => {
return {
staffId: i.staffId,
staffName: i.staffName,
follow: 0
}
})
}
params.userList = followList.concat(memberList)
let apiName = 'insert' let apiName = 'insert'
if (this.basicForm.id) { if (this.basicForm.id) {
apiName = 'update' apiName = 'update'
params.id = this.basicForm.id params.id = this.basicForm.id
} }
console.log(params)
this.$apis.groupGuest[apiName](params) this.$apis.groupGuest[apiName](params)
.then(res => { .then(res => {
if (res) { if (res) {
...@@ -242,6 +308,11 @@ export default { ...@@ -242,6 +308,11 @@ export default {
message: '操作成功!' message: '操作成功!'
}) })
this.$router.push('/guestGroup/index') this.$router.push('/guestGroup/index')
} else {
this.$message({
type: 'error',
message: '操作失败'
})
} }
}) })
.catch(err => { .catch(err => {
...@@ -257,24 +328,25 @@ export default { ...@@ -257,24 +328,25 @@ export default {
this.$apis.groupGuest.detail({ id }).then(res => { this.$apis.groupGuest.detail({ id }).then(res => {
if (res) { if (res) {
this.basicForm = { this.basicForm = {
orgName: res.orgName,
groupName: res.groupName, groupName: res.groupName,
id: res.id, id: res.id,
merchantId: 1, groupNameRule: res.groupNameRule
userList: res.userList // userList: res.userList
// attachmentList: res.attachmentList }
if (res.userList && res.userList.length) {
this.selectData = res.userList.filter(item => item.follow == 0)
this.basicForm.userList = this.selectData
this.basicForm.followList = res.userList.filter(item => item.follow == 1)
} }
// this.$refs.welcome.updateList(res.attachmentList) console.log(this.basicForm)
this.selectData = res.userList // this.selectData = res.userList
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
} }
}) })
}, },
handleCancel() { handleCancel() {
// this.$router.go(-1)
// this.$router.push({ path: '/guestGroup/index' })
if (this.editStatus) { if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -303,49 +375,35 @@ export default { ...@@ -303,49 +375,35 @@ export default {
}, },
// 成员弹窗 // 成员弹窗
handleConfirm() { handleConfirm() {
if (this.$refs.membersForm.innerTags.length == 0) { // this.basicForm.userList = this.$refs.membersForm.innerTags
this.$message({ this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
type: 'error', this.selectData = this.basicForm.userList
message: '请选择成员' this.openMembers()
})
} else if (this.$refs.membersForm.innerTags.length == 1) {
this.$message({
type: 'error',
message: '必须配置两个及以上成员'
})
} else {
// this.$refs.membersForm.resetSearch()
this.basicForm.userList = this.$refs.membersForm.innerTags
this.selectData = this.basicForm.userList
this.openMembers()
}
}, },
handleClose() { handleClose() {
// this.openMembers()
// this.$refs.membersForm.resetSearch()
this.membersVisible = false this.membersVisible = false
// if (this.$route.params.id) { },
// this.$nextTick(() => { selectTable(item) {
// this.$refs.membersForm.selectTable(this.basicForm.userList) this.basicForm.followList = item.map(item => {
// if (this.basicForm.userList && this.basicForm.userList.length != 0) { return {
// this.basicForm.userList.map(item => { staffId: item.id,
// if (item.masterStatus) { staffName: item.staffName
// this.basicForm.group = item }
// this.$refs.membersForm.group = item })
// this.selectData = this.basicForm.userList this.followData = this.basicForm.followList.map(i => i.staffId)
// } this.followkey = new Date()
// }) },
// } removeFollow(idx) {
// }) this.basicForm.followList.splice(idx, 1)
// } else { this.followData = this.basicForm.followList.map(i => i.staffId)
// this.selectData = [] this.followkey = new Date()
// }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss';
.container { .container {
margin-bottom: 84px; margin-bottom: 84px;
background: #ffffff; background: #ffffff;
...@@ -368,6 +426,7 @@ export default { ...@@ -368,6 +426,7 @@ export default {
// align-items: flex-end; // align-items: flex-end;
height: calc(100vh - 250px); height: calc(100vh - 250px);
justify-content: space-between; justify-content: space-between;
overflow-y: auto;
.info-content { .info-content {
width: calc(100% - 360px); width: calc(100% - 360px);
// flex: 1; // flex: 1;
...@@ -403,7 +462,7 @@ export default { ...@@ -403,7 +462,7 @@ export default {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
span { span {
color: #5850ff; color: $btnBlue;
} }
} }
.form-error { .form-error {
...@@ -507,4 +566,13 @@ export default { ...@@ -507,4 +566,13 @@ export default {
margin-right: 8px; margin-right: 8px;
} }
} }
.rule-tips {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 14px;
}
.required:before {
margin-right: 5px;
}
</style> </style>
...@@ -161,6 +161,7 @@ export default { ...@@ -161,6 +161,7 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/variables.scss';
.select-emp-panel { .select-emp-panel {
display: flex; display: flex;
.emp-tree-panel { .emp-tree-panel {
...@@ -219,7 +220,7 @@ export default { ...@@ -219,7 +220,7 @@ export default {
margin-right: 10px; margin-right: 10px;
font-size: 15px; font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content { /deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff; color: $btnBlue;
background: #f2f5fa; background: #f2f5fa;
} }
} }
......
<template>
<div class="square-main" v-loading="loading">
<el-dialog title="选择跟进专员" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<div class="table-box">
<GLTable
:key="key"
v-if="dialogVisible"
ref="followTable"
:layout="layout"
:tableData="tableData"
:hasNum="false"
:tableTotal="tableTotal"
:pageConf="pageConf"
:tableParams="tableParams"
@refreshTable="handleSearch"
@selectionTable="selectionTable"
@row-click="rowClick"
></GLTable>
<div class="form-tips">必须配置至少1个跟进专员</div>
</div>
<span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl">新增专员</a>
<el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'SelectFollow',
data() {
return {
loading: false,
dialogVisible: false,
tableSearchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
checkSelectKey: 'id',
checkSelectVal: [],
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
}
]
},
layout: 'total',
tableData: [],
tableTotal: 0,
selectItem: [],
selectEmp: [],
checkSelect: [],
key: new Date()
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/home/followUp/index')
},
getFollower() {
var params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.followTable.page.pageSize,
pageNum: this.$refs.followTable.page.pageNum
}
this.$apis.groupGuest.getFollower(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.count > 10) {
this.layout = 'total, pager'
}
this.tableData.forEach(item => {
this.selectEmp.forEach((itm, index) => {
if (itm.staffId == item.id) {
this.$refs.followTable.$refs.salelistMutiTable.toggleRowSelection(item)
this.selectEmp.splice(index, 1)
}
})
if (this.checkSelect) this.tableParams.checkSelectVal = this.checkSelect
})
})
},
init(item, checkMember) {
this.checkSelect = checkMember
this.tableSearchForm = {}
this.selectEmp = JSON.parse(JSON.stringify(item))
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.followTable.page.pageNum = 1
this.getFollower()
})
},
handleSearch() {
this.getFollower()
},
selectionTable(val) {
this.selectItem = val
},
handleClose() {
this.handleCancel()
},
rowClick(row) {
if (this.checkSelect.find(i => i == row.id)) return
this.$refs.followTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
handleCancel: utils.debounce(function() {
this.dialogVisible = false
this.$refs.followTable.$refs.salelistMutiTable.clearSelection()
}, 300),
handleSelect: utils.debounce(function() {
this.loading = true
let selectEmp = this.selectEmp.map(item => {
return {
id: item.staffId,
staffName: item.staffName
}
})
const selectItem = this.selectItem.concat(selectEmp)
if (selectItem.length == 0) {
this.$message.error('请选择跟进专员')
return
}
this.loading = false
this.dialogVisible = false
this.$emit('selectTable', this.selectItem.concat(selectEmp))
this.$refs.followTable.$refs.salelistMutiTable.clearSelection()
}, 300)
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.dialog-jump {
color: $btnBlue;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.square-main {
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
.form-tips {
position: absolute;
bottom: 0;
right: 0;
font-size: 12px;
color: #999;
line-height: 32px;
}
.table-box {
position: relative;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>仅筛选有外部客户联系人的成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover
ref="popover"
placement="bottom"
width="215"
trigger="click"
v-model="popoverVisible"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
class="select-tree"
:data="treeData"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick"
></el-tree>
<el-input
v-model="searchForm.department"
slot="reference"
:size="size"
readonly
placeholder="请选择所在门店/部门"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
@keyup.enter.native="search"
></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;">
<el-input
:size="size"
v-model.trim="searchForm.name"
@keyup.enter.native="search"
clearable
placeholder="请输入姓名搜索"
></el-input>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item style="margin-bottom: 0;">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable
:key="key"
v-loading="loading"
ref="empTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
:noDataImg="url"
@selectionTable="selectionTable"
@row-click="rowClick"
>
<div slot="staffName" slot-scope="scope">
<span>{{scope.scope.staffName}}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{scope.scope.staffTitle}}</span>
</div>
</GLTable>
</div>
</div>
<!-- <div class="member-checked">
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</div>-->
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{innerTags.length}}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag
v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData', 'followData'],
data() {
return {
url: url,
searchForm: {},
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
key: new Date()
}
},
mounted() {
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
listDepartmentTree() {
const params = { addChildrensFlag: true }
if (this.islord) {
// 是否群主
params.islord = this.islord
}
this.loading = true
params.isHavCustomer = true
this.$apis.groupGuest.listDepartmentTree(params).then(res => {
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.tableEmpData.length ? (this.$refs.empTable.tableHeightValues = '250px') : this.$refs.empTable.setTableHeightFun()
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
if (this.followData) this.tableParams.checkSelectVal = this.followData
// this.key = new Date()
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
if (data instanceof Array) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
if (this.followData.find(i => i == row.id)) return
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
...@@ -102,16 +102,13 @@ export default { ...@@ -102,16 +102,13 @@ export default {
this.innerTags.forEach(item => { this.innerTags.forEach(item => {
userIds.push(item.userId) userIds.push(item.userId)
}) })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
} }
// onCancel() {
// this.$emit('closeDrawer')
// }
}, },
mounted() {} mounted() {}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/variables.scss';
.drawer-sale-panel { .drawer-sale-panel {
padding: 0px 20px; padding: 0px 20px;
.sale-reload { .sale-reload {
...@@ -148,8 +145,8 @@ export default { ...@@ -148,8 +145,8 @@ export default {
font-size: 14px; font-size: 14px;
color: #7d7d7d; color: #7d7d7d;
&.checked { &.checked {
border: 1px solid #5850ff; border: 1px solid $btnBlue;
color: #5850ff; color: $btnBlue;
} }
i { i {
position: absolute; position: absolute;
......
<template>
<div class="scrm-sub-client-container">
<div class="header flex">
<div class="left-wrap shadow">
<div class="title-info">
<span class="info">群聊信息</span>
</div>
<div class="content">
<div class="group-name flex">
<div class="avator">
<img src="@/assets/guestCustom/chat-logo.png" alt />
</div>
<div class="group-name-info">
<div>{{groupInfo.groupName}}</div>
<div
class="group-name-info-count"
>{{groupInfo.userList ? groupInfo.userList.length : 0}}人</div>
</div>
</div>
<div class="text-info">
已建群数量:
<span class="group-number">{{groupInfo.groupCount}}</span>
</div>
</div>
</div>
<div class="right-wrap shadow">
<div class="title-info">
<span class="info">群成员构成</span>
</div>
<div class="content">
<div class="commissioner">
<div class="text-info">跟进专员:</div>
<div class="entmicro">
<div class="entmicro-tag" v-for="(tag, idx) in followList" :key="tag.id">
<el-tag type="info" v-if="idx < 6" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag>
<el-tag type="info" v-if="followList.length > 6 && idx == 6">
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ followList.length }})</span>
<div class="entmicro-hover">
<el-tag
type="info"
v-for="(i, index) in followList"
:key="index"
:disable-transitions="false"
>
<i class="el-icon-user-solid"></i>
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
</div>
<div class="commissioner">
<div class="text-info">入群成员:</div>
<div class="entmicro">
<div class="entmicro-tag" v-for="(tag, idx) in memberList" :key="tag.id">
<el-tag type="info" v-if="idx < 6" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag>
<el-tag type="info" v-if="memberList.length > 6 && idx == 6">
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ memberList.length }})</span>
<div class="entmicro-hover">
<el-tag
type="info"
v-for="(i, index) in memberList"
:key="index"
:disable-transitions="false"
>
<i class="el-icon-user-solid"></i>
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main shadow">
<div class="title-info flex">
<span class="info">客户群详情</span>
<div class="updata text-info" @click="refreshData">
<i class="el-icon-refresh"></i>
更新数据
</div>
<div class="text-info">更新于:{{currentTime}}</div>
</div>
<GLTable
class="table"
:searchForm="searchForm"
ref="groupDetail"
:hasNum="false"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:noDataImg="url"
:pageConf="pageConf"
:tableParams="tableParams"
:tableData="tableData"
>
<span slot="customerName" slot-scope="scope">
<div class="">
<!-- <div class="customer-img">
<img src="@/assets/guestCustom/chat-logo.png" alt="" />
</div>-->
<div class="customer-name">
{{ scope.scope.customerName }}
<label
class="origin"
>{{ WECHANT_TYPE[scope.scope.type]}}</label>
</div>
</div>
</span>
<div slot="groupOwner" slot-scope="scope">
<el-tag type="info" v-show="scope.scope.lordName" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ scope.scope.lordName }}{{ scope.scope.departmentName ? `(${scope.scope.departmentName})` : '' }}
</el-tag>
</div>
<span slot="status" class="table-status" slot-scope="scope">
<!-- <span
v-if="scope.scope.delFlag == '-1'"
class="statusText"
:class="{ 'red-text': scope.scope.delFlag == '-1' }"
>解散于<span v-if="scope.scope.delFlag == '-1'" class="gray-text">{{ scope.scope.disMiss }}</span></span>
<span
class="statusText"
v-if="scope.scope.delFlag == '0'"
>使用</span> -->
<span
class="statusText"
:class="{ 'red-text': scope.scope.delFlag == '-1' }"
>{{ scope.scope.delFlag == '0' ? '使用' : scope.scope.delFlag == '-1' ? '解散于' : '' }}</span>
<span v-if="scope.scope.delFlag == '-1'" class="gray-text">{{ scope.scope.disMiss }}</span>
</span>
</GLTable>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button @click="handleCancel" type="primary">取消</el-button>
</div>
</div>
</template>
<script>
const WECHANT_TYPE = {
1: '@微信',
2: '@企微'
}
import * as dayjs from 'dayjs'
export default {
name: 'guestGroupDetail',
data() {
return {
WECHANT_TYPE: WECHANT_TYPE,
searchForm: {},
getListApi: this.$apis.groupGuest.customerList,
tableData: [
{
id: 1,
customerName: '嵇翔',
type: 1, //1微信2企微
orgName: '守候专用服务一组',
createdTime: '2021-06-26 09:00:00 ',
delFlag: '0', //0使用 -1停用
groupName: '三人干饭小组',
lordName: '刘益玲',
departmentName: '财务管理中心'
},
{
id: 2,
customerName: '嵇翔',
type: 2, //1微信2企微
orgName: '守候专用服务一组',
createdTime: '2021-06-26 09:00:00',
cancelTime: '2021年7月22日',
delFlag: '-1', //0使用 -1停用
groupName: '三人干饭小组',
lordName: '刘益玲'
}
],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户',
prop: 'customerName',
addHtml: 'customerName',
align: 'left'
// width: 200
},
{
label: '创建时间',
prop: 'createdTime',
align: 'left'
// width: 200
},
{
label: '现群名称',
prop: 'chatName',
align: 'left'
},
{
label: '现群主',
prop: 'createdBy',
// minWidth: '180px',
addHtml: 'groupOwner',
align: 'left'
},
{
label: '状态',
prop: 'status',
addHtml: 'status',
// width: 250,
align: 'left'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
userList: [
{
id: 1110,
templateId: 87,
staffId: 25794,
staffName: '刘伟',
userId: 'GL1029',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1111,
templateId: 87,
staffId: 25795,
staffName: '乔宁',
userId: 'GL0667',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1112,
templateId: 87,
staffId: 25797,
staffName: '胡庚美',
userId: 'GL0376',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1113,
templateId: 87,
staffId: 25808,
staffName: '关则剑',
userId: 'GL1388',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1114,
templateId: 87,
staffId: 25813,
staffName: '邹琰',
userId: 'GL0778',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1115,
templateId: 87,
staffId: 25818,
staffName: '董成',
userId: 'GL0640',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1116,
templateId: 87,
staffId: 25823,
staffName: '麦舒琪',
userId: 'GL1485',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1117,
templateId: 87,
staffId: 25825,
staffName: '王科莉',
userId: '524',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1118,
templateId: 87,
staffId: 25870,
staffName: '康旭',
userId: 'GL1678',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1119,
templateId: 87,
staffId: 25899,
staffName: '陆汉林',
userId: 'GL1744',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1120,
templateId: 87,
staffId: 26035,
staffName: '蒋金家',
userId: 'GL1759',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1121,
templateId: 87,
staffId: 26113,
staffName: '测试机01',
userId: 'test001',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1122,
templateId: 87,
staffId: 26124,
staffName: '黄嘉泰',
userId: 'GL1775',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1124,
templateId: 87,
staffId: 26220,
staffName: '陆汉林',
userId: 'GL1744',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1125,
templateId: 87,
staffId: 26223,
staffName: '乔宁',
userId: 'GL0667',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1126,
templateId: 87,
staffId: 26224,
staffName: '麦舒琪',
userId: 'GL1485',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
}
],
userId: '',
groupInfo: {},
followList: [],
memberList: [],
currentTime: ''
}
},
created() {
console.log(this.$route.params.id)
this.userId = this.$route.params.id
this.getGroupList(this.$route.params.id)
},
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
},
methods: {
//更新数据
refreshData() {
this.$refs.groupDetail.refreshTable()
this.$set(this, 'currentTime', dayjs(new Date()).format('YYYY-MM-DD HH:mm'))
},
setTableFinishFun() {
if (this.$refs.groupDetail.data && !this.$refs.groupDetail.data.length) {
this.$refs.groupDetail.setTableHeightFun()
}
},
getGroupList(id) {
// const id = this.userId
this.$apis.groupGuest.detail({ id }).then(res => {
if (res) {
this.followList = []
this.memberList = []
this.currentTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm')
this.groupInfo = res
if (res.userList && res.userList.length) {
res.userList.forEach(item => {
if (item.follow == 1) {
this.followList.push(item)
} else {
this.memberList.push(item)
}
})
}
}
})
},
handleCancel() {
this.$router.push('/guestGroup/index')
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = {
templateId: this.userId
}
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
box-sizing: border-box;
overflow-y: auto;
margin-bottom: 80px;
.title-info {
width: 100%;
height: 56px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 56px;
border-bottom: 1px solid #d8d8d8;
.info {
margin-left: 20px;
}
}
.text-info {
height: 20px;
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 20px;
margin-right: 10px;
white-space: nowrap;
}
.shadow {
box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);
background: #ffffff;
}
.flex {
display: flex;
align-items: center;
}
.header {
width: 100%;
height: 227px;
margin-bottom: 20px;
.left-wrap {
width: 335px;
height: 100%;
margin-right: 20px;
& .content {
margin: 20px 20px 0 20px;
.group-name {
width: 295px;
height: 64px;
background: #f7f7f7;
border-radius: 4px;
border: 1px solid #dcdfe6;
padding: 10px;
margin-bottom: 30px;
box-sizing: border-box;
.avator {
width: 44px;
height: 44px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
}
}
&-info {
font-size: 14px;
font-weight: 400;
color: #333333;
div {
line-height: 20px;
height: 20px;
}
&-count {
color: #999999;
margin-top: 4px;
}
}
}
& .group-number {
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
margin-right: 10px;
}
}
}
.right-wrap {
width: calc(100% - 355px);
height: 100%;
& .content {
margin: 20px 0 0 44px;
.commissioner {
display: flex;
align-items: flex-start;
margin-bottom: 16px;
}
}
}
}
.main {
width: 100%;
& .updata {
color: $btnBlue;
margin: 0 10px 0 20px;
cursor: pointer;
i.el-icon-refresh {
font-size: 14px;
color: $btnBlue;
}
}
.table {
padding: 20px;
box-sizing: border-box;
}
}
.customer-name {
display: inline-block;
.origin {
color: $btnBlue;
font-size: 14px;
}
}
.customer {
margin-left: -100px;
.customer-img {
width: 34px;
height: 34px;
display: inline-block;
margin-right: 6px;
position: relative;
img {
height: 100%;
}
}
}
}
.entmicro {
text-align: left;
&-tag {
display: inline-block;
}
&-hover {
max-height: 214px;
overflow: auto;
i {
color: #75acff;
font-size: 13px;
}
}
}
i {
color: #75acff;
// margin-right: 3px;
font-size: 14px;
}
.el-tag {
margin: 0 10px 4px 0;
cursor: pointer;
background-color: #fff !important;
height: 26px;
line-height: 26px;
color: #666666;
padding: 0 6px !important;
}
.table-status {
display: flex;
align-items: center;
}
.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);
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<div class="btn-header"> <div class="btn-header">
<!-- <el-button class="addBtn" @click="btnClick('create')">新建群组</el-button> --> <!-- <el-button class="addBtn" @click="btnClick('create')">新建群组</el-button> -->
<GLButton class="addBtn" @click="btnClick('create')" fn="新建群组">新建群组</GLButton> <GLButton class="addBtn" @click="btnClick('create')" fn="新建群组">新建群组</GLButton>
<span class="toptips"> <span class="toptips">
<span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span> <span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span>
</span> </span>
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
class="searchTop border-shadow" class="searchTop border-shadow"
:formModel="searchForm" :formModel="searchForm"
:formList="searchFormData" :formList="searchFormData"
labelWidth="70px"
> >
<span class="inline-b" style="float: right;" slot="form-slot"> <span class="inline-b" style="float: right" slot="form-slot">
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
</span> </span>
</search-form> </search-form>
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
trigger="hover" trigger="hover"
content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
> >
<span slot="reference">...({{scope.scope.userList.length}})</span> <span slot="reference">...({{ scope.scope.userList.length }})</span>
<div class="entmicro-hover"> <div class="entmicro-hover">
<el-tag <el-tag
type="info" type="info"
...@@ -70,13 +71,19 @@ ...@@ -70,13 +71,19 @@
>{{ scope.scope.status == '1' ? '启用' : '停用' }}</span> >{{ scope.scope.status == '1' ? '启用' : '停用' }}</span>
</span> </span>
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<!-- <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button> --> <!-- <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
<GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton> <el-button type="text" @click="btnClick('detail', scope.scope)">查看详情</el-button>-->
<GLButton type="text" @click="btnClick('status', scope.scope)" fn="启用禁用">{{ scope.scope.status == 1 ? '停用' : '启用' }}</GLButton> <GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton>
<GLButton
type="text"
@click="btnClick('status', scope.scope)"
fn="启用禁用"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</GLButton>
<GLButton type="text" @click="btnClick('detail', scope.scope)" fn="客户群详情">查看详情</GLButton>
<!-- <el-button <!-- <el-button
type="text" type="text"
@click="btnClick('status', scope.scope)" @click="btnClick('status', scope.scope)"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button> --> >{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button>-->
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -97,8 +104,8 @@ export default { ...@@ -97,8 +104,8 @@ export default {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'groupName', prop: 'groupName',
label: '组名', label: '群聊名称',
placeholder: '请输入组名搜索', placeholder: '请输入群聊名称搜索',
clearable: true clearable: true
} }
], ],
...@@ -112,8 +119,8 @@ export default { ...@@ -112,8 +119,8 @@ export default {
}, },
tableColumns: [ tableColumns: [
{ {
label: '组名', label: '群聊名称',
prop: 'orgName', prop: 'groupName',
width: 200 width: 200
}, },
{ {
...@@ -238,8 +245,35 @@ export default { ...@@ -238,8 +245,35 @@ export default {
// if (val.path == '/guestGroup/index') this.searchTable() // if (val.path == '/guestGroup/index') this.searchTable()
// } // }
// }, // },
mounted() {}, mounted() {
this.wxTips()
},
methods: { methods: {
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.groupGuest.getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
},
jumpWx() {
this.$history.push('/settings/enterpriseWechat/index')
},
//搜索表格 //搜索表格
searchTable() { searchTable() {
this.$refs.gueastGroup.refreshTable() this.$refs.gueastGroup.refreshTable()
...@@ -252,6 +286,9 @@ export default { ...@@ -252,6 +286,9 @@ export default {
case 'edit': case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id) this.$router.push('/guestGroup/add/' + rowData.id)
break break
case 'detail':
this.$router.push('/guestGroup/detail/' + rowData.id)
break
case 'status': case 'status':
this.$confirm(`是否确认${rowData.status == 1 ? '停用' : '启用'}?`, '提示', { this.$confirm(`是否确认${rowData.status == 1 ? '停用' : '启用'}?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -369,7 +406,6 @@ export default { ...@@ -369,7 +406,6 @@ export default {
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
cursor: pointer; cursor: pointer;
background-color: #fff !important;
} }
/deep/ { /deep/ {
.search-form { .search-form {
......
...@@ -7,29 +7,31 @@ ...@@ -7,29 +7,31 @@
<!-- v-if="!((merchantModel==2 && accountLevel==4) || (merchantModel==1 && accountLevel==1))" --> <!-- v-if="!((merchantModel==2 && accountLevel==4) || (merchantModel==1 && accountLevel==1))" -->
<span> <span>
共有{{ numberObj.groupCount || 0 }}个标签组 共有{{ numberObj.groupCount || 0 }}个标签组
<template v-if="!(merchantModel == 1 && accountLevel == 4)">,{{ numberObj.bizLabelCount || 0 }}个企业标签</template> <!-- v-if="!(merchantModel == 1 && accountLevel == 4)" -->
<template>,{{ numberObj.bizLabelCount || 0 }}个企业标签</template>
<template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">,{{ numberObj.rcLabelCount || 0 }}个自店标签</template> <template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">,{{ numberObj.rcLabelCount || 0 }}个自店标签</template>
</span> </span>
<span class="iconPanelWrap" v-if="!isFirstShow"> <span class="iconPanelWrap" v-if="!isFirstShow">
<el-popover placement="top" width="666" trigger="hover"> <el-popover placement="top" width="666" trigger="hover">
<div v-if="!(merchantModel == 1 && accountLevel == 4)">企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;</div> <!-- v-if="!(merchantModel == 1 && accountLevel == 4)" -->
<div>企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;</div>
<div v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</div> <div v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</div>
<div>行业标签为通过大数据算法规则生成的标签</div> <div>系统标签为通过大数据算法规则生成的标签</div>
<img src="@/assets/tagsManage/question.png" slot="reference" alt="" /> <img src="@/assets/tagsManage/question.png" slot="reference" alt="" />
</el-popover> </el-popover>
</span> </span>
</span> </span>
<div class="initPanel" v-if="isFirstShow"> <div class="initPanel" v-if="isFirstShow">
<template v-if="!(merchantModel == 1 && accountLevel == 4)">企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;</template> <template>企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;</template>
<template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</template> <template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</template>
行业标签为通过大数据算法规则生成的标签 系统标签为通过大数据算法规则生成的标签
<img src="@/assets/tagsManage/Shape.png" alt="" /> <img src="@/assets/tagsManage/Shape.png" alt="" />
<i class="el-icon-close" @click="closeInitPanel"></i> <i class="el-icon-close" @click="closeInitPanel"></i>
</div> </div>
<div class="pageContent"> <div class="pageContent">
<!-- @setTableHeightEvent="setTableHeightEvent" --> <!-- @setTableHeightEvent="setTableHeightEvent" -->
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="tagsPartFormList" @setTableHeightEvent="setTableHeightEvent"> <search-form class="searchTop border-shadow" :formModel="searchForm" :formList="tagsPartFormList" @setTableHeightEvent="setTableHeightEvent" labelWidth="54px">
<span class="inline-b" slot="form-slot"> <span class="inline-b" slot="form-slot">
<el-button @click="resetTable" plain>重置</el-button> <el-button @click="resetTable" plain>重置</el-button>
<!-- :id="tableParams.btnId" --> <!-- :id="tableParams.btnId" -->
...@@ -45,12 +47,12 @@ ...@@ -45,12 +47,12 @@
<!-- :class="[expande ? 'expande' : 'close']" --> <!-- :class="[expande ? 'expande' : 'close']" -->
<div id="allTagsWrap" class="allTagsWrap"> <div id="allTagsWrap" class="allTagsWrap">
<span v-for="(item, index) in showTagArray(scope.scope.labelList)" :key="index" class="ellipsis-1 tag-box-wrap"> <span v-for="(item, index) in showTagArray(scope.scope.labelList)" :key="index" class="ellipsis-1 tag-box-wrap">
<el-tooltip class="item" :content="item.name" placement="top"> <el-tooltip class="item" :content="item.name" placement="top">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</el-tooltip> </el-tooltip>
</span> </span>
<el-popover v-if="scope.scope.labelList.length > 9" class="ellipsis-1 tag-box-wrap" placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"> <el-popover v-if="scope.scope.labelList.length > 9" class="ellipsis-1 tag-box-wrap" placement="top" width="800" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<span slot="reference">...({{ scope.scope.labelList.length }})</span> <span slot="reference">...({{ scope.scope.labelList.length }})</span>
<div class="entmicro-hover" style="height: 214px; overflow-y: auto"> <div class="entmicro-hover" style="height: 214px; overflow-y: auto">
<el-tag type="info" class="ellipsis-1" style="margin-right: 10px; margin-bottom: 10px; max-width: 200px" v-for="(i, sindex) in scope.scope.labelList" :key="sindex" :disable-transitions="false"> <el-tag type="info" class="ellipsis-1" style="margin-right: 10px; margin-bottom: 10px; max-width: 200px" v-for="(i, sindex) in scope.scope.labelList" :key="sindex" :disable-transitions="false">
...@@ -64,7 +66,9 @@ ...@@ -64,7 +66,9 @@
</span> </span>
<template slot="xxx" slot-scope="scope"> <template slot="xxx" slot-scope="scope">
<!-- //这版关掉自店标签 1.0.1允许集团的门店打字店标签,也可以编辑--> <!-- //这版关掉自店标签 1.0.1允许集团的门店打字店标签,也可以编辑-->
<span @click="btnClick('edit', scope.scope)" class="blue-text" v-if="scope.scope.labelType != '行业标签' && isShowEditBtn(scope.scope)">编辑标签组</span> <!-- v-if="scope.scope.labelType != '系统标签' && isShowEditBtn(scope.scope)" -->
<span @click="btnClick('edit', scope.scope)" v-if="scope.scope.labelType != '系统标签' && isShowEditBtn(scope.scope)" class="blue-text" >编辑标签组</span>
<GLButton class="blue-text leftDistance" type="text" fn="查看客户" v-if="userType!==2" @click="toViewCustomer(scope.scope)" >查看客户</GLButton>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -78,9 +82,9 @@ ...@@ -78,9 +82,9 @@
</el-select> </el-select>
<!-- id="tagTipMsgRef" --> <!-- id="tagTipMsgRef" -->
<span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组' && !tagForm.initTagsGroup"> <span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组' && !tagForm.initTagsGroup">
<template v-if="!(merchantModel == 1 && accountLevel == 4)">企业标签</template> <template v-if="!(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))">企业标签</template>
<template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"> <template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">
<template v-if="!(merchantModel == 1 && accountLevel == 4)">和</template> <template v-if="!(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))">和</template>
自店标签分别 自店标签分别
</template> </template>
最多3000个 最多3000个
...@@ -108,7 +112,7 @@ ...@@ -108,7 +112,7 @@
<div class="tagsWrap" v-if="tagDialogTitle == '编辑标签组'"> <div class="tagsWrap" v-if="tagDialogTitle == '编辑标签组'">
<span class="tag" :class="{ inputWrapShow: item.inputVisible }" v-for="item in editTagList" :key="item.id"> <span class="tag" :class="{ inputWrapShow: item.inputVisible }" v-for="item in editTagList" :key="item.id">
<!-- maxlength="30" show-word-limit --> <!-- maxlength="30" show-word-limit -->
<el-input class="input-new-tag" v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="item.name=handleInputConfirm(item.name, item.id)" @keyup.enter.native="item.name=handleInputConfirm(item.name, item.id)"></el-input> <el-input class="input-new-tag" v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="item.name = handleInputConfirm(item.name, item.id)" @keyup.enter.native="item.name = handleInputConfirm(item.name, item.id)"></el-input>
<el-tooltip class="item" :content="item.name" placement="top"> <el-tooltip class="item" :content="item.name" placement="top">
<span class="ellipsis-1" v-if="!item.inputVisible">{{ item.name }}</span> <span class="ellipsis-1" v-if="!item.inputVisible">{{ item.name }}</span>
</el-tooltip> </el-tooltip>
...@@ -118,7 +122,7 @@ ...@@ -118,7 +122,7 @@
<div class="row-tag" v-for="(item, index) in tagForm.tagsList" :key="index"> <div class="row-tag" v-for="(item, index) in tagForm.tagsList" :key="index">
<!-- :onkeyup="(item.name = item.name.replace(/\s+/g, ''))" maxlength="30" show-word-limit @input="checkInputContent"--> <!-- :onkeyup="(item.name = item.name.replace(/\s+/g, ''))" maxlength="30" show-word-limit @input="checkInputContent"-->
<el-input v-model.trim="item.name" placeholder="添加标签名称(至少添加一个标签)" @keyup.native="item.name = checkInputContent(item.name)" ></el-input> <el-input v-model.trim="item.name" placeholder="添加标签名称(至少添加一个标签)" @keyup.native="item.name = checkInputContent(item.name)"></el-input>
<span class="el-icon-circle-close" @click="deleteRow(index)"></span> <span class="el-icon-circle-close" @click="deleteRow(index)"></span>
</div> </div>
<!-- 需要后台告诉已经创建多少个标签了 --> <!-- 需要后台告诉已经创建多少个标签了 -->
...@@ -206,8 +210,8 @@ export default { ...@@ -206,8 +210,8 @@ export default {
value: '自店标签' value: '自店标签'
}, },
{ {
label: '行业标签', label: '系统标签',
value: '行业标签' value: '系统标签'
} }
] ]
}, },
...@@ -240,15 +244,15 @@ export default { ...@@ -240,15 +244,15 @@ export default {
label: '标签', label: '标签',
prop: 'labelList', prop: 'labelList',
addHtml: 'labelList', addHtml: 'labelList',
align: 'left' align: 'center'
}, },
{ {
label: '操作', label: '操作',
prop: 'xxx', prop: 'xxx',
fixed: 'right', fixed: 'right',
addHtml: 'xxx', addHtml: 'xxx',
width: 120 width: 180
} }
] ]
// tableOption: { // tableOption: {
// width: 120 // width: 120
...@@ -271,7 +275,8 @@ export default { ...@@ -271,7 +275,8 @@ export default {
placeholder: '最多30个字符,1个汉字为2个字符', placeholder: '最多30个字符,1个汉字为2个字符',
// maxlength: 30, // maxlength: 30,
// showWordLimit: true, // showWordLimit: true,
disabled: false disabled: false,
clickFunc:this.watchInput
}, },
{ {
label: '标签组类型', label: '标签组类型',
...@@ -291,10 +296,10 @@ export default { ...@@ -291,10 +296,10 @@ export default {
tagRules: { tagRules: {
tagsName: [ tagsName: [
{ required: true, message: '请输入名称', trigger: 'blur' }, { required: true, message: '请输入名称', trigger: 'blur' },
{ // {
validator: checkName, // this.$Commons.checkName, // validator: checkName,
trigger: 'blur' // trigger: 'change'
} // }
], ],
initTagsGroup: [{ required: true, message: '请选择标签组类型', trigger: 'change' }] initTagsGroup: [{ required: true, message: '请选择标签组类型', trigger: 'change' }]
// tagsList: [{ required: true }] // tagsList: [{ required: true }]
...@@ -328,11 +333,11 @@ export default { ...@@ -328,11 +333,11 @@ export default {
// if (this.merchantModel == 1) { // if (this.merchantModel == 1) {
// if (!(this.accountLevel == 1 && this.userType == 1)) this.tagsGroupList.splice(0, 1) //只能创建自店标签 // if (!(this.accountLevel == 1 && this.userType == 1)) this.tagsGroupList.splice(0, 1) //只能创建自店标签
// } // }
//1.0.1集团下的门店只能创建自店标签 //1.0.1集团下的省代、市代,门店只能创建自店标签
if (this.merchantModel == 1) { if (this.merchantModel == 1) {
if (this.accountLevel == 4) { if (this.accountLevel == 2 || this.accountLevel == 3 || this.accountLevel == 4) {
this.tagsGroupList.splice(0, 1) //只能创建自店标签 this.tagsGroupList.splice(0, 1) //只能创建自店标签
this.tagsPartFormList[0].options.splice(0, 1) // this.tagsPartFormList[0].options.splice(0, 1)
} }
} }
...@@ -365,6 +370,21 @@ export default { ...@@ -365,6 +370,21 @@ export default {
// }, 200) // }, 200)
}, },
methods: { methods: {
// toViewCustomer(info) {
// this.$router.push('/tagsManage/viewCustomers')
// },
toViewCustomer(info) {
console.log(info)
const id = info.labelGroup.id
const type = info.labelType
this.$router.push({
// path:`/tagsManage/viewCustomers/530`
path:`/tagsManage/viewCustomers/${id}/${type}`
})
},
watchInput(){
console.log('点击标签组名称输入框')
},
showTagArray(list) { showTagArray(list) {
if (list.length == 0) { if (list.length == 0) {
return [] return []
...@@ -373,39 +393,19 @@ export default { ...@@ -373,39 +393,19 @@ export default {
return list.slice(0, 9) return list.slice(0, 9)
}, },
checkInputContent(e) { checkInputContent(e) {
let str=e //确保每个输入框的内容不和已存在的编辑标签相同
var len = 0
var singleNum=0
var doubleNum=0
for (var i = 0; i < e.length; i++) {
var c = e.charCodeAt(i)
//单字节加1
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
len++
singleNum++
} else {
len += 2
doubleNum++
}
}
if (len > 30) {
this.$message.error('字数已达上限')
return str.substr(0, 15)
}
// console.log(e, '输入框的值')
//确保每个输入框的内容不和已存在的编辑标签相同
let isHasSameTag = this.editTagList.some(ele => ele.name == e) let isHasSameTag = this.editTagList.some(ele => ele.name == e)
if (isHasSameTag) { if (isHasSameTag) {
this.$message.error('不允许输入已存在的标签') this.$message.error('不允许输入已存在的标签')
return str return e
} }
return str return this.$Utils.cutMaxCharStr(e)
}, },
isShowEditBtn(row) { isShowEditBtn(row) {
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店 //集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//单店模式下,仅门店和员工可以编辑 //单店模式下,仅门店和员工可以编辑
if (row.labelType == '自店标签' && !(this.merchantModel == 1 && this.accountLevel == 4)) { if (row.labelType == '自店标签' && !(this.merchantModel == 1 && (this.accountLevel == 2 || this.accountLevel == 3 || this.accountLevel == 4))) {
return false return false
} }
if (this.merchantModel == 1) { if (this.merchantModel == 1) {
...@@ -435,14 +435,6 @@ export default { ...@@ -435,14 +435,6 @@ export default {
}, },
setTableFinishFun(content) { setTableFinishFun(content) {
console.log('表格完成', this.$refs.tagsManage.data) console.log('表格完成', this.$refs.tagsManage.data)
// if (this.$refs.tagsManage.data.length) {
// this.$refs.tagsManage.data.forEach(item => {
// item.expande = true
// item.needShowExpande = false
// })
// } else {
// this.$refs.tagsManage.setTableHeightFun()
// }
this.$refs.tagsManage.data.length ? (this.$refs.tagsManage.tableHeightValues = '') : this.$refs.tagsManage.setTableHeightFun() this.$refs.tagsManage.data.length ? (this.$refs.tagsManage.tableHeightValues = '') : this.$refs.tagsManage.setTableHeightFun()
}, },
getLoginCountFun() { getLoginCountFun() {
...@@ -467,12 +459,12 @@ export default { ...@@ -467,12 +459,12 @@ export default {
}, },
//重置表格 //重置表格
resetTable() { resetTable() {
this.isReload = false // this.isReload = false
this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel } this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel }
// this.$refs.tagsManage.refreshTable() this.$refs.tagsManage.refreshTable()
this.$nextTick(() => { // this.$nextTick(() => {
this.isReload = true // this.isReload = true
}) // })
}, },
btnClick(pType, rowData) { btnClick(pType, rowData) {
...@@ -482,7 +474,7 @@ export default { ...@@ -482,7 +474,7 @@ export default {
this.tagDialogTitle = '添加标签组' this.tagDialogTitle = '添加标签组'
this.tagForm.tagsForm = '' this.tagForm.tagsForm = ''
this.tagForm.initTagsGroup = 1 //默认改成,企业标签 this.tagForm.initTagsGroup = 1 //默认改成,企业标签
if (this.merchantModel == 1 && this.accountLevel == 4) { if (this.merchantModel == 1 && (this.accountLevel == 2 || this.accountLevel == 3 || this.accountLevel == 4)) {
this.tagForm.initTagsGroup = 2 this.tagForm.initTagsGroup = 2
} }
...@@ -498,6 +490,18 @@ export default { ...@@ -498,6 +490,18 @@ export default {
break break
} }
}, },
isHasSome(array) {
var temp = [] //一个新的临时数组
for (var i = 0; i < array.length; i++) {
if (temp.indexOf(array[i]) !== -1) {
return true
}
if (temp.indexOf(array[i]) == -1) {
temp.push(array[i])
}
}
return false
},
//编辑触发事件 //编辑触发事件
editEvent(rowData) { editEvent(rowData) {
this.handleClose() this.handleClose()
...@@ -534,6 +538,16 @@ export default { ...@@ -534,6 +538,16 @@ export default {
this.$message.error('不能提交空标签') this.$message.error('不能提交空标签')
return return
} }
//如果存在添加标签的输入框的内容的标签相同则不提交
let isSameTagFlag = false
var tempArr = this.tagForm.tagsList.map(item => item.name)
isSameTagFlag = this.isHasSome(tempArr)
if (isSameTagFlag) {
this.$message.error('不能提交相同的标签,请修改')
return
}
this.newAddTagFun() this.newAddTagFun()
//this.handleClose() //这里不管 //this.handleClose() //这里不管
} else { } else {
...@@ -572,7 +586,7 @@ export default { ...@@ -572,7 +586,7 @@ export default {
if (!this.tagVisible && this.$refs.tagForm) { if (!this.tagVisible && this.$refs.tagForm) {
this.$refs.tagForm.$children[0].resetFields() this.$refs.tagForm.$children[0].resetFields()
this.tagForm.initTagsGroup = 1 this.tagForm.initTagsGroup = 1
if (this.merchantModel == 1 && this.accountLevel == 4) { if (this.merchantModel == 1 && (this.accountLevel == 2 || this.accountLevel == 3 || this.accountLevel == 4)) {
this.tagForm.initTagsGroup = 2 this.tagForm.initTagsGroup = 2
} }
this.tagForm.tagsName = '' this.tagForm.tagsName = ''
...@@ -603,12 +617,26 @@ export default { ...@@ -603,12 +617,26 @@ export default {
if (!res) { if (!res) {
return return
} }
// console.log(res, 'res信息')
if (res.data.code == 0) { if (res.data.code == 0) {
this.$message.success('添加成功') if (this.tagForm.tagsList.length > 0) {
this.$message.success('添加成功')
}
if (this.tagDialogTitle == '编辑标签组') {
this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = []
}
this.handleClose() this.handleClose()
} else if (res.data.code == 1) { } else if (res.data.code == 1) {
this.$message.error(`${res.data.message}`) this.$message.error(`${res.data.message}`)
} else if (res.data.code == 2) {
//编辑弹框, 空标签调接口返回信息
if (this.tagDialogTitle == '编辑标签组') {
this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = []
}
this.handleClose()
} }
this.resetTable() //刷新下表格 this.resetTable() //刷新下表格
this.getTableTagNumFun() this.getTableTagNumFun()
...@@ -638,9 +666,9 @@ export default { ...@@ -638,9 +666,9 @@ export default {
} }
this.$message.success('修改成功') this.$message.success('修改成功')
this.tagForm.tagsName = '' // this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = '' // this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = [] // this.tagForm.tagsList = []
this.resetTable() //刷新下表格 this.resetTable() //刷新下表格
}) })
...@@ -682,28 +710,7 @@ export default { ...@@ -682,28 +710,7 @@ export default {
i.inputVisible = false i.inputVisible = false
} }
}) })
let str = inputValue return this.$Utils.cutMaxCharStr(inputValue)
var len = 0
var singleNum=0
var doubleNum=0
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i)
//单字节加1
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
len++
singleNum++
} else {
len += 2
doubleNum++
}
}
if (len > 30) {
this.$message.error('字数已达上限')
return str.substr(0, 15)
}
return str
}, },
handleSelect(value) { handleSelect(value) {
console.log('值内容', value) console.log('值内容', value)
...@@ -724,10 +731,14 @@ export default { ...@@ -724,10 +731,14 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
@import '@/styles/resetelement.scss'; @import '@/styles/resetelement.scss';
.leftDistance{
margin-left: 10px;
}
.scrm-sub-client-container { .scrm-sub-client-container {
/deep/.search-form .el-form-item__content { /deep/.search-form .el-form-item__content {
width: inherit; width: auto;
} }
// // el-form-item__label
// /deep/.el-table tbody tr:hover > td { // /deep/.el-table tbody tr:hover > td {
// background-color: #f4f3ff; // background-color: #f4f3ff;
// } // }
...@@ -760,7 +771,7 @@ export default { ...@@ -760,7 +771,7 @@ export default {
position: relative; position: relative;
margin-left: 10px; margin-left: 10px;
height: 20px; height: 20px;
width: 340px; min-width: 440px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
...@@ -802,7 +813,7 @@ export default { ...@@ -802,7 +813,7 @@ export default {
min-height: 80px; min-height: 80px;
box-sizing: border-box; box-sizing: border-box;
background: #e6e9ff; background: #e6e9ff;
border: 1px solid $borderBlue; border: 1px solid $btnBlue;
border-radius: 4px; border-radius: 4px;
padding: 10px 42px; padding: 10px 42px;
height: 60px; height: 60px;
...@@ -830,7 +841,7 @@ export default { ...@@ -830,7 +841,7 @@ export default {
margin-top: 20px; margin-top: 20px;
background-color: #fff; background-color: #fff;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 10px;
} }
.allTagsWrap { .allTagsWrap {
...@@ -852,7 +863,8 @@ export default { ...@@ -852,7 +863,8 @@ export default {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
// margin-bottom: 2px; margin-top: 5px;
margin-bottom: 5px;
padding: 0 10px; padding: 0 10px;
box-sizing: border-box; box-sizing: border-box;
min-width: 76px; min-width: 76px;
......
<template>
<div v-loading="loading2">
<div class="scrm-sub-client-container">
<div class="pageContent">
<div class="labelSet">
<div class="labelSetLeft">标签组:{{ labelGroupName }}</div>
<div class="labelSetLeftRight">
{{ labelUpdateType }}
</div>
</div>
<div class="choiceLabel">
<div class="choiceLabelLeft">
<div class="addLabelStyle">标签:</div>
<button class="addTagsBtn" @click="choiceLabel">选择标签</button>
</div>
<button class="backBtn" @click="goBack">返回标签管理</button>
<!-- <span>(默认显示标签组已打标签所有客户)</span> -->
</div>
<!-- <div class="clientList">
标签组客户列表(100人)
</div> -->
<!-- <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable" @handleExport="handleExport" @syncClick="syncClick">
<span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span>
</search-form> -->
</div>
</div>
<div class="scrm-sub-client-container">
<div class="pageContent" >
<div>
<div class="clientNumExp">
<div class="clientNum">
<!-- {{ labelGroupName }} -->
<!-- <div class="clientListNew">标签组客户列表</div>
<div class="clientNumText">{{ tableTotal }}个</div> -->
<div class="clientListNew">
标签组客户列表
<div class="clientNumText">{{ tableTotal }}个</div>
</div>
</div>
<el-button class="export" size="small" type="primary" @click="handleExport">导出</el-button>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="viewCustomers" :layout="layout" :hasNum="true" :tableData="tableData" :tableTotal="tableTotal" :noDataImg="url" :pageConf="pageConf" :searchForm="searchFormTable" @refreshTable="getCustomersListData" :tableParams="tableParams">
<span slot="qiweimingcheng" slot-scope="scope">
<span>{{ myStandNo(scope.scope.carVin) }}</span>
</span>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
<div v-if="idx == 0">
<span>{{ list.nickName }}</span>
<span class="smallFontSize" :class="[list.type == 1 ? 'pure-green-text' : '', list.type == 2 ? 'pure-yello-text' : '']">@{{ list.corpName }}</span>
</div>
<span v-if="idx == 1">
<el-popover placement="right-start" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<div v-for="(i, index) in scope.scope.nickNameList" style="padding-bottom:3px !important" :key="index">
<span>{{ i.nickName }}</span>
<span style="height: 20px; font-size: 12px; letter-spacing: 0; line-height: 20px; font-weight: 400;margin-left:2px" :class="[i.type == 1 ? 'pure-green-text' : '', i.type == 2 ? 'pure-yello-text' : '']">@{{ i.corpName }}</span>
</div>
<img class="imgEll" src="@/assets/tagsManage/ellipsis.png" alt="" slot="reference" />
</el-popover>
</span>
</div>
</div>
<span slot="carVin" slot-scope="scope">
<span>{{ myStandNo(scope.scope.carVin) }}</span>
</span>
<span slot="status" slot-scope="scope">
<span class="statusText" :class="scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[1] : ''">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[0] : '--' }}</span>
</span>
<span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
<el-dialog title="选择标签" width="314px" :visible="dialogVisible" class="labelDialog" :before-close="handleDialogClose">
<el-input placeholder="请输入搜索关键字" v-model="searchLabel" clearable>
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<div class="labelCombination">
<div class="iconLabels">
<img src="@/assets/tagsManage/doc.png" alt="" />
<span class="iconLabelstext">{{ labelGroupName }}</span>
</div>
<div class="label-panle" :style="{ height: boxHeight + 'px' }" v-if="items.length > 0">
<template v-for="(item, index) in items">
<div class="iconLabelsName" :class="{ active: checkedId == item.labelId }" :key="index" @click="seletLabelActive(item.labelId, item)">
<img src="@/assets/tagsManage/label.png" alt="" />
<span :title="item.labelName.length > 10 ? 'item.labelName' : ''" class="LabelsNameTxt">{{ item.labelName }}</span>
<img v-if="checkedId == item.labelId" class="labelChecked" src="@/assets/tagsManage/checked.png" alt="" />
</div>
</template>
</div>
<div class="noRelatedLabel" v-else>
<img src="@/assets/tagsManage/noData.png" alt="" />
<div>暂无 {{ searchLabel }} 相关内容</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="resetSearch">重置</el-button>
<el-button type="primary" @click="searchClientData">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getCustomersList, getLabelList, exportLabelList } from '@/api/modules/tagsManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'viewCustomers',
components: {},
data() {
return {
loading2: false,
checkedId: '',
allListParams: {
tagLists: []
},
allLabeltags: [],
customerListsNum: 0,
checkedTag: [],
isActive: -1,
groupId: '',
groupType: '',
tagLists: [], //查询
searchLabel: '', //搜索标签
labelGroupName: '', //标签组名称
labelList: [], //存放标签
dialogVisible: false,
labelType: '',
isReload: true,
noRelatedLabel: false,
url: url,
sloading: false,
searchForm: {},
searchForm3: {},
searchFormTable: {},
boxHeight: 200,
exportParams: {},
clientGroupFormList: [
{
type: 'input',
inputType: 'text',
prop: 'phoneNumber',
label: '联系电话',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'registrationNumber',
label: '车牌号',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'vin',
label: '车架号',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: ''
},
{
type: 'select',
prop: 'joinQW',
label: '是否加企微',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 2
}
]
},
{
type: 'select',
prop: 'followUpStaffs',
label: '跟进员工',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '张三',
value: 1
},
{
label: '李四',
value: 2
},
{
label: '王五',
value: 3
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'carSeries',
label: '车系',
placeholder: ''
}
],
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '客户姓名',
prop: 'customerName',
minWidth: 150
},
{
label: '企微名称',
prop: 'nickNameList',
addHtml: 'nickNameList',
minWidth: 200
},
{
label: '联系电话',
prop: 'customerPhone',
minWidth: 110
},
{
label: '车牌号',
prop: 'carNumber'
// width: 160
},
{
label: '车架号(后6位)',
prop: 'carVin',
addHtml: 'carVin',
minWidth: '110'
},
{
label: '车系',
prop: 'audi'
// width: 160
},
{
label: '跟进员工',
prop: 'followStaff',
minWidth: 120
},
{
label: '是否加企微',
prop: 'isJoin',
addHtml: 'isJoin',
minWidth: 100
},
{
label: '添加时间',
prop: 'addTime',
minWidth: 150
}
]
},
tableData: [],
merchantModel: 1,
flushTime: false
// items
}
},
created() {
this.groupId = this.$route.params.info ? this.$route.params.info : ''
this.groupType = this.$route.params.type ? this.$route.params.type : ''
this.getLabelList()
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
}
},
beforeDestroy() {
this.$message.closeAll()
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 250
},
watch: {
labelType(val) {
switch (val) {
case '企业标签':
this.labelUpdateType = '企业标签 | 手动更新'
break
case '自店标签':
this.labelUpdateType = '自店标签 | 手动更新'
break
case '系统标签':
this.labelUpdateType = '系统标签 | 自动更新'
break
}
},
searchLabel(val) {
if (this.allLabeltags.indexOf(val) == -1) {
this.noRelatedLabel = true
} else {
this.noRelatedLabel = false
}
}
},
computed: {
items: function () {
var _search = this.searchLabel
const labelList = this.labelList.filter(item => item.labelName.indexOf(_search) > -1)
return labelList
}
},
methods: {
myStandNo(carVin) {
if (!carVin) {
return ''
}
return carVin.substring(carVin.length - 6)
},
getCustomersListData() {
const params = {
...JSON.parse(JSON.stringify(this.allListParams)),
pageSize: this.$refs.viewCustomers.page.pageSize,
pageNum: this.$refs.viewCustomers.page.pageNum
}
this.exportParams = {...JSON.parse(JSON.stringify(this.allListParams))}
this.loading2 = true;
getCustomersList(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data.length == 0) {
this.$refs.viewCustomers.setTableHeightFun()
}
setTimeout(()=>{
this.loading2 = false;
},300)
})
},
//获取标签组
getLabelList() {
let params = {
// 'labelByGroupIdReq.labelGroupId': this.groupId
'labelByGroupIdReq.labelGroupId': this.groupId,
'labelByGroupIdReq.labelGroupType': this.groupType
}
getLabelList(params).then(res => {
console.log(this.$common)
this.labelGroupName = res.groupName
this.labelList = res.labelNameIds
this.labelType = res.groupType
this.groupId = res.groupId
this.labelList.forEach(item => {
// this.allLabeltags.push(item.labelName)
item.isHidden = true
let res = this.getListParams(item.labelId, item.labelName)
this.allListParams.tagLists.push(res)
})
this.startParams = this.$common.utils.deepClone(this.allListParams)
this.searchForm = {
...this.allListParams
}
this.getCustomersListData()
})
},
seletLabelActive(id, arr) {
if (id == this.checkedId) {
this.checkedId = ''
this.tagLists = []
this.allListParams = this.startParams
return
}
this.checkedId = id
const labelId = arr.labelId
const labelName = arr.labelName
let res = this.getListParams(labelId, labelName)
if (this.tagLists.length > 0) {
// this.checkedTag.shift()
this.tagLists.shift()
}
this.tagLists.push(res)
},
// 首次加载页面显示所有客户数据
getAllClientList(allListParams) {
this.searchForm = {
...allListParams
}
console.log(this.searchForm)
// this.exportParams = {...allListParams}
this.getCustomersListData()
this.tagLists = []
},
// 根据标签获取客户列表
searchClientData() {
this.$refs.viewCustomers.page.pageNum = 1
this.dialogVisible = false
if (!this.tagLists.length) {
// this.exportParams = {...this.allListParams}
this.getAllClientList(this.allListParams)
} else {
this.allListParams = {
tagLists: this.tagLists
}
// this.exportParams = {...this.allListParams}
this.getCustomersListData()
}
},
getListParams(id, name) {
const params = {}
params.groupId = this.groupId
params.groupName = this.labelGroupName
params.groupType = this.labelType
params.labelId = id
params.labelName = name
return params
},
// 重置按钮
resetSearch() {
this.searchLabel = ''
this.checkedId = ''
this.tagLists = []
this.allListParams = this.startParams
// this.$refs.viewCustomers.page.pageNum = 1
// this.$refs.viewCustomers.page.pageSize = 10
// this.getCustomersListData()
// this.dialogVisible = false
},
filterNode(val, labelData) {
if (!val) return true
return labelData.label.indexOf(val) !== -1
},
// 输入框匹配label数据
searchIuputLabel() {
console.log('111')
},
handleDialogClose() {
this.dialogVisible = false
},
choiceLabel() {
this.dialogVisible = true
},
handleNodeClick(data) {
console.log(data)
},
goBack() {
this.$router.go(-1)
},
setTableHeightEvent() {
this.$refs.viewCustomers.setTableHeightFun()
},
setTableFinishFun(content) {
console.log(content, this.$refs.viewCustomers.data.length, '获取数据')
console.log(this.$refs.viewCustomers.total)
this.customerListsNum = this.$refs.viewCustomers.total
this.$refs.viewCustomers.data.length ? (this.$refs.viewCustomers.tableHeightValues = '') : this.$refs.viewCustomers.setTableHeightFun()
},
//导出
handleExport() {
const params = {
...JSON.parse(JSON.stringify(this.exportParams))
}
console.log(params)
exportLabelList(params).then(res => {
this.$Utils.exportFn(res)
})
},
searchTable() {
this.$refs.viewCustomers.refreshTable()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(params)
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.expandImg {
display: flex;
justify-content: center;
.smallFontSize {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.imgEll {
margin-left: 6.5px;
cursor: pointer;
// margin-bottom:3px;
}
}
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.noRelatedLabel {
margin-top: 59px;
text-align: center;
div {
margin-top: 12px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
}
}
.active {
border: 1px solid rgba(88, 80, 255, 1) !important;
.labelChecked {
position: absolute;
top: 0px;
right: 0px;
}
}
.clientNumExp {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 14px;
padding-bottom: 20px;
letter-spacing: 1px;
.clientNum {
// display: flex;
// align-items: center;
.clientListNew {
display: flex;
align-items: center;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
font-size: 20px;
}
.clientNumText {
margin-left: 6px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #5850ff;
line-height: 20px;
padding-top: 2px;
}
}
.export {
}
}
::v-deep .el-dialog {
height: 100%;
margin-right: 0px;
margin-top: 0 !important;
// margin-bottom: 0 !important;
position: relative;
}
::v-deep .el-dialog__wrapper {
margin-right: -6px;
}
::v-deep .el-dialog__footer {
position: absolute;
bottom: 0px;
width: 100%;
}
::v-deep .el-button + .el-button {
margin-left: 20px;
margin-right: 30px;
}
::v-deep .el-input {
margin-top: -10px;
}
.scrm-sub-client-container {
.pageTitle {
position: relative;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
.labelSet {
display: flex;
justify-content: space-between;
padding-top: 15px;
letter-spacing: 1px;
.labelSetLeft {
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.labelSetLeftRight {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.choiceLabel {
display: flex;
justify-content: space-between;
letter-spacing: 1px;
padding: 15px 0px 0px 20px;
.choiceLabelLeft {
display: flex;
align-items: center;
font-size: 20px;
.addLabelStyle {
font-weight: 600;
}
.addTagsBtn {
height: 32px;
background: $btnBlue;
border-radius: 4px;
padding: 0 20px;
color: #fff;
font-size: 14px;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.backBtn {
border-radius: 4px;
height: 32px;
font-size: 14px;
background: #fff;
border: 1px solid rgba(88, 80, 255, 1) !important;
color: $btnBlue;
padding: 0 20px;
border: none;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.clientList {
margin-top: 15px;
font-size: 20px;
}
.glsx-table {
// min-width: 1250px;
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
padding: 6px 20px 30px;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 10px;
}
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: $btnBlue;
font-size: 16px;
}
}
.labelDialog {
overflow: hidden;
.labelCombination {
.iconLabels {
margin-top: 20px;
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
}
.iconLabelstext {
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
}
}
.label-panle {
min-width: 300px;
height: calc(100% - 200px);
overflow-y: auto;
}
.iconLabelsName {
position: relative;
margin-left: 15px;
display: flex;
align-items: center;
height: 26px;
background: #f4f6fc;
border: 1px solid rgba(232, 232, 234, 1);
border-radius: 4px;
margin-top: 12px;
width: fit-content;
width: -webkit-fit-content;
width: -moz-fit-content;
padding: 0 12px 0 5px;
img {
width: 16px;
height: 16px;
}
.LabelsNameTxt {
max-width: 100%;
margin-left: 5px;
font-weight: 400;
font-size: 14px;
color: #666666;
text-align: right;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!