添加我的审核,我的申请提前结束

This commit is contained in:
2026-04-22 16:11:43 +08:00
parent 8b78e82a80
commit 50527f68e0
4 changed files with 81 additions and 18 deletions

View File

@@ -15,7 +15,6 @@
</el-button>
<span class="hint-text">提前结束将把当前时间记录为实际结束时间</span>
</div>
<!-- ===== 新增显示已提前结束的信息 ===== -->
<div v-if="detail.actualEndTime" class="early-end-info">
<el-alert
type="info"
@@ -26,6 +25,16 @@
</template>
</el-alert>
</div>
<div v-else-if="isTravelCompleted(detail)" class="early-end-info">
<el-alert
type="success"
:closable="false"
show-icon>
<template slot="default">
该出差已完成
</template>
</el-alert>
</div>
<!-- 出差时间与行程 -->
<div class="block-title">出差时间与行程</div>
<el-card class="inner-card" shadow="never">
@@ -95,14 +104,19 @@ export default {
const p = n => (n < 10 ? `0${n}` : n)
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`
},
// 新增:处理提前结束
showEarlyEndButton(detail) {
isTravelCompleted (detail) {
if (!detail) return false
const endTime = detail.endTime ? new Date(detail.endTime).getTime() : 0
const now = Date.now()
return Boolean(detail.actualEndTime) || (endTime && endTime <= now)
},
showEarlyEndButton(detail) {
if (!detail) return false
// 已经提前结束的不显示
if (detail.actualEndTime) return false
// 只有已通过或进行中状态才显示
const status = detail.status
return status === 'approved' || status === 'in_progress'
const endTime = detail.endTime ? new Date(detail.endTime).getTime() : 0
const now = Date.now()
return status === 'approved' && endTime > now
},
handleEarlyEnd() {
@@ -116,10 +130,8 @@ export default {
const bizId = this.currentBizId
await earlyEndTravel(bizId)
this.$message.success('提前结束成功')
// 刷新页面
setTimeout(() => {
location.reload()
}, 1000)
this.$emit('refresh')
this.$forceUpdate()
} catch (error) {
this.$message.error(error.message || '提前结束失败')
} finally {