解决合并冲突

This commit is contained in:
2025-12-10 14:20:24 +08:00
parent e1385cb3e6
commit 18f6a845e6
804 changed files with 61881 additions and 13577 deletions

View File

@@ -0,0 +1,510 @@
<template>
<el-dialog v-model="dialogVisible" title="补费" width="90%" :close-on-click-modal="false">
<!-- 弹窗内容 - 左右布局 -->
<div style="display: flex; gap: 20px; height: 70vh">
<!-- 左侧收费组套列表 - 卡片式布局 -->
<div
style="
width: 250px;
border: 1px solid #e4e7ed;
border-radius: 4px;
display: flex;
flex-direction: column;
"
>
<!-- 搜索框 -->
<div style="padding: 10px; border-bottom: 1px solid #e4e7ed">
<el-input v-model="groupSearchText" placeholder="输入组套名称" clearable />
</div>
<!-- 收费组套列表 - 卡片式布局 -->
<div style="flex: 1; overflow-y: auto; padding: 10px">
<div
v-for="group in chargeGroups"
:key="group.id"
class="group-card"
@click="selectChargeGroup(group)"
>
<div class="group-status">
<span class="status-dot"></span>
{{ getGroupType(group.name) }}
</div>
<div class="group-name">{{ group.name }}</div>
<div class="group-info">
{{ getGroupInfo(group.id) }}
</div>
</div>
<!-- 只显示暂无数据文本 -->
<div
v-if="chargeGroups.length === 0"
style="text-align: center; color: #909399; padding: 20px"
>
暂无数据
</div>
</div>
</div>
<!-- 右侧费用项目和信息 -->
<div style="flex: 1; display: flex; flex-direction: column">
<!-- 费用项目表格 -->
<el-table :data="feeItemsList" border style="width: 100%; flex: 1">
<el-table-column label="收费项目" prop="itemName" min-width="200">
<template #default="scope">
<el-input
v-model="scope.row.itemName"
placeholder="请输入收费项目"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="单价" prop="unitPrice" width="100" align="center">
<template #default="scope">
<el-input-number
v-model="scope.row.unitPrice"
:min="0"
:step="0.01"
precision="2"
style="width: 100px"
@change="calculateTotalAmount"
/>
</template>
</el-table-column>
<el-table-column label="计费数量" prop="quantity" width="100" align="center">
<template #default="scope">
<el-input-number
v-model="scope.row.quantity"
:min="1"
:step="1"
style="width: 100px"
@change="calculateTotalAmount"
/>
</template>
</el-table-column>
<el-table-column label="金额" prop="amount" width="100" align="center" />
<el-table-column label="医保类型" prop="insuranceType" width="100" align="center">
<template #default="scope">
<el-input
v-model="scope.row.insuranceType"
placeholder="医保类型"
style="width: 100px"
/>
</template>
</el-table-column>
<el-table-column label="特限符合" prop="special" width="100" align="center">
<template #default="scope">
<el-switch v-model="scope.row.special" />
</template>
</el-table-column>
</el-table>
<!-- 添加项目按钮 - 移到右侧费用项目表格下方 -->
<div
style="
margin-top: 10px;
padding: 15px;
border: 1px dashed #dcdfe6;
border-radius: 4px;
text-align: center;
cursor: pointer;
color: #409eff;
transition: all 0.3s;
"
@click="addEmptyItem"
>
+ 添加项目
</div>
<!-- 底部信息区域 -->
<div style="margin-top: 20px; display: flex; flex-wrap: wrap; gap: 15px">
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">执行时间</span>
<el-date-picker
v-model="executeTime"
type="datetime"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择日期时间"
style="width: 200px"
/>
</div>
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">执行科室</span>
<el-select v-model="selectedDept" placeholder="选择科室" style="width: 150px">
<el-option
v-for="dept in departmentOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
/>
</el-select>
</div>
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">开方医生</span>
<el-select v-model="selectedDoctor" placeholder="选择医生" style="width: 150px">
<el-option label="内科医生" value="doctor1" />
<el-option label="外科医生" value="doctor2" />
<el-option label="儿科医生" value="doctor3" />
</el-select>
</div>
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">执行人</span>
<el-select v-model="executor" placeholder="选择执行人" style="width: 150px">
<el-option label="系统管理员" value="admin" />
<el-option label="护士甲" value="nurse1" />
<el-option label="护士乙" value="nurse2" />
</el-select>
</div>
</div>
<!-- 总金额和操作按钮 -->
<div
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<div style="font-size: 14px; font-weight: bold; text-align: right">
本次补费总金额<span style="color: #ff4d4f">{{ totalAmount.toFixed(2) }}</span>
</div>
<div>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</div>
</div>
</div>
</el-dialog>
</template>
<script setup>
import { ref, computed, onMounted, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { formatDateStr } from '@/utils/index';
// Props定义
const props = defineProps({
visible: {
type: Boolean,
default: false,
},
initialData: {
type: Array,
default: () => [],
},
patientInfo: {
type: String,
default: '',
},
});
// Emits定义
const emit = defineEmits(['update:visible', 'confirm', 'cancel']);
// 响应式数据
const dialogVisible = computed({
get: () => props.visible,
set: (value) => emit('update:visible', value),
});
const searchItemText = ref('');
const selectedItemName = ref('');
const feeTabs = ref('chargeItems');
const feeItemsList = ref([]);
const executeTime = ref('');
const selectedDept = ref('');
const selectedDoctor = ref('');
const executor = ref('');
const departmentOptions = ref([]);
// 收费组套相关数据
const chargeGroups = ref([]);
const groupSearchText = ref('');
// 计算总金额
const totalAmount = computed(() => {
return feeItemsList.value.reduce((sum, item) => {
return sum + (item.unitPrice || 0) * (item.quantity || 0);
}, 0);
});
// 初始化
onMounted(() => {
// 加载科室选项
loadDepartmentOptions();
// 加载收费组套数据
loadChargeGroups();
});
// 监听初始数据变化
watch(
() => props.initialData,
(newData) => {
if (newData && newData.length > 0) {
initFeeDialogData(newData);
}
},
{ deep: true }
);
// 监听弹窗显示状态
watch(
() => props.visible,
(visible) => {
if (visible) {
// 设置默认执行时间为当前时间
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
} else {
// 弹窗关闭时重置数据
resetData();
}
}
);
// 加载科室选项
function loadDepartmentOptions() {
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
{ label: '外科', value: 'surgery' },
{ label: '儿科', value: 'pediatrics' },
{ label: '妇产科', value: 'obstetrics' },
{ label: '其他科室', value: 'others' },
];
}
// 加载收费组套数据
function loadChargeGroups() {
// 模拟收费组套数据
chargeGroups.value = [
{ id: '1', name: '血常规检查组套' },
{ id: '2', name: '生化检查组套' },
{ id: '3', name: '心电图检查组套' },
{ id: '4', name: 'CT检查组套' },
{ id: '5', name: '输液治疗组套' },
];
}
// 获取组套类型
function getGroupType(name) {
if (name.includes('检查')) return '检查';
if (name.includes('治疗')) return '治疗';
return '常规';
}
// 获取组套信息
function getGroupInfo(id) {
const infoMap = {
1: '检验科/基础检查',
2: '检验科/生化项目',
3: '心电图室/常规检查',
4: '影像科/影像学检查',
5: '内科/治疗项目',
};
return infoMap[id] || '标准收费项目';
}
// 初始化费用数据
function initFeeDialogData(selectedRows) {
// 将选中的项目转换为弹窗中的费用项目格式
feeItemsList.value = selectedRows.map((row) => ({
itemName: row.chargeItem,
unitPrice: row.unitPrice,
quantity: row.quantity,
amount: row.unitPrice * row.quantity,
dept: '内科',
special: false,
insuranceType: '',
}));
}
// 选择收费组套
function selectChargeGroup(group) {
// 模拟根据选中的组套添加对应的费用项目
const groupItems = {
1: [
{
itemName: '红细胞计数',
unitPrice: 15.0,
quantity: 1,
dept: '检验科',
special: false,
insuranceType: '甲类',
},
],
2: [
{
itemName: '肝功能检查',
unitPrice: 80.0,
quantity: 1,
dept: '检验科',
special: false,
insuranceType: '甲类',
},
],
3: [
{
itemName: '心电图检查',
unitPrice: 45.0,
quantity: 1,
dept: '心电图室',
special: false,
insuranceType: '甲类',
},
],
4: [
{
itemName: 'CT扫描',
unitPrice: 300.0,
quantity: 1,
dept: '影像科',
special: false,
insuranceType: '乙类',
},
],
5: [
{
itemName: '静脉输液',
unitPrice: 20.0,
quantity: 1,
dept: '内科',
special: false,
insuranceType: '甲类',
},
],
};
const items = groupItems[group.id] || [];
// 计算金额
items.forEach((item) => {
item.amount = item.unitPrice * item.quantity;
});
// 添加到费用项目列表
feeItemsList.value = [...feeItemsList.value, ...items];
}
// 添加空白项目
function addEmptyItem() {
const newItem = {
itemName: '', // 空白项目名称
unitPrice: 0, // 默认单价为0
quantity: 1, // 默认数量为1
amount: 0, // 默认金额为0
dept: '内科', // 默认科室
special: false, // 默认特限不符合
insuranceType: '', // 空白医保类型
};
// 添加到费用项目列表
feeItemsList.value.push(newItem);
// 显示提示信息
ElMessage.success('已添加空白项目,请填写相关信息');
}
// 计算总金额(当数量变化时调用)
function calculateTotalAmount() {
// 更新每个项目的金额
feeItemsList.value.forEach((item) => {
item.amount = (item.unitPrice || 0) * (item.quantity || 0);
});
}
// 取消操作
function handleCancel() {
emit('cancel');
dialogVisible.value = false;
}
// 确认操作
function handleConfirm() {
// 构建提交数据
const submitData = {
feeItems: feeItemsList.value,
executeTime: executeTime.value,
department: selectedDept.value,
doctor: selectedDoctor.value,
executor: executor.value,
totalAmount: totalAmount.value,
};
// 发送确认事件
emit('confirm', submitData);
dialogVisible.value = false;
}
// 重置数据
function resetData() {
feeItemsList.value = [];
executeTime.value = '';
selectedDept.value = '';
selectedDoctor.value = '';
executor.value = '';
}
</script>
<style scoped>
:deep(.el-dialog__body) {
padding: 20px;
}
/* 添加项目按钮样式 */
:deep(
.el-dialog div[style*='flex: 1; display: flex; flex-direction: column'] > div:nth-child(2):hover
) {
background-color: #ecf5ff;
}
/* 收费组套卡片样式 */
.group-card {
background: #ffffff;
border: 1px solid #e4e7ed;
border-radius: 6px;
padding: 12px;
margin-bottom: 12px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.group-card:hover {
border-color: #409eff;
background-color: #ecf5ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
}
.group-status {
display: flex;
align-items: center;
margin-bottom: 8px;
font-size: 14px;
font-weight: 500;
color: #606266;
}
.status-dot {
width: 8px;
height: 8px;
background-color: #67c23a;
border-radius: 50%;
margin-right: 6px;
}
.group-name {
font-size: 16px;
font-weight: 600;
color: #303133;
margin-bottom: 8px;
word-break: break-word;
}
.group-info {
font-size: 12px;
color: #909399;
border-top: 1px dashed #ebeef5;
padding-top: 8px;
margin-top: 4px;
}
</style>

View File

@@ -0,0 +1,528 @@
<template>
<div style="height: calc(100vh - 126px)">
<!-- 操作工具栏 -->
<!-- 主内容区域 - 左右布局 -->
<div style="display: flex; height: calc(100% - 51px)">
<!-- 左侧医嘱列表 -->
<div style="width: 50%; border-right: 1px solid #e4e7ed; overflow-y: auto">
<!--筛选条件 -->
<div style="display: flex; align-items: center; gap: 10px; padding: 10px 0 0 10px">
<!-- 医嘱类型tabs -->
<el-tabs
v-model="orderType"
type="card"
class="date-tabs"
@tab-click="handleOrderTypeClick"
style="width: auto; margin-right: 0"
>
<el-tab-pane label="全部" name="all"></el-tab-pane>
<el-tab-pane label="长期" name="long"></el-tab-pane>
<el-tab-pane label="临时" name="temp"></el-tab-pane>
</el-tabs>
<!-- 医嘱类型选择 -->
<el-form-item label="医嘱类型:" style="margin-bottom: 0">
<el-select
v-model="specificOrderType"
placeholder="医嘱类型"
clearable
style="width: 120px"
>
<el-option label="请选择" value="" />
<el-option
v-for="type in orderTypeOptions"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
</el-form-item>
<!-- 显示有效勾选框 -->
<el-checkbox v-model="showValid">显示有效</el-checkbox>
</div>
<div style="display: flex; align-items: center; gap: 10px; padding: 10px">
<el-form-item label="开方科室:" style="margin-bottom: 0">
<el-select
v-model="prescribeDept"
placeholder="开方科室"
clearable
style="width: 120px"
>
<el-option label="请选择" value="" />
<el-option
v-for="type in departmentOptions"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
</el-form-item>
<el-form-item label="执行科室:" style="margin-bottom: 0">
<el-select
v-model="execDepartment"
placeholder="执行科室"
clearable
style="width: 120px"
>
<el-option label="请选择" value="" />
<el-option
v-for="type in departmentOptions"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
<button class="reset-btn" @click="resetExecDepartment" title="重置">
<el-icon><Refresh /></el-icon>
</button>
</el-form-item>
<!-- 执行科室选择 -->
</div>
<!-- 非医嘱计费 -->
<div
style="margin: 10px 0; border: 1px solid #e4e7ed; border-radius: 4px; overflow: hidden"
>
<div style="background-color: #f5f7fa; padding: 8px 12px; font-weight: bold">
非医嘱计费
</div>
<table
style="
width: 100%;
border-collapse: collapse;
border: 1px solid #e4e7ed;
border-top: none;
"
>
<tbody>
<tr style="border-bottom: 1px solid #e4e7ed">
<td style="padding: 10px; width: 100px">床位计费</td>
<td style="padding: 10px; text-align: right">
住院天数{{ hospitalDays }} / 计费数量{{ billingQuantity }}
</td>
</tr>
<tr>
<td style="padding: 10px; width: 100px">其他</td>
<td style="padding: 10px; text-align: right">总费用{{ totalCost.toFixed(2) }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 医嘱表格 -->
<div v-loading="loading">
<el-table
ref="orderTableRef"
:data="orderList"
border
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa !important' }"
>
<!-- <el-table-column type="selection" align="center" width="50" /> -->
<el-table-column label="类型" prop="type" width="80" align="center" />
<el-table-column label="医嘱内容" prop="content" />
<el-table-column label="预计执行" prop="unit" width="100" align="center" />
<el-table-column label="开始/停止" prop="period" width="180" align="center">
<template #default="scope">
{{ scope.row.startDate }}<br />
{{ scope.row.endDate || '未停止' }}
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 右侧费用列表 -->
<div style="width: 50%; overflow-y: auto">
<div
style="
height: 51px;
border-bottom: 2px solid #e4e7ed;
display: flex;
align-items: center;
padding: 0 15px;
"
>
<div style="display: flex; align-items: center; gap: 10px">
<el-tabs
v-model="orderType"
type="card"
class="date-tabs"
@tab-click="handleOrderTypeClick"
style="width: auto; margin-right: 0"
>
<el-tab-pane label="费用明细" name="all"></el-tab-pane>
<el-tab-pane label="按天汇总" name="long"></el-tab-pane>
</el-tabs>
</div>
<div style="display: flex; align-items: center; gap: 10px; margin-left: 10px">
<!-- 项目选择 -->
<el-form-item label="项目:" style="margin-bottom: 0">
<el-select
v-model="selectedProject"
placeholder="项目"
clearable
style="width: 120px"
>
<el-option label="请选择" value="" />
<el-option
v-for="project in projectOptions"
:key="project.value"
:label="project.label"
:value="project.value"
/>
</el-select>
</el-form-item>
<!-- 显示静脉勾选框 -->
<el-checkbox v-model="showVenous">显示静脉</el-checkbox>
<!-- 补费按钮 -->
<el-button type="primary">补费</el-button>
</div>
</div>
<div v-loading="loading">
<el-table
ref="feeTableRef"
:data="feeList"
border
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa !important' }"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="收费项目" prop="itemName" min-width="180" />
<el-table-column label="单价" prop="unitPrice" width="100" align="center" />
<el-table-column label="使用数量" prop="quantity" width="100" align="center" />
<el-table-column label="金额" prop="amount" width="100" align="center" />
<el-table-column label="退费审核" width="80" align="center">
<template #default="scope">
<el-button type="text" style="color: #409eff">退费申请</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { formatDateStr } from '@/utils/index';
// 响应式数据
const loading = ref(false);
const orderList = ref([]); // 医嘱列表
const feeList = ref([]); // 费用列表
const hospitalDays = ref(0); // 住院天数
const billingQuantity = ref(0); // 计费数量
const totalCost = ref(0.0); // 总费用
const execDepartment = ref('');
const orderType = ref('all'); // all, long, temp
const specificOrderType = ref('');
const showValid = ref(true);
const prescribeDept = ref('');
const selectedProject = ref('');
const showVenous = ref(false);
const departmentOptions = ref([]);
const orderTypeOptions = ref([]);
const projectOptions = ref([]);
const orderTableRef = ref(null);
const feeTableRef = ref(null);
// 初始化
onMounted(() => {
// 加载选项数据
loadOptions();
// 加载初始数据
handleQuery();
// 生成模拟床位计费数据
generateBedBillingData();
});
// 加载选项数据
function loadOptions() {
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
{ label: '外科', value: 'surgery' },
{ label: '儿科', value: 'pediatrics' },
{ label: '妇产科', value: 'obstetrics' },
{ label: '其他科室', value: 'others' },
];
// 模拟医嘱类型数据
orderTypeOptions.value = [
{ label: '药品', value: 'drug' },
{ label: '检查', value: 'check' },
{ label: '检验', value: 'test' },
{ label: '治疗', value: 'treatment' },
];
// 模拟项目数据
projectOptions.value = [
{ label: '药品', value: 'drug' },
{ label: '检查', value: 'check' },
{ label: '检验', value: 'test' },
{ label: '治疗', value: 'treatment' },
];
}
// 处理医嘱类型切换
function handleOrderTypeClick(tab) {
orderType.value = tab.paneName;
// 只更新医嘱列表,不影响费用列表
orderList.value = filterOrderList();
}
// 生成模拟床位计费数据
function generateBedBillingData() {
// 模拟从接口获取的数据
// 住院天数随机生成1-30天
hospitalDays.value = Math.floor(Math.random() * 30) + 1;
// 计费数量根据住院天数生成
billingQuantity.value = Math.ceil(hospitalDays.value / 7);
// 总费用根据计费数量计算
totalCost.value = billingQuantity.value * 200; // 假设每部分费用200元
}
// 生成模拟医嘱数据
function generateMockOrderData() {
return [
{
type: '长期',
content: '维生素C片【0.1g*100片/瓶】(住院西药房)',
unit: '0.1g(1片)',
startDate: '2025-07-01',
endDate: '',
id: '1',
},
{
type: '长期',
content: '盐酸地芬尼多片【25mg*30片】(住院西药房)',
unit: '25mg(1片)',
startDate: '2025-07-01',
endDate: '',
id: '2',
},
{
type: '长期',
content: '注射用头孢他啶【0.5g/瓶】(住院西药房)',
unit: '0.5g(1瓶)',
startDate: '2025-07-01',
endDate: '',
id: '3',
},
{
type: '长期',
content: '静脉注射2.0分/每日一次(9点)',
unit: '',
startDate: '2025-07-01',
endDate: '',
id: '4',
},
{
type: '长期',
content: '注射用苄星青霉素(基)【120万单位/瓶*10瓶/盒】(住院西药房)',
unit: '120万u/1瓶',
startDate: '2025-07-01',
endDate: '',
id: '5',
},
{
type: '长期',
content: '维生素K1注射液(国基)【10mg*1ml*10支/盒】(住院西药房)',
unit: '10mg/1支',
startDate: '2025-07-01',
endDate: '',
id: '6',
},
{
type: '护理',
content: '护理级别III级护理',
unit: '',
startDate: '2025-07-01',
endDate: '',
id: '7',
},
{
type: '长期',
content: '病情:病重',
unit: '',
startDate: '2025-07-01',
endDate: '',
id: '8',
},
];
}
// 生成模拟费用数据
function generateMockFeeData() {
return [
{
itemName: '盐酸地芬尼多片',
unitPrice: 20.3,
quantity: 5,
amount: 3.4,
id: '1',
},
{
itemName: '维生素C片',
unitPrice: 12,
quantity: 5,
amount: 0.6,
id: '2',
},
{
itemName: '盐酸地芬尼多片',
unitPrice: 20.3,
quantity: 1,
amount: 0.68,
id: '3',
},
];
}
// 重置执行科室
function resetExecDepartment() {
execDepartment.value = '';
}
// 处理医嘱列表筛选
function filterOrderList() {
let filteredOrders = generateMockOrderData();
// 应用红色框内的筛选条件(医嘱列表专用)
if (orderType.value === 'long') {
filteredOrders = filteredOrders.filter((item) => item.type === '长期');
} else if (orderType.value === 'temp') {
filteredOrders = filteredOrders.filter((item) => item.type === '临时');
}
// 执行科室筛选
if (execDepartment.value) {
// 这里可以根据实际业务逻辑进行筛选
}
// 医嘱类型筛选
if (specificOrderType.value) {
// 这里可以根据实际业务逻辑进行筛选
}
// 显示有效筛选
if (showValid.value) {
// 这里可以根据实际业务逻辑进行筛选
}
// 开方科室筛选
if (prescribeDept.value) {
// 这里可以根据实际业务逻辑进行筛选
}
return filteredOrders;
}
// 处理费用列表筛选
function filterFeeList() {
let filteredFees = generateMockFeeData();
// 应用绿色框内的筛选条件(费用列表专用)
// 项目筛选
if (selectedProject.value) {
// 这里可以根据实际业务逻辑进行筛选
}
// 显示静脉筛选
if (showVenous.value) {
// 这里可以根据实际业务逻辑进行筛选
}
return filteredFees;
}
// 查询按钮点击
function handleQuery() {
if (patientInfoList.value.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
loading.value = true;
// 模拟API调用延迟
setTimeout(() => {
// 分别独立筛选医嘱列表和费用列表
orderList.value = filterOrderList();
feeList.value = filterFeeList();
loading.value = false;
}, 500);
}
// 暴露方法供父组件调用
defineExpose({
handleQuery,
});
</script>
<style scoped>
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
}
.date-tabs .el-tabs__content {
display: none;
}
:deep(.el-table__header th) {
background-color: #f5f7fa !important;
font-weight: bold;
}
:deep(.el-table__row:hover > td) {
background-color: #f5f7fa !important;
}
/* 自定义复选框样式 */
:deep(.el-checkbox__label) {
margin-left: 4px;
}
/* 调整按钮样式 */
:deep(.el-button--primary) {
background-color: #409eff;
border-color: #409eff;
}
:deep(.el-button--text) {
color: #409eff;
}
.reset-btn {
width: 24px;
height: 24px;
border: none;
background-color: transparent;
cursor: pointer;
margin-left: 8px;
padding: 0;
border-radius: 50%;
transition: all 0.3s ease;
}
.reset-btn:hover {
background-color: #f5f7fa;
transform: scale(1.05);
}
.reset-btn:active {
transform: scale(0.95);
}
</style>

View File

@@ -0,0 +1,56 @@
import request from '@/utils/request'
/**
* 获取住院患者列表
*/
export function getPatientList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient',
method: 'get',
params: queryParams
})
}
/**
* 获取当前登录人管理病区
*/
export function getWardList(queryParams) {
return request({
url: '/app-common/practitioner-ward',
method: 'get',
params: queryParams
})
}
/**
* 获取当前选中患者全部医嘱
*/
export function getPrescriptionList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient-advice',
method: 'get',
params: queryParams
})
}
/**
* 执行医嘱
*/
export function adviceExecute(data) {
return request({
url: '/nurse-station/advice-process/advice-execute',
method: 'post',
data: data
})
}
/**
* 取消执行医嘱
*/
export function adviceCancel(data) {
return request({
url: '/nurse-station/advice-process/advice-cancel',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,388 @@
<template>
<div style="height: calc(100vh - 126px)">
<!-- 操作工具栏 -->
<div
style="
height: 51px;
border-bottom: 2px solid #e4e7ed;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
"
>
<div style="display: flex; align-items: center">
<!-- 日期选择tabs -->
<el-tabs
v-model="dateRange"
type="card"
class="date-tabs"
@tab-click="handleDateTabClick"
style="margin-right: 20px"
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<el-tab-pane label="其他" name="other"></el-tab-pane>
</el-tabs>
<!-- 日期选择器 -->
<el-date-picker
v-model="dateRangeValue"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
style="width: 240px; margin-right: 20px"
/>
<!-- 执行科室选择 -->
<el-select
v-model="execDepartment"
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="dept in departmentOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
/>
</el-select>
<!-- 查询按钮 -->
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<!-- 全选开关 -->
<div style="display: flex; align-items: center; margin-right: 20px">
<span style="margin-right: 8px">全选</span>
<el-switch v-model="selectAll" @change="handleSelectAll" />
</div>
<!-- 计费按钮 -->
<el-button type="primary" @click="handleCalculate">计费</el-button>
<!-- 批量划价按钮 -->
<el-button type="primary" plain @click="handleBatchPrice" style="margin-left: 20px"
>批量划价</el-button
>
</div>
</div>
<!-- 费用列表区域 -->
<div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading"
>
<el-table
ref="tableRef"
:data="billingList"
border
style="width: 100%"
:header-cell-style="{ background: '#eef9fd !important' }"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="医嘱内容" prop="orderContent" min-width="200" />
<el-table-column label="应执行日期" prop="executeDate" width="120" align="center" />
<el-table-column label="执行收费项目" prop="chargeItem" min-width="180" />
<el-table-column label="单价" prop="unitPrice" width="100" align="center">
<template #default="scope">
<el-input-number
v-model="scope.row.unitPrice"
:min="0"
:step="0.01"
style="width: 100px"
/>
</template>
</el-table-column>
<el-table-column label="使用数量" prop="quantity" width="100" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.quantity" :min="1" :step="1" style="width: 100px" />
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
<!-- <el-button type="primary" size="small" @click="handlePrice(scope.row)">划价</el-button> -->
<el-button type="primary" size="small" @click="handleDelete(scope.row)">撤销</el-button>
</template>
</el-table-column>
</el-table>
<!-- 无数据提示 -->
<el-empty v-if="!loading && billingList.length === 0" description="暂无数据" />
</div>
<!-- 使用计费弹窗组件 -->
<FeeDialog
v-model:visible="dialogVisible"
:initial-data="selectedFeeItems"
:patient-info="currentPatientInfo"
@confirm="handleFeeDialogConfirm"
@cancel="handleFeeDialogCancel"
/>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { formatDateStr } from '@/utils/index';
import FeeDialog from './FeeDialog.vue';
// 响应式数据
const loading = ref(false);
const billingList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
const execDepartment = ref('');
const selectAll = ref(false);
const departmentOptions = ref([]);
const tableRef = ref(null);
// 计费弹窗相关数据
const dialogVisible = ref(false);
const selectedFeeItems = ref([]);
const currentPatientInfo = ref('');
// 初始化
onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
// 加载科室选项
loadDepartmentOptions();
});
// 加载科室选项
function loadDepartmentOptions() {
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
{ label: '外科', value: 'surgery' },
{ label: '儿科', value: 'pediatrics' },
{ label: '妇产科', value: 'obstetrics' },
{ label: '其他科室', value: 'others' },
];
}
// 处理日期tabs点击
function handleDateTabClick(tab) {
const rangeType = tab.paneName;
const today = new Date();
const yesterday = new Date();
yesterday.setDate(today.getDate() - 1);
switch (rangeType) {
case 'today':
dateRangeValue.value = [
formatDateStr(today, 'YYYY-MM-DD'),
formatDateStr(today, 'YYYY-MM-DD'),
];
break;
case 'yesterday':
dateRangeValue.value = [
formatDateStr(yesterday, 'YYYY-MM-DD'),
formatDateStr(yesterday, 'YYYY-MM-DD'),
];
break;
// other 情况保持用户选择的值
}
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue.value.length > 0) {
dateRange.value = 'other';
}
}
// 生成模拟数据
function generateMockData() {
const mockData = [
{
orderContent: '血常规检查',
executeDate: dateRangeValue.value[0],
chargeItem: '血液分析',
unitPrice: 35.0,
quantity: 1,
id: '1',
},
{
orderContent: '静脉注射',
executeDate: dateRangeValue.value[0],
chargeItem: '静脉输液',
unitPrice: 20.0,
quantity: 2,
id: '2',
},
{
orderContent: 'CT检查',
executeDate: dateRangeValue.value[0],
chargeItem: '胸部CT平扫',
unitPrice: 320.0,
quantity: 1,
id: '3',
},
{
orderContent: '药物治疗',
executeDate: dateRangeValue.value[0],
chargeItem: '抗生素注射',
unitPrice: 58.5,
quantity: 1,
id: '4',
},
];
// 根据科室筛选模拟数据
if (execDepartment.value) {
// 模拟根据科室筛选
return mockData.filter((_, index) => index % 2 === 0);
}
return mockData;
}
// 查询按钮点击
function handleQuery() {
if (patientInfoList.value.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
loading.value = true;
// 模拟API调用延迟
setTimeout(() => {
// 使用模拟数据
billingList.value = generateMockData();
loading.value = false;
}, 500);
}
// 全选/取消全选
function handleSelectAll(value) {
selectAll.value = value;
if (tableRef.value) {
if (value) {
tableRef.value.toggleAllSelection();
} else {
// 取消全选
tableRef.value.clearSelection();
}
}
}
// 打开计费弹窗
function handleCalculate() {
// 获取选中的数据
const selectedRows = getSelectedRows();
// if (selectedRows.length === 0) {
// ElMessage.warning('请先选择要计费的项目');
// return;
// }
// 设置弹窗初始数据
selectedFeeItems.value = [...selectedRows];
// 设置患者信息
if (patientInfoList.value.length > 0) {
const patient = patientInfoList.value[0];
currentPatientInfo.value = `${patient.patientName || '未知患者'}`;
}
// 显示弹窗
dialogVisible.value = true;
}
// 处理计费弹窗确认
function handleFeeDialogConfirm(data) {
// 模拟计费操作
setTimeout(() => {
ElMessage.success('计费成功');
// 刷新数据
handleQuery();
}, 300);
}
// 处理计费弹窗取消
function handleFeeDialogCancel() {
// 可以在这里添加取消后的处理逻辑
}
// 批量划价
function handleBatchPrice() {
// 获取选中的数据
const selectedRows = getSelectedRows();
if (selectedRows.length === 0) {
ElMessage.warning('请先选择要划价的项目');
return;
}
// 模拟批量划价操作
setTimeout(() => {
ElMessage.success(`批量划价成功,共${selectedRows.length}`);
// 更新状态,模拟已划价
selectedRows.forEach((row) => {
row.status = 'priced';
});
}, 300);
}
// 单项划价
function handlePrice(row) {
// 模拟单项划价操作
setTimeout(() => {
ElMessage.success('划价成功');
// 更新状态,模拟已划价
row.status = 'priced';
}, 300);
}
function handleDelete(row) {
// 从数据列表中删除当前行
const index = billingList.value.findIndex((item) => item.id === row.id);
if (index !== -1) {
billingList.value.splice(index, 1);
ElMessage.success('撤销成功');
}
}
// 获取选中的行
function getSelectedRows() {
if (tableRef.value) {
return tableRef.value.selection || [];
}
return [];
}
// 暴露方法供父组件调用
defineExpose({
handleQuery,
});
</script>
<style scoped>
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
}
.date-tabs .el-tabs__content {
display: none;
}
:deep(.el-table__header th) {
background-color: #eef9fd !important;
}
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
</style>

View File

@@ -0,0 +1,490 @@
<template>
<div style="height: calc(100vh - 126px)">
<!-- 操作工具栏 -->
<div
style="
height: 51px;
border-bottom: 2px solid #e4e7ed;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
"
>
<div style="display: flex; align-items: center">
<!-- 日期选择tabs -->
<el-tabs
v-model="dateRange"
type="card"
class="date-tabs"
@tab-click="handleDateTabClick"
style="margin-right: 20px"
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<el-tab-pane label="其他" name="other"></el-tab-pane>
</el-tabs>
<!-- 日期选择器 -->
<el-date-picker
v-model="dateRangeValue"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
style="width: 240px; margin-right: 20px"
/>
<!-- 缴费方式选择 -->
<el-select
v-model="paymentMethod"
placeholder="请选择缴费方式"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="method in paymentMethodOptions"
:key="method.value"
:label="method.label"
:value="method.value"
/>
</el-select>
<!-- 查询按钮 -->
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<!-- 导出按钮 -->
<el-button @click="handleExport">导出</el-button>
<!-- 打印按钮 -->
<el-button @click="handlePrint" style="margin-left: 15px">打印</el-button>
</div>
</div>
<!-- 预交金列表区域 -->
<div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading"
>
<!-- 费用汇总信息 -->
<div style="background-color: white; padding: 15px; margin-bottom: 10px; border-radius: 4px;">
<div style="display: flex; justify-content: flex-end; align-items: center">
<div style="text-align: right;">
<p style="margin: 0; font-size: 18px; font-weight: bold; color: #ff4d4f;">
合计金额¥{{ totalAmount.toFixed(2) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px;">缴费次数{{ depositList.length }}</p>
</div>
</div>
</div>
<el-table
ref="tableRef"
:data="depositList"
border
style="width: 100%"
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="预交金编号" prop="depositNo" min-width="180" />
<el-table-column label="金额" prop="amount" width="120" align="center" sortable>
<template #default="scope">
<span style="color: #ff4d4f">{{ scope.row.amount.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="缴费方式" prop="paymentMethodName" width="120" align="center" />
<el-table-column label="缴费时间" prop="paymentTime" width="150" align="center" sortable />
<el-table-column label="收费员" prop="cashier" width="100" align="center" />
</el-table>
<!-- 分页 -->
<div style="margin-top: 15px; display: flex; justify-content: flex-end;">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
<!-- 无数据提示 -->
<el-empty v-if="!loading && depositList.length === 0" description="暂无预交金数据" />
</div>
<!-- 打印预览弹窗 -->
<el-dialog v-model="printDialogVisible" title="打印预览" width="80%" :close-on-click-modal="false">
<div id="print-content">
<div style="text-align: center; margin-bottom: 20px;">
<h2 style="margin: 0;">预交金清单</h2>
<p style="margin: 5px 0;">患者姓名{{ patientInfo || '未选择患者' }}</p>
<p style="margin: 5px 0;">费用周期{{ formatDateRange() }}</p>
</div>
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr style="background-color: #eef9fd;">
<th style="border: 1px solid #e4e7ed; padding: 8px;">序号</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">预交金编号</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">金额</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">缴费方式</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">缴费时间</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">收费员</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in depositList" :key="item.id">
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ index + 1 }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.depositNo }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.amount.toFixed(2) }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.paymentMethodName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.paymentTime }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.cashier }}</td>
</tr>
</tbody>
<tfoot>
<tr style="background-color: #f5f7fa;">
<td colspan="2" style="border: 1px solid #e4e7ed; padding: 8px; text-align: right; font-weight: bold;">合计</td>
<td colspan="4" style="border: 1px solid #e4e7ed; padding: 8px; color: #ff4d4f; font-weight: bold;">¥{{ totalAmount.toFixed(2) }}</td>
</tr>
</tfoot>
</table>
</div>
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { getSinglePatient } from '../store/patient.js'; // 导入获取单选患者信息的方法
import { formatDateStr } from '@/utils/index';
// 响应式数据
const loading = ref(false);
const depositList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
const paymentMethod = ref('');
const paymentMethodOptions = ref([]);
const tableRef = ref(null);
const patientInfo = ref('');
// 分页相关
const currentPage = ref(1);
const pageSize = ref(20);
const total = ref(0);
// 打印相关
const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
return depositList.value.reduce((sum, item) => {
return sum + (item.amount || 0);
}, 0);
});
// 初始化
onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
// 加载缴费方式选项
loadPaymentMethodOptions();
// 监听患者选择变化
watchPatientSelection();
});
// 监听患者选择变化
function watchPatientSelection() {
// 定期检查患者选择状态变化
setInterval(() => {
// 使用getSinglePatient方法获取单选患者信息
const selectedPatient = getSinglePatient();
if (selectedPatient) {
patientInfo.value = selectedPatient.patientName || '';
} else {
patientInfo.value = '未选择患者';
}
}, 300);
}
// 加载缴费方式选项
function loadPaymentMethodOptions() {
// 模拟缴费方式数据
paymentMethodOptions.value = [
{ label: '现金', value: 'cash' },
{ label: '银行卡', value: 'bankcard' },
{ label: '微信支付', value: 'wechat' },
{ label: '支付宝', value: 'alipay' },
{ label: '其他', value: 'others' },
];
}
// 处理日期tabs点击
function handleDateTabClick(tab) {
const rangeType = tab.paneName;
const today = new Date();
const yesterday = new Date();
yesterday.setDate(today.getDate() - 1);
switch (rangeType) {
case 'today':
dateRangeValue.value = [
formatDateStr(today, 'YYYY-MM-DD'),
formatDateStr(today, 'YYYY-MM-DD'),
];
break;
case 'yesterday':
dateRangeValue.value = [
formatDateStr(yesterday, 'YYYY-MM-DD'),
formatDateStr(yesterday, 'YYYY-MM-DD'),
];
break;
// other 情况保持用户选择的值
}
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue.value.length > 0) {
dateRange.value = 'other';
}
}
// 格式化日期范围显示
function formatDateRange() {
if (dateRangeValue.value && dateRangeValue.value.length === 2) {
return `${dateRangeValue.value[0]}${dateRangeValue.value[1]}`;
}
return '';
}
// 生成模拟数据
function generateMockData() {
// 缴费方式映射
const paymentMethodMap = {
'cash': '现金',
'bankcard': '银行卡',
'wechat': '微信支付',
'alipay': '支付宝',
'others': '其他'
};
// 生成模拟数据
const mockData = [];
const baseDate = new Date(dateRangeValue.value[0]);
const endDate = new Date(dateRangeValue.value[1]);
const daysDiff = Math.ceil((endDate - baseDate) / (1000 * 60 * 60 * 24)) + 1;
// 收费员池
const cashiers = ['收费员A', '收费员B', '收费员C', '收费员D'];
// 生成数据
let id = 1;
for (let day = 0; day < daysDiff; day++) {
const currentDate = new Date(baseDate);
currentDate.setDate(baseDate.getDate() + day);
// 每天生成1-3条记录
const recordsCount = Math.floor(Math.random() * 3) + 1;
for (let i = 0; i < recordsCount; i++) {
// 随机选择一个缴费方式
const paymentMethods = paymentMethod.value ? [paymentMethod.value] : Object.keys(paymentMethodMap);
const randomMethod = paymentMethods[Math.floor(Math.random() * paymentMethods.length)];
// 生成随机金额 (500-5000元)
const amount = Math.floor(Math.random() * 4500) + 500;
// 生成时间
const hours = Math.floor(Math.random() * 8) + 8; // 8-16点
const minutes = Math.floor(Math.random() * 60);
const seconds = Math.floor(Math.random() * 60);
currentDate.setHours(hours, minutes, seconds);
const timeStr = formatDateStr(currentDate, 'YYYY-MM-DD HH:mm:ss');
// 生成预交金编号 (示例格式5000120200001)
const dateCode = formatDateStr(currentDate, 'YYYYMMDD');
const serialNum = String(id).padStart(6, '0');
const depositNo = `500${dateCode.slice(2)}${serialNum}`;
mockData.push({
id: id++,
depositNo: depositNo,
amount: amount,
paymentMethod: randomMethod,
paymentMethodName: paymentMethodMap[randomMethod],
paymentTime: timeStr,
cashier: cashiers[Math.floor(Math.random() * cashiers.length)]
});
}
}
return mockData;
}
// 查询按钮点击
function handleQuery() {
// 添加调试日志,查看患者列表数据结构
console.log('患者列表数据:', patientInfoList.value);
// 使用getSinglePatient方法获取单选患者信息
const selectedPatient = getSinglePatient();
if (!selectedPatient) {
ElMessage.warning('请先选择患者');
return;
}
// 更新患者信息显示
const patientName = selectedPatient.patientName ||
selectedPatient.name ||
selectedPatient.patientInfo ||
selectedPatient.patient ||
'未命名患者';
patientInfo.value = patientName;
loading.value = true;
// 模拟API调用延迟
setTimeout(() => {
try {
// 使用模拟数据
const allData = generateMockData();
total.value = allData.length;
// 分页处理
const start = (currentPage.value - 1) * pageSize.value;
const end = start + pageSize.value;
depositList.value = allData.slice(start, end);
} catch (error) {
console.error('查询错误:', error);
ElMessage.error('查询失败,请重试');
depositList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
}, 500);
}
// 处理排序变化
function handleSortChange({ prop, order }) {
const sortedData = [...depositList.value];
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop]) ? 1 : -1);
} else if (order === 'descending') {
sortedData.sort((a, b) => (a[prop] < b[prop]) ? 1 : -1);
}
depositList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
pageSize.value = newSize;
currentPage.value = 1;
handleQuery();
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
currentPage.value = newCurrent;
handleQuery();
}
// 导出
function handleExport() {
if (depositList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
// 模拟导出操作
ElMessage.success('导出成功');
// 实际项目中这里应该调用导出API或使用Excel库生成文件
}
// 打印预览
function handlePrint() {
if (depositList.value.length === 0) {
ElMessage.warning('暂无数据可打印');
return;
}
printDialogVisible.value = true;
}
// 执行打印
function doPrint() {
try {
// 获取要打印的内容
const printContent = document.getElementById('print-content').innerHTML;
// 创建临时窗口
const printWindow = window.open('', '_blank');
// 写入内容
printWindow.document.write(`
<html>
<head>
<title>预交金清单</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ccc; padding: 8px; }
th { background-color: #f2f2f2; }
tfoot { font-weight: bold; }
.total-row { background-color: #f5f5f5; }
</style>
</head>
<body>
${printContent}
</body>
</html>
`);
// 打印
printWindow.document.close();
printWindow.focus();
printWindow.print();
} catch (e) {
ElMessage.error('打印失败');
console.error('Print error:', e);
}
}
// 暴露方法供父组件调用
defineExpose({
handleQuery,
});
</script>
<style scoped>
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
}
.date-tabs .el-tabs__content {
display: none;
}
</style>

View File

@@ -0,0 +1,611 @@
<template>
<div style="height: calc(100vh - 126px)">
<!-- 操作工具栏 -->
<div
style="
height: 51px;
border-bottom: 2px solid #e4e7ed;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
"
>
<div style="display: flex; align-items: center">
<!-- 日期选择tabs -->
<el-tabs
v-model="dateRange"
type="card"
class="date-tabs"
@tab-click="handleDateTabClick"
style="margin-right: 20px"
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<el-tab-pane label="其他" name="other"></el-tab-pane>
</el-tabs>
<!-- 日期选择器 -->
<el-date-picker
v-model="dateRangeValue"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
style="width: 240px; margin-right: 20px"
/>
<!-- 费用类型选择 -->
<el-select
v-model="feeType"
placeholder="请选择费用类型"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="type in feeTypeOptions"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
<!-- 执行科室选择 -->
<el-select
v-model="execDepartment"
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="dept in departmentOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
/>
</el-select>
<!-- 查询按钮 -->
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<!-- 导出按钮 -->
<el-button @click="handleExport">导出</el-button>
<!-- 打印按钮 -->
<el-button @click="handlePrint" style="margin-left: 15px">打印</el-button>
</div>
</div>
<!-- 费用明细列表区域 -->
<div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading"
>
<!-- 费用汇总信息 -->
<div style="background-color: white; padding: 15px; margin-bottom: 10px; border-radius: 4px;">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<h3 style="margin: 0; font-weight: normal; color: #303133;">费用汇总</h3>
<p style="margin: 5px 0; color: #606266; font-size: 14px;">费用周期{{ formatDateRange() }}</p>
</div>
<div style="text-align: right;">
<p style="margin: 0; font-size: 18px; font-weight: bold; color: #ff4d4f;">
合计金额¥{{ totalAmount.toFixed(2) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px;">明细项数{{ feeDetailList.length }}</p>
</div>
</div>
</div>
<el-table
ref="tableRef"
:data="feeDetailList"
border
style="width: 100%"
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
<el-table-column label="项目名称" prop="itemName" min-width="200" />
<el-table-column label="费用类型" prop="feeTypeName" width="120" align="center" />
<el-table-column label="单价" prop="unitPrice" width="100" align="center" sortable />
<el-table-column label="数量" prop="quantity" width="100" align="center" sortable />
<el-table-column label="金额" prop="amount" width="100" align="center" sortable>
<template #default="scope">
<span style="color: #ff4d4f">{{ scope.row.amount.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="执行科室" prop="execDept" width="120" align="center" />
<el-table-column label="执行人" prop="executor" width="100" align="center" />
<el-table-column label="执行日期" prop="executeDate" width="120" align="center" />
<el-table-column label="医保类型" prop="insuranceType" width="100" align="center">
<template #default="scope">
<el-tag v-if="scope.row.insuranceType" size="small">{{ scope.row.insuranceType }}</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" min-width="150" />
</el-table>
<!-- 分页 -->
<div style="margin-top: 15px; display: flex; justify-content: flex-end;">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
<!-- 无数据提示 -->
<el-empty v-if="!loading && feeDetailList.length === 0" description="暂无费用明细数据" />
</div>
<!-- 打印预览弹窗 -->
<el-dialog v-model="printDialogVisible" title="打印预览" width="80%" :close-on-click-modal="false">
<div id="print-content">
<div style="text-align: center; margin-bottom: 20px;">
<h2 style="margin: 0;">费用明细清单</h2>
<p style="margin: 5px 0;">患者姓名{{ patientInfo || '未选择患者' }}</p>
<p style="margin: 5px 0;">费用周期{{ formatDateRange() }}</p>
</div>
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr style="background-color: #eef9fd;">
<th style="border: 1px solid #e4e7ed; padding: 8px;">项目名称</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">费用类型</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">单价</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">数量</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">金额</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">执行科室</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">执行日期</th>
</tr>
</thead>
<tbody>
<tr v-for="item in feeDetailList" :key="item.id">
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.itemName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.feeTypeName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.unitPrice.toFixed(2) }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.quantity }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.amount.toFixed(2) }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.execDept }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.executeDate }}</td>
</tr>
</tbody>
<tfoot>
<tr style="background-color: #f5f7fa;">
<td colspan="4" style="border: 1px solid #e4e7ed; padding: 8px; text-align: right; font-weight: bold;">合计</td>
<td colspan="3" style="border: 1px solid #e4e7ed; padding: 8px; color: #ff4d4f; font-weight: bold;">¥{{ totalAmount.toFixed(2) }}</td>
</tr>
</tfoot>
</table>
</div>
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { formatDateStr } from '@/utils/index';
// 响应式数据
const loading = ref(false);
const feeDetailList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
const feeType = ref('');
const execDepartment = ref('');
const departmentOptions = ref([]);
const feeTypeOptions = ref([]);
const tableRef = ref(null);
const patientInfo = ref('');
// 分页相关
const currentPage = ref(1);
const pageSize = ref(20);
const total = ref(0);
// 打印相关
const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
return feeDetailList.value.reduce((sum, item) => {
return sum + (item.amount || 0);
}, 0);
});
// 初始化
onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
// 加载科室选项
loadDepartmentOptions();
// 加载费用类型选项
loadFeeTypeOptions();
// 监听患者选择变化
watchPatientSelection();
});
// 监听患者选择变化
function watchPatientSelection() {
// 定期检查患者选择状态变化
setInterval(() => {
if (patientInfoList.value && patientInfoList.value.length > 0) {
const selectedPatient = patientInfoList.value.find(patient => patient.selected === true);
if (selectedPatient) {
patientInfo.value = selectedPatient.patientName || '';
} else {
patientInfo.value = '未选择患者';
}
} else {
patientInfo.value = '未选择患者';
}
}, 300);
}
// 加载科室选项
function loadDepartmentOptions() {
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
{ label: '外科', value: 'surgery' },
{ label: '儿科', value: 'pediatrics' },
{ label: '妇产科', value: 'obstetrics' },
{ label: '检验科', value: 'laboratory' },
{ label: '影像科', value: 'imaging' },
{ label: '其他科室', value: 'others' },
];
}
// 加载费用类型选项
function loadFeeTypeOptions() {
// 模拟费用类型数据
feeTypeOptions.value = [
{ label: '检查费', value: 'examine' },
{ label: '治疗费', value: 'treatment' },
{ label: '药品费', value: 'medicine' },
{ label: '材料费', value: 'material' },
{ label: '床位费', value: 'bed' },
{ label: '其他费用', value: 'others' },
];
}
// 处理日期tabs点击
function handleDateTabClick(tab) {
const rangeType = tab.paneName;
const today = new Date();
const yesterday = new Date();
yesterday.setDate(today.getDate() - 1);
switch (rangeType) {
case 'today':
dateRangeValue.value = [
formatDateStr(today, 'YYYY-MM-DD'),
formatDateStr(today, 'YYYY-MM-DD'),
];
break;
case 'yesterday':
dateRangeValue.value = [
formatDateStr(yesterday, 'YYYY-MM-DD'),
formatDateStr(yesterday, 'YYYY-MM-DD'),
];
break;
// other 情况保持用户选择的值
}
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue.value.length > 0) {
dateRange.value = 'other';
}
}
// 格式化日期范围显示
function formatDateRange() {
if (dateRangeValue.value && dateRangeValue.value.length === 2) {
return `${dateRangeValue.value[0]}${dateRangeValue.value[1]}`;
}
return '';
}
// 生成模拟数据
function generateMockData() {
// 费用类型映射
const feeTypeMap = {
'examine': '检查费',
'treatment': '治疗费',
'medicine': '药品费',
'material': '材料费',
'bed': '床位费',
'others': '其他费用'
};
// 科室映射
const deptMap = {
'internal': '内科',
'surgery': '外科',
'pediatrics': '儿科',
'obstetrics': '妇产科',
'laboratory': '检验科',
'imaging': '影像科',
'others': '其他科室'
};
// 项目数据池
const itemPools = {
'examine': ['血常规检查', '尿常规检查', '肝功能检查', '肾功能检查', '胸部CT', '心电图', 'B超'],
'treatment': ['静脉输液', '肌肉注射', '氧气吸入', '导尿', '换药', '雾化吸入'],
'medicine': ['抗生素注射液', '维生素C片', '感冒药', '止痛药', '降压药', '消炎药'],
'material': ['一次性输液器', '注射器', '医用棉花', '纱布', '胶带', '一次性手套'],
'bed': ['普通病房床位', 'ICU床位', '单人病房床位', '双人病房床位'],
'others': ['护理费', '诊疗费', '挂号费', '病历费']
};
// 合并所有项目到allItems数组中修复添加这部分代码
let allItems = [];
Object.keys(itemPools).forEach(type => {
itemPools[type].forEach(item => {
allItems.push({
type: type,
name: item
});
});
});
// 筛选条件
if (feeType.value) {
allItems = allItems.filter(item => item.type === feeType.value);
}
// 生成模拟数据
const mockData = [];
const baseDate = new Date(dateRangeValue.value[0]);
const endDate = new Date(dateRangeValue.value[1]);
const daysDiff = Math.ceil((endDate - baseDate) / (1000 * 60 * 60 * 24)) + 1;
// 执行人池
const executors = ['护士A', '护士B', '医生A', '医生B', '技师A'];
// 生成数据
let id = 1;
for (let day = 0; day < daysDiff; day++) {
const currentDate = new Date(baseDate);
currentDate.setDate(baseDate.getDate() + day);
const dateStr = formatDateStr(currentDate, 'YYYY-MM-DD');
// 每天生成3-8条记录
const recordsCount = Math.floor(Math.random() * 6) + 3;
for (let i = 0; i < recordsCount; i++) {
// 随机选择一个项目
const randomItemIndex = Math.floor(Math.random() * allItems.length);
const selectedItem = allItems[randomItemIndex];
// 随机选择一个科室
const deptKeys = Object.keys(deptMap);
const randomDeptKey = deptKeys[Math.floor(Math.random() * deptKeys.length)];
// 如果有科室筛选且不符合,则跳过
if (execDepartment.value && randomDeptKey !== execDepartment.value) {
continue;
}
// 生成随机单价和数量
const unitPrice = Math.floor(Math.random() * 190) + 10; // 10-200元
const quantity = Math.floor(Math.random() * 3) + 1; // 1-4
// 医保类型
const insuranceTypes = ['', '甲类', '乙类', '丙类'];
const insuranceType = insuranceTypes[Math.floor(Math.random() * insuranceTypes.length)];
mockData.push({
id: `item-${id++}`,
itemName: selectedItem.name,
feeType: selectedItem.type,
feeTypeName: feeTypeMap[selectedItem.type],
unitPrice: unitPrice,
quantity: quantity,
amount: unitPrice * quantity,
execDept: deptMap[randomDeptKey],
executor: executors[Math.floor(Math.random() * executors.length)],
executeDate: dateStr,
insuranceType: insuranceType,
remark: ''
});
}
}
return mockData;
}
// 查询按钮点击
function handleQuery() {
// 添加调试日志,查看患者列表数据结构
console.log('患者列表数据:', patientInfoList.value);
// 更灵活的患者选择检测逻辑
let selectedPatient = null;
if (patientInfoList.value && patientInfoList.value.length > 0) {
// 尝试查找选中状态的患者
selectedPatient = patientInfoList.value.find(patient =>
patient.selected === true ||
patient.checked === true ||
patient.isChecked === true ||
(typeof patient.selected === 'string' && patient.selected === '1')
);
// 如果没有明确选中的患者,就使用列表中的第一个患者
if (!selectedPatient) {
selectedPatient = patientInfoList.value[0];
}
}
// 即使没有明确选中的患者标志,也应该允许查询
if (!selectedPatient) {
ElMessage.warning('请先选择患者');
return;
}
// 更新患者信息显示 - 修复:确保正确获取患者姓名
const patientName = selectedPatient.patientName ||
selectedPatient.name ||
selectedPatient.patientInfo ||
selectedPatient.patient ||
'未命名患者';
patientInfo.value = patientName;
loading.value = true;
// 模拟API调用延迟
setTimeout(() => {
try {
// 使用模拟数据
const allData = generateMockData();
total.value = allData.length;
// 分页处理
const start = (currentPage.value - 1) * pageSize.value;
const end = start + pageSize.value;
feeDetailList.value = allData.slice(start, end);
} catch (error) {
console.error('查询错误:', error);
ElMessage.error('查询失败,请重试');
feeDetailList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
}, 500);
}
// 处理排序变化
function handleSortChange({ prop, order }) {
const sortedData = [...feeDetailList.value];
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop]) ? 1 : -1);
} else if (order === 'descending') {
sortedData.sort((a, b) => (a[prop] < b[prop]) ? 1 : -1);
}
feeDetailList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
pageSize.value = newSize;
currentPage.value = 1;
handleQuery();
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
currentPage.value = newCurrent;
handleQuery();
}
// 导出
function handleExport() {
if (feeDetailList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
// 模拟导出操作
ElMessage.success('导出成功');
// 实际项目中这里应该调用导出API或使用Excel库生成文件
}
// 打印预览
function handlePrint() {
if (feeDetailList.value.length === 0) {
ElMessage.warning('暂无数据可打印');
return;
}
printDialogVisible.value = true;
}
// 执行打印
function doPrint() {
try {
// 获取要打印的内容
const printContent = document.getElementById('print-content').innerHTML;
// 创建临时窗口
const printWindow = window.open('', '_blank');
// 写入内容
printWindow.document.write(`
<html>
<head>
<title>费用明细清单</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ccc; padding: 8px; }
th { background-color: #f2f2f2; }
tfoot { font-weight: bold; }
.total-row { background-color: #f5f5f5; }
</style>
</head>
<body>
${printContent}
</body>
</html>
`);
// 打印
printWindow.document.close();
printWindow.focus();
printWindow.print();
} catch (e) {
ElMessage.error('打印失败');
console.error('Print error:', e);
}
}
// 暴露方法供父组件调用
defineExpose({
handleQuery,
});
</script>
<style scoped>
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
}
.date-tabs .el-tabs__content {
display: none;
}
:deep(.el-table__header th) {
background-color: #eef9fd !important;
}
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
</style>

View File

@@ -0,0 +1,138 @@
<template>
<div style="display: flex; justify-content: space-between">
<!-- 左侧患者列表 -->
<div style="width: 20%; height: 90vh; border-right: solid 2px #e4e7ed">
<div
style="
height: 40px;
display: flex;
align-items: center;
justify-content: flex-end;
border-bottom: solid 2px #e4e7ed;
"
>
<el-icon
@click="refresh"
class="refresh-icon"
style="cursor: pointer; font-size: 20px; margin-right: 10px"
>
<Refresh />
</el-icon>
</div>
<el-tabs v-model="active" class="demo-tabs centered-tabs tab-header" @tab-click="handleClick">
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
</el-tabs>
</div>
<!-- 右侧划价确费功能区 -->
<div style="width: 80%; padding: 10px">
<!-- 标签页导航 -->
<el-tabs v-model="activeTab" class="demo-tabs" @tab-change="handleTabChange">
<el-tab-pane label="划价确费" name="billing">
<BillingList ref="billingRef" />
</el-tab-pane>
<el-tab-pane label="医嘱计费" name="orderBilling">
<OrderBilling ref="orderBillingRef" />
</el-tab-pane>
<el-tab-pane label="费用明细查询" name="expenseDetail">
<FeeDetailQuery ref="feeDetailQueryRef" />
</el-tab-pane>
<el-tab-pane label="预交金查询" name="depositQuery">
<deposit-query ref="depositQueryRef" />
</el-tab-pane>
<!-- <el-tab-pane label="患者流转日志" name="patientFlow">
<div style="padding: 20px; text-align: center; color: #909399">患者流转日志功能区域</div>
</el-tab-pane> -->
</el-tabs>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
import PatientList from '../medicalOrderExecution/components/patientList.vue';
import BillingList from './components/billingList.vue';
import FeeDetailQuery from './components/feeDetailQuery.vue';
import DepositQuery from './components/depositQuery.vue';
import OrderBilling from './components/OrderBilling.vue';
// 预交金查询组件引用
const depositQueryRef = ref(null);
// 响应式数据
const active = ref('first');
const activeTab = ref('billing');
const billingRef = ref(null);
const feeDetailQueryRef = ref(null);
const orderBillingRef = ref(null);
// 刷新功能
function refresh() {
ElMessage.success('刷新成功');
// 刷新患者列表
}
// 左侧标签页点击
function handleClick() {
// 可以在这里添加左侧标签切换的逻辑
}
// 右侧标签页切换
function handleTabChange() {
// 切换到划价确费标签时,刷新数据
if (activeTab.value === 'billing' && billingRef.value) {
nextTick(() => {
billingRef.value.handleQuery();
});
}
// 切换到医嘱计费标签时,刷新数据
if (activeTab.value === 'orderBilling' && orderBillingRef.value) {
nextTick(() => {
orderBillingRef.value.handleQuery();
});
}
// 切换到费用明细查询标签时,可以刷新数据
if (activeTab.value === 'expenseDetail' && feeDetailQueryRef.value) {
nextTick(() => {
// 根据feeDetailQuery组件提供的方法进行数据刷新
});
}
// 切换到预交金查询标签时,刷新数据
if (activeTab.value === 'depositQuery' && depositQueryRef.value) {
nextTick(() => {
depositQueryRef.value.handleQuery();
});
}
}
</script>
<style scoped>
.centered-tabs :deep(.el-tabs__nav-wrap) {
display: flex;
justify-content: center;
}
.centered-tabs :deep(.el-tabs__nav-scroll) {
display: flex;
justify-content: center;
}
.tab-header :deep(.el-tabs__item) {
height: 50px !important;
}
.centered-tabs :deep(.el-tabs__nav) {
display: flex;
justify-content: center;
}
:deep(.el-tabs__header) {
margin: 0;
}
</style>

View File

@@ -0,0 +1,21 @@
// 选择患者信息
export const patientInfo = ref()
export function updatePatientInfo(info) {
patientInfo.value = info
}
// 多选患者
export const patientInfoList = ref([])
export function updatePatientInfoList(info) {
patientInfoList.value = info
}
// 获取单选患者信息(去掉复选框模式下使用)
export function getSinglePatient() {
// 如果有选中的患者,只返回第一个患者信息,实现单选效果
if (patientInfoList.value && patientInfoList.value.length > 0) {
return patientInfoList.value[0];
}
return null;
}