diff --git a/pages/Approval/handleTask/processHandling/components/enlistmentReserve.vue b/pages/Approval/handleTask/processHandling/components/enlistmentReserve.vue index cab2be2..a3e1250 100644 --- a/pages/Approval/handleTask/processHandling/components/enlistmentReserve.vue +++ b/pages/Approval/handleTask/processHandling/components/enlistmentReserve.vue @@ -3,10 +3,10 @@ - + 基础信息 - + 学号: @@ -88,7 +88,12 @@ 申请状态: - + + {{ getRejectInfo(form.enlistmentReserveApprovalList).rejectText }} + + {{ getStatusText(form.applyStatus) }} @@ -115,13 +120,14 @@ - + 材料附件 附件列表: - + {{ file.fileName || '-' }} {{ formatFileSize(file.fileSize) }} @@ -131,13 +137,15 @@ - + - + 审批记录 - + {{ approval.nodeName || '-' }} @@ -163,7 +171,8 @@ 审批签名: - + @@ -238,10 +247,14 @@ */ getStatusText(status) { const statusMap = { - 1: '待审批', - 2: '审批中', - 3: '已通过', - 4: '已驳回' + 0: '待提交', + 1: '待辅导员审批', + 2: '待学务审批', + 3: '待二级学院审批', + 4: '待学籍管理科审批', + 5: '待教务处主管领导审批', + 6: '审批通过', + 7: '不通过' }; return statusMap[status] || '未知状态'; }, @@ -253,10 +266,14 @@ */ getStatusClass(status) { const classMap = { - 1: 'status-pending', + 0: 'status-pending', + 1: 'status-processing', 2: 'status-processing', - 3: 'status-success', - 4: 'status-reject' + 3: 'status-processing', + 4: 'status-processing', + 5: 'status-processing', + 6: 'status-success', + 7: 'status-reject' }; return classMap[status] || 'status-default'; }, @@ -323,6 +340,37 @@ current: this.baseUrl + file.signature }); } + }, + /** + * 获取驳回信息(是否驳回 + 驳回文字) + * @param {Array} approvalList 审批意见列表 + * @returns {Object} { isReject: 布尔值, rejectText: 驳回文字 } + */ + getRejectInfo(approvalList) { + // 空值保护:列表不存在/非数组/为空时,返回未驳回 + if (!approvalList || !Array.isArray(approvalList) || approvalList.length === 0) { + return { + isReject: false, + rejectText: '' + }; + } + // 找到第一个审批结果为0(驳回)的记录 + const rejectItem = approvalList.find(item => item.approvalResult === 2); + if (rejectItem) { + // 提取审批节点名称(如「辅导员审批」→ 截取「辅导员」) + const nodeName = rejectItem.nodeName.replace('审批', ''); + // 拼接驳回文字(如「辅导员驳回」) + return { + isReject: true, + rejectText: `${nodeName}驳回` + }; + } else { + // 无驳回记录 + return { + isReject: false, + rejectText: '' + }; + } } } } @@ -342,12 +390,13 @@ padding: 20rpx; margin-bottom: 20rpx; } + .card-header { display: flex; align-items: center; padding: 10rpx 0rpx; border-bottom: 1px solid #f5f5f5; - + .section-title { font-size: 30rpx; font-weight: 600; @@ -385,7 +434,8 @@ /* 关键修改:移除右对齐,改为左对齐 */ // text-align: right; text-align: left; - margin-right: 10rpx; /* 减小右边距,更紧凑 */ + margin-right: 10rpx; + /* 减小右边距,更紧凑 */ text-wrap: nowrap; font-size: 28rpx; color: #333; @@ -512,7 +562,7 @@ flex: 1; } - // ========== 修复:将&嵌套到.approval-header内部 ========== + // ========== 将&嵌套到.approval-header内部 ========== .approval-result-tag { padding: 6rpx 12rpx; border-radius: 15rpx; diff --git a/pages/Approval/handleTask/processHandling/components/outsideAccommodation.vue b/pages/Approval/handleTask/processHandling/components/outsideAccommodation.vue index 1187165..c1fed39 100644 --- a/pages/Approval/handleTask/processHandling/components/outsideAccommodation.vue +++ b/pages/Approval/handleTask/processHandling/components/outsideAccommodation.vue @@ -9,7 +9,10 @@ 申请编号:{{ form.applyNo || '-' }} {{ form.studentName || '-' }} {{ form.studentNo || '-' }} - + + {{ getRejectInfo(form.outsideAccommodationApprovals).rejectText }} + + {{ getStatusText(form.status) }} @@ -91,7 +94,8 @@ 学生签名: - + @@ -128,7 +132,8 @@ 家长意见: - + {{ form.parentOpinion == 1 ? '同意' : '不同意' }} @@ -145,7 +150,8 @@ 家长签字: - + @@ -169,19 +175,22 @@ 承诺签名: - + - + 佐证材料 - + @@ -201,9 +210,12 @@ 审批记录 - + - + + {{ item.approvalNode || '未知节点' }} @@ -216,19 +228,22 @@ 审批结果: - + {{ item.approvalResult == 1 ? '通过' : '驳回' }} - - 审批意见: - {{ item.approvalOpinion }} - 审批签名: - + + + + 审批意见: + {{ item.approvalOpinion }} @@ -238,7 +253,8 @@ - + 审批记录 @@ -309,7 +325,7 @@ const statusMap = { 0: '待提交', 1: '待辅导员审批', - 2: '待学院书记审批', + 2: '待二级学院书记审批', 3: '待学工处审批', 4: '待学校领导审批', 5: '审核通过', @@ -365,6 +381,37 @@ urls: [fullUrl], current: fullUrl }); + }, + /** + * 获取驳回信息(是否驳回 + 驳回文字) + * @param {Array} approvalList 审批意见列表 + * @returns {Object} { isReject: 布尔值, rejectText: 驳回文字 } + */ + getRejectInfo(approvalList) { + // 空值保护:列表不存在/非数组/为空时,返回未驳回 + if (!approvalList || !Array.isArray(approvalList) || approvalList.length === 0) { + return { + isReject: false, + rejectText: '' + }; + } + // 找到第一个审批结果为0(驳回)的记录 + const rejectItem = approvalList.find(item => item.approvalResult === 0); + if (rejectItem) { + // 提取审批节点名称(如「辅导员审批」→ 截取「辅导员」) + const nodeName = rejectItem.approvalNode.replace('审批', ''); + // 拼接驳回文字(如「辅导员驳回」) + return { + isReject: true, + rejectText: `${nodeName}驳回` + }; + } else { + // 无驳回记录 + return { + isReject: false, + rejectText: '' + }; + } } } }; @@ -613,8 +660,9 @@ height: 20rpx; border-radius: 50%; background-color: #ddd; - z-index: 2; + // z-index: 2; flex-shrink: 0; + margin-top: 10rpx; &.dot-success { background-color: #67c23a; @@ -655,7 +703,7 @@ .approval-info { display: flex; align-items: center; - margin-bottom: 8rpx; + margin-bottom: 20rpx; font-size: 26rpx; .info-key { @@ -675,7 +723,10 @@ } // 标签样式 - .status-tag, .fee-tag, .opinion-tag, .approval-result-tag { + .status-tag, + .fee-tag, + .opinion-tag, + .approval-result-tag { padding: 8rpx 16rpx; border-radius: 24rpx; font-size: 24rpx; diff --git a/pages/Approval/handleTask/processHandling/detail.vue b/pages/Approval/handleTask/processHandling/detail.vue index 9fab25f..0b017de 100644 --- a/pages/Approval/handleTask/processHandling/detail.vue +++ b/pages/Approval/handleTask/processHandling/detail.vue @@ -21,7 +21,7 @@ - + @@ -40,6 +40,41 @@ + + + + + + + + + 退回流程 + + + + + + + + {{item.name}} + + + + + + + + + + + + + + + @@ -70,6 +105,7 @@ getOutsideAccommodationApplyByProcessInstanceId, updateOutsideAccommodationApply } from "@/api/dms/outsideAccommodation/outsideAccommodationApply"; + import { addOrUpdateAccommodationApproval } from "@/api/dms/outsideAccommodation/outsideAccommodationApproval"; import { insertOrUpdateByStuAndApprover } from "@/api/routine/enlistmentReserve/enlistmentReserveApproval"; @@ -141,13 +177,13 @@ this.getEnlistmentReserve(this.taskForm.procInsId); // 页面标题修改 uni.setNavigationBarTitle({ - title: '入伍保留学籍申请详情' + title: '入伍保留学籍申请详情' }); } else if (this.category == 'outsideAccommodation') { // 外宿申请表单 this.getOutsideAccommodation(this.taskForm.procInsId); // 页面标题修改 uni.setNavigationBarTitle({ - title: '外宿申请详情' + title: '外宿申请详情' }); } getUserProfile().then(res => { @@ -205,6 +241,9 @@ } }); } + if (this.tag == 1) { + this.getReturnList(); + } } catch (error) { // 错误捕获,避免接口调用失败导致页面异常 console.error("获取数据失败:", error); @@ -237,6 +276,9 @@ } }); } + if (this.tag == 1) { + this.getReturnList(); + } }) }, onComplete() { @@ -253,6 +295,7 @@ this.$refs.approveDialog.close(); this.$refs.returnDialog.close(); }, + // 审批(同意) approveDialogConfirm() { if (this.taskForm.variables.approvalOpinion == '') { uni.showToast({ @@ -270,8 +313,7 @@ this.taskForm.variables.approvalResult = 1 complete(this.taskForm).then(res => { if (res.code == 200) { - if (this.taskName == - '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status:07是入伍保留学籍) + if (this.taskName == '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status:07是入伍保留学籍) updateStudent({ stuId: this.form.studentId, status: '07' @@ -302,6 +344,148 @@ }) }) }, + // 驳回 + rejectDialogConfirm() { + if (this.inputReject == "") { + uni.showToast({ + title: `请填写驳回理由`, + icon: "none" + }) + return; + } + uni.showLoading({ + title: "正在驳回" + }); + let sData = { + taskId: this.taskForm.taskId, + comment: this.inputReject + } + + reject(sData).then(res => { + if (res.code == 200) { + // 是应征入伍保留学籍申请,才执行 + if (this.category == 'enlistmentReserve') { + this.taskReturnApproval("驳回") + } else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行 + this.taskReturnAccommodationApproval("驳回") + } + uni.showToast({ + title: "已驳回" + }) + uni.hideLoading(); + uni.navigateBack({ + success: () => { + const pages = getCurrentPages(); + if (pages && pages.length > 0) { + const prevPage = pages[pages.length - 2] || pages[pages.length - + 1]; + if (prevPage && typeof prevPage.handleChange === 'function') { + prevPage.handleChange(this.tag || 1); + console.log('刷新任务数据'); + } + } + } + }) + } + }) + }, + // 退回或驳回的时候生成入伍保留学籍申请审核 + taskReturnApproval(text) { + let data = { + applyId: this.form.id, + processInstanceId: this.form.processInstanceId, + taskId: this.taskForm.taskId, + nodeName: this.taskName, + approverId: this.user.userId, + approverName: this.user.nickName, + approvalOpinion: text == '驳回' ? this.inputReject : this.taskForm.comment, + approvalResult: 2, + studentName: this.form.studentName, + studentNo: this.form.studentNo, + signature: this.user.signature + } + // 生成审核记录 + insertOrUpdateByStuAndApprover(data).then(ress => {}) + }, + // 退回或驳回的时候生成外宿申请审核 + taskReturnAccommodationApproval(text) { + let data = { + applyId: this.form.id, + processInstanceId: this.form.processInstanceId, + applyNo: this.form.applyNo, + approvalNode: this.taskName, + approverId: this.user.userId, + approverName: this.user.nickName, + approvalOpinion: text == '驳回' ? this.inputReject : this.taskForm.comment, + approvalResult: 0, + studentName: this.form.studentName, + studentNo: this.form.studentNo, + signature: this.user.signature + } + // 生成审核记录 + addOrUpdateAccommodationApproval(data).then(ress => { + // 退回或者驳回生产审批记录之后,更新申请表里面的驳回信息 + updateOutsideAccommodationApply({ + id: this.form.id, + rejectReason: text == '驳回' ? this.inputReject : this.taskForm.comment + }) + }) + }, + // 获取退回节点 + getReturnList() { + returnList(this.taskForm).then((res) => { + this.returnTaskList = res.data + }) + }, + // 选择退回节点时候,获取节点id + taskDotChange(index, item) { + this.taskDotIndex = index; + this.taskForm.targetKey = item.id; + }, + // 回退确认 + returnDialogConfirm() { + if (this.taskForm.targetKey == "") { + this.taskForm.targetKey = this.returnTaskList[0].id; + } + if (this.taskForm.comment == "") { + uni.showToast({ + title: `请填写回退意见`, + icon: "none" + }); + return; + } + uni.showLoading({ + title: "正在回退" + }); + returnTask(this.taskForm).then((res) => { + // 是应征入伍保留学籍申请,才执行 + if (this.category == 'enlistmentReserve') { + this.taskReturnApproval("退回") + } else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行 + this.taskReturnAccommodationApproval("退回") + } + uni.showToast({ + title: "已退回" + }) + uni.hideLoading(); + uni.showToast({ + title: res.msg + }) + uni.navigateBack({ + success: () => { + const pages = getCurrentPages(); + if (pages && pages.length > 0) { + const prevPage = pages[pages.length - 2] || pages[pages.length - 1]; + if (prevPage && typeof prevPage.handleChange === 'function') { + prevPage.handleChange(this.tag || 1); + } + } + + } + }) + }) + this.$refs.returnDialog.close(); + }, } }