@@ -1,89 +1,72 @@
|
||||
<template>
|
||||
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper" class="advice-base-list-wrapper">
|
||||
<Table
|
||||
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper">
|
||||
<el-table
|
||||
ref="adviceBaseRef"
|
||||
:table-data="adviceBaseList"
|
||||
:table-columns="tableColumns"
|
||||
:highlight-current-row="true"
|
||||
:table-height="400"
|
||||
:max-height="400"
|
||||
:loading="loading"
|
||||
height="400"
|
||||
:data="adviceBaseList"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
row-key="patientId"
|
||||
@row-click="handleRowClick"
|
||||
@cell-click="clickRow"
|
||||
>
|
||||
<template #quantity="{ row }">
|
||||
{{ handleQuantity(row) }}
|
||||
</template>
|
||||
<template #useScope="{ row }">
|
||||
<span v-if="row.useLimitFlag === 1">{{ row.useScope }}</span>
|
||||
<span v-else>{{ '-' }}</span>
|
||||
</template>
|
||||
</Table>
|
||||
<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 lang="ts">
|
||||
import { ref, nextTick, watch, computed } from 'vue';
|
||||
import { throttle } from 'lodash-es';
|
||||
import Table from '@/components/TableLayout/Table.vue';
|
||||
<script setup>
|
||||
import { nextTick } from 'vue';
|
||||
import { getAdviceBaseInfo } from './api';
|
||||
import type { TableColumn } from '@/components/types/TableLayout.d';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
interface Props {
|
||||
adviceQueryParams?: {
|
||||
searchKey?: string;
|
||||
adviceType?: string;
|
||||
};
|
||||
const props = defineProps({
|
||||
adviceQueryParams: {
|
||||
type: Object,
|
||||
default: '',
|
||||
},
|
||||
patientInfo: {
|
||||
inHospitalOrgId?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
adviceQueryParams: () => ({}),
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
selectAdviceBase: [row: any];
|
||||
}>();
|
||||
|
||||
const total = ref<number>(0);
|
||||
const loading = ref<boolean>(false);
|
||||
const adviceBaseRef = ref<InstanceType<typeof Table> | null>(null);
|
||||
const tableWrapper = ref<HTMLDivElement | null>(null);
|
||||
const currentIndex = ref<number>(0);
|
||||
const currentSelectRow = ref<any>({});
|
||||
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,3',
|
||||
searchKey: '',
|
||||
organizationId: '',
|
||||
adviceTypes: '1,3'
|
||||
});
|
||||
const adviceBaseList = ref<any[]>([]);
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = computed<TableColumn[]>(() => [
|
||||
{ label: '名称', prop: 'adviceName', align: 'center', width: 200 },
|
||||
{ label: '类型', prop: 'activityType_enumText', align: 'center' },
|
||||
{ label: '包装单位', prop: 'unitCode_dictText', align: 'center' },
|
||||
{ label: '最小单位', prop: 'minUnitCode_dictText', align: 'center' },
|
||||
{ label: '规格', prop: 'volume', align: 'center' },
|
||||
{ label: '用法', prop: 'methodCode_dictText', align: 'center' },
|
||||
{ label: '库存数量', prop: 'quantity', align: 'center', slot: 'quantity' },
|
||||
{ label: '频次', prop: 'rateCode_dictText', align: 'center' },
|
||||
{ label: '注射药品', prop: 'injectFlag_enumText', align: 'center' },
|
||||
{ label: '皮试', prop: 'skinTestFlag_enumText', align: 'center' },
|
||||
{ label: '医保码', prop: 'ybNo', align: 'center' },
|
||||
{
|
||||
label: '限制使用范围',
|
||||
prop: 'useScope',
|
||||
align: 'center',
|
||||
showOverflowTooltip: true,
|
||||
slot: 'useScope',
|
||||
},
|
||||
]);
|
||||
const adviceBaseList = ref([]);
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
@@ -105,52 +88,39 @@ watch(
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.organizationId = props.patientInfo.inHospitalOrgId;
|
||||
getAdviceBaseInfo(queryParams.value)
|
||||
.then((res) => {
|
||||
console.log(res.data.records);
|
||||
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(() => {
|
||||
if (adviceBaseList.value.length > 0) {
|
||||
currentIndex.value = 0;
|
||||
setCurrentRow(adviceBaseList.value[0]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
adviceBaseList.value = [];
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
adviceBaseList.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
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: KeyboardEvent): void => {
|
||||
const handleKeyDown = (event) => {
|
||||
const key = event.key;
|
||||
const data = adviceBaseList.value;
|
||||
|
||||
switch (key) {
|
||||
case 'ArrowUp': // 上箭头
|
||||
event.preventDefault();
|
||||
event.preventDefault(); // 阻止默认滚动行为
|
||||
if (currentIndex.value > 0) {
|
||||
currentIndex.value--;
|
||||
setCurrentRow(data[currentIndex.value]);
|
||||
}
|
||||
break;
|
||||
case 'ArrowDown': // 下箭头
|
||||
case 'ArrowDown': // 下箭头`
|
||||
event.preventDefault();
|
||||
if (currentIndex.value < data.length - 1) {
|
||||
currentIndex.value++;
|
||||
@@ -158,84 +128,52 @@ const handleKeyDown = (event: KeyboardEvent): void => {
|
||||
}
|
||||
break;
|
||||
case 'Enter': // 回车键
|
||||
// const currentRow = adviceBaseRef.value.getSelectionRows();
|
||||
event.preventDefault();
|
||||
if (currentSelectRow.value && Object.keys(currentSelectRow.value).length > 0) {
|
||||
if (currentSelectRow.value) {
|
||||
// 这里可以触发自定义逻辑,如弹窗、跳转等
|
||||
emit('selectAdviceBase', currentSelectRow.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function handleQuantity(row: any): string {
|
||||
function handleQuantity(row) {
|
||||
if (row.inventoryList && row.inventoryList.length > 0) {
|
||||
const totalQuantity = row.inventoryList.reduce(
|
||||
(sum: number, item: any) => sum + (item.quantity || 0),
|
||||
0
|
||||
);
|
||||
return totalQuantity.toString() + (row.minUnitCode_dictText || '');
|
||||
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
|
||||
return totalQuantity.toString() + row.minUnitCode_dictText;
|
||||
}
|
||||
return '0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 设置选中行(带滚动)
|
||||
const setCurrentRow = (row: any) => {
|
||||
if (adviceBaseRef.value?.tableRef) {
|
||||
adviceBaseRef.value.tableRef.setCurrentRow(row);
|
||||
// 滚动到选中行
|
||||
nextTick(() => {
|
||||
const tableEl = adviceBaseRef.value?.tableRef?.$el;
|
||||
if (tableEl) {
|
||||
const tableBody = tableEl.querySelector('.el-table__body-wrapper');
|
||||
const currentRowEl = tableEl.querySelector('.current-row');
|
||||
if (tableBody && currentRowEl) {
|
||||
currentRowEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
}
|
||||
}
|
||||
});
|
||||
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 handleRowClick = (row: any): void => {
|
||||
currentIndex.value = adviceBaseList.value.findIndex((item) => item === row);
|
||||
currentSelectRow.value = row;
|
||||
emit('selectAdviceBase', row);
|
||||
// 当前行变化时更新索引
|
||||
const handleCurrentChange = (currentRow) => {
|
||||
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
|
||||
currentSelectRow.value = currentRow;
|
||||
};
|
||||
|
||||
// 监听表格当前行变化(通过 el-table 的 current-change 事件)
|
||||
watch(
|
||||
() => adviceBaseRef.value?.tableRef,
|
||||
(tableRef) => {
|
||||
if (tableRef) {
|
||||
// 通过 $el 访问原生 el-table 并监听 current-change
|
||||
const elTable = tableRef.$el?.querySelector('.el-table');
|
||||
if (elTable) {
|
||||
// 使用 MutationObserver 或直接监听 DOM 变化来检测当前行变化
|
||||
// 或者通过 watch 监听 currentSelectRow 的变化
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
function clickRow(row) {
|
||||
emit('selectAdviceBase', row);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleKeyDown,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.advice-base-list-wrapper {
|
||||
height: 400px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&:focus {
|
||||
outline: 2px solid #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<style scoped>
|
||||
.popover-table-wrapper:focus {
|
||||
outline: 2px solid #409eff;
|
||||
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1,11 +1,11 @@
|
||||
import request from '@/utils/request';
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getPatientList(queryParams) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/reg-patient-zk',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 诊断相关接口
|
||||
@@ -16,8 +16,8 @@ export function saveDiagnosis(data) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/save-doctor-diagnosis',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,8 +27,8 @@ export function saveDiagnosisBind(data) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/diagnosis-belong-binding',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 删除诊断绑定
|
||||
@@ -37,7 +37,7 @@ export function deleteDiagnosisBind(id) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/diagnosis-belong-binding?id=' + id,
|
||||
method: 'delete',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,8 +47,8 @@ export function getDiagnosisDefinitionList(queryParams) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/condition-definition-metadata',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ export function getConditionDefinitionInfo(patientId) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/get-condition-definition-class?patientId=' + patientId,
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,29 +68,29 @@ 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',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,8 +112,8 @@ export function getTcmCondition(params) {
|
||||
return request({
|
||||
url: '/doctor-station/chinese-medical/condition-info',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,8 +123,8 @@ export function getTcmSyndrome(params) {
|
||||
return request({
|
||||
url: '/doctor-station/chinese-medical/syndrome-info',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,8 +134,8 @@ export function getTcmDiagnosis(params) {
|
||||
return request({
|
||||
url: '/doctor-station/chinese-medical/get-tcm-encounter-diagnosis',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,8 +145,8 @@ export function saveTcmDiagnosis(data) {
|
||||
return request({
|
||||
url: '/doctor-station/chinese-medical/save-tcm-diagnosis',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取人员慢性病诊断
|
||||
@@ -155,10 +155,11 @@ export function getChronicDisease(params) {
|
||||
return request({
|
||||
url: '/yb-request/getConditionDefinition',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取药品列表
|
||||
*/
|
||||
@@ -166,8 +167,8 @@ export function getAdviceBaseInfo(queryParams) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/advice-base-info',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,8 +178,8 @@ export function savePrescription(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/save-reg-advice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 签发处方
|
||||
@@ -187,8 +188,8 @@ export function savePrescriptionSign(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/sign-reg-advice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 处方签退
|
||||
@@ -197,8 +198,8 @@ export function singOut(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/sign-off-reg',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 停嘱
|
||||
@@ -207,8 +208,8 @@ export function stopAdvice(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/stop-reg-advice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取患者本次就诊处方
|
||||
@@ -217,7 +218,7 @@ export function getPrescriptionList(encounterId) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/advice-manage/reg-request-base-info?encounterId=' + encounterId,
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,8 +228,8 @@ export function getContract(params) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/get-encounter-contract',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,7 +239,7 @@ export function getOrgTree() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -257,28 +258,6 @@ export function updateGroupId(data) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/update-groupid',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目绑定信息
|
||||
*/
|
||||
export function getBindDevice(data) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/order-bind-info',
|
||||
method: 'get',
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 出院
|
||||
*/
|
||||
export function leaveHospital(data) {
|
||||
return request({
|
||||
url: '/reg-doctorstation/special-advice/leave-hospital-orders',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,318 +1,87 @@
|
||||
<!--
|
||||
* @Author: sjjh
|
||||
* @Date: 2025-09-05 21:16:06
|
||||
* @Description: 输血申请详情
|
||||
-->
|
||||
<template>
|
||||
<div class="report-container">
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>输血申请</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loading }"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="applicationShow-container">
|
||||
<div class="applicationShow-container-header">
|
||||
<el-button @click="getInfo">刷新</el-button>
|
||||
</div>
|
||||
<div class="applicationShow-container-content">
|
||||
<el-descriptions title="输血申请详情" :column="2">
|
||||
<el-descriptions-item label="Username">kooriookami</el-descriptions-item>
|
||||
<el-descriptions-item label="患者姓名">{{ patientInfoValue?.patientName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="患者性别">{{ patientInfoValue?.patientSex || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="患者年龄">{{ patientInfoValue?.patientAge || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="患者手机号">{{ patientInfoValue?.patientPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="患者身份证号">{{ patientInfoValue?.patientIdCard || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="患者地址">{{ patientInfoValue?.patientAddress || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="applicationShow-container-table">
|
||||
<el-table :data="dataList">
|
||||
<el-table-column label="医嘱名称" prop="adviceName" />
|
||||
<el-table-column label="输血数量" prop="adviceDefinitionId" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
title="输血申请详情"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="currentDetail" class="applicationShow-container">
|
||||
<div class="applicationShow-container-content">
|
||||
<el-descriptions title="基本信息" :column="2">
|
||||
<el-descriptions-item label="患者姓名">{{
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="处方号">{{
|
||||
currentDetail.prescriptionNo || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请者">{{
|
||||
currentDetail.requesterId_dictText || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="就诊ID">{{
|
||||
currentDetail.encounterId || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单ID">{{
|
||||
currentDetail.requestFormId || '-'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div v-if="descJsonData && hasMatchedFields" class="applicationShow-container-content">
|
||||
<el-descriptions title="申请单描述" :column="2">
|
||||
<template v-for="(value, key) in descJsonData" :key="key">
|
||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||
{{ value || '-' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="currentDetail.requestFormDetailList && currentDetail.requestFormDetailList.length"
|
||||
class="applicationShow-container-table"
|
||||
>
|
||||
<el-table :data="currentDetail.requestFormDetailList" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, watch, computed } from 'vue';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref, computed } from 'vue'
|
||||
import { getBloodTransfusion } from './api';
|
||||
import { getOrgList } from '../../../../doctorstation/components/api.js';
|
||||
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits([])
|
||||
const props = defineProps({
|
||||
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
const detailDialogVisible = ref(false);
|
||||
const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
})
|
||||
const state = reactive({
|
||||
|
||||
const fetchData = async () => {
|
||||
if (!patientInfo.value?.encounterId) {
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getBloodTransfusion({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
tableData.value = list.filter(Boolean);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
} catch (e) {
|
||||
proxy.$modal?.msgError?.(e.message || '查询输血申请失败');
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
const handleRefresh = async () => {
|
||||
if (loading.value || !patientInfo.value?.encounterId) return;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
symptom: '症状',
|
||||
sign: '体征',
|
||||
clinicalDiagnosis: '临床诊断',
|
||||
otherDiagnosis: '其他诊断',
|
||||
relatedResult: '相关结果',
|
||||
attention: '注意事项',
|
||||
};
|
||||
|
||||
const isFieldMatched = (key) => {
|
||||
return key in labelMap;
|
||||
};
|
||||
|
||||
const getFieldLabel = (key) => {
|
||||
return labelMap[key] || key;
|
||||
};
|
||||
|
||||
const hasMatchedFields = computed(() => {
|
||||
if (!descJsonData.value) return false;
|
||||
return Object.keys(descJsonData.value).some((key) => isFieldMatched(key));
|
||||
// 使用计算属性确保安全访问
|
||||
const patientInfoValue = computed(() => {
|
||||
return patientInfo.value || {};
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
let name = '';
|
||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||
const obj = orgOptions.value[index];
|
||||
if (obj.id == targetDepartment) {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
const dataList = ref([])
|
||||
const getInfo = () => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getBloodTransfusion({
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
dataList.value = res.data
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return name;
|
||||
};
|
||||
onBeforeMount(() => {
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
try {
|
||||
// descJsonData.value = JSON.parse(row.descJson);
|
||||
const obj = JSON.parse(row.descJson);
|
||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||
descJsonData.value = obj;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
descJsonData.value = null;
|
||||
}
|
||||
} else {
|
||||
descJsonData.value = null;
|
||||
}
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
})
|
||||
onMounted(() => {
|
||||
getInfo()
|
||||
})
|
||||
defineExpose({ state })
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
refresh: fetchData,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-refresh-icon {
|
||||
cursor: pointer;
|
||||
color: #909399;
|
||||
transition: color 0.2s;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.report-refresh-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.report-refresh-icon.is-loading {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.applicationShow-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 70vh;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.applicationShow-container-content {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 0px;
|
||||
.applicationShow-container-header{
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap:8px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.applicationShow-container-table {
|
||||
flex-shrink: 0;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
.applicationShow-container-content{
|
||||
flex: 1;
|
||||
}
|
||||
.applicationShow-container-table{
|
||||
height: 400px;
|
||||
flex:auto
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -4,316 +4,42 @@
|
||||
* @Description: 检查申请详情
|
||||
-->
|
||||
<template>
|
||||
<div class="report-container">
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>检查申请</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loading }"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
title="检查申请详情"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="currentDetail" class="applicationShow-container">
|
||||
<div class="applicationShow-container-content">
|
||||
<el-descriptions title="基本信息" :column="2">
|
||||
<el-descriptions-item label="患者姓名">{{
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="处方号">{{
|
||||
currentDetail.prescriptionNo || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请者">{{
|
||||
currentDetail.requesterId_dictText || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="就诊ID">{{
|
||||
currentDetail.encounterId || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单ID">{{
|
||||
currentDetail.requestFormId || '-'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div v-if="descJsonData && hasMatchedFields" class="applicationShow-container-content">
|
||||
<el-descriptions title="申请单描述" :column="2">
|
||||
<template v-for="(value, key) in descJsonData" :key="key">
|
||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||
{{ value || '-' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="currentDetail.requestFormDetailList && currentDetail.requestFormDetailList.length"
|
||||
class="applicationShow-container-table"
|
||||
>
|
||||
<el-table :data="currentDetail.requestFormDetailList" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="container">
|
||||
<el-button @click="getInfo">查询</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, watch, computed } from 'vue';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
</template>
|
||||
<script setup >
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue'
|
||||
import { getCheck } from './api';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { getCheck } from './api';
|
||||
import { getOrgList } from '../../../../doctorstation/components/api.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
const detailDialogVisible = ref(false);
|
||||
const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
|
||||
const fetchData = async () => {
|
||||
if (!patientInfo.value?.encounterId) {
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getCheck({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
tableData.value = list.filter(Boolean);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
} catch (e) {
|
||||
proxy.$modal?.msgError?.(e.message || '查询检查申请失败');
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefresh = async () => {
|
||||
if (loading.value || !patientInfo.value?.encounterId) return;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
symptom: '症状',
|
||||
sign: '体征',
|
||||
clinicalDiagnosis: '临床诊断',
|
||||
otherDiagnosis: '其他诊断',
|
||||
relatedResult: '相关结果',
|
||||
attention: '注意事项',
|
||||
};
|
||||
|
||||
const isFieldMatched = (key) => {
|
||||
return key in labelMap;
|
||||
};
|
||||
|
||||
const getFieldLabel = (key) => {
|
||||
return labelMap[key] || key;
|
||||
};
|
||||
|
||||
const hasMatchedFields = computed(() => {
|
||||
if (!descJsonData.value) return false;
|
||||
return Object.keys(descJsonData.value).some((key) => isFieldMatched(key));
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
let name = '';
|
||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||
const obj = orgOptions.value[index];
|
||||
if (obj.id == targetDepartment) {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits([])
|
||||
const props = defineProps({
|
||||
|
||||
})
|
||||
const state = reactive({
|
||||
|
||||
})
|
||||
const getInfo = () => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getCheck({
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
console.log('targetDepartment========>', JSON.stringify(row));
|
||||
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
try {
|
||||
const obj = JSON.parse(row.descJson);
|
||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||
descJsonData.value = obj;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
descJsonData.value = null;
|
||||
}
|
||||
} else {
|
||||
descJsonData.value = null;
|
||||
}
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
refresh: fetchData,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-refresh-icon {
|
||||
cursor: pointer;
|
||||
color: #909399;
|
||||
transition: color 0.2s;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.report-refresh-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.report-refresh-icon.is-loading {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.applicationShow-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 70vh;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.applicationShow-container-content {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.applicationShow-container-table {
|
||||
flex-shrink: 0;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
onBeforeMount(() => {
|
||||
|
||||
})
|
||||
onMounted(() => {
|
||||
getInfo()
|
||||
})
|
||||
defineExpose({ state })
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,238 +0,0 @@
|
||||
<template>
|
||||
<div class="report-container">
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>检查报告</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loadingCheck }"
|
||||
@click="handleRefreshCheck"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loadingCheck"
|
||||
:data="checkReportList"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="报告名称" width="140" />
|
||||
<el-table-column prop="reportNo" label="报告号" width="140" />
|
||||
<el-table-column label="链接" min-width="140">
|
||||
<template #default="scope">
|
||||
<a
|
||||
v-if="scope.row.requestUrl"
|
||||
class="report-link"
|
||||
:href="scope.row.requestUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
查看报告
|
||||
</a>
|
||||
<span v-else class="report-link-disabled">暂无链接</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>检验报告</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loadingInspection }"
|
||||
@click="handleRefreshInspection"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loadingInspection"
|
||||
:data="inspectionReportList"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="报告名称" width="140" />
|
||||
<el-table-column prop="reportNo" label="报告号" width="140" />
|
||||
<el-table-column label="链接" min-width="140">
|
||||
<template #default="scope">
|
||||
<a
|
||||
v-if="scope.row.requestUrl"
|
||||
class="report-link"
|
||||
:href="scope.row.requestUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
查看报告
|
||||
</a>
|
||||
<span v-else class="report-link-disabled">暂无链接</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, watch } from 'vue';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { getProofResult, getTestResult } from './api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const checkReportList = ref([]);
|
||||
const inspectionReportList = ref([]);
|
||||
const loadingCheck = ref(false);
|
||||
const loadingInspection = ref(false);
|
||||
|
||||
const fetchCheckReport = async () => {
|
||||
if (!patientInfo.value?.encounterId) return;
|
||||
const res = await getTestResult({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
checkReportList.value = list.filter(Boolean).map((item) => ({
|
||||
reportNo: item.busNo,
|
||||
requestUrl: item.requestUrl,
|
||||
adviceName: item.adviceName,
|
||||
_raw: item,
|
||||
}));
|
||||
} else {
|
||||
checkReportList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const fetchInspectionReport = async () => {
|
||||
if (!patientInfo.value?.encounterId) return;
|
||||
const res = await getProofResult({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
inspectionReportList.value = list.filter(Boolean).map((item) => ({
|
||||
reportNo: item.busNo,
|
||||
requestUrl: item.requestUrl,
|
||||
adviceName: item.adviceName,
|
||||
_raw: item,
|
||||
}));
|
||||
} else {
|
||||
inspectionReportList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAll = async () => {
|
||||
if (!patientInfo.value?.encounterId) {
|
||||
checkReportList.value = [];
|
||||
inspectionReportList.value = [];
|
||||
loadingCheck.value = false;
|
||||
loadingInspection.value = false;
|
||||
return;
|
||||
}
|
||||
loadingCheck.value = true;
|
||||
loadingInspection.value = true;
|
||||
try {
|
||||
await Promise.all([fetchCheckReport(), fetchInspectionReport()]);
|
||||
} catch (e) {
|
||||
proxy.$modal?.msgError?.(e.message || '查询报告失败');
|
||||
} finally {
|
||||
loadingCheck.value = false;
|
||||
loadingInspection.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefreshCheck = async () => {
|
||||
if (loadingCheck.value || !patientInfo.value?.encounterId) return;
|
||||
loadingCheck.value = true;
|
||||
try {
|
||||
await fetchCheckReport();
|
||||
} finally {
|
||||
loadingCheck.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefreshInspection = async () => {
|
||||
if (loadingInspection.value || !patientInfo.value?.encounterId) return;
|
||||
loadingInspection.value = true;
|
||||
try {
|
||||
await fetchInspectionReport();
|
||||
} finally {
|
||||
loadingInspection.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fetchAll();
|
||||
} else {
|
||||
checkReportList.value = [];
|
||||
inspectionReportList.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
max-height: 55%;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.report-table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.report-refresh-icon {
|
||||
cursor: pointer;
|
||||
color: #909399;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.report-refresh-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.report-link {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.report-link-disabled {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
</style>
|
||||
@@ -4,315 +4,33 @@
|
||||
* @Description: 手术申请详情
|
||||
-->
|
||||
<template>
|
||||
<div class="report-container">
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>手术申请</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loading }"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
title="手术申请详情"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="currentDetail" class="applicationShow-container">
|
||||
<div class="applicationShow-container-content">
|
||||
<el-descriptions title="基本信息" :column="2">
|
||||
<el-descriptions-item label="患者姓名">{{
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="处方号">{{
|
||||
currentDetail.prescriptionNo || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请者">{{
|
||||
currentDetail.requesterId_dictText || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="就诊ID">{{
|
||||
currentDetail.encounterId || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单ID">{{
|
||||
currentDetail.requestFormId || '-'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div v-if="descJsonData && hasMatchedFields" class="applicationShow-container-content">
|
||||
<el-descriptions title="申请单描述" :column="2">
|
||||
<template v-for="(value, key) in descJsonData" :key="key">
|
||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||
{{ value || '-' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="currentDetail.requestFormDetailList && currentDetail.requestFormDetailList.length"
|
||||
class="applicationShow-container-table"
|
||||
>
|
||||
<el-table :data="currentDetail.requestFormDetailList" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="container">
|
||||
<el-button @click="getInfo">查询</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, watch, computed } from 'vue';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
import { getSurgery } from './api';
|
||||
import { getOrgList } from '../../../../doctorstation/components/api.js';
|
||||
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
const detailDialogVisible = ref(false);
|
||||
const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
|
||||
const fetchData = async () => {
|
||||
if (!patientInfo.value?.encounterId) {
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getSurgery({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
tableData.value = list.filter(Boolean);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
} catch (e) {
|
||||
proxy.$modal?.msgError?.(e.message || '查询手术申请失败');
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefresh = async () => {
|
||||
if (loading.value || !patientInfo.value?.encounterId) return;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
symptom: '症状',
|
||||
sign: '体征',
|
||||
clinicalDiagnosis: '临床诊断',
|
||||
otherDiagnosis: '其他诊断',
|
||||
relatedResult: '相关结果',
|
||||
attention: '注意事项',
|
||||
};
|
||||
|
||||
const isFieldMatched = (key) => {
|
||||
return key in labelMap;
|
||||
};
|
||||
|
||||
const getFieldLabel = (key) => {
|
||||
return labelMap[key] || key;
|
||||
};
|
||||
|
||||
const hasMatchedFields = computed(() => {
|
||||
if (!descJsonData.value) return false;
|
||||
return Object.keys(descJsonData.value).some((key) => isFieldMatched(key));
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
let name = '';
|
||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||
const obj = orgOptions.value[index];
|
||||
if (obj.id == targetDepartment) {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
const emits = defineEmits([]);
|
||||
const props = defineProps({});
|
||||
const state = reactive({});
|
||||
const getInfo = () => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getSurgery({
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
try {
|
||||
// descJsonData.value = JSON.parse(row.descJson);
|
||||
const obj = JSON.parse(row.descJson);
|
||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||
descJsonData.value = obj;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
descJsonData.value = null;
|
||||
}
|
||||
} else {
|
||||
descJsonData.value = null;
|
||||
}
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
refresh: fetchData,
|
||||
onBeforeMount(() => {});
|
||||
onMounted(() => {
|
||||
getInfo();
|
||||
});
|
||||
defineExpose({ state });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-refresh-icon {
|
||||
cursor: pointer;
|
||||
color: #909399;
|
||||
transition: color 0.2s;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.report-refresh-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.report-refresh-icon.is-loading {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.applicationShow-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 70vh;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.applicationShow-container-content {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.applicationShow-container-table {
|
||||
flex-shrink: 0;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -4,315 +4,34 @@
|
||||
* @Description: 检验申请
|
||||
-->
|
||||
<template>
|
||||
<div class="report-container">
|
||||
<div class="report-section">
|
||||
<div class="report-title">
|
||||
<span>检验申请</span>
|
||||
<el-icon
|
||||
class="report-refresh-icon"
|
||||
:class="{ 'is-loading': loading }"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="report-table-wrapper">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
title="检验申请详情"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-if="currentDetail" class="applicationShow-container">
|
||||
<div class="applicationShow-container-content">
|
||||
<el-descriptions title="基本信息" :column="2">
|
||||
<el-descriptions-item label="患者姓名">{{
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="处方号">{{
|
||||
currentDetail.prescriptionNo || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请者">{{
|
||||
currentDetail.requesterId_dictText || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="就诊ID">{{
|
||||
currentDetail.encounterId || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单ID">{{
|
||||
currentDetail.requestFormId || '-'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div v-if="descJsonData && hasMatchedFields" class="applicationShow-container-content">
|
||||
<el-descriptions title="申请单描述" :column="2">
|
||||
<template v-for="(value, key) in descJsonData" :key="key">
|
||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||
{{ value || '-' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="currentDetail.requestFormDetailList && currentDetail.requestFormDetailList.length"
|
||||
class="applicationShow-container-table"
|
||||
>
|
||||
<el-table :data="currentDetail.requestFormDetailList" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="container">
|
||||
<el-button @click="getInfo">查询</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref, watch, computed } from 'vue';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
import { getInspection } from './api';
|
||||
import { getOrgList } from '../../../../doctorstation/components/api.js';
|
||||
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
const detailDialogVisible = ref(false);
|
||||
const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
|
||||
const fetchData = async () => {
|
||||
if (!patientInfo.value?.encounterId) {
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getInspection({ encounterId: patientInfo.value.encounterId });
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
tableData.value = list.filter(Boolean);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
} catch (e) {
|
||||
proxy.$modal?.msgError?.(e.message || '查询检验申请失败');
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefresh = async () => {
|
||||
if (loading.value || !patientInfo.value?.encounterId) return;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
symptom: '症状',
|
||||
sign: '体征',
|
||||
clinicalDiagnosis: '临床诊断',
|
||||
otherDiagnosis: '其他诊断',
|
||||
relatedResult: '相关结果',
|
||||
attention: '注意事项',
|
||||
};
|
||||
|
||||
const isFieldMatched = (key) => {
|
||||
return key in labelMap;
|
||||
};
|
||||
|
||||
const getFieldLabel = (key) => {
|
||||
return labelMap[key] || key;
|
||||
};
|
||||
|
||||
const hasMatchedFields = computed(() => {
|
||||
if (!descJsonData.value) return false;
|
||||
return Object.keys(descJsonData.value).some((key) => isFieldMatched(key));
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
let name = '';
|
||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||
const obj = orgOptions.value[index];
|
||||
if (obj.id == targetDepartment) {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
const emits = defineEmits([]);
|
||||
const props = defineProps({});
|
||||
const state = reactive({});
|
||||
const getInfo = () => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getInspection({
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
try {
|
||||
const obj = JSON.parse(row.descJson);
|
||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||
descJsonData.value = obj;
|
||||
// descJsonData.value = JSON.parse(row.descJson);
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
descJsonData.value = null;
|
||||
}
|
||||
} else {
|
||||
descJsonData.value = null;
|
||||
}
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
refresh: fetchData,
|
||||
onBeforeMount(() => {});
|
||||
onMounted(() => {
|
||||
getInfo();
|
||||
});
|
||||
defineExpose({ state });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.report-section {
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.report-refresh-icon {
|
||||
cursor: pointer;
|
||||
color: #909399;
|
||||
transition: color 0.2s;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.report-refresh-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.report-refresh-icon.is-loading {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.applicationShow-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 70vh;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.applicationShow-container-content {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.applicationShow-container-table {
|
||||
flex-shrink: 0;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</el-input>
|
||||
</div>
|
||||
<el-table
|
||||
:data="conditionDatas"
|
||||
:data="conditionList"
|
||||
max-height="460"
|
||||
@row-click="handleClickRow"
|
||||
highlight-current-row
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="syndrome-section">
|
||||
<div class="section-title">证候</div>
|
||||
<div class="search-box">
|
||||
<el-input v-model="searchMiddleDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<template #prefix>
|
||||
<el-icon><search /></el-icon>
|
||||
</template>
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div v-if="selectedDisease">
|
||||
<el-table
|
||||
:data="syndromeListDatas"
|
||||
:data="syndromeList"
|
||||
max-height="460"
|
||||
@row-click="clickSyndromeRow"
|
||||
highlight-current-row
|
||||
@@ -85,14 +85,13 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
getTcmCondition,
|
||||
getTcmSyndrome,
|
||||
saveTcmDiagnosis,
|
||||
} from '@/views/doctorstation/components/api';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
openAddDiagnosisDialog: {
|
||||
@@ -112,8 +111,6 @@ const tcmDiagonsisSaveList = ref([]);
|
||||
const syndromeSelected = ref(false); // 当前诊断是否选择对应证候
|
||||
const timestamp = ref('');
|
||||
const selectedDisease = ref(false);
|
||||
const searchDisease = ref('');
|
||||
const searchMiddleDisease = ref('');
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
@@ -123,26 +120,6 @@ function handleOpen() {
|
||||
});
|
||||
}
|
||||
|
||||
// 搜索诊断
|
||||
const conditionDatas = computed(() => {
|
||||
return conditionList.value.filter((item) => {
|
||||
if (searchDisease.value) {
|
||||
return searchDisease.value == item.name || searchDisease.value == item.ybNo;
|
||||
}
|
||||
return conditionList;
|
||||
});
|
||||
});
|
||||
|
||||
// 后证
|
||||
const syndromeListDatas = computed(() => {
|
||||
return syndromeList.value.filter((item) => {
|
||||
if (searchMiddleDisease.value) {
|
||||
return searchMiddleDisease.value == item.name || searchMiddleDisease.value == item.ybNo;
|
||||
}
|
||||
return syndromeList;
|
||||
});
|
||||
});
|
||||
|
||||
// 点击诊断列表处理,点击以后才显示证候列表
|
||||
function handleClickRow(row) {
|
||||
if (syndromeSelected.value || tcmDiagonsisList.value == 0) {
|
||||
@@ -179,7 +156,7 @@ function clickSyndromeRow(row) {
|
||||
// 删除诊断
|
||||
function removeDiagnosis(row, index) {
|
||||
tcmDiagonsisList.value.splice(index, 1);
|
||||
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.value.filter((item) => {
|
||||
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.filter((item) => {
|
||||
return item.syndromeGroupNo !== row.syndromeGroupNo;
|
||||
});
|
||||
}
|
||||
@@ -441,4 +418,4 @@ function close() {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1,633 +0,0 @@
|
||||
<template>
|
||||
<el-form :model="row" :rules="rules" :ref="(el) => (formRef = el)" :label-width="100">
|
||||
<div class="expend_div" style="padding: 16px; background: #f8f9fa; border-radius: 8px">
|
||||
<template v-if="row.adviceType == 1">
|
||||
<div style="display: flex; align-items: center; margin-bottom: 16px; gap: 16px">
|
||||
<span class="medicine-title">
|
||||
{{
|
||||
row.adviceName +
|
||||
' ' +
|
||||
row.volume +
|
||||
' [' +
|
||||
Number(row.unitPrice).toFixed(2) +
|
||||
' 元' +
|
||||
'/' +
|
||||
row.unitCode_dictText +
|
||||
']'
|
||||
}}
|
||||
</span>
|
||||
<el-form-item prop="lotNumber" label="药房:">
|
||||
<el-select
|
||||
v-model="row.inventoryId"
|
||||
style="width: 330px; margin-right: 20px"
|
||||
placeholder="药房"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in row.stockList"
|
||||
:key="item.inventoryId"
|
||||
:value="item.inventoryId"
|
||||
:label="`${item.locationName} 批次号: ${item.lotNumber ?? '-'} 库存:${stockFormat(
|
||||
row.partPercent,
|
||||
row.unitCodeList,
|
||||
item.quantity
|
||||
)}`"
|
||||
@click="handleNumberClick(item)"
|
||||
>
|
||||
<div style="display: flex; gap: 8px; align-items: center">
|
||||
<span>{{ item.locationName }}</span>
|
||||
<span>批次号: {{ item.lotNumber ?? '-' }}</span>
|
||||
<span>
|
||||
库存:{{ stockFormat(row.partPercent, row.unitCodeList, item.quantity) }}
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="执行次数:"
|
||||
prop="executeNum"
|
||||
class="required-field"
|
||||
data-prop="executeNum"
|
||||
v-if="row.injectFlag == 1"
|
||||
>
|
||||
<el-input-number
|
||||
:min="1"
|
||||
v-model="row.executeNum"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => setInputRef('executeNum', el)"
|
||||
@keyup.enter.prevent="handleEnter('executeNum')"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<span class="medicine-info"> 诊断:{{ config.diagnosisName }} </span>
|
||||
<span class="medicine-info"> 皮试:{{ row.skinTestFlag_enumText }} </span>
|
||||
<span class="medicine-info"> 注射药品:{{ row.injectFlag_enumText }} </span>
|
||||
<span class="total-amount" v-if="row.therapyEnum == '2'">
|
||||
总金额:{{ row.totalPrice ? Number(row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }}
|
||||
</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap">
|
||||
<div class="form-group">
|
||||
<!-- 单次剂量 -->
|
||||
<el-form-item
|
||||
label="单次用量:"
|
||||
prop="doseQuantity"
|
||||
class="required-field"
|
||||
data-prop="doseQuantity"
|
||||
>
|
||||
<el-input-number
|
||||
:min="0"
|
||||
v-model="row.doseQuantity"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
style="width: 70px"
|
||||
:ref="(el) => setInputRef('doseQuantity', el)"
|
||||
@input="convertValues"
|
||||
@keyup.enter.prevent="handleEnter('doseQuantity')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 剂量单位 -->
|
||||
<el-select
|
||||
v-model="row.minUnitCode"
|
||||
style="width: 70px; margin-right: 32px"
|
||||
placeholder=" "
|
||||
>
|
||||
<template v-for="item in row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="item.type == config.unitMap['minUnit']"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
<span>=</span>
|
||||
<!-- 单次剂量 -->
|
||||
<el-form-item prop="dose" class="required-field" data-prop="dose" label-width="0">
|
||||
<el-input-number
|
||||
v-model="row.dose"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
style="width: 70px; margin-left: 32px"
|
||||
:ref="(el) => setInputRef('dose', el)"
|
||||
@input="convertDoseValues"
|
||||
@keyup.enter.prevent="handleEnter('dose')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 全部单位 -->
|
||||
<el-select
|
||||
v-model="row.doseUnitCode"
|
||||
style="width: 70px"
|
||||
placeholder=" "
|
||||
@change="convertValues"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in row.unitCodeList"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
:key="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<el-form-item
|
||||
label="给药途径:"
|
||||
prop="methodCode"
|
||||
class="required-field"
|
||||
data-prop="methodCode"
|
||||
>
|
||||
<el-select
|
||||
v-model="row.methodCode"
|
||||
placeholder="给药途径"
|
||||
clearable
|
||||
filterable
|
||||
:ref="(el) => setInputRef('methodCode', el)"
|
||||
style="width: 120px"
|
||||
@keyup.enter.prevent="
|
||||
() => {
|
||||
if (row.methodCode) {
|
||||
handleEnter('methodCode');
|
||||
}
|
||||
}
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in config.methodCode"
|
||||
@click="() => (row.methodCode_dictText = dict.label)"
|
||||
@keyup="handleEnter('methodCode')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="用药频次:"
|
||||
prop="rateCode"
|
||||
class="required-field"
|
||||
data-prop="rateCode"
|
||||
>
|
||||
<el-select
|
||||
v-model="row.rateCode"
|
||||
placeholder="频次"
|
||||
style="width: 120px"
|
||||
filterable
|
||||
:disabled="row.therapyEnum == '2'"
|
||||
@keyup.enter.prevent="
|
||||
() => {
|
||||
if (row.rateCode) {
|
||||
handleEnter('rateCode');
|
||||
}
|
||||
}
|
||||
"
|
||||
:ref="(el) => setInputRef('rateCode', el)"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in config.rateCode"
|
||||
@click="() => (row.rateCode_dictText = dict.label)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px"
|
||||
>
|
||||
<div class="form-group">
|
||||
<template v-if="row.therapyEnum == '2'">
|
||||
<el-form-item
|
||||
label="用药天数:"
|
||||
prop="dispensePerDuration"
|
||||
class="required-field"
|
||||
data-prop="dispensePerDuration"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.dispensePerDuration"
|
||||
style="width: 148px"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => setInputRef('dispensePerDuration', el)"
|
||||
@keyup.enter.prevent="handleEnter('dispensePerDuration')"
|
||||
>
|
||||
<template #suffix>天</template>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="总量:"
|
||||
prop="quantity"
|
||||
class="required-field"
|
||||
data-prop="quantity"
|
||||
label-width="80"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.quantity"
|
||||
style="width: 70px"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => setInputRef('quantity', el)"
|
||||
@keyup.enter.prevent="handleEnter('quantity')"
|
||||
@input="calculateTotalPrice"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select
|
||||
v-model="row.unitCode"
|
||||
style="width: 70px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount"
|
||||
>
|
||||
<template v-for="item in row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="checkUnit(item)"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
@click="
|
||||
() => {
|
||||
if (item.type == config.unitMap['minUnit']) {
|
||||
row.unitPrice = row.minUnitPrice;
|
||||
} else {
|
||||
row.unitPrice = row.unitTempPrice;
|
||||
}
|
||||
row.unitCode_dictText = item.label;
|
||||
}
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-if="row.therapyEnum == '1'">
|
||||
<el-form-item
|
||||
label="首次用量:"
|
||||
prop="firstDose"
|
||||
class="required-field"
|
||||
data-prop="firstDose"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.firstDose"
|
||||
style="width: 70px"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => setInputRef('firstDose', el)"
|
||||
@keyup.enter.prevent="handleEnter('firstDose')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select v-model="row.unitCode" style="width: 70px" placeholder=" ">
|
||||
<template v-for="item in row.unitCodeList" :key="item.value">
|
||||
<el-option v-if="checkUnit(item)" :value="item.value" :label="item.label" />
|
||||
</template>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<el-button type="primary" @click="handleSave">确定</el-button>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="row.adviceType == 2">
|
||||
<div style="display: flex; align-items: center; margin-bottom: 16px; gap: 16px">
|
||||
<span style="font-size: 16px; font-weight: 600">
|
||||
{{
|
||||
row.adviceName +
|
||||
' ' +
|
||||
row.volume +
|
||||
' ' +
|
||||
row.unitPrice +
|
||||
' 元/' +
|
||||
row.unitCode_dictText
|
||||
}}
|
||||
</span>
|
||||
<div class="form-group">
|
||||
<el-select
|
||||
v-model="row.lotNumber"
|
||||
style="width: 180px; margin-right: 20px"
|
||||
placeholder="药房"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in row.stockList"
|
||||
:key="item.inventoryId"
|
||||
:value="item.inventoryId"
|
||||
:label="`${item.locationName} 批次号: ${item.lotNumber ?? '-'} 库存:${stockFormat(
|
||||
row.partPercent,
|
||||
row.unitCodeList,
|
||||
item.quantity
|
||||
)}`"
|
||||
@click="handleNumberClick(item)"
|
||||
>
|
||||
<div style="display: flex; gap: 8px; align-items: center">
|
||||
<span>{{ item.locationName }}</span>
|
||||
<span>批次号: {{ item.lotNumber ?? '-' }}</span>
|
||||
<span>
|
||||
库存:{{ stockFormat(row.partPercent, row.unitCodeList, item.quantity) }}
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-form-item
|
||||
label="数量:"
|
||||
prop="quantity"
|
||||
class="required-field"
|
||||
data-prop="quantity"
|
||||
>
|
||||
<el-input-number
|
||||
placeholder="数量"
|
||||
v-model="row.quantity"
|
||||
style="width: 70px"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
@keyup.enter.prevent="handleEnter('quantity')"
|
||||
@input="calculateTotalAmount"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select
|
||||
v-model="row.unitCode"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount"
|
||||
>
|
||||
<template v-for="item in row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="item.type != config.unitMap['dose']"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
@click="() => (row.unitCode_dictText = item.label)"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
<span class="total-amount" v-if="row.therapyEnum == '2'">
|
||||
总金额:{{ row.totalPrice ? Number(row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<el-button type="primary" @click="handleSave">确定</el-button>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="display: flex; align-items: center; margin-bottom: 16px; gap: 16px">
|
||||
<span style="font-size: 16px; font-weight: 600">
|
||||
{{ row.adviceName }}
|
||||
{{ row.unitPrice ? Number(row.unitPrice).toFixed(2) + '/次' : '-' + '元' }}
|
||||
</span>
|
||||
<div class="form-group">
|
||||
<el-form-item
|
||||
label="执行次数:"
|
||||
prop="quantity"
|
||||
class="required-field"
|
||||
data-prop="quantity"
|
||||
>
|
||||
<el-input-number
|
||||
placeholder="执行次数"
|
||||
style="width: 100px; margin: 0 20px"
|
||||
v-model="row.quantity"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
@keyup.enter.prevent="handleEnter('quantity')"
|
||||
@input="calculateTotalPrice"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="执行科室:" prop="orgId" class="required-field" data-prop="orgId">
|
||||
<el-tree-select
|
||||
clearable
|
||||
v-model="row.orgId"
|
||||
style="width: 200px"
|
||||
:data="config.organization"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
@change="handleOrgChange"
|
||||
placeholder="请选择执行科室"
|
||||
/>
|
||||
</el-form-item>
|
||||
<span class="total-amount" v-if="row.therapyEnum == '2'">
|
||||
总金额:{{ row.totalPrice ? Number(row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }}
|
||||
</span>
|
||||
<span style="font-size: 16px; font-weight: 600">
|
||||
<!-- 金额: {{ row.priceList[0].price }} -->
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<el-button type="primary" @click="handleSave">确定</el-button>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, nextTick, getCurrentInstance, watch, onMounted } from 'vue';
|
||||
|
||||
interface Config {
|
||||
diagnosisName: string; // 仅用于显示
|
||||
methodCode: any[];
|
||||
rateCode: any[];
|
||||
organization: any[];
|
||||
unitMap: {
|
||||
dose: string;
|
||||
minUnit: string;
|
||||
unit: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Handlers {
|
||||
handleEnter: (prop: string, row: any, index: number) => void;
|
||||
handleNumberClick: (item: any, index: number, row: any) => void;
|
||||
handleOrgChange: (value: any, index: number) => void;
|
||||
convertValue: (type: 'dose' | 'doseQuantity', row: any, index: number) => void;
|
||||
calculateTotal: (type: 'price' | 'amount', row: any, index: number) => void;
|
||||
setInputRef: (prop: string, el: any) => void;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
row: any;
|
||||
index: number;
|
||||
formRefName: string;
|
||||
rules: any;
|
||||
config: Config;
|
||||
handlers: Handlers;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'save', row: any, index: number): void;
|
||||
(e: 'cancel', row: any, index: number): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
// 创建表单 ref
|
||||
const formRef = ref();
|
||||
|
||||
// 将表单 ref 注册到父组件的 $refs 上,以便父组件可以通过 proxy.$refs['formRef' + index] 访问
|
||||
const registerFormRef = () => {
|
||||
if (formRef.value && proxy?.$parent?.$refs) {
|
||||
proxy.$parent.$refs[props.formRefName] = formRef.value;
|
||||
}
|
||||
};
|
||||
|
||||
// 监听 formRef 变化,确保注册
|
||||
watch(
|
||||
() => formRef.value,
|
||||
() => {
|
||||
if (formRef.value) {
|
||||
nextTick(() => {
|
||||
registerFormRef();
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
registerFormRef();
|
||||
});
|
||||
if (props.row.therapyEnum == '2' && !props.row.rateCode) {
|
||||
setRateCodeToST();
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.row.therapyEnum,
|
||||
(newVal) => {
|
||||
if (newVal == '2') {
|
||||
setRateCodeToST();
|
||||
} else if (newVal == '1') {
|
||||
props.row.rateCode = '';
|
||||
props.row.rateCode_dictText = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const setRateCodeToST = () => {
|
||||
if (Array.isArray(props.config.rateCode)) {
|
||||
const stOption = props.config.rateCode.find((item) => item.value === 'ST');
|
||||
if (stOption) {
|
||||
props.row.rateCode = 'ST';
|
||||
props.row.rateCode_dictText = stOption.label;
|
||||
} else {
|
||||
props.row.rateCode = 'ST';
|
||||
props.row.rateCode_dictText = '立即';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 格式化库存显示
|
||||
const stockFormat = (partPercent: number, unitList: any[], quantity: number): string => {
|
||||
const unitCode = unitList.find((item) => item.type == 'unit')?.label;
|
||||
const minUnitCode = unitList.find((item) => item.type == 'minUnit')?.label;
|
||||
|
||||
const a = quantity % partPercent;
|
||||
const b = Math.floor(quantity / partPercent);
|
||||
if (a == 0) {
|
||||
return b + ' ' + unitCode;
|
||||
}
|
||||
return b + ' ' + unitCode + ' ' + a + ' ' + minUnitCode;
|
||||
};
|
||||
|
||||
// 检查单位
|
||||
const checkUnit = (item: any): boolean => {
|
||||
if (item.type == 'dose') {
|
||||
return false;
|
||||
} else if (props.row.partAttributeEnum == '2' && item.type == 'minUnit') {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
const handleEnter = (prop: string) => props.handlers.handleEnter(prop, props.row, props.index);
|
||||
const handleSave = () => {
|
||||
nextTick(() => {
|
||||
if (!formRef.value) {
|
||||
console.error('Form ref not found');
|
||||
return;
|
||||
}
|
||||
formRef.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
emit('save', props.row, props.index);
|
||||
} else {
|
||||
if (proxy?.$modal?.msgWarning) {
|
||||
proxy.$modal.msgWarning('请完善必填信息');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('cancel', props.row, props.index);
|
||||
};
|
||||
const handleNumberClick = (item: any) =>
|
||||
props.handlers.handleNumberClick(item, props.index, props.row);
|
||||
const handleOrgChange = (value: any) => props.handlers.handleOrgChange(value, props.index);
|
||||
const convertValues = () => props.handlers.convertValue('doseQuantity', props.row, props.index);
|
||||
const convertDoseValues = () => props.handlers.convertValue('dose', props.row, props.index);
|
||||
const calculateTotalPrice = () => props.handlers.calculateTotal('price', props.row, props.index);
|
||||
const calculateTotalAmount = () => props.handlers.calculateTotal('amount', props.row, props.index);
|
||||
const setInputRef = props.handlers.setInputRef;
|
||||
|
||||
defineExpose({
|
||||
stockFormat,
|
||||
checkUnit,
|
||||
formRef,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.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);
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0px;
|
||||
}
|
||||
|
||||
.expend_div {
|
||||
:deep(.el-form-item--default) {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
:deep(.el-input-number .el-input__inner) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -5,71 +5,49 @@
|
||||
-->
|
||||
<template>
|
||||
<div class="bloodTransfusion-container">
|
||||
<div v-loading="loading" class="transfer-wrapper">
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
</div>
|
||||
<el-transfer v-model="transferValue" :data="applicationList" filter-placeholder="项目代码/名称" filterable
|
||||
:titles="['未选择', '已选择']" />
|
||||
<div class="bloodTransfusion-form">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目类别" prop="categoryType" style="width: 100%">
|
||||
<el-input v-model="form.categoryType" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发往科室" prop="targetDepartment" style="width: 100%">
|
||||
<!-- <el-input v-model="form.targetDepartment" autocomplete="off" /> -->
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.targetDepartment"
|
||||
filterable
|
||||
:data="orgOptions"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
}"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
placeholder="请选择科室"
|
||||
/>
|
||||
<el-form-item label="项目类别" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="症状" prop="symptom" style="width: 100%">
|
||||
<el-input v-model="form.symptom" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="发往科室" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体征" prop="sign" style="width: 100%">
|
||||
<el-input v-model="form.sign" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="症状" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临床诊断" prop="clinicalDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.clinicalDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="体征" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他诊断" prop="otherDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.otherDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="临床诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关结果" prop="relatedResult" style="width: 100%">
|
||||
<el-input v-model="form.relatedResult" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="其他诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="attention" style="width: 100%">
|
||||
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="相关结果" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -78,10 +56,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="BloodTransfusion">
|
||||
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue';
|
||||
import { patientInfo } from '../../../store/patient.js';
|
||||
import { getOrgList } from '../../../../../basicmanage/ward/components/api.js';
|
||||
import { getEncounterDiagnosis } from '../../api.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits(['submitOk']);
|
||||
const props = defineProps({});
|
||||
@@ -89,28 +66,20 @@ import { getApplicationList, saveBloodTransfusio } from './api';
|
||||
const state = reactive({});
|
||||
const applicationListAll = ref();
|
||||
const applicationList = ref();
|
||||
const loading = ref(false);
|
||||
const orgOptions = ref([]); // 科室选项
|
||||
const getList = () => {
|
||||
if (!patientInfo.value?.inHospitalOrgId) {
|
||||
applicationList.value = [];
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '28',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
})
|
||||
.then((res) => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '28',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
||||
applicationListAll.value = res.data.records;
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId,
|
||||
orgId: item.orgId,
|
||||
label: item.adviceName + item.adviceDefinitionId,
|
||||
key: item.adviceDefinitionId,
|
||||
};
|
||||
@@ -119,112 +88,45 @@ const getList = () => {
|
||||
proxy.$message.error(res.message);
|
||||
applicationList.value = [];
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
const transferValue = ref([]);
|
||||
const form = reactive({
|
||||
// categoryType: '', // 项目类别
|
||||
targetDepartment: '', // 发往科室
|
||||
symptom: '', // 症状
|
||||
sign: '', // 体征
|
||||
clinicalDiagnosis: '', // 临床诊断
|
||||
otherDiagnosis: '', // 其他诊断
|
||||
relatedResult: '', // 相关结果
|
||||
attention: '', // 注意事项
|
||||
primaryDiagnosisList: [], //主诊断目录
|
||||
otherDiagnosisList: [], //其他断目录
|
||||
patientName: '',
|
||||
patientSex: '',
|
||||
patientAge: '',
|
||||
patientPhone: '',
|
||||
patientAddress: '',
|
||||
});
|
||||
const rules = reactive({});
|
||||
onBeforeMount(() => {});
|
||||
onBeforeMount(() => { });
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
/**
|
||||
* type(1:watch监听类型 2:点击保存类型)
|
||||
* selectProjectIds(选中项目的id数组)
|
||||
* */
|
||||
const projectWithDepartment = (selectProjectIds, type) => {
|
||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||
let isRelease = true;
|
||||
// 选中项目的数组
|
||||
const arr = [];
|
||||
// 根据选中的项目id查找对应的项目
|
||||
selectProjectIds.forEach((element) => {
|
||||
const searchData = applicationList.value.find((item) => {
|
||||
return element == item.adviceDefinitionId;
|
||||
});
|
||||
arr.push(searchData);
|
||||
});
|
||||
// 清空科室
|
||||
form.targetDepartment = '';
|
||||
if (arr.length > 0) {
|
||||
const obj = arr[0];
|
||||
// 判断科室是否相同
|
||||
const isCompare = arr.every((item) => {
|
||||
return item.orgId == obj.orgId;
|
||||
});
|
||||
if (!isCompare) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '执行科室不同',
|
||||
});
|
||||
isRelease = false;
|
||||
}
|
||||
// 选中项目中的执行科室id与全部科室数据做匹配
|
||||
const findItem = orgOptions.value.find((item) => {
|
||||
return item.id == obj.orgId;
|
||||
});
|
||||
|
||||
if (!findItem) {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
}
|
||||
if (type == 1) {
|
||||
if (isRelease) {
|
||||
form.targetDepartment = findItem.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRelease;
|
||||
};
|
||||
// 监听选择项目变化
|
||||
watch(
|
||||
() => transferValue.value,
|
||||
(newValue) => {
|
||||
projectWithDepartment(newValue, 1);
|
||||
}
|
||||
);
|
||||
const submit = () => {
|
||||
if (transferValue.value.length == 0) {
|
||||
return proxy.$message.error('请选择申请单');
|
||||
}
|
||||
if (!projectWithDepartment(transferValue.value, 2)) {
|
||||
return;
|
||||
}
|
||||
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
||||
return transferValue.value.includes(item.adviceDefinitionId);
|
||||
});
|
||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId /** 诊疗定义id */,
|
||||
quantity: 1, // /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||
unitPrice: item.priceList[0].price /** 单价 */,
|
||||
totalPrice: item.priceList[0].price /** 总价 */,
|
||||
positionId: item.positionId, //执行科室id
|
||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||
conditionId: item.conditionId, //诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||
adviceType: item.adviceType, ///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId, //费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId, //费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId, // // 账户id
|
||||
adviceDefinitionId: item.adviceDefinitionId, /** 诊疗定义id */
|
||||
quantity: 1,// /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode, /** 请求单位编码 */
|
||||
unitPrice: item.priceList[0].price, /** 单价 */
|
||||
totalPrice: item.priceList[0].price, /** 总价 */
|
||||
positionId: item.positionId,//执行科室id
|
||||
ybClassEnum: item.ybClassEnum,//类别医保编码
|
||||
conditionId: item.conditionId,//诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId,//就诊诊断id
|
||||
adviceType: item.adviceType,///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId,//费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId,//费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId,// // 账户id
|
||||
};
|
||||
});
|
||||
saveBloodTransfusio({
|
||||
@@ -235,7 +137,7 @@ const submit = () => {
|
||||
requestFormId: '', // 申请单ID
|
||||
name: '输血申请单',
|
||||
descJson: JSON.stringify(form),
|
||||
categoryEnum: '3', // 1 检验 2 检查 3 输血 4 手术
|
||||
categoryEnum: '1', // 1 检验 2 检查 3 输血 4 手术
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$message.success(res.msg);
|
||||
@@ -245,63 +147,19 @@ const submit = () => {
|
||||
proxy.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data?.records[0]?.children;
|
||||
});
|
||||
};
|
||||
// 获取诊断目录
|
||||
function getDiagnosisList() {
|
||||
getEncounterDiagnosis(patientInfo.value.encounterId).then((res) => {
|
||||
console.log('诊断目录========>', JSON.stringify(res.data));
|
||||
if (res.code == 200) {
|
||||
const datas = (res.data || []).map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = '1';
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
// 主诊断
|
||||
form.primaryDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag == 1;
|
||||
});
|
||||
console.log('@@@@@@========>', form.primaryDiagnosisList);
|
||||
if (form.primaryDiagnosisList.length == 1) {
|
||||
const obj = form.primaryDiagnosisList[0];
|
||||
form.clinicalDiagnosis = obj.name;
|
||||
}
|
||||
//其他诊断
|
||||
form.otherDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag !== 1;
|
||||
});
|
||||
const otherDiagnosisNameList = form.otherDiagnosisList.map((item) => {
|
||||
return item.name;
|
||||
});
|
||||
form.otherDiagnosis = otherDiagnosisNameList.join(',');
|
||||
}
|
||||
});
|
||||
}
|
||||
defineExpose({ state, submit, getLocationInfo, getDiagnosisList });
|
||||
defineExpose({ state, submit });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.bloodTransfusion-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.transfer-wrapper {
|
||||
position: relative;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.el-transfer {
|
||||
--el-transfer-panel-width: 400px !important;
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.bloodTransfusion-form {
|
||||
padding: 8px 8px 0 8px;
|
||||
height: 100%;
|
||||
|
||||
@@ -5,71 +5,54 @@
|
||||
-->
|
||||
<template>
|
||||
<div class="LaboratoryTests-container">
|
||||
<div v-loading="loading" class="transfer-wrapper">
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
</div>
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
<div class="bloodTransfusion-form">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目类别" prop="categoryType" style="width: 100%">
|
||||
<el-input v-model="form.categoryType" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发往科室" prop="targetDepartment" style="width: 100%">
|
||||
<!-- <el-input v-model="form.targetDepartment" autocomplete="off" /> -->
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.targetDepartment"
|
||||
filterable
|
||||
:data="orgOptions"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
}"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
placeholder="请选择科室"
|
||||
/>
|
||||
<el-form-item label="项目类别" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="症状" prop="symptom" style="width: 100%">
|
||||
<el-input v-model="form.symptom" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="发往科室" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体征" prop="sign" style="width: 100%">
|
||||
<el-input v-model="form.sign" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="症状" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临床诊断" prop="clinicalDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.clinicalDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="体征" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他诊断" prop="otherDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.otherDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="临床诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关结果" prop="relatedResult" style="width: 100%">
|
||||
<el-input v-model="form.relatedResult" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="其他诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="attention" style="width: 100%">
|
||||
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="相关结果" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -78,232 +61,104 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="LaboratoryTests">
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive, watch } from 'vue';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
import { patientInfo } from '../../../store/patient.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits(['submitOk']);
|
||||
const props = defineProps({});
|
||||
import { getApplicationList, saveInspection } from './api';
|
||||
import { getOrgList } from '../../../../../basicmanage/ward/components/api.js';
|
||||
import { getEncounterDiagnosis } from '../../api.js';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getApplicationList, saveCheckd } from './api';
|
||||
const state = reactive({});
|
||||
const applicationListAll = ref();
|
||||
const applicationList = ref();
|
||||
const loading = ref(false);
|
||||
const orgOptions = ref([]); // 科室选项
|
||||
const getList = () => {
|
||||
if (!patientInfo.value?.inHospitalOrgId) {
|
||||
applicationList.value = [];
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '22',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
})
|
||||
.then((res) => {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '23',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
applicationListAll.value = res.data.records;
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId,
|
||||
orgId: item.orgId,
|
||||
label: item.adviceName + item.adviceDefinitionId,
|
||||
key: item.adviceDefinitionId,
|
||||
};
|
||||
});
|
||||
console.log('applicationList========>', JSON.stringify(res.data.records));
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
applicationList.value = [];
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
const transferValue = ref([]);
|
||||
const form = reactive({
|
||||
// categoryType: '', // 项目类别
|
||||
targetDepartment: '', // 发往科室
|
||||
symptom: '', // 症状
|
||||
sign: '', // 体征
|
||||
clinicalDiagnosis: '', // 临床诊断
|
||||
otherDiagnosis: '', // 其他诊断
|
||||
relatedResult: '', // 相关结果
|
||||
attention: '', // 注意事项
|
||||
primaryDiagnosisList: [], //主诊断目录
|
||||
otherDiagnosisList: [], //其他断目录
|
||||
patientName: '',
|
||||
patientSex: '',
|
||||
patientAge: '',
|
||||
patientPhone: '',
|
||||
patientAddress: '',
|
||||
});
|
||||
const rules = reactive({});
|
||||
onBeforeMount(() => {});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
/**
|
||||
* type(1:watch监听类型 2:点击保存类型)
|
||||
* selectProjectIds(选中项目的id数组)
|
||||
* */
|
||||
const projectWithDepartment = (selectProjectIds, type) => {
|
||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||
let isRelease = true;
|
||||
// 选中项目的数组
|
||||
const arr = [];
|
||||
// 根据选中的项目id查找对应的项目
|
||||
selectProjectIds.forEach((element) => {
|
||||
const searchData = applicationList.value.find((item) => {
|
||||
return element == item.adviceDefinitionId;
|
||||
});
|
||||
arr.push(searchData);
|
||||
});
|
||||
// 清空科室
|
||||
form.targetDepartment = '';
|
||||
if (arr.length > 0) {
|
||||
const obj = arr[0];
|
||||
// 判断科室是否相同
|
||||
const isCompare = arr.every((item) => {
|
||||
return item.orgId == obj.orgId;
|
||||
});
|
||||
if (!isCompare) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '执行科室不同',
|
||||
});
|
||||
isRelease = false;
|
||||
}
|
||||
// 选中项目中的执行科室id与全部科室数据做匹配
|
||||
const findItem = orgOptions.value.find((item) => {
|
||||
return item.id == obj.orgId;
|
||||
});
|
||||
if (!findItem) {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
}
|
||||
if (type == 1) {
|
||||
if (isRelease) {
|
||||
form.targetDepartment = findItem.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRelease;
|
||||
};
|
||||
// 监听选择项目变化
|
||||
watch(
|
||||
() => transferValue.value,
|
||||
(newValue) => {
|
||||
projectWithDepartment(newValue, 1);
|
||||
}
|
||||
);
|
||||
const submit = () => {
|
||||
if (transferValue.value.length == 0) {
|
||||
return proxy.$message.error('请选择申请单');
|
||||
}
|
||||
if (!projectWithDepartment(transferValue.value, 2)) {
|
||||
return;
|
||||
}
|
||||
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
||||
return transferValue.value.includes(item.adviceDefinitionId);
|
||||
});
|
||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId /** 诊疗定义id */,
|
||||
quantity: 1, // /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||
unitPrice: item.priceList[0].price /** 单价 */,
|
||||
totalPrice: item.priceList[0].price /** 总价 */,
|
||||
positionId: item.positionId, //执行科室id
|
||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||
conditionId: item.conditionId, //诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||
adviceType: item.adviceType, ///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId, //费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId, //费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId, // // 账户id
|
||||
adviceDefinitionId: item.adviceDefinitionId, /** 诊疗定义id */
|
||||
quantity: 1,// /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode, /** 请求单位编码 */
|
||||
unitPrice: item.priceList[0].price, /** 单价 */
|
||||
totalPrice: item.priceList[0].price, /** 总价 */
|
||||
positionId: item.positionId,//执行科室id
|
||||
ybClassEnum: item.ybClassEnum,//类别医保编码
|
||||
conditionId: item.conditionId,//诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId,//就诊诊断id
|
||||
adviceType: item.adviceType,///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId,//费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId,//费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId,// // 账户id
|
||||
};
|
||||
});
|
||||
const params = {
|
||||
saveCheckd({
|
||||
activityList: applicationListAllFilter,
|
||||
patientId: patientInfo.value.patientId, //患者ID
|
||||
encounterId: patientInfo.value.encounterId, // 就诊ID
|
||||
organizationId: patientInfo.value.inHospitalOrgId, // 医疗机构ID
|
||||
requestFormId: '', // 申请单ID
|
||||
name: '检验申请单',
|
||||
name: '检查申请单',
|
||||
descJson: JSON.stringify(form),
|
||||
categoryEnum: '1', // 1 检验 2 检查 3 输血 4 手术
|
||||
};
|
||||
saveInspection(params).then((res) => {
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data?.records[0]?.children;
|
||||
console.log('科室========>', JSON.stringify(orgOptions.value));
|
||||
});
|
||||
};
|
||||
// 获取诊断目录
|
||||
function getDiagnosisList() {
|
||||
getEncounterDiagnosis(patientInfo.value.encounterId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const datas = (res.data || []).map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = '1';
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
// 主诊断
|
||||
form.primaryDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag == 1;
|
||||
});
|
||||
console.log('@@@@@@========>', form.primaryDiagnosisList);
|
||||
if (form.primaryDiagnosisList.length == 1) {
|
||||
const obj = form.primaryDiagnosisList[0];
|
||||
form.clinicalDiagnosis = obj.name;
|
||||
}
|
||||
//其他诊断
|
||||
form.otherDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag !== 1;
|
||||
});
|
||||
const otherDiagnosisNameList = form.otherDiagnosisList.map((item) => {
|
||||
return item.name;
|
||||
});
|
||||
form.otherDiagnosis = otherDiagnosisNameList.join(',');
|
||||
}
|
||||
});
|
||||
}
|
||||
defineExpose({ state, submit, getLocationInfo, getDiagnosisList });
|
||||
defineExpose({ state, submit });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.LaboratoryTests-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.transfer-wrapper {
|
||||
position: relative;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.el-transfer {
|
||||
--el-transfer-panel-width: 400px !important;
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.bloodTransfusion-form {
|
||||
padding: 8px 8px 0 8px;
|
||||
height: 100%;
|
||||
|
||||
@@ -5,71 +5,62 @@
|
||||
-->
|
||||
<template>
|
||||
<div class="medicalExaminations-container">
|
||||
<div v-loading="loading" class="transfer-wrapper">
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
</div>
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
style="width: 100%"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
<div class="bloodTransfusion-form">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
ref="formRef"
|
||||
label-width="120px"
|
||||
class="demo-ruleForm"
|
||||
inline
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目类别" prop="categoryType" style="width: 100%">
|
||||
<el-input v-model="form.categoryType" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发往科室" prop="targetDepartment" style="width: 100%">
|
||||
<!-- <el-input v-model="form.targetDepartment" autocomplete="off" /> -->
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.targetDepartment"
|
||||
filterable
|
||||
:data="orgOptions"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
}"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
placeholder="请选择科室"
|
||||
/>
|
||||
<el-form-item label="项目类别" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="症状" prop="symptom" style="width: 100%">
|
||||
<el-input v-model="form.symptom" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="发往科室" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体征" prop="sign" style="width: 100%">
|
||||
<el-input v-model="form.sign" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="症状" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临床诊断" prop="clinicalDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.clinicalDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="体征" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他诊断" prop="otherDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.otherDiagnosis" autocomplete="off" />
|
||||
<el-form-item label="临床诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关结果" prop="relatedResult" style="width: 100%">
|
||||
<el-input v-model="form.relatedResult" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="其他诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="attention" style="width: 100%">
|
||||
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="相关结果" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -78,40 +69,30 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="MedicalExaminations">
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive, watch } from 'vue';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
import { patientInfo } from '../../../store/patient.js';
|
||||
import { getOrgList } from '../../../../../basicmanage/ward/components/api.js';
|
||||
import { getEncounterDiagnosis } from '../../api.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits(['submitOk']);
|
||||
const props = defineProps({});
|
||||
const orgOptions = ref([]); // 科室选项
|
||||
import { getApplicationList, saveCheckd } from './api';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getApplicationList, saveInspection } from './api';
|
||||
const state = reactive({});
|
||||
const applicationListAll = ref();
|
||||
const applicationList = ref();
|
||||
const loading = ref(false);
|
||||
const getList = () => {
|
||||
if (!patientInfo.value?.inHospitalOrgId) {
|
||||
applicationList.value = [];
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '23',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
// console.log(patientInfo.value);
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '23',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
applicationListAll.value = res.data.records;
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId,
|
||||
orgId: item.orgId,
|
||||
label: item.adviceName + item.adviceDefinitionId,
|
||||
key: item.adviceDefinitionId,
|
||||
};
|
||||
@@ -120,189 +101,75 @@ const getList = () => {
|
||||
proxy.$message.error(res.message);
|
||||
applicationList.value = [];
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
const transferValue = ref([]);
|
||||
const form = reactive({
|
||||
// categoryType: '', // 项目类别
|
||||
targetDepartment: '', // 发往科室
|
||||
symptom: '', // 症状
|
||||
sign: '', // 体征
|
||||
clinicalDiagnosis: '', // 临床诊断
|
||||
otherDiagnosis: '', // 其他诊断
|
||||
relatedResult: '', // 相关结果
|
||||
attention: '', // 注意事项
|
||||
primaryDiagnosisList: [], //主诊断目录
|
||||
otherDiagnosisList: [], //其他断目录
|
||||
patientName: '',
|
||||
patientSex: '',
|
||||
patientAge: '',
|
||||
patientPhone: '',
|
||||
patientAddress: '',
|
||||
});
|
||||
const rules = reactive({});
|
||||
onBeforeMount(() => {});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
/**
|
||||
* type(1:watch监听类型 2:点击保存类型)
|
||||
* selectProjectIds(选中项目的id数组)
|
||||
* */
|
||||
const projectWithDepartment = (selectProjectIds, type) => {
|
||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||
let isRelease = true;
|
||||
// 选中项目的数组
|
||||
const arr = [];
|
||||
// 根据选中的项目id查找对应的项目
|
||||
selectProjectIds.forEach((element) => {
|
||||
const searchData = applicationList.value.find((item) => {
|
||||
return element == item.adviceDefinitionId;
|
||||
});
|
||||
arr.push(searchData);
|
||||
});
|
||||
// 清空科室
|
||||
form.targetDepartment = '';
|
||||
if (arr.length > 0) {
|
||||
const obj = arr[0];
|
||||
// 判断科室是否相同
|
||||
const isCompare = arr.every((item) => {
|
||||
return item.orgId == obj.orgId;
|
||||
});
|
||||
if (!isCompare) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '执行科室不同',
|
||||
});
|
||||
isRelease = false;
|
||||
}
|
||||
// 选中项目中的执行科室id与全部科室数据做匹配
|
||||
const findItem = orgOptions.value.find((item) => {
|
||||
return item.id == obj.orgId;
|
||||
});
|
||||
|
||||
if (!findItem) {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
}
|
||||
if (type == 1) {
|
||||
if (isRelease) {
|
||||
form.targetDepartment = findItem.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRelease;
|
||||
};
|
||||
// 监听选择项目变化
|
||||
watch(
|
||||
() => transferValue.value,
|
||||
(newValue) => {
|
||||
projectWithDepartment(newValue, 1);
|
||||
}
|
||||
);
|
||||
const submit = () => {
|
||||
if (transferValue.value.length == 0) {
|
||||
return proxy.$message.error('请选择申请单');
|
||||
}
|
||||
if (!projectWithDepartment(transferValue.value, 2)) {
|
||||
return;
|
||||
}
|
||||
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
||||
return transferValue.value.includes(item.adviceDefinitionId);
|
||||
});
|
||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId /** 诊疗定义id */,
|
||||
quantity: 1, // /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||
unitPrice: item.priceList[0].price /** 单价 */,
|
||||
totalPrice: item.priceList[0].price /** 总价 */,
|
||||
positionId: item.positionId, //执行科室id
|
||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||
conditionId: item.conditionId, //诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||
adviceType: item.adviceType, ///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId, //费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId, //费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId, // // 账户id
|
||||
adviceDefinitionId: item.adviceDefinitionId, /** 诊疗定义id */
|
||||
quantity: 1,// /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode, /** 请求单位编码 */
|
||||
unitPrice: item.priceList[0].price, /** 单价 */
|
||||
totalPrice: item.priceList[0].price, /** 总价 */
|
||||
positionId: item.positionId,//执行科室id
|
||||
ybClassEnum: item.ybClassEnum,//类别医保编码
|
||||
conditionId: item.conditionId,//诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId,//就诊诊断id
|
||||
adviceType: item.adviceType,///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId,//费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId,//费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId,// // 账户id
|
||||
};
|
||||
});
|
||||
saveCheckd({
|
||||
saveInspection({
|
||||
activityList: applicationListAllFilter,
|
||||
patientId: patientInfo.value.patientId, //患者ID
|
||||
encounterId: patientInfo.value.encounterId, // 就诊ID
|
||||
organizationId: patientInfo.value.inHospitalOrgId, // 医疗机构ID
|
||||
requestFormId: '', // 申请单ID
|
||||
name: '检查申请单',
|
||||
name: '检验申请单',
|
||||
descJson: JSON.stringify(form),
|
||||
categoryEnum: '2', // 1 检验 2 检查 3 输血 4 手术
|
||||
categoryEnum: '1', // 1 检验 2 检查 3 输血 4 手术
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data?.records[0]?.children;
|
||||
});
|
||||
};
|
||||
// 获取诊断目录
|
||||
function getDiagnosisList() {
|
||||
getEncounterDiagnosis(patientInfo.value.encounterId).then((res) => {
|
||||
console.log('诊断目录========>', JSON.stringify(res.data));
|
||||
if (res.code == 200) {
|
||||
const datas = (res.data || []).map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = '1';
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
// 主诊断
|
||||
form.primaryDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag == 1;
|
||||
});
|
||||
console.log('@@@@@@========>', form.primaryDiagnosisList);
|
||||
if (form.primaryDiagnosisList.length == 1) {
|
||||
const obj = form.primaryDiagnosisList[0];
|
||||
form.clinicalDiagnosis = obj.name;
|
||||
}
|
||||
//其他诊断
|
||||
form.otherDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag !== 1;
|
||||
});
|
||||
const otherDiagnosisNameList = form.otherDiagnosisList.map((item) => {
|
||||
return item.name;
|
||||
});
|
||||
form.otherDiagnosis = otherDiagnosisNameList.join(',');
|
||||
}
|
||||
});
|
||||
}
|
||||
defineExpose({ state, submit, getLocationInfo, getDiagnosisList });
|
||||
defineExpose({ state, submit });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.medicalExaminations-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.transfer-wrapper {
|
||||
position: relative;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.el-transfer {
|
||||
--el-transfer-panel-width: 400px !important;
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.bloodTransfusion-form {
|
||||
padding: 8px 8px 0 8px;
|
||||
height: 100%;
|
||||
|
||||
@@ -4,228 +4,133 @@
|
||||
* @Description: 手术
|
||||
-->
|
||||
<template>
|
||||
<div class="surgery-container">
|
||||
<div v-loading="loading" class="transfer-wrapper">
|
||||
<el-transfer
|
||||
v-model="transferValue"
|
||||
:data="applicationList"
|
||||
filter-placeholder="项目代码/名称"
|
||||
filterable
|
||||
:titles="['未选择', '已选择']"
|
||||
/>
|
||||
</div>
|
||||
<div class="surgery-container">
|
||||
<el-transfer v-model="value" :data="applicationList" filter-placeholder="项目代码/名称" filterable :titles="['未选择', '已选择']" />
|
||||
<div class="bloodTransfusion-form">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目类别" prop="categoryType" style="width: 100%">
|
||||
<el-input v-model="form.categoryType" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发往科室" prop="targetDepartment" style="width: 100%">
|
||||
<!-- <el-input v-model="form.targetDepartment" autocomplete="off" /> -->
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.targetDepartment"
|
||||
filterable
|
||||
:data="orgOptions"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
}"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
placeholder="请选择科室"
|
||||
/>
|
||||
<el-form-item label="项目类别" prop="patientName" style="width:100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="症状" prop="symptom" style="width: 100%">
|
||||
<el-input v-model="form.symptom" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="发往科室" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体征" prop="sign" style="width: 100%">
|
||||
<el-input v-model="form.sign" autocomplete="off" type="textarea" />
|
||||
<el-form-item label="症状" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临床诊断" prop="clinicalDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.clinicalDiagnosis" autocomplete="off" />
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体征" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他诊断" prop="otherDiagnosis" style="width: 100%">
|
||||
<el-input disabled v-model="form.otherDiagnosis" autocomplete="off" />
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临床诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关结果" prop="relatedResult" style="width: 100%">
|
||||
<el-input v-model="form.relatedResult" autocomplete="off" type="textarea" />
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他诊断" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="attention" style="width: 100%">
|
||||
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关结果" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注意事项" prop="patientName" style="width: 100%">
|
||||
<el-input v-model="form.patientName" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="Surgery">
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue'
|
||||
import { patientInfo } from '../../../store/patient.js';
|
||||
import { getOrgList } from '../../../../../basicmanage/ward/components/api.js';
|
||||
import { getEncounterDiagnosis } from '../../api.js';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits(['submitOk']);
|
||||
const props = defineProps({});
|
||||
import { getApplicationList, saveSurgery } from './api';
|
||||
import { ElMessage } from 'element-plus';
|
||||
const state = reactive({});
|
||||
const emits = defineEmits(['submitOk'])
|
||||
const props = defineProps({
|
||||
|
||||
})
|
||||
import { getApplicationList,saveSurgery } from './api'
|
||||
const state = reactive({
|
||||
|
||||
})
|
||||
const applicationListAll = ref();
|
||||
const applicationList = ref();
|
||||
const loading = ref(false);
|
||||
const orgOptions = ref([]); // 科室选项
|
||||
const getList = () => {
|
||||
if (!patientInfo.value?.inHospitalOrgId) {
|
||||
applicationList.value = [];
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
getApplicationList({
|
||||
const applicationList=ref()
|
||||
const getList= ()=> {
|
||||
if (patientInfo.value?.inHospitalOrgId) {
|
||||
getApplicationList({
|
||||
pageSize: 10000,
|
||||
pageNum: 1,
|
||||
categoryCode: '24',
|
||||
organizationId: patientInfo.value.inHospitalOrgId,
|
||||
adviceTypes: '3', //1 药品 2耗材 3诊疗
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
applicationListAll.value = res.data.records;
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
adviceTypes:'3'//1 药品 2耗材 3诊疗
|
||||
}
|
||||
).then((res) => {
|
||||
if (res.code === 200) {
|
||||
applicationListAll.value = res.data.records;
|
||||
applicationList.value = res.data.records.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId,
|
||||
orgId: item.orgId,
|
||||
label: item.adviceName + item.adviceDefinitionId,
|
||||
key: item.adviceDefinitionId,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
applicationList.value = [];
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
applicationList.value = []
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const transferValue = ref([]);
|
||||
const form = reactive({
|
||||
// categoryType: '', // 项目类别
|
||||
targetDepartment: '', // 发往科室
|
||||
symptom: '', // 症状
|
||||
sign: '', // 体征
|
||||
clinicalDiagnosis: '', // 临床诊断
|
||||
otherDiagnosis: '', // 其他诊断
|
||||
relatedResult: '', // 相关结果
|
||||
attention: '', // 注意事项
|
||||
primaryDiagnosisList: [], //主诊断目录
|
||||
otherDiagnosisList: [], //其他断目录
|
||||
});
|
||||
const rules = reactive({});
|
||||
onBeforeMount(() => {});
|
||||
patientName: '',
|
||||
patientSex: '',
|
||||
patientAge: '',
|
||||
patientPhone: '',
|
||||
patientAddress: '',
|
||||
})
|
||||
const rules = reactive({
|
||||
})
|
||||
onBeforeMount(() => {
|
||||
|
||||
})
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
/**
|
||||
* type(1:watch监听类型 2:点击保存类型)
|
||||
* selectProjectIds(选中项目的id数组)
|
||||
* */
|
||||
const projectWithDepartment = (selectProjectIds, type) => {
|
||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||
let isRelease = true;
|
||||
// 选中项目的数组
|
||||
const arr = [];
|
||||
// 根据选中的项目id查找对应的项目
|
||||
selectProjectIds.forEach((element) => {
|
||||
const searchData = applicationList.value.find((item) => {
|
||||
return element == item.adviceDefinitionId;
|
||||
});
|
||||
arr.push(searchData);
|
||||
});
|
||||
// 清空科室
|
||||
form.targetDepartment = '';
|
||||
if (arr.length > 0) {
|
||||
const obj = arr[0];
|
||||
// 判断科室是否相同
|
||||
const isCompare = arr.every((item) => {
|
||||
return item.orgId == obj.orgId;
|
||||
});
|
||||
if (!isCompare) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '执行科室不同',
|
||||
});
|
||||
isRelease = false;
|
||||
}
|
||||
// 选中项目中的执行科室id与全部科室数据做匹配
|
||||
const findItem = orgOptions.value.find((item) => {
|
||||
return item.id == obj.orgId;
|
||||
});
|
||||
|
||||
if (!findItem) {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
}
|
||||
if (type == 1) {
|
||||
if (isRelease) {
|
||||
form.targetDepartment = findItem.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRelease;
|
||||
};
|
||||
// 监听选择项目变化
|
||||
watch(
|
||||
() => transferValue.value,
|
||||
(newValue) => {
|
||||
projectWithDepartment(newValue, 1);
|
||||
}
|
||||
);
|
||||
getList()
|
||||
})
|
||||
const submit = () => {
|
||||
if (transferValue.value.length == 0) {
|
||||
return proxy.$message.error('请选择申请单');
|
||||
}
|
||||
if (!projectWithDepartment(transferValue.value, 2)) {
|
||||
return;
|
||||
}
|
||||
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
||||
return transferValue.value.includes(item.adviceDefinitionId);
|
||||
});
|
||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||
return {
|
||||
adviceDefinitionId: item.adviceDefinitionId /** 诊疗定义id */,
|
||||
quantity: 1, // /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||
unitPrice: item.priceList[0].price /** 单价 */,
|
||||
totalPrice: item.priceList[0].price /** 总价 */,
|
||||
positionId: item.positionId, //执行科室id
|
||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||
conditionId: item.conditionId, //诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||
adviceType: item.adviceType, ///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId, //费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId, //费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId, // // 账户id
|
||||
adviceDefinitionId: item.adviceDefinitionId, /** 诊疗定义id */
|
||||
quantity: 1,// /** 请求数量 */
|
||||
unitCode: item.priceList[0].unitCode, /** 请求单位编码 */
|
||||
unitPrice: item.priceList[0].price, /** 单价 */
|
||||
totalPrice: item.priceList[0].price, /** 总价 */
|
||||
positionId: item.positionId,//执行科室id
|
||||
ybClassEnum: item.ybClassEnum,//类别医保编码
|
||||
conditionId: item.conditionId,//诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId,//就诊诊断id
|
||||
adviceType: item.adviceType,///** 医嘱类型 */
|
||||
definitionId: item.priceList[0].definitionId,//费用定价主表ID */
|
||||
definitionDetailId: item.definitionDetailId,//费用定价子表ID */
|
||||
accountId: patientInfo.value.accountId,// // 账户id
|
||||
};
|
||||
});
|
||||
saveSurgery({
|
||||
@@ -234,80 +139,37 @@ const submit = () => {
|
||||
encounterId: patientInfo.value.encounterId, // 就诊ID
|
||||
organizationId: patientInfo.value.inHospitalOrgId, // 医疗机构ID
|
||||
requestFormId: '', // 申请单ID
|
||||
name: '手术申请单',
|
||||
name: '检验申请单',
|
||||
descJson: JSON.stringify(form),
|
||||
categoryEnum: '4', // 1 检验 2 检查 3 输血 4 手术
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
categoryEnum: '1', // 1 检验 2 检查 3 输血 4 手术
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$message.success(res.msg);
|
||||
applicationList.value = [];
|
||||
emits('submitOk');
|
||||
} else {
|
||||
proxy.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data?.records[0]?.children;
|
||||
});
|
||||
};
|
||||
// 获取诊断目录
|
||||
function getDiagnosisList() {
|
||||
getEncounterDiagnosis(patientInfo.value.encounterId).then((res) => {
|
||||
console.log('诊断目录========>', JSON.stringify(res.data));
|
||||
if (res.code == 200) {
|
||||
const datas = (res.data || []).map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = '1';
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
// 主诊断
|
||||
form.primaryDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag == 1;
|
||||
});
|
||||
console.log('@@@@@@========>', form.primaryDiagnosisList);
|
||||
if (form.primaryDiagnosisList.length == 1) {
|
||||
const obj = form.primaryDiagnosisList[0];
|
||||
form.clinicalDiagnosis = obj.name;
|
||||
}
|
||||
//其他诊断
|
||||
form.otherDiagnosisList = datas.filter((item) => {
|
||||
return item?.maindiseFlag !== 1;
|
||||
});
|
||||
const otherDiagnosisNameList = form.otherDiagnosisList.map((item) => {
|
||||
return item.name;
|
||||
});
|
||||
form.otherDiagnosis = otherDiagnosisNameList.join(',');
|
||||
}
|
||||
});
|
||||
}
|
||||
defineExpose({ state, submit, getLocationInfo, getDiagnosisList });
|
||||
</script>
|
||||
defineExpose({ state, submit });
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.surgery-container {
|
||||
.surgery-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.transfer-wrapper {
|
||||
position: relative;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.el-transfer {
|
||||
padding: 8px;
|
||||
.el-transfer {
|
||||
--el-transfer-panel-width: 400px !important;
|
||||
}
|
||||
|
||||
.bloodTransfusion-form {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.bloodTransfusion-form {
|
||||
padding: 8px 8px 0 8px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -0,0 +1,108 @@
|
||||
<!--
|
||||
* @Author: sjjh
|
||||
* @Date: 2025-04-09 17:55:05
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="patient-card" v-for="item in data" :key="item.encounterId" :id="item.encounterId">
|
||||
<patient-parent-card :activeId="modelValue" :type="type" :data="item" @click="parentClick">
|
||||
</patient-parent-card>
|
||||
|
||||
<!-- // TODO 是否考虑孩子 -->
|
||||
<!-- <div v-if="item.children">
|
||||
<div
|
||||
style="margin-top: 8px"
|
||||
v-for="citem in item.children"
|
||||
:key="citem.id"
|
||||
:id="citem.id"
|
||||
>
|
||||
<patient-child-card
|
||||
:active-id="modelValue"
|
||||
:data="citem"
|
||||
:parentData="item"
|
||||
@click="childClick"
|
||||
>
|
||||
</patient-child-card>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import PatientParentCard from './patientParentCard.vue';
|
||||
// import PatientChildCard from './PatientChildCard.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'PatientCard',
|
||||
});
|
||||
const props = defineProps({
|
||||
modelValue: '',
|
||||
data: [],
|
||||
type: 0,
|
||||
keyChild: '',
|
||||
auto: true,
|
||||
});
|
||||
|
||||
const value = ref(props.modelValue);
|
||||
// const childClick = (node: any, parentVal: any) => {
|
||||
// if (props.auto) {
|
||||
// value.value = node.id
|
||||
// }
|
||||
// emits('click', value.value, node, parentVal)
|
||||
// }
|
||||
const diagnosisInit = inject('diagnosisInit')
|
||||
const getAdviceList = inject('getAdviceList')
|
||||
const adviceDiagnoInit = inject('adviceDiagnoInit')
|
||||
// 调用方法
|
||||
const parentClick = (node) => {
|
||||
value.value = node.encounterId;
|
||||
emits('click', value.value, node, null);
|
||||
setTimeout(() => {
|
||||
diagnosisInit()
|
||||
getAdviceList()
|
||||
adviceDiagnoInit()
|
||||
}, 0);
|
||||
};
|
||||
|
||||
const parentNode = ref();
|
||||
const getItem = (val) => {
|
||||
parentNode.value = null;
|
||||
const re = props.data.find((item) => {
|
||||
return item.encounterId === val;
|
||||
});
|
||||
if (re) return re;
|
||||
else {
|
||||
let rec;
|
||||
props.data.forEach((item) => {
|
||||
if (item.children) {
|
||||
item.children.find((citem) => {
|
||||
if (citem.encounterId === val) {
|
||||
parentNode.value = item;
|
||||
rec = citem;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return rec;
|
||||
}
|
||||
};
|
||||
|
||||
const emits = defineEmits(['click', 'change', 'update:modelValue']);
|
||||
watch(props, (newValue) => {
|
||||
value.value = newValue.modelValue;
|
||||
});
|
||||
|
||||
watch(value, (val) => {
|
||||
emits('update:modelValue', val);
|
||||
emits('change', val, getItem(val), parentNode.value);
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.patient-card {
|
||||
user-select: none;
|
||||
|
||||
& + .patient-card {
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,107 @@
|
||||
<!--
|
||||
* @Author: yangbo@bjgoodwill.com
|
||||
* @Date: 2024-10-23 09:37:17
|
||||
* @Description: 患者卡片-孩子节点
|
||||
-->
|
||||
<template>
|
||||
<div @click="clickAct" style="display: flex">
|
||||
<div class="patient-child_broken"></div>
|
||||
<div
|
||||
class="child-card"
|
||||
:style="{
|
||||
backgroundColor:
|
||||
activeId === data.id ? 'rgba(19,192,179,0.05)' : '#ffffff',
|
||||
borderColor: activeId === data.id ? '#13C0B3' : '#eeeeee',
|
||||
}"
|
||||
>
|
||||
<div class="child-bed">
|
||||
{{ data.bedName }}
|
||||
</div>
|
||||
<div class="child-line"></div>
|
||||
<div class="child-name">
|
||||
{{ data.name }}
|
||||
<div class="child-age">{{ data.sexName }}/{{ data.age }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: 'PatientChildCard',
|
||||
});
|
||||
const props = defineProps({
|
||||
data: {},
|
||||
activeId: '',
|
||||
parentData: {}
|
||||
});
|
||||
|
||||
const emits = defineEmits(['click']);
|
||||
const clickAct = () => {
|
||||
emits('click', props.data, props.parentData);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 孩子节点
|
||||
.child-card {
|
||||
position: relative;
|
||||
width: 214px;
|
||||
height: 80px;
|
||||
margin-left: 4px;
|
||||
border: 1px solid;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 2px 0 rgba(57.55, 69.04, 86.28, 20%);
|
||||
cursor: pointer;
|
||||
|
||||
.child-bed {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 16px;
|
||||
display: flex;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.child-line {
|
||||
position: absolute;
|
||||
top: 38px;
|
||||
left: 16px;
|
||||
width: 182px;
|
||||
border-bottom: 1px dashed #ddd;
|
||||
}
|
||||
|
||||
.child-num {
|
||||
position: absolute;
|
||||
top: 9px;
|
||||
right: 16px;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.child-name {
|
||||
position: absolute;
|
||||
top: 48px;
|
||||
left: 16px;
|
||||
display: flex;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
|
||||
.child-age {
|
||||
margin-top: 2.5px;
|
||||
margin-left: 16px;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 折线
|
||||
.patient-child_broken {
|
||||
width: 17px;
|
||||
height: 21px;
|
||||
margin-top: 18px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,243 @@
|
||||
<!--
|
||||
* @Author: yangbo@bjgoodwill.com
|
||||
* @Date: 2024-10-23 09:39:24
|
||||
* @Description: 患者卡片-父节点
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
@click="clickAct"
|
||||
class="patient-card"
|
||||
:class="{
|
||||
actived: activeId === data.encounterId,
|
||||
}"
|
||||
>
|
||||
<!-- //跨科 考虑不考虑 -->
|
||||
|
||||
<div class="main-info-container">
|
||||
<div class="bed-container">
|
||||
<!-- 患者床号 -->
|
||||
<div class="bed">
|
||||
<el-text truncated :tclass="bedfont" width="auto">{{ data.bedName }}</el-text>
|
||||
</div>
|
||||
<!-- 新入院患者标志 -->
|
||||
<!-- <div class="bed_new" /> -->
|
||||
</div>
|
||||
|
||||
<div class="indepatient-code-container">
|
||||
<!-- 患者重/危标识符 -->
|
||||
<!-- <div
|
||||
class="sign"
|
||||
:style="{
|
||||
backgroundColor: data?.criticalCarePatientName === '危' ? '#BA7BC8' : '#E95657',
|
||||
}"
|
||||
>
|
||||
{{ data.criticalCarePatientName }}
|
||||
</div> -->
|
||||
<!-- 住院号 -->
|
||||
<span style="margin-left: 4px"> {{ data.busNo }} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="doctor-parent-line" />
|
||||
<div class="personal-info-container">
|
||||
<div class="name-container">
|
||||
<!-- 患者姓名 -->
|
||||
<div class="name" style="max-width: 70px">
|
||||
<el-text :text="data.patientName" tclass="name" width="auto">
|
||||
{{ data.patientName }}
|
||||
</el-text>
|
||||
</div>
|
||||
<!-- 患者性别/年龄 -->
|
||||
<div class="age">{{ data.genderEnum_enumText }}/{{ data.age }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dept">
|
||||
<div class="doctor">
|
||||
<el-icon size="20px">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<!-- // TODO 医生图标 -->
|
||||
<div class="doctor_name">{{ data.admittedDoctorName }}</div>
|
||||
</div>
|
||||
<div class="deptNurseName">
|
||||
<el-icon size="20px">
|
||||
<Avatar />
|
||||
</el-icon>
|
||||
<!-- // TODO 护士图标 -->
|
||||
{{ data.deptNurseName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: 'PatientParentCard',
|
||||
})
|
||||
|
||||
const bedfont = 'bed-font'
|
||||
|
||||
const props = defineProps({
|
||||
data: {},
|
||||
// type:0:在科、1:出院、2:转科、3:会诊、
|
||||
type: 0,
|
||||
activeId: ''
|
||||
})
|
||||
const emits = defineEmits(['click'])
|
||||
const clickAct = () => {
|
||||
emits('click', props.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.patient-card {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border: 1px solid;
|
||||
border-color: #eee;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 2px 0 rgba(57.55, 69.04, 86.28, 20%);
|
||||
cursor: pointer;
|
||||
|
||||
&.actived {
|
||||
background-color: rgb(7, 155, 140, 5%);
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.cross-dept {
|
||||
height: 24px;
|
||||
padding: 0 16px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
background-color: #256d95;
|
||||
}
|
||||
|
||||
.main-info-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 24px;
|
||||
margin: 7px 0;
|
||||
padding: 0 16px;
|
||||
|
||||
.bed-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
|
||||
.bed {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 1;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.bed-font) {
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bed_new {
|
||||
flex-shrink: 0;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 4px;
|
||||
background: #29af6f;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.indepatient-code-container {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
padding-left: 6px;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
|
||||
.sign {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: white;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.doctor-parent-line {
|
||||
margin: 0 16px;
|
||||
border-bottom: 1px dashed #ddd;
|
||||
}
|
||||
|
||||
.personal-info-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 10px 0;
|
||||
padding: 0 16px;
|
||||
|
||||
.name-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 24px;
|
||||
|
||||
.name {
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.age {
|
||||
margin-left: 10px;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.change-department {
|
||||
width: 58px;
|
||||
height: 24px;
|
||||
color: #5585e3;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
background: #e6edfb;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.dept {
|
||||
margin-bottom: 4px;
|
||||
padding: 0 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.doctor {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
|
||||
.doctor_name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 4px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.deptNurseName {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 32px;
|
||||
color: #256d95;
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,385 @@
|
||||
<!--
|
||||
* @Author:
|
||||
* @Description: 患者列表
|
||||
-->
|
||||
<template>
|
||||
<div class="patientList-container">
|
||||
<div class="patientList-operate" :class="{ 'patientList-operate-unexpand': !expand }">
|
||||
<el-space>
|
||||
<el-icon icon-class="Refresh" size="24" @click="getList">
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
<el-icon class="svg-sty-menu" size="24" @click="updateExpand">
|
||||
<Expand v-if="!expand" />
|
||||
<Fold v-if="expand" />
|
||||
</el-icon>
|
||||
</el-space>
|
||||
</div>
|
||||
<div class="patientList-list" v-if="expand">
|
||||
<div class="search-operate">
|
||||
<!-- 在科 -->
|
||||
<el-input
|
||||
placeholder="床号/住院号/姓名"
|
||||
v-model="searchData.keyword"
|
||||
@keyup.enter="queryPatientData"
|
||||
:prefix-icon="Search"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="patient-cards" v-loading="queryloading">
|
||||
<template v-if="filteredCardData.length > 0">
|
||||
<el-scrollbar ref="expandScrollbarRef" class="patient-cards-scrollbar">
|
||||
<patient-card
|
||||
v-model="cardId"
|
||||
:data="filteredCardData"
|
||||
:type="active"
|
||||
@change="cardChange"
|
||||
>
|
||||
</patient-card>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
<el-empty v-else description="暂无数据" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="patientList-list" v-loading="queryloading" v-else>
|
||||
<el-scrollbar ref="contractScrollbarRef" class="patient-cards-scrollbar">
|
||||
<el-tooltip
|
||||
v-for="item in filteredCardData"
|
||||
:show-after="200"
|
||||
:key="item.encounterId"
|
||||
:show-arrow="true"
|
||||
placement="right"
|
||||
effect="light"
|
||||
:offset="4"
|
||||
>
|
||||
<template #content>
|
||||
<div class="card-tooltip">
|
||||
<span class="f-16">{{ item.bedName }}</span>
|
||||
<span class="f-14">{{ item.name }}</span>
|
||||
<el-icon v-if="item.sexName === '女'" :size="24"> <Female /></el-icon>
|
||||
<el-icon v-else icon-class="headMale" :size="24"><Male /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div
|
||||
class="card-small"
|
||||
:class="{ 'patient-active': cardId === item.encounterId }"
|
||||
@click="smallCardClick(item)"
|
||||
:key="item.encounterId"
|
||||
>
|
||||
{{ item.bedName }}
|
||||
</div>
|
||||
<div class="patient-card-small-border"></div>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
// import { store } from '@hip/portal'
|
||||
import { patientInfo, updatePatientInfo } from '../store/patient'
|
||||
import PatientCard from './patientCard/index.vue'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { getPatientList } from './api'
|
||||
// const props = defineProps({
|
||||
// })
|
||||
const expand = defineModel('expand')
|
||||
// const emit = defineEmits(['update:expand'])
|
||||
const active = ref(0)
|
||||
const searchData = reactive({
|
||||
keyword: '',
|
||||
patientType: 1,
|
||||
type: 1,
|
||||
timeLimit: 3,
|
||||
})
|
||||
// const { userInfo } = store.useGlobalStore()
|
||||
// 卡片
|
||||
const cardId = ref('')
|
||||
// 所有卡片数据
|
||||
const cardAllData = ref([
|
||||
// {
|
||||
// id: '1',
|
||||
// name: '张三',
|
||||
// sexName: '女',
|
||||
// bedName: '1-1床',
|
||||
// deptNurseName: '护士甲',
|
||||
// crossDeptFlag: false,
|
||||
// criticalCarePatientName: '危',
|
||||
// inpatientCode: '1212121212',
|
||||
// age: '30',
|
||||
// admittedDoctorName: '医生乙',
|
||||
// },
|
||||
// {
|
||||
// id: '2',
|
||||
// name: '李四',
|
||||
// sexName: '男',
|
||||
// bedName: '1-2床',
|
||||
// deptNurseName: '护士甲',
|
||||
// crossDeptFlag: false,
|
||||
// criticalCarePatientName: '重',
|
||||
// inpatientCode: '1212121212',
|
||||
// age: '30',
|
||||
// admittedDoctorName: '医生乙',
|
||||
// },
|
||||
])
|
||||
// 过滤后的卡片数据
|
||||
const filteredCardData = computed(() => {
|
||||
// switch (active.value) {
|
||||
// case 0:
|
||||
// return cardAllData.value.filter((item: IInPatient) => {
|
||||
// // const staffId = userInfo?.staffId
|
||||
// // 在科患者-我的患者 住院/主治/主任医生只要有一个对应即可显示
|
||||
// if (searchData.patientType === 1) {
|
||||
// if (
|
||||
// staffId !== item.directorDoctor &&
|
||||
// staffId !== item.masterDoctor &&
|
||||
// staffId !== item.admittedDoctor
|
||||
// ) {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
// // 在科患者-科室患者 全部/婴儿/非婴儿
|
||||
// if (searchData.type === 2) {
|
||||
// // 婴儿
|
||||
// if (!(item.children && item.children.length > 0)) {
|
||||
// return false
|
||||
// }
|
||||
// } else if (searchData.type === 3) {
|
||||
// // 非婴儿
|
||||
// if (item.children && item.children.length > 0) {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
// // 关键字
|
||||
// if (
|
||||
// searchData.keyword &&
|
||||
// !(
|
||||
// item.bedName.includes(searchData.keyword) ||
|
||||
// item.name.includes(searchData.keyword) ||
|
||||
// item.inpatientCode.includes(searchData.keyword)
|
||||
// )
|
||||
// ) {
|
||||
// return false
|
||||
// }
|
||||
// return true
|
||||
// })
|
||||
// default:
|
||||
// return cardAllData.value
|
||||
// }
|
||||
return cardAllData.value
|
||||
})
|
||||
|
||||
|
||||
// 是否初始化激活状态
|
||||
const isInitActive = ref(true)
|
||||
// 展开患者列表Ref
|
||||
const expandScrollbarRef = ref()
|
||||
// 收缩患者列表Ref
|
||||
const contractScrollbarRef = ref()
|
||||
const queryloading = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
cardId.value = patientInfo.value?.encounterId || ''
|
||||
queryPatientData()
|
||||
})
|
||||
const getList = () => {
|
||||
getPatientList({ status: 5 }).then((res) => {
|
||||
cardAllData.value = res.data.records
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 滚动到选中位置
|
||||
* @param {*} value
|
||||
*/
|
||||
const scrollToSelected = () => {
|
||||
// 如果不是第一次定位,则不进行滚动
|
||||
if (!isInitActive.value) return
|
||||
const currentRef = props.expand === true ? expandScrollbarRef : contractScrollbarRef
|
||||
if (!currentRef.value) return
|
||||
const value = getSelectedOffsetTop(currentRef)
|
||||
currentRef.value.setScrollTop(value || 0)
|
||||
isInitActive.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取选中元素位置
|
||||
* @param {*} ref
|
||||
*/
|
||||
const getSelectedOffsetTop = (ref) => {
|
||||
const childrenNodeArray = ref?.value?.wrapRef?.children[0]?.children
|
||||
if (!childrenNodeArray?.length) return 0
|
||||
// TODO 当有子元素时候需要优化
|
||||
const targetNode = Array.from(childrenNodeArray).find((childrenNode) => {
|
||||
return childrenNode?.__vnode?.key === cardId.value
|
||||
})
|
||||
return targetNode?.offsetTop || 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新展开状态
|
||||
*/
|
||||
const updateExpand = () => {
|
||||
// emit('update:expand', !props.expand)
|
||||
expand.value = !expand.value
|
||||
}
|
||||
|
||||
const cardChange = (val, node, parent) => {
|
||||
updatePatientInfo(node)
|
||||
}
|
||||
|
||||
const smallCardClick = (val) => {
|
||||
cardId.value = val.encounterId
|
||||
updatePatientInfo(val)
|
||||
}
|
||||
|
||||
// TODO 从后端获取数据
|
||||
const queryPatientData = async () => {
|
||||
if (queryloading.value) return
|
||||
try {
|
||||
// queryloading.value = true
|
||||
// const res: IInPatient[] = []
|
||||
// // TODO 获取患者列表
|
||||
// // 设置patMiCode和patCode,实际是同一字段
|
||||
// res.forEach((item: IInPatient) => {
|
||||
// item.patMiCode = item.patCode
|
||||
// })
|
||||
// cardAllData.value = res
|
||||
// scrollToSelected()
|
||||
} catch (error) {
|
||||
cardAllData.value = []
|
||||
} finally {
|
||||
queryloading.value = false
|
||||
}
|
||||
}
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.patientList-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
border-right: 1px solid #ebeef5;
|
||||
background-color: #ffffff;
|
||||
.patientList-operate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
height: 44px;
|
||||
padding: 0 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
flex: none;
|
||||
&-unexpand {
|
||||
justify-content: space-around;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.patientList-list {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
height: 0;
|
||||
|
||||
.search-operate {
|
||||
padding: 0 8px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.patient-cards {
|
||||
flex: 1;
|
||||
padding: 0 8px;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
:deep(.patient-cards-scrollbar) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.el-scrollbar__bar {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.patient-active {
|
||||
background-color: var(--el-color-primary);
|
||||
}
|
||||
.card-small {
|
||||
height: 44px;
|
||||
padding-right: 4px;
|
||||
padding-left: 12px;
|
||||
overflow: hidden;
|
||||
font-size: 16px;
|
||||
line-height: 44px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
border-right: none;
|
||||
cursor: pointer;
|
||||
|
||||
&-active {
|
||||
background-color: rgb(243, 252, 251);
|
||||
}
|
||||
|
||||
// &:hover {
|
||||
// background-color: #f8f8f8;
|
||||
// }
|
||||
}
|
||||
|
||||
.patient-card-small-border {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-color: #f1faff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-tooltip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 45px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.svg-gray {
|
||||
fill: var(--hip-color-text-unit);
|
||||
}
|
||||
|
||||
:deep(.scrollbar) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.el-scrollbar__bar {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.f-16 {
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.f-14 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.empty-text-sty {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,34 +1,18 @@
|
||||
/*
|
||||
* @Author: sjjh
|
||||
* @Date: 2025-09-20 17:02:37
|
||||
* @Description:
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request';
|
||||
import request from '@/utils/request'
|
||||
|
||||
// ====== 文书记录
|
||||
// 保存或更新记录
|
||||
export function saveOrUpdateRecord(data) {
|
||||
return request({
|
||||
url: '/document/record/saveOrUpdateRecord',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 新增记录
|
||||
// 新增记录
|
||||
export function addRecord(data) {
|
||||
return request({
|
||||
url: '/document/record/addRecord',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 删除历史记录
|
||||
export function deleteRecord(ids) {
|
||||
return request({
|
||||
url: '/document/record/deleteRecord',
|
||||
method: 'delete',
|
||||
data: ids,
|
||||
});
|
||||
data
|
||||
})
|
||||
}
|
||||
// 根据患者ID或就诊ID获取文书记录列表,只针对不需返回患者具体信息的列表,体温单除外,单独处理
|
||||
|
||||
@@ -36,15 +20,15 @@ export function getRecordByEncounterIdList(params) {
|
||||
return request({
|
||||
url: '/document/record/getRecordByEncounterIdList',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
params
|
||||
})
|
||||
}
|
||||
// 初始化文书定义
|
||||
export function init() {
|
||||
return request({
|
||||
url: '/document/record/init',
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// ====== 文书模板
|
||||
@@ -53,22 +37,24 @@ export function addTemplate(data) {
|
||||
return request({
|
||||
url: '/document/template/add',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
data
|
||||
})
|
||||
}
|
||||
//
|
||||
export function getListByDefinitionId(definitionId) {
|
||||
return request({
|
||||
url: '/document/template/getListByDefinitionId',
|
||||
method: 'get',
|
||||
params: { definitionId },
|
||||
});
|
||||
params: {definitionId}
|
||||
})
|
||||
}
|
||||
// 更新模板
|
||||
export function updateTemplate(data) {
|
||||
return request({
|
||||
url: '/document/template/update',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,25 +8,14 @@
|
||||
</el-input>
|
||||
</div>
|
||||
<el-scrollbar class="emr-history-scrollbar-container" style="width: 100%">
|
||||
<div
|
||||
v-for="item in historyData"
|
||||
:key="item.id"
|
||||
class="scrollbar-item"
|
||||
:class="{ 'selected-history-item': item.id === props.selectedRecordId }"
|
||||
>
|
||||
<el-tooltip effect="dark" :content="`${item.name}(${item.recordTime})`" placement="bottom">
|
||||
<div v-for="item in historyData" :key="item.id" class="scrollbar-item">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="`${item.name}(${item.recordTime})`"
|
||||
placement="bottom"
|
||||
>
|
||||
<el-text class="w-150px mb-2" truncated @click="handleNodeClick(item)">
|
||||
{{ item.name }}({{ item.recordTime }})
|
||||
|
||||
<el-icon
|
||||
class="ml-2"
|
||||
style="margin-left: 26px; cursor: pointer"
|
||||
:disabled="item.printCount && item.printCount > 0"
|
||||
:class="{ 'disabled-icon': item.printCount && item.printCount > 0 }"
|
||||
@click.stop="handleDelete(item)"
|
||||
>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
</el-text>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@@ -35,11 +24,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, defineEmits, unref, nextTick } from 'vue';
|
||||
import { getRecordByEncounterIdList, deleteRecord } from '../api';
|
||||
import { ref, reactive, defineEmits, unref } from 'vue';
|
||||
import { getRecordByEncounterIdList } from '../api';
|
||||
import { ElTree } from 'element-plus';
|
||||
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
const emits = defineEmits(['historyClick']);
|
||||
const props = defineProps({
|
||||
@@ -47,10 +35,6 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
selectedRecordId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const definitionId = defineModel('definitionId', {
|
||||
type: String,
|
||||
@@ -67,7 +51,7 @@ const queryParams = ref({
|
||||
const historyData = ref([]);
|
||||
const queryList = async () => {
|
||||
try {
|
||||
if (patientInfo.value.encounterId && unref(definitionId) && unref(definitionId) !== '') {
|
||||
if (patientInfo.value.encounterId && unref(definitionId)&&unref(definitionId) !== '') {
|
||||
const res = await getRecordByEncounterIdList({
|
||||
...queryParams.value,
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
@@ -75,76 +59,46 @@ const queryList = async () => {
|
||||
definitionId: unref(definitionId),
|
||||
});
|
||||
historyData.value = res.data || [];
|
||||
} else {
|
||||
}else{
|
||||
historyData.value = [];
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
// 不显示错误消息,避免干扰用户体验
|
||||
ElMessage.error('获取模板树失败');
|
||||
historyData.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 更新选中的历史记录ID
|
||||
const updateSelectedRecord = (recordId) => {
|
||||
// 这个函数可以供父组件调用,用于更新选中状态
|
||||
nextTick(() => {
|
||||
// 选中状态会通过props.selectedRecordId自动更新
|
||||
});
|
||||
};
|
||||
|
||||
// 删除历史记录
|
||||
const handleDelete = async (item) => {
|
||||
try {
|
||||
// 检查是否已打印
|
||||
if (item.printCount && item.printCount > 0) {
|
||||
ElMessage.warning('已打印的记录不允许删除');
|
||||
return;
|
||||
}
|
||||
|
||||
await deleteRecord([item.id]);
|
||||
ElMessage.success('删除成功');
|
||||
queryList();
|
||||
} catch (error) {
|
||||
ElMessage.error('删除失败');
|
||||
}
|
||||
};
|
||||
const handleNodeClick = (data) => {
|
||||
emits('historyClick', data);
|
||||
};
|
||||
defineExpose({ queryList, updateSelectedRecord });
|
||||
const currentSelectTemplate = ref({});
|
||||
defineExpose({ queryList });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.emr-history-container {
|
||||
height: 100%;
|
||||
// padding: 8px;
|
||||
.search-box {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
.emr-history-scrollbar-container {
|
||||
height: 100%;
|
||||
// padding: 8px;
|
||||
.search-box {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
|
||||
}
|
||||
.emr-history-scrollbar-container{
|
||||
padding: 8px;
|
||||
height: calc(100% - 40px);
|
||||
.scrollbar-item {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
background: var(--el-color-primary-light-9);
|
||||
& + .scrollbar-item {
|
||||
margin-top: 8px;
|
||||
}
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.selected-history-item {
|
||||
background-color: rgb(194, 231, 255);
|
||||
}
|
||||
|
||||
.disabled-icon {
|
||||
color: #d9d9d9;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
.scrollbar-item {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
background: var(--el-color-primary-light-9);
|
||||
& + .scrollbar-item {
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,15 +9,17 @@
|
||||
</div> -->
|
||||
<el-scrollbar class="emr-template-scrollbar-container" style="width: 100%">
|
||||
<div v-for="item in templateData" :key="item.id" class="scrollbar-item">
|
||||
<el-tooltip effect="dark" :content="`${item.name}`" placement="bottom">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="`${item.name}`"
|
||||
placement="bottom"
|
||||
>
|
||||
<el-text class="2" truncated @click="handleNodeClick(item)">
|
||||
<div class="template-item">
|
||||
{{ item.name }}
|
||||
<el-space>
|
||||
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
|
||||
<el-icon><Delete @click="handleDelete(item)" /></el-icon>
|
||||
</el-space>
|
||||
</div>
|
||||
<div class="template-item">{{ item.name }}
|
||||
<el-space>
|
||||
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
|
||||
</el-space></div>
|
||||
|
||||
</el-text>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@@ -31,8 +33,7 @@ import { getListByDefinitionId } from '../api';
|
||||
import { ElTree } from 'element-plus';
|
||||
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { Edit } from '@element-plus/icons-vue';
|
||||
const emits = defineEmits(['templateClick', 'edit']);
|
||||
const emits = defineEmits(['templateClick','edit']);
|
||||
const props = defineProps({
|
||||
definitionId: {
|
||||
type: String,
|
||||
@@ -54,12 +55,13 @@ const queryParams = ref({
|
||||
const templateData = ref([]);
|
||||
const queryList = async () => {
|
||||
try {
|
||||
if (unref(definitionId) && unref(definitionId) !== '') {
|
||||
if ( unref(definitionId)&&unref(definitionId) !== '') {
|
||||
const res = await getListByDefinitionId(unref(definitionId));
|
||||
templateData.value = res.data || [];
|
||||
} else {
|
||||
}else{
|
||||
templateData.value = [];
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
ElMessage.error('获取模板失败');
|
||||
templateData.value = [];
|
||||
@@ -71,60 +73,40 @@ const handleNodeClick = (data) => {
|
||||
const handleEdit = (data) => {
|
||||
emits('edit', data);
|
||||
};
|
||||
|
||||
// 删除模板
|
||||
const handleDelete = async (item) => {
|
||||
try {
|
||||
ElMessageBox.confirm('确定要删除该模板吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
await deleteTemplate(item.id);
|
||||
ElMessage.success('删除成功');
|
||||
queryList();
|
||||
});
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
ElMessage.error('删除失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const currentSelectTemplate = ref({});
|
||||
defineExpose({ queryList });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.emr-template-container {
|
||||
height: 100%;
|
||||
// padding: 8px;
|
||||
|
||||
.emr-template-scrollbar-container {
|
||||
height: 100%;
|
||||
// padding: 8px;
|
||||
|
||||
.emr-template-scrollbar-container{
|
||||
padding: 8px;
|
||||
height: 100%;
|
||||
.scrollbar-item {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
background: var(--el-color-primary-light-9);
|
||||
& + .scrollbar-item {
|
||||
margin-top: 8px;
|
||||
}
|
||||
transition: all 0.3s ease;
|
||||
.el-text {
|
||||
width: calc(100% - 0px);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.template-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.scrollbar-item {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
background: var(--el-color-primary-light-9);
|
||||
& + .scrollbar-item {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.el-text{
|
||||
width: calc(100% - 0px);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.template-item{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
destroy-on-close
|
||||
@open="handleOpen"
|
||||
>
|
||||
<!-- 使用el-form包裹表单 -->
|
||||
<!-- 使用el-form包裹表单 -->
|
||||
<el-form :model="formData" ref="formRef" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24" class="mb8">
|
||||
<el-col :span="24">
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
/*
|
||||
* @Author: sjjh
|
||||
* @Date: 2025-04-09 17:55:05
|
||||
* @Description:
|
||||
* @Description:
|
||||
*/
|
||||
// import { IInPatient } from '@/model/IInPatient'
|
||||
import { ref } from 'vue';
|
||||
import { ref } from 'vue'
|
||||
|
||||
// 定义护士等级(没接口前mock)
|
||||
export const nursingLevel = ref('0');
|
||||
export const nursingLevel = ref('0')
|
||||
|
||||
export function updateNursingLevel(level) {
|
||||
nursingLevel.value = level;
|
||||
nursingLevel.value = level
|
||||
}
|
||||
|
||||
// 选择患者信息
|
||||
export const patientInfo = ref();
|
||||
export const patientInfo = ref()
|
||||
export function updatePatientInfo(info) {
|
||||
patientInfo.value = info;
|
||||
console.log(123111);
|
||||
|
||||
patientInfo.value = info
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user