Commit a274d219 by 李长胜

调整更近人员

1 parent df7d4a23
...@@ -37,10 +37,10 @@ export default { ...@@ -37,10 +37,10 @@ export default {
if (this.totalData && this.totalData.length > 0) { if (this.totalData && this.totalData.length > 0) {
this.dateArray = this.totalData.map(item => item.dateTime) //日期 this.dateArray = this.totalData.map(item => item.dateTime) //日期
this.customerCount = this.totalData.map(item => item.newCustomerCount) this.customerCount = this.totalData.map(item => item.newCustomerCount)
this.customerRatio = this.totalData.map(item => item.customerRatio.toFixed(4) * 100) this.customerRatio = this.totalData.map(item => item.customerRatio * 100)
this.entmicroCount = this.totalData.map(item => item.newEntmicroCount) this.entmicroCount = this.totalData.map(item => item.newEntmicroCount)
this.entmicroRatio = this.totalData.map(item => item.entmicroRatio.toFixed(4) * 100) this.entmicroRatio = this.totalData.map(item => item.entmicroRatio * 100)
this.initChart() this.initChart()
} }
...@@ -52,10 +52,10 @@ export default { ...@@ -52,10 +52,10 @@ export default {
handler(val) { handler(val) {
this.dateArray = this.totalData.map(item => item.dateTime) //日期 this.dateArray = this.totalData.map(item => item.dateTime) //日期
this.customerCount = this.totalData.map(item => item.newCustomerCount) this.customerCount = this.totalData.map(item => item.newCustomerCount)
this.customerRatio = this.totalData.map(item => item.customerRatio.toFixed(4) * 100) this.customerRatio = this.totalData.map(item => item.customerRatio * 100)
this.entmicroCount = this.totalData.map(item => item.newEntmicroCount) this.entmicroCount = this.totalData.map(item => item.newEntmicroCount)
this.entmicroRatio = this.totalData.map(item => item.entmicroRatio.toFixed(4) * 100) this.entmicroRatio = this.totalData.map(item => item.entmicroRatio * 100)
this.initChart() this.initChart()
} }
......
...@@ -17,6 +17,14 @@ ...@@ -17,6 +17,14 @@
<div class="table-box"> <div class="table-box">
<el-table class="table-list__box" ref="tableList" :data="dataList" :height="tableHeight" border stripe tooltip-effect="dark"> <el-table class="table-list__box" ref="tableList" :data="dataList" :height="tableHeight" border stripe tooltip-effect="dark">
<el-table-column v-for="column in columns" :key="column.key" :prop="column.key" :label="column.label" :width="column.width" :min-width="150" sortable show-overflow-tooltip filter-placement="bottom"></el-table-column> <el-table-column v-for="column in columns" :key="column.key" :prop="column.key" :label="column.label" :width="column.width" :min-width="150" sortable show-overflow-tooltip filter-placement="bottom"></el-table-column>
<template slot="empty" class="emptyBg">
<div class="noDataImgWrap" style="width:64px;height:41px;margin:0 auto;">
<img class="noDataImg" style="width:100%;height:100%;" src="@/assets/clientDataOverview/nodata.png" alt="" />
</div>
<!-- <div>{{ noDataText }}</div> -->
<div>暂无数据</div>
<slot name="additionalContent"></slot>
</template>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<div class="pagination__wrapper"> <div class="pagination__wrapper">
...@@ -64,7 +72,7 @@ export default { ...@@ -64,7 +72,7 @@ export default {
console.log(this.tableHeight, 'tableHeight') console.log(this.tableHeight, 'tableHeight')
}) })
this.dataList = demo.data.rows.concat([]) this.dataList = []//demo.data.rows.concat([])
} }
} }
</script> </script>
......
<template>
<div>
<div class="scrm-sub-client-container">
<!-- <p class="pageTitle">客户管理</p> -->
<div class="pageContent">
<search-form :ploading="sloading" :isHasSyncBtn="true" :showDefaultTime="true" :merchantModel="merchantModel" :accountLevel="accountLevel" class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @resetTable="resetTable" @searchTable="searchTable" @syncClick="syncClick">
<span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" 不做判定了, 允许所有人同步 -->
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span>
</search-form>
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<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 ? '@企微' : '' }}</span>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : '女' }}</span>
</span>
<div slot="followStaff" class="entmicro" slot-scope="scope">
<div class="entmicro-tag" v-for="(tag, idx) in followList(scope.scope.followStaff)" :key="idx">
<el-tag type="info" v-if="idx < 3" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ tag }}
</el-tag>
<el-tag type="info" v-if="followList(scope.scope.followStaff).length > 3 && idx == 3">
<el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<span slot="reference">...({{ followList(scope.scope.followStaff).length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in followList(scope.scope.followStaff)" :key="index" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
<!-- {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} -->
{{ i }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
<span slot="customerPhone" slot-scope="scope">
<span>{{ scope.scope.customerPhone == 'null' ? '' : scope.scope.customerPhone }}</span>
</span>
<span slot="addWay" slot-scope="scope">
<el-tooltip effect="dark" :content="toLabel(scope.scope.addWay)" placement="top">
<span style="display: inline-block; max-width: 120px; text-align: left">{{ toLabel(scope.scope.addWay) }}</span>
</el-tooltip>
</span>
<span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<span slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> -->
<span class="statusText" :class="{ 'red-text': scope.scope.status === -1, 'green-text': scope.scope.status == 0 }">{{ statusText(scope.scope.status) }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.oneId)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { getTableList, getDictionaryFun, syncCustomer } from '@/api/modules/clientManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientManage',
// inject: ['reload'],
data() {
return {
isReload: true,
url: url,
sloading: false,
CLIENTSTATUS: this.$Constants.CLIENT_STATUS,
searchForm: {},
searchFormTable: {},
clientManageFormList: [
{
type: 'daterange',
prop: 'daterange',
label: '添加时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'select',
prop: 'status',
label: '当前状态',
placeholder: '请选择当前状态',
options: [
{
label: '全部',
value: null
},
{
label: '正常',
value: 0
},
{
label: '删除好友',
value: -1
}
]
},
{
type: 'select',
prop: 'isJoin',
label: '是否已加企微',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 0
}
]
},
{
type: 'select',
prop: 'addWay',
label: '来源',
placeholder: '请选择当前来源',
options: [] //this.$Constants.SOURCE_OPTION
},
{
type: 'select',
prop: 'customerSex',
label: '性别',
placeholder: '请选择性别',
options: this.$Constants.GENDER_OPTION
},
{
type: 'input',
inputType: 'text',
prop: 'customerPhone',
label: '手机号',
placeholder: '请输入手机号'
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
},
{
type: 'input',
inputType: 'text',
prop: 'followStaff',
label: '跟进员工',
placeholder: '请输入跟进员工'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
// tableOption: true,
tableColumns: [
{
label: '客户ID',
prop: 'oneId',
width: 180
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
width: 160
},
{
label: '手机号',
prop: 'customerPhone',
addHtml: 'customerPhone',
width: 110
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex',
width: 80
},
{
label: '跟进员工',
prop: 'followStaff',
addHtml: 'followStaff',
width: 110
},
{
label: '来源',
prop: 'addWay',
addHtml: 'addWay',
minWidth: 100
},
{
label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoin',
addHtml: 'isJoin',
width: 100
},
{
label: '当前状态',
prop: 'status',
addHtml: 'status',
width: 100
},
{
label: '添加时间',
prop: 'addTime',
width: 188
}
],
tableOption: {
width: 80
// btnList: [
// {
// name: '详情',
// // pType: 'detail'
// }
// ]
}
},
getListApi: getTableList,
sourceList: [],
merchantModel: 1,
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
flushTime: false
}
},
activated() {
this.searchTable()
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
}
this.getDictionaryFun()
},
mounted() {
//没数据的时候要算高度
// setTimeout(() => {
// if (!this.$refs.clientManage.data.length) {
// this.$refs.clientManage.setTableHeightFun()
// }
// }, 400)
},
methods: {
followList(str) {
if (!str) {
return []
}
return str.split(',')
},
statusText(text) {
return text === -1 ? '删除好友' : text === 0 ? '正常' : ''
},
setTableHeightEvent() {
this.$refs.clientManage.setTableHeightFun()
},
setTableFinishFun(content) {
if (!this.flushTime) {
this.flushTime = true
this.searchTable()
}
//接收到的数据为空
if (!this.$refs.clientManage.data.length) {
this.$refs.clientManage.setTableHeightFun()
}
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
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()
})
},
getDictionaryFun() {
getDictionaryFun({ dictType: 'add_way' }).then(res => {
if (!res) {
return
}
let data = res.map(item => {
return {
...item,
label: item.dictLabel,
value: item.dictValue
}
})
data.unshift({ label: '全部', value: '' })
this.sourceList = data || []
if (data && data.length > 0) {
window.localStorage.setItem('sourceList', JSON.stringify(data))
}
this.$set(this.clientManageFormList[3], 'options', data)
// if (res.code == 0) {
// console.log('shuju', res)
// } else {
// this.$meesage({
// type: 'error',
// message: res.data.message
// })
// }
})
},
//来源 value值转为对应label
toLabel(value) {
if (value !== 0 && !value) {
return
}
let curElement = this.sourceList.find(item => {
return item.value === value
})
return curElement.label
},
//搜索表格
searchTable() {
this.$refs.clientManage.refreshTable()
},
syncClick() {
let _this = this
_this.sloading = true
syncCustomer({})
.then(res => {
if (!res) {
return false
}
_this.sloading = false
_this.$message.success('已同步客户')
_this.$refs.clientManage.refreshTable()
})
.catch(err => {
_this.sloading = false
})
},
//重置表格
resetTable() {
this.isReload = false
this.searchForm = {}
this.$nextTick(() => {
this.isReload = true
})
// this.$refs.clientManage.refreshTable()
// 点击之后强制页面刷新
// this.reload()
// this.$forceUpdate() // 没用
// this.$router.go(0)//没有预期效果,会出现一段空白页,用户体验不好
// location.reload() //没有预期效果,会出现一段空白页,用户体验不好
},
goDetail(id) {
this.$router.push({
path: '/clientManage/clientDetail',
query: {
id: id
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.pageTitle {
margin-bottom: 20px;
position: relative;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
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: 20px;
}
.searchTop {
// margin-bottom: 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;
// }
.entmicro {
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;
text-align: left;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
&-tag {
display: inline-block;
}
&-hover {
max-height: 214px;
overflow: auto;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
// span {
// line-height: 20px;
// }
}
.el-tag {
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
background-color: #fff !important;
}
}
}
</style>
...@@ -23,6 +23,27 @@ ...@@ -23,6 +23,27 @@
<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 ? '男' : '女' }}</span>
</span> </span>
<div slot="followStaff" class="entmicro" slot-scope="scope">
<div class="entmicro-tag" v-for="(tag, idx) in followList(scope.scope.followStaff)" :key="idx">
<el-tag type="info" v-if="idx < 3" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ tag }}
</el-tag>
<el-tag type="info" v-if="followList(scope.scope.followStaff).length > 3 && idx == 3">
<el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<span slot="reference">...({{ followList(scope.scope.followStaff).length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in followList(scope.scope.followStaff)" :key="index" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
<!-- {{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }} -->
{{ i }}
</el-tag>
</div>
</el-popover>
</el-tag>
</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>
...@@ -184,8 +205,8 @@ export default { ...@@ -184,8 +205,8 @@ export default {
{ {
label: '跟进员工', label: '跟进员工',
prop: 'followStaff', prop: 'followStaff',
minWidth:'120' addHtml: 'followStaff',
// addHtml:'followStaff' minWidth: 110
}, },
{ {
label: '来源', label: '来源',
...@@ -249,6 +270,12 @@ export default { ...@@ -249,6 +270,12 @@ export default {
}, },
methods: { methods: {
followList(str) {
if (!str) {
return []
}
return str.split(',')
},
statusText(text) { statusText(text) {
return text === -1 ? '删除好友' : text === 0 ? '正常' : '' return text === -1 ? '删除好友' : text === 0 ? '正常' : ''
}, },
...@@ -408,6 +435,42 @@ export default { ...@@ -408,6 +435,42 @@ export default {
// .glsx-table { // .glsx-table {
// margin-top: 20px; // margin-top: 20px;
// } // }
.entmicro {
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;
// text-align: left;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
&-tag {
display: inline-block;
}
&-hover {
max-height: 214px;
overflow: auto;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
// span {
// line-height: 20px;
// }
}
.el-tag {
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
background-color: #fff !important;
}
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!