diff --git a/src/apps/AppMessageNotification/AppMessageNotification.vue b/src/apps/AppMessageNotification/AppMessageNotification.vue index cbffa7a9..3a4b271b 100644 --- a/src/apps/AppMessageNotification/AppMessageNotification.vue +++ b/src/apps/AppMessageNotification/AppMessageNotification.vue @@ -87,7 +87,7 @@ export default { form: { content: '', contentType: 'text', - sendType: '1', + sendType: '0', }, formData: { fileListImg: [], @@ -122,6 +122,8 @@ export default { radioGroupChange(e) { this.form.sendType = e uni.setStorageSync('sendType', e) + this.deptUserTagList = [] + this.deptUserList = [] }, toSelect() { uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`}) @@ -148,6 +150,7 @@ export default { let result = {}, tags = {} this.deptUserTagList.map(e => { let {kind, id, tagIdList} = e + console.log([result[e.corpId], {kind, id}].flat()) result[e.corpId] = [result[e.corpId], {kind, id}].flat() if (tagIdList) { tags[e.corpId] = [tags[e.corpId], {tagIdList}].flat() @@ -155,11 +158,20 @@ export default { }) console.log(result, tags) - var deptList = Object.keys(result).map(corpId => ({ - corpId, - objList: result[corpId], - tagId: tags[corpId]?.tagIdList - })) + + var deptList = Object.keys(result).map(corpId => { + let res + if (result[corpId]) { + res = { + corpId, + objList: result[corpId] + } + if (tags[corpId]?.tagIdList) { + res.tagId = tags[corpId]?.tagIdList + } + } + return res + }).filter(e => !!e) console.log(deptList) diff --git a/src/apps/AppMessageNotification/selectDeptUser.vue b/src/apps/AppMessageNotification/selectDeptUser.vue index 6a39c6a5..70f00b43 100644 --- a/src/apps/AppMessageNotification/selectDeptUser.vue +++ b/src/apps/AppMessageNotification/selectDeptUser.vue @@ -121,6 +121,9 @@ export default { // }) // uni.$emit("selectDept", [this.selected].flat()) console.log([this.selected].flat()) + if(![this.selected].flat().length) { + return this.$u.toast('请选择部门或人员') + } uni.$emit("pagePicker:custom", [this.selected].flat()) uni.setStorageSync('selectDeptUser', [this.selected].flat()) uni.navigateTo({url: `./selectTag`}) diff --git a/src/apps/AppMessageNotification/selectTag.vue b/src/apps/AppMessageNotification/selectTag.vue index 0077553c..2f4b1b1c 100644 --- a/src/apps/AppMessageNotification/selectTag.vue +++ b/src/apps/AppMessageNotification/selectTag.vue @@ -85,7 +85,7 @@ export default { this.showTagList=false }, getTagList(id) { - var url = this.sendType == 1 ? `/app/wxcp/wxcorptag/listAllByCorp?dvcpCorpId=${id}` : `/app/wxcp/wxgroupchattag/listAllByCorp?dvcpCorpId=${id}` + var url = this.sendType == 1 ? `/app/wxcp/wxcorptag/listAllByCorp?dvcpCorpId=${id}&size=1000` : `/app/wxcp/wxgroupchattag/listAllByCorp?dvcpCorpId=${id}&size=1000` this.$http.post(url).then(res => { if (res?.code == 0) { res.data.records.map((item) => { @@ -125,6 +125,7 @@ export default { var list = uni.getStorageSync('selectDeptUser') this.sendType = uni.getStorageSync('sendType') list.map((item) => { + item.tagIdList = [] if(item.kind == 'dept') { this.deptList.push(item) }else {