<template>
|
<view class="transport-record">
|
<!-- 统计卡片 -->
|
<view class="stats-card">
|
<view class="stat-item">
|
<text class="count">{{ stats.totalTransports }}</text>
|
<text class="label">总转运单</text>
|
</view>
|
<view class="divider"></view>
|
<view class="stat-item">
|
<text class="count">{{ stats.pendingTransports }}</text>
|
<text class="label">待出发</text>
|
</view>
|
<view class="divider"></view>
|
<view class="stat-item">
|
<text class="count">{{ stats.completedTransports }}</text>
|
<text class="label">已完成</text>
|
</view>
|
</view>
|
|
<!-- 筛选栏 -->
|
<view class="filter-bar">
|
<view class="type-filter">
|
<text
|
v-for="(type, index) in transportTypes"
|
:key="index"
|
:class="{ active: currentType === type.value }"
|
@tap="selectType(type.value)"
|
>{{ type.label }}</text
|
>
|
</view>
|
|
<!-- 时间筛选 -->
|
<view class="date-filter">
|
<picker
|
mode="date"
|
:value="startDate"
|
:end="endDate"
|
@change="onStartDateChange"
|
>
|
<text>{{ startDate || "开始日期" }}</text>
|
</picker>
|
<text class="separator">至</text>
|
<picker
|
mode="date"
|
:value="endDate"
|
:start="startDate"
|
@change="onEndDateChange"
|
>
|
<text>{{ endDate || "结束日期" }}</text>
|
</picker>
|
</view>
|
</view>
|
|
<!-- 转运单列表 -->
|
<scroll-view
|
scroll-y
|
class="transport-list"
|
refresher-enabled
|
:refresher-triggered="refreshing"
|
@refresherrefresh="onRefresh"
|
@scrolltolower="onLoadMore"
|
>
|
<view
|
class="transport-item card"
|
v-for="(item, index) in filteredTransports"
|
:key="index"
|
@tap="viewDetail(item)"
|
>
|
<view class="header">
|
<view class="case-info">
|
<view class="info">
|
<text class="case-no">{{ item.caseNo }}</text>
|
<text class="patient"
|
>{{ item.donorName }} | {{ item.gender }} |
|
{{ item.age }}岁</text
|
>
|
</view>
|
</view>
|
<text class="status" :class="item.status">{{ item.statusText }}</text>
|
</view>
|
|
<view class="detail-info">
|
<view class="info-item">
|
<text class="label">疾病诊断</text>
|
<text class="value">{{ item.diagnosis }}</text>
|
</view>
|
<view class="info-item">
|
<text class="label">所在医疗机构</text>
|
<text class="value">{{ item.hospitalName }}</text>
|
</view>
|
<view class="info-item">
|
<text class="label">计划转运时间</text>
|
<text class="value">{{ item.transportTime }}</text>
|
</view>
|
<view class="info-item">
|
<text class="label">负责协调员</text>
|
<text class="value">{{ item.coordinator }}</text>
|
</view>
|
<view class="info-item">
|
<text class="label">创建时间</text>
|
<text class="value">{{ item.createTime }}</text>
|
</view>
|
</view>
|
|
<view class="footer">
|
<view class="action-info">
|
<text class="label">转运状态</text>
|
<text class="transport-status">{{ item.statusText }}</text>
|
</view>
|
<view class="actions">
|
<button
|
class="action-btn"
|
v-if="item.status === 'pending'"
|
@tap.stop="startTransport(item)"
|
>
|
开始转运
|
</button>
|
<button
|
class="action-btn"
|
v-if="item.status === 'transporting'"
|
@tap.stop="completeTransport(item)"
|
>
|
完成转运
|
</button>
|
<button
|
class="action-btn secondary"
|
@tap.stop="editTransport(item)"
|
>
|
编辑
|
</button>
|
<button class="action-btn secondary" @tap.stop="viewDetails(item)">
|
查看详情
|
</button>
|
</view>
|
</view>
|
</view>
|
|
<!-- 加载更多 -->
|
<view class="load-more" v-if="hasMore">
|
<text>加载中...</text>
|
</view>
|
|
<!-- 空状态 -->
|
<view class="empty-state" v-if="filteredTransports.length === 0">
|
<image src="/static/empty/no-transport.png" mode="aspectFit" />
|
<text>暂无转运单记录</text>
|
</view>
|
</scroll-view>
|
|
<!-- 操作确认弹窗 -->
|
<view class="modal-mask" v-if="showActionModal">
|
<view class="modal-content">
|
<view class="modal-header">
|
<text class="modal-title">{{ modalTitle }}</text>
|
</view>
|
<view class="modal-body">
|
<text
|
>确定要{{ modalAction }}转运单 "{{ currentTransport.caseNo }}"
|
吗?</text
|
>
|
</view>
|
<view class="modal-footer">
|
<button class="modal-btn cancel" @tap="cancelAction">取消</button>
|
<button class="modal-btn confirm" @tap="confirmAction">确认</button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { ref, computed } from "vue";
|
import { onLoad } from "@dcloudio/uni-app";
|
|
// 统计数据
|
const stats = ref({
|
totalTransports: 12,
|
pendingTransports: 4,
|
completedTransports: 6,
|
});
|
const pageNum = ref(1);
|
const pageSize = ref(10);
|
// 操作确认弹窗相关
|
const showActionModal = ref(false);
|
const currentTransport = ref({});
|
const modalTitle = ref("");
|
const modalAction = ref("");
|
|
onLoad(async (options) => {
|
// 初始化数据
|
loadTransports();
|
});
|
|
// 筛选相关
|
const transportTypes = [
|
{ label: "全部", value: "all" },
|
{ label: "待出发", value: "pending" },
|
{ label: "转运中", value: "transporting" },
|
{ label: "已完成", value: "completed" },
|
{ label: "已取消", value: "cancelled" },
|
];
|
const currentType = ref("all");
|
const startDate = ref("");
|
const endDate = ref("");
|
|
// 转运单数据
|
const transports = ref([
|
{
|
id: "T20241217001",
|
caseNo: "DON20241216001",
|
donorName: "张三",
|
gender: "男",
|
age: 38,
|
diagnosis: "脑外伤导致脑死亡",
|
hospitalName: "青岛镜湖医院",
|
transportTime: "2024-12-17 14:30",
|
coordinator: "张医生",
|
createTime: "2024-12-16 09:30",
|
status: "pending",
|
statusText: "待出发",
|
departureLocation: "青岛市立医院急诊科",
|
destinationHospital: "青岛镜湖医院",
|
},
|
{
|
id: "T20241217002",
|
caseNo: "DON20241216002",
|
donorName: "李四",
|
gender: "女",
|
age: 45,
|
diagnosis: "脑梗死",
|
hospitalName: "青岛大学附属医院",
|
transportTime: "2024-12-17 16:00",
|
coordinator: "李医生",
|
createTime: "2024-12-16 11:20",
|
status: "transporting",
|
statusText: "转运中",
|
departureLocation: "青岛大学附属医院ICU",
|
destinationHospital: "青岛器官移植中心",
|
},
|
{
|
id: "T20241216003",
|
caseNo: "DON20241215001",
|
donorName: "王五",
|
gender: "男",
|
age: 52,
|
diagnosis: "心脏骤停",
|
hospitalName: "青岛市立医院",
|
transportTime: "2024-12-16 10:15",
|
coordinator: "王医生",
|
createTime: "2024-12-15 14:45",
|
status: "completed",
|
statusText: "已完成",
|
departureLocation: "青岛市立医院心内科",
|
destinationHospital: "青岛器官移植中心",
|
},
|
{
|
id: "T20241216004",
|
caseNo: "DON20241214001",
|
donorName: "赵六",
|
gender: "女",
|
age: 29,
|
diagnosis: "急性肝衰竭",
|
hospitalName: "青岛科大医院",
|
transportTime: "2024-12-16 08:30",
|
coordinator: "赵医生",
|
createTime: "2024-12-14 16:20",
|
status: "cancelled",
|
statusText: "已取消",
|
departureLocation: "青岛科大医院消化科",
|
destinationHospital: "青岛器官移植中心",
|
},
|
]);
|
|
// 筛选记录
|
const filteredTransports = computed(() => {
|
let result = transports.value;
|
|
// 状态筛选
|
if (currentType.value !== "all") {
|
result = result.filter((item) => item.status === currentType.value);
|
}
|
|
// 日期筛选
|
if (startDate.value && endDate.value) {
|
result = result.filter((item) => {
|
const transportDate = item.createTime.split(" ")[0];
|
return transportDate >= startDate.value && transportDate <= endDate.value;
|
});
|
}
|
|
return result;
|
});
|
|
// 分页相关
|
const hasMore = ref(true);
|
const refreshing = ref(false);
|
|
// 选择类型
|
const selectType = (type) => {
|
currentType.value = type;
|
};
|
|
// 日期选择
|
const onStartDateChange = (e) => {
|
startDate.value = e.detail.value;
|
};
|
|
const onEndDateChange = (e) => {
|
endDate.value = e.detail.value;
|
};
|
|
// 查看详情
|
const viewDetail = (item) => {
|
uni.navigateTo({
|
url: `/pages/transport/detail?id=${item.id}`,
|
});
|
};
|
|
// 开始转运
|
const startTransport = (item) => {
|
currentTransport.value = item;
|
modalTitle.value = "开始转运";
|
modalAction.value = "开始";
|
showActionModal.value = true;
|
};
|
|
// 完成转运
|
const completeTransport = (item) => {
|
currentTransport.value = item;
|
modalTitle.value = "完成转运";
|
modalAction.value = "完成";
|
showActionModal.value = true;
|
};
|
|
// 确认操作
|
const confirmAction = () => {
|
const index = transports.value.findIndex(
|
(item) => item.id === currentTransport.value.id
|
);
|
if (index !== -1) {
|
if (modalAction.value === "开始") {
|
transports.value[index].status = "transporting";
|
transports.value[index].statusText = "转运中";
|
stats.value.pendingTransports -= 1;
|
} else if (modalAction.value === "完成") {
|
transports.value[index].status = "completed";
|
transports.value[index].statusText = "已完成";
|
stats.value.completedTransports += 1;
|
}
|
|
uni.showToast({
|
title: `${modalAction.value}成功`,
|
icon: "success",
|
});
|
}
|
showActionModal.value = false;
|
};
|
|
// 取消操作
|
const cancelAction = () => {
|
showActionModal.value = false;
|
};
|
|
// 查看详情
|
const viewDetails = (item) => {
|
uni.navigateTo({
|
url: `/pages/case/transferinfo?id=${item.id}`,
|
});
|
};
|
|
// 编辑转运单
|
const editTransport = (item) => {
|
uni.navigateTo({
|
url: `/pages/case/transferinfo?id=${item.id}`,
|
});
|
};
|
|
// 下拉刷新
|
const onRefresh = () => {
|
refreshing.value = true;
|
loadTransports();
|
setTimeout(() => {
|
refreshing.value = false;
|
}, 1000);
|
};
|
|
// 加载更多
|
const onLoadMore = () => {
|
if (!hasMore.value) return;
|
loadTransports();
|
};
|
|
// 加载记录
|
const loadTransports = async () => {
|
|
// 这里调用API加载数据
|
setTimeout(() => {
|
hasMore.value = false;
|
}, 1000);
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.transport-record {
|
min-height: 100vh;
|
background: linear-gradient(135deg, #fafdff 0%, #e3f0ff 100%);
|
|
.stats-card {
|
margin: 20rpx;
|
background: linear-gradient(135deg, #0071e3 0%, #2997ff 100%);
|
border-radius: 32rpx;
|
padding: 40rpx 30rpx;
|
display: flex;
|
align-items: center;
|
box-shadow: 0 12px 48px 0 rgba(0, 113, 227, 0.15);
|
|
.stat-item {
|
flex: 1;
|
text-align: center;
|
|
.count {
|
font-size: 40rpx;
|
color: #fff;
|
font-weight: bold;
|
margin-bottom: 8rpx;
|
display: block;
|
}
|
|
.label {
|
font-size: 26rpx;
|
color: rgba(255, 255, 255, 0.9);
|
}
|
}
|
|
.divider {
|
width: 2rpx;
|
height: 60rpx;
|
background: rgba(255, 255, 255, 0.2);
|
}
|
}
|
|
.filter-bar {
|
background: #fff;
|
padding: 30rpx;
|
margin: 0 20rpx 20rpx;
|
border-radius: 24rpx;
|
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
|
|
.type-filter {
|
display: flex;
|
margin-bottom: 30rpx;
|
background: #f8f9fa;
|
border-radius: 16rpx;
|
padding: 8rpx;
|
|
text {
|
flex: 1;
|
text-align: center;
|
font-size: 28rpx;
|
color: #86868b;
|
padding: 16rpx 0;
|
position: relative;
|
white-space: nowrap;
|
transition: all 0.3s ease;
|
|
&.active {
|
color: #0071e3;
|
font-weight: 600;
|
background: #fff;
|
border-radius: 12rpx;
|
box-shadow: 0 2rpx 8rpx rgba(0, 113, 227, 0.15);
|
|
&::after {
|
content: "";
|
position: absolute;
|
left: 50%;
|
bottom: 0;
|
transform: translateX(-50%);
|
width: 40rpx;
|
height: 4rpx;
|
background: #0071e3;
|
border-radius: 2rpx;
|
}
|
}
|
}
|
}
|
|
.date-filter {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
gap: 20rpx;
|
|
picker {
|
flex: 1;
|
|
text {
|
display: block;
|
text-align: center;
|
font-size: 26rpx;
|
color: #515154;
|
padding: 20rpx;
|
background: #f8f9fa;
|
border-radius: 16rpx;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
transition: all 0.3s ease;
|
|
&:active {
|
background: #e9ecef;
|
}
|
}
|
}
|
|
.separator {
|
padding: 0 10rpx;
|
font-size: 26rpx;
|
color: #86868b;
|
min-width: 40rpx;
|
text-align: center;
|
}
|
}
|
}
|
|
.transport-list {
|
height: calc(100vh - 400rpx);
|
// padding: 0 20rpx;
|
|
.transport-item {
|
margin: 20rpx;
|
background: linear-gradient(135deg, #fff 60%, #f5f6fa 100%);
|
border-radius: 32rpx;
|
padding: 40rpx 30rpx;
|
margin-bottom: 24rpx;
|
box-shadow: 0 12px 48px 0 rgba(0, 113, 227, 0.1);
|
border: 1.5px solid #e5eaf0;
|
transition: all 0.3s ease;
|
|
&:active {
|
transform: translateY(-2rpx);
|
box-shadow: 0 16px 56px 0 rgba(0, 113, 227, 0.15);
|
}
|
|
.header {
|
display: flex;
|
justify-content: space-between;
|
align-items: flex-start;
|
margin-bottom: 30rpx;
|
|
.case-info {
|
.info {
|
.case-no {
|
font-size: 28rpx;
|
font-weight: 600;
|
color: #0071e3;
|
margin-bottom: 8rpx;
|
display: block;
|
}
|
|
.patient {
|
font-size: 26rpx;
|
color: #515154;
|
font-weight: 500;
|
}
|
}
|
}
|
|
.status {
|
font-size: 22rpx;
|
padding: 8rpx 20rpx;
|
border-radius: 20rpx;
|
font-weight: 500;
|
|
&.pending {
|
color: #ff9500;
|
background: rgba(255, 149, 0, 0.1);
|
}
|
|
&.transporting {
|
color: #007aff;
|
background: rgba(0, 122, 255, 0.1);
|
}
|
|
&.completed {
|
color: #34c759;
|
background: rgba(52, 199, 89, 0.1);
|
}
|
|
&.cancelled {
|
color: #ff3b30;
|
background: rgba(255, 59, 48, 0.1);
|
}
|
}
|
}
|
|
.detail-info {
|
padding: 30rpx 0;
|
border-top: 1.5px solid #f0f0f0;
|
border-bottom: 1.5px solid #f0f0f0;
|
|
.info-item {
|
display: flex;
|
justify-content: space-between;
|
margin-bottom: 20rpx;
|
align-items: flex-start;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
|
.label {
|
font-size: 26rpx;
|
color: #86868b;
|
min-width: 160rpx;
|
}
|
|
.value {
|
font-size: 26rpx;
|
color: #1d1d1f;
|
flex: 1;
|
text-align: right;
|
font-weight: 500;
|
line-height: 1.4;
|
}
|
}
|
}
|
|
.footer {
|
padding-top: 30rpx;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
|
.action-info {
|
.label {
|
font-size: 26rpx;
|
color: #86868b;
|
margin-right: 12rpx;
|
}
|
|
.transport-status {
|
font-size: 28rpx;
|
color: #0071e3;
|
font-weight: 600;
|
}
|
}
|
|
.actions {
|
display: flex;
|
gap: 16rpx;
|
|
.action-btn {
|
height: 60rpx;
|
line-height: 60rpx;
|
padding: 0 24rpx;
|
font-size: 24rpx;
|
color: #0071e3;
|
background: rgba(0, 113, 227, 0.1);
|
border-radius: 30rpx;
|
font-weight: 500;
|
transition: all 0.3s ease;
|
|
&.secondary {
|
color: #515154;
|
background: #f5f5f7;
|
}
|
|
&:active {
|
transform: scale(0.95);
|
}
|
}
|
}
|
}
|
}
|
|
.empty-state {
|
padding: 120rpx 0;
|
text-align: center;
|
|
image {
|
width: 240rpx;
|
height: 240rpx;
|
margin-bottom: 30rpx;
|
opacity: 0.6;
|
}
|
|
text {
|
font-size: 28rpx;
|
color: #86868b;
|
}
|
}
|
}
|
|
/* 操作确认弹窗样式 */
|
.modal-mask {
|
position: fixed;
|
top: 0;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
background: rgba(0, 0, 0, 0.5);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
z-index: 1000;
|
}
|
|
.modal-content {
|
background: #fff;
|
border-radius: 32rpx;
|
width: 600rpx;
|
overflow: hidden;
|
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.2);
|
}
|
|
.modal-header {
|
padding: 40rpx 40rpx 20rpx;
|
text-align: center;
|
}
|
|
.modal-title {
|
font-size: 32rpx;
|
font-weight: 600;
|
color: #1d1d1f;
|
}
|
|
.modal-body {
|
padding: 20rpx 40rpx 40rpx;
|
text-align: center;
|
font-size: 28rpx;
|
color: #515154;
|
line-height: 1.6;
|
}
|
|
.modal-footer {
|
display: flex;
|
border-top: 1.5px solid #f0f0f0;
|
}
|
|
.modal-btn {
|
flex: 1;
|
height: 88rpx;
|
line-height: 88rpx;
|
font-size: 28rpx;
|
border: none;
|
border-radius: 0;
|
background: transparent;
|
transition: all 0.3s ease;
|
|
&.cancel {
|
color: #515154;
|
border-right: 1.5px solid #f0f0f0;
|
|
&:active {
|
background: #f8f9fa;
|
}
|
}
|
|
&.confirm {
|
color: #0071e3;
|
font-weight: 600;
|
|
&:active {
|
background: #f0f7ff;
|
}
|
}
|
}
|
}
|
</style>
|