From b9a624a13dbaa9010c14ef1f0269e19558aa2dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Thu, 27 Nov 2025 17:10:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=AD=A6=E7=B1=8D?= =?UTF-8?q?=E9=80=80=E5=9B=9E=E6=88=96=E9=A9=B3=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enlistmentReserveApproval.js | 10 ++ src/views/flowable/task/todo/detail/index.vue | 102 ++++++++++++++---- .../enlistmentReserve/applicationForm.vue | 12 ++- 3 files changed, 97 insertions(+), 27 deletions(-) diff --git a/src/api/routine/enlistmentReserve/enlistmentReserveApproval.js b/src/api/routine/enlistmentReserve/enlistmentReserveApproval.js index 0c48682..100117c 100644 --- a/src/api/routine/enlistmentReserve/enlistmentReserveApproval.js +++ b/src/api/routine/enlistmentReserve/enlistmentReserveApproval.js @@ -42,3 +42,13 @@ export function delEnlistmentReserveApproval(id) { method: 'post' }) } + + +// 新增保留学籍审批记录 +export function insertOrUpdateByStuAndApprover(data) { + return request({ + url: '/routine/enlistmentReserveApproval/insertOrUpdateByStuAndApprover', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/views/flowable/task/todo/detail/index.vue b/src/views/flowable/task/todo/detail/index.vue index 9784171..6bc30fc 100644 --- a/src/views/flowable/task/todo/detail/index.vue +++ b/src/views/flowable/task/todo/detail/index.vue @@ -439,7 +439,7 @@ - +
@@ -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等于当前returnTask的documentation - 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 - } - }) - } - + taskReturn() { 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() + }) + } + } + }) + }) } }, } diff --git a/src/views/routine/enlistmentReserve/applicationForm.vue b/src/views/routine/enlistmentReserve/applicationForm.vue index 0871901..7242a70 100644 --- a/src/views/routine/enlistmentReserve/applicationForm.vue +++ b/src/views/routine/enlistmentReserve/applicationForm.vue @@ -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("新增成功"); From e8000cee6d42fb37ef1ce38f8c1d74432d41ba15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Thu, 27 Nov 2025 17:24:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/routine/enlistmentReserve/index.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/routine/enlistmentReserve/index.vue b/src/views/routine/enlistmentReserve/index.vue index b6b9e21..50b6889 100644 --- a/src/views/routine/enlistmentReserve/index.vue +++ b/src/views/routine/enlistmentReserve/index.vue @@ -316,7 +316,14 @@ export default { }; }, created() { - this.getUser(); + // this.getUser(); + }, + // 路由守卫:当路由进入该组件时触发(解决返回后不刷新问题) + beforeRouteEnter(to, from, next) { + next(vm => { + // vm 是组件实例,这里调用数据加载方法 + vm.getUser(); + }); }, methods: { /** 查询应征入伍保留学籍申请列表 */ From 03ac1eca2fe0225db4bcf5f38c67a6dec69eaaf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Fri, 28 Nov 2025 11:17:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=AD=A6=E7=B1=8D?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=B5=81=E7=A8=8B=E9=80=9A=E8=BF=87=E5=90=8E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F=E7=9A=84=E5=AD=A6=E7=B1=8D?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA=E2=80=9C=E5=85=A5=E4=BC=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=AD=A6=E7=B1=8D=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flowable/task/todo/detail/index.vue | 8 +++++-- .../enlistmentReserve/applicationForm.vue | 21 ++++++++++++------- .../enlistmentReserveAttach/index.vue | 9 ++++++-- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/views/flowable/task/todo/detail/index.vue b/src/views/flowable/task/todo/detail/index.vue index 6bc30fc..15b2f11 100644 --- a/src/views/flowable/task/todo/detail/index.vue +++ b/src/views/flowable/task/todo/detail/index.vue @@ -663,6 +663,7 @@ import pdf from 'vue-pdf' import { getEnlistmentReserveByProcessInstanceId, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve"; import { insertOrUpdateByStuAndApprover } from "@/api/routine/enlistmentReserve/enlistmentReserveApproval"; import { getUserProfile } from '@/api/system/user' // 获取当前登录用户 +import { updateStudent } from '@/api/stuCQS/basedata/student' export default { name: 'Record', @@ -1046,7 +1047,7 @@ export default { if (valid) { this.$modal.loading('正在努力加载中,请稍等...') - this.taskForm.comment = '同意' + this.taskForm.comment = this.taskForm.variables.approvalOpinion != '' ? this.taskForm.variables.approvalOpinion : '同意' this.taskForm.variables.approvalResult = 1 if (this.taskForm && this.formKeyExist) { // 表单是否禁用 @@ -1058,7 +1059,6 @@ export default { complete(this.taskForm).then((response) => { this.$modal.closeLoading() - this.goBack() }) } else { @@ -1090,6 +1090,10 @@ export default { this.form.quitNumber = this.taskForm.quitNumber this.form.remark = this.taskForm.remark this.updateRtStuQuitSchool() + } else if (this.category == 'enlistmentReserve') { // 是应征入伍保留学籍申请,才执行 + if (this.taskName == '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status:07是入伍保留学籍) + updateStudent({stuId: this.form.studentId, status: '07'}).then(response => {}) + } } else { this.$modal.msgSuccess(response.msg) } diff --git a/src/views/routine/enlistmentReserve/applicationForm.vue b/src/views/routine/enlistmentReserve/applicationForm.vue index 7242a70..be14c45 100644 --- a/src/views/routine/enlistmentReserve/applicationForm.vue +++ b/src/views/routine/enlistmentReserve/applicationForm.vue @@ -692,19 +692,25 @@ export default { }; if (this.formData.id != null) { updateEnlistmentReserve(submitData.formData).then(response => { - this.$modal.msgSuccess("修改成功"); - + + // 填写附件里面的申请编号 + this.enlistmentReserveAttachList.forEach(element => { + element.applyNo = this.formData.applyNo + element.applyId = response.data.id + }) // 批量新增材料附件 if (this.enlistmentReserveAttachList && this.enlistmentReserveAttachList.length > 0) { - this.batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList); + batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList) } - this.goBack() this.loading = false; + this.$modal.msgSuccess("修改成功"); + this.goBack() + }); } else { addEnlistmentReserve(submitData.formData).then(response => { - this.$modal.msgSuccess("新增成功"); + // 申请表新增成功之后,进行附件的添加 if (response.code == 200) { // 填写附件里面的申请编号 @@ -712,11 +718,12 @@ export default { element.applyNo = this.formData.applyNo element.applyId = response.data.id }) - this.loading = false; // 批量新增材料附件 if (this.enlistmentReserveAttachList && this.enlistmentReserveAttachList.length > 0) { - this.batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList); + batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList) } + this.loading = false; + this.$modal.msgSuccess("新增成功"); this.goBack() } }); diff --git a/src/views/routine/enlistmentReserve/enlistmentReserveAttach/index.vue b/src/views/routine/enlistmentReserve/enlistmentReserveAttach/index.vue index 07fefb0..97dd45e 100644 --- a/src/views/routine/enlistmentReserve/enlistmentReserveAttach/index.vue +++ b/src/views/routine/enlistmentReserve/enlistmentReserveAttach/index.vue @@ -50,8 +50,12 @@ @@ -101,6 +105,7 @@ export default { name: "EnlistmentReserveAttach", data() { return { + baseUrl:process.env.VUE_APP_BASE_API, // 遮罩层 loading: true, // 选中数组