Commit ba28ed77 by 杨明

更新v2.4.0代码

1 parent f2219fdf
......@@ -38,6 +38,15 @@ const querylabeltree = params => {
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http_tag({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const deleteChannelCodeBill = params => {
params.method = 'entmicro.api.code.deleteChannelCodeBill'
params.sessionId = session
......@@ -187,5 +196,6 @@ export default {
updateChannelCodeBill,
listChannelCodeBill,
getCustomer,
getChannelCodeStaffList
getChannelCodeStaffList,
queryCrowdtree
}
......@@ -172,6 +172,16 @@ const customerPage = params => {
sign: true
})
}
const findMerchantInfoByMerchantNo = params => {
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getCoupon,
getMerchant,
......@@ -189,5 +199,6 @@ export default {
updateConfig,
findConfig,
addConfig,
customerPage
customerPage,
findMerchantInfoByMerchantNo
}
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-05-31 10:41:36
-->
<template>
<div>
<el-dialog :title="'人群筛选'" :visible.sync="crowdVisible">
<div class="member-wrapper" v-loading="crowdLoading">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="search" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">人群({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="crowdVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
data() {
return {
url: 0,
crowdVisible: false,
crowdLoading: false,
searchForm: { keyword: '' },
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc'
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
console.log(val)
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()
})
},
getCrowdList() {
this.crowdLoading = true
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: this.$refs.crowdTable.page.pageSize,
pageNum: this.$refs.crowdTable.page.pageNum
}
}
this.$apis.channel.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
this.tableData.forEach(item => {
this.inner.forEach((itm, index) => {
if (itm.crowdId == item.crowdId) {
this.rowClick(item)
}
})
})
this.$nextTick(() => {
this.crowdLoading = false
})
})
},
selectionTable(val) {
console.log(val)
this.innerTags = []
for (let i = 0; i < val.length; i++) {
const tagArr = this.innerTags.map(item => item.crowdId)
if (!tagArr.includes(val[i].crowdId)) {
this.innerTags.push(val[i])
}
}
},
remove(item) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.inner = this.$common.utils.deepClone(this.innerTags)
this.getCrowdList()
},
handleConfirm() {
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm.keyword = ''
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/.el-dialog__title {
font-weight: 600;
}
</style>
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose">
<div class="model-panel">
<div class="model-panel" v-loading="loading">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
......@@ -12,7 +12,7 @@
<el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item-panel" v-if="modelList.length > 0">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
......@@ -171,6 +171,7 @@ export default {
}
if (this.activeName == 2) {
params.discountTypes = [2, 3, 4]
params.directionalFlag = 1 // 1所有人可用2定向礼包专用3关联优惠券
params.validType = 'valid'
}
if (this.activeName == 5) {
......
......@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
// return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
}
export const config = {
......
......@@ -21,22 +21,22 @@
<div v-else>0</div>
</div>
<div slot="staffInfo" slot-scope="scope">
<el-popover trigger="hover" placement="top" v-if="scope.scope.staffName.split(',').length > 3">
<div class="accountType-row" v-for="(item, index) in scope.scope.staffName.split(',')" :key="index">
<el-popover trigger="hover" placement="top" v-if="staffNameSplit(scope.scope.staffName).length > 3">
<div class="accountType-row" v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index">
<i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle>
</div>
<div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-show="index < 4">
<div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-show="index < 4">
<div class="accountType-row">
<i class="el-icon-user-solid"></i>
<span v-if="index == 3 && scope.scope.staffName.split(',').length > 3">{{ '...(' + scope.scope.staffName.split(',').length + ')' }}</span>
<span v-if="index == 3 && staffNameSplit(scope.scope.staffName).length > 3">{{ '...(' + staffNameSplit(scope.scope.staffName).length + ')' }}</span>
<GLTitle :content="item" textLength="4" v-else></GLTitle>
</div>
</div>
</div>
</el-popover>
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-else>
<div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-else>
<div class="accountType-row">
<i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle>
......@@ -168,6 +168,9 @@ export default {
}
},
methods: {
staffNameSplit(name) {
return name ? name.split(',') : ''
},
handleDetail(scope) {
this.$router.push('/channel/store/' + scope.id + '/' + scope.codeUuid + '/' + scope.codeState)
},
......
......@@ -6,8 +6,9 @@
<div class="drainage-form-item">
<label>指定方式</label>
<div class="upload-box drainage-type">
<el-radio-group v-model="selectType" @change="changeType">
<el-radio-group v-model="selectType">
<el-radio :label="1">通过标签筛选</el-radio>
<el-radio :label="3">通过人群筛选</el-radio>
<el-radio :label="2">通过Excel导入</el-radio>
</el-radio-group>
</div>
......@@ -20,9 +21,9 @@
筛选标签
</el-button>
<span class="tag-count">
已选标签共关联
<span>{{ contactNum }}</span>
个客户
(已选标签共关联
{{ contactNum }}
个客户)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="labeling.length > 0">
<template v-for="(item, index) in labeling">
......@@ -34,6 +35,28 @@
<div class="upload-tips">提示:系统将自动过滤未补充手机号的客户</div>
</div>
</div>
<div class="drainage-form-item" v-if="selectType == 3">
<label>客户信息</label>
<div class="upload-box">
<el-button size="small" @click="handleCrowd">
<i class="el-icon-plus"></i>
筛选人群
</el-button>
<span class="tag-count">
(已选人群共关联
{{ contactNum }}
个客户)
</span>
<div class="el-input-tag input-tag-wrapper" v-if="crowding.length > 0">
<template v-for="(item, index) in crowding">
<el-tag type="info" :key="item.crowdId" closable :disable-transitions="false" @close="removeCrowding(index)">
{{ item.crowdName }}
</el-tag>
</template>
</div>
<div class="upload-tips">提示:若用户同时属于多个选中人群,系统将自动去重</div>
</div>
</div>
<div class="drainage-form-item" v-if="selectType == 2">
<label>客户信息</label>
<div class="upload-box">
......@@ -56,7 +79,7 @@
</div>
</div>
</div>
<div class="drainage-wrap scrm-box-f">
<div :class="['drainage-wrap', 'scrm-box-f', { 'drainage-bottom': dracImFollowStaffResponses.length == 0 }]">
<div class="drainage-title">营销配置</div>
<div class="form-main">
<div class="drainage-form">
......@@ -162,7 +185,7 @@
</div>
</div>
</div>
<div class="channel-main-welcome scrm-box-f">
<div class="channel-main-welcome scrm-box-f" v-if="dracImFollowStaffResponses.length">
<div class="chanel-form-title">欢迎语</div>
<div class="welcome-panel">
<div class="welcome-switch">
......@@ -235,6 +258,7 @@
<select-emp ref="selectEmpForm" @selectTable="selectTable"></select-emp>
<select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag>
<screen-tag ref="screenTagForm" @tagScreened="tagScreened"></screen-tag>
<select-crowd ref="selectCrowdForm" @crowdData="crowdChecked"></select-crowd>
<activity-model ref="selectModelForm" @selectActivity="selectActivity"></activity-model>
<message-model ref="selectMessageForm" @selectItem="selectItem"></message-model>
</div>
......@@ -246,6 +270,7 @@ import welcomeWords from '@/components/welcome/welcomeWords.vue'
import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag'
import screenTag from '@/components/screenTag'
import selectCrowd from '@/components/selectCrowd'
import messageModel from './components/messageModel'
import util from '@/utils/util'
const validateTime = (rule, value, callback) => {
......@@ -261,6 +286,7 @@ export default {
selectEmp,
selectTag,
screenTag,
selectCrowd,
messageModel,
welcomeWords
},
......@@ -293,6 +319,7 @@ export default {
editId: null,
tagging: [],
labeling: [],
crowding: [],
messageItem: {},
dialogVisible: true,
value: false,
......@@ -300,6 +327,7 @@ export default {
dracImFollowStaffResponses: [],
dracImMessageConfigAddRequest: {},
ModelItem: {},
merchantName: this.$globalState.session.merchantName,
addRules: {
time: [
{ required: true, message: '请选择营销时间', trigger: 'change' },
......@@ -356,6 +384,12 @@ export default {
},
deep: true
},
crowding: {
handler() {
this.handleSaveImport()
},
deep: true
},
labeling: {
handler: function() {
if (this.labeling.length == 0) {
......@@ -381,41 +415,38 @@ export default {
this.saveStatus = true
},
deep: true
}
},
methods: {
changeType() {
if (this.selectType == 2 && this.labeling.length > 0) {
this.selectType = 1
},
selectType(newVal, oldVal) {
if ((oldVal == 2 && this.labeling.length > 0) || (oldVal == 3 && this.crowding.length > 0)) {
this.$confirm('更换指定方式将重置客户列表', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.selectType = 2
this.labeling = []
this.crowding = []
})
.catch(() => {
this.selectType = 1
this.selectType = oldVal
})
}
if (this.selectType == 1 && this.importName) {
this.selectType = 2
if (oldVal == 1 && this.importName) {
this.$confirm('更换指定方式将重置客户列表', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.selectType = 1
this.clearFile()
})
.catch(() => {
this.selectType = 2
this.selectType = oldVal
})
}
},
}
},
methods: {
clearFile() {
this.importName = null
this.exportUrl = null
......@@ -443,11 +474,13 @@ export default {
},
selectItem(item) {
this.messageItem = item
this.addForm.content = item.content
this.addForm.content = `【${this.merchantName}】${item.content}`
},
//打标签
tagSelected(item) {
this.tagging = item
},
//选择标签
tagScreened(item) {
this.labeling = item
},
......@@ -497,22 +530,29 @@ export default {
this.labeling.splice(index, 1)
}
},
removeCrowding(index) {
this.crowding.splice(index, 1)
},
selectActivity(item) {
this.ModelItem = item
console.log(this.ModelItem)
},
handleSaveImport() {
const groupIds = this.crowding.map(item => item.crowdId)
this.loading = true
let params = {
exportUrl: this.exportUrl,
imType: 2,
filterTagging: JSON.stringify(this.filterTagging)
filterTagging: JSON.stringify(this.filterTagging),
groupIds
}
this.$apis.marketing.exportAdd(params).then(res => {
console.log(res)
if (res) {
if (this.selectType == 1) {
this.contactNum = res.totalCount
} else if (this.selectType == 3) {
this.contactNum = res.totalCount
} else {
this.ExportDracImResponse = res
this.importStatus = true
......@@ -526,7 +566,11 @@ export default {
this.$message.error('请选择客户标签')
return
}
if (this.selectType == 1 && this.contactNum == 0) {
if (this.selectType == 3 && this.crowding.length == 0) {
this.$message.error('请选择人群')
return
}
if ((this.selectType == 1 || this.selectType == 3) && this.contactNum == 0) {
this.$message.error('智能营销客户为空')
return
}
......@@ -566,6 +610,7 @@ export default {
labelType: item.labelGroup.name
}
})
const groupIds = this.crowding.map(item => item.crowdId)
let params = {
autoWelcome: this.autoWelcome ? 1 : 0,
imName: this.imName,
......@@ -574,6 +619,7 @@ export default {
filterTagging: JSON.stringify(this.filterTagging),
exportUrl: this.exportUrl,
dracImFollowStaffRequestList: this.dracImFollowStaffResponses,
groupIds,
dracImMessageConfigRequest: {
startTime,
endTime,
......@@ -615,6 +661,12 @@ export default {
handleScreenTag() {
this.$refs.screenTagForm.init(this.labeling)
},
handleCrowd() {
this.$refs.selectCrowdForm.init(this.crowding)
},
crowdChecked(item) {
this.crowding = item
},
//选择短信模板
handleSelectMessage() {
this.$refs.selectMessageForm.init()
......@@ -802,9 +854,13 @@ export default {
}
.drainage-wrap {
margin-bottom: 20px;
&:nth-child(2) {
margin-bottom: 20px;
}
&.drainage-bottom {
margin-bottom: 60px;
}
.drainage-title {
padding-left: 20px;
font-size: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!