This commit is contained in:
yanran200730
2022-01-19 19:02:02 +08:00
parent 9fe4d29858
commit 1eb93adf3c
2 changed files with 13 additions and 11 deletions

View File

@@ -41,11 +41,11 @@
<u-row justify="between" class="item" @click="handleSelectUser"> <u-row justify="between" class="item" @click="handleSelectUser">
<header><em>*</em>参会人</header> <header><em>*</em>参会人</header>
<div class="right"> <div class="right">
<template v-if="!selectedUserCount"> <template v-if="!form.selectCount">
<span>请选择</span> <span>请选择</span>
</template> </template>
<template v-else> <template v-else>
已选择<em v-text="selectedUserCount"/> 已选择<em v-text="form.selectCount"/>
</template> </template>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</div> </div>
@@ -115,6 +115,7 @@ export default {
address: "", address: "",
ticket: '', ticket: '',
content: "", content: "",
selectCount: 0,
attendees: [], attendees: [],
noticeBefore: 4, noticeBefore: 4,
noticeAfter: 0, noticeAfter: 0,
@@ -163,7 +164,7 @@ export default {
methods: { methods: {
...mapActions(['selectPrivilegedContact']), ...mapActions(['selectPrivilegedContact']),
handleSelectUser() { handleSelectUser() {
// if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器")
this.clickedUserSelect = true this.clickedUserSelect = true
this.selectPrivilegedContact({ this.selectPrivilegedContact({
fromDepartmentId: 0, fromDepartmentId: 0,
@@ -172,7 +173,7 @@ export default {
}).then(res => { }).then(res => {
this.form.attendees = res.userList?.map(e => ({id: e.openUserId})) || [] this.form.attendees = res.userList?.map(e => ({id: e.openUserId})) || []
this.form.ticket = res.selectedTicket || "" this.form.ticket = res.selectedTicket || ""
this.selectedUserCount = res.selectedUserCount this.form.selectCount = res.selectedUserCount
this.clickedUserSelect = false this.clickedUserSelect = false
}).catch(() => { }).catch(() => {
this.clickedUserSelect = false this.clickedUserSelect = false

View File

@@ -19,11 +19,11 @@
<u-row justify="between" class="item" style="border-bottom: 1px solid #eeeeee" @click="handleSelectUser"> <u-row justify="between" class="item" style="border-bottom: 1px solid #eeeeee" @click="handleSelectUser">
<header><em>*</em>发送对象</header> <header><em>*</em>发送对象</header>
<div class="right"> <div class="right">
<template v-if="!selectedUserCount"> <template v-if="!form.selectCount">
<span>请选择</span> <span>请选择</span>
</template> </template>
<template v-else> <template v-else>
已选择<em>{{ selectedUserCount }}</em> 已选择<em>{{ form.selectCount }}</em>
</template> </template>
<div class="right-arrow"/> <div class="right-arrow"/>
</div> </div>
@@ -80,6 +80,7 @@ export default {
content: "", content: "",
persons: [], persons: [],
ticket: '', ticket: '',
selectCount: 0,
releaseTime: null, releaseTime: null,
files: [], files: [],
}, },
@@ -109,18 +110,18 @@ export default {
methods: { methods: {
...mapActions(['selectPrivilegedContact', 'wxInvoke']), ...mapActions(['selectPrivilegedContact', 'wxInvoke']),
handleSelectUser() { handleSelectUser() {
// if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器")
// this.$loading()
this.clickedUserSelect = true this.clickedUserSelect = true
this.selectPrivilegedContact({ this.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 => { }).then(res => {
uni.hideLoading()
this.clickedUserSelect = false this.clickedUserSelect = false
this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || [] this.form.persons = res.userList?.map(e => ({id: e.openUserId})) || []
this.form.ticket = res.selectedTicket this.form.ticket = res.selectedTicket
this.selectedUserCount = res.selectedUserCount this.form.selectCount = res.selectedUserCount
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
this.clickedUserSelect = false this.clickedUserSelect = false
@@ -148,7 +149,7 @@ export default {
if (res && res.data) { if (res && res.data) {
this.form.releaseTime = res.data.releaseTime; this.form.releaseTime = res.data.releaseTime;
this.form.ticket = res.data.ticket this.form.ticket = res.data.ticket
this.selectedUserCount = res.data.persons.length this.form.selectCount = res.data.selectCount
Object.keys(this.form).map(e => { Object.keys(this.form).map(e => {
this.form[e] = res.data[e]; this.form[e] = res.data[e];
}) })
@@ -163,7 +164,7 @@ export default {
if (!this.form.content) return this.$u.toast("请输入公告内容") if (!this.form.content) return this.$u.toast("请输入公告内容")
if (!this.form.persons.length) return this.$u.toast("请选择发送对象") if (!this.form.persons.length) return this.$u.toast("至少选择一名应用授权范围内成员")
if (this.index == 1 && !this.form.releaseTime) return this.$u.toast("请选择定时发送时间") if (this.index == 1 && !this.form.releaseTime) return this.$u.toast("请选择定时发送时间")