Commit e9521876 by 杨明

fixed

1 parent a5b56df8
<template>
<div class="square-main" v-loading="loading">
<el-dialog title="客户列表" :visible.sync="dialogVisible" :before-close="handleClose">
<!-- <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> -->
<GLTable v-loading="loading" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleCancel" type="primary">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'selectEmp',
data() {
return {
loading: false,
dialogVisible: false,
status: '',
createTime: [],
optionstatus: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '正常'
},
{
value: '-1',
label: '删除好友'
}
],
tableSearchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '访问页面',
prop: 'addTime'
},
{
label: '访问时间',
prop: 'addTime'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
staffName: [],
tableTotal: 0,
selectItem: [],
selectEmp: [],
pStatus: null,
staffIds: null,
staffId: null
}
},
methods: {
getFollower() {
var params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum,
custState: this.selectRow.codeState,
staffIds: this.staffId ? [this.staffId] : null
}
if (this.createTime && this.createTime.length > 0) {
params.beginTime = this.createTime[0]
params.endTime = this.createTime[1]
}
if (this.pStatus) {
params.status = 0
}
if (this.staffIds) {
params.staffIds = this.staffIds
}
this.loading = true
this.$apis.channel.getCustomer(params).then(res => {
this.loading = false
this.tableData = res.data
this.tableTotal = res.count
})
},
getChannelCodeStaffList() {
var params = {
pageSize: 1000,
pageNum: 1,
codeState: this.selectRow.codeState
}
this.$apis.channel.getChannelCodeStaffList(params).then(res => {
this.staffName = [{ staffName: '全部', staffId: null }].concat(res.data)
})
},
init(item, value, day) {
this.createTime = []
this.pStatus = null
this.staffIds = null
this.timeStatus = true
if (value == 'day' && !day) {
this.createTime = [util.getDay(0), util.getDay(0)]
this.timeStatus = false
}
if (value == 'day' && day) {
if (day.indexOf('~') == -1) {
this.createTime = [day, day]
} else {
this.createTime = [day.split('~')[0], day.split('~')[1]]
}
this.timeStatus = false
}
if (value == 'status' && !day) {
this.pStatus = 'status'
}
if (value == 'status' && day) {
this.pStatus = 'status'
if (day.indexOf('~') == -1) {
this.createTime = [day, day]
} else {
this.createTime = [day.split('~')[0], day.split('~')[1]]
}
this.timeStatus = false
}
if (value == 'staffIds') {
this.staffIds = item.staffId
}
if (value == 'statusAndStaffIds') {
this.pStatus = 'status'
this.staffIds = item.staffId
}
this.selectRow = item
this.tableSearchForm = {}
this.dialogVisible = true
this.getChannelCodeStaffList()
this.$nextTick(() => {
this.$refs.table.page.pageNum = 1
this.getFollower()
})
},
handleSearch() {
this.getFollower()
},
selectionTable(val) {
this.selectItem = val
},
handleClose() {
this.handleCancel()
},
handleDetail(scope) {
this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId)
},
handleCancel: utils.debounce(function() {
this.dialogVisible = false
}, 300)
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.emp-form {
/deep/ {
.el-date-editor,
.el-input {
width: 215px;
}
}
}
.square-main {
/deep/ {
.el-table {
height: 35vh;
overflow-y: auto;
}
.el-form-item {
margin-right: 20px;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
.form-row {
img {
width: 50px;
height: 50px;
vertical-align: middle;
}
}
</style>
export default {
data() {
return {}
},
methods: {
uploadAvatar(e) {
this.uploadFile(e, 'avatar')
},
uploadQrcode(e) {
this.uploadFile(e, 'qrcode')
},
getUploadName(name) {
let nameArr = name.split('.')
let lastName
while (nameArr.length) {
lastName = [nameArr[0]]
nameArr.unshift()
}
},
uploadFile(e, refName, AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf') {
const file = e.srcElement.files[0]
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
if (res) {
this.addCodeForm.headerSrc = res
}
this.$refs[refName].value = ''
})
}
}
}
}
...@@ -9,7 +9,8 @@ export default { ...@@ -9,7 +9,8 @@ export default {
name: 'accountList', name: 'accountList',
data() { data() {
return {} return {}
} },
mounted() {}
} }
</script> </script>
......
...@@ -9,13 +9,17 @@ ...@@ -9,13 +9,17 @@
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
<div slot="yesterdayNum" slot-scope="scope"> <div slot="experience" slot-scope="scope">
<div class="link-dialog" @click="handleEmpDetail(scope.scope, 'day')" v-if="scope.scope.yesterdayNum">{{ scope.scope.yesterdayNum }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope, 'day')">
<div v-else>0</div> <label>{{ scope.scope.yesterdayNum }}</label>
/100
</div>
</div> </div>
<div slot="totalNum" slot-scope="scope"> <div slot="proxy" slot-scope="scope">
<div class="link-dialog" @click="handleEmpDetail(scope.scope)" v-if="scope.scope.totalNum">{{ scope.scope.totalNum }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope)">
<div v-else>0</div> <label>{{ scope.scope.yesterdayNum }}</label>
/100
</div>
</div> </div>
<div slot="staffInfo" slot-scope="scope"> <div slot="staffInfo" slot-scope="scope">
<el-popover trigger="hover" placement="top" v-if="staffNameSplit(scope.scope.staffName).length > 3"> <el-popover trigger="hover" placement="top" v-if="staffNameSplit(scope.scope.staffName).length > 3">
...@@ -56,25 +60,18 @@ ...@@ -56,25 +60,18 @@
:key="index" :key="index"
v-else v-else
></GLFull> ></GLFull>
<!-- <div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-else>
<div class="accountType-row">
<i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle>
</div>
</div> -->
</div> </div>
<div slot="qrCode" slot-scope="scope"> <div slot="qrCode" slot-scope="scope">
<el-popover placement="bottom" width="400" trigger="click"> <el-popover placement="bottom" width="400" trigger="click">
<img :src="scope.scope.qrCode" style="width: 360px; height: 360px" /> <div class="qrCode-popover">
<img :src="scope.scope.qrCode" style="width: 360px; height: 360px" />
<div class="download-link" @click="downloadIamge(scope.scope.qrCode)">下载二维码</div>
</div>
<img :src="scope.scope.qrCode" style="width: 80px; height: 80px" slot="reference" /> <img :src="scope.scope.qrCode" style="width: 80px; height: 80px" slot="reference" />
</el-popover> </el-popover>
<div class="download-link" @click="downloadIamge(scope.scope.qrCode)">下载二维码</div>
</div> </div>
<div slot="tagging" slot-scope="scope" class="tag-panel"> <div slot="tagging" slot-scope="scope" class="tag-panel">
<el-popover trigger="hover" placement="top" v-if="scope.scope.taggingList && scope.scope.taggingList.length > 3"> <el-popover trigger="hover" placement="top" v-if="scope.scope.taggingList && scope.scope.taggingList.length > 3">
<!-- <div :title="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index">
{{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}
</div> -->
<GLTitle :content="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index"></GLTitle> <GLTitle :content="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index"></GLTitle>
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.taggingList" :key="index" v-show="index < 4"> <div v-for="(item, index) in scope.scope.taggingList" :key="index" v-show="index < 4">
...@@ -86,7 +83,6 @@ ...@@ -86,7 +83,6 @@
<template v-if="scope.scope.taggingList && scope.scope.taggingList.length <= 3 && scope.scope.taggingList.length > 0"> <template v-if="scope.scope.taggingList && scope.scope.taggingList.length <= 3 && scope.scope.taggingList.length > 0">
<div v-for="(item, index) in scope.scope.taggingList" :key="index"> <div v-for="(item, index) in scope.scope.taggingList" :key="index">
<GLTitle :content="item.name" class="accountType-row accountType-row-tag"></GLTitle> <GLTitle :content="item.name" class="accountType-row accountType-row-tag"></GLTitle>
<!-- <div :title="item.name" class="accountType-row accountType-row-tag">{{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}</div> -->
</div> </div>
</template> </template>
<div v-if="!scope.scope.taggingList || (scope.scope.taggingList && scope.scope.taggingList.length == 0)">--</div> <div v-if="!scope.scope.taggingList || (scope.scope.taggingList && scope.scope.taggingList.length == 0)">--</div>
...@@ -119,16 +115,16 @@ export default { ...@@ -119,16 +115,16 @@ export default {
}, },
searchFormData: [ searchFormData: [
{ {
label: '渠道名称或备注', label: '姓名',
name: 'codeNameAndRemark', name: 'staffName',
type: 'input', type: 'input',
placeholder: '请输入渠道名称或备注' placeholder: '请输入姓名'
}, },
{ {
label: '关联专员', label: '渠道名称',
name: 'staffName', name: 'codeNameAndRemark',
type: 'input', type: 'input',
placeholder: '请输入关联专员' placeholder: '请输入渠道名称'
} }
], ],
tableData: [], tableData: [],
...@@ -167,26 +163,49 @@ export default { ...@@ -167,26 +163,49 @@ export default {
addHtml: 'codeRemark' addHtml: 'codeRemark'
}, },
{ {
label: '今日新增客户数', label: '姓名',
prop: 'yesterdayNum',
width: '130px',
addHtml: 'yesterdayNum'
},
{
label: '手机号',
prop: 'yesterdayNum',
width: '150px',
addHtml: 'yesterdayNum'
},
{
label: '访问量',
prop: 'yesterdayNum', prop: 'yesterdayNum',
width: '130px', width: '130px',
addHtml: 'yesterdayNum' addHtml: 'yesterdayNum'
}, },
{ {
label: '总新增客户数', label: '今日新增客户',
prop: 'yesterdayNum',
width: '130px',
addHtml: 'yesterdayNum'
},
{
label: '总新增客户',
prop: 'totalNum', prop: 'totalNum',
width: '120px', width: '120px',
addHtml: 'totalNum' addHtml: 'totalNum'
}, },
{ {
label: '使用专员', label: '体验申请',
prop: 'staffInfo', prop: 'yesterdayNum',
width: '130px', width: '130px',
addHtml: 'staffInfo', addHtml: 'experience'
align: 'left'
}, },
{ {
label: '活码', label: '代理申请',
prop: 'totalNum',
width: '120px',
addHtml: 'proxy'
},
{
label: '名片地址',
prop: 'qrCode', prop: 'qrCode',
addHtml: 'qrCode', addHtml: 'qrCode',
width: '126px' width: '126px'
...@@ -332,14 +351,16 @@ export default { ...@@ -332,14 +351,16 @@ export default {
max-width: 1000px; max-width: 1000px;
} }
} }
.qrCode-popover {
text-align: center;
}
.download-link { .download-link {
cursor: pointer; cursor: pointer;
margin-top: 6px; margin-top: 6px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #666666; color: #5850ff;
line-height: 20px; line-height: 20px;
padding-left: 5px;
} }
.codeRemark { .codeRemark {
font-size: 14px; font-size: 14px;
...@@ -421,8 +442,9 @@ export default { ...@@ -421,8 +442,9 @@ export default {
} }
} }
.link-dialog { .link-dialog {
text-decoration: underline; label {
cursor: pointer; color: #5850ff;
}
} }
.accountType-row { .accountType-row {
text-align: left; text-align: left;
......
...@@ -2,6 +2,5 @@ import Vue from 'vue' ...@@ -2,6 +2,5 @@ import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/) const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => { componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default const component = componentsFiles(path).default
console.log(component)
Vue.component(component.name, component) Vue.component(component.name, component)
}) })
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="channel-main scrm-box-f"> <div class="channel-main scrm-box-f">
<div class="scrm-flex"> <div class="scrm-flex">
<el-radio-group v-model="timeRadio" size="mini" @change="handleTab"> <el-radio-group v-model="timeRadio" size="mini" @change="handleTab">
<el-radio-button label="1">今天</el-radio-button> <el-radio-button label="1">昨天</el-radio-button>
<el-radio-button label="2">近1周</el-radio-button> <el-radio-button label="2">近1周</el-radio-button>
<el-radio-button label="3">近2周</el-radio-button> <el-radio-button label="3">近2周</el-radio-button>
<el-radio-button label="4">近1个月</el-radio-button> <el-radio-button label="4">近1个月</el-radio-button>
</el-radio-group> </el-radio-group>
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item" label-width="80px"> <el-form :inline="true" :model="tableSearchForm" class="follow-form-item" label-width="80px">
<el-form-item size="small" label="添加时间"> <el-form-item size="small" label="访问时间">
<el-date-picker :picker-options="pickerOptions" @change="handleTime" value-format="yyyy-MM-dd" v-model="createTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker :picker-options="pickerOptions" @change="handleTime" value-format="yyyy-MM-dd" v-model="createTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item size="small" label="渠道名称"> <el-form-item size="small" label="渠道名称">
...@@ -19,34 +19,6 @@ ...@@ -19,34 +19,6 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="channel-chart">
<div class="channel-chart-box">
<div class="channel-chart-title">新增客户走势</div>
<div class="channel-chart-container">
<linechart ref="channelLine" :colorList="colorList"></linechart>
</div>
</div>
<div class="channel-chart-desc">
<div class="chart-desc">
<div class="chart-desc-title">
<div class="chart-title-time">{{ timeRadio == 1 ? '今天' : timeRadio == 2 ? '近1周' : timeRadio == 3 ? '近2周' : timeRadio == 4 ? '近1个月' : startTime + '-' + endTime }}</div>
<div class="chart-title-num">各渠道新增客户数</div>
</div>
<div class="chart-desc-item" v-for="(item, index) in codeIds" :key="index">
<div class="chart-item-title" :title="item.codeName">
<span :style="{ background: colorList[index] }"></span>
{{ item.codeName }}
</div>
<div class="chart-item-num link-dialog" @click="handleEmpDetail(item)" v-if="item.totalNum">{{ item.totalNum }}</div>
<div class="chart-item-num" v-else>0</div>
</div>
</div>
<div>
<div class="chart-desc-add" @click="handleChannel">+选择查看渠道</div>
<div class="chart-desc-addNum">最多同时查看8个渠道数据</div>
</div>
</div>
</div>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch"> <GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<div slot="newlyCount" slot-scope="scope"> <div slot="newlyCount" slot-scope="scope">
<div class="link-dialog" @click="handleEmpDetail(scope.scope, 'day', scope.scope.timeFrame)" v-if="scope.scope.newlyCount">{{ scope.scope.newlyCount }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope, 'day', scope.scope.timeFrame)" v-if="scope.scope.newlyCount">{{ scope.scope.newlyCount }}</div>
...@@ -56,23 +28,20 @@ ...@@ -56,23 +28,20 @@
<div class="link-dialog" @click="handleEmpDetail(scope.scope, 'status', scope.scope.timeFrame)" v-if="scope.scope.newlyKeepCount">{{ scope.scope.newlyKeepCount }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope, 'status', scope.scope.timeFrame)" v-if="scope.scope.newlyKeepCount">{{ scope.scope.newlyKeepCount }}</div>
<div v-else>0</div> <div v-else>0</div>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleEmpDetail(scope.scope)">访问记录</el-button>
</div>
</GLTable> </GLTable>
<select-channel :colorList="colorList" ref="channelForm" @selectTable="selectTable"></select-channel> <page-detail ref="empDetailForm"></page-detail>
<emp-detail ref="empDetailForm"></emp-detail>
</div> </div>
</template> </template>
<script> <script>
import utils from '@/utils/util' import pageDetail from '@/components/pageDetail'
import linechart from '@/components/linechart'
import selectChannel from '@/components/selectChannel'
import empDetail from '@/components/empDetail'
export default { export default {
name: 'recordList', name: 'recordList',
components: { components: {
linechart, pageDetail
selectChannel,
empDetail
}, },
data() { data() {
return { return {
...@@ -91,22 +60,39 @@ export default { ...@@ -91,22 +60,39 @@ export default {
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '渠道名称', label: '微信名称',
prop: 'codeName'
},
{
label: '手机号码',
prop: 'codeName' prop: 'codeName'
}, },
{ {
label: '新增客户数', label: '已加企微',
prop: 'newlyCount', prop: 'newlyCount',
addHtml: 'newlyCount' formatter: value => {
return '是'
}
}, },
{ {
label: '留存客户数', label: '渠道名称',
prop: 'codeName'
},
{
label: '名片来源',
prop: 'newlyKeepCount', prop: 'newlyKeepCount',
addHtml: 'newlyKeepCount' addHtml: 'newlyKeepCount'
}, },
{ {
label: '日期', label: '日期',
prop: 'timeFrame' prop: 'timeFrame'
},
{
label: '操作',
prop: 'optionBtns',
width: '80px',
addHtml: 'optionBtns',
fixed: 'right'
} }
] ]
}, },
......
...@@ -227,22 +227,25 @@ export default { ...@@ -227,22 +227,25 @@ export default {
console.log(previewList) console.log(previewList)
this.welcomeInfo = previewList this.welcomeInfo = previewList
const tagging = eval(res.tagging) const tagging = eval(res.tagging)
const taggingList = tagging.map(item => { if (tagging && tagging.length) {
let name = item.name.split(',') const taggingList = tagging.map(item => {
let ids = item.tagIds.split(',') let name = item.name.split(',')
console.log(ids) let ids = item.tagIds.split(',')
let labelList = name.map((tag, index) => { console.log(ids)
return { id: ids[index], name: tag } let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
}) })
return { this.tagging = taggingList
labelGroup: { }
id: item.groupId,
name: item.labelType
},
labelList
}
})
this.tagging = taggingList
this.$nextTick(() => { this.$nextTick(() => {
this.saveStatus = false this.saveStatus = false
}) })
......
...@@ -353,8 +353,10 @@ export default { ...@@ -353,8 +353,10 @@ export default {
} }
} }
this.$apis.square.queryCrowdTree(params).then(res => { this.$apis.square.queryCrowdTree(params).then(res => {
const crowdUnitList = res.crowdUnitList.find(item => item.crowdName == '已加企微,待匹配客户') if (res) {
this.crowdId = crowdUnitList.crowdId const crowdUnitList = res.crowdUnitList.find(item => item.crowdName == '已加企微,待匹配客户')
this.crowdId = crowdUnitList.crowdId
}
}) })
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!