保留学籍退回或驳回

This commit is contained in:
2025-11-27 17:10:05 +08:00
parent 60bd79aa9c
commit b9a624a13d
3 changed files with 97 additions and 27 deletions

View File

@@ -42,3 +42,13 @@ export function delEnlistmentReserveApproval(id) {
method: 'post'
})
}
// 新增保留学籍审批记录
export function insertOrUpdateByStuAndApprover(data) {
return request({
url: '/routine/enlistmentReserveApproval/insertOrUpdateByStuAndApprover',
method: 'post',
data: data
})
}

View File

@@ -439,7 +439,7 @@
<!--流程流转记录-->
<el-tab-pane label="流转记录" name="2">
<!--flowRecordList-->
<el-col :span="16" :offset="4">
<el-col :span="16" :offset="4" v-loading="loading" style="min-height: 500px;">
<div class="block">
<el-timeline>
<el-timeline-item v-for="(item, index) in flowRecordList" :key="index" :icon="setIcon(item.finishTime)" :color="setColor(item.finishTime)">
@@ -660,7 +660,9 @@ import { checkRole } from '@/utils/permission' // 权限判断函数
import flow from '@/views/flowable/task/todo/detail/flow'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import pdf from 'vue-pdf'
import { getEnlistmentReserveByProcessInstanceId} from "@/api/routine/enlistmentReserve/enlistmentReserve";
import { getEnlistmentReserveByProcessInstanceId, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
import { insertOrUpdateByStuAndApprover } from "@/api/routine/enlistmentReserve/enlistmentReserveApproval";
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
export default {
name: 'Record',
@@ -984,9 +986,11 @@ export default {
flowRecord(params)
.then((res) => {
that.flowRecordList = res.data.flowList
this.loading = false
})
.catch((res) => {
this.goBack()
this.loading = false
})
},
fillFormData(form, data) {
@@ -1137,13 +1141,18 @@ export default {
/** 驳回任务 */
taskReject() {
this.$refs['taskForm'].validate((valid) => {
this.$modal.loading('正在努力加载中,请稍等...')
if (valid) {
// 入伍保留学籍审核状态和意见
this.taskForm.variables.approvalResult = 0
this.taskForm.variables.approvalOpinion = this.taskForm.comment
rejectTask(this.taskForm).then((res) => {
// 是应征入伍保留学籍申请,才执行
if (this.category == 'enlistmentReserve') {
this.taskReturnApproval("驳回")
}
this.$modal.msgSuccess(res.msg)
this.$modal.closeLoading()
this.goBack()
})
}
@@ -1157,39 +1166,45 @@ export default {
this.returnTaskList = res.data
this.taskForm.variables = null
// 是应征入伍保留学籍申请,才执行
if (this.category == 'enlistmentReserve') {
this.form.enlistmentReserveApprovalList.push({nodeName: "学生申请"})
// 过滤returnTaskList保留documentation在flowRecordList的taskName中存在的项
// 取原审批列表的副本避免直接修改原表单数据导致重复push
const approvalList = [...this.form.enlistmentReserveApprovalList]
// 判断approvalList中是否已存在"学生申请"项仅不存在时才push
const hasStudentApply = approvalList.some(record => record.nodeName === "学生申请")
if (!hasStudentApply) {
approvalList.push({ nodeName: "学生申请" })
}
// 过滤returnTaskList使用处理后的临时approvalList不污染原数据
this.returnTaskList = this.returnTaskList.filter(returnTask => {
// 检查flowRecordList中是否有项的taskName等于当前returnTaskdocumentation
return this.form.enlistmentReserveApprovalList.some(record => record.nodeName === returnTask.documentation)
return approvalList.some(record => record.nodeName === returnTask.documentation)
})
}
this.initApproval()
})
},
/** 提交退回任务 */
taskReturn() {
// 入伍保留学籍审核状态和意见
if (this.category == 'enlistmentReserve') {
this.taskForm.variables.approvalResult = 3
this.taskForm.variables.approvalOpinion = this.taskForm.comment
this.returnTaskList.forEach(element => {
if (element.id == this.taskForm.targetKey) {
this.taskForm.variables.targetNodeName = element.documentation
}
})
}
this.$refs['taskForm'].validate((valid) => {
if (valid) {
this.$modal.loading('正在努力加载中,请稍等...')
returnTask(this.taskForm).then((res) => {
// 是应征入伍保留学籍申请,才执行
if (this.category == 'enlistmentReserve') {
this.taskReturnApproval("退回")
}
this.$modal.msgSuccess(res.msg)
this.$modal.closeLoading()
this.goBack()
})
}
})
},
/** 取消回退任务按钮 */
cancelTask() {
@@ -1266,6 +1281,49 @@ export default {
targetNodeName: this.taskForm.variables.targetNodeName || ''
}
}
},
// 退回或驳回的时候生成入伍保留学籍申请审核
taskReturnApproval(text) {
getUserProfile().then(res => {
let data = {
applyId: this.form.id,
processInstanceId: this.form.processInstanceId,
taskId: this.taskForm.taskId,
nodeName: this.taskName,
approverId: res.data.userId,
approverName: res.data.nickName,
approvalOpinion: this.taskForm.comment,
approvalResult: 2,
studentName: this.form.studentName,
studentNo: this.form.studentNo
}
// 生成审核记录
insertOrUpdateByStuAndApprover(data).then(ress => {
// 审核记录生成之后,判断退回或驳回是不是到学生申请,如果是则更新申请表状态
if (text == '退回') {
let nodeName = ''
this.returnTaskList.forEach(element => {
if (element.id == this.taskForm.targetKey) { // 如果选中的节点id等于列表里面的id就将节点名称获取到nodeName
nodeName = element.documentation
}
});
if (nodeName == '学生申请') { // 如果退回选择的是学生节点更新申请表状态
this.form.applyStatus = 0
updateEnlistmentReserve(this.form).then(result => {
this.$modal.closeLoading()
})
}
} else {
// 驳回
if (this.taskName == '辅导员审批') { // 当前节点如果是辅导员审批,证明驳回就到了学生,所以更新申请表状态
this.form.applyStatus = 0
updateEnlistmentReserve(this.form).then(result => {
this.$modal.closeLoading()
})
}
}
})
})
}
},
}

View File

@@ -693,13 +693,15 @@ export default {
if (this.formData.id != null) {
updateEnlistmentReserve(submitData.formData).then(response => {
this.$modal.msgSuccess("修改成功");
// 批量新增材料附件
if (this.enlistmentReserveAttachList && this.enlistmentReserveAttachList.length > 0) {
this.batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList);
}
this.goBack()
this.loading = false;
});
// 批量新增材料附件
if (this.enlistmentReserveAttachList && this.enlistmentReserveAttachList.length > 0) {
this.batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList);
}
this.goBack()
} else {
addEnlistmentReserve(submitData.formData).then(response => {
this.$modal.msgSuccess("新增成功");