Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-12-14 10:42:29 +08:00
4 changed files with 67 additions and 33 deletions

View File

@@ -274,7 +274,7 @@
<i class="el-icon-folder" />
保存
</el-button>
<el-button type="primary" size="medium" @click="submitForm(1)" v-if="form.id == ''">
<el-button type="primary" size="medium" @click="submitForm(1)" v-if="form.status == 0">
<i class="el-icon-check" />
提交申请
</el-button>
@@ -372,7 +372,9 @@ export default {
promiseDate: '',
parentSignAttachment: '',
promiseContent: '',
accommodationFee: ''
accommodationFee: '',
affixId: '',
status: 0
},
formRules: {
originalDormitory: [{ required: true, message: '原宿舍号不能为空', trigger: 'blur' }],

View File

@@ -152,7 +152,7 @@
v-hasPermi="['dormitory:outsideAccommodationApply:edit']"
v-if="scope.row.status == 0 || getRejectInfo(scope.row.outsideAccommodationApprovals).isReject">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['dormitory:outsideAccommodationApply:remove']" v-if="scope.row.status == 0">删除</el-button>
v-hasPermi="['dormitory:outsideAccommodationApply:remove']" v-if="scope.row.status == 0 && scope.row.processInstanceId == null">删除</el-button>
<el-button v-if="scope.row.applyStatus != 0" size="mini" type="text" icon="el-icon-info"
@click="detail(scope.row)">详情</el-button>
</template>

View File

@@ -2010,29 +2010,30 @@ export default {
// 生成审核记录
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 => {
// 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()
// })
// }
// }
this.$modal.closeLoading()
})
}
} else {
// 驳回
if (this.taskName == '辅导员审批') { // 当前节点如果是辅导员审批,证明驳回就到了学生,所以更新申请表状态
this.form.applyStatus = 0
updateEnlistmentReserve(this.form).then(result => {
this.$modal.closeLoading()
})
}
}
})
})
},
// 退回或驳回的时候生成外宿申请审核

View File

@@ -101,12 +101,21 @@
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="申请状态" align="center" prop="applyStatus">
<el-table-column label="申请状态" align="center" prop="applyStatus" width="150">
<template slot-scope="scope">
<el-tag v-if="scope.row.applyStatus == 0 && scope.row.processInstanceId == ''" type="info">待提交</el-tag>
<el-tag v-if="scope.row.applyStatus == 0 && scope.row.processInstanceId != ''" type="info">被驳回</el-tag>
<el-tag v-if="scope.row.applyStatus == 1">审核中</el-tag>
<el-tag v-if="scope.row.applyStatus == 2" type="success">审核通过</el-tag>
<!-- 优先判断是否驳回只要有一条审批结果为0就显示驳回 -->
<!-- 动态显示驳回节点 + 驳回文字 -->
<el-tag v-if="getRejectInfo(scope.row.enlistmentReserveApprovalList).isReject" type="danger">
{{ getRejectInfo(scope.row.enlistmentReserveApprovalList).rejectText }}
</el-tag>
<!-- 调整顺序驳回优先级最高 -->
<el-tag v-else-if="scope.row.applyStatus == 0 || scope.row.applyStatus == ''" type="info">待提交</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 1">待辅导员审批</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 2">待学务审批</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 3">待二级学院审批</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 4">待学籍管理科审批</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 5">待教务处主管领导审批</el-tag>
<el-tag v-else-if="scope.row.applyStatus == 6" type="success">审批通过</el-tag>
</template>
</el-table-column>
<el-table-column label="保留学籍编号" align="center" prop="reserveNo" />
@@ -124,10 +133,10 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['routine:enlistmentReserve:edit']" v-if="scope.row.applyStatus == 0">修改</el-button>
v-hasPermi="['routine:enlistmentReserve:edit']" v-if="scope.row.applyStatus == 0 || getRejectInfo(scope.row.enlistmentReserveApprovalList).isReject">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['routine:enlistmentReserve:remove']" v-if="scope.row.applyStatus == 0">删除</el-button>
<el-button v-if="scope.row.applyStatus != 0" size="mini" type="text" icon="el-icon-info"
v-hasPermi="['routine:enlistmentReserve:remove']" v-if="scope.row.applyStatus == 0 && scope.row.processInstanceId == ''">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-info"
@click="detail(scope.row)">详情</el-button>
</template>
</el-table-column>
@@ -475,6 +484,28 @@ export default {
query: { id: row.id, type: 'detail', deployId: row.deployId, processInstanceId: row.processInstanceId } // 将 row.id 放在 query 中
})
},
/**
* 获取驳回信息(是否驳回 + 驳回文字)
* @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: '' };
}
}
}
};
</script>