SmartParks_uniapp/pages/sys/workbench/oa/oaDetail.vue

493 lines
10 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="detail-container">
<!-- 顶部导航栏 -->
<view class="detail-navbar">
<image src="/static/ic_back_white.webp" class="detail-back" @click="goBack" />
<view class="detail-right">
<image src="/static/ic_share_w.png" class="detail-scan" />
</view>
</view>
<!-- 卡片容器 -->
<view class="card-wrapper">
<!-- 请假信息卡片 -->
<view class="detail-card">
<!-- 请假状态 -->
<view class="leave-header">
<view class="leave-type">请假</view>
<view class="leave-status">已通过</view>
</view>
<!-- 申请人信息 -->
<view class="applicant-info">
<view class="applicant-avatar" style="background-color: #4B7BF5;"></view>
<view class="applicant-detail">
<text class="applicant-name">余永乐</text>
<text class="applicant-dept">数据开发及研发部</text>
</view>
</view>
<!-- 提交时间 -->
<view class="submit-time">提交时间7月16日 18:36:44</view>
</view>
</view>
<!-- 其他卡片保持原结构 -->
<view class="detail-card">
<view class="detail-title">申批详情</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">假期类型</text>
<text class="detail-value-vertical">病假</text>
</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">开始时间</text>
<text class="detail-value-vertical">2025-07-15</text>
</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">结束时间</text>
<text class="detail-value-vertical">2025-07-17</text>
</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">时长</text>
<text class="detail-value-vertical">2</text>
</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">请假事由</text>
<text class="detail-value-vertical">由于腿儿过大需要到医院进行检查</text>
</view>
<view class="detail-item-vertical">
<text class="detail-label-vertical">附件</text>
<view class="attachment">
<view class="attachment-preview">
<image src="/static/ic_attachment_preview.png" class="attachment-img" />
</view>
<view class="attachment-info">
<text class="attachment-name">174568963.jpg</text>
<text class="attachment-size">289.14 KB</text>
</view>
</view>
</view>
</view>
<!-- 审批记录卡片保持原结构 -->
<view class="detail-card">
<view class="detail-title">申批记录</view>
<view class="approval-item">
<view class="approval-status">
<view class="status-dot selected"></view>
<view class="status-line" v-if="true"></view>
</view>
<view class="approval-content">
<view class="approval-type">提交</view>
<view class="approver-info">
<view class="approver-avatar" style="background-color: #4B7BF5;"></view>
<text class="approver-name">余永乐</text>
<text class="approval-result">已提交</text>
</view>
<text class="approval-time">07-12 18:28:22</text>
</view>
</view>
<view class="approval-item">
<view class="approval-status">
<view class="status-dot selected"></view>
<view class="status-line" v-if="true"></view>
</view>
<view class="approval-content">
<view class="approval-type">审批</view>
<view class="approver-info">
<view class="approver-avatar" style="background-color: #F3831F;"></view>
<text class="approver-name">张桂花</text>
<text class="approval-result">已同意</text>
</view>
<text class="approval-time">07-12 18:28:22</text>
</view>
</view>
<view class="approval-item">
<view class="approval-status">
<view class="status-dot selected"></view>
<view class="status-line" v-if="false"></view>
</view>
<view class="approval-content">
<view class="approval-type">审批</view>
<view class="approver-info">
<view class="approver-avatar" style="background-color: #F3831F;"></view>
<text class="approver-name">张桂花</text>
<text class="approval-result">已批准</text>
</view>
<text class="approval-time">07-12 18:28:22</text>
</view>
</view>
<view class="approval-item">
<view class="approval-status">
<view class="status-dot"></view>
</view>
<view class="approval-content">
<view class="approval-type">结束</view>
<text class="approval-time">07-12 18:28:22</text>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* OA申批详情页面
* @author lyc
*/
export default {
data() {
return {
// 详情数据
detailData: {
type: '请假',
status: '已通过',
leaveType: '病假',
applicant: {
name: '余永乐',
dept: '数据开发及研发部',
avatarText: '余',
avatarColor: '#4B7BF5'
},
submitTime: '7月16日 18:36:44',
startTime: '2025-07-15',
endTime: '2025-07-17',
duration: '2天',
reason: '由于腿儿过大,需要到医院进行检查',
attachment: {
name: '174568963.jpg',
size: '289.14 KB'
},
approvalRecords: [
{
type: '提交',
approver: {
name: '余永乐',
avatarText: '余',
avatarColor: '#4B7BF5'
},
result: '已提交',
time: '07-12 18:28:22'
},
{
type: '审批',
approver: {
name: '张桂花',
avatarText: '张',
avatarColor: '#F3831F'
},
result: '已同意',
time: '07-12 18:28:22'
},
{
type: '审批',
approver: {
name: '张桂花',
avatarText: '张',
avatarColor: '#F3831F'
},
result: '已批准',
time: '07-12 18:28:22'
},
{
type: '结束',
time: '07-12 18:28:22'
}
]
}
}
},
methods: {
// 返回上一页
goBack() {
uni.navigateBack();
}
}
}
</script>
<style scoped>
.detail-container {
background-color: #f7f7f7;
min-height: 100vh;
padding-bottom: 30rpx;
}
/* 导航栏样式 */
.detail-navbar {
width: 100%;
height: 372rpx;
margin-bottom: -180rpx; /* 减少负边距避免过度覆盖 */
display: flex;
justify-content: space-between;
position: relative;
background: linear-gradient(180deg, #0A60ED 0%, #FFFFFF 100%);
}
.detail-back {
margin-left: 37rpx;
width: 15rpx;
height: 33rpx;
}
.detail-right {
margin-right: 37rpx;
}
.detail-scan {
width: 36rpx;
height: 35rpx;
}
/* 卡片通用样式 */
.detail-card {
z-index: 20; /* 提高层级确保显示在导航栏之上 */
background-color: #fff;
margin: 20rpx 30rpx;
border-radius: 16rpx;
padding: 30rpx;
border: 1px dashed #ddd;
}
/* 请假信息卡片 */
.leave-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.leave-type {
font-weight: 600;
font-size: 26rpx;
padding: 10rpx 20rpx;
border-radius: 8rpx;
color: #2186FF;
background: rgba(33, 134, 255, 0.1);
border: 1px solid #2186FF;
display: inline-block;
}
.leave-status {
font-size: 26rpx;
padding: 6rpx 20rpx;
border-radius: 8rpx;
color: #07C78E;
background-color: rgba(7, 199, 142, 0.1);
border: 1px solid #07C78E;
display: inline-block;
}
.applicant-info {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.applicant-avatar {
width: 60rpx;
height: 60rpx;
border-radius: 30rpx;
background-color: #4B7BF5;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
margin-right: 20rpx;
}
.applicant-detail {
display: flex;
flex-direction: column;
}
.applicant-name {
font-size: 28rpx;
color: #333;
font-weight: 500;
margin-bottom: 6rpx;
}
.applicant-dept {
font-size: 24rpx;
color: #666;
}
.submit-time {
font-size: 24rpx;
color: #999;
}
/* 申批详情 */
.detail-title {
font-size: 30rpx;
color: #333;
font-weight: bold;
margin-bottom: 30rpx;
}
.detail-item {
display: flex;
margin-bottom: 20rpx;
}
.detail-label {
width: 150rpx;
font-size: 26rpx;
color: #666;
}
.detail-value {
flex: 1;
font-size: 26rpx;
color: #333;
}
/* 垂直布局的申批详情 */
.detail-item-vertical {
display: flex;
flex-direction: column;
margin-bottom: 20rpx;
}
.detail-label-vertical {
font-size: 26rpx;
color: #666;
margin-bottom: 10rpx;
}
.detail-value-vertical {
font-size: 26rpx;
color: #333;
margin-bottom: 10rpx;
}
/* 附件样式 */
.attachment {
display: flex;
align-items: center;
}
.attachment-preview {
width: 80rpx;
height: 80rpx;
background-color: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
border-radius: 8rpx;
overflow: hidden;
}
.attachment-img {
width: 80rpx;
height: 80rpx;
}
.attachment-info {
display: flex;
flex-direction: column;
}
.attachment-name {
font-size: 26rpx;
color: #333;
margin-bottom: 6rpx;
}
.attachment-size {
font-size: 22rpx;
color: #999;
}
/* 审批记录 */
.approval-item {
display: flex;
margin-bottom: 30rpx;
}
.approval-status {
width: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 20rpx;
}
.status-dot {
width: 20rpx;
height: 20rpx;
border-radius: 10rpx;
border: 1px solid #ddd;
background-color: #fff;
margin-bottom: 10rpx;
}
.status-dot.selected {
background-color: #2186FF;
border-color: #2186FF;
}
.status-line {
width: 2rpx;
flex: 1;
background-color: #ddd;
}
.approval-content {
flex: 1;
}
.approval-type {
font-size: 26rpx;
color: #333;
margin-bottom: 10rpx;
}
.approver-info {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.approver-avatar {
width: 40rpx;
height: 40rpx;
border-radius: 20rpx;
background-color: #4B7BF5;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
margin-right: 10rpx;
}
.approver-name {
font-size: 26rpx;
color: #333;
margin-right: 20rpx;
}
.approval-result {
font-size: 24rpx;
color: #07C78E;
}
.approval-time {
font-size: 24rpx;
color: #999;
}
</style>