Commit 4e1bb9fc by 李长胜

修改

1 parent a7171aa8
{
"name": "scrm-sub-blog",
"name": "custom",
"version": "0.1.0",
"private": true,
"scripts": {
......@@ -13,8 +13,8 @@
"core-js": "^3.4.4",
"echarts": "^5.2.0",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.4",
"glsx-components": "^1.0.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.0.8",
"glsx-table": "^1.1.0",
"sha1": "^1.1.1",
"vue": "^2.6.10",
......
......@@ -18,6 +18,15 @@
sign: true
})
}
export function syncCustomerBase(params){
params.method='cn.com.glsx.entmicro.synchro.syncCustomerBase'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function getTableDetail(params){
params.method='org.ore.api.customer.base.detail'
return http({
......
......@@ -34,6 +34,7 @@
})
}
export function getAllTagTree (params){
params.method='datahub.api.label.querylabeltree'
return http({
......@@ -70,6 +71,15 @@
sign: true
})
}
export function syncCustomer(params){
params.method='cn.com.glsx.entmicro.synchro.syncCustomer'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function getTableDetail(params){
params.method='org.ore.api.customer.detail'
......
......@@ -83,8 +83,8 @@ export default {
// },
legend: {
x: 'center',
y: 'bottom',
// bottom: "bottom",
// y: 'bottom',
bottom: '50px',
// textStyle: {
// //图例的公用文本样式。
// fontSize: 14,
......@@ -96,7 +96,7 @@ export default {
},
grid: {
//直角坐标系内绘图网格
bottom: '15%', //grid 组件离容器下侧的距离。
bottom: '20%', //grid 组件离容器下侧的距离。
left: '1%',
right: '5%',
containLabel: true //grid 区域是否包含坐标轴的刻度标签。
......@@ -105,10 +105,11 @@ export default {
//dataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。#bed0f7
{
bottom: '30px',
type: 'inside',
show: true,
// backgroundColor: '#ff0000',
// borderColor: '#ff0000',
height: '5%',
height: '1%',
// borderColor: '#8FDFFE',
// backgroundColor: '#8fdffe99',
......@@ -116,7 +117,7 @@ export default {
handleColor: '#bed0f7',
handleSize: 20,
handleSize: 15,
handleStyle: {
borderColor: '#bed0f7',
......@@ -152,14 +153,14 @@ export default {
{
type: 'value',
name: '单位:人',
// min: 0,
// max: 35000,
// interval: 5000,
min: 0,
max: 100,
interval: 10,
axisLabel: {
formatter: '{value}'
},
splitLine: {
show: true //是否显示分割线
show: false //是否显示分割线
}
},
{
......@@ -172,7 +173,7 @@ export default {
formatter: '{value}'
},
splitLine: {
show: true //是否显示分割线
show: false //是否显示分割线
}
}
],
......
......@@ -38,7 +38,9 @@ export default {
var maxData = this.entmicroAddCustomerCount + this.entmicroNotAddCustomerCount
option = {
tooltip: {},
tooltip: {
formatter: ' {c}人'
},
xAxis: {
max: maxData, // 以x轴为基准,进行象形图的重复画图,最大值为100(可调整),为了下方好处理我调整为100
splitLine: { show: false }, // x轴 轴线什么的都不需要
......
<template>
<div class="scrm-sub-client-container">
<!-- 有图标无数据文字情况 -->
<div class="nodata" v-if="type=='hasIconText'">
<img src="@/assets/clientDataOverview/nodata.png" alt="">
<p>暂无数据</p>
</div>
<!-- 没有图标有无数据文字 -->
<div class="nodata" v-if="type=='hasText'">
<p>暂无数据</p>
</div>
<div class="scrm-sub-client-container">
<!-- 有图标无数据文字情况 -->
<div class="nodata" v-if="type == 'hasIconText'">
<img src="@/assets/clientDataOverview/nodata.png" alt="" />
<p>暂无数据</p>
</div>
<!-- 没有图标有无数据文字 -->
<div class="nodata" v-if="type == 'hasText'">
<p>暂无数据</p>
</div>
</div>
</template>
<script>
export default {
props: {
type: {
type: String,
default: ''
},
},
export default {
props: {
type: {
type: String,
default: ''
}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container{
.nodata{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
z-index: 9;
p{
height: 22px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 22px;
}
.scrm-sub-client-container {
.nodata {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 9;
p {
height: 22px;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -17,31 +17,38 @@
<span>收起</span>
</div>
</div>
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input>
<div class="firstRowBtn" v-if="!expande && isShowBtns">
<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">同步数据</el-button>
</div>
<div class="itemWidth">
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'">
<el-option v-for="i in item.options" :key="i[item.value] || i.value" :label="i[item.key] || i.label" :value="i[item.value] || i.value" :disabled="i.disabled"></el-option>
</el-select>
</template>
<template v-else-if="item.type === 'daterange'">
<el-date-picker v-model="formModel[item.prop]" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="item.pickerOptions || {}"></el-date-picker>
</template>
</template>
<template v-else-if="item.type === 'select'">
<el-select v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'">
<el-option v-for="i in item.options" :key="i[item.value] || i.value" :label="i[item.key] || i.label" :value="i[item.value] || i.value" :disabled="i.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<template>
<slot name="form-slot"></slot>
</template>
<template v-else-if="item.type === 'daterange'">
<el-date-picker v-model="formModel[item.prop]" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="item.pickerOptions || {}"></el-date-picker>
</el-form-item>
<!-- <el-form-item>
<template>
<slot name="formsearch-slot"></slot>
</template>
</template>
</el-form-item>
<el-form-item>
<template>
<slot name="form-slot"></slot>
</template>
</el-form-item>
<el-form-item>
<template>
<slot name="formsearch-slot"></slot>
</template>
</el-form-item>
</el-form-item> -->
</div>
</el-form>
</div>
</template>
......@@ -68,21 +75,37 @@ export default {
labelWidth: {
type: String,
default: 'auto'
},
ploading: {
type: Boolean,
default: false
},
isHasSyncBtn: {
type: Boolean,
default: false
}
},
data() {
return {
expande: true,
needShowExpande: false,
FormHeight: 0
FormHeight: 0,
isShowBtns: true
}
},
mounted() {
console.log('搜索表单')
var sf = document.getElementById('searchForm')
this.$nextTick(() => {
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
console.log(sf.clientWidth, 'sf')
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
let lineHeight = 75
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.needShowExpande = true
} else {
......@@ -102,14 +125,28 @@ export default {
// console.log('窗口发生改变了哟!')
// }, 100)
// })
window.onresize = () => {
return (() => {
if (resizeTimer) clearTimeout(resizeTimer)
resizeTimer = setTimeout(function() {
that.FormHeight = document.getElementById('searchForm').offsetHeight
}, 100)
})()
}
// window.onresize = () => {
// return (() => {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
// window.location.reload() //浏览器重新从服务器请求资源,在http请求头中不会包含缓存标记
// // that.FormHeight = document.getElementById('searchForm').offsetHeight
// if (sf.clientWidth < 952 && that.isHasSyncBtn) {
// that.isShowBtns = false
// }
// }, 100)
// })()
// }
window.addEventListener('resize', () => {
if (resizeTimer) clearTimeout(resizeTimer)
resizeTimer = setTimeout(function() {
window.location.reload() //浏览器重新从服务器请求资源,在http请求头中不会包含缓存标记
// that.FormHeight = document.getElementById('searchForm').offsetHeight
if (sf.clientWidth < 952 && that.isHasSyncBtn) {
that.isShowBtns = false
}
}, 100)
})()
},
watch: {
......@@ -131,12 +168,20 @@ export default {
onInput(e) {
this.$emit('input', e)
},
resetTable() {
this.$emit('resetTable')
},
searchTable() {
this.$emit('searchTable')
},
syncClick() {
this.$emit('syncClick')
},
// openClose(){
// console.log( document.getElementById('searchForm').offsetHeight);
// document.getElementById('searchForm').offsetHeight=172;
// }
expandeClick() {
console.log('expandeClick')
this.expande = !this.expande
setTimeout(() => {
this.$emit('setTableHeightEvent')
......@@ -151,6 +196,17 @@ export default {
position: relative;
overflow: hidden;
// height: 50px;
.firstRowBtn {
position: absolute;
right: 60px;
.el-button + .el-button {
margin-left: 20px;
}
}
.itemWidth {
max-width: 1050px;
min-width: 660px;
}
.expande-button-wrap {
position: absolute;
right: 0;
......
......@@ -9,7 +9,7 @@
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-blog',
title: 'custom',
response: {
data_key: 'data',
message_key: 'message',
......
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-18 11:51:29
* http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/ 冯支:http://192.168.1.74:8089
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-blog',
title: 'custom',
response: {
data_key: 'data',
message_key: 'message',
......@@ -7,8 +17,12 @@ module.exports = {
code_success_value: '0',
code_message_map: {}
},
request: {
baseURL: 'http://scrm.test.glsx.com.cn',
// 王小龙:http://192.168.2.98:8091/rop-scrm-datahub 冯支:http://192.168.3.191:8064/rop-scrm-entmicro/
/* 开发环境的域名:http://scrm.dev.glsx.com.cn/rop-scrm-datahub 测试:https://scrm.test.glsx.com.cn
http://scrm.dev.glsx.com.cn/rop-scrm-entmicro http://scrm.test.glsx.com.cn/
*/
request: {
baseURL: 'http://scrm.test.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
......@@ -17,10 +31,10 @@ module.exports = {
responseType: 'json'
},
sign: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
format: 'json',
source: 'client-sub-custom'
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
......
......@@ -9,18 +9,20 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
// https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree,Row,Table,TableColumn,Dialog,Pagination,Loading,Tooltip,Divider } from 'element-ui'
import {Scrollbar,Popover, Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree,Row,Table,TableColumn,Dialog,Pagination,Loading,Tooltip,Divider } from 'element-ui'
Vue.use(Scrollbar)
Vue.use(Popover)
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
......
......@@ -59,6 +59,24 @@ const staticRoutes = Object.freeze([
component: resolve => require([`@/views/expand/index.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/index",
component: resolve => require([`@/views/employee/index.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/detail",
component: resolve => require([`@/views/employee/detail.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/add",
component: resolve => require([`@/views/employee/add.vue`], resolve),
meta: {}
}
])
export default staticRoutes
......
......@@ -13,7 +13,7 @@ let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig()
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......
......@@ -16,8 +16,8 @@ import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-ab3d905b-5148-42ba-86dd-8ec6a51b9b86-rop' } })
const { response, request, sign, secret } = await fetchConfig(true)
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-f27a0943-8fbf-4b21-a7a1-8e82a117ba39-rop' } })
Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
......
......@@ -18,6 +18,7 @@
color:$btnBlue;
&:hover{
color: #9994FF;
cursor: pointer;
}
}
.pure-blue-text{
......
......@@ -40,5 +40,8 @@
}
// 子系统不设外边距
.scrm-sub-client-container{
padding: 20px 20px 20px 40px;
padding: 0 20px 20px 40px;
}
.el-table .cell{
// line-height: 20px!important;
}
\ No newline at end of file
......@@ -12,12 +12,12 @@ const overThousandFilter = (val) => {
};
//来源 value值转为对应label(来源)
const toLabel=(value)=> {
if (!value) {
if (value!==0 && !value) {
return
}
let sourceList=JSON.parse(window.localStorage.getItem('sourceList'));
let curElement =sourceList.find(item => {
return item.value == value
return item.value === value
})
return curElement.label
......
......@@ -260,7 +260,7 @@ export default {
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
......@@ -272,7 +272,7 @@ export default {
top: 389px;
height: 25px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #716aff;
line-height: 25px;
......@@ -615,4 +615,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="scrm-sub-client-container">
<!-- <div class="forbidClickLayer"></div> -->
<template v-if="isShowModal">
<div class="modalLayer"></div>
<img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" />
......@@ -10,6 +9,7 @@
</template>
<div class="bannerWrapBox" @click="goNextPage" v-if="!isHasCustomerCountBanner">
<!-- <img src="@/assets/clientDetail/defaultAvator.png" class="inTimeBtn" alt="" /> -->
<img class="bannerWrap" src="@/assets/clientDataOverview/companyBanner.png" alt="" />
</div>
<h3 class="pageSubTitle">客户分层</h3>
......@@ -49,7 +49,7 @@
<span class="person-text">人</span>
</span>
<span v-if="!isEmptyObj">
占比:{{ topDataObj.purposePercent * 100 || 0 }}%
占比:{{ purposePercent }}%
<i class="triangle" :class="{ active: !isNoBuyUp }" v-if="!isEmptyObj"></i>
</span>
<!-- <i class="vertical-line"></i> -->
......@@ -89,7 +89,7 @@
</span>
<span v-if="!isEmptyObj">
占比:{{ topDataObj.purchasePercent * 100 || 0 }}%
占比:{{ purchasePercent }}%
<i class="triangle" :class="{ active: !isBuyUp }" v-if="!isEmptyObj"></i>
</span>
......@@ -175,6 +175,7 @@
</template>
<script>
// import $ from 'jquery'
import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview'
import { getLoginCount } from '@/api/modules/loginCount'
import pieEchart from '@/components/echarts/pieEchart'
......@@ -193,16 +194,6 @@ export default {
pictorialBar,
noData
},
// filters: {
// overThousandFilter: function (val) {
// if (val < 1000) return val;
// let a = val + "";
// let b = a.split("");
// b.splice(-3, 0, ",");
// return b.join("");
// },
// },
data() {
return {
isShowModal: false,
......@@ -272,6 +263,14 @@ export default {
},
isShowData() {
return Object.keys(this.topDataObj).length > 0 && this.topDataObj.customerCount > 0 ? true : false
},
purposePercent() {
if (this.topDataObj.purposePercent) return (this.topDataObj.purposePercent * 100).toFixed(2) || 0
return 0
},
purchasePercent() {
if (this.topDataObj.purchasePercent) return (this.topDataObj.purchasePercent * 100).toFixed(2) || 0
return 0
}
},
created() {
......@@ -294,6 +293,7 @@ export default {
//引流企微按钮暂时效果
toGuideCompanyWechat() {
window.open('https://www.baidu.com', '_blank')
// $('.subtitle').hide()
},
showModalLayer() {
var baseNavEle = document.querySelector('.scrm-base-nav')
......@@ -363,26 +363,33 @@ export default {
//获取上面的数据
getDataOverviewFun() {
// const res = await getDataOverview()
getDataOverview({})
.then(res => {
if (!res) {
return
}
this.topDataObj = res
this.titles[0].num = res.newCarCustomerCount
this.titles[1].num = res.needRenewalCustomerCount
this.titles[2].num = res.burseholderCustomerCount
this.titles[4].num = res.silenceCustomerCount
getDataOverview({}).then(res => {
if (!res) {
return
}
console.log('上面', res)
this.topDataObj = res
this.isNoBuyUp = res.purposeUp
this.isBuyUp = res.purchaseUp
if (this.topDataObj.customerCount > 0) {
this.isHasCustomerCountBanner = true
}
})
.catch(err => {
console.log('错误信息:', err)
})
// this.titles[0].num = res.newCarCustomerCount
// this.titles[1].num = res.needRenewalCustomerCount
// this.titles[2].num = res.burseholderCustomerCount
// this.titles[4].num = res.silenceCustomerCount
console.log(res, '这是上面数据')
this.isNoBuyUp = res.purposeUp
this.isBuyUp = res.purchaseUp
if (this.topDataObj.customerCount > 0) {
this.isHasCustomerCountBanner = true
}
console.log(this.isHasCustomerCountBanner, 'true/fasle')
this.$set(this.titles[0], 'num', res.newCarCustomerCount)
this.$set(this.titles[1], 'num', res.needRenewalCustomerCount)
this.$set(this.titles[2], 'num', res.burseholderCustomerCount)
this.$set(this.titles[3], 'num', res.silenceCustomerCount)
})
// .catch(err => {
// console.log('错误信息:', err)
// })
},
//首次进来获取下方柱状图数据(一进来默认传7天)
async getDataOverviewBarMapFun(dayCount = 7) {
......@@ -435,33 +442,8 @@ export default {
.person-text {
font-size: 16px !important;
}
.forbidClickLayer {
position: fixed;
z-index: 95;
background-color: rgba(0, 0, 0, 0.79);
width: 1px;
height: 1px;
border-radius: 100%;
border: 5000px solid rgba(0, 0, 0, 0.79);
// width: 100%;
// height: 100%;
}
.modalLayer {
// position: fixed;
// z-index: 99;
// // width: 100%;
// // height: 100%;
// top: 120px; //125px;
// right: 50%; //320px;
// width: 160px; //160px;
// height: 90px; //90px;
// filter: blur(15px);
// border-radius: 50% / 50%;
// box-shadow: 0 0 0 2000px #000000;
// background-color: #000000;
// opacity: 0.79;
.modalLayer {
position: fixed;
z-index: 99;
top: 20px;
......@@ -508,7 +490,14 @@ export default {
}
.bannerWrapBox {
width: 100%;
> img {
// position: relative;
// .inTimeBtn {
// position: absolute;
// bottom: 20px;
// right: 50px;
// }
.bannerWrap {
width: 100%;
// height: 146px;
......@@ -521,7 +510,6 @@ export default {
margin: 20px 0;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
......@@ -610,7 +598,6 @@ export default {
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
......@@ -622,7 +609,7 @@ export default {
top: 389px;
height: 25px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #716aff;
line-height: 25px;
......@@ -634,7 +621,7 @@ export default {
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
......@@ -646,7 +633,6 @@ export default {
right: 57px;
top: 389px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #fe9c1c;
line-height: 25px;
......@@ -921,7 +907,7 @@ export default {
height: 80px;
.one1 {
margin-top: 30px;
height: 44px;
height: 36px;
position: relative;
span {
position: absolute;
......@@ -941,7 +927,7 @@ export default {
left: 38.4%;
}
span:nth-child(3) {
left: 57%;
left: 54%;
}
}
.one2 {
......@@ -962,7 +948,7 @@ export default {
left: 38.4%;
}
span:nth-child(2) {
left: 57%;
left: 54%;
}
}
}
......
......@@ -2,7 +2,7 @@
<div class="scrm-sub-client-container">
<div class="header">
<div class="vehicleGroupName">
<span>奥迪车友群</span>
<span>{{ groupName }}</span>
</div>
<button class="backBtn" @click="goBack">返回客户群管理</button>
</div>
......@@ -33,7 +33,7 @@
</p>
<p>
<span>创建时间</span>
<span class="ellipsis-1" style="width:100%;">{{ leftPanelList.createDate }}</span>
<span class="ellipsis-1" :title="leftPanelList.createDate">{{ leftPanelList.createDate }}</span>
</p>
</div>
<div class="rightWrap">
......@@ -41,7 +41,7 @@
<span>客户列表</span>
<span>{{ clientTableDataNum || 0 }}个</span>
</p>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientGroupFormList">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<!-- :size="btn_size" -->
<el-button plain @click="resetTable">重置</el-button>
......@@ -56,7 +56,7 @@
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :tableId="$route.query.id" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchForm" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
<span slot="customerName" slot-scope="scope">
<span>{{ scope.scope.customerName }}</span>
<span class="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>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : '女' }}</span>
......@@ -80,6 +80,7 @@ export default {
name: 'clientGroupDetail',
data() {
return {
groupName: this.$route.query.groupName,
url: url,
leftPanelList: {},
searchForm: {},
......@@ -210,6 +211,9 @@ export default {
resolve()
})
},
setTableHeightEvent() {
this.$refs.clientGroupManage.setTableHeightFun()
},
setTableFinishFun(content) {
this.clientTableDataNum = content.length
},
......@@ -227,7 +231,7 @@ export default {
},
goDetail(id) {
this.$router.push({
name: '/clientManage/clientDetail',
path: '/clientManage/clientDetail',
query: {
id: id
}
......@@ -277,7 +281,7 @@ export default {
.leftWrap {
width: 240px;
// height: 877px;
min-height: calc(100vh - 92px);
min-height: 270px; //calc(100vh - 92px);
background-color: #fff;
box-sizing: border-box;
.avator {
......
<template>
<div>
<div class="scrm-sub-client-container">
<p class="pageTitle">客户群管理</p>
<!-- <p class="pageTitle">客户群管理</p> -->
<div class="pageContent">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<search-form class="searchTop border-shadow" :isHasSyncBtn="true" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent" @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>
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span>
</search-form>
<!-- <basic-table ref="clientGroupTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true">
......@@ -14,14 +15,14 @@
<el-button v-for="(j, idx) in tableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" :size="btn_size" @click="btnClick(j.pType, scope.scope)">{{ j.name }}</el-button>
</span>
</basic-table> -->
<GLTable ref="clientGroupManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<GLTable ref="clientGroupManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :pageConf="pageConf" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> -->
<span class="statusText" :class="scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[1] : ''">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[0] : '--' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span>
<span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
......@@ -30,18 +31,21 @@
</template>
<script>
import { getTableList } from '@/api/modules/clientGroupManage'
import { getTableList, syncCustomerBase } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientManage',
data() {
return {
url: url,
sloading: false,
titles: [
{ name: '客户群总数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息1' },
{ name: '新增客户群数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息2' }
],
searchForm: {},
searchFormTable: {},
clientGroupFormList: [
{
type: 'daterange',
......@@ -107,7 +111,8 @@ export default {
},
{
label: '创建时间',
prop: 'addTime'
prop: 'addTime',
width: 188
}
],
tableOption: {
......@@ -134,6 +139,22 @@ export default {
},
methods: {
syncClick() {
let _this = this
_this.sloading = true
syncCustomerBase({})
.then(res => {
if (!res) {
return
}
_this.sloading = false
this.$message.success('已同步客户群')
this.$refs.clientGroupManage.refreshTable()
})
.catch(err => {
_this.sloading = false
})
},
setTableHeightEvent() {
this.$refs.clientGroupManage.setTableHeightFun()
},
......@@ -142,14 +163,14 @@ export default {
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
console.log(this.searchForm)
if (this.searchForm.daterange) {
this.searchForm.beginTime = this.searchForm.daterange[0]
this.searchForm.endTime = this.searchForm.daterange[1]
delete this.searchForm.daterange
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]
} else {
if (this.searchForm.beginTime) delete this.searchForm.beginTime && delete this.searchForm.endTime
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve()
})
},
......@@ -159,13 +180,21 @@ export default {
this.$refs.clientGroupManage.refreshTable()
},
btnClick(ptype, scope) {},
goDetail(id) {
goDetail(id, name) {
this.$router.push({
name: '/clientGroupManage/clientGroupDetail',
path: '/clientGroupManage/clientGroupDetail',
query: {
id: id
id: id,
groupName: name
}
})
// this.$history.push({
// path: '/clientGroupManage/clientGroupDetail',
// params: {
// id: id,
// groupName: name
// }
// })
}
}
}
......@@ -179,7 +208,6 @@ export default {
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
......@@ -187,6 +215,7 @@ export default {
}
.pageContent {
padding: 6px 20px 30px;
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 20px;
......@@ -206,9 +235,9 @@ export default {
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
// .glsx-table {
// margin-top: 20px;
// }
}
}
</style>
......@@ -14,33 +14,38 @@
</div>
<p>
<span>客户名称</span>
<span>{{ leftPanelInfo.customerName }}</span>
<span class="ellipsis-1" :title="leftPanelInfo.customerName">
<span>
{{ leftPanelInfo.customerName }}
<span style="color:#5850ff">{{ leftPanelInfo.type == 1 ? '@微信' : leftPanelInfo.type == 2 ? '@企微' : '' }}</span>
</span>
</span>
</p>
<p>
<span>联系电话</span>
<span>{{ leftPanelInfo.customerPhone }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span>
</p>
<p>
<span>微信号</span>
<span>{{ leftPanelInfo.weChatId || '待完善' }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.weChatId || '待完善' }}</span>
</p>
<p>
<span>性别</span>
<span>{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span>
</p>
<p>
<span>企业简称</span>
<span>{{ leftPanelInfo.corpName }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.corpName || '待完善' }}</span>
</p>
<p>
<span>职务</span>
<span>{{ leftPanelInfo.position }}</span>
<span class="ellipsis-1">{{ leftPanelInfo.position || '待完善' }}</span>
</p>
<p>
<p v-if="leftPanelInfo.type == 2">
<span>类型</span>
<span>{{ 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">
<span>是否加企微</span>
<!-- 1-是,2-否 -->
<span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span>
......@@ -70,8 +75,8 @@
<span>{{ vehicleTableData.length || 0 }}辆</span>
</p>
<!--1. 车辆信息表 -->
<el-table :data="vehicleTableData" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="standNo" label="车架号(后6位)" align="center">
<el-table :data="vehicleTableData" style="width: 100%" :row-style="{ height: 88 + 'px' }" :header-cell-style="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="standNo" label="车架号(后6位)" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.standNo.substring(scope.row.standNo.length - 6) }}</span>
</template>
......@@ -89,9 +94,9 @@
<el-table-column prop="vehicleModelYear" label="年款" align="center"></el-table-column>
<el-table-column prop="vehiclePrice" label="购车价格" align="center"></el-table-column>
<el-table-column prop="buyTime" label="购车时间" align="center"></el-table-column>
<el-table-column prop="insBgnTime" label="保险开始时间" align="center"></el-table-column>
<el-table-column prop="insEndTime" label="保险到期时间" align="center"></el-table-column>
<el-table-column prop="maintRecTime" label="最近保养时间" align="center"></el-table-column>
<el-table-column prop="insBgnTime" label="保险开始时间" align="center" width="120"></el-table-column>
<el-table-column prop="insEndTime" label="保险到期时间" align="center" width="120"></el-table-column>
<el-table-column prop="maintRecTime" label="最近保养时间" align="center" width="120"></el-table-column>
<!-- 无数据插槽用法 -->
<!-- <div slot="empty" class="emptyBg">
<img src="@/assets/clientDataOverview/nodata.png" alt="">
......@@ -104,14 +109,14 @@
</p>
<!-- <div></div> -->
<!--2. 员工跟进表 -->
<glsx-table :hasNum="false" :tableData="employTableList" :hasPage="false" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<GLTable :hasNum="false" :tableData="employTableList" :hasPage="false" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="addWay" slot-scope="scope">
<span>{{ scope.scope.addWay | toLabel }}</span>
</span>
<span slot="addType" slot-scope="scope">
<span>{{ scope.scope.addType == 1 ? '微信' : '企微' }}</span>
<span>{{ addTypeToLable(scope.scope.addType) }}</span>
</span>
</glsx-table>
</GLTable>
<!-- <el-table :data="employTableList" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="staffName" label="跟进员工" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属部门" align="center"></el-table-column>
......@@ -134,8 +139,12 @@
</p>
<!-- <div>所属客户群表格,待定</div> -->
<!-- 3.所属客户群 -->
<el-table :data="clientGroupTableList" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="groupName" label="客户群名称" align="center"></el-table-column>
<el-table :data="clientGroupTableList" style="width: 100%" :row-style="{ height: 88 + 'px' }" :header-cell-style="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column label="客户群名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.groupName || '群聊(默认)' }}</span>
</template>
</el-table-column>
<el-table-column prop="groupHostName" label="群主" align="center"></el-table-column>
<el-table-column prop="membersNumber" label="成员数" align="center"></el-table-column>
<el-table-column prop="groupNickName" label="本群昵称" align="center"></el-table-column>
......@@ -178,18 +187,12 @@ export default {
data() {
return {
leftPanelInfo: {},
labelIdList: [], //存放用户被标记标签的id
tagsList: [
// { labelName: '一般', labelId: 1 },
// { name: '初次沟通', id: 2 }
],
vehicleTableData: [
// {
// date: '123456',
// name: '粤B 3****1',
// address: '奥迪',
// xi: '2021款 RS 5.2.9TSportback 暗精版'
// },
],
vehicleTableData: [],
//员工跟进
tableParams: {
listName: 'staffFollows',
......@@ -205,7 +208,8 @@ export default {
},
{
label: '添加时间',
prop: 'addTime'
prop: 'addTime',
width: 105
},
{
label: '来源',
......@@ -215,7 +219,8 @@ export default {
{
label: '添加类型',
prop: 'addType',
addHtml: 'addType'
addHtml: 'addType',
width: 170
},
{
label: '备注手机号',
......@@ -237,58 +242,28 @@ export default {
//弹窗数据
tagsDialogTitle: '添加标签',
tagsVisible: false,
roleForm: {
tagsName: '',
initTagsGroup: '',
tagsList: []
},
companyTagsList: [
// {
// name: '标签一',
// arr: [
// { name: '一般', checked: true, id: 1, original: true },
// { name: '重要', checked: false, id: 2 },
// { name: '核心', checked: false, id: 3 }
// ]
// },
// {
// name: '标签二',
// arr: [
// { name: '初次沟通', checked: true, id: 11, original: true },
// { name: '持续跟进', checked: false, id: 12 },
// { name: '意向车主', checked: false, id: 13 }
// ]
// }
],
ownShopTagsList: [
// {
// name: '性别',
// arr: [
// { name: '一般', checked: true, id: 21, original: true },
// { name: '重要', checked: false, id: 22 },
// { name: '核心', checked: true, id: 23, original: true }
// ]
// },
// {
// name: '省份',
// arr: [
// { name: '初次沟通', checked: true, id: 31, original: true },
// { name: '持续跟进', checked: false, id: 32 },
// { name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 }
// ]
// }
],
companyTagsList: [],
ownShopTagsList: [],
allTagsList: [], //企业自店的所有的加起来
submitTagsList: [],
storeTagList: [],
labelIdList: []
merchantId: 10001001
}
},
created() {
// this.getPageDetail()
this.getSingleClientTag()
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
this.getPageDetail()
this.getSingleClientTag(this.$route.query.id, this.merchantId)
},
methods: {
addTypeToLable(num) {
return num === 0 ? '成员主动添加' : num === 1 ? '客户主动添加' : num === 2 ? '成员共享/管理员分配' : ''
},
goDetail(id) {
this.$router.push({
path: '/clientGroupManage/clientGroupDetail',
......@@ -306,14 +281,18 @@ export default {
getSingleClientTag(param)
.then(res => {
if (res.code == 0) {
console.log(res.userLabelUnitList, 'kkk')
console.log(res, 'kkk')
if (!res.userLabelUnitList) {
return
}
let filterArr = []
res.userLabelUnitList.forEach(item => {
filterArr.push(...item.labelInfoList)
})
this.tagsList = filterArr
console.log(this.tagsList, '当前被选中的标签')
this.labelIdList = filterArr.map(item => item.labelId)
// console.log(this.tagsList, '当前被选中的标签')
} else {
this.$message.error(res.message)
}
......@@ -355,20 +334,40 @@ export default {
}
},
getAllTags() {
getAllTagTree({ 'labelTreeReq.shopId': 10001001 })
getAllTagTree({ 'labelTreeReq.shopId': this.merchantId })
.then(res => {
if (res.code == 0) {
console.log(res.data.labelTreeRets, '标签树')
let companyArr = res.data.labelTreeRets.filter(item => item.labelType == '企业标签')
companyArr.forEach(item => item.labelList.forEach(ele => (ele.checked = false)))
companyArr.forEach(item =>
item.labelList.forEach(ele => {
ele.checked = false
ele.original = false
})
)
let ownShopArr = res.data.labelTreeRets.filter(ele => ele.labelType == '自店标签')
ownShopArr.forEach(item => item.labelList.forEach(ele => (ele.checked = false)))
ownShopArr.forEach(item =>
item.labelList.forEach(ele => {
ele.checked = false
ele.original = false
})
)
// 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.original = true
}
}
})
)
} else {
this.$message.error(res.message)
}
......@@ -379,58 +378,47 @@ export default {
this.handleClose()
},
handleConfirm() {
this.$refs.roleForm.$children[0].validate(valid => {
if (!valid) {
return
}
if (this.roleForm.tagsList.length <= 0) {
this.$message.warning('至少要添加一个标签')
// this.$message({
// message: '警告哦,这是一条警告消息',
// type: 'warning'
// });
return false
// if (this.roleForm.tagsList.length <= 0) {
// this.$message.warning('至少要添加一个标签')
// return false
// }
//后台要求循环掉接口
//满足条件进行提交
// let param = {
// 'req.OneId': 14120314541863,
// 'req.labelGroupId':55555,
// 'req.labelIdList':[1,3,5]
// }
this.submitTagsList.forEach((item, index) => {
let param = {
'req.OneId': this.$route.query.id,
'req.labelGroupId': item.labelGroup.id
// 'req.labelIdList': item.labelList.map(ele => ele.id)
}
//后台要求循环掉接口
//满足条件进行提交
// let param = {
// 'req.OneId': 14120314541863,
// 'req.labelGroupId':55555,
// 'req.labelIdList':[1,3,5]
// }
this.submitTagsList.forEach((item, index) => {
let param = {
'req.OneId': 14120314541863,
'req.labelGroupId': item.labelGroup.id,
'req.labelIdList': item.labelList.filter(ele => ele.id)
}
console.log(param, '参数')
// addSingleClientTag({
// 'req.OneId': 14120314541863,
// 'req.labelGroupId': item.labelGroup.id,
// 'req.labelIdList': item.labelList.filter(ele => ele.id)
// })
// .then(res => {
// if (res.code == 0) {
// if (index == this.submitTagsList.length - 1) {
// this.$message.success('添加成功')
var ids = item.labelList.map(ele => ele.id)
param['req.labelIdList'] = ids
console.log(param, '参数')
addSingleClientTag(param)
.then(res => {
if (res.code == 0) {
if (index == this.submitTagsList.length - 1) {
this.$message.success('添加成功')
// this.handleClose()
// this.getSingleClientTag()
// }
// } else {
// this.$message.error(res.message)
// }
// })
// .catch(err => {
// console.error(err, '错误捕获')
// })
})
this.handleClose()
this.getSingleClientTag(this.$route.query.id, this.merchantId)
}
} else {
this.$message.error(res.message)
}
})
.catch(err => {
console.error(err, '错误捕获')
})
})
},
handleClose() {
if (this.tagsVisible) {
// && this.$refs.roleForm this.$refs.roleForm.$children[0].resetFields()
this.companyTagsList = []
this.ownShopTagsList = []
}
......@@ -453,7 +441,7 @@ export default {
return {
...item,
labelList: item.labelList.filter(e => {
if (e.checked) {
if (e.checked && !original) {
return e
}
})
......@@ -596,7 +584,7 @@ export default {
}
}
.tagsWrap {
min-height: 112px;
min-height: 74px;
border: 1px solid #e8e8ea;
padding: 20px 10px;
display: flex;
......
{
"TreeData":[
{
"dataFrom":"企微",
"labelGroup":{
"id":"1",
"name":"是否企微客户"
},
"labelType":"企业标签",
"labelList":[
{
"id":1,
"name":"企微客户"
},
{
"id":2,
"name":"非企微客户"
}
]
},
{
"dataFrom":"企微",
"labelGroup":{
"id":"2",
"name":"评价"
},
"labelType":"企业标签",
"labelList":[
{
"id":3,
"name":"优秀"
},
{
"id":4,
"name":"一般"
},
{
"id":5,
"name":"较差"
}
]
},
{
"dataFrom":"企微",
"labelGroup":{
"id":"3",
"name":"百家姓"
},
"labelType":"企业标签",
"labelList":[
{
"id":6,
"name":"赵"
},
{
"id":7,
"name":"钱"
},
{
"id":8,
"name":"孙"
},
{
"id":9,
"name":"李"
}
]
},
{
"dataFrom":"企微",
"labelGroup":{
"id":"7",
"name":"存档客户"
},
"labelType":"自店标签",
"labelList":[
{
"id":55,
"name":"张三"
},
{
"id":56,
"name":"李四"
}
]
}
]
}
\ No newline at end of file
<!--
* @Descripttion:
* @version: X3版本
* @Author: lily
* @Date: 2021-10-12 10:21:48
* @LastEditors: lily
* @LastEditTime: 2021-10-12 11:01:29
-->
<template>
<div class="wrapper">
<!-- 头部部分 -->
<div class="header">
<el-input v-model="input" placeholder="请输入内容"></el-input>
</div>
<!-- table部分 -->
<div class="main">
<div class="table-box">
<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>
<!-- 分页 -->
<div class="pagination__wrapper">
<cd-pagination ref="pager" :total="pagination.total" :currPage="pagination.pageNow" :pageSize="pagination.pageSize"></cd-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
const columns = [
{ key: 'accountName', label: '登录账号', width: 120 },
{ key: 'phone', label: '登录手机', width: 120 },
{ key: 'userName', label: '用户名称', width: 120 },
{ key: 'email', label: '登录邮箱', width: 210 },
{ key: 'orgNames', label: '所属组织', width: 210 },
{ key: 'roleName', label: '所属角色', width: 210 },
{ key: 'memo', label: '备注', width: 120 },
{ key: 'updateTime', label: '最后操作时间' }
]
import demo from '@/common/demo.json'
export default {
name: 'clientDemo',
components: {},
data() {
return {
input: '',
columns,
dataList: [],
tableHeight: null,
pagination: {
pageNow: 1,
pageSize: 20,
pages: 0,
total: 0
}
}
},
mounted() {
setTimeout(() => {
let height = this.$refs.tableList.$el.parentElement.clientHeight
this.tableHeight = `${height}px`
console.log(this.tableHeight, 'tableHeight')
})
this.dataList = demo.data.rows.concat([])
}
}
</script>
<style lang="scss" scoped>
.wrapper {
background: #fff !important;
height: 100%;
display: flex;
flex-direction: column;
}
.header {
padding: 20px 8px;
background: #ccc;
}
.main {
flex: 1;
overflow: hidden;
}
.table-box {
height: 100%;
display: flex;
flex: auto;
flex-direction: column;
overflow: hidden;
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<p class="pageTitle">客户管理</p>
<!-- <p class="pageTitle">客户管理</p> -->
<div class="pageContent">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @setTableHeightEvent="setTableHeightEvent">
<search-form :ploading="sloading" :isHasSyncBtn="true" class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable" @syncClick="syncClick">
<span class="inline-b" slot="form-slot">
<!-- :id="tableParams.btnId" -->
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span>
</search-form>
<GLTable ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchForm" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<GLTable 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" 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>
<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>
......@@ -28,7 +29,7 @@
<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>
<span style="display: inline-block; max-width: 120px; text-align: left">{{ toLabel(scope.scope.addWay) }}</span>
</el-tooltip>
</span>
......@@ -37,7 +38,7 @@
</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, 'green-text': scope.scope.status == 0 }">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[0] : '正常' }}</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> -->
......@@ -50,15 +51,17 @@
</template>
<script>
import { getTableList, getDictionaryFun } from '@/api/modules/clientManage'
import { getTableList, getDictionaryFun, syncCustomer } from '@/api/modules/clientManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientManage',
data() {
return {
url: url,
sloading: false,
CLIENTSTATUS: this.$Constants.CLIENT_STATUS,
searchForm: {},
searchFormTable: {},
clientManageFormList: [
{
type: 'daterange',
......@@ -86,7 +89,7 @@ export default {
},
{
label: '删除好友',
value: 1
value: -1
}
]
},
......@@ -154,7 +157,8 @@ export default {
tableColumns: [
{
label: 'User_id',
prop: 'oneId'
prop: 'oneId',
width: 180
},
{
label: '客户名称',
......@@ -170,7 +174,8 @@ export default {
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
addHtml: 'customerSex',
width: 80
},
{
label: '跟进员工',
......@@ -184,16 +189,19 @@ export default {
{
label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoin',
addHtml: 'isJoin'
addHtml: 'isJoin',
width: 95
},
{
label: '当前状态',
prop: 'status',
addHtml: 'status'
addHtml: 'status',
width: 80
},
{
label: '添加时间',
prop: 'addTime'
prop: 'addTime',
width: 188
}
],
tableOption: {
......@@ -215,19 +223,22 @@ export default {
},
methods: {
statusText(text) {
return text === -1 ? '删除好友' : text === 0 ? '正常' : ''
},
setTableHeightEvent() {
this.$refs.clientManage.setTableHeightFun()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
console.log(this.searchForm)
if (this.searchForm.daterange) {
this.searchForm.beginTime = this.searchForm.daterange[0]
this.searchForm.endTime = this.searchForm.daterange[1]
delete this.searchForm.daterange
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]
} else {
if (this.searchForm.beginTime) delete this.searchForm.beginTime && delete this.searchForm.endTime
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve()
})
},
......@@ -243,6 +254,8 @@ export default {
value: item.dictValue
}
})
data.unshift({ label: '全部', value: '' })
this.sourceList = data || []
if (data && data.length > 0) {
window.localStorage.setItem('sourceList', JSON.stringify(data))
......@@ -260,11 +273,11 @@ export default {
},
//来源 value值转为对应label
toLabel(value) {
if (!value) {
if (value !== 0 && !value) {
return
}
let curElement = this.sourceList.find(item => {
return item.value == value
return item.value === value
})
return curElement.label
......@@ -273,6 +286,22 @@ export default {
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.searchForm = {}
......@@ -299,7 +328,6 @@ export default {
position: relative;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
......@@ -307,6 +335,7 @@ export default {
}
.pageContent {
padding: 6px 20px 30px;
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 20px;
......@@ -326,9 +355,9 @@ export default {
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
// .glsx-table {
// margin-top: 20px;
// }
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<el-button type="primary" icon="el-icon-plus">创建员工</el-button>
<div class="pageContent">
<search-form :ploading="sloading" class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable">
<span class="inline-b" slot="form-slot">
<!-- :id="tableParams.btnId" -->
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span>
</search-form>
</div>
</div>
</template>
<script>
export default {
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
}
</style>
<template>
<div class="scrm-sub-client-container">
<p class="pageTitle">标签管理</p>
<!-- <p class="pageTitle">标签管理</p> -->
<button class="addTagsBtn" @click="btnClick('create')">添加标签组</button>
<!-- <button class="addTagsBtn" @click="btnClick('edit')">修改标签组</button> -->
<span class="toptips">
<span>共有{{ numberObj.groupCount || 0 }}个标签组,{{ numberObj.bizLabelCount || 0 }}个企业标签,{{ numberObj.rcLabelCount || 0 }}个自店标签</span>
<span class="iconPanelWrap" v-if="!isFirstShow">
<img src="@/assets/tagsManage/question.png" alt="" />
<span class="tipsPanel">企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;行业标签为通过大数据算法规则生成的标签</span>
<el-popover placement="top" width="560" trigger="hover" content="企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;行业标签为通过大数据算法规则生成的标签">
<img src="@/assets/tagsManage/question.png" slot="reference" alt="" />
</el-popover>
<!-- <span class="tipsPanel">企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;行业标签为通过大数据算法规则生成的标签</span> -->
</span>
</span>
<div class="initPanel" v-if="isFirstShow">
......@@ -25,18 +28,20 @@
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tagsManage" :hasNum="true" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" noDataText="你当前还没有添加的标签" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<!-- noDataText="你当前还没有添加的标签" -->
<GLTable @setTableFinishFun="setTableFinishFun" ref="tagsManage" :hasNum="true" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="labelGroup" slot-scope="scope">
<span>{{ scope.scope.labelGroup.name }}</span>
</span>
<span slot="labelList" slot-scope="scope">
<div id="allTagsWrap" class="allTagsWrap" :class="[expande ? 'expande' : 'close']">
<!-- :class="[expande ? 'expande' : 'close']" -->
<div id="allTagsWrap" class="allTagsWrap">
<span v-for="(item, index) in scope.scope.labelList" :key="index" class="ellipsis-1 tag-box-wrap">
<el-tooltip class="item" :content="item.name" placement="top">
<span>{{ item.name }}</span>
</el-tooltip>
</span>
<div class="expande-button-wrap" v-if="needShowExpande">
<!-- <div class="expande-button-wrap" v-if="needShowExpande">
<div class="expande-button" @click="expandeClick" v-if="!expande">
<i class="el-icon-arrow-down"></i>
<span>展开</span>
......@@ -45,7 +50,7 @@
<i class="el-icon-arrow-up"></i>
<span>收起</span>
</div>
</div>
</div> -->
</div>
</span>
<template slot="auth-button" slot-scope="scope">
......@@ -67,8 +72,8 @@
</el-select>
<span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组'">企业标签和自店标签分别最多3000个</span>
<span class="tagTipMsg" v-else>
{{ tagForm.initTagsGroup }}最多3000个,已创建
<span class="pure-blue-text">{{ editTagList.length }}</span>
{{ tagForm.initTagsGroup == 1 ? '企业标签' : '自店标签' }}最多3000个,已创建
<span class="pure-blue-text">{{ tagForm.initTagsGroup == 1 ? numberObj.bizLabelCount : numberObj.rcLabelCount }}</span>
个
</span>
<!-- 企业标签最多3000个,已创建3个 -->
......@@ -77,7 +82,7 @@
<div slot="tagsInput-type">
<div class="tagsWrap" v-if="tagDialogTitle == '编辑标签组'">
<span class="tag" :class="{ inputWrapShow: item.inputVisible }" v-for="item in editTagList" :key="item.id">
<el-input class="input-new-tag" v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="handleInputConfirm(item.name, item.id)" @keyup.enter.native="handleInputConfirm(item.name, item.id)"></el-input>
<el-input class="input-new-tag" maxlength="30" show-word-limit v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="handleInputConfirm(item.name, item.id)" @keyup.enter.native="handleInputConfirm(item.name, item.id)"></el-input>
<el-tooltip class="item" :content="item.name" placement="top">
<span class="ellipsis-1" v-if="!item.inputVisible">{{ item.name }}</span>
</el-tooltip>
......@@ -121,8 +126,8 @@ export default {
return {
numberObj: {},
url: url,
isFirstShow: true,
searchForm: { 'labelTreeReq.shopId': 10001001 },
isFirstShow: false,
searchForm: {},
clientPartFormList: [
{
type: 'select',
......@@ -235,27 +240,19 @@ export default {
//控制展开收起按钮
expande: true,
needShowExpande: false,
FormHeight: 0
merchantId: 10001001 //子系统默认这个门店id
}
},
created() {
this.getLoginCountFun()
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
this.searchForm = { 'labelTreeReq.shopId': this.merchantId }
// this.getLoginCountFun()
this.getTableTagNumFun()
},
watch: {
// FormHeight: {
// handler(val) {
// let lineHeight = 50 //22
// if (val > lineHeight * 2) {
// this.expande = false
// this.needShowExpande = true
// } else {
// this.needShowExpande = false
// this.expande = true
// }
// }
// }
},
methods: {
expandeClick() {
// console.log('expandeClick')
......@@ -271,19 +268,22 @@ export default {
this.$refs.tagsManage.setTableHeightFun()
},
setTableFinishFun(content) {
console.log('表格完成', content)
this.$nextTick(() => {
let lineHeight = 50
console.log('allTagsWrap', document.getElementById('allTagsWrap'))
if (document.getElementById('allTagsWrap').offsetHeight > lineHeight * 2) {
console.log('包含该行标签的div的高度:', document.getElementById('allTagsWrap').offsetHeight)
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
console.log('表格完成', this.$refs.tagsManage.data)
this.$refs.tagsManage.data.forEach(item => {
item.expande = true
item.needShowExpande = false
})
// this.$nextTick(() => {
// let lineHeight = 65
// if (document.getElementById('allTagsWrap').offsetHeight > lineHeight * 2) {
// console.log('包含该行标签的div的高度:', document.getElementById('allTagsWrap').offsetHeight)
// this.expande = false
// this.needShowExpande = true
// } else {
// this.needShowExpande = false
// this.expande = true
// }
// })
},
getLoginCountFun() {
//loginType:3是查客户数据概览浏览次数
......@@ -293,7 +293,7 @@ export default {
})
},
getTableTagNumFun() {
getTableTagNum({ shopId: 10001001 }).then(res => {
getTableTagNum({ shopId: this.merchantId }).then(res => {
if (!res) {
return false
}
......@@ -307,7 +307,7 @@ export default {
},
//重置表格
resetTable() {
this.searchForm = { 'labelTreeReq.shopId': 10001001 }
this.searchForm = { 'labelTreeReq.shopId': this.merchantId }
// searchForm: { 'labelTreeReq.shopId': 10001001 },
this.$refs.tagsManage.refreshTable()
},
......@@ -358,16 +358,22 @@ export default {
}
if (this.tagDialogTitle == '添加标签组') {
this.newAddTagFun()
this.handleClose()
} else {
//修改标签(允许同时增加标签)
let isHasEmpty = this.editTagList.some(ele => ele.name == '')
if (isHasEmpty) {
this.$message.warning('不能提交空标签')
return
}
this.updateTagFun()
if (this.tagForm.tagsList.length > 0) {
//过滤掉没有输入值得标签输入框
this.tagForm.tagsList = this.tagForm.tagsList.filter(item => item.name != '')
this.newAddTagFun()
}
this.handleClose()
}
this.handleClose()
})
},
handleClose() {
......@@ -393,7 +399,7 @@ export default {
//满足条件进行提交
let params = {}
params['labelDTO.dataFrom'] = 'cs'
params.shopId = '10001001'
params['labelDTO.shopId'] = this.merchantId
// params.staffId = '员工A'
params['labelDTO.labelGroup.name'] = this.tagForm.tagsName
params['labelDTO.labelType'] = this.tagForm.initTagsGroup == 1 ? '企业标签' : '自店标签'
......@@ -411,6 +417,7 @@ export default {
// this.tagForm.tagsList = []
this.resetTable() //刷新下表格
this.getTableTagNumFun()
}
})
},
......@@ -426,7 +433,9 @@ export default {
name: item.name
}
})
param['labelDTO.labelList'] = editTagList
updateTag(param).then(res => {
if (!res) {
return
......@@ -468,10 +477,10 @@ export default {
handleInputConfirm(inputValue, id) {
let value = inputValue
if (String(value).length == 0) {
this.$message.warning('不能清空标签')
return
}
// if (String(value).length == 0) {
// this.$message.warning('不能清空标签')
// return
// }
this.editTagList.forEach(i => {
if (i.id == id) {
......@@ -489,7 +498,7 @@ export default {
.scrm-sub-client-container {
.pageTitle {
position: relative;
margin-top: 30px;
// margin-top: 30px;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
......@@ -505,6 +514,7 @@ export default {
border-radius: 4px;
padding: 0 20px;
color: #fff;
font-size: 14px;
&:hover {
background-color: $lightBtnBlue;
}
......@@ -524,9 +534,7 @@ export default {
display: inline-block;
padding: 6px 10px 10px;
box-sizing: border-box;
height: 66px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 22px;
......@@ -610,13 +618,18 @@ export default {
}
}
}
.close {
overflow: hidden;
height: 65px;
}
.tag-box-wrap {
display: inline-block;
margin-right: 10px;
// margin-bottom: 10px;
margin-bottom: 10px;
padding: 0 10px;
box-sizing: border-box;
min-width: 76px;
max-width: 200px;
height: 26px;
line-height: 26px;
border-radius: 4px;
......
......@@ -17,6 +17,7 @@ const cdn = {
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
// `${CDN_DOMAIN}ajax/libs/axios/0.21.0/axios.min.js`,
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
]
}
module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!