diff --git a/src/apps/AppDataScreening/AppDataScreening.vue b/src/apps/AppDataScreening/AppDataScreening.vue index e52716c6..eaa70cea 100644 --- a/src/apps/AppDataScreening/AppDataScreening.vue +++ b/src/apps/AppDataScreening/AppDataScreening.vue @@ -20,6 +20,7 @@ + diff --git a/src/apps/AppDataScreening/userDetail.vue b/src/apps/AppDataScreening/userDetail.vue index 43873978..7ef3f8ed 100644 --- a/src/apps/AppDataScreening/userDetail.vue +++ b/src/apps/AppDataScreening/userDetail.vue @@ -23,6 +23,7 @@ + diff --git a/src/apps/AppMessageNotification/AppMessageNotification.vue b/src/apps/AppMessageNotification/AppMessageNotification.vue index e66833fb..cbffa7a9 100644 --- a/src/apps/AppMessageNotification/AppMessageNotification.vue +++ b/src/apps/AppMessageNotification/AppMessageNotification.vue @@ -137,25 +137,32 @@ export default { } }, confirm() { - // if(!this.areaIdList.length) { - // return this.$u.toast('请选择用户') - // } this.$loading() - if(this.form.sendType == 1 && !this.form.sendTime) { - return this.$u.toast('请选择群发时间') + if(!this.deptUserTagList.length) { + return this.$u.toast('请选择部门') } if(!this.form.content) { return this.$u.toast('请输入文本内容') } - if(this.form.contentType == 'image' && !this.formData.fileList.length) { - return this.$u.toast('请上传图片') - } - if(this.form.contentType == 'video' && !this.formData.fileList.length) { - return this.$u.toast('请上传视频') - } - if(this.form.contentType == 'file' && !this.formData.fileList.length) { - return this.$u.toast('请上传文件') - } + + let result = {}, tags = {} + this.deptUserTagList.map(e => { + let {kind, id, tagIdList} = e + result[e.corpId] = [result[e.corpId], {kind, id}].flat() + if (tagIdList) { + tags[e.corpId] = [tags[e.corpId], {tagIdList}].flat() + } + }) + + console.log(result, tags) + var deptList = Object.keys(result).map(corpId => ({ + corpId, + objList: result[corpId], + tagId: tags[corpId]?.tagIdList + })) + + console.log(deptList) + this.formData.fileList = [] var contentFile = { content: this.form.content, @@ -195,20 +202,15 @@ export default { ...this.form, ...this.formData, areaId: this.areaIdList.join(','), - tag: this.tagIdList.join(','), + deptList: deptList, + messageSource: this.sendType == 1 ? '1' : '2' } this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => { if (res?.code == 0) { this.$u.toast('发送成功') - this.form = { - content: '', - contentType: 'text', - sendType: '0', - sendTime: '' - } - this.areaIdList = [] - this.tagIdList = [] - this.formDataInit() + setTimeout(() => { + uni.navigateBack() + }, 500) }else { this.$u.toast(res.msg) } @@ -216,14 +218,6 @@ export default { this.$u.toast(err) }) }, - formDataInit() { - for(let key in this.formData) { - this.formData[key] = '' - } - this.formData.fileListImg = [] - this.formData.fileListVideo = [] - this.formData.fileListFile = [] - }, back() { uni.navigateBack() } diff --git a/src/apps/AppMessageNotification/selectDeptUser.vue b/src/apps/AppMessageNotification/selectDeptUser.vue index b381c50e..6a39c6a5 100644 --- a/src/apps/AppMessageNotification/selectDeptUser.vue +++ b/src/apps/AppMessageNotification/selectDeptUser.vue @@ -75,18 +75,18 @@ export default { this.treeList = this.allData.filter(e => !e.parentid) this.selectDeptPath = [{name: "可选范围", id: ''}] }, - itemClick({id, name}) { - let index = this.selectDeptPath.findIndex(e => e.id == id) + itemClick({id, name, corpId}) { + let index = this.selectDeptPath.findIndex(e => e.id == id && e.corpId == corpId) if (index == -1) { - this.selectDeptPath.push({name, id}) - this.getDeptsAndUsersByParent(id) + this.selectDeptPath.push({name, id, corpId}) + this.getDeptsAndUsersByParent(id, corpId) } }, - getDeptsAndUsersByParent(departmentId) { - this.treeList = this.allData.filter(e => e.parentid == departmentId) + getDeptsAndUsersByParent(departmentId, corpId) { + this.treeList = this.allData.filter(e => e.parentid == departmentId && e.corpId == corpId) this.userList = [] this.$http.post(`/app/wxcp/wxuser/listByDeptId`, null, { - params: {departmentId, status: 1} + params: {departmentId, status: 1, cid: corpId} }).then(res => { if (res?.data) { this.userList = res.data.map(e => ({...e, isChecked: this.isSelected(e.id)})) diff --git a/src/apps/AppMessageNotification/selectTag.vue b/src/apps/AppMessageNotification/selectTag.vue index 253f09ae..19a1505f 100644 --- a/src/apps/AppMessageNotification/selectTag.vue +++ b/src/apps/AppMessageNotification/selectTag.vue @@ -1,8 +1,8 @@