Commit 96f33638 by chenwq

联调

1 parent 1507b83d
...@@ -241,6 +241,24 @@ export default { ...@@ -241,6 +241,24 @@ export default {
orderReport: [], orderReport: [],
saReport: [] saReport: []
}, },
groupToType: [
{
attr: 'xiReport',
type: 1
},
{
attr: 'zhanReport',
type: 2
},
{
attr: 'orderReport',
type: 3
},
{
attr: 'saReport',
type: 4
}
],
isgroup: true, isgroup: true,
isAutomatic: true, isAutomatic: true,
merchantId: '', merchantId: '',
...@@ -347,8 +365,8 @@ export default { ...@@ -347,8 +365,8 @@ export default {
}, },
wechat: { wechat: {
staffId: '', staffId: '',
automaticName: '', automaticName: ''
roomName: '' // roomName: ''
}, },
baseData: { baseData: {
merchantList: [] merchantList: []
...@@ -382,10 +400,10 @@ export default { ...@@ -382,10 +400,10 @@ export default {
watch: { watch: {
filterText(val) { filterText(val) {
this.$refs.tree.filter(val) this.$refs.tree.filter(val)
},
roomName(val) {
this.filterRoomName(val)
} }
// roomName(val) {
// this.filterRoomName(val)
// }
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
...@@ -438,8 +456,14 @@ export default { ...@@ -438,8 +456,14 @@ export default {
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 = {
automaticName: '', staffId: '',
roomName: '' automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
} }
this.hideSelect() this.hideSelect()
}, },
...@@ -447,18 +471,17 @@ export default { ...@@ -447,18 +471,17 @@ export default {
if (!value) return true if (!value) return true
return data.name.indexOf(value) !== -1 return data.name.indexOf(value) !== -1
}, },
filterRoomName(value) { // filterRoomName(value) {
this.stageList = this.groupList.filter(item => { // this.stageList = this.groupList.filter(item => {
if (item.roomName.indexOf(value) !== -1) { // if (item.roomName.indexOf(value) !== -1) {
return item // return item
} // }
}) // })
}, // },
handleNodeClick(data) { handleNodeClick(data) {
this.hideSelect() this.hideSelect()
this.wechat.automaticName = data.name this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId this.wechat.staffId = data.staffId
this.wechat.roomName = ''
this.getGroupList(this.wechat.staffId) this.getGroupList(this.wechat.staffId)
}, },
hideSelect() { hideSelect() {
...@@ -505,6 +528,16 @@ export default { ...@@ -505,6 +528,16 @@ export default {
this.merchantList.forEach(item => { this.merchantList.forEach(item => {
item.merchantId == val ? (this.merchantName = item.merchantName) : '' item.merchantId == val ? (this.merchantName = item.merchantName) : ''
}) })
this.wechat = {
staffId: '',
automaticName: ''
}
this.groupCofList = {
xiReport: [],
zhanReport: [],
orderReport: [],
saReport: []
}
}, },
battleSetHandle() { battleSetHandle() {
if (this.setectList.length == 0) { if (this.setectList.length == 0) {
...@@ -538,9 +571,12 @@ export default { ...@@ -538,9 +571,12 @@ export default {
}) })
return true 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({ this.$message({
message: '请选择关联群', message: '推送配置必须配置至少一项',
type: 'error', type: 'error',
customClass: 'message-Z-zinde' customClass: 'message-Z-zinde'
}) })
...@@ -551,17 +587,39 @@ export default { ...@@ -551,17 +587,39 @@ export default {
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: []
} }
this.setectList.forEach(item => { this.setectList.forEach(item => {
params.yqMerchantIdList.push(item.yqMerchantId) 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.$apis.saasOrder.updateYqConfig(params).then(res => {
this.$message({ this.$message({
...@@ -588,15 +646,24 @@ export default { ...@@ -588,15 +646,24 @@ export default {
if (sign) { if (sign) {
this.wechat.staffId = data.staffId this.wechat.staffId = data.staffId
this.wechat.automaticName = data.staffName this.wechat.automaticName = data.staffName
this.wechat.groupId = data.groupId // this.wechat.groupId = data.groupId
this.wechat.roomName = data.groupName // 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.getGroupList(this.wechat.staffId)
} }
this.getDepartmentTree() this.getDepartmentTree()
}, },
getGroupList(id) { getGroupList(id) {
this.$apis.saasOrder.getGroupList({ msgStaffIdList: id }).then(res => { 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() { handleSetting() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!