From 569387064c5c944c036291458f8726c9dfded15e Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Wed, 19 Jan 2022 17:30:54 +0800 Subject: [PATCH] bug --- src/sass/AppNotification/add.vue | 41 ++++++++++---------------------- src/store/index.js | 4 +++- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/sass/AppNotification/add.vue b/src/sass/AppNotification/add.vue index 79ca8aa5..990151bd 100644 --- a/src/sass/AppNotification/add.vue +++ b/src/sass/AppNotification/add.vue @@ -109,38 +109,21 @@ export default { ...mapActions(['selectPrivilegedContact', 'wxInvoke']), handleSelectUser() { // if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") - this.$loading() - // this.clickedUserSelect = true - this.wxInvoke(['selectPrivilegedContact', { + // this.$loading() + this.clickedUserSelect = true + this.selectPrivilegedContact({ fromDepartmentId: 0, selectedTickets: this.form.ticket ? [this.form.ticket] : [], selectedOpenUserIds: this.form.persons ? this.form.persons.map(e => e.id) : [] - }, 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 - // }) + }).then(res => { + this.clickedUserSelect = false + this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] + this.form.ticket = res.selectedTicket + this.selectedUserCount = res.selectedUserCount + }).catch(e => { + console.log(e) + this.clickedUserSelect = false + }) }, confirm(e) { if (e.timestamp < (Date.now() / 1000) || 0) { diff --git a/src/store/index.js b/src/store/index.js index 4114ac9c..03d6cf24 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -375,7 +375,9 @@ const store = new Vuex.Store({ reject(res) } }) - }, 100) + }, 300) + }).catch(e => { + reject('error') }) }) },