版本更新

This commit is contained in:
Zhang.WH
2025-09-03 15:54:41 +08:00
parent 0b93d16b64
commit 8f82322d10
3290 changed files with 154339 additions and 23829 deletions

View File

@@ -0,0 +1,181 @@
<template>
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper">
<el-table
ref="adviceBaseRef"
height="400"
:data="adviceBaseList"
highlight-current-row
@current-change="handleCurrentChange"
row-key="patientId"
@cell-click="clickRow"
>
<el-table-column label="名称" align="center" prop="adviceName" />
<el-table-column label="类型" align="center" prop="activityType_enumText" />
<el-table-column label="包装单位" align="center" prop="unitCode_dictText" />
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
<el-table-column label="规格" align="center" prop="volume" />
<el-table-column label="用法" align="center" prop="methodCode_dictText" />
<el-table-column label="库存数量" align="center">
<template #default="scope">{{ handleQuantity(scope.row) }}</template>
</el-table-column>
<el-table-column label="频次" align="center" prop="rateCode_dictText" />
<!-- <el-table-column label="单次剂量" align="center" prop="dose" /> -->
<!-- <el-table-column label="剂量单位" align="center" prop="doseUnitCode_dictText" /> -->
<el-table-column label="注射药品" align="center" prop="injectFlag_enumText" />
<el-table-column label="皮试" align="center" prop="skinTestFlag_enumText" />
<el-table-column label="医保码" align="center" prop="ybNo" />
<!-- <el-table-column label="限制使用标志" align="center" prop="useLimitFlag" /> -->
<el-table-column
label="限制使用范围"
align="center"
:show-overflow-tooltip="true"
prop="useScope"
>
<template #default="scope">
<span v-if="scope.row.useLimitFlag === 1">{{ scope.row.useScope }}</span>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import { nextTick } from 'vue';
import { getAdviceBaseInfo } from './api';
import { throttle } from 'lodash-es';
const props = defineProps({
adviceQueryParams: {
type: Object,
default: '',
},
patientInfo: {
type: Object,
required: true,
},
});
const emit = defineEmits(['selectAdviceBase']);
const total = ref(0);
const adviceBaseRef = ref();
const tableWrapper = ref();
const currentIndex = ref(0); // 当前选中行索引
const currentSelectRow = ref({});
const queryParams = ref({
pageSize: 100,
pageNum: 1,
adviceTypes: '1,2,3'
});
const adviceBaseList = ref([]);
// 节流函数
const throttledGetList = throttle(
() => {
getList();
},
300,
{ leading: true, trailing: true }
);
watch(
() => props.adviceQueryParams,
(newValue) => {
queryParams.value.searchKey = newValue.searchKey;
// queryParams.value.adviceType = newValue.adviceType;
if(newValue.adviceTyp){
queryParams.value.adviceTypes = [newValue.adviceType].join(',');
}
throttledGetList();
},
{ deep: true }
);
getList();
function getList() {
queryParams.value.organizationId = props.patientInfo.orgId;
getAdviceBaseInfo(queryParams.value).then((res) => {
if (res.data.records.length > 0) {
adviceBaseList.value = res.data.records.filter((item) => {
if (item.adviceType == 1 || item.adviceType == 2) {
return handleQuantity(item) != 0;
} else {
return true;
}
});
total.value = res.data.total;
nextTick(() => {
currentIndex.value = 0;
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
});
}
});
}
// 处理键盘事件
const handleKeyDown = (event) => {
const key = event.key;
const data = adviceBaseList.value;
switch (key) {
case 'ArrowUp': // 上箭头
event.preventDefault(); // 阻止默认滚动行为
if (currentIndex.value > 0) {
currentIndex.value--;
setCurrentRow(data[currentIndex.value]);
}
break;
case 'ArrowDown': // 下箭头`
event.preventDefault();
if (currentIndex.value < data.length - 1) {
currentIndex.value++;
setCurrentRow(data[currentIndex.value]);
}
break;
case 'Enter': // 回车键
// const currentRow = adviceBaseRef.value.getSelectionRows();
event.preventDefault();
if (currentSelectRow.value) {
// 这里可以触发自定义逻辑,如弹窗、跳转等
emit('selectAdviceBase', currentSelectRow.value);
}
break;
}
};
function handleQuantity(row) {
if (row.inventoryList && row.inventoryList.length > 0) {
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
return 0;
}
// 设置选中行(带滚动)
const setCurrentRow = (row) => {
adviceBaseRef.value.setCurrentRow(row);
// 滚动到选中行
const tableBody = adviceBaseRef.value.$el.querySelector('.el-table__body-wrapper');
const currentRowEl = adviceBaseRef.value.$el.querySelector('.current-row');
if (tableBody && currentRowEl) {
currentRowEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
};
// 当前行变化时更新索引
const handleCurrentChange = (currentRow) => {
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
currentSelectRow.value = currentRow;
};
function clickRow(row) {
emit('selectAdviceBase', row);
}
defineExpose({
handleKeyDown,
});
</script>
<style scoped>
.popover-table-wrapper:focus {
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
}
</style>

View File

@@ -0,0 +1,652 @@
import request from '@/utils/request'
// 病历相关接口
/**
* 获取患者列表
*/
export function getList(queryParams) {
return request({
url: '/doctor-station/main/patient-info',
method: 'get',
params: queryParams
})
}
/**
* 获取患者历史病历
*/
export function getEmrHistoryList(queryParams) {
return request({
url: '/doctor-station/emr/emr-page',
method: 'get',
params: queryParams
})
}
/**
* 获取病历模板列表
*/
export function getEmrTemplateList(queryParams) {
return request({
url: '/doctor-station/emr/emr-template-page',
method: 'get',
params: queryParams
})
}
/**
* 接诊
*/
export function receiveEncounter(encounterId) {
return request({
url: '/doctor-station/main/receive-encounter?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 暂离
*/
export function leaveEncounter(encounterId) {
return request({
url: '/doctor-station/main/leave-encounter?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 完诊
*/
export function completeEncounter(encounterId) {
return request({
url: '/doctor-station/main/complete-encounter?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 保存病历
*/
export function saveEmr(data) {
return request({
url: '/doctor-station/emr/emr',
method: 'post',
data: data
})
}
/**
* 删除病历模板
*/
export function deleteEmrTemplate(id){
return request({
url: '/doctor-station/emr/emr-template?id=' + id,
method: 'delete',
})
}
/**
* 获取病历详情
*/
export function getEmrDetail(encounterId){
return request({
url: '/doctor-station/emr/emr-detail?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 保存病历模板
*/
export function saveEmrTemplate(data){
return request({
url: '/doctor-station/emr/emr-template',
method: 'post',
data: data
})
}
// 诊断相关接口
/**
* 保存诊断
*/
export function saveDiagnosis(data) {
return request({
url: '/doctor-station/diagnosis/save-doctor-diagnosis',
method: 'post',
data: data
})
}
/**
* 添加诊断绑定
*/
export function saveDiagnosisBind(data) {
return request({
url: '/doctor-station/diagnosis/diagnosis-belong-binding',
method: 'post',
data: data
})
}
/**
* 删除诊断绑定
*/
export function deleteDiagnosisBind(id) {
return request({
url: '/doctor-station/diagnosis/diagnosis-belong-binding?id=' + id,
method: 'delete',
})
}
/**
* 获取诊断定义列表
*/
export function getDiagnosisDefinitionList(queryParams) {
return request({
url: '/doctor-station/diagnosis/condition-definition-metadata',
method: 'get',
params: queryParams
})
}
/**
* 获取诊断分类数据,历史诊断/个人常用诊断/科室常用诊断
*/
export function getConditionDefinitionInfo(patientId) {
return request({
url: '/doctor-station/diagnosis/get-condition-definition-class?patientId=' + patientId,
method: 'get',
})
}
/**
* 获取诊断基础下拉数据
*/
export function diagnosisInit() {
return request({
url: '/doctor-station/diagnosis/init',
method: 'get',
})
}
/**
*
* 获取诊断回显数据
*/
export function getEncounterDiagnosis(encounterId) {
return request({
url: '/doctor-station/diagnosis/get-encounter-diagnosis?encounterId=' + encounterId,
method: 'get',
})
}
/**
*
* 删除就诊诊断
*/
export function delEncounterDiagnosis(conditionId) {
return request({
url: '/doctor-station/diagnosis/encounter-diagnosis?conditionId=' + conditionId,
method: 'delete',
})
}
// 处方相关接口
/**
* 获取药品列表
*/
export function getAdviceBaseInfo(queryParams) {
return request({
url: '/doctor-station/advice/advice-base-info',
method: 'get',
params: queryParams
})
}
/**
* 保存处方(单条)
*/
export function savePrescription(data) {
return request({
url: '/doctor-station/advice/save-advice',
method: 'post',
data: data
})
}
/**
* 签发处方
*/
export function savePrescriptionSign(data) {
return request({
url: '/doctor-station/advice/sign-advice',
method: 'post',
data: data
})
}
/**
* 处方签退
*/
export function singOut(data) {
return request({
url: '/doctor-station/advice/sign-off',
method: 'post',
data: data
})
}
/**
* 获取患者本次就诊处方
*/
export function getPrescriptionList(encounterId) {
return request({
url: '/doctor-station/advice/request-base-info?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 获取科室列表
*/
export function getOrgTree() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
})
}
/**
* 获取退费账单
*/
export function getEncounterPatientPayment(encounterId) {
return request({
url: '/charge-manage/refund/patient-payment?encounterId=' + encounterId,
method: 'get',
})
}
/**
* 申请退费
*/
export function refundPayment(data) {
return request({
url: '/charge-manage/refund/refund-payment',
method: 'post',
data: data
})
}
// 电子处方相关接口
/**
* 电子处方查询
*/
export function getVeriPrescriptionInfo(queryParams) {
return request({
url: '/ybelep-request/get-PrescriptionInfo',
method: 'get',
params: queryParams
})
}
// 处方开立相关接口
/**
* 获取全部药品信息
*/
export function getAllMedicationInfo(queryParams) {
return request({
url: '/doctor-station/elep/get-allMedicationInfo',
method: 'get',
params: queryParams
})
}
// 当返回的list为空时在调用get-allMedicationInfo
export function getAllMedicationUsualInfo(queryParams) {
return request({
url: '/doctor-station/elep/get-allMedicationUsualInfo',
method: 'get',
params: queryParams
})
}
/**
* 电子处方下拉框
*/
export function elepPrescriptionInit() {
return request({
url: '/doctor-station/elep/init',
method: 'get'
})
}
/**
* 获取处方信息
*/
export function getPrescriptionInfo(queryParams) {
return request({
url: '/doctor-station/elep/get-prescriptionInfo',
method: 'get',
params: queryParams
})
}
/**
* 获取药品信息
*/
export function getMedicationInfo(queryParams) {
return request({
url: '/doctor-station/elep/get-medicationInfo',
method: 'get',
params: queryParams
})
}
/**
* 获取单据号
*/
export function prescriptionNoInit() {
return request({
url: '/doctor-station/elep/prescriptionNoInit',
method: 'get'
})
}
/**
* 新增处方
*/
export function savePrescriptionInfo(data) {
return request({
url: '/doctor-station/elep/save-prescriptionInfo',
method: 'post',
data: data
})
}
/**
* 修改处方
*/
export function updatePrescriptionInfo(data) {
return request({
url: '/doctor-station/elep/update-prescriptionInfo',
method: 'post',
data: data
})
}
/**
* 删除处方
*/
export function deletePrescriptionInfo(data) {
return request({
url: '/doctor-station/elep/delete-prescriptionInfo',
method: 'post',
data: data
})
}
/**
* 签发处方
*/
export function issuancePrescription(prescriptionNoList) {
return request({
url: '/doctor-station/elep/issuance-prescription',
method: 'post',
data: prescriptionNoList
})
}
/**
* 获取医嘱历史数据
*/
export function getAdviceHistoryInfo(params) {
return request({
url: '/doctor-station/advice/request-history-info',
method: 'get',
params: params
})
}
/**
* 组合/拆组
*/
export function updateGroupId(data) {
return request({
url: '/doctor-station/advice/update-groupid',
method: 'put',
data: data
})
}
/**
* 组套列表
*/
export function getOrderGroupList(params) {
return request({
url: '/personalization/order-group/order-group',
method: 'get',
params: params
})
}
/**
* 获取费用性质
*/
export function getContract(params) {
return request({
url: '/doctor-station/advice/get-encounter-contract',
method: 'get',
params: params
})
}
/**
* 取得药品最新数据
*/
export function queryYbCatalogue(params) {
return request({
url: '/yb-request/query-yb-catalogue',
method: 'post',
params: params
})
}
/**
* 获取人员慢性病诊断
*/
export function getChronicDisease(params) {
return request({
url: '/yb-request/getConditionDefinition',
method: 'get',
params: params
})
}
/**
* 获取中药列表
*/
export function getTcmMedicine(params) {
return request({
url: '/doctor-station/chinese-medical/tcm-advice-base-info',
method: 'get',
params: params
})
}
/**
* 获取中医诊断
*/
export function getTcmCondition(params) {
return request({
url: '/doctor-station/chinese-medical/condition-info',
method: 'get',
params: params
})
}
/**
* 获取辩证分型
*/
export function getTcmSyndrome(params) {
return request({
url: '/doctor-station/chinese-medical/syndrome-info',
method: 'get',
params: params
})
}
/**
* 获取本次就诊中医诊断
*/
export function getTcmDiagnosis(params) {
return request({
url: '/doctor-station/chinese-medical/get-tcm-encounter-diagnosis',
method: 'get',
params: params
})
}
/**
* 保存中医诊断
*/
export function saveTcmDiagnosis(data) {
return request({
url: '/doctor-station/chinese-medical/save-tcm-diagnosis',
method: 'post',
data: data
})
}
/**
* 保存中医医嘱
*/
export function saveTcmAdvice(data) {
return request({
url: '/doctor-station/chinese-medical/save-tcm-advice',
method: 'post',
data: data
})
}
/**
* 签发中医医嘱
*/
export function signTcmAdvice(data) {
return request({
url: '/doctor-station/chinese-medical/sign-tcm-advice',
method: 'post',
data: data
})
}
/**
* 签退中医医嘱
*/
export function signOutTcmAdvice(data) {
return request({
url: '/doctor-station/chinese-medical/sign-tcm-off',
method: 'post',
data: data
})
}
/**
* 获取本次就诊中医医嘱
*/
export function getTcmAdviceList(params) {
return request({
url: '/doctor-station/chinese-medical/tcm-request-base-info',
method: 'get',
params: params
})
}
/**
* 获取预约记录
*/
export function getReservationInfo(params) {
return request({
url: '/doctor-station/reservation-record/reservation-info',
method: 'get',
params: params
})
}
/**
* 新增预约记录
*/
export function addReservationInfo(data) {
return request({
url: '/doctor-station/reservation-record/save-reservation',
method: 'post',
data: data
})
}
/**
* 修改预约记录
*/
export function editReservationInfo(data) {
return request({
url: '/doctor-station/reservation-record/edit-reservation',
method: 'put',
data: data
})
}
/**
* 删除预约记录
*/
export function delReservationInfo(id) {
return request({
url: '/doctor-station/reservation-record/del-reservation',
method: 'delete',
params: id
})
}
// 查询初期所需数据
export function getInit() {
return request({
url: '/charge-manage/register/init',
method: 'get'
})
}
/**
* 获取科室下拉列表
*/
export function getOrgList() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
})
}
/**
* 查询病区下拉列表
*/
export function wardList(params) {
return request({
url: '/app-common/ward-list',
method: 'get',
params: params
})
}
/**
* 办理入院
*/
export function handleHospitalization(data) {
return request({
url: '/inhospital-charge/register/by-doctor',
method: 'post',
data: data
})
}
/**
* 获取本次就诊处方单
*/
export function getEnPrescriptionInfo(data) {
return request({
url: '/doctor-station/main/prescription-page-info',
method: 'get',
params: data
})
}

View File

@@ -0,0 +1,421 @@
<template>
<el-dialog
title="添加中医诊断"
v-model="props.openAddDiagnosisDialog"
width="1500px"
append-to-body
destroy-on-close
@open="handleOpen"
@close="close"
>
<div class="main-content">
<!-- 左侧疾病选择区 -->
<div class="disease-section">
<div class="section-title">诊断</div>
<div class="search-box">
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
<template #prefix>
<el-icon><search /></el-icon>
</template>
</el-input>
</div>
<el-table
:data="conditionList"
max-height="460"
@row-click="handleClickRow"
highlight-current-row
>
<el-table-column label="疾病名称" align="center" prop="name"></el-table-column>
<el-table-column label="医保编码" align="center" prop="ybNo"></el-table-column>
</el-table>
</div>
<!-- 中间疾病-证型关系区 -->
<div class="syndrome-section">
<div class="section-title">证候</div>
<div class="search-box">
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
<template #prefix>
<el-icon><search /></el-icon>
</template>
</el-input>
</div>
<div v-if="selectedDisease">
<el-table
:data="syndromeList"
max-height="460"
@row-click="clickSyndromeRow"
highlight-current-row
>
<el-table-column label="证候名称" align="center" prop="name"></el-table-column>
<el-table-column label="医保编码" align="center" prop="ybNo"></el-table-column>
</el-table>
</div>
<div class="empty-state" v-else>
<el-empty description="请从左侧选择疾病" />
</div>
</div>
<!-- 右侧诊断详情区 -->
<div class="diagnosis-section">
<div class="section-title">诊断详情</div>
<div class="diagnosis-list">
<div v-for="(item, index) in tcmDiagonsisList" :key="index" class="history-item">
<div class="history-diagnosis">
<div>
<strong>{{ item.conditionName }}</strong> - {{ item.syndromeName }}
</div>
<el-button
size="small"
type="danger"
plain
icon="close"
@click="removeDiagnosis(item, index)"
/>
</div>
</div>
</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import {
getTcmCondition,
getTcmSyndrome,
saveTcmDiagnosis,
} from '@/views/doctorstation/components/api';
const props = defineProps({
openAddDiagnosisDialog: {
type: Boolean,
default: false,
},
patientInfo: {
type: Object,
required: true,
},
});
const conditionList = ref([]);
const syndromeList = ref([]);
const tcmDiagonsisList = ref([]);
const tcmDiagonsisSaveList = ref([]);
const syndromeSelected = ref(false); // 当前诊断是否选择对应证候
const timestamp = ref('');
const selectedDisease = ref(false);
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close']);
function handleOpen() {
getTcmCondition().then((res) => {
conditionList.value = res.data.records;
});
}
// 点击诊断列表处理,点击以后才显示证候列表
function handleClickRow(row) {
if (syndromeSelected.value || tcmDiagonsisList.value == 0) {
selectedDisease.value = true;
syndromeSelected.value = false;
timestamp.value = Date.now();
getTcmSyndrome().then((res) => {
syndromeList.value = res.data.records;
});
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
verificationStatusEnum: 4,
medTypeCode: '11',
});
tcmDiagonsisList.value.push({
conditionName: row.name,
syndromeGroupNo: timestamp.value,
});
}
}
function clickSyndromeRow(row) {
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
});
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
syndromeSelected.value = true;
}
// 删除诊断
function removeDiagnosis(row, index) {
tcmDiagonsisList.value.splice(index, 1);
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.filter((item) => {
return item.syndromeGroupNo !== row.syndromeGroupNo;
});
}
function save() {
saveTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: tcmDiagonsisSaveList.value,
}).then((res) => {
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
}
});
}
function submit() {
if (tcmDiagonsisSaveList.value.length > 0 && syndromeSelected.value) {
save();
} else {
proxy.$modal.msgWarning('请选择证候');
}
}
function close() {
emit('close');
}
</script>
<style scoped>
:deep(.pagination-container .el-pagination) {
right: 20px !important;
}
.app-container {
max-width: 1400px;
margin: 20px auto;
padding: 20px;
background: white;
border-radius: 12px;
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 15px;
border-bottom: 1px solid var(--el-border-color);
margin-bottom: 20px;
}
.header h1 {
color: var(--el-color-primary);
font-size: 24px;
font-weight: 600;
}
.patient-info {
background: var(--el-color-primary-light-9);
padding: 15px;
border-radius: 8px;
margin-bottom: 20px;
}
.patient-info .info-row {
display: flex;
margin-bottom: 8px;
}
.patient-info .info-label {
width: 100px;
color: var(--el-text-color-secondary);
font-weight: 500;
}
.main-content {
display: grid;
grid-template-columns: 1fr 1fr 1.2fr;
gap: 20px;
margin-bottom: 25px;
}
.disease-section,
.syndrome-section,
.diagnosis-section {
border: 1px solid var(--el-border-color);
border-radius: 8px;
padding: 20px;
background: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.section-title {
font-size: 18px;
font-weight: 600;
color: var(--el-color-primary);
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid var(--el-border-color);
}
.disease-list {
max-height: 400px;
overflow-y: auto;
}
.disease-item {
padding: 12px 15px;
border-bottom: 1px solid var(--el-border-color-lighter);
cursor: pointer;
transition: all 0.3s;
border-radius: 4px;
}
.disease-item:hover {
background-color: var(--el-color-primary-light-9);
}
.disease-item.active {
background-color: var(--el-color-primary-light-8);
border-left: 3px solid var(--el-color-primary);
}
.disease-name {
font-weight: 500;
margin-bottom: 5px;
}
.disease-code {
font-size: 12px;
color: var(--el-text-color-secondary);
}
.search-box {
margin-bottom: 15px;
}
.disease-categories {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 15px;
}
.category-tag {
cursor: pointer;
padding: 5px 12px;
border-radius: 15px;
background: var(--el-fill-color-light);
font-size: 13px;
transition: all 0.3s;
}
.category-tag.active {
background: var(--el-color-primary);
color: white;
}
.relation-container {
text-align: center;
padding: 30px 0;
border: 2px dashed var(--el-border-color);
border-radius: 8px;
margin: 20px 0;
background: var(--el-fill-color-lighter);
}
.relation-icon {
margin-bottom: 15px;
color: var(--el-color-primary);
}
.relation-text {
font-size: 18px;
font-weight: 500;
color: var(--el-text-color-primary);
}
.syndrome-details {
padding: 15px;
background: var(--el-color-primary-light-9);
border-radius: 8px;
border: 1px solid var(--el-color-primary-light-5);
}
.detail-item {
margin-bottom: 12px;
}
.detail-label {
font-weight: 500;
color: var(--el-text-color-secondary);
margin-bottom: 3px;
}
.actions {
display: flex;
justify-content: flex-end;
gap: 15px;
padding-top: 20px;
border-top: 1px solid var(--el-border-color);
}
.empty-state {
text-align: center;
padding: 40px 0;
color: var(--el-text-color-secondary);
}
.diagnosis-history {
margin-top: 20px;
border-top: 1px solid var(--el-border-color);
padding-top: 20px;
}
.history-title {
font-size: 16px;
font-weight: 500;
margin-bottom: 12px;
color: var(--el-text-color-primary);
}
.history-item {
padding: 12px;
border-left: 3px solid var(--el-border-color);
margin-bottom: 10px;
background: var(--el-fill-color-lighter);
border-radius: 0 4px 4px 0;
}
.diagnosis-list {
max-height: 520px;
overflow-y: auto;
}
.history-date {
font-size: 12px;
color: var(--el-text-color-secondary);
margin-bottom: 5px;
}
.history-diagnosis {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 5px;
}
.history-note {
font-size: 13px;
color: var(--el-text-color-secondary);
padding-top: 5px;
border-top: 1px dashed var(--el-border-color);
margin-top: 5px;
}
.empty-list {
padding: 20px 0;
text-align: center;
}
</style>

View File

@@ -0,0 +1,551 @@
<template>
<div>
<el-row :gutter="24">
<el-col :span="4" :xs="24">
<el-input
v-model="diagnosis"
placeholder="诊断名称"
clearable
style="width: 100%; margin-bottom: 10px"
@keyup.enter="queryDiagnosisUse"
>
<template #append>
<el-button icon="Search" @click="queryDiagnosisUse" />
</template>
</el-input>
<el-tree
ref="treeRef"
:data="tree"
node-key="id"
:props="{ label: 'name', children: 'children' }"
highlight-current
default-expand-all
:filter-node-method="filterNode"
@node-click="handleNodeClick"
>
<template #default="{ node, data }">
<div class="custom-tree-node">
<span>{{ node.label }}</span>
<span class="tree-node-actions">
<template v-if="node.level === 1 && data.name != '常用' && data.name != '历史'">
<el-button
style="color: #000000"
type="text"
size="small"
@click.stop="addChild(data)"
>
<el-icon><Plus /></el-icon>
</el-button>
</template>
<el-popconfirm
width="200"
:hide-after="10"
title="确认删除此常用诊断吗"
placement="top-start"
@confirm="deleteChild(data)"
>
<template #reference>
<el-button
style="color: #000000"
v-if="
node.level === 2 &&
node.parent.data.name != '常用' &&
node.parent.data.name != '历史'
"
type="text"
size="small"
@click.stop=""
>
<el-icon><Minus /></el-icon>
</el-button>
</template>
</el-popconfirm>
</span>
</div>
</template>
</el-tree>
</el-col>
<el-col :span="20" :xs="24">
<div style="margin-bottom: 10px">
<el-button type="primary" plain @click="handleAddDiagnosis()"> 新增诊断 </el-button>
<el-button type="primary" plain @click="handleSaveDiagnosis()"> 保存诊断 </el-button>
<el-button type="primary" plain @click="handleAddTcmDiagonsis()"> 中医诊断 </el-button>
<el-button type="primary" plain @click="handleImport()"> 导入慢性病诊断 </el-button>
</div>
<el-form :model="form" :rules="rules" ref="formRef">
<el-table ref="diagnosisTableRef" :data="form.diagnosisList" height="650">
<el-table-column label="序号" type="index" width="50" />
<el-table-column label="诊断排序" align="center" prop="diagSrtNo" width="180">
<template #default="scope">
<el-form-item
:prop="`diagnosisList.${scope.$index}.diagSrtNo`"
:rules="rules.diagSrtNo"
>
<el-input-number
v-model="scope.row.diagSrtNo"
controls-position="right"
:controls="false"
style="width: 80px"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="诊断类别" align="center" prop="diagSrtNo" width="180">
<template #default="scope">
<el-form-item
:prop="`diagnosisList.${scope.$index}.medTypeCode`"
:rules="rules.medTypeCode"
>
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
<el-option
v-for="item in med_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="诊断名称" align="center" prop="name">
<template #default="scope">
<el-form-item :prop="`diagnosisList.${scope.$index}.name`" :rules="rules.name">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
trigger="manual"
:width="800"
>
<diagnosislist
:diagnosisSearchkey="diagnosisSearchkey"
@selectDiagnosis="handleSelsectDiagnosis"
/>
<template #reference>
<el-input
v-model="scope.row.name"
placeholder="请选择诊断"
@input="handleChange"
@focus="handleFocus(scope.row, scope.$index)"
@blur="handleBlur(scope.row)"
/>
</template>
</el-popover>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="医保码" align="center" prop="ybNo" width="180" />
<el-table-column label="诊断类型" align="center" prop="maindiseFlag">
<template #default="scope">
<el-checkbox
label="主诊断"
:trueLabel="1"
:falseLabel="0"
v-model="scope.row.maindiseFlag"
border
size="small"
@change="(value) => handleMaindise(value, scope.$index)"
/>
<el-select
v-model="scope.row.verificationStatusEnum"
placeholder=" "
style="width: 40%; padding-bottom: 5px; padding-left: 10px"
size="small"
>
<el-option
v-for="item in diagnosisOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="130">
<template #default="scope">
<el-button
link
type="primary"
@click="handleDeleteDiagnosis(scope.row, scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
</el-col>
</el-row>
<diagnosisdialog
:openDiagnosis="openDiagnosis"
@close="closeDiagnosisDialog"
:radio="orgOrUser"
/>
<AddDiagnosisDialog
:openAddDiagnosisDialog="openAddDiagnosisDialog"
:patientInfo="props.patientInfo"
@close="closeDiagnosisDialog"
/>
</div>
</template>
<script setup>
import { getCurrentInstance } from 'vue';
import {
getConditionDefinitionInfo,
saveDiagnosis,
diagnosisInit,
deleteDiagnosisBind,
getEncounterDiagnosis,
getEmrDetail,
getChronicDisease,
getTcmDiagnosis,
delEncounterDiagnosis,
} from '../api';
import diagnosisdialog from '../diagnosis/diagnosisdialog.vue';
import AddDiagnosisDialog from './addDiagnosisDialog.vue';
import diagnosislist from '../diagnosis/diagnosislist.vue';
// const diagnosisList = ref([]);
const allowAdd = ref(false);
const tree = ref([]);
const openDiagnosis = ref(false);
const openAddDiagnosisDialog = ref(false);
const diagnosisSearchkey = ref('');
const diagnosisOptions = ref([]);
const rowIndex = ref();
const diagnosis = ref();
const orgOrUser = ref();
const form = ref({
diagnosisList: [],
});
const props = defineProps({
patientInfo: {
type: Object,
required: true,
},
});
const emits = defineEmits(['diagnosisSave']);
const { proxy } = getCurrentInstance();
const { med_type } = proxy.useDict('med_type');
const rules = ref({
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
diagSrtNo: [{ required: true, message: '请输入诊断序号', trigger: 'change' }],
});
watch(
() => form.value.diagnosisList,
() => {
emits('diagnosisSave', false);
},
{ deep: true }
);
function getDetail(encounterId) {
getEmrDetail(encounterId).then((res) => {
allowAdd.value = res.data ? true : false;
});
}
function getList() {
getEncounterDiagnosis(props.patientInfo.encounterId).then((res) => {
if (res.code == 200) {
form.value.diagnosisList = res.data;
emits('diagnosisSave', false);
console.log(form.value.diagnosisList);
}
});
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.code == 200) {
if (res.data.illness.length > 0) {
res.data.illness.forEach((item, index) => {
form.value.diagnosisList.push({
name: item.name + '-' + res.data.symptom[index].name,
ybNo: item.ybNo,
medTypeCode: item.medTypeCode,
});
});
}
emits('diagnosisSave', false);
console.log(form.value.diagnosisList);
}
});
getTree();
}
init();
function init() {
diagnosisInit().then((res) => {
if (res.code == 200) {
diagnosisOptions.value = res.data.verificationStatusOptions;
}
});
}
function handleImport() {
if (props.patientInfo.contractName != '自费') {
// 获取患者慢性病信息
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.data.length > 0) {
res.data.forEach((item, index) => {
form.value.diagnosisList.push({
...item,
...{
medTypeCode: '140104',
verificationStatusEnum: 4,
definitionId: item.id,
diagSrtNo: form.value.diagnosisList.length + 1,
iptDiseTypeCode: 2,
diagnosisDesc: '',
},
});
});
}
});
}
}
/**
* 添加子节点
*/
function addChild(data) {
orgOrUser.value = data.name;
openDiagnosis.value = true;
}
/**
* 删除子节点
*/
function deleteChild(data) {
deleteDiagnosisBind(data.id).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('删除成功');
getTree();
}
});
}
watch(diagnosis, (val) => {
proxy.$refs['treeRef'].filter(val);
});
/** 通过条件过滤节点 */
const filterNode = (value, data) => {
console.log('filterNode', value, data);
if (!value) return true;
return data.name.indexOf(value) !== -1;
};
/**
* 获取诊断树列表
*/
function getTree() {
getConditionDefinitionInfo(props.patientInfo ? props.patientInfo.patientId : '').then((res) => {
if (res.code == 200) {
let list = [];
list = res.data.patientHistoryList;
list.children = [];
// 手动构造树列表;
tree.value[0] = {
id: '1',
name: '历史',
children: list,
};
tree.value[1] = {
id: '2',
name: '常用',
children: res.data.doctorCommonUseList,
};
tree.value[2] = {
id: '3',
name: '个人',
children: res.data.userPersonalList,
};
tree.value[3] = {
id: '4',
name: '科室',
children: res.data.organizationList,
};
console.log(tree.value);
}
});
}
/**
* 添加西医诊断
*/
function handleAddDiagnosis() {
proxy.$refs.formRef.validate((valid) => {
if (valid) {
if (!allowAdd.value) {
proxy.$modal.msgWarning('请先填写病历');
return;
}
form.value.diagnosisList.push({
showPopover: false,
name: undefined,
verificationStatusEnum: 4,
medTypeCode: '11',
diagSrtNo: form.value.diagnosisList.length + 1,
iptDiseTypeCode: 2,
diagnosisDesc: '',
});
if (form.value.diagnosisList.length == 1) {
form.value.diagnosisList[0].maindiseFlag = 1;
}
}
});
}
// 添加中医诊断
function handleAddTcmDiagonsis() {
openAddDiagnosisDialog.value = true;
}
/**
* 删除诊断
*/
function handleDeleteDiagnosis(row, index) {
if (row.conditionId) {
delEncounterDiagnosis(row.conditionId).then(() => {
getList();
getTree();
});
} else {
form.value.diagnosisList.splice(index, 1);
}
}
function handleMaindise(value, index) {
if (value == 1) {
let flag = 0;
form.value.diagnosisList.forEach((item) => {
console.log(item);
if (item.maindiseFlag == 1) {
flag++;
}
});
if (flag > 1) {
form.value.diagnosisList[index].maindiseFlag = 0;
proxy.$modal.msgWarning('只能有一条主诊断');
}
}
}
/**
* 保存诊断
*/
function handleSaveDiagnosis() {
proxy.$refs.formRef.validate((valid) => {
if (valid) {
if (form.value.diagnosisList.length == 0) {
proxy.$modal.msgWarning('诊断不能为空');
return false;
} else if (!form.value.diagnosisList.some((diagnosis) => diagnosis.maindiseFlag === 1)) {
proxy.$modal.msgWarning('至少添加一条主诊断');
} else {
saveDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: form.value.diagnosisList,
}).then((res) => {
if (res.code == 200) {
getTree();
getList();
emits('diagnosisSave', false);
proxy.$modal.msgSuccess('诊断已保存');
}
});
}
}
});
}
/**
* 关闭诊断弹窗
*/
function closeDiagnosisDialog(str) {
if (str === 'success') {
proxy.$modal.msgSuccess('操作成功');
}
openAddDiagnosisDialog.value = false;
openDiagnosis.value = false;
getTree();
}
function queryDiagnosisUse(value) {}
function handleChange(value) {
diagnosisSearchkey.value = value;
}
/**
* 选择诊断并赋值到列表
*/
function handleSelsectDiagnosis(row) {
console.log(row);
form.value.diagnosisList[rowIndex.value].ybNo = row.ybNo;
form.value.diagnosisList[rowIndex.value].name = row.name;
form.value.diagnosisList[rowIndex.value].definitionId = row.id;
}
/**获取焦点时 打开列表 */
function handleFocus(row, index) {
rowIndex.value = index;
row.showPopover = true;
}
/**失去焦点时 关闭列表 */
function handleBlur(row) {
row.showPopover = false;
}
function handleNodeClick(data) {
console.log(data.children);
// 检查节点是否为根节点
if (data.children != undefined) {
// 如果是根节点,不执行任何操作
return;
}
if (!allowAdd.value) {
proxy.$modal.msgWarning('请先填写病历');
return;
}
const isDuplicate = form.value.diagnosisList.some(
(diagnosis) => diagnosis.ybNo === data.ybNo || diagnosis.name === data.name
);
if (isDuplicate) {
proxy.$modal.msgWarning('该诊断项已存在');
return;
}
form.value.diagnosisList.push({
ybNo: data.ybNo,
name: data.name,
verificationStatusEnum: 4,
medTypeCode: '11',
diagSrtNo: form.value.diagnosisList.length + 1,
definitionId: data.definitionId,
});
if (form.value.diagnosisList.length == 1) {
form.value.diagnosisList[0].maindiseFlag = 1;
}
}
defineExpose({ getList, getDetail, handleSaveDiagnosis });
</script>
<style lang="scss" scoped>
.el-checkbox.is-bordered.el-checkbox--small {
background-color: #ffffff;
}
.custom-tree-node {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.tree-node-actions {
display: flex;
align-items: center;
}
</style>

View File

@@ -0,0 +1,126 @@
<template>
<el-dialog
:title="title"
v-model="props.openDiagnosis"
width="1000px"
append-to-body
destroy-on-close
@close="close"
>
<div>
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-input
v-model="queryParams.searchKey"
placeholder="诊断名称/拼音码"
clearable
style="width: 50%; margin-bottom: 10px"
@keyup.enter="queryDiagnosisUse"
>
<template #append>
<el-button icon="Search" @click="queryDiagnosisUse" />
</template>
</el-input>
</el-col>
<!-- <el-col :span="12">
<span>使用范围</span>
<el-radio-group v-model="radio">
<el-radio :label="1" size="default">个人</el-radio>
<el-radio :label="2" size="default">科室</el-radio>
</el-radio-group>
</el-col> -->
</el-row>
<el-table
ref="diagnosisDefinitionRef"
:data="diagnosisDefinitionList"
row-key="patientId"
@cell-click="clickRow"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="诊断名称" align="center" prop="name" />
<el-table-column label="医保编码" align="center" prop="ybNo" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { computed } from "vue";
import { getDiagnosisDefinitionList, saveDiagnosisBind } from "../api";
const radio = ref(1);
const props = defineProps({
openDiagnosis: {
type: Boolean,
default: false,
},
radio: {
type: String,
default: '',
},
});
const emit = defineEmits(["close"]);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
});
const diagnosisDefinitionList = ref([]);
const selectRow = ref({});
const title = computed(() => {
return props.radio == "个人" ? "个人常用诊断" : "科室常用诊断";
});
getList();
function getList() {
getDiagnosisDefinitionList(queryParams.value).then((res) => {
diagnosisDefinitionList.value = res.data.records;
total.value = res.data.total;
});
}
function submit() {
saveDiagnosisBind({
definitionId: selectRow.value.id,
definitionName: selectRow.value.name,
bindingEnum: props.radio == "个人" ? 1 : 2,
}).then((res) => {
if (res.code == 200) {
emit("close", "success");
}
});
}
function queryDiagnosisUse() {
getList();
}
function close() {
emit("close");
}
function clickRow(row) {
selectRow.value = row;
}
</script>
<style scoped>
:deep( .pagination-container .el-pagination) {
right: 20px !important;
}
</style>

View File

@@ -0,0 +1,58 @@
<template>
<div>
<el-table
ref="diagnosisDefinitionRef"
:data="diagnosisDefinitionList"
row-key="patientId"
@cell-click="clickRow"
max-height="400"
>
<el-table-column label="诊断名称" align="center" prop="name" />
<el-table-column label="医保编码" align="center" prop="ybNo" />
<el-table-column label="诊断类型" align="center" prop="typeName" width="180"/>
</el-table>
</div>
</template>
<script setup>
import { getDiagnosisDefinitionList } from '../api';
const props = defineProps({
diagnosisSearchkey: {
type: String,
default: '',
},
});
const emit = defineEmits(['selectDiagnosis']);
const total = ref(0);
const queryParams = ref({
pageSize: 1000,
pageNo: 1,
// typeCode: 1,
});
const diagnosisDefinitionList = ref([]);
watch(
() => props.diagnosisSearchkey,
(newValue) => {
queryParams.value.searchKey = newValue;
getList();
},
{ immdiate: true }
);
getList();
function getList() {
getDiagnosisDefinitionList(queryParams.value).then((res) => {
diagnosisDefinitionList.value = res.data.records;
total.value = res.data.total;
});
}
function clickRow(row) {
emit('selectDiagnosis', row);
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,296 @@
<template>
<div style="margin-bottom: 15px">
<el-button type="primary" @click="addEmr()">保存</el-button>
<el-button type="primary" plain @click="handleEmrTemplate()" style="margin-left: 20px">
模板
</el-button>
<el-button type="primary" plain @click="handleSaveTemplate()" style="margin-left: 20px">
另存模板
</el-button>
<el-button type="primary" plain @click="handleEmrHistory()" style="margin-left: 20px">
历史病历
</el-button>
<!-- <el-button type="primary" plain @click="handleReceive()" style="margin-left: 20px">
打印病历
</el-button> -->
</div>
<div style="max-height: 650px; overflow-y: auto; overflow-x: hidden">
<el-form ref="emrRef" :model="form" :rules="rules" label-width="80px">
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="身高" prop="height" style="width: 100%">
<el-input placeholder="" v-model="form.height" class="input-with-bottom-border">
<template #suffix>cm</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="体重" prop="weight" style="width: 100%">
<el-input placeholder="" v-model="form.weight" class="input-with-bottom-border">
<template #suffix>kg</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="体温" prop="temperature" style="width: 100%">
<el-input placeholder="" v-model="form.temperature" class="input-with-bottom-border">
<template #suffix></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="脉搏" prop="pulse" style="width: 100%">
<el-input placeholder="" v-model="form.pulse" class="input-with-bottom-border">
<template #suffix>/</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<!-- <el-col :span="6">
<el-form-item
label="血糖"
prop="chiefComplaint"
style="width: 100%"
>
<el-input placeholder="" class="input-with-bottom-border">
<template #suffix></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="血糖"
prop="chiefComplaint"
style="width: 100%"
>
<el-input placeholder="" class="input-with-bottom-border">
<template #suffix>mmol/L</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="收缩压"
prop="chiefComplaint"
style="width: 100%"
>
<el-input placeholder="" class="input-with-bottom-border">
<template #suffix>mmHg</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="舒张压"
prop="chiefComplaint"
style="width: 100%"
>
<el-input placeholder="" class="input-with-bottom-border">
<template #suffix>mmHg</template>
</el-input>
</el-form-item>
</el-col> -->
</el-row>
<el-row :gutter="24">
<el-col :span="18">
<el-form-item label="主诉" prop="chiefComplaint">
<el-input v-model="form.chiefComplaint" type="textarea" :rows="1" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="发病日期" prop="onsetDate">
<el-date-picker
v-model="form.onsetDate"
type="date"
size="default"
style="width: 100% !important"
placement="bottom"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="现病史" prop="currentIllnessHistory">
<el-input v-model="form.currentIllnessHistory" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="既往史" prop="pastMedicalHistory">
<el-input v-model="form.pastMedicalHistory" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="个人史" prop="menstrualHistory">
<el-input v-model="form.menstrualHistory" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="过敏史" prop="allergyHistory">
<el-input v-model="form.allergyHistory" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="查体" prop="physicalExamination">
<el-input v-model="form.physicalExamination" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="处理" prop="treatment">
<el-input v-model="form.treatment" type="textarea" :rows="2" placeholder="" />
</el-form-item>
<el-form-item label="辅助检查" prop="auxiliaryExamination">
<el-input v-model="form.auxiliaryExamination" type="textarea" :rows="2" placeholder="" />
</el-form-item>
</el-form>
<el-dialog
:title="emrTitle"
v-model="openEmrTemplate"
:width="showDialog == 'emrHistory'?'800px':'600px'"
append-to-body
destroy-on-close
>
<emrTemplate v-if="showDialog == 'emrTemplate'" @selectRow="templateSelect" />
<emrhistory v-if="showDialog == 'emrHistory'" @selectRow="emrHistorySelect" />
<div v-if="showDialog == 'saveTemplate'">
<span> 模板名称 </span>
<el-input
v-model="templateName"
style="width: 260px; margin-top: 10px; margin-right: 20px"
/>
<el-radio-group v-model="radio">
<el-radio-button :label="1">个人</el-radio-button>
<el-radio-button :label="2">科室</el-radio-button>
<el-radio-button :label="3">全院</el-radio-button>
</el-radio-group>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { saveEmr, getEmrDetail, saveEmrTemplate } from '../api';
import emrTemplate from '../emr/emrtemplate.vue';
import emrhistory from '../emr/emrhistory.vue';
const form = ref({});
const emrTitle = ref('');
const radio = ref(1);
const rules = ref({
chiefComplaint: [{ required: true, message: '请输入主诉', trigger: 'blur' }],
});
const emits = defineEmits(['save']);
const { proxy } = getCurrentInstance();
const showDialog = ref('');
const openEmrTemplate = ref(false);
const templateName = ref('');
const props = defineProps({
patientInfo: {
type: Object,
required: true,
},
});
watch(
() => form.value,
() => {
// 如果表单数据有变化,通知父组件保存
emits('save', false);
},
{ deep: true }
);
/**
* 保存病历
*/
function addEmr() {
proxy.$refs['emrRef'].validate((valid) => {
if (valid) {
saveEmr({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
contextJson: form.value,
}).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('病历已保存');
emits('save', true);
}
});
}
});
}
/**
* 病历模板
*/
function handleEmrTemplate() {
emrTitle.value = '病历模板';
showDialog.value = 'emrTemplate';
openEmrTemplate.value = true;
}
/**
* 选择病历模板
*/
function templateSelect(row) {
form.value = row;
}
function emrHistorySelect(row) {
form.value = row;
openEmrTemplate.value = false;
}
/**
* 历史病历
*/
function handleEmrHistory() {
emrTitle.value = '历史病历';
showDialog.value = 'emrHistory';
openEmrTemplate.value = true;
sessionStorage.setItem('patientId', props.patientInfo.patientId);
}
function getDetail(encounterId) {
getEmrDetail(encounterId).then((res) => {
if (res.data) {
form.value = JSON.parse(res.data.contextJson);
// 提交父组件刷新保存装填
emits('save', true);
} else {
form.value = {};
}
});
}
/**
* 保存病历模板
*/
function handleSaveTemplate() {
emrTitle.value = '保存模板';
showDialog.value = 'saveTemplate';
openEmrTemplate.value = true;
}
/**
* 弹窗确认操作,包括保存病历模板/选择病历模板/选择历史病历
*/
function submit() {
switch (showDialog.value) {
case 'saveTemplate':
saveEmrTemplate({
templateName: templateName.value,
useScopeCode: radio.value,
contextJson: form.value,
}).then((res) => {
if (res.code == 200) {
openEmrTemplate.value = false;
proxy.$modal.msgSuccess('保存成功');
}
});
break;
case 'emrTemplate':
openEmrTemplate.value = false;
break;
case 'emrHistory':
break;
}
}
function cancel() {
openEmrTemplate.value = false;
// openDiagnosis.value = false;
}
defineExpose({ getDetail, addEmr });
</script>

View File

@@ -0,0 +1,73 @@
<template>
<div>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd"
>新增
</el-button>
</el-col>
</el-row> -->
<el-table
ref="emrHistoryRef"
:data="emrHistory"
row-key="patientId"
highlight-current-row
@selection-change="handleSelectionChange"
>
<!-- @cell-click="clickRow" -->
<el-table-column type="selection" width="55" />
<el-table-column label="主诉" align="left" prop="name" :show-overflow-tooltip="true"/>
<el-table-column label="时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="80">
<template #default="scope">
<!-- <el-button
link
type="primary"
@click.stop="handelDetail(scope.row)"
>详情
</el-button> -->
<el-button link type="primary" @click.stop="clickRow(scope.row)">复用 </el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup>
import { formatDate, formatDateymd } from '@/utils/index';
import { getEmrHistoryList } from '../api';
const queryParams = ref({
pageNum: 1,
pageSize: 10,
patientId: '',
});
const selectRow = ref({});
const emrHistory = ref([]);
const emits = defineEmits(['selectRow']);
getList();
function getList() {
if (sessionStorage.getItem('patientId')) {
queryParams.value.patientId = sessionStorage.getItem('patientId');
getEmrHistoryList(queryParams.value).then((res) => {
emrHistory.value = res.data.records;
emrHistory.value.map((k) => {
k.name = JSON.parse(k.contextJson).chiefComplaint;
k.createTime = formatDate(k.createTime);
});
});
}
}
function clickRow(row) {
selectRow.value = JSON.parse(row.contextJson);
emits('selectRow', selectRow.value);
}
</script>

View File

@@ -0,0 +1,69 @@
<template>
<div>
<el-table
ref="emrTemplateRef"
:data="emrTemplate"
row-key="id"
highlight-current-row
@cell-click="clickRow"
>
<el-table-column label="模板名称" align="center" prop="templateName" />
<el-table-column label="使用范围" align="center" prop="useScopeCode" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click.stop="handelDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup>
import { getEmrTemplateList, deleteEmrTemplate } from "../api";
const queryParams = ref({});
const emrTemplate = ref([]);
const emrTemplateRef = ref();
const emits = defineEmits(["selectRow"]);
const { proxy } = getCurrentInstance();
const selectRow = ref({});
const props = defineProps({
open: {
type: Boolean,
required: true,
},
});
getList();
function getList() {
queryParams.value.useScopeCode = 1;
getEmrTemplateList(queryParams.value).then((res) => {
emrTemplate.value = res.data.records;
console.log(emrTemplate.value,"emrTemplate.value")
});
}
function clickRow(row) {
console.log(2123);
selectRow.value = JSON.parse(row.contextJson);
emits("selectRow", selectRow.value);
}
function handelDelete(row) {
deleteEmrTemplate(row.id.toString()).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("删除成功");
getList();
}
});
}
</script>

View File

@@ -0,0 +1,885 @@
<template>
<el-dialog
:title="title"
v-model="props.openPrescription"
width="1840px"
append-to-body
destroy-on-close
@open="open"
@close="close"
>
<div>
<el-form :model="infoForm" ref="infoFormRef" :rules="rules">
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="患者ID" prop="patientId" label-width="100">
<el-input
v-model="infoForm.patientId"
placeholder="患者ID"
clearable
style="width: 260px"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="就诊ID" prop="encounterId" label-width="100px">
<el-input
v-model="infoForm.encounterId"
placeholder="就诊ID"
clearable
style="width: 260px"
disabled
/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="处方号:" prop="prescriptionNo" label-width="100px">
<el-input
v-model="form.prescriptionNo"
placeholder="处方号"
clearable
style="width: 260px"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处方类别:" prop="rxTypeCode" label-width="100px">
<el-select v-model="form.rxTypeCode" clearable disabled style="width: 35%">
<el-option
v-for="prescriptionType in prescriptionTypeList"
:key="prescriptionType.value"
:label="prescriptionType.label"
:value="prescriptionType.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row> -->
<el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-form-item label="处方号:" prop="prescriptionNo" label-width="100px">
<el-input v-model="infoForm.prescriptionNo" clearable style="width: 260px" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效天数:" prop="validityDays" label-width="100px">
<el-input-number
:min="1"
:max="3"
controls-position="right"
:controls="false"
v-model.number="infoForm.validityDays"
@input="
(value) => {
if (value > 3) {
infoForm.validityDays = 3;
proxy.$modal.msgWarning('电子处方有效天数最多3天');
}
}
"
clearable
style="width: 260px"
:disabled="title == '查看处方'"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="诊断:" prop="conditionId" label-width="100px">
<el-select
v-model="conditionId"
placeholder="诊断"
style="width: 180px"
:disabled="title == '查看处方'"
>
<el-option
v-for="item in diagnosisList"
:key="item.conditionId"
:label="item.name"
:value="item.conditionId"
/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="延长原因:" prop="extensionReason" label-width="100px">
<el-input
v-model="form.extensionReason"
clearable
style="width: 260px"
:disabled="title == '查看处方'"
/>
</el-form-item>
</el-col> -->
</el-row>
</el-form>
<el-form :model="form" ref="formRef" :rules="rowRules">
<div style="margin-bottom: 5px" v-if="title != '查看处方'">
<el-button type="primary" @click="handleAddPrescription()"> 新增 </el-button>
</div>
<el-table
max-height="650"
ref="prescriptionRef"
:data="form.medicationInfoList"
row-key="id"
border
@row-dblclick="clickMedicineRowDb"
@selection-change="handleSelectionChange"
:selectable="selectable"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="药品名称" align="center" prop="medicationName" width="150">
<template #default="scope">
<template v-if="getRowDisabled(scope.row)">
<el-form-item :prop="`medicationInfoList.${scope.$index}.medicationName`">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
trigger="manual"
:width="1200"
>
<prescriptionMedicineList
:searchKey="medicineSearchKey"
@selectRow="(row) => selectMedRow(scope.row.uniqueKey, row, scope.$index)"
/>
<template #reference>
<el-input
style="width: 96%"
v-model="scope.row.medicationName"
@input="handleChange"
@focus="handleFocus(scope.row, scope.$index)"
/>
<!-- @blur="handleBlur(scope.row)" -->
</template>
</el-popover>
</el-form-item>
</template>
<span v-else>{{ scope.row.medicationName }}</span>
</template>
</el-table-column>
<el-table-column label="药品规格" align="center" prop="" width="100">
<template #default="scope">
<el-form-item :prop="`medicationInfoList.${scope.$index}.drugSpecification`">
<span v-if="!scope.row.isEdit">
{{ scope.row.drugSpecification }}
</span>
<el-input v-else v-model="scope.row.drugSpecification" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="生产厂家" align="center" prop="" width="220">
<template #default="scope">
<el-form-item :prop="`medicationInfoList.${scope.$index}.manufacturerName`">
<el-tooltip :content="scope.row.manufacturerName" placement="top" effect="dark">
<span v-if="!scope.row.isEdit">
{{ scope.row.manufacturerName }}
</span>
<el-input v-else v-model="scope.row.manufacturerName" placeholder="" disabled />
</el-tooltip>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="药品剂量" align="center" prop="" width="80">
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.medDosage`"
:rules="rowRules.medDosage"
>
<span v-if="!scope.row.isEdit">
{{ scope.row.medDosage ? formatNumber(scope.row.medDosage) : '' }}
</span>
<el-input
v-else
v-model="scope.row.medDosage"
placeholder=""
:ref="(el) => setDosageInputRef(el, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="剂量单位" align="center" prop="medDosageUnitCode" width="150">
<template #default="scope">
<el-form-item :prop="`medicationInfoList.${scope.$index}.dose`" style="width: 100%">
<!-- <span v-if="!scope.row.isEdit"> -->
<el-select
v-model="scope.row.medDosageUnitCode"
clearable
filterable
style="width: 100%"
:disabled="!scope.row.isEdit"
@change="
(value) => {
scope.row.unitCode = value;
}
"
>
<el-option
v-for="item in unit_code"
:key="item.value"
:label="item.label"
:value="item.label"
/>
</el-select>
<!-- </span> -->
<!-- <el-select v-else v-model="scope.row.medDosageUnitCode" clearable disabled>
<el-option v-for="category in unit_code" :key="category.value" :label="category.label"
:value="category.value" />
</el-select> -->
<!-- <el-input v-else v-model="scope.row.medDosageUnitCode" placeholder="" disabled /> -->
</el-form-item>
</template>
</el-table-column>
<el-table-column label="使用频次" align="center" prop="medFrequency" width="230">
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.medFrequency`"
:rules="rowRules.medFrequency"
>
<span v-if="!scope.row.isEdit" style="text-align: right">
{{ scope.row.medFrequency_dictText ? scope.row.medFrequency_dictText : '' }}
</span>
<el-select v-else v-model="scope.row.medFrequency" clearable style="width: 200px">
<el-option
v-for="category in elep_rate_code"
:key="category.value"
:label="category.label"
:value="category.value"
/>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="服药时间(开始)"
align="center"
prop="effectiveDoseStart"
width="220"
>
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.effectiveDoseStart`"
:rules="rowRules.effectiveDoseStart"
>
<span v-if="!scope.row.isEdit">{{ parseTime(scope.row.effectiveDoseStart) }}</span>
<el-date-picker
v-else
v-model="scope.row.effectiveDoseStart"
type="datetime"
placeholder="选择日期"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 90%"
@change="calculateEndDate(scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="每次发药供应天数"
align="center"
prop="dispensePerDuration"
width="130"
>
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.dispensePerDuration`"
:rules="rowRules.dispensePerDuration"
>
<span v-if="!scope.row.isEdit">{{ scope.row.dispensePerDuration }}</span>
<el-input
v-else
v-model="scope.row.dispensePerDuration"
clearable
@input="calculateEndDate(scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="服药时间(结束)"
align="center"
prop="effectiveDoseEnd"
width="220"
>
<template #default="scope">
<el-form-item :prop="`medicationInfoList.${scope.$index}.effectiveDoseEnd`">
<span v-if="!scope.row.isEdit">{{ parseTime(scope.row.effectiveDoseEnd) }}</span>
<el-date-picker
v-else
v-model="scope.row.effectiveDoseEnd"
type="datetime"
placeholder="选择日期"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
disabled
style="width: 90%"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="途径" align="center" prop="medRoute" width="140">
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.medRoute`"
:rules="rowRules.medRoute"
>
<span v-if="!scope.row.isEdit">
{{ scope.row.medRoute_dictText }}
</span>
<el-select v-else v-model="scope.row.medRoute" clearable style="width: 110px">
<el-option
v-for="dict in drug_medc_way_code"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="quantity">
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.quantity`"
:rules="rowRules.quantity"
>
<span v-if="!scope.row.isEdit">
{{ scope.row.quantity ? scope.row.quantity : '' }}
</span>
<el-input v-else v-model="scope.row.quantity" placeholder="" clearable />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="medDosageUnitCode" width="150">
<template #default="scope">
<el-form-item
:prop="`medicationInfoList.${scope.$index}.unitCode`"
style="width: 100%"
>
<el-select
v-model="scope.row.unitCode"
clearable
style="width: 100%"
filterable
:disabled="!scope.row.isEdit"
>
<el-option
v-for="item in unit_code"
:key="item.value"
:label="item.label"
:value="item.label"
/>
</el-select>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit" v-if="title != '查看处方'">保存</el-button>
<el-button type="danger" plain @click="deletePrescription()" v-if="title != '查看处方'">
删除
</el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { computed } from 'vue';
// import { calculateQuantityByDays, formatNumber } from '@/utils/his';
import { reactive } from 'vue';
// import { useModal, useDict } from '@/hooks';
import { parseTime, formatNumber } from '@/utils/his';
import { queryYbCatalogue } from './api';
import { debounce } from 'lodash-es';
import {
prescriptionNoInit,
savePrescriptionInfo,
getOrgTree,
updatePrescriptionInfo,
getEncounterDiagnosis,
deletePrescriptionInfo,
getMedicationInfo,
} from './api';
import prescriptionMedicineList from './prescription/prescriptionMedicineList';
const { proxy } = getCurrentInstance();
const radio = ref(1);
const props = defineProps({
openPrescription: {
type: Boolean,
default: false,
},
patient: {
type: Object,
required: true,
},
prescriptionType: {
type: Object,
required: true,
},
title: {
type: String,
required: false,
},
medicationInfo: {
type: Object,
required: true,
},
prescriptionData: {
type: Object,
required: true,
},
});
const { method_code, unit_code, elep_rate_code, distribution_category_code, drug_medc_way_code } =
proxy.useDict(
'method_code',
'unit_code',
'elep_rate_code',
'drug_medc_way_code',
'distribution_category_code'
);
const ids = ref([]); // 存储选择的药品信息行数据
const selectData = ref([]); // 存储选择的药品信息行数据
const single = ref(true);
const multiple = ref(true);
const emit = defineEmits(['close']);
const total = ref(0);
const queryParams = ref({
pageNum: 1,
pageSize: 10,
});
const rowIndex = ref(-1);
const medicineSearchKey = ref('');
const conditionId = ref(undefined);
const selectRow = ref({});
const diagnosisList = ref([]);
const prescriptionTypeList = ref([]);
const form = reactive({
medicationInfoList: [],
});
const infoForm = reactive({
patientId: '', // 患者
encounterId: '', // 就诊id
prescriptionNo: '', // 处方号
rxTypeCode: 1, // 处方类型编码
validityDays: 1, // 有效天数
extensionReason: '', // 延长原因
});
const formRef = ref(null);
const data = reactive({
isEdit: false,
isAdding: true,
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined, // 供应商名称
busNo: undefined, // 编码
statusEnum: undefined, // 状态
supplierId: undefined, // 供应商ID
applyTimeStart: undefined, // 申请时间开始
practitionerId: undefined, // 经手人ID
},
rules: {
practitionerId: [{ required: true, message: '请选择经手人', trigger: 'change' }],
supplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
purposeTypeEnum: [{ required: true, message: '请选择仓库类型', trigger: 'change' }],
medicationType: [{ required: true, message: '请选择药品类型', trigger: 'change' }],
},
rowRules: {
medDosage: [{ required: true, message: '药品剂量不能为空', trigger: 'blur' }],
medFrequency: [{ required: true, message: '使用频次不能为空', trigger: 'change' }],
effectiveDoseStart: [{ required: true, message: '服药时间(开始)不能为空', trigger: 'blur' }],
dispensePerDuration: [{ required: true, message: '每次发药供应天数不能为空', trigger: 'blur' }],
medRoute: [{ required: true, message: '途径不能为空', trigger: 'blur' }],
quantity: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
},
});
const { rules, rowRules } = toRefs(data);
const prescriptionInfo = ref({});
const totalMedication = ref(0);
const queryMedicationParams = ref({
pageNo: 1,
pageSize: 10,
prescriptionNo: undefined, // 处方号
});
const dosageInputRefs = ref([]);
const title = ref('');
const unitMap = ref({
dose: 'dose',
minUnit: 'minUnit',
unit: 'unit',
});
function open() {
conditionId.value = props.prescriptionData.conditionId;
getDiagnosisInfo();
}
/**
* 取得处方号
*/
function getPrescriptionNoInit() {
reset();
title.value = '';
title.value = props.title;
console.log(props, 'props', title.value);
prescriptionTypeList.value = props.prescriptionType;
console.log(prescriptionTypeList.value, 'prescriptionTypeList');
infoForm.patientId = props.patient.patientId;
infoForm.encounterId = props.patient.encounterId;
infoForm.validityDays = props.prescriptionData.validityDays;
infoForm.extensionReason = props.prescriptionData.extensionReason;
if (title.value != '新增处方') {
form.rxTypeCode = props.prescriptionData.rxTypeCode;
infoForm.prescriptionNo = props.prescriptionData.prescriptionNo;
}
console.log(infoForm.prescriptionNo, 'infoForm.prescriptionNo', props.prescriptionData);
// prescriptionInfo.value = props.prescriptionData;
if (title.value === '新增处方') {
prescriptionNoInit().then((res) => {
infoForm.prescriptionNo = res.data;
console.log(props, 'props', res, 'res', 'form', form.value);
});
}
form.medicationInfoList = props.medicationInfo;
}
function getDiagnosisInfo() {
getEncounterDiagnosis(props.patient.encounterId).then((res) => {
diagnosisList.value = res.data;
let diagnosisInfo = diagnosisList.value.filter((item) => {
return item.maindiseFlag == 1;
});
diagnosisInfo.value = diagnosisInfo[0];
if (title.value === '新增处方') {
conditionId.value = diagnosisInfo[0].conditionId;
}
});
}
/**
* 计算用药信息的结束日期
*
* @param index 用药信息在数组中的索引
*/
const calculateEndDate = (index) => {
const item = form.medicationInfoList[index];
if (item.effectiveDoseStart && item.dispensePerDuration) {
const startDate = new Date(item.effectiveDoseStart);
const duration = parseInt(item.dispensePerDuration, 10);
const endDate = new Date(startDate);
endDate.setDate(startDate.getDate() + duration);
// 使用本地时间格式化而不是ISO格式
item.effectiveDoseEnd = formatLocalDateTime(endDate);
}
};
// 辅助函数格式化本地时间为YYYY-MM-DD HH:mm:ss
function formatLocalDateTime(date) {
const pad = (num) => num.toString().padStart(2, '0');
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(
date.getHours()
)}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
}
/**
* 新增处方按钮操作
*/
function handleAddPrescription() {
console.log('handleAddPrescription新增处方按钮操作');
if (form.medicationInfoList.length == 5) {
proxy.$modal.msgWarning('一张处方最多包含5种药');
return;
}
form.medicationInfoList.unshift({
// rowKey: nextId.value++,
showPopover: false,
check: false,
isEdit: true,
statusEnum: 1,
disabled: true,
});
// selectable();
}
function getRowDisabled(row) {
return row.isEdit;
}
function handleFocus(row, index) {
rowIndex.value = index;
row.showPopover = true;
}
function handleChange(value) {
// adviceQueryParams.value.searchKey = value;
medicineSearchKey.value = value;
// medicationId
}
function handleBlur(row) {
// 只有非选择操作时才关闭
if (!row.medicationName) {
row.showPopover = false;
}
}
function setDosageInputRef(el, index) {
dosageInputRefs.value[index] = el;
}
/**
* 选择药品
*/
function selectMedRow(key, row, index) {
const data = {
...form.medicationInfoList[rowIndex.value],
...JSON.parse(JSON.stringify(row)),
};
form.medicationInfoList[rowIndex.value] = data;
form.medicationInfoList[rowIndex.value].medicationId = row.medicalCatalogCode;
form.medicationInfoList[rowIndex.value].medicationName = row.registeredName;
// form.medicationInfoList[rowIndex.value].unitCode = row.minPackageUnit;
form.medicationInfoList[rowIndex.value].medDosageUnitCode = row.minPreparationUnit;
form.medicationInfoList[rowIndex.value].unitCode = row.minPreparationUnit;
form.medicationInfoList[rowIndex.value].version = row.version;
proxy.$nextTick(() => {
form.medicationInfoList[rowIndex.value].showPopover = false;
const param = {
hilistCode: row.medicalCatalogCode,
dateStr: '2020-01-01',
};
// 医保目录信息查询
queryYbCatalogue(param).then((res) => {
const list = res.data;
// 有效标志为0的列表
// const valiFlagList = list.filter((item) => item.valiFlag == '0');
// 按开始日期升序排序,取第一个元素作为结果
const item = list.sort((a, b) => {
return new Date(b.begndate) - new Date(a.begndate);
});
//debugger
if (item.length > 0) {
if (item[0].medChrgitmType != '11' && item[0].medChrgitmType != '09') {
form.medicationInfoList.shift();
proxy.$modal.msgWarning('请选择西药或中成药');
} else {
if (item[0].medChrgitmType == '11') {
form.medicationInfoList[rowIndex.value].rxItemTypeCode = 12;
} else if (item[0].medChrgitmType == '09') {
form.medicationInfoList[rowIndex.value].rxItemTypeCode = 11;
}
form.medicationInfoList[rowIndex.value].rxTypeCode = 1;
}
} else {
form.medicationInfoList.shift();
proxy.$modal.msgWarning('此药品已停供');
}
console.log(res, 'queryYbCatalogue医保目录信息查询');
// 处方类别为医保信息的医疗收费项目类别
// const unitMap = res.data.unitMap;
// form.medicationInfoList[rowIndex.value].minUnit = unitMap['minUnit']; // 最小包装单位
// form.medicationInfoList[rowIndex.value].dose = unitMap['dose']; // 剂量单位
// form.medicationInfoList[rowIndex.value].unit = unitMap['unit']; // 单位
});
});
form.medicationInfoList[rowIndex.value].showPopover = false;
// 聚焦到药品剂量输入框
setTimeout(() => {
if (dosageInputRefs.value[index]) {
dosageInputRefs.value[index].focus();
dosageInputRefs.value[index].select(); // 可选:选中文本
}
}, 50); // 小延迟确保DOM完全更新
}
/**
* 保存处方
*/
function submit() {
if (!infoForm.validityDays) {
proxy.$modal.msgWarning('请填写有效期天数!');
return;
}
console.log(form, 'form, prescriptionList.value新增处方');
if (form.medicationInfoList.length == 0) {
proxy.$modal.msgWarning('请选择药品!');
return;
}
// console.log(row, ' 保存处方row 1234567890');
// 新增的药品信息调用新增接口
formRef.value.validate((valid, fields) => {
console.log('验证结果:', valid);
console.log('失败字段:', fields);
if (valid) {
console.log(' 新增处方updateParam');
console.log(form.medicationInfoList);
const updateParam = {
patientId: infoForm.patientId,
encounterId: infoForm.encounterId,
prescriptionNo: infoForm.prescriptionNo,
conditionId: conditionId.value,
// rxTypeCode: infoForm.rxTypeCode,
validityDays: infoForm.validityDays,
extensionReason: infoForm.extensionReason,
medicationInfoList: form.medicationInfoList,
};
savePrescriptionInfo(updateParam).then((res) => {
if (res.code == 200) {
emit('close', 'success');
reset();
}
});
}
});
}
/**
* 双击药品行
*/
function clickMedicineRowDb(row) {
if (title.value == '查看处方') {
row.isEdit = false;
} else {
row.isEdit = true;
}
}
/** 选择条数 */
function handleSelectionChange(selection) {
console.log(selection, 'selection');
selectData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
// prescriptionNos.value = selection.map((item) => item.prescriptionNo);
ids.value = selection
.filter((item) => item.id != null && item.id !== '') // 筛选 id 不为空的项
.map((item) => item.id); // 提取 id 值
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/**
* @description 判断某行是否可选
*/
function selectable(row, index) {
// 返回 true 表示该行可选,返回 false 表示该行不可选
console.log(row, 'selectable', rowIndex.value);
return row.id == '' || row.id == null || row.id === undefined ? false : true;
}
/**
* 删除处方/药品信息
*
* @param index - 要删除的处方在列表中的索引
*/
function deletePrescription(index) {
console.log(ids.value.length, 'ids.value', form.medicationInfoList);
if (selectData.value.length == 0) {
console.log('eeeeeeeeeeeeeeeeeeeeee');
proxy.$modal.msgWarning('请选择要删除的数据信息!');
return;
}
// 药品信息有值但是ids没有值时说明是新增的药品信息直接过滤掉即可。
if (selectData.value.length > 0 && ids.value.length == 0) {
console.log('=======================');
proxy.$modal
.confirm('是否确认删除以上数据!')
.then(function () {
form.medicationInfoList = form.medicationInfoList.filter(
(item) => item.id != '' && item.id !== null && item.id !== undefined
);
})
.catch(() => {});
return;
}
const data = {
idList: ids.value,
prescriptionNoList: [],
};
console.log('deletePrescription删除', data);
proxy.$modal
.confirm('是否确认删除以上数据!')
.then(function () {
form.medicationInfoList = form.medicationInfoList.filter(
(item) => item.id != '' && item.id !== null && item.id !== undefined
);
console.log('rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr');
return deletePrescriptionInfo(data);
})
.then(() => {
// if (prescriptionNos.value.length > 0) {
// getList();
// }
queryMedicationParams.value.prescriptionNo = infoForm.prescriptionNo;
console.log(
queryMedicationParams.value.prescriptionNo,
'rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrdddddddddddddddddddwwwwwwwwwwwwwww'
);
getMedicationInfo(queryMedicationParams.value).then((response) => {
console.log('shanchuhouchaxun', response);
form.medicationInfoList = response.data.records;
infoForm.conditionId = form.medicationInfoList[0].conditionId;
form.medicationInfoList.forEach((medicationInfo) => {
medicationInfo.isEdit = false;
});
console.log(response, '处方详细的药品信息', form.medicationInfoList);
});
// if (res.code == 200) {
// emit('close', 'success');
// reset();
// }
proxy.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
function close() {
reset();
emit('close');
}
function reset() {
form.medicationInfoList = [];
infoForm.patientId = '';
infoForm.encounterId = '';
infoForm.prescriptionNo = '';
infoForm.rxTypeCode = 1;
infoForm.validityDays = 1;
infoForm.extensionReason = '';
}
defineExpose({
getPrescriptionNoInit,
});
</script>
<style scoped>
:deep(.pagination-container .el-pagination) {
right: 20px !important;
}
::v-deep .el-table .cell {
display: flex;
align-items: center; /* 垂直居中对齐 */
}
::v-deep .el-table td {
vertical-align: middle !important;
}
</style>

View File

@@ -0,0 +1,604 @@
<template>
<div style="width: 100%; padding-bottom: 20px">
<div style="margin-bottom: 5px">
<el-button type="primary" @click="handleAddPrescription()" :disabled="selectDataStatus == 2">
新增处方
</el-button>
<el-button type="primary" @click="handleSave()" :disabled="false"> 签发 </el-button>
<el-button type="danger" plain @click="deletePrescription()" :disabled="false">
删除
</el-button>
</div>
<div>处方信息</div>
<el-table
max-height="650"
ref="eprescriptionRef"
:data="prescriptionList"
row-key="prescriptionNo"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" :selectable="selectable" />
<el-table-column label="处方号" align="center" prop="prescriptionNo" width="200" sortable>
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.prescriptionNo }}
</span>
</template>
</el-table-column>
<el-table-column label="门诊号" align="center" prop="iptOtpNo">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.iptOtpNo }}
</span>
</template>
</el-table-column>
<el-table-column label="病区" align="center" prop="departmentWard">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.departmentWard }}
</span>
</template>
</el-table-column>
<el-table-column label="有效天数" align="center" prop="validityDays" width="80">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.validityDays }}
</span>
<el-input-number
v-else
:min="0"
controls-position="right"
:controls="false"
v-model="scope.row.validityDays"
placeholder=""
@input="handleValidityDaysChange(scope.$index, $event)"
style="width: 90%"
/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="statusEnum_enumText" width="80">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.statusEnum_enumText }}
</span>
</template>
</el-table-column>
<el-table-column
label="开方医师"
align="center"
prop="practitionerName"
header-align="center"
width="90"
>
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.practitionerName }}
</span>
</template>
</el-table-column>
<el-table-column label="处方开立日期" align="center" prop="prscTime" width="170">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ parseTime(scope.row.prscTime) }}
</span>
</template>
</el-table-column>
<el-table-column label="取药状态" align="center" prop="medStatus" width="80">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.medStatus }}
</span>
</template>
</el-table-column>
<el-table-column label="延长原因" align="center" prop="extensionReason">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.extensionReason }}
</span>
<el-input v-model="scope.row.extensionReason" placeholder="" v-else />
</template>
</el-table-column>
<el-table-column label="撤销原因" align="center" prop="quashReason">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.quashReason }}
</span>
</template>
</el-table-column>
<el-table-column label="诊断" align="center" prop="conditionName">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.conditionName }}
</span>
</template>
</el-table-column>
<!-- <el-table-column label="处方类别" align="center" prop="rxTypeCode">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.rxTypeCode_enumText }}
</span>
<el-form-item
v-else
:prop="'prescriptionList.' + scope.$index + '.rxTypeCode'"
:rules="rules.rxTypeCode"
>
<el-select v-model="scope.row.rxTypeCode" clearable>
<el-option
v-for="prescriptionType in prescriptionTypeList"
:key="prescriptionType.value"
:label="prescriptionType.label"
:value="prescriptionType.value"
/>
</el-select>
</el-form-item>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="220" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
<el-button
link
type="primary"
icon="Edit"
@click="handleEdit(scope.row)"
:disabled="scope.row.statusEnum == 2 || scope.row.statusEnum == 3"
>编辑</el-button
>
<el-button
link
type="primary"
icon="Plus"
@click="savePrescriptionData(scope.row, scope.$index)"
:disabled="!scope.row.isEdit"
>保存</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
style="margin-bottom: 5px"
/>
<eprescriptiondialog
ref="prescriptionDialogRef"
:openPrescription="openPrescription"
:patient="props.patientInfo"
:prescriptionType="prescriptionTypeList"
:medicationInfo="medicationInfoList"
:prescriptionData="prescriptionInfo"
:title="title"
@close="closePrescriptionDialog"
/>
</div>
</template>
<script setup>
import {
elepPrescriptionInit,
getEncounterDiagnosis,
getPrescriptionList,
getOrgTree,
getPrescriptionInfo,
updatePrescriptionInfo,
getMedicationInfo,
deletePrescriptionInfo,
issuancePrescription,
} from './api';
import eprescriptiondialog from './eprescriptiondialog.vue';
import { getCurrentInstance } from 'vue';
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
patientId: undefined, // 门诊号/姓名
});
const totalMedication = ref(0);
const queryMedicationParams = ref({
pageNo: 1,
pageSize: 10,
prescriptionNo: undefined, // 处方号
});
const prescriptionNoTemp = ref(undefined);
const dateRange = ref([]);
const openPrescription = ref(false);
const prescriptionList = ref([]);
const selectDataStatus = ref(0); // 选中数据的状态
const medicationInfoList = ref([]);
const form = ref({});
const eprescriptionFormRef = ref(null);
const title = ref('');
const prescriptionform = ref({});
const selectCurData = ref({});
const selectDataList = ref({});
const rowIndex = ref(-1);
const nextId = ref(1);
const unitCodeList = ref([]);
const organization = ref([]);
const clickTimer = ref(null);
const prescriptionDialogRef = ref();
// const rules = ref({
// // validityDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
// // extensionReason: [{ required: true, message: '延长原因不能为空', trigger: 'blur' }],
// });
const rules = ref({
validityDays: [
{ required: true, message: '有效天数不能为空', trigger: 'blur' },
{ type: 'number', message: '必须为数字值', transform: (value) => Number(value) },
{ type: 'number', min: 1, max: 30, message: '有效天数应在1-30之间' },
],
extensionReason: [
{ required: true, message: '延长原因不能为空', trigger: 'blur' },
{ min: 5, max: 100, message: '长度在5到100个字符' },
],
});
const unitMap = ref({
dose: 'dose',
minUnit: 'minUnit',
unit: 'unit',
});
const buttonDisabled = computed(() => {
return !props.patientInfo;
});
const props = defineProps({
patientInfo: {
type: Object,
required: true,
},
});
const isAdding = ref(false);
const eprescriptionRef = ref();
const prescriptionInfo = ref({});
const prescriptionTypeList = ref([]);
const { proxy } = getCurrentInstance();
const { method_code, unit_code, rate_code, distribution_category_code } = proxy.useDict(
'method_code',
'unit_code',
'rate_code',
'distribution_category_code'
);
const ids = ref([]); // 存储选择的药品信息行数据
const prescriptionNos = ref([]); // 存储选择的处方行数据
const single = ref(true);
const multiple = ref(true);
const handleValidityDaysChange = (index, value) => {
// 确保存储的是数字类型
prescriptionList.value[index].validityDays = Number(value) || null;
// 手动触发验证
nextTick(() => {
eprescriptionFormRef.value.validateField(`prescriptionList.${index}.validityDays`);
});
};
// getList();
getElepPrescriptionInit();
/** 处方信息取得 */
function getList() {
console.log(
queryParams.value,
'queryParams.value电子处方',
props.patientInfo,
'props.patientInfo'
);
prescriptionList.value = [];
medicationInfoList.value = [];
prescriptionNoTemp.value = undefined;
queryParams.value.patientId = props.patientInfo.patientId;
console.log(queryParams.value, 'queryParams.value电子处方');
getPrescriptionInfo(queryParams.value).then((res) => {
prescriptionList.value = res.data.records;
console.log(res, '电子处方列表');
total.value = res.data.total;
});
}
/** 电子处方下拉选取得 */
function getElepPrescriptionInit() {
elepPrescriptionInit().then((res) => {
prescriptionTypeList.value = res.data.rxTypeCodeListOptions;
console.log(res, '电子处方下拉框');
});
}
/** 选择条数 */
function handleSelectionChange(selection) {
console.log(selection, 'selection');
selectDataList.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
prescriptionNos.value = selection.map((item) => item.prescriptionNo);
ids.value = selection
.filter((item) => item.id != null && item.id !== '') // 筛选 id 不为空的项
.map((item) => item.id); // 提取 id 值
single.value = selection.length != 1;
multiple.value = !selection.length;
}
function getRowDisabled(row) {
return row.isEdit;
}
/**
* 新增处方按钮操作
*/
function handleAddPrescription() {
console.log('handleAddPrescription新增处方按钮操作', prescriptionNoTemp.value);
title.value = '新增处方';
openPrescriptionDialog();
}
/**
* @description 判断某行是否可选
*/
function selectable(row, index) {
// 返回 true 表示该行可选,返回 false 表示该行不可选
// console.log(row, 'selectable', rowIndex.value);
return row.statusEnum !== 2;
}
/**
* 单击行显示处方详细的药品信息
*/
function handleView(row) {
// reset();
title.value = '查看处方';
open.value = true;
queryMedicationParams.value.prescriptionNo = row.prescriptionNo;
prescriptionNoTemp.value = JSON.stringify(row.prescriptionNo);
prescriptionInfo.value.validityDays = row.validityDays;
prescriptionInfo.value.extensionReason = row.extensionReason;
prescriptionInfo.value.rxTypeCode = row.rxTypeCode;
prescriptionInfo.value.prescriptionNo = row.prescriptionNo;
console.log(queryMedicationParams.value, '处方详细的药品信息参数', row.prescriptionNo);
getMedicationInfo(queryMedicationParams.value).then((response) => {
medicationInfoList.value = response.data.records;
medicationInfoList.value.forEach((medicationInfo) => {
medicationInfo.isEdit = false;
});
prescriptionInfo.value.conditionId = response.data.records[0].conditionId;
openPrescriptionDialog();
console.log(response, '处方详细的药品信息', medicationInfoList.value);
});
}
/**
* 单击行显示处方详细的药品信息
*/
function handleEdit(row) {
title.value = '编辑处方';
open.value = true;
queryMedicationParams.value.prescriptionNo = row.prescriptionNo;
prescriptionNoTemp.value = JSON.stringify(row.prescriptionNo);
prescriptionInfo.value.validityDays = row.validityDays;
prescriptionInfo.value.extensionReason = row.extensionReason;
prescriptionInfo.value.rxTypeCode = row.rxTypeCode;
prescriptionInfo.value.prescriptionNo = row.prescriptionNo;
console.log(queryMedicationParams.value, '处方详细的药品信息参数', row.prescriptionNo);
getMedicationInfo(queryMedicationParams.value).then((response) => {
medicationInfoList.value = response.data.records;
medicationInfoList.value.forEach((medicationInfo) => {
medicationInfo.isEdit = false;
});
prescriptionInfo.value.conditionId = response.data.records[0].conditionId;
openPrescriptionDialog();
console.log(response, '处方详细的药品信息', medicationInfoList.value);
});
}
/**
* 双击处方行
*/
function clickPrescriptionRow(row) {
clearTimeout(clickTimer.value);
if (row.statusEnum === 2) {
row.isEdit = false;
proxy.$modal.msgWarning('当前处方已签发,不可编辑');
return;
} else {
row.isEdit = true;
}
}
/**
* 打开新增处方弹窗
*/
function openPrescriptionDialog() {
openPrescription.value = true;
nextTick(() => {
proxy.$refs['prescriptionDialogRef'].getPrescriptionNoInit();
});
console.log(openPrescription.value, '打开新增处方弹窗');
}
/**
* 关闭新增处方弹窗
*/
function closePrescriptionDialog(str) {
if (str === 'success') {
// getList();
proxy.$modal.msgSuccess('操作成功');
}
getList();
openPrescription.value = false;
}
/**
* 保存处方
*/
async function savePrescriptionData(row, index) {
// try {
// // 验证特定字段
// await eprescriptionFormRef.value.validateField([
// `prescriptionList.${index}.validityDays`,
// `prescriptionList.${index}.extensionReason`,
// ]);
if (!row.validityDays) {
proxy.$modal.msgWarning('请填写有效期天数!');
return;
}
// 校验通过
const updateParam = {
prescriptionNo: row.prescriptionNo,
validityDays: row.validityDays,
extensionReason: row.extensionReason,
rxTypeCode: row.rxTypeCode,
};
console.log(updateParam, ' 保存处方updateParam');
updatePrescriptionInfo(updateParam).then((response) => {
if (response.code == 200) {
console.log(response, '保存成功');
proxy.$modal.msgSuccess('保存成功');
getList();
} else {
proxy.$modal.console.error(response.msg);
}
});
// } catch (error) {
// console.log('验证失败:', error);
// // 验证失败,不执行保存
// }
}
/**
* 签发处方
*/
function handleSave() {
if (prescriptionNos.value.length == 0) {
proxy.$modal.msgWarning('请选择想要签发的处方');
return;
}
const checkList = selectDataList.value
.filter((item) => item.statusEnum === 2) // 筛选 id 不为空的项
.map((item) => ({ ...item })); //
if (checkList.length > 0) {
proxy.$modal.msgWarning('选择的处方中包含已签发处方');
return;
}
const prescriptionNoList = prescriptionNos.value;
issuancePrescription(prescriptionNoList).then((res) => {
if (res.code === 200) {
proxy.$modal.msgSuccess('签发成功');
getList();
// nextId.value == 1;
}
});
}
// 删除处方
/**
* 删除处方/药品信息
*
* @param index - 要删除的处方在列表中的索引
*/
function deletePrescription(index) {
const prescriptionNo = prescriptionNoTemp.value;
if (ids.value.length == 0 && prescriptionNos.value.length == 0) {
proxy.$modal.msgWarning('请选择要删除的数据信息!');
return;
}
const data = {
idList: ids.value,
prescriptionNoList: prescriptionNos.value,
};
console.log('deletePrescription删除', data);
proxy.$modal
.confirm('是否确认删除以上数据!')
.then(function () {
return deletePrescriptionInfo(data);
})
.then(() => {
if (prescriptionNos.value.length > 0) {
getList();
}
// if (ids.value.length > 0) {
// queryMedicationParams.value.prescriptionNo = prescriptionNo;
// getMedicationInfo(queryMedicationParams.value).then((response) => {
// form.value.medicationInfoList = response.data.records;
// form.value.medicationInfoList.forEach((medicationInfo) => {
// medicationInfo.isEdit = false;
// });
// console.log(response, '处方详细的药品信息', form.value.medicationInfoList);
// totalMedication.value = response.data.total;
// });
// }
proxy.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
defineExpose({ getList });
</script>
<style lang="scss" scoped>
:deep(.el-table__expand-icon) {
display: none !important;
}
.medicine-title {
font-size: 16px;
font-weight: 600;
min-width: 280px;
display: inline-block;
}
.total-amount {
font-size: 16px;
font-weight: 600;
color: #409eff;
white-space: nowrap;
}
.medicine-info {
font-size: 15px;
font-weight: 600;
color: #606266;
white-space: nowrap;
}
.form-group {
display: flex;
align-items: center;
gap: 8px;
background: #fff;
padding: 6px 10px;
border-radius: 4px;
border: 1px solid #ebeef5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
/* 调整element组件默认间距 */
// .el-select,
// .el-input-number {
// margin-right: 0 !important;
// }
.el-input-number .el-input__inner {
text-align: center;
}
.el-table__cell .el-form-item--default {
margin-bottom: 0px;
}
.el-table {
overflow: visible !important;
/* 允许内容溢出 */
}
.el-table__body-wrapper {
overflow: visible !important;
}
</style>

View File

@@ -0,0 +1,323 @@
<template>
<el-dialog
title="住院登记"
v-model="props.open"
width="1000px"
append-to-body
destroy-on-close
@close="close"
@open="openDialog"
>
<div class="operate">
<div>患者信息</div>
</div>
<el-row>
<el-col :span="2" class="descriptions-item-label">
<el-text truncated>患者姓名</el-text>
</el-col>
<el-col :span="3" class="patInfo-value">
<el-text truncated>{{ patientInfo.patientName }}</el-text>
</el-col>
<el-col :span="2" class="descriptions-item-label">
<el-text truncated>年龄</el-text>
</el-col>
<el-col :span="3" class="patInfo-value">
<el-text truncated>{{ patientInfo.age }}</el-text>
</el-col>
<el-col :span="2" class="descriptions-item-label">
<el-text truncated>性别</el-text>
</el-col>
<el-col :span="3" class="patInfo-value">
<el-text truncated>{{ patientInfo.genderEnum_enumText }}</el-text>
</el-col>
<el-col :span="2" class="descriptions-item-label">
<el-text truncated>费用性质</el-text>
</el-col>
<el-col :span="3" class="patInfo-value">
<el-text truncated>{{ patientInfo.contractName }}</el-text>
</el-col>
</el-row>
<div class="operate">
<div>住院信息</div>
</div>
<el-form
class="register-from"
:model="submitForm"
style="padding-left: 8px"
ref="registerRef"
label-width="80px"
:rules="rules"
>
<el-row :gutter="8">
<el-col :span="6">
<el-form-item label="入院科室" prop="inHospitalOrgId">
<el-tree-select
clearable
style="width: 100%"
v-model="submitForm.inHospitalOrgId"
filterable
:data="organization"
:props="{
value: 'id',
label: 'name',
children: 'children',
}"
value-key="id"
check-strictly
:check-strictly-except-leaf="false"
:default-expand-all="true"
placeholder="请选择入院科室"
@change="handleChange"
@node-click="handleNodeClick"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="入院病区" prop="wardLocationId">
<el-select v-model="submitForm.wardLocationId">
<el-option
v-for="item in wardListOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<template #empty>
<div>请先选择入院科室</div>
</template>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="患者病情">
<el-select v-model="submitForm.priorityEnum">
<el-option
v-for="item in priorityLevelOptionOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="6">
<el-form-item label="入院类型" prop="admitSourceCode">
<el-select v-model="submitForm.admitSourceCode">
<el-option
v-for="item in admit_source_code"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="入院方式" prop="inWayCode">
<el-select v-model="submitForm.inWayCode">
<el-option
v-for="item in in_way_code"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
-->
</el-row>
<el-row :gutter="8">
<el-col :span="6">
<el-form-item label="诊断类别" prop="medTypeCode">
<el-select
v-model="submitForm.medTypeCode"
placeholder="诊断"
clearable
filterable
@change="
(value) => {
submitForm.ybClassEnum = value;
}
"
>
<el-option
v-for="item in med_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入院诊断" prop="diagnosisDefinitionId">
<el-select
v-model="submitForm.diagnosisDefinitionId"
placeholder="诊断"
clearable
filterable
remote
:remote-method="getDiagnosisInfo"
style="width: 400px"
>
<el-option
v-for="item in diagnosisDefinitionList"
:key="item.id"
:label="item.name"
:value="item.id"
@click="handleDiagnosisChange(item)"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import {
getInit,
getOrgList,
wardList,
getDiagnosisDefinitionList,
handleHospitalization,
} from './api.js';
const submitForm = reactive({
medTypeCode: '21',
});
const props = defineProps({
open: {
type: Boolean,
default: false,
},
patientInfo: {
type: Object,
},
});
const emit = defineEmits(['close']);
const priorityLevelOptionOptions = ref(undefined);
const organization = ref([]);
const wardListOptions = ref([]);
const diagnosisDefinitionList = ref([]);
let diagnosisDefinitionId = '';
let diagnosisYbNo = '';
const { proxy } = getCurrentInstance();
const { med_type } = proxy.useDict('med_type');
const rules = reactive({
diagnosisDefinitionId: [
{
required: true,
message: '入院诊断未填写',
trigger: ['blur', 'change'],
},
],
medTypeCode: [
{
required: true,
message: '诊断类别未选择',
trigger: ['blur', 'change'],
},
],
inHospitalOrgId: [
{
required: true,
message: '入院科室未填写',
trigger: ['blur', 'change'],
},
],
});
function openDialog() {
getOrgList().then((res) => {
organization.value = res.data.records;
});
// wardList().then((res) => {
// wardListOptions.value = res.data;
// });
getInit().then((response) => {
console.log(response, 'response');
priorityLevelOptionOptions.value = response.data.priorityLevelOptionOptions; // 优先级
});
console.log(props.patientInfo, 'patientInfo');
getDiagnosisInfo(undefined);
}
function getDiagnosisInfo(value) {
getDiagnosisDefinitionList({ pageSize: 500, pageNo: 1, searchKey: value }).then((res) => {
diagnosisDefinitionList.value = res.data.records;
});
}
function handleDiagnosisChange(item) {
diagnosisYbNo = item.ybNo;
diagnosisDefinitionId = item.id;
}
function handleNodeClick(orgInfo) {
wardList({ orgId: orgInfo.id }).then((res) => {
wardListOptions.value = res.data;
});
}
function handleChange(value) {
if (!value) {
wardListOptions.value = [];
submitForm.wardLocationId = undefined;
}
}
function submit() {
proxy.$refs['registerRef'].validate((valid) => {
if (valid) {
let saveData = {
...submitForm,
diagnosisYbNo: diagnosisYbNo,
diagnosisDefinitionId: diagnosisDefinitionId,
ambEncounterId: props.patientInfo.encounterId,
patientId: props.patientInfo.patientId,
};
handleHospitalization(saveData).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('办理成功');
close();
}
});
}
});
}
function close() {
emit('close');
}
</script>
<style lang="scss" scoped>
.operate {
font-size: 16px;
background: rgba(37, 109, 149, 0.05);
display: flex;
justify-content: space-between;
align-items: center;
height: 32px;
border-radius: 4px 4px 0px 0px;
padding-left: 16px;
color: var(--hip-color-primary-light);
font-weight: bold;
margin: 10px 0;
}
.patInfo-value {
width: 100px;
}
</style>

View File

@@ -0,0 +1,216 @@
<template>
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px">
<el-input
v-model="queryParams.patientName"
placeholder="请输入患者姓名"
clearable
style="flex: 1.4"
@keyup.enter="handleQuery"
>
<template #append>
<el-button icon="Search" @click="handleQuery" />
</template>
</el-input>
<el-date-picker
v-model="date"
placeholder="请选择挂号日期"
type="date"
size="default"
placement="bottom"
style="flex: 1.1"
@change="handleDateQuery"
:clearable="false"
value-format="YYYY-MM-DD"
/>
<el-radio-group
v-model="queryParams.statusEnum"
@change="getPatientList"
style="flex-shrink: 0"
>
<el-radio-button :label="1">待诊</el-radio-button>
<el-radio-button :label="3">暂离</el-radio-button>
<el-radio-button :label="4">完诊</el-radio-button>
</el-radio-group>
</div>
<div style="justify-content: space-between; display: flex; margin-bottom: 10px">
<div></div>
</div>
<el-table
max-height="750"
ref="patientTableRef"
:data="patient"
row-key="id"
@cell-click="clickRow"
v-loading="loading"
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" type="index" width="50" />
<el-table-column label="患者" align="center" prop="name">
<template #default="scope">
<div style="display: flex; justify-content: flex-start; align-items: center">
<div style="padding-top: 5px">
<el-avatar
:size="40"
src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
/>
</div>
<div style="font-size: 12px; text-align: left; padding-left: 20px">
<div>
<span style="margin-right: 10px">{{ scope.row.patientName }}</span>
<span style="margin-right: 10px">年龄{{ scope.row.age }}</span>
<span>性别{{ scope.row.genderEnum_enumText }}</span>
</div>
<div>
<span>挂号时间{{ formatDate(scope.row.registerTime) }}</span>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" prop="name" width="100">
<template #default="scope">
<el-button type="primary" link @click="handleReceive(scope.row)"> 接诊 </el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getPatientList"
/>
</template>
<script setup>
import { getList, receiveEncounter, leaveEncounter, completeEncounter } from './api';
import { formatDate, formatDateStr } from '@/utils/index';
const date = ref(formatDate(new Date()));
const queryParams = ref({
pageNo: 1,
pageSize: 50,
statusEnum: 1,
registerTimeSTime: formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00',
registerTimeETime: formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59',
});
const patient = ref([]);
const loading = ref(false);
const patientTableRef = ref();
const total = ref(0);
const emits = defineEmits(['cellClick', 'toCurrent']);
const props = defineProps({
status: {
type: Number,
required: true,
},
});
const { proxy } = getCurrentInstance();
const encounterId = ref();
onMounted(() => {
getPatientList();
});
function getPatientList() {
// queryParams.value.statusEnum = props.status;
loading.value = true;
// queryParams.value.registerTimeSTime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00';
// queryParams.value.registerTimeETime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59';
getList(queryParams.value).then((res) => {
patient.value = res.data.records;
total.value = res.data.total;
loading.value = false;
});
}
function clickRow(row) {
encounterId.value = row.encounterId;
emits('cellClick', row);
}
/**
* 接诊并跳到现诊tab页
*/
function handleReceive(row) {
// if (encounterId.value == undefined) {
// proxy.$modal.msgError('请选择患者');
// return;
// }
receiveEncounter(row.encounterId).then(() => {
emits('toCurrent', row);
});
}
/**
* 暂离
*/
function handleDisabled() {
if (encounterId.value == undefined) {
proxy.$modal.msgError('请选择患者');
return;
}
proxy.$modal
.confirm('是否暂离该患者?')
.then(() => {
proxy.$modal.loading();
leaveEncounter(encounterId.value).then(() => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess('暂离成功');
getPatientList();
});
})
.catch(() => {
proxy.$modal.closeLoading();
});
}
/**
* 完诊
*/
function handleComplete() {
if (encounterId.value == undefined) {
proxy.$modal.msgError('请选择患者');
return;
}
proxy.$modal.confirm('是否完成该患者问诊?').then(() => {
proxy.$modal.loading();
completeEncounter(encounterId.value).then(() => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess('完成问诊成功');
getPatientList();
});
});
}
function handleQuery() {
// 清空表格选中状态
patientTableRef.value.setCurrentRow(null);
getPatientList();
}
function handleDateQuery(value) {
queryParams.value.registerTimeSTime = value + ' 00:00:00';
queryParams.value.registerTimeETime = value + ' 23:59:59';
handleQuery();
}
function handleSelectionChange() {}
// 添加刷新方法
function refreshList() {
getPatientList();
}
// 暴露 refreshList 方法
defineExpose({
refreshList,
});
</script>
<style scoped>
.custom-date-picker.el-picker__popper {
width: 285px !important;
}
</style>

View File

@@ -0,0 +1,81 @@
<template>
<el-drawer v-model="drawer" title="组套信息" direction="ltr">
<div style="margin: 10px 0px">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入组套信息"
clearable
style="width: 45%; margin-bottom: -6px; margin-right: 50px"
@keyup.enter="getList"
>
<template #append>
<el-button icon="Search" @click="getList" />
</template>
</el-input>
<el-radio-group v-model="queryParams.rangeCode" @change="getList">
<el-radio-button :label="1">个人</el-radio-button>
<el-radio-button :label="2">科室</el-radio-button>
<el-radio-button :label="3">全院</el-radio-button>
</el-radio-group>
</div>
<el-table :data="orderList">
<el-table-column label="组套名称" align="center" prop="name" />
<!-- <el-table-column label="组套类型" align="center" prop="typeEnum_enumText" /> -->
<el-table-column label="使用范围" align="center" prop="rangeCode_dictText" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button type="primary" link @click="handleUseOrderGroup(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-drawer>
</template>
<script setup>
import { getOrderGroupList } from '../api';
const props = defineProps({
diagnosis: {
type: Object,
required: true,
},
});
const drawer = ref(false);
const orderList = ref([]);
const emit = defineEmits(['useOrderGroup']);
const queryParams = ref({
typeEnum: 1,
rangeCode: 3,
});
function handleOpen() {
drawer.value = true;
getList();
}
function handleUseOrderGroup(row) {
let value = JSON.parse(row.groupJson);
value = value.map((item) => {
return {
...item,
conditionId: props.diagnosis.conditionId,
conditionDefinitionId: props.diagnosis.definitionId,
};
});
// value.conditionId = props.diagnosis.conditionId;
// value.conditionDefinitionId = props.diagnosis.definitionId;
emit('useOrderGroup', value);
drawer.value = false;
}
function getList() {
getOrderGroupList(queryParams.value).then((res) => {
orderList.value = res.data.records;
});
}
defineExpose({
handleOpen,
});
</script>

View File

@@ -0,0 +1,119 @@
<template>
<el-drawer v-model="drawer" title="历史医嘱" direction="ltr">
<div style="margin: 10px 0px">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入医嘱信息"
clearable
style="width: 50%; margin-bottom: 10px"
@keyup.enter="getList"
>
<template #append>
<el-button icon="Search" @click="getList" />
</template>
</el-input>
</div>
<el-table :data="orderList">
<el-table-column label="医嘱项" align="center" prop="adviceName" width="150" />
<!-- <el-table-column label="组套类型" align="center" prop="typeEnum_enumText" /> -->
<el-table-column label="单次剂量" align="center" prop="rangeCode_dictText">
<template #default="scope">
{{
scope.row.dose
? formatNumber(scope.row.dose) + ' ' + scope.row.doseUnitCode_dictText
: ''
}}
</template>
</el-table-column>
<el-table-column label="总量" align="center" prop="rangeCode_dictText">
<template #default="scope">
{{ scope.row.quantity ? scope.row.quantity + ' ' + scope.row.unitCode_dictText : '' }}
</template>
</el-table-column>
<el-table-column label="频次/用法" align="center" prop="rangeCode_dictText" width="200">
<template #default="scope">
{{
scope.row.rateCode_dictText
? scope.row.rateCode_dictText +
' ' +
scope.row.dispensePerDuration +
'天' +
' ' +
scope.row.methodCode_dictText
: ''
}}
</template>
</el-table-column>
<el-table-column label="注射药品" align="center" prop="rangeCode_dictText">
<template #default="scope">
{{ scope.row.injectFlag_enumText || '-' }}
</template>
</el-table-column>
<el-table-column label="皮试" align="center" prop="rangeCode_dictText">
<template #default="scope">
{{ scope.row.skinTestFlag_enumText || '-' }}
</template>
</el-table-column>
<el-table-column label="诊断" align="center" prop="rangeCode_dictText">
<template #default="scope">
{{ scope.row.diagnosisName || scope.row.conditionDefinitionName }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template #default="scope">
<el-button type="primary" link @click="handleUseOrderGroup(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-drawer>
</template>
<script setup>
import { getAdviceHistoryInfo } from '../api';
import { formatNumber } from '@/utils/his';
const props = defineProps({
patientInfo: {
type: Object,
required: true,
},
diagnosis: {
type: Object,
required: true,
},
});
const drawer = ref(false);
const orderList = ref([]);
const emit = defineEmits(['userPrescriptionHistory']);
const queryParams = ref({
typeEnum: 1,
});
function handleOpen() {
drawer.value = true;
getList();
}
function handleUseOrderGroup(row) {
row = {
...row,
conditionId: props.diagnosis.conditionId,
conditionDefinitionId: props.diagnosis.definitionId,
};
// value.conditionId = props.diagnosis.conditionId;
// value.conditionDefinitionId = props.diagnosis.definitionId;
emit('userPrescriptionHistory', row);
drawer.value = false;
}
function getList() {
getAdviceHistoryInfo({ patientId: props.patientInfo.patientId, encounterId: props.patientInfo.encounterId }).then((res) => {
orderList.value = res.data;
});
}
defineExpose({
handleOpen,
});
</script>

View File

@@ -0,0 +1,205 @@
<template>
<el-dialog
title="处方单"
v-model="props.open"
width="1600px"
append-to-body
destroy-on-close
@close="close"
@open="openDialog"
>
<div class="prescription-dialog-wrapper">
<div
class="prescription-container"
v-for="item in precriptionInfo"
:key="item.prescriptionNo"
>
<div>
<span>处方号</span>
<span>{{ item.prescriptionNo }}</span>
</div>
<div style="text-align: center">
<h2>长春大学医院</h2>
</div>
<div style="text-align: center">
<h3>处方单</h3>
</div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">姓名</span>
<span class="item-value">{{ item.patientName }}</span>
</div>
<div>
<span class="item-label">年龄</span>
<span class="item-value">20</span>
</div>
<div>
<span class="item-label">性别</span>
<span class="item-value"></span>
</div>
</div>
<div class="divider"></div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">科室</span>
<span class="item-value">门诊内科</span>
</div>
<div>
<span class="item-label">费用性质</span>
<span class="item-value">自费</span>
</div>
<div>
<span class="item-label">日期</span>
<span class="item-value">{{ formatDateStr(item.requestTime, 'YYYY-MM-DD') }}</span>
</div>
</div>
<div class="divider"></div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">门诊号</span>
<span class="item-value">M0000000001</span>
</div>
<div>
<span class="item-label">开单医生</span>
<span class="item-value">徐丹</span>
</div>
</div>
<div class="divider"></div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">诊断</span>
<span class="item-value">{{ item.conditionDefinitionName }}</span>
</div>
</div>
<div class="divider"></div>
<div style="font-size: 16px; font-weight: 700; margin-bottom: 3px">Rp</div>
<div class="medicen-list">
<div
style="margin-bottom: 3px"
v-for="(medItem, index) in item.prescriptionInfoDetail"
:key="medItem.requestId"
>
<span>{{ index + 1 + '. ' }}</span>
<span>{{ medItem.adviceName }}</span>
<span>{{ '(' + medItem.volume + ')' }}</span>
<span>{{ medItem.quantity + ' ' + medItem.unitCode_dictText }}</span>
<span>{{ '批次号:' + medItem.lotNumber }}</span>
<div>
<span>用法用量</span>
<span>
{{
medItem?.methodCode_dictText +
' / ' +
medItem?.dose +
+' ' +
medItem?.doseUnitCode_dictText +
' / ' +
medItem?.rateCode_dictText
}}
</span>
</div>
</div>
</div>
<div class="divider"></div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">医师</span>
<span class="item-value"></span>
</div>
<div>
<span class="item-label">收费</span>
<span class="item-value"></span>
</div>
<div>
<span class="item-label">合计</span>
<span class="item-value"></span>
</div>
</div>
<div style="display: flex; justify-content: space-between">
<div>
<span class="item-label">调配</span>
<span class="item-value"></span>
</div>
<div>
<span class="item-label">核对</span>
<span class="item-value"></span>
</div>
<div>
<span class="item-label">发药</span>
<span class="item-value"></span>
</div>
</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { formatDateStr } from '@/utils/index';
const props = defineProps({
open: {
type: Boolean,
default: false,
},
precriptionInfo: {
type: [],
default: [],
},
});
const emit = defineEmits(['close']);
function close() {
emit('close');
}
function clickRow(row) {
selectRow.value = row;
}
</script>
<style lang="scss" scoped>
.prescription-dialog-wrapper {
height: 700px;
display: flex;
overflow-x: auto;
flex-wrap: wrap;
gap: 20px;
// background-color: #d7d7d7;
// padding: 10px
}
.prescription-container {
height: 660px;
width: 500px;
border: solid 2px #757575;
font-size: 13px;
color: #000000;
background-color: #f3f3f3;
padding: 10px;
}
.divider {
height: 2px;
background-color: #757575;
margin: 5px 0 5px 0;
}
.medicen-list {
height: 330px;
}
.item-label {
width: 70px;
text-align: left;
font-weight: 700;
color: #000000;
display: inline-block;
}
.item-value {
color: #393a3b;
font-weight: 500;
width: 87px;
display: inline-block;
}
</style>

View File

@@ -0,0 +1,100 @@
<template>
<div style="height: 500px;padding-bottom: 120px">
<el-table ref="medicineRef" height="400" :data="medicineList" @cell-click="clickRow">
<el-table-column label="药品名称" align="center" prop="registeredName" width="300" />
<el-table-column label="药品规格" align="center" prop="drugSpecification" />
<el-table-column label="生产厂家" align="center" prop="manufacturerName" />
<el-table-column label="国药准字号" align="center" prop="approvalNo"/>
<el-table-column label="包装单位" align="center" prop="minPackageUnit" />
<el-table-column label="剂量单位" align="center" prop="minPreparationUnit" />
<!-- <el-table-column
label="最小单位"
align="center"
prop="minUnitCode_dictText"
/>
<el-table-column label="规格" align="center" prop="volume" /> -->
<!-- <el-table-column label="用法" align="center" prop="methodCode_dictText" />
<el-table-column label="单次剂量" align="center" prop="dose" />
<<<<<<< HEAD
<el-table-column
label="剂量单位"
align="center"
prop="doseUnitCode_dictText"
/> -->
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup>
import { getAllMedicationInfo,getAllMedicationUsualInfo} from '../api';
import { watch } from 'vue';
import { throttle } from 'lodash-es';
const props = defineProps({
searchKey: {
type: String,
default: '',
},
itemType: {
type: String,
default: '',
},
});
const emit = defineEmits(['selectRow']);
const queryParams = ref({
pageNum: 1,
pageSize: 50,
});
const medicineList = ref([]);
const total = ref(0);
// 节流函数
const throttledGetList = throttle(
() => {
console.log('节流执行了', queryParams.value);
getList();
},
300,
{ leading: true, trailing: true }
);
watch(
() => props.searchKey,
(newValue) => {
queryParams.value.searchKey = newValue;
throttledGetList();
},
{ deep: true }
);
getList();
function getList() {
getAllMedicationUsualInfo(queryParams.value).then((res) => {
console.log(res, '药品列表', queryParams.value, 'queryParams.value');
if(res.data&&res.data.records&&res.data.records.length>0){
medicineList.value = res.data.records;
total.value = res.data.total;
}else{
getAllMedicationInfo(queryParams.value).then((res) => {
console.log(res, 'wwwwwwwwwwwwwwwww药品列表', queryParams.value, 'queryParams.value');
medicineList.value = res.data.records;
total.value = res.data.total;
});
}
});
}
function clickRow(row) {
emit('selectRow', row);
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,276 @@
<template>
<el-dialog
title="退费单"
v-model="props.open"
width="1300px"
append-to-body
destroy-on-close
@close="close"
@open="openDialog"
>
<div class="footer">
<div class="statistics">
<span> {{ total }} 个项目</span>
<!-- <span class="total">合计金额¥ {{ totalAmount.toFixed(2) }}</span> -->
</div>
</div>
<div>
<!-- <el-row :gutter="24" class="mb8">
<el-col :span="12">
<el-input
v-model="queryParams.searchKey"
placeholder="诊断名称/拼音码"
clearable
style="width: 100%; margin-bottom: 10px"
@keyup.enter="queryDiagnosisUse"
>
<template #append>
<el-button icon="Search" @click="queryDiagnosisUse" />
</template>
</el-input>
</el-col>
</el-row> -->
<el-table
ref="refundListRef"
:data="refundList"
row-key="paymentId"
row-class-name="parent-row"
v-loading="tableLoading"
border
height="600"
>
<el-table-column
type="selection"
width="55"
align="center"
class-name="selection-column"
:selectable="
(row) => {
return row.refundStatus == 5;
}
"
/>
<el-table-column label="处方号" align="center" prop="prescriptionNo" />
<el-table-column label="项目名" align="center" prop="itemName" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="单位" align="center" prop="unitCode_dictText" />
<el-table-column label="收款金额" align="center" prop="totalPrice" />
<el-table-column label="发放状态" align="center">
<template #default="scope">
<el-tag v-if="scope.row.dispenseStatus != 0" type="default">
{{ scope.row.dispenseStatus_enumText }}
</el-tag>
<el-tag v-else type="default">{{ scope.row.serviceStatus_enumText }}</el-tag>
</template>
</el-table-column>
<el-table-column label="支付状态" align="center" prop="refundStatus_enumText">
<template #default="scope">
<el-tag
:type="
handleColor(
[1, 2, 3, 4, 5, 8, 9],
['success', 'info', 'warning', 'warning', 'success', 'info', 'error'],
scope.row.refundStatus
)
"
>
{{ scope.row.refundStatus_enumText }}
</el-tag>
</template>
</el-table-column>
</el-table>
<!-- <pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/> -->
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { getEncounterPatientPayment, refundPayment } from '../api';
import { handleColor } from '@/utils/his';
const props = defineProps({
open: {
type: Boolean,
default: false,
},
encounterId: {
type: String,
default: '',
},
});
const emit = defineEmits(['close']);
const total = ref(0);
const tableLoading = ref(false);
const queryParams = ref({
pageNum: 1,
pageSize: 10,
});
const refundList = ref([]);
const expandOrder = ref([]);
const selectRow = ref({});
const { proxy } = getCurrentInstance();
const selectedMedicines = ref(0);
const totalAmount = ref(0);
function openDialog() {
getList();
}
function getList() {
refundList.value = [];
tableLoading.value = true;
getEncounterPatientPayment(props.encounterId).then((res) => {
refundList.value = res.data;
total.value = res.data ? res.data.length : 0;
// expandOrder.value = refundList.value.map((item) => {
// return item.paymentNo;
// });
tableLoading.value = false;
});
}
function submit() {
// 1. 获取当前选中行并提取去重的 paymentId 列表
const selectedRows = proxy.$refs['refundListRef'].getSelectionRows();
const selectedPaymentIds = [...new Set(selectedRows.map((row) => row.paymentId))];
// 2. 遍历 refundList筛选出符合条件的数据并设置 refundFlag
const result = refundList.value
.filter((row) => selectedPaymentIds.includes(row.paymentId)) // 筛选出选中的 paymentId 对应的原始数据
.map((row) => ({
paymentId: row.paymentId,
chargeItemId: row.chargeItemId,
// refundFlg: selectedRows.some((selectedRow) => selectedRow.chargeItemId === row.chargeItemId), // 是否选中
refundFlg: true, // todo 半退暂时不处理 此处先写死,等需要用半退的时候再放开上边的代码
}));
console.log('组装后的数据:', result);
// 3. 调用接口提交
refundPayment(result).then((res) => {
if (res.code === 200) {
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
// refundList.value.forEach((item, index) => {
// // proxy.$refs['itemRef' + index].getSelectionRows().forEach((row) => {
// // saveList.push({ paymentId: item.paymentId, chargeItemId: row.chargeItemId, refundFlg: true });
// // });
// const selectedIds = proxy.$refs['refundListRef'].getSelectionRows().map((row) => {
// return row.busNo;
// });
// console.log(selectedIds);
// item.chargeItemList.forEach((item) => {
// saveList.push({
// paymentId: item.paymentId,
// chargeItemId: item.chargeItemId,
// refundFlg: selectedIds.has(item.busNo),
// });
// });
// });
// refundPayment({
// definitionId: selectRow.value.id,
// definitionName: selectRow.value.name,
// bindingEnum: props.radio == '个人' ? 1 : 2,
// }).then((res) => {
// if (res.code == 200) {
// emit('close', 'success');
// }
// });
}
function handleSelectAll(selection) {
if (selection.length > 0) {
selection.forEach((item, index) => {
proxy.$refs['itemRef' + index].toggleAllSelection();
});
} else {
for (let i = 0; i < refundList.value.length; i++) {
proxy.$refs['itemRef' + i].clearSelection();
}
}
}
function handleSelectionChange(value, row) {
let selectIndex = refundList.value.findIndex((item) => {
return item.paymentNo === row.paymentNo;
});
if (value.includes(row)) {
proxy.$refs['itemRef' + selectIndex].toggleAllSelection();
} else {
proxy.$refs['itemRef' + selectIndex].clearSelection();
}
}
// 处理外层列表选中状态
function handleItemSelectionChange(parentRow, selection, index) {
// 子列表全选中,自动选中父级列表
proxy.$refs['refundListRef'].toggleRowSelection(
parentRow,
selection.length == parentRow.chargeItemList.length
);
}
function queryDiagnosisUse() {
getList();
}
function close() {
emit('close');
}
function clickRow(row) {
selectRow.value = row;
}
</script>
<style lang="scss" scoped>
.sub-table-wrapper {
padding: 16px 55px;
background: #f9fafe;
.nested-sub-table {
border: 1px solid #e8e8f3;
border-radius: 2px;
// :deep(.sub-cell) {
// background: #ffffff !important;
// padding: 12px 16px;
// }
}
}
:deep(.parent-row) {
td {
// background: #e8ece6 !important; /* 浅蓝色背景 */
// border-color: #e4e7ed !important;
height: 48px;
}
}
.footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border-top: 1px solid #ebeef5;
.total {
margin-left: 20px;
color: #f56c6c;
font-weight: 500;
}
}
</style>

View File

@@ -0,0 +1,382 @@
<template>
<div class="app-container">
<div style="width: 50%">
<el-calendar
v-model="selectedDate"
@panel-change="
(value) => {
console.log(value);
}
"
>
<template #date-cell="{ data }">
<div class="calendar-cell" @click="selectDate(data)">
{{ data.day.split('-').slice(2).join('-') }}
<div v-if="hasAppointment(data.day)" class="appointment-dot"></div>
</div>
</template>
</el-calendar>
</div>
<div class="appointment-section">
<div class="section-header">
<h3>{{ selectedDateFormatted }} 的预约</h3>
<el-button type="primary" @click="showAddForm">新增预约</el-button>
</div>
<div v-if="showForm" class="appointment-form">
<el-form :model="appointmentForm" label-width="80px">
<el-form-item label="患者姓名">
<el-input v-model="appointmentForm.patientName" />
</el-form-item>
<el-form-item label="联系方式">
<el-input v-model="appointmentForm.patientTel" />
</el-form-item>
<el-form-item label="预约时间">
<el-time-select
v-model="appointmentForm.reservationTime"
start="08:30"
step="00:30"
end="18:00"
placeholder="选择时间"
/>
</el-form-item>
<!-- <el-form-item label="预约类型">
<el-select v-model="appointmentForm.chiefComplaint" placeholder="请选择">
<el-option label="初诊" value="初诊" />
<el-option label="复诊" value="复诊" />
<el-option label="检查" value="检查" />
<el-option label="取药" value="取药" />
</el-select>
</el-form-item> -->
<el-form-item label="备注">
<el-input v-model="appointmentForm.remark" type="textarea" />
</el-form-item>
<el-form-item>
<el-button @click="cancelForm">取消</el-button>
<el-button type="primary" @click="saveAppointment">保存</el-button>
</el-form-item>
</el-form>
</div>
<div class="appointment-list">
<div v-if="currentAppointments.length === 0" class="empty-tips">当日无预约</div>
<div
v-for="appointment in currentAppointments"
:key="appointment.id"
class="appointment-card"
>
<div class="card-header">
<span class="time">{{ appointment.reservationTime }}</span>
<!-- <el-tag :type="getTagType(appointment.type)" size="small">
{{ appointment.type }}
</el-tag> -->
</div>
<div class="card-body">
<div class="patient-info">
<el-icon><User /></el-icon>
<span>{{ appointment.patientName }}</span>
</div>
<div class="patient-info">
<el-icon><Phone /></el-icon>
<span>{{ appointment.patientTel }}</span>
</div>
<div v-if="appointment.remark" class="remark">
<el-icon><Comment /></el-icon>
<span>{{ appointment.remark }}</span>
</div>
</div>
<div class="card-actions">
<el-button type="primary" size="small" @click="editAppointment(appointment)">
编辑
</el-button>
<el-button type="danger" size="small" @click="deleteAppointment(appointment.id)">
删除
</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, computed, reactive } from 'vue';
import {
getReservationInfo,
addReservationInfo,
editReservationInfo,
delReservationInfo,
} from './api';
import { formatDateStr } from '@/utils/index';
const showForm = ref(false);
const selectedDate = ref(new Date());
const selectedDateStr = ref(formatDateStr(new Date(), 'YYYY-MM-DD'));
const isEditing = ref(false);
const editingId = ref(null);
const queryParams = ref({});
const currentAppointments = ref([]);
const { proxy } = getCurrentInstance();
// 预约数据
const appointments = ref([]);
// 预约表单
const appointmentForm = reactive({
id: '',
patientName: '',
reservationTime: '',
patientTel: '',
remark: '',
});
getRecords(selectedDate.value);
getTodayRecords(selectedDateStr.value);
watch(
() => selectedDate.value,
(newValue) => {
getRecords(newValue);
},
{ immediate: true }
);
function getRecords(date) {
let month = formatDateStr(date, 'YYYY-MM');
getReservationInfo({
pageNo: 1,
pageSize: 1000,
reservationTimeSTime: month + '01 00:00:00',
reservationTimeETime: month + '31 23:59:59',
}).then((res) => {
appointments.value = res.data.records.map((item) => {
return formatDateStr(item.reservationTime, 'YYYY-MM-DD');
});
console.log(appointments.value);
});
}
// 格式化选中的日期
const selectedDateFormatted = computed(() => {
return selectedDate.value.toLocaleDateString('zh-CN', {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
});
});
// 检查某天是否有预约
const hasAppointment = (date) => {
return appointments.value.includes(date);
};
// 选择日期
const selectDate = (date) => {
selectedDateStr.value = date.day;
getTodayRecords(date.day);
showForm.value = false;
};
function getTodayRecords(date) {
queryParams.value.reservationTimeSTime = date + ' 00:00:00';
queryParams.value.reservationTimeETime = date + ' 23:59:59';
getReservationInfo(queryParams.value).then((res) => {
currentAppointments.value = res.data.records;
});
}
// 显示添加表单
const showAddForm = () => {
resetForm();
isEditing.value = false;
showForm.value = true;
};
// 编辑预约
const editAppointment = (appointment) => {
Object.assign(appointmentForm, appointment);
appointmentForm.reservationTime = formatDateStr(appointmentForm.reservationTime, 'HH:mm');
isEditing.value = true;
editingId.value = appointment.id;
showForm.value = true;
};
// 删除预约
const deleteAppointment = (id) => {
delReservationInfo({ id: id }).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
getTodayRecords(selectedDateStr.value);
});
};
// 保存预约
const saveAppointment = () => {
if (isEditing.value) {
let updateParams = {
...appointmentForm,
reservationTime: selectedDateStr.value + ' ' + appointmentForm.reservationTime + ':00',
};
editReservationInfo(updateParams).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
getTodayRecords(selectedDateStr.value);
});
} else {
let saveParams = {
...appointmentForm,
reservationTime: selectedDateStr.value + ' ' + appointmentForm.reservationTime + ':00',
};
addReservationInfo(saveParams).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
getTodayRecords(selectedDateStr.value);
});
}
cancelForm();
};
// 取消表单
const cancelForm = () => {
showForm.value = false;
resetForm();
};
// 重置表单
const resetForm = () => {
Object.assign(appointmentForm, {
patientName: '',
reservationTime: '',
patientTel: '',
remark: '',
});
isEditing.value = false;
editingId.value = null;
};
// 获取标签类型
const getTagType = (appointmentType) => {
const types = {
初诊: 'primary',
复诊: 'success',
检查: 'warning',
取药: 'info',
};
return types[appointmentType] || '';
};
</script>
<style scoped>
.app-container {
margin: 20px 100px;
padding: 20px;
display: flex;
justify-content: space-between;
gap: 24px;
}
.calendar-cell {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
cursor: pointer;
}
.appointment-dot {
position: absolute;
bottom: 5px;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #f56c6c;
}
.appointment-section {
background-color: #fff;
border-radius: 8px;
padding: 20px;
width: 45%;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.appointment-form {
margin-bottom: 24px;
padding: 16px;
background-color: #f8f8f8;
border-radius: 8px;
}
.appointment-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 16px;
max-height: 450px;
overflow-y: auto;
}
.appointment-card {
border: 1px solid #ebeef5;
border-radius: 8px;
padding: 16px;
background-color: #fff;
transition: box-shadow 0.3s;
}
.appointment-card:hover {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #f0f0f0;
}
.time {
font-weight: bold;
font-size: 16px;
}
.card-body {
margin-bottom: 16px;
}
.patient-info,
.remark {
display: flex;
align-items: center;
margin-bottom: 8px;
}
.patient-info .el-icon,
.remark .el-icon {
margin-right: 8px;
color: #909399;
}
.card-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
.empty-tips {
text-align: center;
color: #999;
padding: 40px 0;
grid-column: 1 / -1;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,158 @@
<template>
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper">
<el-table
ref="adviceBaseRef"
height="400"
:data="adviceBaseList"
highlight-current-row
@current-change="handleCurrentChange"
row-key="patientId"
@cell-click="clickRow"
>
<el-table-column label="名称" align="center" prop="adviceName" />
<el-table-column label="类型" align="center" prop="activityType_enumText" />
<el-table-column label="包装单位" align="center" prop="unitCode_dictText" />
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
<!-- <el-table-column label="规格" align="center" prop="volume" /> -->
<!-- <el-table-column label="用法" align="center" prop="methodCode_dictText" /> -->
<el-table-column label="库存数量" align="center">
<template #default="scope">{{ handleQuantity(scope.row) }}</template>
</el-table-column>
<el-table-column label="频次" align="center" prop="rateCode_dictText" />
<!-- <el-table-column label="单次剂量" align="center" prop="dose" /> -->
<!-- <el-table-column label="剂量单位" align="center" prop="doseUnitCode_dictText" /> -->
<!-- <el-table-column label="注射药品" align="center" prop="injectFlag_enumText" /> -->
<!-- <el-table-column label="皮试" align="center" prop="skinTestFlag_enumText" /> -->
</el-table>
</div>
</template>
<script setup>
import { nextTick } from 'vue';
import { getTcmMedicine } from '@/views/doctorstation/components/api';
import { throttle } from 'lodash-es';
const props = defineProps({
adviceQueryParams: {
type: Object,
default: '',
},
patientInfo: {
type: Object,
required: true,
},
});
const emit = defineEmits(['selectAdviceBase']);
const total = ref(0);
const adviceBaseRef = ref();
const tableWrapper = ref();
const currentIndex = ref(0); // 当前选中行索引
const currentSelectRow = ref({});
const queryParams = ref({
pageSize: 100,
pageNum: 1,
});
const adviceBaseList = ref([]);
// 节流函数
const throttledGetList = throttle(
() => {
getList();
},
300,
{ leading: true, trailing: true }
);
watch(
() => props.adviceQueryParams,
(newValue) => {
queryParams.value.searchKey = newValue.searchKey;
queryParams.value.adviceType = newValue.adviceType;
throttledGetList();
},
{ deep: true }
);
getList();
function getList() {
queryParams.value.organizationId = props.patientInfo.orgId;
getTcmMedicine(queryParams.value).then((res) => {
adviceBaseList.value = res.data.records;
total.value = res.data.total;
nextTick(() => {
currentIndex.value = 0;
if (adviceBaseList.value.length > 0) {
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
}
});
});
}
// 处理键盘事件
const handleKeyDown = (event) => {
const key = event.key;
const data = adviceBaseList.value;
switch (key) {
case 'ArrowUp': // 上箭头
event.preventDefault(); // 阻止默认滚动行为
if (currentIndex.value > 0) {
currentIndex.value--;
setCurrentRow(data[currentIndex.value]);
}
break;
case 'ArrowDown': // 下箭头`
event.preventDefault();
if (currentIndex.value < data.length - 1) {
currentIndex.value++;
setCurrentRow(data[currentIndex.value]);
}
break;
case 'Enter': // 回车键
// const currentRow = adviceBaseRef.value.getSelectionRows();
event.preventDefault();
if (currentSelectRow.value) {
// 这里可以触发自定义逻辑,如弹窗、跳转等
emit('selectAdviceBase', currentSelectRow.value);
}
break;
}
};
function handleQuantity(row) {
if (row.inventoryList) {
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
return 0;
}
// 设置选中行(带滚动)
const setCurrentRow = (row) => {
adviceBaseRef.value.setCurrentRow(row);
// 滚动到选中行
const tableBody = adviceBaseRef.value.$el.querySelector('.el-table__body-wrapper');
const currentRowEl = adviceBaseRef.value.$el.querySelector('.current-row');
if (tableBody && currentRowEl) {
currentRowEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
};
// 当前行变化时更新索引
const handleCurrentChange = (currentRow) => {
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
currentSelectRow.value = currentRow;
};
function clickRow(row) {
emit('selectAdviceBase', row);
}
defineExpose({
handleKeyDown,
});
</script>
<style scoped>
.popover-table-wrapper:focus {
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
}
</style>

View File

@@ -0,0 +1,383 @@
<template>
<el-dialog
title="中医诊断"
v-model="openDiagnosis"
width="500px"
append-to-body
destroy-on-close
@close="close"
@open="open"
>
<div class="diagnosis-container">
<div class="select-group">
<span class="select-label">中医诊断</span>
<el-select
v-model="condition"
placeholder="请选择中医诊断"
filterable
clearable
style="width: 300px"
>
<el-option
v-for="item in conditionOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div class="select-group">
<span class="select-label">中医证候</span>
<el-select
v-model="syndrome"
placeholder="请选择中医证候"
filterable
clearable
style="width: 300px"
>
<el-option
v-for="item in syndromeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { ref } from 'vue';
import { getTcmCondition, getTcmSyndrome, saveTcmDiagnosis } from '@/views/doctorstation/components/api';
const condition = ref('');
const syndrome = ref('');
const conditionOptions = ref([]);
const syndromeOptions = ref([]);
const diagnosisList = ref([]);
const openDiagnosis = ref(false);
const emit = defineEmits(['flush']);
const { proxy } = getCurrentInstance();
const props = defineProps({
patientInfo: {
type: Object,
required: true,
},
});
function open() {}
function submit() {
// 提交逻辑
if (!condition.value || !syndrome.value) {
proxy.$modal.msgWarning('请选择诊断和证候');
return; // 确保选择了诊断和证候
}
// 构建诊断对象
const diagnosis = {
id: Date.now(), // 使用时间戳作为唯一ID
condition: conditionOptions.value.find((item) => item.value === condition.value)?.label || '',
conditionCode: condition.value,
syndrome: syndromeOptions.value.find((item) => item.value === syndrome.value)?.label || '',
syndromeCode: syndrome.value,
};
const data = localStorage.getItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
diagnosisList.value = JSON.parse(data);
// 添加到列表
diagnosisList.value.push(diagnosis);
localStorage.removeItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
// 保存到本地缓存
localStorage.setItem(
`tcmDiagnosisList_${props.patientInfo.encounterId}`,
JSON.stringify(diagnosisList.value)
);
console.log('当前诊断列表:', diagnosisList.value);
emit('flush')
close();
}
function openDialog() {
openDiagnosis.value = true;
// 获取中医诊断选项
getTcmCondition().then((res) => {
conditionOptions.value = res.data.records.map((item) => ({
value: item.ybNo,
label: item.name,
}));
});
// 获取中医证候选项
getTcmSyndrome().then((res) => {
syndromeOptions.value = res.data.records.map((item) => ({
value: item.ybNo,
label: item.name,
}));
});
}
function close() {
// 关闭逻辑
condition.value = '';
syndrome.value = '';
openDiagnosis.value = false;
}
defineExpose({ openDialog });
</script>
<style scoped>
.diagnosis-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
padding: 20px 0;
}
.select-group {
display: flex;
align-items: center;
width: 100%;
justify-content: center;
}
.select-label {
width: 100px;
text-align: right;
margin-right: 10px;
font-size: 14px;
}
:deep(.pagination-container .el-pagination) {
right: 20px !important;
}
.app-container {
max-width: 1400px;
margin: 20px auto;
padding: 20px;
background: white;
border-radius: 12px;
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 15px;
border-bottom: 1px solid var(--el-border-color);
margin-bottom: 20px;
}
.header h1 {
color: var(--el-color-primary);
font-size: 24px;
font-weight: 600;
}
.patient-info {
background: var(--el-color-primary-light-9);
padding: 15px;
border-radius: 8px;
margin-bottom: 20px;
}
.patient-info .info-row {
display: flex;
margin-bottom: 8px;
}
.patient-info .info-label {
width: 100px;
color: var(--el-text-color-secondary);
font-weight: 500;
}
.main-content {
display: grid;
grid-template-columns: 1fr 1fr 1.2fr;
gap: 20px;
margin-bottom: 25px;
}
.disease-section, .syndrome-section, .diagnosis-section {
border: 1px solid var(--el-border-color);
border-radius: 8px;
padding: 20px;
background: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.section-title {
font-size: 18px;
font-weight: 600;
color: var(--el-color-primary);
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid var(--el-border-color);
}
.disease-list {
max-height: 400px;
overflow-y: auto;
}
.disease-item {
padding: 12px 15px;
border-bottom: 1px solid var(--el-border-color-lighter);
cursor: pointer;
transition: all 0.3s;
border-radius: 4px;
}
.disease-item:hover {
background-color: var(--el-color-primary-light-9);
}
.disease-item.active {
background-color: var(--el-color-primary-light-8);
border-left: 3px solid var(--el-color-primary);
}
.disease-name {
font-weight: 500;
margin-bottom: 5px;
}
.disease-code {
font-size: 12px;
color: var(--el-text-color-secondary);
}
.search-box {
margin-bottom: 15px;
}
.disease-categories {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 15px;
}
.category-tag {
cursor: pointer;
padding: 5px 12px;
border-radius: 15px;
background: var(--el-fill-color-light);
font-size: 13px;
transition: all 0.3s;
}
.category-tag.active {
background: var(--el-color-primary);
color: white;
}
.relation-container {
text-align: center;
padding: 30px 0;
border: 2px dashed var(--el-border-color);
border-radius: 8px;
margin: 20px 0;
background: var(--el-fill-color-lighter);
}
.relation-icon {
margin-bottom: 15px;
color: var(--el-color-primary);
}
.relation-text {
font-size: 18px;
font-weight: 500;
color: var(--el-text-color-primary);
}
.syndrome-details {
padding: 15px;
background: var(--el-color-primary-light-9);
border-radius: 8px;
border: 1px solid var(--el-color-primary-light-5);
}
.detail-item {
margin-bottom: 12px;
}
.detail-label {
font-weight: 500;
color: var(--el-text-color-secondary);
margin-bottom: 3px;
}
.actions {
display: flex;
justify-content: flex-end;
gap: 15px;
padding-top: 20px;
border-top: 1px solid var(--el-border-color);
}
.empty-state {
text-align: center;
padding: 40px 0;
color: var(--el-text-color-secondary);
}
.diagnosis-history {
margin-top: 20px;
border-top: 1px solid var(--el-border-color);
padding-top: 20px;
}
.history-title {
font-size: 16px;
font-weight: 500;
margin-bottom: 12px;
color: var(--el-text-color-primary);
}
.history-item {
padding: 12px;
border-left: 3px solid var(--el-border-color);
margin-bottom: 10px;
background: var(--el-fill-color-lighter);
border-radius: 0 4px 4px 0;
}
.history-date {
font-size: 12px;
color: var(--el-text-color-secondary);
margin-bottom: 5px;
}
.history-diagnosis {
font-size: 14px;
margin-bottom: 5px;
}
.history-note {
font-size: 13px;
color: var(--el-text-color-secondary);
padding-top: 5px;
border-top: 1px dashed var(--el-border-color);
margin-top: 5px;
}
.empty-list {
padding: 20px 0;
text-align: center;
}
</style>