Commit c8e2dfc1 by 前端

Merge branch 'SAAS+V4.51.1' into 'master'

上线合并

See merge request !80
2 parents 64688db3 649a37e3
...@@ -82,4 +82,41 @@ const getGroupList = params => { ...@@ -82,4 +82,41 @@ const getGroupList = params => {
}) })
} }
export default { getStaffList, getMerchantList, getlistDepartmentTree, getYqReportlist, updateYqConfig, insertStaff, getGroupList } // 分页查询驻店员工群聊配置
const getStaffCofList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = 'dj.api.smarcarlife.MerchantActionReportConfig.listStaffWithPage'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'post',
data: params,
sign: true
})
}
// 查询广联数科商户下角色列表
const getGlskMerchantRole = params => {
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = 'dj.api.smarcarlife.MerchantActionReportConfig.getGlskMerchantRole'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'post',
data: params,
sign: true
})
}
// 更新驻店员工群聊配置
const updateStaffConfig = params => {
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = 'dj.api.smarcarlife.MerchantActionReportConfig.updateStaffConfig'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
export default { getStaffList, getMerchantList, getlistDepartmentTree, getYqReportlist, updateYqConfig, insertStaff, getGroupList, getStaffCofList, getGlskMerchantRole, updateStaffConfig }
...@@ -150,7 +150,8 @@ export default { ...@@ -150,7 +150,8 @@ export default {
InvoicingReport: [], InvoicingReport: [],
wordReport: [], wordReport: [],
regionalOperationsReport: [], regionalOperationsReport: [],
extendedRevenueReport: [] extendedRevenueReport: [],
sceneReport:[]
}, },
switchList: { switchList: {
xiReport: [], xiReport: [],
...@@ -178,7 +179,8 @@ export default { ...@@ -178,7 +179,8 @@ export default {
InvoicingReportValue: [], InvoicingReportValue: [],
wordReportValue: [], wordReportValue: [],
regionalOperationsReportValue: [], regionalOperationsReportValue: [],
extendedRevenueReportValue: [] extendedRevenueReportValue: [],
sceneReportValue: []
}, },
groupToType: [ groupToType: [
{ {
...@@ -216,6 +218,10 @@ export default { ...@@ -216,6 +218,10 @@ export default {
{ {
attr: 'extendedRevenueReport', attr: 'extendedRevenueReport',
type: 26 type: 26
},
{
attr: 'sceneReport',
type: 28
} }
], ],
buttetinList: [ buttetinList: [
...@@ -280,6 +286,12 @@ export default { ...@@ -280,6 +286,12 @@ export default {
storageList: 'extendedRevenueReportValue', storageList: 'extendedRevenueReportValue',
componentName: '', componentName: '',
eyeIcon: '' eyeIcon: ''
},
{
label: '将场景集市上架通知',
storageList: 'sceneReportValue',
componentName: '',
eyeIcon: ''
} }
], ],
isImgVisible: false, isImgVisible: false,
...@@ -375,7 +387,8 @@ export default { ...@@ -375,7 +387,8 @@ export default {
InvoicingReportValue: [{ name: '' }], InvoicingReportValue: [{ name: '' }],
wordReportValue: [{ name: '' }], wordReportValue: [{ name: '' }],
regionalOperationsReportValue: [{ name: '' }], regionalOperationsReportValue: [{ name: '' }],
extendedRevenueReportValue: [{ name: '' }] extendedRevenueReportValue: [{ name: '' }],
sceneReportValue: [{ name: '' }]
} }
}) })
}, },
...@@ -411,7 +424,8 @@ export default { ...@@ -411,7 +424,8 @@ export default {
employeeBadgeReport: [], employeeBadgeReport: [],
InvoicingReport: [], InvoicingReport: [],
regionalOperationsReport: [], regionalOperationsReport: [],
extendedRevenueReport: [] extendedRevenueReport: [],
sceneReport:[]
} }
this.groupCofListInput = { this.groupCofListInput = {
xiReportValue: [], xiReportValue: [],
...@@ -422,7 +436,8 @@ export default { ...@@ -422,7 +436,8 @@ export default {
InvoicingReportValue: [], InvoicingReportValue: [],
wordReportValue: [], wordReportValue: [],
regionalOperationsReportValue: [], regionalOperationsReportValue: [],
extendedRevenueReportValue: [] extendedRevenueReportValue: [],
sceneReportValue:[]
} }
// 编辑 // 编辑
if (sign) { if (sign) {
...@@ -451,7 +466,7 @@ export default { ...@@ -451,7 +466,7 @@ export default {
} }
if (item.sendTime) { if (item.sendTime) {
this.pushRadio = 2 this.pushRadio = 2
this.pushTimeValue = item.sendTime this.pushTimeValue = item.sendTime
} }
} }
}) })
...@@ -475,7 +490,8 @@ export default { ...@@ -475,7 +490,8 @@ export default {
employeeBadgeReportValue: [{ name: '' }], employeeBadgeReportValue: [{ name: '' }],
wordReportValue: [{ name: '' }], wordReportValue: [{ name: '' }],
regionalOperationsReportValue: [{ name: '' }], regionalOperationsReportValue: [{ name: '' }],
extendedRevenueReportValue: [{ name: '' }] extendedRevenueReportValue: [{ name: '' }],
sceneReportValue: [{ name: '' }]
} }
} }
}, },
...@@ -493,7 +509,8 @@ export default { ...@@ -493,7 +509,8 @@ export default {
InvoicingReport: [], InvoicingReport: [],
wordReport: [], wordReport: [],
regionalOperationsReport: [], regionalOperationsReport: [],
extendedRevenueReport: [] extendedRevenueReport: [],
sceneReport:[]
} }
} }
} }
...@@ -518,7 +535,8 @@ export default { ...@@ -518,7 +535,8 @@ export default {
InvoicingReport: [], InvoicingReport: [],
wordReport: [], wordReport: [],
regionalOperationsReport: [], regionalOperationsReport: [],
extendedRevenueReport: [] extendedRevenueReport: [],
sceneReport:[]
} }
}, },
async getDepartmentTree() { async getDepartmentTree() {
......
<!-- 人员配置 -->
<template>
<div class="activity">
<!-- 表格区域 开始 -->
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex-between title">
<div class="title-text">人员列表</div>
</div>
<GLTable ref="battleRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="content" slot-scope="scope">
<div v-if="scope.scope">
<div v-for="(item, index) in formatterContent(scope.scope)" :key="index">{{ item }}</div>
</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>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import { dateFormat } from '@/utils/index'
export default {
data() {
return {
merchantId: '',
merchantName: '',
size: 'small',
mode: 'mid',
url: url,
merchantList: [],
groupList: [],
// 搜索
searchForm: {
residentStaffName: '',
residentStaffPhone: '',
residentStaffRoleId: '',
residentStaffRoleName: '',
residentStaffJobType: '',
residentStaffMentorFlag: ''
},
searchFormData: [
{
label: '员工姓名',
name: 'residentStaffName',
type: 'input',
maxlength: 128
},
{
label: '手机号',
name: 'residentStaffPhone',
type: 'input',
maxlength: 11
},
{
label: '账户角色',
name: 'residentStaffRoleId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'roleName',
optionsName: 'merchantRoleList',
changeAttr: (value, targetItem) => {
this.searchForm.residentStaffRoleName = value ? targetItem.optionList?.find(item => item.id == value)?.roleName : ''
}
},
{
label: '员工职级',
name: 'residentStaffJobType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'jobTypeList'
},
{
label: '是否导师',
name: 'residentStaffMentorFlag',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'mentorFlagList'
}
],
// 表格
getListApi: this.$apis.saasOrder.getStaffCofList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '员工姓名',
prop: 'residentStaffName',
},
{
label: '手机号',
prop: 'residentStaffPhone',
width: 160
},
{
label: '账户角色',
prop: 'residentStaffRoleName',
width: 160
},
{
label: '员工职级',
prop: 'residentStaffJobType',
line: 1,
width: 160,
formatter: cellValue => {
return this.baseData.jobTypeList.find(item => item.confId == cellValue.residentStaffJobType)?.confName || '-'
}
},
{
label: '是否导师',
prop: 'residentStaffMentorFlag',
width: 160,
formatter: cellValue => {
return cellValue.residentStaffMentorFlag == 'Y' ? '是' : '否'
}
},
{
label: '内容',
prop: '',
addHtml: 'content'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
config: {
merchantId: ''
},
rules: {
staffId: { required: true, message: '请选择推送人', trigger: 'change' },
groupId: { required: true, message: '请选择关联群', trigger: 'change' }
},
wechat: {
staffId: '',
automaticName: ''
},
baseData: {
mentorFlagList: [{
confId: 'Y',
confName: '是'
}, {
confId: 'N',
confName: '否'
}],
merchantRoleList: [],
jobTypeList: [{
confId: '0',
confName: '实习生(理论)'
}, {
confId: '1',
confName: '实习生(实践)'
}, {
confId: '2',
confName: '初级驻店'
}, {
confId: '3',
confName: '中级驻店'
}, {
confId: '4',
confName: '高级驻店'
}, {
confId: '5',
confName: '小店长'
}, {
confId: '6',
confName: '大店长'
}, {
confId: '7',
confName: '初级区域督导'
}, {
confId: '8',
confName: '中级区域督导'
}, {
confId: '9',
confName: '高级区域督导'
}, {
confId: '10',
confName: '见习驻店'
}]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getGlskMerchantRole()
},
methods: {
formatterContent(cellValue) {
let typeToTxt = new Map([
[27, '#2.场景线索>>'],
[29, '#1.员工培训日报>>']
])
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
},
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)
}
}
})
}
},
getGlskMerchantRole() {
this.$apis.saasOrder.getGlskMerchantRole({}).then(res => {
console.log(res, 'res---')
this.baseData.merchantRoleList = res
this.getOptionsList('searchFormData', true, 'residentStaffRoleId')
})
},
handleReset() {
this.searchForm = {
residentStaffName: '',
residentStaffPhone: '',
residentStaffRoleId: '',
residentStaffRoleName: '',
residentStaffJobType: '',
residentStaffMentorFlag: ''
}
this.handleSearch()
},
dateFormatFun(date) {
return dateFormat(date)
},
handlebattleOn(data, sign) {
let params = {
data: JSON.stringify(data),
sign: sign ? sign : ''
}
this.$router.push({
path: '/bulletin/editStaffConfig',
query: params
})
},
handleClick() {
this.handleSearch()
},
setTableFinishFun() {
// 接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
}
}
}
</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>
...@@ -1094,7 +1094,8 @@ export default { ...@@ -1094,7 +1094,8 @@ export default {
[23, '#6.智能工牌开机检测>>'], [23, '#6.智能工牌开机检测>>'],
[10, '#7.业务预警>>'], [10, '#7.业务预警>>'],
[25, '#8.区域运营日报>>'], [25, '#8.区域运营日报>>'],
[26, '#9.延保门店产值及个人成交报表>>'] [26, '#9.延保门店产值及个人成交报表>>'],
[28, '#10.将场景集市上架通知>>']
]) ])
let txt = '' let txt = ''
cellValue.groupConfigList?.forEach(item => { cellValue.groupConfigList?.forEach(item => {
......
<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">{{ routeParams.residentStaffName }}</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" @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 :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" v-if="bulletin.componentName" @click="openConfigDialog(bulletin.componentName)">配置</span>
</el-form-item>
</template>
</el-form>
</div>
</div>
<GLFooter class="footer-panel">
<el-button @click="handleStaffClose" size="medium">取消</el-button>
<el-button type="primary" @click="handleStaffConfirm" 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'
import saasDialog from './components/dialogs/saasDialog.vue'
import viewDialog from './components/dialogs/viewDialog.vue'
import InvoicingDialog from './components/dialogs/InvoicingDialog.vue'
export default {
components: {
GlSelectMenu,
personalDialog,
xibaoDialog,
bulletinDialog,
charactersDialog,
dailyDialog,
progressDialog,
replenishmentDialog,
InvoicingDialog,
saasDialog,
viewDialog
},
data() {
return {
selectGroupName: [],
isDialogVisible: false,
merchantName: '',
paramsData: this.$route.query,
routeParams: {},
dialogComponent: '',
merchantList: [],
automaticData: [],
expandedKeys: [],
defaultProps: {
children: 'children',
label: 'name'
},
config: {
merchantId: ''
},
isAutomatic: true,
filterText: '',
wechat: {
staffId: '',
automaticName: ''
// roomName: ''
},
groupCofList: {
trainingReport: [],
sceneClue: []
},
groupCofListInput: {
trainingReportValue: [],
sceneClueValue: [],
},
groupToType: [
{
attr: 'trainingReport',
type: 29
},
{
attr: 'sceneClue',
type: 27
},
],
buttetinList: [
{
label: '.培训日报',
storageList: 'trainingReportValue',
componentName: ''
},
{
label: '.场景线索',
storageList: 'sceneClueValue',
componentName: ''
}
]
}
},
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.routeParams = data
this.merchantName = data.merchantName + data.merchantId
this.getMerchantList(sign)
this.handleStaffOn(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
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 = { wordReportValue: [{ name: '' }], orderReportValue: [{ name: '' }], viewReportValue: [{ name: '' }], InvoicingReportValue: [{ name: '' }], saReportValue: [{ name: '' }], trainingReportValue: [{ name: '' }], scheduleReportValue: [{ name: '' }], zhanReportValue: [{ name: '' }], saasReportValue: [{ name: '' }] }
this.groupCofListInput = { trainingReportValue: [{ name: '' }], sceneClueValue: [{ 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
})
}
})
})
},
handleStaffOn(data, sign) {
this.setectList = []
this.setectList.push(data)
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofListInput = {
trainingReportValue: [],
sceneClueValue: [],
}
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)
this.getDepartmentTree()
} else {
this.groupCofListInput = {
// xiReportValue: [{ name: '' }],
// wordReportValue: [{ name: '' }],
// orderReportValue: [{ name: '' }],
// viewReportValue: [{ name: '' }],
// InvoicingReportValue: [{ name: '' }],
// saReportValue: [{ name: '' }],
trainingReportValue: [{ name: '' }],
sceneClueValue: [{ name: '' }],
// scheduleReportValue: [{ name: '' }],
// zhanReportValue: [{ name: '' }],
// saasReportValue: [{ 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 = {
trainingReport: [],
sceneClue: []
}
}
}
})
},
//所属企业
handleMerchatChange(val) {
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.config.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
trainingReport: [],
sceneClue: []
}
},
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()
},
handleStaffConfirm() {
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 = {
residentStaffPhone: this.routeParams.residentStaffPhone,
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,
groupConfigList: [],
}
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.updateStaffConfig(params).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.data) {
this.$router.push({
path: '/bulletin/index',
query: {
activeName: '5'
}
})
}
})
},
handleStaffClose() {
this.$router.push({
path: '/bulletin/index',
query: {
activeName: '5'
}
})
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;
}
}
.is-reverse {
transform: rotate(180deg);
}
</style>
...@@ -9,13 +9,15 @@ import battle from './components/battle/index.vue' ...@@ -9,13 +9,15 @@ import battle from './components/battle/index.vue'
import saasOrder from './components/saasOrder/index.vue' import saasOrder from './components/saasOrder/index.vue'
import vehicleDamageOrder from './components/vehicleDamageOrder/index.vue' import vehicleDamageOrder from './components/vehicleDamageOrder/index.vue'
import clewOrder from './components/clewOrder/index.vue' import clewOrder from './components/clewOrder/index.vue'
import staffConfig from './components/staffConfig/index.vue'
export default { export default {
components: { components: {
battle, battle,
saasOrder, saasOrder,
vehicleDamageOrder, vehicleDamageOrder,
clewOrder clewOrder,
staffConfig
}, },
data() { data() {
return { return {
...@@ -37,6 +39,10 @@ export default { ...@@ -37,6 +39,10 @@ export default {
{ {
label: '2.1', label: '2.1',
name: '4' name: '4'
},
{
label: '人员配置',
name: '5'
} }
] ]
} }
...@@ -51,7 +57,8 @@ export default { ...@@ -51,7 +57,8 @@ export default {
1: 'saasOrder', 1: 'saasOrder',
2: 'battle', 2: 'battle',
3: 'clewOrder', 3: 'clewOrder',
4: 'vehicleDamageOrder' 4: 'vehicleDamageOrder',
5: 'staffConfig'
} }
this.currentComponent = componetObj[this.activeName] this.currentComponent = componetObj[this.activeName]
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!