提交merge1.3

This commit is contained in:
2025-12-27 15:30:40 +08:00
parent 088861f66e
commit 3c497417dc
167 changed files with 0 additions and 17577 deletions

View File

@@ -1,13 +1,6 @@
/*
* @Author: sjjh
* @Date: 2025-09-20 17:02:37
<<<<<<< HEAD
* @Description:
*/
import request from '@/utils/request'
// ====== 文书记录
=======
* @Description:
*/
import request from '@/utils/request';
@@ -21,17 +14,11 @@ export function saveOrUpdateRecord(data) {
data,
});
}
>>>>>>> v1.3
// 新增记录
export function addRecord(data) {
return request({
url: '/document/record/addRecord',
method: 'post',
<<<<<<< HEAD
data
})
}
=======
data,
});
}
@@ -69,31 +56,21 @@ export function deleteTemplate(id) {
});
}
>>>>>>> v1.3
// 根据患者ID或就诊ID获取文书记录列表,只针对不需返回患者具体信息的列表,体温单除外,单独处理
export function getRecordByEncounterIdList(params) {
return request({
url: '/document/record/getRecordByEncounterIdList',
method: 'get',
<<<<<<< HEAD
params
})
=======
params,
});
>>>>>>> v1.3
}
// 初始化文书定义
export function init() {
return request({
url: '/document/record/init',
method: 'get',
<<<<<<< HEAD
})
=======
});
>>>>>>> v1.3
}
// ====== 文书模板
@@ -102,40 +79,22 @@ export function addTemplate(data) {
return request({
url: '/document/template/add',
method: 'post',
<<<<<<< HEAD
data
})
=======
data,
});
>>>>>>> v1.3
}
//
export function getListByDefinitionId(definitionId) {
return request({
url: '/document/template/getListByDefinitionId',
method: 'get',
<<<<<<< HEAD
params: {definitionId}
})
=======
params: { definitionId },
});
>>>>>>> v1.3
}
// 更新模板
export function updateTemplate(data) {
return request({
url: '/document/template/update',
method: 'put',
<<<<<<< HEAD
data
})
}
=======
data,
});
}
>>>>>>> v1.3

View File

@@ -7,13 +7,6 @@
</template>
</el-input>
</div>
<<<<<<< HEAD
<el-scrollbar class="emr-history-scrollbar-container" style="width: 100%">
<div v-for="item in historyData" :key="item.id" class="scrollbar-item">
<el-tooltip effect="dark" :content="`${item.name}(${item.recordTime})`" placement="bottom">
<el-text class="w-150px mb-2" truncated @click="handleNodeClick(item)">
{{ item.name }}({{ item.recordTime }})
=======
<el-scrollbar
class="emr-history-scrollbar-container"
style="width: 100%; height: calc(100vh - 300px)"
@@ -37,7 +30,6 @@
>
<Delete />
</el-icon>
>>>>>>> v1.3
</el-text>
</el-tooltip>
</div>
@@ -46,13 +38,8 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, reactive, defineEmits, unref } from 'vue';
import { getRecordByEncounterIdList } from '../api';
=======
import { ref, reactive, defineEmits, unref, nextTick } from 'vue';
import { getRecordByEncounterIdList, deleteRecord } from '../api';
>>>>>>> v1.3
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
@@ -62,13 +49,10 @@ const props = defineProps({
type: String,
default: '',
},
<<<<<<< HEAD
=======
selectedRecordId: {
type: String,
default: '',
},
>>>>>>> v1.3
});
const definitionId = defineModel('definitionId', {
type: String,
@@ -97,20 +81,13 @@ const queryList = async () => {
historyData.value = [];
}
} catch (error) {
<<<<<<< HEAD
// ElMessage.error('获取模板树失败');
=======
// ElMessage.error(' 获取模板树失败 ');
>>>>>>> v1.3
historyData.value = [];
}
};
const handleNodeClick = (data) => {
emits('historyClick', data);
};
<<<<<<< HEAD
const currentSelectTemplate = ref({});
=======
// 删除历史记录
const handleDelete = async (item) => {
try {
@@ -128,7 +105,6 @@ const handleDelete = async (item) => {
}
};
>>>>>>> v1.3
defineExpose({ queryList });
</script>
@@ -152,8 +128,6 @@ defineExpose({ queryList });
& + .scrollbar-item {
margin-top: 8px;
}
<<<<<<< HEAD
=======
transition: all 0.3s ease;
}
.selected-history-item {
@@ -164,7 +138,6 @@ defineExpose({ queryList });
color: #d9d9d9;
cursor: not-allowed;
opacity: 0.6;
>>>>>>> v1.3
}
}
}

View File

@@ -9,19 +9,6 @@
</div> -->
<el-scrollbar class="emr-template-scrollbar-container" style="width: 100%">
<div v-for="item in templateData" :key="item.id" class="scrollbar-item">
<<<<<<< HEAD
<el-tooltip
effect="dark"
:content="`${item.name}`"
placement="bottom"
>
<el-text class="2" truncated @click="handleNodeClick(item)">
<div class="template-item">{{ item.name }}
<el-space>
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
</el-space></div>
=======
<el-tooltip effect="dark" :content="`${item.name}`" placement="bottom">
<el-text class="2" truncated @click="handleNodeClick(item)">
<div class="template-item">
@@ -31,7 +18,6 @@
<el-icon><Delete @click="handleDelete(item)" /></el-icon>
</el-space>
</div>
>>>>>>> v1.3
</el-text>
</el-tooltip>
</div>
@@ -41,19 +27,11 @@
<script setup>
import { ref, reactive, defineEmits, unref } from 'vue';
<<<<<<< HEAD
import { getListByDefinitionId } from '../api';
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
const emits = defineEmits(['templateClick','edit']);
=======
import { getListByDefinitionId, deleteTemplate } from '../api';
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
const emits = defineEmits(['templateClick', 'edit']);
>>>>>>> v1.3
const props = defineProps({
definitionId: {
type: String,
@@ -73,17 +51,6 @@ const queryParams = ref({
isPage: 0,
});
const templateData = ref([]);
<<<<<<< HEAD
const queryList = async () => {
try {
if ( unref(definitionId)&&unref(definitionId) !== '') {
const res = await getListByDefinitionId(unref(definitionId));
templateData.value = res.data || [];
}else{
templateData.value = [];
}
=======
// 删除模板
const handleDelete = async (item) => {
try {
@@ -102,7 +69,6 @@ const queryList = async () => {
} else {
templateData.value = [];
}
>>>>>>> v1.3
} catch (error) {
ElMessage.error('获取模板失败');
templateData.value = [];
@@ -120,38 +86,6 @@ defineExpose({ queryList });
<style lang="scss" scoped>
.emr-template-container {
<<<<<<< HEAD
height: 100%;
// padding: 8px;
.emr-template-scrollbar-container{
padding: 8px;
height: 100%;
.scrollbar-item {
height: 40px;
line-height: 40px;
border-radius: 4px;
cursor: pointer;
background: var(--el-color-primary-light-9);
& + .scrollbar-item {
margin-top: 8px;
}
.el-text{
width: calc(100% - 0px);
display: flex;
justify-content: space-between;
padding: 0 8px;
}
.template-item{
width: 100%;
display: flex;
justify-content: space-between;
}
}
}
}
=======
height: 100%;
// padding: 8px;
@@ -181,5 +115,4 @@ defineExpose({ queryList });
}
}
}
>>>>>>> v1.3
</style>

View File

@@ -1,11 +1,3 @@
<<<<<<< HEAD
<!--
* @Author: sjjh
* @Date: 2025-09-18 15:41:10
* @Description: 门诊病历组件
-->
=======
>>>>>>> v1.3
<template>
<div class="emr-use-container">
<div
@@ -51,26 +43,13 @@
<!-- <el-button type="primary" @click="newEmr">新建</el-button> -->
<el-button type="primary" @click="saveAsModel">存为模版</el-button>
<el-button @click="refresh">刷新</el-button>
<<<<<<< HEAD
<el-button type="primary" @click="save">保存</el-button>
<!-- <el-button type="primary" @click="print">打印</el-button> -->
=======
<el-button @click="resetForm">重置</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="print">打印</el-button>
>>>>>>> v1.3
</el-space>
</div>
<div class="operate-main">
<el-scrollbar class="template-tree-scrollbar">
<<<<<<< HEAD
<component
:is="currentComponent"
ref="emrComponentRef"
:patientInfo="props.patientInfo"
@submitOk="handleSubmitOk"
/>
=======
<div v-loading="loading" class="loading-container">
<component
:is="currentComponent"
@@ -79,7 +58,6 @@
@submitOk="handleSubmitOk"
/>
</div>
>>>>>>> v1.3
</el-scrollbar>
</div>
</div>
@@ -92,10 +70,7 @@
@historyClick="handleHistoryClick"
ref="historyRef"
v-model:definitionId="currentSelectTemplate.id"
<<<<<<< HEAD
=======
:selectedRecordId="selectedHistoryRecordId"
>>>>>>> v1.3
/>
</el-tab-pane>
<el-tab-pane label="模版" name="model">
@@ -119,20 +94,6 @@
</div>
</template>
<script setup>
<<<<<<< HEAD
import { getCurrentInstance, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { getTreeList } from '@/views/basicmanage/caseTemplates/api';
import { addRecord, addTemplate } from './api';
import { patientInfo } from '../store/patient.js';
import dayjs from 'dayjs';
// 打印工具
// import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js';
const { proxy } = getCurrentInstance();
const emits = defineEmits(['emrSaved']);
const props = defineProps({
/** 患者信息 doctorStation 传递信息*/
=======
import { nextTick, onMounted, ref, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { getTreeList } from '@/views/basicmanage/caseTemplates/api';
@@ -146,7 +107,6 @@ const { proxy } = getCurrentInstance();
const emits = defineEmits([]);
const props = defineProps({
/** 患者信息 doctorStation 传递信息*/
>>>>>>> v1.3
patientInfo: {
type: Object,
required: true,
@@ -169,10 +129,7 @@ const queryParams = ref({
useRanges: [1, 2], // 0 暂不使用 1 全院 2 科室 3 个人
organizationId: userStore.orgId,
});
<<<<<<< HEAD
=======
const loading = ref(false); // 数据加载状态
>>>>>>> v1.3
const currentSelectTemplate = ref({
id: '',
@@ -182,10 +139,7 @@ const emrComponentRef = ref(null);
const quicklyactiveName = ref('history');
const leftShow = ref(true);
const rightShow = ref(true);
<<<<<<< HEAD
=======
const templateTree = ref(null);
>>>>>>> v1.3
// 树配置(模板树)
const defaultProps = {
@@ -198,12 +152,9 @@ const queryTemplateTree = async () => {
try {
const res = await getTreeList(queryParams.value);
templateData.value = res.data || [];
<<<<<<< HEAD
=======
// 组件挂载后患者信息变化时会自动调用selectDefaultTemplate
// 这里不再重复调用,避免重复操作
>>>>>>> v1.3
} catch (error) {
// ElMessage.error('获取模板树失败');
templateData.value = [];
@@ -223,9 +174,6 @@ const handleNodeClick = (data, node) => {
};
// currentComponent.value = null;
}
<<<<<<< HEAD
historyRef.value?.queryList();
=======
// 确保组件状态更新后再查询历史记录
nextTick(() => {
@@ -240,7 +188,6 @@ const handleNodeClick = (data, node) => {
}, 100);
});
>>>>>>> v1.3
templateRef.value?.queryList();
};
@@ -300,14 +247,6 @@ const handleSubmitOk = async (data) => {
editForm.value.encounterId = patientInfo.value.encounterId;
editForm.value.patientId = patientInfo.value.patientId;
editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
<<<<<<< HEAD
await addRecord(editForm.value);
ElMessage.success('病历保存成功');
historyRef.value?.queryList();
templateRef.value?.queryList();
// 通知父组件病历保存成功
emits('emrSaved', true);
=======
// 提交病历
await saveOrUpdateRecord(editForm.value);
ElMessage.success('保存成功');
@@ -320,18 +259,12 @@ const handleSubmitOk = async (data) => {
setTimeout(() => {
loadLatestMedicalRecord();
}, 100);
>>>>>>> v1.3
} catch (error) {
ElMessage.error('提交失败');
console.log(error);
}
} else if (currentOperate.value === 'addTemplate') {
<<<<<<< HEAD
// 新增或者编辑模板
// editTemplateForm.value.id=
=======
// 新增或修改模板
>>>>>>> v1.3
editTemplateForm.value.name =
currentSelectTemplate.value.name + dayjs().format('YYYY/MM/DD HH:mm');
editTemplateForm.value.contextJson = JSON.stringify(data);
@@ -346,26 +279,12 @@ const refresh = () => {
templateRef.value?.queryList();
};
<<<<<<< HEAD
const deleteEmr = async () => {
try {
// 这里应该添加实际的删除逻辑
ElMessage.success('删除成功!');
} catch (error) {
ElMessage.error('删除失败');
}
};
const save = async () => {
try {
=======
const save = async () => {
try {
if (editForm.value && editForm.value.printCount && editForm.value.printCount > 0) {
ElMessage.warning('该病历已打印,不允许修改');
return;
}
>>>>>>> v1.3
currentOperate.value = 'add';
await emrComponentRef.value?.submit();
} catch (error) {
@@ -373,8 +292,6 @@ const save = async () => {
}
};
<<<<<<< HEAD
=======
// 重置表单数据
const resetForm = async () => {
try {
@@ -419,7 +336,6 @@ const resetForm = async () => {
}
};
>>>>>>> v1.3
const historyRef = ref(null);
const handleHistoryClick = (data) => {
newEmr();
@@ -428,8 +344,6 @@ const handleHistoryClick = (data) => {
emrComponentRef.value?.setFormData(JSON.parse(editForm.value.contentJson));
});
};
<<<<<<< HEAD
=======
// 默认选中门诊病历模板
const selectOutpatientMedicalRecordTemplate = async () => {
@@ -532,17 +446,13 @@ const loadLatestMedicalRecord = async () => {
loading.value = false;
}
};
>>>>>>> v1.3
const templateRef = ref(null);
const handleTemplateClick = (data) => {
newEmr();
editForm.value = data;
<<<<<<< HEAD
=======
editForm.value.id = '';
editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
>>>>>>> v1.3
nextTick(() => {
emrComponentRef.value?.setFormData(JSON.parse(editForm.value.contextJson));
});
@@ -555,12 +465,6 @@ const templateEdit = (data) => {
const templateEditVisible = ref(false);
// const templateEditSubmitOk = () => {};
<<<<<<< HEAD
// 打印方法实现
const print = async () => {
try {
// 检查是否有选中的病历模板
=======
// 定义病历模板类型与打印模板的映射关系
const templateToPrintTemplateMap = {
// 手术记录相关模板
@@ -593,46 +497,19 @@ const getPrintTemplateByTemplateName = (templateName) => {
// 打印
const print = async () => {
try {
>>>>>>> v1.3
if (!currentSelectTemplate.value || !currentSelectTemplate.value.id) {
ElMessage.warning('请先选择病历模板');
return;
}
<<<<<<< HEAD
=======
// 检查是否已保存
if (!editForm.value.id || editForm.value.id === '') {
ElMessage.warning('请先保存病历后再进行打印');
return;
}
>>>>>>> v1.3
// 获取当前病历组件的表单数据
const formData = emrComponentRef.value?.formData || {};
<<<<<<< HEAD
// 准备打印数据不依赖子组件的getPrintData方法
// const printData = {
// // 使用当前选中的模板信息
// templateInfo: currentSelectTemplate.value,
// // 添加患者信息
// patientInfo: props.patientInfo,
// // 添加打印时间
// printTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// // 添加基本病历信息
// emrInfo: {
// documentName: currentSelectTemplate.value.name || '住院病历',
// documentId: currentSelectTemplate.value.id || '',
// encounterId: props.patientInfo.encounterId || '',
// patientId: props.patientInfo.patientId || '',
// recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// },
// // 添加病历表单数据(包含红框内的所有字段)
// formData: formData,
// doctorName: userStore.nickName,
// };
=======
// 获取诊断数据
let diagnosisList = [];
let diagnosisText = '';
@@ -659,7 +536,6 @@ const print = async () => {
const selectedPrintTemplate = getPrintTemplateByTemplateName(templateName);
// 打印数据
>>>>>>> v1.3
const printData = {
// 模板信息
templateName: currentSelectTemplate.value.name || '住院病历',
@@ -683,30 +559,16 @@ const print = async () => {
department: props.patientInfo.department || '',
attendingDoctor: props.patientInfo.attendingDoctor || '',
<<<<<<< HEAD
=======
// 诊断信息
diagnosisList: JSON.stringify(diagnosisList),
diagnosisText: diagnosisText,
>>>>>>> v1.3
// 病历信息
documentName: currentSelectTemplate.value.name || '住院病历',
documentId: currentSelectTemplate.value.id || '',
recordTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
printTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
<<<<<<< HEAD
// 表单数据 - 需要将嵌套结构展开
...flattenObject(formData),
};
// 执行打印
await simplePrint(PRINT_TEMPLATE.OUTPATIENT_MEDICAL_RECORD, printData);
ElMessage.success('打印成功');
} catch (error) {
console.error('打印失败:', error);
=======
//病历号
busNo: props.patientInfo.busNo || '',
//费用类型
@@ -733,7 +595,6 @@ const print = async () => {
ElMessage.success('打印成功');
} catch (error) {
>>>>>>> v1.3
ElMessage.error('打印失败: ' + (error.message || '未知错误'));
}
};
@@ -767,17 +628,6 @@ const templateEditSubmitOk = () => {
historyRef.value?.queryList();
templateRef.value?.queryList();
};
<<<<<<< HEAD
// onBeforeMount(() => {});
// 刚进页面默认显示门诊病历
const selectDefaultTemplate = () => {
nextTick(() => {
// 查找门诊病历(1.0.0)节点
const findTemplate = (nodes) => {
for (const node of nodes) {
if (node.children && node.children.length > 0) {
const found = findTemplate(node.children);
=======
// 选择默认模板 - 获取门诊病历分类下的第一个模板
const selectDefaultTemplate = () => {
@@ -805,41 +655,14 @@ const selectDefaultTemplate = () => {
// 递归查找子节点
if (node.children && node.children.length > 0) {
const found = findOutpatientRecordCategoryAndFirstTemplate(node.children);
>>>>>>> v1.3
if (found) {
return found;
}
}
<<<<<<< HEAD
// 根据ID查找门诊病历模板
if (node.document && node.document.id === '1963474077201162242') {
return node;
}
=======
>>>>>>> v1.3
}
return null;
};
<<<<<<< HEAD
const defaultTemplate = findTemplate(templateData.value);
if (defaultTemplate) {
// 模拟点击节点
const mockNode = {
isLeaf: true,
};
handleNodeClick(defaultTemplate, mockNode);
}
});
};
onMounted(async () => {
console.log('hospitalizationEmr mounted', userStore);
await queryTemplateTree();
selectDefaultTemplate();
});
defineExpose({ state });
=======
const defaultTemplate = findOutpatientRecordCategoryAndFirstTemplate(templateData.value);
if (defaultTemplate) {
nextTick(() => {
@@ -899,7 +722,6 @@ onMounted(async () => {
});
// defineExpose({ state }); // state未使用
>>>>>>> v1.3
const disNode = () => {
leftShow.value = !leftShow.value;
@@ -1013,14 +835,6 @@ const disNode_R = () => {
}
.operate-main {
<<<<<<< HEAD
height: calc(100vh - 150px);
flex: auto;
}
.operate-main .template-tree-scrollbar {
height: 100%;
overflow-y: auto;
=======
flex: 1;
min-height: 0; /* 允许flex子项高度收缩 */
display: flex;
@@ -1044,7 +858,6 @@ const disNode_R = () => {
.operate-main .template-tree-scrollbar > * {
max-width: 100%;
box-sizing: border-box;
>>>>>>> v1.3
}
}
@@ -1066,13 +879,10 @@ const disNode_R = () => {
transition-duration: 300ms;
}
}
<<<<<<< HEAD
=======
/* 加载状态样式 */
.loading-container {
min-height: 400px;
position: relative;
}
>>>>>>> v1.3
</style>