Commit f9fa23f3 by 陈婉清

Merge branch 'v2.8.0' into 'v2.7.2_feat'

众筹

See merge request !321
2 parents 398d5b99 9fa63b12
Showing 68 changed files with 6759 additions and 2919 deletions
...@@ -45,4 +45,4 @@ ...@@ -45,4 +45,4 @@
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }
\ No newline at end of file \ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const findAllByPage = params => {
params.method = 'entmicro.api.dracIm.findAllByPage'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置详情
const activityDetail = params => {
params.method = 'marketing.api.activity.config.detail'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置列表
const activityPage = params => {
params.method = 'marketing.api.activity.config.page'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置创建
const activityInsert = params => {
params.method = 'marketing.api.activity.config.insert'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置创建
const activityGroupList = params => {
params.method = 'marketing.api.activity.config.group.list'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置创建
const machetes = params => {
params.method = 'marketing.api.activity.customer.machetes'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置编辑
const activityUpdate = params => {
params.method = 'marketing.api.activity.config.update'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//查询活动列表
const activityPageList = params => {
params.method = 'marketing.api.activity.activityPage'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//查询活动客户列表
const activityCustomerPage = params => {
params.method = 'marketing.api.activity.activityCustomerPage'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//分配客户
const assignmentCustomer = params => {
params.method = 'marketing.api.activity.assignmentCustomer'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置编辑
const queryCrowdGroupTree = params => {
params.method = 'scrm.api.datahub.crowdgroup.queryCrowdGroupTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
findAllByPage,
activityDetail,
activityPage,
activityPageList,
activityCustomerPage,
assignmentCustomer,
activityInsert,
activityUpdate,
queryCrowdGroupTree,
activityGroupList,
machetes
}
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const getStaffList = params => {
params.method = 'entmicro.api.staff.findStaffByMerchantId'
return http({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'GET',
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 {
getStaffList,
listDepartmentTree,
queryCrowdTree
}
import { http, http2, http_xiaolong } from '@/main' import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.' const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router' const URL = 'rop-scrm-entmicro/router'
...@@ -378,6 +378,28 @@ const getMaterialListApi = params => { ...@@ -378,6 +378,28 @@ const getMaterialListApi = params => {
sign: true sign: true
}) })
} }
// 更新客户群发客户列表
const renewDetailList = params => {
params.method = `${path}update.merchant`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 客户群发统计
const renewStatistic = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { export default {
customerList, customerList,
...@@ -416,5 +438,7 @@ export default { ...@@ -416,5 +438,7 @@ export default {
queryCrowdtree, queryCrowdtree,
followerEcho, followerEcho,
getGroupListApi, getGroupListApi,
getMaterialListApi getMaterialListApi,
renewDetailList,
renewStatistic
} }
...@@ -118,7 +118,28 @@ const momentCancel = params => { ...@@ -118,7 +118,28 @@ const momentCancel = params => {
sign: true sign: true
}) })
} }
//同步朋友圈状态
const createStatus = params => {
params.method = 'marketing.api.moment.sync.create.status'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//同步朋友圈员工发送状态
const publicStatus = params => {
params.method = 'marketing.api.moment.sync.staff.public.status'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
momentDetail, momentDetail,
momentRemindUser, momentRemindUser,
...@@ -129,5 +150,7 @@ export default { ...@@ -129,5 +150,7 @@ export default {
momentStaff, momentStaff,
momentStaffCustomers, momentStaffCustomers,
getListApi, getListApi,
momentCancel momentCancel,
createStatus,
publicStatus
} }
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const URL = '/rop-scrm-entmicro/router'
const PATH = 'entmicro.api.one.template.'
const WURL = '/rop-scrm-wechat/router'
const PATH2 = 'entmicro.api.group.'
const templateList = params => {
params.method = `${PATH}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${PATH}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const update = params => {
params.method = `${PATH}update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const detail = params => {
params.method = `${PATH}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const status = params => {
params.method = `${PATH}status`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const updateNameVaild = params => {
params.method = 'entmicro.api.one.template.name.update.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: WURL,
method: 'POST',
data: params,
sign: true
})
}
//一客一群详情页
const getListApi = params => {
params.method = `${PATH}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerList = params => {
params.method = `${PATH2}template.customer.page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getFollower = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
templateList,
insert,
detail,
status,
update,
listDepartmentTree,
nameVaild,
getStatus,
updateNameVaild,
getListApi,
customerList,
getFollower
}
...@@ -91,6 +91,16 @@ const getMaterialListApi = params => { ...@@ -91,6 +91,16 @@ const getMaterialListApi = params => {
sign: true sign: true
}) })
} }
// 众筹模式活动
const crowdfundingActivity = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//模板列表 //模板列表
const templatePage = params => { const templatePage = params => {
params.method = `${path}template.page.search` params.method = `${path}template.page.search`
...@@ -144,5 +154,6 @@ export default { ...@@ -144,5 +154,6 @@ export default {
templatePage, templatePage,
createdNameList, createdNameList,
templateUpdate, templateUpdate,
templateSave templateSave,
crowdfundingActivity
} }
...@@ -664,3 +664,56 @@ html { ...@@ -664,3 +664,56 @@ html {
color: #5850ff !important; color: #5850ff !important;
} }
} }
.scrm-box-f {
background: #ffffff;
}
.circleStatusRed {
width: 6px;
height: 6px;
border-radius: 50%;
background: #eb4e4e;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.circleStatusGray {
width: 6px;
height: 6px;
border-radius: 50%;
background: #999999;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.circleStatusGreen {
width: 6px;
height: 6px;
border-radius: 50%;
background: #2cca74;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.circleStatusYellow {
width: 6px;
height: 6px;
border-radius: 50%;
background: #fdb757;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.circleStatusPurple {
width: 6px;
height: 6px;
border-radius: 50%;
background: #5850ff;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
...@@ -231,5 +231,20 @@ function setMinHeight(calssName = '.edit-container') { ...@@ -231,5 +231,20 @@ function setMinHeight(calssName = '.edit-container') {
let minHeight = 'calc(100vh - ' + height + ')' let minHeight = 'calc(100vh - ' + height + ')'
document.querySelector(calssName).style.minHeight = minHeight document.querySelector(calssName).style.minHeight = minHeight
} }
function isShowBtn(value) {
export { limitPrice, getExplorer, exportFn, aToExport, downloadIamge, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight } let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu)
function menuLevel(item) {
item.forEach(itm => {
if (itm.path == value) {
isShowStatus = true
}
if (itm.children) {
menuLevel(itm.children)
}
})
}
return isShowStatus
}
export { isShowBtn, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight }
...@@ -18,6 +18,7 @@ import tableTooltip from '@/components/table-tooltip/index.vue' ...@@ -18,6 +18,7 @@ import tableTooltip from '@/components/table-tooltip/index.vue'
import glsxRows from '@/components/glsx-rows/index.vue' import glsxRows from '@/components/glsx-rows/index.vue'
import glsxDescriptions from '@/components/glsx-descriptions/index.vue' import glsxDescriptions from '@/components/glsx-descriptions/index.vue'
import selectTag from '@/components/selectTag/index.vue' import selectTag from '@/components/selectTag/index.vue'
import searchForm from '@/components/search-form/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
...@@ -28,4 +29,5 @@ Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog) ...@@ -28,4 +29,5 @@ Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip) Vue.component('table-tooltip', tableTooltip)
Vue.component('glsx-rows', glsxRows) Vue.component('glsx-rows', glsxRows)
Vue.component('glsx-descriptions', glsxDescriptions) Vue.component('glsx-descriptions', glsxDescriptions)
Vue.component('select-tag', selectTag)
\ No newline at end of file \ No newline at end of file
Vue.component('select-tag', selectTag)
Vue.component('search-form', searchForm)
\ No newline at end of file \ No newline at end of file
<template>
<div>
<el-form class="clearfix search-form" id="searchForm" :class="[expande ? 'expande' : 'close']" :model="formModel" :size="size" @submit.native.prevent :label-position="labelPosition" :label-width="labelWidth">
<!-- <div class="expande-button-wrap" @click="openClose">
<i class="el-icon-arrow-down"></i>
<span v-if="expande">展开</span>
<span v-else>收起</span>
</div> -->
<div class="expande-button-wrap" v-if="needShowExpande">
<div class="expande-button" @click="expandeClick" v-if="!expande">
<i class="el-icon-arrow-down"></i>
<span>展开</span>
</div>
<div class="expande-button" @click="expandeClick" v-else>
<i class="el-icon-arrow-up"></i>
<span>收起</span>
</div>
</div>
<div class="firstRowBtn" v-if="!expande && isShowBtns && isNeedThreeBtns">
<el-button plain @click="resetTable" size="small">重置</el-button>
<el-button type="primary" @click="searchTable" size="small">查询</el-button>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" -->
<!-- <el-button type="primary" @click="syncClick" :loading="ploading" size="small" >同步数据</el-button> -->
</div>
<div class="itemWidth">
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :clearable="item.clearable || false" :readonly="item.readonly || false" @keyup.enter.native="onInput" ></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select size="small" v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="!item.noFilter">
<el-option v-for="i in item.options" :key="i[item.value] || i.value" :label="i[item.key] || i.label" :value="i[item.value] || i.value" :disabled="i.disabled"></el-option>
</el-select>
</template>
<template v-else-if="item.type === 'daterange'">
<!-- :default-value="['2021-10-03', '2021-11-03']" -->
<el-date-picker v-if="showDefaultTime" v-model="formModel[item.prop]" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="item.pickerOptions || {}"></el-date-picker>
<el-date-picker v-else v-model="formModel[item.prop]" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="item.pickerOptions || {}"></el-date-picker>
</template>
</template>
</el-form-item>
<el-form-item style="position:absolute;right:-12px;bottom:0;" v-if="!needShowExpande || expande">
<template>
<slot name="form-slot"></slot>
</template>
</el-form-item>
</div>
</el-form>
</div>
</template>
<script>
export default {
name: 'search-form',
props: {
formModel: {
type: Object,
default: () => {}
},
size: {
type: String,
default: 'small'
},
formList: {
type: Array,
default: () => []
},
labelPosition: {
type: String,
default: 'right'
},
labelWidth: {
type: String,
default: 'auto'
},
ploading: {
type: Boolean,
default: false
},
isHasSyncBtn: {
type: Boolean,
default: false
},
isThreeRowShow:{
type: Boolean,
default: false
},
merchantModel: {
type: Number,
default: 1
},
accountLevel: {
type: Number,
default: 0
},
showDefaultTime: {
type: Boolean,
default: false
},
isNeedThreeBtns:{
type: Boolean,
default: true
}
},
data() {
return {
expande: true,
needShowExpande: false,
FormHeight: 0,
isShowBtns: true
}
},
created() {},
mounted() {
if (this.showDefaultTime) {
//调用默认时间(30天)
this.getPassMonthFormatDate()
}
this.$nextTick(()=>{
var sf = document.getElementById('searchForm')
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
if( sf.clientWidth< 840 && this.isThreeRowShow){
document.querySelector('.itemWidth').style.minHeight= document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
})
//有数据不算表格高度,没数据算高度
// setTimeout(() => {
// this.$emit('setTableHeightEvent')
// }, 200)
// })
//-------------------------
// var that = this
// var resizeTimer = null
// 如何实现不管窗口如何改变,只在停止改变之后才执行代码呢?
// $(window).bind('resize', function() {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
//
// }, 100)
// })
// window.onresize = () => {
// return (() => {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
// window.location.reload() //浏览器重新从服务器请求资源,在http请求头中不会包含缓存标记
// // that.FormHeight = document.getElementById('searchForm').offsetHeight
// if (sf.clientWidth < 952 && that.isHasSyncBtn) {
// that.isShowBtns = false
// }
// }, 100)
// })()
// }
// window.addEventListener('resize', () => {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
// window.location.reload() //浏览器重新从服务器请求资源,在http请求头中不会包含缓存标记
// // that.FormHeight = document.getElementById('searchForm').offsetHeight
// if (sf.clientWidth < 952 && that.isHasSyncBtn) {
// that.isShowBtns = false
// }
// }, 100)
// })()
},
watch: {
FormHeight: {
handler(val) {
let lineHeight = 75 //22
if (val > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
}
}
},
methods: {
onInput(e) {
this.$emit('input', e)
},
resetTable() {
this.$emit('resetTable')
},
searchTable() {
this.$emit('searchTable')
},
syncClick() {
this.$emit('syncClick')
},
handleExport(){
this.$emit('handleExport')
},
expandeClick() {
this.expande = !this.expande
// setTimeout(() => {
// this.$emit('setTableHeightEvent')
// }, 200)
},
//时间选择器显示默认一月的时间
/* 获取过去时间,并传值给现在时间 */
getPassMonthFormatDate() {
var nowDate = new Date()
var date = new Date(nowDate)
date.setDate(date.getDate() - 30) //7 30 365
var seperator1 = '-'
var year = date.getFullYear()
var month = date.getMonth() + 1
var strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
var formatDate = year + seperator1 + month + seperator1 + strDate
this.getNowFormatDate(formatDate)
},
/* 获取现在时间,并接受过去时间的值 */
getNowFormatDate(formatDate) {
var date = new Date()
var seperator1 = '-'
var year = date.getFullYear()
var month = date.getMonth() + 1
var strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
var nowData = year + seperator1 + month + seperator1 + strDate
this.$set(this.formModel, 'daterange', [formatDate, nowData])
// this.formModel['daterange'] = [formatDate, nowData] // 默认赋值一个月时间,不要直接赋值,不是响应式
}
}
}
</script>
<style lang="scss">
@import '@/styles/variables.scss';
.search-form {
padding: 18px 0 0 0;
position: relative;
overflow: hidden;
min-height: 50px;
/deep/.el-form-item__label-wrap .el-form-item__label {
// display: inline-block;
// width: 110px;
}
.firstRowBtn {
position: absolute;
right: 52px;
z-index: 1;
.el-button + .el-button {
margin-left: 10px;
}
}
.itemWidth {
max-width: 1027px;
min-width: 660px;
}
.expande-button-wrap {
position: absolute;
top: 24px;
right: 0;
z-index: 99;
.expande-button {
color: $btnBlue;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
line-height: 20px;
}
}
}
.el-form-item {
display: inline-block;
// float: left;
// width: calc(50% - 20px);
// max-width: 350px; //420
margin-right: 15px;
}
.el-range-editor--small.el-input__inner {
width: 215px;
}
.el-input--small .el-input__inner {
width: 215px;
}
.el-select {
width: 215px;
}
.el-select>.el-input{
width: 215px;
}
.el-form-item__content {
width: 100%;
}
}
.expande {
// overflow: auto;
height: auto;
// padding-bottom: 22px;
}
.close {
overflow: hidden;
height: 50px;
// padding-bottom: 0;
}
</style>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
......
...@@ -33,4 +33,3 @@ export const http = params => Vue.prototype.$http(params) ...@@ -33,4 +33,3 @@ export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params) export const http2 = params => Vue.prototype.$http2(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
export const http_merchant = params => Vue.prototype.$http_merchant(params) export const http_merchant = params => Vue.prototype.$http_merchant(params)
export const http_xiaolong = params => Vue.prototype.$http_xiaolong(params)
export default {
data() {
return {
crowdGroupUnitList: []
}
},
mounted() {},
methods: {
async queryCrowdGroupTree(isHead) {
let params = {
req: {
pageSize: 1000,
pageNum: 1,
merchantId: this.$globalState.session.merchantId,
keyword: ''
}
}
const crowdGroupUnitList = await this.$apis.activity.queryCrowdGroupTree(params)
console.log(crowdGroupUnitList)
return isHead ? [{ crowdGroupName: '默认客群', crowdGroupId: '0' }].concat(crowdGroupUnitList.crowdGroupUnitList) : crowdGroupUnitList.crowdGroupUnitList
},
async queryCrowdTree() {
const commonParam = { pageSize: 1000, pageNum: 1, merchantId: this.$globalState.session.merchantId }
const params1 = {
req: {
crowdType: 1,
...commonParam
}
}
const params2 = {
req: {
...commonParam,
crowdType: 2
}
}
const crowdUnitList1 = this.$apis.activity.queryCrowdTree(params1)
const crowdUnitList2 = this.$apis.activity.queryCrowdTree(params2)
const crowdUnitList = await Promise.all([crowdUnitList1, crowdUnitList2])
/*
groupArr: 勾选的人群
checked: 是否展开
isIndeterminateGroup:树节点选中
gruopCheckAll: 全选
selectGroup:右边树的选中数据
*/
this.crowdUnitList = [
{ crowdName: '推荐人群', children: crowdUnitList[0] },
{ crowdName: '自定义人群', children: crowdUnitList[1] }
]
return this.crowdUnitList
}
}
}
...@@ -27,7 +27,7 @@ Vue.use(GLTableButton) ...@@ -27,7 +27,7 @@ Vue.use(GLTableButton)
Vue.use(GLEditor) Vue.use(GLEditor)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, xiaolong_req } = await fetchConfig(false) const { response, request, request2, sign, secret, sign_common, request_common, request_merchant } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -40,7 +40,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -40,7 +40,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) // Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$tracker = common.tracker Vue.prototype.$tracker = common.tracker
// const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop' // const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop'
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } }) // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } })
......
.inline-b {
display: inline-block;
}
.pull-right {
float: right;
}
.green-text {
color: #00A854;
}
.gray-text{
color:#666666;
margin-left:6px;
}
.red-text {
color: rgb(255, 0, 0);
}
.blue-text{
color:$btnBlue;
&:hover{
color: #9994FF;
cursor: pointer;
}
}
.pure-blue-text{
color:$btnBlue!important;
}
.green {
background-color: #00A854;
}
.red {
color: rgb(255, 0, 0);
}
.flex-center{
display: flex;
justify-content: center;
align-items: center;
}
.additional-text{
height: 22px;
font-size: 16px;
font-weight: 400;
color: #666666;
line-height: 22px;
}
.btn-blue {
height: 32px;
background: $btnBlue;
border-radius: 4px;
color: #fff;
font-size: 14px;
font-weight: 400;
color: #FFFFFF;
padding: 6px 27px;
}
// 单行省略
.ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* for Opera */
}
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
.ellipsis-2 {
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*显示的行数*/
}
.ellipsis-2-text:after {
content: "...";
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.ellipsis-4{
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
}
.ellipsis-4-text:after {
content: "...";
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.statusText {
vertical-align: middle;
}
\ No newline at end of file \ No newline at end of file
@import "./variables.scss";
@import "./common.scss";
@import "./resetelement.scss";
body,
html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
background-color: $bgColor;
}
// #app {
// height: 100%;
// overflow: auto;
// }
// html, body, #app {
// width: 100%;
// height: 100%;
// }
// 默认去掉所有p元素的上下边距
p {
margin-top: 0;
margin-bottom: 0;
}
button {
border: none;
&:hover {
cursor: pointer;
}
}
// 子系统不设外边距
.scrm-sub-client-container {
// padding: 0 20px 20px 40px;
box-sizing: border-box;
}
.el-table .cell {
// line-height: 20px!important;
}
.el-select {
width: 100%;
}
.el-pagination {
display: flex;
margin-top: 18px;
}
.el-message-box__btns .el-button--small {
min-width: 68px;
}
.glsx-table .el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: $btnBlue;
color: #fff;
}
/deep/ .el-input__inner:focus {
border-color: $btnBlue !important;
}
/deep/.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: $btnBlue;
}
.el-message-box {
width: 547px;
height: 310px;
box-sizing: border-box;
padding-bottom: 10px;
}
.el-message-box__title {
padding-left: 0;
margin-bottom: 0;
font-size: 20px;
line-height: 1;
color: #333;
}
.el-message-box__title {
display: block !important;
}
.el-message-box__headerbtn {
display: block !important;
color: #666666;
}
.el-message-box__header {
position: relative;
padding: 15px 20px;
border-bottom: 1px solid #e6e6e6;
}
.el-message-box__content {
text-align: center;
padding: 60px 0;
}
.el-icon-warning {
display: block !important;
font-size: 33px !important;
color: #5850ff !important;
position: relative;
left: 50%;
transform: translateX(-50%);
margin-bottom: 12px;
}
// .el-message-box__status.el-icon-error {
// display: block !important;
// font-size: 33px !important;
// position: relative;
// left: 50%;
// transform: translateX(-50%);
// margin-bottom: 12px;
// }
.el-tooltip__popper.is-dark {
background: #666666 !important;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06) !important;
font-size: 12px;
font-weight: 400;
color: #ffffff;
line-height: 18px;
}
.el-tooltip__popper[x-placement^="top"] .popper__arrow {
border-top-color: #666666 !important;
}
.el-tooltip__popper[x-placement^="top"] .popper__arrow:after {
border-top-color: #666666 !important;
}
\ No newline at end of file \ No newline at end of file
$bgColor:#F4F5FA;
$btnBlue:#5850ff;
$lightBtnBlue:#9994FF;
<template>
<div class="activity-main">
<div class="activity-box-f" v-loading="addLoading">
<div class="activity-box-title">{{ activityId ? '编辑活动' : '创建活动' }}</div>
<div class="activity-box-form">
<el-form ref="addForm" :model="addForm" class="code-body-form" label-width="120px" :rules="addRules">
<el-form-item label="活动名称" prop="configName" size="small" class="form-w40">
<el-input size="small" v-model.trim="addForm.configName" placeholder="请输入活动名称" maxlength="20"></el-input>
<div class="activity-name-tips">例:输入“定保客户”,系统推送任务时将自动追加月份信息“5月招揽-定保客户”</div>
</el-form-item>
<el-form-item label="活动对象" prop="selectType" size="small" class="activity-item">
<el-radio-group v-model="addForm.selectType" :disabled="this.activityId" @change="handleType">
<el-radio :label="1">客群</el-radio>
<el-radio :label="2">Excel导入</el-radio>
</el-radio-group>
<template v-if="addForm.selectType == 2">
<div class="activity-link">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" />
</div>
<a href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/活动客户明细模板.xlsx">下载模板</a>
</div>
<div class="upload-result" v-if="importName">
<div class="upload-name">{{ importName }}</div>
<div class="upload-del">
<i
class="el-icon-delete"
@click="
importName = ''
exportUrl = ''
successStatus = false
"
></i>
</div>
</div>
<div class="activity-name-tips">注:1. 手机号码、车牌号、车架号 至少填写一项,系统将用于匹配客户;</div>
<div class="activity-name-tips" style="margin-left: 26px">2. 导入招揽员工号码前,请确保该员工已加入企业微信,并且备注号码。</div>
</template>
</el-form-item>
<template v-if="addForm.selectType == 1">
<el-form-item label="推送日期" prop="sendDate" size="small" class="activity-item">
<div class="activity-date">
每月
<el-input-number v-model="addForm.sendDate" controls-position="right" :min="1" :max="28"></el-input-number>
号
</div>
</el-form-item>
<el-form-item label="推送月份" prop="sendMonth" size="small" class="activity-item">
<el-radio-group v-model="addForm.sendMonth">
<el-radio :label="1">次月</el-radio>
<el-radio :label="0">当月</el-radio>
</el-radio-group>
<div class="activity-name-tips">例:选择“次月”,系统将在设定的推送日期推送次月的待定保客户</div>
</el-form-item>
<el-form-item label="状态" size="small" class="activity-status">
<el-switch v-model="activityStatus"></el-switch>
<span class="activity-stop">{{ activityStatus ? '启用' : '停用' }}</span>
<el-popover placement="top" width="300" trigger="hover" content="停用活动仅会影响下个周期的营销推送,不影响已经生成的招揽活动。">
<img src="@/assets/activity/question.png" slot="reference" class="count-item-question" />
</el-popover>
</el-form-item>
<el-form-item label="客群" prop="custGroupId" size="small">
<div class="group-item">
<el-select v-model="addForm.custGroupId" placeholder="请选择" @change="selectCrowd(addForm.custGroupId)">
<el-option v-for="item in crowdGroupUnitList" :key="item.crowdGroupId" :label="item.crowdGroupName" :value="item.crowdGroupId"></el-option>
</el-select>
<div class="edit-group" @click="jumpCrowd" v-if="isShowBtn('/clientDataOverview/grouping')">编辑客群</div>
</div>
</el-form-item>
</template>
<el-form-item label="配置营销" prop="name" size="small" v-if="addForm.custGroupId || (successStatus && exportUrl)">
<GLTable :hasPage="false" ref="config" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<template slot="welcomeConfigDTOS" slot-scope="scope">
<div class="statusText">
<span :class="{ circleStatusGray: scope.scope.welcomeDTOS.length == 0, circleStatusGreen: scope.scope.welcomeDTOS.length > 0 }"></span>
<span>{{ statusText(scope.scope.welcomeDTOS) }}</span>
</div>
</template>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleConfig(scope.scope)"><div class="config">配置</div></el-button>
<el-button type="text" @click="handleReset(scope.scope)" v-if="scope.scope.welcomeDTOS && scope.scope.welcomeDTOS.length"><div class="config">重置</div></el-button>
</div>
</GLTable>
<div class="activity-name-tips">
配置后,员工企微端可以对该细分人群进行一键营销,点击
<a @click="$refs.imageForm.clickHandler()">预览</a>
</div>
</el-form-item>
</el-form>
</div>
</div>
<GLDialog title="提示" @onOk="handleSureConfig" @onCancel="handleCancel" type="warning" content="重置后营销内容将清空,是否确认重置?" :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>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">
否
</el-button>
<el-button size="small" type="primary" @click="handleSureConfig">是</el-button>
</div> -->
</GLDialog>
<GLDialog title="匹配结果" :hasFooter="true" mode="small" :visible.sync="importVisible">
<div class="dialog-body-panel">
<div class="import-result">
匹配成功
<span>{{ ImportResult.successCount }}</span>
条,匹配失败
<span>{{ ImportResult.errorCount }}</span>
条
</div>
<div class="import-reason">
<div class="import-reason-content">失败分析:</div>
<div class="import-reason-content">1. 导入数据后,若一行数据中的不同字段匹配到不同的客户,系统不会自动处理,统一汇总在「失败记录」,您可导出后重新整理数据,安排再次导入;</div>
<div class="import-reason-content">2. 若一行数据中的所有字段都不能匹配到系统内的任一客户,系统不会自动处理,统一汇总在「失败记录」,请进入「客户管理」确认该客户是否存在。</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false">
完成
</el-button>
<el-button size="small" type="primary" @click="handleImport" v-if="ImportResult.errorCount">导出失败记录</el-button>
</span>
</GLDialog>
<div class="downloading-containner" v-if="downloadStatus">
<div class="downloading-box">
<div class="downloading-title">
<i class="el-icon-loading"></i>
数据导入中,请稍等
</div>
<div class="downloading-opration">
<i class="el-icon-arrow-down" v-if="downHeight" @click="downHeight = 0"></i>
<i class="el-icon-arrow-up" v-else @click="downHeight = 30"></i>
</div>
</div>
<div class="downloading-step" :style="{ height: downHeight + 'px' }">
<div class="downloading-name">客户数据表.xlsl</div>
<div class="downloading-bar">
<div class="downloading-num" :style="{ width: percentage + '%' }"></div>
</div>
</div>
</div>
<el-image class="preview-panel" style="width: 100px; height: 0px" ref="imageForm" :src="url" :preview-src-list="srcList"></el-image>
<GLFooter>
<el-button @click="goBack">
取消
</el-button>
<el-button type="primary" @click="handleSure" v-show="(successStatus && addForm.selectType == 2 && exportUrl) || addForm.selectType == 1">提交</el-button>
</GLFooter>
<component @handleConfigChecked="handleConfigChecked" :is="'market-config'" ref="configForm" :boxHeight="boxHeight"></component>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
import url from '@/assets/activity/config.png'
import marketConfig from './components/marketConfig.vue'
import crowd from '@/mixins/crowd'
import { isShowBtn } from '@/common/constant'
const optionsGroup = [
{
value: '1',
label: '待定保客户'
},
{
value: '2',
label: '待首保客户'
},
{
value: '3',
label: '流失客户'
}
]
export default {
mixins: [crowd],
name: 'addActivity',
components: {
marketConfig
},
data() {
return {
url,
isShowBtn,
ImportResult: {},
downloadStatus: false,
downHeight: 0,
percentage: 0,
setInter: '',
activityStatus: true,
boxHeight: '',
srcList: [url],
importName: '',
successStatus: false,
dialogVisible: false,
importVisible: false,
addLoading: false,
drawer: false,
addForm: {
sendMonth: 1,
status: 0,
selectType: 1
},
activityId: '',
optionsGroup,
tableData: [],
tableIndex: 0,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '人群',
prop: 'crowdName'
},
{
label: '状态',
prop: 'welcomeConfigDTOS',
addHtml: 'welcomeConfigDTOS',
formatter: cellValue => {
return cellValue.welcomeDTOS && cellValue.welcomeDTOS.length ? '已配置' : '未配置'
}
},
{
label: '操作',
prop: 'optionBtns',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
addRules: {
configName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
sendDate: [{ required: true, message: '请输入推送日期', trigger: 'change' }],
selectType: [{ required: true, message: '请输入推送日期', trigger: 'change' }],
sendMonth: [{ required: true, message: '请选择推送月份', trigger: 'change' }],
custGroupId: [{ required: true, message: '请选择客群', trigger: 'change' }]
}
}
},
watch: {
addForm: {
handler() {
if (this.addForm.sendDate < new Date().getDate() && this.addForm.sendMonth == 0) {
this.addForm.sendDate = new Date().getDate()
}
},
deep: true
},
activityStatus(val) {
this.addForm.status = val ? 0 : -1
}
},
methods: {
handleCancel() {
this.dialogVisible = false
},
handleType() {
if (this.addForm.selectType == 2) {
this.tableData = [
{
groupId: 0,
configId: 0,
crowdName: '默认客群',
welcomeDTOS: []
}
]
}
},
statusText(text) {
return text && text.length ? '已配置' : '未配置'
},
addProcess() {
this.percentage = this.percentage > 90 ? this.percentage : this.percentage + Math.random() * 5
},
uploadFile(e) {
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.downloadStatus = true
this.setInter = setInterval(this.addProcess, 100)
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) {
this.importName = file.name
this.exportUrl = res
this.handleSaveImport()
}
this.$refs.file.value = ''
})
}
},
handleImport() {
util.openUrl(this.ImportResult.errUrl)
},
handleSaveImport() {
this.$apis.activity
.machetes({ url: this.exportUrl, activityType: 1 })
.then(res => {
if (res) {
this.ImportResult = res
this.importVisible = true
if (this.ImportResult.successCount) {
this.successStatus = true
}
} else {
this.importName = ''
this.exportUrl = ''
}
this.clearLoading()
})
.catch(err => {
this.clearLoading()
})
},
clearLoading() {
this.downloadStatus = false
this.percentage = 0
clearInterval(this.setInter)
},
handleReset(scope) {
this.tableIndex = this.tableData.findIndex(item => item.groupId == scope.groupId)
this.dialogVisible = true
},
//配置
handleConfig(scope) {
this.tableIndex = this.tableData.findIndex(item => item.groupId == scope.groupId)
let params = {
groupIdList: [scope.crowdId],
custGroupId: this.addForm.custGroupId
}
this.$apis.activity.activityGroupList(params).then(res => {
console.log(res)
})
this.$refs.configForm.init(this.tableData[this.tableIndex].welcomeDTOS)
},
handleConfigChecked(dtos) {
let welcome = dtos.filter(item => item.attContent)
console.log(welcome)
this.tableData[this.tableIndex].welcomeDTOS = welcome
},
handleSureConfig() {
this.dialogVisible = false
this.tableData[this.tableIndex].welcomeDTOS = []
},
handleSure: utils.debounce(function() {
this.$refs['addForm'].validate(valid => {
if (valid) {
this.addLoading = true
let params = this.$common.utils.deepClone(this.addForm)
params.configDetailRpcRequests = this.tableData
if (this.exportUrl) {
params.url = this.exportUrl
params.activityType = 1
delete params.sendDate
delete params.selectType
delete params.sendMonth
delete params.custGroupId
delete params.sendDate
}
let activityParams
if (this.activityId) {
activityParams = 'activityUpdate'
} else {
activityParams = 'activityInsert'
}
this.$apis.activity[activityParams](params).then(res => {
this.addLoading = false
if (res) {
this.$router.push('/activityConfig/index')
}
})
}
})
}, 300),
//编辑客群
jumpCrowd() {
this.$history.push('/custom/clientDataOverview/grouping')
},
//选择客群
selectCrowd(val) {
let tableData
this.crowdGroupUnitList.forEach(item => {
if (item.crowdGroupId == val) {
tableData = item.crowdUnitList
}
})
this.tableData = tableData.map(item => {
return {
groupId: item.crowdId,
configId: item.crowdId,
crowdName: item.crowdName,
welcomeDTOS: []
}
})
},
activityDetail(id) {
let params = { id }
this.addLoading = true
this.$apis.activity.activityDetail(params).then(res => {
this.addForm = Object.assign(res, { selectType: 1 })
const configDetailRpcRequests = res.configDetailRpcResponses
let tableData
this.crowdGroupUnitList.forEach(item => {
if (item.crowdGroupId == res.custGroupId) {
tableData = item.crowdUnitList
}
})
this.tableData = tableData.map((item, index) => {
return {
groupId: item.crowdId,
configId: item.crowdId,
crowdName: item.crowdName,
welcomeDTOS: configDetailRpcRequests[index] && configDetailRpcRequests[index].welcomeConfigDTOList ? configDetailRpcRequests[index].welcomeConfigDTOList : []
}
})
this.activityStatus = this.addForm.status == -1 ? false : true
this.$nextTick(() => {
this.addLoading = false
})
delete this.addForm.configDetailRpcResponses
})
},
goBack() {
this.$router.push('/activityConfig/index')
}
},
async created() {
this.activityId = this.$route.query.id
this.crowdGroupUnitList = await this.queryCrowdGroupTree()
if (this.activityId) {
this.activityDetail(this.activityId)
}
},
beforeDestroy() {
clearInterval(this.setInter)
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 160
}
}
</script>
<style lang="scss" scoped>
.downloading-containner {
padding: 20px;
width: 300px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
position: fixed;
bottom: 30px;
right: 20px;
background: #ffffff;
border-radius: 4px;
.downloading-box {
display: flex;
justify-content: space-between;
.el-icon-loading {
color: #5850ff;
opacity: 0.8;
}
.downloading-opration {
cursor: pointer;
}
}
.downloading-step {
height: 30px;
overflow: hidden;
transition: all 0.5s;
.downloading-name {
font-size: 12px;
line-height: 24px;
font-weight: 400;
color: #333333;
text-align: left;
}
.downloading-bar {
height: 2px;
background: #e8e8ea;
border-radius: 1px;
width: 100%;
position: relative;
.downloading-num {
height: 2px;
border-radius: 1px;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
background: #5850ff;
}
}
}
}
.table-btns {
/deep/ {
.el-button--text {
padding: 0px;
}
}
}
.import-result {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 21px;
text-align: left;
margin-bottom: 12px;
span {
color: #eb4e4e;
&:first-child {
color: #5850ff;
}
}
}
.import-reason-content {
font-size: 14px;
color: #999999;
line-height: 22px;
font-weight: 400;
text-align: left;
}
.statusText {
> span:first-child {
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
&.circleStatusGreen {
background: #2cca74;
}
&.circleStatusGray {
background: #c6c6c6;
}
}
}
.activity-box-f {
background: #ffffff;
min-height: calc(100vh - 138px);
.activity-box-title {
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 54px;
padding-left: 24px;
border-bottom: 1px solid #d8d8d8;
}
.activity-box-form {
width: 50%;
padding-top: 30px;
.form-w40 {
width: 80%;
}
.upload-result {
display: flex;
align-items: center;
.upload-name {
margin-right: 5px;
padding-left: 10px;
height: 26px;
line-height: 26px;
background: #f5f7fa;
border-radius: 2px;
flex: 1;
}
i {
cursor: pointer;
color: #c6c6c6;
}
}
.activity-link {
display: flex;
margin: 5px 0px;
cursor: pointer;
.upload-btn {
position: relative;
display: inline-block;
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a {
margin-left: 6px;
color: #5850ff;
}
}
.activity-item {
/deep/ {
.el-radio {
margin-right: 24px;
}
.el-input-number--small {
width: 104px;
}
}
}
.activity-stop {
margin: 0px 8px;
}
.group-item {
display: flex;
.edit-group {
color: #5850ff;
cursor: pointer;
margin-left: 15px;
line-height: 32px;
}
}
.activity-status {
/deep/ {
.el-form-item__content {
display: flex;
align-items: center;
}
}
}
.count-item-question {
width: 14px;
height: 14px;
vertical-align: middle;
margin-top: -1px;
}
.activity-name-tips {
font-size: 14px;
line-height: 14px;
font-weight: 400;
color: #999999;
margin: 8px 0px;
a {
color: #5850ff;
cursor: pointer;
}
}
}
}
.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;
}
.preview-panel {
/deep/ {
.el-image-viewer__img {
max-width: 61vh !important;
max-height: 64vh !important;
}
}
}
</style>
<template>
<div class="activity-main">
<el-drawer class="activity-drawer" size="50%" title="配置企微营销" :visible.sync="drawer" :before-close="handleClose">
<div class="market-container">
<div v-if="title || $slots.title">
<slot name="title">{{ title }}</slot>
</div>
<div class="market-title">营销内容</div>
<div class="market-content" v-if="drawer">
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div>
</div>
<div class="drawer-btn">
<el-button @click="drawer = false" size="small">
取消
</el-button>
<el-button type="primary" @click="handleSaveConfig" size="small">提交</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7,
MATERIAL: 10
}
export default {
name: 'marketConfig',
props: {
title: {
type: String,
default: ''
},
boxHeight: {
type: Number,
default: 200
}
},
data() {
return {
drawer: false,
welcomeStatus: false,
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
// 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], //只允许文本和图片
// // limitNum: 2,//限制视频数量
// // limitWidth: 10000,//限制视频宽度
// // limitHeight: 10000,//限制视频高度
// // limitTime: 2,//限制视频时长
// 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: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
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: 'link',
// funName: 'link',
// text: '车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
// },
// {
// name: '素材',
// type: 'material',
// funName: 'material',
// groupListApi: this.$apis.welcomeword.getGroupListApi,
// materialListApi: this.$apis.welcomeword.getMaterialListApi,
// // videoNo: true
// pdfNo: true
// },
{
name: '模板',
type: 'message',
funName: 'message',
getSearchApi: this.$apis.welcomeword.createdNameList,
templateApi: this.$apis.welcomeword.templatePage,
templateUpdateApi: this.$apis.welcomeword.templateUpdate,
templateSaveApi: this.$apis.welcomeword.templateSave,
templateDetailApi: this.$apis.welcomeword.templateDetail
}
]
}
},
watch: {
drawer(val) {
if (!val) {
let previewList = this.$refs.welcome.previewList
previewList.map(item => {
if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
})
this.$emit('handleConfigChecked', previewList)
}
}
},
methods: {
init(previewList) {
this.drawer = true
this.$nextTick(() => {
previewList.map(item => {
if (item.attType == 7) {
item.attContent = JSON.parse(item.attContent)
}
})
this.$refs.welcome.updateList(previewList)
})
},
handleSaveConfig() {
this.drawer = false
}
}
}
</script>
<style lang="scss" scoped>
.activity-drawer {
z-index: 3000 !important;
/deep/ .el-drawer__header {
border-bottom: 1px solid #e6e6e6;
padding: 18px 20px;
margin-bottom: 20px;
}
}
.market-container {
padding: 0px 20px 20px;
height: calc(100% - 64px);
}
.market-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 24px;
margin-bottom: 10px;
}
.drawer-btn {
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 20px;
height: 64px;
border-top: 1px solid #e6e6e6;
}
</style>
<style>
.el-select-dropdown {
z-index: 3001 !important;
}
</style>
<template>
<div>
<GLDialog title="分配任务" :hasFooter="true" @onOk="handleSure" @onCancel="handleCancel" :visible.sync="dialogVisible" mode="big">
<div class="member-item">
<label>任务提醒:</label>
<el-radio-group v-model="immExecutionFlag">
<el-radio :label="true">立即提醒</el-radio>
<el-radio :label="false">指定日期</el-radio>
<el-date-picker :picker-options="pickerOptions" v-if="!immExecutionFlag" value-format="yyyy-MM-dd" v-model="sendDate" type="date" placeholder="选择日期" size="small"></el-date-picker>
</el-radio-group>
</div>
<div class="member-item">
<label>跟进员工:</label>
<el-radio-group v-model="flowFirstFlag">
<el-radio :label="true">上一次跟进员</el-radio>
<el-radio :label="false">指定员工</el-radio>
</el-radio-group>
</div>
<div class="member-wrapper" v-if="!flowFirstFlag">
<div class="member-left">
<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-popover ref="popover" placement="bottom" 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-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;margin-left:20px" size="small">
<el-input :size="size" v-model.trim="searchForm.name" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item style="margin-bottom: 0;margin-left:20px" size="small">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content" :style="{ 'max-height': boxHeight + 'px' }">
<GLTable 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">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
<div class="member-checked">
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</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)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
<!-- <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">
取消
</el-button>
<el-button size="small" type="primary" @click="handleSure">确定</el-button>
</div> -->
</GLDialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['customerIds'],
data() {
return {
immExecutionFlag: true,
flowFirstFlag: true,
sendDate: '',
dialogVisible: false,
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7 // 如果没有后面的-8.64e7就是不可以选择今天的
}
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerName',
formatter: cellValue => {
return cellValue.followerName ? cellValue.followerName : '-'
}
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
boxHeight: 200
}
},
mounted() {
this.boxHeight = document.documentElement.clientHeight - 550
this.listDepartmentTree(false)
},
methods: {
handleCancel() {
this.dialogVisible = false
},
selectionTable(val) {
this.innerTags = val
// this.$emit('selectTable', val)
},
init() {
this.immExecutionFlag = true
this.flowFirstFlag = true
this.sendDate = ''
this.innerTags = []
this.dialogVisible = true
},
handleSure: utils.debounce(function() {
const { flowFirstFlag, immExecutionFlag, sendDate, customerIds, innerTags } = this
const staffIds = innerTags.map(item => item.staffId)
const activityId = this.$route.query.id
let params = {
flowFirstFlag,
immExecutionFlag,
sendDate,
activityId,
customerIds,
staffIds
}
if (immExecutionFlag) {
delete params.sendDate
}
this.$apis.activity.assignmentCustomer(params).then(res => {
if (res) {
this.$message({
message: '分配成功',
type: 'success'
})
this.$emit('taskFinish')
this.dialogVisible = false
}
})
}, 300),
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = false
params.isFollowerStaff = isFollowerStaff
this.$apis.custom.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.$nextTick(() => {
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
})
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
if (keyword) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
console.log(this.allTreeData, '---')
this.tableEmpData = this.allTreeData
}
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
checkChange(val) {
console.log(val)
this.searchForm = {}
this.listDepartmentTree(val)
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 300px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-item {
height: 36px;
display: flex;
align-items: center;
> label {
font-size: 16px;
font-weight: 500;
color: #333333;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 70%;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 30%;
margin-left: 14px;
margin-top: -26px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 17px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 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% - 115px);
display: flex;
align-items: center;
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;
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<div class="task-header">
任务分配
<span>将门店近近期的招揽活动批量的指派给特定员工,系统将自动发送企微通知提醒员工跟进。</span>
</div>
<div class="pageContent">
<GLCombiForm ref="combiForm" :formObj="searchForm" :formData="clientManageFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<div class="leadList">
<div>
<span>客户列表</span>
</div>
<el-button size="small" @click="handleDistribution">分配任务</el-button>
</div>
<GLTable @selectionTable="selectionTable" @setTableFinishFun="setTableFinishFun" ref="customForm" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :pageConf="pageConf" :tableParams="tableParams" :pageSizes="[10, 100, 1000, 2000]">
<span slot="customerName" slot-scope="scope">
<GLFull :labelWidth="70" :identi="`node_${scope.scope.id}`">{{ scope.scope.customerName }}</GLFull>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
</span>
<div slot="followName" class="entmicro" slot-scope="scope">
<div v-if="!followList(scope.scope.followName).length">--</div>
<div class="entmicro-tag" style="padding-right:3px" v-for="(tag, idx) in followList(scope.scope.followName)" :key="idx">
<GLFull :labelWidth="110" :label="tag" textType="user" :identi="`tagIdentification_${scope.scope.id}`"></GLFull>
</div>
</div>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-if="!scope.scope.nickNameList || !scope.scope.nickNameList.length">--</div>
<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" :key="index" style="padding-bottom: 3px !important">
<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>
</el-popover>
</span>
</div>
</div>
<span slot="customerPhone" slot-scope="scope">
<span>{{ scope.scope.customerPhone == null ? '--' : scope.scope.customerPhone }}</span>
</span>
<span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<div slot="followFlag" slot-scope="scope">
<div class="statusText">
<span :class="{ circleStatusGray: scope.scope.followFlag === 0, circleStatusGreen: scope.scope.followFlag == 1 || scope.scope.followFlag == 2 }"></span>
<span>{{ statusText(scope.scope.followFlag) }}</span>
</div>
</div>
<!-- <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<auth-button :data="scope.scope"></auth-button>
<span @click="goDetail(scope.scope.oneId)" class="blue-text">详情</span>
</template> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="!scope.scope.oneId" @click="goDetail(scope.scope)" v-if="isShowBtn('/clientManage/clientDetail')">详情</el-button>
<!-- <GLButton @click="goDetail(scope.scope.oneId)" fn="客户详情" type="text">详情</GLButton> -->
</div>
</GLTable>
</div>
</div>
<select-member ref="memberForm" @taskFinish="taskFinish" :customerIds="customerIds"></select-member>
</div>
</template>
<script>
import selectMember from './components/selectMember.vue'
import crowd from '@/mixins/crowd'
import { isShowBtn } from '@/common/constant'
export default {
components: { selectMember },
mixins: [crowd],
name: 'clientManage',
data() {
return {
isShowBtn,
isReload: true,
sloading: false,
searchForm: {},
customerIds: [],
searchFormTable: {},
clientManageFormList: [
{
type: 'input',
inputType: 'text',
// prop: 'customerPhone',
name: 'keyword',
label: '姓名电话',
placeholder: '输入关键字搜索'
},
{
type: 'select',
// prop: 'isJoin',
name: 'distributeFlag',
label: '是否分配',
placeholder: '请选择',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 0
}
]
},
{
type: 'datePicker',
// prop: 'daterange',
name: 'daterange',
label: '分配日期',
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
},
{
type: 'select',
name: 'staffId',
// prop: 'staffId',
noFilter: false,
optionLabel: 'label',
optionId: 'value',
label: '跟进员工',
placeholder: '请输入跟进员工',
optionList: []
},
{
type: 'select',
// prop: 'status',
name: 'followFlag',
label: '跟进状态',
placeholder: '请选择当前状态',
optionLabel: 'optionLabel',
optionId: 'optionId',
optionList: [
{
optionLabel: '全部',
optionId: null
},
{
optionLabel: '已跟进',
optionId: 1
},
{
optionLabel: '未跟进',
optionId: 0
}
]
},
{
label: '人群分组',
name: 'groupId',
type: 'select',
optionLabel: 'crowdName',
optionId: 'crowdId',
optionList: []
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
tableOption: false,
listName: 'data',
// 行数据的key
mutiSelectUniqueKey: 'customerId',
checkSelectKey: 'customerId',
// 多选ref的名称
mutiSelectName: 'activityList',
checkSelectVal: [],
tableColumns: [
{
label: '客户姓名',
prop: 'customerName',
addHtml: 'customerName',
width: 120
},
{
label: '企微账号',
prop: 'nickNameList',
addHtml: 'nickNameList',
width: 190
},
{
label: '联系电话',
prop: 'customerPhone',
addHtml: 'customerPhone',
width: 140
},
{
label: '人群分组',
prop: 'groupName',
width: 120
},
{
label: '是否分配', //1. 加入,0.未加入
prop: 'distributeFlag',
formatter: cellValue => {
return cellValue.distributeFlag ? '是' : '否'
},
width: 120
},
{
label: '分配日期',
prop: 'distributeDate',
width: 190
},
{
label: '跟进员工',
prop: 'followName',
addHtml: 'followName',
width: 120
},
{
label: '跟进状态',
prop: 'followFlag',
addHtml: 'followFlag',
minWidth: 130
},
{
label: '操作',
prop: 'optionBtns',
width: '65px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
getListApi: this.$apis.activity.activityCustomerPage,
merchantModel: 1,
sourceList: [],
staffIdList: [],
queryFlag: 0,
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
flushTime: false
}
},
// activated() {
// this.searchTable()
// },
beforeDestroy() {
this.$message.closeAll()
},
methods: {
selectionTable(val) {
this.customerIds = val.map(item => item.customerId)
},
//分配任务
handleDistribution() {
if (this.customerIds.length == 0) {
this.$message({
showClose: true,
duration: 3000,
message: '请勾选需要被分配的客户后,再进行分配任务。'
})
return
}
this.$refs.memberForm.init()
},
followList(str) {
if (!str) {
return []
}
return str.split(',')
},
statusText(text) {
return text === 1 || text === 2 ? '已跟进' : text === 0 ? '未跟进' : '--'
},
setTableHeightEvent() {
this.$refs.customForm.setTableHeightFun()
},
setTableFinishFun(content) {
if (content && content.length) {
content.forEach(item => {
item.distributeFlag && this.tableParams.checkSelectVal.push(item.customerId)
})
this.$refs.customForm.tableHeightValues = ''
} else {
this.$refs.customForm.setTableHeightFun()
}
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (/^1[3456789]\d{9}$/.test(params.keyword)) {
params.customerPhone = params.keyword
} else {
params.customerName = params.keyword
}
params.id = this.$route.query.id
if (params.daterange) {
params.startTime = this.searchForm.daterange[0].replace(/-/g, '/')
params.endTime = this.searchForm.daterange[1].replace(/-/g, '/')
} else {
if (params.startTime) delete params.startTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise(async (resolve, reject) => {
this.searchFormTable = this.getParams()
resolve()
})
},
//来源 value值转为对应label
toLabel(value) {
if (value !== 0 && !value) {
return
}
let curElement = this.sourceList.find(item => {
return item.value === value
})
return curElement.label
},
taskFinish() {
this.searchTable()
},
//搜索表格
searchTable() {
this.$refs.customForm.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {}
this.$refs.customForm.refreshTable()
},
goDetail(scope) {
this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId)
},
//获取跟进员工
getStaffList() {
this.$apis.custom.getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const index = this.clientManageFormList.findIndex(item => {
return item.name == 'staffId'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.id
}
})
staff.unshift({ label: '全部', value: '' })
this.clientManageFormList.find(item => item.name == 'staffId').optionList = staff
})
},
queryCrowdTree() {
const params = {
req: {
pageSize: 1000,
pageNum: 1,
merchantId: this.$globalState.session.merchantId,
crowdType: 3
}
}
this.$apis.custom.queryCrowdTree(params).then(res => {
this.clientManageFormList.find(item => item.name == 'groupId').optionList = [{ crowdName: '默认人群', crowdId: '0' }].concat(res.crowdUnitList)
})
}
},
async mounted() {
console.log(document.querySelector('.task-header').$el)
this.getStaffList()
this.queryCrowdTree()
}
}
</script>
<style lang="scss" scoped>
.ellipsis-1 {
max-width: 100%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.statusText {
> span:first-child {
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
&.circleStatusGreen {
background: #2cca74;
}
&.circleStatusGray {
background: #c6c6c6;
}
}
}
.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;
}
.scrm-sub-client-container {
.pageTitle {
margin-bottom: 20px;
position: relative;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.task-header {
padding-left: 24px;
background: #fff;
font-size: 16px;
color: #333333;
height: 54px;
line-height: 54px;
border-bottom: 1px solid #d8d8d8;
span {
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
.pageContent {
.leadList {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
div {
text-align: center;
span:nth-child(1) {
font-weight: 600;
font-size: 16px;
}
}
/deep/ .el-button {
color: #5850ff;
border: 1px solid #5850ff;
}
}
padding: 20px 20px 30px;
// min-width: 1300px;
background-color: #fff;
.el-button + .el-button {
margin-left: 10px;
}
.searchTop {
// margin-bottom: 20px;
}
.glsx-table {
// /deep/ .el-table__fixed {
// height: 100% !important; //设置高优先,以覆盖内联样式
// }
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
}
.entmicro {
display: flex;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
// }
}
.el-tag {
max-width: 100%;
cursor: pointer;
background-color: #fff !important;
}
}
}
</style>
<template>
<div class="activity-main">
<div class="activity-main-header">
活动管理
<label>系统将自动推送基于门店重点招揽人群的活动清单,门店可将客户批量分配给指定员工进行跟进。</label>
</div>
<div class="activity-tabel scrm-box-f">
<div class="activity-tabel-form">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable @setTableFinishFun="setTableFinishFun" :noDataImg="url" ref="taskForm" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDistribution(scope.scope)">任务分配</el-button>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/activity/empty.png'
import crowd from '@/mixins/crowd'
export default {
name: 'activity',
mixins: [crowd],
data() {
return {
url: url,
tableSearchForm: {
groupTypeId: '',
activityName: '',
createTime: ''
},
searchFormData: [
{
label: '人群类型',
name: 'groupTypeId',
type: 'select',
placeholder: '请选择',
optionId: 'crowdGroupId',
optionLabel: 'crowdGroupName',
optionList: []
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
placeholder: '输入关键字搜索'
},
{
label: '创建时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
}
],
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
},
createTime: '',
dialogVisible: true,
getListApi: this.$apis.activity.activityPageList,
tableParams: {
tableOption: false,
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'data',
tableColumns: [
{
label: '活动名称',
prop: 'activityName',
width: 300,
line: 1
},
{
label: '人群类型',
prop: 'groupTypeIdName',
width: 200,
line: 1
},
{
label: '客户总数',
prop: 'customerCount'
},
{
label: '已跟进',
prop: 'followCustomerCount'
},
{
label: '已到店',
prop: 'retCustomerCount'
},
{
label: '创建日期',
prop: 'createdTime',
width: '220px'
},
{
label: '操作',
prop: 'optionBtns',
width: '90px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
async mounted() {
this.searchFormData.find(item => (item.name = 'groupTypeId')).optionList = await this.queryCrowdGroupTree(1)
},
methods: {
handleSearch() {
this.$refs.taskForm.refreshTable()
},
handleReset() {
this.tableSearchForm = {}
this.$refs.taskForm.refreshTable()
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.startTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
} else {
delete this.tableSearchForm.startTime
delete this.tableSearchForm.endTime
}
delete this.tableSearchForm.createTime
resolve()
})
},
setTableFinishFun() {
this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun()
},
handleDistribution(scope) {
this.$router.push('/activity/distribution?id=' + scope.id)
}
}
}
</script>
<style lang="scss" scoped>
.activity-main-header {
font-size: 20px;
color: #333333;
line-height: 32px;
font-weight: 600;
label {
font-size: 14px;
color: #666666;
line-height: 32px;
font-weight: 400;
margin-left: 16px;
}
img {
width: 14px;
height: 14px;
margin-top: 8px;
}
}
.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;
}
}
}
}
.activity-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
img {
width: 14px;
height: 14px;
margin-top: 5px;
}
}
.activity-num-box {
height: 102px;
margin: 20px 0px;
background: #ffffff;
display: flex;
.activity-num-item {
width: 33.33%;
padding-left: 20px;
.activity-num-title {
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.activity-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;
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;
}
}
}
.activity-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;
}
.noDataImg {
width: 400px;
height: 160px;
}
}
}
</style>
<template>
<div class="activity-main">
<div class="activity-main-header">
<el-button data-title="新增营销" type="primary" size="small" @click="handleAdd()" fn="新增营销">
<i class="el-icon-plus"></i>
创建活动
</el-button>
<label>统一配制招揽活动,设置人群范围及人群对应企微营销的内容。</label>
</div>
<div class="activity-tabel scrm-box-f">
<div class="activity-tabel-form">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable @setTableFinishFun="setTableFinishFun" ref="taskForm" :noDataImg="url" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="status" slot-scope="scope" v-if="scope.scope.custTypeName != '默认客群'">
<el-switch v-model="scope.scope.status" :active-value="0" :inactive-value="-1" @change="changeSwitch(scope.scope)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }}
</div>
<div v-else>--</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleAdd(scope.scope)" :disabled="scope.scope.custTypeName == '默认客群'">编辑</el-button>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div>
</GLTable>
<div v-show="false">
<div class="nodata-panel">
尚未创建活动,
<a @click="handleAdd()">前往创建</a>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/activity/empty.png'
import crowd from '@/mixins/crowd'
export default {
name: 'activityConfig',
mixins: [crowd],
data() {
return {
url: url,
tableSearchForm: {
custGroupId: '',
configName: '',
createTime: ''
},
searchFormData: [
{
label: '人群类型',
name: 'custGroupId',
type: 'select',
placeholder: '请选择',
optionId: 'crowdGroupId',
optionLabel: 'crowdGroupName',
optionList: []
},
{
label: '活动名称',
name: 'configName',
type: 'input',
placeholder: '输入关键字搜索'
},
{
label: '创建时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
}
],
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
},
createTime: '',
dialogVisible: true,
getListApi: this.$apis.activity.activityPage,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '活动名称',
prop: 'configName',
width: 300,
line: 1
},
{
label: '人群类型',
prop: 'custTypeName',
width: 200,
line: 1
},
{
label: '推送日期',
prop: 'sendDate'
},
{
label: '创建人',
prop: 'createdByName'
},
{
label: '创建日期',
prop: 'createdTime',
width: '180px'
},
{
label: '状态',
prop: 'status',
addHtml: 'status',
width: '140px'
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
async mounted() {
this.searchFormData.find(item => (item.name = 'custGroupId')).optionList = await this.queryCrowdGroupTree(1)
},
methods: {
handleSearch() {
this.$refs.taskForm.refreshTable()
},
handleReset() {
this.tableSearchForm = {}
this.$refs.taskForm.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, '-')
} else {
delete this.tableSearchForm.beginTime
delete this.tableSearchForm.endTime
}
delete this.tableSearchForm.createTime
resolve()
})
},
handleAdd(scope) {
let editParams = scope ? '?$title=编辑活动&id=' + scope.id : ''
this.$router.push('/activity/addActivity' + editParams)
},
changeSwitch(scope) {
this.$apis.activity
.activityUpdate({
id: scope.id,
status: scope.status
})
.then(res => {
if (res) {
this.handleSearch()
}
})
},
setTableFinishFun() {
if (this.$refs.taskForm.data.length) {
this.$refs.taskForm.tableHeightValues = ''
} else {
const tableSearchArr = Object.values(this.tableSearchForm).find(item => item)
let cloneNode,
nodata = document.querySelector('.nodata-panel')
this.$nextTick(() => {
if (tableSearchArr) {
nodata.setAttribute('style', 'display:none')
cloneNode = '暂无数据'
document.querySelector('.noDataText').innerHTML = ''
document.querySelector('.noDataText').append(nodata)
} else {
nodata.setAttribute('style', 'display:block')
document.querySelector('.noDataText').innerHTML = ''
cloneNode = nodata
}
document.querySelector('.noDataText').append(cloneNode)
this.$refs.taskForm.setTableHeightFun()
})
}
}
}
}
</script>
<style lang="scss" scoped>
.activity-main-header {
font-size: 20px;
color: #333333;
line-height: 32px;
font-weight: 600;
label {
font-size: 14px;
color: #666666;
line-height: 32px;
font-weight: 400;
margin-left: 16px;
}
img {
width: 14px;
height: 14px;
margin-top: 8px;
}
}
.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;
}
}
}
}
.activity-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
img {
width: 14px;
height: 14px;
margin-top: 5px;
}
}
.activity-num-box {
height: 102px;
margin: 20px 0px;
background: #ffffff;
display: flex;
.activity-num-item {
width: 33.33%;
padding-left: 20px;
.activity-num-title {
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 22px;
}
.activity-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;
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;
}
}
}
.nodata-panel {
a {
cursor: pointer;
color: #5850ff;
}
}
.activity-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;
}
.noDataImg {
width: 400px;
height: 160px;
}
}
}
</style>
...@@ -807,6 +807,7 @@ export default { ...@@ -807,6 +807,7 @@ export default {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
console.log(params) console.log(params)
this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
...@@ -816,6 +817,9 @@ export default { ...@@ -816,6 +817,9 @@ export default {
this.cancelJump() this.cancelJump()
} }
}) })
.finally(() => {
this.loading = false
})
} }
}) })
}, },
......
...@@ -566,6 +566,7 @@ export default { ...@@ -566,6 +566,7 @@ export default {
} else { } else {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
...@@ -575,6 +576,9 @@ export default { ...@@ -575,6 +576,9 @@ export default {
this.cancelJump() this.cancelJump()
} }
}) })
.finally(() => {
this.loading = false
})
} }
}) })
}, },
......
...@@ -457,6 +457,7 @@ export default { ...@@ -457,6 +457,7 @@ export default {
} else { } else {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
...@@ -466,6 +467,9 @@ export default { ...@@ -466,6 +467,9 @@ export default {
this.cancelJump() this.cancelJump()
} }
}) })
.finally(() => {
this.loading = false
})
} }
}) })
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="topMsg"> <div class="topMsg">
<p class="pageTitle">基本信息</p> <p class="pageTitle">基本信息</p>
</div> </div>
<div class="live-room container" style="padding-top: 20px;"> <div class="live-room container" style="padding-top: 20px;" v-loading="sloading">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px" id="couponName"> <el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px" id="couponName">
<el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input> <el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
</div> </div>
<GLFooter> <GLFooter>
<el-button @click="goBack" size="medium">取消</el-button> <el-button @click="goBack" size="medium">取消</el-button>
<el-button type="primary" v-if="showSubmit" @click="submitForm('ruleForm')" size="medium" :loading="loading">提交</el-button> <el-button type="primary" v-if="showSubmit" @click="submitForm('ruleForm')" size="medium" :loading="sloading">提交</el-button>
</GLFooter> </GLFooter>
<!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" --> <!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" -->
<glsx-dialog title="" top="30vh" :hasScroll="false" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm"> <glsx-dialog title="" top="30vh" :hasScroll="false" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm">
...@@ -209,6 +209,7 @@ export default { ...@@ -209,6 +209,7 @@ export default {
}, 1000) }, 1000)
} }
return { return {
timer: Function,
isEdit: false, isEdit: false,
showSubmit: true, showSubmit: true,
disabledDescription: false, disabledDescription: false,
...@@ -402,6 +403,8 @@ export default { ...@@ -402,6 +403,8 @@ export default {
}, },
submitForm(formName) { submitForm(formName) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$refs[formName].validate((valid, errorObj) => { this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = [] var merchantErrorObj = []
...@@ -426,6 +429,7 @@ export default { ...@@ -426,6 +429,7 @@ export default {
return false return false
} }
}) })
},500)
}, },
//创建服务 //创建服务
createService() { createService() {
...@@ -494,20 +498,15 @@ export default { ...@@ -494,20 +498,15 @@ export default {
createService(params) createService(params)
.then(res => { .then(res => {
if (res.code == 0) { if (res.code == 0) {
this.sloading = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.$router.push('/couponManage/index') this.$router.push('/couponManage/index')
} else { } else {
this.sloading = false
this.$message({ this.$message({
type: 'error', type: 'error',
message: res.message message: res.message
}) })
} }
}) })
.catch(err => {
this.sloading = false
})
.finally(() => { .finally(() => {
this.sloading = false this.sloading = false
}) })
...@@ -526,20 +525,15 @@ export default { ...@@ -526,20 +525,15 @@ export default {
updateService(param) updateService(param)
.then(res => { .then(res => {
if (res.code == 0) { if (res.code == 0) {
this.sloading = false
this.$message.success('编辑服务成功') this.$message.success('编辑服务成功')
this.$router.push('/couponManage/index') this.$router.push('/couponManage/index')
} else { } else {
this.sloading = false
this.$message({ this.$message({
type: 'error', type: 'error',
message: res.message message: res.message
}) })
} }
}) })
.catch(err => {
this.sloading = false
})
.finally(() => { .finally(() => {
this.sloading = false this.sloading = false
}) })
......
...@@ -274,6 +274,16 @@ export default { ...@@ -274,6 +274,16 @@ export default {
merchantId: this.$globalState.session.merchantId merchantId: this.$globalState.session.merchantId
} }
} }
// {
// itemName: '众筹活动',
// itemValue: 7,
// itemType: 'crowdfunding',
// getInterfaceApi: this.$apis.welcomeword.crowdfundingActivity,
// params: {
// currentPage: 1,
// activityStatus: 2
// }
// }
] ]
}, },
{ {
...@@ -379,7 +389,7 @@ export default { ...@@ -379,7 +389,7 @@ export default {
previewForm(val) { previewForm(val) {
console.log(val) console.log(val)
const value = this.$common.utils.deepClone(val) const value = this.$common.utils.deepClone(val)
if (!value[0].attContent) value.splice(0, 1) if (value[0] && !value[0].attContent) value.splice(0, 1)
this.previewVal = value this.previewVal = value
}, },
handleCancel() { handleCancel() {
...@@ -477,11 +487,14 @@ export default { ...@@ -477,11 +487,14 @@ export default {
}) })
item.attContent = replaceImg.substring(0, 600) item.attContent = replaceImg.substring(0, 600)
} else if (item.attType == 7) { } else if (item.attType == 7) {
if (item.attContent.title) {
item.attType = 4
params.crowdFunding = true
}
item.attContent = JSON.stringify(item.attContent) item.attContent = JSON.stringify(item.attContent)
} }
return item return item
}) })
console.log(params)
params.attachmentList = attachmentList params.attachmentList = attachmentList
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
...@@ -502,7 +515,7 @@ export default { ...@@ -502,7 +515,7 @@ export default {
type: 'success', type: 'success',
message: '操作成功!' message: '操作成功!'
}) })
this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群发',params})) this.$tracker.track(Object.assign({}, { pageName: '群发助手', name: '新建客户群发', params }))
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
......
...@@ -121,7 +121,14 @@ ...@@ -121,7 +121,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="title">数据统计</div> <div class="data">
<div class="titles">数据统计</div>
<div style="cursor:pointer;" @click="refreshData">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="time">更新于 {{time}}</span>
</div>
<div class="statistics-info"> <div class="statistics-info">
<div class="statistics-ul"> <div class="statistics-ul">
<div class="statistics-li statistics-border"> <div class="statistics-li statistics-border">
...@@ -201,7 +208,9 @@ export default { ...@@ -201,7 +208,9 @@ export default {
condition: {} condition: {}
}, },
statistic: {}, statistic: {},
limitUserList: [] limitUserList: [],
time: '',
timeId: Function
} }
}, },
watch: { watch: {
...@@ -216,6 +225,7 @@ export default { ...@@ -216,6 +225,7 @@ export default {
mounted() { mounted() {
this.getCustomerDetail(this.id) this.getCustomerDetail(this.id)
this.getStatistic() this.getStatistic()
this.time = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
// console.log(this.basicInfo.condition, '----') // console.log(this.basicInfo.condition, '----')
}, },
computed: { computed: {
...@@ -242,6 +252,20 @@ export default { ...@@ -242,6 +252,20 @@ export default {
this.eventBus.$emit('update', previewList) this.eventBus.$emit('update', previewList)
}) })
}, },
refreshData() {
clearTimeout(this.timeId)
this.timeId = setTimeout(() => {
const { id } = this
this.$apis.customerTransform.renewStatistic({ id }).then(res => {
if (res.code == 0) {
this.getStatistic()
this.time = res.data.createdTime
this.$emit('handleSelect')
this.$emit('handleCustomSelect')
}
})
}, 1500)
},
getStatistic() { getStatistic() {
const { id, form } = this const { id, form } = this
if (form == 'customer') { if (form == 'customer') {
...@@ -418,4 +442,18 @@ export default { ...@@ -418,4 +442,18 @@ export default {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.titles {
font-size: 16px;
font-weight: 600;
color: #333;
margin-right: 10px;
}
.data {
padding: 20px 0 17px 20px;
border-bottom: 1px solid #d8d8d8;
display: flex;
align-items: center;
font-size: 14px;
color: #5850FF
}
</style> </style>
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div> <div class="preview-text text" v-html="item.attContent"></div>
</template> </template>
<template v-else-if="item.attType == 7"> <template v-else-if="item.attType == 7 || item.attType == 4">
<div class="preview-activity"> <div class="preview-activity">
<div class="activity-name">{{ item.attContent.marketingName }}</div> <div class="activity-name">{{ item.attContent.marketingName }}</div>
<img v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6" class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt /> <img v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6 && item.attContent.marketingType != 7" class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt />
<img v-if="item.attContent.marketingType == 5" class="activity-logo" src="@/assets/guestCustom/activity-spike.png" alt /> <img v-if="item.attContent.marketingType == 5" class="activity-logo" src="@/assets/guestCustom/activity-spike.png" alt />
<img v-if="item.attContent.marketingType == 6" class="activity-logo" src="@/assets/guestCustom/activity-service.png" alt /> <img v-if="item.attContent.marketingType == 6" class="activity-logo" src="@/assets/guestCustom/activity-service.png" alt />
<div class="activity-footer"> <img v-if="item.attContent.marketingType == 7" class="link-logo" src="@/assets/guestCustom/link.png" alt />
<div class="activity-footer" v-if="item.attContent.marketingType != 7">
<img src="@/assets/guestCustom/applet-footer.png" alt /> <img src="@/assets/guestCustom/applet-footer.png" alt />
</div> </div>
</div> </div>
...@@ -82,7 +83,7 @@ export default { ...@@ -82,7 +83,7 @@ export default {
}) })
item.attContent = htm item.attContent = htm
} else if (item.attType != 2 && item.attType != 3) { } else if (item.attType != 2 && item.attType != 3) {
console.log(item.attContent, JSON.parse(item.attContent).fileName) // console.log(item.attContent, JSON.parse(item.attContent).fileName)
item.attContent = JSON.parse(item.attContent) item.attContent = JSON.parse(item.attContent)
} }
}) })
...@@ -114,7 +115,7 @@ export default { ...@@ -114,7 +115,7 @@ export default {
} }
</script> </script>
<style lang="scss" scope> <style lang="scss" scoped>
.img-bg { .img-bg {
position: relative; position: relative;
width: 290px; width: 290px;
...@@ -248,4 +249,10 @@ export default { ...@@ -248,4 +249,10 @@ export default {
} }
} }
} }
.link-logo {
width: 30px;
height: 30px;
margin-left: 131px;
margin-bottom: 5px;
}
</style> </style>
...@@ -246,7 +246,7 @@ export default { ...@@ -246,7 +246,7 @@ export default {
} }
.member-left { .member-left {
width: 800px; width: calc(100% - 286px);
.member-content { .member-content {
border: 1px solid #eee; border: 1px solid #eee;
......
...@@ -249,7 +249,7 @@ export default { ...@@ -249,7 +249,7 @@ export default {
} }
} }
.member-left { .member-left {
width: 800px; width: calc(100% - 286px);
.member-content { .member-content {
border: 1px solid #eee; border: 1px solid #eee;
......
...@@ -16,6 +16,21 @@ ...@@ -16,6 +16,21 @@
<el-form-item label="姓名" style="margin-bottom: 0;"> <el-form-item label="姓名" style="margin-bottom: 0;">
<el-input :size="size" v-model.trim="searchForm.name" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input> <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 label="跟进专员类型">
<el-select
v-model="searchForm.status"
clearable
:size="size"
placeholder="全部"
>
<el-option
v-for="item in state"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</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>
</el-form-item>--> </el-form-item>-->
...@@ -58,6 +73,8 @@ export default { ...@@ -58,6 +73,8 @@ export default {
props: ['selectData'], props: ['selectData'],
data() { data() {
return { return {
state: [],
stateList: [],
url: url, url: url,
searchForm: {}, searchForm: {},
checked: '', checked: '',
...@@ -125,6 +142,18 @@ export default { ...@@ -125,6 +142,18 @@ export default {
onHidePopover() { onHidePopover() {
this.popoverVisible = false this.popoverVisible = false
}, },
unique(arr) {
let res = new Set()
return arr.filter((item) => {
let id = JSON.stringify(item)
if (res.has(id)) {
return false
} else {
res.add(id)
return true
}
})
},
listDepartmentTree(isFollowerStaff) { listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true } const params = { addChildrensFlag: true }
this.loading = true this.loading = true
...@@ -145,6 +174,10 @@ export default { ...@@ -145,6 +174,10 @@ export default {
}) })
this.selectData = [] this.selectData = []
} }
res[0].entmicroStaffResponses.forEach(e => {
this.state.push({value: e.followerTypeId, label: e.followerName})
})
this.state = this.unique(this.state)
} else { } else {
this.treeData = [] this.treeData = []
} }
...@@ -176,6 +209,7 @@ export default { ...@@ -176,6 +209,7 @@ export default {
this.tableEmpData = [] this.tableEmpData = []
const data = this.currentTreeData const data = this.currentTreeData
const keyword = this.searchForm.name const keyword = this.searchForm.name
const status = this.searchForm.status
let arr = [] let arr = []
// this.loading = true // this.loading = true
console.log(keyword, data, this.tableEmpData) console.log(keyword, data, this.tableEmpData)
...@@ -224,6 +258,17 @@ export default { ...@@ -224,6 +258,17 @@ export default {
}) })
} }
} }
this.stateList = this.tableEmpData
if (status) {
this.tableEmpData = []
this.stateList.forEach(i => {
if (String(i.followerTypeId).indexOf(status) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.stateList
}
}, },
remove(item) { remove(item) {
// var idx = this.innerTags.findIndex(k => k.id == item.id) // var idx = this.innerTags.findIndex(k => k.id == item.id)
...@@ -289,7 +334,7 @@ export default { ...@@ -289,7 +334,7 @@ export default {
} }
} }
.member-left { .member-left {
width: 800px; width: calc(100% - 286px);
.member-content { .member-content {
border: 1px solid #eee; border: 1px solid #eee;
......
<template> <template>
<div> <div>
<BasicInof :eventBus="eventBus" :id="$route.params.id" :form="'customer'"></BasicInof> <BasicInof :eventBus="eventBus" :id="$route.params.id" :form="'customer'" @handleSelect="handleSelect" @handleCustomSelect="handleCustomSelect"></BasicInof>
<div class="detail-container"> <div class="detail-container">
<div class="detail-modular"> <div class="detail-modular">
<div class="title">员工详情</div> <div class="title">员工详情</div>
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
>新建群发</el-button>--> >新建群发</el-button>-->
<GLButton type="primary" :size="size" icon="el-icon-plus" fn="新建客户群发" @click="btnClick('create', 1)">新建群发</GLButton> <GLButton type="primary" :size="size" icon="el-icon-plus" fn="新建客户群发" @click="btnClick('create', 1)">新建群发</GLButton>
<div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div> <div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div>
<div class="renew">
<div style="cursor:pointer;" @click="refreshData('1')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="time">更新于 {{time}}</span>
</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable :key="key" ref="customer" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf"> <GLTable :key="key" ref="customer" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
...@@ -46,6 +53,13 @@ ...@@ -46,6 +53,13 @@
>新建群发</el-button>--> >新建群发</el-button>-->
<GLButton type="primary" :size="size" fn="新建客户群群发" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</GLButton> <GLButton type="primary" :size="size" fn="新建客户群群发" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</GLButton>
<div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div> <div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div>
<div class="renews">
<div style="cursor:pointer;" @click="refreshData('2')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="times">更新于 {{times}}</span>
</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable :key="groupKey" ref="customerGroup" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf"> <GLTable :key="groupKey" ref="customerGroup" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
...@@ -82,6 +96,9 @@ export default { ...@@ -82,6 +96,9 @@ export default {
5: '链接' 5: '链接'
} }
return { return {
timeId: Function,
time:'',
times:'',
ATT_TYPE, ATT_TYPE,
activeIndex: 1, activeIndex: 1,
// 表格按钮 // 表格按钮
...@@ -309,16 +326,46 @@ export default { ...@@ -309,16 +326,46 @@ export default {
next(vm => { next(vm => {
const path = from.path const path = from.path
const pathArr = path.split('/') const pathArr = path.split('/')
if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') vm.activeIndex = 2 if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') {
vm.activeIndex = 2
}
if (vm.activeIndex == 1) {
vm.time = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
}
}) })
}, },
mounted() { mounted() {
// this.wxTips() // this.wxTips()
}, },
watch: {
activeIndex (newVal,oldVal) {
if (newVal == 2) {
this.times = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
} else if (newVal == 1) {
this.time = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
}
}
},
beforeDestroy() { beforeDestroy() {
this.$message.closeAll() this.$message.closeAll()
}, },
methods: { methods: {
refreshData(type) {
clearTimeout(this.timeId)
this.timeId = setTimeout(() => {
this.$apis.customerTransform.renewDetailList({}).then(res => {
if(res.code == '0'){
if(type == 1) {
this.time = res.data.createdTime
this.$refs.customer.refreshTable()
} else if(type == 2) {
this.times = res.data.createdTime
this.$refs.customerGroup.refreshTable()
}
}
})
}, 1500)
},
switchMenu(val) { switchMenu(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.activeIndex = val this.activeIndex = val
...@@ -448,6 +495,13 @@ export default { ...@@ -448,6 +495,13 @@ export default {
color: #999; color: #999;
margin-left: 20px; margin-left: 20px;
} }
.renew,.renews {
display: flex;
position: absolute;
right: 44px;
font-size: 14px;
color: #5850FF
}
} }
} }
} }
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :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="3"></el-tab-pane>
<el-tab-pane label="权益套餐" name="4"></el-tab-pane>
<el-tab-pane label="商城券" name="2"></el-tab-pane>
<el-tab-pane label="秒杀活动" name="5"></el-tab-pane>
<el-tab-pane label="无忧服务" name="6" v-if="openFlag"></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" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 6">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.packageName" v-show="activeName == 4">{{ item.packageName }}</div>
<div class="model-item-title" :title="item.activityName" v-show="activeName == 5">{{ item.activityName }}</div>
<div class="model-item-content" v-show="activeName == 3">领取方式:免费领用</div>
<div class="model-item-content" v-show="activeName == 4">领取方式:付费购买</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 6">有效期:{{ item.effectiveDays }}天</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 3">有效期:无限制</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 2">有效期:{{ item.effectiveStartTime ? item.effectiveStartTime.split(' ')[0] : '' }}~{{ item.effectiveEndTime ? item.effectiveEndTime.split(' ')[0] : '' }}</div>
<div class="model-item-content" v-show="activeName == 6">获取方式:需先购买无忧服务套餐</div>
<div class="model-item-content" v-show="activeName == 6">获取限制:每个服务套餐限领一次</div>
<div class="model-item-content" v-show="activeName == 3"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 3">
试用天数:
<span>{{ item.freeDay }}天</span>
</div>
<div class="model-item-content" v-show="activeName == 2">
使用途径:
{{ item.useChannel == 1 ? '线上商品' : '到店核销' }}
</div>
<div class="model-item-content model-item-weight" v-show="activeName == 6">
赠送天数:
<span>{{ item.effectiveType == 2 ? item.effectivedDay + '天' : '永久有效' }}</span>
</div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4">
销售价格:
<span>{{ item.packagePrice }}元</span>
</div>
<div class="model-item-content" v-if="activeName == 5">
开始时间:
{{ item.startTime }}
</div>
<div class="model-item-content" v-if="activeName == 5">
结束时间:
{{ item.endTime }}
</div>
<div class="model-item-content model-item-contents" v-show="activeName == 2">
数量:
<span>{{ item.residueAmount }}</span>
</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination v-if="activeName != 3" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :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" v-show="modelList.length">确 定</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 2 && memberMenu">立即添加</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 4 && couponMenu">立即添加</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 5 && activityMenu">立即添加</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'ActivityModel',
data() {
return {
dialogVisible: false,
couponMenu: false,
loading: false,
activeName: '3',
modelList: [],
pageNum: 1,
pageSize: 12,
tableTotal: 0,
openFlag: 0,
selectItem: {
id: ''
}
}
},
methods: {
handleSelectItem(item) {
this.selectItem = item
if (item.equityClassId) {
this.selectItem.id = item.equityClassId
}
console.log(this.selectItem)
},
handleSelect() {
if (!this.selectItem.id) {
this.$message({
type: 'error',
message: '请选择活动'
})
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
handleOpen() {
let url
switch (this.activeName) {
case '2':
url = '/marketing/couponManage/index'
break
case '4':
url = '/marketing/memberCenter/setmealAddUpdate?%24title=%25E5%2588%259B%25E5%25BB%25BA%25E5%25A5%2597%25E9%25A4%2590'
break
case '5':
url = '/marketing/seckillActivity/editActivity/1'
break
}
util.openUrl(location.origin + url)
this.dialogVisible = false
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '6':
market = 'merchant'
break
case '2':
market = 'getMerchant'
break
case '3':
market = 'getCard'
break
case '4':
market = 'getPackage'
break
case '5':
market = 'getActivity'
break
}
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
if (this.activeName == 3) {
params.tryAble = 1
params.merchantId = this.$globalState.session.merchantId
}
if (this.activeName == 2) {
params.discountTypes = [2, 3, 4]
params.validType = 'valid'
}
if (this.activeName == 5) {
params.currentPage = this.pageNum
params.activityStatus = 2
}
if (this.activeName == 6) {
params.merchantId = this.$globalState.session.merchantId
}
this.$apis.customerTransform[market](params)
.then(res => {
if (this.activeName == 3 || this.activeName == 6) {
this.modelList = res
} else {
this.modelList = res.list ? res.list : res.data
this.tableTotal = res.total
}
this.loading = false
})
.catch(() => {
this.loading = false
})
},
merchantOpen() {
let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag
})
},
init() {
this.merchantOpen()
this.couponMenu = false
this.activityMenu = false
this.memberMenu = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (item.name == 'marketing') {
if (!item.children) {
return
}
item.children.forEach(itm => {
console.log(itm.path)
if (itm.path == '/couponManage/index') {
this.couponMenu = true
}
if (itm.path == '/seckillActivity/index') {
this.activityMenu = true
}
if (itm.path == '^') {
this.memberMenu = true
}
})
}
})
this.dialogVisible = true
this.getModelList()
this.selectItem = {}
},
handleClick() {
this.getModelList()
}
}
}
</script>
<style lang="scss" scoped>
.square-main {
/deep/ {
.el-dialog__footer {
text-align: center;
}
}
}
.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;
font-weight: 600;
}
}
}
.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;
max-height: 38vh;
overflow: auto;
display: flex;
flex-wrap: wrap;
align-items: stretch;
flex-direction: row;
.model-item {
width: 240px;
margin-right: 24px;
margin-bottom: 24px;
padding: 12px 16px;
position: relative;
height: 128px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e6e6e6;
padding: 14px 24px;
box-sizing: border-box;
&:nth-child(4n) {
margin-right: 0px;
}
&.checked {
background: rgba(88, 80, 255, 0.1);
border: 1px 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: 16px;
height: 16px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.model-item-weight {
line-height: 20px;
height: 20px;
}
span {
color: #5850ff;
font-size: 20px;
}
}
&-contents {
line-height: 22px;
height: 22px;
}
}
}
}
</style>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</div> </div>
</div> </div>
</div> </div>
<Preview :eventBus="eventBus" :list.sync="basicInfo.attachmentList"></Preview> <Preview :previewView="previewView" :list.sync="basicInfo.attachmentList"></Preview>
</div> </div>
</div> </div>
</template> </template>
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
}, },
data() { data() {
return { return {
previewView: '',
updatedTime: '', updatedTime: '',
refreshStatus: false, refreshStatus: false,
STATUS_TYPE: STATUS, STATUS_TYPE: STATUS,
...@@ -133,12 +134,19 @@ export default { ...@@ -133,12 +134,19 @@ export default {
}, },
methods: { methods: {
handleRefresh: utils.debounce(function() { handleRefresh: utils.debounce(function() {
this.getCustomerDetail() this.publicStatus()
this.refreshStatus = true this.refreshStatus = true
setTimeout(() => { setTimeout(() => {
this.refreshStatus = false this.refreshStatus = false
}, 1000) }, 1000)
}, 1000), }, 1000),
publicStatus() {
const id = this.$route.query.id
this.$apis.friendGroup.publicStatus({ id }).then(res => {
this.getCustomerDetail()
this.$emit('refreshList')
})
},
getCustomerDetail() { getCustomerDetail() {
const id = this.$route.query.id const id = this.$route.query.id
this.$apis.friendGroup.momentDetail({ id }).then(res => { this.$apis.friendGroup.momentDetail({ id }).then(res => {
...@@ -153,33 +161,34 @@ export default { ...@@ -153,33 +161,34 @@ export default {
// } // }
return item return item
}) })
this.previewView = previewList
//图片合并 //图片合并
let previewListFilter = previewList.map(item => { // let previewListFilter = previewList.map(item => {
return { // return {
attContent: [item.attContent], // attContent: [item.attContent],
attType: item.attType // attType: item.attType
} // }
}) // })
previewListFilter = previewListFilter.reduce((prev, cur) => { // previewListFilter = previewListFilter.reduce((prev, cur) => {
let index = prev.findIndex(item => item.attType == 2) // let index = prev.findIndex(item => item.attType == 2)
if (index != -1 && prev.length) { // if (index != -1 && prev.length) {
const prevArr = prev.map(tag => { // const prevArr = prev.map(tag => {
let attContent // let attContent
if (tag.attType == 2) { // if (tag.attType == 2) {
attContent = tag.attContent.concat(cur.attContent) // attContent = tag.attContent.concat(cur.attContent)
} else { // } else {
attContent = tag.attContent // attContent = tag.attContent
} // }
return { // return {
attType: tag.attType, // attType: tag.attType,
attContent // attContent
} // }
}) // })
return prevArr // return prevArr
} // }
return prev.concat(cur) // return prev.concat(cur)
}, []) // }, [])
this.eventBus.$emit('update', previewListFilter) // this.eventBus.$emit('update', previewListFilter)
}) })
}, },
getStatistic() { getStatistic() {
......
<!-- 查看产品 - 评价信息 -->
<template>
<div class="comment-detail container edit-container">
<div style="padding: 20px">
<!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="starLevel" slot-scope="scope">
<img v-for="(item, index) in scope.scope.starLevel" :key="index" class="icon-star" src="@/assets/icon-star.png" />
</div>
<div slot="goodsImage" class="table-image" slot-scope="scope">
<span v-if="!scope.scope.imgUrls">-</span>
<img v-else class="img-60" :src="scope.scope.imgUrls[0]" @click="handleImgLook(scope.scope.imgUrls)" />
</div>
</GLTable>
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible" :close-on-click-modal="false">
<div class="dialog-look">
<span v-for="(item, index) in dialogObj.imgUrls" :key="index">
<el-image style="width: 200px; height: 200px; margin-right: 10px" :src="item" :preview-src-list="[item]"></el-image>
</span>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'commentDetail',
data() {
return {
size: 'small',
url: url,
searchForm: {
goodsId: ''
},
isImgVisible: false,
// imgUrls: [],,
dialogObj: {
imgUrls: [],
uploadType: 'img'
},
// 表格
getListApi: this.$apis.proManage.getGoodsCommentListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '评价用户名称',
prop: 'customerName'
},
{
label: '评价时间',
prop: 'createdDateStr'
},
{
label: '评价星级',
prop: 'starLevel',
addHtml: 'starLevel'
},
{
label: '评价内容',
prop: 'commentContent',
line: 3
},
{
label: '图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
props: {
goodsId: {
type: Object,
default: () => {}
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.goodsId = this.goodsId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
},
handleImgLook(imgUrls) {
this.isImgVisible = !this.isImgVisible
this.dialogObj = {
imgUrls: imgUrls,
uploadType: 'img'
}
}
}
}
</script>
<style></style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
<template>
<div class="square-main">
<el-dialog title="选择模板" :visible.sync="dialogVisible" width="1142px" :before-close="handleClose" :close-on-click-modal="false">
<div class="model-panel">
<el-form :inline="true" class="message-form" :model="searchForm" ref="searchForm">
<el-form-item label="模板标题">
<el-input v-model="searchForm.title" :size="size" placeholder="请输入模板名称搜索"></el-input>
</el-form-item>
<el-form-item label="创建者">
<el-select v-model="searchForm.createdBy" :size="size" placeholder="全部">
<el-option v-for="item in createdList" :key="item.id" :label="item.createdName" :value="item.createdBy"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
<el-form-item style="float: right;margin-right: 0;">
<el-button :size="size" icon="el-icon-plus" @click="createModel">新增模板</el-button>
</el-form-item>
</el-form>
<!-- <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-tab-pane label="售后" name="3"></el-tab-pane>
</el-tabs>
</div>-->
<div class="model-item-panel" v-if="!loading && modelList.length > 0" v-loading="loading">
<div class="model-item" v-for="item in modelList" :key="item.id">
<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">创建人:{{ item.createdName }}</div>
<div class="model-content">创建日期:{{ item.createdTime }}</div>
</div>
<div class="model-item-btn">
<el-button v-if="item.createdBy == userId" type="text" :size="size" @click="editModel(item.id)">编辑</el-button>
</div>
</div>
</div>
<div class="model-item-panel" v-else>
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="tableTotal" :layout="layout"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="selectModelItem">复制文本</el-button>
</span>
</el-dialog>
<el-dialog :title="modelTitle" :visible.sync="createVisible" width="547px" :before-close="handleCreateClose" :close-on-click-modal="false">
<el-form :model="templateForm" :rules="templateRules" ref="templateForm" label-width="100px" class="templateForm">
<el-form-item label="标题" prop="title">
<el-input v-model="templateForm.title" maxlength="10" show-word-limit placeholder="输入10个字以内的标题,如活动促销"></el-input>
</el-form-item>
<el-form-item label="内容说明" prop="content">
<el-input type="textarea" v-model="templateForm.content" maxlength="600" :rows="7" show-word-limit placeholder="输入不超过600字内的文字说明"></el-input>
</el-form-item>
</el-form>
<div class="template-footer">
<el-button size="small" @click="createModel">取 消</el-button>
<el-button size="small" type="primary" :loading="createLoading" @click="handleCreate">立即创建</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'MessageModel',
data() {
return {
dialogVisible: false,
createVisible: false,
loading: false,
activeName: '1',
messageRadio: {},
modelList: [
// {
// title: '121',
// content: 'jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开',
// createdTime: '2022-01-04'
// }
],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
layout: '',
searchForm: {},
templateForm: {},
templateRules: {
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
content: [{ required: true, message: '请输入标题', trigger: 'blur' }]
},
createLoading: false,
createdList: [],
modelTitle: '创建群发模板',
userId: ''
}
},
mounted() {
console.log(this.$globalState, '222323')
if (this.$globalState) {
this.userId = this.$globalState.session.id
}
},
methods: {
init() {
this.pageNum = 1
this.messageRadio = {}
this.dialogVisible = true
this.dracImMessage()
this.getCreatedList()
},
selectModelItem() {
this.dialogVisible = false
this.$emit('selectItem', this.messageRadio)
},
handleClick() {
this.dracImMessage()
},
search() {
this.dracImMessage(this.searchForm)
},
handleClose() {
this.dialogVisible = false
this.modelList = []
this.tableTotal = 0
},
dracImMessage(searcher) {
this.modelList = []
this.loading = true
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
if (searcher) {
params.title = searcher.title
params.createdBy = searcher.createdBy
}
this.$apis.customerTransform.templatePage(params).then(res => {
console.log(res)
if (res) {
this.modelList = res.data
this.tableTotal = res.count
if (res.count > 10) {
this.layout = 'pager'
}
}
this.loading = false
})
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
},
handleCurrentChange(val) {
this.pageNum = val
this.dracImMessage()
console.log(`当前页: ${val}`)
},
createModel() {
this.createVisible = !this.createVisible
if (!this.createVisible) {
this.templateForm = {}
}
},
handleCreate() {
this.$refs.templateForm.validate(valid => {
if (valid) {
console.log(this.templateForm)
this.createLoading = true
const params = {
title: this.templateForm.title,
content: this.templateForm.content
}
let api = 'templateSave'
if (this.templateForm.id) {
api = 'templateUpdate'
params.id = this.templateForm.id
}
console.log(params)
this.$apis.customerTransform[api](params).then(res => {
console.log(res)
this.createLoading = false
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.pageNum = 1
this.createModel()
this.dracImMessage()
}
})
}
})
},
editModel(id) {
this.createModel()
this.modelTitle = '编辑群发模板'
this.getTemplateDetail(id)
},
getCreatedList() {
this.$apis.customerTransform.createdNameList({}).then(res => {
this.createdList = res
})
},
getTemplateDetail(id) {
this.$apis.customerTransform.templateDetail({ id }).then(res => {
console.log(res)
if (res) {
this.templateForm = res
}
})
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
padding: 0 20px;
.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-panel {
max-height: 400px;
overflow: auto;
> 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;
&:last-child {
border-bottom: none;
}
&-radio {
width: 60px;
/deep/ {
.el-radio__input {
margin-top: 10px;
}
.el-radio__label {
display: none;
}
}
}
&-content {
min-width: 210px;
margin-right: 50px;
.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;
max-width: 658px;
color: #333333;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.model-title-h2 {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
max-width: 658px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
&-btn {
width: 30px;
height: 40px;
}
}
}
}
.message-form .el-form-item {
margin-bottom: 0 !important;
}
/deep/ .el-pager {
height: 30px;
}
.el-pagination {
margin-top: 21px;
}
.templateForm {
padding: 0 20px;
/deep/ {
.el-textarea__inner {
background-color: #fff;
}
.el-textarea .el-input__count {
background-color: #fff;
}
}
}
.template-footer {
text-align: center;
border-top: 1px solid #e6e6e6;
padding-top: 16px;
margin-bottom: -14px;
}
/deep/ {
.el-dialog__body {
padding: 30px 0;
}
}
</style>
<template> <template>
<div class="img-bg"> <div class="img-bg">
<div class="preview-content"> <div class="preview-content">
<div class="preview-info" v-show="previewList.length"> <div class="preview-info" v-show="previewListFilter.length">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt /> <img class="avatar" src="@/assets/guestCustom/default-customer.png" alt />
<div class="preview-box" v-for="item in previewList" :key="item.id"> <div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc"> <div class="preview-box-desc">
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent[0]"></div> <div class="preview-text text" v-html="item.attContent"></div>
</template> </template>
<template v-else-if="item.attType == 7"> <template v-else-if="item.attType == 7">
<div class="preview-text preview-link"> <div class="preview-text preview-link">
...@@ -14,20 +14,20 @@ ...@@ -14,20 +14,20 @@
<div>{{ item.attContent[0].marketingName }}</div> <div>{{ item.attContent[0].marketingName }}</div>
</div> </div>
</template> </template>
<template v-else-if="item.attType == 2 && !previewList.map(k => k.attType).includes(3)" v-for="(imgItem, index) in item.attContent"> <template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image> <el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> --> <!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<div class="video-panel"> <div class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted> <video id="video" width="100%" height="100%" preload loop muted>
<source :src="item.attContent[0]" type="video/mp4" /> <source :src="item.attContent" type="video/mp4" />
</video> </video>
<i <i
class="el-icon-video-play" class="el-icon-video-play"
@click=" @click="
videoShow = true videoShow = true
videoUrl = item.attContent[0] videoUrl = item.attContent
" "
></i> ></i>
</div> </div>
...@@ -60,7 +60,7 @@ const ATT_TYPE = { ...@@ -60,7 +60,7 @@ const ATT_TYPE = {
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
export default { export default {
name: 'Preview', name: 'Preview',
props: { eventBus: Object }, props: { previewView: Array },
data() { data() {
return { return {
videoShow: false, videoShow: false,
...@@ -70,48 +70,53 @@ export default { ...@@ -70,48 +70,53 @@ export default {
} }
}, },
watch: { watch: {
previewList(val) { previewView: {
console.log(val) handler(val) {
if (val.length && val[0].attType == 1) { const previewVal = this.$common.utils.deepClone(val).filter(item => item)
const attContent = val[0].attContent[0] console.log(previewVal)
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { this.previewListFilter = []
let word = res.replace(/\[|\]/gi, '') for (let i in previewVal) {
const list = emoji.flat(Infinity) if (previewVal[i].attType == 1) {
let index = parseInt(list.indexOf(word)) + 1 const attContent = previewVal[i].attContent
if (index < 10) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
index = '00' + index let word = res.replace(/\[|\]/gi, '')
} else if (index >= 10 && index < 100) { const list = emoji.flat(Infinity)
index = '0' + index let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
this.previewListFilter.push({
attType: 1,
attContent: htm
})
} else if (previewVal[i].attType == 2) {
const pindex = this.previewListFilter.findIndex(item => item.attType == 2)
if (pindex == -1) {
this.previewListFilter.push({
attType: 2,
attContent: [previewVal[i].attContent]
})
} else {
this.previewListFilter[pindex].attContent.push(previewVal[i].attContent)
}
} else {
this.previewListFilter.push({
attType: previewVal[i].attType,
attContent: previewVal[i].attContent
})
} }
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">` }
this.$nextTick(() => {
this.previewListFilter = this.previewListFilter.filter(item => item)
}) })
val[0].attContent[0] = htm },
} deep: true
//图片合并
// const previewListFilter = val.map(item=>{
// return {
// attContent: [item.attContent],
// attType: item.attType
// }
// })
// this.previewListFilter = previewListFilter.reduce((prev, cur) => {
// let index = prev.find(item=>item.attType == ATT_TYPE.IMAGE)
// if(index != -1 && prev.length) {
// return prev[index].attContent.concat(cur.attContent)
// }
// return prev.concat(cur)
// },[])
// console.log(this.previewListFilter)
} }
}, }
created() {
this.eventBus.$on('update', val => {
setTimeout(() => {
this.previewList = val
}, 100)
})
},
mounted() {}
} }
</script> </script>
......
<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" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="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-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
<!-- <el-radio :label="itm">{{ itm.name.length > 4 ? itm.name.slice(0, 3) + '...' : itm.name }}</el-radio> -->
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-radio-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets">
<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 {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
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: {
labelTreeRets: {
handler() {
this.selectNum = 0
this.labelTreeRets.forEach(item => {
if (item.tagChecked) {
this.selectNum++
}
})
},
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) {
console.log(selectItem, '-----')
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
// shopId: '44210934',
labelGroupName: this.labelGroupName,
// labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
// edition: 4
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
console.log(res.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
//回显
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]
}
})
})
console.log(this.labelTreeRets)
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
}
})
},
remove(item, idx) {
item.tagChecked = null
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', 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;
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: 26px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-radio {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner {
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
}
}
}
.checkbox-group-box {
overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
}
.tag-selected-box {
min-height: 200px;
}
</style>
<!-- 树形搜索 -->
<template>
<div>
<el-popover ref="popover" placement="bottom-start" trigger="click" v-model="popoverVisible" :disabled="targetItem.isDisabled" @show="onShowPopover" @hide="onHidePopover">
<el-tree ref="tree" class="select-tree" highlight-current default-expand-all node-key="id" :expand-on-click-node="isExpand" :style="`min-width: ${treeWidth}`" :data="treeData" :current-node-key="form[targetItem.name]" :props="defaultProps" :filter-node-method="handleFilterNode" @current-change="handleNodeClick"></el-tree>
<el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" clearable :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @change="handleClear"></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto'
}
},
props: {
// 输入框宽度
width: String,
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
},
defaultProps: {
type: Object,
default: () => ({
parent: 'parentId',
value: 'id',
label: 'menuName',
children: 'childlist'
})
}
},
watch: {
form(val) {
if (this.form[this.targetItem.name]) {
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
}
},
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
if (this.form[this.targetItem.name]) {
// console.log(this.treeData)
// console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
},
methods: {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
if (!query) return true
return data[this.defaultProps.label].indexOf(query) !== -1
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = []
stark = stark.concat(tree)
while (stark.length) {
const temp = stark.shift()
if (temp[this.defaultProps.children]) {
stark = stark.concat(temp[this.defaultProps.children])
}
if (temp[this.defaultProps.value] === id) {
return temp[this.defaultProps.label]
}
}
return
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
</style>
<!-- 分享弹窗 -->
<template>
<glsx-dialog title="分享" width="806px" :noCancel="true" btnOkLabel="关闭" :isVisible="isShareVisible" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.posterUrl)">保存图片</el-button>
</div>
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.qrCodeUrl)">保存图片</el-button>
</div>
<img style="width: 180px; height: 180px" :src="shareForm.qrCodeUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{ shareForm.linkUrl }}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.linkUrl)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
</glsx-dialog>
</template>
<script>
export default {
name: 'share',
data() {
return {}
},
props: {
isShareVisible: {
type: Boolean,
default: false
},
shareForm: {
type: Object,
default: () => {}
}
},
mounted() {},
methods: {
handleSaveImg(url) {
var alink = document.createElement('a')
alink.href = url
alink.setAttribute('target', '_blank')
alink.download = '海报'
alink.click()
alink.remove()
},
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
handleShareClose() {
this.$emit('handleShareClose')
}
}
}
</script>
<style scoped>
.share-dialog .box {
background: #f7f7f7;
border-radius: 6px;
padding: 30px;
}
.share-dialog .poster img {
width: 180px;
height: 297px;
margin-left: 45px;
}
.share-dialog .page-route {
margin-top: 16px;
}
.share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style>
<template>
<div class="w-textarea" ref="wTextarea">
<div contenteditable="true" class="w-textarea_input" ref="wTextareaContent" :id="contentId" @click="inputClick($event)" @focus="onFocus" @blur="onBlur" @keydown.delete="handleDelete($event)" @input="handleInput($event.target)"></div>
<!-- <div class="w-textarea_tools" v-if="tools.length > 0 || maxlength">
<button
class="w-textarea_tools__item"
v-for="item in tools"
:key="item.type"
@click="openTagDialog(item.type)"
>{{item.text}}</button>
<span
:class="['w-textarea_tools__text',
count.num < 0 ? '__danger' : '']"
v-if="maxlength"
>{{count.text}}</span>
</div>-->
<!-- <div class="w-textarea_dialog">
<slot></slot>
</div>-->
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'wTextarea',
data() {
return {
// 记录currentText以计算长度
currentText: this.value,
// 为input区域生成随机id,当在页面上有多个组件时,用于监听光标的变化
contentId: `content${this.getGuid()}`,
// 输入的时候锁定,禁止更新innerHTML
isLocked: false,
isInsert: false,
// 记录当前选中tag的ID
currentTagId: null,
// 当前光标位置
savedRange: {}
}
},
props: {
value: {
type: String,
default: ''
},
tag: {
// 自定义模版标签的标签名
type: String,
// 默认使用wise作为标签名,并添加了默认样式
// 当使用其他标签名的时候,需要另写标签样式
default: 'wise'
},
tools: {
// 自定义扩展功能:超链接'link',模版标签'tag'
type: Array,
default() {
return [
{ type: 'link', text: '添加超链接' },
{ type: 'tag', text: '添加模版标签' }
]
}
},
maxlength: {
// 最大输入长度
type: [String, Number],
default: ''
}
},
computed: {
count() {
// 字符长度记数
let num = this.maxlength - this.currentText.length
let text = num < 0 ? `已超出${Math.abs(num)}个字符` : `还可以输入${num}个字符`
return { num, text }
}
},
mounted() {
// 初始化数据
this.currentText && (this.$refs.wTextareaContent.innerHTML = this.currentText)
// 创建模版标签的style
this.createStyle()
// 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler)
},
beforeDestroy() {
// 卸载事件
document.removeEventListener('selectionchange', this.selectHandler)
},
methods: {
updateData(text) {
this.$emit('input', text)
},
createStyle() {
// 为自定义的模版标签添加样式,使之不可编辑
let style = document.createElement('style')
style.innerHTML = `.w-textarea ${this.tag} {
cursor: default;
-webkit-user-modify: read-only !important;
}`
this.$refs.wTextarea.appendChild(style)
},
closeModal() {
this.form.text = ''
this.showModal = false
},
openTagDialog(type) {
// if (addLink)
// 将事件抛给父组件处理
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type)
},
addTag(text) {
// 创建模版标签
let node = document.createElement(this.tag)
if (navigator.userAgent.indexOf('Firefox') > 0) {
node.setAttribute('contenteditable', 'false')
}
node.innerText = text
// 添加id便于删除
node.id = this.getGuid()
this.insertNode(node)
},
addNode() {
let target = this.$refs.wTextareaContent
this.updateData(target.innerHTML)
},
promiseAdd(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
promiseAddNode(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
addContent(attContent) {
attContent.forEach(async (item, index) => {
await this.promiseAdd(item, index)
this.addTag('@昵称')
// await this.promiseAddNode(item, index)
// this.addNode()
// t2(item)
})
// for (let i = 0; i < attContent.length; i++) {
// if (attContent[i] || (i == 0 && !attContent[i])) {
// document.querySelector('.w-textarea_input').innerHTML += attContent[i]
// document.querySelector('.w-textarea_input').focus()
// document.querySelector('.w-textarea_input').click()
// this.$nextTick(()=>{
// this.addTag('@昵称')
// })
// }
// // 代码格式
// // (function(a) {})(b)
// }
},
addLink(text, url) {
// 创建a标签
let node = document.createElement('a')
node.innerText = text
node.href = url
node.target = 'blank'
this.insertNode(node)
},
addImg(url) {
// 创建a标签
let node = document.createElement('img')
node.src = url
// node.setAttribute('ondragstart', 'return false;')
this.insertNode(node)
},
onFocus() {
this.isLocked = true
this.isInsert = true
},
onBlur() {
this.isLocked = false
},
insertNode(node) {
// 在内容中插入标签
// 删掉选中的内容(如有)
if (this.savedRange.startContainer) {
this.insertNodeFirst(node)
} else {
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
this.insertNodeFirst(node)
document.querySelector('.w-textarea_input').blur()
}, 100)
}
},
insertNodeFirst(node) {
this.savedRange.deleteContents()
// 插入链接
if (this.isInsert) {
this.savedRange.insertNode(node)
} else {
document.querySelector('.w-textarea_input').appendChild(node)
}
this.isInsert = false
// 更新双向绑定数据
let target = this.$refs.wTextareaContent
if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) {
this.updateData(target.innerHTML + '&nbsp;')
} else {
this.updateData(target.innerHTML)
}
let htm = target.innerHTML
const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
console.log(replaceImg)
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText)
},
placeCaretAtEnd(el) {
//传入光标要去的jq节点对象
el.focus()
if (typeof window.getSelection != 'undefined' && typeof document.createRange != 'undefined') {
var range = document.createRange()
range.selectNodeContents(el)
range.collapse(false)
var sel = window.getSelection()
sel.removeAllRanges()
sel.addRange(range)
} else if (typeof document.body.createTextRange != 'undefined') {
var textRange = document.body.createTextRange()
textRange.moveToElementText(el)
textRange.collapse(false)
textRange.select()
}
},
handleInput(target) {
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
console.log(htm)
const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText)
},
handleDelete(e) {
// 监听“删除”事件
if (this.currentTagId) {
// 若已选中模版标签,直接删除dom节点
let t = document.getElementById(this.currentTagId)
this.$refs.wTextareaContent.removeChild(t)
this.currentTagId = null
// 阻止浏览器默认的删除事件,并手动更新数据
e.preventDefault()
this.handleInput(e.target)
}
},
inputClick(e) {
// 监听点击事件
this.isLocked = true
const TAG_NAME = e.target.nodeName
if (TAG_NAME === this.tag.toUpperCase()) {
// 点击模版标签时,记录id
this.currentTagId = e.target.id
e.target.className = 'active'
} else if (this.currentTagId) {
// 清空active样式
let target = document.getElementById(this.currentTagId)
target.className = ''
this.currentTagId = null
} else {
this.currentTagId = null
}
},
getGuid() {
// 生成随机ID
return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
},
selectHandler() {
// 监听选定文本的变动
let sel = window.getSelection()
let range = sel.rangeCount > 0 ? sel.getRangeAt(0) : null
if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) {
this.savedRange = range
}
}
},
watch: {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (!this.isLocked) {
this.$refs.wTextareaContent.innerHTML = val
}
}
}
}
</script>
<style lang="scss">
// 给标签默认样式,不可scoped
.w-textarea {
wise {
border-radius: 2px;
background-color: #fff;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 2px;
margin: 0 5px;
color: #26a2ff;
// padding: 0 1px;
white-space: nowrap;
cursor: default;
-webkit-user-modify: read-only !important;
}
img {
width: 24px;
height: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
vertical-align: middle;
}
.active {
background: #dcdfe6;
}
}
</style>
<style lang="scss" scoped>
$borderColor: #dcdfe6;
$bgColor: #f5f7fa;
$textColor: #666;
.w-textarea {
width: 100%;
box-sizing: border-box;
// border-radius: 4px;
border: 1px solid $borderColor;
overflow: hidden;
min-height: 200px;
// margin-bottom: 15px;
overflow: hidden;
position: relative;
&_input {
width: 100%;
height: 200px;
min-height: 100px;
box-sizing: border-box;
padding: 10px;
line-height: 1.5;
word-break: break-word;
// 允许编辑,禁止富文本
-webkit-user-modify: read-write-plaintext-only !important;
&:focus {
outline: none;
}
}
&_tools {
padding: 0 10px;
height: 40px;
line-height: 40px;
border-top: 1px solid $borderColor;
background-color: $bgColor;
color: $textColor;
font-size: 12px;
&__item {
display: inline-block;
line-height: 1;
padding: 5px 8px;
margin-right: 8px;
color: $textColor;
cursor: pointer;
border: 1px solid $borderColor;
border-radius: 4px;
background: #fff;
transition: all 0.3s;
&:hover {
background: $bgColor;
opacity: 0.7;
}
&:focus {
outline: none;
}
}
&__text {
display: inline-block;
line-height: 40px;
padding: 0 8px;
float: right;
color: $textColor;
cursor: default;
transition: all 0.3s;
&:hover {
opacity: 1;
}
&.__danger {
color: red;
}
}
}
}
</style>
<template>
<div class="welcome-box">
<!-- <div class="required">入群欢迎语</div> -->
<div class="content">
<div class="content-bg" v-loading="loading">
<!-- <div id="nick" contenteditable="false" class="nickname">
@昵称
<i class="el-icon-error"></i>
</div>-->
<!-- <div id="toolbar-container" style="display: none;"></div>
<div id="text-container" class="editor-container"></div>-->
<wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea>
<!-- <el-input
type="textarea"
:rows="9"
maxlength="600"
show-word-limit
v-model="guestForm.name"
@input="textInput"
style="-webkit-user-modify: read-write-plaintext-only !important;"
placeholder="请输入内容"
></el-input>-->
<div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1 && itm.attType != 2">
<template v-if="itm.attType == 3">
<img src="@/assets/guestCustom/icon-video.png" alt />
<span class="welcome-file-desc" :title="itm.attContent[0]">{{ itm.attContent[0] }}</span>
</template>
<template v-else-if="itm.attType == 7">
<img src="@/assets/guestCustom/icon-applet.png" alt />
<span :title="itm.attContent[0].marketingName">{{ itm.attContent[0].marketingName }}</span>
</template>
<template v-else-if="itm.attType == 5">
<img src="@/assets/guestCustom/icon-applet.png" alt />
<span class="welcome-file-desc" :title="itm.attContent.title">{{ itm.attContent.title }}</span>
</template>
<i class="el-icon-circle-close" @click="close(index)" v-if="itm.attType != 2"></i>
</div>
<div class="welcome-file welcome-file-img" v-if="itm.attType == 2">
<vuedraggable v-model="itm.attContent" animation="300" @end="onEnd">
<transition-group>
<div v-for="(imgItem, idx) in itm.attContent" :key="imgItem" class="welcome-file-item">
<img src="@/assets/guestCustom/icon-img.png" alt />
<span class="welcome-file-img" :title="imgItem">{{ imgItem }}</span>
<i class="el-icon-circle-close" @click="closeImg(itm, idx, index)"></i>
</div>
</transition-group>
</vuedraggable>
</div>
</div>
<div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id">
<!-- <i class="el-icon-circle-plus-outline"></i> -->
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" alt v-if="item.id == 1" @click="selectEmotion" />
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" v-else alt />
<span v-if="item.id == 1" @click.stop="selectEmotion">{{ item.name }}</span>
<span v-else>{{ item.name }}</span>
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-video" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div>
</div>
</div>
<div v-show="emotionStatus" class="emotion-panel">
<emotion class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion>
</div>
<div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span>因企业微信限制,普通图片:总像素不超过1555200,大小不超过10M,数量不超过9张。视频建议不超过1280x720,帧率30FPS,视频码率1.67 Mbps,最长不超过30S,最大不超过10MB</span>
</div>
</div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<MessageModel ref="message" @selectItem="selectMessage"></MessageModel>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import vuedraggable from 'vuedraggable'
import emoji from '@/utils/emo'
import ActivityModel from './activityModel'
import MessageModel from './messageModel'
import Emotion from './emotionWords'
import wTextarea from './tag-textarea'
import { utils } from 'glsx-common'
export default {
name: 'WelcomeWords',
components: {
ActivityModel,
Emotion,
wTextarea,
MessageModel,
vuedraggable
},
props: { eventBus: Object, btnList: Array, form: String },
data() {
return {
loading: false,
emotionStatus: false,
// btnList: [
// {
// id: 1,
// name: '表情',
// funcName: '',
// type: 'expression',
// limitSize: 10
// },
// {
// id: 2,
// name: '图片',
// funcName: '',
// type: 'img',
// limitSize: 10
// },
// {
// id: 3,
// name: '昵称',
// type: 'nickname',
// funName: 'nickname'
// },
// {
// id: 4,
// name: '活动',
// type: 'acivity',
// funName: 'activity'
// }
// ],
guestForm: {},
previewList: [],
imgList: [],
sendType: '',
sendTime: '',
sendDate: '',
editor: {},
textValue: ''
}
},
mounted() {
// const _this = this
// this.editor = new E('#toolbar-container', '#text-container')
// this.editor.config.zIndex = 100
// this.editor.config.height = 165
// this.editor.config.colors = ['#000000', '#f7f7f7']
// this.editor.config.focus = false
// this.editor.config.onchange = function(newHtml) {
// console.log('change 之后最新的 html', newHtml)
// console.log(_this.editor.txt.text())
// const val = _this.editor.txt.text()
// _this.textInput(val)
// }
// this.editor.config.onchangeTimeout = 500
// this.editor.create()
this.eventBus.$emit('update', this.previewList)
},
methods: {
onEnd() {
console.log(this.imgList)
this.eventBus.$emit('update', this.previewList)
},
selectEmotion() {
this.emotionStatus = !this.emotionStatus
},
handleEmotion(i) {
this.emotionStatus = false
const list = emoji.flat(Infinity)
let index = list.indexOf(i) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
},
updateText(val) {
this.textInput(val)
},
// 上传图片
handleImgChange(e) {
console.log(e)
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
// if (image.width > 1440 || image.height > 1080) {
// this.$message.error('图片长宽不超过1440x1080')
// return
// }
this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT || item.attType == ATT_TYPE.IMAGE
})
const imgIndex = this.previewList.findIndex(imgItem => imgItem.attType == ATT_TYPE.IMAGE)
if (imgIndex != -1 && this.previewList[imgIndex].attContent.length >= 9) {
this.$message.error('最多上传9张图片')
return
}
if (imgIndex == -1) {
this.previewList.push({
attType: ATT_TYPE.IMAGE,
attContent: []
})
} else {
this.previewList[imgIndex].attContent.push('')
}
console.log(imgIndex)
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
let len = this.previewList.length - 1
if (res) {
if (imgIndex == -1) {
this.$set(this.previewList[len].attContent, 0, res)
} else {
let idx = this.previewList[imgIndex].attContent.length - 1
this.$set(this.previewList[len].attContent, idx, res)
}
this.eventBus.$emit('update', this.previewList)
} else {
if (imgIndex != -1) {
let idx = this.previewList[imgIndex].attContent.length - 1
this.previewList[imgIndex].attContent.splice(idx, 1)
}
}
document.querySelector('.upload-img').value = ''
this.loading = false
})
}
}
},
// 上传视频
async handleVideoChange(e) {
let file
try {
file = await this.uploadFile(e)
var reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT
})
this.eventBus.$emit('update', this.previewList)
this.loading = true
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: [res]
})
this.$nextTick(() => {
this.eventBus.$emit('update', this.previewList)
})
}
this.loading = false
})
document.querySelector('.upload-video').value = ''
}
} catch (err) {
console.log(err)
}
},
uploadFile(e) {
const _this = this
return new Promise((resolve, reject) => {
let file = e.srcElement.files[0]
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return reject()
}
let videoUrl = URL.createObjectURL(file)
let videoObj = document.createElement('video')
videoObj.src = videoUrl
videoObj.load()
videoObj.onloadedmetadata = function(evt) {
URL.revokeObjectURL(videoUrl)
console.dir(videoObj)
if (videoObj.videoWidth > 1280 || videoObj.videoHeight > 720) {
_this.$message.error('上传视频不超过1280x720')
reject()
}
if (videoObj.duration > 30) {
_this.$message.error('上传视频不超过30s')
reject()
}
resolve(file)
}
})
},
handleFun(name) {
if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') {
this.$refs.activity.init()
} else if (name == 'message') {
this.$refs.message.init()
}
},
close(index) {
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
closeImg(value, index, idx) {
value.attContent.splice(index, 1)
if (value.length == 0) {
this.previewList.splice(idx, 1)
}
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1)
if (val) {
if (hasText) {
this.$set(this.previewList, 0, {
attContent: [val],
attType: ATT_TYPE.TEXT
})
} else {
this.previewList.unshift({
attContent: [val],
attType: ATT_TYPE.TEXT
})
}
} else {
this.previewList.splice(0, 1)
}
this.eventBus.$emit('update', this.previewList)
},
selectActivity(val) {
let idx
const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) {
idx = index
return item
}
})
if (val) {
if (hasActivity) {
this.$set(this.previewList, idx, {
attContent: [val],
attType: ATT_TYPE.ACTIVITY
})
} else {
this.previewList.push({
attContent: [val],
attType: ATT_TYPE.ACTIVITY
})
}
}
},
selectMessage(val) {
console.log(val)
const content = val.content
this.updateText(content)
this.textValue = content
// this.previewList[0] = {
// attContent: content,
// attType: ATT_TYPE.TEXT
// }
},
insertHtmlAtCaret(html) {
var sel, range, frag
if (window.getSelection) {
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
var el = document.createElement('span')
el.innerHTML = '<span contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
// var el = document.createElement('div')
// el.innerHTML = html
frag = document.createDocumentFragment()
var node
var lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
if (lastNode) {
range = range.cloneRange()
range.setEndAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
}
},
changeInput: utils.debounce(function() {
var allNodes = document.getElementById('editor').childNodes
var str = ''
allNodes.forEach(item => {
if (item.className == 'nickname') {
str += item.innerText
} else if (item.data) {
str += item.data
}
})
this.textInput(str)
}, 300),
updateList(val) {
console.log(val)
this.previewList = val
this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
}
}
}
</script>
<style lang="scss" scoped>
.welcome-box {
}
.emotion-panel {
position: relative;
height: 0px;
&-box {
position: absolute;
top: -320px;
}
}
.content-bg {
background-color: #f7f7f7;
}
.content {
display: inline-block;
vertical-align: text-top;
// width: calc(100% - 103px);
width: 100%;
// margin-left: 12px;
.welcome-file {
display: flex;
align-items: center;
color: #999;
line-height: 20px;
padding: 5px 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
&-item {
position: relative;
max-width: 530px;
i {
position: absolute;
top: 2px;
right: -30px;
}
}
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
.welcome-file-img {
display: inline-block;
max-width: 500px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
.welcome-file-desc {
display: inline-block;
margin-right: 20px;
max-width: 500px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
i {
font-size: 16px;
cursor: pointer;
}
.el-icon-loading {
font-size: 24px;
}
&:last-child {
margin-bottom: 0;
}
}
.btn-group {
padding: 6px 0 6px 20px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
padding-right: 25px;
font-size: 16px;
color: #666;
cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
cursor: pointer;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
font-size: 0;
height: 40px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
}
}
.date-picker {
margin-top: 10px;
font-size: 14px;
color: #999;
}
}
.required {
display: inline-block;
line-height: 40px;
text-align: right;
width: 90px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
}
.form-tips {
font-size: 12px;
color: #999;
}
.form-upload {
position: absolute;
top: 0;
width: 140px;
// width: 100%;
height: 100%;
cursor: pointer;
z-index: 1;
}
/deep/ {
.el-textarea__inner {
background-color: #f7f7f7;
border-radius: 0;
}
.el-textarea__inner:focus {
border-color: #dcdfe6;
}
.el-textarea .el-input__count {
background-color: #f7f7f7;
}
}
.upload {
position: relative;
}
.upload-bg {
position: relative;
width: 140px;
height: 140px;
background-color: #f7f7f7;
color: #999;
border: 1px dashed #dcdfe6;
i {
position: absolute;
top: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 30px;
}
.upload-text {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 12px;
}
}
.tips-text {
display: flex;
align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 6px 16px;
margin-top: 10px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
line-height: 24px;
.tips-icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
// 编辑器
.editor-container {
border: 1px solid #dcdfe6;
min-height: 165px;
/deep/ {
.w-e-text {
background-color: #f7f7f7;
}
}
}
.text-editor {
outline: 0;
width: 100%;
min-height: 200px;
max-height: 200px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
padding: 5px;
line-height: 20px;
font-size: 12px;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
_overflow-y: visible;
}
/deep/.nickname {
display: inline;
// width: 64px;
// height: 20px;
border-radius: 2px;
background-color: #fff;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 2px;
margin: 0 5px;
i {
font-size: 10px;
}
}
</style>
<template> <template>
<div class> <div class>
<div class="container"> <div class="container">
<div class="edit-container"> <div>
<!-- 基础信息 --> <!-- 基础信息 -->
<div class="title"> <div class="title">
编辑朋友圈 编辑朋友圈
...@@ -41,8 +41,12 @@ ...@@ -41,8 +41,12 @@
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px"> <el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px">
<el-form-item prop="attachmentList"> <el-form-item prop="attachmentList">
<label slot="label" class="required">内容正文</label> <label slot="label" class="required">内容正文</label>
<WelcomeWords ref="welcome" :form="'customer'" :btnList="btnList" :eventBus="eventBus"></WelcomeWords> <GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div> <div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
<div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span>因企业微信限制,普通图片:总像素不超过1555200,大小不超过10M,数量不超过9张。视频建议不超过1280x720,帧率30FPS,视频码率1.67 Mbps,最长不超过30S,最大不超过10MB</span>
</div>
</el-form-item> </el-form-item>
<el-form-item label="发送时间" prop="sendType"> <el-form-item label="发送时间" prop="sendType">
<el-radio-group v-model="basicForm.sendType"> <el-radio-group v-model="basicForm.sendType">
...@@ -59,7 +63,7 @@ ...@@ -59,7 +63,7 @@
</div> </div>
</div> </div>
<div class="preview"> <div class="preview">
<Preview :eventBus="eventBus"></Preview> <Preview :previewView="previewView"></Preview>
</div> </div>
</div> </div>
</div> </div>
...@@ -87,14 +91,11 @@ const ATT_TYPE = { ...@@ -87,14 +91,11 @@ const ATT_TYPE = {
} }
import Vue from 'vue' import Vue from 'vue'
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import WelcomeWords from './components/welcomeWords.vue'
import SelectMember from './components/selectMember.vue' import SelectMember from './components/selectMember.vue'
import Preview from './components/preview.vue' import Preview from './components/preview.vue'
import SelectLabel from './components/selectLabel.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
components: { components: {
WelcomeWords,
SelectMember, SelectMember,
Preview Preview
}, },
...@@ -128,32 +129,47 @@ export default { ...@@ -128,32 +129,47 @@ export default {
addLoading: false, addLoading: false,
eventBus: new Vue(), eventBus: new Vue(),
taggingList: [], taggingList: [],
previewView: [],
btnList: [ btnList: [
{ {
id: 1,
name: '表情', name: '表情',
funcName: '', funcName: '',
type: 'expression', type: 'expression',
limitSize: 10 limitSize: 10
}, },
{ {
id: 2,
name: '图片', name: '图片',
funcName: '', funcName: '',
type: 'img', type: 'img',
limitSize: 10 togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
limitSize: 10, //限制图片大小
limitNum: 9, //限制图片数量
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload
}, },
{ {
id: 3,
name: '视频', name: '视频',
funcName: '',
type: 'video', type: 'video',
funName: 'video' limitSize: 10, //限制视频大小
togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
limitNum: 1, //限制视频数量
limitWidth: 1280, //限制视频宽度
limitHeight: 720, //限制视频高度
limitTime: 30, //限制视频时长
uploadApi: this.$apis.common.pictureUpload
} }
// { // {
// id: 4, // name: '模板',
// name: '活动', // type: 'message',
// type: 'acivity', // funName: 'message',
// funName: 'activity' // getSearchApi: this.$apis.welcomeword.createdNameList,
// templateApi: this.$apis.welcomeword.templatePage,
// templateUpdateApi: this.$apis.welcomeword.templateUpdate,
// templateSaveApi: this.$apis.welcomeword.templateSave,
// templateDetailApi: this.$apis.welcomeword.templateDetail
// } // }
], ],
basicForm: { basicForm: {
...@@ -219,10 +235,12 @@ export default { ...@@ -219,10 +235,12 @@ export default {
deep: true deep: true
} }
}, },
mounted() { mounted() {},
this.setMinHeight()
},
methods: { methods: {
previewForm(val) {
console.log(val)
this.previewView = val
},
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
}, },
...@@ -331,18 +349,7 @@ export default { ...@@ -331,18 +349,7 @@ export default {
staffName: item.staffName staffName: item.staffName
} }
}) })
let previewListArr = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList let attachmentList = this.$refs.welcome.previewList
let previewList = previewListArr.reduce((prev, cur) => {
if (cur.attContent.length == 1) {
return prev.concat({ attContent: cur.attContent[0], attType: cur.attType })
} else {
let attContentImg = []
cur.attContent.forEach(imgItem => {
attContentImg.push({ attContent: imgItem, attType: cur.attType })
})
return prev.concat(attContentImg)
}
}, [])
const material = previewList.filter(item => item.attType != ATT_TYPE.TEXT) const material = previewList.filter(item => item.attType != ATT_TYPE.TEXT)
let materialType = 0 let materialType = 0
if (material && material.length > 0) { if (material && material.length > 0) {
...@@ -361,22 +368,7 @@ export default { ...@@ -361,22 +368,7 @@ export default {
if (material.length > 1) { if (material.length > 1) {
materialType = 2 materialType = 2
} }
console.log(previewList)
params.materialType = materialType params.materialType = materialType
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
item.attContent = replaceImg.substring(0, 600)
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.attachmentList = attachmentList params.attachmentList = attachmentList
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
...@@ -438,6 +430,24 @@ export default { ...@@ -438,6 +430,24 @@ export default {
font-weight: 100; font-weight: 100;
} }
} }
.tips-text {
display: flex;
align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 6px 16px;
margin-top: 10px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
line-height: 24px;
.tips-icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
.info-box { .info-box {
display: inline-flex; display: inline-flex;
width: 100%; width: 100%;
......
<template> <template>
<div> <div>
<BasicInof :eventBus="eventBus" :id="$route.query.id" :form="'customer'"></BasicInof> <BasicInof :id="$route.query.id" :form="'customer'" @refreshList="refreshList"></BasicInof>
<div class="detail-container"> <div class="detail-container">
<div class="detail-modular"> <div class="detail-modular">
<div class="title">成员详情</div> <div class="title">成员详情</div>
...@@ -22,17 +22,15 @@ ...@@ -22,17 +22,15 @@
</div> </div>
</div> </div>
</div> </div>
<div <!-- <div
class="footer-panel" class="footer-panel"
:style="{ :style="{
left: footerLeft + 'px', left: footerLeft + 'px',
width: footerWidth + 'px' width: footerWidth + 'px'
}" }"
> >
<!-- <el-button type="primary" @click="handle
Next">确定</el-button>-->
<el-button type="primary" @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleCancel">取消</el-button>
</div> </div> -->
<el-dialog title="已送达客户" :visible.sync="dialogVisible" width="576px" :before-close="handleClose" class="user-dialog"> <el-dialog title="已送达客户" :visible.sync="dialogVisible" width="576px" :before-close="handleClose" class="user-dialog">
<div class="user-list"> <div class="user-list">
<div class="user-item" v-for="(item, index) in userList" :key="index"> <div class="user-item" v-for="(item, index) in userList" :key="index">
...@@ -133,6 +131,9 @@ export default { ...@@ -133,6 +131,9 @@ export default {
this.searchForm.status = val this.searchForm.status = val
this.$refs.table.refreshTable() this.$refs.table.refreshTable()
}, },
refreshList() {
this.$refs.table.refreshTable()
},
handleCustomSelect(val) { handleCustomSelect(val) {
this.customIndex = val this.customIndex = val
this.getCustomerList(val) this.getCustomerList(val)
......
...@@ -2,8 +2,17 @@ ...@@ -2,8 +2,17 @@
<template> <template>
<div class="marketing pro-group"> <div class="marketing pro-group">
<div class="m-b-20 friend-title"> <div class="m-b-20 friend-title">
<GLButton :size="size" type="primary" fn="编辑朋友圈" @click="handleEdit(1)">发布朋友圈</GLButton> <div>
<span>管理员可直接在后台为员工创建朋友圈,员工收到朋友圈新消息提醒后,可快捷将管理员创建的朋友圈发送到自己朋友圈中。</span> <GLButton :size="size" type="primary" fn="编辑朋友圈" @click="handleEdit(1)">发布朋友圈</GLButton>
<span>管理员可直接在后台为员工创建朋友圈,员工收到朋友圈新消息提醒后,可快捷将管理员创建的朋友圈发送到自己朋友圈中。</span>
</div>
<div class="title">
<span class="info-refresh" @click="handleRefresh">
<i :class="{ 'el-icon-refresh': true, 'wait-status': refreshStatus }"></i>
更新数据
</span>
<span class="info-time">更新于{{ this.updatedTime }}</span>
</div>
</div> </div>
<div class="container"> <div class="container">
<!-- <div> <!-- <div>
...@@ -68,10 +77,12 @@ ...@@ -68,10 +77,12 @@
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { utils } from 'glsx-common'
export default { export default {
name: 'friendGroup', name: 'friendGroup',
data() { data() {
return { return {
refreshStatus: false,
size: 'small', size: 'small',
loading: false, loading: false,
url: url, url: url,
...@@ -85,6 +96,7 @@ export default { ...@@ -85,6 +96,7 @@ export default {
downRules: { downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }] offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
}, },
updatedTime: '',
// 分享 // 分享
isShareVisible: false, isShareVisible: false,
shareForm: {}, shareForm: {},
...@@ -138,7 +150,7 @@ export default { ...@@ -138,7 +150,7 @@ export default {
return row.status == 2 || row.status == 1 return row.status == 2 || row.status == 1
}, },
listeners: { listeners: {
click: () => { } click: () => {}
} }
}, },
{ {
...@@ -152,7 +164,7 @@ export default { ...@@ -152,7 +164,7 @@ export default {
return row.status == -1 return row.status == -1
}, },
listeners: { listeners: {
click: () => { } click: () => {}
} }
}, },
{ {
...@@ -166,7 +178,7 @@ export default { ...@@ -166,7 +178,7 @@ export default {
return row.status == 4 return row.status == 4
}, },
listeners: { listeners: {
click: () => { } click: () => {}
} }
}, },
{ {
...@@ -252,17 +264,17 @@ export default { ...@@ -252,17 +264,17 @@ export default {
{ {
label: '已发送成员', label: '已发送成员',
prop: 'sendStaffCount', prop: 'sendStaffCount',
width: '100' width: '110'
}, },
{ {
label: '未发送成员', label: '未发送成员',
prop: 'unSendStaffCount', prop: 'unSendStaffCount',
width: '100' width: '110'
}, },
{ {
label: '已送达客户', label: '已送达客户',
prop: 'copyCustomerCount', prop: 'copyCustomerCount',
width: '100' width: '110'
} }
] ]
}, },
...@@ -300,6 +312,18 @@ export default { ...@@ -300,6 +312,18 @@ export default {
}, },
methods: { methods: {
handleRefresh: utils.debounce(function() {
this.createStatus()
this.refreshStatus = true
setTimeout(() => {
this.refreshStatus = false
}, 1000)
}, 1000),
createStatus() {
this.$apis.friendGroup.createStatus({}).then(res => {
this.getListData()
})
},
getListData() { getListData() {
this.loading = true this.loading = true
const params = { const params = {
...@@ -313,6 +337,7 @@ export default { ...@@ -313,6 +337,7 @@ export default {
} }
this.$apis.friendGroup.getListApi(params).then(res => { this.$apis.friendGroup.getListApi(params).then(res => {
this.loading = false this.loading = false
this.updatedTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (res) { if (res) {
this.tableData = res.data this.tableData = res.data
this.tableData.forEach(listM => { this.tableData.forEach(listM => {
...@@ -490,7 +515,27 @@ export default { ...@@ -490,7 +515,27 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.friend-title { .friend-title {
display: flex;
justify-content: space-between;
align-items: center;
color: #666666; color: #666666;
.title {
.info-refresh {
font-size: 14px;
color: #5850ff;
cursor: pointer;
margin-left: 20px;
.wait-status {
transition: all ease-in 1s;
transform: rotate(360deg);
}
}
.info-time {
font-size: 14px;
color: #7d7d7d;
margin-left: 10px;
}
}
span { span {
font-size: 14px; font-size: 14px;
margin-left: 10px; margin-left: 10px;
......
<template>
<div class="scrm-sub-client-container">
<div class="container">
<div>
<!-- 基础信息 -->
<div class="title">基础信息</div>
<div class="info-box">
<div class="info-content">
<div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span>企业主体信息需要认证,才可使用该功能。</span>
</div>
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px">
<el-form-item label="自定义群名" prop="groupName">
<el-input v-model.trim="basicForm.groupName" size="small" placeholder="为群聊设个自定义组名,如“VIP服务群”" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="群聊命名规则" prop="groupNameRule">
<el-radio-group v-model="basicForm.groupNameRule" style="line-height: 40px; font-size: 14px; max-width: 600px;">
<el-radio v-for="(rule, index) in nameRules" :label="rule.id" :key="index">
{{ rule.rule }}
<span class="rule-tips">{{ rule.tips }}</span>
</el-radio>
</el-radio-group>
<!-- <div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div> -->
</el-form-item>
<el-form-item prop="followList">
<label slot="label" class="required">跟进专员</label>
<el-button size="small" @click="openFollow">
<i class="el-icon-plus"></i>
选择跟进专员
</el-button>
<span class="label-text">
已选择
<span>{{ basicForm.followList ? basicForm.followList.length : 0 }}</span>
人
</span>
<div :key="followkey" class="sale-select" v-show="basicForm.followList.length">
<div class="el-input-tag input-tag-wrapper">
<div style="max-height: 64px">
<el-tag v-for="(tag, idx) in basicForm.followList" :key="idx" type="info" closable :disable-transitions="false" @close="removeFollow(idx)">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
<!-- <div class="form-tips">必须配置至少1个跟进专员</div> -->
</el-form-item>
<el-form-item>
<label slot="label">默认成员</label>
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择成员
</el-button>
<span class="label-text">
已选择
<span>{{ basicForm.userList ? basicForm.userList.length : 0 }}</span>
人
</span>
<div :key="key" class="sale-select" v-show="basicForm.userList.length">
<div class="el-input-tag input-tag-wrapper">
<div style="max-height: 64px">
<el-tag v-for="(tag, idx) in basicForm.userList" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
<!-- <div class="title">编辑入群欢迎语</div> -->
<!-- <div>
<el-form :model="basicForm" label-width="120px">
<el-form-item label="入群欢迎语">
<WelcomeWords ref="welcome" :eventBus="eventBus"></WelcomeWords>
</el-form-item>
</el-form>
</div>-->
</div>
<!-- <div class="preview">
<Preview :eventBus="eventBus"></Preview>
</div>-->
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
</GLFooter>
<GLDialog :title="'选择成员'" :visible.sync="membersVisible">
<!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :followData="followData"></SelectMember>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="membersVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
</span>
</GLDialog>
<!-- <SelectMember ref="membersForm"></SelectMember> -->
<select-follow @selectTable="selectTable" ref="selectEmpForm"></select-follow>
</div>
</template>
<script>
import Vue from 'vue'
// import WelcomeWords from './components/welcomeWords.vue'
import SelectMember from './components/selectMember.vue'
import SelectFollow from './components/selectFollow.vue'
// import Preview from './components/preview.vue'
export default {
name: 'guestGroupAdd',
components: {
// WelcomeWords,
SelectMember,
SelectFollow
// Preview
},
data() {
const validatorUser = (rule, value, callback) => {
const followList = this.basicForm.followList
let userList = []
if (this.basicForm.userList && this.basicForm.userList.length) {
userList = this.basicForm.followList.concat(this.basicForm.userList)
} else {
userList = this.basicForm.followList
}
if (!this.basicForm.followList.length) {
callback(new Error('请选择跟进专员'))
} else {
if (userList.length < 2) {
this.$message({
type: 'error',
message: '必须配置2个及以上成员'
})
// callback(new Error('必须配置2个及以上成员'))
} else {
callback()
}
}
}
// const nameVaild = (rule, value, callback) => {
//
// if (value) {
// const params = {
// templateName: value
// }
// let api = 'nameVaild'
// if (this.$route.params.id) {
// params.id = this.$route.params.id
// api = 'updateNameVaild'
// }
// this.$apis.groupGuest[api](params).then(res => {
// if (res) {
// callback(new Error('群聊名称不可重复'))
// } else {
// callback()
// }
// })
// }
// }
return {
eventBus: new Vue(),
basicForm: {
followList: [],
userList: [],
groupNameRule: 1
},
nameRules: [
{
rule: '车系+客户昵称+自定义群名',
tips: '(车系/客户昵称自动填充,例:“奥迪A6Carr_VIP服务群”)',
id: 1
},
{
rule: '车系+车牌号+自定义群名',
tips: '(车系/客户昵称自动填充,例:“日产轩逸粤B·1V566_VIP服务群”)',
id: 2
},
{
rule: '自定义群名',
id: 0
}
],
basicRules: {
groupName: [
{ required: true, message: '请输入群聊名称', trigger: 'change' }
// { validator: nameVaild, trigger: 'blur' }
],
groupNameRule: [{ required: true, message: '请选择群聊命名规则', trigger: 'change' }],
followList: [
// { required: true, message: '请选择默认成员', trigger: 'change' },
{ validator: validatorUser, trigger: 'change' }
]
},
membersVisible: false,
key: new Date(),
followkey: new Date(),
previewFlag: false,
selectData: [],
followData: [],
editStatus: false,
// 跟进专员
followVisible: false
}
},
watch: {
basicForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
// membersVisible(val) {
//
// if (!val) {
// this.$refs.membersForm.resetSearch()
// }
// }
},
mounted() {
if (this.$route.params) {
const id = this.$route.params.id
if (id != -1) this.getDetail(id)
}
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
},
methods: {
openMembers() {
this.membersVisible = !this.membersVisible
},
openFollow() {
const checkMember = this.basicForm.userList.length ? this.basicForm.userList.map(i => i.id) : []
this.$refs.selectEmpForm.init(this.basicForm.followList, checkMember)
},
handleSubmit() {
this.$refs.basicForm.validate(valid => {
if (valid) {
const params = {
groupName: this.basicForm.groupName,
groupNameRule: this.basicForm.groupNameRule
}
const followList = this.basicForm.followList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName,
follow: 1
}
})
let memberList = []
if (this.basicForm.userList && this.basicForm.userList.map.length) {
memberList = this.basicForm.userList.map(i => {
return {
staffId: i.staffId,
staffName: i.staffName,
follow: 0
}
})
}
params.userList = followList.concat(memberList)
let apiName = 'insert'
if (this.basicForm.id) {
apiName = 'update'
params.id = this.basicForm.id
}
this.$apis.groupGuest[apiName](params)
.then(res => {
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.$router.push('/guestGroup/index')
} else {
this.$message({
type: 'error',
message: '操作失败'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
}
})
},
getDetail(id) {
this.$apis.groupGuest.detail({ id }).then(res => {
if (res) {
this.basicForm = {
groupName: res.groupName,
id: res.id,
groupNameRule: res.groupNameRule
// userList: res.userList
}
if (res.userList && res.userList.length) {
this.selectData = res.userList.filter(item => item.follow == 0)
this.basicForm.userList = this.selectData
this.basicForm.followList = res.userList.filter(item => item.follow == 1)
}
// this.selectData = res.userList
this.$nextTick(() => {
this.editStatus = false
})
}
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'gl-message-box',
type: 'warning'
})
.then(() => {
this.$router.push('/guestGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/guestGroup/index')
}
},
remove(val, idx) {
if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.key = new Date()
}
},
// 成员弹窗
handleConfirm() {
// this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList
this.openMembers()
},
handleClose() {
this.membersVisible = false
},
selectTable(item) {
this.basicForm.followList = item.map(item => {
return {
staffId: item.id,
staffName: item.staffName
}
})
this.followData = this.basicForm.followList.map(i => i.staffId)
this.followkey = new Date()
},
removeFollow(idx) {
this.basicForm.followList.splice(idx, 1)
this.followData = this.basicForm.followList.map(i => i.staffId)
this.followkey = new Date()
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.container {
margin-bottom: 20px;
background: #ffffff;
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
&::after {
content: '';
}
}
.info-box {
display: inline-flex;
width: 100%;
padding-bottom: 30px;
// align-items: flex-end;
height: calc(100vh - 250px);
justify-content: space-between;
overflow-y: auto;
.info-content {
width: calc(100% - 360px);
// flex: 1;
}
}
.el-form {
padding: 32px 0 20px 24px;
/deep/.el-input {
width: 320px;
}
}
.form-tips {
font-size: 12px;
color: #999;
}
.preview {
margin-right: 24px;
}
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: $btnBlue;
}
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper {
max-width: 320px;
// max-height: 68px;
overflow: auto;
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: 0 5px;
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;
line-height: 32px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
// // overflow: auto;
// /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: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
/deep/ {
.el-form-item .el-form-item {
margin-bottom: 22px;
}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
}
}
.tips-text {
display: flex;
width: 616px;
align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 13px 16px;
margin-top: 20px;
margin-left: 20px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
.tips-icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
.rule-tips {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 14px;
}
.required:before {
margin-right: 5px;
}
</style>
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-time">{{ currentTime }}</div>
<div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/logo.png" alt />
<template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div>
</template>
<template v-else-if="item.attType == 4">
<div class="preview-text preview-link">
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt />
</div>
</template>
<template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template>
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<video style="width: 100px" :src="item.attContent"></video>
</template>
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet">
<div class="preview-applet-title">
<img :src="item.attContent.picUrl" alt />
<span>{{ item.attContent.title }}</span>
</div>
{{ item.attContent.page }}
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Preview',
props: { eventBus: Object },
data() {
return {
previewList: [],
currentTime: ''
}
},
created() {
this.eventBus.$on('update', val => {
this.previewList = val
})
},
mounted() {
const date = new Date()
let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours
let minutes = date.getMinutes()
minutes = minutes < 10 ? `0${minutes}` : minutes
this.currentTime = `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日 ${hours}:${minutes}`
}
}
</script>
<style lang="scss" scope>
.img-bg {
position: relative;
width: 290px;
height: 566px;
background-image: url(../../../assets/guestCustom/iphone-bg.png);
background-size: 100%;
.preview-content {
position: absolute;
width: 250px;
height: 350px;
overflow-y: auto;
top: 115px;
left: 20px;
// background-color: cornflowerblue;
.preview-time {
font-size: 10px;
color: #999;
text-align: center;
margin-bottom: 15px;
}
.preview-info {
display: flex;
padding: 0 44px 20px 9px;
.avatar {
width: 26px;
height: 26px;
margin-right: 8px;
}
.preview-text {
position: relative;
max-width: 169px;
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
}
.text {
font-size: 16px;
padding: 8px 11px;
}
.preview-link {
display: inline-flex;
word-break: break-all;
font-size: 14px;
padding: 8px 8px 8px 11px;
img {
width: 34px;
height: 34px;
margin-left: 10px;
}
}
.preview-text::before {
content: '';
position: absolute;
left: -10px;
top: 20%;
border-width: 5px;
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue;
}
.preview-applet {
img {
width: 20px;
height: 20px;
margin-right: 4px;
}
&-title {
display: flex;
align-self: center;
color: #999;
margin-bottom: 5px;
}
}
}
}
}
</style>
...@@ -2,23 +2,37 @@ ...@@ -2,23 +2,37 @@
<div class="select-emp-panel"> <div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel"> <div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div> <div class="popper-arrow"></div>
<div
class="emp-scroll-panel" <div class="emp-scroll-panel" :style="{
:style="{ height: treeHeight + 20 + 'px'
height: treeHeight + 'px' }">
}"
>
<div class="tree-title">所在门店/部门</div> <div class="tree-title">所在门店/部门</div>
<el-tree v-loading="loading" :data="listTree" :expand-on-click-node="false" highlight-current :props="defaultProps" @node-click="handleNodeClick"></el-tree> <el-tree
v-loading="loading"
:data="listTree"
:expand-on-click-node="false"
highlight-current
:props="defaultProps"
@node-click="handleNodeClick"
></el-tree>
</div> </div>
</div> </div>
<el-col <el-col
class="scrm-p10 emp-table-panel" class="scrm-p10 emp-table-panel"
:style="{ :style="{
height: treeHeight + 20 + 'px' height: treeHeight + 20 + 'px'
}" }"
> >
<GLTable v-loading="loading" ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable> <GLTable
v-loading="loading"
ref="saleTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
@selectionTable="selectionTable"
></GLTable>
</el-col> </el-col>
</div> </div>
</template> </template>
...@@ -70,20 +84,17 @@ export default { ...@@ -70,20 +84,17 @@ export default {
if (this.islord) { if (this.islord) {
params.islord = this.islord params.islord = this.islord
} }
params.isHavCustomer = true this.$apis.groupGuest.listDepartmentTree(params).then(res => {
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.listTree = res this.listTree = res
this.loading = false this.loading = false
if (this.listTree.length) { if (this.listTree.length) {
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree) this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses) this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
} }
if (this.selectData && this.selectData.length) { this.selectData.forEach(i => {
this.selectData.forEach(i => { const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId) this.clearSelect(row)
this.clearSelect(row) })
})
}
this.$nextTick(() => { this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click() document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click() document.getElementsByClassName('el-tree-node__content')[0].click()
...@@ -106,6 +117,7 @@ export default { ...@@ -106,6 +117,7 @@ export default {
d.forEach(i => { d.forEach(i => {
if (i.entmicroStaffResponses) { if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => { i.entmicroStaffResponses.forEach(j => {
// arr.push(j)
const flag = arr.find(m => m.id == j.id) const flag = arr.find(m => m.id == j.id)
if (!flag) { if (!flag) {
arr.push(j) arr.push(j)
...@@ -127,6 +139,7 @@ export default { ...@@ -127,6 +139,7 @@ export default {
} }
}) })
} }
this.tableEmpData = arr this.tableEmpData = arr
} }
// listEntmicroStaff(staffName) { // listEntmicroStaff(staffName) {
...@@ -142,12 +155,13 @@ export default { ...@@ -142,12 +155,13 @@ export default {
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 650 this.treeHeight = clientHeight - 700
this.listDepartmentTree() this.listDepartmentTree()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/variables.scss';
.select-emp-panel { .select-emp-panel {
display: flex; display: flex;
.emp-tree-panel { .emp-tree-panel {
...@@ -206,7 +220,7 @@ export default { ...@@ -206,7 +220,7 @@ export default {
margin-right: 10px; margin-right: 10px;
font-size: 15px; font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content { /deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff; color: $btnBlue;
background: #f2f5fa; background: #f2f5fa;
} }
} }
......
<template>
<div class="square-main" v-loading="loading">
<GLDialog title="选择跟进专员" :visible.sync="dialogVisible">
<el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<div class="table-box">
<GLTable :key="key" v-if="dialogVisible" ref="followTable" :layout="layout" :tableData="tableData" :hasNum="false" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable" @row-click="rowClick"></GLTable>
<div class="form-tips">必须配置至少1个跟进专员</div>
</div>
<span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl">新增专员</a>
<el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'SelectFollow',
data() {
return {
loading: false,
dialogVisible: false,
tableSearchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'data',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
checkSelectKey: 'id',
checkSelectVal: [],
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
}
]
},
layout: 'total',
tableData: [],
tableTotal: 0,
selectItem: [],
selectEmp: [],
checkSelect: [],
key: new Date()
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/settings/followUp/index')
},
getFollower() {
var params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.followTable.page.pageSize,
pageNum: this.$refs.followTable.page.pageNum
}
this.$apis.groupGuest.getFollower(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.count > 10) {
this.layout = 'total, pager'
}
this.tableData.forEach(item => {
this.selectEmp.forEach((itm, index) => {
if (itm.staffId == item.id) {
this.$refs.followTable.$refs.salelistMutiTable.toggleRowSelection(item)
this.selectEmp.splice(index, 1)
}
})
if (this.checkSelect) this.tableParams.checkSelectVal = this.checkSelect
})
})
},
init(item, checkMember) {
this.checkSelect = checkMember
this.tableSearchForm = {}
this.selectEmp = JSON.parse(JSON.stringify(item))
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.followTable.page.pageNum = 1
this.getFollower()
})
},
handleSearch() {
this.getFollower()
},
selectionTable(val) {
this.selectItem = val
},
handleClose() {
this.handleCancel()
},
rowClick(row) {
if (this.checkSelect.find(i => i == row.id)) return
this.$refs.followTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
handleCancel: utils.debounce(function() {
this.dialogVisible = false
this.$refs.followTable.$refs.salelistMutiTable.clearSelection()
}, 300),
handleSelect: utils.debounce(function() {
this.loading = true
let selectEmp = this.selectEmp.map(item => {
return {
id: item.staffId,
staffName: item.staffName
}
})
const selectItem = this.selectItem.concat(selectEmp)
if (selectItem.length == 0) {
this.$message.error('请选择跟进专员')
return
}
this.loading = false
this.dialogVisible = false
this.$emit('selectTable', this.selectItem.concat(selectEmp))
this.$refs.followTable.$refs.salelistMutiTable.clearSelection()
}, 300)
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.dialog-jump {
color: $btnBlue;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.square-main {
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
.form-tips {
position: absolute;
bottom: 0;
right: 0;
font-size: 12px;
color: #999;
line-height: 32px;
}
.table-box {
position: relative;
}
</style>
...@@ -3,51 +3,94 @@ ...@@ -3,51 +3,94 @@
<div class="member-left"> <div class="member-left">
<div class="member-title"> <div class="member-title">
预选 预选
<span>共{{ chatGroupCount }}个群聊,{{ tableEmpData.length }}个群主成员</span> <span>仅筛选有外部客户联系人的成员</span>
</div> </div>
<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 style="margin-bottom: 0"> <el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<span class="lord-label" slot="label">所在门店/部门</span> <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 style="width: 215px" 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 :size="size" v-model.trim="searchForm.lordName" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input> <el-input
</el-form-item> :size="size"
<el-form-item style="margin-bottom: 0"> v-model.trim="searchForm.name"
<span class="lord-label" slot="label">跟进专员类型</span> @keyup.enter.native="search"
<el-select v-model="searchForm.followerId" style="width: 215px" :size="size" placeholder="请选择"> clearable
<el-option v-for="item in followTypeList" :key="item.id" :label="item.followName" :value="item.id"></el-option> placeholder="请输入姓名搜索"
</el-select> ></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>
</el-form-item>--> </el-form-item>-->
<el-form-item label style="margin-bottom: 0; margin-left: 40px"> <el-form-item style="margin-bottom: 0;">
<el-button :size="size" @click="handleReset">重置</el-button> <el-button type="primary" :size="size" @click="search">查询</el-button>
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="table-content" style="max-height: 456px"> <div class="table-content">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick"> <GLTable
: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>
</div> </div>
<!-- <div class="member-checked">
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</div>-->
</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 v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)"> <el-tag
<i class="el-icon-user-solid"></i> v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
</div> </div>
...@@ -59,13 +102,12 @@ ...@@ -59,13 +102,12 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
export default { export default {
name: 'SelectLord', name: 'SelectMember',
props: ['selectData'], props: ['selectData', 'followData'],
data() { data() {
return { return {
url: url, url: url,
searchForm: {}, searchForm: {},
checked: '',
treeData: [], treeData: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
...@@ -92,17 +134,6 @@ export default { ...@@ -92,17 +134,6 @@ export default {
{ {
label: '所在门店/部门', label: '所在门店/部门',
prop: 'departmentName' prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName',
formatter: cellValue => {
return cellValue.followerTypeName ? cellValue.followerTypeName : '-'
}
},
{
label: '群数量',
prop: 'chatCount'
} }
] ]
}, },
...@@ -110,14 +141,12 @@ export default { ...@@ -110,14 +141,12 @@ export default {
allTreeData: [], allTreeData: [],
currentTreeData: [], currentTreeData: [],
innerTags: [], innerTags: [],
followTypeList: [], key: new Date()
chatGroupCount: 0
} }
}, },
mounted() { mounted() {
this.getFindLordGroup({}, true)
this.getFollowerType()
this.listDepartmentTree() this.listDepartmentTree()
}, },
methods: { methods: {
selectionTable(val) { selectionTable(val) {
...@@ -136,30 +165,34 @@ export default { ...@@ -136,30 +165,34 @@ export default {
onHidePopover() { onHidePopover() {
this.popoverVisible = false this.popoverVisible = false
}, },
getFindLordGroup(params, isFirst) { listDepartmentTree() {
this.$apis.customerTransform.findLordGroup(params).then(res => { const params = { addChildrensFlag: true }
if (this.islord) {
// 是否群主
params.islord = this.islord
}
this.loading = true
params.isHavCustomer = true
this.$apis.groupGuest.listDepartmentTree(params).then(res => {
this.loading = false this.loading = false
if (res) { if (res) {
this.tableEmpData = res this.tableEmpData = this.getEmployee(res)
this.tableEmpData.map(item => (this.chatGroupCount += item.chatCount)) this.allTreeData = this.getEmployee(res)
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px' this.currentTreeData = this.getEmployee(res)
if (isFirst && this.selectData && this.selectData.length) { this.treeData = res
this.tableEmpData.length ? (this.$refs.empTable.tableHeightValues = '250px') : this.$refs.empTable.setTableHeightFun()
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)
}) })
} }
if (this.followData) this.tableParams.checkSelectVal = this.followData
// this.key = new Date()
} else { } else {
this.treeData = [] this.treeData = []
} }
}) })
}, },
listDepartmentTree() {
const params = { addChildrensFlag: true }
params.islord = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.treeData = res
})
},
handleNodeClick(data) { handleNodeClick(data) {
this.searchForm.department = data.departmentName this.searchForm.department = data.departmentName
this.currentTreeData = data this.currentTreeData = data
...@@ -182,22 +215,57 @@ export default { ...@@ -182,22 +215,57 @@ export default {
return arr return arr
}, },
search() { search() {
this.getFindLordGroup(this.searchForm) this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
if (data instanceof Array) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
}, },
remove(item) { remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
}, },
rowClick(row) { rowClick(row) {
if (this.followData.find(i => i == row.id)) return
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
getFollowerType() {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
},
handleReset() {
this.searchForm = {}
this.search()
} }
} }
} }
...@@ -229,15 +297,11 @@ export default { ...@@ -229,15 +297,11 @@ export default {
background-color: #999; background-color: #999;
} }
} }
.lord-label {
display: inline-block;
width: 110px;
}
.member-wrapper { .member-wrapper {
display: flex; display: flex;
.member-title { .member-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 500;
line-height: 22px; line-height: 22px;
margin-bottom: 6px; margin-bottom: 6px;
span { span {
...@@ -245,7 +309,6 @@ export default { ...@@ -245,7 +309,6 @@ export default {
padding-left: 5px; padding-left: 5px;
font-size: 12px; font-size: 12px;
color: #999; color: #999;
font-weight: 500;
} }
} }
.member-left { .member-left {
...@@ -253,14 +316,13 @@ export default { ...@@ -253,14 +316,13 @@ export default {
.member-content { .member-content {
border: 1px solid #eee; border: 1px solid #eee;
border-bottom: none;
.member-form { .member-form {
padding: 10px 20px; padding: 10px 20px;
} }
.table-content { .table-content {
max-height: 456px; max-height: 456px;
overflow: auto; overflow: auto;
border-top: 1px solid #eee; border: 1px solid #eee;
} }
} }
.member-checked { .member-checked {
......
<template> <template>
<div class="drawer-sale-panel"> <div class="drawer-sale-panel">
<el-form label-width="100px" :model="addForm" @submit.native.prevent> <el-form label-width="100px" :model="addForm">
<el-form-item label="请选择成员"> <el-form-item label="请选择成员">
<div class="sale-select"> <div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput"> <div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<div class="tag-box"> <div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)"> <el-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" />
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
</div> </div>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none" @keyup.enter.native="searchEmp"></el-input> <el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div> </div>
<div> <div>
<el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button> <el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button>
...@@ -84,16 +85,13 @@ export default { ...@@ -84,16 +85,13 @@ export default {
this.innerTags.forEach(item => { this.innerTags.forEach(item => {
userIds.push(item.userId) userIds.push(item.userId)
}) })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
} }
// onCancel() {
// this.$emit('closeDrawer')
// }
}, },
mounted() {} mounted() {}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/variables.scss';
.drawer-sale-panel { .drawer-sale-panel {
padding: 0px 20px; padding: 0px 20px;
.sale-reload { .sale-reload {
...@@ -130,8 +128,8 @@ export default { ...@@ -130,8 +128,8 @@ export default {
font-size: 14px; font-size: 14px;
color: #7d7d7d; color: #7d7d7d;
&.checked { &.checked {
border: 1px solid #5850ff; border: 1px solid $btnBlue;
color: #5850ff; color: $btnBlue;
} }
i { i {
position: absolute; position: absolute;
...@@ -207,15 +205,15 @@ export default { ...@@ -207,15 +205,15 @@ export default {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
::-webkit-scrollbar { // ::-webkit-scrollbar {
/*滚动条整体样式*/ // /*滚动条整体样式*/
width: 6px; // width: 6px;
height: 4px; // height: 4px;
} // }
::-webkit-scrollbar-thumb { // ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ // /*滚动条里面小方块*/
border-radius: 4px; // border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3); // background-color: rgba(144, 147, 153, 0.3);
} // }
</style> </style>
<template>
<div class="welcome-box">
<!-- <div class="required">入群欢迎语</div> -->
<div class="content">
<div class="content-bg">
<el-input type="textarea" :rows="9" maxlength="600" show-word-limit v-model="text" @input="textInput" placeholder="请输入内容"></el-input>
<div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1">
<template v-if="itm.attType == 2">
<img src="@/assets/guestCustom/icon-img.png" alt="" />
<span>{{ itm.attContent }}</span>
</template>
<template v-else-if="itm.attType == 3">
<img src="@/assets/guestCustom/icon-img.png" alt="" />
<span>{{ itm.attContent }}</span>
</template>
<template v-else-if="itm.attType == 4">
<img src="@/assets/guestCustom/icon-link.png" alt="" />
<span>{{ itm.attContent.url }}</span>
</template>
<template v-else-if="itm.attType == 5">
<img src="@/assets/guestCustom/icon-applet.png" alt="" />
<span>{{ itm.attContent.title }}</span>
</template>
<i class="el-icon-circle-close" @click="close(index)"></i>
</div>
</div>
<div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id">
<i class="el-icon-circle-plus-outline"></i>
<span>{{ item.name }}</span>
<!-- <div id="video"></div> -->
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-if="item.type == 'popup'" style="opacity: 0" @click="switchDailog(item.funName)">{{ item.name }}</el-link>
</div>
</div>
</div>
<div class="tips-text">
<img src="../../../assets/guestCustom/tips.png" class="tips-icon" alt="" />
<span>欢迎语将在客户进群时发送一次,不设置时不发送入群欢迎语。</span>
</div>
</div>
<GLdialog :title="dialogTitle" :visible.sync="dialogVisible">
<div>
<el-form v-if="dialogTitle == '添加网页消息'" :model="linkForm" :rules="linkRules" ref="linkForm" label-width="120px">
<el-form-item label="网页标题" prop="title">
<el-input v-model="linkForm.title" placeholder="请输入网页标题"></el-input>
</el-form-item>
<el-form-item label="添加网页链接" prop="url">
<el-input v-model="linkForm.url" placeholder="以http或https开头"></el-input>
</el-form-item>
</el-form>
<el-form v-else-if="dialogTitle == '添加小程序'" :model="appletForm" :rules="appletRules" ref="appletForm" label-width="120px">
<el-form-item label="小程序标题" prop="title">
<el-input v-model="appletForm.title" placeholder="请输入小程序标题"></el-input>
</el-form-item>
<el-form-item label="小程序appID" prop="appid">
<el-input v-model="appletForm.appid" placeholder="请输入小程序appID"></el-input>
</el-form-item>
<el-form-item label="小程序路径" prop="page">
<el-input v-model="appletForm.page" placeholder="请输入小程序路径"></el-input>
<div class="form-tips">注意:小程序路径以html作为后缀</div>
</el-form-item>
<el-form-item label="小程序封面" prop="picUrl">
<div class="upload">
<div v-show="!appletForm.picUrl" class="upload-bg">
<i class="el-icon-circle-plus"></i>
<div class="upload-text">上传封面</div>
</div>
<input type="file" style="opacity: 0" ref="file" class="form-upload img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="handleImg" />
<el-image v-show="appletForm.picUrl" style="width: 140px" :src="appletForm.picUrl" fit="contain"></el-image>
</div>
<div class="form-tips">建议图片大小在2M以内,建议尺寸:352*282px</div>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="closeDialog">取 消</el-button>
<el-button type="primary" size="small" @click="handleConfirm">确 定</el-button>
</span>
</GLdialog>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6
}
export default {
name: 'WelcomeWords',
props: { eventBus: Object },
data() {
return {
btnList: [
{
id: 1,
name: '图片',
funcName: '',
type: 'img',
limitSize: 10
},
{
id: 2,
name: '视频',
funcName: '',
type: 'video',
limitSize: 10
},
{
id: 3,
name: '链接',
type: 'popup',
funName: 'link'
},
{
id: 4,
name: '小程序',
type: 'popup',
funName: 'applet'
}
],
guestForm: {},
text: '',
dialogTitle: '',
dialogVisible: false,
linkForm: {},
linkRules: {
title: [{ required: true, message: '请输入网页标题', trigger: 'blur' }],
url: [{ required: true, message: '请输入网页链接', trigger: 'blur' }]
},
appletForm: {},
appletRules: {
title: [{ required: true, message: '请输入小程序标题', trigger: 'blur' }],
appid: [{ required: true, message: '请输入小程序appID', trigger: 'blur' }],
page: [{ required: true, message: '请输入小程序路径', trigger: 'blur' }],
picUrl: [{ required: true, message: '请上传封面路径', trigger: 'change' }]
},
previewList: []
}
},
mounted() {
this.eventBus.$emit('update', this.previewList)
// this.updateList(this.previewList)
// obj.init('video')
},
methods: {
handleImgChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.IMAGE,
attContent: res
})
}
})
}
}
},
handleVideoChange(e, targetItem) {
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: res
})
}
})
}
},
handleImg(e) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$set(this.appletForm, 'picUrl', 'dfasdfasfa')
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.$set(this.appletForm, 'picUrl', res)
}
})
}
}
},
switchDailog(funName) {
if (funName == 'link') {
this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') {
this.dialogTitle = '添加小程序'
}
this.dialogVisible = !this.dialogVisible
},
handleConfirm() {
const { dialogTitle } = this
switch (dialogTitle) {
case '添加网页消息':
this.$refs.linkForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.URL,
attContent: this.linkForm
})
this.closeDialog('linkForm')
// this.dialogVisible = !this.dialogVisible
// this.linkForm = {}
// this.$refs.linkForm.clearValidate()
} else {
return false
}
})
break
case '添加小程序':
this.$refs.appletForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm
})
this.closeDialog('appletForm')
// this.dialogVisible = !this.dialogVisible
// this.appletForm = {}
// this.$refs.appletForm.clearValidate()
} else {
return false
}
})
break
default:
}
},
close(index) {
// this.previewList
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
attType: ATT_TYPE.TEXT
})
} else {
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
},
closeDialog() {
if (this.dialogVisible) {
if (this.$refs.linkForm) this.$refs.linkForm.clearValidate()
this.linkForm = {}
if (this.$refs.appletForm) this.$refs.appletForm.clearValidate()
this.appletForm = {}
}
this.dialogVisible = !this.dialogVisible
},
updateList(val) {
this.previewList = val
this.eventBus.$emit('update', this.previewList)
if (val) {
const obj = val.find(item => item.attType == 1)
if (obj) {
this.text = obj.attContent
} else {
this.text = ''
}
}
}
}
}
</script>
<style lang="scss" scoped>
.welcome-box {
// padding-top: 20px;
// margin-left: 87px;
}
.content {
display: inline-block;
vertical-align: text-top;
width: calc(100% - 103px);
// margin-left: 12px;
.content-bg {
background-color: #f7f7f7;
}
.welcome-file {
display: flex;
align-items: center;
color: #999;
padding: 10px;
margin-bottom: 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
span {
display: inline-block;
margin-right: 20px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
i {
font-size: 16px;
}
&:last-child {
margin-bottom: 0;
}
}
.btn-group {
padding: 6px 0 6px 20px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
padding-right: 25px;
font-size: 16px;
color: #666;
cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
}
}
}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
}
.form-tips {
font-size: 12px;
color: #999;
}
.form-upload {
position: absolute;
top: 0;
width: 140px;
// width: 100%;
height: 100%;
cursor: pointer;
z-index: 1;
}
/deep/ {
.el-textarea__inner {
background-color: #f7f7f7;
border-radius: 0;
}
.el-textarea__inner:focus {
border-color: #dcdfe6;
}
.el-textarea .el-input__count {
background-color: #f7f7f7;
}
}
.upload {
position: relative;
}
.upload-bg {
position: relative;
width: 140px;
height: 140px;
background-color: #f7f7f7;
color: #999;
border: 1px dashed #dcdfe6;
i {
position: absolute;
top: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 30px;
}
.upload-text {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 12px;
}
}
.tips-text {
display: flex;
align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 13px 16px;
margin-top: 10px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
.tips-icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="header flex">
<div class="left-wrap shadow">
<div class="title-info">
<span class="info">群聊信息</span>
</div>
<div class="content">
<div class="group-name flex">
<div class="avator">
<img src="@/assets/guestCustom/chat-logo.png" alt />
</div>
<div class="group-name-info">
<div>{{ groupInfo.groupName }}</div>
<div class="group-name-info-count">{{ groupInfo.userList ? groupInfo.userList.length : 0 }}人</div>
</div>
</div>
<div class="text-info">
已建群数量:
<span class="group-number">{{ groupInfo.groupCount }}</span>
</div>
</div>
</div>
<div class="right-wrap shadow">
<div class="title-info">
<span class="info">群成员构成</span>
</div>
<div class="content">
<div class="commissioner">
<div class="text-info">跟进专员:</div>
<div class="entmicro">
<div class="entmicro-tag" v-for="(tag, idx) in followList" :key="tag.id">
<el-tag type="info" v-if="idx < 6" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag>
<el-tag type="info" v-if="followList.length > 6 && idx == 6">
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ followList.length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in followList" :key="index" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
</div>
<div class="commissioner">
<div class="text-info">入群成员:</div>
<div class="entmicro">
<div class="entmicro-tag" v-for="(tag, idx) in memberList" :key="tag.id">
<el-tag type="info" v-if="idx < 6" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag>
<el-tag type="info" v-if="memberList.length > 6 && idx == 6">
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ memberList.length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in memberList" :key="index" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main shadow">
<div class="title-info flex">
<span class="info">客户群详情</span>
<div class="updata text-info" @click="refreshData">
<i class="el-icon-refresh"></i>
更新数据
</div>
<div class="text-info">更新于:{{ currentTime }}</div>
</div>
<GLTable class="table" :searchForm="searchForm" ref="groupDetail" :hasNum="false" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams" :tableData="tableData">
<span slot="customerName" slot-scope="scope">
<div class="">
<!-- <div class="customer-img">
<img src="@/assets/guestCustom/chat-logo.png" alt="" />
</div>-->
<div class="customer-name">
{{ scope.scope.customerName }}
<label class="origin">{{ WECHANT_TYPE[scope.scope.type] }}</label>
</div>
</div>
</span>
<div slot="groupOwner" slot-scope="scope">
<el-tag type="info" v-show="scope.scope.lordName" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ scope.scope.lordName }}{{ scope.scope.departmentName ? `(${scope.scope.departmentName})` : '' }}
</el-tag>
</div>
<span slot="status" class="table-status" slot-scope="scope">
<!-- <span
v-if="scope.scope.delFlag == '-1'"
class="statusText"
:class="{ 'red-text': scope.scope.delFlag == '-1' }"
>解散于<span v-if="scope.scope.delFlag == '-1'" class="gray-text">{{ scope.scope.disMiss }}</span></span>
<span
class="statusText"
v-if="scope.scope.delFlag == '0'"
>使用</span> -->
<span class="statusText" :class="{ 'red-text': scope.scope.delFlag == '-1' }">{{ scope.scope.delFlag == '0' ? '使用' : scope.scope.delFlag == '-1' ? '解散于' : '' }}</span>
<span v-if="scope.scope.delFlag == '-1'" class="gray-text">{{ scope.scope.disMiss }}</span>
</span>
</GLTable>
</div>
</div>
</template>
<script>
const WECHANT_TYPE = {
1: '@微信',
2: '@企微'
}
import * as dayjs from 'dayjs'
export default {
name: 'guestGroupDetail',
data() {
return {
WECHANT_TYPE: WECHANT_TYPE,
searchForm: {},
getListApi: this.$apis.groupGuest.customerList,
tableData: [
{
id: 1,
customerName: '嵇翔',
type: 1, //1微信2企微
orgName: '守候专用服务一组',
createdTime: '2021-06-26 09:00:00 ',
delFlag: '0', //0使用 -1停用
groupName: '三人干饭小组',
lordName: '刘益玲',
departmentName: '财务管理中心'
},
{
id: 2,
customerName: '嵇翔',
type: 2, //1微信2企微
orgName: '守候专用服务一组',
createdTime: '2021-06-26 09:00:00',
cancelTime: '2021年7月22日',
delFlag: '-1', //0使用 -1停用
groupName: '三人干饭小组',
lordName: '刘益玲'
}
],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户',
prop: 'customerName',
addHtml: 'customerName'
//align: 'left'
// width: 200
},
{
label: '创建时间',
prop: 'createdTime'
//align: 'left'
// width: 200
},
{
label: '现群名称',
prop: 'chatName'
//align: 'left'
},
{
label: '现群主',
prop: 'createdBy',
// minWidth: '180px',
addHtml: 'groupOwner'
//align: 'left'
},
{
label: '状态',
prop: 'status',
addHtml: 'status'
// width: 250,
//align: 'left'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
userList: [
{
id: 1110,
templateId: 87,
staffId: 25794,
staffName: '刘伟',
userId: 'GL1029',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1111,
templateId: 87,
staffId: 25795,
staffName: '乔宁',
userId: 'GL0667',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1112,
templateId: 87,
staffId: 25797,
staffName: '胡庚美',
userId: 'GL0376',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1113,
templateId: 87,
staffId: 25808,
staffName: '关则剑',
userId: 'GL1388',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1114,
templateId: 87,
staffId: 25813,
staffName: '邹琰',
userId: 'GL0778',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1115,
templateId: 87,
staffId: 25818,
staffName: '董成',
userId: 'GL0640',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1116,
templateId: 87,
staffId: 25823,
staffName: '麦舒琪',
userId: 'GL1485',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1117,
templateId: 87,
staffId: 25825,
staffName: '王科莉',
userId: '524',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1118,
templateId: 87,
staffId: 25870,
staffName: '康旭',
userId: 'GL1678',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1119,
templateId: 87,
staffId: 25899,
staffName: '陆汉林',
userId: 'GL1744',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1120,
templateId: 87,
staffId: 26035,
staffName: '蒋金家',
userId: 'GL1759',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1121,
templateId: 87,
staffId: 26113,
staffName: '测试机01',
userId: 'test001',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1122,
templateId: 87,
staffId: 26124,
staffName: '黄嘉泰',
userId: 'GL1775',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1124,
templateId: 87,
staffId: 26220,
staffName: '陆汉林',
userId: 'GL1744',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 1
},
{
id: 1125,
templateId: 87,
staffId: 26223,
staffName: '乔宁',
userId: 'GL0667',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
},
{
id: 1126,
templateId: 87,
staffId: 26224,
staffName: '麦舒琪',
userId: 'GL1485',
departmentName: null,
masterStatus: null,
delFlag: 0,
follow: 0
}
],
userId: '',
groupInfo: {},
followList: [],
memberList: [],
currentTime: ''
}
},
created() {
this.userId = this.$route.params.id
this.getGroupList(this.$route.params.id)
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
},
methods: {
//更新数据
refreshData() {
this.$refs.groupDetail.refreshTable()
this.$set(this, 'currentTime', dayjs(new Date()).format('YYYY-MM-DD HH:mm'))
},
setTableFinishFun() {
if (this.$refs.groupDetail.data && !this.$refs.groupDetail.data.length) {
this.$refs.groupDetail.setTableHeightFun()
}
},
getGroupList(id) {
// const id = this.userId
this.$apis.groupGuest.detail({ id }).then(res => {
if (res) {
this.followList = []
this.memberList = []
this.currentTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm')
this.groupInfo = res
if (res.userList && res.userList.length) {
res.userList.forEach(item => {
if (item.follow == 1) {
this.followList.push(item)
} else {
this.memberList.push(item)
}
})
}
}
})
},
// handleCancel() {
// this.$router.push('/guestGroup/index')
// },
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = {
templateId: this.userId
}
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
box-sizing: border-box;
overflow-y: auto;
margin-bottom: 80px;
.title-info {
width: 100%;
height: 56px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 56px;
border-bottom: 1px solid #d8d8d8;
.info {
margin-left: 20px;
}
}
.text-info {
height: 20px;
font-size: 14px;
font-weight: 400;
color: #7d7d7d;
line-height: 20px;
margin-right: 10px;
white-space: nowrap;
}
.shadow {
box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);
background: #ffffff;
}
.flex {
display: flex;
align-items: center;
}
.header {
width: 100%;
height: 227px;
margin-bottom: 20px;
.left-wrap {
width: 335px;
height: 100%;
margin-right: 20px;
& .content {
margin: 20px 20px 0 20px;
.group-name {
width: 295px;
height: 64px;
background: #f7f7f7;
border-radius: 4px;
border: 1px solid #dcdfe6;
padding: 10px;
margin-bottom: 30px;
box-sizing: border-box;
.avator {
width: 44px;
height: 44px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
}
}
&-info {
font-size: 14px;
font-weight: 400;
color: #333333;
div {
line-height: 20px;
height: 20px;
}
&-count {
color: #999999;
margin-top: 4px;
}
}
}
& .group-number {
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
margin-right: 10px;
}
}
}
.right-wrap {
width: calc(100% - 355px);
height: 100%;
& .content {
margin: 20px 0 0 44px;
.commissioner {
display: flex;
align-items: flex-start;
margin-bottom: 16px;
}
}
}
}
.main {
width: 100%;
& .updata {
color: $btnBlue;
margin: 0 10px 0 20px;
cursor: pointer;
i.el-icon-refresh {
font-size: 14px;
color: $btnBlue;
}
}
.table {
padding: 20px;
box-sizing: border-box;
}
}
.customer-name {
display: inline-block;
.origin {
color: $btnBlue;
font-size: 14px;
}
}
.customer {
margin-left: -100px;
.customer-img {
width: 34px;
height: 34px;
display: inline-block;
margin-right: 6px;
position: relative;
img {
height: 100%;
}
}
}
}
.entmicro {
text-align: left;
&-tag {
display: inline-block;
}
&-hover {
max-height: 214px;
overflow: auto;
i {
color: #75acff;
font-size: 13px;
}
}
}
i {
color: #75acff;
// margin-right: 3px;
font-size: 14px;
}
.el-tag {
margin: 0 10px 4px 0;
cursor: pointer;
background-color: #fff !important;
height: 26px;
line-height: 26px;
color: #666666;
padding: 0 6px !important;
}
.table-status {
display: flex;
align-items: center;
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="btn-header">
<!-- <el-button class="addBtn" @click="btnClick('create')">新建群组</el-button> -->
<GLButton class="addBtn" @click="btnClick('create')" fn="新建群组">新建群组</GLButton>
<span class="toptips">
<span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span>
</span>
</div>
<div class="container">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="searchFormData" labelWidth="85px">
<span class="inline-b" style="float: right" slot="form-slot">
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- 表格区域 开始 -->
<GLTable ref="gueastGroup" @setTableFinishFun="setTableFinishFun" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<div class="entmicro-tag" v-for="(tag, idx) in scope.scope.userList" :key="idx">
<el-tag type="info" v-if="idx < 3" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ tag.staffName }}{{ tag.departmentName ? `(${tag.departmentName})` : '' }}
</el-tag>
<el-tag type="info" v-if="scope.scope.userList.length > 3 && idx == 3">
<el-popover placement="top" width="600" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<span slot="reference">...({{ scope.scope.userList.length }})</span>
<div class="entmicro-hover">
<el-tag class="toptip" type="info" v-for="(i, index) in scope.scope.userList" :key="index" :disable-transitions="false">
<!-- <i class="el-icon-user-solid"></i> -->
<img class="headPortrait" src="@/assets/headPortrait.png" />
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div>
<span slot="status" slot-scope="scope">
<span :class="{ circleStatusGray: scope.scope.status === 2, circleStatusGreen: scope.scope.status === 1 }"></span>
<span>{{ scope.scope.status == '1' ? '启用' : '停用' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<!-- <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
<el-button type="text" @click="btnClick('detail', scope.scope)">查看详情</el-button>-->
<GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton>
<GLButton type="text" @click="btnClick('status', scope.scope)" fn="启用禁用">{{ scope.scope.status == 1 ? '停用' : '启用' }}</GLButton>
<GLButton type="text" @click="btnClick('detail', scope.scope)" fn="客户群详情">查看详情</GLButton>
<!-- <el-button
type="text"
@click="btnClick('status', scope.scope)"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button>-->
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'guestGroup',
data() {
return {
url: url,
searchForm: {},
searchFormData: [
{
type: 'input',
inputType: 'text',
prop: 'groupName',
label: '群聊名称:',
placeholder: '请输入群聊名称搜索',
clearable: true
}
],
// 表格
getListApi: this.$apis.groupGuest.templateList,
tableParams: {
listName: 'data',
tableOption: false,
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '群聊名称',
prop: 'groupName',
width:250,
line: 1
},
{
label: '默认成员',
prop: 'entmicroName',
minWidth: 320,
addHtml: 'entmicro-name'
},
{
label: '创建时间',
prop: 'createdTime',
line: 1
// minWidth: 110
},
{
label: '状态',
prop: 'status',
// minWidth: 130,
addHtml: 'status'
},
{
label: '操作',
prop: 'optionBtns',
width: '200px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableData: [
{
id: 1,
orgName: '守候专用服务一组',
createdTime: '2021-11-05',
status: '1',
userList: [
{
id: 1,
name: '1号',
tips: '售前一组'
},
{
id: 2,
name: '2号',
tips: '售前一组'
},
{
id: 3,
name: '3号',
tips: '售前一组'
},
{
id: 4,
name: '4号',
tips: '售前一组'
},
{
id: 5,
name: '5号',
tips: '售前一组'
},
{
id: 6,
name: '6号',
tips: '售前一组'
},
{
id: 7,
name: '7号',
tips: '售前一组'
},
{
id: 8,
name: '8号',
tips: '售前一组'
},
{
id: 9,
name: '9号',
tips: '售前一组'
},
{
id: 10,
name: '10号',
tips: '售前一组'
}
]
},
{
id: 2,
orgName: '守候专用服务er组',
createdTime: '2021-11-05',
status: '2',
userList: [
{
id: 1,
name: '1号'
},
{
id: 2,
name: '2号'
},
{
id: 3,
name: '3号'
},
{
id: 4,
name: '4号'
},
{
id: 5,
name: '5号'
}
]
}
]
}
},
// watch: {
// $route(val) {
// if (val.path == '/guestGroup/index') this.searchTable()
// }
// },
beforeDestroy() {
this.$message.closeAll()
},
mounted() {
this.wxTips()
},
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')
},
//搜索表格
searchTable() {
this.$refs.gueastGroup.refreshTable()
},
btnClick(name, rowData) {
switch (name) {
case 'create':
this.$router.push('/guestGroup/add')
break
case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id)
break
case 'detail':
this.$router.push('/guestGroup/detail/' + rowData.id)
break
case 'status':
this.$confirm(`是否确认${rowData.status == 1 ? '停用' : '启用'}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'gl-message-box',
type: 'warning'
})
.then(() => {
const params = {
id: rowData.id,
status: rowData.status == 1 ? 2 : 1,
merchantId: 1
}
this.$apis.groupGuest
.status(params)
.then(res => {
if (res) {
this.searchTable()
this.$message({
type: 'success',
message: '操作成功'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
break
default:
}
},
setTableFinishFun() {
// if (!this.$refs.gueastGroup.data.length) {
// this.$refs.gueastGroup.setTableHeightFun()
// }
this.$refs.gueastGroup.data.length ? (this.$refs.gueastGroup.tableHeightValues = '') : this.$refs.gueastGroup.setTableHeightFun()
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.searchTop {
/deep/ .el-form-item:nth-child(2) {
position: static !important;
.el-form-item__content {
margin-left: 15px !important;
}
}
}
/deep/.search-form {
.itemWidth {
display: flex;
.el-form-item {
display: flex;
}
}
.el-form-item__content {
width: auto;
display: inline-block;
margin-left: 0px !important;
.el-input {
width: 415px;
.el-input__inner {
width: 415px;
}
}
}
}
.btn-header {
margin-bottom: 10px;
}
.container {
margin-bottom: 20px;
background: #ffffff;
padding: 20px;
}
.addBtn {
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;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
}
.entmicro {
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;
text-align: left;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
&-tag {
display: inline-block;
}
&-hover {
max-height: 214px;
overflow: auto;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
// span {
// line-height: 20px;
// }
}
.el-tag {
margin-right: 10px;
// margin-bottom: 10px;
cursor: pointer;
}
.toptip {
margin-bottom: 10px;
&:nth-last-of-type(-n + 4) {
margin-bottom: 0;
}
}
/deep/ {
.search-form {
padding-top: 0;
}
.search-form .itemWidth {
max-width: 100%;
}
.search-form .el-form-item:last-child {
float: right;
}
}
</style>
...@@ -226,11 +226,11 @@ export default { ...@@ -226,11 +226,11 @@ export default {
name: 'homeSet', name: 'homeSet',
data() { data() {
return { return {
showGh: false,
size: 'small', size: 'small',
userInfo: {}, userInfo: {},
// 查看大图 // 查看大图
isImgVisible: false, isImgVisible: false,
showGh: false,
state: '', state: '',
dialogObj: { dialogObj: {
url: '', url: '',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!