Commit d59ee01a by 徐忆琳

Merge branch 'v3.18.0_10' into 'v3.18.0'

菜单迁移

See merge request !158
2 parents a82b935e b8613dbb
Showing 73 changed files with 3522 additions and 123 deletions
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"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",
"xlsx": "^0.18.5"
}, },
"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,7 +20,10 @@ ...@@ -20,7 +20,10 @@
.el-tag.el-tag--info.el-tag--plain { .el-tag.el-tag--info.el-tag--plain {
background: transparent !important; background: transparent !important;
} }
.scrm-box-f {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
}
// ::-webkit-scrollbar { // ::-webkit-scrollbar {
// /*滚动条整体样式*/ // /*滚动条整体样式*/
// width: 6px; // width: 6px;
......
<!--
* @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>
...@@ -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
...@@ -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>
<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="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">
<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="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="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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!