feat(审批流程): 优化审批逻辑并添加抄送功能
重构审批条件判断逻辑,统一使用canApprove和canWithdraw计算属性控制按钮显示 为所有审批详情页添加撤回按钮功能 在审批列表页新增抄送功能,支持多选抄送人 调整提交成功后的跳转路由为/hrm/apply 仅在approverMode为template时设置tplId参数
This commit is contained in:
@@ -244,9 +244,9 @@
|
||||
<div v-if="currentTask" class="btn-row">
|
||||
<el-input v-model="actionRemark" type="textarea" :rows="3" placeholder="填写审批意见(可选)" />
|
||||
<div class="btn-row mt10">
|
||||
<el-button type="success" :loading="actionSubmitting" @click="submitTaskAction('approve')">通过</el-button>
|
||||
<el-button type="danger" :loading="actionSubmitting" @click="submitTaskAction('reject')">驳回</el-button>
|
||||
<el-button :loading="actionSubmitting" @click="submitTaskAction('withdraw')">撤回</el-button>
|
||||
<el-button type="success" v-if="canApprove" :loading="actionSubmitting" @click="submitTaskAction('approve')">通过</el-button>
|
||||
<el-button type="danger" v-if="canApprove" :loading="actionSubmitting" @click="submitTaskAction('reject')">驳回</el-button>
|
||||
<el-button v-if="canWithdraw" :loading="actionSubmitting" @click="submitTaskAction('withdraw')">撤回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty">当前无待办任务(可能已处理完成,或你不是当前审批人)</div>
|
||||
@@ -361,10 +361,18 @@ export default {
|
||||
}
|
||||
return empId ? `员工ID:${empId}` : '-'
|
||||
},
|
||||
canApprove() {
|
||||
// 只有待审批状态且是当前用户待审批的才能审批
|
||||
return this.seal.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
},
|
||||
canStamp() {
|
||||
// 审批通过后,且尚未生成回执时,可以盖章
|
||||
return this.seal.status === 'approved' && !this.seal.receiptFileIds && this.targetPdfFile && this.attachmentList.length > 0
|
||||
}
|
||||
},
|
||||
canWithdraw() {
|
||||
console.log(this.seal.createBy, this.$store.getters.name)
|
||||
return this.seal.status === 'running' && this.seal.createBy === this.$store.getters.name
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadEmployees()
|
||||
|
||||
Reference in New Issue
Block a user