This commit is contained in:
=
2026-08-26 15:41:02 +08:00
parent d5fe018988
commit d1e11363b1
12 changed files with 450 additions and 72 deletions
@@ -85,6 +85,7 @@ layout("/layouts/platform.html"){
await this.doHandle("onSave")
},
onSubmit() {
if (!this.validateRequiredFiles()) return
this.$refs.clubFormRef.$refs.form.validate().then(() => {
this.doHandle("onSubmit")
}).catch(() => {
@@ -92,12 +93,26 @@ layout("/layouts/platform.html"){
})
},
onFinishTask() {
if (!this.validateRequiredFiles()) return
this.$refs.clubFormRef.$refs.form.validate().then(() => {
this.doHandle("onFinishTask")
}).catch(() => {
this.$message.warning({ title: "警告", message: "存在必填项未填写!" })
})
},
// 文件上传组件使用数组承载文件,提交前显式检查空数组,避免表单校验误判为已填写。
validateRequiredFiles() {
const formData = this.$refs.clubFormRef.formData
if (!formData.establishReport || formData.establishReport.length === 0) {
this.$message.warning({ title: "警告", message: "请上传申请成立报告" })
return false
}
if (!formData.rulesFile || formData.rulesFile.length === 0) {
this.$message.warning({ title: "警告", message: "请上传章程草案" })
return false
}
return true
},
async doHandle(type) {
let formData = {}
try {
@@ -391,6 +391,10 @@ const optionSelect = {
userName: "",
userSign: ""
}
// PC端本人选择时默认当前登录人作为收货人;管理员代选仍由管理员填写目标用户收货人。
if (!this.isProxySelect && this.$store.state.user && this.$store.state.user.username) {
this.$set(this.contactForm, "userName", this.$store.state.user.username)
}
this.getProjectInfo()
},
@@ -440,7 +444,11 @@ const optionSelect = {
this.hasSubmittedBefore = this.userSelection.length > 0
if (this.userSelection && this.userSelection.length > 0) {
this.contactForm.mobile = this.userSelection[0]?.mobile
this.$set(this.contactForm, "mobile", this.userSelection[0]?.mobile || "")
// 已有选择记录时优先回显历史收货人;历史记录为空时保留本人默认值。
if (this.userSelection[0]?.userName) {
this.$set(this.contactForm, "userName", this.userSelection[0].userName)
}
this.$set(this.contactForm, "userSign", this.userSelection[0]?.userSign || "")
} else {
if (this.isProxySelect) {
@@ -126,7 +126,9 @@ layout("/layouts/platform.html"){
</el-dialog>
<el-dialog title="发送福利选择提醒" :visible.sync="reminderVisible" width="500px" :close-on-click-modal="false">
<el-alert :title="'发送模式:' + reminderModeText + ';本次将向' + reminderCount + '人发送消息'" type="warning" :closable="false"></el-alert>
<el-alert :title="'发送模式:' + reminderModeText + ';本次将向' + reminderCount + '人发送消息,预计新增OA待办' + reminderNewTodoCount + '条'" type="warning" :closable="false"></el-alert>
<el-alert v-if="reminderExistingTodoCount > 0" class="mt10" :title="'已有' + reminderExistingTodoCount + '人存在OA待办,本次仅发送消息,不重复创建待办'" type="info" :closable="false"></el-alert>
<el-alert v-if="!reminderTodoEnabled" class="mt10" title="学校OA待办开关未开启,本次只发送消息" type="info" :closable="false"></el-alert>
<el-form label-width="80px" class="mt20">
<el-form-item label="提醒内容">
<el-input v-model="reminderContent" type="textarea" :rows="5" maxlength="500" show-word-limit placeholder="请输入提醒内容"></el-input>
@@ -174,6 +176,9 @@ layout("/layouts/platform.html"){
reminderVisible: false,
reminderContent: "",
reminderCount: 0,
reminderNewTodoCount: 0,
reminderExistingTodoCount: 0,
reminderTodoEnabled: false,
reminderSending: false
}
},
@@ -270,11 +275,14 @@ layout("/layouts/platform.html"){
this.$message.error(response.msg)
return
}
if (response.data === 0) {
if (!response.data || response.data.recipientCount === 0) {
this.$message.warning("当前筛选条件下没有可提醒的人员")
return
}
this.$set(this, "reminderCount", response.data)
this.$set(this, "reminderCount", response.data.recipientCount)
this.$set(this, "reminderNewTodoCount", response.data.newTodoCount)
this.$set(this, "reminderExistingTodoCount", response.data.existingTodoCount)
this.$set(this, "reminderTodoEnabled", response.data.todoEnabled)
this.$set(this, "reminderContent", "请及时完成本次福利选择。")
this.$set(this, "reminderVisible", true)
},
@@ -294,7 +302,11 @@ layout("/layouts/platform.html"){
{ headers: { "Content-Type": "application/x-www-form-urlencoded" } }
)
if (response.code === 0) {
this.$message.success(response.msg)
if (response.data && response.data.todoFailedCount > 0) {
this.$message.warning(response.msg)
} else {
this.$message.success(response.msg)
}
this.closeReminder()
} else {
this.$message.error(response.msg)
@@ -308,6 +320,10 @@ layout("/layouts/platform.html"){
closeReminder() {
this.$set(this, "reminderVisible", false)
this.$set(this, "reminderContent", "")
this.$set(this, "reminderCount", 0)
this.$set(this, "reminderNewTodoCount", 0)
this.$set(this, "reminderExistingTodoCount", 0)
this.$set(this, "reminderTodoEnabled", false)
},
// 管理员待选