人员选择器需求调整
This commit is contained in:
@@ -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'])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact'])
|
||||
this.injectJWeixin(['sendChatMessage'])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['injectJWeixin', 'wxInvoke']),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user