Commit c3848470 by 杨明

fixed

1 parent 4a8d5c4d
import GLCombiForm from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLCombiForm.install = function(Vue) {
Vue.component(GLCombiForm.name, GLCombiForm)
}
// 默认导出组件
export default GLCombiForm
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file \ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk">查询</el-button>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? '展开' : '收起' }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data() {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created() {},
mounted() {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn() {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum() {
const items = document.getElementById('gl-search').getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand(nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith() {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk() {
// 点击确定的回调
this.$emit('onOk')
},
handleRest() {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy() {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
// @media screen and (max-width: 1062px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1062px) and (max-width: 1440px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1440px) and (max-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
.search-list {
.search-item {
width: 100%;
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
font-size: 14px;
font-weight: 400;
color: #666;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file \ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
import { getCustomersList, exportLabelList } from '@/api/modules/tagsManage' import { getCustomersList, exportLabelList } from '@/api/modules/tagsManage'
import { getStaffList } from '@/api/modules/clientManage'
export default { export default {
data() { data() {
return { return {
tagHeight: 0, tagHeight: 0,
tagHeightStatus: false,
tagCheckItem: [], tagCheckItem: [],
allListParams: [], allListParams: [],
crowdForm: { crowdForm: {
...@@ -13,15 +14,14 @@ export default { ...@@ -13,15 +14,14 @@ export default {
} }
}, },
mounted() { mounted() {
this.getStaffList()
this.getCustomersListData() this.getCustomersListData()
}, },
watch: { watch: {
tagCheckItem: { tagCheckItem: {
handler() { handler() {
if (this.tagCheckItem.length == 0) { if (this.tagCheckItem.length == 0) {
setTimeout(() => { this.tagHeight = 0
this.tagHeight = 0
}, 300)
} }
this.allListParams = [] this.allListParams = []
const tagNode = this.$common.utils.deepClone(this.tagCheckItem) const tagNode = this.$common.utils.deepClone(this.tagCheckItem)
...@@ -41,14 +41,56 @@ export default { ...@@ -41,14 +41,56 @@ export default {
this.getCustomersListData() this.getCustomersListData()
}, },
deep: true deep: true
},
tagHeight: {
handler(val) {
if (val == 0) {
setTimeout(() => {
this.tagHeightStatus = false
}, 300)
} else {
this.tagHeightStatus = true
}
},
deep: true
} }
}, },
methods: { methods: {
//获取跟进员工
getStaffList() {
getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const id = this.tagsPartFormList.findIndex(item => {
return item.name == 'followStaff'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.staffName
}
})
staff.unshift({ label: '全部', value: '' })
this.$nextTick(() => {
this.tagsPartFormList[id].optionList = staff
})
console.log(this.tagsPartFormList[id])
})
},
goDetail(scope) {
this.$router.push('/clientManage/clientDetail?id=' + scope.oneId)
},
//删除标签组 //删除标签组
removeItem(index) { removeItem(index) {
this.tagCheckItem.splice(index, 1) this.tagCheckItem.splice(index, 1)
this.$refs.tagTree.getTreeNode(this.tagCheckItem) this.$refs.tagTree.getTreeNode(this.tagCheckItem)
}, },
treeScroll(id) {
const h = document.querySelector('.node_' + id).offsetTop
this.$refs.tagTree.handleScroll(h)
},
//获取选中的标签并排序 //获取选中的标签并排序
getCheckItem(item) { getCheckItem(item) {
const tree_id = [] const tree_id = []
...@@ -89,10 +131,16 @@ export default { ...@@ -89,10 +131,16 @@ export default {
}, },
//客户列表 //客户列表
getCustomersListData() { getCustomersListData() {
if (this.searchForm.createTime) {
this.searchForm.beginTime = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.searchForm.endTime = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
}
delete this.searchForm.createTime
const tagLists = this.$common.utils.deepClone(this.allListParams) const tagLists = this.$common.utils.deepClone(this.allListParams)
this.userLoading = true this.userLoading = true
const params = { const params = {
...JSON.parse(JSON.stringify({ tagLists })), ...JSON.parse(JSON.stringify({ tagLists })),
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.viewCustomers.page.pageSize, pageSize: this.$refs.viewCustomers.page.pageSize,
pageNum: this.$refs.viewCustomers.page.pageNum pageNum: this.$refs.viewCustomers.page.pageNum
} }
...@@ -100,6 +148,9 @@ export default { ...@@ -100,6 +148,9 @@ export default {
this.userLoading = false this.userLoading = false
this.tableData = res.data this.tableData = res.data
this.tableTotal = res.count this.tableTotal = res.count
if (this.tableTotal == 0) {
this.$refs.viewCustomers.setTableHeightFun()
}
}) })
}, },
//创建人群 //创建人群
......
...@@ -7,14 +7,16 @@ import { getRoutes } from '@/router' ...@@ -7,14 +7,16 @@ import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
import GLCombiForm from '@/components/GlCombiForm'
Vue.use(GLCombiForm)
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
let routes = [] let routes = []
let router = null let router = null
let instance = null let instance = null
// http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3 // http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3
export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request,request2,request3, request4,sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch const { response, request, request2, request3, request4, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch) //globalState.configSwitch
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -24,7 +26,7 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt ...@@ -24,7 +26,7 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } }) // Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } }) // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
//Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) //Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<div class="back color-58 font-14" @click="goBack">返回人群管理</div> <div class="back color-58 font-14" @click="goBack">返回人群管理</div>
</div> </div>
<div class="main-container"> <div class="main-container">
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="tagsPartFormList" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="main-container-head flex-between"> <div class="main-container-head flex-between">
<div class="main-container-head-title color-3 font-20"> <div class="main-container-head-title color-3 font-20">
全部客户 全部客户
...@@ -46,6 +47,9 @@ ...@@ -46,6 +47,9 @@
</span> </span>
</div> </div>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="goDetail(scope.scope)" class="blue-text">详情</el-button>
</div>
</GLTable> </GLTable>
</div> </div>
</div> </div>
...@@ -53,6 +57,7 @@ ...@@ -53,6 +57,7 @@
<script> <script>
import { getCustomerList, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview' import { getCustomerList, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview'
import { getStaffList } from '@/api/modules/clientManage'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
export default { export default {
name: 'group', name: 'group',
...@@ -60,7 +65,74 @@ export default { ...@@ -60,7 +65,74 @@ export default {
return { return {
getListApi: this.$route.params.crowdType ? getcrowdManageList : getCustomerList, getListApi: this.$route.params.crowdType ? getcrowdManageList : getCustomerList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableSearchForm: {}, tableSearchForm: {
customerPhone: '',
nickName: '',
customerName: '',
followStaff: '',
audi: '',
carNumber: '',
isJoin: ''
},
tagsPartFormList: [
{
type: 'input',
name: 'carNumber',
label: '车牌号'
},
{
type: 'input',
name: 'audi',
label: '车系'
},
{
type: 'select',
name: 'followStaff',
optionId: 'value',
optionLabel: 'label',
optionList: [],
label: '跟进员工'
},
{
type: 'input',
name: 'customerPhone',
label: '联系电话'
},
{
type: 'input',
name: 'nickName',
label: '企微名称'
},
{
type: 'input',
name: 'customerName',
label: '客户名称'
},
{
type: 'select',
name: 'isJoin',
label: '是否加企微',
optionId: 'value',
optionLabel: 'label',
placeholder: '请选择',
optionList: [
{
value: '1',
label: '是'
},
{
value: '0',
label: '否'
}
]
},
{
type: 'datePicker',
name: 'createTime',
label: '购车时间',
isClear: true
}
],
crowdForm: {}, crowdForm: {},
id: this.$route.params.id ? this.$route.params.id : '', id: this.$route.params.id ? this.$route.params.id : '',
crowdType: this.$route.params.crowdType ? this.$route.params.crowdType : '', crowdType: this.$route.params.crowdType ? this.$route.params.crowdType : '',
...@@ -91,7 +163,7 @@ export default { ...@@ -91,7 +163,7 @@ export default {
prop: 'carNumber' prop: 'carNumber'
}, },
{ {
label: '车架号(后6位)', label: '车架号',
prop: 'carVin', prop: 'carVin',
minWidth: '110' minWidth: '110'
}, },
...@@ -112,9 +184,21 @@ export default { ...@@ -112,9 +184,21 @@ export default {
width: 100 width: 100
}, },
{ {
label: '购车时间',
prop: 'addTime',
width: 110
},
{
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime',
width: 150 width: 110
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
} }
] ]
}, },
...@@ -126,7 +210,42 @@ export default { ...@@ -126,7 +210,42 @@ export default {
let { id } = this let { id } = this
this.init(id) this.init(id)
}, },
mounted() {
this.getStaffList()
},
methods: { methods: {
//获取跟进员工
getStaffList() {
getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const id = this.tagsPartFormList.findIndex(item => {
return item.name == 'followStaff'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.staffName
}
})
staff.unshift({ label: '全部', value: '' })
this.$nextTick(() => {
this.tagsPartFormList[id].optionList = staff
})
console.log(this.tagsPartFormList[id])
})
},
handleSearch() {
this.$refs.groupRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
crowdId: this.id
}
this.$refs.groupRef.refreshTable()
},
init(id) { init(id) {
this.tableSearchForm = { this.tableSearchForm = {
crowdId: id crowdId: id
...@@ -137,6 +256,9 @@ export default { ...@@ -137,6 +256,9 @@ export default {
} }
// this.getTotalCount() // this.getTotalCount()
}, },
goDetail(scope) {
this.$router.push('/clientManage/clientDetail?id=' + scope.oneId)
},
getCrowdDetails() { getCrowdDetails() {
let params = { let params = {
'req.crowdId': this.id 'req.crowdId': this.id
......
...@@ -731,7 +731,7 @@ export default { ...@@ -731,7 +731,7 @@ export default {
this.$router.push({ path: '/tagsManage/index' }) this.$router.push({ path: '/tagsManage/index' })
}, },
goBack() { goBack() {
this.$router.push({ path: '/clientManage/index' }) this.$router.go(-1)
}, },
//点击添加按钮 //点击添加按钮
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<el-tree @check="checkChange" class="tag-tree" ref="tagTree" :data="labelTree" :props="defaultProps" show-checkbox node-key="id" default-expand-all :expand-on-click-node="false" :filter-node-method="filterNode"> <el-tree @check="checkChange" class="tag-tree" ref="tagTree" :data="labelTree" :props="defaultProps" show-checkbox node-key="id" default-expand-all :expand-on-click-node="false" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }"> <div class="custom-tree-node" slot-scope="{ node, data }">
<span class="tree-node">{{ node.label }}</span> <span :class="['tree-node', `node_${data.id}`]">{{ node.label }}</span>
<span v-if="data.labelType" @click="editTree(data)"> <span v-if="data.labelType && data.labelType != '系统标签' && isShowEditBtn(data.labelDTO)" @click="editTree(data)">
<i class="el-icon-edit-outline"></i> <i class="el-icon-edit-outline"></i>
</span> </span>
</div> </div>
...@@ -42,9 +42,35 @@ export default { ...@@ -42,9 +42,35 @@ export default {
}, },
methods: { methods: {
isShowEditBtn(row) {
const { userType, accountLevel, merchantModel } = this.$globalState.session
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//单店模式下,仅门店和员工可以编辑
if (row.labelType == '自店标签' && !(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))) {
return false
}
if (merchantModel == 1) {
if (accountLevel == 1 && userType == 1) {
return true
}
if (accountLevel !== 1) {
//如果是企业标签不显示
if (row.labelType == '企业标签') {
return false
}
return true
}
}
return true //门店版都显示编辑按钮
},
handleScroll(height) {
document.querySelector('.tag-tree').scrollTop = height
},
resetTree() { resetTree() {
this.$refs.tagTree.setCheckedKeys([]) this.$refs.tagTree.setCheckedKeys([])
this.$emit('getCheckItem', this.$refs.tagTree) this.$nextTick(() => {
this.$emit('getCheckItem', this.$refs.tagTree)
})
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
...@@ -66,7 +92,13 @@ export default { ...@@ -66,7 +92,13 @@ export default {
editTree(data) { editTree(data) {
this.$emit('editTag', 'edit', data.labelDTO) this.$emit('editTag', 'edit', data.labelDTO)
}, },
getTableList() { updateTreeNode() {
this.getTreeNode(this.$parent.tagCheckItem)
this.$emit('getCheckItem', this.$refs.tagTree)
},
// 获取标签树
getTableList(status) {
this.labelTree = []
let params = { let params = {
labelTreeReq: { labelTreeReq: {
pageNum: 1, pageNum: 1,
...@@ -91,7 +123,7 @@ export default { ...@@ -91,7 +123,7 @@ export default {
const index = this.labelTree.findIndex(ret => ret.name == item.labelType) const index = this.labelTree.findIndex(ret => ret.name == item.labelType)
if (index == -1) { if (index == -1) {
this.labelTree.push({ this.labelTree.push({
id: item.id + '000', id: item.labelType == '系统标签' ? 1 : item.labelType == '企业标签' ? 2 : 3,
name: item.labelType, name: item.labelType,
children: [item], children: [item],
sort: item.labelType == '系统标签' ? 1 : item.labelType == '企业标签' ? 2 : 3 sort: item.labelType == '系统标签' ? 1 : item.labelType == '企业标签' ? 2 : 3
...@@ -101,6 +133,10 @@ export default { ...@@ -101,6 +133,10 @@ export default {
} }
}) })
this.labelTree = this.labelTree.sort((a, b) => a.sort - b.sort) this.labelTree = this.labelTree.sort((a, b) => a.sort - b.sort)
this.$nextTick(() => {
status && this.updateTreeNode()
})
this.loading = false this.loading = false
}) })
} }
...@@ -113,7 +149,7 @@ export default { ...@@ -113,7 +149,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.content-wrap { .content-wrap {
padding: 16px; padding: 16px 10px 16px 16px;
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
.tree-input { .tree-input {
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="select-tag-panel" :style="{ 'max-height': tagHeight + 'px' }"> <div class="select-tag-panel" :style="{ 'max-height': tagHeight + 'px', 'margin-top': tagHeight ? '10px' : '0px' }">
<el-tag effect="plain" slot="reference" type="info" class="select-tagGroup" v-for="(item, idx) in tagCheckItem" :key="idx" closable :disable-transitions="false" @close="removeItem(idx)"> <el-tag effect="plain" slot="reference" type="info" class="select-tagGroup" v-for="(item, idx) in tagCheckItem" :key="idx" closable :disable-transitions="false" @click="treeScroll(item.id)" @close="removeItem(idx)">
<label>{{ item.name }}:</label> <label>{{ item.name }}:</label>
<template v-for="(tag, index) in item.children"> <template v-for="(tag, index) in item.children">
<div class="select-tagLabel" :key="index" v-if="tag && index < 3">{{ tag.name }}</div> <div class="select-tagLabel" :key="index" v-if="tag && index < 3">{{ tag.name }}</div>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</el-popover> </el-popover>
</el-tag> </el-tag>
</div> </div>
<div class="client-expand" v-if="tagHeight"> <div class="client-expand" v-if="tagHeightStatus">
<el-button type="text" size="small" @click="tagHeight = 0"> <el-button type="text" size="small" @click="tagHeight = 0">
<span>收起</span> <span>收起</span>
<i class="expand el-icon-arrow-up"></i> <i class="expand el-icon-arrow-up"></i>
...@@ -71,14 +71,7 @@ ...@@ -71,14 +71,7 @@
</div> </div>
</div> </div>
<div class="pageContent"> <div class="pageContent">
<!-- @setTableHeightEvent="setTableHeightEvent" --> <GLCombiForm ref="formSearch" :formObj="searchForm" :formData="tagsPartFormList" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="tagsPartFormList" @setTableHeightEvent="setTableHeightEvent" labelWidth="54px">
<span class="inline-b" slot="form-slot">
<el-button @click="resetTable" plain>重置</el-button>
<!-- :id="tableParams.btnId" -->
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<div class="clientNumExp"> <div class="clientNumExp">
<div class="clientNum"> <div class="clientNum">
<!-- {{ labelGroupName }} --> <!-- {{ labelGroupName }} -->
...@@ -104,7 +97,7 @@ ...@@ -104,7 +97,7 @@
</div> </div>
</div> </div>
<!-- noDataText="你当前还没有添加的标签" --> <!-- noDataText="你当前还没有添加的标签" -->
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="viewCustomers" :layout="layout" :hasNum="true" :tableData="tableData" :tableTotal="tableTotal" :noDataImg="url" :pageConf="pageConf" :searchForm="searchFormTable" @refreshTable="getCustomersListData" :tableParams="tableParams"> <GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="viewCustomers" :layout="layout" :hasNum="true" :tableData="tableData" :tableTotal="tableTotal" :noDataImg="url" :pageConf="pageConf" @refreshTable="getCustomersListData" :tableParams="tableParams">
<!-- 企微名称 --> <!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg"> <div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx"> <div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
...@@ -129,9 +122,9 @@ ...@@ -129,9 +122,9 @@
<span slot="isJoin" slot-scope="scope"> <span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span> <span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span> </span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span> <el-button type="text" @click="goDetail(scope.scope)" class="blue-text">详情</el-button>
</template> </div>
</GLTable> </GLTable>
</div> </div>
</div> </div>
...@@ -275,7 +268,7 @@ import { getLoginCount } from '@/api/modules/loginCount' ...@@ -275,7 +268,7 @@ import { getLoginCount } from '@/api/modules/loginCount'
import tagGroup from './components/tagGroup.vue' import tagGroup from './components/tagGroup.vue'
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/clientDataOverview/nodata.png'
import tag from '@/mixins/tag' import tag from '@/mixins/tag'
// import { debounce } from '@/utils/index' import util from '@/utils/util'
export default { export default {
mixins: [tag], mixins: [tag],
name: 'tagsManage', name: 'tagsManage',
...@@ -322,22 +315,72 @@ export default { ...@@ -322,22 +315,72 @@ export default {
numberObj: {}, numberObj: {},
url: url, url: url,
isFirstShow: false, isFirstShow: false,
searchForm: {}, searchForm: {
customerPhone: '',
nickName: '',
customerName: '',
followStaff: '',
audi: '',
carNumber: '',
isJoin: ''
},
tagsPartFormList: [ tagsPartFormList: [
{ {
type: 'input',
name: 'carNumber',
label: '车牌号'
},
{
type: 'input',
name: 'audi',
label: '车系'
},
{
type: 'select', type: 'select',
prop: 'labelTreeReq.labelTypesStr', name: 'followStaff',
label: '标签组', optionId: 'value',
placeholder: '请选择标签组类型', optionLabel: 'label',
options: this.$Constants.LABEL_OPTION optionList: [],
label: '跟进员工'
},
{
type: 'input',
name: 'customerPhone',
label: '联系电话'
}, },
{ {
type: 'input', type: 'input',
inputType: 'text', name: 'nickName',
prop: 'labelTreeReq.labelGroupName', label: '企微名称'
label: '搜索', },
placeholder: '请输入标签组或标签名称', {
clearable: true type: 'input',
name: 'customerName',
label: '客户名称'
},
{
type: 'select',
name: 'isJoin',
label: '是否加企微',
optionId: 'value',
optionLabel: 'label',
placeholder: '请选择',
optionList: [
{
value: '1',
label: '是'
},
{
value: '0',
label: '否'
}
]
},
{
type: 'datePicker',
name: 'createTime',
label: '购车时间',
isClear: true
} }
], ],
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
...@@ -365,8 +408,8 @@ export default { ...@@ -365,8 +408,8 @@ export default {
}, },
{ {
label: '车牌号', label: '车牌号',
prop: 'carNumber' prop: 'carNumber',
// width: 160 width: 90
}, },
{ {
label: '车架号', label: '车架号',
...@@ -387,12 +430,24 @@ export default { ...@@ -387,12 +430,24 @@ export default {
label: '是否加企微', label: '是否加企微',
prop: 'isJoin', prop: 'isJoin',
addHtml: 'isJoin', addHtml: 'isJoin',
minWidth: 100 minWidth: 90
},
{
label: '购车时间',
prop: 'addTime',
minWidth: 140
}, },
{ {
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime',
minWidth: 150 minWidth: 140
},
{
label: '操作',
prop: 'optionBtns',
width: '80px',
addHtml: 'optionBtns',
fixed: 'right'
} }
] ]
}, },
...@@ -516,7 +571,7 @@ export default { ...@@ -516,7 +571,7 @@ export default {
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 140 this.heightBox = clientHeight - 150
//没数据的时候要算高度 //没数据的时候要算高度
// setTimeout(() => { // setTimeout(() => {
// if (!this.$refs.tagsManage.data.length) { // if (!this.$refs.tagsManage.data.length) {
...@@ -547,12 +602,12 @@ export default { ...@@ -547,12 +602,12 @@ export default {
// return list // return list
return list.slice(0, 9) return list.slice(0, 9)
}, },
checkInputContent(e) { checkInputContent: function(e) {
console.log(e)
//确保每个输入框的内容不和已存在的编辑标签相同 //确保每个输入框的内容不和已存在的编辑标签相同
let isHasSameTag = this.editTagList.some(ele => ele.name == e) let isHasSameTag = this.editTagList.some(ele => ele.name == e)
if (isHasSameTag) { if (isHasSameTag) {
this.$message.error('不允许输入已存在的标签') // this.$message.error('不允许输入已存在的标签')
return e return e
} }
return this.$Utils.cutMaxCharStr(e) return this.$Utils.cutMaxCharStr(e)
...@@ -588,10 +643,6 @@ export default { ...@@ -588,10 +643,6 @@ export default {
setTableHeightEvent() { setTableHeightEvent() {
this.$refs.tagsManage.setTableHeightFun() this.$refs.tagsManage.setTableHeightFun()
}, },
setTableFinishFun(content) {
console.log('表格完成', this.$refs.tagsManage.data)
this.$refs.tagsManage.data.length ? (this.$refs.tagsManage.tableHeightValues = '') : this.$refs.tagsManage.setTableHeightFun()
},
getLoginCountFun() { getLoginCountFun() {
//loginType:3是查客户数据概览浏览次数 //loginType:3是查客户数据概览浏览次数
getLoginCount({ loginType: 3 }).then(res => { getLoginCount({ loginType: 3 }).then(res => {
...@@ -609,17 +660,13 @@ export default { ...@@ -609,17 +660,13 @@ export default {
}, },
//搜索表格 //搜索表格
searchTable() { handleSearch() {
this.$refs.tagsManage.refreshTable() this.getCustomersListData()
}, },
//重置表格 //重置表格
resetTable() { handleReset() {
// this.isReload = false this.getCustomersListData()
this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel } this.searchForm = {}
this.$refs.tagsManage.refreshTable()
// this.$nextTick(() => {
// this.isReload = true
// })
}, },
btnClick(pType, rowData) { btnClick(pType, rowData) {
...@@ -670,7 +717,6 @@ export default { ...@@ -670,7 +717,6 @@ export default {
this.tagForm.initTagsGroup = rowData.labelType == '企业标签' ? 1 : rowData.labelType == '自店标签' ? 2 : '' //标签组类型 this.tagForm.initTagsGroup = rowData.labelType == '企业标签' ? 1 : rowData.labelType == '自店标签' ? 2 : '' //标签组类型
}, },
handleConfirm() { handleConfirm() {
console.log(this.$refs.tagForm.$children, 'kkk')
this.$refs.tagForm.$children[0].validate(valid => { this.$refs.tagForm.$children[0].validate(valid => {
if (!valid) { if (!valid) {
if (this.tagForm.tagsList.length <= 0 && this.tagDialogTitle == '添加标签组') { if (this.tagForm.tagsList.length <= 0 && this.tagDialogTitle == '添加标签组') {
...@@ -795,7 +841,7 @@ export default { ...@@ -795,7 +841,7 @@ export default {
} }
this.handleClose() this.handleClose()
} }
this.resetTable() //刷新下表格 this.$refs.tagTree.getTableList(true) //刷新下表格
this.getTableTagNumFun() this.getTableTagNumFun()
}) })
}, },
...@@ -827,7 +873,7 @@ export default { ...@@ -827,7 +873,7 @@ export default {
// this.tagForm.initTagsGroup = '' // this.tagForm.initTagsGroup = ''
// this.tagForm.tagsList = [] // this.tagForm.tagsList = []
this.resetTable() //刷新下表格 this.$refs.tagTree.getTableList(true) //刷新下表格
}) })
}, },
//删除一行标签 //删除一行标签
...@@ -1097,6 +1143,7 @@ export default { ...@@ -1097,6 +1143,7 @@ export default {
} }
.client-tabel { .client-tabel {
flex: 1; flex: 1;
overflow: hidden;
.client-expand { .client-expand {
text-align: center; text-align: center;
} }
...@@ -1125,7 +1172,6 @@ export default { ...@@ -1125,7 +1172,6 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
font-size: 14px; font-size: 14px;
margin-top: 10px;
transition: all 0.3s linear; transition: all 0.3s linear;
overflow-y: auto; overflow-y: auto;
.select-tagGroup { .select-tagGroup {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!