修复了已知问题以及报销合理化
This commit is contained in:
@@ -39,27 +39,6 @@ export function delSealReq(bizIds) {
|
||||
})
|
||||
}
|
||||
|
||||
export function approveSealReq(bizId) {
|
||||
return request({
|
||||
url: `/hrm/seal/${bizId}/approve`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function rejectSealReq(bizId) {
|
||||
return request({
|
||||
url: `/hrm/seal/${bizId}/reject`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function cancelSealReq(bizId) {
|
||||
return request({
|
||||
url: `/hrm/seal/${bizId}/cancel`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function stampSealJava(bizId, data) {
|
||||
// 确保数据正确序列化,特别是 0 值
|
||||
const payload = {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<slot :detail="detail"></slot>
|
||||
<slot :detail="detail" :flowInstance="flowInstance"></slot>
|
||||
|
||||
<div class="block-title">审批信息</div>
|
||||
<el-card class="inner-card" shadow="never">
|
||||
|
||||
@@ -136,9 +136,8 @@ 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)
|
||||
// 只有审批中且是当前用户待审批的才能审批
|
||||
return this.flowInstance?.status === 'running' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
},
|
||||
canWithdraw () {
|
||||
return false
|
||||
|
||||
@@ -81,13 +81,10 @@ export default {
|
||||
},
|
||||
canWithdraw () {
|
||||
return false;
|
||||
// 只有待审批状态且是当前用户提交的才能撤回
|
||||
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.name
|
||||
},
|
||||
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)
|
||||
// 只有审批中且是当前用户待审批的才能审批
|
||||
return this.flowInstance?.status === 'running' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<BizDetailContainer :bizId="currentBizId" bizType="travel" :preview="preview">
|
||||
<template slot-scope="{ detail }">
|
||||
<template slot-scope="{ detail, flowInstance }">
|
||||
<div>
|
||||
<!-- ===== 新增:提前结束按钮区域 ===== -->
|
||||
<div class="action-buttons" v-if="showEarlyEndButton(detail)">
|
||||
<div class="action-buttons" v-if="showEarlyEndButton(detail, flowInstance)">
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
@@ -110,13 +110,14 @@ export default {
|
||||
const now = Date.now()
|
||||
return Boolean(detail.actualEndTime) || (endTime && endTime <= now)
|
||||
},
|
||||
showEarlyEndButton(detail) {
|
||||
showEarlyEndButton(detail, flowInstance) {
|
||||
if (!detail) return false
|
||||
if (detail.actualEndTime) return false
|
||||
const status = detail.status
|
||||
// 已通过与否以流程实例为准
|
||||
const approved = flowInstance?.status === 'approved'
|
||||
const endTime = detail.endTime ? new Date(detail.endTime).getTime() : 0
|
||||
const now = Date.now()
|
||||
return status === 'approved' && endTime > now
|
||||
return approved && endTime > now
|
||||
},
|
||||
|
||||
handleEarlyEnd() {
|
||||
|
||||
Reference in New Issue
Block a user