Commit b8e8d47a by 胡悦

提交群发

1 parent 77598813
import { http } from '@/main'
const path = 'org.ore.api.one.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerGroupList = params => {
params.type = 2
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 detail = params => {
params.type = 2
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const remindUserGroup = params => {
params.type = 2
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listRemindOperate = params => {
params.type = 2
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
params.method = 'datahub.api.label.querylabeltree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
customerList,
customerGroupList,
insert,
detail,
remindUserGroup,
listRemindOperate,
listDepartmentTree,
querylabeltree
}
......@@ -24,7 +24,7 @@ export async function start() {
// .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1]
// })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
......
......@@ -10,11 +10,19 @@
<el-form-item label="群聊名称" prop="groupName">
<el-input v-model="basicForm.groupName" placeholder="群发名称仅内部可见" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="选择群主" prop="groupName">
<el-form-item label="选择群主" prop="userList">
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
全部账号
</el-button>
<span>已选择{{ basicForm.userList.length }}人</span>
<div class="sale-select" v-show="basicForm.userList">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(tag, idx) in basicForm.userList" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
</div>
</div>
<div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div>
</el-form-item>
</el-form>
......@@ -41,7 +49,7 @@
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<glsx-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMembers ref="drawerForm" @closeDrawer="closeDrawer" @handSelectdEmp="handSelectdEmp"></SelectMembers>
<SelectMembers ref="membersForm"></SelectMembers>
</glsx-dialog>
</div>
</template>
......@@ -65,7 +73,8 @@ export default {
name: [{ required: true, message: '请输入组名', trigger: 'blur' }],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }]
},
membersVisible: false
membersVisible: false,
key: new Date()
}
},
// mounted() {
......@@ -80,6 +89,18 @@ export default {
},
handleCancel() {
this.$router.go(-1)
},
// 成员弹窗
handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
this.basicForm.userList = this.$refs.membersForm.innerTags
this.openMembers()
},
remove(val) {
console.log(val, '00000')
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.key = new Date()
}
}
}
......
......@@ -3,26 +3,30 @@
<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.type == 'text'">
<div class="preview-text text">{{ item.content }}</div>
<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.type == 'link'">
<template v-else-if="item.attType == 4">
<div class="preview-text preview-link">
{{ item.url }}
<img src="../../../assets/guestCustom/preview-link.png" alt="" />
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt="" />
</div>
</template>
<template v-else-if="item.type == 'img'">
<el-image style="width: 100px" :src="item.url" fit="contain"></el-image>
<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.type == 'applet'">
<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.appleIcon" alt="" />
<span>{{ item.title }}</span>
<img :src="item.attContent.picUrl" alt="" />
<span>{{ item.attContent.title }}</span>
</div>
{{ item.content }}
{{ item.attContent.page }}
</div>
</template>
</div>
......@@ -37,7 +41,6 @@ export default {
data() {
return {
previewList: [],
currentTime: ''
}
},
......@@ -48,7 +51,6 @@ export default {
})
},
mounted() {
console.log(1111, this.eventBus)
const date = new Date()
let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours
......@@ -90,10 +92,11 @@ export default {
}
.preview-text {
position: relative;
max-width: 190px;
max-width: 169px;
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
}
.text {
font-size: 16px;
......
......@@ -55,7 +55,8 @@ export default {
}
]
},
tableEmpData: []
tableEmpData: [],
group: {}
}
},
methods: {
......@@ -63,7 +64,7 @@ export default {
this.$emit('selectTable', val)
},
listDepartmentTree() {
this.$apis.emp.listDepartmentTree({ id: 1 }).then(res => {
this.$apis.customerTransform.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
this.listTree = res
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
......@@ -72,6 +73,7 @@ export default {
})
},
clearSelect(row) {
console.log(row, '2222')
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
......@@ -79,18 +81,19 @@ export default {
},
handleNodeClick(data) {
this.departmentId = data.id
this.listEntmicroStaff()
},
listEntmicroStaff(staffName) {
let params = {
departmentId: this.departmentId,
staffName: staffName ? staffName : this.staffName,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.listEntmicroStaff(params).then(res => {
this.tableEmpData = res
})
this.tableEmpData = data.entmicroStaffResponses
// this.listEntmicroStaff()
}
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight
......
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div>
<div class="checkbox-group-box" :style="{ 'max-height': heightBox + 'px' }">
<div v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box">
<template v-for="item in labelTreeRets">
<el-tag class="tag-selected-item" v-for="(tag, idx) in item.tagChecked" :key="idx" closable :disable-transitions="false" @close="remove(item, idx)">
{{ tag.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'SelectLabel',
data() {
return {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
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 => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
init() {
this.dialogVisible = true
this.querylabeltree()
},
handleSearch() {
this.querylabeltree()
},
querylabeltree() {
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName
}
})
.then(res => {
console.log(res)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
})
},
remove(item, idx) {
item.tagChecked.splice(idx, 1)
if (item.tagChecked.length == 0) item.checkAll = false
},
//全选
handleCheckAllChange(val, index) {
if (val) {
this.labelTreeRets[index].tagChecked = []
for (let i in this.labelTreeRets[index].labelList) {
this.labelTreeRets[index].tagChecked.push(this.labelTreeRets[index].labelList[i])
}
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
},
//选中
handleCheckedChange(value, index) {
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 300
}
}
</script>
<style lang="scss" scoped>
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
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: 22px;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
min-height: 200px;
}
</style>
\ No newline at end of file
......@@ -13,28 +13,11 @@
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<select-emp @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - 3 }}个</div>
</el-form-item>
<!-- <el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item> -->
</el-form>
</div>
</template>
......@@ -50,7 +33,7 @@ export default {
addForm: {},
typeIndex: 0,
empType: [],
empTypeValue: '',
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
......@@ -69,14 +52,6 @@ export default {
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
......@@ -85,58 +60,34 @@ export default {
}
},
remove(row) {
console.log(row, '111')
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
this.$refs.selectEmpTabel.listDepartmentTree(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择成员',
type: 'error'
})
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
}
// onSubmit() {
// if (this.innerTags.length == 0) {
// this.$message({
// message: '请选择员工',
// type: 'error'
// })
// return
// }
// let userIds = []
// this.innerTags.forEach(item => {
// userIds.push(item.userId)
// })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
// },
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted() {
this.listEntFollowerType()
console.log(111)
// this.listEntFollowerType()
}
}
</script>
......
......@@ -10,7 +10,7 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 1)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :tableData="gueastTableData" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
<GLTable ref="gueast" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
......@@ -27,7 +27,7 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :tableData="gueastTableData" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
<GLTable ref="gueast" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
......@@ -102,32 +102,8 @@ export default {
]
},
gueastPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
gueastTableData: [
{
id: 1,
massName: '守候专用服务一组dfajkfhakjdfhak[土盘]',
sendTime: '2021-11-05',
name: '群发任务命名',
sendType: 1,
sendUserNum: 1,
sendCustomerNum: 1,
unsendUserNum: 2,
unsendCustomerNum: 3,
isRemind: 1 // 1已提醒2 未提醒
},
{
id: 2,
massName: '守候专用服务一组dfajkfhakjdfhak[土盘]',
sendTime: '2021-11-05',
name: '群发任务命名',
sendType: 1,
sendUserNum: 1,
sendCustomerNum: 1,
unsendUserNum: 2,
unsendCustomerNum: 3,
isRemind: 2 // 1已提醒2 未提醒
}
],
customerList: this.$apis.customerTransform.customerList,
customerGroupList: this.$apis.customerTransform.customerGroupList,
gueastGroupTableParams: {
listName: 'data',
tableOption: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!