Commit 86f35ca7 by 匡雅琴

群发助手标签

1 parent 71e8f65b
import { http } 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'
...@@ -67,7 +67,8 @@ const findLordGroup = params => { ...@@ -67,7 +67,8 @@ const findLordGroup = params => {
} }
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.label.querylabeltree' // params.method = 'scrm.api.datahub.label.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',
......
...@@ -10,3 +10,4 @@ ...@@ -10,3 +10,4 @@
import { bootstrap, mount, unmount } from './qiankun' import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single' import { start } from './single'
export { bootstrap, mount, unmount, start } export { bootstrap, mount, unmount, start }
...@@ -49,3 +49,4 @@ function subscribe({ messenger }) { ...@@ -49,3 +49,4 @@ function subscribe({ messenger }) {
console.log(`监听到子应用${v.from}发来消息:`, v) console.log(`监听到子应用${v.from}发来消息:`, v)
}) })
} }
...@@ -16,7 +16,7 @@ import render from './render' ...@@ -16,7 +16,7 @@ import render from './render'
import { routes } from '@/router' import { routes } from '@/router'
export async function start() { export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig() const { response, request, sign, secret, request2 } = await fetchConfig()
var urlParams = {} var urlParams = {}
// window.location.href // window.location.href
// .split('?')[1] // .split('?')[1]
...@@ -24,7 +24,8 @@ export async function start() { ...@@ -24,7 +24,8 @@ export async function start() {
// .forEach(item => { // .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1] // urlParams[item.split('=')[0]] = item.split('=')[1]
// }) // })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-53e870b5-80d5-483e-8277-cdc4dec0ad80-rop' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'scrm-base-0958821a-6542-474e-b057-74a1192a25f2-rop'
Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) 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'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes) render('/', routes)
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
style="width: 320px;" style="width: 320px;"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<!-- <el-form-item label="标签筛选"> <el-form-item label="标签筛选">
<el-button size="small" @click="openLabel"> <el-button size="small" @click="openLabel">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
标签筛选 标签筛选
...@@ -112,15 +112,17 @@ ...@@ -112,15 +112,17 @@
:key="key" :key="key"
class="el-input-tag input-tag-wrapper" class="el-input-tag input-tag-wrapper"
> >
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag <el-tag
v-for="(tag, idx) in tagging" v-for="(tagItem, idx1) in tag.labelList"
:key="idx" :key="idx1"
:size="size" :size="size"
type="info" type="info"
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="removeTag(tag, idx)" @close="removeTag(tag, idx1, idx)"
>{{ tag.name }}</el-tag> >{{ tagItem.name }}</el-tag>
</span>
</div> </div>
<div class="sale-select" v-show="basicForm.condition.labelList"> <div class="sale-select" v-show="basicForm.condition.labelList">
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key" class="el-input-tag input-tag-wrapper">
...@@ -136,7 +138,7 @@ ...@@ -136,7 +138,7 @@
<el-input size="small" style="outline: none; border: none"></el-input> <el-input size="small" style="outline: none; border: none"></el-input>
</div> </div>
</div> </div>
</el-form-item>--> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </div>
...@@ -280,6 +282,7 @@ export default { ...@@ -280,6 +282,7 @@ export default {
return { return {
addLoading: false, addLoading: false,
eventBus: new Vue(), eventBus: new Vue(),
taggingList: '',
btnList: [ btnList: [
{ {
id: 1, id: 1,
...@@ -432,8 +435,24 @@ export default { ...@@ -432,8 +435,24 @@ export default {
}, },
openLabel() { openLabel() {
this.dialogVisible = !this.dialogVisible this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init()
}, },
handleSubmit() { handleSubmit() {
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push( {
groupId: parseInt(item.labelGroup.id),
groupName: item.labelGroup.name,
labelId: parseInt(tag.id),
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
// console.log(this.taggingList)
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
this.attachmentShow = true this.attachmentShow = true
...@@ -512,20 +531,28 @@ export default { ...@@ -512,20 +531,28 @@ export default {
}, },
handleSelect(val) { handleSelect(val) {
this.isUpdate = true this.isUpdate = true
const arr = [] // const arr = []
if (val.length != 0) { // if (val.length != 0) {
val.forEach(item => { // val.forEach(item => {
if (item.labelList.length != 0) { // if (item.labelList.length != 0) {
item.labelList.map(i => arr.push(i)) // item.labelList.map(i => arr.push(i))
} // }
// arr.push(item.labelList) // // arr.push(item.labelList)
}) // })
} // }
this.tagging = arr this.tagging = val
// this.taggingList = val
console.log(val, '1')
console.log(this.tagging, '2')
}, },
// 删除标签 // 删除标签
removeTag(item, idx) { removeTag(tag, idx1, idx) {
this.tagging.splice(idx, 1) console.log(tag, 'tag');
// this.tagging.splice(idx, 1)
tag.labelList.splice(idx1, 1)
if(tag.labelList.length == 0) {
this.tagging.splice(idx,1)
}
this.isUpdate = true this.isUpdate = true
// this.$refs.selectLabel.init(this.tagging) // this.$refs.selectLabel.init(this.tagging)
}, },
...@@ -554,9 +581,12 @@ export default { ...@@ -554,9 +581,12 @@ export default {
sex: this.basicForm.condition.sex, sex: this.basicForm.condition.sex,
chatId: chatFlag ? this.basicForm.condition.chat.map(item => item.id).join(',') : '', chatId: chatFlag ? this.basicForm.condition.chat.map(item => item.id).join(',') : '',
chatName: chatFlag ? this.basicForm.condition.chat.map(item => item.groupName).join(',') : '', chatName: chatFlag ? this.basicForm.condition.chat.map(item => item.groupName).join(',') : '',
tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '', // tagId: "328,329,330",
tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : '' // tagName: "一般,重要,核心"
// tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
// tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging) // tagId: JSON.stringify(this.tagging)
labelList: this.taggingList
} }
} }
if (this.basicForm.condition.date) { if (this.basicForm.condition.date) {
...@@ -583,17 +613,18 @@ export default { ...@@ -583,17 +613,18 @@ export default {
return return
} }
const params = this.getSiftMembers() const params = this.getSiftMembers()
this.$apis.customerTransform console.log(params)
.customerCount(params) // this.$apis.customerTransform
.then(res => { // .customerCount(params)
// if (res) { // .then(res => {
this.groupNumber = res // // if (res) {
// } // this.groupNumber = res
this.isUpdate = false // // }
}) // this.isUpdate = false
.catch(err => { // })
this.groupNumber = 0 // .catch(err => {
}) // this.groupNumber = 0
// })
}, },
// 选择客户change事件 // 选择客户change事件
radioChange(val) { radioChange(val) {
......
...@@ -9,30 +9,14 @@ ...@@ -9,30 +9,14 @@
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input> <el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button> <el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div> </div>
<div class="checkbox-group-box" :style="{ 'max-height': heightBox + 'px' }"> <div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div v-for="(item, index) in labelTreeRets" :key="index"> <div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span <span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
class="el-tree-node__expand-icon el-icon-caret-right" <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>
:class="{ expanded: item.checked }" <el-tag :size="size">{{ item.labelType }}</el-tag>
@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> <div style="margin: 15px 0"></div>
<el-checkbox-group <el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked">
class="tag-group" <el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
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> </el-checkbox-group>
</div> </div>
</div> </div>
...@@ -42,18 +26,12 @@ ...@@ -42,18 +26,12 @@
<div class="tag-title">已选标签</div> <div class="tag-title">已选标签</div>
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div> <div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box"> <div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRetSelect"> <template v-for="item in labelTreeRetSelect">
<template v-for="(tag, idx) in item.tagChecked"> <template v-for="(tag, idx) in item.tagChecked">
<el-tag <el-tag :title="tag.name" type="info" class="tag-selected-item" :key="idx" v-if="tag" closable :disable-transitions="false" @close="remove(item, idx)">
class="tag-selected-item" {{ tag.name }}
:key="idx" </el-tag>
v-if="tag"
type="info"
closable
:disable-transitions="false"
@close="remove(item, idx)"
>{{ tag.name }}</el-tag>
</template> </template>
</template> </template>
</div> </div>
...@@ -61,6 +39,7 @@ ...@@ -61,6 +39,7 @@
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
...@@ -70,8 +49,9 @@ ...@@ -70,8 +49,9 @@
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/utils/util'
export default { export default {
name: 'SelectLabel', name: 'activityModel',
data() { data() {
return { return {
heightBox: 200, heightBox: 200,
...@@ -109,10 +89,10 @@ export default { ...@@ -109,10 +89,10 @@ export default {
} }
}, },
watch: { watch: {
labelTreeRets: { labelTreeRetSelect: {
handler() { handler() {
this.selectNum = 0 this.selectNum = 0
this.labelTreeRets.forEach(item => { this.labelTreeRetSelect.forEach(item => {
this.selectNum += item.tagChecked.length this.selectNum += item.tagChecked.length
}) })
}, },
...@@ -120,6 +100,10 @@ export default { ...@@ -120,6 +100,10 @@ export default {
} }
}, },
methods: { methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) { init(item) {
this.labelGroupName = '' this.labelGroupName = ''
this.dialogVisible = true this.dialogVisible = true
...@@ -135,15 +119,19 @@ export default { ...@@ -135,15 +119,19 @@ export default {
labelTreeReq: { labelTreeReq: {
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
shopId: this.$globalState.session.merchantId, // shopId: this.$globalState.session.merchantId,
shopId: '44210934',
labelGroupName: this.labelGroupName, labelGroupName: this.labelGroupName,
edition: this.$globalState.session.merchantModel // labelTypesStr: '自店标签,企业标签',
// edition: this.$globalState.session.merchantModel
edition: 4
} }
}) })
.then(res => { .then(res => {
if (selectItem && selectItem.length > 0) { if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
labelType: item.labelType,
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.labelList, labelList: item.labelList,
checked: false, checked: false,
...@@ -182,6 +170,7 @@ export default { ...@@ -182,6 +170,7 @@ export default {
} else { } else {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
labelType: item.labelType,
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.labelList, labelList: item.labelList,
checked: false, checked: false,
...@@ -241,11 +230,13 @@ export default { ...@@ -241,11 +230,13 @@ export default {
if (item.tagChecked.length) { if (item.tagChecked.length) {
return { return {
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: item.tagChecked labelList: item.tagChecked
} }
} }
}) })
.filter(item => item) .filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets) this.$emit('tagSelected', labelTreeRets)
}, },
//全选 //全选
...@@ -285,12 +276,19 @@ export default { ...@@ -285,12 +276,19 @@ export default {
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 300 this.heightBox = clientHeight - 0.15 * clientHeight - 350
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel { .tag-panel {
display: flex; display: flex;
.tag-panel-select { .tag-panel-select {
...@@ -348,6 +346,12 @@ export default { ...@@ -348,6 +346,12 @@ export default {
margin: 0px 6px 6px 0px; margin: 0px 6px 6px 0px;
height: 26px; height: 26px;
line-height: 24px; line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
} }
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
color: #5850ff; color: #5850ff;
...@@ -368,6 +372,11 @@ export default { ...@@ -368,6 +372,11 @@ export default {
} }
.checkbox-group-box { .checkbox-group-box {
overflow: auto; overflow: auto;
.el-tag {
font-size: 12px;
border: none;
background: rgba($color: #5850FF, $alpha: 0.3)
}
} }
.tag-selected-box { .tag-selected-box {
min-height: 200px; min-height: 200px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!