Commit 91370589 by 前端

Merge branch 'v3.18.0' of http://192.168.3.233:8090/saas/scrm-micro-custom into v3.20.0_10

 Conflicts:
	package.json
	src/assets/css/public.scss
2 parents 6427f9c2 d59ee01a
Showing 73 changed files with 11737 additions and 149 deletions
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
"vue-animate-number": "^0.4.2", "vue-animate-number": "^0.4.2",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.15", "xlsx": "^0.18.5"
"word-edit": "^1.2.7"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
......
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const importsUpload = params => {
params.method = 'entmicro.api.imports.upload'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const downloadModel = params => {
params.method = 'entmicro.api.imports.download.model'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantConfig = params => {
params.method = 'entmicro.api.datacube.merchant.config'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const datacubeUpload = params => {
params.method = 'entmicro.api.datacube.upload'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsRecord = params => {
params.method = 'entmicro.api.datacube.log.page'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const datacubeNotice = params => {
params.method = 'entmicro.api.datacube.notice.pc'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsCount = params => {
params.method = 'entmicro.api.imports.count'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsKey = params => {
params.method = 'entmicro.api.imports.record.key'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const findLoginCount = params => {
params.method = 'entmicro.api.common.findLoginCount'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdTree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
importsUpload,
downloadModel,
importsRecord,
importsCount,
importsKey,
findLoginCount,
datacubeUpload,
merchantConfig,
datacubeNotice,
queryCrowdTree
}
...@@ -20,29 +20,9 @@ ...@@ -20,29 +20,9 @@
.el-tag.el-tag--info.el-tag--plain { .el-tag.el-tag--info.el-tag--plain {
background: transparent !important; background: transparent !important;
} }
.live-room .container { .scrm-box-f {
background: #ffffff; background: #ffffff;
padding: 20px; box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
}
.live-room .container-nop {
background: #ffffff;
}
.live-room .m-b-20 {
margin-bottom: 20px;
}
.live-room .m-t-20 {
margin-top: 20px;
}
.border-title {
height: 56px;
background: #ffffff;
padding: 20px;
box-sizing: border-box;
font-weight: 600;
font-size: 16px;
color: #333333;
border-bottom: 1px solid #e5e5e5;
} }
// ::-webkit-scrollbar { // ::-webkit-scrollbar {
// /*滚动条整体样式*/ // /*滚动条整体样式*/
...@@ -74,10 +54,7 @@ ...@@ -74,10 +54,7 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.is_error{
color: #f56c6c;
font-size: 12px;
}
.color-6 { .color-6 {
color: #666666; color: #666666;
} }
......
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div 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" v-loading="loading" :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 :disabled="isLabelType(item.labelType)" 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="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<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="dialogVisible = false">取 消</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'
export default {
name: 'activityModel',
data() {
return {
loading: false,
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
// }
]
}
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelType = []
console.log(new Date())
this.labelTreeRetSelect.forEach(item => {
if (item.tagChecked) {
this.selectNum++
if (!this.labelType.includes(item.labelType)) {
this.labelType.push(item.labelType)
}
}
})
this.$nextTick(() => {
console.log(new Date())
})
},
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
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.channel
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem) {
console.log(res.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : 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)
console.log(index)
// 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 == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : 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]
// }
}
})
})
// labelTreeRets.forEach(item => {
// this.labelTreeRets.forEach(tag => {
// if (item.labelGroup.id == tag.labelGroup.id) {
// 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)
}
}
this.$nextTick(() => {
this.loading = false
})
})
},
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
}
}
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagScreened', labelTreeRets)
},
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;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
// 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__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;
overflow-y: auto;
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-06-14 18:21:41
-->
<template>
<div>
<el-dialog :title="'人群筛选'" :width="'1080px'" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">人群({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
data() {
return {
url: 0,
crowdVisible: false,
searchForm: { keyword: '' },
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
// console.log(val)
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
// this.$refs.crowdTable.tableHeightValues = '250'
getCrowdList(page = { pageNum: 1, pageSize: 10 }) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.channel.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({ pageNum: 1, pageSize: 10 })
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = { keyword: {} }
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 500px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div 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="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-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">
<template v-for="(tag, idx) in item.tagChecked">
<el-tag :title="tag.name" type="info" class="tag-selected-item" :key="idx" v-if="tag" closable :disable-transitions="false" @close="remove(item, idx)">
{{ tag.name }}
</el-tag>
</template>
</template>
</div>
</div>
</div>
</div>
<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'
export default {
name: 'activityModel',
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: []
}
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelTreeRetSelect.forEach(item => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.channel
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelList = []
item.labelList.forEach(x => {
labelList.push(x.id)
})
this.$nextTick(() => {
tag.tagChecked = tag.labelList.filter(i => labelList.includes(i.id))
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
this.labelTreeRets.forEach((item, index) => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id && itm.tagChecked.length > 0) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
this.$nextTick(() => {
this.handleCheckedChange(itm.tagChecked, index, 1)
})
}
})
})
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
}
this.$nextTick(() => {
this.loading = false
})
})
},
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
}
if (item.tagChecked.length == 0) {
this.$nextTick(() => {
item.checkAll = false
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked.length) {
return {
labelGroup: item.labelGroup,
labelList: item.tagChecked
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
//全选
handleCheckAllChange(val, index) {
if (val) {
this.labelTreeRets[index].tagChecked = []
this.labelTreeRets[index].labelList.forEach(item => {
this.labelTreeRets[index].tagChecked.push(item)
})
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
},
//选中
handleCheckedChange(value, index, status) {
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
if (!status) {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.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;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
display: flex;
flex-wrap: wrap;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
min-height: 200px;
}
</style>
...@@ -26,9 +26,10 @@ import VueAnimateNumber from 'vue-animate-number' ...@@ -26,9 +26,10 @@ import VueAnimateNumber from 'vue-animate-number'
Vue.use(VueAnimateNumber) Vue.use(VueAnimateNumber)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.use(glsxTable) Vue.use(glsxTable)
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
// Vue.prototype.btn_size = 'mini' // Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants Vue.prototype.$Constants = Constants
......
export default {
data() {
return {}
},
methods: {
uploadAvatar(e) {
this.uploadFile(e, 'avatar')
},
uploadQrcode(e) {
this.uploadFile(e, 'qrcode')
},
getUploadName(name) {
let nameArr = name.split('.')
let lastName
while (nameArr.length) {
lastName = [nameArr[0]]
nameArr.unshift()
}
},
uploadFile(e, refName, AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf') {
const file = e.srcElement.files[0]
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
if (res) {
if (!this.addCodeForm.headerSrc) {
this.addCodeForm.image = res
this.hasImage = true
} else {
this.addCodeForm.headerSrc = res
}
}
this.$refs[refName].value = ''
})
}
}
}
}
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7,
MATERIAL: 10
}
export default {
data() {
return {
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
// limitPx: 1555200,
// togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
// limitSize: 10, //限制图片大小
// limitNum: 2, //限制图片数量
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
// Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload
},
// {
// name: '视频',
// funcName: '',
// type: 'video',
// limitSize: 10, //限制视频大小
// togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
// isReplace: 1, //限制视频数量
// limitWidth: 1280, //限制视频宽度
// limitHeight: 720, //限制视频高度
// limitTime: 30, //限制视频时长
// uploadApi: this.$apis.common.pictureUpload
// },
{
name: '昵称',
type: 'nickname',
funName: 'nickname'
},
{
name: '活动',
type: 'activity',
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {
state: 1
}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid',
status: 2
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.welcomeword.merchant,
merchantOpen: {
merchantOpenApi: this.$apis.welcomeword.merchantOpen,
params: {
merchantId: this.$globalState.session.merchantId
}
},
params: {
merchantId: this.$globalState.session.merchantId
}
}
]
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi,
params: { createdType: 2 }
// fileType: 1
// videoNo: true,
// pdfNo: true
}
// {
// name: '插入推荐频道',
// type: 'channelLink',
// funName: 'channelLink',
// getMerchantList: this.$apis.welcomeword.getMerchantList,
// channelPreview: this.$apis.welcomeword.channelPreview
// }
]
}
}
}
import MD5 from 'md5'
var w = {}
let uploadInfo = {}
let that = {}
const options = {
showprocess: true,
action: '',
tips: '',
size: 2,
url: '',
success: ''
}
that.config = {
id: '',
token: '',
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
url: 'http://qcdidicb.glsx.com.cn:7060/router',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}
/**
* 参数序列化
*/
uploadInfo.formRequestData = function(data) {
var _sendstr = null
if (data) {
_sendstr = ''
for (var i in data) {
_sendstr += (_sendstr ? '&' : '') + i + '=' + encodeURIComponent(data[i])
}
}
return _sendstr
}
/**
* 检查文件是否上传
*/
/**
* 文件切片
*/
uploadInfo.fileSlice = function(oParams) {
if (!oParams) {
return false
}
var o = options
var file = oParams.file
var cellBlod = []
var cell = Number(o.size) * 1024 * 1024 //单个分片的大小
var size = oParams.size //文件大小
var num = Math.ceil(size / cell) //计算分片的个数
if (num == 1) {
cellBlod.push(file)
} else {
for (var i = 0; i < num; i++) {
var s = i * cell
var e = (i + 1) * cell
var m = ''
if (file.slice) {
m = file.slice(s, e)
}
//兼容firefox
if (file.mozSlice) {
m = file.mozSlice(s, e)
}
// 兼容webkit
if (file.webkitSlice) {
m = file.webkitSlice(s, e)
}
cellBlod.push(m)
}
}
return cellBlod
}
/**
* 获取文件类型
*/
uploadInfo.getFileType = function(file) {
if (!file) {
return false
}
var arr = file.split('.')
return arr[arr.length - 1]
}
/**
* arrbuffer转换成base64
*/
uploadInfo.transformArrayBufferToBase64 = function(buffer) {
var binary = ''
var bytes = new Uint8Array(buffer)
for (var len = bytes.byteLength, i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i])
}
return window.btoa(binary)
}
/**
* 生成签名
*/
uploadInfo.createSign = function(params) {
var secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
var noSignAttr = []
delete params.sign
noSignAttr.push('refreshTable')
var keys = Object.keys(params).sort()
var str = []
var obj = null
for (const key in params) {
obj = params[key]
if (obj === null || obj === undefined) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
/**
* 获取参数
*/
uploadInfo.getParams = function(index, oInfo) {
var o = that.options
var k = that.config
var oParams = {}
var len = w.list.length
var size = Number(o.size * 1024 * 1024)
// console.log(o.size)
// console.log(w);
// console.log('个数:' + w.list.length);
// console.log('当前个数' + index)
if (len > 1 && index == len - 1) {
size = w.fileSize - o.size * 1024 * 1024 * (w.list.length - 2)
}
//只有一个分片
if (w.list.length == 1) {
size = w.fileSize
}
var spark = new MD5()
spark.append(oInfo)
oParams.app_key = k.app_key
oParams.v = k.v
oParams.timestamp = new Date().getTime()
oParams.format = k.format
oParams.source = '2323242323'
oParams.method = 'glsx.accounts.biz.common.uploadFileWithFileInfo'
oParams.token = w.token
oParams.number = index + 1
oParams.fileType = w.fileType
oParams.fileName = w.fileName
oParams.fileSize = w.fileSize
oParams.fileFragmentSize = size
oParams.fileUpSum = w.list.length
oParams.fileMD5 = w.fileMD5
oParams.fragmentMD5 = spark.end()
// for (let k in m) {
// oParams.append(k, m[k]);
// }
return uploadInfo.createSign(oParams)
}
export default uploadInfo
<template>
<div class="square-main">
<div class="drainage-wrap scrm-box-f">
<div class="drainage-title" v-if="configType">客户资料跟进</div>
<div class="drainage-title" v-else>批量加好友</div>
<div class="drainage-panel">
<div class="drainage-config-wrap">
<div class="drainage-item-label" v-if="configType">平台将识别尚未补充联系方式的企微客户,并自动发送消息提醒对应员工跟进。</div>
<div class="drainage-item-label" v-else>通过数据魔方导入客户数据后,平台将识别尚未添加企微的客户,并自动发送消息提醒对应员工跟进。</div>
<div class="drainage-item-switch">
<el-switch v-model="addValue" @change="handleAddSwitch" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
</div>
<div class="config-title">
<el-button type="primary" icon="el-icon-edit-outline" size="small" v-if="!editStatus && !configType" @click="editStatus = true">编辑配置</el-button>
</div>
<div class="config-market" v-if="configType">
<div class="config-market-item checked">
<div class="config-market-title">首次提醒</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">信息缺失的企微客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon2.png" />
</div>
<div class="config-market-name">添加客户10天后尚未补充联系方式</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon3.png" />
</div>
<div class="config-market-name">首次提醒</div>
</div>
</div>
</div>
<div class="config-market-item checked">
<!-- <el-switch
v-model="remindValue"
active-color="#5850FF"
inactive-color="#999999"
class="config-switch-icon"
></el-switch> -->
<div class="config-market-title">重复提醒</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">信息缺失的企微客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon6.png" />
</div>
<div class="config-market-name">每周一</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon5.png" />
</div>
<div class="config-market-name">再次提醒</div>
</div>
</div>
</div>
</div>
<div class="config-market" v-else>
<div class="config-market-item checked">
<div class="config-market-title">首次提醒</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">未添加企微的客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon2.png" />
</div>
<div class="config-market-name">魔方导入客户数据后3天后</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon3.png" />
</div>
<div class="config-market-name">首次提醒</div>
</div>
</div>
</div>
<div class="config-market-item checked">
<!-- <el-switch
v-model="remindValue"
active-color="#5850FF"
inactive-color="#999999"
class="config-switch-icon"
></el-switch> -->
<div class="config-market-title">重复提醒</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">未添加企微的客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon6.png" />
</div>
<div class="config-market-name">每周一</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon5.png" />
</div>
<div class="config-market-name">再次提醒</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="drainage-wrap scrm-box-f" v-if="!configType">
<div class="drainage-title">营销配置</div>
<div class="drainage-form">
<div class="drainage-form-item el-form-item is-required" v-if="editStatus">
<label class="el-form-item__label">跟进员工</label>
<div style="position: relative">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="drainage-coutom-count">已经选择{{ staffIds.length }}人</span>
<div class="el-input-tag input-tag-wrapper" v-if="editStatus && staffIds.length">
<el-tag effect="plain" type="info" v-for="(tag, idx) in staffIds" :key="idx" closable :disable-transitions="false" @close="remove(idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
<div class="el-form-item__error" v-if="imNameStatus">请选择跟进专员</div>
</div>
</div>
<div class="drainage-form-item" v-else>
<label>跟进员工</label>
<div class="drainage-emp">
<div class="emp-tag" :key="index" v-for="(item, index) in staffIds">
<i class="el-icon-user-solid"></i>
{{ item.staffName }}
</div>
</div>
</div>
</div>
</div>
<div
v-if="(editStatus && !configType) || configType"
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSave" v-if="!configType">确定</el-button>
<el-button type="primary" @click="goback" v-if="configType">返回</el-button>
<el-button @click="handleCancel" v-if="!configType">取消</el-button>
</div>
<select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp>
</div>
</template>
<script>
import selectEmp from '@/components/selectEmp'
export default {
name: 'friends',
components: {
selectEmp
},
data() {
return {
imNameStatus: false,
noStatus: false,
editStatus: false,
configType: false,
configItem: {},
footerLeft: 0,
footerWidth: 0,
dialogVisible: true,
addValue: false,
remindValue: false,
staffIds: []
}
},
watch: {
$route: {
handler(newRouter) {
this.init()
}
}
},
methods: {
goback() {
this.$router.push('/square/index')
},
handleAddSwitch() {
if (this.noStatus) {
this.handleSwitch()
return
}
if (this.addValue) {
this.handleSwitch()
} else {
this.$alert('系统将停止此类营销,营销配置仍然保留', '提示', {
showConfirmButton: false,
center: true
}).catch(action => {
this.handleSwitch()
})
}
},
handleSwitch() {
let params = {
id: this.configItem.id,
delFlag: this.addValue ? 0 : 1,
configType: this.configType ? 2 : 1
}
let config
if (this.configItem.id) {
config = 'updateConfig'
} else {
config = 'addConfig'
}
this.$apis.marketing[config](params).then(res => {
if (res) {
this.$message({
message: '操作成功',
type: 'success'
})
}
})
},
remove(index) {
this.staffIds.splice(index, 1)
},
selectTable(item) {
this.staffIds = item.map(item => {
return {
staffId: item.relationId,
staffName: item.staffName
}
})
},
handleAddEmp() {
this.imNameStatus = false
this.$refs.selectEmpForm.init(this.staffIds)
},
handleCancel() {
this.init()
},
handleSave() {
if (this.editStatus && this.staffIds && this.staffIds.length == 0) {
this.imNameStatus = true
return
}
let params = {
configType: this.configType ? 2 : 1,
id: this.configItem.id,
staffIds: this.configType ? null : JSON.stringify(this.staffIds)
}
let config
if (this.configItem.id) {
config = 'updateConfig'
params.delFlag = this.addValue ? 0 : 1
} else {
config = 'addConfig'
}
this.$apis.marketing[config](params).then(res => {
if (res) {
this.$message({
message: '操作成功',
type: 'success'
})
this.editStatus = false
this.init()
}
})
},
findConfig(configType) {
this.$apis.marketing.findConfig({ configType }).then(res => {
if (res) {
this.configItem = res
this.addValue = res.delFlag == 0 ? true : false
this.staffIds = res.staffIds ? eval(res.staffIds) : []
}
})
},
findAllByPage() {
this.$apis.marketing.findAllByPage({ pageSize: 1, pageNum: 1 }).then(res => {
if (res.data && res.data.length) {
this.noStatus = true
}
})
},
init() {
this.editStatus = false
this.findAllByPage()
let { id } = this.$route.params
if (id) {
this.configType = true
this.findConfig(2)
} else {
this.findConfig(1)
this.configType = false
}
},
resize() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}
},
mounted() {
this.resize()
this.init()
window.addEventListener('resize', () => {
this.resize()
})
}
}
</script>
<style lang="scss" scoped>
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.drainage-wrap {
margin-bottom: 20px;
.drainage-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.drainage-form {
padding: 20px;
.drainage-form-item {
display: flex;
label {
width: 120px;
text-align: right;
margin-right: 20px;
height: 36px;
line-height: 36px;
font-size: 16px;
}
}
.drainage-emp {
display: flex;
margin-top: 6px;
flex-wrap: wrap;
div {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
i {
color: #75acff;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.drainage-coutom-count {
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 36px;
margin-left: 20px;
}
}
.drainage-panel {
padding: 20px;
.drainage-config-wrap {
display: flex;
justify-content: space-between;
align-items: center;
.drainage-item-label {
width: 50%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.config-title {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 40px;
height: 40px;
margin: 8px 0px;
span {
cursor: pointer;
}
i {
margin-left: 6px;
}
}
.config-market {
display: flex;
&-item {
position: relative;
padding: 10px;
width: 50%;
height: 160px;
background: #f6f6ff;
border-radius: 4px;
opacity: 0.8;
box-sizing: border-box;
&:first-child {
margin-right: 20px;
}
&.checked {
border: 1px solid #5850ff;
.config-market-title {
color: #5850ff;
}
.config-market-icon {
background: linear-gradient(153deg, #8085ef 0%, #6f76ee 100%, #6f76ee 100%) !important;
}
.config-market-name {
color: #333333 !important;
}
.config-line {
border: 1px solid #5850ff !important;
}
}
.config-market-title {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
text-align: center;
}
.config-switch-icon {
position: absolute;
right: 10px;
top: 10px;
}
.config-market-select {
display: flex;
.config-market-s1 {
width: 33.33%;
margin: 0 auto;
text-align: center;
position: relative;
.config-line {
position: absolute;
top: 45px;
right: -30%;
width: 60%;
border: 1px solid #999999;
}
.config-market-icon {
width: 56px;
height: 56px;
background: #999999;
border-radius: 50%;
margin: 20px auto 10px;
}
.config-market-name {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 20px;
}
}
}
}
}
}
}
</style>
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<div class="title">基础信息</div> <div class="title">基础信息</div>
<div class="info-box"> <div class="info-box">
<div class="info-content"> <div class="info-content">
<div class="tips-text"> <!-- <div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt /> <img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span>企业主体信息需要认证,才可使用该功能。</span> <span>企业主体信息需要认证,才可使用该功能。</span>
</div> </div> -->
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px"> <el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px">
<el-form-item label="自定义群名" prop="groupName"> <el-form-item label="自定义群名" prop="groupName">
<el-input v-model.trim="basicForm.groupName" size="small" placeholder="为群聊设个自定义组名,如“VIP服务群”" maxlength="10"></el-input> <el-input v-model.trim="basicForm.groupName" size="small" placeholder="为群聊设个自定义组名,如“VIP服务群”" maxlength="10"></el-input>
...@@ -87,19 +87,15 @@ ...@@ -87,19 +87,15 @@
</div> </div>
</div> </div>
</div> </div>
<div <GLFooter>
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCancel">取消</el-button>
</div> <el-button type="primary" @click="handleSubmit">确定</el-button>
</GLFooter>
<GLDialog :title="'选择成员'" :visible.sync="membersVisible"> <GLDialog :title="'选择成员'" :visible.sync="membersVisible">
<!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> --> <!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<div style="width:100%;overflow:hidden">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :followData="followData"></SelectMember> <SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :followData="followData"></SelectMember>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="membersVisible = false">取消</el-button> <el-button plain size="small" class="btn-three" @click="membersVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button> <el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
...@@ -126,7 +122,6 @@ export default { ...@@ -126,7 +122,6 @@ export default {
}, },
data() { data() {
const validatorUser = (rule, value, callback) => { const validatorUser = (rule, value, callback) => {
const followList = this.basicForm.followList const followList = this.basicForm.followList
let userList = [] let userList = []
if (this.basicForm.userList && this.basicForm.userList.length) { if (this.basicForm.userList && this.basicForm.userList.length) {
...@@ -138,7 +133,6 @@ export default { ...@@ -138,7 +133,6 @@ export default {
if (!this.basicForm.followList.length) { if (!this.basicForm.followList.length) {
callback(new Error('请选择跟进专员')) callback(new Error('请选择跟进专员'))
} else { } else {
if (userList.length < 2) { if (userList.length < 2) {
this.$message({ this.$message({
type: 'error', type: 'error',
...@@ -215,6 +209,9 @@ export default { ...@@ -215,6 +209,9 @@ export default {
followVisible: false followVisible: false
} }
}, },
beforeDestroy() {
this.$message.closeAll()
},
watch: { watch: {
basicForm: { basicForm: {
handler(val) { handler(val) {
...@@ -230,6 +227,7 @@ export default { ...@@ -230,6 +227,7 @@ export default {
// } // }
}, },
mounted() { mounted() {
this.wxTips()
if (this.$route.params) { if (this.$route.params) {
const id = this.$route.params.id const id = this.$route.params.id
if (id != -1) this.getDetail(id) if (id != -1) this.getDetail(id)
...@@ -240,6 +238,31 @@ export default { ...@@ -240,6 +238,31 @@ export default {
this.boxHeight = clientHeight - 200 this.boxHeight = clientHeight - 200
}, },
methods: { methods: {
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.groupGuest.getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
},
jumpWx() {
this.$history.push('/settings/enterpriseWechat/index')
},
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
}, },
...@@ -341,7 +364,6 @@ export default { ...@@ -341,7 +364,6 @@ export default {
} }
}, },
remove(val, idx) { remove(val, idx) {
if (this.$refs.membersForm) { if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val) this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags) this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
...@@ -384,7 +406,7 @@ export default { ...@@ -384,7 +406,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
.container { .container {
margin-bottom: 84px; margin-bottom: 20px;
background: #ffffff; background: #ffffff;
// padding: 20px; // padding: 20px;
...@@ -426,17 +448,7 @@ export default { ...@@ -426,17 +448,7 @@ export default {
margin-right: 24px; margin-right: 24px;
} }
} }
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 120px;
width: 100%;
// background: #ffffff;
// box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.label-text { .label-text {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
......
...@@ -8,42 +8,13 @@ ...@@ -8,42 +8,13 @@
<div class="member-content"> <div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent> <el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;"> <el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover <el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
ref="popover" <el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
placement="bottom" <el-input v-model="searchForm.department" slot="reference" :size="size" readonly placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
width="215"
trigger="click"
v-model="popoverVisible"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
class="select-tree"
:data="treeData"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick"
></el-tree>
<el-input
v-model="searchForm.department"
slot="reference"
:size="size"
readonly
placeholder="请选择所在门店/部门"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
@keyup.enter.native="search"
></el-input>
</el-popover> </el-popover>
</el-form-item> </el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;"> <el-form-item label="姓名" style="margin-bottom: 0;">
<el-input <el-input :size="size" v-model.trim="searchForm.name" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
:size="size"
v-model.trim="searchForm.name"
@keyup.enter.native="search"
clearable
placeholder="请输入姓名搜索"
></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item> <!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox> <el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
...@@ -53,21 +24,10 @@ ...@@ -53,21 +24,10 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="table-content"> <div class="table-content">
<GLTable <GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
:key="key"
v-loading="loading"
ref="empTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
:noDataImg="url"
@selectionTable="selectionTable"
@row-click="rowClick"
>
<div slot="staffName" slot-scope="scope"> <div slot="staffName" slot-scope="scope">
<span>{{scope.scope.staffName}}</span> <span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{scope.scope.staffTitle}}</span> <span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div> </div>
</GLTable> </GLTable>
</div> </div>
...@@ -78,17 +38,10 @@ ...@@ -78,17 +38,10 @@
</div> </div>
<div class="member-right"> <div class="member-right">
<div class="member-title">已选</div> <div class="member-title">已选</div>
<div class="member-name">成员名称({{innerTags.length}}项)</div> <div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper"> <div class="input-tag-wrapper">
<div class="tag-box"> <div class="tag-box">
<el-tag <el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<!-- <i class="el-icon-user-solid"></i> --> <!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" /> <img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }} {{ tag.staffName }}
...@@ -146,7 +99,6 @@ export default { ...@@ -146,7 +99,6 @@ export default {
}, },
mounted() { mounted() {
this.listDepartmentTree() this.listDepartmentTree()
}, },
methods: { methods: {
selectionTable(val) { selectionTable(val) {
...@@ -180,7 +132,7 @@ export default { ...@@ -180,7 +132,7 @@ export default {
this.allTreeData = this.getEmployee(res) this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res) this.currentTreeData = this.getEmployee(res)
this.treeData = res this.treeData = res
this.tableEmpData.length ? (this.$refs.empTable.tableHeightValues = '250px') : this.$refs.empTable.setTableHeightFun() // this.tableEmpData.length && (this.$refs.empTable.tableHeightValues = '250px')
if (this.selectData && this.selectData.length) { if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => { this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
...@@ -298,6 +250,7 @@ export default { ...@@ -298,6 +250,7 @@ export default {
} }
} }
.member-wrapper { .member-wrapper {
width: 100%;
display: flex; display: flex;
.member-title { .member-title {
font-size: 16px; font-size: 16px;
...@@ -312,8 +265,6 @@ export default { ...@@ -312,8 +265,6 @@ export default {
} }
} }
.member-left { .member-left {
width: 800px;
.member-content { .member-content {
border: 1px solid #eee; border: 1px solid #eee;
.member-form { .member-form {
......
...@@ -147,14 +147,12 @@ export default { ...@@ -147,14 +147,12 @@ export default {
} }
}, },
mounted() { mounted() {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
// this.updateList(this.previewList) // this.updateList(this.previewList)
// obj.init('video') // obj.init('video')
}, },
methods: { methods: {
handleImgChange(e, targetItem) { handleImgChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
...@@ -170,12 +168,10 @@ export default { ...@@ -170,12 +168,10 @@ export default {
var image = new Image() var image = new Image()
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.IMAGE, attType: ATT_TYPE.IMAGE,
attContent: res attContent: res
...@@ -198,10 +194,9 @@ export default { ...@@ -198,10 +194,9 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.VEDIO, attType: ATT_TYPE.VEDIO,
attContent: res attContent: res
...@@ -227,11 +222,10 @@ export default { ...@@ -227,11 +222,10 @@ export default {
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$set(this.appletForm, 'picUrl', 'dfasdfasfa') this.$set(this.appletForm, 'picUrl', 'dfasdfasfa')
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.$set(this.appletForm, 'picUrl', res) this.$set(this.appletForm, 'picUrl', res)
} }
}) })
...@@ -239,7 +233,6 @@ export default { ...@@ -239,7 +233,6 @@ export default {
} }
}, },
switchDailog(funName) { switchDailog(funName) {
if (funName == 'link') { if (funName == 'link') {
this.dialogTitle = '添加网页消息' this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') { } else if (funName == 'applet') {
...@@ -253,7 +246,6 @@ export default { ...@@ -253,7 +246,6 @@ export default {
case '添加网页消息': case '添加网页消息':
this.$refs.linkForm.validate(valid => { this.$refs.linkForm.validate(valid => {
if (valid) { if (valid) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.URL, attType: ATT_TYPE.URL,
attContent: this.linkForm attContent: this.linkForm
...@@ -264,16 +256,13 @@ export default { ...@@ -264,16 +256,13 @@ export default {
// this.linkForm = {} // this.linkForm = {}
// this.$refs.linkForm.clearValidate() // this.$refs.linkForm.clearValidate()
} else { } else {
return false return false
} }
}) })
break break
case '添加小程序': case '添加小程序':
this.$refs.appletForm.validate(valid => { this.$refs.appletForm.validate(valid => {
if (valid) { if (valid) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM, attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm attContent: this.appletForm
...@@ -283,23 +272,19 @@ export default { ...@@ -283,23 +272,19 @@ export default {
// this.appletForm = {} // this.appletForm = {}
// this.$refs.appletForm.clearValidate() // this.$refs.appletForm.clearValidate()
} else { } else {
return false return false
} }
}) })
break break
default: default:
} }
}, },
close(index) { close(index) {
// this.previewList // this.previewList
this.previewList.splice(index, 1) this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
textInput(val) { textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (hasText) {
...@@ -313,7 +298,6 @@ export default { ...@@ -313,7 +298,6 @@ export default {
attType: ATT_TYPE.TEXT attType: ATT_TYPE.TEXT
}) })
} }
}, },
closeDialog() { closeDialog() {
if (this.dialogVisible) { if (this.dialogVisible) {
...@@ -342,13 +326,14 @@ export default { ...@@ -342,13 +326,14 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.welcome-box { .welcome-box {
display: inline-block !important;
// padding-top: 20px; // padding-top: 20px;
// margin-left: 87px; // margin-left: 87px;
} }
.content { .content {
display: inline-block; display: inline-block;
vertical-align: text-top; vertical-align: text-top;
width: calc(100% - 103px); width: calc(100% - 103px) !important;
// margin-left: 12px; // margin-left: 12px;
.content-bg { .content-bg {
background-color: #f7f7f7; background-color: #f7f7f7;
......
...@@ -120,15 +120,6 @@ ...@@ -120,15 +120,6 @@
</span> </span>
</GLTable> </GLTable>
</div> </div>
<!-- <div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button @click="handleCancel" type="primary">取消</el-button>
</div> -->
</div> </div>
</template> </template>
<script> <script>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</template> </template>
<script> <script>
import url from '@/assets/clientDataOverview/nodata.png' import url from '@/assets/empty.png'
export default { export default {
name: 'guestGroup', name: 'guestGroup',
data() { data() {
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
{ {
label: '群聊名称', label: '群聊名称',
prop: 'groupName', prop: 'groupName',
// minWidth: 90, width: 250,
line: 1 line: 1
}, },
{ {
...@@ -300,7 +300,6 @@ export default { ...@@ -300,7 +300,6 @@ export default {
}) })
break break
default: default:
} }
}, },
setTableFinishFun() { setTableFinishFun() {
...@@ -345,7 +344,7 @@ export default { ...@@ -345,7 +344,7 @@ export default {
} }
} }
.btn-header { .btn-header {
margin-bottom: 10px; margin-bottom: 16px;
} }
.container { .container {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -367,7 +366,7 @@ export default { ...@@ -367,7 +366,7 @@ export default {
.toptips { .toptips {
display: inline-block; display: inline-block;
position: relative; position: relative;
margin-left: 10px; margin-left: 16px;
height: 20px; height: 20px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
......
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="model-panel">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane label="券营销" name="1"></el-tab-pane>
<el-tab-pane label="权益卡" name="2"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" v-show="activeName == 2">
{{ item.cardClassName }}
</div>
<div class="model-item-title" v-show="activeName == 1">
{{ item.couponName }}
</div>
<div class="model-item-content" v-show="activeName == 1">数量:{{ item.residueAmount }}</div>
<div class="model-item-content" v-show="activeName == 2">价格:{{ item.price }}</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 2">有效期:{{ item.effectiveNum }}天</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 1">有效期:无限制</div>
<div class="model-item-content" v-show="activeName == 1 && item.effectiveType == 2">有效期:{{ item.effectiveStartTime }}~{{ item.effectiveEndTime }}</div>
<div class="model-item-content" v-show="activeName == 1 && item.effectiveType == 1">有效期:{{ item.effectiveDays }}天</div>
<div class="model-item-content" v-show="activeName == 1 && item.effectiveType == 3">有效期:无限制</div>
<div class="model-item-content" v-show="activeName == 1">类型:{{ item.discountType == 1 ? '满减劵' : item.discountType == 2 ? '折扣券' : item.discountType == 3 ? '代金券' : item.discountType == 4 ? '实物券' : item.discountType == 5 ? '购车代金券' : item.discountType == 6 ? '商品折扣券' : item.discountType == 7 ? '会员服务' : '' }}</div>
<div class="model-item-content" v-show="activeName == 2">类型:权益卡</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/img/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'activityModel',
data() {
return {
dialogVisible: false,
loading: false,
activeName: '1',
modelList: [],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
selectItem: {}
}
},
methods: {
handleSelectItem(item) {
this.selectItem = item
},
handleSelect() {
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id, marketingType: this.activeName, marketingUrl: this.selectItem.autoUrl })
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '1':
market = 'getMerchant'
break
case '2':
market = 'getCard'
break
}
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
this.$apis.marketing[market](params).then(res => {
this.modelList = res.list ? res.list : res.data
this.tableTotal = res.total
this.loading = false
})
},
init() {
this.dialogVisible = true
this.getModelList()
},
handleClick() {
this.getModelList()
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-empty {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
}
.model-item-panel {
display: grid;
grid-template-columns: repeat(4, 25%);
grid-row-gap: 10px;
height: 40vh;
overflow: auto;
.model-item {
position: relative;
height: 128px;
background: #ffffff;
border-radius: 4px;
border: 2px solid #e6e6e6;
padding: 14px 24px;
box-sizing: border-box;
margin-right: 10px;
&:nth-child(4n) {
margin-right: 0px;
}
&.checked {
border: 2px solid #5850ff;
}
&-qrcode {
position: absolute;
right: 10px;
bottom: 10px;
width: 60px;
height: 60px;
border: 1px solid #979797;
}
&-title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main" v-loading.fullscreen.lock="loading">
<div class="drainage-wrap scrm-box-f">
<div class="drainage-title">营销配置</div>
<div class="form-main">
<div class="drainage-form">
<!-- <div class="drainage-form-item">
<label class="is-require" style="line-height: 32px">营销名称</label>
<div style="position: relative">
<el-input @focus="imNameStatus = false" type="type" size="small" placeholder="请输入营销名称" v-model.trim="imName" :disabled="!editStatus" maxlength="30"></el-input>
<div class="el-form-item__error" v-if="imNameStatus">请输入营销名称</div>
</div>
</div> -->
<div class="drainage-form-item">
<!-- <label>群发短信</label> -->
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules" class="code-body-form">
<el-form-item label="营销名称:" prop="imName">
<el-input @focus="imNameStatus = false" type="type" size="small" placeholder="请输入营销名称" v-model.trim="imName" :disabled="!editStatus" maxlength="30"></el-input>
</el-form-item>
<el-form-item label="推送规则:"><div class="configForm-desc">系统将在「开始营销时间」之后启动短信营销,并在「截止营销时间」之后停止短信下放。由于相关管控限制,营销类短信无法实时触达用户,若短信时效要求很高,请谨慎使用。</div></el-form-item>
<el-form-item size="small" label="营销时间:" prop="time">
<el-time-picker is-range :disabled="!editStatus" value-format="HH:mm" format="HH:mm" v-model="addForm.time" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item>
<el-form-item label="短信内容:" prop="content">
<el-input type="textarea" v-model="addForm.content" rows="5" :disabled="!editStatus" maxlength="280" show-word-limit></el-input>
<div class="form-tips">70字內(含70字)计一条,超过70字,按70字/条计费。</div>
<div class="form-tips">提示:当前短信已有{{ addForm.content.length }}字,按{{ content.length }}条短信发送且计费。</div>
</el-form-item>
<div class="drainage-form-item">
<label>
自动打标签:
<el-popover placement="top" width="400" trigger="hover" content="提示:通过该营销活动添加员工企微的客户,将自动使用以下标签进行标记。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="drainage-emp">
<template v-for="item in tagging">
<div :key="index" v-for="(tag, index) in item.labelList">
{{ tag.name }}
</div>
</template>
</div>
</div>
</el-form>
</div>
</div>
<div class="drainage-form-item">
<label style="margin-left: 20px">
跟进员工:
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="drainage-emp">
<div :key="index" v-for="(item, index) in dracImFollowStaffResponses">
<i class="el-icon-user-solid"></i>
{{ item.staffName }}
</div>
</div>
</div>
</div>
<div class="form-image">
<img src="@/assets/img/marketing/phone.png" />
<div class="preview-content">
<div class="preview-info">
<div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div>
</div>
</div>
</div>
</div>
<div class="channel-main-welcome scrm-box-f">
<div class="chanel-form-title">欢迎语</div>
<div class="welcome-panel">
<div class="welcome-switch">
<label>自动发送欢迎语:</label>
<el-switch v-model="autoWelcome" :disabled="!editStatus" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
<div class="welcome-box" v-show="!editStatus && autoWelcome">
<div class="welcome-box-contaner">
<div :key="index" v-for="(item, index) in welcomeInfo">
<div v-if="item.attType == 1">
<div v-html="item.attContent" class="welcome-box-name"></div>
</div>
<div v-else-if="item.attType == 2">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 3">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 4">
<img src="@/assets/img/guestCustom/icon-link.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 5">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 6">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ JSON.parse(item.attContent).fileName }}</span>
</div>
<div v-else-if="item.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent.marketingName }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue'
export default {
name: 'configInfo',
data() {
return {
loading: false,
welcomeInfo: [],
eventBus: new Vue(),
taggingLength: 0,
autoWelcome: true,
imName: '',
imNameStatus: false,
empStatus: false,
importName: null,
exportUrl: null,
editStatus: false,
saveStatus: false,
importStatus: false,
ExportDracImResponse: {},
footerLeft: 0,
footerWidth: 0,
addForm: {
desc: '',
content: '',
time: ['9:00:00', '18:00:00']
},
content: [],
editId: null,
tagging: [],
messageItem: {},
dialogVisible: true,
value: false,
value1: false,
dracImFollowStaffResponses: [],
dracImMessageConfigAddRequest: {},
ModelItem: {}
}
},
watch: {
'addForm.content': {
handler: function() {
this.content = []
let str = this.addForm.content
let num = 70
let len = str.length
for (let i = 0; i < len / num; i++) {
let str1 = str.substring(i * num, (i + 1) * num)
this.content.push(str1)
}
}
},
importName: {
handler() {
this.saveStatus = true
},
deep: true
},
imName: {
handler() {
this.saveStatus = true
},
deep: true
},
autoWelcome: {
handler() {
this.saveStatus = true
},
deep: true
},
addForm: {
handler() {
this.saveStatus = true
},
deep: true
},
tagging: {
handler: function() {
this.taggingLength = 0
this.tagging.forEach(item => {
this.taggingLength += item.labelList.length
})
this.saveStatus = true
},
deep: true
},
dracImFollowStaffResponses: {
handler() {
this.saveStatus = true
},
deep: true
}
},
methods: {
goback() {
this.importStatus = false
},
findById(id) {
this.$apis.marketing.findById({ id }).then(res => {
this.$nextTick(() => {
this.$refs.configForm.validate()
})
this.dracImFollowStaffResponses = res.dracImFollowStaffResponses
this.addForm.time = [res.dracImMessageConResponse.startTime, res.dracImMessageConResponse.endTime]
this.addForm.content = res.dracImMessageConResponse.content
this.imName = res.imName
this.autoWelcome = res.autoWelcome ? true : false
const dracScrmWelcomeConfigDTOS = res.dracScrmWelcomeConfigDTOS ? res.dracScrmWelcomeConfigDTOS : []
const previewList = dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>').replaceAll(/\n/g, '<br>')
return item
})
this.welcomeInfo = previewList
const tagging = eval(res.tagging)
if (tagging && tagging.length) {
const taggingList = tagging.map(item => {
let name = item.name.split(',')
let ids = item.tagIds.split(',')
console.log(ids)
let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
})
this.tagging = taggingList
}
this.$nextTick(() => {
this.saveStatus = false
})
})
}
},
mounted() {
let { id } = this.$route.params
this.editId = id
this.findById(id)
}
}
</script>
<style lang="scss" scoped>
.channel-main-welcome {
margin: 20px 0px 16px;
.chanel-form-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.welcome-panel {
margin: 10px;
padding: 0px 42px 20px;
.welcome-switch {
margin-bottom: 20px;
label {
margin-right: 10px;
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
.welcome-box {
margin-left: 70px;
&-contaner {
margin: 20px;
background: rgba(247, 247, 247, 0.52);
border-radius: 2px;
line-height: 22px;
padding: 10px;
min-width: 500px;
}
img {
width: 16px;
height: 16px;
vertical-align: sub;
margin-right: 5px;
}
}
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.image-uploader {
display: inline-block;
margin-bottom: 6px;
width: 100px;
position: relative;
input {
cursor: pointer;
position: absolute;
top: 0px;
width: 100%;
height: 100%;
font-size: 0px;
}
/deep/ {
.el-upload-list {
display: none;
}
}
}
.import-panel {
z-index: 2001;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
&-box {
width: 712px;
height: 266px;
background: #ffffff;
border-radius: 4px;
padding: 20px;
box-sizing: border-box;
.import-title {
font-size: 20px;
font-weight: 500;
color: #424242;
line-height: 28px;
}
.import-num-panel {
display: flex;
margin: 10px;
.import-num-item {
width: 50%;
height: 140px;
text-align: center;
display: table-cell;
vertical-align: middle;
.import-num {
margin-top: 40px;
font-size: 20px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 28px;
}
.import-num-h2 {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
}
}
.import-footer {
display: flex;
justify-content: space-between;
}
}
}
.drainage-wrap {
margin-bottom: 20px;
&:nth-child(2) {
margin-bottom: 20px;
}
.drainage-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.form-main {
display: flex;
.form-image {
width: 280px;
height: 546px;
margin: 20px 10px;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
}
}
img {
width: 100%;
height: auto;
}
}
.drainage-form {
flex: 1;
}
}
.form-tips {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-top: 5px;
}
.drainage-form {
padding: 20px;
.drainage-form-item {
display: flex;
margin-top: 20px;
/deep/ {
.el-input__inner {
width: 448px;
}
}
label {
font-size: 14px;
text-align: right;
color: #666;
width: 140px;
margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
margin-left: 5px;
}
&.is-require {
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
}
}
/deep/ {
.el-textarea__inner {
border-radius: 0px;
border: 1px solid #dcdfe6;
}
}
.select-panel {
padding-left: 20px;
background: #fff;
display: flex;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 30px;
border: 1px solid #dcdfe6;
border-top: 0px;
> div {
cursor: pointer;
margin-right: 10px;
span {
margin-left: 3px;
}
}
}
.upload-box {
margin-bottom: 10px;
.upload-file-panel {
display: flex;
align-items: center;
> a {
margin-left: 10px;
text-decoration: underline;
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
}
}
.upload-btn {
text-align: center;
width: 96px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #dcdfe6;
font-size: 14px;
font-weight: 400;
color: #999999;
padding: 6px 0px;
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.message-panel {
background: #f7f7f7;
border: 1px solid #dcdfe6;
padding: 20px;
flex: 1;
box-sizing: border-box;
font-size: 14px;
color: #3a3a3a;
.configForm-desc {
margin-top: 10px;
line-height: 20px;
}
}
.drainage-emp {
display: flex;
margin-top: 6px;
flex-wrap: wrap;
div {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
i {
color: #75acff;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.tag-item-panel {
display: flex;
}
.drainage-coutom-count {
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 36px;
margin-left: 20px;
}
}
.drainage-panel {
padding: 20px;
.drainage-config-wrap {
display: flex;
justify-content: space-between;
align-items: center;
.drainage-item-label {
width: 50%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.config-title {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
margin: 20px 0px;
i {
margin-left: 6px;
}
}
.config-market {
display: flex;
&-item {
position: relative;
padding: 10px;
width: 50%;
height: 150px;
background: #f6f6ff;
border-radius: 4px;
opacity: 0.8;
box-sizing: border-box;
&:first-child {
margin-right: 20px;
}
&.checked {
border: 1px solid #5850ff;
.config-market-title {
color: #5850ff;
}
.config-market-icon {
background: linear-gradient(153deg, #8085ef 0%, #6f76ee 100%, #6f76ee 100%) !important;
}
.config-market-name {
color: #333333 !important;
}
.config-line {
border: 1px solid #5850ff !important;
}
}
.config-market-title {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
text-align: center;
}
.config-switch-icon {
position: absolute;
right: 10px;
top: 10px;
}
.config-market-select {
display: flex;
.config-market-s1 {
width: 33.33%;
margin: 0 auto;
text-align: center;
position: relative;
.config-line {
position: absolute;
top: 45px;
right: -30%;
width: 60%;
border: 1px solid #999999;
}
.config-market-icon {
width: 56px;
height: 56px;
background: #999999;
border-radius: 50%;
margin: 20px auto 10px;
}
.config-market-name {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 20px;
}
}
}
}
}
}
}
</style>
<template>
<div>
<div class="form-panel scrm-box-f">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item">
<el-row>
<el-form-item size="small" label="手机号">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item size="small" label="发送状态" style="margin-left: 20px">
<el-select v-model="tableSearchForm.status" placeholder="请选择">
<el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="客户姓名" style="margin-left: 20px">
<el-input size="small" v-model="tableSearchForm.customerName" placeholder="请输入客户姓名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div slot="status" slot-scope="scope">
<span :class="['task_icon', scope.scope.status == 1 ? 'green-icon' : 'yellow-icon']"></span>
{{ scope.scope.statusName }}
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
</div>
</GLTable>
<GLDialog title="短信内容" :hasFooter="true" :content="messageContent" :visible.sync="dialogVisible" mode="small">
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="dialogVisible = false">确定</el-button>
</span>
</GLDialog>
</div>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'customList',
data() {
return {
loading: false,
messageContent: '',
tableSearchForm: {},
dialogVisible: false,
tableData: [],
optionstatus: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '未发送'
},
{
value: '1',
label: '已发送'
}
],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '客户姓名',
prop: 'customerName'
},
{
label: '发送状态',
prop: 'statusName',
addHtml: 'status'
},
{
label: '发送时间',
prop: 'sendTime'
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
handleDetail(scope) {
this.dialogVisible = true
this.messageContent = scope.content
},
handleSearch() {
this.listChannelCodeByPage()
},
handleReset() {
this.tableSearchForm = {}
this.listChannelCodeByPage()
},
listChannelCodeByPage() {
const { id } = this.$route.params
const params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum,
id
}
this.loading = true
this.$apis.marketing.customerPage(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.data
this.tableData.forEach(item => {
this.$set(item, 'taggingList', [])
const tagging = eval(item.tagging)
if (tagging && tagging.length > 0) {
tagging.forEach(itm => {
let name = itm.name.split(',')
name.forEach((tag, index) => {
item.taggingList.push({ name: tag })
})
})
}
})
this.tableTotal = res.count
}
})
}
},
mounted() {
this.listChannelCodeByPage()
}
}
</script>
<style>
.el-popover {
max-width: 800px;
}
</style>
<style lang="scss" scoped>
.popover-panel {
width: 1000px;
}
.form-header {
margin-bottom: 20px;
}
.form-panel {
padding: 20px;
margin-bottom: 60px;
/deep/ .el-popover {
max-width: 1000px;
}
}
.download-link {
cursor: pointer;
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
}
.codeRemark {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
.green-icon {
background: #2cca74;
}
.yellow-icon {
background: #fdb757;
}
.tag-panel {
.tag-item {
border-radius: 4px;
border: 1px solid #e8e8ea;
display: inline-block;
padding: 4px 6px;
margin-right: 3px;
margin-bottom: 3px;
}
}
.allTagsWrap {
position: relative;
display: -webkit-box;
// max-height: 56px;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
padding-bottom: -2px;
box-sizing: border-box;
// &:hover {
// -webkit-line-clamp: 9999;
// // .tag-box-wrap {
// // margin-bottom: 10px;
// // }
// }
.tag-box-wrap {
display: inline-block;
margin-right: 10px;
// margin-bottom: 2px;
padding: 0 10px;
box-sizing: border-box;
min-width: 76px;
max-width: 200px;
height: 26px;
line-height: 26px;
border-radius: 4px;
border: 1px solid #e8e8ea;
background: #fafbfe;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #666666;
max-width: 245px;
cursor: pointer;
margin-bottom: 3px;
// &:first-child{
// margin-bottom: 4px;
// }
}
// .tag-box-wrap + .tag-box-wrap {
// margin-bottom: 4px;
// }
.expande-button-wrap {
position: absolute;
right: 0;
bottom: 0;
.expande-button {
color: #fafbfe;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 14px;
font-weight: 400;
color: #fafbfe;
line-height: 20px;
}
}
}
}
.link-dialog {
text-decoration: underline;
cursor: pointer;
}
.accountType-row {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
&-tag {
display: inline-block;
border: 1px solid #e8e8ea;
background: #fafbfe;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #666;
max-width: 150px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
i {
color: #75acff;
margin-right: 3px;
}
// &::before {
// content: '';
// position: absolute;
// width: 6px;
// height: 6px;
// background: #5850ff;
// border-radius: 8px;
// left: 0px;
// top: 7px;
// }
}
</style>
<template>
<div class="square-main">
<el-dialog
title="选择模板"
:visible.sync="dialogVisible"
width="70%"
:before-close="handleClose"
>
<div class="model-panel">
<div class="model-panel-tab">
<el-input v-model="keyword" placeholder="请输入关键字" width="215px" size="small"></el-input>
<el-button type="primary" @click="handleSearch" size="small">查询</el-button>
</div>
<div class="model-item-panel" v-if="modelList.length>0" v-loading="loading">
<div class="model-item" v-for="(item, index) in modelList" :key="index">
<div class="model-item-radio">
<el-radio v-model="messageRadio" :label="item"></el-radio>
</div>
<div class="model-item-title">
<div class="model-title-h1">{{ item.title }}</div>
<div class="model-title-h2">{{ item.content }}</div>
</div>
<div class="model-item-content">
<div class="model-content">创建人:巴拉巴拉</div>
<div class="model-content">创建日期:{{ item.createdTime }}</div>
</div>
</div>
</div>
<div class="model-item-panel" v-else v-loading="loading">
<img src="@/assets/img/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="tableTotal"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="selectModelItem">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "activityModel",
data() {
return {
keyword: '',
dialogVisible: false,
loading: false,
activeName: "1",
messageRadio: {},
modelList: [],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
};
},
methods: {
init() {
this.keyword = '';
this.messageRadio = {};
this.dialogVisible = true;
this.dracImMessage();
},
selectModelItem() {
this.dialogVisible = false;
this.$emit("selectItem", this.messageRadio);
},
handleClick() {
this.dracImMessage();
},
dracImMessage() {
this.loading = true;
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum,
keyword: this.keyword
};
this.$apis.marketing.dracImMessage(params).then((res) => {
this.messageRadio = {};
this.modelList = res.data;
this.tableTotal = res.count;
this.loading = false;
});
},
handleSearch() {
this.dracImMessage();
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
},
};
</script>
<style lang="scss" scoped>
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-input,.el-input__inner {
width: 320px;
margin-right: 20px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-panel {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
.model-item {
display: flex;
padding: 20px;
border-bottom: 1px solid #e9e9e9;
&-radio {
width: 80px;
/deep/ {
.el-radio__input {
margin-top: 10px;
}
.el-radio__label {
display: none;
}
}
}
&-content {
width: 210px;
.model-content {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
&-title {
flex: 1;
.model-title-h1 {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
.model-title-h2 {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main" v-loading.fullscreen.lock="loading">
<div class="drainage-wrap scrm-box-f">
<div class="drainage-title">指定客户</div>
<div class="drainage-form">
<div class="drainage-form-item">
<label style="margin: 0 0 0 32px">指定方式:</label>
<div class="upload-box drainage-type">
<el-radio-group v-model="selectType">
<el-radio :label="1">通过标签筛选</el-radio>
<el-radio :label="3">通过人群筛选</el-radio>
<el-radio :label="2">通过Excel导入</el-radio>
</el-radio-group>
</div>
</div>
<div class="drainage-form-item" v-if="selectType == 1">
<label style="margin: 0 0 0 32px">客户信息:</label>
<div class="upload-box">
<el-button size="small" @click="handleScreenTag">
<i class="el-icon-plus"></i>
筛选标签
</el-button>
<span class="tag-count">
(已选标签共关联
{{ contactNum }}
个客户)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="labeling.length > 0">
<template v-for="(item, index) in labeling">
<el-tag type="info" v-for="(tag, idx) in item.labelList" :key="idx" closable :disable-transitions="false" @close="removeTypeTag(item, idx, index)">
{{ tag.name }}
</el-tag>
</template>
</div>
<div class="upload-tips">提示:系统将自动过滤未补充手机号的客户</div>
</div>
</div>
<div class="drainage-form-item" v-if="selectType == 3">
<label style="margin: 0 0 0 32px">客户信息:</label>
<div class="upload-box">
<el-button size="small" @click="handleCrowd">
<i class="el-icon-plus"></i>
筛选人群
</el-button>
<span class="tag-count">
(已选人群共关联
{{ contactNum }}
个客户)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="crowding.length > 0">
<template v-for="(item, index) in crowding">
<el-tag type="info" :key="item.crowdId" closable :disable-transitions="false" @close="removeCrowding(index)">
{{ item.crowdName }}
</el-tag>
</template>
</div>
<div class="upload-tips">提示:若用户同时属于多个选中人群,系统将自动去重</div>
</div>
</div>
<div class="drainage-form-item" v-if="selectType == 2">
<label style="margin: 0 0 0 32px">客户信息:</label>
<div class="upload-box">
<div class="upload-file-panel">
<div class="image-uploader">
<div class="upload-btn">
<i class="el-icon-upload2"></i>
上传文件
</div>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" />
</div>
<a class="download-url" href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/客户信息导入模板.xlsx">下载导入模版</a>
</div>
<div class="upload-result" v-if="importName">
<div class="upload-result-input">{{ importName }}</div>
<i class="el-icon-delete" @click="clearFile"></i>
</div>
<div class="upload-tips">支持扩展名:xlsx、xls</div>
</div>
</div>
</div>
</div>
<div :class="['drainage-wrap', 'scrm-box-f', { 'drainage-bottom': dracImFollowStaffResponses.length == 0 }]">
<div class="drainage-title">营销配置</div>
<div class="form-main">
<div class="drainage-form">
<!-- <div class="drainage-form-item">
<label class="is-require" style="line-height: 32px">营销名称</label>
<div style="position: relative">
<el-input @focus="imNameStatus = false" type="type" size="small" placeholder="请输入营销名称" v-model.trim="imName" :disabled="!editStatus" maxlength="30"></el-input>
<div class="el-form-item__error" v-if="imNameStatus">请输入营销名称</div>
</div>
</div> -->
<div class="drainage-form-item">
<!-- <label>群发短信</label> -->
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules" class="code-body-form">
<el-form-item label="营销名称:" prop="imName">
<el-input ref="sInput" @focus="imNameStatus = false" type="type" size="small" placeholder="请输入营销名称" v-model.trim="addForm.imName" :disabled="!editStatus" maxlength="30"></el-input>
</el-form-item>
<el-form-item label="推送时间:">系统将在「开始营销时间」之后启动智系统将在「开始营销时间」之后启动短信营销,并在「截止营销时间」之后停止短信发送。由于相关管控限制,营销类短信无法实时触达用户,若短信时效要求很高,请谨慎使用。</el-form-item>
<el-form-item size="small" label="营销时间:" prop="time">
<el-time-picker is-range :disabled="!editStatus" value-format="HH:mm" format="HH:mm" v-model="addForm.time" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item>
<el-form-item label="短信内容:" prop="content">
<el-input type="textarea" v-model="addForm.content" rows="5" :disabled="!editStatus" maxlength="280" show-word-limit></el-input>
<div class="select-panel" v-if="editStatus">
<div @click="handleSelectMessage">
<i class="el-icon-circle-plus-outline"><span>选择模板</span></i>
</div>
</div>
<div class="form-tips">70字內(含70字)计一条,超过70字,按70字/条计费。</div>
<div class="form-tips">提示:当前短信已有{{ addForm.content.length }}字,按{{ content.length }}条短信发送且计费。</div>
</el-form-item>
<div class="drainage-form-item">
<label>
自动打标签:
<el-popover placement="top" width="400" trigger="hover" content="提示:通过该营销活动添加员工企微的客户,将自动使用以下标签进行标记。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="tag-item-panel" v-if="editStatus">
<div>
<el-button size="small" @click="handleAddTag">添加</el-button>
<div class="el-input-tag input-tag-wrapper" v-if="taggingLength">
<template v-for="(item, index) in tagging">
<el-tag type="info" v-for="(tag, idx) in item.labelList" :key="idx" closable :disable-transitions="false" @close="removeTag(item, idx, index)">
{{ tag.name }}
</el-tag>
</template>
</div>
</div>
</div>
<div v-else class="drainage-emp">
<template v-for="item in tagging">
<div :key="index" v-for="(tag, index) in item.labelList">
{{ tag.name }}
</div>
</template>
</div>
</div>
</el-form>
</div>
</div>
<div class="drainage-form-item" v-if="editStatus">
<label class="is-require" style="margin-left: 20px">
跟进员工:
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div style="position: relative">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="drainage-coutom-count">已经选择{{ dracImFollowStaffResponses.length }}人</span>
<div class="el-input-tag input-tag-wrapper" v-show="dracImFollowStaffResponses.length">
<el-tag effect="plain" type="info" v-for="(tag, idx) in dracImFollowStaffResponses" :key="idx" closable :disable-transitions="false" @close="remove(idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
<div class="el-form-item__error" v-if="empStatus">请选择跟进专员</div>
</div>
</div>
<div class="drainage-form-item" v-else>
<label style="margin-left: 20px">
跟进员工:
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="drainage-emp">
<div :key="index" v-for="(item, index) in dracImFollowStaffResponses">
<i class="el-icon-user-solid"></i>
{{ item.staffName }}
</div>
</div>
</div>
</div>
<div class="form-image">
<img src="@/assets/img/marketing/phone.png" />
<div class="preview-content">
<div class="preview-info">
<div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div>
</div>
</div>
</div>
</div>
<div class="channel-main-welcome scrm-box-f" v-if="dracImFollowStaffResponses.length">
<div class="chanel-form-title">欢迎语</div>
<div class="welcome-panel">
<div class="welcome-switch">
<label>自动发送欢迎语:</label>
<el-switch v-model="autoWelcome" :disabled="!editStatus" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
<div class="welcome-box" v-show="editStatus && autoWelcome">
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div>
<div class="welcome-box" v-show="!editStatus && autoWelcome">
<div class="welcome-box-contaner">
<div :key="index" v-for="(item, index) in welcomeInfo">
<div v-if="item.attType == 1">
<div v-html="item.attContent" class="welcome-box-name"></div>
</div>
<div v-else-if="item.attType == 2">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 3">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 4">
<img src="@/assets/img/guestCustom/icon-link.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 5">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent.marketingName }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">提交</el-button>
</GLFooter>
<div class="import-panel" v-if="importStatus">
<div class="import-panel-box">
<div class="import-title">操作结果</div>
<div class="import-num-panel">
<div class="import-num-item">
<div class="import-num">{{ ExportDracImResponse.totalCount }}</div>
<div class="import-num-h2">成功记录</div>
</div>
<div class="import-num-item">
<div class="import-num" style="color: #ff4d4f">{{ ExportDracImResponse.failCount }}</div>
<div class="import-num-h2">失败记录</div>
</div>
</div>
<div class="import-footer">
<el-button type="primary" @click="importError(ExportDracImResponse.errorUrl)" size="small" v-if="ExportDracImResponse.failCount">导出失败记录</el-button>
<el-button type="primary" @click="goback" size="small">完成</el-button>
</div>
</div>
</div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisible = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisible" mode="small"></GLDialog>
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
<select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag>
<screen-tag ref="screenTagForm" @tagScreened="tagScreened"></screen-tag>
<select-crowd ref="selectCrowdForm" @crowdData="crowdChecked"></select-crowd>
<activity-model ref="selectModelForm" @selectActivity="selectActivity"></activity-model>
<message-model ref="selectMessageForm" @selectItem="selectItem"></message-model>
</div>
</template>
<script>
import Vue from 'vue'
import word from '@/mixins/word'
import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag'
import screenTag from '@/components/screenTag'
import selectCrowd from '@/components/selectCrowd'
import messageModel from './components/messageModel'
import util from '@/utils/util'
const validateTime = (rule, value, callback) => {
if ((new Date(`2000-1-1 ${value[1]}`).getTime() - new Date(`2000-1-1 ${value[0]}`).getTime()) / (1000 * 60) < 120) {
callback(new Error('因营销类短信内容需人工审核,建议预留2小时的营销时长。'))
} else {
callback()
}
}
const validateContent = (rule, value, callback) => {
if (value == `【${Vue.prototype.$globalState.session.merchantName}】`) {
callback(new Error('请选择短信模板'))
} else {
callback()
}
}
export default {
mixins: [word],
name: 'config',
components: {
selectEmp,
selectTag,
screenTag,
selectCrowd,
messageModel
},
data() {
return {
contactNum: 0,
selectType: 1,
loading: false,
welcomeInfo: [],
taggingLength: 0,
autoWelcome: true,
imName: '',
imNameStatus: false,
empStatus: false,
importName: null,
exportUrl: null,
editStatus: true,
saveStatus: false,
importStatus: false,
ExportDracImResponse: {},
footerLeft: 0,
footerWidth: 0,
addForm: {
imName: '',
desc: '',
content: `【${this.$globalState.session.merchantName}】`,
time: ['9:00:00', '18:00:00']
},
content: [],
editId: null,
tagging: [],
labeling: [],
crowding: [],
messageItem: {},
dialogVisible: false,
value: false,
value1: false,
dracImFollowStaffResponses: [],
dracImMessageConfigAddRequest: {},
ModelItem: {},
merchantName: this.$globalState.session.merchantName,
addRules: {
imName: [{ required: true, message: '请输入营销名称', trigger: 'blur' }],
time: [
{ required: true, message: '请选择营销时间', trigger: 'change' },
{ validator: validateTime, trigger: 'change' }
],
content: [
{ required: true, message: '请选择短信模板', trigger: 'change' },
{ validator: validateContent, trigger: 'blur' }
]
}
}
},
watch: {
'addForm.content': {
handler: function() {
this.content = []
let str = this.addForm.content
let num = 70
let len = str.length
for (let i = 0; i < len / num; i++) {
let str1 = str.substring(i * num, (i + 1) * num)
this.content.push(str1)
}
}
},
importName: {
handler() {
this.saveStatus = true
},
deep: true
},
imName: {
handler() {
this.saveStatus = true
},
deep: true
},
autoWelcome: {
handler() {
this.saveStatus = true
},
deep: true
},
addForm: {
handler() {
this.saveStatus = true
},
deep: true
},
tagging: {
handler: function() {
this.taggingLength = 0
this.tagging.forEach(item => {
this.taggingLength += item.labelList.length
})
this.saveStatus = true
},
deep: true
},
crowding: {
handler() {
if (this.crowding.length == 0) {
this.contactNum = 0
return
}
this.handleSaveImport()
},
deep: true
},
labeling: {
handler() {
if (this.labeling.length == 0) {
this.contactNum = 0
this.filterTagging = []
return
}
this.filterTagging = this.labeling.map(item => {
return {
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: item.labelList[0].id,
labelName: item.labelList[0].name
}
})
this.handleSaveImport()
},
deep: true
},
dracImFollowStaffResponses: {
handler() {
this.saveStatus = true
},
deep: true
},
selectType(newVal, oldVal) {
if ((oldVal == 1 && this.labeling.length > 0) || (oldVal == 3 && this.crowding.length > 0)) {
this.$confirm('更换指定方式将重置客户列表', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.labeling = []
this.crowding = []
this.contactNum = 0
})
.catch(() => {
this.selectType = oldVal
})
}
if (oldVal == 1 && this.importName) {
this.$confirm('更换指定方式将重置客户列表', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.clearFile()
})
.catch(() => {
this.selectType = oldVal
})
}
}
},
methods: {
clearFile() {
this.importName = null
this.exportUrl = null
this.$refs.file.value = ''
},
importError(url) {
util.openUrl(url)
},
goback() {
this.importStatus = false
},
handleSure() {
this.$router.push('/market/index')
},
handleCancel() {
if (this.saveStatus || (this.$refs.welcome && this.$refs.welcome.previewList.length > 0 && this.editStatus)) {
this.dialogVisible = true
} else {
this.$router.push('/market/index')
}
},
selectItem(item) {
this.messageItem = item
this.addForm.content = `【${this.merchantName}】${item.content}`
},
//打标签
tagSelected(item) {
this.tagging = item
},
//选择标签
tagScreened(item) {
this.labeling = item
},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx' //文件格式判断
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileName = file.name.split('.')
//fileUrl: 文件名 + @ + base64拼接
const fileUrl = fileName.pop() + '@' + arrBase64[1]
//this.$apis.common.pictureUpload 调用接口api
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
this.importName = file.name
this.exportUrl = res
this.$refs.file.value = ''
this.handleSaveImport()
})
}
},
selectTable(item) {
this.dracImFollowStaffResponses = item.map(item => {
return {
staffId: item.relationId,
staffName: item.staffName
}
})
},
remove(index) {
this.dracImFollowStaffResponses.splice(index, 1)
},
removeTag(item, idx, index) {
item.labelList.splice(idx, 1)
if (item.labelList.length == 0) {
this.tagging.splice(index, 1)
}
},
removeTypeTag(item, idx, index) {
item.labelList.splice(idx, 1)
if (item.labelList.length == 0) {
this.labeling.splice(index, 1)
}
},
removeCrowding(index) {
this.crowding.splice(index, 1)
},
selectActivity(item) {
this.ModelItem = item
},
handleSaveImport() {
const groupIds = this.crowding.map(item => item.crowdId)
this.loading = true
let params = {
exportUrl: this.exportUrl,
imType: 2,
filterTagging: JSON.stringify(this.filterTagging),
groupIds
}
if (params.filterTagging && params.filterTagging == '[]') {
delete params.filterTagging
}
if (params.groupIds && params.groupIds.length == 0) {
delete params.groupIds
}
this.$apis.marketing.exportAdd(params).then(res => {
if (res) {
if (this.selectType == 1) {
this.contactNum = res.totalCount
} else if (this.selectType == 3) {
this.contactNum = res.totalCount
} else {
this.ExportDracImResponse = res
this.importStatus = true
}
} else {
this.contactNum = 0
}
this.loading = false
})
},
handleSave() {
if (this.selectType == 1 && this.labeling.length == 0) {
this.$message.error('请选择客户标签')
return
}
if (this.selectType == 3 && this.crowding.length == 0) {
this.$message.error('请选择人群')
return
}
if ((this.selectType == 1 || this.selectType == 3) && this.contactNum == 0) {
this.$message.error('智能营销客户为空')
return
}
if (this.selectType == 2 && !this.exportUrl) {
this.$message.error('请上传客户信息')
return
}
if (!this.addForm.imName) {
this.imNameStatus = true
this.$message.error('请输入营销名称')
return
}
if (this.dracImFollowStaffResponses && this.dracImFollowStaffResponses.length == 0) {
this.empStatus = true
return
}
this.$refs['configForm'].validate(valid => {
if (valid) {
let startTime, endTime
if (this.addForm.time) {
startTime = this.addForm.time[0]
endTime = this.addForm.time[1]
}
let templateId = this.messageItem.id
const content = this.addForm.content
let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => {
return tag.id
})
let name = item.labelList.map(tag => {
return tag.name
})
return {
groupId: item.labelGroup.id,
tagIds: tagIds.join(','),
name: name.join(','),
labelType: item.labelGroup.name
}
})
const groupIds = this.crowding.map(item => item.crowdId)
let params = {
autoWelcome: this.autoWelcome ? 1 : 0,
imName: this.addForm.imName,
imType: 2,
tagging: JSON.stringify(tagging),
filterTagging: JSON.stringify(this.filterTagging),
exportUrl: this.exportUrl,
dracImFollowStaffRequestList: this.dracImFollowStaffResponses,
groupIds,
dracImMessageConfigRequest: {
startTime,
endTime,
templateId,
content
}
}
if (params.filterTagging && params.filterTagging == '[]') {
delete params.filterTagging
}
if (params.groupIds && params.groupIds.length == 0) {
delete params.groupIds
}
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.welcomeInfo = attachmentList
this.loading = true
this.$apis.marketing.exportAdd(params).then(res => {
this.loading = false
if (res) {
this.$router.push('/market/index')
}
})
}
})
},
//选择员工
handleAddEmp() {
this.empStatus = false
this.$refs.selectEmpForm.init(this.dracImFollowStaffResponses)
},
//选择标签
handleAddTag() {
this.$refs.selectTagForm.init(this.tagging)
},
//筛选标签
handleScreenTag() {
this.$refs.screenTagForm.init(this.labeling)
},
handleCrowd() {
this.$refs.selectCrowdForm.init(this.crowding)
},
crowdChecked(item) {
this.crowding = item
},
//选择短信模板
handleSelectMessage() {
this.$refs.selectMessageForm.init()
},
handleSelectModel() {
this.$refs.selectModelForm.init()
},
findById(id) {
this.$apis.marketing.findById({ id }).then(res => {
this.$nextTick(() => {
this.$refs.configForm.validate()
})
this.dracImFollowStaffResponses = res.dracImFollowStaffResponses
this.addForm.time = [res.dracImMessageConResponse.startTime, res.dracImMessageConResponse.endTime]
this.addForm.content = res.dracImMessageConResponse.content
this.addForm.imName = res.imName
this.autoWelcome = res.autoWelcome ? true : false
const previewList = res.dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>')
return item
})
this.welcomeInfo = previewList
const tagging = eval(res.tagging)
const taggingList = tagging.map(item => {
let name = item.name.split(',')
let ids = item.tagIds.split(',')
let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
})
this.tagging = taggingList
this.$nextTick(() => {
this.saveStatus = false
})
})
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
let { id } = this.$route.params
if (id) {
this.editId = id
this.findById(id)
this.editStatus = false
}
}
}
</script>
<style lang="scss" scoped>
.channel-main-welcome {
margin: 20px 0px 60px;
.chanel-form-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.welcome-panel {
margin: 10px;
padding: 0px 42px 20px;
.welcome-switch {
margin-bottom: 20px;
label {
margin-right: 10px;
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
.welcome-box {
margin-left: 61px;
&-contaner {
margin: 20px;
background: rgba(247, 247, 247, 0.52);
border-radius: 2px;
line-height: 22px;
padding: 10px;
min-width: 500px;
}
img {
width: 16px;
height: 16px;
vertical-align: sub;
margin-right: 5px;
}
}
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.image-uploader {
display: inline-block;
margin-bottom: 6px;
width: 100px;
position: relative;
input {
cursor: pointer;
position: absolute;
top: 0px;
width: 100%;
height: 100%;
font-size: 0px;
}
/deep/ {
.el-upload-list {
display: none;
}
}
}
.import-panel {
z-index: 2001;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
&-box {
width: 712px;
height: 266px;
background: #ffffff;
border-radius: 4px;
padding: 20px;
box-sizing: border-box;
.import-title {
font-size: 20px;
font-weight: 500;
color: #424242;
line-height: 28px;
}
.import-num-panel {
display: flex;
margin: 10px;
.import-num-item {
width: 50%;
height: 140px;
text-align: center;
display: table-cell;
vertical-align: middle;
.import-num {
margin-top: 40px;
font-size: 20px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 28px;
}
.import-num-h2 {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
}
}
.import-footer {
display: flex;
justify-content: space-between;
}
}
}
.drainage-wrap {
margin-bottom: 16px;
&:nth-child(2) {
margin-bottom: 20px;
}
&.drainage-bottom {
margin-bottom: 16px;
}
.drainage-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.form-main {
display: flex;
.form-image {
width: 280px;
height: 546px;
margin: 20px 10px;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
}
}
img {
width: 100%;
height: auto;
}
}
.drainage-form {
flex: 1;
}
}
.form-tips {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-top: 5px;
}
.drainage-form {
padding: 20px;
.drainage-form-item {
display: flex;
margin-top: 20px;
/deep/ {
.el-input__inner {
width: 448px;
}
}
label {
font-size: 14px;
text-align: right;
color: #666;
width: 140px;
margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
margin-left: 5px;
}
&.is-require {
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
}
}
/deep/ {
.el-textarea__inner {
border-radius: 0px;
border: 1px solid #dcdfe6;
}
}
.select-panel {
padding-left: 20px;
background: #fff;
display: flex;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 30px;
border: 1px solid #dcdfe6;
width: 580px !important;
border-top: 0px;
box-sizing: border-box;
> div {
cursor: pointer;
margin-right: 10px;
span {
margin-left: 3px;
}
}
}
.upload-box {
margin-bottom: 10px;
&.drainage-type {
margin-left: -28px;
}
.tag-count {
color: #666666;
margin-left: 10px;
span {
color: #5850ff;
}
}
.upload-file-panel {
display: flex;
align-items: center;
> a {
margin-left: 10px;
text-decoration: underline;
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
}
}
.upload-btn {
text-align: center;
width: 96px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #dcdfe6;
font-size: 14px;
font-weight: 400;
color: #999999;
padding: 6px 0px;
}
.upload-result {
display: flex;
align-items: center;
&-input {
width: 320px;
height: 26px;
background: #f5f7fa;
border-radius: 4px;
font-size: 14px;
padding-left: 12px;
color: #333333;
line-height: 26px;
}
> i {
cursor: pointer;
color: #c6c6c6;
font-size: 14px;
margin-left: 10px;
}
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.message-panel {
background: #f7f7f7;
border: 1px solid #dcdfe6;
padding: 20px;
flex: 1;
box-sizing: border-box;
font-size: 14px;
color: #3a3a3a;
.configForm-desc {
margin-top: 10px;
line-height: 20px;
}
}
.drainage-emp {
display: flex;
margin-top: 6px;
flex-wrap: wrap;
div {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
i {
color: #75acff;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.tag-item-panel {
display: flex;
}
.drainage-coutom-count {
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 36px;
margin-left: 20px;
}
}
.drainage-panel {
padding: 20px;
.drainage-config-wrap {
display: flex;
justify-content: space-between;
align-items: center;
.drainage-item-label {
width: 50%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.config-title {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
margin: 20px 0px;
i {
margin-left: 6px;
}
}
.config-market {
display: flex;
&-item {
position: relative;
padding: 10px;
width: 50%;
height: 150px;
background: #f6f6ff;
border-radius: 4px;
opacity: 0.8;
box-sizing: border-box;
&:first-child {
margin-right: 20px;
}
&.checked {
border: 1px solid #5850ff;
.config-market-title {
color: #5850ff;
}
.config-market-icon {
background: linear-gradient(153deg, #8085ef 0%, #6f76ee 100%, #6f76ee 100%) !important;
}
.config-market-name {
color: #333333 !important;
}
.config-line {
border: 1px solid #5850ff !important;
}
}
.config-market-title {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
text-align: center;
}
.config-switch-icon {
position: absolute;
right: 10px;
top: 10px;
}
.config-market-select {
display: flex;
.config-market-s1 {
width: 33.33%;
margin: 0 auto;
text-align: center;
position: relative;
.config-line {
position: absolute;
top: 45px;
right: -30%;
width: 60%;
border: 1px solid #999999;
}
.config-market-icon {
width: 56px;
height: 56px;
background: #999999;
border-radius: 50%;
margin: 20px auto 10px;
}
.config-market-name {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 20px;
}
}
}
}
}
}
}
</style>
<template>
<div class="channel-main">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="营销配置" name="first"></el-tab-pane>
<el-tab-pane label="客户列表" name="second"></el-tab-pane>
</el-tabs>
<component :is="activeName == 'first' ? configInfo : customList"></component>
<!-- <GLFooter>
<el-button type="primary" @click="goback">返回</el-button>
</GLFooter> -->
</div>
</template>
<script>
import configInfo from './components/configInfo'
import customList from './components/customList'
export default {
name: 'config',
components: {
configInfo,
customList
},
data() {
return {
activeName: 'first',
customList: 'customList',
configInfo: 'configInfo'
}
},
methods: {
goback() {
this.$router.push('/market/index')
}
}
}
</script>
<style lang="scss" scoped>
.channel-main {
/deep/ {
.el-tabs__nav-wrap::after {
height: 0px;
}
}
}
</style>
<template>
<div class="form-panel scrm-box-f">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item">
<el-form-item size="small" label="客户名称">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入客户名称"></el-input>
</el-form-item>
<el-form-item size="small" label="手机号">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item size="small" label="领取状态">
<el-select v-model="tableSearchForm.status" placeholder="请选择">
<el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">导出</el-button>
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">客户详情</el-button>
<el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
</div>
</GLTable>
</div>
</template>
<script>
export default {
name: 'effect',
data() {
return {
totalCount: 0,
percentage: 0,
optionstatus: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '未发送'
},
{
value: '1',
label: '已发送'
}
],
tableSearchForm: {},
getListApi: this.$apis.overview.findAllMessageByPage,
tableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectName: 'emp',
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'phone'
},
{
label: '手机号',
prop: 'phone'
},
{
label: '是否加企微',
prop: 'phone'
},
{
label: '手机号',
prop: 'phone'
},
{
label: '跟进员工',
prop: 'statusName'
},
{
label: '领取状态',
prop: 'phone'
},
{
label: '领取时间',
prop: 'sendTime'
},
{
label: '核销状态',
prop: 'phone'
},
{
label: '核销时间',
prop: 'sendTime'
},
{
label: '操作',
prop: 'optionBtns',
width: '160px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
methods: {
findMessageStatic() {
this.$apis.overview.findMessageStatic({}).then(res => {
this.totalCount = res.totalCount
this.percentage = res.percentage
})
},
handleReset() {
this.tableSearchForm = {}
this.handleSearch()
},
handleSearch() {
this.$refs.employeeRef.refreshTable()
},
handleDetail(scope) {
this.$alert(scope.content, { center: true })
}
},
mounted() {
this.findMessageStatic()
}
}
</script>
<style lang="scss" scoped>
.form-header {
margin-bottom: 20px;
}
.form-panel {
padding: 20px;
.statistics-panel {
display: flex;
&-item {
width: 33.33%;
.statistics-title-h {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
margin-bottom: 20px;
}
.statistics-title {
font-size: 16px;
font-weight: 500;
color: #424242;
line-height: 22px;
img {
width: 14px;
height: 14px;
margin-left: 10px;
margin-top: 4px;
}
}
.circle-box {
margin: 20px 0px;
display: flex;
align-items: center;
.circle-box-item {
margin-left: 10px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
.circle-item-num {
font-size: 22px;
font-weight: 600;
color: #333333;
line-height: 30px;
}
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main">
<div class="square-main-header">
<GLButton type="primary" size="small" @click="addConfig" fn="新增营销">
<i class="el-icon-plus"></i>
新增营销
</GLButton>
<!-- <GLButton type="primary" @click="addConfig" size="small" fn="新增" mode="el-button">新增营销</GLButton> -->
<label>结合门店营销活动,指定客户创建智能营销,提高活动转化率</label>
<el-popover placement="top" width="400" trigger="hover" content="通过导入的客户,门店可通过智能外呼及智能短信,结合营销活动的需要向离店用户进行智能营销,可实现标准、高效的营销同时实现用户线上化。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
<div class="square-tabel scrm-box-f">
<div class="square-tabel-form">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="imStatus" slot-scope="scope">
<span :class="['task_icon', scope.scope.imStatus == 3 ? 'green-icon' : 'yellow-icon']"></span>
{{ scope.scope.imStatusName }}
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="智能营销配置">查看配置</GLButton>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'marketing',
data() {
return {
tableSearchForm: {
imName: '',
imStatus: '',
createTime: ''
},
searchFormData: [
{
label: '添加时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
},
{
label: '状态',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '待处理'
},
{
value: '3',
label: '已完成'
}
]
},
{
label: '营销名称',
name: 'imName',
type: 'input',
placeholder: '请输入营销名称'
}
],
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
},
createTime: '',
dialogVisible: true,
getListApi: this.$apis.marketing.findAllByPage,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '营销名称',
prop: 'imName',
minWidth: '150px'
},
{
label: '营销客户数',
prop: 'customerCount',
minWidth: '120px'
},
{
label: '状态',
prop: 'imStatusName',
addHtml: 'imStatus'
},
{
label: '创建时间',
prop: 'createdTime',
minWidth: '180px'
},
{
label: '创建人',
prop: 'createdName',
minWidth: '220px'
},
{
label: '操作',
prop: 'optionBtns',
width: '180px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
watch: {
// createTime(value) {
// if (value) {
// this.tableSearchForm.beginTime = value[0]
// this.tableSearchForm.endTime = value[1]
// } else {
// delete this.tableSearchForm.beginTime
// delete this.tableSearchForm.endTime
// }
// }
},
methods: {
handleSearch() {
this.$refs.employeeRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {}
this.$refs.employeeRef.refreshTable()
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
}
// delete this.tableSearchForm.createTime
resolve()
})
},
handleImport() {},
addConfig() {
this.$router.push('/market/config')
},
handleDetail(scope) {
this.$router.push('/market/configDetail/' + scope.id)
},
handleStatistics(scope) {
this.$router.push('/market/effect/' + scope.id)
}
}
}
</script>
<style lang="scss" scoped>
.square-main-header {
label {
margin: 0px 20px 0px 10px;
color: #666666;
}
img {
width: 14px;
height: 14px;
margin-top: 8px;
}
}
.green-icon {
background: #2cca74;
}
.yellow-icon {
background: #fdb757;
}
.dialog-wrap-box {
z-index: 2001;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.5);
.dialog-wrap-panel {
background: #ffffff;
position: absolute;
top: 50%;
left: 10%;
transform: translateY(-50%);
height: 360px;
width: 80%;
.dialog-wrap-items {
position: relative;
display: flex;
width: 100%;
height: 360px;
.footer-btn {
cursor: pointer;
position: absolute;
bottom: -50px;
left: 50%;
text-align: center;
width: 120px;
margin-left: -60px;
height: 34px;
line-height: 34px;
background: #5850ff;
border-radius: 4px;
font-size: 14px;
color: #ffffff;
}
}
.dialog-wrap-item {
padding: 30px;
width: 33.33%;
text-align: center;
border-right: 1px solid #eeeeee;
.dialog-item-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
}
img {
width: 200px;
height: auto;
margin: 20px;
}
.dialog-item-content {
font-size: 14px;
width: 240px;
margin: 0 auto;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
}
.square-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
img {
width: 14px;
height: 14px;
margin-top: 5px;
}
}
.square-num-box {
height: 102px;
margin: 20px 0px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
display: flex;
.square-num-item {
width: 33.33%;
padding-left: 20px;
.square-num-title {
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.square-num-count {
font-size: 30px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 38px;
}
}
}
.coustom-box {
margin-top: 20px;
display: flex;
&-item {
box-sizing: border-box;
width: 25%;
margin-right: 20px;
padding: 20px;
height: 334px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
text-align: center;
&:last-child {
margin-right: 0px;
}
.coustom-box-title {
font-size: 20px;
font-weight: 500;
color: #424242;
line-height: 28px;
letter-spacing: 1px;
margin: 10px;
}
.coustom-echart {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
.coustom-echart-desc {
margin-left: 10px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
.coustom-echart-num {
font-size: 20px;
}
}
}
.coustom-box-content {
font-size: 14px;
font-weight: 500;
color: #a3a3a3;
line-height: 20px;
text-align: left;
height: 110px;
}
.coustom-box-config {
margin: 10px auto;
display: inline-block;
border-radius: 4px;
border: 1px solid #5850ff;
padding: 7px 28px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 14px;
}
}
}
.square-tabel {
padding: 20px;
margin-top: 20px;
/deep/ {
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 220px;
}
.el-form-item {
margin-right: 20px;
}
}
}
</style>
<template>
<div :id="coustomId" class="coustom-main"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'echartCircle',
props: {
coustomId: {
type: String,
default: ''
},
bgColor: {
type: String,
default: ''
},
lineData: {
type: Array
}
},
data() {
return {}
},
watch: {
lineData() {
this.getEchart()
}
},
methods: {
getEchart() {
const chartDom = document.getElementById(this.coustomId)
const myChart = echarts.init(chartDom)
let option
option = {
series: [
{
type: 'pie',
radius: ['40%', '70%'],
hoverAnimation: false,
avoidLabelOverlap: false,
color: ['rgba(0,0,0,.06)', this.bgColor],
label: {
show: false,
position: 'center'
},
labelLine: {
show: false
},
data: [{ value: (this.lineData[0] == 0 && this.lineData[1] == 0) ? 1 : this.lineData[1] },{ value: this.lineData[0] } ]
}
]
}
option && myChart.setOption(option)
}
},
}
</script>
<style lang="scss" scoped>
.coustom-main {
width: 64px;
height: 64px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main">
<el-dialog
title="选择跟进专员"
:visible.sync="dialogVisible"
width="50%"
:before-close="handleClose"
>
<el-form :inline="true" :model="tableSearchForm" label-width="80px">
<el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.name" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<GLTable
ref="employeeRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
:hasNum="false"
>
</GLTable>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "selectEmp",
data() {
return {
dialogVisible: false,
tableSearchForm: {},
getListApi: this.$apis.channel.getListApi,
tableParams: {
listName: "data",
tableOption: false,
otherOptions: {
label: "启用开关",
},
tableColumns: [
{
label: "姓名",
prop: "staffName",
},
{
label: "部门",
prop: "entmicroName",
},
{
label: "测试专员类型",
prop: "roleName",
},
],
},
pageConf: { pageSize: "pageSize", pageNum: "pageNum", totalCount: "count" },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: [],
},
};
},
methods: {
init() {
this.dialogVisible = true;
},
},
};
</script>
<style lang="scss" scoped></style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="import-main" v-loading="loading">
<div class="upload-container">
<div class="upload-item" v-for="(item, index) in fileList" :key="item">
<div class="upload-label" :style="{ width: textNum * 20 + 'px' }">
<label v-if="item.flag">*</label>
{{ item.templateName }}:
</div>
<div class="upload-desc">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
{{ item.fileName ? '更换文件' : '上传文件' }}
</el-button>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile($event, item, index)" />
</div>
<a :href="item.templateUrl">下载模板</a>
<div class="upload-tips" v-if="!item.fileName && !item.fileInfo">支持扩展名:xlsx、xls</div>
<div class="upload-tips" v-if="item.fileInfo">
<i class="el-icon-success"></i>
文件格式正确({{ item.fileName }})
</div>
<div class="upload-tips" v-if="item.fileName && !item.fileInfo">
<i class="el-icon-error"></i>
文件格式错误,请更换文件({{ item.fileName }})
</div>
</div>
</div>
<div class="upload-item">
<div class="upload-label" :style="{ width: textNum * 20 + 'px' }">
备注:
</div>
<div class="upload-desc">
<el-input type="textarea" maxlength="50" :rows="6" placeholder="为本次导入的数据添加备注" v-model="remarks"></el-input>
</div>
</div>
<div class="upload-item">
<div class="upload-label" :style="{ width: textNum * 20 + 'px' }">
跟进人
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
:
</div>
<div class="upload-desc">
<div style="position: relative">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<div class="el-input-tag input-tag-wrapper" v-show="staffIdList.length">
<el-tag effect="plain" type="info" v-for="(tag, idx) in staffIdList" :key="idx" closable :disable-transitions="false" @close="remove(idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</div>
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import util from '@/utils/util'
import uploadInfo from '@/utils/upload'
import selectEmp from '@/components/selectEmp'
import MD5 from 'md5'
export default {
name: 'step-first',
props: {},
components: {
selectEmp
},
data() {
return {
textNum: 0,
loading: false,
staffIdList: [],
tabelHeader: [],
tabelHeaderModel: [],
fileList: [],
remarks: ''
}
},
mounted() {
this.merchantConfig()
},
methods: {
async merchantConfig() {
this.loading = true
const fileList = (await this.$apis.square.merchantConfig({})) || []
this.fileList = fileList.map(item => {
this.textNum = this.textNum > item.templateName.length ? this.textNum : item.templateName.length + 1
return {
size: '',
flag: !parseInt(item.mustUpload),
fileName: '',
templateName: item.templateName,
fileUrl: '',
fileInfo: '',
templateUrl: item.templateUrl,
BusinessTypeId: item.businessType,
businessTypeName: item.businessName
}
})
this.loading = false
this.readWorkbookFromRemoteFile()
},
getUploadInfo() {
for (let f of this.fileList) {
if (!f.fileName && f.flag) {
this.$message.error('请上传' + f.templateName)
return false
}
if (!f.fileInfo && f.fileName) {
this.$message.error(f.templateName + '文件格式错误,请更换文件')
return false
}
}
const staffIdList = this.staffIdList.map(item => {
return item.staffId
})
return {
fileList: this.fileList,
remarks: this.remarks,
staffIdList
}
},
getDownloadModel() {
this.$apis.square.downloadModel({}).then(res => {
console.log(res)
})
},
// 从网络上读取某个excel文件,url必须同域,否则报错
async readWorkbookFromRemoteFile() {
for (let f of this.fileList) {
try {
let tabelHeaderArr = await this.getTabelHeaderModel(f.templateUrl)
this.tabelHeaderModel.push(tabelHeaderArr)
} catch (error) {
this.$message.error('读取失败')
}
}
},
getTabelHeaderModel(model_url) {
const _this = this
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest()
xhr.open('get', model_url, true)
xhr.responseType = 'arraybuffer'
xhr.onload = function(e) {
if (xhr.status == 200) {
var datat = new Uint8Array(xhr.response)
var workbook = XLSX.read(datat, { type: 'array' })
const wsname = workbook.SheetNames[0]
const ws = workbook.Sheets[wsname]
/* 数组转换 */
const data = _this.getHeaderRow(ws)
resolve(data)
} else {
reject()
}
}
xhr.send()
})
},
getHeaderRow(sheet) {
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
if (!hdr.includes('UNKNOWN')) {
headers.push(hdr)
}
}
return headers
},
compareHeader(file) {
return new Promise(resolve => {
const reader = new FileReader()
reader.onload = event => {
/* 解析数据 */
const bstr = event.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
const ws = wb.Sheets[wsname]
if (!ws['!ref']) {
this.$message.error('格式错误')
this.loading = false
return
}
const data = this.getHeaderRow(ws)
resolve(data)
}
reader.readAsBinaryString(file)
})
},
send(arr) {
let max = 3 //最多允许同时执行的ajax次数
var current = 0 //当前有多少ajax正在执行
// var _name = getFileType(w.fileName);
var _num = 0
var len = arr.length
var hasFile = false
for (let i = len - 1; i >= 0; i--) {
var _index = i
var fileBase64 = uploadInfo.transformArrayBufferToBase64(arr[i])
var oParams = uploadInfo.getParams(_index, fileBase64)
var o = {}
oParams.file = oParams.fileType + '@' + fileBase64
o.method = 'POST'
o.data = oParams
//fileFragmentUpload(o);
//如果存在url,则直接跳出循环
if (hasFile) {
return false
}
this.$apis.common.getUploadFileToken(o).then(res => {
if (res.code == 0) {
_num++
var _obj = res.data
// 如果有进度条,则设置对应的进度条属性
//如果存在url,则直接跳出循环
if (res.data.fileUrl) {
hasFile = true
return false
}
}
})
}
},
//创建worker分线程
createWorker() {
let self = this
var myWorker = function() {
// let that = this
let w = {}
this.addEventListener(
'message',
function(e) {
var _obj = e.data
var files = self.file
console.log(self)
var reader = new FileReader()
w.config = _obj.config
w.options = _obj.options
w.file = _obj.file
//var r1 = getToken(files);
reader.readAsArrayBuffer(files)
reader.onload = function(e) {
var hexHash = MD5(e.target.res)
if (hexHash) {
console.log('加密结束:' + new Date().getTime())
}
var oParams = {}
oParams.fileMD5 = hexHash
oParams.file = e.target.result
oParams.size = files.size
//w.fileMD5 = hexHash;
this.postMessage(oParams)
/*var _arr = fileSlice(oParams);
console.log(_arr)
w.list = _arr;
Promise.all([r1]).then(res => {
checkFileIsUpload(hexHash).then(res => {
console.log(res);
if (res.code == 0) {
send(_arr);
}
});
})*/
}
},
false
)
}
var workerData = new Blob(['(' + myWorker.toString() + ')()'], {
type: 'text/javascript'
})
return workerData
},
async uploadFile(e, uploadItem, index) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = file.size / 1024 / 1024
if (size > 8) {
this.$message.error('单文件体积需小于8M')
return
}
this.loading = true
const header = await this.compareHeader(file)
if (util.getArrayIsSubset(header, this.tabelHeaderModel[index])) {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = file.name.split('.').pop() + '@' + arrBase64[1]
uploadItem.fileInfo = fileInfo
uploadItem.size = size
uploadItem.fileName = file.name
this.loading = false
// const params = {}
// console.log(fileInfo)
// params.fileList = [{ file: fileInfo, fileType: 'doc' }]
// this.$apis.common.pictureUpload(params).then(res => {
// uploadItem.fileUrl = res
// uploadItem.size = size
// uploadItem.fileName = file.name
// this.$refs.file.value = ''
// this.loading = false
// })
}
} else {
uploadItem.fileName = file.name
uploadItem.fileInfo = ''
this.loading = false
}
},
// uploadFile(e, uploadItem, index) {
// const file = e.srcElement.files[0]
// let AllImgExt = '.xls|.xlsx'
// let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
// console.log(extName)
// if (AllImgExt.indexOf(extName) === -1) {
// this.$message.error('上传格式不正确')
// return false
// }
// const size = file.size / 1024 / 1024
// if (size > 30) {
// this.$message.error('单文件体积需小于30M')
// return
// }
// const reader = new FileReader(file)
// reader.onload = event => {
// /* 解析数据 */
// const bstr = event.target.result
// const wb = XLSX.read(bstr, { type: 'binary' })
// /* 获取文件的第一个工作表(WorkSheet) */
// const wsname = wb.SheetNames[0]
// const ws = wb.Sheets[wsname]
// /* 数组转换 */
// const data = XLSX.utils.sheet_to_json(ws, { header: 1 })
// /* 进行表格数据更新 */
// uploadItem.fileName = file.name
// if (data && data.length > 0 && util.getArrayIsSubset(data[0], this.tabelHeaderModel[index])) {
// const arrBase64 = bstr.split(',')
// const fileInfo = file.name.split('.')[1] + '@' + arrBase64[1]
// this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
// uploadItem.fileUrl = res
// uploadItem.size = size
// this.$refs.file.value = ''
// })
// }
// /* 进行表格表头数据更新 */
// this.getHeaderRow(ws)
// }
// reader.readAsBinaryString(file)
// },
uploadFileSuccess(e) {
let AllImgExt = '.xls|.xlsx'
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = e.size / 1024 / 1024
if (size < 9) {
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = e.name.split('.')[1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
this.fileInfo = res
this.importName = e.name
this.$refs.file.value = ''
})
}
} else {
this.$message.error('上传文件不可超过9M')
}
},
//选择员工
handleAddEmp() {
this.$refs.selectEmpForm.init(this.staffIdList)
},
selectTable(item) {
this.staffIdList = item.map(item => {
return {
staffId: item.relationId,
staffName: item.staffName
}
})
},
remove(index) {
this.staffIdList.splice(index, 1)
}
}
}
</script>
<style lang="scss" scoped>
.import-main {
margin: 60px auto 0px;
width: 92%;
.upload-item {
display: flex;
margin-top: 30px;
font-size: 14px;
.upload-label {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
text-align: right;
min-width: 110px;
label {
color: #eb4e4e;
}
img {
width: 14px;
height: 14px;
vertical-align: middle;
}
}
.upload-desc {
margin-top: -6px;
.upload-btn {
position: relative;
display: inline-block;
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
/deep/ .el-textarea {
width: 500px;
}
a {
color: #5850ff;
margin-left: 10px;
vertical-align: text-bottom;
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
i {
color: #2cca74;
&.el-icon-error {
color: #eb4e4e;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 500px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
}
}
}
</style>
<template>
<div class="import-main">
<div class="upload-process">
<div class="upload-process-item" v-for="(item, index) in process" :key="item">
<div class="process-item-label" :style="{ width: textNum * 20 + 'px' }">
<label>*</label>
{{ item.templateName }}:
</div>
<div class="process-item-info">
<div class="process-item-size">
<img src="@/assets/img/Excel.png" alt="" />
文件大小:{{ item.size }}M
</div>
<div class="process-item-name">{{ item.fileName }}</div>
<div class="process-item-num">
<el-progress :show-text="false" :stroke-width="6" :percentage="item.percentage" :color="item.percentage != 100 ? '#5850FF' : '#2CCA74'"></el-progress>
<div class="process-num-status" v-if="item.percentage > 0 && item.percentage < 100">上传中</div>
<div class="process-num-status process-refresh" v-if="item.percentage == 0 && !dialogVisible" @click="refresh(index)">
重试
<i class="el-icon-refresh-right"></i>
</div>
<div class="process-num-status process-refresh" v-if="item.percentage == 0 && dialogVisible">
等待上传
</div>
<div class="process-num-status" v-if="item.percentage == 100"><i class="el-icon-success"></i></div>
</div>
</div>
</div>
</div>
<GLDialog @onOk="handleSure" @onCancel="handleCancel" title="提示" :visible.sync="dialogVisible" mode="small">
<div class="dialog-body">
<div class="dialog-tips-icon"><i class="el-icon-warning"></i></div>
<div class="dialog-tips-text">点击继续将开始上传数据文件</div>
<div class="dialog-tips-text">
<span>期间请勿关闭页面</span>
,是否继续吗?
</div>
</div>
<!-- <div slot="footer" class="dialog-footer">
<el-button size="small" @click="handleCancel">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSure">确 定</el-button>
</div> -->
</GLDialog>
<div class="loading-containner" v-if="processLoading"></div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
export default {
name: 'step-second',
props: {},
data() {
return {
textNum: 0,
processLoading: false,
resultNum: 0,
dialogVisible: false,
setInter: [],
process: [{ percentage: 0 }, { percentage: 0 }, { percentage: 0 }],
uploadItem: ''
}
},
mounted() {},
beforeDestroy() {
this.setInter.forEach(item => {
item && clearInterval(item)
})
},
methods: {
handleSure: utils.debounce(function() {
this.fileUpload()
this.dialogVisible = false
}, 300),
handleCancel() {
this.$emit('excelCancel')
this.dialogVisible = false
},
handleClose() {
this.handleCancel()
},
startUpload(info) {
this.uploadItem = info
const fileList = info.fileList
this.process = fileList.map(p => {
this.textNum = this.textNum > p.templateName.length ? this.textNum : p.templateName.length + 1
return {
percentage: 0,
fileName: p.fileName,
templateName: p.templateName,
size: p.size.toFixed(2)
}
})
console.log(info)
this.dialogVisible = true
},
async refresh(index) {
this.processLoading = true
this.process[index].percentage = 0
this.setInter[index] = setInterval(this.addProcess(index), 300)
try {
this.uploadItem.fileList[index].fileUrl = await this.$apis.common.pictureUpload({ file: this.uploadItem.fileList[index].fileInfo })
this.resultNum++
this.process[index].percentage = 100
clearInterval(this.setInter[index])
if (this.resultNum == this.process.length) {
this.datacubeUpload()
}
} catch (e) {
this.processLoading = false
this.process[index].percentage = 0
clearInterval(this.setInter[index])
}
},
datacubeUpload() {
this.processLoading = false
const fileList = this.uploadItem.fileList.map(item => {
return {
templateName: item.templateName,
fileName: item.fileName,
fileUrl: item.fileUrl,
templateUrl: item.templateUrl,
BusinessTypeId: item.BusinessTypeId,
businessTypeName: item.businessTypeName
}
})
let params = { fileList, createdStaffId: this.$globalState.session.id, remarks: this.uploadItem.remarks, staffIdList: this.uploadItem.staffIdList }
this.$apis.square.datacubeUpload(params).then(res => {
if (res) {
this.$emit('handleSuccess')
}
})
},
fileUpload() {
this.process.forEach(p => {
p.percentage = Math.random() * 30
})
this.resultNum = 0
this.processLoading = true
this.uploadItem.fileList.forEach(async (item, index) => {
this.$set(this.setInter, index, setInterval(this.addProcess(index), 300))
try {
this.uploadItem.fileList[index].fileUrl = await this.$apis.common.pictureUpload({ file: item.fileInfo })
this.process[index].percentage = 100
this.resultNum++
clearInterval(this.setInter[index])
if (this.resultNum == this.process.length) {
this.datacubeUpload()
}
} catch (e) {
this.processLoading = false
this.process[index].percentage = 0
clearInterval(this.setInter[index])
}
// setTimeout(() => {
// clearInterval(this.setInter)
// this.$emit('handleSuccess')
// }, 1000)
// }
// this.$apis.common
// .pictureUpload({ file: item.fileInfo })
// .then(res => {
// resultNum++
// item.fileUrl = res
// this.process[index].percentage = 100
// })
// .catch(() => {
// this.process[index].percentage = 0
// })
})
// this.uploadItem.fileList = this.uploadItem.fileList.filter(item => item.fileUrl)
// this.uploadItem.createdStaffId = this.$globalState.session.id
// this.$apis.square
// .datacubeUpload(this.uploadItem)
// .then(res => {
// if (res) {
// const result = res.failFile
// let resultNum = 0
// result.forEach((item, index) => {
// if (item.uploadSuccess == 0) {
// this.process[index].percentage = 100
// resultNum++
// } else {
// this.process[index].percentage = 0
// }
// })
// if (resultNum == result.length) {
// setTimeout(() => {
// clearInterval(this.setInter)
// this.$emit('handleSuccess')
// }, 1000)
// }
// }
// })
// .catch(() => {
// this.process.forEach(p => {
// p.percentage = 0
// })
// })
},
addProcess(index) {
this.process[index].percentage = this.process[index].percentage > 90 ? this.process[index].percentage : this.process[index].percentage + Math.random() * 5
}
}
}
</script>
<style lang="scss" scoped>
.loading-containner {
top: 0px;
left: 0px;
position: fixed;
width: 100%;
background: rgba(255, 255, 255, 0.1);
z-index: 5000;
height: 100%;
}
.import-main {
margin: 60px auto 0px;
width: 92%;
.upload-process {
&-item {
display: flex;
margin-bottom: 20px;
width: 40vw;
.process-item-label {
font-size: 14px;
font-weight: 400;
color: #333333;
min-width: 120px;
line-height: 20px;
text-align: right;
label {
color: #eb4e4e;
}
}
.process-item-info {
flex: 1;
}
.process-item-size {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
img {
width: 24px;
}
}
.process-item-name {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
margin-top: 6px;
}
.process-item-num {
margin-top: 8px;
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
line-height: 22px;
/deep/ .el-progress {
flex: 1;
margin-right: 6px;
}
.process-num-status {
width: 60px;
&.process-refresh {
cursor: pointer;
}
i {
color: #2cca74;
font-size: 14px;
&.el-icon-refresh-right {
color: #8c8c8c;
}
}
}
}
}
}
.dialog-body {
text-align: center;
margin: 10px 0px;
.dialog-tips-icon {
margin-bottom: 12px;
i {
color: #5850ff;
font-size: 32px;
}
}
.dialog-tips-text {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
span {
color: #eb4e4e;
}
}
}
.dialog-footer {
text-align: center;
}
}
</style>
<template>
<div class="import-main">
<div class="import-success">
<div class="import-success-image">
<i class="el-icon-success"></i>
</div>
<div class="import-success-desc">上传完成</div>
<div class="import-success-content">数据中心已成功接收到数据,数据处理完毕后将发送企微通知。</div>
<div class="import-success-content">届时请回到【引流获客】-【企微魔方】查看分析结果</div>
</div>
</div>
</template>
<script>
export default {
name: 'step-third',
props: {},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.import-main {
padding: 30px;
width: 80%;
margin: 0 auto;
border: 1px solid #e8e8ea;
}
.import-success {
text-align: center;
.el-icon-success {
font-size: 60px;
color: #2cca74;
}
&-desc {
font-size: 24px;
font-weight: 500;
color: #333333;
line-height: 32px;
margin: 20px 0px 10px;
}
&-content {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
opacity: 0.45;
}
}
</style>
<template>
<div class="form-panel scrm-box-f">
<div class="form-header"><el-button type="primary" size="small" @click="goback">返回</el-button></div>
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item">
<el-form-item size="small" label="客户名称">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入客户名称"></el-input>
</el-form-item>
<el-form-item size="small" label="电话号码">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入电话号码"></el-input>
</el-form-item>
<el-form-item size="small" label="是否添加企微">
<el-select v-model="tableSearchForm.status" placeholder="请选择">
<el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="首次添加企微">
<el-date-picker :picker-options="pickerOptions" v-model="createTime" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right; margin-right: 0px">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">导出</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">客户详情</el-button>
</div>
</GLTable>
</div>
</template>
<script>
export default {
name: 'customDetail',
data() {
return {
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
},
createTime: '',
totalCount: 0,
percentage: 0,
optionstatus: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '是'
},
{
value: '1',
label: '否'
}
],
tableSearchForm: {},
getListApi: this.$apis.overview.findAllMessageByPage,
tableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectName: 'emp',
listName: 'data',
tableOption: false,
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '客户名称',
prop: 'phone'
},
{
label: '手机号',
prop: 'phone'
},
{
label: '性别',
prop: 'phone'
},
{
label: '是否加企微',
prop: 'statusName'
},
{
label: '来源',
prop: 'sendTime',
align: 'left'
},
{
label: '跟进员工',
prop: 'phone'
},
{
label: '首次添加企微',
prop: 'sendTime'
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
watch: {
createTime(value) {
if (value) {
this.tableSearchForm.startTime = value[0] + ' 00:00:00'
this.tableSearchForm.endTime = value[1] + ' 23:59:59'
} else {
delete this.tableSearchForm.startTime
delete this.tableSearchForm.endTime
}
}
},
methods: {
findMessageStatic() {
this.$apis.overview.findMessageStatic({}).then(res => {
this.totalCount = res.totalCount
this.percentage = res.percentage
})
},
goback() {
this.$router.go('-1')
},
handleReset() {
this.tableSearchForm = {}
this.handleSearch()
},
handleSearch() {
this.$refs.employeeRef.refreshTable()
},
handleDetail(scope) {
this.$alert(scope.content, { center: true })
}
},
mounted() {
this.findMessageStatic()
}
}
</script>
<style lang="scss" scoped>
.form-header {
margin-bottom: 20px;
}
.form-panel {
padding: 20px;
.follow-form-item {
/deep/ {
.el-form-item {
margin-right: 20px;
}
.el-input__inner {
width: 215px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main">
<div class="drainage-wrap scrm-box-f">
<div class="drainage-title">客户引流企微</div>
<div class="drainage-panel">
<div class="drainage-config-wrap">
<div class="drainage-item-label">通过自动下发引流短信,用户一键接入微信生态。用户接入企微后可领取会员权益卡,实现高效锁客及后续营销策略提供精准触达的通道。</div>
<div class="drainage-item-switch">
<el-switch @change="handleSwitch" v-model="addValue" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
</div>
<div class="config-title">
<el-button type="primary" icon="el-icon-edit-outline" size="small" v-if="!editStatus" @click="editStatus = true">编辑配置</el-button>
</div>
<div class="config-market">
<div class="config-market-item checked">
<div class="config-market-title">首次营销</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">非企微客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon2.png" />
</div>
<div class="config-market-name">导入客户信息后</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon3.png" />
</div>
<div class="config-market-name">首次营销</div>
</div>
</div>
</div>
<div class="config-market-item checked">
<div class="config-market-title">二次营销</div>
<div class="config-market-select">
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon1.png" />
</div>
<div class="config-market-name">非企微客户</div>
</div>
<div class="config-market-s1">
<div class="config-line"></div>
<div class="config-market-icon">
<img src="@/assets/img/square/icon4.png" />
</div>
<div class="config-market-name">首次营销30天后</div>
</div>
<div class="config-market-s1">
<div class="config-market-icon">
<img src="@/assets/img/square/icon5.png" />
</div>
<div class="config-market-name">再次营销</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="drainage-wrap scrm-box-f">
<div class="drainage-title">营销配置</div>
<div class="form-main">
<div class="drainage-form">
<div class="drainage-form-item">
<!-- <label>群发短信</label> -->
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules" class="code-body-form">
<el-form-item label="推送时间:">系统将在「开始营销时间」之后启动智系统将在「开始营销时间」之后启动短信营销,并在「截止营销时间」之后停止短信发送。由于相关管控限制,营销类短信无法实时触达用户,若短信时效要求很高,请谨慎使用。</el-form-item>
<el-form-item size="small" label="营销时间:" prop="time">
<el-time-picker is-range :disabled="!editStatus" value-format="HH:mm" format="HH:mm" v-model="addForm.time" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item>
<el-form-item label="短信内容:" prop="content">
<el-input :disabled="!editStatus" type="textarea" v-model="addForm.content" rows="5" maxlength="280" show-word-limit></el-input>
<div class="select-panel" v-if="editStatus">
<div @click="handleSelectMessage">
<i class="el-icon-circle-plus-outline"><span>选择模板</span></i>
</div>
</div>
<div class="form-tips">70字內(含70字)计一条,超过70字,按70字/条计费。</div>
<div class="form-tips">提示:当前短信已有{{ addForm.content.length }}字,按{{ content.length }}条短信发送且计费。</div>
</el-form-item>
<div class="drainage-form-item">
<label style="width: 140px;font-size:14px; text-align: right; color: #666">
自动打标签:
<el-popover placement="top" width="400" trigger="hover" content="提示:通过该营销活动添加员工企微的客户,将自动使用以下标签进行标记。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="tag-item-panel" v-if="editStatus">
<div>
<el-button size="small" @click="handleAddTag">添加</el-button>
<div class="el-input-tag input-tag-wrapper" v-if="taggingLength">
<template v-for="(item, index) in addForm.tagging">
<el-tag type="info" v-for="(tag, idx) in item.labelList" :key="idx" closable :disable-transitions="false" @close="removeTag(item, idx, index)">
{{ tag.name }}
</el-tag>
</template>
</div>
</div>
</div>
<div v-else class="drainage-emp">
<template v-for="item in addForm.tagging">
<div :key="index" v-for="(tag, index) in item.labelList">
{{ tag.name }}
</div>
</template>
</div>
</div>
</el-form>
</div>
</div>
<div class="drainage-form-item" v-if="editStatus">
<label class="is-require" style="width: 140px;font-size:14px; text-align: right; color: #666">
跟进员工:
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div style="position: relative">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="drainage-coutom-count">已经选择{{ addForm.staffIds.length }}人</span>
<div class="el-input-tag input-tag-wrapper" v-if="addForm.staffIds.length">
<el-tag effect="plain" type="info" v-for="(tag, idx) in addForm.staffIds" :key="idx" closable :disable-transitions="false" @close="remove(idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
<div class="el-form-item__error" v-if="empStatus">请选择跟进专员</div>
</div>
</div>
<div class="drainage-form-item" v-else>
<label style="width: 140px;font-size:14px; text-align: right; color: #666;margin-left:20px;">
跟进员工:
<el-popover placement="top" width="400" trigger="hover" content="用户点击短信中的链接后,将自动分配以下某位员工的企微名片,客户添加好友将自动回复后台所配置的欢迎语。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</label>
<div class="drainage-emp" v-if="addForm.staffIds.length">
<div :key="index" v-for="(item, index) in addForm.staffIds">
<i class="el-icon-user-solid"></i>
{{ item.staffName }}
</div>
</div>
</div>
</div>
<div class="form-image">
<img src="@/assets/img/marketing/phone.png" />
<div class="preview-content">
<div class="preview-info">
<div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div>
</div>
</div>
</div>
</div>
<div class="channel-main-welcome scrm-box-f">
<div class="chanel-form-title">欢迎语</div>
<div class="welcome-panel">
<div class="welcome-switch">
<label>自动发送欢迎语:</label>
<el-switch :disabled="!editStatus" v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div>
<div class="welcome-box" v-show="editStatus && autoWelcome">
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div>
<div class="welcome-box" v-show="!editStatus && autoWelcome">
<div class="welcome-box-contaner">
<div :key="index" v-for="(item, index) in welcomeInfo">
<div v-if="item.attType == 1">
<div v-html="item.attContent" class="welcome-box-name"></div>
</div>
<div v-else-if="item.attType == 2">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 3">
<img src="@/assets/img/guestCustom/icon-img.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 4">
<img src="@/assets/img/guestCustom/icon-link.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 5">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent }}</span>
</div>
<div v-else-if="item.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent.marketingName }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button type="primary" @click="handleSave" v-if="editStatus">提交</el-button>
<el-button @click="goback">取消</el-button>
</GLFooter>
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
<select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag>
<message-model ref="selectMessageForm" @selectItem="selectItem"></message-model>
<div class="dialog-wrap-box" v-show="dialogVisible">
<div class="dialog-wrap-panel">
<div class="dialog-step">
<div class="el-steps el-steps--horizontal">
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head is-finish">
<div class="el-step__line" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: 0ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<div class="el-step__icon-inner">1</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title">智能外呼</div>
<div class="el-step__title">精准触达</div>
</div>
</div>
</div>
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head is-finish">
<div class="el-step__line" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: -150ms; border-width: 0px; width: 0%"></i>
</div>
<div class="el-step__icon is-text">
<!---->
<div class="el-step__icon-inner">2</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title">智能短信</div>
<div class="el-step__title">快速引流</div>
</div>
</div>
</div>
<div class="el-step is-horizontal is-flex" style="flex-basis: 50%; max-width: 33.3333%">
<div class="el-step__head is-finish">
<div class="el-step__line"><i class="el-step__line-inner"></i></div>
<div class="el-step__icon is-text">
<!---->
<div class="el-step__icon-inner">3</div>
</div>
<div class="el-step__main el-step__desc">
<div class="el-step__title">会员权益</div>
<div class="el-step__title">留存锁客</div>
</div>
</div>
</div>
</div>
</div>
<div class="dialog-wrap-items">
<div class="dialog-wrap-item"></div>
<div class="dialog-wrap-item"></div>
<div class="dialog-wrap-item"></div>
</div>
<div class="dialog-wrap-footer">
<el-button type="primary" @click="open">一键体验</el-button>
<el-button type="primary" @click="dialogVisible = false">创建配置</el-button>
</div>
</div>
</div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleTips = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisibleTips" mode="small"></GLDialog>
</div>
</template>
<script>
import Vue from 'vue'
import word from '@/mixins/word'
import { utils } from 'glsx-common'
import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag'
import messageModel from '../market/components/messageModel'
const validateTime = (rule, value, callback) => {
if ((new Date(`2000-1-1 ${value[1]}`).getTime() - new Date(`2000-1-1 ${value[0]}`).getTime()) / (1000 * 60) < 120) {
callback(new Error('因营销类短信内容需人工审核,建议预留2小时的营销时长。'))
} else {
callback()
}
}
export default {
mixins: [word],
name: 'drainage',
components: {
selectEmp,
selectTag,
messageModel
},
data() {
return {
welcomeInfo: [],
dialogVisibleTips: false,
eventBus: new Vue(),
autoWelcome: true,
editStatus: false,
saveStatus: false,
footerLeft: 0,
footerWidth: 0,
taggingLength: 0,
addForm: {
configType: 3,
content: '',
endTime: [],
id: '',
staffIds: [],
startTime: '',
tagging: [],
templateId: ''
},
previewListStart: [],
content: [],
dialogVisible: false,
addValue: false,
empStatus: false,
value1: false,
dracImFollowStaffResponses: [],
addRules: {
time: [
{ required: true, message: '请选择营销时间', trigger: 'change' },
{ validator: validateTime, trigger: 'change' }
],
content: [{ required: true, message: '请选择短信模板', trigger: 'change' }]
}
}
},
watch: {
'addForm.content': {
handler: function() {
this.content = []
if (this.addForm.content) {
let str = this.addForm.content
let num = 70
let len = str.length
for (let i = 0; i < len / num; i++) {
let str1 = str.substring(i * num, (i + 1) * num)
this.content.push(str1)
}
}
}
},
'addForm.tagging': {
handler: function() {
this.taggingLength = 0
if (this.addForm.tagging) {
this.addForm.tagging.forEach(item => {
this.taggingLength += item.labelList.length
})
}
},
deep: true
},
addForm: {
handler() {
this.saveStatus = true
},
deep: true
},
autoWelcome: {
handler() {
this.saveStatus = true
},
deep: true
}
},
methods: {
selectItem(item) {
this.addForm.templateId = item.id
this.addForm.content = item.content
},
tagSelected(item) {
this.addForm.tagging = item
},
selectTable(item) {
this.addForm.staffIds = item.map(item => {
return {
staffId: item.relationId,
staffName: item.staffName
}
})
console.log(this.addForm.staffIds)
},
remove(index) {
this.addForm.staffIds.splice(index, 1)
},
removeTag(item, idx, index) {
item.labelList.splice(idx, 1)
if (item.labelList.length == 0) {
this.addForm.tagging.splice(index, 1)
}
},
handleAddEmp() {
this.$refs.selectEmpForm.init(this.addForm.staffIds)
},
handleAddTag() {
this.$refs.selectTagForm.init(this.addForm.tagging)
},
handleSelectMessage() {
this.$refs.selectMessageForm.init()
},
handleSelectModel() {
this.$refs.selectModelForm.init()
},
open() {
this.dialogVisible = false
this.$prompt('请输入手机号', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
inputErrorMessage: '手机号格式不正确'
})
.then(({ value }) => {})
.catch(() => {})
},
goback() {
this.previewListStart.forEach(item => {
this.$refs.welcome.previewList.forEach(itm => {
if (item.attType == itm.attType) {
if (typeof item.attContent != 'object' && item.attContent != itm.attContent) {
this.saveStatus = true
}
if (typeof item.attContent == 'object' && item.attContent.marketingName != itm.attContent.marketingName) {
this.saveStatus = true
}
}
})
})
if (this.previewListStart.length == 0 && this.$refs.welcome.previewList.length > 0) {
this.saveStatus = true
}
if (this.saveStatus) {
this.dialogVisibleTips = true
} else {
this.$router.go(-1)
}
},
handleSure() {
this.$router.go(-1)
},
//开关
handleSwitch() {
let params = {
id: this.addForm.id,
delFlag: this.addValue ? 0 : 1,
configType: 3
}
let config
if (this.addForm.id) {
config = 'updateConfig'
} else {
config = 'addConfig'
}
this.$apis.marketing[config](params).then(res => {
if (res) {
this.$message({
message: '操作成功',
type: 'success'
})
}
})
},
//提交
handleSave() {
if (this.editStatus && this.addForm.staffIds.length == 0) {
this.empStatus = true
return
}
this.$refs['configForm'].validate(valid => {
if (valid) {
let params = utils.deepClone(this.addForm)
if (this.addForm.time) {
params.startTime = this.addForm.time[0]
params.endTime = this.addForm.time[1]
}
let tagging = params.tagging.map(item => {
let tagIds = item.labelList.map(tag => {
return tag.id
})
let name = item.labelList.map(tag => {
return tag.name
})
return {
groupId: item.labelGroup.id,
tagIds: tagIds.join(','),
name: name.join(','),
labelType: item.labelGroup.name
}
})
params.tagging = JSON.stringify(tagging)
params.staffIds = JSON.stringify(params.staffIds)
params.autoWelcome = this.autoWelcome ? 1 : 0
const previewList = this.$common.utils.deepClone(this.$refs.welcome.previewList)
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
console.log(item.attContent)
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7 && item.attContent) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.welcomeInfo = attachmentList
let config
if (this.addForm.id) {
config = 'updateConfig'
params.delFlag = this.addValue ? 0 : 1
} else {
config = 'addConfig'
}
this.$apis.marketing[config](params).then(res => {
if (res) {
this.$message({
message: '操作成功',
type: 'success'
})
this.findConfig()
}
})
}
})
},
findConfig() {
this.editStatus = false
this.$apis.marketing.findConfig({ configType: 3 }).then(res => {
if (res) {
if (!res.staffIds) {
this.addForm.id = res.id
this.addForm.content = ''
return
}
this.addForm = res
this.addForm.staffIds = res.staffIds ? eval(res.staffIds) : []
if (this.addForm.tagging) {
const tagging = eval(this.addForm.tagging)
const taggingList = tagging.map(item => {
let name = item.name.split(',')
let ids = item.tagIds.split(',')
console.log(ids)
let labelList = name.map((tag, index) => {
return { id: ids[index], name: tag }
})
return {
labelGroup: {
id: item.groupId,
name: item.labelType
},
labelList
}
})
this.addForm.tagging = taggingList ? taggingList : []
}
this.$set(this.addForm, 'time', [this.addForm.startTime, this.addForm.endTime])
this.addValue = res.delFlag == 0 ? true : false
this.autoWelcome = res.autoWelcome ? true : false
if (res.dracScrmWelcomeConfigDTOS) {
const dracScrmWelcomeConfigDTOS = utils.deepClone(res.dracScrmWelcomeConfigDTOS)
const previewListDesc = dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>')
return item
})
this.welcomeInfo = previewListDesc
const previewList = res.dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
return item
})
this.$refs.welcome.updateList(previewList)
}
this.$nextTick(() => {
this.saveStatus = false
this.previewListStart = this.$common.utils.deepClone(this.$refs.welcome.previewList)
})
}
})
}
},
mounted() {
this.findConfig()
}
}
</script>
<style lang="scss" scoped>
.channel-main-welcome {
margin: 20px 0px 16px;
.chanel-form-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.welcome-panel {
margin: 10px;
padding: 0px 42px 20px;
.welcome-switch {
margin-bottom: 20px;
label {
margin-right: 10px;
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
.welcome-box {
margin-left: 60px;
&-contaner {
margin: 20px;
background: rgba(247, 247, 247, 0.52);
border-radius: 2px;
line-height: 22px;
padding: 10px;
min-width: 500px;
}
img {
width: 16px;
height: 16px;
vertical-align: sub;
margin-right: 5px;
}
}
}
}
.dialog-step {
width: 80%;
margin: 0 auto 20px;
}
.el-steps {
transform: translateX(-30px);
}
.el-step.is-vertical .el-step__head {
width: 32px;
}
.el-step__line {
background: rgba(0, 0, 0, 0.15);
}
.el-step__icon {
width: 32px;
height: 32px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
.el-step.is-horizontal .el-step__line {
top: 14px;
left: 120px;
right: 4%;
}
.el-step__icon-inner {
color: rgba(0, 0, 0, 0.25);
}
.el-step__head.is-finish {
color: #ffffff;
border-color: #5850ff;
}
.el-step__desc {
position: absolute;
display: inline-block;
top: -5px;
left: 36px;
width: 134px;
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 24px;
}
.el-step__head.is-finish .el-step__icon-inner {
color: #ffffff;
}
.el-step__head.is-finish .el-step__line {
background: #5850ff;
}
.el-step__head.is-finish .el-step__icon.is-text {
background-color: #5850ff;
}
.el-step__title {
font-size: 16px;
line-height: 24px;
}
.el-step__description {
font-size: 13px;
}
.el-step__title.is-wait {
color: #999999;
}
.el-step__title.is-finish {
color: #333333;
font-weight: 700;
}
.drainage-emp {
display: flex;
margin-top: 6px;
flex-wrap: wrap;
div {
text-align: left;
position: relative;
font-size: 14px;
line-height: 14px;
padding-left: 15px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 6px;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
i {
color: #75acff;
}
}
}
.dialog-wrap-box {
z-index: 2001;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.5);
.dialog-wrap-panel {
background: #ffffff;
position: absolute;
top: 50%;
left: 10%;
transform: translateY(-50%);
width: 80%;
padding: 40px;
box-sizing: border-box;
.dialog-wrap-items {
margin-top: 60px;
display: flex;
justify-content: space-between;
.dialog-wrap-item {
width: 200px;
height: 350px;
border: 1px solid #999999;
}
}
.dialog-wrap-footer {
display: flex;
justify-content: space-between;
width: 80%;
margin: 30px auto 0px;
}
}
}
.drainage-wrap {
margin-bottom: 20px;
.drainage-title {
padding-left: 20px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 57px;
height: 57px;
border-bottom: 1px solid #d8d8d8;
}
.form-main {
display: flex;
.form-image {
width: 280px;
height: 546px;
margin: 20px 10px;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
}
}
img {
width: 100%;
height: auto;
}
}
.drainage-form {
flex: 1;
}
}
.form-tips {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-top: 5px;
}
.drainage-form {
padding: 20px;
.drainage-form-item {
display: flex;
margin-top: 20px;
label {
width: 140px;
text-align: right;
margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
}
&.is-require {
padding-left: 20px;
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
}
}
/deep/ {
.el-textarea__inner {
border-radius: 0px;
border: 1px solid #dcdfe6;
}
}
.tag-item-panel {
display: flex;
}
.select-panel {
padding-left: 20px;
background: #fff;
display: flex;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 30px;
border: 1px solid #dcdfe6;
border-top: 0px;
width: 580px!important;
box-sizing: border-box;
> div {
cursor: pointer;
margin-right: 10px;
span {
margin-left: 3px;
}
}
}
.upload-box {
margin-bottom: 10px;
.upload-file-panel {
display: flex;
align-items: center;
> a {
margin-left: 10px;
text-decoration: underline;
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
}
}
.upload-btn {
text-align: center;
width: 96px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #dcdfe6;
font-size: 14px;
font-weight: 400;
color: #999999;
padding: 6px 0px;
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.message-panel {
// background: #f7f7f7;
// border: 1px solid #dcdfe6;
padding: 20px;
flex: 1;
box-sizing: border-box;
font-size: 14px;
color: #3a3a3a;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.drainage-coutom-count {
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 36px;
margin-left: 20px;
}
}
.drainage-panel {
padding: 20px;
.drainage-config-wrap {
display: flex;
justify-content: space-between;
align-items: center;
.drainage-item-label {
width: 50%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.config-title {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 40px;
height: 40px;
margin: 8px 0px;
span {
cursor: pointer;
}
i {
margin-left: 6px;
}
}
.config-market {
display: flex;
&-item {
position: relative;
padding: 10px;
width: 50%;
height: 150px;
background: #f6f6ff;
border-radius: 4px;
opacity: 0.8;
box-sizing: border-box;
&:first-child {
margin-right: 20px;
}
&.checked {
border: 1px solid #5850ff;
.config-market-title {
color: #5850ff;
}
.config-market-icon {
background: linear-gradient(153deg, #8085ef 0%, #6f76ee 100%, #6f76ee 100%) !important;
}
.config-market-name {
color: #333333 !important;
}
.config-line {
border: 1px solid #5850ff !important;
}
}
.config-market-title {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
text-align: center;
}
.config-switch-icon {
position: absolute;
right: 10px;
top: 10px;
}
.config-market-select {
display: flex;
.config-market-s1 {
width: 33.33%;
margin: 0 auto;
text-align: center;
position: relative;
.config-line {
position: absolute;
top: 45px;
right: -30%;
width: 60%;
border: 1px solid #999999;
}
.config-market-icon {
width: 56px;
height: 56px;
background: #999999;
border-radius: 50%;
margin: 20px auto 10px;
}
.config-market-name {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 20px;
}
}
}
}
}
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
<template>
<div class="squre-main">
<div class="squre-title">
数据魔方
<span>智能分析客户数据,自动人群分类,推荐策略。</span>
</div>
<div class="squre-safe-panel scrm-box-f" v-loading="loading" :style="{ 'min-height': boxHeight + 'px' }">
<div class="dialog-step">
<div class="el-steps el-steps--horizontal">
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div class="el-step__head is-finish">
<div :class="['el-step__line', activeIndex > 1 ? 'is-finish' : '']" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: 0ms; border-width: 0px; width: 0%"></i>
</div>
<div :class="['el-step__icon', activeIndex == 1 ? 'is-text' : '']">
<div class="el-step__icon-inner" v-if="activeIndex > 1"><i class="el-icon-check"></i></div>
<div class="el-step__icon-inner" v-else>1</div>
</div>
<div class="el-step__main el-step__desc">
<div :class="['el-step__title', activeIndex == 1 ? 'is-finish' : '']">第一步</div>
<div :class="['el-step__sub', activeIndex == 1 ? 'is-finish' : '']">选择数据文件</div>
</div>
</div>
</div>
<div class="el-step is-horizontal" style="flex-basis: 50%; margin-right: 0px">
<div :class="['el-step__head', activeIndex > 1 ? 'is-finish' : '']">
<div :class="['el-step__line', activeIndex > 2 ? 'is-finish' : '']" style="margin-right: 0px">
<i class="el-step__line-inner" style="transition-delay: -150ms; border-width: 0px; width: 0%"></i>
</div>
<div :class="['el-step__icon', activeIndex == 2 ? 'is-text' : '']">
<!---->
<div class="el-step__icon-inner" v-if="activeIndex > 2"><i class="el-icon-check"></i></div>
<div class="el-step__icon-inner" v-else>2</div>
</div>
<div class="el-step__main el-step__desc">
<div :class="['el-step__title', activeIndex == 2 ? 'is-finish' : '']">第二步</div>
<div :class="['el-step__sub', activeIndex == 2 ? 'is-finish' : '']">上传数据文件</div>
</div>
</div>
</div>
<div class="el-step is-horizontal is-flex" style="flex-basis: 50%; max-width: 33.3333%">
<div :class="['el-step__head', activeIndex > 2 ? 'is-finish' : '']">
<div class="el-step__line"><i class="el-step__line-inner"></i></div>
<div :class="['el-step__icon', activeIndex == 3 ? 'is-text' : '']">
<!---->
<div class="el-step__icon-inner">3</div>
</div>
<div class="el-step__main el-step__desc">
<div :class="['el-step__title', activeIndex == 3 ? 'is-finish' : '']">第三步</div>
<div :class="['el-step__sub', activeIndex == 3 ? 'is-finish' : '']">完成</div>
</div>
</div>
</div>
</div>
</div>
<div class="upload-list">
<!-- <component :is="stepName"></component> -->
<step-first v-show="stepName == 'stepFirst'" ref="firstForm"></step-first>
<step-second v-show="stepName == 'stepSecond'" ref="secondForm" @handleSuccess="handleSuccess" @excelCancel="excelCancel"></step-second>
<step-third v-show="stepName == 'stepThird'" ref="thirdForm"></step-third>
</div>
</div>
<GLFooter>
<el-button type="primary" @click="handleNext" v-show="activeIndex == 1">下一步</el-button>
<el-button type="primary" @click="goBack" v-show="activeIndex == 3">返回魔方</el-button>
</GLFooter>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import stepFirst from './components/step-first.vue'
import stepSecond from './components/step-second.vue'
import stepThird from './components/step-third.vue'
export default {
components: { stepFirst, stepSecond, stepThird },
name: 'import',
data() {
return {
boxHeight: 0,
swiperList: ['加密传输', '脱敏传输', '去标识化', '限制访问'],
autoplay: true,
loading: false,
importName: '',
borderhover: false, //文件拖拖动到区域的hover效果
imgArr: [],
fileData: [],
fileInfo: '',
activeIndex: 1,
staffIds: [],
active: 1
}
},
computed: {
stepName() {
let status = ''
switch (this.activeIndex) {
case 1:
status = 'stepFirst'
break
case 2:
status = 'stepSecond'
break
case 3:
status = 'stepThird'
break
}
return status
}
},
methods: {
goBack() {
this.$router.push('/square/index')
},
// 从网络上读取某个excel文件,url必须同域,否则报错
readWorkbookFromRemoteFile() {
var xhr = new XMLHttpRequest()
xhr.open('get', 'https://img01.glsx.com.cn/upload/biz/魔方导入模板v1_0_2_20210117_1.xlsx', true)
xhr.responseType = 'arraybuffer'
xhr.onload = function(e) {
if (xhr.status == 200) {
var data = new Uint8Array(xhr.response)
var workbook = XLSX.read(data, { type: 'array' })
var tabelHeader = ''
for (var sheet in workbook.Sheets) {
if (workbook.Sheets.hasOwnProperty(sheet)) {
tabelHeader = XLSX.utils.sheet_to_json(workbook.Sheets[sheet])
// break; // 若是只取第一张表,就取消注释这行
}
}
if (tabelHeader && tabelHeader.length > 0) {
this.tabelHeaderTwo = Object.keys(tabelHeader[0])
}
console.log(this.tabelHeaderTwo)
}
}
xhr.send()
},
handleSuccess() {
this.activeIndex = 3
},
excelCancel() {
this.activeIndex = 1
},
changeItem(e) {
this.active = e + 1
},
setActiveItem(index) {
this.autoplay = false
this.active = index + 1
this.$refs.carousel.setActiveItem(index)
},
delHandleMouseEnter() {
this.$refs.carousel.handleMouseEnter = () => {}
},
handleNext() {
let uploadInfo = this.$refs.firstForm.getUploadInfo()
uploadInfo.fileList = uploadInfo.fileList.filter(item => item.fileInfo)
if (uploadInfo) {
this.activeIndex++
this.$refs.secondForm.startUpload(uploadInfo)
}
},
changeInput(e) {
this.uploadFile(e.target.files[0])
},
readExcel(file) {
// 解析Excel
let _this = this
return new Promise(function(resolve, reject) {
// 返回Promise对象
const reader = new FileReader()
reader.onload = e => {
// 异步执行
try {
// 以二进制流方式读取获得整份excel表格对象
var data = e.target.result,
workbook = XLSX.read(data, { type: 'binary' })
} catch (e) {
reject(e.message)
}
// 表格的表格范围,可用于判断表头是否数量是否正确
var fromTo = ''
// 遍历每张表读取
for (var sheet in workbook.Sheets) {
let sheetInfos = workbook.Sheets[sheet]
let locations = [] // A1,B1,C1...
if (workbook.Sheets.hasOwnProperty(sheet)) {
fromTo = sheetInfos['!ref'] // A1:B5
locations = _this.getLocationsKeys(fromTo)
}
for (let i = 0; i < locations.length; i++) {
let value = sheetInfos[locations[i]].v
if (value != i) {
// 自定的校验规则,自由实现便可
// 校验失败reject
reject(locations[i] + "'s parameter isn't " + i)
}
}
// 校验成功resolve
resolve(true)
}
}
reader.readAsBinaryString(file)
})
},
getHeaderRow(sheet) {
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
headers.push(hdr)
}
return headers
},
uploadFile(file) {
const reader = new FileReader()
reader.onload = e => {
/* 解析数据 */
const bstr = e.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
const ws = wb.Sheets[wsname]
/* 数组转换 */
const data = XLSX.utils.sheet_to_json(ws, { header: 1 })
/* 进行表格数据更新 */
if (data && data.length > 0) {
this.tabelHeader = data[0]
}
/* 进行表格表头数据更新 */
this.getHeaderRow(ws)
}
reader.readAsBinaryString(file)
// let AllImgExt = '.xls|.xlsx'
// let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
// console.log(extName)
// if (AllImgExt.indexOf(extName) === -1) {
// this.$message.error('上传格式不正确')
// return false
// }
// const size = e.size / 1024 / 1024
// if (size < 9) {
// // // 转码base64
// const reader = new FileReader()
// reader.readAsDataURL(e)
// reader.onload = event => {
// const imgFile = event.target.result
// const arrBase64 = imgFile.split(',')
// const fileInfo = e.name.split('.')[1] + '@' + arrBase64[1]
// this.$apis.common.pictureUpload({ file: fileInfo }).then(res => {
// this.fileInfo = res
// this.importName = e.name
// this.$refs.file.value = ''
// })
// }
// } else {
// this.$message.error('上传文件不可超过9M')
// }
},
handleSubmit() {
if (!this.fileInfo) {
this.$message.error('请上传文件')
return
}
this.loading = true
this.$apis.square.importsUpload({ fileUrl: this.fileInfo }).then(res => {
this.loading = false
if (res) {
this.$store.dispatch('square/setImport', res)
this.$router.push('/square/importResult/' + res.id)
}
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 280
// this.readWorkbookFromRemoteFile()
}
}
</script>
<style lang="scss" scoped>
.squre-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
span {
margin-left: 4px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 14px;
}
}
.dialog-step {
width: 80%;
margin: 0 auto 80px;
}
.el-steps {
transform: translateX(-30px);
}
.el-step.is-vertical .el-step__head {
width: 32px;
}
.el-step__line {
background: rgba(0, 0, 0, 0.15);
}
.el-step__icon {
width: 32px;
height: 32px;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 50%;
}
.el-step.is-horizontal .el-step__line {
top: 14px;
left: 120px;
right: 4%;
}
.el-step__icon-inner {
color: #c6c6c6;
}
.el-step__head.is-finish {
color: #ffffff;
border-color: #5850ff;
}
.el-step__desc {
position: absolute;
display: inline-block;
top: -5px;
left: 42px;
width: 134px;
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 24px;
}
.el-step__head.is-finish .el-step__icon-inner {
color: #5850ff;
}
.el-step__head.is-finish .el-step__line.is-finish {
background: #5850ff;
}
.el-step__head.is-finish .el-step__icon {
border-color: #5850ff;
border-radius: 50%;
// background: #5850ff;
}
.el-step__head.is-finish .el-step__icon.is-text {
border-color: #5850ff;
background: #5850ff;
}
.el-step__icon.is-text .el-step__icon-inner {
color: #ffffff;
}
.el-step__title {
font-size: 16px;
line-height: 24px;
font-weight: 500;
color: rgba(0, 0, 0, 0.65);
}
.el-step__sub {
font-size: 14px;
line-height: 24px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
}
.el-step__description {
font-size: 13px;
}
.el-step__title.is-wait {
font-weight: 400;
}
.el-step__title.is-finish {
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.el-step__sub.is-finish {
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.image-uploader {
position: relative;
height: 40px;
display: flex;
margin: 20px 0px;
justify-content: center;
input {
cursor: pointer;
position: absolute;
top: 0px;
width: 35px;
height: 35px;
font-size: 0px;
}
/deep/ {
.el-upload-list {
display: none;
}
}
}
.squre-safe-panel {
padding: 40px;
margin-top: 10px;
margin-bottom: 16px;
/deep/ {
.el-carousel__indicators,
.el-carousel__arrow {
display: none;
}
}
.safe-upload-panel {
margin: 20px auto;
padding: 20px;
box-sizing: border-box;
width: 384px;
height: 214px;
background: rgba(0, 0, 0, 0.02);
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
.safe-upload-icon {
i {
font-size: 35px;
color: #5850ff;
}
}
.safe-upload-tips {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.safe-upload-xl {
font-size: 12px;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
line-height: 20px;
}
.safe-upload-link {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 22px;
margin-top: 10px;
cursor: pointer;
}
}
.safe-upload-footer {
width: 300px;
display: flex;
justify-content: center;
margin: 0 auto;
}
.squre-safe-title {
text-align: center;
font-size: 32px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 40px;
}
.swiper-container {
width: 70%;
margin: 40px auto;
.swiper-wrap {
display: flex;
justify-content: center;
text-align: center;
.swiper-wrap-item {
width: 20%;
font-size: 24px;
font-weight: 300;
color: #464646;
line-height: 32px;
letter-spacing: 2px;
cursor: pointer;
&.checked {
color: #1d39c4;
font-weight: 600;
}
}
}
.swiper-container-content {
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 24px;
margin-right: 80px;
}
.swiper-container-panel {
padding: 40px;
box-sizing: border-box;
margin: 40px 0px;
height: 328px;
background: #ffffff;
border-radius: 2px;
display: flex;
justify-content: space-between;
align-items: center;
.swiper-container-image {
img {
height: 248px;
width: auto;
}
}
}
}
}
</style>
<template>
<div class="squre-main">
<el-button type="primary" size="small" @click="goBack">返回</el-button>
<div class="squre-success-panel scrm-box-f">
<!-- <div class="contact-us-wrap">
<img src="@/assets/img/qrcode.png" />
<div class="contact-us-about">联系我们</div>
</div> -->
<div class="squre-success-image"><i class="el-icon-success"></i></div>
<div class="squre-success-tips">提交成功</div>
<div class="squre-success-content">所提交的数据已经过加密,并安全存储专属加密区。</div>
<div class="squre-success-content">针对导入的结果有疑问请扫码联系我们,我们将为您提供专业答疑和营销推荐。</div>
<div class="squre-success-footer">
<div class="squre-success-item">
<div class="success-item-title">本次导入总客户数</div>
<div class="success-item-num">{{ detailInfo.importNumber }}</div>
</div>
<div class="squre-success-item">
<div class="success-item-title">新导入客户数</div>
<div class="success-item-num">{{ detailInfo.newCustomerNumber }}</div>
</div>
<div class="squre-success-item">
<div class="success-item-title">企微客户占比</div>
<div class="success-item-num">{{ detailInfo.entmicroNumber }}/{{ detailInfo.importNumber }}</div>
</div>
</div>
<div class="squre-tips" v-if="importData.errorNum">
<i class="el-icon-warning"></i>
本次导入共有{{ importData.errorNum }}条异常数据,请点击
<a :href="importData.errorDataUrl">下载</a>
获取明细
</div>
</div>
<div class="custom-title">客户分群营销</div>
<div class="custom-wrap">
<div class="custom-wrap-item">
<div class="custom-wrap-itemBox">
<div class="custom-wrap-title">待添加企微客户</div>
<div class="custom-wrap-sta">
<div class="custom-count-item">
<div class="custom-count-title">属于本次导入</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitAddEntmicroNumber }}人</div>
</div>
<div class="custom-count-item">
<div class="custom-count-title">人群累计人数</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitAddEntmicroTotal }}人</div>
</div>
</div>
<div class="custom-wrap-content">当前客户池中,尚未匹配到企微账号的数量。推荐使用以下营销策略,吸引用户添加企微。</div>
<div class="custom-wrap-config" @click="jumpDrainage">营销配置</div>
</div>
</div>
<div class="custom-wrap-item">
<div class="custom-wrap-itemBox">
<div class="custom-wrap-title">待续保客户</div>
<div class="custom-wrap-sta">
<div class="custom-count-item">
<div class="custom-count-title">属于本次导入</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitRenewalNumber }}人</div>
</div>
<div class="custom-count-item">
<div class="custom-count-title">人群累计人数</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitTotal }}人</div>
</div>
</div>
<div class="custom-wrap-content">提前给车险快到期的用户自动推荐适合该客户的优惠服务,提高客户续保率。</div>
<div class="custom-wrap-config">敬请期待</div>
</div>
</div>
<div class="custom-wrap-item">
<div class="custom-wrap-itemBox">
<div class="custom-wrap-title">待首保客户</div>
<div class="custom-wrap-sta">
<div class="custom-count-item">
<div class="custom-count-title">属于本次导入</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitRegularMaintainNumber }}人</div>
</div>
<div class="custom-count-item">
<div class="custom-count-title">人群累计人数</div>
<div class="custom-count-num" @click="jumpDetail">{{ detailInfo.waitRegularMaintainTotal }}人</div>
</div>
</div>
<div class="custom-wrap-content">智能提醒用户回店首保,提高用户返店率。</div>
<div class="custom-wrap-config">敬请期待</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'importResult',
data() {
return {
detailInfo: {},
importData: {}
}
},
methods: {
goBack() {
this.$router.push('/square/index')
},
jumpDrainage() {
this.$router.push('/square/drainage')
},
jumpDetail() {
// this.$router.push('/square/customDetail')
},
importsKey() {
this.importData = this.$store.getters.square.importData
let { id } = this.$route.params
this.$apis.square.importsKey({ id }).then(res => {
this.detailInfo = res
})
}
},
mounted() {
this.importsKey()
},
beforeDestroy() {
this.$store.dispatch('square/setImport', {})
}
}
</script>
<style lang="scss" scoped>
.squre-success-panel {
margin-top: 20px;
position: relative;
.contact-us-wrap {
position: absolute;
top: 0px;
right: 0px;
width: 144px;
height: 191px;
background: #ffffff;
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05);
text-align: center;
img {
width: 124px;
height: 124px;
margin: 15px 0px;
}
.contact-us-about {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
}
}
.squre-success-image {
padding-top: 45px;
text-align: center;
i {
font-size: 64px;
color: #73d13d;
}
}
.squre-success-tips {
text-align: center;
font-size: 24px;
font-weight: 500;
color: #000000;
line-height: 32px;
margin: 20px 0px 10px;
}
.squre-success-content {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
}
.squre-success-footer {
display: flex;
.squre-success-item {
width: 33.33%;
text-align: center;
margin: 20px auto;
.success-item-title {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.success-item-num {
font-size: 30px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 38px;
}
}
}
.squre-tips {
padding: 20px;
font-size: 16px;
font-weight: 500;
color: #424242;
line-height: 28px;
a {
cursor: pointer;
text-decoration: underline;
color: #5850ff;
}
i {
color: #f56c6c;
}
}
}
.custom-title {
margin: 20px 0px;
font-size: 20px;
font-weight: 500;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.custom-wrap {
display: flex;
.custom-wrap-item {
box-sizing: border-box;
width: 33.33%;
padding: 30px 0px;
text-align: center;
height: 334px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-right: 20px;
&:last-child {
margin-right: 0px;
}
.custom-wrap-itemBox {
width: 70%;
margin: 0 auto;
}
.custom-wrap-title {
font-size: 20px;
font-weight: 500;
color: #424242;
line-height: 28px;
}
.custom-wrap-sta {
display: flex;
justify-content: space-between;
margin: 20px 0px;
.custom-count-title {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.custom-count-num {
font-size: 20px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 34px;
cursor: pointer;
}
}
.custom-wrap-content {
font-size: 14px;
font-weight: 500;
color: #a3a3a3;
line-height: 20px;
text-align: left;
height: 110px;
}
.custom-wrap-config {
cursor: pointer;
margin: 10px auto;
display: inline-block;
border-radius: 4px;
border: 1px solid #5850ff;
padding: 7px 28px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 14px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="square-main" v-loading="loading">
<div class="square-title">
<span>数据魔方</span>
<el-popover placement="top" width="400" trigger="hover" content="通过导入的客户基础信息,过滤出系统策略所匹配的目标营销人群,从而引导门店分门别类的配置营销方案,并监控实施效果。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
<div class="square-num-box">
<div class="square-num-item">
<div class="square-num-title">魔方导入客户数</div>
<div class="square-num-count">
<span class="detail-content">
{{ countAll.magicCount | overThousandFilter }}
<div @click="jumpDetail(0)" class="detail-btn" fn="客户明细" mode="label"></div>
</span>
</div>
</div>
<div class="square-num-item">
<div class="square-num-title">魔方客户匹配企微数</div>
<div class="square-num-count">
<span class="detail-content">
{{ countAll.qyCount | overThousandFilter }}
<div @click="jumpDetail(1)" class="detail-btn" fn="客户明细" mode="label"></div>
</span>
</div>
</div>
</div>
<div class="coustom-box-container">
<div class="square-title">客户分群营销</div>
<div class="coustom-box">
<div class="coustom-box-item">
<div class="coustom-box-title">待添加企微客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unQyCount | overThousandFilter }}
<label>人</label>
<div @click="jumpDetailGroup" class="detail-btn" fn="客户明细" mode="label"></div>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">当前客户池中,尚未匹配到企微账号的数量。推荐使用以下营销策略,吸引用户添加企微。</div>
<div class="coustom-box-config">
<GLButton class="coustom-box-btn" @click="jumpDrainage" fn="客户引流企微" mode="div">营销配置</GLButton>
</div>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">信息待完善客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unInfoCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">当前客户池中,有企微客户尚未维护手机号码。建议批量通知对应的销售顾问维护此类客户信息。</div>
<div class="coustom-box-config">
<GLButton class="coustom-box-btn" @click="jumpFriend" fn="客户资料跟进" mode="div">营销配置</GLButton>
</div>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">待续保客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRenewCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">提前给车险快到期的用户自动推荐适合该客户的优惠服务,提高客户续保率。</div>
<div class="coustom-box-config"><div class="coustom-box-btn coustom-box-wait">敬请期待</div></div>
</div>
<div class="coustom-box-item">
<div class="coustom-box-title">待首保客户</div>
<div class="coustom-echart">
<div class="coustom-echart-desc">
<div class="coustom-echart-num">
<span class="detail-content">
{{ countAll.unRegularCount | overThousandFilter }}
<label>人</label>
</span>
</div>
</div>
</div>
<div class="coustom-box-content">智能提醒用户回店首保,提高用户返店率。</div>
<div class="coustom-box-config"><div class="coustom-box-btn coustom-box-wait">敬请期待</div></div>
</div>
</div>
</div>
<div class="square-tabel scrm-box-f">
<div class="square-tabel-form">
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="tabel-container-tips">
<div class="tabel-tips">
<span>数据列表</span>
<i class="el-icon-warning-outline"></i>
数据已处理: 表示所导出的数据已进入系统。由于每个系统标签的统计规则不同,具体更新时间有所差异。
</div>
<GLButton plain size="small" @click="handleImport" fn="导入数据">
导入数据
</GLButton>
</div>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="state" slot-scope="scope">
<span :class="['task_icon', scope.scope.state == 1 ? 'green-icon' : 'yellow-icon']"></span>
{{ scope.scope.state == 1 ? '已处理' : '处理中' }}
</div>
<div slot="importNumber" slot-scope="scope">
<div class="number-form">
<span>{{ scope.scope.entmicroNumber }}</span>
|
<span>{{ scope.scope.importNumber }}</span>
</div>
</div>
<div slot="newCostomerNumber" slot-scope="scope">
<div class="number-form">
<span>{{ scope.scope.newCustomerNumber }}</span>
|
<span>{{ scope.scope.importNumber }}</span>
</div>
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<a type="text" :href="scope.scope.failDataUrl" v-if="scope.scope.state == 1 && scope.scope.failDataUrl">异常数据</a>
</div>
</GLTable>
</div>
</div>
<div class="dialog-wrap-box" v-show="dialogVisible">
<div class="dialog-wrap-panel">
<div class="dialog-wrap-items">
<div class="dialog-wrap-item">
<div class="dialog-item-title">客户智能分群</div>
<div class="dialog-item-image">
<img src="@/assets/img/square/coutom1.png" />
</div>
<div class="dialog-item-content">通过企微客户及导入的客户基础数据,识别针对未匹配到企微的客户系统提供全套智能引流方案。</div>
</div>
<div class="dialog-wrap-item">
<div class="dialog-item-title">自动匹配营销策略</div>
<div class="dialog-item-image">
<img src="@/assets/img/square/coutom3.png" />
</div>
<div class="dialog-item-content">系统识别客户所处的营销场景,如待定保、待续保,配合智能外呼及智能短信推送营销活动,降低跟进客户的成本。</div>
</div>
<div class="dialog-wrap-item">
<div class="dialog-item-title">支持多种数据对接模式</div>
<div class="dialog-item-image">
<img src="@/assets/img/square/coutom2.png" />
</div>
<div class="dialog-item-content">支持按需手动导入客户数据以供分析;支持API对接同步客户数据,大幅降低客户数据维护难度,提高运营时效性。</div>
</div>
<div class="footer-btn" @click="dialogVisible = false">我知道啦</div>
</div>
</div>
</div>
</div>
</template>
<script>
// import echartCircle from './components/echartCircle'
export default {
name: 'square',
data() {
return {
loading: false,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
},
crowdId: '',
createTime: '',
countAll: {},
dialogVisible: false,
tableSearchForm: {
createTime: '',
state: null
},
searchFormData: [
{
label: '导入时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
},
{
label: '数据处理状态',
name: 'state',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '已处理'
},
{
value: '0',
label: '处理中'
}
]
}
],
// pickerOptions: {
// disabledDate: time => {
// return time.getTime() > Date.now()
// }
// },
getListApi: this.$apis.square.importsRecord,
tableParams: {
listName: 'data',
tableOption: false,
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '导入批次',
prop: 'batchNumber'
},
{
label: '导入时间',
prop: 'createdTime',
formatter: cellValue => {
return new Date(cellValue.createdTime).toLocaleDateString() + ' ' + new Date(cellValue.createdTime).toLocaleTimeString()
}
},
{
label: '数据处理状态',
prop: 'state',
addHtml: 'state'
// formatter: cellValue => {
// return cellValue.state == 1 ? '已处理' : '处理中'
// }
},
{
label: '导入人员',
prop: 'createdStaff'
},
{
label: '备注',
prop: 'remarks'
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
methods: {
importsCount() {
this.$apis.square.importsCount({}).then(res => {
if (res) {
this.countAll = res
}
})
},
handleReset() {
this.tableSearchForm = {}
this.createTime = null
this.handleSearch()
},
handleSearch() {
this.$refs.employeeRef.refreshTable()
},
jumpDrainage() {
this.$router.push('/square/drainage')
},
jumpFriend() {
this.$router.push('/friends/index/2')
},
handleDetail(scope) {
this.$router.push('/square/importResult/' + scope.id)
},
handleImport() {
this.$router.push('/square/import')
},
jumpDetail(status) {
let url
if (status) {
url = `/custom/clientManage/index?isJoin=${status}&addWay=数据魔方`
} else {
url = `/custom/clientManage/index?addWay=数据魔方`
}
this.$history.push(url)
},
jumpDetailGroup() {
this.$history.push(`/custom/clientDataOverview/group/${this.crowdId}/1`)
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.startTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
resolve()
})
},
findLogin() {
this.$apis.square.findLoginCount({ loginType: 1005 }).then(res => {
if (res) {
this.dialogVisible = true
}
})
},
datacubeNotice() {
this.$apis.square.datacubeNotice({}).then(res => {
if (res && res.length) {
for (let k of res) {
setTimeout(() => {
this.$notify({
title: '数据魔方已处理完成',
message: '批次' + k,
type: 'success',
duration: 2000
})
}, 100)
}
}
})
},
queryCrowdTree() {
this.loading = true
const params = {
req: {
pageSize: 1000,
pageNum: 1,
merchantId: this.$globalState.session.merchantId,
crowdType: 1
}
}
console.log('???')
this.$apis.square.queryCrowdTree(params).then(res => {
this.loading = false
if (res && res.crowdUnitList) {
const crowdUnitList = res.crowdUnitList.find(item => item.crowdName == '基盘未加企微客户')
this.crowdId = crowdUnitList ? crowdUnitList.crowdId : ''
}
})
}
},
mounted() {
this.importsCount()
this.findLogin()
this.datacubeNotice()
this.queryCrowdTree()
},
beforeDestroy() {
this.$notify.closeAll()
}
}
</script>
<style lang="scss" scoped>
.green-icon {
background: #2cca74;
}
.yellow-icon {
background: #fdb757;
}
.detail-content {
position: relative;
}
.detail-btn {
display: inline-block;
position: absolute;
cursor: pointer;
opacity: 0;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
}
.detail-btn::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: brown;
}
.number-form {
span {
display: inline-block;
min-width: 80px;
text-align: left;
&:first-child {
text-align: right;
}
}
}
.dialog-wrap-box {
z-index: 2001;
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.5);
.dialog-wrap-panel {
background: #ffffff;
position: absolute;
top: 50%;
left: 10%;
transform: translateY(-50%);
height: 360px;
width: 80%;
.dialog-wrap-items {
position: relative;
display: flex;
width: 100%;
height: 360px;
.footer-btn {
cursor: pointer;
position: absolute;
bottom: -50px;
left: 50%;
text-align: center;
width: 120px;
margin-left: -60px;
height: 34px;
line-height: 34px;
background: #5850ff;
border-radius: 4px;
font-size: 14px;
color: #ffffff;
}
}
.dialog-wrap-item {
padding: 30px;
width: 33.33%;
text-align: center;
border-right: 1px solid #eeeeee;
.dialog-item-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
}
img {
width: 200px;
height: auto;
margin: 20px;
}
.dialog-item-content {
font-size: 14px;
width: 240px;
margin: 0 auto;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
}
.square-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
img {
width: 14px;
height: 14px;
margin-top: 3px;
margin-left: 18px;
}
}
.square-num-box {
height: 102px;
margin: 20px 0px;
background: #ffffff;
display: flex;
.square-num-item {
width: 50%;
padding-left: 20px;
text-align: center;
&:first-child {
position: relative;
&::after {
content: '';
position: absolute;
top: 18px;
right: 0px;
width: 1px;
height: 62px;
background: #f0f0f0;
}
}
.square-num-title {
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.square-num-count {
font-size: 30px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 38px;
}
}
}
.coustom-box-container {
margin-top: 16px;
background: #ffffff;
.square-title {
height: 55px;
border-bottom: 1px solid #e8e8ea;
line-height: 55px;
padding-left: 20px;
}
.coustom-box {
display: flex;
padding: 20px;
&-item {
box-sizing: border-box;
width: 25%;
margin-right: 20px;
height: 271px;
border-radius: 4px;
border: 1px solid #e9e6f5;
&:last-child {
margin-right: 0px;
}
.coustom-box-title {
font-size: 16px;
font-weight: 600;
color: #333;
line-height: 28px;
letter-spacing: 1px;
height: 56px;
line-height: 56px;
background: #f4f4fc;
border-radius: 4px;
padding-left: 24px;
}
.coustom-echart {
margin-top: 30px;
padding-left: 24px;
.coustom-echart-desc {
margin-left: 10px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
.coustom-echart-num {
font-size: 26px;
font-weight: bold;
color: rgba(0, 0, 0, 0.85);
line-height: 32px;
label {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
}
.coustom-box-content {
margin-top: 20px;
font-size: 14px;
font-weight: 500;
color: #a3a3a3;
line-height: 20px;
text-align: left;
padding: 0px 24px;
height: 72px;
box-sizing: border-box;
}
.coustom-box-config {
text-align: center;
.coustom-box-btn {
cursor: pointer;
margin: 10px auto;
display: inline-block;
border-radius: 4px;
border: 1px solid #5850ff;
padding: 7px 0px;
width: calc(100% - 46px);
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 14px;
&.coustom-box-wait {
color: #999999;
border: 1px solid #e5e5e5;
}
}
}
}
}
}
.tabel-container-tips {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
/deep/ .el-button--small {
border: 1px solid #5850ff;
color: #5850ff;
}
.tabel-tips {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
span {
color: #333333;
font-size: 18px;
font-weight: 600;
}
i {
color: #999999;
margin-left: 5px;
}
}
}
.square-tabel {
padding: 20px;
margin-top: 16px;
}
.table-btns a {
color: #5850ff;
}
</style>
<template>
<div class="content-wrap" v-loading="loading">
<div class="tree-input">
<el-input placeholder="请输入标签组或标签关键字" v-model="filterText" size="small"><i slot="suffix" class="el-input__icon el-icon-search"></i></el-input>
<span @click="resetTree">重置</span>
</div>
<el-tree @node-expand="nodeExpand" accordion @check="checkChange" class="tag-tree" ref="tagTree" :data="labelTree" :props="defaultProps" @node-click="nodeClick" show-checkbox node-key="id" :default-expanded-keys="expandId" :expand-on-click-node="false" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<el-tooltip placement="top" v-if="hoverId == data.id && hoverStatus">
<span :class="['tree-node', `node_${data.id}`]" slot="content">
{{ node.label }}
</span>
<span :class="['tree-node', `node_${data.id}`]">
{{ node.label }}
</span>
</el-tooltip>
<span :class="['tree-node', `node_${data.id}`]" v-else @mouseenter="hoverFun(data)">
{{ node.label }}
</span>
<!-- 暂时不做编辑功能 -->
<!-- <span v-if="data.labelType && data.labelType != '系统标签' && isShowEditBtn(data.labelDTO)" @click.stop="editTree(data)">
<i class="el-icon-edit-outline"></i>
</span> -->
</div>
</el-tree>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/tagsManage'
export default {
name: 'tagGroup',
data() {
return {
hoverId: '',
hoverStatus: false,
expandId: [],
loading: false,
heightBox: 200,
dialogVisible: false,
filterText: '',
selectNum: 0,
searchStatus: false,
labelTree: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tagTree.filter(val)
}
},
methods: {
hoverFun(data) {
this.hoverId = data.id
this.hoverStatus = document.querySelector(`.node_${data.id}`).scrollWidth > 140
},
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 == '企业标签' || row.labelType == '集团标签') {
return false
}
return true
}
}
return true //门店版都显示编辑按钮
},
nodeClick(data) {
!data.sort && document.querySelector(`.node_${data.id}`).parentElement.previousElementSibling.click()
},
handleScroll(height) {
document.querySelector('.tag-tree').scrollTop = height
},
resetTree() {
this.filterText = ''
this.$parent.searchForm = {}
this.$refs.tagTree.setCheckedKeys([])
this.$nextTick(() => {
this.$emit('getCheckItem', this.$refs.tagTree)
})
},
filterNode(value, data, node) {
if (!value) return true
return data.name.indexOf(value) !== -1
// let val = value.toLowerCase()
// this.$nextTick(() => {
// this.setTreeHeight()
// })
// return this.chooseNode(val, data, node) // 调用过滤二层方法
},
chooseNode(value, data, node) {
if (data.name.indexOf(value) !== -1) {
return true
}
const level = node.level
// 如果传入的节点本身就是一级节点就不用校验了
if (level === 1) {
return false
}
// 先取当前节点的父节点
let parentData = node.parent
// 遍历当前节点的父节点
let index = 0
while (index < level - 1) {
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
if (parentData.data.name.indexOf(value) !== -1) {
return true
}
// 否则的话再往上一层做匹配
parentData = parentData.parent
index++
}
// 没匹配到返回false
return false
},
//勾选
checkChange() {
this.$emit('getCheckItem', this.$refs.tagTree)
},
getTreeNode(item) {
let tree_id = []
item.forEach(group_item => {
group_item.children.forEach(label_item => {
label_item && tree_id.push(label_item.id)
})
})
this.$refs.tagTree.setCheckedKeys(tree_id)
},
editTree(data) {
this.$emit('editTag', 'edit', data.labelDTO)
},
updateTreeNode() {
this.getTreeNode(this.$parent.tagCheckItem)
this.$emit('getCheckItem', this.$refs.tagTree)
},
// 获取标签树
getTableList(status) {
this.labelTree = []
let params = {
labelTreeReq: {
belongType: 2,
pageNum: 1,
pageSize: 10000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.filterText,
edition: this.$globalState.session.merchantModel,
// labelTypesStr:'自店标签'
}
}
this.loading = true
getTableList(params).then(res => {
const labelTreeRets = res.labelTreeRets&&res.labelTreeRets.map(item => {
return {
id: item.labelGroup.id,
name: item.labelGroup.name,
children: item.labelList,
labelType: item.labelType == '企业标签' && this.$globalState.session.merchantModel == 1 ? '集团标签' : item.labelType,
labelDTO: item
}
})
const labelType = this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签'
labelTreeRets&&labelTreeRets.forEach(item => {
const index = this.labelTree.findIndex(ret => ret.name == item.labelType)
if (index == -1) {
this.labelTree.push({
id: item.labelType == '系统标签' ? 1 : item.labelType == labelType ? 2 : 3,
name: item.labelType,
children: [item],
sort: item.labelType == '系统标签' ? 1 : item.labelType == labelType ? 2 : 3
})
} else {
this.labelTree[index].children.push(item)
}
})
this.labelTree = this.labelTree.sort((a, b) => a.sort - b.sort)
this.expandId = []
if (this.labelTree && this.labelTree.length) {
this.labelTree[0].children.forEach(item => {
this.expandId.push(item.id)
})
}
this.$nextTick(() => {
status && this.updateTreeNode()
this.setTreeHeight()
})
this.loading = false
})
},
setTreeHeight(domNode) {
const nodeHeight = document.querySelectorAll('.el-tree>.el-tree-node').length * 30
if (domNode) {
domNode.style.maxHeight = this.$parent.heightBox - 80 - nodeHeight + 'px'
domNode.style.overflow = 'auto'
} else {
document.querySelector('.el-tree>.el-tree-node.is-expanded .el-tree-node__children').style.maxHeight = this.$parent.heightBox - 80 - nodeHeight + 'px'
document.querySelector('.el-tree>.el-tree-node.is-expanded .el-tree-node__children').style.overflow = 'auto'
}
},
nodeExpand(data, node, target) {
if (data.sort) {
this.$nextTick(() => {
const domNode = target.$refs.node.lastElementChild
this.setTreeHeight(domNode)
})
}
}
},
mounted() {
this.getTableList()
}
}
</script>
<style lang="scss" scoped>
.content-wrap {
padding: 16px 3px 0px 16px;
box-sizing: border-box;
height: 100%;
.tree-input {
display: flex;
align-items: center;
span {
display: inline-block;
color: #5850ff;
font-size: 14px;
width: 40px;
margin-left: 6px;
cursor: pointer;
}
}
.tag-tree {
margin-top: 20px;
overflow-y: auto;
/deep/ {
.el-tree-node {
.el-tree-node__content {
height: 30px;
> .el-checkbox {
display: none;
}
}
}
.el-tree-node__children {
.el-tree-node__content {
.el-checkbox {
display: block;
}
}
}
.custom-tree-node {
font-size: 14px;
color: #333;
}
.tree-node {
width: 140px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.el-tree-node__expand-icon {
font-size: 15px;
margin-top: -2px;
color: #000000;
}
.el-tree-node__expand-icon.is-leaf {
color: transparent;
}
.el-checkbox__inner {
margin-right: 10px;
}
.el-icon-edit-outline {
color: #999;
font-size: 15px;
cursor: pointer;
&:hover {
color: #5850ff;
}
}
}
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<!-- <p class="pageTitle">标签管理</p> -->
<button class="addTagsBtn" @click="btnClick('create')">添加群标签组</button>
<!-- <button class="addTagsBtn" @click="btnClick('edit')">修改标签组</button> -->
<span class="toptips">
<!-- v-if="!((merchantModel==2 && accountLevel==4) || (merchantModel==1 && accountLevel==1))" -->
<span>
共有{{ numberObj.groupCount || 0 }}个标签组
<!-- v-if="!(merchantModel == 1 && accountLevel == 4)" -->
<template>,{{ numberObj.rcLabelCount || 0 }}个自店标签</template>
<template>,{{ numberObj.traLabelCount || 0 }}个系统标签</template>
</span>
<span class="iconPanelWrap" v-if="!isFirstShow">
<el-popover placement="top" width="666" trigger="hover">
<!-- v-if="!(merchantModel == 1 && accountLevel == 4)" -->
<div>自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</div>
<div>系统标签为通过大数据算法规则生成的标签</div>
<img src="@/assets/tagsManage/question.png" slot="reference" alt="" />
</el-popover>
</span>
</span>
<div class="initPanel" v-if="isFirstShow">
<template>自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;</template>
系统标签为通过大数据算法规则生成的标签
<img src="@/assets/tagsManage/Shape.png" alt="" />
<i class="el-icon-close" @click="closeInitPanel"></i>
</div>
<div class="client-main-box">
<div class="client-tag">
<tag-group @getCheckItem="getCheckItem" ref="tagTree" @editTag="btnClick"></tag-group>
</div>
<div class="client-tabel">
<div class="client-title-panel">
<div class="client-tabel-title">
<div class="client-tabel-label">
已选标签
<span @click="dialogRuleVisible = true">人群规则说明</span>
</div>
<div class="client-expand" v-if="!tagHeight && tagCheckItem.length">
<el-button type="text" size="small" @click="tagHeight = 180">
<span>展开</span>
<i class="expand el-icon-arrow-down"></i>
</el-button>
</div>
</div>
<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" @click="treeScroll(item.id)" @close="removeItem(idx)">
<label>{{ item.name }}:</label>
<template v-for="(tag, index) in item.children">
<div class="select-tagLabel" :key="index" v-if="tag && index < 3">{{ tag.name }}</div>
</template>
<el-popover placement="top" trigger="hover" class="select-popover-tag">
<div class="select-popover-box">
<template v-for="(tag, index) in item.children">
<div class="select-tagLabel" :key="index" v-if="tag">{{ tag.name }}</div>
</template>
</div>
<div class="select-tagLabel" slot="reference" v-if="item.children.length > 3">+ {{ item.children.length - 3 }}</div>
</el-popover>
</el-tag>
</div>
<div class="client-expand" v-if="tagHeightStatus">
<el-button type="text" size="small" @click="tagHeight = 0">
<span>收起</span>
<i class="expand el-icon-arrow-up"></i>
</el-button>
</div>
</div>
<div class="pageContent" :style="{ height: heightBox - 115 + 'px' }">
<GLCombiForm ref="formSearch" :formObj="searchForm" :formData="tagsPartFormList" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="clientNumExp">
<div class="clientNum">
<div class="clientListNew">群聊列表({{ tableTotal }}个)</div>
</div>
<div>
<GLButton size="small" @click="handleExport" class="export" fn="导出">导出</GLButton>
<!-- <el-button
plain
size="small"
:disabled="tagCheckItem.length == 0"
@click="
groupVisible = true
crowdForm = {
crowdName: '',
crowdDesc: ''
}
"
>
保存为人群
</el-button> -->
<el-button plain size="small" @click="createMarketSOP()">
营销SOP
</el-button>
</div>
</div>
<!-- noDataText="你当前还没有添加的标签" -->
<GLTable @setTableFinishFun="setTableFinishFun" @refreshTable="getCustomersListData" ref="viewCustomers" :layout="layout" :hasNum="true" :tableData="tableData" :tableTotal="tableTotal" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams">
<span slot="status" slot-scope="scope">
<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 slot="delFlag" slot-scope="scope">
<span :class="{ circleStatusGreen: scope.scope.delFlag == 0, circleStatusGray: scope.scope.delFlag == -1 }"></span>
<span>{{ scope.scope.delFlag == -1 ? '已解散' : scope.scope.delFlag == 0 ? '正常' : '' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" v-if="scope.scope.delFlag == 0" @click="goGroupDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</el-button>
</div>
</GLTable>
</div>
</div>
</div>
<GLDialog title="人群规则说明" :visible.sync="dialogRuleVisible" :hasFooter="false">
<div class="crowd-dialog-wrap color-3">
<div class="condition font-14">
<b>说明:</b>
<br />
<span>
标签组内已选标签取
<b>并集(或)</b>
,即满足一个条件即可、标签组之间取
<b>交集(且)</b>
,即同时满足标签组条件。
</span>
</div>
<div class="flex-between">
<div class="static-image">
<img src="@/assets/crowdManage/sum.png" alt="" />
</div>
<div class="static-image">
<img src="@/assets/crowdManage/intersection.png" alt="" />
</div>
</div>
</div>
</GLDialog>
<GLDialog class="role" :title="tagDialogTitle" :visible.sync="tagVisible">
<div class="form-title">
<span>说明:</span>
此处添加的标签均为人工标签,即后续标签更新由员工更新打标签
</div>
<rule-form :ruleForm="tagForm" :rules="tagRules" :ruleData="tagDialogData" ref="tagForm">
<div slot="tagsGroup-type">
<el-select v-model="tagForm.initTagsGroup" placeholder="请选择" :disabled="tagDialogTitle != '添加标签组'" @change="handleSelect">
<el-option v-for="item in tagsGroupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<!-- id="tagTipMsgRef" -->
<span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组' && !tagForm.initTagsGroup">
<template v-if="!(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))">{{ '企业' | tagType }}标签</template>
<template v-if="!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))">
<template v-if="!(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))">和</template>
自店标签分别
</template>
最多3000个
</span>
<span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组' && tagForm.initTagsGroup == 2">
自店标签已创建
<span class="pure-blue-text">{{ numberObj.rcLabelCount }}</span>
个
</span>
<span class="tagTipMsg" v-if="tagDialogTitle == '编辑标签组'">
{{ tagForm.initTagsGroup == 1 ? (merchantModel == 1 ? '集团标签' : '企业标签') : '自店标签' }}最多3000个,已创建
<span class="pure-blue-text">{{ tagForm.initTagsGroup == 1 ? numberObj.bizLabelCount : numberObj.rcLabelCount }}</span>
个
</span>
</div>
<div slot="modeType">
<el-input v-model.trim="tagForm.mode" disabled></el-input>
</div>
<div slot="tagsInput-type">
<div class="tagsWrap" v-if="tagDialogTitle == '编辑标签组'">
<div class="tagsWrapInput">
<span class="tag" :class="{ inputWrapShow: item.inputVisible }" v-for="item in editTagList" :key="item.id">
<!-- maxlength="30" show-word-limit -->
<el-input class="input-new-tag" v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="item.name = handleInputConfirm(item.name, item.id)" @keyup.enter.native="item.name = handleInputConfirm(item.name, item.id)"></el-input>
<el-tooltip class="item" :content="item.name" placement="top">
<span class="ellipsis-1" v-if="!item.inputVisible">{{ item.name }}</span>
</el-tooltip>
<img class="editIcon" src="@/assets/tagsManage/edit.png" @click="showInput(item.id)" alt="" v-show="!item.inputVisible" />
</span>
</div>
</div>
<div class="row-tag" v-for="(item, index) in tagForm.tagsList" :key="index">
<!-- :onkeyup="(item.name = item.name.replace(/\s+/g, ''))" maxlength="30" show-word-limit @input="checkInputContent"-->
<el-input v-model.trim="item.name" placeholder="添加标签名称(至少添加一个标签)" @keyup.native="item.name = checkInputContent(item.name)"></el-input>
<span class="el-icon-circle-close" @click="deleteRow(index)"></span>
</div>
<!-- 需要后台告诉已经创建多少个标签了 -->
<div class="addtagIcon" v-if="tagForm.initTagsGroup == 2" :style="{ color: numberObj.rcLabelCount >= 3000 ? '#EEE' : '' }" @click="addRow(tagForm.initTagsGroup)">
<i class="el-icon-circle-plus-outline"></i>
<span class="addTagText">新增标签</span>
</div>
<div class="addtagIcon" v-if="tagForm.initTagsGroup == ''" @click="addRow(tagForm.initTagsGroup)">
<i class="el-icon-circle-plus-outline"></i>
<span class="addTagText">新增标签</span>
</div>
<!-- v-if="tagNameRules" -->
<div class="el-form-item__error" v-if="tagNameRules">请至少添加一个标签</div>
</div>
</rule-form>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="handleClose">取消</el-button>
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
</span>
</GLDialog>
<GLDialog title="保存为人群" :visible.sync="groupVisible" :hasFooter="true">
<div class="gl-form-page gl-form-min">
<el-form :model="crowdForm" :rules="crowdFormRules">
<el-form-item label="人群名称:" prop="crowdName">
<el-input class="crowdName" v-model.trim="crowdForm.crowdName" size="small" placeholder="请输入人群名称:" maxlength="30" show-word-limit></el-input>
</el-form-item>
<el-form-item label="人群描述:">
<el-input class="crowdDesc" type="textarea" v-model.trim="crowdForm.crowdDesc" size="small" placeholder="请输入人群描述" maxlength="100" show-word-limit></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="groupVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="groupConfirmDialog">确定</el-button>
</span>
</GLDialog>
<GLDialog title="提示" mode="small" :visible.sync="successVisible" :hasFooter="false">
<div class="success-panel">
<i class="el-icon-circle-check"></i>
</div>
<div class="success-tips">
<div class="success-tips-h1">已保存为人群</div>
<div class="success-tips-h2" @click="jumpGroup">立即前往“人群管理”></div>
</div>
</GLDialog>
<div class="loading-containner" v-if="userLoading">
<div class="loading-box">群聊列表加载中</div>
</div>
</div>
</template>
<script>
import { getTableTagNum, newAddTag, updateTag } from '@/api/modules/tagsManage'
import { getLoginCount } from '@/api/modules/loginCount'
import tagGroup from './components/tagGroup.vue'
import url from '@/assets/clientDataOverview/nodata.png'
import tag from '@/mixins/groupTag'
import { utils } from 'glsx-common'
export default {
mixins: [tag],
name: 'tagsManage',
data() {
//这里就是整个checkName啦,就是方法一的使用
var checkName = (rule, value, callback) => {
var len = 0
for (var i = 0; i < value.length; i++) {
var c = value.charCodeAt(i)
//单字节加1
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
len++
} else {
len += 2
}
}
if (len > 30) {
//重点重点,下面就是填写提示的文字 (len < 4 && len> 0) ||
// callback(new Error('名称长度为4-30个字符,一个中文字等于2个字符。'));
callback(new Error('字数已达上限'))
} else {
callback()
}
}
var checkTagsInput = (rule, value, callBack) => {
if (value && value.length == 0) {
return callBack(new Error('请添加标签'))
} else {
return callBack()
}
}
return {
isShowCloseBtn: true,
dialogMode: 'mid',
successVisible: false,
userLoading: false,
dialogRuleVisible: false,
expand: false,
heightBox: 0,
// isReload: true,
isAllowCloseDialog: false,
isHasSameTag: false,
tagNameRules: false,
numberObj: {},
url: url,
isFirstShow: false,
crowdFormRules: {
crowdName: [{ required: true, message: '请输入人群名称', trigger: 'blur' }]
},
searchForm: {
custGroupName: '',
groupHostName: '',
groupAdminName: '',
creationMethod: '',
delFlag: ''
},
tagsPartFormList: [
{
type: 'input',
inputType: 'text',
name: 'custGroupName',
label: '群聊名称',
placeholder: '请输入群聊名称'
},
{
type: 'input',
inputType: 'text',
name: 'groupHostName',
label: '群主',
placeholder: '请输入群主'
},
{
type: 'input',
inputType: 'text',
name: 'groupAdminName',
label: '管理员',
placeholder: '请输入管理员'
},
{
type: 'select',
name: 'creationMethod',
label: '创建方式',
placeholder: '请选择',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: null
},
{
label: '手动拉群',
value: 1
},
{
label: '一客一群',
value: 2
}
]
},
{
type: 'select',
name: 'delFlag',
label: '群聊状态',
placeholder: '请选择',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: null
},
{
label: '正常',
value: 0
},
{
label: '已解散',
value: -1
}
]
}
],
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '客户群名称',
prop: 'custGroupName',
line: 1,
width: 160
},
{
label: '当前成员总数',
prop: 'allMembers',
minWidth: 140
},
{
label: '当前客户数',
prop: 'totalCount',
minWidth: 110
},
{
label: '当日新增入群客户数',
prop: 'newCustomerCount',
minWidth: 170
},
{
label: '当日新增退群客户数',
prop: 'delCustomerCount',
minWidth: 170
},
{
label: '当前跟进员工数',
prop: 'staffs',
minWidth: 140
},
{
label: '群主',
prop: 'groupHostName',
minWidth: 130
},
{
label: '管理员',
prop: 'groupAdminName',
minWidth: 100
},
{
label: '创建方式',
prop: 'creationMethod',
formatter: cellValue => {
return cellValue.creationMethod == 1 ? '手动拉群' : cellValue.creationMethod == 2 ? '一客一群' : ''
},
minWidth: 140
},
{
label: '群聊状态',
prop: 'delFlag',
width: 120,
addHtml: 'delFlag'
},
{
label: '创建时间',
prop: 'addTime',
width: 180
},
{
label: '操作',
prop: 'optionBtns',
width: '65px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
tableData: [],
// 弹窗数据
tagDialogTitle: '添加标签组',
tagVisible: false,
groupVisible: false,
tagForm: {
tagsName: '',
initTagsGroup: 2,
mode: '人工',
tagsList: []
},
tagDialogData: [
{
label: '标签组名称:',
prop: 'tagsName',
type: 'input',
placeholder: '最多30个字符,1个汉字为2个字符',
disabled: false,
clickFunc: this.watchInput
},
{
label: '标签组类型:',
prop: 'initTagsGroup',
type: 'customize',
slotName: 'tagsGroup-type'
},
{
label: '更新方式:',
prop: 'initTagsGroup',
type: 'customize',
slotName: 'modeType'
},
{
label: '标签:',
prop: 'tagsList',
type: 'customize',
slotName: 'tagsInput-type',
class: 'is-required' //添加红色标志
}
],
tagRules: {
tagsName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
initTagsGroup: [{ required: true, message: '请选择标签组类型', trigger: 'change' }]
// tagsList: [{ required: true }]
},
tagsGroupList: [
// { id: 1, name: this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签' },
{ id: 2, name: '自店标签' }
],
modeList: [{ id: 1, name: '人工' }],
//编辑便签输入的值
editTagList: [],
tagGroupId: 0, //标签组id,编辑提交接口要用
//控制展开收起按钮
expande: true,
needShowExpande: false,
merchantId: 10001001, //子系统默认这个门店id
merchantModel: 1, //集团:1,门店:2
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
userType: 0 //1是商户,2是员工
}
},
components: {
tagGroup
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType
}
this.searchForm = { 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel }
this.getLoginCountFun()
this.getTableTagNumFun()
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 122
},
methods: {
// toViewCustomer(info) {
// this.$router.push('/tagsManage/viewCustomers')
// },
// 跳转到营销SOP
createMarketSOP() {
let getDatas = JSON.parse(
JSON.stringify(this.allListParams)
.replace(/groupId/g, 'labelGroupId')
// .replace(/groupName/g, 'labelGroupName')
.replace(/groupType/g, 'labelGroupType')
)
let mergeDatas = getDatas.map((item, index) => {
return { ...item, ...this.sopListParams[index] }
})
var params = {
addOrEdit: 'add',
fromPage: '/custom/tagsManage/index',
$title: encodeURI('新建SOP'),
info: {
// 标签
customerOptType: 3,
labelList: [...mergeDatas]
}
}
this.$common.utils.storage.set('sopInfo', params)
this.$history.push({
path: 'marketing/sop/editSop'
})
},
toViewCustomer(info) {
const id = info.labelGroup.id
const type = info.labelType
this.$router.push({
// path:`/tagsManage/viewCustomers/530`
path: `/tagsManage/viewCustomers/${id}/${type}`
})
},
goGroupDetail(id, name) {
this.$router.push({
path: '/clientGroupManage/clientGroupDetail',
query: {
id: id,
groupName: name
}
})
},
watchInput() {},
showTagArray(list) {
if (list.length == 0) {
return []
}
// return list
return list.slice(0, 9)
},
checkInputContent: function(e) {
//确保每个输入框的内容不和已存在的编辑标签相同
let isHasSameTag = this.editTagList.some(ele => ele.name == e)
if (isHasSameTag) {
// this.$message.error('不允许输入已存在的标签')
return e
}
return this.$Utils.cutMaxCharStr(e)
},
isShowEditBtn(row) {
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//单店模式下,仅门店和员工可以编辑
if (row.labelType == '自店标签' && !(this.merchantModel == 1 && (this.accountLevel == 2 || this.accountLevel == 3 || this.accountLevel == 4))) {
return false
}
if (this.merchantModel == 1) {
if (this.accountLevel == 1 && this.userType == 1) {
return true
}
if (this.accountLevel !== 1) {
//如果是企业标签不显示
if (row.labelType == '企业标签' || row.labelType == '集团标签') {
return false
}
return true
}
}
return true //门店版都显示编辑按钮
},
expandeClick() {
this.expande = !this.expande
},
closeInitPanel() {
this.isFirstShow = false
},
setTableHeightEvent() {
this.$refs.tagsManage.setTableHeightFun()
},
getLoginCountFun() {
//loginType:3是查客户数据概览浏览次数
getLoginCount({ loginType: 3 }).then(res => {
//获取是否第一次点击该页面
this.isFirstShow = res
})
},
getTableTagNumFun() {
getTableTagNum({ 'labelStatReq.shopId': this.merchantId, 'labelStatReq.edition': this.merchantModel, 'labelStatReq.belongType': 2 }).then(res => {
if (!res) {
return false
}
this.numberObj = res
})
},
//搜索表格
handleSearch() {
this.getCustomersListData()
},
//重置表格
handleReset() {
this.searchForm = {}
this.getCustomersListData()
},
btnClick(pType, rowData) {
switch (pType) {
case 'create':
this.tagDialogTitle = '添加标签组'
this.tagForm.tagsForm = ''
this.$set(this.tagDialogData[0], 'disabled', false)
this.handleClose()
break
case 'edit':
this.tagDialogTitle = '编辑标签组'
// this.$set(this.tagDialogData[0], 'disabled', true)
this.editEvent(rowData)
break
}
},
isHasSome(array) {
var temp = [] //一个新的临时数组
for (var i = 0; i < array.length; i++) {
if (temp.indexOf(array[i]) !== -1) {
return true
}
if (temp.indexOf(array[i]) == -1) {
temp.push(array[i])
}
}
return false
},
//编辑触发事件
editEvent(rowData) {
this.handleClose()
this.tagsForm = JSON.parse(JSON.stringify(rowData))
this.editTagList = rowData.labelList.map(item => {
return { ...item, inputVisible: false }
})
this.tagGroupId = rowData.labelGroup.id //标签组id
this.tagForm.tagsName = rowData.labelGroup.name //标签组名
this.tagForm.initTagsGroup = rowData.labelType == '企业标签' || rowData.labelType == '集团标签' ? 1 : rowData.labelType == '自店标签' ? 2 : '' //标签组类型
},
handleConfirm: utils.debounce(function() {
this.$refs.tagForm.$children[0].validate(valid => {
if (!valid) {
if (this.tagForm.tagsList.length <= 0 && this.tagDialogTitle == '添加标签组') {
this.tagNameRules = true
this.$message.error('至少要添加一个标签')
// return
}
return
}
if (this.tagForm.tagsList.length <= 0 && this.tagDialogTitle == '添加标签组') {
this.tagNameRules = true
this.$message.error('至少要添加一个标签')
return
}
if (this.tagDialogTitle == '添加标签组') {
//过滤掉没有输入值得标签输入框
this.tagForm.tagsList = this.tagForm.tagsList.filter(item => item.name != '')
if (this.tagForm.tagsList.length <= 0) {
this.$message.error('不能提交空标签')
return
}
//如果存在添加标签的输入框的内容的标签相同则不提交
let isSameTagFlag = false
var tempArr = this.tagForm.tagsList.map(item => item.name)
isSameTagFlag = this.isHasSome(tempArr)
if (isSameTagFlag) {
this.$message.error('不能提交相同的标签,请修改')
return
}
this.newAddTagFun(1)
//this.handleClose() //这里不管
} else {
//修改标签(允许同时增加标签)
let isHasEmpty = this.editTagList.some(ele => ele.name == '')
if (isHasEmpty) {
this.$message.error('不能提交空的编辑标签')
return
}
if (this.tagForm.tagsList.length > 0) {
//过滤掉没有输入值得标签输入框
this.tagForm.tagsList = this.tagForm.tagsList.filter(item => item.name != '')
//如果存在添加标签的输入框的内容和可编辑的标签相同则不提交
let ishasSameTagFlag = false
this.editTagList.forEach(item => {
for (let i = 0; i < this.tagForm.tagsList.length; i++) {
if (this.tagForm.tagsList[i].name == item.name) {
ishasSameTagFlag = true
}
}
})
if (ishasSameTagFlag) {
this.$message.error('不能提交已存在的标签,请修改')
return
}
}
this.updateTagFun()
this.newAddTagFun()
// this.handleClose()
}
})
}, 300),
handleRuleClose() {
this.dialogRuleVisible = false
},
handleClose() {
this.tagNameRules = false
if (!this.tagVisible && this.$refs.tagForm) {
this.$refs.tagForm.$children[0].resetFields()
this.tagForm.initTagsGroup = 2
this.tagForm.tagsName = ''
}
this.tagForm.tagsList = [] //取消时清空新增标签
this.tagVisible = !this.tagVisible
},
newAddTagFun(status) {
//满足条件进行提交
let params = {}
params['labelDTO.belongType'] = 2
params['labelDTO.dataFrom'] = 'cs'
params['labelDTO.shopId'] = this.merchantId
params['labelDTO.edition'] = this.merchantModel
// params.staffId = '员工A'
params['labelDTO.labelGroup.name'] = this.tagForm.tagsName
params['labelDTO.labelType'] = this.tagForm.initTagsGroup == 1 ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : '自店标签'
params['labelDTO.labelList'] = this.tagForm.tagsList
params['labelDTO.isAddLabelGroupEnter'] = this.tagDialogTitle == '添加标签组' ? true : false
newAddTag(params).then(res => {
if (!res) {
return
}
if (res.data.code == 0) {
if (this.tagForm.tagsList.length > 0) {
// this.$message.success('添加成功')
status && this.$message.success('添加成功')
}
if (this.tagDialogTitle == '编辑标签组') {
this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = []
}
this.handleClose()
} else if (res.data.code == 1) {
this.$message.error(`${res.data.message}`)
} else if (res.data.code == 2) {
//编辑弹框, 空标签调接口返回信息
if (this.tagDialogTitle == '编辑标签组') {
this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = []
}
this.handleClose()
}
this.$refs.tagTree.getTableList(true) //刷新下表格
this.getTableTagNumFun()
})
},
updateTagFun() {
let param = {}
param['labelDTO.belongType'] = 2
param['labelDTO.dataFrom'] = 'cs'
param['labelDTO.edition'] = this.merchantModel
param['labelDTO.labelGroup.id'] = this.tagGroupId
param['labelDTO.labelGroup.name'] = this.tagForm.tagsName
param['labelDTO.labelType'] = this.tagForm.initTagsGroup == 1 ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : '自店标签'
param['labelDTO.shopId'] = this.merchantId
let editTagList = this.editTagList.map(item => {
return {
id: item.id,
name: item.name
}
})
param['labelDTO.labelList'] = editTagList
updateTag(param).then(res => {
if (!res) {
return
}
this.$message.success('修改成功')
// this.tagForm.tagsName = ''
// this.tagForm.initTagsGroup = ''
// this.tagForm.tagsList = []
// this.$refs.tagTree.getTableList(true) //刷新下表格 //重复请求了
})
},
//删除一行标签
deleteRow(index) {
this.tagForm.tagsList.splice(index, 1)
},
//添加一行标签
addRow(type) {
this.tagNameRules = false
if (type == 2 && this.numberObj.rcLabelCount >= 3000) {
this.$message.error('自店标签数量已达上限')
return
}
this.tagForm.tagsList.push({ name: '' })
},
showInput(id) {
// this.inputVisible = true
this.editTagList.forEach(item => {
if (item.id == id) {
item.inputVisible = true
}
})
//聚焦到输入框
this.$nextTick(_ => {
this.$refs.saveTagInput[0].focus()
})
},
handleInputConfirm(inputValue, id) {
this.editTagList.forEach(i => {
if (i.id == id) {
i.inputVisible = false
}
})
return this.$Utils.cutMaxCharStr(inputValue)
},
handleSelect(value) {}
//注意问问他们后台怎么处理转义字符
//限制输入特殊字符
// keyUp(e) {
// e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '')
// },
// // 只能输入汉字、英文、数字
// keydown(e) {
// e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, '')
// }
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.crowdName {
padding-right: 50px;
}
.crowdDesc {
padding-right: 58px;
}
.loading-containner {
top: 0px;
left: 0px;
position: fixed;
width: 100%;
background: rgba(255, 255, 255, 0.1);
z-index: 5000;
height: 100%;
.loading-box {
position: absolute;
top: 50%;
left: 50%;
margin-top: -28px;
margin-left: -88px;
width: 176px;
font-size: 14px;
color: #ffffff;
line-height: 54px;
text-align: center;
height: 54px;
background: #666666;
border-radius: 2px;
&::after {
content: '';
position: absolute;
top: 0%;
bottom: 0;
animation: dot 3s infinite steps(3, start);
color: #ffffff;
}
}
}
@keyframes dot {
33.33% {
content: '.';
}
66.67% {
content: '. .';
}
100% {
content: '. . .';
}
}
.success-panel {
display: flex;
justify-content: center;
margin-top: 40px;
.el-icon-circle-check {
color: #2cca74;
font-size: 36px;
}
}
.success-tips {
color: #5850ff;
text-align: center;
margin: 10px 0px 30px;
line-height: 20px;
&-h1 {
font-size: 16px;
color: #333333;
}
&-h2 {
cursor: pointer;
margin-top: 30px;
font-size: 14px;
color: #5850ff;
}
}
.success-footer {
text-align: center;
}
.leftDistance {
margin-left: 10px;
}
.form-title {
padding-left: 30px;
margin-bottom: 15px;
font-size: 12px;
font-weight: 400;
color: #333333;
line-height: 21px;
}
.expandImg {
display: flex;
// justify-content: center;
.smallFontSize {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.imgEll {
margin-left: 6.5px;
cursor: pointer;
// margin-bottom:3px;
}
}
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.crowd-dialog-wrap {
.condition {
margin-bottom: 16px;
line-height: 21px;
b {
color: #666666;
}
// span {
// white-space: nowrap;
// }
}
.static-image {
width: 335px;
height: 325px;
img {
width: 100%;
}
}
}
.scrm-sub-client-container {
/deep/.search-form .el-form-item__content {
width: auto;
}
// // el-form-item__label
// /deep/.el-table tbody tr:hover > td {
// background-color: #f4f3ff;
// }
.pageTitle {
position: relative;
// margin-top: 30px;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.addTagsBtn {
height: 32px;
background: $btnBlue;
border-radius: 4px;
padding: 0 20px;
color: #fff;
font-size: 14px;
&:hover {
background-color: $lightBtnBlue;
}
}
.toptips {
display: inline-block;
position: relative;
margin-left: 10px;
height: 20px;
min-width: 440px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
.tipsPanel {
position: absolute;
display: inline-block;
padding: 6px 10px 10px;
box-sizing: border-box;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
display: none;
z-index: 100;
background: #fff;
width: 560px;
height: 82px;
right: -280px;
top: -84px;
}
.iconPanelWrap {
img {
display: inline-block;
margin-left: 20px;
vertical-align: middle;
}
&:hover {
.tipsPanel {
display: block !important;
}
}
}
}
.initPanel {
position: relative;
margin-top: 20px;
width: 708px;
min-height: 80px;
box-sizing: border-box;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
padding: 10px 42px;
height: 60px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
img {
position: absolute;
left: 16px;
top: 13px;
}
i {
position: absolute;
top: 14px;
right: 18px;
width: 9px;
height: 9px;
cursor: pointer;
}
}
.client-main-box {
display: flex;
.client-tag {
width: 260px;
margin-right: 10px;
margin-top: 10px;
background-color: #fff;
}
.client-tabel {
flex: 1;
overflow: hidden;
.client-expand {
text-align: center;
}
.client-title-panel {
padding: 16px;
margin-top: 10px;
background-color: #fff;
}
&-title {
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 22px;
display: flex;
justify-content: space-between;
span {
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
cursor: pointer;
}
}
.select-tag-panel {
display: flex;
flex-wrap: wrap;
font-size: 14px;
transition: all 0.3s linear;
overflow-y: auto;
.select-tagGroup {
display: inline-block;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 4px 8px;
line-height: 24px;
margin-right: 8px;
margin-bottom: 8px;
height: 36px;
box-sizing: border-box;
/deep/ {
.el-icon-close {
right: 0px;
}
}
label {
color: #333333;
font-weight: 600;
}
}
.select-tagLabel {
display: inline-block;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 0px 8px;
line-height: 20px;
margin-right: 4px;
}
}
}
}
.pageContent {
overflow-y: auto;
padding: 20px 20px 30px;
margin-top: 10px;
background-color: #fff;
.el-button + .el-button {
margin-left: 10px;
}
.clientNumExp {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 14px;
padding-bottom: 10px;
letter-spacing: 1px;
.clientNum {
// display: flex;
// align-items: center;
.clientListNew {
display: flex;
align-items: center;
font-weight: 600;
color: #333333;
font-size: 16px;
}
.clientNumText {
margin-left: 6px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
padding-top: 2px;
}
}
.export {
color: #5850ff;
border: 1px solid #5850ff;
}
}
.allTagsWrap {
position: relative;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
padding-bottom: -2px;
box-sizing: border-box;
&:hover {
-webkit-line-clamp: 9999;
}
.tag-box-wrap {
display: inline-block;
margin-right: 10px;
margin-top: 5px;
margin-bottom: 5px;
padding: 0 10px;
box-sizing: border-box;
min-width: 76px;
max-width: 200px;
height: 26px;
line-height: 26px;
border-radius: 4px;
border: 1px solid #e8e8ea;
background: #fafbfe;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #666666;
max-width: 245px;
cursor: pointer;
}
.expande-button-wrap {
position: absolute;
right: 0;
bottom: 0;
.expande-button {
color: $btnBlue;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
line-height: 20px;
}
}
}
}
.close {
overflow: hidden;
height: 65px;
}
}
.role {
/deep/.tagTipMsg {
font-size: 12px;
display: flex;
color: #999999;
margin-left: 150px;
}
.tagsWrap {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
padding-top: 3px;
.tagsWrapInput {
border: 1px solid rgb(229, 229, 229);
padding: 8px;
width: 423px;
max-height: 75px;
overflow-y: auto;
}
img {
display: none;
}
::v-deep .tag {
text-align: center;
display: inline-block;
padding: 0 10px;
min-width: 68px;
max-width: 200px;
margin-right: 6px;
margin-bottom: 6px;
height: 26px;
line-height: 26px;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
position: relative;
box-sizing: border-box;
/deep/.input-new-tag {
// position: relative;
width: 100%;
}
.el-input--small .el-input__inner {
height: 26px;
line-height: 26px;
font-size: 14px;
}
.ellipsis-1 {
display: inline-block;
width: 100%;
font-weight: 400;
color: #666666;
font-size: 14px;
}
&:hover {
.editIcon {
display: inline-block;
cursor: pointer;
position: absolute;
top: -8px;
right: -8px;
// z-index: 9999;
}
}
.el-input {
max-width: 200px;
}
}
.inputWrapShow {
//显示输入框时,不显示外面框的左右边距
padding: 0 0;
border: 0;
}
}
.row-tag {
display: flex;
&:not(:first-child) {
margin-top: 5px;
margin-left: 154px;
}
align-items: center;
.el-icon-circle-close {
margin-left: 15px;
font-size: 18px;
color: #999999;
cursor: pointer;
}
}
.addtagIcon {
width: 75px;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
color: $btnBlue;
cursor: pointer;
margin-left: 150px;
i {
font-size: 20px;
}
.addTagText {
font-size: 12px;
}
}
}
}
.dialog-form {
padding: 0px 20px;
margin: 20px;
&-item {
display: flex;
align-items: center;
label {
width: 100px;
text-align: right;
}
}
.form-tips {
margin-top: 6px;
padding-left: 80px;
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 17px;
display: flex;
justify-content: space-between;
}
}
</style>
<style lang="scss">
.select-popover-box {
max-width: 600px;
.select-tagLabel {
display: inline-block;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 0px 8px;
line-height: 20px;
margin-right: 4px;
margin-bottom: 5px;
}
}
</style>
<template>
<div v-loading="loading2">
<div class="scrm-sub-client-container">
<div class="pageContent">
<div class="labelSet">
<div class="labelSetLeft">标签组:{{ labelGroupName }}</div>
<div class="labelSetLeftRight">
{{ labelUpdateType }}
</div>
</div>
<div class="choiceLabel">
<div class="choiceLabelLeft">
<div class="addLabelStyle">标签:</div>
<button class="addTagsBtn" @click="choiceLabel">选择标签</button>
</div>
<button class="backBtn" @click="goBack">返回标签管理</button>
<!-- <span>(默认显示标签组已打标签所有客户)</span> -->
</div>
<!-- <div class="clientList">
标签组客户列表(100人)
</div> -->
<!-- <search-form class="searchTop border-shadow" :isHasSyncBtn="true" :showDefaultTime="false" :merchantModel="merchantModel" :accountLevel="accountLevel" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable" @handleExport="handleExport" @syncClick="syncClick">
<span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
<el-button type="primary" @click="handleExport">导出</el-button>
</span>
</search-form> -->
</div>
</div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<div>
<div class="clientNumExp">
<div class="clientNum">
<!-- {{ labelGroupName }} -->
<!-- <div class="clientListNew">标签组客户列表</div>
<div class="clientNumText">{{ tableTotal }}个</div> -->
<div class="clientListNew">
标签组客户列表
<div class="clientNumText">{{ tableTotal }}个</div>
</div>
</div>
<el-button class="export" size="small" @click="handleExport">导出</el-button>
</div>
<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">
<span slot="qiweimingcheng" slot-scope="scope">
<span>{{ myStandNo(scope.scope.carVin) }}</span>
</span>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
<div v-if="idx == 0">
<span>{{ list.nickName }}</span>
<span class="smallFontSize" :class="[list.type == 1 ? 'pure-green-text' : '', list.type == 2 ? 'pure-yello-text' : '']">@{{ list.corpName }}</span>
</div>
<span v-if="idx == 1">
<el-popover placement="right-start" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<div v-for="(i, index) in scope.scope.nickNameList" style="padding-bottom:3px !important" :key="index">
<span>{{ i.nickName }}</span>
<span style="height: 20px; font-size: 12px; letter-spacing: 0; line-height: 20px; font-weight: 400;margin-left:2px" :class="[i.type == 1 ? 'pure-green-text' : '', i.type == 2 ? 'pure-yello-text' : '']">@{{ i.corpName }}</span>
</div>
<img class="imgEll" src="@/assets/tagsManage/ellipsis.png" alt="" slot="reference" />
</el-popover>
</span>
</div>
</div>
<span slot="carVin" slot-scope="scope">
<span>{{ myStandNo(scope.scope.carVin) }}</span>
</span>
<span slot="status" slot-scope="scope">
<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 slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<span @click="goDetail(scope.scope.id, scope.scope.custGroupName)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
<GLTable title="选择标签" :visible.sync="dialogVisible">
<el-input placeholder="请输入搜索关键字" v-model="searchLabel" clearable>
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<div class="labelCombination">
<div class="iconLabels">
<img src="@/assets/tagsManage/doc.png" alt="" />
<span class="iconLabelstext">{{ labelGroupName }}</span>
</div>
<div class="label-panle" :style="{ height: boxHeight + 'px' }" v-if="items.length > 0">
<template v-for="(item, index) in items">
<div class="iconLabelsName" :class="{ active: checkedId == item.labelId }" :key="index" @click="seletLabelActive(item.labelId, item)">
<img src="@/assets/tagsManage/label.png" alt="" />
<span :title="item.labelName.length > 10 ? 'item.labelName' : ''" class="LabelsNameTxt">{{ item.labelName }}</span>
<img v-if="checkedId == item.labelId" class="labelChecked" src="@/assets/tagsManage/checked.png" alt="" />
</div>
</template>
</div>
<div class="noRelatedLabel" v-else>
<img src="@/assets/tagsManage/noData.png" alt="" />
<div>暂无 {{ searchLabel }} 相关内容</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="resetSearch">重置</el-button>
<el-button type="primary" size="small" @click="searchClientData">确定123</el-button>
</span>
</GLTable>
</div>
</template>
<script>
import { getCustomersList, getLabelList, exportLabelList } from '@/api/modules/tagsManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'viewCustomers',
components: {},
data() {
return {
loading2: false,
checkedId: '',
allListParams: {
tagLists: []
},
allLabeltags: [],
customerListsNum: 0,
checkedTag: [],
isActive: -1,
groupId: '',
groupType: '',
tagLists: [], //查询
searchLabel: '', //搜索标签
labelGroupName: '', //标签组名称
labelList: [], //存放标签
dialogVisible: false,
labelType: '',
isReload: true,
noRelatedLabel: false,
url: url,
sloading: false,
searchForm: {},
searchForm3: {},
searchFormTable: {},
boxHeight: 200,
exportParams: {},
clientGroupFormList: [
{
type: 'input',
inputType: 'text',
prop: 'phoneNumber',
label: '联系电话',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'registrationNumber',
label: '车牌号',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'vin',
label: '车架号',
placeholder: ''
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: ''
},
{
type: 'select',
prop: 'joinQW',
label: '是否加企微',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 2
}
]
},
{
type: 'select',
prop: 'followUpStaffs',
label: '跟进员工',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '张三',
value: 1
},
{
label: '李四',
value: 2
},
{
label: '王五',
value: 3
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'carSeries',
label: '车系',
placeholder: ''
}
],
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '客户姓名',
prop: 'customerName',
minWidth: 150
},
{
label: '企微名称',
prop: 'nickNameList',
addHtml: 'nickNameList',
minWidth: 200
},
{
label: '联系电话',
prop: 'customerPhone',
minWidth: 140
},
{
label: '车牌号',
prop: 'carNumber',
width: 140
},
{
label: '车架号(后6位)',
prop: 'carVin',
addHtml: 'carVin',
minWidth: 140
},
{
label: '车系',
prop: 'audi',
minWidth: 140
},
{
label: '跟进员工',
prop: 'followStaff',
minWidth: 180
},
{
label: '是否加企微',
prop: 'isJoin',
addHtml: 'isJoin',
minWidth: 120
},
{
label: '添加时间',
prop: 'addTime',
minWidth: 170
}
]
},
tableData: [],
merchantModel: 1,
flushTime: false
// items
}
},
created() {
this.groupId = this.$route.params.info ? this.$route.params.info : ''
this.groupType = this.$route.params.type ? this.$route.params.type : ''
this.getLabelList()
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
}
},
beforeDestroy() {
this.$message.closeAll()
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 250
},
watch: {
labelType(val) {
switch (val) {
case '企业标签':
this.labelUpdateType = '企业标签 | 手动更新'
break
case '自店标签':
this.labelUpdateType = '自店标签 | 手动更新'
break
case '系统标签':
this.labelUpdateType = '系统标签 | 自动更新'
break
}
},
searchLabel(val) {
if (this.allLabeltags.indexOf(val) == -1) {
this.noRelatedLabel = true
} else {
this.noRelatedLabel = false
}
}
},
computed: {
items: function() {
var _search = this.searchLabel
const labelList = this.labelList.filter(item => item.labelName.indexOf(_search) > -1)
return labelList
}
},
methods: {
myStandNo(carVin) {
if (!carVin) {
return ''
}
return carVin.substring(carVin.length - 6)
},
getCustomersListData() {
const params = {
...JSON.parse(JSON.stringify(this.allListParams)),
pageSize: this.$refs.viewCustomers.page.pageSize,
pageNum: this.$refs.viewCustomers.page.pageNum,
belongType:2
}
this.exportParams = { ...JSON.parse(JSON.stringify(this.allListParams)) }
this.loading2 = true
getCustomersList(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data.length == 0) {
this.$refs.viewCustomers.setTableHeightFun()
}
setTimeout(() => {
this.loading2 = false
}, 300)
})
},
//获取标签组
getLabelList() {
let params = {
belongType:2,
// 'labelByGroupIdReq.labelGroupId': this.groupId
'labelByGroupIdReq.labelGroupId': this.groupId,
'labelByGroupIdReq.labelGroupType': this.groupType
}
getLabelList(params).then(res => {
this.labelGroupName = res.groupName
this.labelList = res.labelNameIds
this.labelType = res.groupType
this.groupId = res.groupId
this.labelList.forEach(item => {
// this.allLabeltags.push(item.labelName)
item.isHidden = true
let res = this.getListParams(item.labelId, item.labelName)
this.allListParams.tagLists.push(res)
})
this.startParams = this.$common.utils.deepClone(this.allListParams)
this.searchForm = {
...this.allListParams
}
this.getCustomersListData()
})
},
seletLabelActive(id, arr) {
if (id == this.checkedId) {
this.checkedId = ''
this.tagLists = []
this.allListParams = this.startParams
return
}
this.checkedId = id
const labelId = arr.labelId
const labelName = arr.labelName
let res = this.getListParams(labelId, labelName)
if (this.tagLists.length > 0) {
// this.checkedTag.shift()
this.tagLists.shift()
}
this.tagLists.push(res)
},
// 首次加载页面显示所有客户数据
getAllClientList(allListParams) {
this.searchForm = {
...allListParams
}
// this.exportParams = {...allListParams}
this.getCustomersListData()
this.tagLists = []
},
// 根据标签获取客户列表
searchClientData() {
this.$refs.viewCustomers.page.pageNum = 1
this.dialogVisible = false
if (!this.tagLists.length) {
// this.exportParams = {...this.allListParams}
this.getAllClientList(this.allListParams)
} else {
this.allListParams = {
tagLists: this.tagLists
}
// this.exportParams = {...this.allListParams}
this.getCustomersListData()
}
},
getListParams(id, name) {
const params = {}
params.groupId = this.groupId
params.groupName = this.labelGroupName
params.groupType = this.labelType
params.labelId = id
params.labelName = name
return params
},
// 重置按钮
resetSearch() {
this.searchLabel = ''
this.checkedId = ''
this.tagLists = []
this.allListParams = this.startParams
// this.$refs.viewCustomers.page.pageNum = 1
// this.$refs.viewCustomers.page.pageSize = 10
// this.getCustomersListData()
// this.dialogVisible = false
},
filterNode(val, labelData) {
if (!val) return true
return labelData.label.indexOf(val) !== -1
},
// 输入框匹配label数据
searchIuputLabel() {
},
handleDialogClose() {
this.dialogVisible = false
},
choiceLabel() {
this.dialogVisible = true
},
handleNodeClick(data) {
},
goBack() {
this.$router.go(-1)
},
setTableHeightEvent() {
this.$refs.viewCustomers.setTableHeightFun()
},
setTableFinishFun(content) {
this.customerListsNum = this.$refs.viewCustomers.total
this.$refs.viewCustomers.data.length ? (this.$refs.viewCustomers.tableHeightValues = '') : this.$refs.viewCustomers.setTableHeightFun()
},
//导出
handleExport() {
const params = {
belongType:2,
...JSON.parse(JSON.stringify(this.exportParams))
}
exportLabelList(params).then(res => {
this.$Utils.exportFn(res)
})
},
searchTable() {
this.$refs.viewCustomers.refreshTable()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.expandImg {
display: flex;
// justify-content: center;
.smallFontSize {
margin-left: 2px;
height: 20px;
font-size: 12px;
letter-spacing: 0;
line-height: 20px;
font-weight: 400;
}
.imgEll {
margin-left: 6.5px;
cursor: pointer;
// margin-bottom:3px;
}
}
.pure-green-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
.noRelatedLabel {
margin-top: 59px;
text-align: center;
div {
margin-top: 12px;
font-size: 14px;
font-weight: 400;
color: #000000;
}
}
.active {
border: 1px solid rgba(88, 80, 255, 1) !important;
.labelChecked {
position: absolute;
top: 0px;
right: 0px;
}
}
.clientNumExp {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 14px;
padding-bottom: 20px;
letter-spacing: 1px;
.clientNum {
// display: flex;
// align-items: center;
.clientListNew {
display: flex;
align-items: center;
font-weight: 600;
color: #333333;
font-size: 20px;
}
.clientNumText {
margin-left: 6px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
padding-top: 2px;
}
}
.export {
color: #5850ff;
border: 1px solid #5850ff;
}
}
::v-deep .el-dialog {
height: 100%;
margin-right: 0px;
margin-top: 0 !important;
// margin-bottom: 0 !important;
position: relative;
}
::v-deep .el-dialog__wrapper {
margin-right: -6px;
}
::v-deep .el-dialog__footer {
position: absolute;
bottom: 0px;
width: 100%;
}
::v-deep .el-button + .el-button {
margin-left: 20px;
margin-right: 30px;
}
::v-deep .el-input {
margin-top: -10px;
}
.scrm-sub-client-container {
.pageTitle {
position: relative;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
.labelSet {
display: flex;
justify-content: space-between;
padding-top: 15px;
letter-spacing: 1px;
.labelSetLeft {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.labelSetLeftRight {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
.choiceLabel {
display: flex;
justify-content: space-between;
letter-spacing: 1px;
padding: 15px 0px 0px 20px;
.choiceLabelLeft {
display: flex;
align-items: center;
font-size: 20px;
.addLabelStyle {
font-weight: 600;
}
.addTagsBtn {
height: 32px;
background: $btnBlue;
border-radius: 4px;
padding: 0 20px;
color: #fff;
font-size: 14px;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.backBtn {
border-radius: 4px;
height: 32px;
font-size: 14px;
background: #fff;
border: 1px solid rgba(88, 80, 255, 1) !important;
color: $btnBlue;
padding: 0 20px;
border: none;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.clientList {
margin-top: 15px;
font-size: 20px;
}
.glsx-table {
// min-width: 1250px;
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
padding: 6px 20px 30px;
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 10px;
}
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid $btnBlue;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: $btnBlue;
font-size: 16px;
}
}
.labelDialog {
overflow: hidden;
.labelCombination {
.iconLabels {
margin-top: 20px;
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
}
.iconLabelstext {
font-size: 14px;
font-weight: 600;
color: #333333;
}
}
.label-panle {
min-width: 300px;
height: calc(100% - 200px);
overflow-y: auto;
}
.iconLabelsName {
position: relative;
margin-left: 15px;
display: flex;
align-items: center;
height: 26px;
background: #f4f6fc;
border: 1px solid rgba(232, 232, 234, 1);
border-radius: 4px;
margin-top: 12px;
width: fit-content;
width: -webkit-fit-content;
width: -moz-fit-content;
padding: 0 12px 0 5px;
img {
width: 16px;
height: 16px;
}
.LabelsNameTxt {
max-width: 100%;
margin-left: 5px;
font-weight: 400;
font-size: 14px;
color: #666666;
text-align: right;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!