Commit 4e1bb9fc by 李长胜

修改

1 parent a7171aa8
{ {
"name": "scrm-sub-blog", "name": "custom",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"echarts": "^5.2.0", "echarts": "^5.2.0",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.4", "glsx-common": "^1.4.6",
"glsx-components": "^1.0.5", "glsx-components": "^1.0.8",
"glsx-table": "^1.1.0", "glsx-table": "^1.1.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"vue": "^2.6.10", "vue": "^2.6.10",
......
...@@ -18,6 +18,15 @@ ...@@ -18,6 +18,15 @@
sign: true 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){ export function getTableDetail(params){
params.method='org.ore.api.customer.base.detail' params.method='org.ore.api.customer.base.detail'
return http({ return http({
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
}) })
} }
export function getAllTagTree (params){ export function getAllTagTree (params){
params.method='datahub.api.label.querylabeltree' params.method='datahub.api.label.querylabeltree'
return http({ return http({
...@@ -70,6 +71,15 @@ ...@@ -70,6 +71,15 @@
sign: true 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){ export function getTableDetail(params){
params.method='org.ore.api.customer.detail' params.method='org.ore.api.customer.detail'
......
...@@ -83,8 +83,8 @@ export default { ...@@ -83,8 +83,8 @@ export default {
// }, // },
legend: { legend: {
x: 'center', x: 'center',
y: 'bottom', // y: 'bottom',
// bottom: "bottom", bottom: '50px',
// textStyle: { // textStyle: {
// //图例的公用文本样式。 // //图例的公用文本样式。
// fontSize: 14, // fontSize: 14,
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
}, },
grid: { grid: {
//直角坐标系内绘图网格 //直角坐标系内绘图网格
bottom: '15%', //grid 组件离容器下侧的距离。 bottom: '20%', //grid 组件离容器下侧的距离。
left: '1%', left: '1%',
right: '5%', right: '5%',
containLabel: true //grid 区域是否包含坐标轴的刻度标签。 containLabel: true //grid 区域是否包含坐标轴的刻度标签。
...@@ -105,10 +105,11 @@ export default { ...@@ -105,10 +105,11 @@ export default {
//dataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。#bed0f7 //dataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。#bed0f7
{ {
bottom: '30px', bottom: '30px',
type: 'inside',
show: true, show: true,
// backgroundColor: '#ff0000', // backgroundColor: '#ff0000',
// borderColor: '#ff0000', // borderColor: '#ff0000',
height: '5%', height: '1%',
// borderColor: '#8FDFFE', // borderColor: '#8FDFFE',
// backgroundColor: '#8fdffe99', // backgroundColor: '#8fdffe99',
...@@ -116,7 +117,7 @@ export default { ...@@ -116,7 +117,7 @@ export default {
handleColor: '#bed0f7', handleColor: '#bed0f7',
handleSize: 20, handleSize: 15,
handleStyle: { handleStyle: {
borderColor: '#bed0f7', borderColor: '#bed0f7',
...@@ -152,14 +153,14 @@ export default { ...@@ -152,14 +153,14 @@ export default {
{ {
type: 'value', type: 'value',
name: '单位:人', name: '单位:人',
// min: 0, min: 0,
// max: 35000, max: 100,
// interval: 5000, interval: 10,
axisLabel: { axisLabel: {
formatter: '{value}' formatter: '{value}'
}, },
splitLine: { splitLine: {
show: true //是否显示分割线 show: false //是否显示分割线
} }
}, },
{ {
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
formatter: '{value}' formatter: '{value}'
}, },
splitLine: { splitLine: {
show: true //是否显示分割线 show: false //是否显示分割线
} }
} }
], ],
......
...@@ -38,7 +38,9 @@ export default { ...@@ -38,7 +38,9 @@ export default {
var maxData = this.entmicroAddCustomerCount + this.entmicroNotAddCustomerCount var maxData = this.entmicroAddCustomerCount + this.entmicroNotAddCustomerCount
option = { option = {
tooltip: {}, tooltip: {
formatter: ' {c}人'
},
xAxis: { xAxis: {
max: maxData, // 以x轴为基准,进行象形图的重复画图,最大值为100(可调整),为了下方好处理我调整为100 max: maxData, // 以x轴为基准,进行象形图的重复画图,最大值为100(可调整),为了下方好处理我调整为100
splitLine: { show: false }, // x轴 轴线什么的都不需要 splitLine: { show: false }, // x轴 轴线什么的都不需要
......
<template> <template>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<!-- 有图标无数据文字情况 --> <!-- 有图标无数据文字情况 -->
<div class="nodata" v-if="type=='hasIconText'"> <div class="nodata" v-if="type == 'hasIconText'">
<img src="@/assets/clientDataOverview/nodata.png" alt=""> <img src="@/assets/clientDataOverview/nodata.png" alt="" />
<p>暂无数据</p> <p>暂无数据</p>
</div>
<!-- 没有图标有无数据文字 -->
<div class="nodata" v-if="type=='hasText'">
<p>暂无数据</p>
</div>
</div> </div>
<!-- 没有图标有无数据文字 -->
<div class="nodata" v-if="type == 'hasText'">
<p>暂无数据</p>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
type: { type: {
type: String, type: String,
default: '' default: ''
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.scrm-sub-client-container{ .scrm-sub-client-container {
.nodata{ .nodata {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
z-index: 9; z-index: 9;
p{ p {
height: 22px; height: 22px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
line-height: 22px; line-height: 22px;
}
} }
}
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -17,31 +17,38 @@ ...@@ -17,31 +17,38 @@
<span>收起</span> <span>收起</span>
</div> </div>
</div> </div>
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''"> <div class="firstRowBtn" v-if="!expande && isShowBtns">
<template> <el-button plain @click="resetTable" size="small">重置</el-button>
<template v-if="item.type === 'input'"> <el-button type="primary" @click="searchTable" size="small">查询</el-button>
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input> <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>
<template v-else-if="item.type === 'select'"> </el-form-item>
<el-select v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'"> <el-form-item>
<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> <template>
</el-select> <slot name="form-slot"></slot>
</template> </template>
<template v-else-if="item.type === 'daterange'"> </el-form-item>
<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>
<template>
<slot name="formsearch-slot"></slot>
</template> </template>
</template> </el-form-item> -->
</el-form-item> </div>
<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> </el-form>
</div> </div>
</template> </template>
...@@ -68,21 +75,37 @@ export default { ...@@ -68,21 +75,37 @@ export default {
labelWidth: { labelWidth: {
type: String, type: String,
default: 'auto' default: 'auto'
},
ploading: {
type: Boolean,
default: false
},
isHasSyncBtn: {
type: Boolean,
default: false
} }
}, },
data() { data() {
return { return {
expande: true, expande: true,
needShowExpande: false, needShowExpande: false,
FormHeight: 0 FormHeight: 0,
isShowBtns: true
} }
}, },
mounted() { mounted() {
console.log('搜索表单') var sf = document.getElementById('searchForm')
this.$nextTick(() => { 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 let lineHeight = 75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) { if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
console.log('第一次searchForm高度', document.getElementById('searchForm').offsetHeight) // console.log('第一次searchForm高度', document.getElementById('searchForm').offsetHeight)
this.expande = false this.expande = false
this.needShowExpande = true this.needShowExpande = true
} else { } else {
...@@ -102,14 +125,28 @@ export default { ...@@ -102,14 +125,28 @@ export default {
// console.log('窗口发生改变了哟!') // console.log('窗口发生改变了哟!')
// }, 100) // }, 100)
// }) // })
window.onresize = () => { // window.onresize = () => {
return (() => { // return (() => {
if (resizeTimer) clearTimeout(resizeTimer) // if (resizeTimer) clearTimeout(resizeTimer)
resizeTimer = setTimeout(function() { // resizeTimer = setTimeout(function() {
that.FormHeight = document.getElementById('searchForm').offsetHeight // window.location.reload() //浏览器重新从服务器请求资源,在http请求头中不会包含缓存标记
}, 100) // // 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: { watch: {
...@@ -131,12 +168,20 @@ export default { ...@@ -131,12 +168,20 @@ export default {
onInput(e) { onInput(e) {
this.$emit('input', e) this.$emit('input', e)
}, },
resetTable() {
this.$emit('resetTable')
},
searchTable() {
this.$emit('searchTable')
},
syncClick() {
this.$emit('syncClick')
},
// openClose(){ // openClose(){
// console.log( document.getElementById('searchForm').offsetHeight); // console.log( document.getElementById('searchForm').offsetHeight);
// document.getElementById('searchForm').offsetHeight=172; // document.getElementById('searchForm').offsetHeight=172;
// } // }
expandeClick() { expandeClick() {
console.log('expandeClick')
this.expande = !this.expande this.expande = !this.expande
setTimeout(() => { setTimeout(() => {
this.$emit('setTableHeightEvent') this.$emit('setTableHeightEvent')
...@@ -151,6 +196,17 @@ export default { ...@@ -151,6 +196,17 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
// height: 50px; // height: 50px;
.firstRowBtn {
position: absolute;
right: 60px;
.el-button + .el-button {
margin-left: 20px;
}
}
.itemWidth {
max-width: 1050px;
min-width: 660px;
}
.expande-button-wrap { .expande-button-wrap {
position: absolute; position: absolute;
right: 0; right: 0;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'scrm-sub-blog', title: 'custom',
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', 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 = { module.exports = {
title: 'scrm-sub-blog', title: 'custom',
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
...@@ -7,8 +17,12 @@ module.exports = { ...@@ -7,8 +17,12 @@ module.exports = {
code_success_value: '0', code_success_value: '0',
code_message_map: {} code_message_map: {}
}, },
request: { // 王小龙:http://192.168.2.98:8091/rop-scrm-datahub 冯支:http://192.168.3.191:8064/rop-scrm-entmicro/
baseURL: 'http://scrm.test.glsx.com.cn', /* 开发环境的域名: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, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -17,10 +31,10 @@ module.exports = { ...@@ -17,10 +31,10 @@ module.exports = {
responseType: 'json' responseType: 'json'
}, },
sign: { sign: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
format: 'json', format: 'json',
source: '' source: 'client-sub-custom'
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
......
...@@ -9,18 +9,20 @@ ...@@ -9,18 +9,20 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
if (isEnv) { if (isEnv) {
let { request } = cfg let { request } = cfg
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(cfg) return Promise.resolve(cfg)
} }
//return window.fetch('https://', {}).then(res => res.json()) // https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // 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 = { export const config = {
install(vue, cfg) { install(vue, cfg) {
vue.prototype.$config = cfg vue.prototype.$config = cfg
} }
} }
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' 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(Button)
Vue.use(ButtonGroup) Vue.use(ButtonGroup)
Vue.use(Form) Vue.use(Form)
......
...@@ -59,6 +59,24 @@ const staticRoutes = Object.freeze([ ...@@ -59,6 +59,24 @@ const staticRoutes = Object.freeze([
component: resolve => require([`@/views/expand/index.vue`], resolve), component: resolve => require([`@/views/expand/index.vue`], resolve),
meta: {} 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 export default staticRoutes
......
...@@ -13,7 +13,7 @@ let routes = [] ...@@ -13,7 +13,7 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) { 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.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -16,8 +16,8 @@ import render from './render' ...@@ -16,8 +16,8 @@ import render from './render'
import { routes } from '@/router' import { routes } from '@/router'
export async function start() { export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig() const { response, request, sign, secret } = await fetchConfig(true)
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-ab3d905b-5148-42ba-86dd-8ec6a51b9b86-rop' } }) 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'] }) Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes) render('/', routes)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
color:$btnBlue; color:$btnBlue;
&:hover{ &:hover{
color: #9994FF; color: #9994FF;
cursor: pointer;
} }
} }
.pure-blue-text{ .pure-blue-text{
......
...@@ -40,5 +40,8 @@ ...@@ -40,5 +40,8 @@
} }
// 子系统不设外边距 // 子系统不设外边距
.scrm-sub-client-container{ .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 \ No newline at end of file
...@@ -12,12 +12,12 @@ const overThousandFilter = (val) => { ...@@ -12,12 +12,12 @@ const overThousandFilter = (val) => {
}; };
//来源 value值转为对应label(来源) //来源 value值转为对应label(来源)
const toLabel=(value)=> { const toLabel=(value)=> {
if (!value) { if (value!==0 && !value) {
return return
} }
let sourceList=JSON.parse(window.localStorage.getItem('sourceList')); let sourceList=JSON.parse(window.localStorage.getItem('sourceList'));
let curElement =sourceList.find(item => { let curElement =sourceList.find(item => {
return item.value == value return item.value === value
}) })
return curElement.label return curElement.label
......
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
top: 365px; top: 365px;
height: 20px; height: 20px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
top: 389px; top: 389px;
height: 25px; height: 25px;
font-size: 18px; font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #716aff; color: #716aff;
line-height: 25px; line-height: 25px;
...@@ -615,4 +615,4 @@ export default { ...@@ -615,4 +615,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<!-- <div class="forbidClickLayer"></div> -->
<template v-if="isShowModal"> <template v-if="isShowModal">
<div class="modalLayer"></div> <div class="modalLayer"></div>
<img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" /> <img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" />
...@@ -10,6 +9,7 @@ ...@@ -10,6 +9,7 @@
</template> </template>
<div class="bannerWrapBox" @click="goNextPage" v-if="!isHasCustomerCountBanner"> <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="" /> <img class="bannerWrap" src="@/assets/clientDataOverview/companyBanner.png" alt="" />
</div> </div>
<h3 class="pageSubTitle">客户分层</h3> <h3 class="pageSubTitle">客户分层</h3>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<span class="person-text">人</span> <span class="person-text">人</span>
</span> </span>
<span v-if="!isEmptyObj"> <span v-if="!isEmptyObj">
占比:{{ topDataObj.purposePercent * 100 || 0 }}% 占比:{{ purposePercent }}%
<i class="triangle" :class="{ active: !isNoBuyUp }" v-if="!isEmptyObj"></i> <i class="triangle" :class="{ active: !isNoBuyUp }" v-if="!isEmptyObj"></i>
</span> </span>
<!-- <i class="vertical-line"></i> --> <!-- <i class="vertical-line"></i> -->
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</span> </span>
<span v-if="!isEmptyObj"> <span v-if="!isEmptyObj">
占比:{{ topDataObj.purchasePercent * 100 || 0 }}% 占比:{{ purchasePercent }}%
<i class="triangle" :class="{ active: !isBuyUp }" v-if="!isEmptyObj"></i> <i class="triangle" :class="{ active: !isBuyUp }" v-if="!isEmptyObj"></i>
</span> </span>
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
</template> </template>
<script> <script>
// import $ from 'jquery'
import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview' import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview'
import { getLoginCount } from '@/api/modules/loginCount' import { getLoginCount } from '@/api/modules/loginCount'
import pieEchart from '@/components/echarts/pieEchart' import pieEchart from '@/components/echarts/pieEchart'
...@@ -193,16 +194,6 @@ export default { ...@@ -193,16 +194,6 @@ export default {
pictorialBar, pictorialBar,
noData 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() { data() {
return { return {
isShowModal: false, isShowModal: false,
...@@ -272,6 +263,14 @@ export default { ...@@ -272,6 +263,14 @@ export default {
}, },
isShowData() { isShowData() {
return Object.keys(this.topDataObj).length > 0 && this.topDataObj.customerCount > 0 ? true : false 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() { created() {
...@@ -294,6 +293,7 @@ export default { ...@@ -294,6 +293,7 @@ export default {
//引流企微按钮暂时效果 //引流企微按钮暂时效果
toGuideCompanyWechat() { toGuideCompanyWechat() {
window.open('https://www.baidu.com', '_blank') window.open('https://www.baidu.com', '_blank')
// $('.subtitle').hide()
}, },
showModalLayer() { showModalLayer() {
var baseNavEle = document.querySelector('.scrm-base-nav') var baseNavEle = document.querySelector('.scrm-base-nav')
...@@ -363,26 +363,33 @@ export default { ...@@ -363,26 +363,33 @@ export default {
//获取上面的数据 //获取上面的数据
getDataOverviewFun() { getDataOverviewFun() {
// const res = await getDataOverview() // const res = await getDataOverview()
getDataOverview({}) getDataOverview({}).then(res => {
.then(res => { if (!res) {
if (!res) { return
return }
} console.log('上面', res)
this.topDataObj = res 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
this.isNoBuyUp = res.purposeUp // this.titles[0].num = res.newCarCustomerCount
this.isBuyUp = res.purchaseUp // this.titles[1].num = res.needRenewalCustomerCount
if (this.topDataObj.customerCount > 0) { // this.titles[2].num = res.burseholderCustomerCount
this.isHasCustomerCountBanner = true // this.titles[4].num = res.silenceCustomerCount
}
}) console.log(res, '这是上面数据')
.catch(err => { this.isNoBuyUp = res.purposeUp
console.log('错误信息:', err) 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天) //首次进来获取下方柱状图数据(一进来默认传7天)
async getDataOverviewBarMapFun(dayCount = 7) { async getDataOverviewBarMapFun(dayCount = 7) {
...@@ -435,33 +442,8 @@ export default { ...@@ -435,33 +442,8 @@ export default {
.person-text { .person-text {
font-size: 16px !important; 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; position: fixed;
z-index: 99; z-index: 99;
top: 20px; top: 20px;
...@@ -508,7 +490,14 @@ export default { ...@@ -508,7 +490,14 @@ export default {
} }
.bannerWrapBox { .bannerWrapBox {
width: 100%; width: 100%;
> img { // position: relative;
// .inTimeBtn {
// position: absolute;
// bottom: 20px;
// right: 50px;
// }
.bannerWrap {
width: 100%; width: 100%;
// height: 146px; // height: 146px;
...@@ -521,7 +510,6 @@ export default { ...@@ -521,7 +510,6 @@ export default {
margin: 20px 0; margin: 20px 0;
height: 20px; height: 20px;
font-size: 20px; font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -610,7 +598,6 @@ export default { ...@@ -610,7 +598,6 @@ export default {
top: 365px; top: 365px;
height: 20px; height: 20px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -622,7 +609,7 @@ export default { ...@@ -622,7 +609,7 @@ export default {
top: 389px; top: 389px;
height: 25px; height: 25px;
font-size: 18px; font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #716aff; color: #716aff;
line-height: 25px; line-height: 25px;
...@@ -634,7 +621,7 @@ export default { ...@@ -634,7 +621,7 @@ export default {
top: 365px; top: 365px;
height: 20px; height: 20px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -646,7 +633,6 @@ export default { ...@@ -646,7 +633,6 @@ export default {
right: 57px; right: 57px;
top: 389px; top: 389px;
font-size: 18px; font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #fe9c1c; color: #fe9c1c;
line-height: 25px; line-height: 25px;
...@@ -921,7 +907,7 @@ export default { ...@@ -921,7 +907,7 @@ export default {
height: 80px; height: 80px;
.one1 { .one1 {
margin-top: 30px; margin-top: 30px;
height: 44px; height: 36px;
position: relative; position: relative;
span { span {
position: absolute; position: absolute;
...@@ -941,7 +927,7 @@ export default { ...@@ -941,7 +927,7 @@ export default {
left: 38.4%; left: 38.4%;
} }
span:nth-child(3) { span:nth-child(3) {
left: 57%; left: 54%;
} }
} }
.one2 { .one2 {
...@@ -962,7 +948,7 @@ export default { ...@@ -962,7 +948,7 @@ export default {
left: 38.4%; left: 38.4%;
} }
span:nth-child(2) { span:nth-child(2) {
left: 57%; left: 54%;
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<div class="header"> <div class="header">
<div class="vehicleGroupName"> <div class="vehicleGroupName">
<span>奥迪车友群</span> <span>{{ groupName }}</span>
</div> </div>
<button class="backBtn" @click="goBack">返回客户群管理</button> <button class="backBtn" @click="goBack">返回客户群管理</button>
</div> </div>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</p> </p>
<p> <p>
<span>创建时间</span> <span>创建时间</span>
<span class="ellipsis-1" style="width:100%;">{{ leftPanelList.createDate }}</span> <span class="ellipsis-1" :title="leftPanelList.createDate">{{ leftPanelList.createDate }}</span>
</p> </p>
</div> </div>
<div class="rightWrap"> <div class="rightWrap">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<span>客户列表</span> <span>客户列表</span>
<span>{{ clientTableDataNum || 0 }}个</span> <span>{{ clientTableDataNum || 0 }}个</span>
</p> </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"> <span class="inline-b" slot="form-slot">
<!-- :size="btn_size" --> <!-- :size="btn_size" -->
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
...@@ -56,7 +56,7 @@ ...@@ -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"> <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 slot="customerName" slot-scope="scope">
<span>{{ scope.scope.customerName }}</span> <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>
<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>
...@@ -80,6 +80,7 @@ export default { ...@@ -80,6 +80,7 @@ export default {
name: 'clientGroupDetail', name: 'clientGroupDetail',
data() { data() {
return { return {
groupName: this.$route.query.groupName,
url: url, url: url,
leftPanelList: {}, leftPanelList: {},
searchForm: {}, searchForm: {},
...@@ -210,6 +211,9 @@ export default { ...@@ -210,6 +211,9 @@ export default {
resolve() resolve()
}) })
}, },
setTableHeightEvent() {
this.$refs.clientGroupManage.setTableHeightFun()
},
setTableFinishFun(content) { setTableFinishFun(content) {
this.clientTableDataNum = content.length this.clientTableDataNum = content.length
}, },
...@@ -227,7 +231,7 @@ export default { ...@@ -227,7 +231,7 @@ export default {
}, },
goDetail(id) { goDetail(id) {
this.$router.push({ this.$router.push({
name: '/clientManage/clientDetail', path: '/clientManage/clientDetail',
query: { query: {
id: id id: id
} }
...@@ -277,7 +281,7 @@ export default { ...@@ -277,7 +281,7 @@ export default {
.leftWrap { .leftWrap {
width: 240px; width: 240px;
// height: 877px; // height: 877px;
min-height: calc(100vh - 92px); min-height: 270px; //calc(100vh - 92px);
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
.avator { .avator {
......
<template> <template>
<div> <div>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<p class="pageTitle">客户群管理</p> <!-- <p class="pageTitle">客户群管理</p> -->
<div class="pageContent"> <div class="pageContent">
<search-form class="searchTop border-shadow" :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"> <span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span> </span>
</search-form> </search-form>
<!-- <basic-table ref="clientGroupTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true"> <!-- <basic-table ref="clientGroupTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true">
...@@ -14,14 +15,14 @@ ...@@ -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> <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> </span>
</basic-table> --> </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 slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> --> <!-- <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 class="statusText" :class="scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[1] : ''">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[0] : '--' }}</span>
</span> </span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> --> <!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span> <span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -30,18 +31,21 @@ ...@@ -30,18 +31,21 @@
</template> </template>
<script> <script>
import { getTableList } from '@/api/modules/clientGroupManage' import { getTableList, syncCustomerBase } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
export default { export default {
name: 'clientManage', name: 'clientManage',
data() { data() {
return { return {
url: url, url: url,
sloading: false,
titles: [ titles: [
{ name: '客户群总数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息1' }, { name: '客户群总数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息1' },
{ name: '新增客户群数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息2' } { name: '新增客户群数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息2' }
], ],
searchForm: {}, searchForm: {},
searchFormTable: {},
clientGroupFormList: [ clientGroupFormList: [
{ {
type: 'daterange', type: 'daterange',
...@@ -107,7 +111,8 @@ export default { ...@@ -107,7 +111,8 @@ export default {
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'addTime' prop: 'addTime',
width: 188
} }
], ],
tableOption: { tableOption: {
...@@ -134,6 +139,22 @@ export default { ...@@ -134,6 +139,22 @@ export default {
}, },
methods: { 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() { setTableHeightEvent() {
this.$refs.clientGroupManage.setTableHeightFun() this.$refs.clientGroupManage.setTableHeightFun()
}, },
...@@ -142,14 +163,14 @@ export default { ...@@ -142,14 +163,14 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(this.searchForm) this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.daterange) { if (this.searchFormTable.daterange) {
this.searchForm.beginTime = this.searchForm.daterange[0] this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchForm.endTime = this.searchForm.daterange[1] this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchForm.daterange
} else { } 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() resolve()
}) })
}, },
...@@ -159,13 +180,21 @@ export default { ...@@ -159,13 +180,21 @@ export default {
this.$refs.clientGroupManage.refreshTable() this.$refs.clientGroupManage.refreshTable()
}, },
btnClick(ptype, scope) {}, btnClick(ptype, scope) {},
goDetail(id) { goDetail(id, name) {
this.$router.push({ this.$router.push({
name: '/clientGroupManage/clientGroupDetail', path: '/clientGroupManage/clientGroupDetail',
query: { query: {
id: id id: id,
groupName: name
} }
}) })
// this.$history.push({
// path: '/clientGroupManage/clientGroupDetail',
// params: {
// id: id,
// groupName: name
// }
// })
} }
} }
} }
...@@ -179,7 +208,6 @@ export default { ...@@ -179,7 +208,6 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
height: 20px; height: 20px;
font-size: 20px; font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -187,6 +215,7 @@ export default { ...@@ -187,6 +215,7 @@ export default {
} }
.pageContent { .pageContent {
padding: 6px 20px 30px; padding: 6px 20px 30px;
// min-width: 1300px;
background-color: #fff; background-color: #fff;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 20px;
...@@ -206,9 +235,9 @@ export default { ...@@ -206,9 +235,9 @@ export default {
// font-weight: 400; // font-weight: 400;
// color: #666666; // color: #666666;
// } // }
.glsx-table { // .glsx-table {
margin-top: 20px; // margin-top: 20px;
} // }
} }
} }
</style> </style>
{
"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 \ 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> <template>
<div> <div>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<p class="pageTitle">客户管理</p> <!-- <p class="pageTitle">客户管理</p> -->
<div class="pageContent"> <div class="pageContent">
<search-form class="searchTop border-shadow" :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"> <span class="inline-b" slot="form-slot">
<!-- :id="tableParams.btnId" --> <!-- :id="tableParams.btnId" -->
<el-button plain @click="resetTable">重置</el-button> <el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button> <el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button>
</span> </span>
</search-form> </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"> <span slot="customerName" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top"> <el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
<span class="ellipsis-1" style="display:inline-block;max-width:70px;text-align:left;">{{ scope.scope.customerName }}</span> <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
</el-tooltip> </el-tooltip>
<span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span> <span class="pure-blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<span slot="addWay" slot-scope="scope"> <span slot="addWay" slot-scope="scope">
<el-tooltip effect="dark" :content="toLabel(scope.scope.addWay)" placement="top"> <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> </el-tooltip>
</span> </span>
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
</span> </span>
<span slot="status" slot-scope="scope"> <span slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> --> <!-- <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> </span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> --> <!-- <auth-button :data="scope.scope"></auth-button> -->
...@@ -50,15 +51,17 @@ ...@@ -50,15 +51,17 @@
</template> </template>
<script> <script>
import { getTableList, getDictionaryFun } from '@/api/modules/clientManage' import { getTableList, getDictionaryFun, syncCustomer } from '@/api/modules/clientManage'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
export default { export default {
name: 'clientManage', name: 'clientManage',
data() { data() {
return { return {
url: url, url: url,
sloading: false,
CLIENTSTATUS: this.$Constants.CLIENT_STATUS, CLIENTSTATUS: this.$Constants.CLIENT_STATUS,
searchForm: {}, searchForm: {},
searchFormTable: {},
clientManageFormList: [ clientManageFormList: [
{ {
type: 'daterange', type: 'daterange',
...@@ -86,7 +89,7 @@ export default { ...@@ -86,7 +89,7 @@ export default {
}, },
{ {
label: '删除好友', label: '删除好友',
value: 1 value: -1
} }
] ]
}, },
...@@ -154,7 +157,8 @@ export default { ...@@ -154,7 +157,8 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: 'User_id', label: 'User_id',
prop: 'oneId' prop: 'oneId',
width: 180
}, },
{ {
label: '客户名称', label: '客户名称',
...@@ -170,7 +174,8 @@ export default { ...@@ -170,7 +174,8 @@ export default {
{ {
label: '性别', label: '性别',
prop: 'customerSex', prop: 'customerSex',
addHtml: 'customerSex' addHtml: 'customerSex',
width: 80
}, },
{ {
label: '跟进员工', label: '跟进员工',
...@@ -184,16 +189,19 @@ export default { ...@@ -184,16 +189,19 @@ export default {
{ {
label: '是否加企微', //1. 加入,0.未加入 label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoin', prop: 'isJoin',
addHtml: 'isJoin' addHtml: 'isJoin',
width: 95
}, },
{ {
label: '当前状态', label: '当前状态',
prop: 'status', prop: 'status',
addHtml: 'status' addHtml: 'status',
width: 80
}, },
{ {
label: '添加时间', label: '添加时间',
prop: 'addTime' prop: 'addTime',
width: 188
} }
], ],
tableOption: { tableOption: {
...@@ -215,19 +223,22 @@ export default { ...@@ -215,19 +223,22 @@ export default {
}, },
methods: { methods: {
statusText(text) {
return text === -1 ? '删除好友' : text === 0 ? '正常' : ''
},
setTableHeightEvent() { setTableHeightEvent() {
this.$refs.clientManage.setTableHeightFun() this.$refs.clientManage.setTableHeightFun()
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(this.searchForm) this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.daterange) { if (this.searchFormTable.daterange) {
this.searchForm.beginTime = this.searchForm.daterange[0] this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchForm.endTime = this.searchForm.daterange[1] this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchForm.daterange
} else { } 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() resolve()
}) })
}, },
...@@ -243,6 +254,8 @@ export default { ...@@ -243,6 +254,8 @@ export default {
value: item.dictValue value: item.dictValue
} }
}) })
data.unshift({ label: '全部', value: '' })
this.sourceList = data || [] this.sourceList = data || []
if (data && data.length > 0) { if (data && data.length > 0) {
window.localStorage.setItem('sourceList', JSON.stringify(data)) window.localStorage.setItem('sourceList', JSON.stringify(data))
...@@ -260,11 +273,11 @@ export default { ...@@ -260,11 +273,11 @@ export default {
}, },
//来源 value值转为对应label //来源 value值转为对应label
toLabel(value) { toLabel(value) {
if (!value) { if (value !== 0 && !value) {
return return
} }
let curElement = this.sourceList.find(item => { let curElement = this.sourceList.find(item => {
return item.value == value return item.value === value
}) })
return curElement.label return curElement.label
...@@ -273,6 +286,22 @@ export default { ...@@ -273,6 +286,22 @@ export default {
searchTable() { searchTable() {
this.$refs.clientManage.refreshTable() 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() { resetTable() {
this.searchForm = {} this.searchForm = {}
...@@ -299,7 +328,6 @@ export default { ...@@ -299,7 +328,6 @@ export default {
position: relative; position: relative;
height: 20px; height: 20px;
font-size: 20px; font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
...@@ -307,6 +335,7 @@ export default { ...@@ -307,6 +335,7 @@ export default {
} }
.pageContent { .pageContent {
padding: 6px 20px 30px; padding: 6px 20px 30px;
// min-width: 1300px;
background-color: #fff; background-color: #fff;
.el-button + .el-button { .el-button + .el-button {
margin-left: 20px; margin-left: 20px;
...@@ -326,9 +355,9 @@ export default { ...@@ -326,9 +355,9 @@ export default {
// font-weight: 400; // font-weight: 400;
// color: #666666; // color: #666666;
// } // }
.glsx-table { // .glsx-table {
margin-top: 20px; // margin-top: 20px;
} // }
} }
} }
</style> </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>
...@@ -17,6 +17,7 @@ const cdn = { ...@@ -17,6 +17,7 @@ const cdn = {
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${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/axios/0.21.0/axios.min.js`,
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js` `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
] ]
} }
module.exports = { module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!