2026-04-13 17:04:38 +08:00
|
|
|
|
<template>
|
2026-04-15 16:52:27 +08:00
|
|
|
|
<BizDetailContainer :bizId="currentBizId" bizType="travel" :preview="preview">
|
2026-04-13 17:04:38 +08:00
|
|
|
|
<template slot-scope="{ detail }">
|
|
|
|
|
|
<div>
|
2026-04-15 18:32:59 +08:00
|
|
|
|
<!-- ===== 新增:提前结束按钮区域 ===== -->
|
|
|
|
|
|
<div class="action-buttons" v-if="showEarlyEndButton(detail)">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
icon="el-icon-finished"
|
|
|
|
|
|
:loading="earlyEndLoading"
|
|
|
|
|
|
@click="handleEarlyEnd"
|
|
|
|
|
|
>
|
|
|
|
|
|
提前结束
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<span class="hint-text">提前结束将把当前时间记录为实际结束时间</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="detail.actualEndTime" class="early-end-info">
|
|
|
|
|
|
<el-alert
|
|
|
|
|
|
type="info"
|
|
|
|
|
|
:closable="false"
|
|
|
|
|
|
show-icon>
|
|
|
|
|
|
<template slot="default">
|
|
|
|
|
|
该出差已于 {{ formatDate(detail.actualEndTime) }} 提前结束
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-alert>
|
|
|
|
|
|
</div>
|
2026-04-22 16:11:43 +08:00
|
|
|
|
<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>
|
2026-04-13 17:04:38 +08:00
|
|
|
|
<!-- 出差时间与行程 -->
|
|
|
|
|
|
<div class="block-title">出差时间与行程</div>
|
|
|
|
|
|
<el-card class="inner-card" shadow="never">
|
|
|
|
|
|
<el-descriptions :column="2" border size="small">
|
|
|
|
|
|
<el-descriptions-item label="开始时间">
|
|
|
|
|
|
<span class="date-time">{{ formatDate(detail.startTime) }}</span>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="结束时间">
|
|
|
|
|
|
<span class="date-time">{{ formatDate(detail.endTime) }}</span>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="出差类型">{{ detail.travelType || '-' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="目的地">
|
|
|
|
|
|
<span class="destination-text">{{ detail.destination || '-' }}</span>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="出差事由" :span="2">
|
|
|
|
|
|
<div class="reason-content">{{ detail.reason || '未填写' }}</div>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="block-title">交通/住宿/行程附件</div>
|
|
|
|
|
|
<el-card class="inner-card" shadow="never">
|
|
|
|
|
|
<file-preview v-model="detail.accessoryApplyIds" />
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 流程状态 -->
|
|
|
|
|
|
<div class="block-title">回执附件</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-card class="inner-card" shadow="never">
|
|
|
|
|
|
<file-preview v-model="detail.accessoryReceiptIds" />
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</BizDetailContainer>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import FilePreview from "@/components/FilePreview/index.vue";
|
|
|
|
|
|
import BizDetailContainer from '@/views/hrm/components/BizDetailContainer/index.vue';
|
2026-04-15 18:32:59 +08:00
|
|
|
|
import { earlyEndTravel } from '@/api/hrm/travel'
|
2026-04-13 17:04:38 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'TravelDetail',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
bizId: { type: [String, Number], default: '' },
|
2026-04-15 16:52:27 +08:00
|
|
|
|
embedded: { type: Boolean, default: false },
|
|
|
|
|
|
preview: { type: Boolean, default: false }
|
2026-04-13 17:04:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
components: {
|
|
|
|
|
|
BizDetailContainer,
|
|
|
|
|
|
FilePreview
|
|
|
|
|
|
},
|
2026-04-15 18:32:59 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
earlyEndLoading: false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-04-13 17:04:38 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
currentBizId () {
|
|
|
|
|
|
return this.bizId || this.$route?.params?.bizId || this.$route?.query?.bizId || this.$route?.params?.id
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
formatDate (val) {
|
|
|
|
|
|
if (!val) return '-'
|
|
|
|
|
|
const d = new Date(val)
|
|
|
|
|
|
const p = n => (n < 10 ? `0${n}` : n)
|
|
|
|
|
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`
|
|
|
|
|
|
},
|
2026-04-22 16:11:43 +08:00
|
|
|
|
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) {
|
2026-04-15 18:32:59 +08:00
|
|
|
|
if (!detail) return false
|
|
|
|
|
|
if (detail.actualEndTime) return false
|
|
|
|
|
|
const status = detail.status
|
2026-04-22 16:11:43 +08:00
|
|
|
|
const endTime = detail.endTime ? new Date(detail.endTime).getTime() : 0
|
|
|
|
|
|
const now = Date.now()
|
|
|
|
|
|
return status === 'approved' && endTime > now
|
2026-04-15 18:32:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handleEarlyEnd() {
|
|
|
|
|
|
this.$confirm('确认提前结束本次出差吗?结束后的实际时间将记录为当前时间。', '提示', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}).then(async () => {
|
|
|
|
|
|
this.earlyEndLoading = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const bizId = this.currentBizId
|
|
|
|
|
|
await earlyEndTravel(bizId)
|
|
|
|
|
|
this.$message.success('提前结束成功')
|
2026-04-22 16:11:43 +08:00
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
|
this.$forceUpdate()
|
2026-04-15 18:32:59 +08:00
|
|
|
|
} catch (error) {
|
|
|
|
|
|
this.$message.error(error.message || '提前结束失败')
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
this.earlyEndLoading = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(() => {})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2026-04-13 17:04:38 +08:00
|
|
|
|
}
|
2026-04-15 18:32:59 +08:00
|
|
|
|
|
2026-04-13 17:04:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.request-page {
|
|
|
|
|
|
padding: 16px 20px 32px;
|
|
|
|
|
|
background: #f8f9fb;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-card {
|
|
|
|
|
|
max-width: 980px;
|
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
border: 1px solid #d7d9df;
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.card-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.block-title {
|
|
|
|
|
|
margin: 12px 0 8px;
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #2f3440;
|
|
|
|
|
|
border-left: 3px solid #9aa3b2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.hint-text {
|
|
|
|
|
|
margin: 6px 0 10px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #8a8f99;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-summary {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
padding: 12px 12px;
|
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
border: 1px solid #e6e8ed;
|
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.summary-title {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.summary-sub {
|
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #8a8f99;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.summary-right {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.summary-item .k {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #8a8f99;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.summary-item .v {
|
|
|
|
|
|
margin-top: 2px;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.inner-card {
|
|
|
|
|
|
border: 1px solid #e6e8ed;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.approver-info {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 24px;
|
|
|
|
|
|
padding: 12px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.approver-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.approver-label {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #8a8f99;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.approver-value {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty {
|
|
|
|
|
|
color: #a0a3ad;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
padding: 10px 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.timeline-row .t-main {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.timeline-row .t-remark {
|
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.btn-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.attachment-list {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.attachment-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 10px 12px;
|
|
|
|
|
|
border: 1px solid #e6e8ed;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
background: #fafbfc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-info {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-icon {
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
color: #9aa3b2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-details {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-name {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-meta {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #8a8f99;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.date-time {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.destination-text {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.cost-text {
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #e6a23c;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.reason-content {
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
background: #f8f9fa;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-section {
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
border: 1px solid #e6e8ed;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
background: #fafbfc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-label {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-label i {
|
|
|
|
|
|
color: #9aa3b2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-content {
|
|
|
|
|
|
min-height: 40px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-text {
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-placeholder {
|
|
|
|
|
|
color: #c0c4cc;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
font-style: italic;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.remark-section {
|
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
|
padding-top: 16px;
|
|
|
|
|
|
border-top: 1px solid #e6e8ed;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.remark-label {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.remark-content {
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
background: #f8f9fa;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-time {
|
|
|
|
|
|
margin-left: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.flow-status {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
border: 1px solid #e6e8ed;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
background: #fafbfc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status-label {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
min-width: 80px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status-value {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
color: #2b2f36;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 1200px) {
|
|
|
|
|
|
.summary-right {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-15 18:32:59 +08:00
|
|
|
|
.action-buttons {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
background: #fdf6ec;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.early-end-info {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
}
|
2026-04-13 17:04:38 +08:00
|
|
|
|
</style>
|