Commit d2fdc554 by 张权

Merge branch 'v3.5.2' into 'v3.6.0'

V3.5.2

See merge request !42
2 parents 48f99cfd 662ca078
......@@ -19,16 +19,14 @@
</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="154px" :rules="rules">
<el-form :model="wechat" ref="form" label-width="200px" :rules="rules">
<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-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">
<!-- 推送人 -->
<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">
......@@ -54,29 +52,152 @@
</gl-select-menu>
</transition>
</el-form-item>
<!-- 关联群 -->
<el-form-item class="select-wrap" label="关联群:" prop="groupId">
<!-- 收款喜报 - 关联群 -->
<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 groupList" 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 text-hide">{{ k.roomName }}</span>
<img @click="handleGroupRemove(kIdx, 'xiReport')" src="@/assets/icon-close.png" />
</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 groupList" 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 text-hide">{{ k.roomName }}</span>
<img @click="handleGroupRemove(kIdx, 'zhanReport')" src="@/assets/icon-close.png" />
</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 groupList" 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 text-hide">{{ k.roomName }}</span>
<img @click="handleGroupRemove(kIdx, 'orderReport')" src="@/assets/icon-close.png" />
</div>
</div>
</el-form-item>
<!-- SA喜报 - 关联群 -->
<el-form-item class="select-wrap">
<div slot="label">将
<img class="icon-eye" @click="handlePoster('saReport')" src="@/assets/icon-eye.png" />
SA喜报:推送至群聊:
</div>
<div class="common el-form-item__content">
<div class="el-input" ref="groupRef">
<div class="el-input__inner" @click="openGroup">
<span class="placeholder" v-if="wechat.roomName == ''">选择选择群</span>
{{ wechat.roomName }}
<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">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isgroup ? 'is-reverse' : '']"></i></span>
<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="!isgroup">
<gl-select-menu :domEl="domEl" @changeStatu="hideSelect">
<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="i in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="i" @click="selectGroup(i)">
<span>{{ i.roomName }}</span>
<li v-for="(k, kIdx) in groupList" 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>
......@@ -84,10 +205,20 @@
</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 text-hide">{{ k.roomName }}</span>
<img @click="handleGroupRemove(kIdx, 'saReport')" src="@/assets/icon-close.png" />
</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>
......@@ -101,6 +232,40 @@ export default {
},
data() {
return {
// 推送至群聊,下拉框是否隐藏
groupHideObj: {
xiReport: true,
zhanReport: true,
orderReport: true,
saReport: true
},
groupCofList: {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
},
groupToType: [
{
attr: 'xiReport',
type: 1
},
{
attr: 'zhanReport',
type: 2
},
{
attr: 'orderReport',
type: 3
},
{
attr: 'saReport',
type: 4
}
],
// 查看大图
isImgVisible: false,
dialogImageUrl: '',
isgroup: true,
isAutomatic: true,
merchantId: '',
......@@ -113,10 +278,21 @@ export default {
setectList: [],
merchantList: [],
groupList: [],
// groupList: [{
// roomChatId: '1688855088375831_R:1970325371975971',
// roomName: '波波的单店'
// }, {
// roomChatId: '111',
// roomName: 'cwq'
// }, {
// roomChatId: '222',
// roomName: '啦啦啦'
// }],
// 搜索
searchForm: {
yqMerchantId: '',
yqMerchantName: ''
yqMerchantName: '',
enterpriseMerchantId: ''
},
searchFormData: [
{
......@@ -130,6 +306,16 @@ export default {
name: 'yqMerchantId',
type: 'input',
maxlength: 11
},
{
label: '企微名称',
name: 'enterpriseMerchantId',
type: 'select',
width: '215px',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList'
}
],
// 表格
......@@ -146,18 +332,39 @@ export default {
tableColumns: [
{
label: '园区店',
prop: 'yqMerchantName'
prop: 'yqMerchantName',
formatter: cellValue => {
return cellValue.yqMerchantName + (cellValue.yqMerchantId || '')
}
},
{
label: '商户号',
prop: 'yqMerchantId'
label: '企微',
prop: 'groupName'
},
{
label: '负责人',
label: '推送人',
prop: 'staffName',
line: 1,
width: 300
},
{
label: '内容',
prop: '',
formatter: cellValue => {
let typeToTxt = {
1: '(推收款喜报)',
2: '(推战报)',
3: '(推补录订单)',
4: '(推SA喜报)'
}
let txt = ''
cellValue.groupConfigList?.forEach(item => {
if (item.groupId) {
txt = (txt ? txt + ';' : txt) + item.groupName + typeToTxt[item.actionReportType]
}
})
return txt
}
}
]
},
......@@ -175,13 +382,13 @@ export default {
merchantId: ''
},
rules: {
staffId: { required: true, message: '请选择战报自动发送', trigger: 'change' },
staffId: { required: true, message: '请选择推送人', trigger: 'change' },
groupId: { required: true, message: '请选择关联群', trigger: 'change' }
},
wechat: {
staffId: '',
automaticName: '',
roomName: ''
automaticName: ''
// roomName: ''
},
baseData: {
merchantList: []
......@@ -190,13 +397,23 @@ export default {
},
mounted() {
this.merchantList = this.$saasOrder?.merchantList || []
this.config.merchantId = this.merchantList[0]?.merchantId
this.config.merchantName = this.merchantList[0]?.merchantName
this.getMerchantList()
// this.merchantList = this.$saasOrder?.merchantList || []
// this.config.merchantId = this.merchantList[0]?.merchantId
// this.config.merchantName = this.merchantList[0]?.merchantName
},
computed: {
domEl() {
return this.$refs.groupRef
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
......@@ -205,16 +422,59 @@ export default {
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(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: ''
yqMerchantName: '',
enterpriseMerchantId: ''
}
this.handleSearch()
},
......@@ -223,8 +483,14 @@ export default {
this.$refs.battleRef.clearMutiSelect()
this.config.merchantId = this.merchantList[0]?.merchantId
this.wechat = {
automaticName: '',
roomName: ''
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
this.hideSelect()
},
......@@ -232,43 +498,73 @@ export default {
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
}
})
},
// 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.wechat.roomName = ''
this.getGroupList(this.wechat.staffId)
this.getGroupList(this.wechat.staffId, true)
},
hideSelect() {
this.isgroup = true
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
this.groupHideObj.orderReport = true
this.groupHideObj.saReport = true
this.isAutomatic = true
},
selectGroup(data) {
this.hideSelect()
this.wechat.roomName = data.roomName
this.wechat.groupId = data.roomChatId
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(e) {
openGroup(groupHideAttr) {
this.isAutomatic = true
this.isgroup = !this.isgroup
// this.isgroup = !this.isgroup
this.groupHideObj[groupHideAttr] = !this.groupHideObj[groupHideAttr]
},
openAutomatic() {
this.isgroup = true
// this.isgroup = true
this.groupHideObj.xiReport = true
this.groupHideObj.zhanReport = true
this.groupHideObj.orderReport = true
this.groupHideObj.saReport = true
this.isAutomatic = !this.isAutomatic
},
handleGroupRemove(idx, groupHideAttr) {
this.groupCofList[groupHideAttr].splice(idx, 1)
},
//所属企业
changeRadio(val) {
handleMerchatChange(val) {
// console.log(val)
this.getDepartmentTree()
this.merchantList.forEach(item => {
item.merchantId == val ? (this.merchantName = item.merchantName) : ''
})
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
},
battleSetHandle() {
if (this.setectList.length == 0) {
......@@ -278,6 +574,16 @@ export default {
})
return
}
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
this.getDepartmentTree()
this.battleVisible = true
},
......@@ -296,15 +602,18 @@ export default {
handlebattleConfirm() {
if (!this.wechat.staffId) {
this.$message({
message: '请选择战报自动发送',
message: '请选择推送人',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
if (this.wechat.automaticName !== '' && this.wechat.roomName == '') {
let isGroupEmpty = Object.keys(this.groupCofList)
.map(item => this.groupCofList[item].length)
.every(item => item == 0)
if (isGroupEmpty) {
this.$message({
message: '请选择关联群',
message: '推送配置必须配置至少一项',
type: 'error',
customClass: 'message-Z-zinde'
})
......@@ -315,17 +624,32 @@ export default {
enterpriseMerchantName: this.config.merchantName,
staffId: this.wechat.staffId,
staffName: this.wechat.automaticName,
groupId: this.wechat.groupId,
groupName: this.wechat.roomName,
// groupId: this.wechat.groupId,
// groupName: this.wechat.roomName,
groupMerchantId: this.config.merchantId,
updatedBy: this.$globalState.session.accountName,
yqMerchantIdList: []
yqMerchantIdList: [],
groupConfigList: []
}
this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId)
})
// console.log(params, 'params---')
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
})
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
......@@ -347,20 +671,49 @@ export default {
handlebattleOn(data, sign) {
this.setectList = []
this.setectList.push(data)
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
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.wechat.groupId = data.groupId
// this.wechat.roomName = data.groupName
data.groupConfigList.forEach(item => {
let groupHideAttr = this.groupToType.find(k => k.type == item.actionReportType).attr
if (item.groupId) {
this.groupCofList[groupHideAttr].push({
groupId: item.groupId,
roomName: item.groupName
})
}
})
this.getGroupList(this.wechat.staffId)
}
this.getDepartmentTree()
},
getGroupList(id) {
getGroupList(id, isReset = false) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) this.groupList = res.data
if (res.code == 0) {
this.groupList = res.data
if (isReset) {
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
}
}
})
},
handleSetting() {
......@@ -486,6 +839,12 @@ export default {
}
}
.select-wrap {
vertical-align: middle;
.icon-eye {
width: 20px;
height: 20px;
cursor: pointer;
}
.common {
margin: 4px 0;
height: 40px !important;
......@@ -502,6 +861,31 @@ export default {
}
}
}
.group-list-box {
display: flex;
.list-tag {
box-sizing: border-box;
display: flex;
align-items: center;
height: 30px;
line-height: 30px;
background: #f2f1ff;
padding: 0 8px;
margin-right: 4px;
border-radius: 8px;
.tag-txt {
box-sizing: border-box;
max-width: 100px;
padding-right: 8px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
}
}
}
}
.search-groomname {
......@@ -514,6 +898,10 @@ export default {
.filter-tree {
padding: 0 16px;
}
.grey-txt {
color: #c8c8c8;
cursor: not-allowed;
}
.empty {
padding: 10px 0;
margin: 0;
......@@ -526,4 +914,8 @@ export default {
color: #c0c6ce;
line-height: 20px;
}
.dialog-look {
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!