feat(审批流程): 优化审批逻辑并添加抄送功能

重构审批条件判断逻辑,统一使用canApprove和canWithdraw计算属性控制按钮显示
为所有审批详情页添加撤回按钮功能
在审批列表页新增抄送功能,支持多选抄送人
调整提交成功后的跳转路由为/hrm/apply
仅在approverMode为template时设置tplId参数
This commit is contained in:
砂糖
2026-01-05 11:42:53 +08:00
parent a0f03c374a
commit 78b5af5143
10 changed files with 141 additions and 36 deletions

View File

@@ -9,7 +9,7 @@
<!-- 审批操作按钮 -->
<el-button
v-if="currentTask"
v-if="canApprove"
type="success"
size="mini"
:loading="actionLoading"
@@ -18,7 +18,7 @@
通过
</el-button>
<el-button
v-if="currentTask"
v-if="canApprove"
type="danger"
size="mini"
:loading="actionLoading"
@@ -26,14 +26,14 @@
>
驳回
</el-button>
<!-- <el-button
<el-button
v-if="canWithdraw"
size="mini"
:loading="actionLoading"
@click="handleWithdraw"
>
撤回
</el-button> -->
</el-button>
</div>
</div>
@@ -236,8 +236,13 @@ export default {
}
return empId ? `员工ID:${empId}` : '-'
},
canApprove() {
// 只有待审批状态且是当前用户待审批的才能审批
console.log(this.currentTask, this.$store.getters.name, this.$store.getters.id)
return this.detail.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
},
canWithdraw() {
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.userId
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.name
}
},
created() {