Commit 9ee31c59 by 胡悦

修改群发助手

1 parent ce7297a2
...@@ -357,6 +357,28 @@ const followerEcho = params => { ...@@ -357,6 +357,28 @@ const followerEcho = params => {
}) })
} }
// 获取素材组列表
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
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -392,5 +414,7 @@ export default { ...@@ -392,5 +414,7 @@ export default {
findLordGroup, findLordGroup,
followerType, followerType,
queryCrowdtree, queryCrowdtree,
followerEcho followerEcho,
getGroupListApi,
getMaterialListApi
} }
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-01-20 18:06:46 * @Date: 2022-01-20 18:06:46
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-05-27 16:28:40 * @LastEditTime: 2022-07-12 14:14:15
*/ */
import Vue from 'vue' import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js' import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton, GLEditor } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import render from './render' import render from './render'
...@@ -23,6 +23,7 @@ Vue.use(GLTable) ...@@ -23,6 +23,7 @@ Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLCombiForm) Vue.use(GLCombiForm)
Vue.use(GLTableButton) Vue.use(GLTableButton)
Vue.use(GLEditor)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, xiaolong_req } = await fetchConfig(false) const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, xiaolong_req } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
......
...@@ -25,17 +25,6 @@ ...@@ -25,17 +25,6 @@
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
</div> </div>
<!-- <div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag
v-for="(tag, idx) in basicForm.userList"
:key="idx"
:size="size"
closable
:disable-transitions="false"
@close="remove(tag)"
>{{ tag.staffName }}</el-tag>
<el-input size="small" style="outline: none; border: none"></el-input>
</div>-->
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="选择客户" prop="selectType"> <el-form-item label="选择客户" prop="selectType">
...@@ -95,11 +84,9 @@ ...@@ -95,11 +84,9 @@
</div> </div>
<div v-show="basicForm.selectType == 3" class="crowd-tips">人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。</div> <div v-show="basicForm.selectType == 3" class="crowd-tips">人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。</div>
<div class="filter-footer"> <div class="filter-footer">
<!-- <span>将消息发送给客户符合条件的客户</span> -->
<div class="filter-number"> <div class="filter-number">
查看预计群发人数 查看预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button> <el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<!-- <span v-show="isUpdate" @click="viewMembers">查看</span> -->
<span v-show="!isUpdate">{{ groupNumber }}</span> <span v-show="!isUpdate">{{ groupNumber }}</span>
</div> </div>
</div> </div>
...@@ -111,7 +98,7 @@ ...@@ -111,7 +98,7 @@
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px"> <el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px">
<el-form-item prop="attachmentList"> <el-form-item prop="attachmentList">
<label slot="label" class="required">群发内容</label> <label slot="label" class="required">群发内容</label>
<WelcomeWords ref="welcome" :form="'customer'" :btnList="btnList" :eventBus="eventBus"></WelcomeWords> <GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div> <div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item> </el-form-item>
<el-form-item label="发送时间" prop="sendType"> <el-form-item label="发送时间" prop="sendType">
...@@ -129,12 +116,11 @@ ...@@ -129,12 +116,11 @@
</div> </div>
</div> </div>
<div class="preview"> <div class="preview">
<Preview :eventBus="eventBus"></Preview> <Preview :previewVal="previewVal"></Preview>
</div> </div>
</div> </div>
</div> </div>
<glsx-dialog :title="'选择成员'" :width="'1142px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible"> <glsx-dialog :title="'选择成员'" :width="'1142px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember> <SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
</glsx-dialog> </glsx-dialog>
</div> </div>
...@@ -160,7 +146,6 @@ const combineType = { ...@@ -160,7 +146,6 @@ const combineType = {
} }
import Vue from 'vue' import Vue from 'vue'
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import WelcomeWords from './components/welcomeWords.vue'
import SelectMember from './components/selectMember.vue' import SelectMember from './components/selectMember.vue'
import SelectCrowd from './components/selectCrowd.vue' import SelectCrowd from './components/selectCrowd.vue'
import Preview from './components/preview.vue' import Preview from './components/preview.vue'
...@@ -168,7 +153,6 @@ import SelectLabel from './components/selectLabel.vue' ...@@ -168,7 +153,6 @@ import SelectLabel from './components/selectLabel.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
components: { components: {
WelcomeWords,
SelectMember, SelectMember,
Preview, Preview,
SelectLabel, SelectLabel,
...@@ -221,36 +205,88 @@ export default { ...@@ -221,36 +205,88 @@ export default {
taggingList: [], taggingList: [],
btnList: [ btnList: [
{ {
id: 1,
name: '表情', name: '表情',
funcName: '', funcName: '',
type: 'expression', type: 'expression',
limitSize: 10 limitSize: 10
}, },
{ {
id: 2,
name: '图片', name: '图片',
funcName: '', funcName: '',
type: 'img', type: 'img',
limitSize: 10 limitSize: 10,
uploadApi: this.$apis.common.pictureUpload
}, },
// {
// id: 3,
// name: '昵称',
// type: 'nickname',
// funName: 'nickname'
// },
{ {
id: 4,
name: '活动', name: '活动',
type: 'acivity', type: 'activity',
funName: 'activity' funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.customerTransform.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.customerTransform.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.customerTransform.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.customerTransform.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.customerTransform.merchant,
params: {
merchantId: this.$globalState.session.merchantId
}
}
]
}, },
{ {
id: 5,
name: '模板', name: '模板',
type: 'nickname', type: 'message',
funName: 'message' funName: 'message',
getSearchApi: this.$apis.customerTransform.createdNameList,
templateApi: this.$apis.customerTransform.templatePage,
templateUpdateApi: this.$apis.customerTransform.templateUpdate,
templateSaveApi: this.$apis.customerTransform.templateSave,
templateDetailApi: this.$apis.customerTransform.templateDetail
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.customerTransform.getGroupListApi,
materialListApi: this.$apis.customerTransform.getMaterialListApi
} }
], ],
basicForm: { basicForm: {
...@@ -263,10 +299,7 @@ export default { ...@@ -263,10 +299,7 @@ export default {
attachmentShow: false, attachmentShow: false,
attachmentText: '', attachmentText: '',
basicRules: { basicRules: {
userList: [ userList: [{ validator: validatorUser, trigger: 'change' }],
// { required: true, message: '请选择群发账号', trigger: 'blur' },
{ validator: validatorUser, trigger: 'change' }
],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }], selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
// attachmentList: [ // attachmentList: [
// // { required: true, message: '请输入入群欢迎语' }, // // { required: true, message: '请输入入群欢迎语' },
...@@ -302,7 +335,8 @@ export default { ...@@ -302,7 +335,8 @@ export default {
footerLeft: 40, footerLeft: 40,
footerWidth: 500, footerWidth: 500,
viewLoading: false, viewLoading: false,
isSelectCrowd: false isSelectCrowd: false,
previewVal: []
} }
}, },
watch: { watch: {
...@@ -334,6 +368,11 @@ export default { ...@@ -334,6 +368,11 @@ export default {
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
}, },
// 预览回显事件
previewForm(val) {
console.log(val)
this.previewVal = val
},
handleCancel() { handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) { if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
...@@ -417,14 +456,6 @@ export default { ...@@ -417,14 +456,6 @@ export default {
if (v) { if (v) {
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
// if (this.basicForm.condition.chat && this.basicForm.condition.chat.length && this.basicForm.condition.chat.length > 100) {
// this.$message({
// type: 'error',
// message: '所在群聊不可超过100个'
// })
// return false
// }
// params.attachmentList = this.basicForm.attachmentList
params.sendType = this.basicForm.sendType params.sendType = this.basicForm.sendType
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => { const attachmentList = previewList.map(item => {
...@@ -500,18 +531,15 @@ export default { ...@@ -500,18 +531,15 @@ export default {
}) })
this.taggingList = arr this.taggingList = arr
console.log(this.taggingList) console.log(this.taggingList)
// this.taggingList = val
console.log(val, '1') console.log(val, '1')
console.log(this.tagging, '2') console.log(this.tagging, '2')
}, },
// 删除标签 // 删除标签
removeTag(tag, idx1, idx) { removeTag(tag, idx1, idx) {
console.log(tag, 'tag') console.log(tag, 'tag')
// this.tagging.splice(idx, 1)
tag.labelList.splice(idx1, 1) tag.labelList.splice(idx1, 1)
if (tag.labelList.length == 0) { if (tag.labelList.length == 0) {
this.tagging.splice(idx, 1) this.tagging.splice(idx, 1)
// this.taggingList.splice(idx, 1)
} }
let arr = [] let arr = []
this.tagging.forEach(item => { this.tagging.forEach(item => {
...@@ -527,12 +555,10 @@ export default { ...@@ -527,12 +555,10 @@ export default {
}) })
this.taggingList = arr this.taggingList = arr
this.isUpdate = true this.isUpdate = true
// this.$refs.selectLabel.init(this.tagging)
}, },
// 删除人群 // 删除人群
removeCrowd(item, index) { removeCrowd(item, index) {
this.basicForm.crowdList.splice(index, 1) this.basicForm.crowdList.splice(index, 1)
// this.$refs.selectCrowd.remove(item)
this.getCrowdData(this.basicForm.crowdList) this.getCrowdData(this.basicForm.crowdList)
if (!this.basicForm.crowdList.length) { if (!this.basicForm.crowdList.length) {
this.basicForm.userList = [] this.basicForm.userList = []
...@@ -585,7 +611,6 @@ export default { ...@@ -585,7 +611,6 @@ export default {
params.userList = this.basicForm.userList.map(item => { params.userList = this.basicForm.userList.map(item => {
return { return {
staffId: item.staffId staffId: item.staffId
// staffName: item.staffName
} }
}) })
} }
...@@ -615,7 +640,6 @@ export default { ...@@ -615,7 +640,6 @@ export default {
return return
} }
const params = this.getSiftMembers() const params = this.getSiftMembers()
console.log(params)
this.viewLoading = true this.viewLoading = true
this.$apis.customerTransform this.$apis.customerTransform
.customerCount(params) .customerCount(params)
...@@ -630,7 +654,6 @@ export default { ...@@ -630,7 +654,6 @@ export default {
this.viewLoading = false this.viewLoading = false
}) })
.catch(err => { .catch(err => {
console.log(2222)
this.viewLoading = false this.viewLoading = false
this.groupNumber = 0 this.groupNumber = 0
this.isUpdate = false this.isUpdate = false
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
</template> </template>
<template v-else-if="item.attType == 7"> <template v-else-if="item.attType == 7">
<div class="preview-activity"> <div class="preview-activity">
<!-- <img class="applet-logo" src="@/assets/guestCustom/applet-logo.png" alt /> -->
<div class="activity-name">{{ item.attContent.marketingName }}</div> <div class="activity-name">{{ item.attContent.marketingName }}</div>
<img v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6" class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt /> <img v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6" class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt />
<img v-if="item.attContent.marketingType == 5" class="activity-logo" src="@/assets/guestCustom/activity-spike.png" alt /> <img v-if="item.attContent.marketingType == 5" class="activity-logo" src="@/assets/guestCustom/activity-spike.png" alt />
...@@ -18,16 +17,11 @@ ...@@ -18,16 +17,11 @@
<img src="@/assets/guestCustom/applet-footer.png" alt /> <img src="@/assets/guestCustom/applet-footer.png" alt />
</div> </div>
</div> </div>
<!-- <div class="preview-text preview-link">
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt />
</div>-->
</template> </template>
<template v-else-if="item.attType == 2"> <template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<video style="width: 100px" :src="item.attContent"></video> <video style="width: 100px" :src="item.attContent"></video>
</template> </template>
<template v-else-if="item.attType == 5"> <template v-else-if="item.attType == 5">
...@@ -48,7 +42,7 @@ ...@@ -48,7 +42,7 @@
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
export default { export default {
name: 'Preview', name: 'Preview',
props: { eventBus: Object }, props: { eventBus: Object, previewVal: Array },
data() { data() {
return { return {
previewList: [], previewList: [],
...@@ -72,6 +66,12 @@ export default { ...@@ -72,6 +66,12 @@ export default {
}) })
val[0].attContent = htm val[0].attContent = htm
} }
},
previewVal: {
handler(val) {
this.previewList = val
},
deep: true
} }
}, },
created() { created() {
......
<template>
<div class="drawer-sale-panel">
<el-form label-width="100px" :model="addForm" @submit.native.prevent>
<el-form-item label="请选择成员">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none" @keyup.enter.native="searchEmp"></el-input>
</div>
<div>
<el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button>
</div>
</div>
<div>
<div class="select-sale-panel">
<select-emp :selectData="selectData" :islord="islord" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp.vue'
export default {
name: 'SelectMembers',
props: ['selectData', 'islord'],
components: {
selectEmp
},
data() {
return {
addForm: {},
typeIndex: 0,
empType: [],
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.searchTable(this.newTag)
},
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() {}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.tag-box {
max-height: 66px;
overflow: auto;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #606266;
display: inline-block;
outline: none;
padding: 0 0 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
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: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 4px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!