解决合并冲突
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
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/medicine-summary/dispensing-form',
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇总领药申请
|
||||
*/
|
||||
export function medicineSummary(data) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/medicine-summary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询汇总领药单
|
||||
*/
|
||||
export function getMedicineSummary(param) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/summary-form',
|
||||
method: 'get',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取汇总单详细信息
|
||||
*/
|
||||
export function getMedicineSummaryDetail(param) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/summary-form-detail',
|
||||
method: 'get',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-input placeholder="住院号/姓名">
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getPatientList" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:load="loadNode"
|
||||
lazy
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
@node-click="handleNodeClick"
|
||||
@check="handleCheckChange"
|
||||
@node-expand="onNodeExpand"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node" v-if="node.level === 2">
|
||||
<span>{{ data.bedName + ' / ' + node.label }}</span>
|
||||
<span class="tree-node-actions">
|
||||
{{ data.genderEnum_enumText + ' / ' + data.age }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPatientList, getWardList } from './api';
|
||||
import { updatePatientInfoList } from '../store/patient';
|
||||
import { nextTick, onMounted } from 'vue';
|
||||
|
||||
const treeRef = ref(null);
|
||||
const allNodesLoaded = ref(false);
|
||||
// 树节点加载完成后的回调
|
||||
function onTreeLoaded() {
|
||||
if (!allNodesLoaded.value && treeRef.value) {
|
||||
// 等待DOM更新后设置全选
|
||||
nextTick(() => {
|
||||
// 获取所有节点并设置为选中状态
|
||||
const allNodes = getAllNodes(treeRef.value.store.root.childNodes);
|
||||
const allKeys = allNodes.map((node) => node.key);
|
||||
|
||||
treeRef.value.setCheckedKeys(allKeys, true); // 第二个参数设为true表示级联选中
|
||||
allNodesLoaded.value = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 递归获取所有节点
|
||||
function getAllNodes(nodes) {
|
||||
let result = [];
|
||||
if (nodes && nodes.length > 0) {
|
||||
nodes.forEach((node) => {
|
||||
result.push(node);
|
||||
if (node.childNodes && node.childNodes.length > 0) {
|
||||
result = result.concat(getAllNodes(node.childNodes));
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadNode(node, resolve) {
|
||||
// 初始加载:获取所有病区(父级节点)
|
||||
if (node.level === 0) {
|
||||
getWardList().then((res) => {
|
||||
// 确保病区节点不是叶子节点
|
||||
const wards = res.map((ward) => ({
|
||||
...ward,
|
||||
leaf: false,
|
||||
}));
|
||||
return resolve(wards);
|
||||
});
|
||||
}
|
||||
// 展开病区节点时:获取该病区下的患者列表
|
||||
else if (node.level === 1) {
|
||||
const wardId = node.data.id;
|
||||
getPatientList({ wardId: wardId }).then((res) => {
|
||||
let children = res.data.records.map((item) => {
|
||||
return {
|
||||
leaf: true, // 患者节点为叶子节点
|
||||
...item,
|
||||
name: item.patientName,
|
||||
};
|
||||
});
|
||||
return resolve(children);
|
||||
});
|
||||
}
|
||||
// 更深层级直接返回空数组
|
||||
else {
|
||||
return resolve([]);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有选中的子节点(叶子节点)
|
||||
function getCheckedLeafNodes() {
|
||||
if (!treeRef.value) return [];
|
||||
|
||||
// 获取所有选中的节点key
|
||||
const checkedKeys = treeRef.value.getCheckedKeys();
|
||||
// 获取所有半选中的节点key(父节点)
|
||||
const halfCheckedKeys = treeRef.value.getHalfCheckedKeys();
|
||||
|
||||
// 获取所有选中的节点数据
|
||||
const checkedNodes = treeRef.value.getCheckedNodes();
|
||||
|
||||
// 只返回叶子节点(患者节点)
|
||||
return checkedNodes.filter((node) => node.leaf === true);
|
||||
}
|
||||
|
||||
// 处理节点选中状态变化
|
||||
function handleCheckChange(data, checked) {
|
||||
// 可以在这里处理选中状态变化的逻辑
|
||||
let list = getCheckedLeafNodes();
|
||||
console.log(list, '2345678');
|
||||
|
||||
updatePatientInfoList(list);
|
||||
handleGetPrescription();
|
||||
}
|
||||
const handleGetPrescription = inject('handleGetPrescription');
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tree-node-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node__content) {
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div style="height: calc(100vh - 176px)">
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-collapse
|
||||
v-model="activeNames"
|
||||
expand-icon-position="left"
|
||||
v-if="prescriptionList.length > 0"
|
||||
style="
|
||||
border-bottom: 0px;
|
||||
border-top: 0px;
|
||||
border-radius: 0px;
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 200px);
|
||||
"
|
||||
>
|
||||
<el-collapse-item
|
||||
v-for="(item, index) in prescriptionList"
|
||||
:key="index"
|
||||
:name="item[0].encounterId"
|
||||
style="
|
||||
border: 2px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
"
|
||||
>
|
||||
<template #title>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>
|
||||
<span>{{ item[0].bedName + '【' + item[0].busNo + '】' }}</span>
|
||||
<span>
|
||||
{{
|
||||
item[0].patientName + ' / ' + item[0].genderEnum_enumText + ' / ' + item[0].age
|
||||
}}
|
||||
</span>
|
||||
<el-tag style="margin-left: 10px">{{ item[0].contractName }}</el-tag>
|
||||
<span style="margin-left: 30px; font-weight: 600">
|
||||
{{ item[0].conditionNames }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
align-items: center;
|
||||
margin-right: 20px;
|
||||
"
|
||||
>
|
||||
<div style="display: inline-block; margin-right: 10px">
|
||||
<span class="descriptions-item-label">住院医生:</span>
|
||||
<span>{{ item[0].requesterId_dictText }}</span>
|
||||
</div>
|
||||
<div style="display: inline-block; margin-right: 10px">
|
||||
<div
|
||||
class="descriptions-item-label"
|
||||
style="height: 20px; line-height: 20px; text-align: center; margin: 0"
|
||||
>
|
||||
预交金额
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
color: #ec8c43;
|
||||
"
|
||||
>
|
||||
{{ item[0].balanceAmount?.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-table
|
||||
:data="item"
|
||||
border
|
||||
:ref="'tableRef' + index"
|
||||
:header-cell-style="{ background: '#eef9fd !important' }"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="50" />
|
||||
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
|
||||
<template #default="scope">
|
||||
<span :style="scope.row.therapyEnum == '1' ? 'color: #a6745c' : 'color: #3787a5'">
|
||||
{{ scope.row.therapyEnum_enumText }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医嘱内容" prop="adviceName">
|
||||
<template #default="scope">
|
||||
<span>
|
||||
{{ scope.row.adviceName }}
|
||||
</span>
|
||||
<template v-if="scope.row.adviceTable == 'med_medication_request'">
|
||||
<span>
|
||||
{{ ' 【' + scope.row.volume + '】' }}
|
||||
</span>
|
||||
<span style="color: #447c95 !important">
|
||||
{{
|
||||
'(' +
|
||||
scope.row.methodCode_dictText +
|
||||
' ' +
|
||||
scope.row.dose +
|
||||
scope.row.doseUnitCode_dictText +
|
||||
' ' +
|
||||
scope.row.rateCode_dictText +
|
||||
')'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领药总量" prop="requestTime" width="150">
|
||||
<template #default="scope">
|
||||
{{ '1支' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="取药科室" prop="requestTime" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.positionName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领药时间" prop="times">
|
||||
<template #default="scope">
|
||||
<div
|
||||
v-for="(item, timeIndex) in scope.row.times"
|
||||
:key="timeIndex"
|
||||
style="padding-bottom: 5px"
|
||||
>
|
||||
<span>{{ item }}</span>
|
||||
<el-checkbox-group
|
||||
v-model="scope.row.checkedRates[item]"
|
||||
style="display: inline-block; margin-left: 15px"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="(rateItem, rateIndex) in scope.row.rate[item]"
|
||||
:key="rateIndex"
|
||||
:value="rateItem.rate"
|
||||
@change="(value) => handleRateChange(value, rateItem, scope.row)"
|
||||
border
|
||||
size="small"
|
||||
style="margin-right: 15px"
|
||||
>
|
||||
{{ rateItem.rate }}
|
||||
<template v-if="rateItem.practitionerName">
|
||||
{{ rateItem.practitionerName }}
|
||||
</template>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<el-empty v-else description="点击查询获取患者医嘱信息"></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPrescriptionList, adviceExecute, adviceCancel, medicineSummary } from './api';
|
||||
import { patientInfoList } from '../store/patient.js';
|
||||
import { formatDate, formatDateStr } from '@/utils/index';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
|
||||
const activeNames = ref([]);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const prescriptionList = ref([]);
|
||||
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const therapyEnum = ref(undefined);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
requestStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
deadline: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
function handleGetPrescription() {
|
||||
if (patientInfoList.value.length > 0) {
|
||||
loading.value = true;
|
||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||
getPrescriptionList({
|
||||
encounterIds: encounterIds,
|
||||
pageSize: 10000,
|
||||
pageNo: 1,
|
||||
therapyEnum: therapyEnum.value,
|
||||
exeStatus: props.exeStatus,
|
||||
requestStatus: props.requestStatus,
|
||||
}).then((res) => {
|
||||
// try {
|
||||
// 根据encounterId分组
|
||||
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
|
||||
let times = new Set();
|
||||
let rate = {};
|
||||
let checkedRates = {};
|
||||
// 汇总时间点 默认全部汇总
|
||||
prescription.dispenseIds = [];
|
||||
prescription.medicineSummaryParamList.forEach((item) => {
|
||||
// 已汇总的时间点不需要显示
|
||||
if (item.dispenseStatus != 8) {
|
||||
prescription.dispenseIds.push({
|
||||
dispenseId: item.dispenseId,
|
||||
receiverId: userStore.id,
|
||||
});
|
||||
|
||||
// 将全部的时间点拆分 把日期去重,页面显示示例 05-15 [01:30 02:30 03:30]
|
||||
let time = item.dispenseTime.substring(5, 10);
|
||||
let rateTime = item.dispenseTime.substring(11, 16);
|
||||
times.add(time);
|
||||
rate[time] = rate[time] || [];
|
||||
rate[time].push({ rate: rateTime, dispenseId: item.dispenseId });
|
||||
checkedRates[time] = checkedRates[time] || [];
|
||||
checkedRates[time].push(rateTime);
|
||||
}
|
||||
});
|
||||
|
||||
prescription.times = Array.from(times);
|
||||
prescription.rate = rate;
|
||||
prescription.checkedRates = checkedRates;
|
||||
// 把相同encounterId的医嘱放在同一个数组中
|
||||
const encounterId = prescription.encounterId;
|
||||
if (!groups[encounterId]) {
|
||||
groups[encounterId] = [];
|
||||
}
|
||||
if (!activeNames.value.includes(encounterId)) {
|
||||
activeNames.value.push(encounterId);
|
||||
}
|
||||
groups[encounterId].push(prescription);
|
||||
return groups;
|
||||
}, {});
|
||||
|
||||
// 将分组结果转换为数组形式
|
||||
prescriptionList.value = Object.values(groupedPrescriptions);
|
||||
loading.value = false;
|
||||
// } catch {
|
||||
// loading.value = false;
|
||||
// }
|
||||
});
|
||||
chooseAll.value = false;
|
||||
} else {
|
||||
prescriptionList.value = [];
|
||||
// proxy.$message.warning('请选择患者');
|
||||
}
|
||||
}
|
||||
|
||||
function handleMedicineSummary() {
|
||||
let paramList = getSelectRows();
|
||||
let ids = [];
|
||||
paramList = paramList.forEach((item) => {
|
||||
ids.push(...item.dispenseIds);
|
||||
});
|
||||
medicineSummary(ids).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$message.success('操作成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
});
|
||||
return list;
|
||||
}
|
||||
function handleRateChange(value, item, row) {
|
||||
// 拼接当前选中时间
|
||||
if (value) {
|
||||
row.dispenseIds.push({ dispenseId: item.dispenseId, receiverId: userStore.id });
|
||||
} else {
|
||||
row.dispenseIds.splice(
|
||||
row.dispenseIds.findIndex((k) => {
|
||||
return k.dispenseId === item.dispenseId;
|
||||
}),
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleGetPrescription,
|
||||
handleMedicineSummary,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-collapse-icon-position-left :deep(.el-collapse-item__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 表头背景色 */
|
||||
:deep(.prescription-table .el-table__header th) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
color: #606266;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div style="height: calc(100vh - 176px)">
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table
|
||||
:data="medicineSummaryFormList"
|
||||
border
|
||||
:ref="'tableRef' + index"
|
||||
:header-cell-style="{ background: '#eef9fd !important' }"
|
||||
>
|
||||
<el-table-column label="单据号" prop="busNo" align="center" width="180" />
|
||||
<el-table-column label="申请时间" align="center" prop="applyTime" />
|
||||
<el-table-column label="发药时间" align="center" prop="dispenseTime" />
|
||||
<el-table-column label="药房" align="center" prop="locationName" />
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" />
|
||||
<el-table-column label="领药人" align="center" prop="receiverName" />
|
||||
<el-table-column label="发药状态" align="center" prop="statusEnum_enumText" />
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="getDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="汇总单详情" width="900">
|
||||
<el-table
|
||||
:data="medicineSummaryFormDetails"
|
||||
border
|
||||
:header-cell-style="{ background: '#eef9fd !important' }"
|
||||
>
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="药品名称" prop="itemName" align="center" />
|
||||
<el-table-column label="规格" prop="totalVolume" align="center" width="180" />
|
||||
<el-table-column label="批次号" prop="lotNumber" align="center" width="180" />
|
||||
<el-table-column label="数量" prop="itemQuantity" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.itemQuantity + ' ' + scope.row.minUnitCode_dictText }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getMedicineSummary, getMedicineSummaryDetail } from './api';
|
||||
import { patientInfoList } from '../store/patient.js';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
|
||||
const medicineSummaryFormList = ref([]);
|
||||
const medicineSummaryFormDetails = ref([]);
|
||||
const dialogVisible = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
requestStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
});
|
||||
|
||||
handleGetPrescription();
|
||||
function handleGetPrescription() {
|
||||
loading.value = true;
|
||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||
getMedicineSummary({}).then((res) => {
|
||||
medicineSummaryFormList.value = res.data.records;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 获取发药单详情
|
||||
function getDetail(row) {
|
||||
getMedicineSummaryDetail({ summaryNo: row.busNo }).then((res) => {
|
||||
medicineSummaryFormDetails.value = res.data;
|
||||
dialogVisible.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
function handleExecute() {
|
||||
let list = getSelectRows();
|
||||
list = list.map((item) => {
|
||||
return {
|
||||
requestId: item.requestId,
|
||||
accountId: item.accountId,
|
||||
adviceTable: item.adviceTable,
|
||||
executeTimes: item.executeTimes,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
console.log(list, 'list');
|
||||
list = list.map((item) => {
|
||||
return {
|
||||
procedureId: item.procedureId,
|
||||
executeTimes: item.cancelTimes,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个日期之间的所有日期(包含起始和结束日期)
|
||||
* @param {string|Date} startDate - 开始日期
|
||||
* @param {string|Date} endDate - 结束日期
|
||||
* @returns {Array<string>} 格式为MM-DD的日期数组
|
||||
*/
|
||||
function getDateRange(startDate, endDate) {
|
||||
const start = new Date(startDate);
|
||||
const end = new Date(endDate);
|
||||
|
||||
// 重置时间部分,只保留日期
|
||||
start.setHours(0, 0, 0, 0);
|
||||
end.setHours(0, 0, 0, 0);
|
||||
|
||||
const dates = [];
|
||||
const current = new Date(start);
|
||||
|
||||
// 循环添加日期直到结束日期
|
||||
while (current <= end) {
|
||||
// 格式化为MM-DD
|
||||
const month = String(current.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(current.getDate()).padStart(2, '0');
|
||||
dates.push(`${month}-${day}`);
|
||||
|
||||
// 移动到下一天
|
||||
current.setDate(current.getDate() + 1);
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
|
||||
function handleRateChange(value, date, time, row) {
|
||||
// 拼接当前选中时间
|
||||
let tiemStr = row.year + '-' + date + ' ' + time + ':00';
|
||||
if (value) {
|
||||
row.executeTimes.push(tiemStr);
|
||||
} else {
|
||||
row.executeTimes.splice(row.executeTimes.indexOf(tiemStr), 1);
|
||||
}
|
||||
console.log(row.executeTimes, 'row.executeTimes');
|
||||
}
|
||||
|
||||
function handelSwicthChange(value) {
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
proxy.$refs['tableRef' + index][0].toggleAllSelection();
|
||||
});
|
||||
}
|
||||
|
||||
// 处理后端返回的时间集合
|
||||
function handleTime() {}
|
||||
|
||||
defineExpose({
|
||||
handleGetPrescription,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-collapse-icon-position-left :deep(.el-collapse-item__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 表头背景色 */
|
||||
:deep(.prescription-table .el-table__header th) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
color: #606266;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,26 +1,296 @@
|
||||
<template>
|
||||
<div class="drugDistribution-container">
|
||||
<patientList />
|
||||
<DrugDistributionList />
|
||||
<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: 100%">
|
||||
<div
|
||||
style="
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: solid 2px #e4e7ed;
|
||||
padding: 0 15px;
|
||||
background: linear-gradient(90deg, #f0f8ff, #e6f7ff);
|
||||
"
|
||||
>
|
||||
<div class="nav-button-group">
|
||||
<el-button
|
||||
v-for="nav in navigationButtons"
|
||||
:key="nav.path"
|
||||
:type="currentRoute.path === nav.path ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="navigateTo(nav.path)"
|
||||
class="nav-button"
|
||||
:class="{ 'active-nav': currentRoute.path === nav.path }"
|
||||
>
|
||||
<el-icon v-if="nav.icon"><component :is="nav.icon" /></el-icon>
|
||||
<span>{{ nav.label }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
height: 50px;
|
||||
border-bottom: 2px solid #e4e7ed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<el-radio-group class="ml10" v-model="drugType">
|
||||
<el-radio-button label="西药" value="1" />
|
||||
<el-radio-button label="中药" value="2" />
|
||||
</el-radio-group>
|
||||
<el-radio-group class="ml20" v-model="isDetails" @change="handleRadioChange">
|
||||
<el-radio-button label="明细" value="1" />
|
||||
<el-radio-button label="汇总" value="2" />
|
||||
</el-radio-group>
|
||||
<span class="descriptions-item-label">截止时间:</span>
|
||||
<el-date-picker
|
||||
v-model="deadline"
|
||||
type="datetime"
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
value-format="YYYY/MM/DD HH:mm:ss"
|
||||
:clearable="false"
|
||||
@change="handleGetPrescription"
|
||||
/>
|
||||
<el-radio-group v-model="therapyEnum" class="ml20" @change="handleRadioChange">
|
||||
<el-radio :value="undefined">全部</el-radio>
|
||||
<el-radio :value="1">长期</el-radio>
|
||||
<el-radio :value="2">临时</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button class="ml20" type="primary" plain @click="handleGetPrescription">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<span class="descriptions-item-label">全选:</span>
|
||||
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
|
||||
<el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
<PrescriptionList
|
||||
v-if="isDetails == 1"
|
||||
ref="prescriptionRefs"
|
||||
:exeStatus="exeStatus"
|
||||
:requestStatus="requestStatus"
|
||||
:deadline="deadline"
|
||||
/>
|
||||
<SummaryMedicineList v-else />
|
||||
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
||||
<el-tab-pane
|
||||
v-for="tab in prescriptionTabs"
|
||||
:key="tab.name"
|
||||
:lazy="true"
|
||||
:label="tab.label"
|
||||
:name="tab.name"
|
||||
>
|
||||
<PrescriptionList
|
||||
:exeStatus="exeStatus"
|
||||
:requestStatus="requestStatus"
|
||||
:ref="(el) => setPrescriptionRef(el, tab.name)"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup >
|
||||
import patientList from './patientList.vue'
|
||||
import DrugDistributionList from './drugDistributionList.vue'
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.drugDistribution-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.patientList-container {
|
||||
flex: none;
|
||||
width: 240px;
|
||||
}
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import PatientList from './components/patientList.vue';
|
||||
import PrescriptionList from './components/prescriptionList.vue';
|
||||
import SummaryMedicineList from './components/summaryMedicineList.vue';
|
||||
|
||||
.medicalOrderList-container {
|
||||
flex: 1;
|
||||
const { proxy } = getCurrentInstance();
|
||||
const router = useRouter();
|
||||
const currentRoute = useRoute();
|
||||
|
||||
const activeName = ref('preparation');
|
||||
const active = ref('first');
|
||||
const exeStatus = ref(1);
|
||||
const deadline = ref(proxy.formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const requestStatus = ref(3);
|
||||
const chooseAll = ref(false);
|
||||
const drugType = ref('1');
|
||||
const isDetails = ref('1');
|
||||
|
||||
// 存储子组件引用的对象
|
||||
const prescriptionRefs = ref();
|
||||
|
||||
// 导航按钮配置
|
||||
const navigationButtons = ref([
|
||||
{
|
||||
label: '入出转',
|
||||
path: '/inHospital/statistics/inOut',
|
||||
icon: 'Document',
|
||||
},
|
||||
{
|
||||
label: '护理记录',
|
||||
path: '/inHospital/statistics/nursingRecord',
|
||||
icon: 'MedicineBox',
|
||||
},
|
||||
{
|
||||
label: '三测单',
|
||||
path: '/inHospital/statistics/tprChart',
|
||||
icon: 'List',
|
||||
},
|
||||
{
|
||||
label: '医嘱执行',
|
||||
path: '/inHospital/statistics/medicalOrderExecution',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '医嘱校对',
|
||||
path: '/inHospital/statistics/medicalOrderProofread',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '汇总发药申请',
|
||||
path: '/inHospital/statistics/drugDistribution',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '住院记账',
|
||||
path: '/inHospital/statistics/InpatientBilling',
|
||||
icon: 'Back',
|
||||
},
|
||||
]);
|
||||
|
||||
// 页面导航方法
|
||||
const navigateTo = (path) => {
|
||||
router.push(path);
|
||||
};
|
||||
|
||||
// 定义处方列表tabs配置
|
||||
const prescriptionTabs = [
|
||||
{ label: '待执行', name: 'preparation' },
|
||||
{ label: '已执行', name: 'completed' },
|
||||
{ label: '不执行', name: 'stopped' },
|
||||
{ label: '取消执行', name: 'cancel' },
|
||||
];
|
||||
|
||||
function handleClick(tabName) {
|
||||
// tabName是tab的name属性值
|
||||
const activeTabName = tabName || activeName.value;
|
||||
|
||||
switch (activeTabName) {
|
||||
case 'preparation':
|
||||
// 执行状态待执行
|
||||
exeStatus.value = 1;
|
||||
// 请求状态已校对
|
||||
requestStatus.value = 3;
|
||||
break;
|
||||
case 'completed':
|
||||
exeStatus.value = 6;
|
||||
break;
|
||||
case 'stopped':
|
||||
exeStatus.value = 5;
|
||||
break;
|
||||
case 'cancel':
|
||||
exeStatus.value = 9;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function handleGetPrescription() {
|
||||
prescriptionRefs.value.handleGetPrescription();
|
||||
}
|
||||
|
||||
function handelSwicthChange() {
|
||||
if (chooseAll.value) {
|
||||
proxy.$refs['prescriptionRefs'].selectAllRows();
|
||||
} else {
|
||||
proxy.$refs['prescriptionRefs'].clearSelection();
|
||||
}
|
||||
}
|
||||
|
||||
function handleRadioChange(value) {
|
||||
if (value == '1') {
|
||||
handleGetPrescription();
|
||||
}
|
||||
}
|
||||
|
||||
function handleExecute() {
|
||||
proxy.$refs['prescriptionRefs'].handleMedicineSummary();
|
||||
}
|
||||
|
||||
provide('handleGetPrescription', (value) => {
|
||||
prescriptionRefs.value.handleGetPrescription();
|
||||
});
|
||||
</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;
|
||||
}
|
||||
|
||||
.nav-button-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.nav-button {
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.nav-button:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.nav-button.active-nav {
|
||||
box-shadow: 0 4px 8px rgba(64, 158, 255, 0.3);
|
||||
}
|
||||
|
||||
.nav-button :deep(.el-icon) {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,12 @@
|
||||
// 选择患者信息
|
||||
export const patientInfo = ref()
|
||||
export function updatePatientInfo(info) {
|
||||
patientInfo.value = info
|
||||
}
|
||||
|
||||
// 多选患者
|
||||
export const patientInfoList = ref([])
|
||||
export function updatePatientInfoList(info) {
|
||||
patientInfoList.value = info
|
||||
}
|
||||
|
||||
@@ -50,7 +50,18 @@ export function adviceExecute(data) {
|
||||
export function adviceCancel(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-cancel',
|
||||
method: 'post',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*/
|
||||
export function adviceNoExecute(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-void',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -39,6 +39,14 @@
|
||||
>
|
||||
执行选中
|
||||
</el-button>
|
||||
<el-button
|
||||
class="ml20"
|
||||
type="primary"
|
||||
@click="handleNoExecute"
|
||||
:disabled="props.exeStatus == 6"
|
||||
>
|
||||
不执行
|
||||
</el-button>
|
||||
<el-button
|
||||
class="ml20 mr20"
|
||||
type="danger"
|
||||
@@ -182,13 +190,7 @@
|
||||
:key="rateIndex"
|
||||
:value="rateItem.rate"
|
||||
@change="
|
||||
(value) =>
|
||||
handleRateChange(
|
||||
value,
|
||||
item,
|
||||
scope.row.checkedRates[timeIndex],
|
||||
scope.row
|
||||
)
|
||||
(value) => handleRateChange(value, item, rateItem.rate, scope.row, rateItem)
|
||||
"
|
||||
border
|
||||
size="small"
|
||||
@@ -212,7 +214,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPrescriptionList, adviceExecute, adviceCancel } from './api';
|
||||
import { getPrescriptionList, adviceExecute, adviceCancel, adviceNoExecute } from './api';
|
||||
import { patientInfoList } from '../store/patient.js';
|
||||
import { formatDate, formatDateStr } from '@/utils/index';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
@@ -274,12 +276,15 @@ function handleGetPrescription() {
|
||||
prescription.procedureIds = [];
|
||||
// 添加复选框状态管理
|
||||
prescription.checkedRates = {};
|
||||
// 已执行时间点列表
|
||||
let exeTimeList = prescription.exePerformRecordList.map((item) => {
|
||||
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
// 不执行时间点列表
|
||||
let stopTimeList = prescription.stopPerformRecordList.map((item) => {
|
||||
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
// 取消执行时间点列表
|
||||
let cancelTimeList = prescription.cancelPerformRecordList.map((item) => {
|
||||
return formatDateStr(item.occurrenceTime, 'YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
@@ -295,22 +300,23 @@ function handleGetPrescription() {
|
||||
let rateItems = [];
|
||||
rate.forEach((rateItem) => {
|
||||
let dateStr = prescription.year + '-' + time + ' ' + rateItem + ':00';
|
||||
prescription.executeTimes.push(dateStr);
|
||||
switch (props.exeStatus) {
|
||||
case 1:
|
||||
// 如果该时间点未执行,则加入待选中列表
|
||||
if (!exeTimeList.includes(dateStr)) {
|
||||
case 1: // 待执行tab
|
||||
// 如果该时间点未执行并且不在不执行列表中,则加入待选中列表
|
||||
if (!exeTimeList.includes(dateStr) && !stopTimeList.includes(dateStr)) {
|
||||
rateItems.push({
|
||||
rate: rateItem,
|
||||
});
|
||||
checkedRatesForTime.push(rateItem);
|
||||
prescription.executeTimes.push(dateStr);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 6: // 已执行tab
|
||||
let index = exeTimeList.findIndex((item) => {
|
||||
return item == dateStr;
|
||||
});
|
||||
if (index != -1) {
|
||||
// 显示执行人practitionerName
|
||||
rateItems.push({
|
||||
procedureId: prescription.exePerformRecordList[index].procedureId,
|
||||
practitionerName: prescription.exePerformRecordList[index].practitionerName,
|
||||
@@ -318,18 +324,30 @@ function handleGetPrescription() {
|
||||
});
|
||||
checkedRatesForTime.push(rateItem);
|
||||
}
|
||||
// 这里把时间点都加到执行时间列表中,后续遍历全部执行者id用
|
||||
prescription.executeTimes.push(dateStr);
|
||||
break;
|
||||
case 5:
|
||||
case 5: // 不执行tab
|
||||
let index1 = stopTimeList.findIndex((item) => {
|
||||
return item == dateStr;
|
||||
});
|
||||
if (stopTimeList.includes(dateStr)) {
|
||||
// 显示执行人practitionerName
|
||||
rateItems.push({
|
||||
practitionerName: prescription.stopPerformRecordList[index1].practitionerName,
|
||||
rate: rateItem,
|
||||
});
|
||||
checkedRatesForTime.push(rateItem);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
case 9: // 取消执行tab
|
||||
let index2 = cancelTimeList.findIndex((item) => {
|
||||
return item == dateStr;
|
||||
});
|
||||
if (cancelTimeList.includes(dateStr)) {
|
||||
rateItems.push({
|
||||
practitionerName:
|
||||
prescription.cancelPerformRecordList[index2].practitionerName,
|
||||
rate: rateItem,
|
||||
});
|
||||
checkedRatesForTime.push(rateItem);
|
||||
@@ -352,8 +370,7 @@ function handleGetPrescription() {
|
||||
prescription.times = validTimes;
|
||||
prescription.rate = validRates;
|
||||
prescription.checkedRates = newCheckedRates;
|
||||
|
||||
// 处理已执行记录
|
||||
// 处理已执行记录,拿到全部的执行人id,取消执行时候要传id
|
||||
prescription.exePerformRecordList.forEach((item) => {
|
||||
if (prescription.executeTimes.includes(item.occurrenceTime)) {
|
||||
prescription.procedureIds.push(item.procedureId);
|
||||
@@ -386,6 +403,7 @@ function handleGetPrescription() {
|
||||
}
|
||||
}
|
||||
|
||||
// 执行
|
||||
function handleExecute() {
|
||||
let list = getSelectRows();
|
||||
list = list.map((item) => {
|
||||
@@ -404,16 +422,41 @@ function handleExecute() {
|
||||
});
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
// 不执行
|
||||
function handleNoExecute() {
|
||||
let list = getSelectRows();
|
||||
console.log(list, 'list');
|
||||
list = list.map((item) => {
|
||||
return {
|
||||
procedureId: item.procedureId,
|
||||
executeTimes: item.cancelTimes,
|
||||
requestId: item.requestId,
|
||||
encounterId: item.encounterId,
|
||||
patientId: item.patientId,
|
||||
adviceTable: item.adviceTable,
|
||||
executeTimes: item.executeTimes,
|
||||
};
|
||||
});
|
||||
adviceCancel({ adviceExecuteParam: list }).then((res) => {
|
||||
console.log(list, 'list');
|
||||
adviceNoExecute({ adviceExecuteDetailList: list }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
handleGetPrescription();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 取消执行
|
||||
function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
let producerIds = [];
|
||||
list.forEach((item) => {
|
||||
producerIds.push(
|
||||
...item.procedureIds.map((value) => {
|
||||
return {
|
||||
procedureId: value,
|
||||
therapyEnum: item.therapyEnum,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
handleGetPrescription();
|
||||
}
|
||||
@@ -459,15 +502,18 @@ function getDateRange(startDate, endDate) {
|
||||
return dates;
|
||||
}
|
||||
|
||||
function handleRateChange(value, date, time, row) {
|
||||
function handleRateChange(value, date, time, row, rateItem) {
|
||||
// 拼接当前选中时间
|
||||
let tiemStr = row.year + '-' + date + ' ' + time + ':00';
|
||||
let index = row.executeTimes.indexOf(tiemStr);
|
||||
debugger;
|
||||
if (value) {
|
||||
row.executeTimes.push(tiemStr);
|
||||
row.procedureIds.push(rateItem.producerId);
|
||||
} else {
|
||||
row.executeTimes.splice(row.executeTimes.indexOf(tiemStr), 1);
|
||||
row.procedureIds.splice(row.executeTimes.indexOf(rateItem.producerId), 1);
|
||||
}
|
||||
console.log(row.executeTimes, 'row.executeTimes');
|
||||
}
|
||||
|
||||
function handelSwicthChange(value) {
|
||||
|
||||
@@ -93,7 +93,6 @@ function handleTabClick(tabName) {
|
||||
}
|
||||
// 调用子组件方法
|
||||
nextTick(() => {
|
||||
debugger;
|
||||
console.log(prescriptionRefs.value[activeTabName], '1');
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user