Commit 96f33638 by chenwq

联调

1 parent 1507b83d
......@@ -241,6 +241,24 @@ export default {
orderReport: [],
saReport: []
},
groupToType: [
{
attr: 'xiReport',
type: 1
},
{
attr: 'zhanReport',
type: 2
},
{
attr: 'orderReport',
type: 3
},
{
attr: 'saReport',
type: 4
}
],
isgroup: true,
isAutomatic: true,
merchantId: '',
......@@ -347,8 +365,8 @@ export default {
},
wechat: {
staffId: '',
automaticName: '',
roomName: ''
automaticName: ''
// roomName: ''
},
baseData: {
merchantList: []
......@@ -382,10 +400,10 @@ export default {
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
// roomName(val) {
// this.filterRoomName(val)
// }
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
......@@ -438,8 +456,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()
},
......@@ -447,18 +471,17 @@ 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)
},
hideSelect() {
......@@ -505,6 +528,16 @@ export default {
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) {
......@@ -538,9 +571,12 @@ export default {
})
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'
})
......@@ -551,17 +587,39 @@ 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
})
})
} else {
params.groupConfigList.push({
groupId: '',
groupName: '',
groupMerchantId: this.config.merchantId,
actionReportType: type
})
}
})
console.log(params, 'params---')
this.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({
......@@ -588,15 +646,24 @@ export default {
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) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) this.groupList = res.data
// if (res.code == 0) this.groupList = res.data
})
},
handleSetting() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!