This commit is contained in:
yanran200730
2022-01-19 17:14:37 +08:00
parent 94d467d0da
commit 2629b4d34c

View File

@@ -106,23 +106,41 @@ export default {
}, },
methods: { methods: {
...mapActions(['selectPrivilegedContact']), ...mapActions(['selectPrivilegedContact', 'wxInvoke']),
handleSelectUser() { handleSelectUser() {
// if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") // if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器")
this.clickedUserSelect = true this.$loading()
this.selectPrivilegedContact({ // this.clickedUserSelect = true
this.wxInvoke(['selectPrivilegedContact', {
fromDepartmentId: 0, fromDepartmentId: 0,
selectedTickets: this.form.ticket ? [this.form.ticket] : [], selectedTickets: this.form.ticket ? [this.form.ticket] : [],
selectedOpenUserIds: this.form.persons ? this.form.persons.map(e => e.id) : [] selectedOpenUserIds: this.form.persons ? this.form.persons.map(e => e.id) : []
}).then(res => { }, res => {
this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] console.log(res)
this.form.ticket = res.selectedTicket if (res.err_msg == 'selectPrivilegedContact:ok') {
this.selectedUserCount = res.selectedUserCount const res = typeof res.result == 'string' ? JSON.parse(res.result) : res.result
this.clickedUserSelect = false this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || []
}).catch(e => { this.form.ticket = res.selectedTicket
console.log(e) this.selectedUserCount = res.selectedUserCount
this.clickedUserSelect = false 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) { confirm(e) {
if (e.timestamp < (Date.now() / 1000) || 0) { if (e.timestamp < (Date.now() / 1000) || 0) {