Commit f930edeb by chenwq

删除无用代码

1 parent 8e660053
<template> <template>
<div class="select-cutomer"> <div class="select-cutomer">
<el-dialog title="选择客户" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false"> <el-dialog title="选择客户" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false">
<!-- <div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div> -->
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer"> <span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
...@@ -9,15 +8,6 @@ ...@@ -9,15 +8,6 @@
</glsx-combi-form> </glsx-combi-form>
<div class="flex-default"> <div class="flex-default">
<div class="customer-list"> <div class="customer-list">
<!-- <div class="customer-tag-box">
<span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span>
<span v-for="(tag, idx) in selectedLabelList" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span>
</div>
</div> -->
<p class="list-title p-16">客户列表(最多仅可选200个客户)</p> <p class="list-title p-16">客户列表(最多仅可选200个客户)</p>
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable> <GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable>
</div> </div>
...@@ -32,7 +22,6 @@ ...@@ -32,7 +22,6 @@
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="handleClose">取 消</el-button> <el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button> <el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span> </span>
...@@ -169,30 +158,6 @@ export default { ...@@ -169,30 +158,6 @@ export default {
}, },
methods: { methods: {
// beforeSearchFn() {
// return new Promise(resolve => {
// this.searchForm = {
// combineType: 2,
// tagLists: []
// }
// this.selectedLabelList.length &&
// this.selectedLabelList.forEach(item => {
// item.labelList.length &&
// item.labelList.forEach(subItem => {
// this.searchForm.tagLists.push({
// groupId: item.labelGroup.id,
// groupName: item.labelGroup.name,
// groupType: item.labelType,
// labelId: subItem.id,
// labelName: subItem.name
// })
// })
// })
// this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
// resolve()
// })
// },
handleSearch() { handleSearch() {
this.$refs.customerRef.refreshTable() this.$refs.customerRef.refreshTable()
}, },
...@@ -228,10 +193,6 @@ export default { ...@@ -228,10 +193,6 @@ export default {
}, },
handleSelectionTable(val) { handleSelectionTable(val) {
// 未选客户时,筛选客户条件
// if (!this.selectedCustomerList.length) {
// this.dealCondLimit(val[0])
// }
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList)) let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id) let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val)) this.selectedCustomerList = JSON.parse(JSON.stringify(val))
......
<template>
<div class="tag-main">
<el-dialog :title="activeName == 'tag' ? '选择标签' : '选择客户'" :visible.sync="dialogVisible" width="1080px" :before-close="handleClose">
<div v-if="activeName == 'tag'" class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容" clearable @keydown.enter.native="handleSearch"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click.self="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
{{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-if="item.checked" @change="handleCheckedTag">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
<!-- <el-radio :label="itm">{{ itm.name.length > 4 ? itm.name.slice(0, 3) + '...' : itm.name }}</el-radio> -->
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-radio-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRetSelect">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="customer-tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name.length > 11 ? item.tagChecked.name.slice(0, 11) + '...' : item.tagChecked.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<select-customer v-if="activeName == 'customer'" ref="customerRef" :selectedLabelList="selectedLabelList" :condLimitObj.sync="condLimitObj" :selectedCustomerList.sync="selectedCustomerList" @handleChangeTag="handleChangeTag"></select-customer>
<span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
import selectCustomer from './selectCustomer.vue'
export default {
name: 'activityModel',
data() {
return {
activeName: 'tag',
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: [
// {
// labelGroup: { id: '109', name: '湖口123' },
// labelList: [
// { id: '372', name: '12345678' },
// { id: '371', name: '7654321' },
// { id: '370', name: '1234567' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// },
// {
// labelGroup: { id: '65', name: '自店标签111' },
// labelList: [
// { id: '179', name: '标签44' },
// { id: '178', name: '标签33' },
// { id: '176', name: '标签1112' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// }
],
selectedLabelList: [],
selectedCustomerList: []
}
},
components: {
selectCustomer
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelType = []
this.labelTreeRetSelect.forEach(item => {
if (item.tagChecked) {
this.selectNum++
if (!this.labelType.includes(item.labelType)) {
this.labelType.push(item.labelType)
}
}
})
this.$nextTick(() => { })
},
deep: true
}
},
methods: {
// 选择标签
handleCheckedTag() {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(tag => {
if (tag.labelGroup.id == item.labelGroup.id && item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index]
}
})
})
},
isLabelType(label) {
return this.labelType.length > 0 && !this.labelType.includes(label)
},
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
handleChangeTag(item) {
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : []
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.activeName = item.activeName
},
init(item) {
this.labelGroupName = ''
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : []
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.querylabeltree(item.tagList)
this.labelTreeRetSelect = item.tagList
this.selectedLabelList = item.tagList
this.activeName = item.activeName
this.dialogVisible = true
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
// console.log(selectItem, '-----')
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
// shopId: '44210934',
labelGroupName: this.labelGroupName,
// labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
// edition: 4
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelId = item.labelList[0].id
let index = tag.labelList.findIndex(iem => iem.id == labelId)
// tag.tagChecked = item.tagChecked
tag.tagChecked = tag.labelList[index]
}
})
})
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
} else {
// this.labelTreeRets = res.labelTreeRets.map(item => {
// return {
// labelType: item.labelType,
// labelGroup: item.labelGroup,
// labelList: item.labelList,
// checked: false,
// tagChecked: null,
// isIndeterminate: false,
// checkAll: false
// }
// })
const labelTreeRets = utils.deepClone(this.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
this.labelTreeRetSelect.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (tag.labelGroup.id == item.labelGroup.id && item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index]
}
})
})
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
}
})
},
remove(item, idx) {
item.tagChecked = null
this.labelTreeRetSelect.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (tag.labelGroup.id == item.labelGroup.id) {
if (item.tagChecked) {
let labelId = item.tagChecked ? item.tagChecked.id : ''
let index = tag.labelList.findIndex(iem => iem.id == labelId)
tag.tagChecked = tag.labelList[index]
} else {
tag.tagChecked = null
}
// }
}
})
})
},
handleClose() {
this.activeName = 'tag'
this.dialogVisible = false
},
//选中
handleSelect() {
this.selectedLabelList = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
// console.log(this.selectedLabelList)
// 标签
if (this.activeName == 'tag') {
this.activeName = 'customer'
return false
}
// 客户
this.activeName = 'tag'
this.$emit('tagSelected', { selectedLabelList: [], selectedCustomerList: this.$refs.customerRef.selectedCustomerList, condLimitObj: this.$refs.customerRef.condLimitObj })
this.dialogVisible = false
},
handleReset() {
this.labelGroupName = ''
this.querylabeltree()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
// ::v-deep .el-tag{
// color: red !important;
// }
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.customer-tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: auto !important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 26px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-radio {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner {
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
}
}
}
.checkbox-group-box {
overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
}
.tag-selected-box {
min-height: 200px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!