Commit 4c88e498 by 匡雅琴

高级企微企微群发页面

1 parent 832dcd0c
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
//权益卡
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//权益卡
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//是否开通权益
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//优惠券
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//套餐
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//秒杀活动
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
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 => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板保存
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板更新
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板创建人
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCard,
merchant,
getActivity,
getPackage,
getMerchant,
getCoupon,
merchantOpen,
getGroupListApi,
getMaterialListApi,
templatePage,
createdNameList,
templateUpdate,
templateSave,
crowdfundingActivity
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import Vue from 'vue' import Vue from 'vue'
import { message } from '@/plugins/element.js' import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import { GLButton, GLTable, GLCombiForm, GLFooter, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLCombiForm, GLFooter, GLTableButton, GLDialog, GLEditor } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
...@@ -24,6 +24,7 @@ Vue.use(GLCombiForm) ...@@ -24,6 +24,7 @@ Vue.use(GLCombiForm)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLTableButton) Vue.use(GLTableButton)
Vue.use(GLDialog) Vue.use(GLDialog)
Vue.use(GLEditor)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, sign_common, secret, request_common } = await fetchConfig(true) //globalState.configSwitch const { response, request, sign, sign_common, secret, request_common } = await fetchConfig(true) //globalState.configSwitch
Vue.prototype.$history = history Vue.prototype.$history = history
......
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
if (month < 10) month = '0' + month
if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1
month = month + 12
}
if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function(time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function(dateStr, separator) {
if (!separator) {
separator = '-'
}
var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0])
var month
//处理月份为04这样的情况
if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1))
} else {
month = parseInt(dateArr[1])
}
var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day)
return date
}
util.getDay = function(num, str = '-') {
var today = new Date()
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
export default util
<template>
<div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<div class="header-text">已激活列表</div>
<div>
<el-button class="table-btn" @click="handleSync" :size="size" type="primary" plain mode="el-button">企微接入授权</el-button>
</div>
</div>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'collocation',
data() {
return {
url,
searchForm: {
belongWechat: '',
staffName: '',
telphone: '',
status: ''
},
searchFormData: [
{
label: '所属企微',
name: 'belongWechat',
type: 'input',
isClear: true
},
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true
},
{
label: '手机号码',
name: 'telphone',
type: 'input',
isClear: true
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '是',
value: 1
},
{
label: '否',
value: 0
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
}
],
tableParams: {
listName: 'list',
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工企微号',
prop: 'staffNum'
},
{
label: '手机号码',
prop: 'telphone'
},
{
label: '所属门店',
prop: 'belongStore'
},
{
label: '所属企微',
prop: 'belongWechat'
},
{
label: '最后同步时间',
prop: 'time'
},
{
label: '状态',
prop: 'status'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
// getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage,
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
}
</style>
<template>
<div>
<GLDialog :bigTitle="'人群筛选'" mode="big" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<!-- <div class="member-name">人群({{ innerTags.length }}项)</div> -->
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
data() {
return {
url: 0,
crowdVisible: false,
searchForm: { keyword: '' },
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
console.log(this.$refs.crowdTable, '==')
this.$nextTick(() => {
console.log(this.$refs.crowdTable, '==')
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
getCrowdList(page = { pageNum: 1, pageSize: 10 }) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.customerTransform.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({ pageNum: 1, pageSize: 10 })
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = { keyword: {} }
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: calc(100% - 286px);
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
.el-pagination {
margin-top: 0;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 480px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
font-size: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template>
<div>
<GLDialog :mode="'big'" class="gl-form-min" bigTitle="选择门店" :visible.sync="storeDiaVisible" @close="clearStaff">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="门店名称:">
<el-input v-model="searchForm.storeName" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label="门店编号:">
<el-input v-model="searchForm.storeNum" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" class="gap8" @click="findNotActiveStaff">查询</el-button>
<el-button plain :size="size" class="btn-three" @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">员工列表</div>
<div class="member-content">
<div class="table-content" style="max-height: 456px;">
<GLTable :hasPage="false" v-loading="loading" ref="activateTable" :tableData="tableActiveData" :tableParams="tableParams" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="openJoinStatusString" class="dot" slot-scope="scope">
<div :class="status[scope.scope.openJoinStatusString]"></div>
<span v-if="scope.scope.openJoinStatusString == '未开启'">未开启</span>
<span v-if="scope.scope.openJoinStatusString == '已开启'">已开启</span>
<span v-if="scope.scope.openJoinStatusString == '未授权'">未授权</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选列表</div>
<div class="member-context">
<div class="member-name">已选({{ innerTags.length }}项)</div>
<el-button type="text" @click="clearStaff">清空</el-button>
</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="tag in innerTags" :key="tag.userId" type="info" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="closeDia">取 消</el-button>
<el-button size="small" type="primary" @click="activeStaff" :loading="butLoading">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
const status = {
未开启: 'dot3',
已开启: 'dot2',
未授权: 'dot3'
}
const options = [
{
value: 0,
label: '未开启'
},
{
value: 1,
label: '已开启'
},
{
value: 2,
label: '未授权'
}
]
export default {
name: 'ActivateDia',
props: ['selectData'],
data() {
return {
url: url,
butLoading: false,
searchForm: {
storeName: '',
storeNum: ''
},
checked: '',
treeData: [],
options: options,
status,
storeDiaVisible: false,
defaultProps: {
children: 'children',
label: 'departmentName'
},
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '启用状态',
prop: 'openJoinStatusString',
addHtml: 'openJoinStatusString'
}
]
},
// 未激活员工表信息
tableActiveData: [],
innerTags: [],
// 账号信息
activeInfo: {}
}
},
mounted() {},
methods: {
init(row) {
this.activeInfo = row
this.storeDiaVisible = true
this.findNotActiveStaff()
},
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {
storeName: '',
storeNum: ''
}
this.findNotActiveStaff()
},
findNotActiveStaff() {
const { corpId, merchantId } = this.activeInfo
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
corpId,
merchantId
}
this.loading = true
this.$apis.accountConfig.findNotActiveStaff(params).then(res => {
if (res.code == 0) {
this.tableActiveData = res.data
this.loading = false
} else {
this.loading = false
this.$message({
message: res.message,
type: 'error',
customClass: 'global-messageZindex'
})
}
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
remove(item) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
// 激活员工
activeStaff() {
if (!this.innerTags.length) {
this.$message({
message: '未选中员工,无法激活',
type: 'error',
customClass: 'global-messageZindex'
})
return
}
var userIdList = []
this.innerTags.forEach(item => {
userIdList.push(item.userId)
})
const { merchantId, corpId } = this.activeInfo
var params = {
corpId,
merchantId,
userIdList
}
this.butLoading = true
this.$apis.accountConfig.activeAccount(params).then(res => {
if (res.code == '0') {
this.butLoading = false
this.storeDiaVisible = false
var txt = '<p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>'
this.$confirm(txt, '提示', {
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
showCancelButton: false,
confirmButtonClass: 'confirmbtn',
type: 'success',
customClass: 'gl-message-box confirm-btn',
callback: action => {
if (res.data && res.data > 0) {
this.$emit('activeStaff')
}
}
})
} else {
this.butLoading = false
this.$message.error(res.message)
}
})
},
// 清空右侧选择员工
clearStaff() {
this.$refs.activateTable.$refs.salelistMutiTable.clearSelection()
this.innerTags = []
},
// 关闭弹窗
closeDia() {
this.clearStaff()
this.storeDiaVisible = false
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
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-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 400;
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-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 30%;
margin-left: 14px;
.member-context {
display: flex;
justify-content: space-between;
padding: 11px 8px 11px 16px;
border: 1px solid #eee;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
}
.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% - 72px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
/deep/ .el-tag--info {
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
.global-messageZindex {
z-index: 3000 !important;
}
</style>
<template>
<div class="container">
<div>
<el-button @click="addSendGroup" :size="size" type="primary" mode="el-button">新建群发</el-button>
</div>
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="groupTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'collocation',
data() {
return {
url,
searchForm: {
sendName: '',
sendTime: '',
store: ''
},
searchFormData: [
{
label: '群发名称',
name: 'sendName',
type: 'input',
isClear: true
},
{
label: '群发时间',
name: 'sendTime',
type: 'datePicker',
isClear: true
},
{
label: '群发门店',
name: 'store',
type: 'input',
isClear: true
}
],
tableParams: {
listName: 'list',
tableColumns: [
{
label: '群发名称',
prop: 'sendName'
},
{
label: '群发门店',
prop: 'senaStore'
},
{
label: '客户数',
prop: 'customerNum'
},
{
label: '标签/人群',
prop: 'tag'
},
{
label: '创建时间',
prop: 'creatTime'
},
{
label: '发送状态',
prop: 'sendStatus'
},
{
label: '完成情况(失败/成功)',
prop: 'finish',
width: '200'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
// getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage,
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
},
// 跳转新建群发
addSendGroup() {
this.$router.push('/wechatGroup/addWechatGroup')
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!