docs(release-notes): 添加住院护士站划价功能说明和发版记录

- 新增住院护士站划价服务流程说明文档,详细描述了从参数预处理到结果响应的五大阶段流程
- 包含耗材类医嘱和诊疗活动类医嘱的差异化处理逻辑
- 添加完整的发版内容记录,涵盖新增菜单功能和各模块优化点
- 记录了住院相关功能的新增和门诊业务流程的修复
```
This commit is contained in:
2025-12-25 14:13:14 +08:00
parent 85fcb7c2e2
commit abc0674531
920 changed files with 107068 additions and 14495 deletions

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

@@ -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

@@ -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

@@ -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>