Commit 5f0c65a3 by 李伟康

Merge branch 'master' into 'saas+4.24.0'

合并主干

See merge request !66
2 parents 9af54a63 3eff9a19
Showing 37 changed files with 7035 additions and 850 deletions
...@@ -75,5 +75,14 @@ const getGroupList = params => { ...@@ -75,5 +75,14 @@ const getGroupList = params => {
returnAll: true returnAll: true
}) })
} }
const activityreportWorktool = params => {
export default { getStaffList, getMerchantList, getlistDepartmentTree, getActivitylist, insertStaff, getGroupList, activityOpen } params.method = `entmicro.api.wechatcloudcontrol.activityreport.worktool.grouplist`
return http({
url: url1,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { activityreportWorktool, getStaffList, getMerchantList, getlistDepartmentTree, getActivitylist, insertStaff, getGroupList, activityOpen }
...@@ -19,6 +19,7 @@ import glsxRows from '@/components/glsx-rows/index.vue' ...@@ -19,6 +19,7 @@ import glsxRows from '@/components/glsx-rows/index.vue'
import glsxDescriptions from '@/components/glsx-descriptions/index.vue' import glsxDescriptions from '@/components/glsx-descriptions/index.vue'
import selectTag from '@/components/selectTag/index.vue' import selectTag from '@/components/selectTag/index.vue'
import searchForm from '@/components/search-form/index.vue' import searchForm from '@/components/search-form/index.vue'
import verbal from '@/components/verbal/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
...@@ -31,3 +32,4 @@ Vue.component('glsx-rows', glsxRows) ...@@ -31,3 +32,4 @@ Vue.component('glsx-rows', glsxRows)
Vue.component('glsx-descriptions', glsxDescriptions) Vue.component('glsx-descriptions', glsxDescriptions)
Vue.component('select-tag', selectTag) Vue.component('select-tag', selectTag)
Vue.component('search-form', searchForm) Vue.component('search-form', searchForm)
Vue.component('verbal', verbal)
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
name: 'emotionWords',
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
position: absolute;
z-index:999;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
<template>
<div class="w-textarea" ref="wTextarea">
<div contenteditable="true" class="w-textarea_input" ref="wTextareaContent" :id="contentId" @keydown="textareaKeydown($event)" @click="inputClick($event)" @focus="onFocus" @blur="onBlur" @keydown.delete="handleDelete($event)" @compositionend="handleInput($event.target)" @input="handleInput($event.target)"></div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'wTextarea',
data() {
return {
// 记录currentText以计算长度
currentText: this.value,
// 为input区域生成随机id,当在页面上有多个组件时,用于监听光标的变化
contentId: `content${this.getGuid()}`,
// 输入的时候锁定,禁止更新innerHTML
isLocked: false,
isInsert: false,
// 记录当前选中tag的ID
currentTagId: null,
// 当前光标位置
savedRange: {}
}
},
props: {
value: {
type: String,
default: ''
},
tag: {
// 自定义模版标签的标签名
type: String,
// 默认使用wise作为标签名,并添加了默认样式
// 当使用其他标签名的时候,需要另写标签样式
default: 'wise'
},
tools: {
// 自定义扩展功能:超链接'link',模版标签'tag'
type: Array,
default() {
return [
{ type: 'link', text: '添加超链接' },
{ type: 'tag', text: '添加模版标签' }
]
}
},
maxlength: {
// 最大输入长度
type: [String, Number],
default: ''
}
},
computed: {
count() {
// 字符长度记数
let num = this.maxlength - this.currentText.length
let text = num < 0 ? `已超出${Math.abs(num)}个字符` : `还可以输入${num}个字符`
return { num, text }
}
},
mounted() {
// 初始化数据
this.currentText && (this.$refs.wTextareaContent.innerHTML = this.currentText)
// 创建模版标签的style
this.createStyle()
// 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler)
},
beforeDestroy() {
// 卸载事件
document.removeEventListener('selectionchange', this.selectHandler)
},
methods: {
updateData(text) {
this.$emit('input', text)
},
createStyle() {
// 为自定义的模版标签添加样式,使之不可编辑
let style = document.createElement('style')
style.innerHTML = `.w-textarea ${this.tag} {
cursor: default;
-webkit-user-modify: read-only !important;
}`
this.$refs.wTextarea.appendChild(style)
},
closeModal() {
this.form.text = ''
this.showModal = false
},
openTagDialog(type) {
// if (addLink)
// 将事件抛给父组件处理
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type)
},
textareaKeydown(event) {
if (event.keyCode == 13) {
this.insertContent('<br>')
}
},
/*换行*/
insertHtml(html) {
var sel, range
if (window.getSelection) {
// IE9 或 非IE浏览器
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
// Range.createContextualFragment() would be useful here but is
// non-standard and not supported in all browsers (IE9, for one)
var el = document.createElement('div')
el.innerHTML = html
var frag = document.createDocumentFragment(),
node,
lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
// Preserve the selection
if (lastNode) {
range = range.cloneRange()
range.setStartAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
} else if (document.selection && document.selection.type != 'Control') {
// IE < 9
document.selection.createRange().pasteHTML(html)
}
const htm = document.querySelector('.w-textarea_input').innerHTML
this.subText(htm)
},
addTag(text) {
// 创建模版标签
let node = document.createElement(this.tag)
if (navigator.userAgent.indexOf('Firefox') > 0) {
node.setAttribute('contenteditable', 'false')
}
node.innerText = text
// 添加id便于删除
node.id = this.getGuid()
this.insertContent(node)
},
addNode() {
let target = this.$refs.wTextareaContent
this.updateData(target.innerHTML)
},
addLink(text, url) {
// 创建a标签
let node = document.createElement('a')
node.innerText = text
node.href = url
node.target = 'blank'
this.insertNode(node)
},
addImg(url) {
// 创建a标签
let node = document.createElement('img')
node.src = url
// node.setAttribute('ondragstart', 'return false;')
this.insertContent(node)
},
onFocus() {
this.isLocked = true
this.isInsert = true
},
onBlur() {
this.isLocked = false
},
insertContent(el) {
let sel = null
if (document.selection) {
sel = document.selection
sel.createRange().pasteHTML(el)
} else {
sel = window.getSelection()
// 同上考虑到标签插入时光标会在之前插入过的标签内或者不在DIV上,这里作一下判断
// 光标在div的text上时后层组件是div,在插入标签时后两层是div,这样就不会插入到div外面或者出现标签内插入标签。
console.log(sel)
if (sel.rangeCount > 0) {
console.log(888)
const frag = document.createDocumentFragment()
const node = el
const lastNode = frag.appendChild(node)
this.savedRange.insertNode(frag)
const contentRange = this.savedRange.cloneRange()
contentRange.setStartAfter(lastNode)
contentRange.collapse(true)
sel.removeAllRanges()
sel.addRange(contentRange)
}
}
},
insertNode(node) {
// 在内容中插入标签
// 删掉选中的内容(如有)
if (this.savedRange.startContainer) {
this.insertNodeFirst(node)
} else {
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
this.insertNodeFirst(node)
document.querySelector('.w-textarea_input').blur()
}, 100)
}
},
subText(htm) {
this.$emit('updateText', htm)
},
insertNodeFirst(node) {
this.savedRange.deleteContents()
// 插入链接
if (this.isInsert) {
this.savedRange.insertNode(node)
} else {
document.querySelector('.w-textarea_input').appendChild(node)
}
if (navigator.userAgent.indexOf('Chrome') != -1) {
this.savedRange.insertNode(document.createElement('span'))
}
this.isInsert = false
// 更新双向绑定数据
let target = this.$refs.wTextareaContent
if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) {
this.updateData(target.innerHTML + '&nbsp;')
} else {
this.updateData(target.innerHTML)
}
let htm = target.innerHTML
this.subText(htm)
},
placeCaretAtEnd(el) {
//传入光标要去的jq节点对象
el.focus()
if (typeof window.getSelection != 'undefined' && typeof document.createRange != 'undefined') {
var range = document.createRange()
range.selectNodeContents(el)
range.collapse(false)
var sel = window.getSelection()
sel.removeAllRanges()
sel.addRange(range)
} else if (typeof document.body.createTextRange != 'undefined') {
var textRange = document.body.createTextRange()
textRange.moveToElementText(el)
textRange.collapse(false)
textRange.select()
}
},
handleInput(target) {
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
this.subText(htm)
},
handleDelete(e) {
// 监听“删除”事件
if (this.currentTagId) {
// 若已选中模版标签,直接删除dom节点
let t = document.getElementById(this.currentTagId)
this.$refs.wTextareaContent.removeChild(t)
this.currentTagId = null
// 阻止浏览器默认的删除事件,并手动更新数据
e.preventDefault()
this.handleInput(e.target)
}
},
inputClick(e) {
// 监听点击事件
this.isLocked = true
const TAG_NAME = e.target.nodeName
if (TAG_NAME === this.tag.toUpperCase()) {
// 点击模版标签时,记录id
this.currentTagId = e.target.id
e.target.className = 'active'
} else if (this.currentTagId) {
// 清空active样式
let target = document.getElementById(this.currentTagId)
target.className = ''
this.currentTagId = null
} else {
this.currentTagId = null
}
},
getGuid() {
// 生成随机ID
return 1
// return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
},
setFocus() {
this.savedRange.setStartAfter && this.savedRange.setStartAfter(document.querySelector('.w-textarea_input').lastChild)
},
selectHandler() {
// 监听选定文本的变动
let sel = window.getSelection()
let range = sel.rangeCount > 0 ? sel.getRangeAt(0) : null
if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) {
this.savedRange = range
}
}
},
watch: {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (!this.isLocked) {
this.$refs.wTextareaContent.innerHTML = val
}
}
}
}
</script>
<style lang="scss">
.w-textarea {
wise {
// user-select: none;
border-radius: 2px;
background-color: transparent;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 0px;
margin: 0 2px;
color: #26a2ff;
// padding: 0 1px;
white-space: nowrap;
user-select: auto !important;
cursor: default;
-webkit-user-modify: read-only !important;
}
img {
width: 18px;
height: 18px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
vertical-align: middle;
}
.active {
background: #dcdfe6;
}
}
</style>
<style lang="scss" scoped>
$borderColor: #e5e5e5;
$bgColor: #f5f7fa;
$textColor: #666;
.w-textarea {
width: 100%;
box-sizing: border-box;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border: 1px solid $borderColor;
position: relative;
overflow-y: auto;
&_input {
width: 100%;
height: 200px;
min-height: 100px;
box-sizing: border-box;
padding: 10px;
line-height: 1.5;
word-break: break-word;
// 允许编辑,禁止富文本
-webkit-user-modify: read-write-plaintext-only !important;
&:focus {
outline: none;
}
}
&_tools {
padding: 0 10px;
height: 40px;
line-height: 40px;
border-top: 1px solid $borderColor;
background-color: $bgColor;
color: $textColor;
font-size: 12px;
&__item {
display: inline-block;
line-height: 1;
padding: 5px 8px;
margin-right: 8px;
color: $textColor;
cursor: pointer;
border: 1px solid $borderColor;
border-radius: 4px;
background: #fff;
transition: all 0.3s;
&:hover {
background: $bgColor;
opacity: 0.7;
}
&:focus {
outline: none;
}
}
&__text {
display: inline-block;
line-height: 40px;
padding: 0 8px;
float: right;
color: $textColor;
cursor: default;
transition: all 0.3s;
&:hover {
opacity: 1;
}
&.__danger {
color: red;
}
}
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-29 11:20:35
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im
-->
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-10 14:48:12
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="text-area">
<w-textarea ref="textContent" v-model="textValue" @updateText="updateText"></w-textarea>
<div class="btn-group-panel">
<div class="btn-group">
<div class="add-btn" v-for="(item, k) in btnList" :key="k" @click="selectItem(item)">
<template v-if="item.type == 1">
<img class="emotion-item" src="@/assets/textarea/expression.png" />
<span class="emotion-item">{{ item.name }}</span>
</template>
<template v-else>
<img class="emotion-item" src="@/assets/textarea/add.png" />
<span class="emotion-item">{{ item.name }}</span>
</template>
</div>
</div>
<div class="text-num">{{ textNum }}/{{ maxNum }}</div>
</div>
<div v-show="emotionStatus" class="emotion-panel">
<emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import WTextarea from './WTextarea'
import EmotionWords from './EmotionWords'
export default {
data() {
return {
textNum: 0,
limitContent: '',
emotionStatus: false
}
},
props: {
btnList: {
type: Array,
default: () => []
},
mapList: {
type: Array,
default: () => []
},
maxNum: {
typr: Number,
default: 200
}
},
components: {
WTextarea,
EmotionWords
},
methods: {
selectItem(item) {
if (item.type == 1) {
this.selectEmotion()
} else {
this.selectTag(item.name)
}
},
//选择标签
selectTag(name) {
this.$refs.textContent.addTag(name)
},
updateText(val) {
const html = this.getTextValue(val),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
this.textNum = text.length
if (this.textNum > this.maxNum) {
this.textNum = this.maxNum
this.update(this.limitContent)
} else {
this.limitContent = val
}
},
//展开表情
selectEmotion() {
this.emotionStatus = !this.emotionStatus
},
//选择表情
handleEmotion(i) {
this.emotionStatus = false
const list = emoji.flat(Infinity)
let index = list.indexOf(i) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
},
getTextValue(val) {
const html = val ? val : this.$refs.textContent.$refs.wTextareaContent.innerHTML
const _this = this
const list = emoji.flat(Infinity)
let htm =
html &&
html
.replace(/<span>([\s\S]*?)<\/span>/g, '$1')
.replace(/<img.+?src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<br>/g, '\n')
htm = htm.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, (str, v) => {
return _this.mapList[v]
})
return (
htm &&
htm.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
)
},
update(attContent) {
if (!attContent) {
return
}
let content = attContent.replace(/(\$\{.+?\})/g, str => {
for (let i in this.mapList) {
if (this.mapList[i] == str) {
return `<wise id="1" contenteditable="false">${i}</wise>`
}
}
})
let htm =
content &&
content.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
if (htm.substr(-1, 1) == '>' && navigator.userAgent.indexOf('Firefox') > 0) {
htm += '&nbsp;'
}
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
const html = this.getTextValue(htm),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
this.textNum = text.length
if(this.textNum == 200) this.limitContent = htm
this.$refs.textContent.setFocus()
}, 100)
}
}
}
</script>
<style lang="scss" scoped>
.text-area {
background: #fff;
// width: 448px;
}
.btn-group-panel {
display: flex;
flex-wrap: wrap;
padding: 10px 0 10px 20px;
border: 1px solid #e5e5e5;
border-top: 0;
background: #fafbfe;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
.btn-group {
display: flex;
column-gap: 20px;
line-height: 20px;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
font-size: 16px;
color: #666;
cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
cursor: pointer;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
font-size: 0;
height: 40px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
}
}
.text-num {
padding-right: 10px;
font-size: 14px;
color: #999999;
position: absolute;
right: -85px;
}
}
.date-picker {
margin-top: 10px;
font-size: 14px;
color: #999;
}
</style>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: * @version:
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-30 16:27:13 * @LastEditTime: 2023-06-25 14:57:05
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
name: 'emotionWords',
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
<template>
<div class="w-textarea" ref="wTextarea">
<div contenteditable="true" class="w-textarea_input" ref="wTextareaContent" :id="contentId" @keydown="textareaKeydown($event)" @click="inputClick($event)" @focus="onFocus" @blur="onBlur" @keydown.delete="handleDelete($event)" @input="handleInput($event.target)"></div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'wTextarea',
data() {
return {
// 记录currentText以计算长度
currentText: this.value,
// 为input区域生成随机id,当在页面上有多个组件时,用于监听光标的变化
contentId: `content${this.getGuid()}`,
// 输入的时候锁定,禁止更新innerHTML
isLocked: false,
isInsert: false,
// 记录当前选中tag的ID
currentTagId: null,
// 当前光标位置
savedRange: {}
}
},
props: {
value: {
type: String,
default: ''
},
tag: {
// 自定义模版标签的标签名
type: String,
// 默认使用wise作为标签名,并添加了默认样式
// 当使用其他标签名的时候,需要另写标签样式
default: 'wise'
},
tools: {
// 自定义扩展功能:超链接'link',模版标签'tag'
type: Array,
default() {
return [
{ type: 'link', text: '添加超链接' },
{ type: 'tag', text: '添加模版标签' }
]
}
},
maxlength: {
// 最大输入长度
type: [String, Number],
default: ''
}
},
computed: {
count() {
// 字符长度记数
let num = this.maxlength - this.currentText.length
let text = num < 0 ? `已超出${Math.abs(num)}个字符` : `还可以输入${num}个字符`
return { num, text }
}
},
mounted() {
// 初始化数据
this.currentText && (this.$refs.wTextareaContent.innerHTML = this.currentText)
// 创建模版标签的style
this.createStyle()
// 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler)
},
beforeDestroy() {
// 卸载事件
document.removeEventListener('selectionchange', this.selectHandler)
},
methods: {
updateData(text) {
this.$emit('input', text)
},
createStyle() {
// 为自定义的模版标签添加样式,使之不可编辑
let style = document.createElement('style')
style.innerHTML = `.w-textarea ${this.tag} {
cursor: default;
-webkit-user-modify: read-only !important;
}`
this.$refs.wTextarea.appendChild(style)
},
closeModal() {
this.form.text = ''
this.showModal = false
},
openTagDialog(type) {
// if (addLink)
// 将事件抛给父组件处理
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type)
},
textareaKeydown(event) {
if (event.keyCode == 13) {
this.insertHtml('<br>')
let nn = document.createElement('br')
document.querySelector('.w-textarea_input').appendChild(nn)
return false
}
},
/*换行*/
insertHtml(html) {
var sel, range
if (window.getSelection) {
// IE9 或 非IE浏览器
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
// Range.createContextualFragment() would be useful here but is
// non-standard and not supported in all browsers (IE9, for one)
var el = document.createElement('div')
el.innerHTML = html
var frag = document.createDocumentFragment(),
node,
lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
// Preserve the selection
if (lastNode) {
range = range.cloneRange()
range.setStartAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
} else if (document.selection && document.selection.type != 'Control') {
// IE < 9
document.selection.createRange().pasteHTML(html)
}
const htm = document.querySelector('.w-textarea_input').innerHTML
this.subText(htm)
},
addTag(text) {
// 创建模版标签
let node = document.createElement(this.tag)
if (navigator.userAgent.indexOf('Firefox') > 0) {
node.setAttribute('contenteditable', 'false')
}
node.innerText = text
// 添加id便于删除
node.id = this.getGuid()
this.insertNode(node)
},
addNode() {
let target = this.$refs.wTextareaContent
this.updateData(target.innerHTML)
},
addLink(text, url) {
// 创建a标签
let node = document.createElement('a')
node.innerText = text
node.href = url
node.target = 'blank'
this.insertNode(node)
},
addImg(url) {
// 创建a标签
let node = document.createElement('img')
node.src = url
// node.setAttribute('ondragstart', 'return false;')
this.insertNode(node)
},
onFocus() {
this.isLocked = true
this.isInsert = true
},
onBlur() {
this.isLocked = false
},
insertNode(node) {
// 在内容中插入标签
// 删掉选中的内容(如有)
if (this.savedRange.startContainer) {
this.insertNodeFirst(node)
} else {
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
this.insertNodeFirst(node)
document.querySelector('.w-textarea_input').blur()
}, 100)
}
},
subText(htm) {
const list = emoji.flat(Infinity)
const cutImg = htm
.replace(/<span>([\s\S]*?)<\/span>/g, '$1')
.replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, '$1')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = replaceImg
this.$emit('updateText', this.currentText)
},
insertNodeFirst(node) {
this.savedRange.deleteContents()
// 插入链接
if (this.isInsert) {
this.savedRange.insertNode(node)
} else {
document.querySelector('.w-textarea_input').appendChild(node)
}
if (navigator.userAgent.indexOf('Chrome') != -1) {
this.savedRange.insertNode(document.createElement('span'))
}
this.isInsert = false
// 更新双向绑定数据
let target = this.$refs.wTextareaContent
if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) {
this.updateData(target.innerHTML + '&nbsp;')
} else {
this.updateData(target.innerHTML)
}
let htm = target.innerHTML
this.subText(htm)
},
placeCaretAtEnd(el) {
//传入光标要去的jq节点对象
el.focus()
if (typeof window.getSelection != 'undefined' && typeof document.createRange != 'undefined') {
var range = document.createRange()
range.selectNodeContents(el)
range.collapse(false)
var sel = window.getSelection()
sel.removeAllRanges()
sel.addRange(range)
} else if (typeof document.body.createTextRange != 'undefined') {
var textRange = document.body.createTextRange()
textRange.moveToElementText(el)
textRange.collapse(false)
textRange.select()
}
},
handleInput(target) {
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
this.subText(htm)
},
handleDelete(e) {
// 监听“删除”事件
if (this.currentTagId) {
// 若已选中模版标签,直接删除dom节点
let t = document.getElementById(this.currentTagId)
this.$refs.wTextareaContent.removeChild(t)
this.currentTagId = null
// 阻止浏览器默认的删除事件,并手动更新数据
e.preventDefault()
this.handleInput(e.target)
}
},
inputClick(e) {
// 监听点击事件
this.isLocked = true
const TAG_NAME = e.target.nodeName
if (TAG_NAME === this.tag.toUpperCase()) {
// 点击模版标签时,记录id
this.currentTagId = e.target.id
e.target.className = 'active'
} else if (this.currentTagId) {
// 清空active样式
let target = document.getElementById(this.currentTagId)
target.className = ''
this.currentTagId = null
} else {
this.currentTagId = null
}
},
getGuid() {
// 生成随机ID
return 1
// return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
},
selectHandler() {
// 监听选定文本的变动
let sel = window.getSelection()
let range = sel.rangeCount > 0 ? sel.getRangeAt(0) : null
if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) {
this.savedRange = range
}
}
},
watch: {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (!this.isLocked) {
this.$refs.wTextareaContent.innerHTML = val
}
}
}
}
</script>
<style lang="scss">
.w-textarea {
wise {
user-select: none;
border-radius: 2px;
background-color: transparent;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 0px;
margin: 0 2px;
color: #26a2ff;
// padding: 0 1px;
white-space: nowrap;
user-select: none;
cursor: default;
-webkit-user-modify: read-only !important;
}
img {
width: 18px;
height: 18px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
vertical-align: middle;
}
.active {
background: #dcdfe6;
}
}
</style>
<style lang="scss" scoped>
$borderColor: #e5e5e5;
$bgColor: #f5f7fa;
$textColor: #666;
.w-textarea {
width: 100%;
box-sizing: border-box;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border: 1px solid $borderColor;
position: relative;
overflow-y: auto;
&_input {
width: 100%;
height: 200px;
min-height: 100px;
box-sizing: border-box;
padding: 10px;
line-height: 1.5;
word-break: break-word;
// 允许编辑,禁止富文本
-webkit-user-modify: read-write-plaintext-only !important;
&:focus {
outline: none;
}
}
&_tools {
padding: 0 10px;
height: 40px;
line-height: 40px;
border-top: 1px solid $borderColor;
background-color: $bgColor;
color: $textColor;
font-size: 12px;
&__item {
display: inline-block;
line-height: 1;
padding: 5px 8px;
margin-right: 8px;
color: $textColor;
cursor: pointer;
border: 1px solid $borderColor;
border-radius: 4px;
background: #fff;
transition: all 0.3s;
&:hover {
background: $bgColor;
opacity: 0.7;
}
&:focus {
outline: none;
}
}
&__text {
display: inline-block;
line-height: 40px;
padding: 0 8px;
float: right;
color: $textColor;
cursor: default;
transition: all 0.3s;
&:hover {
opacity: 1;
}
&.__danger {
color: red;
}
}
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-10 15:19:23
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im
-->
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-10 14:48:12
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="activity"> <div class="text-area">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> <w-textarea ref="textContent" v-model="textValue" @updateText="updateText"></w-textarea>
<!-- 表格区域 开始 --> <div class="btn-group-panel">
<div class="container"> <div class="btn-group">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <div class="add-btn" v-for="(item, k) in btnList" :key="k" @click="selectItem(item)">
<div class="flex-between title"> <template v-if="item.type == 1">
<div class="title-text">专员列表</div> <img class="emotion-item" src="@/assets/textarea/expression.png" />
<template v-if="activeName == 'first'"> <span class="emotion-item">{{ item.name }}</span>
<el-button :size="size" type="primary" class="battle-set-btn" @click="battleSetHandle">批量配置专员</el-button>
</template> </template>
</div> <template v-else>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable"> <img class="emotion-item" src="@/assets/textarea/add.png" />
<div slot="activityTime" slot-scope="scope">{{ dateFormatFun(scope.scope.startTime) }}-{{ dateFormatFun(scope.scope.endTime) }}</div> <span class="emotion-item">{{ item.name }}</span>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleClose(scope.scope, 'close')" v-if="scope.scope.actionReportSendFlag == 1">关闭</el-button>
<el-button type="text" @click="handleClose(scope.scope, 'open')" v-else>打开</el-button>
<el-button type="text" v-if="scope.scope.reportStaffs.length == 0" @click="handlebattleOn(scope.scope)">配置</el-button>
<el-button type="text" v-else @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
</div>
</GLTable>
</div>
<GLDialog mode="big" :before-close="handlebattleClose" class="battle-dialog" bigTitle="配置专员" @onOk="handlebattleConfirm" @onCancel="handlebattleClose" :visible.sync="battleVisible" :beforeSearchFn="beforeSearchFn">
<div class="gl-form-page gl-form-min">
<el-form ref="form" label-width="154px">
<el-form-item label="发送人员:">
<el-radio-group v-model="config.staffType" @change="changeType">
<el-radio v-model="radio" label="1">全部人员</el-radio>
<el-radio v-model="radio" label="2">指定人员</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属企业:">
<el-radio-group v-model="config.merchantId" @change="changeRadio">
<template v-for="(item, index) in merchantList">
<el-radio :key="index" :label="item.merchantId">{{ item.merchantName }}</el-radio>
</template>
</el-radio-group>
</el-form-item>
<el-form-item label="人员选择:" v-show="config.staffType == 2">
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择成员
</el-button>
<div class="el-input-tag input-tag-wrapper" v-show="userList.length">
<GLFull :label="tag.staffName" :identi="`${tag.id}`" labelWidth="110" textType="user" :haveClose="true" v-for="(tag, idx) in userList" :key="idx" @handleRemove="removeStaff(idx)"></GLFull>
</div>
</el-form-item>
<!-- 战报自动发送 -->
<el-form-item class="select-wrap" label="战报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openMenu(1)">
<span v-if="!wechat.battleStaffName" class="placeholder">选择成员</span>
{{ wechat.battleStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(1)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 1 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(1)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 1">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 喜报自动发送 -->
<el-form-item class="select-wrap" label="喜报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="happyRef">
<div class="el-input__inner" @click="openMenu(2)">
<span v-if="!wechat.goodStaffName" class="placeholder">选择成员</span>
{{ wechat.goodStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(2)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 2 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(2)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 2">
<gl-select-menu :domEl="happyEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterTextH"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="treeH" @node-click="handleNodeClick"></el-tree>
</template> </template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 关联群 -->
<el-form-item class="select-wrap" label="关联群:">
<div class="common el-form-item__content">
<div class="el-input" ref="groupRef">
<div class="el-input__inner" @click="openMenu(3)">
<span class="placeholder" v-if="wechat.roomName == ''">选择选择群</span>
{{ wechat.roomName }}
</div>
<span class="el-input__suffix" @click="openMenu(3)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 3 ? 'is-reverse' : '']"></i></span>
</span>
</div> </div>
</div> </div>
<transition name="el-zoom-in-top" v-if="menuIndex == 3">
<gl-select-menu :domEl="domEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="i in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="i" @click="selectGroup(i)">
<span>{{ i.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div> </div>
</gl-select-menu> <div v-show="emotionStatus" class="emotion-panel">
</transition> <emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words>
</el-form-item>
<el-form-item class="select-wrap" label="群名:">
<el-input v-model="groupName" placeholder="请输入群名" @blur="importGroup"></el-input>
</el-form-item>
</el-form>
</div> </div>
</GLDialog>
<GLDialog :mode="mode" title="选择员工" @onOk="handlestaffbattleConfirm" @onCancel="handlestaffbattleClose" :visible.sync="battlestaffVisible">
<SelectMember ref="selectMember" :selectlist="userList" v-if="battlestaffVisible" :merchantId="config.merchantId"></SelectMember>
</GLDialog>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import emoji from '@/utils/emo'
import url from '@/assets/empty.png' import WTextarea from './components/WTextarea'
import { dateFormat } from '../../utils/index' import EmotionWords from './components/EmotionWords'
import SelectMember from '../battle/components/SelectMember.vue'
import GlSelectMenu from '../battle/components/select-dropdown.vue'
export default { export default {
components: {
SelectMember,
GlSelectMenu
},
data() { data() {
return { return {
groupName: '', btnList: [
isgroup: true,
isAutomatic: true,
menuIndex: 0,
merchantId: '',
merchantName: '',
activeName: 'first',
size: 'small',
mode: 'mid',
battleVisible: false,
battlestaffVisible: false,
url: url,
setectList: [],
setectEditList: [],
merchantList: [],
groupList: [],
tabPaneList: [
{
label: '进行中',
name: 'first'
},
{ {
label: '已结束', type: 1,
name: 'second' name: '表情'
}
],
searchFormData: [
{
label: '活动门店',
name: 'merchantName',
type: 'input'
},
{
label: '活动名称',
name: 'activityNames',
type: 'select',
width: '215px',
multiple: true,
attrs: {
multipleLimit: 10
},
noFilter: false,
optionList: [],
optionId: 'confId',
optionLabel: 'confName'
}, },
{ {
label: '活动类型', type: 2,
name: 'marketingType', name: '销售顾问'
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'activityTypeList'
}
],
tableSearchForm: {
merchantName: '',
activityName: '',
activityType: ''
}, },
// 表格
userList: [],
selectArray: [],
getListApi: this.$apis.battle.getActivitylist,
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
// // 行数据的key
mutiSelectUniqueKey: 'activityId',
// 多选ref的名称
mutiSelectName: 'activity',
tableColumns: [
{ {
label: '活动名称', type: 2,
prop: 'activityName' name: '客户姓名'
}, },
{ {
label: '活动门店', type: 2,
prop: 'merchantName' name: '车型'
}, },
{ {
label: '活动类型', type: 2,
prop: 'marketingType', name: '订单总金额'
formatter: cellValue => {
const data = this.baseData.activityTypeList.filter(item => item.confId == cellValue.marketingType)
return data.length > 0 ? data[0].confName : '--'
}
}, },
{ {
label: '活动时间', type: 2,
addHtml: 'activityTime' name: '阳光激励费'
}, },
{ {
label: '负责人', type: 2,
formatter: val => { name: '商品名称'
return val.reportStaffs.length > 0 ? val.reportStaffs.map(item => item.staffName).join('、') : '--'
},
prop: 'reportStaffs',
line: 1,
width: 300
} }
] ],
}, emotionStatus: false
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
defaultProps: {
children: 'children',
label: 'name'
},
expandedKeys: [],
filterText: '',
filterTextH: '',
automaticData: [],
stageList: [],
roomName: '',
config: {
merchantId: '',
staffType: '2'
},
wechat: {
battleStaffName: '',
goodStaffName: '',
roomName: ''
},
idBefEncryptionBattle: '',
idBefEncryptionGood: '',
baseData: {
activityTypeList: [
{ confId: '3', confName: '众筹' },
{ confId: '5', confName: '膨胀金' }
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getCrowdfundingParams()
this.getMerchantList()
},
computed: {
domEl() {
return this.$refs.groupRef
},
automaticEl() {
return this.$refs.automaticRef
},
happyEl() {
return this.$refs.happyRef
}
},
watch: {
activeName: {
handler(val) {
if (val == 'first') {
this.tableParams.tableOption = true
this.$nextTick(() => {
this.tableParams.mutiSelectUniqueKey = 'activityId'
this.tableParams.mutiSelectName = 'activityId'
})
} else {
this.tableParams.tableOption = false
this.$nextTick(() => {
this.tableParams.mutiSelectUniqueKey = ''
this.tableParams.mutiSelectName = ''
})
} }
}, },
immediate: true components: {
}, WTextarea,
idBefEncryptionBattle(val) { EmotionWords
this.importGroup()
},
idBefEncryptionGood(val) {
this.importGroup()
},
filterText(val) {
this.$refs.tree.filter(val)
},
filterTextH(val) {
this.$refs.treeH.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { selectItem(item) {
if (refreshSigle) { if (item.type == 1) {
var item = this[formName].find(k => k.name == refreshSigle) this.selectEmotion()
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else { } else {
this[formName].forEach((item, index) => { this.selectTag(item.name)
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
async getCrowdfundingParams() {
/**参数类型 1:众筹活动名称(返回类型String),2:众筹活动门店 */
const funding = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 1
})
const gold = await this.$apis.seckillActivity.getCrowdGoldParams({
parameterType: 1
})
const activity = [...funding?.parameters, ...gold?.parameters]
let activityNameList = []
activity.map(e => {
activityNameList.push({
confId: e,
confName: e
})
})
this.$set(this.searchFormData[1], 'optionList', this.$common.utils.deepClone(activityNameList))
},
clearData() {
// this.setectList = []
this.config.merchantId = this.merchantId
this.config.staffType = '2'
this.wechat = {
battleStaffName: '',
goodStaffName: '',
roomName: ''
} }
this.groupName = ''
this.hideSelect()
}, },
filterNode(value, data) { //选择标签
if (!value) return true selectTag(name) {
return data.name.indexOf(value) !== -1 this.$refs.textContent.addTag(name)
}, },
filterRoomName(value) { //展开表情
this.stageList = this.groupList.filter(item => { selectEmotion() {
if (item.roomName.indexOf(value) !== -1) { this.emotionStatus = !this.emotionStatus
return item
}
})
}, },
handleNodeClick(data) { //选择表情
this.setSendName(data.name, data.staffId) handleEmotion(i) {
// this.wechat.roomName = '' this.emotionStatus = false
if (this.menuIndex == 1) { const list = emoji.flat(Infinity)
this.idBefEncryptionBattle = data.idBefEncryption let index = list.indexOf(i) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
} }
if (this.menuIndex == 2) { this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
this.idBefEncryptionGood = data.idBefEncryption
}
this.hideSelect()
},
setSendName(name, staffId, isClear, i) {
console.log(staffId, this.wechat.battleStaffId, i)
if (this.menuIndex == 1 || i == 1) {
if (staffId == this.wechat.battleStaffId && staffId) return
Object.assign(this.wechat, { battleStaffName: name, battleStaffId: staffId })
}
if (this.menuIndex == 2 || i == 2) {
if (staffId == this.wechat.goodStaffId && staffId) return
Object.assign(this.wechat, { goodStaffName: name, goodStaffId: staffId })
}
console.log(this.wechat)
if (isClear && !this.wechat.battleStaffName && !this.wechat.goodStaffName) {
this.wechat.roomName = ''
this.groupList = []
return
}
if (isClear && (this.wechat.battleStaffName || this.wechat.goodStaffName)) return
this.wechat.roomName = ''
this.getGroupList()
},
hideSelect() {
this.menuIndex = 0
},
selectGroup(data) {
this.hideSelect()
this.wechat.roomName = data.roomName
const { goodStaffId, battleStaffId } = this.wechat
if (this.wechat.battleStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == battleStaffId)?.staffCloudId
this.wechat.battleGroupId = staffCloudId + '_R:' + data.roomIdOnly
}
if (this.wechat.goodStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == goodStaffId)?.staffCloudId
this.wechat.goodGroupId = staffCloudId + '_R:' + data.roomIdOnly
}
// this.wechat.groupId = data.roomChatId
},
importGroup() {
if (this.wechat.roomName) return
if (this.wechat.battleStaffName) {
this.wechat.battleGroupId = this.idBefEncryptionBattle + '_R:' + this.groupName
}
if (this.wechat.goodStaffName) {
this.wechat.goodGroupId = this.idBefEncryptionGood + '_R:' + this.groupName
}
},
openMenu(e) {
if (e == this.menuIndex) return (this.menuIndex = 0)
this.menuIndex = e
},
removeStaff(index) {
this.userList.splice(index, 1)
},
//所属企业
changeRadio(val) {
if (this.config.staffType == 1) this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.merchantName = item.merchantName) : ''
})
this.userList = []
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
this.config.merchantId = this.merchantList && this.merchantList[0].merchantId
this.merchantId = this.merchantList && this.merchantList[0].merchantId
this.merchantName = this.merchantList && this.merchantList[0].merchantName
})
},
changeType(val) {
if (val == 1) {
this.getDepartmentTree()
} else {
this.userList = []
}
},
handleClose(scope, status) {
const info = status == 'close' ? '关闭' : '打开'
const infoN = status == 'close' ? '取消' : '恢复'
this.$confirm(`${info}则${infoN}战报发送功能,是否确认${info}?`, info, {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.activityOpen(scope)
})
.catch(() => {
// this.$message({
// type: 'info',
// message: '已取消'
// })
})
},
activityOpen(scope) {
const { activityId, actionReportSendFlag } = scope
this.$apis.battle
.activityOpen({
activityId,
actionReportSendFlag: actionReportSendFlag == 1 ? 2 : 1
})
.then(res => {
if (res) {
this.handleSearch()
this.$message.success('操作成功')
}
})
},
battleSetHandle() {
if (this.setectList.length == 0) {
this.$message({
message: '请选择活动',
type: 'error'
})
return
}
this.getDepartmentTree()
this.userList = []
// this.editStatus = false
this.battleVisible = true
},
dateFormatFun(date) {
return dateFormat(date)
},
selectionTable(val) {
this.setectList = val
},
handlestaffbattleConfirm() {
this.battlestaffVisible = false
this.userList = this.$refs.selectMember.userList
},
handlestaffbattleClose() {
this.battlestaffVisible = false
},
openMembers() {
this.battlestaffVisible = true
// if (this.ids.length > 0) {
// this.$refs.selectMember.$refs.tree.setCheckedKeys(this.ids)
// }
},
handlebattleConfirm() {
if (this.userList.length == 0) {
this.$message({
message: '请选择专员',
type: 'error'
})
return
}
if (this.wechat.battleStaffName !== '' && this.wechat.roomName == '' && !this.groupName) {
this.$message({
message: '请选择关联群',
type: 'error'
})
return
}
let staffRequestList = []
let batchstaffRequestList = []
this.userList.forEach(item => {
staffRequestList.push({
staffId: item.staffId,
staffName: item.staffName,
merchantId: this.config.merchantId,
merchantName: this.merchantName,
userId: item.userId
})
})
const setectList = this.setectEditList.length ? this.setectEditList : this.setectList
setectList.forEach(item => {
let autoStaff = {}
if (Object.keys(this.wechat).length) {
const { battleStaffId, battleStaffName, battleGroupId, goodStaffName, roomName, goodGroupId, goodStaffId } = this.wechat
autoStaff = {
battleStaffId,
battleStaffName,
battleGroupId,
goodGroupId,
goodStaffName,
goodStaffId,
autoGroupName: roomName ? roomName : this.groupName,
autoGroupMerchantId: this.$merchantId
}
}
batchstaffRequestList.push({
activityId: item.activityId,
...autoStaff,
staffRequestList
})
})
this.$apis.battle.insertStaff({ batchstaffRequestList, staffType: this.config.staffType }).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.battleVisible = false
this.handleSearch()
this.activeName = 'first'
this.clearData()
}
})
},
handlebattleClose() {
this.clearData()
this.setectEditList = []
this.battleVisible = false
},
handleDetails() {},
handlebattleOn(data, sign) {
this.setectEditList = []
this.userList = []
this.wechat = {
battleStaffName: '',
roomName: '',
goodStaffName: ''
}
this.setectEditList.push(data)
this.battleVisible = true
if (sign) {
this.getStaffList(data)
}
this.getDepartmentTree()
},
clearWechat(i) {
this.setSendName('', '', true, i)
},
//获取编辑
getStaffList(data) {
this.$apis.battle.getStaffList({ id: data.activityId }).then(res => {
this.config.merchantId = res.staffs[0].merchantId
this.merchantId = res.staffs[0].merchantId
this.merchantName = res.staffs[0].merchantName
this.userList = res.staffs
this.config.staffType = res.staffType + ''
// this.wechat.staffId = res.autoStaffId
// this.wechat.battleStaffName = res.autoStaffName
// this.wechat.groupId = res.autoGroupId
// this.wechat.roomName = res.autoGroupName
const { goodStaffId, goodStaffName, battleStaffId, battleStaffName, goodGroupId, battleGroupId, autoGroupName, autoGroupMerchantId } = res
this.wechat = {
goodStaffId,
goodStaffName,
battleStaffId,
battleStaffName,
goodGroupId,
battleGroupId,
roomName: '',
autoGroupMerchantId
}
const groupId = battleGroupId || goodGroupId
if (groupId.split('_R:')[1] == autoGroupName) {
this.groupName = autoGroupName
this.idBefEncryptionBattle = battleGroupId.split('_R:')[0]
this.idBefEncryptionGood = goodGroupId.split('_R:')[0]
} else {
this.wechat.roomName = autoGroupName
}
this.getGroupList(this.wechat.staffId)
})
},
getGroupList(id) {
const { battleStaffId, goodStaffId } = this.wechat
const msgStaffIdList = [battleStaffId, goodStaffId]
this.$apis.battle.getGroupList({ msgStaffIdList, unionRoom: true }).then(res => {
if (res.code == 0) {
this.groupList = res.data
}
})
},
handleSetting() {
this.drawer = true
},
handleClick() {
this.handleSearch()
},
handleReset() {
this.tableSearchForm = {}
this.handleSearch()
},
getParams() {
let params = {
...this.tableSearchForm
}
this.activeName == 'first' ? (params.activityStatus = 2) : (params.activityStatus = 3)
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
},
async getDepartmentTree() {
// let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId,loginStatus:1 }
let params = { addChildrensFlag: true, queryMerchantId: this.$merchantId, loginStatus: 1 }
let data = await this.$apis.battle.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
await this.initData(this.automaticData)
this.expandedKeys = [this.automaticData[0]?.id]
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
}
children.length && this.initData(children)
})
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style lang="scss" scoped>
.activity { .text-area {
/deep/ { background: #fff;
.el-select .el-tag { // width: 448px;
max-width: 60% !important; }
} .btn-group-panel {
.el-form-item__content {
overflow: inherit !important;
}
}
.container {
margin-top: 16px;
.title {
height: 32px;
line-height: 32px;
margin-bottom: 10px;
.title-text {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-left: 4px;
}
}
}
.empty-btn {
position: absolute;
right: -40px;
top: 0px;
font-size: 14px;
color: #5850ff;
}
.config-pannel {
background: #f9f9f9;
width: 520px;
height: 168px;
display: flex; display: flex;
.config-item { justify-content: space-between;
padding: 26px 20px;
}
.clear-btn {
cursor: pointer;
background: #f1f1f1;
width: 40px;
height: 100%;
line-height: 20px;
font-size: 14px;
color: #666666;
padding: 60px 13px;
box-sizing: border-box;
}
}
.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: #666;
display: inline-block;
outline: none;
padding: 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap; flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); padding: 10px 0 10px 20px;
width: 450px; border: 1px solid #e5e5e5;
border-top: 0;
background: #fafbfe;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
.btn-group {
display: flex; display: flex;
justify-content: space-around;
gap: 20px;
.add-btn {
display: inline-flex;
position: relative;
align-items: center; align-items: center;
margin-top: 6px; font-size: 16px;
font-size: 14px; color: #666;
i { cursor: pointer;
color: #75acff; span {
margin-right: 3px;
font-size: 14px; font-size: 14px;
margin-left: 5px;
cursor: pointer;
} }
/deep/ .el-tag { input {
background-color: #fff !important; position: absolute;
margin-bottom: 4px; width: 100%;
} cursor: pointer;
} font-size: 0;
.select-wrap { height: 40px;
.common {
margin: 4px 0;
height: 40px !important;
overflow: hidden;
/deep/ .el-input {
height: 40px !important;
line-height: 40px !important;
} }
/deep/ .el-input__suffix { img {
height: 40px !important; width: 16px;
margin-top: -4px; height: 16px;
.is-reverse { cursor: pointer;
transform: rotate(180deg);
} }
.el-link {
position: absolute;
width: 100%;
} }
} }
} }
} .text-num {
.search-groomname { padding-right: 10px;
width: 252px;
margin: 12px 16px 0;
/deep/.el-input {
width: 252px;
} }
} }
.filter-tree { .date-picker {
padding: 0 16px; margin-top: 10px;
}
.empty {
padding: 10px 0;
margin: 0;
text-align: center;
color: #999;
font-size: 13px;
}
.placeholder {
font-size: 14px; font-size: 14px;
color: #c0c6ce; color: #999;
line-height: 20px;
} }
</style> </style>
<template>
<div class="marketing">
<div class="addConfig-wrap">
<div class="header color-3 weight-6 text-16">
门店配置
<span class="weight-5 color6 font-14 ml12">{{ merchantName }}</span>
</div>
<div class="config-wrap gl-form-page">
<el-form ref="form" :model="form" label-width="154px">
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
<!-- 推送人 -->
<el-form-item class="select-wrap" label="推送人:" prop="staffId">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openAutomatic">
<span v-if="wechat.automaticName == ''" class="placeholder">选择成员</span>
{{ wechat.automaticName }}
</div>
<span class="el-input__suffix" @click="openAutomatic">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isAutomatic ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!isAutomatic">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect" style="width:432px">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- #喜报>> : -->
<template v-for="(bulletin, index) in buttetinList">
<el-form-item :label="'#' + (index + 1) + bulletin.label + '>>' + ':'" class="group-item-box" :key="index">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput[bulletin.storageList]" :key="k">
<!-- <el-input v-model="i.name" ></el-input> -->
<el-select v-model="i.name" :placeholder="'将' + bulletin.label + '推送至群聊'" filterable clearable>
<el-option v-for="item in selectGroupName" :key="item.groupName" :label="item.groupName" :value="item.groupName"></el-option>
</el-select>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput[bulletin.storageList])"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput[bulletin.storageList], k)"></i>
</div>
</div>
<span class="group-config-text" @click="openConfigDialog(bulletin.componentName)">配置</span>
</el-form-item>
</template>
</el-form>
</div>
</div>
<GLFooter class="footer-panel">
<el-button @click="handlebattleClose" size="medium">取消</el-button>
<el-button type="primary" @click="handlebattleConfirm" size="medium" :loading="loading">保存</el-button>
</GLFooter>
<component :is="dialogComponent" ref="componentRef" v-if="isDialogVisible" :isDialogVisible="isDialogVisible" :switchList="switchList" @handlePreview="handlePreview" @handleClose="handleClose"></component>
</div>
</template>
<script>
import GlSelectMenu from '../battle/components/select-dropdown.vue'
import personalDialog from './components/dialogs/personalDialog.vue'
import xibaoDialog from './components/dialogs/xibaoDialog.vue'
import bulletinDialog from './components/dialogs/bulletinDialog.vue'
import charactersDialog from './components/dialogs/charactersDialog.vue'
import dailyDialog from './components/dialogs/dailyDialog.vue'
import progressDialog from './components/dialogs/progressDialog.vue'
import replenishmentDialog from './components/dialogs/replenishmentDialog.vue'
export default {
components: {
GlSelectMenu,
personalDialog,
xibaoDialog,
bulletinDialog,
charactersDialog,
dailyDialog,
progressDialog,
replenishmentDialog
},
data() {
return {
selectGroupName: [],
isDialogVisible: false,
merchantName: '',
paramsData: this.$route.query,
dialogComponent: '',
merchantList: [],
automaticData: [],
expandedKeys: [],
defaultProps: {
children: 'children',
label: 'name'
},
config: {
merchantId: ''
},
isAutomatic: true,
filterText: '',
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
groupCofList: {
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: [],
wordReport: []
},
switchList: {
// xiReport: [],
zhanReport: [{ switchType: 201, switchStatus: 'Y', actionReportType: 2 }],
orderReport: [],
saReport: [
{ switchType: 401, switchStatus: 'Y', actionReportType: 4 },
{ switchType: 402, switchStatus: 'Y', actionReportType: 4 }
],
saPerReport: [
{ switchType: 501, switchStatus: 'Y', actionReportType: 5 },
{ switchType: 502, switchStatus: 'Y', actionReportType: 5 },
{ switchType: 503, switchStatus: 'Y', actionReportType: 5 },
{ switchType: 504, switchStatus: 'Y', actionReportType: 5, switchText: '' }
],
scheduleReport: [{ switchType: 601, switchStatus: 'Y', actionReportType: 6 }],
wordReport: [{ switchType: 701, switchStatus: 'Y', actionReportType: 7, switchText: '' }]
},
groupCofListInput: {
wordReportValue: [],
orderReportValue: [],
saReportValue: [],
saPerReportValue: [],
scheduleReportValue: [],
zhanReportValue: []
},
groupToType: [
// {
// attr: 'xiReport',
// type: 1
// },
{
attr: 'zhanReport',
type: 2
},
{
attr: 'orderReport',
type: 3
},
{
attr: 'saReport',
type: 4
},
{
attr: 'saPerReport',
type: 5
},
{
attr: 'scheduleReport',
type: 6
},
{
attr: 'wordReport',
type: 7
}
],
buttetinList: [
{
label: '.SA个人喜报',
storageList: 'saPerReportValue',
componentName: 'personalDialog'
},
{
label: '.SA喜报',
storageList: 'saReportValue',
componentName: 'bulletinDialog'
},
{
label: '.文字喜报',
storageList: 'wordReportValue',
componentName: 'charactersDialog'
},
{
label: '.早报',
storageList: 'zhanReportValue',
componentName: 'dailyDialog'
},
{
label: '.客户进度消息',
storageList: 'scheduleReportValue',
componentName: 'progressDialog'
},
{
label: '.补单通知',
storageList: 'orderReportValue',
componentName: 'replenishmentDialog'
}
]
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
},
computed: {
automaticEl() {
return this.$refs.automaticRef
}
},
mounted() {
let { data, sign } = this.paramsData
this.merchantName = data.merchantName + data.merchantId
this.getMerchantList(sign)
this.handlebattleOn(data, sign)
},
methods: {
handlePreview(params) {
let { key, data } = params
this.switchList[key] = data
this.isDialogVisible = false
},
handleClose() {
this.isDialogVisible = false
},
openConfigDialog(componentName) {
this.dialogComponent = componentName
this.isDialogVisible = true
},
addGroup(group) {
group.push({ name: '' })
},
delGroup(group, i) {
group.splice(i, 1)
},
hideSelect() {
this.isAutomatic = true
},
openAutomatic() {
this.isAutomatic = !this.isAutomatic
},
getMerchantList(sign) {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
if (!sign) {
this.config.merchantId = res[0]?.merchantId
this.config.merchantName = res[0]?.merchantName
}
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(data) {
this.hideSelect()
this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId
this.idBefEncryption = data.idBefEncryption
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || []
this.groupCofListInput = { wordReportValue: [{ name: '' }], orderReportValue: [{ name: '' }], saReportValue: [{ name: '' }], saPerReportValue: [{ name: '' }], scheduleReportValue: [{ name: '' }], zhanReportValue: [{ name: '' }] }
})
},
// 弹窗数据回显
initswitchList(switchList) {
switchList.forEach(item => {
this.groupToType.find(v => {
if (v.type == item.actionReportType) {
this.switchList[v.attr].push({
actionReportType: item.actionReportType,
switchStatus: item.switchStatus,
switchText: item.switchText,
switchType: item.switchType
})
}
})
})
},
handlebattleOn(data, sign) {
this.setectList = []
this.setectList.push(data)
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofListInput = {
// xiReportValue: [],
wordReportValue: [],
orderReportValue: [],
saReportValue: [],
saPerReportValue: [],
scheduleReportValue: [],
zhanReportValue: []
}
this.battleVisible = true
// 编辑
if (sign) {
this.wechat.staffId = data.staffId
this.wechat.automaticName = data.staffName
this.config.merchantId = data.enterpriseMerchantId
this.config.merchantName = data.enterpriseMerchantName
this.initswitchList(data.switchList)
data.groupConfigList.forEach(item => {
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr
if (!groupHideAttr) return
if (item.groupId) {
if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) {
groupHideAttr && this.groupCofListInput[groupHideAttr + 'Value'].push({ name: item.groupName })
this.idBefEncryption = item.groupId.split('_R:')[0]
} else if (item.groupName) {
groupHideAttr &&
this.groupCofList[groupHideAttr].push({
groupId: item.groupId,
roomName: item.groupName
})
} else {
this.idBefEncryption = item.groupId.split('_R:')[0]
groupHideAttr && this.groupCofListInput[groupHideAttr + 'Value'].push({ name: '' })
}
}
})
for (let k in this.groupCofListInput) {
if (this.groupCofListInput.hasOwnProperty(k) && !this.groupCofListInput[k][0]) {
this.groupCofListInput[k] = [{ name: '' }]
}
}
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || []
})
this.getGroupList(this.wechat.staffId)
} else {
this.groupCofListInput = {
// xiReportValue: [{ name: '' }],
wordReportValue: [{ name: '' }],
orderReportValue: [{ name: '' }],
saReportValue: [{ name: '' }],
saPerReportValue: [{ name: '' }],
scheduleReportValue: [{ name: '' }],
zhanReportValue: [{ name: '' }]
}
}
this.getDepartmentTree()
},
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: [],
wordReport: []
}
}
}
})
},
//所属企业
handleMerchatChange(val) {
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: [],
wordReport: []
}
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 }
let data = await this.$apis.saasOrder.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
await this.initData(this.automaticData)
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
}
children.length && this.initData(children)
})
},
clearData() {
this.setectList = []
this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = {
staffId: '',
automaticName: ''
}
this.hideSelect()
},
handlebattleConfirm() {
if (!this.wechat.staffId) {
this.$message({
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [],
groupConfigList: [],
merchantId: this.setectList[0]?.merchantId,
scene: 1
}
let switchList = []
let reportParams = ['saReport', 'zhanReport', 'orderReport', 'saPerReport', 'scheduleReport', 'wordReport']
reportParams.forEach(item => {
switchList.push(...this.switchList[item])
})
switchList.map(item => (item.switchStatus = item.switchStatus ? 'Y' : 'N'))
params.switchList = switchList
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
Object.keys(this.groupCofList).map(item => {
let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.$router.go(-1)
}
})
},
handlebattleClose() {
this.$router.go(-1)
this.clearData()
}
}
}
</script>
<style lang="scss" scoped>
.footer-panel {
margin-top: 20px;
}
.search-groomname {
width: 402px;
margin: 12px 16px 0;
/deep/.el-input {
width: 402px;
}
}
.addConfig-wrap {
background: #fff;
.header {
width: 100%;
height: 58px;
border-bottom: 1px solid #e5e5e5;
line-height: 58px;
padding-left: 20px;
}
.ml12 {
margin-left: 12px;
}
.config-wrap {
padding: 32px 20px;
min-height: 600px;
}
.group-item-box {
/deep/.el-form-item__content {
width: 392px;
}
}
.group-box {
width: 100%;
padding: 20px;
background: #f9f9f9;
.input-box {
display: flex;
align-items: center;
/deep/ {
.el-select,
.el-input {
width: 355px !important;
}
}
i {
cursor: pointer;
font-size: 20px;
color: #5850ff;
margin-left: 6px;
}
}
}
.group-config-text {
font-size: 12px;
color: #5850ff;
position: absolute;
left: 450px;
top: 20px;
white-space: nowrap;
cursor: pointer;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
}
</style>
<template>
<div>
<div>
<el-form ref="form"
:model="company"
label-width="154px"></el-form>
</div>
<div class="member-wrapper">
<div class="member-left">
<div class="member-content">
<div class="member-content-head">
<el-checkbox :indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
</div>
<div class="table-content">
<el-input size="medium"
v-model="filterText"
suffix-icon="el-icon-search"
clearable
placeholder="请输入搜索关键字"></el-input>
<el-tree :data="departmentList"
:default-expanded-keys="expandedKeys"
show-checkbox
ref="tree"
node-key="id"
:props="defaultProps"
@check="handleNodeClick"
:filter-node-method="filterNode"></el-tree>
</div>
</div>
</div>
<div class="member-right">
<div class="member-name member-content-head">
<div>已选名称</div>
<div class="blue"
@click="clear">清空</div>
</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(label, idx) in userList"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(idx)">
{{ label.name }}
</el-tag>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
newArr: [],
filterText: '',
userList: [],
isIndeterminate: false,
checkAll: false,
ids: [],
selectIds: [],
expandedKeys: [],
defaultIds: [],
departmentList: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
props: {
merchantId: {
type: String,
default: ''
},
selectlist: {
type: Array,
default: () => []
}
},
created() {
this.getDepartmentTree()
},
watch: {
filterText(val) {
console.log(val)
this.$refs.tree.filter(val)
},
selectlist(val) {
this.defaultData()
}
},
methods: {
clear() {
this.userList = []
this.$refs.tree.setCheckedKeys([])
this.handleNodeClick()
},
handleCheckAllChange(val) {
// console.log(this.ids)
val ? this.$refs.tree.setCheckedKeys(this.ids) : this.$refs.tree.setCheckedKeys([])
this.handleNodeClick()
this.isIndeterminate = false
},
defaultData() {
this.defaultIds = this.selectlist.map(item => item.staffId)
this.$refs.tree.setCheckedKeys(this.defaultIds)
this.handleNodeClick()
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
this.merchantId = this.merchantList[0].merchantId
this.merchantName = this.merchantList[0].merchantName
})
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.merchantId }
// let params = { addChildrensFlag: true, queryMerchantId: '44210895' }
let data = await this.$apis.battle.getlistDepartmentTree(params)
this.ids = []
this.departmentList = data
await this.initData(this.departmentList)
this.expandedKeys = [this.departmentList[0].id]
this.$nextTick(() => {
if (this.selectlist.length > 0) {
this.defaultData()
}
})
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
data.splice(index, 1)
}
children.length && this.initData(children)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
search() { },
handleNodeClick() {
this.userList = this.$refs.tree.getCheckedNodes().filter(item => item.children && item.children.length == 0)
this.isIndeterminate = this.userList.length > 0 && this.userList.length < this.ids.length
this.checkAll = this.userList.length === this.ids.length
},
remove(index) {
this.userList.splice(index, 1)
let ids = this.userList.map(item => item.staffId)
this.$refs.tree.setCheckedKeys(ids)
this.isIndeterminate = ids.length < this.ids.length
}
}
}
</script>
<style scoped lang="scss">
.member-wrapper {
display: flex;
.member-left {
width: 400px;
.member-content {
border: 1px solid #eee;
.member-content-head {
height: 44px;
line-height: 44px;
padding: 0 16px;
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
.el-input {
margin: 20px 20px 6px 20px;
width: 360px;
height: 36px;
box-sizing: border-box;
}
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 264px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 44px;
height: 44px;
border: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
.blue {
color: #5850ff;
cursor: pointer;
}
}
}
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
.table-content .el-tree {
margin: 0 20px 20px;
}
.member-right {
width: 300px;
margin-left: 14px;
}
.member-name {
font-size: 14px;
color: #333;
line-height: 60px;
height: 60px;
padding: 0 20px;
border: 1px solid #eee;
}
.input-tag-wrapper {
max-height: 456px;
overflow: scroll;
}
.tag-box {
margin: 12px 8px;
.el-tag {
margin-right: 4px;
margin-bottom: 4px;
background-color: #fff !important;
font-weight: 400;
font-size: 14px;
color: #666666;
line-height: 20px;
padding: 3px 8px;
height: auto;
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-21 19:07:21
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-21 20:12:35
* @FilePath: \scrm-micro-battles\src\views\bulletin\components\battle\components\select-dropdown.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="el-select-dropdown el-popper group-select" :style="groupStyle" v-bind="$attrs">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'ElSelectDropdown',
props: {
appendToBody: {
type: Boolean,
default: true
},
domEl: {
type: Object,
default: () => {}
}
},
componentName: 'selectyy',
data() {
return {
groupStyle: '',
includeData: ['el-input__inner', 'placeholder', 'el-select__caret el-input__icon el-icon-arrow-up']
}
},
mounted() {
if (this.appendToBody) document.body.appendChild(this.$el)
this.getBoundingClientRect()
window.addEventListener('resize', this.getBoundingClientRect)
document.addEventListener('click', e => {
if (!this.includeData.includes(e.target.className)) {
this.removeEl()
}
})
},
methods: {
getBoundingClientRect() {
let { left, top } = this.domEl.getBoundingClientRect()
this.groupStyle = { left: left + 'px', top: top + 45 + 'px' }
},
removeEl() {
document.body.contains(this.$el) && document.body.removeChild(this.$el)
this.$emit('changeStatu')
}
},
beforeDestroy() {
this.removeEl()
}
}
</script>
<style lang="scss" scoped>
.group-select {
min-width: 284px;
transform-origin: center top;
z-index: 10000;
position: fixed;
top: 740px;
left: 600px;
/deep/ .el-select-dropdown__item {
width: 236px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
</style>
<template>
<!-- 1.3 -->
<div class="activity">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<!-- 表格区域 开始 -->
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex-between title">
<div class="title-text">专员列表</div>
<template v-if="activeName == 'first'">
<el-button :size="size" type="primary" class="battle-set-btn" @click="battleSetHandle">批量配置专员</el-button>
</template>
</div>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div slot="activityTime" slot-scope="scope">{{ dateFormatFun(scope.scope.startTime) }}-{{ dateFormatFun(scope.scope.endTime) }}</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleClose(scope.scope, 'close')" v-if="scope.scope.actionReportSendFlag == 1">关闭</el-button>
<el-button type="text" @click="handleClose(scope.scope, 'open')" v-else>打开</el-button>
<el-button type="text" v-if="scope.scope.reportStaffs.length == 0" @click="handlebattleOn(scope.scope)">配置</el-button>
<el-button type="text" v-else @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
</div>
</GLTable>
</div>
<GLDialog mode="big" :before-close="handlebattleClose" class="battle-dialog" bigTitle="配置专员" @onOk="handlebattleConfirm" @onCancel="handlebattleClose" :visible.sync="battleVisible" :beforeSearchFn="beforeSearchFn">
<div class="gl-form-page gl-form-min">
<el-form ref="form" label-width="154px">
<el-form-item label="发送人员:">
<el-radio-group v-model="config.staffType" @change="changeType">
<el-radio v-model="radio" label="1">全部人员</el-radio>
<el-radio v-model="radio" label="2">指定人员</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属企业:">
<el-radio-group v-model="config.merchantId" @change="changeRadio">
<template v-for="(item, index) in merchantList">
<el-radio :key="index" :label="item.merchantId">{{ item.merchantName }}</el-radio>
</template>
</el-radio-group>
</el-form-item>
<el-form-item label="人员选择:" v-show="config.staffType == 2">
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择成员
</el-button>
<div class="el-input-tag input-tag-wrapper" v-show="userList.length">
<GLFull :label="tag.staffName" :identi="`${tag.id}`" labelWidth="110" textType="user" :haveClose="true" v-for="(tag, idx) in userList" :key="idx" @handleRemove="removeStaff(idx)"></GLFull>
</div>
</el-form-item>
<!-- 战报自动发送 -->
<el-form-item class="select-wrap" label="战报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openMenu(1)">
<span v-if="!wechat.battleStaffName" class="placeholder">选择成员</span>
{{ wechat.battleStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(1)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 1 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(1)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 1">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 喜报自动发送 -->
<el-form-item class="select-wrap" label="喜报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="happyRef">
<div class="el-input__inner" @click="openMenu(2)">
<span v-if="!wechat.goodStaffName" class="placeholder">选择成员</span>
{{ wechat.goodStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(2)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 2 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(2)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 2">
<gl-select-menu :domEl="happyEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterTextH"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="treeH" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 关联群 -->
<el-form-item class="select-wrap" label="关联群:">
<div class="common el-form-item__content">
<div class="el-input" ref="groupRef">
<div class="el-input__inner" @click="openMenu(3)">
<span class="placeholder" v-if="wechat.roomName == ''">选择选择群</span>
{{ wechat.roomName }}
</div>
<span class="el-input__suffix" @click="openMenu(3)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 3 ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 3">
<gl-select-menu :domEl="domEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="i in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="i" @click="selectGroup(i)">
<span>{{ i.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<el-form-item class="select-wrap" label="群名:">
<el-select v-model="groupName" placeholder="请选择" filterable clearable>
<el-option v-for="item in selectGroupName" :key="item.groupName" :label="item.groupName" :value="item.groupName"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</GLDialog>
<GLDialog :mode="mode" title="选择员工" @onOk="handlestaffbattleConfirm" @onCancel="handlestaffbattleClose" :visible.sync="battlestaffVisible">
<SelectMember ref="selectMember" :selectlist="userList" v-if="battlestaffVisible" :merchantId="config.merchantId"></SelectMember>
</GLDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { dateFormat } from '@/utils/index'
import SelectMember from './components/SelectMember.vue'
import GlSelectMenu from './components/select-dropdown.vue'
export default {
components: {
SelectMember,
GlSelectMenu
},
data() {
return {
selectGroupName: [],
groupName: '',
isgroup: true,
isAutomatic: true,
menuIndex: 0,
merchantId: '',
merchantName: '',
activeName: 'first',
size: 'small',
mode: 'mid',
battleVisible: false,
battlestaffVisible: false,
url: url,
setectList: [],
setectEditList: [],
merchantList: [],
groupList: [],
tabPaneList: [
{
label: '进行中',
name: 'first'
},
{
label: '已结束',
name: 'second'
}
],
searchFormData: [
{
label: '活动门店',
name: 'merchantName',
type: 'input'
},
{
label: '活动名称',
name: 'activityNames',
type: 'select',
width: '215px',
multiple: true,
attrs: {
multipleLimit: 10
},
noFilter: false,
optionList: [],
optionId: 'confId',
optionLabel: 'confName'
},
{
label: '活动类型',
name: 'marketingType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'activityTypeList'
}
],
tableSearchForm: {
merchantName: '',
activityName: '',
activityType: ''
},
// 表格
userList: [],
selectArray: [],
getListApi: this.$apis.battle.getActivitylist,
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
// // 行数据的key
mutiSelectUniqueKey: 'activityId',
// 多选ref的名称
mutiSelectName: 'activity',
tableColumns: [
{
label: '活动名称',
prop: 'activityName'
},
{
label: '活动门店',
prop: 'merchantName'
},
{
label: '活动类型',
prop: 'marketingType',
formatter: cellValue => {
const data = this.baseData.activityTypeList.filter(item => item.confId == cellValue.marketingType)
return data.length > 0 ? data[0].confName : '--'
}
},
{
label: '活动时间',
addHtml: 'activityTime'
},
{
label: '负责人',
formatter: val => {
return val.reportStaffs.length > 0 ? val.reportStaffs.map(item => item.staffName).join('、') : '--'
},
prop: 'reportStaffs',
line: 1,
width: 300
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
defaultProps: {
children: 'children',
label: 'name'
},
expandedKeys: [],
filterText: '',
filterTextH: '',
automaticData: [],
stageList: [],
roomName: '',
config: {
merchantId: '',
staffType: '2'
},
wechat: {
battleStaffName: '',
goodStaffName: '',
roomName: ''
},
idBefEncryptionBattle: '',
idBefEncryptionGood: '',
baseData: {
activityTypeList: [
{ confId: '3', confName: '众筹' },
{ confId: '5', confName: '膨胀金' }
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getCrowdfundingParams()
this.getMerchantList()
},
computed: {
domEl() {
return this.$refs.groupRef
},
automaticEl() {
return this.$refs.automaticRef
},
happyEl() {
return this.$refs.happyRef
}
},
watch: {
activeName: {
handler(val) {
if (val == 'first') {
this.tableParams.tableOption = true
this.$nextTick(() => {
this.tableParams.mutiSelectUniqueKey = 'activityId'
this.tableParams.mutiSelectName = 'activityId'
})
} else {
this.tableParams.tableOption = false
this.$nextTick(() => {
this.tableParams.mutiSelectUniqueKey = ''
this.tableParams.mutiSelectName = ''
})
}
},
immediate: true
},
// idBefEncryptionBattle(val) {
// this.importGroup()
// },
// idBefEncryptionGood(val) {
// this.importGroup()
// },
filterText(val) {
this.$refs.tree.filter(val)
},
filterTextH(val) {
this.$refs.treeH.filter(val)
},
roomName(val) {
this.filterRoomName(val)
},
groupName(val) {
if (this.wechat.roomName) return
if (this.wechat.battleStaffName) {
this.wechat.battleGroupId = this.idBefEncryptionBattle + '_R:' + val
}
if (this.wechat.goodStaffName) {
this.wechat.goodGroupId = this.idBefEncryptionGood + '_R:' + val
}
}
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
async getCrowdfundingParams() {
/**参数类型 1:众筹活动名称(返回类型String),2:众筹活动门店 */
const funding = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 1
})
const gold = await this.$apis.seckillActivity.getCrowdGoldParams({
parameterType: 1
})
const activity = [...funding?.parameters, ...gold?.parameters]
let activityNameList = []
activity.map(e => {
activityNameList.push({
confId: e,
confName: e
})
})
this.$set(this.searchFormData[1], 'optionList', this.$common.utils.deepClone(activityNameList))
},
clearData() {
// this.setectList = []
this.config.merchantId = this.merchantId
this.config.staffType = '2'
this.wechat = {
battleStaffName: '',
goodStaffName: '',
roomName: ''
}
this.groupName = ''
this.hideSelect()
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
filterRoomName(value) {
this.stageList = this.groupList.filter(item => {
if (item.roomName.indexOf(value) !== -1) {
return item
}
})
},
handleNodeClick(data) {
// this.wechat.roomName = ''
if (this.menuIndex == 1) {
this.idBefEncryptionBattle = data.idBefEncryption
}
if (this.menuIndex == 2) {
this.idBefEncryptionGood = data.idBefEncryption
this.groupName = ''
}
this.setSendName(data.name, data.staffId)
this.hideSelect()
},
setSendName(name, staffId, isClear, i) {
console.log(staffId, this.wechat.battleStaffId, i)
if (this.menuIndex == 1 || i == 1) {
if (staffId == this.wechat.battleStaffId && staffId) return
Object.assign(this.wechat, { battleStaffName: name, battleStaffId: staffId })
}
if (this.menuIndex == 2 || i == 2) {
if (staffId == this.wechat.goodStaffId && staffId) return
Object.assign(this.wechat, { goodStaffName: name, goodStaffId: staffId })
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryptionGood }).then(res => {
this.selectGroupName = res.data.result || []
})
}
if (isClear && !this.wechat.battleStaffName && !this.wechat.goodStaffName) {
this.wechat.roomName = ''
this.groupList = []
return
}
if (isClear && (this.wechat.battleStaffName || this.wechat.goodStaffName)) return
this.wechat.roomName = ''
this.getGroupList()
},
hideSelect() {
this.menuIndex = 0
},
selectGroup(data) {
this.hideSelect()
this.wechat.roomName = data.roomName
const { goodStaffId, battleStaffId } = this.wechat
if (this.wechat.battleStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == battleStaffId)?.staffCloudId
this.wechat.battleGroupId = staffCloudId + '_R:' + data.roomIdOnly
}
if (this.wechat.goodStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == goodStaffId)?.staffCloudId
this.wechat.goodGroupId = staffCloudId + '_R:' + data.roomIdOnly
}
// this.wechat.groupId = data.roomChatId
},
// importGroup() {
// if (this.wechat.roomName) return
// if (this.wechat.battleStaffName) {
// this.wechat.battleGroupId = this.idBefEncryptionBattle + '_R:' + this.groupName
// }
// if (this.wechat.goodStaffName) {
// this.wechat.goodGroupId = this.idBefEncryptionGood + '_R:' + this.groupName
// }
// },
openMenu(e) {
if (e == this.menuIndex) return (this.menuIndex = 0)
this.menuIndex = e
},
removeStaff(index) {
this.userList.splice(index, 1)
},
//所属企业
changeRadio(val) {
if (this.config.staffType == 1) this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.merchantName = item.merchantName) : ''
})
this.userList = []
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
this.config.merchantId = this.merchantList && this.merchantList[0].merchantId
this.merchantId = this.merchantList && this.merchantList[0].merchantId
this.merchantName = this.merchantList && this.merchantList[0].merchantName
})
},
changeType(val) {
if (val == 1) {
this.getDepartmentTree()
} else {
this.userList = []
}
},
handleClose(scope, status) {
const info = status == 'close' ? '关闭' : '打开'
const infoN = status == 'close' ? '取消' : '恢复'
this.$confirm(`${info}则${infoN}战报发送功能,是否确认${info}?`, info, {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.activityOpen(scope)
})
.catch(() => {
// this.$message({
// type: 'info',
// message: '已取消'
// })
})
},
activityOpen(scope) {
const { activityId, actionReportSendFlag } = scope
this.$apis.battle
.activityOpen({
activityId,
actionReportSendFlag: actionReportSendFlag == 1 ? 2 : 1
})
.then(res => {
if (res) {
this.handleSearch()
this.$message.success('操作成功')
}
})
},
battleSetHandle() {
if (this.setectList.length == 0) {
this.$message({
message: '请选择活动',
type: 'error'
})
return
}
this.getDepartmentTree()
this.userList = []
// this.editStatus = false
this.battleVisible = true
},
dateFormatFun(date) {
return dateFormat(date)
},
selectionTable(val) {
this.setectList = val
},
handlestaffbattleConfirm() {
this.battlestaffVisible = false
this.userList = this.$refs.selectMember.userList
},
handlestaffbattleClose() {
this.battlestaffVisible = false
},
openMembers() {
this.battlestaffVisible = true
// if (this.ids.length > 0) {
// this.$refs.selectMember.$refs.tree.setCheckedKeys(this.ids)
// }
},
async handlebattleConfirm() {
if (this.userList.length == 0) {
this.$message({
message: '请选择专员',
type: 'error'
})
return
}
if (this.wechat.battleStaffName !== '' && this.wechat.roomName == '' && !this.groupName) {
this.$message({
message: '请选择关联群',
type: 'error'
})
return
}
let staffRequestList = []
let batchstaffRequestList = []
this.userList.forEach(item => {
staffRequestList.push({
staffId: item.staffId,
staffName: item.staffName,
merchantId: this.config.merchantId,
merchantName: this.merchantName,
userId: item.userId
})
})
const setectList = this.setectEditList.length ? this.setectEditList : this.setectList
setectList.forEach(item => {
let autoStaff = {}
if (Object.keys(this.wechat).length) {
const { battleStaffId, battleStaffName, battleGroupId, goodStaffName, roomName, goodGroupId, goodStaffId } = this.wechat
autoStaff = {
battleStaffId,
battleStaffName,
battleGroupId,
goodGroupId,
goodStaffName,
goodStaffId,
autoGroupName: roomName ? roomName : this.groupName,
autoGroupMerchantId: this.$merchantId
}
}
batchstaffRequestList.push({
activityId: item.activityId,
...autoStaff,
staffRequestList
})
})
this.$apis.battle.insertStaff({ batchstaffRequestList, staffType: this.config.staffType }).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.battleVisible = false
this.handleSearch()
this.activeName = 'first'
this.clearData()
}
})
},
handlebattleClose() {
this.clearData()
this.setectEditList = []
this.battleVisible = false
},
handleDetails() {},
handlebattleOn(data, sign) {
this.setectEditList = []
this.userList = []
this.wechat = {
battleStaffName: '',
roomName: '',
goodStaffName: ''
}
this.setectEditList.push(data)
this.battleVisible = true
if (sign) {
this.getStaffList(data)
}
this.getDepartmentTree()
},
clearWechat(i) {
this.setSendName('', '', true, i)
},
//获取编辑
getStaffList(data) {
this.$apis.battle.getStaffList({ id: data.activityId }).then(res => {
this.config.merchantId = res.staffs[0].merchantId
this.merchantId = res.staffs[0].merchantId
this.merchantName = res.staffs[0].merchantName
this.userList = res.staffs
this.config.staffType = res.staffType + ''
// this.wechat.staffId = res.autoStaffId
// this.wechat.battleStaffName = res.autoStaffName
// this.wechat.groupId = res.autoGroupId
// this.wechat.roomName = res.autoGroupName
const { goodStaffId, goodStaffName, battleStaffId, battleStaffName, goodGroupId, battleGroupId, autoGroupName, autoGroupMerchantId } = res
this.wechat = {
goodStaffId,
goodStaffName,
battleStaffId,
battleStaffName,
goodGroupId,
battleGroupId,
roomName: '',
autoGroupMerchantId
}
const groupId = battleGroupId || goodGroupId || ''
if (groupId.split('_R:')[1] == autoGroupName) {
this.groupName = autoGroupName
this.idBefEncryptionBattle = battleGroupId.split('_R:')[0]
this.idBefEncryptionGood = goodGroupId.split('_R:')[0]
} else {
this.wechat.roomName = autoGroupName
}
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryptionGood }).then(res => {
this.selectGroupName = res.data.result || []
})
this.getGroupList(this.wechat.staffId)
})
},
getGroupList(id) {
const { battleStaffId, goodStaffId } = this.wechat
const msgStaffIdList = [battleStaffId, goodStaffId]
this.$apis.battle.getGroupList({ msgStaffIdList, unionRoom: true }).then(res => {
if (res.code == 0) {
this.groupList = res.data
}
})
},
handleSetting() {
this.drawer = true
},
handleClick() {
this.handleSearch()
},
handleReset() {
this.tableSearchForm = {}
this.handleSearch()
},
getParams() {
let params = {
...this.tableSearchForm
}
this.activeName == 'first' ? (params.activityStatus = 2) : (params.activityStatus = 3)
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
},
async getDepartmentTree() {
// let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId,loginStatus:1 }
let params = { addChildrensFlag: true, queryMerchantId: this.$merchantId, loginStatus: 1 } //this.$merchantId
let data = await this.$apis.battle.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
await this.initData(this.automaticData)
this.expandedKeys = [this.automaticData[0]?.id]
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
}
children.length && this.initData(children)
})
}
}
}
</script>
<style scoped lang="scss">
.activity {
/deep/ {
.el-select .el-tag {
max-width: 60% !important;
}
.el-form-item__content {
overflow: inherit !important;
}
}
.container {
margin-top: 16px;
.title {
height: 32px;
line-height: 32px;
margin-bottom: 10px;
.title-text {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-left: 4px;
}
}
}
.empty-btn {
position: absolute;
right: -40px;
top: 0px;
font-size: 14px;
color: #5850ff;
}
.config-pannel {
background: #f9f9f9;
width: 520px;
height: 168px;
display: flex;
.config-item {
padding: 26px 20px;
}
.clear-btn {
cursor: pointer;
background: #f1f1f1;
width: 40px;
height: 100%;
line-height: 20px;
font-size: 14px;
color: #666666;
padding: 60px 13px;
box-sizing: border-box;
}
}
.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: #666;
display: inline-block;
outline: none;
padding: 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ .el-tag {
background-color: #fff !important;
margin-bottom: 4px;
}
}
.select-wrap {
.common {
margin: 4px 0;
height: 40px !important;
overflow: hidden;
/deep/ .el-input {
height: 40px !important;
line-height: 40px !important;
}
/deep/ .el-input__suffix {
height: 40px !important;
margin-top: -4px;
.is-reverse {
transform: rotate(180deg);
}
}
}
}
}
.search-groomname {
width: 252px;
margin: 12px 16px 0;
/deep/.el-input {
width: 252px;
}
}
.filter-tree {
padding: 0 16px;
}
.empty {
padding: 10px 0;
margin: 0;
text-align: center;
color: #999;
font-size: 13px;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
</style>
<template>
<GLDialog :mode="mode" title="#2.SA喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/bulletin.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="商品名称:">
<el-switch class="switchStyle" v-model="goodsType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示商品名称</span>
</div>
<div class="item-line">
<el-form-item label="剔除0产值的员工:">
<el-switch class="switchStyle" v-model="outputType.switchStatus" active-text="剔除" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报将显示产值为0的销售名单,喜报长度可能过长,可阅读性较差</span>
</div>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,驻店新建下单或扫码下单,客户支付成功后产生有效订单时自动推送, 订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
goodsType: {
switchType: 401
},
outputType: {
switchType: 402
},
params: ['goodsType', 'outputType']
}
},
methods: {
initData() {
this.switchList.saReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'saReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 20px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
bottom: 110px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
}
</style>
<template>
<GLDialog :mode="mode" title="#3.文字喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/characters.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="编辑文本:" class="verbal-wrap">
<verbal :btnList="btnList" :maxNum="2000" :mapList="mapList" ref="verbalRef"></verbal>
</el-form-item>
</div>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,驻店新建下单或扫码下单,客户支付成功后产生有效订单时自动推送, 订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
wordType: {
switchType: 701,
switchText: ''
},
btnList: [
{
type: 1,
name: '表情'
},
{
type: 2,
name: '销售顾问'
},
{
type: 2,
name: '客户姓名'
},
{
type: 2,
name: '车型'
},
{
type: 2,
name: '订单总金额'
},
{
type: 2,
name: '阳光激励费'
},
{
type: 2,
name: '商品名称'
}
],
params: ['wordType'],
mapList: {
销售顾问: '${employeeName}',
客户姓名: '${customerName}',
车型: '${carType}',
订单总金额: '${totalPrice}',
阳光激励费: '${sunshineInspiration}',
商品名称: '${goodsNames}'
}
}
},
methods: {
initData() {
this.switchList.wordReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
}
})
})
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.wordType.switchText)
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
if (data == 'wordType') this[data].switchText = this.$refs.verbalRef.getTextValue()
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'wordReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 20px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
bottom: 85px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
.verbal-wrap {
/deep/ .el-form-item__content {
width: 448px;
}
/deep/ .btn-group-panel .btn-group {
flex-wrap: wrap;
justify-content: none;
.add-btn {
margin-bottom: 5px;
}
}
}
}
</style>
<template>
<GLDialog :mode="mode" title="#4.早报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/daily.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="客户跟进:">
<el-switch class="switchStyle" v-model="clientType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的早报不会显示客户跟进整个模块</span>
</div>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,配置后每日早上9-10点,统计前一日门店汇总数据进行推送</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
clientType: {
switchType: 201
},
params: ['clientType']
}
},
methods: {
initData() {
this.switchList.zhanReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'zhanReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 20px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
bottom: 110px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
}
</style>
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-19 10:49:23
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-19 11:05:16
* @FilePath: \scrm-micro-battles\src\views\bulletin\components\dialogs\dialog.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
props: {
switchList: {
type: Array,
default: () => []
},
isDialogVisible: Boolean
},
created() {
this.initData()
},
methods: {
handlebattleClose() {
this.$emit('handleClose')
}
}
}
<template>
<GLDialog :mode="mode" title="#1.SA个人喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/personal.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="switchList" label-width="154px">
<div class="item-line">
<el-form-item label="客户车型:">
<el-switch class="switchStyle" v-model="vehicleType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示客户车型</span>
</div>
<div class="item-line">
<el-form-item label="开单商品:">
<el-switch class="switchStyle" v-model="goodsType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示开单商品</span>
</div>
<div class="item-line">
<el-form-item label="收款方式:">
<el-switch class="switchStyle" v-model="proceedsType.switchStatus" active-text="全部" inactive-text="部分"></el-switch>
</el-form-item>
<span class="warn">关闭后仅推送嘀加收款的喜报,门店收款不推送</span>
</div>
<el-form-item label="话术推荐:" class="verbal-wrap">
<verbal ref="verbalRef" :maxNum="200" :btnList="btnList"></verbal>
</el-form-item>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,驻店新建下单或扫码下单,客户支付成功后产生有效订单时自动推送, 订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
vehicleType: {
switchType: 501
},
goodsType: {
switchType: 502
},
proceedsType: { switchType: 503 },
verbalType: {
switchType: 504,
switchText: ''
},
btnList: [
{
type: 1,
name: '表情'
}
],
params: ['vehicleType', 'goodsType', 'proceedsType', 'verbalType']
}
},
methods: {
initData() {
this.switchList.saPerReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
this.$nextTick(() => {
this.$refs.verbalRef && this.$refs.verbalRef.update(this.verbalType.switchText)
})
},
handlebattleConfirm() {
this.isDialogVisible = false
let switchList = []
this.params.forEach(data => {
if (data == 'verbalType') this[data].switchText = this.$refs.verbalRef.getTextValue()
switchList.push(this[data])
})
console.log(switchList)
this.$emit('handlePreview', { key: 'saPerReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
// min-height:626px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 15px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
z-index: 0;
bottom: 75px;
font-size:14px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
.verbal-wrap {
/deep/ .el-form-item__content {
width: 448px;
}
}
}
</style>
<template>
<GLDialog :mode="mode" title="#5.客户进度消息 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/progress.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="业务类型:">
<el-switch class="switchStyle" v-model="businessType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示礼券类型</span>
</div>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,门店销售顾问给客户发券时,客户扫码领券成功后会推送此通知,驻店可通过此通知了解待跟进客户基础信息,可进入小程序电联客户预约施工时间</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
businessType: {
switchType: 601
},
params: ['businessType']
}
},
methods: {
initData() {
this.switchList.scheduleReport.forEach(i => {
this.params.find(data => {
if (this[data].switchType == i.switchType) {
this[data] = this.$common.utils.deepClone(i)
this.$set(this[data], 'switchStatus', i.switchStatus == 'Y' || i.switchStatus === true ? true : false)
}
})
})
},
handlebattleConfirm() {
let switchList = []
this.params.forEach(data => {
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'scheduleReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 20px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
bottom: 110px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
}
</style>
<template>
<GLDialog :mode="mode" title="#6.补单通知 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleClose" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/replenishment.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<div class="empty">
<img src="@/assets/buttetin/empty.png" />
</div>
<p class="empty-text">暂无配置项</p>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,门店放置有4S店收款码或园区店收款码时,客户扫码付款后触发推送,推送时并未产生系统订单,会推送此通知提醒驻店补单</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big'
}
},
methods: {
handlebattleConfirm() {
this.isDialogVisible = false
// let switchList = []
// const params = ['vehicleType', 'goodsType', 'proceedsType', 'verbalType']
// params.forEach(data => {
// this[data].switchStatus = this[data].switchStatus ? 'Y' : 'N'
// switchList.push(this[data])
// })
// this.$emit('handlePreview',{key:'saPerReport',data:switchList})
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
display: 1;
position: relative;
width: 100%;
margin-top: 12px;
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 20px;
}
.empty {
width: 420px;
height: 260px;
position: absolute;
top: 35%;
left: 50%;
transform: translate(-50%, -50%);
img {
width: 100%;
height: 100%;
}
}
.empty-text {
font-size: 16px;
color: #666666;
line-height: 20px;
position: absolute;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
bottom: 30px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
}
</style>
<template>
<GLDialog :mode="mode" title="#4.收款喜报 预览配置显示字段" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
<div class="popup-wrap">
<div class="left-wrap">
<div class="img-wrap">
<img src="@/assets/buttetin/personal.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="154px">
<div class="item-line">
<el-form-item label="收款方店名:">
<el-switch class="switchStyle" v-model="payeeType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示收款方店名</span>
</div>
<div class="item-line">
<el-form-item label="累计:">
<el-switch class="switchStyle" v-model="addType.switchStatus" active-text="显示" inactive-text="关闭"></el-switch>
</el-form-item>
<span class="warn">关闭后推送的喜报不会显示累计单量和累计产量</span>
</div>
</el-form>
<div class="explain">
<div class="color6 weight-6 font-14">
<i class="el-icon-warning"></i>
推送机制说明
</div>
<p class="mrp">仅推送太阳膜品类的产品,驻店新建下单或扫码下单,客户支付成功后产生有效订单时自动推送, 订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
addType: {
switchType: 502,
switchStatus: true,
actionReportType: 1
},
payeeType: {
switchType: 502,
switchStatus: true,
actionReportType: 1
},
btnList: [
{
type: 1,
name: '表情'
}
]
}
},
methods: {
handlebattleConfirm() {
let switchList = []
const params = ['addType', 'payeeType']
params.forEach(data => {
this[data].switchStatus = this[data].switchStatus ? 'Y' : 'N'
switchList.push(this[data])
})
this.$emit('handlePreview', { key: 'xiReport', data: switchList })
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
display: flex;
padding: 0 72px;
// min-height:626px;
.img-wrap {
width: 250px;
height: 560px;
margin-bottom: 14px;
img {
width: 100%;
height: 100%;
}
}
.right-wrap {
/deep/.el-form-item {
margin-bottom: 0px;
}
.item-line {
margin-bottom: 15px;
}
.switchStyle /deep/ .el-switch__label {
position: absolute;
display: none;
color: #fff;
font-size: 12px !important;
line-height: 20px;
}
.el-switch__core {
background-color: rgba(166, 166, 166, 1);
}
.switchStyle /deep/.el-switch__label--left {
z-index: 9;
left: 20px;
}
.switchStyle /deep/ .el-switch__label--right {
z-index: 9;
left: 4px;
}
.switchStyle /deep/ .el-switch__label.is-active {
display: block;
}
.switchStyle /deep/ .el-switch__core {
width: 56px !important;
}
.switchStyle /deep/ .el-switch__label {
width: 56px !important;
}
.explain {
width: 486px;
background: #f4f6fc;
padding: 16px;
margin-left: 70px;
box-sizing: border-box;
position: absolute;
z-index: 0;
bottom: 85px;
.el-icon-warning {
width: 16px;
height: 16px;
margin-right: 4px;
}
.mrp {
margin: 8px 0 0 20px;
line-height: 22px;
}
}
}
.warn {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
.verbal-wrap {
/deep/ .el-form-item__content {
width: 448px;
}
}
}
</style>
<!-- 转化订单推送 1.1-->
<template>
<div class="activity">
<!-- 表格区域 开始 -->
<div class="container">
<div class="flex-between title">
<div class="title-text">专员列表</div>
<!-- <el-button :size="size"
type="primary"
class="battle-set-btn"
@click="battleSetHandle">批量配置专员</el-button> -->
</div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div slot="activityTime" slot-scope="scope">{{ dateFormatFun(scope.scope.startTime) }}-{{ dateFormatFun(scope.scope.endTime) }}</div>
<div slot="content" slot-scope="scope">
<div v-for="(item, index) in formatterContent(scope.scope)" :key="index">{{ item }}</div>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="!scope.scope.staffId" @click="handlebattleOn(scope.scope)">配置</el-button>
<el-button type="text" v-else @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
</div>
</GLTable>
</div>
<GLDialog :mode="mode" class="battle-dialog" title="配置专员" @onOk="handlebattleConfirm" @onCancel="handlebattleClose" :visible.sync="battleVisible">
<div class="gl-form-page gl-form-min">
<el-form :model="wechat" ref="form" label-width="230px" :rules="rules">
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
<!-- 推送人 -->
<el-form-item class="select-wrap" label="推送人:" prop="staffId">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openAutomatic">
<span v-if="wechat.automaticName == ''" class="placeholder">选择成员</span>
{{ wechat.automaticName }}
</div>
<span class="el-input__suffix" @click="openAutomatic">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isAutomatic ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!isAutomatic">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 收款喜报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 收款喜报
<img class="icon-eye" @click="handlePoster('xiReport')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupXiRef">
<div class="el-input__inner" @click="openGroup('xiReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('xiReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.xiReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.xiReport">
<gl-select-menu :domEl="domXiEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'xiReport')">
<span :class="[groupCofList.xiReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.xiReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'xiReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.xiReportValue" :key="k">
<el-input v-model="i.name" placeholder="将收款喜报推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.xiReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.xiReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 战报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 战报
<img class="icon-eye" @click="handlePoster('zhanReport')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupZhanRef">
<div class="el-input__inner" @click="openGroup('zhanReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('zhanReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.zhanReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.zhanReport">
<gl-select-menu :domEl="domZhanEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'zhanReport')">
<span :class="[groupCofList.zhanReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.zhanReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'zhanReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.zhanReportValue" :key="k">
<el-input v-model="i.name" placeholder="将战报推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.zhanReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.zhanReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 补单通知 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 补单通知
<img class="icon-eye" @click="handlePoster('orderReport')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupOrderRef">
<div class="el-input__inner" @click="openGroup('orderReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('orderReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.orderReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.orderReport">
<gl-select-menu :domEl="domOrderEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'orderReport')">
<span :class="[groupCofList.orderReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.orderReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'orderReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.orderReportValue" :key="k">
<el-input v-model="i.name" placeholder="将补单通知推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.orderReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.orderReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- SA喜报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 SA喜报
<img class="icon-eye" @click="handlePoster('saReport')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupSaRef">
<div class="el-input__inner" @click="openGroup('saReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('saReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.saReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.saReport">
<gl-select-menu :domEl="domSaEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'saReport')">
<span :class="[groupCofList.saReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.saReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'saReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.saReportValue" :key="k">
<el-input v-model="i.name" placeholder="将SA喜报推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.saReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.saReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- SA个人喜报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 SA个人喜报
<img class="icon-eye" @click="handlePoster('saPerReport')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupSaPerRef">
<div class="el-input__inner" @click="openGroup('saPerReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('saPerReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.saPerReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.saPerReport">
<gl-select-menu :domEl="domSaPerEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'saPerReport')">
<span :class="[groupCofList.saPerReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.saPerReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'saPerReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.saPerReportValue" :key="k">
<el-input v-model="i.name" placeholder="将SA个人喜报推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.saPerReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.saPerReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 客户进度消息 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 客户进度消息
<!-- <img class="icon-eye"
@click="handlePoster('scheduleReport')"
src="@/assets/icon-eye.png" /> -->
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupScheduleRef">
<div class="el-input__inner" @click="openGroup('scheduleReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('scheduleReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.scheduleReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.scheduleReport">
<gl-select-menu :domEl="domScheduleEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'scheduleReport')">
<span :class="[groupCofList.scheduleReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.scheduleReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'scheduleReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动输入群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.scheduleReportValue" :key="k">
<el-input v-model="i.name" placeholder="将客户进度消息推送至群聊"></el-input>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.scheduleReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.scheduleReportValue, k)"></i>
</div>
</div>
</el-form-item>
</el-form>
</div>
</GLDialog>
<!-- 查看 -->
<GLDialog v-if="isImgVisible" title="查看" mode="mid" :visible.sync="isImgVisible" class="dialog-look" :hasFooter="false">
<img width="50%" :src="require(`@/assets/${dialogImageUrl}.png`)" alt="" />
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import { dateFormat } from '@/utils/index'
import GlSelectMenu from '../battle/components/select-dropdown.vue'
export default {
components: {
GlSelectMenu
},
data() {
return {
// 推送至群聊,下拉框是否隐藏
groupHideObj: {
xiReport: true,
zhanReport: true,
orderReport: true,
saReport: true,
saPerReport: true,
scheduleReport: true
},
groupCofList: {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
},
groupCofListInput: {
xiReportValue: [],
zhanReportValue: [],
orderReportValue: [],
saReportValue: [],
saPerReportValue: [],
scheduleReportValue: []
},
groupToType: [
{
attr: 'xiReport',
type: 1
},
{
attr: 'zhanReport',
type: 2
},
{
attr: 'orderReport',
type: 3
},
{
attr: 'saReport',
type: 4
},
{
attr: 'saPerReport',
type: 5
},
{
attr: 'scheduleReport',
type: 6
}
],
// 查看大图
isImgVisible: false,
dialogImageUrl: '',
isgroup: true,
isAutomatic: true,
merchantId: '',
merchantName: '',
size: 'small',
mode: 'mid',
battleVisible: false,
battlestaffVisible: false,
url: url,
setectList: [],
merchantList: [],
groupList: [],
// groupList: [{
// roomChatId: '1688855088375831_R:1970325371975971',
// roomName: '波波的单店'
// }, {
// roomChatId: '111',
// roomName: 'cwq'
// }, {
// roomChatId: '222',
// roomName: '啦啦啦'
// }],
// 搜索
searchForm: {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 1
},
searchFormData: [
{
label: '园区店',
name: 'yqMerchantName',
type: 'input',
maxlength: 128
},
{
label: '商户号',
name: 'unionMerchantId',
type: 'input',
maxlength: 11
},
{
label: '4S店',
name: 'merchantName',
type: 'input',
maxlength: 128
}
],
// 表格
// userList: [],
selectArray: [],
getListApi: this.$apis.saasOrder.getYqReportlist,
tableParams: {
listName: 'list',
tableOption: true,
// // 行数据的key
// mutiSelectUniqueKey: 'activityId',
// 多选ref的名称
// mutiSelectName: 'activity',
tableColumns: [
{
label: '4S店',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName + (cellValue.merchantId || '')
}
},
{
label: '园区店',
prop: 'yqMerchantName',
formatter: cellValue => {
return cellValue.yqMerchantName + (cellValue.yqMerchantId || '')
}
},
{
label: '内容',
prop: '',
addHtml: 'content'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
defaultProps: {
children: 'children',
label: 'name'
},
expandedKeys: [],
filterText: '',
automaticData: [],
stageList: [],
roomName: '',
config: {
merchantId: ''
},
rules: {
staffId: { required: true, message: '请选择推送人', trigger: 'change' },
groupId: { required: true, message: '请选择关联群', trigger: 'change' }
},
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
baseData: {
merchantList: []
}
}
},
mounted() {
this.getMerchantList()
// this.merchantList = this.$saasOrder?.merchantList || []
// this.config.merchantId = this.merchantList[0]?.merchantId
// this.config.merchantName = this.merchantList[0]?.merchantName
},
computed: {
domXiEl() {
return this.$refs.groupXiRef
},
domZhanEl() {
return this.$refs.groupZhanRef
},
domOrderEl() {
return this.$refs.groupOrderRef
},
domSaEl() {
return this.$refs.groupSaRef
},
automaticEl() {
return this.$refs.automaticRef
},
domSaPerEl() {
return this.$refs.groupSaPerRef
},
domScheduleEl() {
return this.$refs.groupScheduleRef
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
},
methods: {
formatterContent(cellValue) {
let typeToTxt = new Map([
[5, '#1.SA个人喜报>>'],
[4, '#2.SA喜报>>'],
[7, '#3.文字喜报>>'],
[2, '#4.早报>>'],
[6, '#5.客户进度消息>>'],
[3, '#6.补单通知>>']
])
let txt = ''
cellValue.groupConfigList?.forEach(item => {
if (item.groupId && typeToTxt.get(item.actionReportType)) {
typeToTxt.set(item.actionReportType, item.groupName ? typeToTxt.get(item.actionReportType) + `【${item.groupName}】` : '')
}
})
txt = [...typeToTxt.values()].filter(item => item.includes('【'))
return txt
},
// 图片查看,
handlePoster(name) {
this.isImgVisible = true
this.dialogImageUrl = name
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.baseData.merchantList = res
this.merchantList = res
this.getOptionsList('searchFormData')
this.config.merchantId = this.baseData.merchantList[0]?.merchantId
this.config.merchantName = this.baseData.merchantList[0]?.merchantName
// this.config.merchantId = this.merchantList && this.merchantList[0].merchantId
// this.merchantId = this.merchantList && this.merchantList[0].merchantId
// this.merchantName = this.merchantList && this.merchantList[0].merchantName
})
},
handleReset() {
this.searchForm = {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 1
}
this.handleSearch()
},
clearData() {
this.setectList = []
this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
}
this.hideSelect()
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
filterRoomName(value) {
this.stageList = this.groupList.filter(item => {
if (item.roomName.indexOf(value) !== -1) {
return item
}
})
},
handleNodeClick(data) {
this.hideSelect()
this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId
this.idBefEncryption = data.idBefEncryption
this.getGroupList(this.wechat.staffId, true)
},
hideSelect() {
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
this.groupHideObj.orderReport = true
this.groupHideObj.saReport = true
this.isAutomatic = true
},
selectGroup(e, data, groupHideAttr) {
e.stopPropagation()
if (this.groupCofList[groupHideAttr].findIndex(i => i.roomName == data.roomName) != -1) {
return
}
// this.hideSelect()
// this.wechat.roomName = data.roomName
// this.wechat.groupId = data.roomChatId
this.groupCofList[groupHideAttr].push({
groupId: data.roomChatId,
roomName: data.roomName
})
},
openGroup(groupHideAttr) {
this.isAutomatic = true
// this.isgroup = !this.isgroup
let attrList = Object.keys(this.groupHideObj)
attrList.forEach(item => {
if (item != groupHideAttr) {
this.groupHideObj[item] = true
}
})
this.roomName = ''
this.stageList = []
this.groupHideObj[groupHideAttr] = !this.groupHideObj[groupHideAttr]
},
openAutomatic() {
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
this.groupHideObj.orderReport = true
this.groupHideObj.saReport = true
this.groupHideObj.saPerReport = true
this.groupHideObj.scheduleReport = true
this.isAutomatic = !this.isAutomatic
},
handleGroupRemove(idx, groupHideAttr) {
this.groupCofList[groupHideAttr].splice(idx, 1)
},
//所属企业
handleMerchatChange(val) {
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
}
},
battleSetHandle() {
if (this.setectList.length == 0) {
this.$message({
message: '请选择园区店',
type: 'error'
})
return
}
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
}
this.getDepartmentTree()
this.battleVisible = true
},
dateFormatFun(date) {
return dateFormat(date)
},
selectionTable(val) {
this.setectList = val
},
handlestaffbattleConfirm() {
this.battlestaffVisible = false
},
handlestaffbattleClose() {
this.battlestaffVisible = false
},
handlebattleConfirm() {
if (!this.wechat.staffId) {
this.$message({
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
// groupId: this.wechat.groupId,
// groupName: this.wechat.roomName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [],
groupConfigList: [],
merchantId: this.setectList[0]?.merchantId,
scene: 1
}
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
Object.keys(this.groupCofList).map(item => {
// console.log(this.groupCofList[item])
let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.battleVisible = false
this.handleSearch()
this.clearData()
}
})
},
handlebattleClose() {
this.battleVisible = false
this.clearData()
},
handleDetails() {},
addGroup(group) {
group.push({ name: '' })
},
delGroup(group, i) {
group.splice(i, 1)
},
handlebattleOn(data, sign) {
let params = {
data: data,
sign: sign ? sign : ''
}
this.$router.push({
path: '/bulletin/addConfig',
query: params
})
// this.setectList = []
// this.setectList.push(data)
// this.wechat = {
// staffId: '',
// automaticName: ''
// }
// this.groupCofList = {
// xiReport: [],
// zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: []
// }
// this.groupCofListInput = {
// xiReportValue: [],
// zhanReportValue: [],
// orderReportValue: [],
// saReportValue: [],
// saPerReportValue: [],
// scheduleReportValue: []
// }
// this.battleVisible = true
// // 编辑
// if (sign) {
// this.wechat.staffId = data.staffId
// this.wechat.automaticName = data.staffName
// // this.wechat.groupId = data.groupId
// // this.wechat.roomName = data.groupName
// this.config.merchantId = data.enterpriseMerchantId
// this.config.merchantName = data.enterpriseMerchantName
// data.groupConfigList.forEach(item => {
// let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType).attr
// if (item.groupId) {
// if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) {
// this.groupCofListInput[groupHideAttr + 'Value'].push({ name: item.groupName })
// this.idBefEncryption = item.groupId.split('_R:')[0]
// } else if (item.groupName) {
// this.groupCofList[groupHideAttr].push({
// groupId: item.groupId,
// roomName: item.groupName
// })
// } else {
// this.groupCofListInput[groupHideAttr + 'Value'].push({ name: '' })
// }
// }
// })
// for (let k in this.groupCofListInput) {
// if (this.groupCofListInput.hasOwnProperty(k) && !this.groupCofListInput[k][0]) {
// this.groupCofListInput[k] = [{ name: '' }]
// }
// }
// console.log(this.groupCofListInput)
// this.getGroupList(this.wechat.staffId)
// } else {
// this.groupCofListInput = {
// xiReportValue: [{ name: '' }],
// zhanReportValue: [{ name: '' }],
// orderReportValue: [{ name: '' }],
// saReportValue: [{ name: '' }],
// saPerReportValue: [{ name: '' }],
// scheduleReportValue: [{ name: '' }]
// }
// }
// this.getDepartmentTree()
},
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: [],
saPerReport: [],
scheduleReport: []
}
}
}
})
},
handleSetting() {
this.drawer = true
},
handleClick() {
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 }
// let params = { addChildrensFlag: true, queryMerchantId: 44209846, loginStatus: 1 }
let data = await this.$apis.saasOrder.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
await this.initData(this.automaticData)
this.expandedKeys = [this.automaticData[0].id]
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
}
children.length && this.initData(children)
})
}
}
}
</script>
<style scoped lang="scss">
.message-Z-zinde {
z-index: 9999 !important;
}
.activity {
.container {
margin-top: 16px;
.title {
height: 32px;
line-height: 32px;
margin-bottom: 10px;
.title-text {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-left: 4px;
}
}
}
.group-box {
padding: 20px;
background: #f9f9f9;
.input-box {
display: flex;
align-items: center;
i {
cursor: pointer;
font-size: 20px;
color: #5850ff;
margin-left: 6px;
}
}
}
.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: #666;
display: inline-block;
outline: none;
padding: 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ .el-tag {
background-color: #fff !important;
margin-bottom: 4px;
}
}
.select-wrap {
.icon-eye {
width: 20px;
height: 20px;
cursor: pointer;
vertical-align: middle;
}
.common {
margin: 4px 0;
height: 40px !important;
overflow: hidden;
/deep/ .el-input {
height: 40px !important;
line-height: 40px !important;
}
/deep/ .el-input__suffix {
height: 40px !important;
margin-top: -4px;
.is-reverse {
transform: rotate(180deg);
}
}
}
.group-list-box {
display: flex;
flex-wrap: wrap;
.list-tag {
box-sizing: border-box;
display: flex;
align-items: center;
// height: 30px;
// line-height: 30px;
background: #fafbfe;
border: 1px solid #e8e8ea;
padding: 0 8px;
margin-right: 4px;
border-radius: 4px;
.tag-txt {
font-size: 14px;
color: #666666;
box-sizing: border-box;
padding-right: 8px;
line-height: 26px;
}
.icon-close {
width: 8px;
height: 8px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
}
}
}
}
.search-groomname {
width: 400px;
margin: 12px 16px 0;
/deep/.el-input {
width: 252px;
}
}
.filter-tree {
padding: 0 16px;
}
.grey-txt {
color: #c8c8c8;
cursor: not-allowed;
}
.empty {
padding: 10px 0;
margin: 0;
text-align: center;
color: #999;
font-size: 13px;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
.dialog-look {
text-align: center;
}
</style>
<!-- 车损权益升级推送 2.1-->
<template>
<div class="activity">
<!-- 表格区域 开始 -->
<div class="container">
<div class="flex-between title">
<div class="title-text">专员列表</div>
<!-- <el-button :size="size"
type="primary"
class="battle-set-btn"
@click="battleSetHandle">批量配置专员</el-button> -->
</div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div slot="activityTime" slot-scope="scope">{{ dateFormatFun(scope.scope.startTime) }}-{{ dateFormatFun(scope.scope.endTime) }}</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="!scope.scope.staffId" @click="handlebattleOn(scope.scope)">配置</el-button>
<el-button type="text" v-else @click="handlebattleOn(scope.scope, 'edit')">编辑</el-button>
</div>
</GLTable>
</div>
<GLDialog :mode="mode" class="battle-dialog" title="配置专员" @onOk="handlebattleConfirm" @onCancel="handlebattleClose" :visible.sync="battleVisible">
<div class="gl-form-page gl-form-min">
<el-form :model="wechat" ref="form" label-width="230px" :rules="rules">
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
<!-- 推送人 -->
<el-form-item class="select-wrap" label="推送人:" prop="staffId">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openAutomatic">
<span v-if="wechat.automaticName == ''" class="placeholder">选择成员</span>
{{ wechat.automaticName }}
</div>
<span class="el-input__suffix" @click="openAutomatic">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isAutomatic ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!isAutomatic">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 收款喜报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 收款喜报
<img class="icon-eye" @click="handlePoster('xiReport_qy')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupXiRef">
<div class="el-input__inner" @click="openGroup('xiReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('xiReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.xiReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.xiReport">
<gl-select-menu :domEl="domXiEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'xiReport')">
<span :class="[groupCofList.xiReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.xiReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'xiReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.xiReportValue" :key="k">
<el-select v-model="i.name" placeholder="请选择" filterable clearable>
<el-option v-for="item in selectGroupName" :key="item.groupName" :label="item.groupName" :value="item.groupName"></el-option>
</el-select>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.xiReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.xiReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 战报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 战报
<img class="icon-eye" @click="handlePoster('zhanReport_qy')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupZhanRef">
<div class="el-input__inner" @click="openGroup('zhanReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('zhanReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.zhanReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.zhanReport">
<gl-select-menu :domEl="domZhanEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'zhanReport')">
<span :class="[groupCofList.zhanReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.zhanReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'zhanReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.zhanReportValue" :key="k">
<el-select v-model="i.name" placeholder="请选择" filterable clearable>
<el-option v-for="item in selectGroupName" :key="item.groupName" :label="item.groupName" :value="item.groupName"></el-option>
</el-select>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.zhanReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.zhanReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 服务商战报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">
将 服务商战报
<img class="icon-eye" @click="handlePoster('zhanServerReport_qy')" src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupZhanServerRef">
<div class="el-input__inner" @click="openGroup('zhanServerReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix" @click="openGroup('zhanServerReport')">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.zhanServerReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!groupHideObj.zhanServerReport">
<gl-select-menu :domEl="domZhanServerEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="kIdx" @click="e => selectGroup(e, k, 'zhanServerReport')">
<span :class="[groupCofList.zhanServerReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag" v-for="(k, kIdx) in groupCofList.zhanServerReport" :key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close" @click="handleGroupRemove(kIdx, 'zhanServerReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput.zhanServerReportValue" :key="k">
<el-select v-model="i.name" placeholder="请选择" filterable clearable>
<el-option v-for="item in selectGroupName" :key="item.groupName" :label="item.groupName" :value="item.groupName"></el-option>
</el-select>
<i class="el-icon-circle-plus" v-if="k == 0" @click="addGroup(groupCofListInput.zhanServerReportValue)"></i>
<i class="el-icon-remove" v-else @click="delGroup(groupCofListInput.zhanServerReportValue, k)"></i>
</div>
</div>
</el-form-item>
<!-- 补单通知 - 关联群 -->
<!-- <el-form-item class="select-wrap">
<div slot="label">
将 补单通知
<img class="icon-eye"
@click="handlePoster('orderReport')"
src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input"
ref="groupOrderRef">
<div class="el-input__inner"
@click="openGroup('orderReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix"
@click="openGroup('orderReport')">
<span class="el-input__suffix-inner"><i
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.orderReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top"
v-if="!groupHideObj.orderReport">
<gl-select-menu :domEl="domOrderEl"
@changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词"
prefix-icon="el-icon-search"
v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList"
class="el-select-dropdown__item"
:key="kIdx"
@click="e => selectGroup(e, k, 'orderReport')">
<span
:class="[groupCofList.orderReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty"
v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag"
v-for="(k, kIdx) in groupCofList.orderReport"
:key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close"
@click="handleGroupRemove(kIdx, 'orderReport')"
src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box"
v-for="(i, k) in groupCofListInput.orderReportValue"
:key="k">
<el-input v-model="i.name"
placeholder="将补单通知推送至群聊"></el-input>
<i class="el-icon-circle-plus"
v-if="k == 0"
@click="addGroup(groupCofListInput.orderReportValue)"></i>
<i class="el-icon-remove"
v-else
@click="delGroup(groupCofListInput.orderReportValue, k)"></i>
</div>
</div>
</el-form-item> -->
<!-- SA喜报 - 关联群 -->
<!-- <el-form-item class="select-wrap">
<div slot="label">
将 SA喜报
<img class="icon-eye"
@click="handlePoster('saReport')"
src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input"
ref="groupSaRef">
<div class="el-input__inner"
@click="openGroup('saReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix"
@click="openGroup('saReport')">
<span class="el-input__suffix-inner"><i
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.saReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top"
v-if="!groupHideObj.saReport">
<gl-select-menu :domEl="domSaEl"
@changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词"
prefix-icon="el-icon-search"
v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList"
class="el-select-dropdown__item"
:key="kIdx"
@click="e => selectGroup(e, k, 'saReport')">
<span
:class="[groupCofList.saReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty"
v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag"
v-for="(k, kIdx) in groupCofList.saReport"
:key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close"
@click="handleGroupRemove(kIdx, 'saReport')"
src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box"
v-for="(i, k) in groupCofListInput.saReportValue"
:key="k">
<el-input v-model="i.name"
placeholder="将SA喜报推送至群聊"></el-input>
<i class="el-icon-circle-plus"
v-if="k == 0"
@click="addGroup(groupCofListInput.saReportValue)"></i>
<i class="el-icon-remove"
v-else
@click="delGroup(groupCofListInput.saReportValue, k)"></i>
</div>
</div>
</el-form-item> -->
<!-- SA个人喜报 - 关联群 -->
<!-- <el-form-item class="select-wrap">
<div slot="label">
将 SA个人喜报
<img class="icon-eye"
@click="handlePoster('saPerReport')"
src="@/assets/icon-eye.png" />
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input"
ref="groupSaPerRef">
<div class="el-input__inner"
@click="openGroup('saPerReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix"
@click="openGroup('saPerReport')">
<span class="el-input__suffix-inner"><i
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.saPerReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top"
v-if="!groupHideObj.saPerReport">
<gl-select-menu :domEl="domSaPerEl"
@changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词"
prefix-icon="el-icon-search"
v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList"
class="el-select-dropdown__item"
:key="kIdx"
@click="e => selectGroup(e, k, 'saPerReport')">
<span
:class="[groupCofList.saPerReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty"
v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag"
v-for="(k, kIdx) in groupCofList.saPerReport"
:key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close"
@click="handleGroupRemove(kIdx, 'saPerReport')"
src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box"
v-for="(i, k) in groupCofListInput.saPerReportValue"
:key="k">
<el-input v-model="i.name"
placeholder="将SA个人喜报推送至群聊"></el-input>
<i class="el-icon-circle-plus"
v-if="k == 0"
@click="addGroup(groupCofListInput.saPerReportValue)"></i>
<i class="el-icon-remove"
v-else
@click="delGroup(groupCofListInput.saPerReportValue, k)"></i>
</div>
</div>
</el-form-item> -->
<!-- 客户进度消息 - 关联群 -->
<!-- <el-form-item class="select-wrap">
<div slot="label">
将 客户进度消息
:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input"
ref="groupScheduleRef">
<div class="el-input__inner"
@click="openGroup('scheduleReport')">
<span class="placeholder">请选择(可多选)</span>
</div>
<span class="el-input__suffix"
@click="openGroup('scheduleReport')">
<span class="el-input__suffix-inner"><i
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', groupHideObj.scheduleReport ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top"
v-if="!groupHideObj.scheduleReport">
<gl-select-menu :domEl="domScheduleEl"
@changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词"
prefix-icon="el-icon-search"
v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="(k, kIdx) in roomName == '' ? groupList : stageList"
class="el-select-dropdown__item"
:key="kIdx"
@click="e => selectGroup(e, k, 'scheduleReport')">
<span
:class="[groupCofList.scheduleReport.findIndex(i => i.roomName == k.roomName) != -1 ? 'grey-txt' : '']">{{ k.roomName }}</span>
</li>
</template>
<div class="empty"
v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="group-list-box">
<div class="list-tag"
v-for="(k, kIdx) in groupCofList.scheduleReport"
:key="kIdx">
<span class="tag-txt">{{ k.roomName }}</span>
<img class="icon-close"
@click="handleGroupRemove(kIdx, 'scheduleReport')"
src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<el-form-item label="手动选择群名:">
<div class="group-box">
<div class="input-box"
v-for="(i, k) in groupCofListInput.scheduleReportValue"
:key="k">
<el-input v-model="i.name"
placeholder="将客户进度消息推送至群聊"></el-input>
<i class="el-icon-circle-plus"
v-if="k == 0"
@click="addGroup(groupCofListInput.scheduleReportValue)"></i>
<i class="el-icon-remove"
v-else
@click="delGroup(groupCofListInput.scheduleReportValue, k)"></i>
</div>
</div>
</el-form-item> -->
</el-form>
</div>
</GLDialog>
<!-- 查看 -->
<GLDialog v-if="isImgVisible" title="查看" mode="mid" :visible.sync="isImgVisible" class="dialog-look" :hasFooter="false">
<img width="50%" :src="require(`@/assets/${dialogImageUrl}.png`)" alt="" />
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import { dateFormat } from '@/utils/index'
import GlSelectMenu from '../battle/components/select-dropdown.vue'
export default {
components: {
GlSelectMenu
},
data() {
return {
selectGroupName: [],
// 推送至群聊,下拉框是否隐藏
groupHideObj: {
xiReport: true,
zhanReport: true,
// orderReport: true,
// saReport: true,
// saPerReport: true,
// scheduleReport: true,
zhanServerReport: true
},
groupCofList: {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
},
groupCofListInput: {
xiReportValue: [],
zhanReportValue: [],
// orderReportValue: [],
// saReportValue: [],
// saPerReportValue: [],
// scheduleReportValue: [],
zhanServerReportValue: []
},
groupToType: [
{
attr: 'xiReport',
type: 20
},
{
attr: 'zhanReport',
type: 21
},
// {
// attr: 'orderReport',
// type: 3
// },
// {
// attr: 'saReport',
// type: 4
// },
// {
// attr: 'saPerReport',
// type: 5
// },
// {
// attr: 'scheduleReport',
// type: 6
// },
{
attr: 'zhanServerReport',
type: 22
}
],
// 查看大图
isImgVisible: false,
dialogImageUrl: '',
isgroup: true,
isAutomatic: true,
merchantId: '',
merchantName: '',
size: 'small',
mode: 'mid',
battleVisible: false,
battlestaffVisible: false,
url: url,
setectList: [],
merchantList: [],
groupList: [],
// groupList: [{
// roomChatId: '1688855088375831_R:1970325371975971',
// roomName: '波波的单店'
// }, {
// roomChatId: '111',
// roomName: 'cwq'
// }, {
// roomChatId: '222',
// roomName: '啦啦啦'
// }],
// 搜索
searchForm: {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 0
},
searchFormData: [
{
label: '园区店',
name: 'yqMerchantName',
type: 'input',
maxlength: 128
},
{
label: '商户号',
name: 'unionMerchantId',
type: 'input',
maxlength: 11
},
{
label: '4S店',
name: 'merchantName',
type: 'input',
maxlength: 128
},
{
label: '企微名称',
name: 'enterpriseMerchantId',
type: 'select',
width: '215px',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList'
}
],
// 表格
// userList: [],
selectArray: [],
getListApi: this.$apis.saasOrder.getYqReportlist,
tableParams: {
listName: 'list',
tableOption: true,
// // 行数据的key
// mutiSelectUniqueKey: 'activityId',
// 多选ref的名称
// mutiSelectName: 'activity',
tableColumns: [
{
label: '4S店',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName + (cellValue.merchantId || '')
}
},
{
label: '园区店',
prop: 'yqMerchantName',
formatter: cellValue => {
return cellValue.yqMerchantName + (cellValue.yqMerchantId || '')
}
},
{
label: '企微',
prop: 'enterpriseMerchantName',
width: 200
},
{
label: '推送人',
prop: 'staffName',
line: 1,
width: 200
},
{
label: '内容',
prop: '',
formatter: cellValue => {
let typeToTxt = {
20: '(推收款喜报)',
21: '(推战报)',
// 3: '(推补录订单)',
// 4: '(推SA喜报)',
// 5: '(推SA个人喜报)',
// 6: '(推客户进度消息)',
22: '(推服务商战报)'
}
let txt = ''
cellValue.groupConfigList?.forEach(item => {
if (item.groupId) {
txt = (txt ? txt + ';' : txt) + item.groupName + typeToTxt[item.actionReportType]
}
})
return txt
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
defaultProps: {
children: 'children',
label: 'name'
},
expandedKeys: [],
filterText: '',
automaticData: [],
stageList: [],
roomName: '',
config: {
merchantId: ''
},
rules: {
staffId: { required: true, message: '请选择推送人', trigger: 'change' },
groupId: { required: true, message: '请选择关联群', trigger: 'change' }
},
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
baseData: {
merchantList: []
}
}
},
mounted() {
this.getMerchantList()
// this.merchantList = this.$saasOrder?.merchantList || []
// this.config.merchantId = this.merchantList[0]?.merchantId
// this.config.merchantName = this.merchantList[0]?.merchantName
},
computed: {
domXiEl() {
return this.$refs.groupXiRef
},
domZhanEl() {
return this.$refs.groupZhanRef
},
// domOrderEl() {
// return this.$refs.groupOrderRef
// },
// domSaEl() {
// return this.$refs.groupSaRef
// },
automaticEl() {
return this.$refs.automaticRef
},
// domSaPerEl() {
// return this.$refs.groupSaPerRef
// },
// domScheduleEl() {
// return this.$refs.groupScheduleRef
// },
domZhanServerEl() {
return this.$refs.groupZhanServerRef
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
},
methods: {
// 图片查看
handlePoster(name) {
this.isImgVisible = true
this.dialogImageUrl = name
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.baseData.merchantList = res
this.merchantList = res
this.getOptionsList('searchFormData')
this.config.merchantId = this.baseData.merchantList[0]?.merchantId
this.config.merchantName = this.baseData.merchantList[0]?.merchantName
// this.config.merchantId = this.merchantList && this.merchantList[0].merchantId
// this.merchantId = this.merchantList && this.merchantList[0].merchantId
// this.merchantName = this.merchantList && this.merchantList[0].merchantName
})
},
handleReset() {
this.searchForm = {
yqMerchantId: '',
yqMerchantName: '',
enterpriseMerchantId: '',
scene: 0
}
this.handleSearch()
},
clearData() {
this.setectList = []
this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
}
this.hideSelect()
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
filterRoomName(value) {
this.stageList = this.groupList.filter(item => {
if (item.roomName.indexOf(value) !== -1) {
return item
}
})
},
handleNodeClick(data) {
this.hideSelect()
this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId
this.idBefEncryption = data.idBefEncryption
this.getGroupList(this.wechat.staffId, true)
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || []
this.groupCofListInput = {
xiReportValue: [{ name: '' }],
zhanReportValue: [{ name: '' }],
zhanServerReportValue: [{ name: '' }]
}
})
},
hideSelect() {
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
// this.groupHideObj.orderReport = true
// this.groupHideObj.saReport = true
this.groupHideObj.zhanServerReport = true
this.isAutomatic = true
},
selectGroup(e, data, groupHideAttr) {
e.stopPropagation()
if (this.groupCofList[groupHideAttr].findIndex(i => i.roomName == data.roomName) != -1) {
return
}
// this.hideSelect()
// this.wechat.roomName = data.roomName
// this.wechat.groupId = data.roomChatId
this.groupCofList[groupHideAttr].push({
groupId: data.roomChatId,
roomName: data.roomName
})
},
openGroup(groupHideAttr) {
this.isAutomatic = true
// this.isgroup = !this.isgroup
let attrList = Object.keys(this.groupHideObj)
attrList.forEach(item => {
if (item != groupHideAttr) {
this.groupHideObj[item] = true
}
})
this.roomName = ''
this.stageList = []
this.groupHideObj[groupHideAttr] = !this.groupHideObj[groupHideAttr]
},
openAutomatic() {
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
// this.groupHideObj.orderReport = true
// this.groupHideObj.saReport = true
// this.groupHideObj.saPerReport = true
// this.groupHideObj.scheduleReport = true
this.groupHideObj.zhanServerReport = true
this.isAutomatic = !this.isAutomatic
},
handleGroupRemove(idx, groupHideAttr) {
this.groupCofList[groupHideAttr].splice(idx, 1)
},
//所属企业
handleMerchatChange(val) {
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
}
},
battleSetHandle() {
if (this.setectList.length == 0) {
this.$message({
message: '请选择园区店',
type: 'error'
})
return
}
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
}
this.getDepartmentTree()
this.battleVisible = true
},
dateFormatFun(date) {
return dateFormat(date)
},
selectionTable(val) {
this.setectList = val
},
handlestaffbattleConfirm() {
this.battlestaffVisible = false
},
handlestaffbattleClose() {
this.battlestaffVisible = false
},
async handlebattleConfirm() {
if (!this.wechat.staffId) {
this.$message({
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length)
.every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) {
this.$message({
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var params = {
enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
// groupId: this.wechat.groupId,
// groupName: this.wechat.roomName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [],
groupConfigList: [],
merchantId: this.setectList[0]?.merchantId,
scene: 0
}
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
Object.keys(this.groupCofList).map(item => {
// console.log(this.groupCofList[item])
let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => {
params.groupConfigList.push({
groupId: k.groupId,
groupName: k.roomName,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
} else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name,
groupMerchantId: this.config.merchantId,
actionReportType: type
})
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.battleVisible = false
this.handleSearch()
this.clearData()
}
})
},
handlebattleClose() {
this.battleVisible = false
this.clearData()
},
handleDetails() {},
addGroup(group) {
group.push({ name: '' })
},
delGroup(group, i) {
group.splice(i, 1)
},
handlebattleOn(data, sign) {
this.setectList = []
this.setectList.push(data)
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
}
this.groupCofListInput = {
xiReportValue: [],
zhanReportValue: [],
// orderReportValue: [],
// saReportValue: [],
// saPerReportValue: [],
// scheduleReportValue: [],
zhanServerReportValue: []
}
this.battleVisible = true
// 编辑
if (sign) {
this.wechat.staffId = data.staffId
this.wechat.automaticName = data.staffName
// this.wechat.groupId = data.groupId
// this.wechat.roomName = data.groupName
this.config.merchantId = data.enterpriseMerchantId
this.config.merchantName = data.enterpriseMerchantName
const groupConfigList = data.groupConfigList
groupConfigList &&
groupConfigList.forEach(item => {
console.log(item, '999999')
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType)?.attr
if (!groupHideAttr) {
return
}
if (item.groupId) {
if (item.groupId.split('_R:')[1] && item.groupId.split('_R:')[1] == item.groupName) {
this.groupCofListInput[groupHideAttr + 'Value'].push({ name: item.groupName })
this.idBefEncryption = item.groupId.split('_R:')[0]
} else if (item.groupName) {
this.groupCofList[groupHideAttr].push({
groupId: item.groupId,
roomName: item.groupName
})
} else {
this.idBefEncryption = item.groupId.split('_R:')[0]
this.groupCofListInput[groupHideAttr + 'Value'].push({ name: '' })
}
}
})
for (let k in this.groupCofListInput) {
if (this.groupCofListInput.hasOwnProperty(k) && !this.groupCofListInput[k][0]) {
this.groupCofListInput[k] = [{ name: '' }]
}
}
this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
this.selectGroupName = res.data.result || []
})
this.getGroupList(this.wechat.staffId)
} else {
this.groupCofListInput = {
xiReportValue: [{ name: '' }],
zhanReportValue: [{ name: '' }],
// orderReportValue: [{ name: '' }],
// saReportValue: [{ name: '' }],
// saPerReportValue: [{ name: '' }],
// scheduleReportValue: [{ name: '' }],
zhanServerReportValue: [{ name: '' }]
}
}
this.getDepartmentTree()
},
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: []
}
}
}
})
},
handleSetting() {
this.drawer = true
},
handleClick() {
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 }
// let params = { addChildrensFlag: true, queryMerchantId: 44209846, loginStatus: 1 }
let data = await this.$apis.saasOrder.getlistDepartmentTree(params)
this.ids = []
this.automaticData = data
await this.initData(this.automaticData)
this.expandedKeys = [this.automaticData[0].id]
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
}
children.length && this.initData(children)
})
}
}
}
</script>
<style scoped lang="scss">
.message-Z-zinde {
z-index: 9999 !important;
}
.activity {
.container {
margin-top: 16px;
.title {
height: 32px;
line-height: 32px;
margin-bottom: 10px;
.title-text {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-left: 4px;
}
}
}
.group-box {
padding: 20px;
background: #f9f9f9;
/deep/ .el-input {
width: 255px !important;
}
.input-box {
display: flex;
align-items: center;
i {
cursor: pointer;
font-size: 20px;
color: #5850ff;
margin-left: 6px;
}
}
}
.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: #666;
display: inline-block;
outline: none;
padding: 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ .el-tag {
background-color: #fff !important;
margin-bottom: 4px;
}
}
.select-wrap {
.icon-eye {
width: 20px;
height: 20px;
cursor: pointer;
vertical-align: middle;
}
.common {
margin: 4px 0;
height: 40px !important;
overflow: hidden;
/deep/ .el-input {
height: 40px !important;
line-height: 40px !important;
}
/deep/ .el-input__suffix {
height: 40px !important;
margin-top: -4px;
.is-reverse {
transform: rotate(180deg);
}
}
}
.group-list-box {
display: flex;
flex-wrap: wrap;
.list-tag {
box-sizing: border-box;
display: flex;
align-items: center;
// height: 30px;
// line-height: 30px;
background: #fafbfe;
border: 1px solid #e8e8ea;
padding: 0 8px;
margin-right: 4px;
border-radius: 4px;
.tag-txt {
font-size: 14px;
color: #666666;
box-sizing: border-box;
padding-right: 8px;
line-height: 26px;
}
.icon-close {
width: 8px;
height: 8px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
}
}
}
}
.search-groomname {
width: 252px;
margin: 12px 16px 0;
/deep/.el-input {
width: 252px;
}
}
.filter-tree {
padding: 0 16px;
}
.grey-txt {
color: #c8c8c8;
cursor: not-allowed;
}
.empty {
padding: 10px 0;
margin: 0;
text-align: center;
color: #999;
font-size: 13px;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
.dialog-look {
text-align: center;
}
</style>
<template>
<div class="bulletin-wrap">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<component :is="currentComponent" ref="componentRef"></component>
</div>
</template>
<script>
import battle from './components/battle/index.vue'
import saasOrder from './components/saasOrder/index.vue'
import vehicleDamageOrder from './components/vehicleDamageOrder/index.vue'
export default {
components: {
battle,
saasOrder,
vehicleDamageOrder
},
data() {
return {
activeName: '1',
currentComponent: 'saasOrder',
tabPaneList: [
{
label: '1.1',
name: '1'
},
{
label: '1.3',
name: '2'
},
{
label: '2.1',
name: '3'
}
]
}
},
methods: {
handleClick() {
let componetObj = {
1: 'saasOrder',
2: 'battle',
3: 'vehicleDamageOrder'
}
this.currentComponent = componetObj[this.activeName]
}
}
}
</script>
<style lang="scss" scoped></style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-form label-width="100px" :inline="true"> <el-form label-width="100px" :inline="true">
<el-row v-for="(item, index) in detailFormDataRow" :key="index"> <el-row v-for="(item, index) in detailFormDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label" class="row-item"> <el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label" class="row-item">
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span> <span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : subItem.format ? subItem.format(detailForm) : '-' }}</span>
</el-form-item> </el-form-item>
</el-row> </el-row>
<template v-if="detailForm.formDescribe"> <template v-if="detailForm.formDescribe">
...@@ -205,7 +205,9 @@ export default { ...@@ -205,7 +205,9 @@ export default {
}, },
{ {
label: '尾款', label: '尾款',
name: 'crowdFundingPrice' format: data => {
return data.crowdFundingPrice + ' * ' + data.orderGoods[0].goodsNumber
}
}, },
{ {
label: '发货地址', label: '发货地址',
......
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { dateFormat } from '../../utils/index' import { dateFormat } from '@/utils/index'
import GlSelectMenu from '../battle/components/select-dropdown.vue' import GlSelectMenu from '../battle/components/select-dropdown.vue'
export default { export default {
components: { components: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!