外宿和入伍申请-状态显示调整
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user