feat(审批流程): 优化审批逻辑并添加抄送功能
重构审批条件判断逻辑,统一使用canApprove和canWithdraw计算属性控制按钮显示 为所有审批详情页添加撤回按钮功能 在审批列表页新增抄送功能,支持多选抄送人 调整提交成功后的跳转路由为/hrm/apply 仅在approverMode为template时设置tplId参数
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user