Commit ef3cf413 by 前端

Merge branch 'littlexu_dev_v3.5.0' into 'v3.5.0'

更新企微接入3.5.0代码

See merge request !57
2 parents 03c5a789 1dd47b7d
...@@ -32,8 +32,30 @@ const wechatDepositList = params => { ...@@ -32,8 +32,30 @@ const wechatDepositList = params => {
sign: true sign: true
}) })
} }
const wechatDepositNotAccessList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositNotAccessList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getStaffFriends = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getStaffFriends'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getLoginQcCode, getLoginQcCode,
getQcCodeDetail, getQcCodeDetail,
wechatDepositList wechatDepositList,
wechatDepositNotAccessList,
getStaffFriends
} }
import { http, http2 } 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'
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree' params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({ return http({
url: '/rop-scrm-datahub/router', url: '/rop-scrm-datahub/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const queryCrowdtree = params => { const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree' params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({ return http({
url: 'rop-scrm-datahub/router', url: 'rop-scrm-datahub/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const batchmessagingRecord = params => { const batchmessagingRecord = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
// 企微群发查看预计群发人数 // 企微群发查看预计群发人数
const batchmessagingCustomercount = params => { const batchmessagingCustomercount = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
// 企微群发任务创建 // 企微群发任务创建
const atchmessagingCreate = params => { const atchmessagingCreate = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true, sign: true,
returnAll:true returnAll: true
}) })
} }
const getStoreList = params => { const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const recordSend = params => { const recordSend = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record.send' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record.send'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const sendStop = params => { const sendStop = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.send.stop' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.send.stop'
return http({ return http({
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true, sign: true,
returnAll:true returnAll: true
}) })
} }
// 获取可选跟进员工
export default { export default {
querylabeltree, querylabeltree,
queryCrowdtree, queryCrowdtree,
batchmessagingRecord, batchmessagingRecord,
batchmessagingCustomercount, batchmessagingCustomercount,
atchmessagingCreate, atchmessagingCreate,
getStoreList, getStoreList,
recordSend, recordSend,
sendStop sendStop,
} }
<template>
<div>
<GLDialog :bigTitle="'选择客户'" mode="big" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<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-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="member-title">
员工列表
</div>
<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">
<div class="numberOfSelected">
<span class="selected">已选</span>
{{ innerTags.length }}人
</div>
<span class="empty" @click="clearTheSelectedList">清空</span>
</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.nickname }}
</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',
props: {
resetMerchantId: {
type: String,
default: ''
}
},
data() {
return {
url: 0,
initId:'',
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: 'nickname'
},
{
label: '手机号',
prop: 'mobile',
width: '200',
line: 1
}
]
}
}
},
methods: {
clearTheSelectedList() {
this.$refs.crowdTable.clearMutiSelect()
},
init(val,userId) {
console.log(userId)
this.initId = userId
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList( {pageNum: 1, pageSize: 10})
})
},
getCrowdList(page = {pageNum: 1, pageSize: 10}) {
console.log(this.initId)
this.$refs.crowdTable.page = page
var params = {
pageSize: page.pageSize,
pageNum: page.pageNum,
userId:this.initId
}
this.$apis.collocation.getStaffFriends(params).then(res => {
console.log(res)
this.tableData = res && res.data
this.tableTotal = res && res.count
// 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.userId == item.userId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.userId == item.userId) == '-1' && this.innerTags.findIndex(k => k.userId == item.userId) == '-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.userId == row.userId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
console.log(this.$refs.crowdTable.mutiSelectArr)
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.userId == item.userId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.userId == row.userId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.userId == item.userId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.userId).includes(item.userId)) {
var i = this.tableData.findIndex(k => k.userId == item.userId)
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('customerData', 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;
display: flex;
justify-content: space-between;
.numberOfSelected {
.selected {
font-size: 16px;
}
}
.empty {
color: #5850FF;
}
}
}
}
.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: 100%;
display: flex;
align-items: center;
max-height: 557px;
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 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>
<GLTable :hasNum="false" v-if="dialogVisible" @refreshTable="handleSearch" ref="table" :layout="layout"
:tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div slot="options" slot-scope="scope">
<el-radio :label="scope.scope.idBefEncryption" v-model="selectId"></el-radio>
</div>
</GLTable>
<span slot="footer" class="dialog-footer">
<el-button plain 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: 'SelectEmployees ',
data() {
return {
selectId: null,
// loading: false,
dialogVisible: false,
tableSearchForm: {},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'data',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
tableColumns: [
{
label: '',
prop: '',
addHtml: 'options'
},
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '企业微信',
prop: 'entmicroName'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
selectEmp: [],
typeselect: '',
selectUuid: ''
}
},
methods: {
selectableStaff() {
let params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum,
loginStatus: 1
}
this.$apis.collocation.wechatDepositNotAccessList(params).then(res => {
this.tableData = res.data ? res.data : []
this.tableTotal = res.count
})
},
init() {
this.tableSearchForm = {}
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.table.page.pageNum = 1
this.selectableStaff()
})
},
handleSearch() {
this.selectableStaff()
},
handleClose() {
this.handleCancel()
},
handleCancel: utils.debounce(function () {
this.dialogVisible = false
}, 300),
handleSelect: utils.debounce(function () {
if (!this.selectId) {
this.$message.error('请选择发送人')
return
}
let list = this.tableData.filter(item => {
return item['idBefEncryption'] == this.selectId
})
console.log(list[0])
let selectEmp = {
staffName: list[0].staffName,
staffCloudIdList: list[0].idBefEncryption,
staffId: list[0].id
}
this.dialogVisible = false
this.$emit('selectSender', selectEmp)
}, 300)
}
}
</script>
<style lang="scss" scoped>
/deep/ .glsx-table .emptyBg .noDataImg {
margin-top: 150px !important;
}
/deep/ .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none;
}
/deep/ .el-radio__label {
display: none;
}
.dialog-jump {
color: #5850ff;
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;
}
}
}
</style>
...@@ -167,6 +167,7 @@ export default { ...@@ -167,6 +167,7 @@ export default {
// 恢复选择 // 恢复选择
addSelected() { addSelected() {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.innerTags)
var list = JSON.parse(JSON.stringify(this.innerTags)) var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) { if (list && list.length) {
list.forEach(row => { list.forEach(row => {
......
...@@ -3,6 +3,7 @@ import * as dayjs from "dayjs"; ...@@ -3,6 +3,7 @@ import * as dayjs from "dayjs";
export default { export default {
data() { data() {
return { return {
selectSenderList:null,
groupNumber: 0, groupNumber: 0,
viewLoading: false, viewLoading: false,
isUpdate: true, isUpdate: true,
...@@ -39,6 +40,26 @@ export default { ...@@ -39,6 +40,26 @@ export default {
} }
}, },
methods: { methods: {
getCustomerData(val) {
this.basicForm.customerList = val
},
selectSender(list) {
this.selectSenderList = list
this.basicForm.staffCloudIdList.push(list.staffCloudIdList)
},
// 客户筛选弹窗
selectCustomer() {
const {staffCloudIdList, customerList} = this.basicForm
console.log()
if (staffCloudIdList.length == 0) {
return this.$message({
type: 'error',
message: '请选择发送人'
})
}
let staffCloudIdListStr = staffCloudIdList[0].toString()
this.$refs.selectCustomer.init(customerList, staffCloudIdListStr)
},
// 返回 // 返回
handleCancel(path) { handleCancel(path) {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) { if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
...@@ -152,24 +173,30 @@ export default { ...@@ -152,24 +173,30 @@ export default {
}) })
}, },
// 查看群发人数 // 查看群发人数
async viewMembers() { async viewMembers(managedType) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) { if (managedType == 1) {
return this.$message({ if (this.basicForm.selectType == '1' && !this.taggingList.length) {
type: 'error', return this.$message({
message: '请选择标签' type: 'error',
}) message: '请选择标签'
})
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
return this.$message({
type: 'error',
message: '请选择人群'
})
}
let params = this.getBaseInfo(managedType)
this.viewLoading = true
await this.getTheNumberOfPeople(params)
this.isUpdate = false
this.viewLoading = false
} }
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) { if (managedType ==2) {
return this.$message({ this.groupNumber = this.basicForm.customerList.length
type: 'error', this.isUpdate = false
message: '请选择人群'
})
} }
let params = this.getBaseInfo()
this.viewLoading = true
await this.getTheNumberOfPeople(params)
this.isUpdate = false
this.viewLoading = false
}, },
// 发送时间change事件 // 发送时间change事件
changeValue(v) { changeValue(v) {
...@@ -186,23 +213,40 @@ export default { ...@@ -186,23 +213,40 @@ export default {
} }
} }
}, },
getBaseInfo() { getBaseInfo(managedType) {
let params = { let params = {}
customerType: this.basicForm.selectType, if (managedType == 1){
msgName: this.basicForm.groupName, params = {
msgMerchantId: this.basicForm.selectStore ? this.basicForm.selectStore : this.basicForm.taskMerchantId, customerType: this.basicForm.selectType,
msgMerchantName: this.msgMerchantName msgName: this.basicForm.groupName,
} msgMerchantId: this.basicForm.selectStore ? this.basicForm.selectStore : this.basicForm.taskMerchantId,
const combineType = { msgMerchantName: this.msgMerchantName
label: 2, }
crowd: 1 const combineType = {
label: 2,
crowd: 1
}
if (params.customerType == 1) {
params.combineType = combineType.label
params.labelList = this.taggingList
} else if (params.customerType == 2) {
params.crowdList = this.basicForm.crowdList
params.combineType = combineType.crowd
}
} }
if (params.customerType == 1) { if (managedType == 2){
params.combineType = combineType.label let customerCloudIdList = []
params.labelList = this.taggingList let staffCloudIdList = []
} else if (params.customerType == 2) { this.basicForm.customerList.forEach(item => {
params.crowdList = this.basicForm.crowdList customerCloudIdList.push(item.userId)
params.combineType = combineType.crowd })
staffCloudIdList.push(this.basicForm.staffCloudIdList[0])
params = {
customerType: 3,
msgName: this.basicForm.groupName,
staffCloudIdList,
customerCloudIdList
}
} }
return params return params
}, },
...@@ -217,6 +261,21 @@ export default { ...@@ -217,6 +261,21 @@ export default {
} }
this.$refs.selectCrowd.init(this.basicForm.crowdList) this.$refs.selectCrowd.init(this.basicForm.crowdList)
}, },
// getCustomerData(val) {
// console.log(val)
// this.isUpdate = true
// if (val.length) {
// this.isSelectCustomer = true
// this.basicForm.customerList = val
// } else {
// this.basicForm.userList = []
// this.basicForm.customerList = []
// this.selectData = []
// this.isSelectCustomer = false
// this.editStatus = true
// this.key = new Date()
// }
// },
// 获取人群数据(根据人群筛选获取群发账号人群数据) // 获取人群数据(根据人群筛选获取群发账号人群数据)
getCrowdData(val) { getCrowdData(val) {
this.isUpdate = true this.isUpdate = true
...@@ -244,5 +303,10 @@ export default { ...@@ -244,5 +303,10 @@ export default {
} }
this.key = new Date() this.key = new Date()
}, },
removeCustomer(item, index) {
this.basicForm.customerList.splice(index, 1)
this.getCustomerData(this.basicForm.customerList)
this.key = new Date()
},
} }
} }
<template> <template>
<div class="container"> <div>
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" <div>
@handleRest="handleReset"></GLCombiForm> <el-tabs v-model="activeNameHostingList" @tab-click="handleClick">
<div class="table-header"> <el-tab-pane label="已接入SCRM托管列表" name="first"></el-tab-pane>
<div class="header-text">已激活列表</div> <el-tab-pane label="非SCRM托管列表" name="second"></el-tab-pane>
<div> </el-tabs>
<el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" plain mode="el-button"> <el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" mode="el-button">
企微接入授权 <div class="enterpriseMicroLogin">
</el-button> <img src="@/assets/enterpriseMicroLogin.png">
</div> <p> 企微登录</p>
</div>
</el-button>
</div> </div>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" <div class="container">
:tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch"
<div slot="staffName" slot-scope="scope"> @handleRest="handleReset"></GLCombiForm>
<div class="staffName"> <!-- <div class="table-header">-->
<span>{{ scope.scope.staffName }}</span> <!-- <div class="header-text">已激活列表</div>-->
<span class="entmicroName" v-if="scope.scope.entmicroName">@{{ scope.scope.entmicroName }}</span> <!-- <div>-->
<!-- <el-button class="table-btn" @click="handleqrCode" :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">
<div slot="staffName" slot-scope="scope">
<div class="staffName">
<span>{{ scope.scope.staffName }}</span>
<span class="entmicroName" v-if="scope.scope.entmicroName">@{{ scope.scope.entmicroName }}</span>
</div>
</div> </div>
</div> <div slot="loginStatus" slot-scope="scope">
<div slot="loginStatus" slot-scope="scope"> <div class="loginStatus">
<div class="loginStatus">
<span class="cycle" <span class="cycle"
:style="{ background: scope.scope.loginStatus == '1' ? '#2CCA74' : scope.scope.loginStatus == '0' ? '#999999' : '' }"></span> :style="{ background: scope.scope.loginStatus == '1' ? '#2CCA74' : scope.scope.loginStatus == '0' ? '#999999' : '' }"></span>
{{ scope.scope.loginStatus == '1' ? '在线' : scope.scope.loginStatus == '0' ? '离线' : '--' }} {{ scope.scope.loginStatus == '1' ? '在线' : scope.scope.loginStatus == '0' ? '离线' : '--' }}
</div>
</div>
</GLTable>
<GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible">
<div v-loading="addLoading" class="qrIMGbox">
<img class="qrIMG" :src="qrcodeUrl"/>
</div> </div>
</div> <span slot="footer" class="dialog-footer">
</GLTable>
<GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible">
<div v-loading="addLoading" class="qrIMGbox">
<img class="qrIMG" :src="qrcodeUrl"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" disabled v-if="!show" class="count">{{ count }} s</el-button> <el-button size="small" disabled v-if="!show" class="count">{{ count }} s</el-button>
<el-button type="primary" size="small" v-if="show" @click="getCode">刷新</el-button> <el-button type="primary" size="small" v-if="show" @click="getCode">刷新</el-button>
</span> </span>
</GLDialog> </GLDialog>
</div>
</div> </div>
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import setPromiseInterval, { clearPromiseInterval } from 'set-promise-interval' import setPromiseInterval, {clearPromiseInterval} from 'set-promise-interval'
import {utils} from 'glsx-common' import {utils} from 'glsx-common'
...@@ -49,6 +64,7 @@ export default { ...@@ -49,6 +64,7 @@ export default {
data() { data() {
return { return {
url, url,
activeNameHostingList: 'first',
show: true, show: true,
count: '', count: '',
timer: null, timer: null,
...@@ -136,10 +152,14 @@ export default { ...@@ -136,10 +152,14 @@ export default {
} }
] ]
}, },
tableColumnsCopy: [],
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'}, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'},
getListApi: this.$apis.collocation.wechatDepositList getListApi: this.$apis.collocation.wechatDepositList
} }
}, },
created() {
this.tableColumnsCopy = this.tableParams.tableColumns.slice()
},
methods: { methods: {
handleSearch() { handleSearch() {
this.$refs.activeTable.refreshTable() this.$refs.activeTable.refreshTable()
...@@ -228,12 +248,25 @@ export default { ...@@ -228,12 +248,25 @@ export default {
} else { } else {
this.clearAllInterval() this.clearAllInterval()
} }
},
activeNameHostingList(val) {
let secondTableColumns = this.tableColumnsCopy.filter(item => item.label !== '所属门店')
this.tableParams.tableColumns = val == 'first' ? this.tableColumnsCopy : secondTableColumns
this.getListApi = val == 'first' ? this.$apis.collocation.wechatDepositList : this.$apis.collocation.wechatDepositNotAccessList
this.handleSearch()
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.enterpriseMicroLogin{
display: flex;
align-items: center;
img{
margin-right: 8px;
}
}
/deep/ { /deep/ {
.el-table th > .cell { .el-table th > .cell {
padding: 0 16px; padding: 0 16px;
...@@ -241,6 +274,7 @@ export default { ...@@ -241,6 +274,7 @@ export default {
} }
.container { .container {
margin-top: 16px;
padding: 20px; padding: 20px;
background-color: #fff; background-color: #fff;
......
...@@ -8,80 +8,142 @@ ...@@ -8,80 +8,142 @@
<el-form-item prop="taskName" label="群发名称:" size="small"> <el-form-item prop="taskName" label="群发名称:" size="small">
<el-input v-model="basicForm.taskName" placeholder="请输入群发名称"></el-input> <el-input v-model="basicForm.taskName" placeholder="请输入群发名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="taskMerchantId" label="选择门店:" size="small"> <el-form-item label="托管类型:" prop="managedType">
<el-select filterable v-model="basicForm.taskMerchantId" placeholder="请选择门店"> <el-radio-group v-model="basicForm.managedType">
<el-option v-for="item in optionsMe" :key="item.msgMerchantId" :label="item.msgMerchantName" <el-radio :label="1">已接入门店</el-radio>
:value="item.msgMerchantId"></el-option> <el-radio :label="2">未接入门店</el-radio>
</el-select>
</el-form-item>
<el-form-item prop="userList">
<label slot="label" class="required">选择员工:</label>
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择员工
</el-button>
<div class="sale-select" v-show="basicForm.staffUserList && basicForm.staffUserList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.staffUserList" :key="idx" closable
:disable-transitions="false" @close="remove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
<div v-show="empErrorShow" class="el-form-item__error">请选择员工</div>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="0">全部客户</el-radio>
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="basicForm.selectType == 1"> </el-form-item>
<div class="selectedLabel"> <template v-if="basicForm.managedType == 1">
<el-button size="small" @click="openLabel('taskMerchantId')"> <el-form-item prop="taskMerchantId" label="选择门店:" size="small">
<i class="el-icon-plus"></i> <el-select filterable v-model="basicForm.taskMerchantId" placeholder="请选择门店">
选择标签 <el-option v-for="item in optionsMe" :key="item.msgMerchantId" :label="item.msgMerchantName"
</el-button> :value="item.msgMerchantId"></el-option>
<div class="selectLen" v-show="taggingList.length != 0"> </el-select>
(已选 </el-form-item>
<span class="num">{{ taggingList.length }}</span> <el-form-item prop="userList">
个标签) <label slot="label" class="required">选择员工:</label>
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择员工
</el-button>
<div class="sale-select" v-show="basicForm.staffUserList && basicForm.staffUserList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.staffUserList" :key="idx" closable
:disable-transitions="false" @close="remove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div> </div>
</div> </div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper"> <div v-show="empErrorShow" class="el-form-item__error">请选择员工</div>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="0">全部客户</el-radio>
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group>
<div v-show="basicForm.selectType == 1">
<div class="selectedLabel">
<el-button size="small" @click="openLabel('taskMerchantId')">
<i class="el-icon-plus"></i>
选择标签
</el-button>
<div class="selectLen" v-show="taggingList.length != 0">
(已选
<span class="num">{{ taggingList.length }}</span>
个标签)
</div>
</div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx"> <span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable <el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable
:disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{
tagItem.name tagItem.name
}}</el-tag> }}</el-tag>
</span> </span>
</div>
</div> </div>
</div> <div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px"> <el-button :size="size" icon="el-icon-plus" @click="selectCrowd('taskMerchantId')">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd('taskMerchantId')"> {{ isSelectCrowd ? '继续选择' : '选择人群' }}
{{ isSelectCrowd ? '继续选择' : '选择人群' }} </el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable
:disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
</div>
</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips">
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。
</div>
<div class="filter-footer" v-show="basicForm.selectType !== 0">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading"
@click="viewMembers(basicForm.managedType)">查看
</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
</el-form-item>
</template>
<template v-if="basicForm.managedType == 2">
<el-form-item prop="userList">
<label slot="label" class="required">选择发送人:</label>
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择发送人
</el-button> </el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0"> <div class="sale-select" v-show="selectSenderList && selectSenderList.staffName">
<div class="el-input-tag input-tag-wrapper"> <div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable <el-tag effect="plain" type="info"
:disable-transitions="false" @close="removeCrowd(t, i)"> closable
{{ t.crowdName }} :disable-transitions="false" @close="selectSenderList = null">
<i class="el-icon-user-solid"></i>
{{ selectSenderList.staffName }}
</el-tag> </el-tag>
</div> </div>
</div> </div>
</div> <div v-show="empErrorShowExpediter" class="el-form-item__error">请选择发送人</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips"> </el-form-item>
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。 <el-form-item label="选择客户:" prop="selectType">
</div> <el-radio-group @change="radioChange" v-model="basicForm.selectType">
<div class="filter-footer" v-show="basicForm.selectType !== 0"> <el-radio :label="0">全部客户</el-radio>
<div class="filter-number"> <el-radio :label="1">指定客户</el-radio>
预计群发人数 </el-radio-group>
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button> <div v-show="basicForm.selectType == 1" style="line-height: 32px; padding-bottom: 10px">
<span v-show="!isUpdate">{{ groupNumber }}</span> <el-button :size="size" icon="el-icon-plus" @click="selectCustomer">
{{ isSelectCustomer ? '继续选择' : '选择客户' }}
</el-button>
<div class="sale-select" v-show="basicForm.customerList && basicForm.customerList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.customerList" :key="i" closable
:disable-transitions="false" @close="removeCustomer(t, i)">
{{ t.nickname }}
</el-tag>
</div>
</div>
<div v-show="empErrorShowCustomer" class="el-form-item__error">请选择客户</div>
</div> </div>
</div> <div v-show="basicForm.selectType == 2" class="crowd-tips">
</el-form-item> 人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。
</div>
<div class="filter-footer" v-show="basicForm.selectType !== 0">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading"
@click="viewMembers(basicForm.managedType)">查看
</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
</el-form-item>
</template>
<el-form-item prop="attachmentList" class="attachment-panel"> <el-form-item prop="attachmentList" class="attachment-panel">
<label slot="label" class="required">朋友圈内容:</label> <label slot="label" class="required">朋友圈内容:</label>
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor> <GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
...@@ -118,6 +180,9 @@ ...@@ -118,6 +180,9 @@
:dialogVisible="dialogVisible"></SelectLabel> :dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="basicForm.taskMerchantId" <SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="basicForm.taskMerchantId"
:selectCrowdData="basicForm.crowdList"></SelectCrowd> :selectCrowdData="basicForm.crowdList"></SelectCrowd>
<SelectEmployees ref="selectEmpForm" @selectSender="selectSender"></SelectEmployees>
<SelectCustomer ref="selectCustomer" @customerData="getCustomerData"
:selectCustomerData="basicForm.customerList"></SelectCustomer>
</div> </div>
</template> </template>
...@@ -137,6 +202,9 @@ import marketingGroup from '@/mixins/marketingGroup' ...@@ -137,6 +202,9 @@ import marketingGroup from '@/mixins/marketingGroup'
import SelectMember from './components/selectMember.vue' import SelectMember from './components/selectMember.vue'
import SelectCrowd from '@/components/selectCrowd/selectCrowd' import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel' import SelectLabel from '@/components/SelectLabel/SelectLabel'
import SelectEmployees from '@/components/SelectEmployees/index'
import SelectCustomer from '@/components/SelectCustomer/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
...@@ -144,7 +212,9 @@ export default { ...@@ -144,7 +212,9 @@ export default {
components: { components: {
SelectMember, SelectMember,
SelectLabel, SelectLabel,
SelectCrowd SelectCrowd,
SelectEmployees,
SelectCustomer
}, },
data() { data() {
const validatorSendType = (rule, value, callback) => { const validatorSendType = (rule, value, callback) => {
...@@ -166,7 +236,9 @@ export default { ...@@ -166,7 +236,9 @@ export default {
} }
return { return {
optionsMe: [], optionsMe: [],
msgMerchantName:'', empErrorShowExpediter: false,
empErrorShowCustomer: false,
msgMerchantName: '',
addLoading: false, addLoading: false,
taggingList: [], taggingList: [],
previewView: [], previewView: [],
...@@ -222,7 +294,10 @@ export default { ...@@ -222,7 +294,10 @@ export default {
sendTime: '', sendTime: '',
sendDate: '', sendDate: '',
selectType: 0, selectType: 0,
crowdList: [] crowdList: [],
managedType: 1,
customerList: [],
staffCloudIdList: []
}, },
attachmentShow: false, attachmentShow: false,
empErrorShow: false, empErrorShow: false,
...@@ -231,6 +306,7 @@ export default { ...@@ -231,6 +306,7 @@ export default {
taskMerchantId: [{required: true, message: '请选择门店', trigger: 'change'}], taskMerchantId: [{required: true, message: '请选择门店', trigger: 'change'}],
taskName: [{required: true, message: '请输入群发名称', trigger: 'blur'}], taskName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}], selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
managedType: [{required: true, message: '请选择托管类型', trigger: 'change'}],
sendType: [ sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'}, {required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'} {validator: validatorSendType, trigger: 'change'}
...@@ -251,13 +327,45 @@ export default { ...@@ -251,13 +327,45 @@ export default {
watch: { watch: {
'basicForm.staffUserList'() { 'basicForm.staffUserList'() {
this.empErrorShow = false this.empErrorShow = false
} },
'selectSenderList'(val) {
if (val.length > 0) {
this.empErrorShowExpediter = false
}
},
'basicForm.customerList'(val) {
if (val.length !== 0) {
this.empErrorShowCustomer = false
}
},
'basicForm.managedType'(newVal, oldVal) {
if (oldVal == 2 || newVal == 2) {
this.basicForm.taskMerchantId = '' //门店
this.basicForm.selectType = 0 //客户
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
this.isUpdate = true //查看
this.basicForm.staffCloudIdList = [] //发送人
this.selectSenderList = []
this.basicForm.customerList = [] //未接入门店客户
}
},
}, },
async mounted() { async mounted() {
const merchantList = await this.merchantList() const merchantList = await this.merchantList()
this.optionsMe = merchantList ? merchantList : [] this.optionsMe = merchantList ? merchantList : []
}, },
methods: { methods: {
handleAddEmp() {
this.$refs.selectEmpForm.init()
},
previewForm(val) { previewForm(val) {
this.previewView = val this.previewView = val
this.attachmentShow = false this.attachmentShow = false
...@@ -293,25 +401,35 @@ export default { ...@@ -293,25 +401,35 @@ export default {
} }
this.isUpdate = true this.isUpdate = true
}, },
handleSubmit: utils.debounce( function () { handleSubmit: utils.debounce(function () {
this.$refs.groupForm.validate( async valid => { this.$refs.groupForm.validate(async valid => {
if (valid) { if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) { if (this.basicForm.managedType == 1) {
this.$message({ if (this.basicForm.selectType == '1' && !this.taggingList.length) {
type: 'error', this.$message({
message: '请选择标签' type: 'error',
}) message: '请选择标签'
return })
return
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
this.$message({
type: 'error',
message: '请选择人群'
})
return
}
if (this.basicForm.staffUserList.length == 0) {
this.empErrorShow = true
return
}
} }
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) { if (this.basicForm.managedType == 2 && !this.selectSenderList) {
this.$message({ this.empErrorShowExpediter = true
type: 'error',
message: '请选择人群'
})
return return
} }
if (this.basicForm.staffUserList.length == 0) { if (this.basicForm.managedType == 2 && this.basicForm.selectType !== 0 && this.basicForm.customerList && this.basicForm.customerList.length == 0) {
this.empErrorShow = true this.empErrorShowCustomer = true
return return
} }
const previewList = this.$refs.welcome.previewList const previewList = this.$refs.welcome.previewList
...@@ -323,7 +441,7 @@ export default { ...@@ -323,7 +441,7 @@ export default {
if (previewList.length != 0) { if (previewList.length != 0) {
this.basicForm.attachmentList = previewList this.basicForm.attachmentList = previewList
} }
let staffIds = this.basicForm.staffUserList.map(item => { let staffIds = this.basicForm.staffUserList && this.basicForm.staffUserList.map(item => {
return item.staffId return item.staffId
}) })
let attachmentList = this.$refs.welcome.previewList let attachmentList = this.$refs.welcome.previewList
...@@ -345,40 +463,56 @@ export default { ...@@ -345,40 +463,56 @@ export default {
if (material.length > 1) { if (material.length > 1) {
materialType = 2 materialType = 2
} }
const {taskName, taskMerchantId, sendType} = this.basicForm const {taskName, taskMerchantId, sendType, managedType} = this.basicForm
const taskMerchantName = this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName const taskMerchantName = managedType == 1 && this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName
let peopleParams = this.getBaseInfo() let peopleParams = this.getBaseInfo(managedType)
if (this.basicForm.selectType != 0){ if (managedType == 1 && this.basicForm.selectType != 0) {
await this.getTheNumberOfPeople(peopleParams) await this.getTheNumberOfPeople(peopleParams)
} }
if (this.basicForm.selectType != 0 && this.groupNumber == 0) { if ((this.basicForm.selectType != 0 && this.groupNumber == 0 && managedType == 1) || (managedType == 2 && this.basicForm.customerList && this.basicForm.customerList.length == 0)) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '群发人数为0!' message: '群发人数为0!'
}) })
return return
} }
let params = { let params = {}
materialType, if (managedType == 1) {
attachmentList, params = {
staffIds, materialType,
taskName, attachmentList,
taskMerchantName, staffIds,
taskMerchantId, taskName,
sendType taskMerchantName,
} taskMerchantId,
const combineType = { sendType
label: 2, }
crowd: 1 const combineType = {
label: 2,
crowd: 1
}
params.customerType = peopleParams.customerType
if (params.customerType == 1) {
params.combineType = combineType.label
params.labelList = this.taggingList
} else if (params.customerType == 2) {
params.crowdList = this.basicForm.crowdList
params.combineType = combineType.crowd
}
} }
params.customerType = peopleParams.customerType if (managedType == 2) {
let storeParametersAreNotConnected = this.getBaseInfo(managedType)
if (params.customerType == 1) { let {customerType, customerCloudIdList} = storeParametersAreNotConnected
params.combineType = combineType.label params = {
params.labelList = this.taggingList materialType,
} else if (params.customerType == 2) { attachmentList,
params.crowdList = this.basicForm.crowdList taskName,
params.combineType = combineType.crowd sendType,
customerType,
customerCloudIdList,
staffIds: this.selectSenderList.staffId
}
} }
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTime = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTime = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
......
...@@ -9,65 +9,109 @@ ...@@ -9,65 +9,109 @@
<el-form-item label="群发名称:" prop="groupName"> <el-form-item label="群发名称:" prop="groupName">
<el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input> <el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect"> <el-form-item label="托管类型:" prop="managedType">
<el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore" <el-radio-group v-model="basicForm.managedType">
placeholder="请选择门店" @change="selectChange"> <el-radio :label="1">已接入门店</el-radio>
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" <el-radio :label="2">未接入门店</el-radio>
:value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="basicForm.selectType == 1"> </el-form-item>
<div class="selectedLabel"> <template v-if="basicForm.managedType == 1">
<el-button size="small" @click="openLabel('selectStore')"> <el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<i class="el-icon-plus"></i> <el-select clearable filterable v-model="basicForm.selectStore"
选择标签 placeholder="请选择门店" @change="selectChange">
</el-button> <el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName"
<div class="selectLen" v-show="taggingList.length != 0"> :value="item.msgMerchantId"></el-option>
(已选 </el-select>
<span class="num">{{ taggingList.length }}</span> </el-form-item>
个标签) <el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group>
<div v-show="basicForm.selectType == 1">
<div class="selectedLabel">
<el-button size="small" @click="openLabel('selectStore')">
<i class="el-icon-plus"></i>
选择标签
</el-button>
<div class="selectLen" v-show="taggingList.length != 0">
(已选
<span class="num">{{ taggingList.length }}</span>
个标签)
</div>
</div> </div>
</div> <div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx"> <span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable <el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable
:disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{
tagItem.name tagItem.name
}}</el-tag> }}</el-tag>
</span> </span>
</div>
</div>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd('selectStore')">
{{ isSelectCrowd ? '继续选择' : '选择人群' }}
</el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable
:disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
</div>
</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips">
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。
</div> </div>
</div> </el-form-item>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px"> </template>
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd('selectStore')"> <template v-if="basicForm.managedType == 2">
{{ isSelectCrowd ? '继续选择' : '选择人群' }} <el-form-item prop="userList">
<label slot="label" class="required">选择发送人:</label>
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
选择发送人
</el-button> </el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0"> <div class="sale-select" v-show="selectSenderList && selectSenderList.staffName">
<div class="el-input-tag input-tag-wrapper"> <div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable <el-tag effect="plain" type="info"
:disable-transitions="false" @close="removeCrowd(t, i)"> closable
{{ t.crowdName }} :disable-transitions="false" @close="selectSenderList = null">
<i class="el-icon-user-solid"></i>
{{ selectSenderList.staffName }}
</el-tag> </el-tag>
</div> </div>
</div> </div>
</div> <div v-show="empErrorShowExpediter" class="el-form-item__error">请选择发送人</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips"> </el-form-item>
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。 <el-form-item prop="userList">
</div> <label slot="label" class="required">选择客户:</label>
<div class="filter-footer"> <el-button :size="size" icon="el-icon-plus" @click="selectCustomer">
<div class="filter-number"> {{ isSelectCustomer ? '继续选择' : '选择客户' }}
预计群发人数 </el-button>
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看 <div class="sale-select" v-show="basicForm.customerList && basicForm.customerList.length != 0">
</el-button> <div class="el-input-tag input-tag-wrapper">
<span v-show="!isUpdate">{{ groupNumber }}</span> <el-tag effect="plain" type="info" v-for="(t, i) in basicForm.customerList" :key="i" closable
:disable-transitions="false" @close="removeCustomer(t, i)">
{{ t.nickname }}
</el-tag>
</div>
</div> </div>
</div> <div v-show="empErrorShowCustomer" class="el-form-item__error">请选择客户</div>
</el-form-item> </el-form-item>
</template>
</el-form> </el-form>
<div class="filter-footer">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading"
@click="viewMembers(basicForm.managedType)">查看
</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
<!-- 编辑入群欢迎语 --> <!-- 编辑入群欢迎语 -->
<div class="group-content"> <div class="group-content">
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="154px"> <el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="154px">
...@@ -106,6 +150,9 @@ ...@@ -106,6 +150,9 @@
:dialogVisible="dialogVisible"></SelectLabel> :dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId" <SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId"
:selectCrowdData="basicForm.crowdList"></SelectCrowd> :selectCrowdData="basicForm.crowdList"></SelectCrowd>
<SelectEmployees ref="selectEmpForm" @selectSender="selectSender"></SelectEmployees>
<SelectCustomer ref="selectCustomer" @customerData="getCustomerData"
:selectCustomerData="basicForm.customerList"></SelectCustomer>
</div> </div>
</template> </template>
<script> <script>
...@@ -116,16 +163,21 @@ const combineType = { ...@@ -116,16 +163,21 @@ const combineType = {
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import SelectCrowd from '@/components/selectCrowd/selectCrowd' import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel' import SelectLabel from '@/components/SelectLabel/SelectLabel'
import SelectEmployees from '@/components/SelectEmployees/index'
import SelectCustomer from '@/components/SelectCustomer/index'
import department from '@/mixins/department' import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup' import marketingGroup from '@/mixins/marketingGroup'
// import SearchDropDown from './components/searchDropDown/index' // import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
mixins: [department,marketingGroup], mixins: [department, marketingGroup],
components: { components: {
SelectLabel, SelectLabel,
SelectCrowd SelectCrowd,
SelectEmployees,
SelectCustomer
}, },
data() { data() {
const validatorSendType = (rule, value, callback) => { const validatorSendType = (rule, value, callback) => {
...@@ -148,6 +200,8 @@ export default { ...@@ -148,6 +200,8 @@ export default {
return { return {
resetMerchantId: '', resetMerchantId: '',
msgMerchantName: '', msgMerchantName: '',
empErrorShowExpediter: false,
empErrorShowCustomer: false,
// 新建按钮加载 // 新建按钮加载
addLoading: false, addLoading: false,
// 标签/人群筛选数组 // 标签/人群筛选数组
...@@ -265,6 +319,7 @@ export default { ...@@ -265,6 +319,7 @@ export default {
groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}], groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectStore: [{required: true, message: '请选择门店', trigger: 'change'}], selectStore: [{required: true, message: '请选择门店', trigger: 'change'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}], selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
managedType: [{required: true, message: '请选择托管类型', trigger: 'change'}],
sendType: [ sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'}, {required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'} {validator: validatorSendType, trigger: 'change'}
...@@ -274,10 +329,13 @@ export default { ...@@ -274,10 +329,13 @@ export default {
groupName: '', groupName: '',
selectStore: '', selectStore: '',
selectType: 1, selectType: 1,
sendType:1, sendType: 1,
crowdList: [], crowdList: [],
sendDate:'', customerList: [],
sendTime:'' sendDate: '',
sendTime: '',
managedType: 1,
staffCloudIdList: []
}, },
groupList: [], groupList: [],
selectData: [], selectData: [],
...@@ -291,6 +349,7 @@ export default { ...@@ -291,6 +349,7 @@ export default {
footerWidth: 500, footerWidth: 500,
viewLoading: false, viewLoading: false,
isSelectCrowd: false, isSelectCrowd: false,
isSelectCustomer: false,
dataItems: [] dataItems: []
} }
}, },
...@@ -299,24 +358,71 @@ export default { ...@@ -299,24 +358,71 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
const merchantList = await this.merchantList() const merchantList = await this.merchantList()
this.dataItems = merchantList ? merchantList : [] this.dataItems = merchantList ? merchantList : []
this.backupCopybtnList = this.btnList.slice()
},
watch: {
'basicForm.managedType'(newVal, oldVal) {
let unconnectedbtnList = this.backupCopybtnList.filter(item => item.name !== '活动' && item.name !== '素材' && item.name !== '模板')
this.btnList = newVal == '1' ? this.backupCopybtnList : unconnectedbtnList
if (oldVal == 2 || newVal == 2) {
this.basicForm.selectStore = '' //门店
this.basicForm.selectType = 1 //客户
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
this.isUpdate = true //查看
this.basicForm.staffCloudIdList = [] //发送人
this.selectSenderList = []
this.basicForm.customerList = [] //未接入门店客户
}
},
'selectSenderList'(val) {
if (val.length > 0) {
this.empErrorShowExpediter = false
}
},
'basicForm.customerList'(val) {
if (val.length !== 0) {
this.empErrorShowCustomer = false
}
}
}, },
methods: { methods: {
// 提交
handleAddEmp() {
this.$refs.selectEmpForm.init()
},
async handleSubmit() { async handleSubmit() {
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) { if (this.basicForm.managedType == 1) {
this.$message({ if (this.basicForm.selectType == '1' && !this.taggingList.length) {
type: 'error', this.$message({
message: '请选择标签' type: 'error',
}) message: '请选择标签'
})
return
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
this.$message({
type: 'error',
message: '请选择人群'
})
return
}
}
if (this.basicForm.managedType == 2 && !this.selectSenderList) {
this.empErrorShowExpediter = true
return return
} }
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) { if (this.basicForm.managedType == 2 && this.basicForm.selectType !== 0 && this.basicForm.customerList && this.basicForm.customerList.length == 0) {
this.$message({ this.empErrorShowCustomer = true
type: 'error',
message: '请选择人群'
})
return return
} }
this.attachmentShow = true this.attachmentShow = true
...@@ -336,9 +442,13 @@ export default { ...@@ -336,9 +442,13 @@ export default {
} }
this.$refs.groupForm.validate(async v => { this.$refs.groupForm.validate(async v => {
if (v) { if (v) {
let params = this.getBaseInfo() let params = this.getBaseInfo(this.basicForm.managedType)
await this.getTheNumberOfPeople(params) if (this.basicForm.managedType == 1) {
if (this.groupNumber == 0) {
await this.getTheNumberOfPeople(params)
}
console.log(params)
if ((this.basicForm.managedType == 1 && this.groupNumber == 0) || (this.basicForm.managedType == 2 && this.basicForm.customerList.length == 0)) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '群发人数为0!' message: '群发人数为0!'
...@@ -372,18 +482,10 @@ export default { ...@@ -372,18 +482,10 @@ export default {
params.contentList = contentList params.contentList = contentList
this.addLoading = true this.addLoading = true
await this.$apis.wechatGroup.atchmessagingCreate(params).then(res => { await this.$apis.wechatGroup.atchmessagingCreate(params).then(res => {
if (res.code == 0) { this.$message({
this.$message({ type: res.code == 0 ? 'success' : 'error',
type: 'success', message: res.code == 0 ? '操作成功!' : ' res.message'
message: '操作成功!' })
})
// this.$tracker.track(Object.assign({}, { pageName: '群发助手', name: '新建客户群发', params }))
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false this.addLoading = false
this.$router.push('/wechatGroup/index') this.$router.push('/wechatGroup/index')
}) })
...@@ -437,6 +539,9 @@ export default { ...@@ -437,6 +539,9 @@ export default {
//} //}
.filter-footer { .filter-footer {
display: flex; display: flex;
//margin-left: 152px;
//margin-bottom: 8px;
margin: -20px 0px 25px 174px;
// padding: 14px 20px; // padding: 14px 20px;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!