diff --git a/src/sass/AppAskForm/AppAskForm.vue b/src/sass/AppAskForm/AppAskForm.vue index b2a0387e..03f36a9a 100644 --- a/src/sass/AppAskForm/AppAskForm.vue +++ b/src/sass/AppAskForm/AppAskForm.vue @@ -39,7 +39,7 @@ export default { document.title = "问卷表单" this.$refs?.TabPage?.show() this.$nextTick(() => { - this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact', 'shareAppMessage', 'shareWechatMessage']).then(() => { + this.injectJWeixin(['sendChatMessage', 'shareAppMessage', 'shareWechatMessage']).then(() => { this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']) }) }) diff --git a/src/sass/AppAskForm/Result.vue b/src/sass/AppAskForm/Result.vue index 4da4bc8f..b2eb18da 100644 --- a/src/sass/AppAskForm/Result.vue +++ b/src/sass/AppAskForm/Result.vue @@ -40,7 +40,7 @@ export default { } }, mounted() { - this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact']) + this.injectJWeixin(['sendChatMessage']) }, methods: { ...mapActions(['injectJWeixin', 'wxInvoke']), diff --git a/src/sass/AppMeetingNotice/addMeeting.vue b/src/sass/AppMeetingNotice/addMeeting.vue index eb5bc848..56b577bf 100644 --- a/src/sass/AppMeetingNotice/addMeeting.vue +++ b/src/sass/AppMeetingNotice/addMeeting.vue @@ -159,16 +159,16 @@ export default { } }, methods: { - ...mapActions(['selectEnterpriseContact']), + ...mapActions(['selectPrivilegedContact']), handleSelectUser() { if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") this.clickedUserSelect = true - this.selectEnterpriseContact({ + this.selectPrivilegedContact({ fromDepartmentId: 0, - type: ["user"], - selectedUserIds: this.form.attendees?.map(e => e.id) + selectedOpenUserIds: this.form.attendees?.map(e => e.id) }).then(res => { this.change(res?.userList || []) + this.form.ticket = res?.selectedTicket || "" this.clickedUserSelect = false }).catch(() => { this.clickedUserSelect = false diff --git a/src/sass/AppNotification/add.vue b/src/sass/AppNotification/add.vue index 0bc718c0..a6e15e4a 100644 --- a/src/sass/AppNotification/add.vue +++ b/src/sass/AppNotification/add.vue @@ -105,16 +105,16 @@ export default { }, methods: { - ...mapActions(['selectEnterpriseContact']), + ...mapActions(['selectPrivilegedContact']), handleSelectUser() { if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") this.clickedUserSelect = true - this.selectEnterpriseContact({ + this.selectPrivilegedContact({ fromDepartmentId: 0, - type: ["user"], - selectedUserIds: this.form.persons?.map(e => e.id) + selectedOpenUserIds: this.form.persons?.map(e => e.id) }).then(res => { this.form.persons = res?.userList || [] + this.form.ticket = res?.selectedTicket this.clickedUserSelect = false }).catch(() => { this.clickedUserSelect = false diff --git a/src/store/index.js b/src/store/index.js index 5813b384..57cd43b5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -351,6 +351,27 @@ const store = new Vuex.Store({ }) }) }, + selectPrivilegedContact(state, params) { + return new Promise(resolve => { + state.dispatch("injectJWeixin", "selectPrivilegedContact").then(() => { + setTimeout(() => { + let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin + sdk?.invoke("selectEnterpriseContact", { + fromDepartmentId: -1, + mode: "multi", + ...params + }, res => { + if (res.err_msg == "selectPrivilegedContact:ok") { + if (typeof res.result == 'string') { + res.result = JSON.parse(res.result) + } + resolve(res.result) + } + }) + }, 500) + }) + }) + }, }, getters: { getDict: state => key => {