From 2629b4d34c220dbf748c038bcd810e51a2c5834b Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Wed, 19 Jan 2022 17:14:37 +0800 Subject: [PATCH] bug --- src/sass/AppNotification/add.vue | 42 +++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/sass/AppNotification/add.vue b/src/sass/AppNotification/add.vue index c573d168..79ca8aa5 100644 --- a/src/sass/AppNotification/add.vue +++ b/src/sass/AppNotification/add.vue @@ -106,23 +106,41 @@ export default { }, methods: { - ...mapActions(['selectPrivilegedContact']), + ...mapActions(['selectPrivilegedContact', 'wxInvoke']), handleSelectUser() { // if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") - this.clickedUserSelect = true - this.selectPrivilegedContact({ + this.$loading() + // this.clickedUserSelect = true + this.wxInvoke(['selectPrivilegedContact', { fromDepartmentId: 0, selectedTickets: this.form.ticket ? [this.form.ticket] : [], selectedOpenUserIds: this.form.persons ? this.form.persons.map(e => e.id) : [] - }).then(res => { - this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] - this.form.ticket = res.selectedTicket - this.selectedUserCount = res.selectedUserCount - this.clickedUserSelect = false - }).catch(e => { - console.log(e) - this.clickedUserSelect = false - }) + }, res => { + console.log(res) + if (res.err_msg == 'selectPrivilegedContact:ok') { + const res = typeof res.result == 'string' ? JSON.parse(res.result) : res.result + this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] + this.form.ticket = res.selectedTicket + this.selectedUserCount = res.selectedUserCount + this.clickedUserSelect = false + uni.$hideLoading() + } else { + uni.$hideLoading() + } + }]) + // this.selectPrivilegedContact({ + // fromDepartmentId: 0, + // selectedTickets: this.form.ticket ? [this.form.ticket] : [], + // selectedOpenUserIds: this.form.persons ? this.form.persons.map(e => e.id) : [] + // }).then(res => { + // this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] + // this.form.ticket = res.selectedTicket + // this.selectedUserCount = res.selectedUserCount + // this.clickedUserSelect = false + // }).catch(e => { + // console.log(e) + // this.clickedUserSelect = false + // }) }, confirm(e) { if (e.timestamp < (Date.now() / 1000) || 0) {