diff --git a/src/apps/AppCooperationPropaganda/AppCooperationPropaganda.vue b/src/apps/AppCooperationPropaganda/AppCooperationPropaganda.vue index 46306e20..3c4acd59 100644 --- a/src/apps/AppCooperationPropaganda/AppCooperationPropaganda.vue +++ b/src/apps/AppCooperationPropaganda/AppCooperationPropaganda.vue @@ -135,6 +135,16 @@ export default { tabClick(item,index) { this.tabIndex = index; this.sendType = item.value + uni.clearStorageSync('userSelect') + uni.clearStorageSync('wxGroupsUser') + uni.clearStorageSync('girdSelect') + uni.clearStorageSync('deptList') + uni.clearStorageSync('sendScope') + uni.clearStorageSync('ResidentTags') + uni.clearStorageSync('ResidentTagsRemove') + uni.clearStorageSync('circleTags') + uni.clearStorageSync('circleTagsRemove') + this.getList() }, toDetail(item) { uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`}) diff --git a/src/apps/AppCooperationPropaganda/addPropaganda.vue b/src/apps/AppCooperationPropaganda/addPropaganda.vue index f9b41d9b..ca2e4f16 100644 --- a/src/apps/AppCooperationPropaganda/addPropaganda.vue +++ b/src/apps/AppCooperationPropaganda/addPropaganda.vue @@ -10,7 +10,7 @@
请选择 - 预计送达{{ form.wxGroups.length }}名成员 + 预计送达{{ form.wxGroups.length || forms.executorList }}名成员
@@ -139,13 +139,57 @@ export default { type: '', form: { taskTitle: '', - wxGroups: [], // 发送范围 contents: [], // 发送内容 enableExamine: '0', // 是否需要审批 0否 1是 examines: [], // 审批人 choiceTime: '', // 定时发送时间 sendScope: '', // 0:全部居民群、1:按部门选择、2:按网格选择 sendType: '0', // 0:立即发送、1:定时发送 + wxGroups: [ // 发送范围 + { + corpId: "ww596787bb70f08288", + errorCode: null, + errorMsg: null, + groupCount: 1, + groupIds: "wrytYEDgAAA5MGVJ3Ttb6ycbmxJ2Zv-Q", + groupNames: "111", + groupOwnerId: "d41d8cd98f00b204e9800998ecf8427e", + groupOwnerName: "张硕", + id: null, + msgId: null, + sendStatus: null, + sendTime: null, + taskId: null, + }, + { + corpId: "ww596787bb70f08288", + errorCode: null, + errorMsg: null, + groupCount: 4, + groupIds: "wrytYEDgAA-Llt9H1jr40WT1_RfOstWQ,wrytYEDgAADava7QSJGicwZg09nG_GXg,wrytYEDgAAKG6qd39fHWFkrTiT9vsSQQ,wrytYEDgAAPxVpqyzf4kwzwvtdE0nqbQ", + groupNames: "慧政务需求沟通,临汾市政法委企微项目沟通,淄博企微项目沟通群,未命名群聊", + groupOwnerId: "XieJin", + groupOwnerName: "谢晋", + id: null, + msgId: null, + sendStatus: null, + sendTime: null, + taskId: null, + } + ], // 送达居民群 + }, + forms: { + taskTitle: '', + taskType: '', + executorList: [], // 任务执行人集合(群发朋友圈的执行人) + groupList: [], // 添加人集合 + contentList: [], // 发送内容 + enableExamine: '0', // 是否需要审批 0否 1是 + examineList: [], // 审批人 + choiceTime: '', // 定时发送时间 + sendScope: '', // 0:全部居民群、1:按部门选择、2:按网格选择 + sendType: '0', // 0:立即发送、1:定时发送 + gender: '', // 性别:0-女、1-男、2-全部 wxGroups: [ { corpId: "ww596787bb70f08288", @@ -334,8 +378,12 @@ export default { this.form.choiceTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second }, + confirm() { + if(this.flag) return + + if(this.type=='ResidentsGroup') { // 文本 const firstContent = [ { @@ -409,8 +457,19 @@ export default { }).catch((err)=>{ this.flag = false this.$u.toast(err) - }) + }) + } else { + this.$http.post(`/app/whchatmomentstask/addOrUpdate`, { ...this.form }).then(res=>{ + if(res?.code ==0) { + this.flag = false + this.$u.toast("新增成功") + } + }).catch((err)=>{ + this.flag = false + this.$u.toast(err) + }) + } }, getDeptUser() { @@ -432,6 +491,12 @@ export default { onLoad(o) { this.type = o.type; document.title = this.type=='ResidentsGroup'? "群发居民群": this.type=='Residents'? "群发居民": "群发朋友圈" + if(this.type=='Residents') { + this.forms.taskType = 1 + } else if(this.type=='CircleOfFriends') { + this.forms.taskType = 0 + } + this.forms.taskTitle = this.form.taskTitle }, onShow() { this.form.wxGroups = uni.getStorageSync('wxGroupsUser') || [] diff --git a/src/apps/AppCooperationPropaganda/scopedSelect.vue b/src/apps/AppCooperationPropaganda/scopedSelect.vue index 50b07f57..403dcf97 100644 --- a/src/apps/AppCooperationPropaganda/scopedSelect.vue +++ b/src/apps/AppCooperationPropaganda/scopedSelect.vue @@ -3,26 +3,38 @@
添加人
- 已选择{{ selectedUser.length || deptListArr.length }} - 个网格个部门 + +
+ 已选择{{ deptListArr.length }}个部门 + 请选择 +
+
+ 已选择{{ selectedUser.length }}个网格 + 请选择 +
+ +
+
+ +
+
包含标签
+
+ 已选择{{ circleTags.length || ResidentTags.length }}个标签 请选择
-
-
包含标签
-
- 请选择 - -
-
+
剔除标签
- 请选择 + 已剔除{{ circleTagsRemove.length || ResidentTagsRemove.length }}个标签 + 请选择
+
添加时间
@@ -31,6 +43,7 @@
+
性别
@@ -59,10 +72,14 @@ export default { showCalendar: false, startTime: '', endTime: '', - sex: "0", + sex: 0, // 性别:0-女、1-男、2-全部 userList: [], deptListArr: [], - selectedUser: [] + selectedUser: [], + circleTags: [], // 朋友圈包含标签 + circleTagsRemove: [], // 朋友圈剔除标签 + ResidentTags: [], // 居民包含标签 + ResidentTagsRemove: [], // 居民剔除标签 } }, methods: { @@ -92,22 +109,20 @@ export default { }) }, + // 选择包含、剔除的标签 0包含 1剔除 toTagsList(e) { - uni.navigateTo({url: `./tagsList?type=${e}`}) + uni.navigateTo({url: `./tagsList?type=${e}&sendType=${this.sendType}`}) }, - // 选包含标签 - // selectTags() {}, - - // 选剔除标签 - // deleteTags() {}, - // 选时间范围 selectDate(e) { this.startTime = e.startDate this.endTime = e.endDate }, submit() { + uni.setStorageSync('gender',this.sex) + uni.setStorageSync('startTime', this.startTime) + uni.setStorageSync('endTime', this.endTime) uni.setStorageSync('deptList',this.deptListArr) uni.navigateBack() } @@ -118,8 +133,22 @@ export default { document.title = this.type == 1? '按部门选择':'按网格选择' }, onShow() { + // 网格或者部门 this.selectedUser = uni.getStorageSync('girdSelect') this.deptListArr = uni.getStorageSync('deptList') + // 添加时间 + this.startTime = uni.getStorageSync('startTime') + this.endTime = uni.getStorageSync('endTime') + // 标签 + if(this.sendType == 'Residents') { + this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含 + this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除 + } else if(this.sendType == 'CircleOfFriends') { + this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含 + this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除 + } + // 性别 + this.sex = uni.getStorageSync('gender') } } diff --git a/src/apps/AppCooperationPropaganda/sendScoped.vue b/src/apps/AppCooperationPropaganda/sendScoped.vue index 2490ce15..e11ea756 100644 --- a/src/apps/AppCooperationPropaganda/sendScoped.vue +++ b/src/apps/AppCooperationPropaganda/sendScoped.vue @@ -3,14 +3,14 @@
- - + +
{{ item.name }}
-
+
已选择{{ deptSelect.length }}个部门
已选择{{ girdSelect.length }}个网格
- +
@@ -39,21 +39,41 @@ export default { sendScope: '0', girdListIds: [], deptListIds: [], - wxGroups: [], - groupNames: [], + wxGroups: [], // 居民群,居民,朋友圈 + sex: '', + // groupList: [], // 居民 + // executorList: [], // 朋友圈 + ResidentTags: [], + ResidentTagsRemove: [], + startTime: '', + endTime: '', } }, methods: { checkBtn(e) { - this.checkList.forEach(v=> v.checked = false) - e.checked = true + // this.checkList.forEach(v=> v.checked = false) + // e.checked = true + if(e.value == '1' || e.value == '2') { uni.navigateTo({url: `./scopedSelect?type=${e.value}&sendType=${this.sendType}`}) + } - this.sendScope = e.value + this.sendScope = e.value; + uni.setStorageSync('sendScope', this.sendScope) + // uni.clearStorageSync('ResidentTags') + // uni.clearStorageSync('ResidentTagsRemove') + // uni.clearStorageSync('circleTags') + // uni.clearStorageSync('circleTagsRemove') }, submit() { - this.getWxGroups() + if(this.sendType == 'ResidentsGroup') { + this.getWxGroups() + } else if(this.sendType == 'Residents') { + this.getResidents() + } else if(this.sendType == 'CircleOfFriends') { + this.getCircleOfFriends() + } + uni.setStorageSync('sendScope', this.sendScope) setTimeout(() => { uni.navigateBack({ @@ -64,6 +84,7 @@ export default { }, 4000) }, + // 群发居民群 getWxGroups() { this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`, { @@ -72,26 +93,68 @@ export default { if (res.code === 0) { this.wxGroups = res.data uni.setStorageSync('wxGroupsUser', this.wxGroups) - console.log(this.wxGroups,res.data); } }) }, + // 群发居民 + getResidents() { + const tags = this.ResidentTags.join(',') + const removeTags = this.ResidentTagsRemove.join(',') + this.$http.post(`/app/whchatmomentstask/getCustomerGroups?sendScope=${this.sendScope}&addFromTime=${this.startTime}&addEndTime=${this.endTime}&gender=${this.sex}&filteTags=${tags}&excludeFilterTags=${removeTags}`, + { + filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',') + }).then(res => { + if (res.code === 0) { + // this.groupList = res.data + // uni.setStorageSync('groupList', this.groupList) + this.wxGroups = res.data + uni.setStorageSync('wxGroupsUser', this.wxGroups) + } + }) + }, + // 群发朋友圈 + getCircleOfFriends() { + this.$http.post(`/app/whchatmomentstask/getExecutors?sendScope=${this.sendScope}`, + { + filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',') + }).then(res => { + if (res.code === 0) { + // this.executorList = res.data + // uni.setStorageSync('executorList', this.executorList) + this.wxGroups = res.data + uni.setStorageSync('wxGroupsUser', this.wxGroups) + } + }) + } }, onLoad(o) { this.sendType = o.type; document.title = "选择发送范围" - // this.checkList.forEach(i=> { - // return { - // name: i.name, - // value: i.value, - // checked: this.sendScope.find(v=>(i.value==v)) - // } - // }) }, onShow() { this.sendScope = uni.getStorageSync('sendScope') || '' - this.girdListIds = uni.getStorageSync('girdSelect').map(e=>e.id) || [] - this.deptListIds = uni.getStorageSync('deptList').map(v=>v.id) || [] + const girdArr = uni.getStorageSync('girdSelect') + if(girdArr.length) { + this.girdListIds = girdArr.map(e=>e.id) + } + const deptArr = uni.getStorageSync('deptList') + if(deptArr.length) { + this.deptListIds = deptArr.map(v=>v.id) + } + this.sex = uni.getStorageSync('gender') + // 标签 + if(this.sendType == 'Residents') { + this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含 + this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除 + } + // 时间 + this.startTime = uni.getStorageSync('startTime') + // console.log(this.startTime, '哈哈哈哈'); + this.endTime = uni.getStorageSync('endTime') + // else if(this.sendType == 'CircleOfFriends') { + // this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含 + // this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除 + // } } } diff --git a/src/apps/AppCooperationPropaganda/tagsList.vue b/src/apps/AppCooperationPropaganda/tagsList.vue index 4a1d4d8d..2537f795 100644 --- a/src/apps/AppCooperationPropaganda/tagsList.vue +++ b/src/apps/AppCooperationPropaganda/tagsList.vue @@ -23,67 +23,17 @@ export default { name: "tagsList", data() { return { - subTags: [ - { - id: "1", - name: "第一组", - tagList: [ - { - id: "1.1", - name: "介绍的", - }, - { - id: "1.2", - name: "介绍的啊塑胶地板", - }, - { - id: "1.3", - name: "介绍的", - }, - { - id: "1.4", - name: "介绍的啊啊啊啊啊啊啊啊", - }, - { - id: "1.5", - name: "介绍的啊啊啊", - }, - { - id: "1.6", - name: "介绍的红红火火恍恍惚惚或或或或或或或或或或或或红红火火恍恍惚惚或或或或或或或", - }, - { - id: "1.7", - name: "介绍的红红火火恍恍惚惚或或或或或或或或或或或或红红火火恍恍惚惚或或或或或或或", - }, - ] - }, - { - id: "2", - name: "第二组", - tagList: [ - { - id: "2.2", - name: "的范德萨发", - } - ] - } - ], + sendType: '', + subTags: [], checked: [], - list: [] + type: '', } }, methods: { getTags() { - this.$http.post(`/app/wxcp/wxcorptag/listAll`).then(res => { + this.$http.post(`/app/wxcp/wxcorptag/listAll?current=1&size=3000`).then(res => { if (res?.data) { - console.log(res); - // this.subTags = res.data.map(item => { - // return { - // dictName: item.name, - // dictValue: item.id - // } - // }) + this.subTags = res.data.records } }) }, @@ -101,20 +51,47 @@ export default { return this.$u.toast('请选择标签') } - const list = this.list.filter(v => { - return this.checked.includes(v.id) - }) - - uni.$emit('onChecked', list) + // const list = this.subTags.filter(v => { + // return this.checked.includes(v.id) + // }) + if(this.sendType == 'Residents') { + if(this.type == '0') { // 居民包含 + uni.setStorageSync('ResidentTags', this.checked) + } else if(this.type == '1') { // 居民剔除 + uni.setStorageSync('ResidentTagsRemove', this.checked) + } + } else if(this.sendType == 'CircleOfFriends') { + if(this.type == '0') { // 朋友圈包含 + uni.setStorageSync('circleTags', this.checked) + } else if(this.type == '1') { // 朋友圈剔除 + uni.setStorageSync('circleTagsRemove', this.checked) + } + } uni.navigateBack() } }, onShow() { this.getTags() + this.checked = [] + if(this.sendType == 'Residents') { + if(this.type == 0) { // 居民包含 + this.checked = uni.getStorageSync('ResidentTags') || [] + } else { // 居民剔除 + this.checked = uni.getStorageSync('ResidentTagsRemove') || [] + } + } else if(this.sendType == 'CircleOfFriends') { + if(this.type == 0) { // 朋友圈包含 + this.checked = uni.getStorageSync('circleTags') || [] + } else { // 朋友圈剔除 + this.checked = uni.getStorageSync('circleTagsRemove') || [] + } + } }, onLoad(o) { document.title = o.type ==0? '包含标签': '剔除标签' + this.sendType = o.sendType + this.type = o.type } }