Commit fdb5e547 by 杨北旺

场景文字喜报配置

1 parent 9495dcb8
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
</template> </template>
</div> </div>
</div> </div>
<div class="text-num">{{ textNum }}/{{ maxNum }}</div> <span v-if="showNewMaxNum" class="text-num-up">{{ textNum }}/{{ maxNum }}</span>
<div v-else class="text-num">{{ textNum }}/{{ maxNum }}</div>
</div> </div>
<div v-show="emotionStatus" class="emotion-panel"> <div v-show="emotionStatus" class="emotion-panel">
<emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words> <emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words>
...@@ -62,7 +63,8 @@ export default { ...@@ -62,7 +63,8 @@ export default {
maxNum: { maxNum: {
typr: Number, typr: Number,
default: 200 default: 200
} },
showNewMaxNum:Boolean
}, },
components: { components: {
WTextarea, WTextarea,
...@@ -222,6 +224,15 @@ export default { ...@@ -222,6 +224,15 @@ export default {
position: absolute; position: absolute;
right: -85px; right: -85px;
} }
.text-num-up{
font-size: 14px;
color: #999999;
position: absolute;
right: 12px;
bottom: 100px;
background: #fff;
line-height: 16px;
}
} }
.date-picker { .date-picker {
margin-top: 10px; margin-top: 10px;
......
<template>
<div class="marketing">
<div class="addConfig-wrap">
<div class="header color-3 weight-6 text-16">配置专员</div>
<div class="config-wrap gl-form-page">
<el-form ref="form" :model="form" label-width="235px">
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange" @visible-change="hideSelect">
<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 class="group-item-box" :key="index">
<div slot="label">
{{ bulletin.label }}
<img v-if="bulletin.eyeIcon" class="icon-eye" @click="handlePoster(bulletin.eyeIcon)" src="@/assets/icon-eye.png" />
<span v-if="bulletin.label != '推送时间'">推送至群聊:</span>
<span v-else>:</span>
</div>
<div v-if="bulletin.label == '推送时间'" class="group-box group-box-white">
<div class="input-box radio-box">
<el-radio-group @change="changeRadio" v-model="pushRadio">
<el-radio :label="2">次日</el-radio>
<el-radio :label="1">当天</el-radio>
</el-radio-group>
</div>
<div class="input-box">
<el-time-select
:disabled="pushRadio==2"
:picker-options="{
start: '00:00',
step: '00:60',
end: '23:00'
}"
v-model="pushTimeValue"
placeholder="选择时间"
></el-time-select>
</div>
</div>
<div v-else class="group-box">
<div class="input-box" v-for="(i, k) in groupCofListInput[bulletin.storageList]" :key="k">
<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 v-if="bulletin.componentName == 'wordReportDialog'" 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>
<!-- 查看 -->
<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 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 wordReportDialog from './components/dialogs/wordReportDialog.vue'
// import dailyDialog from './components/dialogs/dailyDialog.vue'
// import progressDialog from './components/dialogs/progressDialog.vue'
// import replenishmentDialog from './components/dialogs/replenishmentDialog.vue'
// import saasDialog from './components/dialogs/saasDialog.vue'
// import viewDialog from './components/dialogs/viewDialog.vue'
// import InvoicingDialog from './components/dialogs/InvoicingDialog.vue'
import { dateFormat } from '@/utils/index'
export default {
components: {
// GlSelectMenu,
// personalDialog,
// xibaoDialog,
// bulletinDialog,
wordReportDialog
// dailyDialog,
// progressDialog,
// replenishmentDialog,
// InvoicingDialog,
// saasDialog,
// viewDialog
},
data() {
return {
selectGroupName: [],
isDialogVisible: false,
paramsData: this.$route.query,
dialogComponent: '',
merchantList: [],
automaticData: [],
expandedKeys: [],
defaultProps: {
children: 'children',
label: 'name'
},
config: {
merchantId: ''
},
isAutomatic: true,
filterText: '',
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
groupCofList: {
xiReport: [],
zhanReport: [],
zhanServerReport: [],
storeServerReport: [],
employeeBadgeReport: [],
InvoicingReport: [],
wordReport: []
},
switchList: {
xiReport: [],
zhanReport: [{ switchType: 201, switchStatus: 'Y', actionReportType: 2 }],
InvoicingReport: [],
// 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: 2401, switchStatus: 'Y', actionReportType: 24, switchText: '' }]
},
groupCofListInput: {
xiReportValue: [],
zhanReportValue: [],
zhanServerReportValue: [],
storeServerReportValue: [],
employeeBadgeReportValue: [],
InvoicingReportValue: [],
wordReportValue: []
},
groupToType: [
{
attr: 'xiReport',
type: 20
},
{
attr: 'zhanReport',
type: 21
},
{
attr: 'zhanServerReport',
type: 22
},
{
attr: 'storeServerReport',
type: 9
},
{
attr: 'employeeBadgeReport',
type: 23
},
{
attr: 'InvoicingReport',
type: 10
},
{
attr: 'wordReport',
type: 24
}
],
buttetinList: [
{
label: '收款喜报',
storageList: 'xiReportValue',
componentName: '',
eyeIcon: 'xiReport_qy'
},
{
label: '文字喜报',
storageList: 'wordReportValue',
componentName: 'wordReportDialog',
eyeIcon: 'wordReport_qy'
},
{
label: '店面早报',
storageList: 'zhanReportValue',
componentName: '',
eyeIcon: 'zhanReport_qy'
},
{
label: '推送时间',
storageList: '',
componentName: '',
eyeIcon: ''
},
{
label: '服务商战报',
storageList: 'zhanServerReportValue',
componentName: '',
eyeIcon: 'zhanServerReport_qy'
},
{
label: '驻店日报',
text: '预览配置',
storageList: 'storeServerReportValue',
componentName: '',
eyeIcon: ''
},
{
label: '智能工牌开机检测',
storageList: 'employeeBadgeReportValue',
componentName: '',
eyeIcon: ''
},
{
label: '开单预警',
text: '预览配置',
storageList: 'InvoicingReportValue',
componentName: '',
eyeIcon: ''
}
],
isImgVisible: false,
dialogImageUrl: '',
pushTimeValue: '9:00',
pushRadio:2,
}
},
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
data = JSON.parse(data)
this.getMerchantList(sign)
console.log(data);
this.handlebattleOn(data, sign)
},
methods: {
changeRadio(e){
if(e==2){
this.pushTimeValue = '9:00'
}
},
// 图片查看
handlePoster(name) {
this.isImgVisible = true
this.dialogImageUrl = name
},
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
this.getDepartmentTree()
}
})
},
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 = {
xiReportValue: [{ name: '' }],
zhanReportValue: [{ name: '' }],
zhanServerReportValue: [{ name: '' }],
storeServerReportValue: [{ name: '' }],
employeeBadgeReportValue: [{ name: '' }],
InvoicingReportValue: [{ name: '' }],
wordReportValue: [{ 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.groupCofList = {
xiReport: [],
zhanReport: [],
wordReport: [],
zhanServerReport: [],
storeServerReport: [],
employeeBadgeReport: [],
InvoicingReport: []
}
this.groupCofListInput = {
xiReportValue: [],
zhanReportValue: [],
zhanServerReportValue: [],
storeServerReportValue: [],
employeeBadgeReportValue: [],
InvoicingReportValue: [],
wordReportValue: []
}
// 编辑
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: '' })
}
if(item.sendTime){
this.pushRadio = 1
this.pushTimeValue = item.sendTime
}
}
})
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)
this.getDepartmentTree()
} else {
this.groupCofListInput = {
xiReportValue: [{ name: '' }],
zhanReportValue: [{ name: '' }],
zhanServerReportValue: [{ name: '' }],
storeServerReportValue: [{ name: '' }],
InvoicingReportValue: [{ name: '' }],
employeeBadgeReportValue: [{ name: '' }],
wordReportValue: [{ name: '' }]
}
}
},
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: [],
zhanServerReport: [],
storeServerReport: [],
employeeBadgeReport: [],
InvoicingReport: [],
wordReport: []
}
}
}
})
},
//所属企业
handleMerchatChange(val) {
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
zhanServerReport: [],
storeServerReport: [],
employeeBadgeReport: [],
InvoicingReport: [],
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
}
console.log(this.groupCofListInput, 'this.groupCofListInput')
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: 0
}
let switchList = []
let reportParams = ['xiReport', 'zhanReport', 'wordReport', 'InvoicingReport']
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)
})
const sendTime = this.pushTimeValue?this.pushTimeValue+':00':''
let _emptyObj = {}
Object.keys(this.groupCofList).map(item => {
let type = this.groupToType.find(k => k.attr == item).type
if(type==21&&this.pushRadio==1){//仅早报需要
_emptyObj.sendTime = sendTime
}else{
_emptyObj = {}
}
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,
..._emptyObj
})
})
} 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,
..._emptyObj
})
})
}
})
//联调测试模拟数据
// params.groupConfigList.forEach(el=>{
// if(el.actionReportType==24){
// el.groupId = "null_R:江氏大客户服务群"
// el.groupName = "江氏大客户服务群"
// }
// })
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.handlebattleClose()
}
})
},
handlebattleClose() {
this.$router.push({
path: '/bulletin/index',
query: {
activeName: '4'
}
})
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-box-white {
background: #fff;
padding: 14px 0 20px 20px;
.radio-box {
margin-bottom: 14px;
}
}
.group-config-text {
font-size: 14px;
color: #5850ff;
position: absolute;
left: 450px;
top: 20px;
white-space: nowrap;
cursor: pointer;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
}
.is-reverse {
transform: rotate(180deg);
}
.icon-eye {
width: 20px;
height: 20px;
cursor: pointer;
vertical-align: middle;
}
.dialog-look {
text-align: center;
}
</style>
<template>
<GLDialog :mode="mode" title="文字喜报配置" :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/wordReport_qy.png" />
</div>
<p class="color-3 txt-center text-14">图示效果</p>
</div>
<div class="right-wrap">
<el-form ref="form" :model="form" label-width="120px">
<div class="item-line">
<el-form-item label="编辑文本:" class="verbal-wrap">
<verbal :showNewMaxNum="true" :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">推送2.1会员权益场景的商品,驻店在小程序端下单,客户支付成功后产生有效订单时自动推送,订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送。</p>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import dialog from './dialog'
export default {
mixins: [dialog],
data() {
return {
mode: 'big',
wordType: {
switchType: 2401,
switchText: ''
},
btnList: [
{
type: 1,
name: '表情'
},
{
type: 2,
name: '销售顾问'
},
{
type: 2,
name: '客户姓名'
},
{
type: 2,
name: '转化人员'
},
{
type: 2,
name: '商品名称'
},
{
type: 2,
name: '车辆价格'
},
{
type: 2,
name: '今日单量'
},{
type: 2,
name: '部门名称累计:本月累计单量'
},{
type: 2,
name: '本月累计单量'
},{
type: 2,
name: '本月累计产值'
},{
type: 2,
name: '订单总金额'
},{
type: 2,
name: '流量店门店名称'
},
],
params: ['wordType'],
mapList: {
销售顾问: '${employeeName}',
客户姓名: '${customerName}',
转化人员: '${transferName}',
车辆价格: '${carPrice}',
商品名称: '${goodsNames}',
今日单量: '${orderNumber}',
'部门名称累计:本月累计单量': '${departmentNameOrderNumber}',
本月累计单量: '${monthOrderNumber}',
本月累计产值: '${monthTurnover}',
订单总金额: '${orderPrice}',
流量店门店名称: '${merchantName4s}',
}
}
},
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 28px;
.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: 592px;
background: #f4f6fc;
padding: 16px;
margin-left: 120px;
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: 592px;
}
/deep/ .w-textarea_input {
height: 328px;
}
/deep/ .btn-group-panel .btn-group {
flex-wrap: wrap;
justify-content: none;
.add-btn {
margin-bottom: 5px;
}
}
}
}
</style>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
<GLDialog <!-- <GLDialog
:mode="mode" :mode="mode"
class="battle-dialog" class="battle-dialog"
title="配置专员" title="配置专员"
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 推送人 -->
<el-form-item <el-form-item
class="select-wrap" class="select-wrap"
label="推送人:" label="推送人:"
...@@ -144,7 +143,6 @@ ...@@ -144,7 +143,6 @@
</gl-select-menu> </gl-select-menu>
</transition> </transition>
</el-form-item> </el-form-item>
<!-- 收款喜报 - 关联群 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 收款喜报 将 收款喜报
...@@ -257,7 +255,6 @@ ...@@ -257,7 +255,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- 战报 - 关联群 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 店面早报 将 店面早报
...@@ -370,7 +367,6 @@ ...@@ -370,7 +367,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- 服务商战报 - 关联群 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 服务商战报 将 服务商战报
...@@ -483,7 +479,6 @@ ...@@ -483,7 +479,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- 驻店日报 - 关联群 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 驻店日报 将 驻店日报
...@@ -596,7 +591,6 @@ ...@@ -596,7 +591,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- 智能工牌开机检测 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 智能工牌开机检测 将 智能工牌开机检测
...@@ -704,7 +698,6 @@ ...@@ -704,7 +698,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- 开单预警 - 关联群 -->
<el-form-item class="select-wrap"> <el-form-item class="select-wrap">
<div slot="label"> <div slot="label">
将 开单预警 将 开单预警
...@@ -819,7 +812,7 @@ ...@@ -819,7 +812,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</GLDialog> </GLDialog> -->
<!-- 查看 --> <!-- 查看 -->
<GLDialog <GLDialog
v-if="isImgVisible" v-if="isImgVisible"
...@@ -840,10 +833,10 @@ ...@@ -840,10 +833,10 @@
<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: {
GlSelectMenu // GlSelectMenu
}, },
data () { data () {
return { return {
...@@ -1085,54 +1078,54 @@ export default { ...@@ -1085,54 +1078,54 @@ export default {
// this.config.merchantName = this.merchantList[0]?.merchantName // this.config.merchantName = this.merchantList[0]?.merchantName
}, },
computed: { computed: {
domXiEl () { // domXiEl () {
return this.$refs.groupXiRef // return this.$refs.groupXiRef
},
domZhanEl () {
return this.$refs.groupZhanRef
},
// domOrderEl() {
// return this.$refs.groupOrderRef
// }, // },
// domSaEl() { // domZhanEl () {
// return this.$refs.groupSaRef // return this.$refs.groupZhanRef
// }, // },
automaticEl () { // // domOrderEl() {
return this.$refs.automaticRef // // return this.$refs.groupOrderRef
}, // // },
// domSaPerEl() { // // domSaEl() {
// return this.$refs.groupSaPerRef // // return this.$refs.groupSaRef
// // },
// automaticEl () {
// return this.$refs.automaticRef
// }, // },
// domScheduleEl() { // // domSaPerEl() {
// return this.$refs.groupScheduleRef // // return this.$refs.groupSaPerRef
// // },
// // domScheduleEl() {
// // return this.$refs.groupScheduleRef
// // },
// domZhanServerEl () {
// return this.$refs.groupZhanServerRef
// },
// domStoreServerEl () {
// return this.$refs.groupStoreServerRef
// },
// domInvoicingServerEl () {
// return this.$refs.groupInvoicingServerRef
// },
// domemployeeBadgeEl () {
// return this.$refs.employeeBadgeRef
// }, // },
domZhanServerEl () {
return this.$refs.groupZhanServerRef
},
domStoreServerEl () {
return this.$refs.groupStoreServerRef
},
domInvoicingServerEl () {
return this.$refs.groupInvoicingServerRef
},
domemployeeBadgeEl () {
return this.$refs.employeeBadgeRef
},
}, },
watch: { watch: {
filterText (val) { // filterText (val) {
this.$refs.tree.filter(val) // this.$refs.tree.filter(val)
}, // },
roomName (val) { // roomName (val) {
this.filterRoomName(val) // this.filterRoomName(val)
} // }
}, },
methods: { methods: {
// 图片查看 // 图片查看
handlePoster (name) { // handlePoster (name) {
this.isImgVisible = true // this.isImgVisible = true
this.dialogImageUrl = name // this.dialogImageUrl = name
}, // },
getOptionsList (formName, hasAll = true, refreshSigle) { getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
...@@ -1179,162 +1172,162 @@ export default { ...@@ -1179,162 +1172,162 @@ export default {
} }
this.handleSearch() this.handleSearch()
}, },
clearData () { // clearData () {
this.setectList = [] // this.setectList = []
this.$refs.battleRef.clearMutiSelect() // this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId // this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = { // this.wechat = {
staffId: '', // staffId: '',
automaticName: '' // automaticName: ''
} // }
this.groupCofList = { // this.groupCofList = {
xiReport: [], // xiReport: [],
zhanReport: [], // zhanReport: [],
// orderReport: [], // // orderReport: [],
// saReport: [], // // saReport: [],
// saPerReport: [], // // saPerReport: [],
// scheduleReport: [], // // scheduleReport: [],
zhanServerReport: [], // zhanServerReport: [],
storeServerReport: [], // storeServerReport: [],
employeeBadgeReport: [], // employeeBadgeReport: [],
InvoicingReport: [] // InvoicingReport: []
} // }
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: '' }],
storeServerReportValue: [{ name: '' }],
InvoicingReportValue: [{ name: '' }],
employeeBadgeReportValue: [{ 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.groupHideObj.storeServerReport = true
this.groupHideObj.employeeBadgeReport = true
this.groupHideObj.InvoicingReport = 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.hideSelect()
// this.wechat.roomName = data.roomName // },
// this.wechat.groupId = data.roomChatId // filterNode (value, data) {
this.groupCofList[groupHideAttr].push({ // if (!value) return true
groupId: data.roomChatId, // return data.name.indexOf(value) !== -1
roomName: data.roomName // },
}) // filterRoomName (value) {
}, // this.stageList = this.groupList.filter(item => {
openGroup (groupHideAttr) { // if (item.roomName.indexOf(value) !== -1) {
this.isAutomatic = true // return item
// this.isgroup = !this.isgroup // }
let attrList = Object.keys(this.groupHideObj) // })
attrList.forEach(item => { // },
if (item != groupHideAttr) { // handleNodeClick (data) {
this.groupHideObj[item] = true // this.hideSelect()
} // this.wechat.automaticName = data.name
}) // this.wechat.staffId = data.staffId
this.roomName = '' // this.idBefEncryption = data.idBefEncryption
this.stageList = [] // this.getGroupList(this.wechat.staffId, true)
this.groupHideObj[groupHideAttr] = !this.groupHideObj[groupHideAttr] // this.$apis.battle.activityreportWorktool({ cloudId: this.idBefEncryption }).then(res => {
}, // this.selectGroupName = res.data.result || []
openAutomatic () { // this.groupCofListInput = {
// this.isgroup = true // xiReportValue: [{ name: '' }],
this.groupHideObj.xiReport = true // zhanReportValue: [{ name: '' }],
this.groupHideObj.zhanReport = true // zhanServerReportValue: [{ name: '' }],
// this.groupHideObj.orderReport = true // storeServerReportValue: [{ name: '' }],
// this.groupHideObj.saReport = true // InvoicingReportValue: [{ name: '' }],
// this.groupHideObj.saPerReport = true // employeeBadgeReportValue: [{ name: '' }]
// this.groupHideObj.scheduleReport = true // }
this.groupHideObj.zhanServerReport = true // })
this.groupHideObj.storeServerReport = true // },
this.groupHideObj.employeeBadgeReport = true // hideSelect () {
this.groupHideObj.InvoicingReport = true // // this.isgroup = true
this.isAutomatic = !this.isAutomatic // this.groupHideObj.xiReport = true
}, // this.groupHideObj.zhanReport = true
handleGroupRemove (idx, groupHideAttr) { // // this.groupHideObj.orderReport = true
this.groupCofList[groupHideAttr].splice(idx, 1) // // this.groupHideObj.saReport = true
}, // this.groupHideObj.zhanServerReport = true
// this.groupHideObj.storeServerReport = true
// this.groupHideObj.employeeBadgeReport = true
// this.groupHideObj.InvoicingReport = 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.groupHideObj.storeServerReport = true
// this.groupHideObj.employeeBadgeReport = true
// this.groupHideObj.InvoicingReport = true
// this.isAutomatic = !this.isAutomatic
// },
// handleGroupRemove (idx, groupHideAttr) {
// this.groupCofList[groupHideAttr].splice(idx, 1)
// },
//所属企业 //所属企业
handleMerchatChange (val) { // handleMerchatChange (val) {
this.getDepartmentTree() // this.getDepartmentTree()
this.merchantList.forEach(item => { // this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : '' // item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
}) // })
this.wechat = { // this.wechat = {
staffId: '', // staffId: '',
automaticName: '' // automaticName: ''
} // }
this.groupCofList = { // this.groupCofList = {
xiReport: [], // xiReport: [],
zhanReport: [], // zhanReport: [],
// orderReport: [], // // orderReport: [],
// saReport: [], // // saReport: [],
// saPerReport: [], // // saPerReport: [],
// scheduleReport: [], // // scheduleReport: [],
zhanServerReport: [], // zhanServerReport: [],
storeServerReport: [], // storeServerReport: [],
employeeBadgeReport: [], // employeeBadgeReport: [],
InvoicingReport: [] // InvoicingReport: []
} // }
}, // },
battleSetHandle () { // battleSetHandle () {
if (this.setectList.length == 0) { // if (this.setectList.length == 0) {
this.$message({ // this.$message({
message: '请选择园区店', // message: '请选择园区店',
type: 'error' // type: 'error'
}) // })
return // return
} // }
this.wechat = { // this.wechat = {
staffId: '', // staffId: '',
automaticName: '' // automaticName: ''
} // }
this.groupCofList = { // this.groupCofList = {
xiReport: [], // xiReport: [],
zhanReport: [], // zhanReport: [],
// orderReport: [], // // orderReport: [],
// saReport: [], // // saReport: [],
// saPerReport: [], // // saPerReport: [],
// scheduleReport: [], // // scheduleReport: [],
zhanServerReport: [], // zhanServerReport: [],
storeServerReport: [], // storeServerReport: [],
employeeBadgeReport: [], // employeeBadgeReport: [],
InvoicingReport: [] // InvoicingReport: []
} // }
this.getDepartmentTree() // this.getDepartmentTree()
this.battleVisible = true // this.battleVisible = true
}, // },
dateFormatFun (date) { dateFormatFun (date) {
return dateFormat(date) return dateFormat(date)
}, },
...@@ -1347,210 +1340,219 @@ export default { ...@@ -1347,210 +1340,219 @@ export default {
handlestaffbattleClose () { handlestaffbattleClose () {
this.battlestaffVisible = false this.battlestaffVisible = false
}, },
async handlebattleConfirm () { // async handlebattleConfirm () {
if (!this.wechat.staffId) { // if (!this.wechat.staffId) {
this.$message({ // this.$message({
message: '请选择推送人', // message: '请选择推送人',
type: 'error', // type: 'error',
customClass: 'message-Z-zinde' // customClass: 'message-Z-zinde'
}) // })
return true // return true
} // }
try { // try {
let isGroupEmpty = Object.keys(this.groupCofList) // let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length) // .map(item => this.groupCofList[item].length)
.every(item => item == 0) // .every(item => item == 0)
let isGroupEmptyInput = Object.keys(this.groupCofListInput) // let isGroupEmptyInput = Object.keys(this.groupCofListInput)
.map(item => this.groupCofListInput[item].length) // .map(item => this.groupCofListInput[item].length)
.every(item => item == 0) // .every(item => item == 0)
if (isGroupEmpty && isGroupEmptyInput) { // if (isGroupEmpty && isGroupEmptyInput) {
this.$message({ // this.$message({
message: '推送配置必须配置至少一项', // message: '推送配置必须配置至少一项',
type: 'error', // type: 'error',
customClass: 'message-Z-zinde' // customClass: 'message-Z-zinde'
}) // })
return true // return true
} // }
var params = { // var params = {
enterpriseMerchantId: this.config.merchantId, // enterpriseMerchantId: this.config.merchantId,
enterpriseMerchantName: this.config.merchantName, // enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId, // staffId: this.wechat.staffId,
staffName: this.wechat.automaticName, // staffName: this.wechat.automaticName,
// groupId: this.wechat.groupId, // // groupId: this.wechat.groupId,
// groupName: this.wechat.roomName, // // groupName: this.wechat.roomName,
groupMerchantId: this.config.merchantId, // groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName, // updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: [], // yqMerchantIdList: [],
groupConfigList: [], // groupConfigList: [],
merchantId: this.setectList[0]?.merchantId, // merchantId: this.setectList[0]?.merchantId,
scene: 0 // scene: 0
} // }
this.setectList.forEach(item => { // this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId) // params.yqMerchantIdList.push(item.yqMerchantId)
}) // })
Object.keys(this.groupCofList).map(item => { // Object.keys(this.groupCofList).map(item => {
console.log(item) // console.log(item)
// console.log(this.groupCofList[item]) // // console.log(this.groupCofList[item])
let type = this.groupToType.find(k => k.attr == item).type // let type = this.groupToType.find(k => k.attr == item).type
if (this.groupCofList[item].length) { // if (this.groupCofList[item].length) {
this.groupCofList[item].forEach(k => { // this.groupCofList[item].forEach(k => {
params.groupConfigList.push({ // params.groupConfigList.push({
groupId: k.groupId, // groupId: k.groupId,
groupName: k.roomName, // groupName: k.roomName,
groupMerchantId: this.config.merchantId, // groupMerchantId: this.config.merchantId,
actionReportType: type // actionReportType: type
}) // })
}) // })
} else if (this.groupCofListInput[item + 'Value'].length) { // } else if (this.groupCofListInput[item + 'Value'].length) {
this.groupCofListInput[item + 'Value'].forEach(k => { // this.groupCofListInput[item + 'Value'].forEach(k => {
params.groupConfigList.push({ // params.groupConfigList.push({
groupId: this.idBefEncryption + '_R:' + k.name, // groupId: this.idBefEncryption + '_R:' + k.name,
groupName: k.name, // groupName: k.name,
groupMerchantId: this.config.merchantId, // groupMerchantId: this.config.merchantId,
actionReportType: type // actionReportType: type
}) // })
}) // })
} // }
}) // })
console.log(params, 'params---') // console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => { // this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({ // this.$message({
message: res.code == '0' ? '配置成功' : res.message, // message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error' // type: res.code == '0' ? 'success' : 'error'
}) // })
if (res.data) { // if (res.data) {
this.battleVisible = false // this.battleVisible = false
this.handleSearch() // this.handleSearch()
this.clearData() // this.clearData()
} // }
}) // })
} catch (error) { // } catch (error) {
console.log(error) // console.log(error)
} // }
}, // },
handlebattleClose () { // handlebattleClose () {
this.battleVisible = false // this.battleVisible = false
this.clearData() // this.clearData()
}, // },
handleDetails () { }, handleDetails () { },
addGroup (group) { // addGroup (group) {
group.push({ name: '' }) // group.push({ name: '' })
}, // },
delGroup (group, i) { // delGroup (group, i) {
group.splice(i, 1) // group.splice(i, 1)
}, // },
handlebattleOn (data, sign) { handlebattleOn (data, sign) {
this.setectList = [] let params = {
this.setectList.push(data) data: JSON.stringify(data),
this.wechat = { sign: sign ? sign : ''
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
// orderReport: [],
// saReport: [],
// saPerReport: [],
// scheduleReport: [],
zhanServerReport: [],
storeServerReport: [],
employeeBadgeReport: [],
InvoicingReport: []
}
this.groupCofListInput = {
xiReportValue: [],
zhanReportValue: [],
// orderReportValue: [],
// saReportValue: [],
// saPerReportValue: [],
// scheduleReportValue: [],
zhanServerReportValue: [],
storeServerReportValue: [],
employeeBadgeReportValue: [],
InvoicingReportValue: []
}
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.$router.push({
this.selectGroupName = res.data.result || [] path: '/bulletin/addConfig_21',
query: params
}) })
this.getGroupList(this.wechat.staffId)
} else { // this.setectList = []
this.groupCofListInput = { // this.setectList.push(data)
xiReportValue: [{ name: '' }], // this.wechat = {
zhanReportValue: [{ name: '' }], // staffId: '',
// orderReportValue: [{ name: '' }], // automaticName: ''
// saReportValue: [{ name: '' }], // }
// saPerReportValue: [{ name: '' }], // this.groupCofList = {
// scheduleReportValue: [{ name: '' }], // xiReport: [],
zhanServerReportValue: [{ name: '' }], // zhanReport: [],
storeServerReportValue: [{ name: '' }], // // orderReport: [],
InvoicingReportValue: [{ name: '' }], // // saReport: [],
employeeBadgeReportValue: [{ name: '' }] // // saPerReport: [],
} // // scheduleReport: [],
} // zhanServerReport: [],
this.getDepartmentTree() // storeServerReport: [],
}, // employeeBadgeReport: [],
getGroupList (id, isReset = false) { // InvoicingReport: []
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => { // }
if (res.code == 0) { // this.groupCofListInput = {
this.groupList = res.data // xiReportValue: [],
if (isReset) { // zhanReportValue: [],
this.groupCofList = { // // orderReportValue: [],
xiReport: [], // // saReportValue: [],
zhanReport: [], // // saPerReportValue: [],
// orderReport: [], // // scheduleReportValue: [],
// saReport: [], // zhanServerReportValue: [],
// saPerReport: [], // storeServerReportValue: [],
// scheduleReport: [], // employeeBadgeReportValue: [],
zhanServerReport: [], // InvoicingReportValue: []
storeServerReport: [], // }
employeeBadgeReport: [], // this.battleVisible = true
InvoicingReport: [] // // 编辑
} // if (sign) {
} // this.wechat.staffId = data.staffId
} // this.wechat.automaticName = data.staffName
}) // // this.wechat.groupId = data.groupId
}, // // this.wechat.roomName = data.groupName
handleSetting () { // this.config.merchantId = data.enterpriseMerchantId
this.drawer = true // 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: '' }],
// storeServerReportValue: [{ name: '' }],
// InvoicingReportValue: [{ name: '' }],
// employeeBadgeReportValue: [{ 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: [],
// storeServerReport: [],
// employeeBadgeReport: [],
// InvoicingReport: []
// }
// }
// }
// })
// },
// handleSetting () {
// this.drawer = true
// },
handleClick () { handleClick () {
this.handleSearch() this.handleSearch()
}, },
...@@ -1561,58 +1563,58 @@ export default { ...@@ -1561,58 +1563,58 @@ export default {
handleSearch () { handleSearch () {
this.$refs.battleRef.refreshTable() this.$refs.battleRef.refreshTable()
}, },
async getDepartmentTree () { // async getDepartmentTree () {
let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 } // let params = { addChildrensFlag: true, queryMerchantId: this.config.merchantId, loginStatus: 1 }
// let params = { addChildrensFlag: true, queryMerchantId: 44209846, loginStatus: 1 } // // let params = { addChildrensFlag: true, queryMerchantId: 44209846, loginStatus: 1 }
let data = await this.$apis.saasOrder.getlistDepartmentTree(params) // let data = await this.$apis.saasOrder.getlistDepartmentTree(params)
this.ids = [] // this.ids = []
this.automaticData = data // this.automaticData = data
await this.initData(this.automaticData) // await this.initData(this.automaticData)
this.expandedKeys = [this.automaticData[0].id] // this.expandedKeys = [this.automaticData[0].id]
}, // },
initData (data) { // initData (data) {
data.forEach((item, index) => { // data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName) // this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || [] // let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => { // entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) { // if (staff.staffName) {
this.$set(staff, 'name', staff.staffName) // this.$set(staff, 'name', staff.staffName)
} else { // } else {
this.$set(staff, 'name', staff.departmentName) // this.$set(staff, 'name', staff.departmentName)
} // }
if (staff.staffId && !this.ids.includes(staff.staffId)) { // if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId) // this.ids.push(staff.staffId)
return true // return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) { // } else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false // return false
} // }
}) // })
let child = this.$common.utils.deepClone(item.children) || [] // let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => { // child = child.filter((staff, idx) => {
if (staff.staffName) { // if (staff.staffName) {
this.$set(staff, 'name', staff.staffName) // this.$set(staff, 'name', staff.staffName)
} else { // } else {
this.$set(staff, 'name', staff.departmentName) // this.$set(staff, 'name', staff.departmentName)
} // }
if (staff.staffId && !this.ids.includes(staff.staffId)) { // if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId) // this.ids.push(staff.staffId)
return true // return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) { // } else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false // return false
} else if (staff.entmicroStaffResponses) { // } else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id // staff.staffId = staff.id
return true // return true
} // }
}) // })
const children = [...child, ...entmicroStaffResponses] // const children = [...child, ...entmicroStaffResponses]
item.children = children // item.children = children
//清除没有员工的部门 // //清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) { // if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1) // // data.splice(index, 1)
} // }
children.length && this.initData(children) // children.length && this.initData(children)
}) // })
} // }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!