提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -1,8 +1,56 @@
<template>
<<<<<<< HEAD
<el-dialog v-model="dialogVisible" title="补费" width="90%" :close-on-click-modal="false">
<!-- 弹窗内容 - 左右布局 -->
<div style="display: flex; gap: 20px; height: 70vh">
<!-- 左侧收费组套列表 - 卡片式布局 -->
=======
<el-dialog v-model="dialogVisible" title="补费" width="80%" :close-on-click-modal="false">
<div style="font-size: 16px; font-weight: bold; margin-bottom: 10px">
患者信息{{
props.patientInfo.patientName +
' ' +
props.patientInfo.genderEnum_enumText +
' ' +
props.patientInfo.age
}}
| 住院号{{ props.patientInfo.busNo }} | 科室{{ props.patientInfo.organizationName }} |
病区{{ props.patientInfo.wardName }} | 病房{{ props.patientInfo.houseName }} | 床号{{
props.patientInfo.bedName
}}
</div>
<div style="margin-bottom: 15px; display: flex; align-items: center; gap: 15px">
<el-select
v-model="adviceType"
placeholder="医嘱类型"
style="width: 200px"
@change="getAdviceBaseInfos"
>
<el-option
v-for="item in adviceTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<div>
<el-input
style="width: 400px"
v-model="searchText"
placeholder="输入项目名称"
@keydown.enter="getAdviceBaseInfos"
clearable
>
<template #append>
<el-button icon="Search" @click="getAdviceBaseInfos"></el-button>
</template>
</el-input>
</div>
<el-button type="primary">划价组套</el-button>
</div>
<!-- 弹窗内容 - 左右布局 -->
<div style="display: flex; gap: 20px; height: 70vh">
>>>>>>> v1.3
<div
style="
width: 250px;
@@ -12,6 +60,7 @@
flex-direction: column;
"
>
<<<<<<< HEAD
<!-- 搜索框 -->
<div style="padding: 10px; border-bottom: 1px solid #e4e7ed">
<el-input v-model="groupSearchText" placeholder="输入组套名称" clearable />
@@ -31,11 +80,48 @@
<div class="group-name">{{ group.name }}</div>
<div class="group-info">
{{ getGroupInfo(group.id) }}
=======
<!-- 诊疗耗材 -->
<div
style="flex: 1; overflow-y: auto; padding: 10px; min-height: 200px"
v-loading="adviceLoading"
element-loading-text="正在努力加载..."
element-loading-background="rgba(255, 255, 255, 0.8)"
>
<div
v-for="item in AdviceBaseInfoList"
:key="item.id"
class="item-card"
@click="selectChange(item)"
>
<div class="item-status">
<span class="status-dot"></span>
{{ getItemType_Text(item.adviceType) }}
</div>
<div class="item-name">{{ item.adviceName }}</div>
<div class="item-name">
{{
item.priceList && item.priceList.length > 0
? (item.priceList[0].price / item.partPercent).toFixed(2) +
'元' +
'/' +
item.minUnitCode_dictText
: ''
}}
</div>
<div class="item-name" v-if="item.adviceType === 2">
库存数量
{{ handleQuantity(item) }}
>>>>>>> v1.3
</div>
</div>
<!-- 只显示暂无数据文本 -->
<div
<<<<<<< HEAD
v-if="chargeGroups.length === 0"
=======
v-if="AdviceBaseInfoList.length === 0"
>>>>>>> v1.3
style="text-align: center; color: #909399; padding: 20px"
>
暂无数据
@@ -48,6 +134,7 @@
<!-- 费用项目表格 -->
<el-table :data="feeItemsList" border style="width: 100%; flex: 1">
<el-table-column label="收费项目" prop="itemName" min-width="200">
<<<<<<< HEAD
<template #default="scope">
<el-input
v-model="scope.row.itemName"
@@ -57,11 +144,30 @@
</template>
</el-table-column>
<el-table-column label="单价" prop="unitPrice" width="100" align="center">
=======
<!-- <template #default="scope">
<el-input
v-model="scope.row.adviceName"
placeholder="请输入收费项目"
style="width: 100%"
/>
</template> -->
<template #default="scope">
{{ scope.row.adviceName }}
{{
scope.row.volume === '-' || !scope.row.volume ? '' : '[' + scope.row.volume + ']'
}}
</template>
</el-table-column>
<!-- 单价 - 简化版 -->
<el-table-column label="单价" width="200" align="center">
>>>>>>> v1.3
<template #default="scope">
<el-input-number
v-model="scope.row.unitPrice"
:min="0"
:step="0.01"
<<<<<<< HEAD
precision="2"
style="width: 100px"
@change="calculateTotalAmount"
@@ -69,12 +175,21 @@
</template>
</el-table-column>
<el-table-column label="计费数量" prop="quantity" width="100" align="center">
=======
precision="6"
style="width: 150px"
/>
</template>
</el-table-column>
<el-table-column label="计费数量" prop="quantity" width="150" align="center">
>>>>>>> v1.3
<template #default="scope">
<el-input-number
v-model="scope.row.quantity"
:min="1"
:step="1"
style="width: 100px"
<<<<<<< HEAD
@change="calculateTotalAmount"
/>
</template>
@@ -92,10 +207,88 @@
<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-column label="最小单位" prop="minUnitCode_dictText" width="100" align="center">
<template #default="scope">
{{ scope.row.minUnitCode_dictText }}
</template>
</el-table-column> -->
<el-table-column label="单位" width="140" align="center">
<template #default="scope">
<el-select
v-model="scope.row.selectUnitCode"
placeholder="单位"
style="width: 100px"
@change="unitCodeChange(scope.row)"
>
<el-option
v-for="unit in scope.row.uniqueUnitCodes"
:key="unit.code"
:label="unit.codeText"
:value="unit.code"
/>
</el-select>
</template>
</el-table-column>
<!-- 优化后的金额列 -->
<el-table-column label="金额" width="100" align="center">
<template #default="scope">
{{ (scope.row.unitPrice * scope.row.quantity).toFixed(6) }}
</template>
</el-table-column>
<el-table-column label="执行科室/位置" prop="dept" width="250" align="center">
<template #default="scope">
<el-select
v-if="scope.row.adviceType == 3"
clearable
filterable
v-model="scope.row.positionId"
placeholder="选择科室"
style="width: 220px"
>
<el-option
v-for="dept in departmentOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
/>
</el-select>
<el-select
v-if="scope.row.adviceType == 2"
clearable
filterable
v-model="scope.row.positionId"
placeholder="选择药房/耗材房"
style="width: 220px"
>
<el-option
v-for="dept in locationOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="医保等级" prop="chrgitmLv_dictText" width="150" align="center">
<template #default="scope">
{{ scope.row.chrgitmLv_dictText }}
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
<el-button type="text" size="small" @click="feeItemsList.splice(scope.$index, 1)">
删除
</el-button>
>>>>>>> v1.3
</template>
</el-table-column>
</el-table>
<<<<<<< HEAD
<!-- 添加项目按钮 - 移到右侧费用项目表格下方 -->
<div
style="
@@ -113,6 +306,8 @@
+ 添加项目
</div>
=======
>>>>>>> v1.3
<!-- 底部信息区域 -->
<div style="margin-top: 20px; display: flex; flex-wrap: wrap; gap: 15px">
<div style="display: flex; align-items: center">
@@ -126,6 +321,7 @@
style="width: 200px"
/>
</div>
<<<<<<< HEAD
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">执行科室</span>
@@ -158,6 +354,9 @@
</div>
</div>
=======
</div>
>>>>>>> v1.3
<!-- 总金额和操作按钮 -->
<div
style="
@@ -168,7 +367,11 @@
"
>
<div style="font-size: 14px; font-weight: bold; text-align: right">
<<<<<<< HEAD
本次补费总金额<span style="color: #ff4d4f">{{ totalAmount.toFixed(2) }}</span>
=======
本次补费总金额<span style="color: #ff4d4f">{{ totalAmount.toFixed(6) }}</span>
>>>>>>> v1.3
</div>
<div>
<el-button @click="handleCancel">取消</el-button>
@@ -181,9 +384,19 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, computed, onMounted, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { formatDateStr } from '@/utils/index';
=======
import { ref, computed, onMounted, watch, reactive } from 'vue';
import { ElMessage } from 'element-plus';
import { formatDateStr } from '@/utils/index';
import { getAdviceBaseInfo, getOrgList, getDiseaseTreatmentInitLoc } from './api.js';
import useUserStore from '@/store/modules/user';
import { get } from 'lodash';
import { lo } from 'element-plus/es/locales.mjs';
>>>>>>> v1.3
// Props定义
const props = defineProps({
@@ -196,8 +409,13 @@ const props = defineProps({
default: () => [],
},
patientInfo: {
<<<<<<< HEAD
type: String,
default: '',
=======
type: Object, // 通常这类信息是对象,这里假设你已经修正了类型
default: () => ({}),
>>>>>>> v1.3
},
});
@@ -209,6 +427,7 @@ const dialogVisible = computed({
get: () => props.visible,
set: (value) => emit('update:visible', value),
});
<<<<<<< HEAD
const searchItemText = ref('');
const selectedItemName = ref('');
const feeTabs = ref('chargeItems');
@@ -226,11 +445,111 @@ const groupSearchText = ref('');
const totalAmount = computed(() => {
return feeItemsList.value.reduce((sum, item) => {
return sum + (item.unitPrice || 0) * (item.quantity || 0);
=======
const adviceTypeList = ref([
{ label: '耗材', value: 2 },
{ label: '诊疗', value: 3 },
{ label: '全部', value: '' },
]);
const adviceType = ref('');
const feeItemsList = ref([]);
const executeTime = ref('');
const departmentOptions = ref([]);
const AdviceBaseInfoList = ref([]);
const locationOptions = ref([]);
const searchText = ref('');
const userId = ref('');
const orgId = ref('');
const queryParams = ref({
pageSize: 100,
pageNum: 1,
adviceTypes: '2,3',
});
/**
* 医嘱提交数据模型
* @type {object}
* @property {number} organizationId - 提交机构ID
* @property {string} startTime - 开始时间 (ISO格式字符串如 '2023-10-27T10:00:00')
* @property {string} authoredTime - 开立时间
* @property {Array<RegAdviceItem>} regAdviceSaveList - 医嘱项目列表
*/
const submitData = reactive({
organizationId: 0,
startTime: '',
authoredTime: '',
regAdviceSaveList: [
{
dbOpType: '1', // '1':新增, '2': 修改, '3': 删除 (签发操作时传1)
adviceType: 0, // 1:药品 , 2: 耗材 , 3:项目
requestId: 0, // 请求ID
chargeItemId: 0, // 费用项id
contentJson: '',
categoryCode: '', // 医嘱详细分类代码,来自数据字典
positionId: 0, // 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
pharmacologyCategoryCode: '', // 药理分类代码
partPercent: 0.0, // 拆零比
partAttributeEnum: 0, // 拆分属性-门诊
executeNum: 0, // 执行次数
prescriptionNo: '', // 处方号
quantity: 0.0, // 数量
dispensePerDuration: 0, // 每次发药供应天数
unitCode: '', // 包装单位
unitPrice: 0.0, // 单价
totalPrice: 0.0, // 总价
definitionId: 0, // 费用定价主表ID
definitionDetailId: 0, // 费用定价子表ID
lotNumber: '', // 默认产品批号
statusEnum: 0, // 请求状态
categoryEnum: 0, // 请求类型枚举 (与categoryCode的区别这是程序内部使用的数字枚举用于逻辑判断)
adviceDefinitionId: 0, // 医嘱定义ID
adviceTableName: '', // 医嘱定义对应表名
adviceName: '', // 医嘱名称
minUnitQuantity: 0.0, // 请求小单位数量
patientId: 0, // 患者ID
practitionerId: 0, // 开方医生ID
locationId: 0, // 请求发起的位置ID
performLocation: 0, // 发放/执行位置ID
founderOrgId: 0, // 开方人科室ID
encounterId: 0, // 就诊ID
accountId: 0, // 账户ID
conditionId: 0, // 诊断ID
encounterDiagnosisId: 0, // 就诊诊断ID
conditionDefinitionId: 0, // 诊断定义ID | 分方使用
therapyEnum: 0, // 治疗类型
methodCode: '', // 用法代码
rateCode: '', // 使用频次代码
dose: 0.0, // 单次剂量
firstDose: 0.0, // 首次用量
doseUnitCode: '', // 剂量单位代码
skinTestFlag: 0, // 是否皮试标识
injectFlag: 0, // 是否为注射药物
groupId: 0, // 分组id, 一组药品共用一个id
packageId: 0, // 组套id
activityId: 0, // 活动(项目)定义id
ybClassEnum: 0, // 类别医保编码
chineseHerbsDoseQuantity: 0.0, // 中药付数
sufferingFlag: 0, // 代煎标识 | 0:否 , 1:是
dosageInstruction: '', // 用药说明
sortNumber: 0, // 排序号
basedOnId: 0, // 请求基于什么的ID
},
],
});
const adviceLoading = ref(false);
// 【优化核心】计算总金额 - 使用计算属性实现实时更新
const totalAmount = computed(() => {
return feeItemsList.value.reduce((sum, item) => {
const price = Number(item.unitPrice) || 0;
const quantity = Number(item.quantity) || 0;
return sum + price * quantity;
>>>>>>> v1.3
}, 0);
});
// 初始化
onMounted(() => {
<<<<<<< HEAD
// 加载科室选项
loadDepartmentOptions();
// 加载收费组套数据
@@ -248,15 +567,32 @@ watch(
{ deep: true }
);
=======
const userStore = useUserStore();
userId.value = userStore.id;
orgId.value = userStore.orgId;
console.log(props.patientInfo, 'patientInfo in FeeDialog');
console.log('initialData in FeeDialog');
loadDepartmentOptions();
getAdviceBaseInfos();
getDiseaseInitLoc();
});
>>>>>>> v1.3
// 监听弹窗显示状态
watch(
() => props.visible,
(visible) => {
if (visible) {
<<<<<<< HEAD
// 设置默认执行时间为当前时间
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
} else {
// 弹窗关闭时重置数据
=======
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
} else {
>>>>>>> v1.3
resetData();
}
}
@@ -264,6 +600,7 @@ watch(
// 加载科室选项
function loadDepartmentOptions() {
<<<<<<< HEAD
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
@@ -409,6 +746,119 @@ function calculateTotalAmount() {
// 更新每个项目的金额
feeItemsList.value.forEach((item) => {
item.amount = (item.unitPrice || 0) * (item.quantity || 0);
=======
getOrgList().then((res) => {
if (res.data && res.data.records && res.data.records.length > 0) {
departmentOptions.value = res.data.records[0].children || [];
}
});
}
// 加载收费组套数据
function getAdviceBaseInfos() {
adviceLoading.value = true;
queryParams.value.searchKey = searchText.value;
queryParams.value.adviceType = adviceType.value;
queryParams.value.organizationId = orgId.value;
queryParams.value.pricingFlag = 1; // 划价标记
getAdviceBaseInfo(queryParams.value)
.then((res) => {
AdviceBaseInfoList.value = res.data?.records || [];
})
.finally(() => {
adviceLoading.value = false;
});
}
function getDiseaseInitLoc() {
getDiseaseTreatmentInitLoc(16).then((response) => {
console.log('Disease Treatment Init Loc:', response);
locationOptions.value = response.data.locationOptions;
});
}
// 获取组套类型文本
function getItemType_Text(type) {
const map = { 2: '耗材', 3: '诊疗' };
return map[type] || '其他';
}
function getUnitCodeOptions(row) {
const unitCodes = [
{ code: row.unitCode, codeText: row.unitCode_dictText },
{ code: row.minUnitCode, codeText: row.minUnitCode_dictText },
];
// 使用 Set 来跟踪已经存在的 code
const seenCodes = new Set();
const uniqueUnitCodes = unitCodes.filter((item) => {
// 如果 Set 中没有这个 code就保留它并把它加入 Set
if (!seenCodes.has(item.code)) {
seenCodes.add(item.code);
return true;
}
// 如果已经存在,就过滤掉
return false;
});
return uniqueUnitCodes;
}
// 单位变更处理
function unitCodeChange(row) {
// 获取价格
const price = row.priceList?.[0]?.price || 0;
// 根据选择的单位调整单价
if (row.selectUnitCode === row.unitCode) {
// 如果选择的是大单位 (如 "盒")
row.unitPrice = price.toFixed(6); // 单价就是原价
} else if (row.selectUnitCode === row.minUnitCode) {
// 如果选择的是小单位 (如 "个")
row.unitPrice = (price / (row.partPercent || 1)).toFixed(6); // 单价 = 原价 / 拆零比
}
}
function handleQuantity(row) {
if (row.inventoryList && row.inventoryList.length > 0) {
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
return 0;
}
// 选择收费项目 - 添加到费用列表
function selectChange(row) {
console.log('Added item:', row, props.patientInfo);
if (row == null) {
return;
}
// 校验库存
if (row.adviceType === 2) {
if (!row.inventoryList || row.inventoryList.length === 0) {
ElMessage.warning(`"${row.adviceName}" 库存信息不可用,无法添加`);
return;
}
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
if (totalQuantity <= 0) {
ElMessage.warning(`"${row.adviceName}" 库存不足,无法添加`);
return;
}
}
// 检查是否已存在
const exists = feeItemsList.value.some(
(existing) => existing.adviceDefinitionId === row.adviceDefinitionId
);
if (exists) {
ElMessage.warning(`"${row.adviceName}" 已存在于费用列表中`);
return;
}
//获取价格
const price = row.priceList?.[0]?.price || 0;
//获取大小单位
const uniqueUnitCodes = getUnitCodeOptions(row);
//插入费用列表
feeItemsList.value.push({
...row,
uniqueUnitCodes: uniqueUnitCodes,
unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价
quantity: 1,
// positionId: row.positionId === null || row.positionId === undefined ? orgId : row.positionId, // 默认执行科室
selectUnitCode: row.minUnitCode, // 默认选择小单位
>>>>>>> v1.3
});
}
@@ -420,6 +870,7 @@ function handleCancel() {
// 确认操作
function handleConfirm() {
<<<<<<< HEAD
// 构建提交数据
const submitData = {
feeItems: feeItemsList.value,
@@ -442,6 +893,109 @@ function resetData() {
selectedDept.value = '';
selectedDoctor.value = '';
executor.value = '';
=======
if (feeItemsList.value.length === 0) {
ElMessage.warning('请至少添加一项费用项目');
return;
}
if (!executeTime.value) {
ElMessage.warning('请选择执行时间');
return;
}
//验证数据的完整性
if (feeItemsList.value.some((item) => !item.positionId)) {
ElMessage.warning('请为所有费用项目选择执行科室/位置');
return;
}
convertDataManually();
emit('confirm', submitData);
dialogVisible.value = false;
}
// 手动转换数据
function convertDataManually() {
// 从 feeItemsList.value 中提取机构ID
const organizationId = props.patientInfo.organizationId;
const encounterId = props.patientInfo.encounterId;
const patientId = props.patientInfo.patientId;
const accountId = props.patientInfo.accountId;
console.log('Submitting data for patientId:', props.patientInfo);
if (!organizationId || !encounterId || !patientId || !accountId) {
ElMessage.error('患者信息不完整,无法提交费用项目');
return;
}
// 设置提交数据的机构ID和时间
submitData.organizationId = organizationId;
submitData.startTime = executeTime.value;
submitData.authoredTime = executeTime.value;
// 清空并重新填充 regAdviceSaveList
submitData.regAdviceSaveList = feeItemsList.value.map((item) => {
// ... (这里是和上面computed中完全相同的映射逻辑)
const mappedItem = {
dbOpType: '1', // 默认为新增操作
adviceType: item.adviceType, // 1:药品 , 2: 耗材 , 3:项目
requestId: null, // 新增项ID为0
chargeItemId: null, // feeItemsList中没有直接对应的chargeItemId可能需要从chargeItemDefinitionId映射或设为0
contentJson: feeItemsList.value.length > 0 ? JSON.stringify(feeItemsList.value) : '',
categoryCode: item.categoryCode, //医嘱详细分类代码,来自数据字典
positionId: item.positionId, // 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
pharmacologyCategoryCode: item.pharmacologyCategoryCode || '', //药品性质 | 分方使用
partPercent: item.partPercent || 1.0, // 默认拆零比为1
partAttributeEnum: item.partAttributeEnum, //拆分属性-门诊
executeNum: 1, // 默认执行次数为1
prescriptionNo: '', // 处方号
quantity: item.quantity || 0.0, // 数量
// dispensePerDuration: 0, //每次发药供应天数
unitCode: item.unitCode || '',
unitPrice: item.unitPrice.toFixed(6) || 0.0, // 单价
totalPrice: ((item.quantity || 0) * (item.unitPrice || 0)).toFixed(6), // 计算总价
definitionId: item.chargeItemDefinitionId || 0,
definitionDetailId: 0,
lotNumber: item.defaultLotNumber || '',
// statusEnum: 1, // 假设默认为“待执行”状态
categoryEnum: item.categoryCode, // 简单映射项目类型枚举值可能与adviceType相同
adviceDefinitionId: item.adviceDefinitionId || '',
adviceTableName: item.adviceTableName || '',
adviceName: item.adviceName || '',
minUnitQuantity: item.quantity || 0.0, // 假设最小单位数量等于请求数量
patientId: patientId, // 需要从外部获取
practitionerId: userId.value, // 需要从外部获取
locationId: item.adviceType === 2 ? item.positionId : null, // 请求发起的位置ID
performLocation: item.adviceType === 2 ? item.positionId : null, // 发放位置ID
founderOrgId: organizationId, // 开方科室ID可能与机构ID相同
encounterId: encounterId, // 需要从外部获取
accountId: accountId, // 需要从外部获取
// conditionId: null, // 需要从外部获取
// encounterDiagnosisId: null, // 需要从外部获取
// conditionDefinitionId: null, // 需要从外部获取
therapyEnum: 2, // 默认治疗类型 1 长期 2 临时
methodCode: item.methodCode || '',
rateCode: item.rateCode || '',
dose: item.dose || null,
// firstDose: null, // 默认无首次用量
doseUnitCode: item.doseUnitCode || '',
skinTestFlag: item.skinTestFlag,
injectFlag: item.injectFlag, //注射药物 1:是 , 0:否
// groupId: null, // 默认不分组
// packageId: null, // 默认不是组套
activityId: item.adviceType === 3 ? item.adviceDefinitionId : null, // 如果是项目类型activityId可能等于adviceDefinitionId
// ybClassEnum: 0, // 默认医保类别
// chineseHerbsDoseQuantity: null, // 默认为0非中药
// sufferingFlag: null, // 默认不代煎
dosageInstruction: item.dosageInstruction || '', //用药说明
// sortNumber: 0, // 默认排序号
basedOnId: null, // 默认无基于ID
};
return mappedItem;
});
}
// 重置数据
function resetData() {
feeItemsList.value = [];
adviceType.value = '';
searchText.value = '';
executeTime.value = '';
>>>>>>> v1.3
}
</script>
@@ -449,6 +1003,7 @@ function resetData() {
:deep(.el-dialog__body) {
padding: 20px;
}
<<<<<<< HEAD
/* 添加项目按钮样式 */
:deep(
@@ -459,6 +1014,9 @@ function resetData() {
/* 收费组套卡片样式 */
.group-card {
=======
.item-card {
>>>>>>> v1.3
background: #ffffff;
border: 1px solid #e4e7ed;
border-radius: 6px;
@@ -468,14 +1026,22 @@ function resetData() {
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
<<<<<<< HEAD
.group-card:hover {
=======
.item-card:hover {
>>>>>>> v1.3
border-color: #409eff;
background-color: #ecf5ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
}
<<<<<<< HEAD
.group-status {
=======
.item-status {
>>>>>>> v1.3
display: flex;
align-items: center;
margin-bottom: 8px;
@@ -483,7 +1049,10 @@ function resetData() {
font-weight: 500;
color: #606266;
}
<<<<<<< HEAD
=======
>>>>>>> v1.3
.status-dot {
width: 8px;
height: 8px;
@@ -491,14 +1060,19 @@ function resetData() {
border-radius: 50%;
margin-right: 6px;
}
<<<<<<< HEAD
.group-name {
=======
.item-name {
>>>>>>> v1.3
font-size: 16px;
font-weight: 600;
color: #303133;
margin-bottom: 8px;
word-break: break-word;
}
<<<<<<< HEAD
.group-info {
font-size: 12px;
@@ -508,3 +1082,6 @@ function resetData() {
margin-top: 4px;
}
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -213,7 +213,11 @@
<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { formatDateStr } from '@/utils/index';
// 响应式数据
@@ -449,7 +453,11 @@ function filterFeeList() {
// 查询按钮点击
function handleQuery() {
if (patientInfoList.value.length === 0) {
<<<<<<< HEAD
ElMessage.warning('请先选择患者');
=======
// ElMessage.warning('请先选择患者');
>>>>>>> v1.3
return;
}

View File

@@ -1,4 +1,8 @@
<<<<<<< HEAD
import request from '@/utils/request'
=======
import request from '@/utils/request';
>>>>>>> v1.3
/**
* 获取住院患者列表
@@ -7,8 +11,13 @@ export function getPatientList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
=======
params: queryParams,
});
>>>>>>> v1.3
}
/**
@@ -18,10 +27,25 @@ export function getWardList(queryParams) {
return request({
url: '/app-common/practitioner-ward',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
}
=======
params: queryParams,
});
}
/**
* 获取科室下拉列表
*/
export function getOrgList() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
});
}
>>>>>>> v1.3
/**
* 获取当前选中患者全部医嘱
*/
@@ -29,8 +53,13 @@ export function getPrescriptionList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient-advice',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
=======
params: queryParams,
});
>>>>>>> v1.3
}
/**
@@ -40,8 +69,13 @@ export function adviceExecute(data) {
return request({
url: '/nurse-station/advice-process/advice-execute',
method: 'post',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
/**
@@ -51,6 +85,68 @@ export function adviceCancel(data) {
return request({
url: '/nurse-station/advice-process/advice-cancel',
method: 'post',
<<<<<<< HEAD
data: data
})
}
}
=======
data: data,
});
}
/**
* 获取药品列表
*/
export function getAdviceBaseInfo(queryParams) {
return request({
url: '/doctor-station/advice/advice-base-info',
method: 'get',
params: queryParams,
});
}
/**
* 护士划价补费 -新增
*/
export function addBilling(data) {
return request({
url: '/inhospitalnursestation/nursebilling/add-billing',
method: 'post',
data: data,
});
}
/**
* 护士划价补费 -查询
*/
export function queryBilling(queryParams) {
return request({
url: '/inhospitalnursestation/nursebilling/innurse-billing-list/',
method: 'get',
params: queryParams,
});
}
/**
* 护士划价补费 -删除
*/
export function deleteBilling(data) {
return request({
url: '/inhospitalnursestation/nursebilling/del-billing',
method: 'post',
data: data,
});
}
// 目录分类子查询
export function getDiseaseTreatmentInitLoc(id) {
return request({
url: '/base-data-manage/org-loc/loc-list?locationForm=' + id,
method: 'get',
});
}
// 住院护士站费用明细
export function getCostDetail(queryParams) {
return request({
url: '/inhospitalnursestation/nursebilling/cost-detail/',
method: 'get',
params: queryParams,
});
}
>>>>>>> v1.3

View File

@@ -1,5 +1,9 @@
<template>
<<<<<<< HEAD
<div style="height: calc(100vh - 126px)">
=======
<div style="height: calc(100vh - 126px); display: flex; flex-direction: column">
>>>>>>> v1.3
<!-- 操作工具栏 -->
<div
style="
@@ -9,6 +13,10 @@
align-items: center;
justify-content: space-between;
padding: 0 15px;
<<<<<<< HEAD
=======
flex-shrink: 0;
>>>>>>> v1.3
"
>
<div style="display: flex; align-items: center">
@@ -22,7 +30,11 @@
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="其他" name="other"></el-tab-pane>
=======
<el-tab-pane label="自定义" name="custom"></el-tab-pane>
>>>>>>> v1.3
</el-tabs>
<!-- 日期选择器 -->
@@ -35,6 +47,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
<<<<<<< HEAD
style="width: 240px; margin-right: 20px"
/>
@@ -53,11 +66,18 @@
/>
</el-select>
=======
:disabled="dateRange !== 'custom'"
style="width: 240px; margin-right: 20px"
/>
>>>>>>> v1.3
<!-- 查询按钮 -->
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<<<<<<< HEAD
<!-- 全选开关 -->
<div style="display: flex; align-items: center; margin-right: 20px">
<span style="margin-right: 8px">全选</span>
@@ -119,6 +139,214 @@
</div>
<!-- 使用计费弹窗组件 -->
=======
<!-- 新增划价 -->
<el-button type="primary" @click="handAddBilling">新增划价</el-button>
</div>
</div>
<!-- 费用列表区域 - Collapse折叠面板+按encounterId分组版 -->
<div
style="flex: 1; display: flex; flex-direction: column; overflow: hidden"
v-loading="loading"
element-loading-text="数据加载中..."
element-loading-spinner="el-icon-loading"
>
<!-- 列表统计信息 -->
<div
style="
padding: 10px 15px;
background-color: #f8f9fa;
border-bottom: 1px solid #e4e7ed;
flex-shrink: 0;
"
>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span class="text-primary font-bold">患者医嘱列表</span>
<span style="margin-left: 15px; color: #666">
<span class="text-danger">{{ groupedPrescriptionList.length }}</span> 位患者
</span>
</div>
<!-- <div>
<el-button size="small" type="text" @click="exportData">
<el-icon><Download /></el-icon> 导出数据
</el-button>
</div> -->
</div>
</div>
<!-- 列表内容容器 -->
<div style="flex: 1; overflow-y: auto; padding: 10px; background-color: #f5f7fa">
<!-- 空状态 -->
<div v-if="groupedPrescriptionList.length === 0 && !loading" class="empty-container">
<el-empty description="暂无患者划价数据,请选择查询条件后点击查询" :image-size="120">
<el-button type="primary" @click="handleQuery">立即查询</el-button>
</el-empty>
</div>
<!-- 患者医嘱折叠面板 -->
<div v-else class="prescription-collapse-container">
<el-collapse
v-model="activeCollapseNames"
accordion
border
style="--el-collapse-border-color: #e4e7ed"
>
<!-- 按encounterId分组渲染患者折叠项 -->
<el-collapse-item
v-for="(patientGroup, index) in groupedPrescriptionList"
:key="`patient-${index}-${safeGet(patientGroup[0], 'encounterId', index)}`"
:name="`patient-${index}`"
class="patient-collapse-item"
>
<!-- 折叠面板头部 - 患者信息 -->
<template #title>
<div class="patient-header">
<div class="patient-basic-info">
<el-avatar :icon="User" size="small" style="margin-right: 10px"></el-avatar>
<div>
<span class="patient-name">{{
safeGet(patientGroup[0], 'patientName', '未知患者')
}}</span>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'genderEnum_enumText', '未知') }} /
{{ safeGet(patientGroup[0], 'age', '未知') }}</span
>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'bedName', '无床位') }}{{
safeGet(patientGroup[0], 'busNo', '未知编号')
}}</span
>
</div>
</div>
<div class="patient-ext-info">
<div class="ext-item">
<span class="label">住院医生</span>
<span class="value">{{
safeGet(patientGroup[0], 'admittingDoctorName', '未知')
}}</span>
</div>
<div class="ext-item">
<span class="label">预交金余额</span>
<span class="value amount">{{
formatNumber(safeGet(patientGroup[0], 'balanceAmount', 0), 4)
}}</span>
</div>
<div class="ext-item">
<span class="label">诊断</span>
<span class="value" :title="safeGet(patientGroup[0], 'conditionNames', '无')">
{{ truncateText(safeGet(patientGroup[0], 'conditionNames', '无'), 20) }}
</span>
</div>
<div class="ext-item">
<el-tag size="small">{{
safeGet(patientGroup[0], 'contractName', '未知')
}}</el-tag>
</div>
<div class="patient-amount-preview">
小计<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</div>
</div>
</div>
</template>
<!-- 折叠面板内容 - 医嘱表格 -->
<div class="prescription-table-container">
<el-table
:data="safeArray(patientGroup)"
border
size="small"
:ref="(el) => (tableRef[index] = el)"
@selection-change="(val) => handleTableSelectionChange(index, val)"
:header-cell-style="{ background: '#eef9fd', color: '#333' }"
:row-class-name="
({ row }) => (safeGet(row, 'status') === 'priced' ? 'priced-row' : '')
"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="医嘱类型" prop="therapyEnum_enumText" width="90">
<template #default="scope">
<el-tag
size="small"
:type="safeGet(scope.row, 'therapyEnum') === 1 ? 'warning' : 'primary'"
>
{{ safeGet(scope.row, 'therapyEnum_enumText', '未知') }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="划价内容" min-width="200">
<template #default="scope">
<div class="advice-content">
<span>{{ safeGet(scope.row, 'adviceName', '无') }}</span>
<template v-if="safeGet(scope.row, 'adviceTable') === 'wor_device_request'">
<span class="advice-detail">
规格:{{ safeGet(scope.row, 'volume', '无') }} / 数量:{{
safeGet(scope.row, 'quantity', 0)
}}{{ safeGet(scope.row, 'unitCode_dictText', '') }}
</span>
</template>
</div>
</template>
</el-table-column>
<el-table-column label="数量" prop="quantity" width="60">
<template #default="scope">
{{ formatNumber(safeGet(scope.row, 'quantity', 0), 0) }}
{{ safeGet(scope.row, 'unitCode_dictText', '') }}
</template>
</el-table-column>
<el-table-column label="申请时间" prop="requestTime" width="160" />
<el-table-column label="执行/发放" prop="positionName" width="120" />
<el-table-column label="单价()" width="90">
<template #default="scope">
<!-- 实际项目单价可能需要从收费项目配置中获取这里先显示0.0000 -->
{{ formatNumber(safeGet(scope.row, 'unitPrice', 0), 4) }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
<template #default="scope">
<el-button
size="small"
type="text"
@click="handleSingleDelete(scope.row)"
:disabled="safeGet(scope.row, 'status') === 'priced'"
>
撤销
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 患者级操作栏 -->
<div class="patient-actions">
<el-button
size="small"
type="primary"
plain
@click="selectAllPatientItems(index)"
>
全选
</el-button>
<el-button size="small" type="primary" @click="handleBatchDelete(index)">
批量撤销
</el-button>
<el-button size="small" type="primary" @click="handleCalculate(patientGroup)">
新增划价
</el-button>
<span class="patient-amount">
小计:<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</span>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</div>
<!-- 计费弹窗 -->
>>>>>>> v1.3
<FeeDialog
v-model:visible="dialogVisible"
:initial-data="selectedFeeItems"
@@ -130,6 +358,7 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
@@ -365,10 +594,483 @@ function getSelectedRows() {
// 暴露方法供父组件调用
defineExpose({
handleQuery,
=======
import { ref, onMounted, computed, nextTick, watch } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
// Element Plus 图标导入
import { User, Download } from '@element-plus/icons-vue';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import FeeDialog from './FeeDialog.vue';
import { addBilling, queryBilling, deleteBilling } from './api.js';
import useUserStore from '@/store/modules/user';
// ========== 核心工具函数 ==========
/**
* 安全获取对象属性,避免空值报错
* @param {Object} obj - 源对象
* @param {String} path - 属性路径
* @param {Any} defaultValue - 默认值
* @returns {Any}
*/
const safeGet = (obj, path, defaultValue = '') => {
// 1. 前置校验:如果源对象不是对象类型,直接返回默认值
if (!obj || typeof obj !== 'object') return defaultValue;
// 2. 拆分路径:把 "info.basic.name" 拆成 ["info", "basic", "name"]
const paths = path.split('.');
// 3. 初始化结果为源对象
let result = obj;
// 4. 循环遍历路径数组,逐层访问属性
for (const p of paths) {
// 5. 关键如果当前层属性不存在undefined/null直接返回默认值
if (result[p] === undefined || result[p] === null) return defaultValue;
// 6. 存在则继续访问下一层
result = result[p];
}
// 7. 所有层级都存在,返回最终属性值
return result;
};
/**
* 安全转换为数组
* @param {Any} data - 待转换数据
* @returns {Array}
*/
const safeArray = (data) => {
return Array.isArray(data) ? data : [];
};
/**
* 格式化数字保留4位小数金额专用
* @param {Number} num - 数字
* @param {Number} decimal - 小数位数默认4位
* @returns {String}
*/
const formatNumber = (num, decimal = 4) => {
if (isNaN(Number(num))) return '0.0000';
// 保留指定小数位不足补0
return Number(num).toFixed(decimal);
};
/**
* 文本截断(超出长度显示省略号)
* @param {String} text - 待处理文本
* @param {Number} length - 最大长度
* @returns {String}
*/
const truncateText = (text, length = 20) => {
if (!text || text.length <= length) return text;
return `${text.slice(0, length)}...`;
};
/**
* 按encounterId分组数据
* @param {Array} data - 原始数据
* @returns {Array} 分组后的数据(二维数组)
*/
const groupByEncounterId = (data) => {
const grouped = {};
safeArray(data).forEach((item) => {
const encounterId = safeGet(item, 'encounterId', 'unknown');
if (!grouped[encounterId]) {
grouped[encounterId] = [];
}
// 为每个项添加默认状态未划价和单价默认0实际应从收费项目中获取
grouped[encounterId].push({
...item,
status: safeGet(item, 'status', 'unpriced'), // 默认未划价
unitPrice: safeGet(item, 'unitPrice', 0), // 单价默认0实际需要对接收费项目
});
});
// 转换为数组格式
return Object.values(grouped);
};
// ========== 响应式数据 ==========
const loading = ref(false);
const dateRange = ref('today');
const dateRangeValue = ref([]);
const tableRef = ref([]);
const rawPrescriptionList = ref([]); // 原始未分组数据
const groupedPrescriptionList = ref([]); // 按encounterId分组后的数据
const activeCollapseNames = ref([]); // Collapse激活状态
const selectedRows = ref({}); // 选中的行数据
const totalItemsCount = ref(0); // 总医嘱项数
const totalAmount = ref(0); // 总金额保留4位小数
const dialogVisible = ref(false);
const selectedFeeItems = ref([]);
const currentPatientInfo = ref(null);
const queryParams = ref({
pageSize: 10000,
pageNo: 1,
});
// 用户信息
const userStore = useUserStore();
const userId = ref(safeGet(userStore, 'id', ''));
const orgId = ref(safeGet(userStore, 'orgId', ''));
// ========== 计算属性 ==========
// 计算总统计信息(总项数、总金额)
const calculateTotalStats = computed(() => {
let itemsCount = 0;
let amount = 0;
safeArray(groupedPrescriptionList.value).forEach((patientGroup) => {
safeArray(patientGroup).forEach((item) => {
itemsCount++;
// 累加单价保留4位小数精度
amount = Math.round((amount + Number(safeGet(item, 'unitPrice', 0))) * 10000) / 10000;
});
});
totalItemsCount.value = itemsCount;
totalAmount.value = amount;
});
// ========== 方法 ==========
/**
* 计算单个患者的总金额保留4位小数
* @param {Array} patientGroup - 患者医嘱列表
* @returns {String} 格式化后的金额字符串
*/
const calculatePatientTotal = (patientGroup) => {
const total = safeArray(patientGroup).reduce((sum, item) => {
return (
Math.round(
(sum + Number(safeGet(item, 'unitPrice', 0) * safeGet(item, 'quantity', 0))) * 10000
) / 10000
);
}, 0);
return formatNumber(total, 4);
};
/**
* 全选单个患者的所有项
* @param {Number} index - 患者索引
*/
const selectAllPatientItems = (index) => {
nextTick(() => {
const table = safeArray(tableRef.value)[index];
if (table && typeof table.toggleAllSelection === 'function') {
table.toggleAllSelection();
}
});
};
/**
* 处理表格选择变化
* @param {Number} index - 患者索引
* @param {Array} val - 选中行
*/
const handleTableSelectionChange = (index, val) => {
selectedRows.value[index] = safeArray(val);
console.log('selectedRows:', selectedRows.value);
// 合并所有选中行
const allSelected = [];
Object.values(selectedRows.value).forEach((rows) => {
allSelected.push(...safeArray(rows));
});
selectedFeeItems.value = allSelected;
console.log('selectedFeeItems:', selectedFeeItems.value);
};
/**
* 日期Tab切换
* @param {Object} tab - 标签页
*/
const handleDateTabClick = (tab) => {
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
const format = (date) => formatDateStr(date, 'YYYY-MM-DD');
switch (safeGet(tab, 'paneName')) {
case 'today':
dateRangeValue.value = [format(today), format(today)];
break;
case 'yesterday':
dateRangeValue.value = [format(yesterday), format(yesterday)];
break;
case 'custom':
if (!dateRangeValue.value.length) {
dateRangeValue.value = [format(today), format(today)];
}
break;
}
};
/**
* 日期选择器变化
* @param {Array} val - 选中日期
*/
const handleDatePickerChange = (val) => {
const dateVal = safeArray(val);
if (dateVal.length === 2) {
dateRange.value = 'custom';
const start = new Date(dateVal[0]);
const end = new Date(dateVal[1]);
if (start > end) {
ElMessage.warning('开始日期不能晚于结束日期');
dateRangeValue.value = [dateVal[1], dateVal[0]];
}
}
};
/**
* 查询数据并按encounterId分组
*/
const handleQuery = async () => {
// 基础校验
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (safeArray(dateRangeValue.value).length < 2) {
ElMessage.warning('请选择有效的查询日期');
return;
}
loading.value = true;
try {
queryParams.value = {
...queryParams.value,
encounterIds: patientList
.map((p) => safeGet(p, 'encounterId'))
.filter((id) => id)
.join(','),
startTime: `${safeArray(dateRangeValue.value)[0]} 00:00:00`,
endTime: `${safeArray(dateRangeValue.value)[1]} 23:59:59`,
};
const response = await queryBilling(queryParams.value);
const rawData = safeArray(safeGet(response, 'data.records', []));
rawPrescriptionList.value = rawData;
// 核心按encounterId分组数据
groupedPrescriptionList.value = groupByEncounterId(rawData);
// 默认展开第一个患者面板
if (groupedPrescriptionList.value.length > 0 && activeCollapseNames.value.length === 0) {
activeCollapseNames.value = ['patient-0'];
}
// 重置选中状态
selectedRows.value = {};
selectedFeeItems.value = [];
ElMessage.success(`查询成功,共找到 ${groupedPrescriptionList.value.length} 位患者的划价数据`);
} catch (error) {
console.error('查询失败:', error);
ElMessage.error(`查询失败:${safeGet(error, 'message', '网络异常')}`);
rawPrescriptionList.value = [];
groupedPrescriptionList.value = [];
} finally {
loading.value = false;
}
};
/**
* 打开新增弹窗
*/
const handAddBilling = () => {
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (patientList.length > 1) {
ElMessage.warning('新增划价仅支持单患者操作');
return;
}
currentPatientInfo.value = patientList[0];
dialogVisible.value = true;
};
//新增划价
const handleCalculate = (patientGroup) => {
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (patientGroup.length === 0) {
ElMessage.warning('该患者暂无医嘱信息,无法新增划价');
return;
}
const currentPatient = patientList.find(
(p) => safeGet(p, 'encounterId') === safeGet(patientGroup[0], 'encounterId')
);
if (!currentPatient) {
ElMessage.warning('无法获取当前患者信息');
return;
}
currentPatientInfo.value = currentPatient;
dialogVisible.value = true;
};
/**
* 弹窗确认
* @param {Object} data - 弹窗数据
*/
const handleFeeDialogConfirm = async (data) => {
try {
if (!data || typeof data !== 'object') {
ElMessage.warning('请填写计费信息');
return;
}
loading.value = true;
await addBilling({
...data,
operatorId: userId.value,
orgId: orgId.value,
});
ElMessage.success('计费新增成功');
dialogVisible.value = false;
await handleQuery();
} catch (error) {
ElMessage.error(`计费失败:${safeGet(error, 'message', '提交异常')}`);
} finally {
loading.value = false;
}
};
/**
* 弹窗取消
*/
const handleFeeDialogCancel = () => {
dialogVisible.value = false;
selectedFeeItems.value = [];
currentPatientInfo.value = null;
};
/**
* 单个患者批量撤销
* @param {Number} index - 患者索引
*/
const handleBatchDelete = (index) => {
const rows = safeArray(selectedRows.value[index]);
if (rows.length === 0) {
ElMessage.warning('请先选择要撤销的划价项目');
return;
}
// 第一步:显示确认弹窗
ElMessageBox.confirm(`确认对选中的 ${rows.length} 项划价内容进行批量撤销?`, '批量撤销', {
type: 'warning',
})
.then(() => {
// 用户确认后执行撤销逻辑
loading.value = true;
// 构造请求参数
const param = rows.map((row) => ({
requestId: safeGet(row, 'requestId'),
adviceType:
safeGet(row, 'adviceTable') === 'wor_device_request'
? 2
: safeGet(row, 'adviceTable') === 'wor_service_request'
? 3
: 1,
}));
// 调用批量撤销接口Promise 链式调用)
return deleteBilling(param);
})
.then(() => {
// 接口调用成功
ElMessage.success('批量撤销成功');
handleQuery(); // 重新查询刷新数据
})
.catch((error) => {
// 异常处理(取消操作/接口失败)
if (error !== 'cancel') {
// 排除用户点击取消的情况
ElMessage.error(`批量撤销失败:${safeGet(error, 'message', '操作异常')}`);
}
})
.finally(() => {
// 无论成功/失败,最终关闭加载状态
loading.value = false;
});
};
const handleSingleDelete = (row) => {
if (!row || row.length === 0) {
ElMessage.warning('请先选择要撤销的划价项目');
return;
}
// 第一步:显示确认弹窗
ElMessageBox.confirm(`确认对选中的 ${row.adviceName} 项划价内容进行批量撤销?`, '批量撤销', {
type: 'warning',
})
.then(() => {
// 用户确认后执行撤销逻辑
loading.value = true;
// 构造请求参数
const rowArr = safeArray([row]);
const param = rowArr.map((row) => ({
requestId: safeGet(row, 'requestId'),
adviceType:
safeGet(row, 'adviceTable') === 'wor_device_request'
? 2
: safeGet(row, 'adviceTable') === 'wor_service_request'
? 3
: 1,
}));
// 调用批量撤销接口Promise 链式调用)
return deleteBilling(param);
})
.then(() => {
// 接口调用成功
ElMessage.success('批量撤销成功');
handleQuery(); // 重新查询刷新数据
})
.catch((error) => {
// 异常处理(取消操作/接口失败)
if (error !== 'cancel') {
// 排除用户点击取消的情况
ElMessage.error(`批量撤销失败:${safeGet(error, 'message', '操作异常')}`);
}
})
.finally(() => {
// 无论成功/失败,最终关闭加载状态
loading.value = false;
});
};
// ========== 初始化 ==========
onMounted(() => {
// 设置默认日期
const today = new Date();
const defaultDate = formatDateStr(today, 'YYYY-MM-DD');
dateRangeValue.value = [defaultDate, defaultDate];
// 监听日期变化自动查询
watch(
[dateRange, dateRangeValue],
([newRange, newVal], [oldRange, oldVal]) => {
if (oldRange !== undefined && safeArray(newVal).length === 2) {
handleQuery();
}
},
{ deep: true }
);
// 初始化统计信息
calculateTotalStats.value;
>>>>>>> v1.3
});
</script>
<style scoped>
<<<<<<< HEAD
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
@@ -386,3 +1088,186 @@ defineExpose({
background-color: #eef9fd !important;
}
</style>
=======
/* 基础样式 */
.font-bold {
font-weight: 600;
}
.text-primary {
color: #409eff;
}
.text-danger {
color: #f56c6c;
}
.text-success {
color: #67c23a;
}
/* 空状态容器 */
.empty-container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
/* 折叠面板容器 */
.prescription-collapse-container {
--el-collapse-item-border-radius: 8px;
}
/* 患者折叠项 */
.patient-collapse-item {
margin-bottom: 12px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 患者头部 */
.patient-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
flex-wrap: wrap;
gap: 8px;
}
.patient-basic-info {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.patient-name {
font-weight: 600;
font-size: 15px;
margin-right: 10px;
}
.patient-info-tag {
color: #666;
font-size: 13px;
margin-right: 8px;
}
.patient-ext-info {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.ext-item {
display: flex;
align-items: center;
font-size: 13px;
flex-wrap: wrap;
}
.ext-item .label {
color: #999;
margin-right: 4px;
}
.ext-item .amount {
color: #e6a23c;
font-weight: 600;
}
.patient-amount-preview {
font-size: 13px;
color: #333;
margin-left: 10px;
}
.patient-amount-preview .amount {
color: #e6a23c;
font-weight: 600;
}
/* 医嘱表格容器 */
.prescription-table-container {
padding: 10px 0;
}
:deep(.el-table) {
--el-table-header-text-color: #333;
--el-table-row-hover-bg-color: #f8f9fa;
--el-table-border-color: #e4e7ed;
}
.priced-row {
background-color: #f0f9ff !important;
}
.advice-content {
display: flex;
flex-direction: column;
}
.advice-detail {
font-size: 12px;
color: #447c95;
margin-top: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 患者操作栏 */
.patient-actions {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0 0;
margin-top: 8px;
border-top: 1px dashed #e4e7ed;
}
.patient-amount {
font-size: 14px;
color: #333;
}
.patient-amount .amount {
color: #e6a23c;
font-weight: 600;
}
/* 日期Tabs样式 */
.date-tabs :deep(.el-tabs__header) {
margin-bottom: 0;
}
.date-tabs :deep(.el-tabs__content) {
display: none;
}
/* 折叠面板样式优化 */
:deep(.el-collapse-item__header) {
padding: 12px 15px;
background-color: #fff;
}
:deep(.el-collapse-item__content) {
padding: 0 15px 15px;
background-color: #fff;
}
:deep(.el-collapse) {
--el-collapse-header-text-color: #333;
--el-collapse-content-bg-color: #fff;
}
/* 表格单元格溢出处理 */
:deep(.el-table__cell) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
>>>>>>> v1.3

View File

@@ -170,7 +170,11 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { getSinglePatient } from '../store/patient.js'; // 导入获取单选患者信息的方法
import { formatDateStr } from '@/utils/index';

View File

@@ -22,7 +22,11 @@
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="其他" name="other"></el-tab-pane>
=======
<!-- <el-tab-pane label="其他" name="other"></el-tab-pane> -->
>>>>>>> v1.3
</el-tabs>
<!-- 日期选择器 -->
@@ -40,13 +44,21 @@
<!-- 费用类型选择 -->
<el-select
<<<<<<< HEAD
v-model="feeType"
=======
v-model="formParams.chargeItemEnum"
>>>>>>> v1.3
placeholder="请选择费用类型"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
<<<<<<< HEAD
v-for="type in feeTypeOptions"
=======
v-for="type in med_chrgitm_type"
>>>>>>> v1.3
:key="type.value"
:label="type.label"
:value="type.value"
@@ -55,20 +67,35 @@
<!-- 执行科室选择 -->
<el-select
<<<<<<< HEAD
v-model="execDepartment"
=======
v-model="formParams.orgId"
>>>>>>> v1.3
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
<<<<<<< HEAD
v-for="dept in departmentOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
=======
v-for="dept in orgOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
>>>>>>> v1.3
/>
</el-select>
<!-- 查询按钮 -->
<<<<<<< HEAD
=======
<el-button type="primary" @click="onReset">重置</el-button>
>>>>>>> v1.3
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
@@ -77,7 +104,11 @@
<el-button @click="handleExport">导出</el-button>
<!-- 打印按钮 -->
<<<<<<< HEAD
<el-button @click="handlePrint" style="margin-left: 15px">打印</el-button>
=======
<!-- <el-button @click="handlePrint" style="margin-left: 15px">打印</el-button> -->
>>>>>>> v1.3
</div>
</div>
@@ -87,6 +118,7 @@
v-loading="loading"
>
<!-- 费用汇总信息 -->
<<<<<<< HEAD
<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>
@@ -98,6 +130,23 @@
合计金额¥{{ totalAmount.toFixed(2) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px;">明细项数{{ feeDetailList.length }}</p>
=======
<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>
>>>>>>> v1.3
</div>
</div>
</div>
@@ -107,6 +156,7 @@
:data="feeDetailList"
border
style="width: 100%"
<<<<<<< HEAD
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
@@ -127,14 +177,56 @@
<el-tag v-if="scope.row.insuranceType" size="small">{{ scope.row.insuranceType }}</el-tag>
</template>
</el-table-column>
=======
max-height="400px"
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
<el-table-column label="项目名称" prop="chargeName" min-width="200" />
<el-table-column
label="费用类型"
prop="chargeItemEnum_enumText"
width="120"
align="center"
/>
<el-table-column label="单价" prop="unitPrice" width="100" align="center" sortable />
<el-table-column label="数量" prop="quantityValue" width="100" align="center" sortable />
<el-table-column label="金额" prop="totalPrice" width="100" align="center" sortable>
<template #default="scope">
<span style="color: #ff4d4f">{{ scope.row.totalPrice.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column :prop="orgId" label="执行科室" width="120" align="center">
<template #default="scope">
{{ selectOrg(scope.row.orgId) }}
</template>
</el-table-column>
<el-table-column label="执行人" prop="practitioner" width="100" align="center" />
<el-table-column label="执行日期" prop="recordedTime" width="120" align="center">
<template #default="scope">
{{ moment(scope.row?.recordedTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="医保类型" prop="chrgitmLv_enumText" width="100" align="center">
</el-table-column>
>>>>>>> v1.3
<el-table-column label="备注" prop="remark" min-width="150" />
</el-table>
<!-- 分页 -->
<<<<<<< HEAD
<div style="margin-top: 15px; display: flex; justify-content: flex-end;">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
=======
<div style="margin-top: 15px; display: flex; justify-content: flex-end">
<el-pagination
v-model:current-page="formParams.pageNo"
v-model:page-size="formParams.pageSize"
>>>>>>> v1.3
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@@ -148,6 +240,7 @@
</div>
<!-- 打印预览弹窗 -->
<<<<<<< HEAD
<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;">
@@ -166,10 +259,36 @@
<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>
=======
<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>
>>>>>>> v1.3
</tr>
</thead>
<tbody>
<tr v-for="item in feeDetailList" :key="item.id">
<<<<<<< HEAD
<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>
@@ -183,11 +302,47 @@
<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>
=======
<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>
>>>>>>> v1.3
</tr>
</tfoot>
</table>
</div>
<<<<<<< HEAD
=======
>>>>>>> v1.3
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
@@ -197,26 +352,61 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { formatDateStr } from '@/utils/index';
=======
import { ref, computed, onMounted, watch, reactive } from 'vue';
import moment from 'moment';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import { getCostDetail } from './api.js';
import { getOrgList } from '../../../basicmanage/ward/components/api.js';
const { proxy } = getCurrentInstance();
const { med_chrgitm_type } = proxy.useDict('med_chrgitm_type');
>>>>>>> v1.3
// 响应式数据
const loading = ref(false);
const feeDetailList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
<<<<<<< HEAD
const feeType = ref('');
=======
>>>>>>> v1.3
const execDepartment = ref('');
const departmentOptions = ref([]);
const feeTypeOptions = ref([]);
const tableRef = ref(null);
const patientInfo = ref('');
<<<<<<< HEAD
// 分页相关
const currentPage = ref(1);
const pageSize = ref(20);
=======
const orgOptions = ref([]);
const formParams = reactive({
chargeItemEnum: undefined,
orgId: undefined,
recordedTimeSTime: undefined,
recordedTimeETime: undefined,
pageSize: 10,
pageNo: 1,
});
const props = defineProps({
activeTab: {
type: String,
},
});
// 分页相关
>>>>>>> v1.3
const total = ref(0);
// 打印相关
@@ -225,7 +415,11 @@ const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
return feeDetailList.value.reduce((sum, item) => {
<<<<<<< HEAD
return sum + (item.amount || 0);
=======
return sum + (item.totalPrice || 0);
>>>>>>> v1.3
}, 0);
});
@@ -234,6 +428,7 @@ onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
<<<<<<< HEAD
// 加载科室选项
loadDepartmentOptions();
@@ -245,12 +440,58 @@ onMounted(() => {
watchPatientSelection();
});
=======
});
watch(
() => patientInfoList,
(newValue) => {
if (newValue.value.length > 1) {
if (props.activeTab == 'expenseDetail') {
ElMessage({
type: 'error',
message: '一次只能查询一位患者的费用明细',
});
return;
}
}
if (newValue.value.length == 1) {
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
patientInfo.value = newValue.value[0];
formParams.encounterId = patientInfo.value.encounterId;
getTableList();
}
if (newValue.value.length <= 0) {
feeDetailList.value = [];
}
},
{ deep: true }
);
// 获取列表信息
const getTableList = async () => {
const params = formParams;
try {
const res = await getCostDetail(params);
feeDetailList.value = res.data.records;
total.value = res.data?.total;
console.log('data======>', JSON.stringify(feeDetailList.value));
} catch (error) {}
};
>>>>>>> v1.3
// 监听患者选择变化
function watchPatientSelection() {
// 定期检查患者选择状态变化
setInterval(() => {
if (patientInfoList.value && patientInfoList.value.length > 0) {
<<<<<<< HEAD
const selectedPatient = patientInfoList.value.find(patient => patient.selected === true);
=======
const selectedPatient = patientInfoList.value.find((patient) => patient.selected === true);
>>>>>>> v1.3
if (selectedPatient) {
patientInfo.value = selectedPatient.patientName || '';
} else {
@@ -262,6 +503,7 @@ function watchPatientSelection() {
}, 300);
}
<<<<<<< HEAD
// 加载科室选项
function loadDepartmentOptions() {
// 模拟科室数据
@@ -275,6 +517,35 @@ function loadDepartmentOptions() {
{ label: '其他科室', value: 'others' },
];
}
=======
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
console.log('orgOptions======>', JSON.stringify(orgOptions.value));
});
};
getLocationInfo();
// 映射
const selectOrg = (itemid) => {
if (!itemid) return '';
const item = orgOptions.value.find((item) => {
return item.id == itemid;
});
return item?.name || '';
};
// 重置
const onReset = () => {
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
getTableList();
};
>>>>>>> v1.3
// 加载费用类型选项
function loadFeeTypeOptions() {
@@ -311,12 +582,26 @@ function handleDateTabClick(tab) {
break;
// other 情况保持用户选择的值
}
<<<<<<< HEAD
=======
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
>>>>>>> v1.3
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue.value.length > 0) {
<<<<<<< HEAD
dateRange.value = 'other';
=======
// dateRange.value = 'other';
} else {
formParams.recordedTimeSTime = undefined;
formParams.recordedTimeETime = undefined;
>>>>>>> v1.3
}
}
@@ -328,6 +613,7 @@ function formatDateRange() {
return '';
}
<<<<<<< HEAD
// 生成模拟数据
function generateMockData() {
// 费用类型映射
@@ -496,11 +782,18 @@ function handleQuery() {
loading.value = false;
}
}, 500);
=======
// 查询按钮点击
function handleQuery() {
console.log('params=======>', formParams);
getTableList();
>>>>>>> v1.3
}
// 处理排序变化
function handleSortChange({ prop, order }) {
const sortedData = [...feeDetailList.value];
<<<<<<< HEAD
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop]) ? 1 : -1);
@@ -508,32 +801,70 @@ function handleSortChange({ prop, order }) {
sortedData.sort((a, b) => (a[prop] < b[prop]) ? 1 : -1);
}
=======
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));
}
>>>>>>> v1.3
feeDetailList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
<<<<<<< HEAD
pageSize.value = newSize;
currentPage.value = 1;
handleQuery();
=======
formParams.pageSize = newSize;
formParams.pageNo = 1;
getTableList();
>>>>>>> v1.3
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
<<<<<<< HEAD
currentPage.value = newCurrent;
handleQuery();
}
// 导出
function handleExport() {
=======
formParams.pageNo = newCurrent;
getTableList();
}
// 导出
async function handleExport() {
>>>>>>> v1.3
if (feeDetailList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
<<<<<<< HEAD
// 模拟导出操作
ElMessage.success('导出成功');
// 实际项目中这里应该调用导出API或使用Excel库生成文件
=======
try {
// 实际项目中这里应该调用导出API或使用Excel库生成文件
await proxy.$download.downloadGet(
'/inhospitalnursestation/nursebilling/excel-out',
{
...formParams,
},
`dict_${new Date().getTime()}.xlsx`
);
} catch (error) {}
>>>>>>> v1.3
}
// 打印预览
@@ -542,7 +873,11 @@ function handlePrint() {
ElMessage.warning('暂无数据可打印');
return;
}
<<<<<<< HEAD
=======
>>>>>>> v1.3
printDialogVisible.value = true;
}
@@ -551,10 +886,17 @@ function doPrint() {
try {
// 获取要打印的内容
const printContent = document.getElementById('print-content').innerHTML;
<<<<<<< HEAD
// 创建临时窗口
const printWindow = window.open('', '_blank');
=======
// 创建临时窗口
const printWindow = window.open('', '_blank');
>>>>>>> v1.3
// 写入内容
printWindow.document.write(`
<html>
@@ -574,7 +916,11 @@ function doPrint() {
</body>
</html>
`);
<<<<<<< HEAD
=======
>>>>>>> v1.3
// 打印
printWindow.document.close();
printWindow.focus();
@@ -608,4 +954,8 @@ defineExpose({
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
</style>
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -0,0 +1,874 @@
<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"
@clear="onClear"
style="width: 240px; margin-right: 20px"
/>
<!-- 费用类型选择 -->
<el-select
v-model="formParams.chargeItemEnum"
placeholder="请选择费用类型"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="type in med_chrgitm_type"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
<!-- 执行科室选择 -->
<el-select
v-model="formParams.orgId"
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="dept in orgOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
/>
</el-select>
<!-- 查询按钮 -->
<el-button type="primary" @click="onReset">重置</el-button>
<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">
合计金额¥{{ formatNumber(totalAmount, 4) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px">
明细项数{{ groupedPrescriptionList.length }}
</p>
</div>
</div>
</div>
<!-- 列表内容容器 -->
<div
v-if="groupedPrescriptionList.length > 0"
style="
flex: 1;
overflow-y: auto;
padding: 10px;
background-color: white;
border-radius: 4px;
"
>
<!-- 患者医嘱折叠面板 -->
<div class="prescription-collapse-container">
<el-collapse
v-model="activeCollapseNames"
accordion
border
style="--el-collapse-border-color: #e4e7ed"
@change="onCollapasChange"
>
<!-- 按encounterId分组渲染患者折叠项 -->
<el-collapse-item
v-for="(patientGroup, index) in groupedPrescriptionList"
:key="`patient-${index}-${safeGet(patientGroup[0], 'encounterId', index)}`"
:name="`patient-${index}`"
class="patient-collapse-item"
>
<!-- 折叠面板头部 - 患者信息 -->
<template #title>
<div class="patient-header">
<div class="patient-basic-info">
<el-avatar :icon="User" size="small" style="margin-right: 10px"></el-avatar>
<div>
<span class="patient-name">{{
safeGet(patientGroup[0], 'patientName', '未知患者')
}}</span>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'genderEnum_enumText', '未知') }} /
{{ safeGet(patientGroup[0], 'age', '未知') }}</span
>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'bedName', '无床位') }}{{
safeGet(patientGroup[0], 'busNo', '未知编号')
}}</span
>
</div>
</div>
<div class="patient-ext-info">
<div class="ext-item">
<span class="label">住院医生</span>
<span class="value">{{
safeGet(patientGroup[0], 'admittingDoctorName', '未知')
}}</span>
</div>
<div class="ext-item">
<span class="label">预交金余额</span>
<span class="value amount">{{
formatNumber(safeGet(patientGroup[0], 'balanceAmount', 0), 4)
}}</span>
</div>
<div class="ext-item">
<span class="label">诊断</span>
<span class="value" :title="safeGet(patientGroup[0], 'conditionNames', '无')">
{{ truncateText(safeGet(patientGroup[0], 'conditionNames', '无'), 20) }}
</span>
</div>
<div class="ext-item">
<el-tag size="small">{{
safeGet(patientGroup[0], 'contractName', '未知')
}}</el-tag>
</div>
<div class="patient-amount-preview">
小计<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</div>
</div>
</div>
</template>
<!-- 折叠面板内容 - 医嘱表格 -->
<div class="prescription-table-container">
<el-table
:data="safeArray(patientGroup)"
border
size="small"
style="width: 100%; margin-top: 10px"
@sort-change="handleSortChange"
>
<el-table-column label="项目名称" prop="chargeName" min-width="200" />
<el-table-column
label="费用类型"
prop="chargeItemEnum_enumText"
width="120"
align="center"
/>
<el-table-column
label="单价"
prop="unitPrice"
width="100"
align="center"
sortable
>
<template #default="scope">
{{ formatNumber(scope.row.unitPrice, 4) }}
</template>
</el-table-column>
<el-table-column
label="数量"
prop="quantityValue"
width="100"
align="center"
sortable
/>
<el-table-column
label="金额"
prop="totalPrice"
width="100"
align="center"
sortable
>
<template #default="scope">
<span style="color: #ff4d4f">{{
formatNumber(scope.row.totalPrice, 4)
}}</span>
</template>
</el-table-column>
<el-table-column :prop="orgId" label="执行科室" width="120" align="center">
<template #default="scope">
{{ selectOrg(scope.row.orgId) }}
</template>
</el-table-column>
<el-table-column label="执行人" prop="practitioner" width="100" align="center" />
<el-table-column label="执行日期" prop="recordedTime" width="120" align="center">
<template #default="scope">
{{ moment(scope.row?.recordedTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column
label="医保类型"
prop="chrgitmLv_enumText"
width="100"
align="center"
>
</el-table-column>
<el-table-column label="备注" prop="remark" min-width="150" />
</el-table>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
<!-- 无数据提示 -->
<el-empty
v-if="!loading && groupedPrescriptionList.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, watch, reactive } from 'vue';
import moment from 'moment';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import { getCostDetail } from './api.js';
import { getOrgList } from '../../../basicmanage/ward/components/api.js';
import { User } from '@element-plus/icons-vue';
const { proxy } = getCurrentInstance();
const { med_chrgitm_type } = proxy.useDict('med_chrgitm_type');
const groupedPrescriptionList = ref([]); // 按encounterId分组后的数据
const activeCollapseNames = ref(['patient-0']); // Collapse激活状态
// 响应式数据
const loading = ref(false);
const feeDetailList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
const execDepartment = ref('');
const feeTypeOptions = ref([]);
const patientInfo = ref('');
const orgOptions = ref([]);
const selectIndex = ref(0);
const formParams = reactive({
chargeItemEnum: undefined,
orgId: undefined,
recordedTimeSTime: undefined,
recordedTimeETime: undefined,
pageSize: 10,
encounterIds: '',
pageNo: 1,
});
const props = defineProps({
activeTab: {
type: String,
},
});
// 分页相关
const total = ref(0);
// 打印相关
const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
console.log('feeDetailList========>', feeDetailList.value);
return feeDetailList?.value?.reduce((sum, item) => {
return sum + (item.totalPrice || 0);
}, 0);
});
// 初始化
onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
});
watch(
() => patientInfoList,
(newValue) => {
if (newValue.value.length > 0) {
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
const encounterIds = newValue.value
.map((item) => {
return item.encounterId;
})
.join(',');
formParams.encounterIds = encounterIds;
if (props.activeTab === 'expenseDetail') {
getTableList();
}
}
if (newValue.value.length <= 0) {
feeDetailList.value = [];
groupedPrescriptionList.value = [];
}
},
{ deep: true }
);
// 获取列表信息
const getTableList = async () => {
const params = formParams;
try {
const res = await getCostDetail(params);
feeDetailList.value = res.data;
total.value = res.data?.total;
// 核心按encounterId分组数据
groupedPrescriptionList.value = groupByEncounterId(res.data);
// 默认展开第一个患者面板
if (groupedPrescriptionList.value.length > 0 && activeCollapseNames.value.length === 0) {
activeCollapseNames.value = ['patient-0'];
}
} catch (error) {}
};
// 监听患者选择变化
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);
}
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
});
};
getLocationInfo();
// 映射
const selectOrg = (itemid) => {
const item = orgOptions.value.find((item) => {
return item.id == itemid;
});
return item?.name;
};
// 重置
const onReset = () => {
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
dateRange.value = 'today';
getTableList();
};
// 加载费用类型选项
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 情况保持用户选择的值
}
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
getTableList();
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue?.value?.length > 0) {
// dateRange.value = 'other';
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
} else {
formParams.recordedTimeSTime = undefined;
formParams.recordedTimeETime = undefined;
}
}
// 清空
const onClear = () => {
console.log('1111111111');
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
dateRange.value = 'today';
getTableList();
};
// 格式化日期范围显示
function formatDateRange() {
if (dateRangeValue.value && dateRangeValue.value.length === 2) {
return `${dateRangeValue.value[0]}${dateRangeValue.value[1]}`;
}
return '';
}
// 查询按钮点击
function handleQuery() {
console.log('params=======>', formParams);
getTableList();
}
// 处理排序变化
function handleSortChange({ prop, order }) {
// const sortedData = [...feeDetailList.value];
const selectData = groupedPrescriptionList.value[selectIndex.value];
const sortedData = [...selectData];
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));
}
groupedPrescriptionList.value[selectIndex.value] = sortedData;
// feeDetailList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
formParams.pageSize = newSize;
formParams.pageNo = 1;
getTableList();
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
formParams.pageNo = newCurrent;
getTableList();
}
// 导出
async function handleExport() {
if (groupedPrescriptionList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
try {
// 实际项目中这里应该调用导出API或使用Excel库生成文件
await proxy.$download.downloadGet(
'/inhospitalnursestation/nursebilling/excel-out',
{
...formParams,
},
`dict_${new Date().getTime()}.xlsx`
);
} catch (error) {}
}
// 打印预览
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);
}
}
// 获取当前展开折叠板索引
function onCollapasChange(select) {
if (select) {
const selectArr = select.split('-');
if (selectArr && selectArr.length > 1) {
const idx = selectArr[1];
selectIndex.value = Number(idx);
}
}
}
// ========== 核心工具函数 ==========
/**
* 安全获取对象属性,避免空值报错
* @param {Object} obj - 源对象
* @param {String} path - 属性路径
* @param {Any} defaultValue - 默认值
* @returns {Any}
*/
const safeGet = (obj, path, defaultValue = '') => {
// 1. 前置校验:如果源对象不是对象类型,直接返回默认值
if (!obj || typeof obj !== 'object') return defaultValue;
// 2. 拆分路径:把 "info.basic.name" 拆成 ["info", "basic", "name"]
const paths = path.split('.');
// 3. 初始化结果为源对象
let result = obj;
// 4. 循环遍历路径数组,逐层访问属性
for (const p of paths) {
// 5. 关键如果当前层属性不存在undefined/null直接返回默认值
if (result[p] === undefined || result[p] === null) return defaultValue;
// 6. 存在则继续访问下一层
result = result[p];
}
// 7. 所有层级都存在,返回最终属性值
return result;
};
/**
* 安全转换为数组
* @param {Any} data - 待转换数据
* @returns {Array}
*/
const safeArray = (data) => {
return Array.isArray(data) ? data : [];
};
/**
* 格式化数字保留4位小数金额专用
* @param {Number} num - 数字
* @param {Number} decimal - 小数位数默认4位
* @returns {String}
*/
const formatNumber = (num, decimal = 4) => {
if (isNaN(Number(num))) return '0.0000';
// 保留指定小数位不足补0
return Number(num).toFixed(decimal);
};
/**
* 文本截断(超出长度显示省略号)
* @param {String} text - 待处理文本
* @param {Number} length - 最大长度
* @returns {String}
*/
const truncateText = (text, length = 20) => {
if (!text || text.length <= length) return text;
return `${text.slice(0, length)}...`;
};
/**
* 按encounterId分组数据
* @param {Array} data - 原始数据
* @returns {Array} 分组后的数据(二维数组)
*/
const groupByEncounterId = (data) => {
const grouped = {};
safeArray(data).forEach((item) => {
const encounterId = safeGet(item, 'encounterId', 'unknown');
if (!grouped[encounterId]) {
grouped[encounterId] = [];
}
grouped[encounterId].push({
...item,
});
});
// 转换为数组格式
return Object.values(grouped);
};
/**
* 计算单个患者的总金额保留4位小数
* @param {Array} patientGroup - 患者医嘱列表
* @returns {String} 格式化后的金额字符串
*/
const calculatePatientTotal = (patientGroup) => {
const total = safeArray(patientGroup).reduce((sum, item) => {
return Math.round((sum + Number(safeGet(item, 'totalPrice', 0))) * 10000) / 10000;
}, 0);
return formatNumber(total, 4);
};
// 暴露方法供父组件调用
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;
}
/* 折叠面板容器 */
.prescription-collapse-container {
--el-collapse-item-border-radius: 8px;
}
/* 患者折叠项 */
.patient-collapse-item {
margin-bottom: 12px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 患者头部 */
.patient-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
padding-left: 10px;
flex-wrap: wrap;
gap: 8px;
}
.patient-basic-info {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.patient-name {
font-weight: 600;
font-size: 15px;
margin-right: 10px;
}
.patient-info-tag {
color: #666;
font-size: 13px;
margin-right: 8px;
}
.patient-ext-info {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.ext-item {
display: flex;
align-items: center;
font-size: 13px;
flex-wrap: wrap;
}
.ext-item .label {
color: #999;
margin-right: 4px;
}
.ext-item .amount {
color: #e6a23c;
font-weight: 600;
}
.patient-amount-preview {
font-size: 13px;
color: #333;
margin-left: 10px;
}
.patient-amount-preview .amount {
color: #e6a23c;
font-weight: 600;
}
.prescription-table-container {
padding: 10px 0;
}
</style>

View File

@@ -23,9 +23,17 @@
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
=======
<!-- 隐藏tab
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
-->
>>>>>>> v1.3
</el-tabs>
</div>
@@ -36,7 +44,15 @@
<el-tab-pane label="划价确费" name="billing">
<BillingList ref="billingRef" />
</el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="医嘱计费" name="orderBilling">
=======
<el-tab-pane label="费用明细查询" name="expenseDetail">
<!-- <FeeDetailQuery :activeTab="activeTab" ref="feeDetailQueryRef" /> -->
<NewfeeDetailQuery :activeTab="activeTab" ref="feeDetailQueryRef" />
</el-tab-pane>
<!-- <el-tab-pane label="医嘱计费" name="orderBilling">
>>>>>>> v1.3
<OrderBilling ref="orderBillingRef" />
</el-tab-pane>
<el-tab-pane label="费用明细查询" name="expenseDetail">
@@ -45,7 +61,11 @@
<el-tab-pane label="预交金查询" name="depositQuery">
<deposit-query ref="depositQueryRef" />
</el-tab-pane>
<<<<<<< HEAD
<!-- <el-tab-pane label="患者流转日志" name="patientFlow">
=======
<el-tab-pane label="患者流转日志" name="patientFlow">
>>>>>>> v1.3
<div style="padding: 20px; text-align: center; color: #909399">患者流转日志功能区域</div>
</el-tab-pane> -->
</el-tabs>
@@ -56,9 +76,16 @@
<script setup>
import { ref, onMounted, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import PatientList from '../medicalOrderExecution/components/patientList.vue';
import BillingList from './components/billingList.vue';
import FeeDetailQuery from './components/feeDetailQuery.vue';
=======
import PatientList from '../components/patientList.vue';
import BillingList from './components/billingList.vue';
import FeeDetailQuery from './components/feeDetailQuery.vue';
import NewfeeDetailQuery from './components/newfeeDetailQuery.vue';
>>>>>>> v1.3
import DepositQuery from './components/depositQuery.vue';
import OrderBilling from './components/OrderBilling.vue';
@@ -88,7 +115,11 @@ function handleTabChange() {
// 切换到划价确费标签时,刷新数据
if (activeTab.value === 'billing' && billingRef.value) {
nextTick(() => {
<<<<<<< HEAD
billingRef.value.handleQuery();
=======
// billingRef.value.handleQuery();
>>>>>>> v1.3
});
}
// 切换到医嘱计费标签时,刷新数据

View File

@@ -0,0 +1,136 @@
<template>
<div class="nurse-nav-bar" :style="{ background: background }">
<div class="nav-scroll">
<div
v-for="nav in navs"
:key="nav.path"
class="nav-tab"
:class="{ 'is-active': currentPath === nav.path, disabled: nav.disabled }"
:style="nav.accent ? { '--accent-color': nav.accent } : null"
@click="() => handleNav(nav)"
>
<div class="nav-icon" v-if="nav.icon">
<component :is="nav.icon" />
</div>
<span class="nav-label">{{ nav.label }}</span>
<span v-if="nav.desc" class="nav-desc">{{ nav.desc }}</span>
</div>
</div>
</div>
</template>
<script setup>
import { computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
const props = defineProps({
navs: {
type: Array,
default: () => [],
},
activePath: {
type: String,
default: '',
},
background: {
type: String,
default: '#f8f9fb',
},
});
const emit = defineEmits(['navigate']);
const route = useRoute();
const router = useRouter();
const currentPath = computed(() => props.activePath || route.path);
function handleNav(nav) {
if (nav.disabled) return;
emit('navigate', nav);
if (nav.path && nav.path !== currentPath.value) {
router.push(nav.path);
}
}
</script>
<style scoped>
.nurse-nav-bar {
--theme-color: var(--el-color-primary, #409eff);
height: 40px;
border-bottom: 1px solid #e4e7ed;
padding: 0 12px;
display: flex;
align-items: center;
}
.nav-scroll {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
width: 100%;
}
.nav-tab {
height: 32px;
padding: 0 14px;
border-radius: 16px;
background: #fff;
border: 1px solid transparent;
display: inline-flex;
align-items: center;
gap: 6px;
cursor: pointer;
transition: all 0.15s ease;
position: relative;
color: #1f2d3d;
font-size: 14px;
}
.nav-tab:hover {
border-color: rgba(64, 158, 255, 0.45);
color: var(--theme-color);
background: rgba(64, 158, 255, 0.08);
}
.nav-tab.is-active {
background: rgba(64, 158, 255, 0.18);
border-color: var(--theme-color);
color: var(--theme-color);
box-shadow: 0 3px 8px rgba(64, 158, 255, 0.12);
}
.nav-tab.disabled {
opacity: 0.5;
cursor: not-allowed;
box-shadow: none;
}
.nav-icon {
width: 18px;
height: 18px;
border-radius: 50%;
background: rgba(64, 158, 255, 0.12);
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--accent-color, var(--theme-color));
font-size: 12px;
}
.nav-tab.is-active .nav-icon {
background: rgba(255, 255, 255, 0.8);
color: var(--theme-color);
}
.nav-label {
font-weight: 600;
}
.nav-desc {
font-size: 12px;
color: #909399;
}
</style>

View File

@@ -0,0 +1,23 @@
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
})
}

View File

@@ -0,0 +1,305 @@
<template>
<div>
<div>
<el-input placeholder="住院号/姓名" v-model="searchKey" @keyup.enter="handleSearch">
<template #append>
<el-button icon="Search" @click="handleSearch" />
</template>
</el-input>
</div>
<el-tree
ref="treeRef"
:key="treeKey"
:load="loadNode"
lazy
show-checkbox
node-key="id"
default-expand-all
:props="{ label: 'name', children: 'children' }"
@node-click="handleNodeClick"
@check="handleCheckChange"
>
<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 { ref, nextTick, inject, defineExpose } from 'vue';
const treeRef = ref(null);
const searchKey = ref('');
const treeKey = ref(0); // 用于强制重新渲染树组件
const wardList = ref([]); // 存储病区列表
const patientDataCache = ref(new Map()); // 缓存患者数据key为wardIdvalue为患者列表
const handleGetPrescription = inject('handleGetPrescription');
/**
* 加载树节点数据
* @param {Object} node - 树节点对象
* @param {Function} resolve - 解析函数,用于返回子节点数据
*/
function loadNode(node, resolve) {
// 根节点:加载所有病区
if (node.level === 0) {
loadWardList(resolve);
}
// 病区节点:加载该病区下的患者列表
else if (node.level === 1) {
const wardId = node.data.id;
loadPatientList(wardId, resolve);
}
// 其他层级返回空数组
else {
resolve([]);
}
}
/**
* 加载病区列表
* @param {Function} resolve - 解析函数
*/
function loadWardList(resolve) {
getWardList()
.then((res) => {
// 格式化病区数据
const wards = Array.isArray(res) ? res : res.data || [];
wardList.value = wards;
// 将病区数据转换为树节点格式
const wardNodes = wards.map((ward) => ({
id: ward.id,
name: ward.name || ward.wardName || '',
leaf: false, // 病区节点不是叶子节点
...ward,
}));
resolve(wardNodes);
})
.catch((error) => {
console.error('加载病区列表失败:', error);
resolve([]);
});
}
/**
* 加载指定病区的患者列表
* @param {String|Number} wardId - 病区ID
* @param {Function} resolve - 解析函数
*/
function loadPatientList(wardId, resolve) {
// 构建缓存键(包含搜索条件)
const cacheKey = `${wardId}_${searchKey.value || ''}`;
// 如果缓存中存在且搜索条件为空,直接使用缓存(搜索时需要重新加载)
if (!searchKey.value && patientDataCache.value.has(cacheKey)) {
const cachedPatients = patientDataCache.value.get(cacheKey);
resolve(cachedPatients);
return;
}
// 调用接口获取患者列表
getPatientList({
wardId: wardId,
searchKey: searchKey.value || '',
})
.then((res) => {
// 处理返回的患者数据
const records = res?.data?.records || [];
// 格式化患者数据
const patients = records.map((item) => ({
id: item.id || item.encounterId,
name: item.patientName || '',
leaf: true, // 患者节点是叶子节点
...item,
}));
// 缓存患者数据(仅在没有搜索条件时缓存)
if (!searchKey.value) {
patientDataCache.value.set(cacheKey, patients);
}
resolve(patients);
})
.catch((error) => {
console.error('加载患者列表失败:', error);
resolve([]);
});
}
/**
* 重新加载所有病区的患者列表
*/
function reloadAllPatients() {
if (!treeRef.value) return;
// 清除患者数据缓存
patientDataCache.value.clear();
nextTick(() => {
const rootNode = treeRef.value?.store?.root;
if (!rootNode?.childNodes) return;
// 遍历所有已展开的病区节点,重新加载患者列表
rootNode.childNodes.forEach((wardNode) => {
if (wardNode && wardNode.level === 1 && wardNode.key) {
reloadWardNodePatients(wardNode);
}
});
});
}
/**
* 重新加载指定病区节点的患者列表
* @param {Object} wardNode - 病区节点对象
*/
function reloadWardNodePatients(wardNode) {
if (!wardNode?.key || !treeRef.value) return;
const wardId = wardNode.data.id;
const cacheKey = `${wardId}_${searchKey.value || ''}`;
// 清除该病区的缓存
patientDataCache.value.delete(cacheKey);
// 清除旧的子节点
treeRef.value.updateKeyChildren(wardNode.key, []);
// 重置节点状态
wardNode.loaded = false;
wardNode.childNodes = [];
// 重新加载患者列表
loadPatientList(wardId, (children) => {
treeRef.value.updateKeyChildren(wardNode.key, children);
});
}
/**
* 重新加载指定病区的患者列表
* @param {String|Number} wardId - 病区ID
*/
function reloadWardPatients(wardId) {
if (!treeRef.value) return;
nextTick(() => {
const rootNode = treeRef.value?.store?.root;
if (!rootNode?.childNodes) return;
// 查找对应的病区节点
const wardNode = rootNode.childNodes.find((node) => node.data.id === wardId);
if (wardNode) {
reloadWardNodePatients(wardNode);
}
});
}
/**
* 手动触发加载节点
* @param {Object} node - 节点对象如果为null则重新加载整个树
*/
function manualLoadNode(node = null) {
if (!node) {
// 重新加载整个树
treeKey.value += 1;
patientDataCache.value.clear();
} else if (node.key && treeRef.value) {
// 重新加载指定节点
if (node.level === 1) {
// 病区节点:重新加载患者列表
reloadWardNodePatients(node);
} else if (node.level === 0) {
// 根节点:重新加载病区列表
loadWardList((wards) => {
treeRef.value.updateKeyChildren(node.key, wards);
});
}
}
}
/**
* 获取所有选中的叶子节点(患者节点)
* @returns {Array} 患者节点数组
*/
function getCheckedLeafNodes() {
if (!treeRef.value) return [];
// 获取所有选中的节点数据
const checkedNodes = treeRef.value.getCheckedNodes() || [];
// 只返回叶子节点(患者节点)
return checkedNodes.filter((node) => node.leaf === true);
}
/**
* 处理节点选中状态变化
* @param {Object} data - 节点数据
* @param {Object} checked - 选中状态对象
*/
function handleCheckChange(data, checked) {
const checkedPatients = getCheckedLeafNodes();
updatePatientInfoList(checkedPatients);
// 调用父组件的方法获取处方列表
if (handleGetPrescription && typeof handleGetPrescription === 'function') {
handleGetPrescription();
}
}
/**
* 处理节点点击事件
* @param {Object} data - 节点数据
* @param {Object} node - 节点对象
*/
function handleNodeClick(data, node) {
// 节点点击处理逻辑(可根据需要添加)
}
/**
* 处理搜索
*/
function handleSearch() {
// 清除缓存(搜索时需要重新加载)
patientDataCache.value.clear();
// 重新加载所有已展开病区的患者列表
reloadAllPatients();
}
// 暴露方法供外部调用
defineExpose({
manualLoadNode,
reloadAllPatients,
reloadWardPatients,
handleSearch,
});
</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>

View File

@@ -0,0 +1,45 @@
export const inpatientNurseNavs = [
{
label: '入出转',
path: '/inHospital/statistics/inOut',
icon: 'Document',
accent: '#5b8ff9',
},
{
label: '护理记录',
path: '/inHospital/statistics/nursingRecord',
icon: 'MedicineBox',
accent: '#13c2c2',
},
{
label: '三测单',
path: '/inHospital/statistics/tprChart',
icon: 'List',
accent: '#ffc53d',
},
{
label: '医嘱执行',
path: '/inHospital/statistics/medicalOrderExecution',
icon: 'Finished',
accent: '#73d13d',
},
{
label: '医嘱校对',
path: '/inHospital/statistics/medicalOrderProofread',
icon: 'EditPen',
accent: '#ff7a45',
},
{
label: '汇总发药申请',
path: '/inHospital/statistics/drugDistribution',
icon: 'Collection',
accent: '#597ef7',
},
{
label: '住院记账',
path: '/inHospital/statistics/InpatientBilling',
icon: 'Tickets',
accent: '#9e60ff',
},
];

View File

@@ -15,19 +15,19 @@
</el-tabs>
</div>
</template>
<script setup >
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue'
<script setup>
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue';
import { WaitForDischarge, Discharged } from './components/index.ts'
import { WaitForDischarge, Discharged } from './components/index.ts';
// const { proxy } = getCurrentInstance()
// const emits = defineEmits([])
// const props = defineProps({})
const state = reactive({})
onBeforeMount(() => { })
onMounted(() => { })
defineExpose({ state })
const state = reactive({});
onBeforeMount(() => {});
onMounted(() => {});
defineExpose({ state });
const activeTabName = ref('first')
const activeTabName = ref('first');
</script>
<style lang="scss" scoped>
.inpatientNurseHome-inOut-container {

View File

@@ -164,7 +164,11 @@
<script setup>
import { getPrescriptionList, adviceExecute, adviceCancel, medicineSummary } from './api';
<<<<<<< HEAD
import { patientInfoList } from '../store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { formatDate, formatDateStr } from '@/utils/index';
import { ref, getCurrentInstance } from 'vue';
import useUserStore from '@/store/modules/user';
@@ -203,6 +207,7 @@ function handleGetPrescription() {
therapyEnum: therapyEnum.value,
exeStatus: props.exeStatus,
requestStatus: props.requestStatus,
<<<<<<< HEAD
}).then((res) => {
// try {
// 根据encounterId分组
@@ -253,6 +258,68 @@ function handleGetPrescription() {
// loading.value = false;
// }
});
=======
})
.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;
// }
})
.catch((err) => {
loading.value = false;
useUserStore()
.logOut()
.then(() => {
ElMessage.error(err);
next({ path: '/' });
});
});
>>>>>>> v1.3
chooseAll.value = false;
} else {
prescriptionList.value = [];
@@ -324,4 +391,8 @@ defineExpose({
font-size: 15px;
font-weight: 500;
}
</style>
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -49,7 +49,11 @@
<script setup>
import { getMedicineSummary, getMedicineSummaryDetail } from './api';
<<<<<<< HEAD
import { patientInfoList } from '../store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { ref, getCurrentInstance } from 'vue';
const medicineSummaryFormList = ref([]);

View File

@@ -6,6 +6,7 @@
height: 40px;
display: flex;
align-items: center;
<<<<<<< HEAD
justify-content: flex-end;
border-bottom: solid 2px #e4e7ed;
"
@@ -15,6 +16,17 @@
class="refresh-icon"
style="cursor: pointer; font-size: 20px; margin-right: 10px"
>
=======
justify-content: space-between;
border-bottom: solid 2px #e4e7ed;
padding: 0 10px;
"
>
<!-- <el-icon style="cursor: pointer; font-size: 20px" @click="handleBack">
<ArrowLeft />
</el-icon> -->
<el-icon @click="refresh" class="refresh-icon" style="cursor: pointer; font-size: 20px">
>>>>>>> v1.3
<Refresh />
</el-icon>
</div>
@@ -22,6 +34,7 @@
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
@@ -53,6 +66,17 @@
</el-button>
</div>
</div>
=======
<!-- 隐藏转科列表
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
-->
</el-tabs>
</div>
<div style="width: 100%">
<!-- <NurseNavBar :navs="navigationButtons" /> -->
>>>>>>> v1.3
<div
style="
height: 50px;
@@ -124,6 +148,7 @@
<script setup>
import { getCurrentInstance, ref } from 'vue';
<<<<<<< HEAD
import { useRoute, useRouter } from 'vue-router';
import PatientList from './components/patientList.vue';
import PrescriptionList from './components/prescriptionList.vue';
@@ -132,6 +157,17 @@ import SummaryMedicineList from './components/summaryMedicineList.vue';
const { proxy } = getCurrentInstance();
const router = useRouter();
const currentRoute = useRoute();
=======
import { useRouter } from 'vue-router';
import PatientList from '../components/patientList.vue';
import NurseNavBar from '../components/NurseNavBar.vue';
import PrescriptionList from './components/prescriptionList.vue';
import SummaryMedicineList from './components/summaryMedicineList.vue';
import { inpatientNurseNavs } from '../constants/navigation';
const { proxy } = getCurrentInstance();
const router = useRouter();
>>>>>>> v1.3
const activeName = ref('preparation');
const active = ref('first');
@@ -145,6 +181,7 @@ const isDetails = ref('1');
// 存储子组件引用的对象
const prescriptionRefs = ref();
<<<<<<< HEAD
// 导航按钮配置
const navigationButtons = ref([
{
@@ -188,6 +225,9 @@ const navigationButtons = ref([
const navigateTo = (path) => {
router.push(path);
};
=======
const navigationButtons = inpatientNurseNavs;
>>>>>>> v1.3
// 定义处方列表tabs配置
const prescriptionTabs = [
@@ -242,6 +282,13 @@ function handleExecute() {
proxy.$refs['prescriptionRefs'].handleMedicineSummary();
}
<<<<<<< HEAD
=======
function handleBack() {
router.back();
}
>>>>>>> v1.3
provide('handleGetPrescription', (value) => {
prescriptionRefs.value.handleGetPrescription();
});
@@ -269,6 +316,7 @@ provide('handleGetPrescription', (value) => {
:deep(.el-tabs__header) {
margin: 0;
}
<<<<<<< HEAD
.nav-button-group {
display: flex;
@@ -293,4 +341,6 @@ provide('handleGetPrescription', (value) => {
.nav-button :deep(.el-icon) {
margin-right: 5px;
}
=======
>>>>>>> v1.3
</style>

View File

@@ -1,112 +0,0 @@
<template>
<div class="patientList-container">
<div class="search-container">
<el-space :size="4">
<el-input v-model="searchForm.searchVal" style="width: 100px" placeholder="请输入" />
<el-button>查询</el-button>
</el-space>
</div>
<div class="patientList-table">
<el-table :data="patientListData" row-key="id" style="width: 100%; height: 100%" highlight-current-row
@selection-change="handleSelectionChange" :show-header="false" show-overflow-tooltip>
<el-table-column label="姓名" prop="name" min-width="100">
<template #default="{ row }">
<span class="name" v-if="row.children"> {{ row.department }}({{ row.children?.length || 0 }})</span>
<div class="patient-name" v-else>
<span class="name">{{ row.name }}</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const searchForm = ref({
searchVal: '',
})
const patientListData = ref([
{
id: 1,
department: '儿科',
children: [
{
id: 11,
name: '张三',
bedName: '1201',
gender: '男',
status: '在科',
attention: '医生A'
},
{
id: 12,
name: '张三-2',
age: 3,
gender: '女',
status: '在科',
attention: '医生A'
}
]
},
{
id: 2,
department: '神经内科科',
children: [
{
id: 21,
name: '张三',
bedName: '1201',
gender: '男',
status: '在科',
attention: '医生A'
},
{
id: 22,
name: '张三-2',
age: 3,
gender: '女',
status: '在科',
attention: '医生A'
}
]
}
])
const handleSelectionChange = (selection: any[]) => {
console.log('handleSelectionChange', selection)
}
</script>
<style lang="scss" scoped>
.patientList-container {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
overflow: hidden;
width: 240px;
border-right: 1px solid #e4e7ed;
.search-container {
flex: none;
padding: 0px 8px;
border-bottom: 1px solid #e4e7ed;
height: 40px;
display: flex;
align-items: center;
}
.patientList-table {
flex: 1;
:deep(.el-table__indent) {
display: none !important;
}
:deep(.el-table__placeholder) {
display: none !important;
}
}
}
</style>

View File

@@ -1,4 +1,4 @@
import request from '@/utils/request'
import request from '@/utils/request';
/**
* 获取初始化
@@ -7,8 +7,8 @@ export function getInit(queryParams) {
return request({
url: '/nurse-station/atd-manage/init',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
/**
@@ -18,8 +18,8 @@ export function getPendingInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-patient',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
/**
@@ -29,8 +29,8 @@ export function getBedInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-bed',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
/**
@@ -40,8 +40,8 @@ export function getPatientInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-patient-info',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
/**
@@ -50,8 +50,8 @@ export function getPatientInfo(queryParams) {
export function getDoctorInfo(queryParams) {
return request({
url: '/charge-manage/register/practitioner-metadata?orgId=' + queryParams.organizationId,
method: 'get'
})
method: 'get',
});
}
/**
@@ -60,8 +60,8 @@ export function getDoctorInfo(queryParams) {
export function getNurseInfo(queryParams) {
return request({
url: '/app-common/nurse-list?orgId=' + queryParams.organizationId,
method: 'get'
})
method: 'get',
});
}
/**
@@ -71,8 +71,8 @@ export function bedAssignment(data) {
return request({
url: '/nurse-station/atd-manage/bed-assignment',
method: 'post',
data: data
})
data: data,
});
}
/**
@@ -82,14 +82,66 @@ export function childLocationList(queryParams) {
return request({
url: '/app-common/child-location-list',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
export function getPractitionerWard(queryParams) {
return request({
url: '/app-common/practitioner-ward',
method: 'get',
params: queryParams
})
params: queryParams,
});
}
export function getPrescriptionList(queryParams) {
return request({
url: '/nurse-station/atd-manage/patient-pending',
method: 'get',
params: queryParams,
});
}
//获取个人账户金额
export function getPersonAccount(queryParams) {
return request({
url: '/nurse-station/atd-manage/get-amount?encounterId=' + queryParams.encounterId,
method: 'get',
});
}
//待配药/待发药获取
export function getDRMedication(queryParams) {
return request({
url: '/nurse-station/atd-manage/get-dr-medication?encounterId=' + queryParams.encounterId,
method: 'get',
});
}
//转院
export function updateTransferDepartment(encounterId) {
return request({
url: '/nurse-station/atd-manage/transfer-department',
method: 'put',
params: {
encounterId: encounterId,
},
});
}
//出院
export function updateOutHospital(encounterId) {
return request({
url: '/nurse-station/atd-manage/hospital-discharge',
method: 'put',
params: {
encounterId: encounterId,
},
});
}
//清床
export function terminalCleaning(encounterId) {
return request({
url: '/nurse-station/atd-manage/terminal-cleaning',
method: 'put',
params: {
encounterId: encounterId,
},
});
}

View File

@@ -7,5 +7,7 @@ import BedAllocation from './bedAllocation.vue'
import TransferInDialog from './transferInDialog.vue'
import SignEntryDialog from './signEntryDialog.vue'
import BedCards from './bedcards.vue'
import TransferOut from './transferOut.vue'
export { BedAllocation, TransferInDialog, SignEntryDialog, BedCards }
export { BedAllocation, TransferInDialog, SignEntryDialog, BedCards ,TransferOut }

View File

@@ -15,93 +15,158 @@
<el-row>
<el-col :span="24">
<div class="patient-info">
<div style="display: flex;align-items: center;margin-bottom: 16px;">
<div style="margin-right: 36px;font-size: 18px;font-weight: 700;">{{ props.pendingInfo.houseName + '-' + props.pendingInfo.bedName }}</div>
<div style="border-radius: 50px;border: 2px solid slategray;padding: 4px 12px;">{{ props.pendingInfo.contractName }}</div>
<div style="display: flex; align-items: center; margin-bottom: 16px">
<div style="margin-right: 36px; font-size: 18px; font-weight: 700">
{{ props.pendingInfo.houseName + '-' + props.pendingInfo.bedName }}
</div>
<div style="border-radius: 50px; border: 2px solid slategray; padding: 4px 12px">
{{ props.pendingInfo.contractName }}
</div>
</div>
<div>
<el-row>
<el-col :span="12">
<div style="margin-bottom: 12px;">
{{ props.pendingInfo.patientName}}
<span style="color: #9f9f9f;">{{ props.pendingInfo.genderEnum_enumText}}/</span>
<span style="color: #9f9f9f;">{{ props.pendingInfo.age}}</span>
<div style="margin-bottom: 12px">
{{ props.pendingInfo.patientName }}
<span style="color: #9f9f9f"
>{{ props.pendingInfo.genderEnum_enumText }}/</span
>
<span style="color: #9f9f9f">{{ props.pendingInfo.age }}</span>
</div>
</el-col>
<el-col :span="12">
<div>
电话{{ pendingInfo.phone }}
</div>
<div>电话{{ pendingInfo.phone }}</div>
</el-col>
<el-col :span="12">
<div>
住院诊断{{ pendingInfo.conditionNames }}
</div>
<div>住院诊断{{ pendingInfo.conditionNames }}</div>
</el-col>
<el-col :span="12">{{ props.pendingInfo.patientId }}</el-col>
</el-row>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="info-title">
入院体征
</div>
<div class="info-title">入院体征</div>
</el-col>
<el-col :span="8">
<el-form-item label="身高" label-width="50px">
<el-input-number :controls="false" style="width: 160px" clearable v-model="interventionForm.height" placeholder="请输入" :min="0"
:max="999"></el-input-number><span class="unit">cm</span>
<!-- <el-input-number
:controls="false"
style="width: 160px"
clearable
v-model="interventionForm.height"
placeholder="请输入"
:min="0"
:max="999"
></el-input-number
><span class="unit">cm</span> -->
<el-input
class="right-aligned"
style="width: 160px"
clearable
v-model="interventionForm.height"
placeholder="请输入"
:min="0"
:max="999"
></el-input>
<span class="unit">cm</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="体重" label-width="50px">
<el-input-number :controls="false" style="width: 160px" v-model="interventionForm.weight" clearable placeholder="请输入" :min="0"
:max="999"></el-input-number>
<!-- <el-input-number
:controls="false"
style="width: 160px"
v-model="interventionForm.weight"
clearable
placeholder="请输入"
:min="0"
:max="999"
></el-input-number>
<span class="unit">kg</span> -->
<el-input
class="right-aligned"
style="width: 160px"
v-model="interventionForm.weight"
clearable
placeholder="请输入"
></el-input>
<span class="unit">kg</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="体温" label-width="50px">
<el-input-number :controls="false" style="width: 160px" v-model="interventionForm.temperature" clearable placeholder="请输入"
:min="0" :max="99"></el-input-number>
<el-input-number
:controls="false"
style="width: 160px"
v-model="interventionForm.temperature"
clearable
placeholder="请输入"
:min="0"
:max="99"
></el-input-number>
<span class="unit"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="心率" label-width="50px">
<el-input-number :controls="false" style="width: 160px" v-model="interventionForm.hertRate" clearable placeholder="请输入" :min="0"
:max="999"></el-input-number>
<el-input-number
:controls="false"
style="width: 160px"
v-model="interventionForm.hertRate"
clearable
placeholder="请输入"
:min="0"
:max="999"
></el-input-number>
<span class="unit">BPM</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="脉搏" label-width="50px">
<el-input-number :controls="false" style="width: 160px" v-model="interventionForm.pulse" clearable placeholder="请输入" :min="0"
:max="999"></el-input-number><span class="unit">P</span>
<el-input-number
:controls="false"
style="width: 160px"
v-model="interventionForm.pulse"
clearable
placeholder="请输入"
:min="0"
:max="999"
></el-input-number
><span class="unit">P</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="血压" label-width="50px">
<el-input-number :controls="false" style="width: 72px" v-model="interventionForm.endBloodPressure" clearable placeholder="请输入"
:min="0" :max="999"></el-input-number>
<el-input-number
:controls="false"
style="width: 72px"
v-model="interventionForm.endBloodPressure"
clearable
placeholder="请输入"
:min="0"
:max="999"
></el-input-number>
<span style="display: inline-block; width: 8px; margin: 0 4px"> ~ </span>
<el-input-number :controls="false" style="width: 72px" v-model="interventionForm.highBloodPressure" clearable placeholder="请输入"
:min="0" :max="999"></el-input-number>
<el-input-number
:controls="false"
style="width: 72px"
v-model="interventionForm.highBloodPressure"
clearable
placeholder="请输入"
:min="0"
:max="999"
></el-input-number>
<span class="unit">mmHg</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="info-title">
入院信息
</div>
<div class="info-title">入院信息</div>
</el-col>
<el-col :span="8">
<el-form-item label="入院科室" label-width="100px">
@@ -150,7 +215,9 @@
v-model="interventionForm.admittingDoctorId"
placeholder="请选择住院医生"
style="width: 240px"
:disabled="props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2"
:disabled="
props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2
"
>
<el-option
v-for="item in doctorInfoOptions"
@@ -167,7 +234,9 @@
v-model="interventionForm.attendingDoctorId"
placeholder="请选择主治医生"
style="width: 240px"
:disabled="props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2"
:disabled="
props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2
"
>
<el-option
v-for="item in doctorInfoOptions"
@@ -184,7 +253,9 @@
v-model="interventionForm.chiefDoctorId"
placeholder="请选择主任医生"
style="width: 240px"
:disabled="props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2"
:disabled="
props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2
"
>
<el-option
v-for="item in doctorInfoOptions"
@@ -213,7 +284,9 @@
v-model="interventionForm.primaryNurseId"
placeholder="请选择责任护士"
style="width: 240px"
:disabled="props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2"
:disabled="
props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2
"
>
<el-option
v-for="item in nurseInfoOptions"
@@ -230,7 +303,9 @@
v-model="interventionForm.priorityEnum"
placeholder="请选择患者病情"
style="width: 240px"
:disabled="props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2"
:disabled="
props.pendingInfo.encounterStatus == 5 && props.pendingInfo.entranceType == 2
"
>
<el-option
v-for="item in props.priorityOptions"
@@ -257,50 +332,57 @@
</el-dialog>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, inject, type Ref, watch } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
import { dayjs, ElMessage } from 'element-plus'
import { reactive, ref, onMounted, inject, type Ref, watch, nextTick } from 'vue';
import type { FormInstance, FormRules } from 'element-plus';
import { dayjs, ElMessage } from 'element-plus';
// import type { IInPatient } from '@/model/IInPatient'
import { getBedInfo, getDoctorInfo, getNurseInfo, getInit, bedAssignment, getPatientInfo } from './api'
import {
getBedInfo,
getDoctorInfo,
getNurseInfo,
getInit,
bedAssignment,
getPatientInfo,
} from './api';
const props = defineProps({
pendingInfo: {
type: Object,
require: true,
default: () => ({})
default: () => ({}),
},
priorityOptions: {
type: Object,
require: true,
default: () => ({})
default: () => ({}),
},
})
});
const currentInPatient = ref<Partial<IInPatient>>({})
const bedInfoOptions = ref<{ label: string; value: string }[]>([])
const doctorInfoOptions = ref<{ name: string; id: string }[]>([])
const nurseInfoOptions = ref<{ name: string; practitionerId: string }[]>([])
const InitInfoOptions = ref<any>({})
const priorityListOptions = ref<{ info: string; value: string }[]>([])
const pendingInfo = ref<any>({})
const currentInPatient = ref<Partial<IInPatient>>({});
const bedInfoOptions = ref<{ label: string; value: string }[]>([]);
const doctorInfoOptions = ref<{ name: string; id: string }[]>([]);
const nurseInfoOptions = ref<{ name: string; practitionerId: string }[]>([]);
const InitInfoOptions = ref<any>({});
const priorityListOptions = ref<{ info: string; value: string }[]>([]);
const pendingInfo = ref<any>({});
const initCurrentInPatient = () => {
currentInPatient.value = {
feeType: '08',
sexName: '男',
age: '0',
}
}
};
};
/* 入科 */
const interventionForm = ref({
height: undefined,
weight: undefined,
temperature: undefined,
hertRate: undefined,
pulse: undefined,
endBloodPressure: undefined,
highBloodPressure: undefined,
height: '',
weight: '',
temperature: '',
hertRate: '',
pulse: '',
endBloodPressure: '',
highBloodPressure: '',
bedLocationId: '', // 床号
admittingDoctorId: '', // 住院医师
attendingDoctorId: '', // 主治医师
@@ -312,85 +394,129 @@ const interventionForm = ref({
bedName: '',
attendingDocUpdateId: '',
startTime: '', //入院时间
})
});
watch(() => props.pendingInfo, (newVal, oldVal) => {
console.log(newVal)
if(newVal) {
getPatientInfo({encounterId: newVal.encounterId}).then(res => {
pendingInfo.value = res.data
interventionForm.value.admittingDoctorId = res.data.admittingDoctorId
interventionForm.value.attendingDoctorId = res.data.attendingDoctorId
interventionForm.value.chiefDoctorId = res.data.chiefDoctorId
interventionForm.value.primaryNurseId = res.data.primaryNurseId
if(res.data.startTime) {
interventionForm.value.startTime = dayjs(res.data.startTime).format('YYYY-MM-DD HH:mm:ss')
}else {
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
}
})
interventionForm.value.priorityEnum = newVal.priorityEnum
interventionForm.value.organizationName = newVal.organizationName
interventionForm.value.wardName = newVal.wardName
interventionForm.value.bedName = newVal.bedName
}
},{ deep: true })
watch(
() => props.pendingInfo,
(newVal, oldVal) => {
console.log(newVal);
if (newVal) {
getPatientInfo({ encounterId: newVal.encounterId }).then((res) => {
console.log('res============>', JSON.stringify(res.data));
pendingInfo.value = res.data;
interventionForm.value.admittingDoctorId = res.data.admittingDoctorId;
interventionForm.value.attendingDoctorId = res.data.attendingDoctorId;
if (res.data.chiefDoctorId) {
interventionForm.value.chiefDoctorId = res.data.chiefDoctorId;
}
interventionForm.value.primaryNurseId = res.data.primaryNurseId;
if (res.data.startTime) {
interventionForm.value.startTime = dayjs(res.data.startTime).format(
'YYYY-MM-DD HH:mm:ss'
);
} else {
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
}
interventionForm.value.height = res.data.height;
interventionForm.value.weight = res.data.weight;
interventionForm.value.temperature = res.data.temperature;
interventionForm.value.hertRate = res.data.hertRate;
interventionForm.value.pulse = res.data.pulse;
interventionForm.value.endBloodPressure = res.data.endBloodPressure;
interventionForm.value.highBloodPressure = res.data.highBloodPressure;
});
interventionForm.value.priorityEnum = newVal.priorityEnum;
interventionForm.value.organizationName = newVal.organizationName;
interventionForm.value.wardName = newVal.wardName;
interventionForm.value.bedName = newVal.bedName;
}
},
{ deep: true }
);
/* 初始化数据 */
const init = () => {
initCurrentInPatient()
getInit().then(res => {
InitInfoOptions.value = res.data
// 安全地设置priorityListOptions
if (res.data && res.data.priorityListOptions) {
priorityListOptions.value = res.data.priorityListOptions
}
}).catch(error => {
console.error('获取初始化数据失败:', error)
})
initCurrentInPatient();
getInit()
.then((res) => {
InitInfoOptions.value = res.data;
// 安全地设置priorityListOptions
if (res.data && res.data.priorityListOptions) {
priorityListOptions.value = res.data.priorityListOptions;
}
})
.catch((error) => {
console.error('获取初始化数据失败:', error);
});
if (props.pendingInfo.wardLocationId) {
getBedInfo({wardLocationId: props.pendingInfo.wardLocationId}).then(res => {
bedInfoOptions.value = res.data || []
}).catch(error => {
console.error('获取床位信息失败:', error)
bedInfoOptions.value = []
})
getBedInfo({ wardLocationId: props.pendingInfo.wardLocationId })
.then((res) => {
bedInfoOptions.value = res.data || [];
})
.catch((error) => {
console.error('获取床位信息失败:', error);
bedInfoOptions.value = [];
});
}
if (props.pendingInfo.organizationId) {
getDoctorInfo({organizationId: props.pendingInfo.organizationId}).then(res => {
doctorInfoOptions.value = res.data.records || []
}).catch(error => {
console.error('获取医生信息失败:', error)
doctorInfoOptions.value = []
})
getNurseInfo({organizationId: props.pendingInfo.organizationId}).then(res => {
nurseInfoOptions.value = res.data || []
}).catch(error => {
console.error('获取护士信息失败:', error)
nurseInfoOptions.value = []
})
// 主任医生
getDoctorInfo({ organizationId: props.pendingInfo.organizationId })
.then((res) => {
console.log('doctorInfoOptions======>', JSON.stringify(res.data));
doctorInfoOptions.value = res.data.records || [];
nextTick(() => {
// 如果存在主任医师显示主任,如果没有选择第一个展示
if (doctorInfoOptions.value.length > 0) {
let selectId = '';
doctorInfoOptions.value.forEach((item: any) => {
if (item.drProfttlCode == '231') {
selectId = item.id;
}
});
if (selectId.length > 0) {
interventionForm.value.chiefDoctorId = selectId;
} else {
interventionForm.value.chiefDoctorId = doctorInfoOptions.value[0].id;
}
}
});
})
.catch((error) => {
console.error('获取医生信息失败:', error);
doctorInfoOptions.value = [];
});
getNurseInfo({ organizationId: props.pendingInfo.organizationId })
.then((res) => {
nurseInfoOptions.value = res.data || [];
})
.catch((error) => {
console.error('获取护士信息失败:', error);
nurseInfoOptions.value = [];
});
}
}
};
const rules = reactive<FormRules>({
admittingDoctorId: [{ required: true, message: '请选择住院医生', trigger: ['blur', 'change'] }],
primaryNurseId: [{ required: true, message: '请选择责任护士', trigger: ['blur', 'change'] }],
bedLocationId: [{ required: true, message: '请选择入住床位', trigger: ['blur', 'change'] }],
})
});
const printWristband = ref(false)
const emits = defineEmits(['okAct'])
const visible = defineModel('visible')
const width = '950px'
const printWristband = ref(false);
const emits = defineEmits(['okAct']);
const visible = defineModel('visible');
const width = '950px';
/* 取消 */
const cancelAct = () => {
resetForm()
visible.value = false
}
resetForm();
visible.value = false;
};
const resetForm = () => {
// interventionForm.value = {
@@ -415,74 +541,76 @@ const resetForm = () => {
// 可选:清空校验状态
if (interventionFormRef.value) {
interventionFormRef.value.resetFields()
interventionFormRef.value.resetFields();
}
}
};
/* 入科 */
const interventionFormRef = ref<FormInstance | null>(null)
const interventionFormRef = ref<FormInstance | null>(null);
const handleSubmit = async () => {
// TODO 登记入科
if (!interventionFormRef.value) {
console.error('表单引用不存在')
return
console.error('表单引用不存在');
return;
}
try {
const valid = await interventionFormRef.value.validate()
const valid = await interventionFormRef.value.validate();
if (valid) {
const params = {
const params = {
...pendingInfo.value,
...interventionForm.value,
targetBedId: props.pendingInfo.bedId,
busNo: props.pendingInfo.busNo,
inHosTime: props.pendingInfo.inHosTime,
targetHouseId : props.pendingInfo.targetHouseId,
targetHouseId: props.pendingInfo.targetHouseId,
targetEncounterId: props.pendingInfo.targetEncounterId,
editFlag: props.pendingInfo.entranceType == 1 ? 1 : 0
}
bedAssignment(params).then((res: any) => {
ElMessage({
message: '登记成功!',
type: 'success',
grouping: true,
showClose: true,
editFlag: props.pendingInfo.entranceType == 1 ? 1 : 0,
};
bedAssignment(params)
.then((res: any) => {
ElMessage({
message: '登记成功!',
type: 'success',
grouping: true,
showClose: true,
});
resetForm();
emits('okAct');
visible.value = false; // 关闭对话框
})
resetForm()
emits('okAct')
visible.value = false // 关闭对话框
}).catch((error: any) => {
console.error('登记失败:', error)
ElMessage({
message: '登记失败!',
type: 'error',
grouping: true,
showClose: true,
})
})
.catch((error: any) => {
console.error('登记失败:', error);
ElMessage({
message: '登记失败!',
type: 'error',
grouping: true,
showClose: true,
});
});
}
} catch (error) {
console.log('表单验证失败:', error)
console.log('表单验证失败:', error);
}
}
};
const openAct = () => {
init()
init();
if (props.pendingInfo) {
interventionForm.value.priorityEnum = props.pendingInfo.priorityEnum || ''
interventionForm.value.admittingDoctorId = props.pendingInfo.practitionerId || ''
interventionForm.value.organizationName = props.pendingInfo.organizationName || ''
interventionForm.value.wardName = props.pendingInfo.wardName || ''
interventionForm.value.attendingDocUpdateId = props.pendingInfo.admittingDoctorId || ''
interventionForm.value.priorityEnum = props.pendingInfo.priorityEnum || '';
interventionForm.value.admittingDoctorId = props.pendingInfo.practitionerId || '';
interventionForm.value.organizationName = props.pendingInfo.organizationName || '';
interventionForm.value.wardName = props.pendingInfo.wardName || '';
interventionForm.value.attendingDocUpdateId = props.pendingInfo.admittingDoctorId || '';
}
}
};
const closedAct = () => {
resetForm()
visible.value = false
}
resetForm();
visible.value = false;
};
onMounted(() => {})
onMounted(() => {});
</script>
<style lang="scss" scoped>
.transferIn-container {
@@ -531,4 +659,10 @@ onMounted(() => {})
padding: 5px 10px;
margin-bottom: 16px;
}
</style>
.right-aligned {
:deep(.el-input__inner) {
text-align: center;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -5,43 +5,69 @@
-->
<template>
<div class="inpatientNurseHome-inOut-container">
<el-tabs v-model="activeTabName" type="card" class="inOut-tabs">
<el-tabs v-model="activeTabName" class="inOut-tabs" @tab-click="test">
<el-tab-pane label="入科" name="first">
<BedAllocation />
<BedAllocation v-if="activeTabName === 'first'" ref="firstRef" />
</el-tab-pane>
<el-tab-pane label="转出" name="second">Config</el-tab-pane>
<el-tab-pane label="出院" name="second">Config</el-tab-pane>
<el-tab-pane label="出院患者" name="second">Config</el-tab-pane>
<el-tab-pane label="转出" name="second">
<TransferOut
v-if="activeTabName === 'second'"
ref="secondRef"
operation-type="transfer"
:visible="activeTabName === 'second'"
/>
</el-tab-pane>
<el-tab-pane label="出院" name="third">
<TransferOut
v-if="activeTabName === 'third'"
ref="thirdRef"
operation-type="discharge"
:visible="activeTabName === 'third'"
/>
</el-tab-pane>
<!-- <el-tab-pane label="出院患者" name="fourth">Config</el-tab-pane> -->
</el-tabs>
</div>
</template>
<script setup lang="ts">
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue'
import { getCurrentInstance, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
import { BedAllocation, TransferInDialog, SignEntryDialog } from './components/index'
import { BedAllocation, TransferInDialog, SignEntryDialog, TransferOut } from './components/index';
// const { proxy } = getCurrentInstance()
// const emits = defineEmits([])
// const props = defineProps({})
const state = reactive({})
onBeforeMount(() => {})
onMounted(() => {
})
defineExpose({ state })
const state = reactive({});
const firstRef = ref();
const secondRef = ref();
const thirdRef = ref();
onBeforeMount(() => {});
onMounted(() => {});
defineExpose({ state });
const test = () => {
nextTick(() => {
if (activeTabName.value == 'first') {
firstRef?.value?.refreshTap();
} else if (activeTabName.value == 'second') {
secondRef?.value?.refreshTap();
} else if (activeTabName.value == 'third') {
thirdRef?.value?.refreshTap();
}
});
};
const activeTabName = ref('first')
const activeTabName = ref('first');
</script>
<style lang="scss" scoped>
.inpatientNurseHome-inOut-container {
width: 100%;
height: 100%;
display: flex;
padding: 0 8px 8px;
:deep(.inOut-tabs) {
height: 100%;
width: 100%;
.el-tabs__header {
margin: 0;
padding: 0 0 0 8px;
}
.el-tab-pane {
height: 100%;

View File

@@ -0,0 +1,39 @@
// 入出转管理
import inOut from '../inOut/index.vue';
// 护理记录
import NursingRecord from '@/views/inpatientNurse/nursingRecord/index.vue';
// 三测单
// import TprChart from '@/views/inpatientNurse/tprChart/index.vue';
import TprChart from '@/views/inpatientNurse/tprsheet/index.vue';
// 科室耗材盘点
import ChkstockPartDeptDevice from '@/views/medicationmanagement/chkstock/chkstockPartDeptDevice/index.vue';
// 医嘱执行
import MedicalOrderExecution from '@/views/inpatientNurse/medicalOrderExecution/index.vue';
// 医嘱校对
import MedicalOrderProofread from '@/views/inpatientNurse/medicalOrderProofread/index.vue';
// 汇总领药
import DrugDistribution from '@/views/inpatientNurse/drugDistribution/index.vue';
// 住院记账
import InpatientBilling from '@/views/inpatientNurse/InpatientBilling/index.vue';
// 出院管理
import DischargedManagement from '@/views/inpatientNurse/dischargedManagement/index.vue';
// 住院病历
import InpatientRecord from '@/views/inpatientDoctor/home/emr/index.vue';
// 滚费配置
import RollFee from '@/views/inpatientNurse/rollFee/index.vue';
// 危重记录
import Criticalrecord from '@/views/inpatientNurse/nursingstatistics/criticalrecord.vue';
export {
inOut,
ChkstockPartDeptDevice,
NursingRecord,
TprChart,
MedicalOrderExecution,
MedicalOrderProofread,
DrugDistribution,
InpatientBilling,
DischargedManagement,
InpatientRecord,
RollFee,
Criticalrecord,
};

View File

@@ -0,0 +1,135 @@
<template>
<div class="inpatientNurse-home-container">
<el-container>
<!-- main -->
<el-container class="inpatientNurse-home-main">
<el-main>
<el-tabs v-model="activeTabName" type="card" class="patient-tabs">
<el-tab-pane label="入出转管理" name="InOut">
<inOut v-if="activeTabName === 'InOut'"></inOut>
</el-tab-pane>
<el-tab-pane label="住院病历" name="InpatientRecord">
<el-container v-if="activeTabName === 'InpatientRecord'">
<PatientList :selected-patient="patientInfo" :on-select="handlePatientSelect" />
<el-container>
<el-header>
<inPatientBarDoctorFold></inPatientBarDoctorFold>
</el-header>
<el-main>
<InpatientRecord :key="recordKey"></InpatientRecord>
</el-main>
</el-container>
</el-container>
</el-tab-pane>
<el-tab-pane label="医嘱校对" name="MedicalOrderProofread">
<MedicalOrderProofread
v-if="activeTabName === 'MedicalOrderProofread'"
></MedicalOrderProofread>
</el-tab-pane>
<el-tab-pane label="医嘱执行" name="MedicalOrderExecution">
<MedicalOrderExecution
v-if="activeTabName === 'MedicalOrderExecution'"
></MedicalOrderExecution>
</el-tab-pane>
<el-tab-pane label="护理记录" name="NursingRecord">
<Criticalrecord v-if="activeTabName === 'NursingRecord'"></Criticalrecord>
</el-tab-pane>
<el-tab-pane label="体温单" name="TprSheet">
<TprChart
v-if="activeTabName === 'TprSheet'"
:selected-patient="patientInfo"
:on-select="handlePatientSelect"
/>
</el-tab-pane>
<el-tab-pane label="住院记账" name="InpatientBilling">
<InpatientBilling v-if="activeTabName === 'InpatientBilling'" />
</el-tab-pane>
<el-tab-pane label="汇总领药" name="DrugDistribution">
<DrugDistribution v-if="activeTabName === 'DrugDistribution'"></DrugDistribution>
</el-tab-pane>
<el-tab-pane label="科室耗材盘点" name="ChkstockPartDeptDevice">
<ChkstockPartDeptDevice
v-if="activeTabName === 'ChkstockPartDeptDevice'"
></ChkstockPartDeptDevice>
</el-tab-pane>
<el-tab-pane label="滚费配置" name="RollFee">
<RollFee v-if="activeTabName === 'RollFee'"></RollFee>
</el-tab-pane>
<!-- <el-tab-pane label="皮试管理" name="I"> 皮试管理 </el-tab-pane>
<el-tab-pane label="出院管理" name="J">
<DischargedManagement></DischargedManagement>
</el-tab-pane>
<el-tab-pane label="退药管理" name="K"> 退药管理 </el-tab-pane>
<el-tab-pane label="手术记录" name="L"> 手术记录 </el-tab-pane> -->
</el-tabs>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script setup>
import { computed, ref, watch } from 'vue';
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
import PatientList from '@/components/PatientList/patient-list.vue';
import { patientInfo, updatePatientInfo } from '@/views/inpatientDoctor/home/store/patient.js';
import {
inOut,
ChkstockPartDeptDevice,
NursingRecord,
TprChart,
MedicalOrderExecution,
MedicalOrderProofread,
DrugDistribution,
InpatientBilling,
DischargedManagement,
InpatientRecord,
RollFee,
Criticalrecord,
} from './index.js';
const activeTabName = ref('InOut');
const recordKey = computed(
() => patientInfo.value?.encounterId || patientInfo.value?.id || 'empty'
);
const handlePatientSelect = (patient) => {
updatePatientInfo(patient);
};
</script>
<style lang="scss" scoped>
.inpatientNurse-home-container {
height: 100%;
height: calc(100vh - 84px);
.el-container {
height: 100%;
}
:deep(.el-aside) {
padding: 0;
}
.inpatientNurse-home-main {
background-color: #ffffff;
:deep(.el-header) {
padding: 0px;
margin-bottom: 0px;
}
.el-main {
padding: 0px 8px;
}
:deep(.patient-tabs) {
height: 100%;
.el-tabs__header {
margin: 0;
}
.el-tabs__content {
height: calc(100% - 40px);
}
.el-tab-pane {
height: 100%;
}
}
}
}
</style>

View File

@@ -1,148 +0,0 @@
<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>

View File

@@ -29,6 +29,15 @@
</el-button>
</div>
<div>
<span class="descriptions-item-label">实际执行时间</span>
<el-date-picker
v-model="exeDate"
type="datetime"
format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY/MM/DD HH:mm:ss"
:clearable="false"
@change="handleGetPrescription"
/>
<span class="descriptions-item-label">全选</span>
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
<el-button
@@ -139,6 +148,8 @@
border
:ref="'tableRef' + index"
:header-cell-style="{ background: '#eef9fd !important' }"
@select="(selection, row) => handleRowSelect(selection, row, index)"
@select-all="(selection) => handleSelectAll(selection, index)"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
@@ -173,7 +184,7 @@
</template>
</el-table-column>
<el-table-column label="开始/终止" prop="requestTime" width="200" />
<el-table-column label="预计执行" prop="times">
<el-table-column :label="props.exeStatus == 1 ? '预计执行' : '执行时间'" prop="times">
<template #default="scope">
<div
v-for="(item, timeIndex) in scope.row.times"
@@ -215,13 +226,19 @@
<script setup>
import { getPrescriptionList, adviceExecute, adviceCancel, adviceNoExecute } from './api';
<<<<<<< HEAD
import { patientInfoList } from '../store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
import { lotNumberMatch } from '@/api/public';
>>>>>>> v1.3
import { formatDate, formatDateStr } from '@/utils/index';
import { ref, getCurrentInstance } from 'vue';
import { ref, getCurrentInstance, nextTick } from 'vue';
const activeNames = ref([]);
const prescriptionList = ref([]);
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
const exeDate = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
const therapyEnum = ref(undefined);
const { proxy } = getCurrentInstance();
const loading = ref(false);
@@ -392,6 +409,10 @@ function handleGetPrescription() {
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
loading.value = false;
// 默认选中全部行
nextTick(() => {
defaultSelectAllRows();
});
// } catch {
// loading.value = false;
// }
@@ -406,6 +427,7 @@ function handleGetPrescription() {
// 执行
function handleExecute() {
let list = getSelectRows();
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
list = list.map((item) => {
return {
requestId: item.requestId,
@@ -415,13 +437,35 @@ function handleExecute() {
};
});
console.log(list, 'list');
adviceExecute({ adviceExecuteDetailList: list }).then((res) => {
adviceExecute({ exeDate: exeDate.value, adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) {
handleGetPrescription();
lotNumberMatch({ encounterIdList: encounterIds });
}
});
}
// 不执行
function handleNoExecute() {
let list = getSelectRows();
list = list.map((item) => {
return {
requestId: item.requestId,
encounterId: item.encounterId,
patientId: item.patientId,
adviceTable: item.adviceTable,
executeTimes: item.executeTimes,
};
});
console.log(list, 'list');
adviceNoExecute({ adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) {
handleGetPrescription();
}
});
}
<<<<<<< HEAD
// 不执行
function handleNoExecute() {
let list = getSelectRows();
@@ -456,6 +500,22 @@ function handleCancel() {
})
);
});
=======
// 取消执行
function handleCancel() {
let list = getSelectRows();
let producerIds = [];
list.forEach((item) => {
producerIds.push(
...item.procedureIds.map((value) => {
return {
procedureId: value,
therapyEnum: item.therapyEnum,
};
})
);
});
>>>>>>> v1.3
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
if (res.code == 200) {
handleGetPrescription();
@@ -504,6 +564,7 @@ function getDateRange(startDate, endDate) {
function handleRateChange(value, date, time, row, rateItem) {
// 拼接当前选中时间
<<<<<<< HEAD
let tiemStr = row.year + '-' + date + ' ' + time + ':00';
let index = row.executeTimes.indexOf(tiemStr);
debugger;
@@ -514,14 +575,215 @@ function handleRateChange(value, date, time, row, rateItem) {
row.executeTimes.splice(row.executeTimes.indexOf(tiemStr), 1);
row.procedureIds.splice(row.executeTimes.indexOf(rateItem.producerId), 1);
}
=======
let timeStr = row.year + '-' + date + ' ' + time + ':00';
let timeIndex = row.executeTimes.indexOf(timeStr);
if (value) {
// 选中checkbox如果时间不在执行时间列表中则添加
if (timeIndex === -1) {
row.executeTimes.push(timeStr);
}
// 如果有procedureId添加到列表中
if (rateItem.procedureId && !row.procedureIds.includes(rateItem.procedureId)) {
row.procedureIds.push(rateItem.procedureId);
}
} else {
// 取消选中checkbox从执行时间列表中移除
if (timeIndex !== -1) {
row.executeTimes.splice(timeIndex, 1);
}
// 移除对应的procedureId
if (rateItem.procedureId) {
const procedureIndex = row.procedureIds.indexOf(rateItem.procedureId);
if (procedureIndex !== -1) {
row.procedureIds.splice(procedureIndex, 1);
}
}
}
// 检查该行所有checkbox是否全部选中联动表格行选中状态
nextTick(() => {
checkAndToggleRowSelection(row);
});
>>>>>>> v1.3
}
function handelSwicthChange(value) {
prescriptionList.value.forEach((item, index) => {
proxy.$refs['tableRef' + index][0].toggleAllSelection();
const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) {
if (value) {
// 全选选中所有行并联动checkbox
item.forEach((row) => {
tableRef[0].toggleRowSelection(row, true);
selectAllCheckboxesInRow(row);
});
} else {
// 取消全选取消选中所有行并联动checkbox
item.forEach((row) => {
tableRef[0].toggleRowSelection(row, false);
unselectAllCheckboxesInRow(row);
});
}
}
});
}
// 默认选中全部行
function defaultSelectAllRows() {
prescriptionList.value.forEach((item, index) => {
const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) {
// 选中该表格的所有行
item.forEach((row) => {
tableRef[0].toggleRowSelection(row, true);
// 同时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row);
});
}
});
// 更新全选开关状态
chooseAll.value = true;
}
// 选中行内部的所有checkbox
function selectAllCheckboxesInRow(row) {
if (!row.times || !row.rate) return;
// 遍历所有时间点选中所有checkbox
row.times.forEach((time, timeIndex) => {
const rateItems = row.rate[time] || [];
if (rateItems.length > 0) {
// 获取该时间点的所有rate值
const allRates = rateItems.map((item) => item.rate);
// 设置为全选
row.checkedRates[timeIndex] = [...allRates];
// 更新执行时间列表
allRates.forEach((rate) => {
const timeStr = row.year + '-' + time + ' ' + rate + ':00';
if (!row.executeTimes.includes(timeStr)) {
row.executeTimes.push(timeStr);
}
// 添加procedureId
const rateItem = rateItems.find((item) => item.rate === rate);
if (rateItem && rateItem.procedureId && !row.procedureIds.includes(rateItem.procedureId)) {
row.procedureIds.push(rateItem.procedureId);
}
});
}
});
}
// 取消选中行内部的所有checkbox
function unselectAllCheckboxesInRow(row) {
if (!row.times) return;
// 清空所有checkbox选中状态
row.times.forEach((time, timeIndex) => {
row.checkedRates[timeIndex] = [];
});
// 清空执行时间列表和procedureIds
row.executeTimes = [];
row.procedureIds = [];
}
// 检查行内部所有checkbox是否全部选中
function isAllCheckboxesSelected(row) {
if (!row.times || !row.rate) return false;
// 遍历所有时间点,检查是否全部选中
for (let timeIndex = 0; timeIndex < row.times.length; timeIndex++) {
const time = row.times[timeIndex];
const rateItems = row.rate[time] || [];
const checkedRates = row.checkedRates[timeIndex] || [];
// 如果该时间点的checkbox没有全部选中返回false
if (rateItems.length > 0 && checkedRates.length !== rateItems.length) {
return false;
}
}
return true;
}
// 检查并联动表格行选中状态
function checkAndToggleRowSelection(row) {
prescriptionList.value.forEach((item, tableIndex) => {
const rowIndex = item.findIndex((r) => r.requestId === row.requestId);
if (rowIndex !== -1) {
const tableRef = proxy.$refs['tableRef' + tableIndex];
if (tableRef && tableRef[0]) {
const isAllSelected = isAllCheckboxesSelected(row);
const selectedRows = tableRef[0].getSelectionRows();
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
// 根据checkbox状态更新表格行选中状态
if (isAllSelected && !isCurrentlySelected) {
tableRef[0].toggleRowSelection(row, true);
} else if (!isAllSelected && isCurrentlySelected) {
tableRef[0].toggleRowSelection(row, false);
}
}
}
});
}
// 处理表格行选中事件
function handleRowSelect(selection, row, tableIndex) {
const isSelected = selection.some((item) => item.requestId === row.requestId);
if (isSelected) {
// 选中行时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row);
} else {
// 取消选中行时取消选中该行内部的所有checkbox
unselectAllCheckboxesInRow(row);
}
// 更新全选开关状态
updateChooseAllStatus();
}
// 处理表格全选事件
function handleSelectAll(selection, tableIndex) {
const tableData = prescriptionList.value[tableIndex];
if (!tableData) return;
if (selection.length > 0) {
// 全选时选中所有行内部的所有checkbox
tableData.forEach((row) => {
selectAllCheckboxesInRow(row);
});
} else {
// 取消全选时取消选中所有行内部的所有checkbox
tableData.forEach((row) => {
unselectAllCheckboxesInRow(row);
});
}
// 更新全选开关状态
updateChooseAllStatus();
}
// 更新全选开关状态
function updateChooseAllStatus() {
let allSelected = true;
prescriptionList.value.forEach((item, index) => {
const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) {
const selectedRows = tableRef[0].getSelectionRows();
if (selectedRows.length !== item.length) {
allSelected = false;
}
} else {
allSelected = false;
}
});
chooseAll.value = allSelected;
}
// 处理后端返回的时间集合
function handleTime() {}

View File

@@ -22,9 +22,11 @@
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<!-- 隐藏转科tab
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
-->
</el-tabs>
</div>
<div style="width: 100%">
@@ -50,7 +52,7 @@
<script setup>
import { getCurrentInstance } from 'vue';
import PatientList from './components/patientList.vue';
import PatientList from '../components/patientList.vue';
import PrescriptionList from './components/prescriptionList.vue';
const activeName = ref('preparation');

View File

@@ -1,146 +0,0 @@
<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>

View File

@@ -21,7 +21,7 @@
</div>
<div>
<span class="descriptions-item-label">全选</span>
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
<el-switch v-model="chooseAll" @change="handelSwitchChange" />
<el-button class="ml20" type="primary" @click="handleCheck"> 核对通过 </el-button>
<el-button class="ml20 mr20" type="danger" @click="handleCancel"> 退回 </el-button>
</div>
@@ -107,8 +107,10 @@
border
:ref="'tableRef' + index"
:header-cell-style="{ background: '#eef9fd !important' }"
@select="handleSelectionChange"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="组" align="center" width="60" prop="groupIcon" />
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
<template #default="scope">
<span :style="scope.row.therapyEnum == '1' ? 'color: #a6745c' : 'color: #3787a5'">
@@ -151,7 +153,7 @@
</template>
<script setup>
import { getPrescriptionList, adviceVerify, cancel } from './api';
import { patientInfoList } from '../store/patient.js';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
const activeNames = ref([]);
@@ -199,7 +201,9 @@ function handleGetPrescription() {
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
console.log('@@@@@=======>', JSON.stringify(prescriptionList.value));
loading.value = false;
getGroupMarkers();
});
chooseAll.value = false;
} else {
@@ -207,6 +211,58 @@ function handleGetPrescription() {
}
}
// 分组标记处理
function getGroupMarkers() {
// 初始化所有行的 groupIcon 为 null
prescriptionList.value.forEach((item) => {
item.forEach((prescription) => {
prescription.groupIcon = null;
});
});
console.log('prescriptionList====>', JSON.stringify(prescriptionList.value));
// 创建一个映射来存储每个 groupId 对应的行索引
const groupMap = {};
// 遍历处方列表,按 groupId 分组(忽略无 groupId 的项)
prescriptionList.value.forEach((item, index) => {
item.forEach((prescription, idnexNum) => {
if (prescription.groupId) {
if (!groupMap[prescription.groupId]) {
groupMap[prescription.groupId] = [];
}
groupMap[prescription.groupId].push(idnexNum);
}
});
});
// 为每个组设置 groupIcon
Object.values(groupMap).forEach((indices) => {
// 只有当组内元素大于1个时才需要显示分组标记
if (indices.length > 1) {
let iconArrayIndex = 0;
indices.forEach((index, i) => {
prescriptionList.value.forEach((itemArray, index1) => {
itemArray.forEach((item, index2) => {
if (index2 === index) {
iconArrayIndex++;
if (iconArrayIndex == 1) {
item.groupIcon = '┏';
} else if (iconArrayIndex == indices.length) {
item.groupIcon = '┗';
} else {
item.groupIcon = '┃';
}
}
});
});
});
}
});
console.log('prescriptionList====>', JSON.stringify(prescriptionList.value));
}
// 选择框改变时的处理
function handleSelectionChange(selection, row) {}
/**
* 核对通过
*/
@@ -257,7 +313,7 @@ function getSelectRows() {
});
}
function handelSwicthChange(value) {
function handelSwitchChange(value) {
prescriptionList.value.forEach((item, index) => {
proxy.$refs['tableRef' + index][0].toggleAllSelection();
});
@@ -318,4 +374,4 @@ defineExpose({
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
</style>
</style>

View File

@@ -18,17 +18,19 @@
<Refresh />
</el-icon>
</div>
<el-tabs v-model="active" class="demo-tabs centered-tabs tab-header" @tab-click="handleClick">
<el-tabs v-model="active" class="centered-tabs tab-header" @tab-click="handleClick">
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<!-- 隐藏tab
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
-->
</el-tabs>
</div>
<div style="width: 100%">
<el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleTabClick">
<el-tabs v-model="activeName" class="centered-tabs" @tab-change="handleTabClick">
<el-tab-pane
v-for="tab in prescriptionTabs"
:key="tab.name"
@@ -48,7 +50,7 @@
</template>
<script setup>
import PatientList from './components/patientList.vue';
import PatientList from '../components/patientList.vue';
import PrescriptionList from './components/prescriptionList.vue';
const activeName = ref('unverified');

View File

@@ -1,12 +0,0 @@
// 选择患者信息
export const patientInfo = ref()
export function updatePatientInfo(info) {
patientInfo.value = info
}
// 多选患者
export const patientInfoList = ref([])
export function updatePatientInfoList(info) {
patientInfoList.value = info
}

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request';
// 体温单图表展示
export function getSummaryList(data) {
return request({
url: '/document/record/summary',
method: 'get',
params: data,
});
}

View File

@@ -0,0 +1,844 @@
<template>
<div class="main">
<PatientList :selected-patient="patientInfo" :on-select="handlePatientSelect" />
<el-container style="height: 100%">
<el-main style="padding: 0">
<div style="margin-bottom: 10px">
<el-date-picker
v-model="intervalTime"
type="daterange"
range-separator="~"
start-placeholder="起始时间"
end-placeholder="结束时间"
:size="medium"
value-format="YYYY-MM-DD"
/>
<el-button style="margin-left: 10px" type="primary" size="default" @click="onSearch"
>搜索</el-button
>
<el-button type="primary" size="default" @click="onAddRecord">新增</el-button>
<el-button type="primary" size="default" @click="printNursingRecord">打印</el-button>
</div>
<div class="header">
<div class="header-item" v-for="(item, index) in personInfo1" :key="index">
<div class="header-title">
<el-text>{{ item.title }}</el-text>
</div>
<div class="header-content">
<el-text>{{ item.text }}</el-text>
</div>
</div>
<!-- <div class="header-item">
<div class="header-title"><el-text></el-text></div>
<div class="header-content"><el-text>20</el-text></div>
<div class="header-title"><el-text></el-text></div>
</div> -->
</div>
<div class="table-contanier">
<el-table
:data="tableData"
:span-method="arraySpanMethod"
border
style="width: 100%"
class="custom-header-table"
height="100%"
>
<!-- 日期与时间合并表头 -->
<el-table-column align="center" class-name="date-time-header" width="150px">
<template #header>
<div class="date-time-container">
<div class="date-label">日期</div>
<div class="time-label">时间</div>
</div>
</template>
<template #default="scope">
<div class="date-time-cell">
<div
v-if="
recordsData[scope.$index].id === null ||
recordsData[scope.$index].id === undefined
"
>
<div style="color: red; font-weight: bold">
总入量为:{{ scope.row.input }}、总出量为:{{ scope.row.output }}
</div>
</div>
<div v-else style="display: flex">
<div class="date-cell">{{ scope.row.date }}</div>
/
<div class="time-cell">{{ scope.row.time }}</div>
</div>
</div>
</template>
</el-table-column>
<!-- 一般column -->
<!-- <el-table-column
v-for="column in averageColumn"
:key="column.id"
:label="column.title"
align="center"
>
<template #default="scope">
{{ averageColumn($index).prop == 'temperature' ? scope.temperature : '' }}
</template>
</el-table-column> -->
<!-- 嵌套column -->
<!-- <el-table-column
v-for="column in nestingColumn"
:key="column.id"
:label="column.title"
align="center"
>
<el-table-column
v-for="column in column.child"
:prop="column.prop"
:key="column.id"
:label="column.title"
align="center"
></el-table-column>
</el-table-column> -->
<el-table-column label="意识" align="center" width="200px">
<template #default="scope">
<!-- <el-select
v-model="scope.row.consciousnessCodeList"
placeholder=""
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="99"
disabled=""
>
<el-option
v-for="item in ysOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<el-tag
style="margin: 2px"
type=""
v-for="item in filterYs(scope.row.consciousnessCodeList)"
:key="item.value"
>{{ item.label }}</el-tag
>
</template>
</el-table-column>
<el-table-column label="体温(℃)" align="center" width="100px">
<template #default="scope">
<el-text> {{ scope.row.temperature }}</el-text>
</template>
</el-table-column>
<el-table-column label="脉搏(次/分)" align="center" width="100px">
<template #default="scope">
<el-text> {{ scope.row.pulse }}</el-text>
</template>
</el-table-column>
<el-table-column label="呼吸(次/分)" align="center" width="100px">
<template #default="scope">
<el-text> {{ scope.row.breathe }}</el-text>
</template>
</el-table-column>
<el-table-column label="血压(mmHg)" align="center" width="100px">
<template #default="scope">
<el-text> {{ scope.row.bloodPressure }}</el-text>
</template>
</el-table-column>
<el-table-column label="血氧饱和度(%)" align="center" width="110px">
<template #default="scope">
<el-text> {{ scope.row.bloodOxygen }}</el-text>
</template>
</el-table-column>
<el-table-column label="吸氧升/分" align="center" width="110px">
<template #default="scope">
<el-text> {{ scope.row?.oxygen }}</el-text>
</template>
</el-table-column>
<!-- 入量列组 -->
<el-table-column label="入量(ml)" align="center">
<el-table-column label="名称用法" align="center">
<template #default="scope">
<el-text> {{ scope.row.inputName }}</el-text>
</template>
</el-table-column>
<el-table-column label="量" align="center">
<template #default="scope">
<el-text> {{ scope.row.input }}</el-text>
</template>
</el-table-column>
</el-table-column>
<!-- 出量列组 -->
<el-table-column label="出量" align="center">
<el-table-column label="名称" align="center">
<template #default="scope">
<el-text> {{ scope.row.outputName }}</el-text>
</template>
</el-table-column>
<el-table-column label="量" align="center">
<template #default="scope">
<el-text> {{ scope.row.output }}</el-text>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="skin" label="皮肤" align="center" width="200px">
<template #default="scope">
<!-- <el-select
placeholder=""
v-model="scope.row.skinconditionCodeList"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="99"
disabled=""
>
<el-option
v-for="item in skinconditionOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<el-tag
style="margin: 2px"
type=""
v-for="item in filterPf(scope.row.skinconditionCodeList)"
:key="item.value"
>{{ item.label }}</el-tag
>
</template>
</el-table-column>
<el-table-column prop="tube" label="管路" align="center" width="200px">
<template #default="scope">
<!-- <el-select
placeholder=""
v-model="scope.row.pipelinecare"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="99"
disabled=""
>
<el-option
v-for="item in pipelinecareOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<el-tag
style="margin: 2px"
type=""
v-for="item in filterGl(scope.row.pipelinecare)"
:key="item.value"
>{{ item.label }}</el-tag
>
</template>
</el-table-column>
<el-table-column prop="observation" label="病情观察及措施" align="center" width="120px">
<template #default="scope">
<el-text> {{ scope.row.condition }}</el-text>
</template>
</el-table-column>
<el-table-column
prop="nurse"
label="护士签名"
align="center"
width="100px"
></el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="150px">
<template #default="scope" style="display: flex">
<el-button
type="primary"
size="small"
plain
@click="onEdit(scope.row, scope.$index)"
>编辑</el-button
>
<el-button
type="danger"
size="small"
plain
@click="onDelete(scope.row, scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="tip-text">
<el-text
>备注:以下项目在相应表格中填写序号:一意识(1、意识清 2、嗜睡3、意识模糊 4、昏睡5.浅昏迷
6.深昏迷)二、管路(1.尿管2.鼻饲管3.胃肠减压管4.
外周静脉置管)5.中心静脉置管6.胸腔闭式引流管 7.腹腔引流管 8.头部引流管 9.其他引流管 10
其他置管)三、皮肤(1.完好 2压疮 3.出血点 4.破损 5. 水肿)。</el-text
>
</div>
</el-main>
</el-container>
<!-- 弹出框 -->
<el-dialog v-model="dialogTableVisible" :show-close="false" width="85%" style="height: 700px">
<OperationRecord
@cancleDialog="onCancle"
@refreshData="refreshFn"
ref="redordRef"
></OperationRecord>
</el-dialog>
</div>
</template>
<script setup>
import { ref, reactive, nextTick, watch } from 'vue';
import OperationRecord from './operationrecord.vue';
import { patientInfo, updatePatientInfo } from '../../inpatientDoctor/home/store/patient';
import { getTemperatureType } from '../tprsheet/api/api';
import { getSummaryList } from './api';
import { getRecordByEncounterIdList } from '../../inpatientDoctor/home/emr/api';
import { deleteRecord } from '../../inpatientDoctor/home/emr/api';
import printUtils, { PRINT_TEMPLATE } from '@/utils/printUtils';
import PatientList from '@/components/PatientList/patient-list.vue';
import { ElMessage } from 'element-plus';
// 处理患者选择
const handlePatientSelect = (patient) => {
updatePatientInfo(patient);
};
const dialogTableVisible = ref(false);
const intervalTime = ref([]);
const redordRef = ref();
const isTemplate = ref(false);
const editForm = ref({
definitionId: '',
startTime: '',
endTime: '',
});
const recordsData = ref([]);
watch(patientInfo, (newVal) => {
const dataArr = [
{ title: '科别', text: newVal.inHospitalOrgName ?? '' },
{ title: '姓名', text: newVal.patientName ?? '' },
{ title: '年龄', text: newVal.age ?? '' },
{ title: '性别', text: newVal.genderEnum_enumText ?? '' },
{ title: '床号', text: newVal.bedName ?? '' },
{ title: '住院', text: '人民医院' },
{ title: '入院日期', text: newVal.inHospitalTime ?? '' },
{ title: '诊断', text: newVal.regDiagnosisName ?? '' },
];
Object.assign(personInfo1, dataArr);
getDefinitionIdNet();
});
// 意识
const ysOptions = [
{
value: '1',
label: '清醒',
},
{
value: '2',
label: '嗜睡',
},
{
value: '3',
label: '意识模糊',
},
{
value: '4',
label: '昏睡',
},
{
value: '5',
label: '谵妄',
},
{
value: '6',
label: '浅昏迷',
},
{
value: '7',
label: '中度昏迷',
},
{
value: '8',
label: '深昏迷',
},
{
value: '9',
label: '全麻未醒',
},
{
value: '10',
label: '镇静',
},
];
// 氧疗
const oxygenOptions = [
{
value: '1',
label: '鼻导管吸氧',
},
{
value: '2',
label: '面罩吸氧',
},
{
value: '3',
label: '高流量氧疗',
},
{
value: '4',
label: '机械通气',
},
];
// 皮肤情况
const skinconditionOption = [
{
value: '1',
label: '完好',
},
{
value: '2',
label: '压疮',
},
{
value: '3',
label: '出血点',
},
{
value: '4',
label: '破损',
},
{
value: '5',
label: '水肿',
},
{
value: '6',
label: '瘀斑',
},
{
value: '7',
label: '过敏',
},
{
value: '8',
label: '其他',
},
];
// 管路护理
const pipelinecareOption = [
{
value: '1',
label: '胃管',
},
{
value: '2',
label: '导尿管',
},
{
value: '3',
label: '静脉置管',
},
{
value: '4',
label: '吸氧管',
},
{
value: '5',
label: 'T管',
},
{
value: '6',
label: '胸腔引流管',
},
{
value: '7',
label: '腹腔引流管',
},
{
value: '8',
label: '伤口引流管',
},
{
value: '9',
label: '脑室引流管',
},
{
value: '10',
label: '其他',
},
];
// 过滤意识
const filterYs = (row) => {
let dats = [];
(row || []).forEach((str) => {
ysOptions.forEach((item) => {
if (item.value == str) {
dats.push(item);
}
});
});
return dats;
};
// 过滤皮肤
const filterPf = (row) => {
let dats = [];
(row || []).forEach((str) => {
skinconditionOption.forEach((item) => {
if (item.value == str) {
dats.push(item);
}
});
});
return dats;
};
// 过滤管路
const filterGl = (row) => {
let dats = [];
(row || []).forEach((str) => {
pipelinecareOption.forEach((item) => {
if (item.value == str) {
dats.push(item);
}
});
});
return dats;
};
// 获取护理记录单类型
const getDefinitionIdNet = async () => {
const res = await getTemperatureType({ menuEnum: '3' });
//默认选中第一个
if (res.data?.length > 0) {
isTemplate.value = true;
const obj = res.data[0];
editForm.value.definitionId = obj.id;
getTableList();
} else {
isTemplate.value = false;
}
};
const refreshFn = () => {
getTableList();
};
// 获取列表数据
const getTableList = async () => {
const res = await getSummaryList({
...editForm.value,
encounterId: patientInfo.value.encounterId,
patientId: patientInfo.value.patientId,
});
console.log('getTableList========>', JSON.stringify(res.data));
recordsData.value = res.data || [];
const tables = [];
(res.data || []).forEach((item) => {
const obj = JSON.parse(item.contentJson);
tables.push(obj);
});
tableData.value = tables;
};
// 个人信息
const personInfo1 = reactive([
{ title: '科别', text: '' },
{ title: '姓名', text: '' },
{ title: '年龄', text: '' },
{ title: '性别', text: '' },
{ title: '床号', text: '' },
{ title: '住院', text: '' },
{ title: '入院日期', text: '' },
{ title: '诊断', text: '' },
]);
// 普通表头配置
const averageColumn = [
{
id: '0',
prop: 'consciousness',
title: '意识',
},
{
id: '1',
prop: 'temperature',
title: '体温(℃)',
},
{
id: '2',
prop: 'pulse',
title: '脉搏(次/分)',
},
{
id: '3',
prop: 'respiration',
title: '呼吸(次/分)',
},
{
id: '4',
prop: 'bloodPressure',
title: '血压(mmHg)',
},
{
id: '5',
prop: 'bloodOxygen',
title: '血氧饱和度(%)',
},
{
id: '6',
prop: 'oxygenFlow',
title: '吸氧(升/分)',
},
];
//
const nestingColumn = ref([
{
id: '7',
prop: '',
title: '入量(ml)',
child: [
{
id: '7-1',
prop: 'name',
title: '名称用法',
},
{
id: '7-2',
prop: 'plan',
title: '量',
},
],
},
{
id: '8',
prop: '',
title: '出量',
child: [
{
id: '8-1',
prop: 'name',
title: '名称',
},
{
id: '8-2',
prop: 'plan',
title: '量',
},
],
},
]);
// 表格数据
const tableData = ref([]);
// 合并单元格
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
const obj = recordsData.value[rowIndex];
if (obj.id === undefined || obj.id === null) {
if (columnIndex == 0) {
return {
rowspan: 1,
colspan: 17,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
return {
rowspan: 1,
colspan: 1,
};
// if (rowIndex == 1) {
// if (columnIndex == 0) {
// return {
// rowspan: 1,
// colspan: 17,
// };
// } else {
// return {
// rowspan: 0,
// colspan: 0,
// };
// }
// }
// return {
// rowspan: 1,
// colspan: 1,
// };
};
// 编辑
const onEdit = (row, index) => {
const item = recordsData.value[index];
dialogTableVisible.value = true;
nextTick(() => {
if (redordRef) {
redordRef.value.editEmit(item);
}
});
};
// 新增
const onAddRecord = () => {
if (!patientInfo.value) {
ElMessage({
type: 'error',
message: '请选择患者',
});
return;
}
if (!isTemplate.value) {
ElMessage({
type: 'error',
message: '护理记录未配置,请联系管理员',
});
return;
}
dialogTableVisible.value = true;
nextTick(() => {
if (redordRef) {
redordRef.value.reset();
}
});
};
// 搜索
const onSearch = () => {
if (typeof intervalTime === 'object' && intervalTime === null) {
editForm.value.startTime = '';
editForm.value.endTime = '';
getTableList();
} else {
if (intervalTime.value?.length > 0) {
editForm.value.startTime = intervalTime.value[0];
editForm.value.endTime = intervalTime.value[1];
getTableList();
} else {
editForm.value.startTime = '';
editForm.value.endTime = '';
getTableList();
}
}
};
// 删除
const onDelete = async (row, index) => {
const ids = recordsData.value[index].id;
debugger;
// recordsData.value
await deleteRecord([ids]);
getTableList();
};
// 关闭弹出曾次
const onCancle = () => {
dialogTableVisible.value = false;
};
</script>
<style lang="scss" scoped>
.main {
padding-top: 10px;
display: flex;
height: 100%;
.header {
// background: red;
display: flex;
justify-content: space-between;
padding: 0 10px;
.header-item {
display: flex;
align-items: center;
}
}
.table-contanier {
margin-top: 10px;
background: red;
height: calc(100vh - 280px);
.custom-header-table ::v-deep .el-table__header-wrapper th {
background-color: #f5f7fa;
font-weight: normal;
}
/* 日期时间表头样式 */
.date-time-header {
width: 120px;
}
.date-time-container {
position: relative;
width: 100%;
height: 100%;
min-height: 60px;
}
.date-label {
position: absolute;
top: 5px;
left: 5px;
z-index: 1;
}
.time-label {
position: absolute;
bottom: 5px;
right: 5px;
z-index: 1;
}
.date-time-container::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
154deg,
transparent 49.5%,
#dcdfe6 49.5%,
#dcdfe6 50.5%,
transparent 50.5%
);
pointer-events: none;
}
/* 日期时间单元格样式 */
.date-time-cell {
// position: relative;
display: flex;
// flex-direction: column;
align-items: center;
// height: 100%;
// min-height: 48px;
}
.date-cell {
// position: absolute;
// top: 5px;
// left: 5px;
// background: red;
}
.time-cell {
// position: absolute;
// bottom: 5px;
// right: 5px;
height: 100%;
// width: 100%;
text-align: left;
}
}
.tip-text {
padding: 0 10px;
}
}
</style>

View File

@@ -0,0 +1,662 @@
<template>
<div class="main">
<div class="title">
<h1>患者护理记录单</h1>
</div>
<el-scrollbar height="500px" style="height: 100%">
<div class="content">
<el-form :model="rulesFrom" :rules="rules" ref="formRef">
<el-card>
<div class="commoncss">
<el-form-item prop="date" label="日期:" label-width="100px">
<el-date-picker
v-model="rulesFrom.date"
type="date"
placeholder="请选择"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
@change="dateChange"
/>
</el-form-item>
<el-form-item prop="time" label="时间:" label-width="100px">
<el-time-picker
v-model="rulesFrom.time"
placeholder="请选择时间"
format="HH:mm"
value-format="HH:mm"
@change="dateChange"
/>
</el-form-item>
</div>
<!-- 基本信息 -->
<div class="foundation">
<div class="commone-title">基本信息</div>
<div class="foundation-content">
<div class="foundation-content-first">
<el-form-item label="意识:" label-width="100px">
<el-select
v-model="rulesFrom.consciousnessCodeList"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="1"
placeholder="请选择"
style="width: 220px"
>
<el-option
v-for="item in ysOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="体温:" label-width="100px">
<div class="commoncss">
<el-input
v-model="rulesFrom.temperature"
placeholder="请输入"
clearable
style="width: 220px"
/>
<div></div>
</div>
</el-form-item>
<el-form-item label="心率:" label-width="100px">
<div class="commoncss">
<el-input
v-model="rulesFrom.heartRate"
placeholder="请选择"
clearable
style="width: 220px"
/>
<div class="unit">/</div>
</div>
</el-form-item>
</div>
<div class="foundation-content-second">
<el-form-item label="脉率:" label-width="100px" class="wait-flex">
<div class="commoncss">
<el-input
v-model="rulesFrom.pulse"
placeholder="请选择"
clearable
class="wait-flex"
style="width: 180px"
/>
<div class="unit">/</div>
</div>
</el-form-item>
<el-form-item label="呼吸:" label-width="100px" class="wait-flex">
<div class="commoncss">
<el-input
v-model="rulesFrom.breathe"
placeholder="请选择"
clearable
class="wait-flex"
style="width: 180px"
/>
<div class="unit">/</div>
</div>
</el-form-item>
<el-form-item label="血压:" label-width="100px" class="wait-flex">
<div class="commoncss">
<el-input
v-model="rulesFrom.bloodPressure"
placeholder="请选择"
clearable
style="width: 180px"
/>
<div class="unit">mmHg</div>
</div>
</el-form-item>
<el-form-item label="血氧饱和度:" label-width="100px" class="wait-flex">
<div class="commoncss">
<el-input
v-model="rulesFrom.bloodOxygen"
placeholder="请选择"
clearable
style="width: 180px"
/>
<div class="unit">%</div>
</div>
</el-form-item>
</div>
<div>
<el-form-item label="吸氧升/分:" label-width="100px" class="wait-flex">
<div class="commoncss">
<el-input
v-model="rulesFrom.oxygen"
placeholder="请选择"
clearable
style="width: 180px"
/>
<div class="unit">/</div>
</div>
</el-form-item>
</div>
</div>
</div>
<!-- 氧疗 -->
<div class="oxygen">
<div class="oxygen-title commone-title">氧疗/min</div>
<div class="oxygen-content">
<el-form-item label="方式:" label-width="100px">
<el-select
v-model="rulesFrom.oxygenCodeList"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="1"
placeholder="请选择"
style="width: 220px"
>
<el-option
v-for="item in oxygenOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="流量:" label-width="100px">
<div>
<el-input
v-model="rulesFrom.oxygenflow"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
</div>
</div>
<!-- 入量 -->
<div class="input">
<div class="input-title commone-title">入量</div>
<div class="input-content">
<el-form-item label="名称:" label-width="100px">
<div>
<el-input
v-model="rulesFrom.inputName"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
<el-form-item label="ml" label-width="100px">
<div>
<el-input
v-model="rulesFrom.input"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
<el-form-item label="途径:" label-width="100px">
<div>
<el-input
v-model="rulesFrom.inputvia"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
</div>
</div>
<!-- 出量 -->
<div class="out">
<div class="out-title commone-title">出量</div>
<div class="out-content">
<el-form-item label="名称:" label-width="100px">
<div>
<el-input
v-model="rulesFrom.outputName"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
<el-form-item label="ml" label-width="100px">
<div>
<el-input
v-model="rulesFrom.output"
placeholder="请输入"
clearable
style="width: 220px"
/>
</div>
</el-form-item>
</div>
</div>
<!-- 皮肤情况 -->
<div class="skin">
<el-form-item label="皮肤情况:" label-width="100px">
<el-select
v-model="rulesFrom.skinconditionCodeList"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="3"
placeholder="请选择"
style="width: 380px"
>
<el-option
v-for="item in skinconditionOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</div>
<!-- 管路护理 -->
<div class="nursing">
<el-form-item label="管路护理:" label-width="100px">
<el-select
v-model="rulesFrom.pipelinecare"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="3"
placeholder="请选择"
style="width: 380px"
>
<el-option
v-for="item in pipelinecareOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</div>
<!-- 病情措施 -->
<div class="nursing">
<el-form-item label="病情措施:" label-width="100px">
<div>
<el-input
type="textarea"
v-model="rulesFrom.condition"
placeholder="请选择"
clearable
style="width: 380px"
:rows="10"
:autosize="{ minRows: 5, maxRows: 10 }"
/>
</div>
</el-form-item>
</div>
<!-- 护士签名 -->
<div class="nurse">
<el-form-item label="护士签名:" label-width="100px">
<div>
<el-input
v-model="rulesFrom.nurse"
placeholder="请选择"
clearable
style="width: 380px"
/>
</div>
</el-form-item>
</div>
</el-card>
</el-form>
</div>
</el-scrollbar>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<el-button @click="onCancle">取消</el-button>
<el-button type="primary" @click="saveData">保存</el-button>
</div>
</div>
</template>
<script setup>
import { computed, nextTick, reactive, ref, watch, watchEffect } from 'vue';
import dayjs from 'dayjs';
import { getTemperatureType, addRecord } from '../tprsheet/api/api';
import { patientInfo } from '../../inpatientDoctor/home/store/patient';
import { ElMessage } from 'element-plus';
const formRef = ref();
// 意识
const ysOptions = [
{
value: '1',
label: '清醒',
},
{
value: '2',
label: '嗜睡',
},
{
value: '3',
label: '意识模糊',
},
{
value: '4',
label: '昏睡',
},
{
value: '5',
label: '谵妄',
},
{
value: '6',
label: '浅昏迷',
},
{
value: '7',
label: '中度昏迷',
},
{
value: '8',
label: '深昏迷',
},
{
value: '9',
label: '全麻未醒',
},
{
value: '10',
label: '镇静',
},
];
// 氧疗
const oxygenOptions = [
{
value: '1',
label: '鼻导管吸氧',
},
{
value: '2',
label: '面罩吸氧',
},
{
value: '3',
label: '高流量氧疗',
},
{
value: '4',
label: '机械通气',
},
];
// 皮肤情况
const skinconditionOption = [
{
value: '1',
label: '完好',
},
{
value: '2',
label: '压疮',
},
{
value: '3',
label: '出血点',
},
{
value: '4',
label: '破损',
},
{
value: '5',
label: '水肿',
},
{
value: '6',
label: '瘀斑',
},
{
value: '7',
label: '过敏',
},
{
value: '8',
label: '其他',
},
];
// 管路护理
const pipelinecareOption = [
{
value: '1',
label: '胃管',
},
{
value: '2',
label: '导尿管',
},
{
value: '3',
label: '静脉置管',
},
{
value: '4',
label: '吸氧管',
},
{
value: '5',
label: 'T管',
},
{
value: '6',
label: '胸腔引流管',
},
{
value: '7',
label: '腹腔引流管',
},
{
value: '8',
label: '伤口引流管',
},
{
value: '9',
label: '脑室引流管',
},
{
value: '10',
label: '其他',
},
];
const rulesFrom = ref({
date: '', //日期 年月日
time: '', //时间 十分
recordTime: '', //组合日期时间 年月日时分
consciousnessCodeList: [], //意识code
temperature: '', //体温
heartRate: '', //心率
pulse: '', //脉搏
breathe: '', //呼吸
bloodPressure: '', //血压
bloodOxygen: '', //血氧
oxygenCodeList: [], //氧疗
oxygenflow: '', //氧疗流量
inputName: '', //入量名称
input: '', //入量
inputvia: '', //入量途径
outputName: '', //出量名称
output: '', //出量
skinconditionCodeList: [], //皮肤情况
pipelinecare: [], //管路护理
condition: '', //病情
nurse: '', //护士
oxygen: '',
});
const rules = reactive({
date: [{ required: true, message: '请选择日期', trigger: 'blur' }],
time: [{ required: true, message: '请选择时间', trigger: 'blur' }],
});
const dateChange = () => {
rulesFrom.value.recordTime = rulesFrom.value.date + ' ' + rulesFrom.value.time + ':00';
};
// 计算时间
rulesFrom.value.recordTime = computed(() => {
console.log('11111111111111');
return rulesFrom.value.date + ' ' + rulesFrom.value.time;
});
// 保存form
const editForm = ref({
id: '',
definitionId: '',
definitionBusNo: '',
contentJson: '',
statusEnum: 1, // 0草稿/暂存 1提交 2归档 3修改
organizationId: 0,
encounterId: '',
patientId: '',
recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy: '',
source: '3',
});
const emit = defineEmits(['cancleDialog', 'refreshData']);
const onCancle = () => {
emit('cancleDialog');
};
// 保存数据
const saveData = () => {
if (!patientInfo.value) {
ElMessage({
type: 'error',
message: '请选择患者',
});
}
editForm.value.contentJson = JSON.stringify(rulesFrom.value);
editForm.value.encounterId = patientInfo.value.encounterId;
editForm.value.patientId = patientInfo.value.patientId;
editForm.value.recordTime = rulesFrom.value.recordTime;
console.log('editForm=================>', JSON.stringify(rulesFrom.value));
formRef.value.validate(async (res) => {
if (res) {
await addRecord(editForm.value);
if (editForm.value.id && editForm.value.id.length > 0) {
ElMessage.success('护理记录修改成功');
} else {
ElMessage.success('护理记录保存成功');
}
emit('refreshData');
}
});
};
// 获取护理记录单类型
const getDefinitionIdNet = async () => {
const res = await getTemperatureType({ menuEnum: '3' });
//默认选中第一个
if (res.data?.length > 0) {
const obj = res.data[0];
editForm.value.definitionId = obj.id;
editForm.value.definitionBusNo = obj.busNo;
}
};
watch(patientInfo, () => {
getDefinitionIdNet();
});
// 重置
const reset = () => {
rulesFrom.value = {
date: '', //日期 年月日
time: '', //时间 十分
recordTime: '', //组合日期时间 年月日时分
consciousnessCodeList: [], //意识code
temperature: '', //体温
heartRate: '', //心率
pulse: '', //脉搏
breathe: '', //呼吸
bloodPressure: '', //血压
bloodOxygen: '', //血氧
oxygenCodeList: [], //氧疗
oxygenflow: '', //氧疗流量
inputName: '', //入量名称
input: '', //入量
inputvia: '', //入量途径
outputName: '', //出量名称
output: '', //出量
skinconditionCodeList: [], //皮肤情况
pipelinecare: [], //管路护理
condition: '', //病情
nurse: '', //护士
};
editForm.value = {
id: '',
definitionId: '',
definitionBusNo: '',
contentJson: '',
statusEnum: 1, // 0草稿/暂存 1提交 2归档 3修改
organizationId: 0,
encounterId: '',
patientId: '',
recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy: '',
source: '3',
};
getDefinitionIdNet();
};
// 编辑
const editEmit = (row) => {
console.log('rowwwww=======>', JSON.stringify(row));
editForm.value.id = row.id;
editForm.value.definitionId = row.definitionId;
editForm.value.definitionBusNo = row.definitionBusNo;
rulesFrom.value = JSON.parse(row.contentJson);
};
defineExpose({ reset, editEmit });
</script>
<style lang="scss" scoped>
.main {
display: flex;
flex-direction: column;
.title {
width: 100%;
text-align: center;
}
.foundation {
.foundation-content {
.foundation-content-first {
display: flex;
}
.foundation-content-second {
display: flex;
}
}
}
.oxygen {
.oxygen-title {
}
.oxygen-content {
display: flex;
}
}
.input {
.input-title {
}
.input-content {
display: flex;
}
}
.out {
.out-title {
}
.out-content {
display: flex;
}
}
}
.commoncss {
display: flex;
}
.unit {
width: 50px;
}
.wait-flex {
flex: 1;
}
.commone-title {
font-weight: bold;
}
</style>

View File

@@ -0,0 +1,177 @@
import request from '@/utils/request';
/**
* 获取初始化
*/
export function getInit(queryParams) {
return request({
url: '/nurse-station/atd-manage/init',
method: 'get',
params: queryParams,
});
}
/**
* 获取患者列表
*/
export function getPendingInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-patient',
method: 'get',
params: queryParams,
});
}
/**
* 获取床位列表
*/
export function getBedInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-bed',
method: 'get',
params: queryParams,
});
}
/**
* 获取患者详细信息
*/
export function getPatientInfo(queryParams) {
return request({
url: '/nurse-station/atd-manage/admission-patient-info',
method: 'get',
params: queryParams,
});
}
/**
* 获取医生列表
*/
export function getDoctorInfo(queryParams) {
return request({
url: '/charge-manage/register/practitioner-metadata?orgId=' + queryParams.organizationId,
method: 'get',
});
}
/**
* 获取护士列表
*/
export function getNurseInfo(queryParams) {
return request({
url: '/app-common/nurse-list?orgId=' + queryParams.organizationId,
method: 'get',
});
}
/**
* 入科床位分配
*/
export function bedAssignment(data) {
return request({
url: '/nurse-station/atd-manage/bed-assignment',
method: 'post',
data: data,
});
}
/**
* 获取病区
*/
export function childLocationList(queryParams) {
return request({
url: '/app-common/child-location-list',
method: 'get',
params: queryParams,
});
}
export function getPractitionerWard(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 getPersonAccount(queryParams) {
return request({
url: '/nurse-station/atd-manage/get-amount?encounterId=' + queryParams.encounterId,
method: 'get',
});
}
export function getDRMedication(queryParams) {
return request({
url: '/nurse-station/atd-manage/get-dr-medication?encounterId=' + queryParams.encounterId,
method: 'get',
});
}
export function updateTransferDepartment(encounterId) {
return request({
url: '/nurse-station/atd-manage/transfer-department',
method: 'put',
params: {
encounterId: encounterId,
},
});
}
export function updateOutHospital(encounterId) {
return request({
url: '/nurse-station/atd-manage/transfer-department',
method: 'put',
params: {
encounterId: encounterId,
},
});
}
// 获取数据源
export function getDataSource() {
return request({
url: '/nurse-station/auto-roll/source-info',
method: 'get',
});
}
// 保存住院就诊的滚方信息
export function saveInpatientRoll(data) {
return request({
url: '/nurse-station/auto-roll/save-binding',
method: 'post',
data: data,
});
}
// 查询住院就诊的滚方信息
export function getRollInfoPage(id) {
return request({
url: `/nurse-station/auto-roll/encounter-info?encounterId=${id}`,
method: 'get',
});
}
// 启用
export function enableRoll(id) {
return request({
url: `/nurse-station/auto-roll/active?id=${id}`,
method: 'put',
});
}
// 停用
export function stopRoll(id) {
return request({
url: `/nurse-station/auto-roll/retired?id=${id}`,
method: 'put',
});
}
// 删除
export function deleteRoll(id) {
return request({
url: `/nurse-station/auto-roll/delete-binding?id=${id}`,
method: 'delete',
});
}

View File

@@ -0,0 +1,621 @@
<template>
<div class="app-container">
<el-row :gutter="10">
<el-form :model="queryParams" ref="queryRef" inline="true">
<el-form-item label="入院病区" prop="wardId" style="width: 240px">
<el-select
v-model="queryParams.wardId"
@change="changeWardLocationId"
filterable
clearable
>
<el-option
v-for="item in initInfoOptions.wardListOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="入院病房" prop="houseId">
<el-select
v-model="queryParams.houseId"
style="width: 240px"
@change="handleQuery"
filterable
clearable
>
<el-option
v-for="item in wardLocationList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="住院状态" prop="encounterStatus">
<el-select
v-model="queryParams.encounterStatus"
style="width: 240px"
@change="handleQuery"
filterable
clearable
>
<el-option label="全部" value="" />
<el-option
v-for="item in initInfoOptions.encounterStatusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="床位状态" prop="bedStatus" style="width: 240px">
<el-select v-model="bedStatusFilter" filterable clearable @change="handleQuery">
<el-option label="全部" value="" />
<el-option
v-for="item in initInfoOptions.bedStatusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row :gutter="10">
<el-col :span="4">
<el-card shadow="never">
<template #header>
<div class="card-header">
<span>新入院患者</span>
</div>
</template>
<el-input
v-model="queryParams.searchKey"
placeholder="请输入住院号"
clearable
style="width: 100%; margin-bottom: 10px"
@keyup.enter="handleQuery"
>
<template #append>
<el-button icon="Search" @click="handleQuery" />
</template>
</el-input>
<el-scrollbar height="700px">
<div
v-for="(item, index) in patientList"
:class="item.active ? 'patient-card actived' : 'patient-card'"
:key="item.id"
@click="handleCardClick(item, index)"
@dblclick="handleCardDblClick(item)"
>
<div class="main-info-container">
<div class="name-container">
<!-- 患者姓名 -->
<div class="name" style="max-width: 90px">
<el-text class="name" width="auto">{{ item.patientName || '未知' }}</el-text>
</div>
</div>
<div class="name-container">
<!-- 患者性别/年龄 -->
<div class="age">
<el-text class="name" width="auto">
{{ item.genderEnum_enumText }}/{{ item.age }}/{{ item.priorityEnum_enumText }}
</el-text>
</div>
</div>
<div class="patient-tag" :class="getPatientTagClass(item)">
{{ item.encounterStatus_enumText }}
</div>
</div>
<div style="margin-left: 15px; color: #333; font-size: 14px">
{{ item.contractName }}
</div>
<div class="doctor-parent-line" />
<div class="personal-info-container">
<div class="name-container">
<div class="name">
<el-text class="name" width="auto">入院时间</el-text>
<el-text class="name" width="auto">
{{ item.startTime ? formatDate(item.startTime) : '-' }}
</el-text>
</div>
</div>
</div>
<div class="personal-info-container">
<div class="name-container">
<el-text class="name" width="auto">入院科室</el-text>
<el-text class="name" width="auto">
{{ item.organizationName ? item.organizationName : '-' }}
</el-text>
</div>
</div>
<div class="personal-info-container">
<div class="name-container">
<el-text class="name" width="auto">住院号</el-text>
<el-text class="name" width="auto">
{{ item.busNo ? item.busNo : '-' }}
</el-text>
</div>
</div>
</div>
</el-scrollbar>
</el-card>
</el-col>
<el-col :span="20">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAddFeeItemm"
:disabled="!selectPatient"
>
新增滚费项目
</el-button>
</el-col>
</el-row>
<el-table :data="rollInfoPageList" ref="table" border>
<el-table-column label="滚费项目" prop="definitionName" align="center" />
<el-table-column label="单位" prop="unitCodeName" align="center" />
<el-table-column label="数量" prop="quantity" align="center" />
<el-table-column label="状态" prop="statusEnum_enumText" align="center">
<template #default="scope">
<el-tag v-if="scope.row.statusEnum_enumText === '启用'" type="success">
{{ scope.row.statusEnum_enumText }}
</el-tag>
<el-tag v-else type="warning">
{{ scope.row.statusEnum_enumText }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="success"
icon="Edit"
@click="handleEnable(scope.row)"
v-if="scope.row.statusEnum_enumText === '停用'"
>
启用
</el-button>
<el-button
link
type="warning"
icon="Edit"
@click="handleStop(scope.row)"
v-if="scope.row.statusEnum_enumText === '启用'"
>
停用
</el-button>
<el-button link icon="Edit" type="danger" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-dialog
title="新增滚费配置"
v-model="dialogVisible"
width="400px"
:before-close="handleClose"
append-to-body
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="滚费项目" prop="instanceId">
<el-select
v-model="form.instanceId"
placeholder="请选择"
filterable
clearable
style="width: 100%"
@change="handleChageInstanceId"
>
<el-option
v-for="item in feeItemOptions"
:key="item.instanceId"
:label="item.instanceName"
:value="item.instanceId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" prop="quantity">
<el-input-number
v-model="form.quantity"
placeholder="请输入数量"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入" disabled style="width: 100%" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { onBeforeMount, onMounted, reactive, ref, getCurrentInstance } from 'vue';
import {
getPendingInfo,
getBedInfo,
getInit,
childLocationList,
getPractitionerWard,
getDataSource,
saveInpatientRoll,
getRollInfoPage,
enableRoll,
stopRoll,
deleteRoll,
} from './components/api.js';
import { formatDate } from '@/utils/index';
import { ElMessage } from 'element-plus';
const { proxy } = getCurrentInstance();
const transferInDialogVisible = ref(false);
const dialogVisible = ref(false);
const state = reactive({});
const loading = ref(false);
const total = ref();
const badList = ref([]);
const patientList = ref([]);
const pendingInfo = ref({});
const wardLocationList = ref([]);
const priorityOptions = ref([]);
const initInfoOptions = ref({
encounterStatusOptions: [],
bedStatusOptions: [],
priorityOptions: [],
wardListOptions: [],
});
// 新增床状态筛选字段
const bedStatusFilter = ref('');
onBeforeMount(() => {});
const queryParams = ref({
pageNo: 1,
pageSize: 50,
searchKey: '',
wardId: '',
houseId: '',
encounterStatus: '',
bedStatus: '', // 这个字段现在只用于床位查询,不再用于患者列表查询
});
const formRef = ref(null);
const form = reactive({
instanceId: undefined,
unit: undefined,
quantity: 1,
});
const rules = {
instanceId: [{ required: true, message: '请选择滚费项目', trigger: 'change' }],
quantity: [
{ required: true, message: '请输入数量', trigger: 'blur' },
{ type: 'number', min: 0, message: '数量必须大于等于0', trigger: 'blur' },
],
};
onMounted(() => {
getInit().then((res) => {
initInfoOptions.value = res.data;
priorityOptions.value = res.data.priorityOptions || [];
getList();
});
getPractitionerWard().then((res) => {
queryParams.value.wardId = res[0].id;
initInfoOptions.value.wardListOptions = res;
changeWardLocationId(res[0].id);
});
});
defineExpose({ state });
const feeItemOptions = ref([]);
async function getInitDataSourceOptions() {
const res = await getDataSource();
feeItemOptions.value = res.data;
}
const getList = () => {
getPatientList();
// 床位查询不使用encounterStatus参数只使用基本的查询参数
const bedQueryParams = {
...queryParams.value,
encounterStatus: undefined, // 移除encounterStatus确保不影响床位列表查询
};
getBedInfo(bedQueryParams).then((res) => {
badList.value = res.data.records;
});
};
function handleEnable(row) {
proxy
.$confirm('确定启用吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
enableRoll([row.id]).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('启用成功');
getRollInfoPageList();
}
});
});
}
function handleStop(row) {
proxy
.$confirm('确定停用吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
stopRoll([row.id]).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('停用成功');
getRollInfoPageList();
}
});
});
}
function handleDelete(row) {
proxy
.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
deleteRoll([row.id]).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('删除成功');
getRollInfoPageList();
}
});
});
}
// 重置查询条件
function resetQuery() {
queryParams.value = {
pageNo: 1,
pageSize: 50,
searchKey: '',
wardId: '',
houseId: '',
encounterStatus: '',
bedStatus: '',
};
bedStatusFilter.value = '';
getList();
}
function changeWardLocationId(id) {
let params = {
locationId: id,
locationForm: 10,
};
queryParams.value.houseId = '';
childLocationList(params).then((res) => {
wardLocationList.value = res;
});
handleQuery();
}
// 获新入院患者列表
function getPatientList() {
// 为患者列表查询创建一个新的参数对象不包含bedStatus
const patientQueryParams = {
...queryParams.value,
bedStatus: undefined, // 移除bedStatus确保不影响患者列表查询
};
getPendingInfo(patientQueryParams).then((res) => {
loading.value = false;
// 为每个患者项初始化 active 属性
patientList.value = res.data.records.map((item) => ({
...item,
active: false,
}));
total.value = res.data.total;
});
}
// 选中患者
const selectPatient = ref(null);
function handleCardClick(item, index) {
// 清除所有项的激活状态
patientList.value.forEach((patient) => {
patient.active = false;
});
// 设置当前项为激活状态
item.active = true;
console.log(item);
selectPatient.value = item;
getRollInfoPageList();
}
function handleChageInstanceId(value) {
form.unit = feeItemOptions.value.find(
(item) => item.instanceId === value
).permittedUnitCode_dictText;
}
function handleClose() {
dialogVisible.value = false;
// 重置表单
form.name = '';
form.unit = '';
form.quantity = 1;
formRef.value?.resetFields();
}
// 获取滚费信息列表
const rollInfoPageList = ref([]);
function getRollInfoPageList() {
const encounterId = selectPatient.value.encounterId;
loading.value = true;
getRollInfoPage(encounterId).then((res) => {
rollInfoPageList.value = res.data;
loading.value = false;
});
}
function handleSubmit() {
formRef.value?.validate((valid) => {
if (valid) {
const param = {
encounterId: selectPatient.value.encounterId,
instanceId: form.instanceId,
quantity: form.quantity,
};
proxy
.$confirm('确认保存吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
saveInpatientRoll(param).then((res) => {
ElMessage.success('新增成功');
handleClose();
getRollInfoPageList();
});
})
.catch(() => {});
} else {
ElMessage.warning('请完善表单信息');
}
});
}
// 双击患者卡片事件
function handleCardDblClick(item) {
if (item.encounterStatus == 2) {
ElMessage({
message: '请分配病床!',
type: 'warning',
grouping: true,
showClose: true,
});
} else {
pendingInfo.value = {
...item,
entranceType: 1,
};
transferInDialogVisible.value = true;
}
}
function handleQuery() {
getList();
}
function handleAddFeeItemm() {
dialogVisible.value = true;
getInitDataSourceOptions();
}
function getPatientTagClass(item) {
if (item.encounterStatus == 2) {
return 'blue-tag';
} else if (item.encounterStatus == 5) {
return 'green-tag';
}
return '';
}
</script>
<style lang="scss" scoped>
.patient-card {
width: 100%;
overflow: hidden;
background-color: #fff;
border: 1px solid;
border-color: #eee;
border-radius: 4px;
box-shadow: 0 2px 2px 0 rgba(57.55, 69.04, 86.28, 20%);
margin-bottom: 10px;
cursor: pointer;
transition: all 0.2s ease;
&.actived {
background-color: rgb(7, 155, 140, 5%);
border-color: var(--el-color-primary);
}
&.dragging {
opacity: 0.5;
transform: rotate(5deg);
}
.doctor-parent-line {
margin: 0 16px;
border-bottom: 1px dashed #ddd;
}
.personal-info-container {
display: flex;
align-items: center;
justify-content: space-between;
margin: 8px 0;
padding: 0 16px;
.name-container {
display: flex;
align-items: center;
height: 18px;
.name {
color: #333;
font-size: 14px;
}
.age {
margin-left: 10px;
color: #666;
font-size: 14px;
}
}
}
}
.main-info-container {
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
margin: 7px 0;
padding: 0 16px;
margin-right: 48px;
position: relative;
.patient-tag {
position: absolute;
top: -7px;
right: -48px;
font-size: 14px;
padding: 2px 8px;
border-radius: 4px;
&.blue-tag {
background-color: #1890ff;
color: white;
}
&.green-tag {
background-color: #52c41a;
color: white;
}
}
}
</style>

View File

@@ -67,9 +67,7 @@
</el-card>
<el-card style="width: 60%">
<div>
<el-button size="default" type="primary" @click="openAddTprDialog"
>新增</el-button
>
<el-button size="default" type="primary" @click="openAddTprDialog">新增</el-button>
</div>
<div class="business-temperature-sheet" style="width: 60%">
<div>
@@ -133,7 +131,7 @@
@close="closePatientDetialDialog"
/>
<!-- </div> -->
<iframe id="printIframe" ref="printIframe" style="display:none;"></iframe>
<iframe id="printIframe" ref="printIframe" style="display: none"></iframe>
</div>
</template>
@@ -173,7 +171,7 @@ const queryParams = ref({
orgId: userStore.orgId,
});
const data1 = reactive({
const data1 = reactive({
patientInfo: {},
grParamBOS: {
age: '',
@@ -192,10 +190,10 @@ const data1 = reactive({
total: '',
hospDate: '',
operaDate: '',
outdate: ''
outdate: '',
},
rows: [],
types: []
types: [],
});
const patientData = ref({});
const integerPoints = [2, 6, 10, 14, 18, 22];
@@ -268,7 +266,7 @@ function init1(data) {
console.log('体温单初始化', data);
const inDate = data.grParamBOS.hospDate;
const outdate = data.grParamBOS.outdate;
week.value = Math.floor(dateDiff(inDate, outdate) / 7);
week.value = Math.floor(dateDiff(inDate, outdate) / 10);
setTemperatureComp(data);
}
@@ -276,6 +274,8 @@ function init1(data) {
* 点击患者列表行 获取患者体温单数据
*/
function viewPatient(row) {
console.log('1232312123221231');
patientInfo.value = row;
console.log('点击患者列表行 获取患者体温单数据', row);
chargeLoading.value = true;
@@ -375,7 +375,7 @@ function getSignsCharts() {
function getPatientList() {}
// 体温单控件数据设置
function setTemperatureComp(data) {
console.log(data,'体温单控件数据设置');
console.log(JSON.stringify(), '体温单控件数据设置');
if (data !== undefined) {
inputData.value = data;
}
@@ -434,12 +434,12 @@ function sliceData(data) {
const datas = cloneDeep(data);
datas.rows = rows;
datas.types = types;
console.log(datas,"666666666666666666")
console.log(datas, '666666666666666666');
return datas;
}
// 计算时间差
function dateDiff(start, end) {
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 :start;
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 : start;
if (end) {
diffTime = moment(end.substring(0, 10)).diff(moment(start.substring(0, 10))) / 1000;
}
@@ -475,39 +475,45 @@ function printPage() {
clone.style.transformOrigin = 'top left';
clone.style.width = 'calc(210mm * 1.11)';
clone.style.height = 'calc(297mm * 1.11)';
clone.style.marginLeft = '50px';
clone.style.marginLeft = '50px';
// 插入到 body 中以便 html2pdf 渲染
document.body.appendChild(clone);
// 设置 html2pdf 配置
const opt = {
margin: 0,
filename: '体温单.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all'] },
margin: 0,
filename: '体温单.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all'] },
onclone: (clonedDoc) => {
const chart = clonedDoc.getElementById(clone.id);
if (chart) {
chart.style.width = '210mm'; // 强制 A4 宽度
chart.style.margin = '0 auto';
}
}
},
};
// 导出为 PDF 并打印
html2pdf().from(clone).set(opt).toPdf().get('pdf').then(function (pdf) {
pdf.autoPrint(); // 自动打印
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF以便用户确认
}).finally(() => {
document.body.removeChild(clone); // 清理临时元素
});
html2pdf()
.from(clone)
.set(opt)
.toPdf()
.get('pdf')
.then(function (pdf) {
pdf.autoPrint(); // 自动打印
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF以便用户确认
})
.finally(() => {
document.body.removeChild(clone); // 清理临时元素
});
}
// 转化时间
function formatDateTo(dateStr) {
const [formattedDate, timePartWithSeconds] = dateStr ? dateStr.split('T'): ['', ''];
const [formattedDate, timePartWithSeconds] = dateStr ? dateStr.split('T') : ['', ''];
const [formattedHour, minutePart] = timePartWithSeconds.split(':');
const formattedTime = `${formattedHour}:${minutePart}`;
@@ -580,7 +586,7 @@ function formatHourTimes(dateStr, temperaturePulses) {
* 打开体征录入
*/
function openAddTprDialog() {
patientData.value = patientInfo.value
patientData.value = patientInfo.value;
openAddTpr.value = true;
// patientId.value = row.id;
nextTick(() => {
@@ -633,4 +639,4 @@ function closePatientDetialDialog(str) {
max-height: 270mm;
overflow: hidden;
}
</style>
</style>

View File

@@ -0,0 +1,42 @@
import request from '@/utils/request';
// 查询诊疗项目列表
export function getTemperatureType(data) {
return request({
url: '/document/definition/getDefinitionId',
method: 'get',
params: data,
});
}
// 根据时间查询体温单数据
export function getTemperatureHistory(data) {
return request({
url: '/document/record/getRecordByEncounterIdAndTimeList',
method: 'get',
params: data,
});
}
// 体温单保存
export function addRecord(data) {
return request({
url: '/document/record/saveOrUpdateRecord',
method: 'post',
data,
});
}
// 体温单图表展示
export function temChar(data) {
return request({
url: '/document/record/temperature-chart',
method: 'get',
params: data,
});
}
export function getPatientList(queryParams) {
return request({
url: '/reg-doctorstation/advice-manage/reg-patient-zk',
method: 'get',
params: queryParams,
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,755 @@
<template>
<div style="display: flex">
<el-button type="primary" style="margin-left: 20px" @click="increaseAdd('0')"
>变更体温单</el-button
>
<!-- <el-button type="primary" style="margin-left: 20px" @click="increaseAdd('1')">修改</el-button> -->
<!-- <el-button type="primary" style="margin-left: 20px" @click="increaseAdd('2')">查询</el-button> -->
</div>
<div class="main">
<template v-if="isEmpty">
<div class="empty">
<el-empty description="暂无数据" />
</div>
</template>
<template v-else>
<div class="business-temperature-sheet">
<div class="custom-tooltip">
<el-tooltip content="首页" placement="right-end">
<el-button
style="margin-left: 12px"
icon="Upload"
size="default"
type="primary"
@click="toFirst"
/>
</el-tooltip>
<el-tooltip content="上一页" placement="right-end">
<el-button
style="margin-left: 12px; margin-top: 15px"
icon="ArrowUpBold"
size="default"
type="primary"
@click="lastWeek"
/>
</el-tooltip>
<el-tooltip content="下一页" placement="right-end">
<el-button
style="margin-left: 12px; margin-top: 15px"
icon="ArrowDown"
size="default"
type="primary"
@click="nextWeek"
/>
</el-tooltip>
<el-tooltip content="尾页" placement="right-end">
<el-button
style="margin-left: 12px; margin-top: 15px"
icon="Download"
size="default"
type="primary"
@click="toEnd"
/>
</el-tooltip>
<el-tooltip content="打印本页" placement="right-end">
<el-button
style="margin-left: 12px; margin-top: 15px"
icon="Printer"
size="default"
type="primary"
@click="printPage"
/>
</el-tooltip>
</div>
</div>
<div class="sheet">
<div id="my_dataviz" ref="printRef" style="width: 100%; background-color: white" />
</div>
</template>
</div>
<el-drawer v-model="isOpenDraw" :direction="direction" size="100%" :with-header="false">
<template #default>
<AddAttr ref="attrRef" @onSearcTem="onSearch"></AddAttr>
</template>
<template #footer>
<div style="flex: auto">
<el-button @click="cancelClick">取消</el-button>
<el-button v-if="actionType == '2'" type="primary" @click="confirmClick">查询</el-button>
<el-button v-if="actionType !== '2'" type="primary" @click="confirmClick">保存</el-button>
</div>
</template>
</el-drawer>
</template>
<script setup>
import { init } from '@/action/nurseStation/temperatureSheet/line.js';
import { patientInfo } from '../../../inpatientDoctor/home/store/patient';
import { getVitalSignsInfo } from '../../tprChart/components/api';
import { nextTick, onMounted, watch } from 'vue';
import { getTemperatureType, temChar } from '../api/api';
import moment from 'moment';
import AddAttr from './addAttr.vue';
import cloneDeep from 'lodash.clonedeep';
import { ElMessage } from 'element-plus';
import html2pdf from 'html2pdf.js';
const attrRef = ref('');
const actionType = ref('');
const printRef = ref(null);
const isTemplate = ref(false);
const data1 = reactive({
patientInfo: {},
grParamBOS: {
age: '',
birth: '',
cwh: '',
hosNum: '',
inDate: '',
inDiagName: '',
name: '',
// 科室
deptName: '',
operaDays: '',
sex: '',
weekNo: '',
beginDate: '',
hospDays: '',
total: '',
hospDate: '',
operaDate: '',
outdate: '',
},
rows: [],
types: [],
});
const isOpenDraw = ref(false);
const week = ref(0);
const patientId = ref('');
const patientData = ref({});
const integerPoints = [2, 6, 10, 14, 18, 22];
const closestPoint = ref(null);
const patientList = ref([]);
const chargeLoading = ref(false);
const addTprDialogRef = ref(null);
const definitionId = ref(''); //体温单类型
const isEmpty = ref(true);
const objTest = {
hospDate: '2025-11-20T08:13:00',
operaDate: null,
outdate: null,
temperaturePulses: [
{
chartsSmalls: [
{
collectionMode: null,
date: '2025-11-20',
times: '10:00:00',
typeCode: '9500',
typeValue: '入科,08:13',
weekNo: 1,
orderByDateTimes: '2025-11-20 08:13:00',
id: 'c3bafb02-4609-4b53-b307-ad6767f9ba9b',
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-20',
times: '10:00:00',
typeCode: '003',
typeValue: '36.3',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '10:00:00',
typeCode: '002',
typeValue: '90',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '10:00:00',
typeCode: '001',
typeValue: '18',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-20',
times: '14:00:00',
typeCode: '003',
typeValue: '36.6',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '14:00:00',
typeCode: '002',
typeValue: '84',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '14:00:00',
typeCode: '001',
typeValue: '20',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-20',
times: '18:00:00',
typeCode: '003',
typeValue: '36.5',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '18:00:00',
typeCode: '002',
typeValue: '88',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-20',
times: '18:00:00',
typeCode: '001',
typeValue: '20',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-21',
times: '06:00:00',
typeCode: '003',
typeValue: '36.5',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '06:00:00',
typeCode: '002',
typeValue: '88',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '06:00:00',
typeCode: '001',
typeValue: '18',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '06:00:00',
typeCode: '016',
typeValue: '2',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-21',
times: '10:00:00',
typeCode: '003',
typeValue: '36.4',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '10:00:00',
typeCode: '002',
typeValue: '86',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '10:00:00',
typeCode: '001',
typeValue: '18',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
{
chartsSmalls: [
{
collectionMode: 1,
date: '2025-11-21',
times: '14:00:00',
typeCode: '003',
typeValue: '36.5',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '14:00:00',
typeCode: '002',
typeValue: '82',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: 1,
date: '2025-11-21',
times: '14:00:00',
typeCode: '001',
typeValue: '18',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
weekNo: 1,
},
],
others: [
{
collectionMode: null,
date: '2025-11-20',
times: null,
typeCode: '030',
typeValue: '卧床',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: null,
typeCode: '009',
typeValue: '卧床',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: '14:00:00',
typeCode: '008',
typeValue: '112/54,',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: '6:00:00',
typeCode: '008',
typeValue: '110/54,',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: null,
typeCode: '011',
typeValue: '3000/22h',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: null,
typeCode: '004',
typeValue: 'C',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
{
collectionMode: null,
date: '2025-11-20',
times: null,
typeCode: '005',
typeValue: '0',
weekNo: 1,
orderByDateTimes: null,
id: null,
},
],
};
/**
* 点击患者列表行 获取患者体温单数据
*/
const inputData = ref({});
onMounted(() => {
console.log(
'onMountedonMountedonMountedonMountedonMountedonMounted========>',
JSON.stringify(patientInfo.value)
);
if (patientInfo.value) {
getTemRequset();
} else {
isEmpty.value = true;
}
});
watch(patientInfo, (newValue) => {
console.log('patientInfo========>', JSON.stringify(patientInfo.value));
isEmpty.value = false;
getTemRequset();
});
// 1.获取体温单类型
// 获取体温单类型
const getTemRequset = async () => {
const res = await getTemperatureType({ menuEnum: 4 });
//默认选中第一个
if (res?.data?.length > 0) {
const obj = res.data[0];
definitionId.value = obj.id;
viewPatient(patientInfo.value);
isTemplate.value = true;
} else {
isTemplate.value = false;
}
};
// 2.根据患者id和病历id获取详情绘制图表
function viewPatient(row = {}) {
chargeLoading.value = true;
patientId.value = row.patientId; // 接收子组件传来的数据
data1.patientInfo = row;
data1.grParamBOS.patientId = row.patientId;
data1.grParamBOS.age = row.age;
data1.grParamBOS.birth = row.birthDate;
// data1.grParamBOS.cwh = row.bedLocationId_dictText;
data1.grParamBOS.cwh = row.bedName;
data1.grParamBOS.deptName = row.wardName;
data1.grParamBOS.hosNum = row.encounterId;
data1.grParamBOS.sex = row.genderEnum_enumText;
// 入科时间存在的场合使用入科时间
data1.grParamBOS.inDate = row.admissionDate;
data1.grParamBOS.name = row.patientName;
data1.grParamBOS.operaDays = null;
data1.grParamBOS.weekNo = null;
data1.grParamBOS.beginDate = getCurrentDate();
data1.grParamBOS.hospDays = null;
data1.grParamBOS.total = null;
getSignsCharts();
}
function getSignsCharts() {
// data1.grParamBOS.hospDate =
// objTest.hospDate && objTest.hospDate.length > 10
// ? objTest.hospDate.substring(0, 10)
// : objTest.hospDate;
// data1.grParamBOS.operaDate = objTest.operaDate;
// data1.grParamBOS.outdate = objTest.outdate;
// data1.rows = objTest.temperaturePulses.map((item) => ({
// rowBOS: item.chartsSmalls,
// weekNo: item.weekNo - 1,
// }));
// data1.types = objTest.others.map((item) => ({
// ...item, // 保留其他属性
// weekNo: item.weekNo - 1, // 将 weekNo 减 1
// }));
// console.log('体温单查询this.data1', data1);
// init1(data1);
const params = {
patientId: patientId.value ?? '',
encounterId: patientInfo.value.encounterId ?? '',
definitionId: definitionId.value,
};
temChar(params).then((response) => {
console.log('体温单返回值', JSON.stringify(response));
if (response.code === 200) {
data1.grParamBOS.hospDate =
response.data.hospDate && response.data.hospDate.length > 10
? response.data.hospDate.substring(0, 10)
: response.data.hospDate;
data1.grParamBOS.operaDate = response.data.operaDate;
data1.grParamBOS.outdate = response.data.outdate;
data1.rows = response.data.temperaturePulses.map((item) => ({
rowBOS: item.chartsSmalls,
weekNo: item.weekNo - 1,
}));
data1.types = response.data.others.map((item) => ({
...item, // 保留其他属性
weekNo: item.weekNo - 1, // 将 weekNo 减 1
}));
console.log('体温单查询this.data1', data1);
init1(data1);
}
});
}
function init1(data) {
console.log('体温单初始化', data);
const inDate = data.grParamBOS.hospDate;
const outdate = data.grParamBOS.outdate;
// week.value = Math.floor(dateDiff(inDate, outdate) / 10);
week.value = Math.floor(dateDiff(inDate, outdate) / 7);
setTemperatureComp(data);
}
// 体温单控件数据设置
function setTemperatureComp(data) {
console.log(JSON.stringify(data), '体温单控件数据设置');
if (data !== undefined) {
inputData.value = data;
}
const inDate = inputData.value.grParamBOS.hospDate;
const outdate = inputData.value.grParamBOS.outdate;
const begin = moment(new Date(inDate))
.add(week.value * 7, 'day')
.format('YYYY-MM-DD HH:mm:ss');
inputData.value.grParamBOS.weekNo = week.value;
inputData.value.grParamBOS.beginDate = begin;
inputData.value.grParamBOS.hospDays = week.value * 7;
inputData.value.grParamBOS.total = Math.floor(dateDiff(inDate, outdate) / 7);
console.log('inputData============>', JSON.stringify(inputData));
init(sliceData(inputData.value));
}
function dateDiff(start, end) {
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 : start;
if (end) {
diffTime = moment(end.substring(0, 10)).diff(moment(start.substring(0, 10))) / 1000;
}
if (diffTime > 24 * 3600) {
return Math.floor(diffTime / (24 * 3600));
} else if (diffTime > 3600) {
return '0';
} else {
return '0';
}
}
function getCurrentDate() {
// 获取当前日期
const today = new Date();
const year = today.getFullYear();
const month = (today.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始所以需要加1
const day = today.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`; // 格式化为 YYYY-MM-DD
}
// 拆分当前周数据
function sliceData(data) {
const rows = data.rows.filter((item) => item.weekNo === week.value);
const types = data.types.filter((item) => item.weekNo === week.value);
// const datas = JSON.parse(JSON.stringify(data));
const datas = cloneDeep(data);
datas.rows = rows;
datas.types = types;
console.log(datas, '666666666666666666');
return datas;
}
function toFirst() {
week.value = 0;
setTemperatureComp();
}
function toEnd() {
week.value = inputData.value.grParamBOS.total;
setTemperatureComp();
}
function lastWeek() {
week.value--;
if (week.value < 0) {
week.value = 0;
}
setTemperatureComp();
}
function nextWeek() {
week.value = Number(week.value) + 1;
if (week.value > inputData.value.grParamBOS.total) {
week.value = inputData.value.grParamBOS.total;
}
setTemperatureComp();
}
// 新增
const increaseAdd = (type) => {
if (!patientInfo.value) {
ElMessage({
type: 'error',
message: '请选择患者',
});
return;
}
if (!isTemplate.value) {
ElMessage({
type: 'error',
message: '体温单未配置,请联系管理员',
});
return;
}
isOpenDraw.value = true;
nextTick(() => {
actionType.value = type;
if (attrRef.value) {
attrRef.value.onActionEdit(type);
}
});
};
// 打印体温单
function printPage() {
const element = printRef.value;
if (!element) {
console.error('未找到可打印的内容');
return;
}
// 创建一个克隆元素用于打印,避免修改原 DOM
const clone = element.cloneNode(true);
// 设置宽度为 A4780px ≈ 210mm高度自适应
clone.style.transform = 'scale(0.7)';
clone.style.transformOrigin = 'top left';
clone.style.width = 'calc(210mm * 1.11)';
clone.style.height = 'calc(297mm * 1.11)';
clone.style.marginLeft = '50px';
// 插入到 body 中以便 html2pdf 渲染
document.body.appendChild(clone);
// 设置 html2pdf 配置
const opt = {
margin: 0,
filename: '体温单.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all'] },
onclone: (clonedDoc) => {
const chart = clonedDoc.getElementById(clone.id);
if (chart) {
chart.style.width = '210mm'; // 强制 A4 宽度
chart.style.margin = '0 auto';
}
},
};
// 导出为 PDF 并打印
html2pdf()
.from(clone)
.set(opt)
.toPdf()
.get('pdf')
.then(function (pdf) {
pdf.autoPrint(); // 自动打印
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF以便用户确认
})
.finally(() => {
document.body.removeChild(clone); // 清理临时元素
});
}
const confirmClick = () => {
attrRef.value.saveData();
};
const cancelClick = () => {
isOpenDraw.value = false;
};
// 子组件查询方法
const onSearch = (value) => {
getTemRequset();
isOpenDraw.value = false;
};
</script>
<style scoped>
.main {
height: 100%;
display: flex;
flex-direction: row;
.empty {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.business-temperature-sheet {
height: 100%;
width: 100px;
.custom-tooltip {
height: 100%;
margin-left: 10px;
margin-right: 10px;
display: flex;
flex-direction: column;
justify-content: center;
}
}
.sheet {
flex: 1;
/* background: red; */
}
}
</style>

View File

@@ -0,0 +1,58 @@
<template>
<div class="inpatientNurse-home-container">
<PatientList :selected-patient="patientInfo" :on-select="handlePatientSelect" />
<el-container>
<el-header>
<inPatientBarDoctorFold></inPatientBarDoctorFold>
</el-header>
<el-main>
<Details></Details>
</el-main>
</el-container>
</div>
</template>
<script setup>
import { computed } from 'vue';
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
import Details from './compoents/details.vue';
import { patientInfo, updatePatientInfo } from '@/views/inpatientNurse/components/store/patient';
import PatientList from '@/components/PatientList/patient-list.vue';
// 处理患者选择
const handlePatientSelect = (patient) => {
updatePatientInfo(patient);
};
</script>
<style lang="scss" scoped>
.inpatientNurse-home-container {
padding-top: 10px;
display: flex;
height: 100%;
.el-container {
height: 100%;
}
.inpatientNurse-home-main {
background-color: #ffffff;
:deep(.el-header) {
padding: 0px;
margin-bottom: 0px;
}
.el-main {
padding: 0px 8px;
}
:deep(.patient-tabs) {
height: 100%;
.el-tabs__header {
margin: 0;
}
.el-tabs__content {
}
.el-tab-pane {
height: 100%;
}
}
}
}
</style>