|
|
|
|
@@ -137,7 +137,7 @@
|
|
|
|
|
<el-descriptions title="申请单描述" :column="2">
|
|
|
|
|
<template v-for="(value, key) in descJsonData" :key="key">
|
|
|
|
|
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
|
|
|
|
{{ transformField(key, value) || '-' }}
|
|
|
|
|
{{ value || '-' }}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
@@ -270,12 +270,6 @@ const parseStatus = (status) => {
|
|
|
|
|
const labelMap = {
|
|
|
|
|
categoryType: '项目类别',
|
|
|
|
|
targetDepartment: '发往科室',
|
|
|
|
|
urgencyLevel: '紧急程度',
|
|
|
|
|
allergyHistory: '过敏史',
|
|
|
|
|
examinationPurpose: '检查目的',
|
|
|
|
|
expectedExaminationTime: '期望检查时间',
|
|
|
|
|
medicalHistorySummary: '病史摘要',
|
|
|
|
|
allergyConfirmed: '过敏确认',
|
|
|
|
|
symptom: '症状',
|
|
|
|
|
sign: '体征',
|
|
|
|
|
clinicalDiagnosis: '临床诊断',
|
|
|
|
|
@@ -284,17 +278,6 @@ const labelMap = {
|
|
|
|
|
attention: '注意事项',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Fields that need value transformation before display
|
|
|
|
|
const transformField = (key, value) => {
|
|
|
|
|
if (key === 'urgencyLevel') {
|
|
|
|
|
return value === 'emergency' ? '急诊' : '普通';
|
|
|
|
|
}
|
|
|
|
|
if (key === 'allergyConfirmed') {
|
|
|
|
|
return value === true || value === 'true' ? '已口头确认' : '未确认';
|
|
|
|
|
}
|
|
|
|
|
return value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const isFieldMatched = (key) => {
|
|
|
|
|
return key in labelMap;
|
|
|
|
|
};
|
|
|
|
|
@@ -309,46 +292,49 @@ const hasMatchedFields = computed(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/** 查询科室 */
|
|
|
|
|
const getLocationInfo = async () => {
|
|
|
|
|
const res = await getDepartmentList();
|
|
|
|
|
orgOptions.value = res.data || [];
|
|
|
|
|
const getLocationInfo = () => {
|
|
|
|
|
getDepartmentList().then((res) => {
|
|
|
|
|
orgOptions.value = res.data || [];
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const recursionFun = (targetDepartment) => {
|
|
|
|
|
if (!targetDepartment) return '';
|
|
|
|
|
let name = '';
|
|
|
|
|
for (let index = 0; index < orgOptions.value.length; index++) {
|
|
|
|
|
const obj = orgOptions.value[index];
|
|
|
|
|
if (obj.id == targetDepartment) {
|
|
|
|
|
name = obj.name;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
const subObjArray = obj['children'];
|
|
|
|
|
if (subObjArray && subObjArray.length > 0) {
|
|
|
|
|
for (let i = 0; i < subObjArray.length; i++) {
|
|
|
|
|
const item = subObjArray[i];
|
|
|
|
|
for (let index = 0; index < subObjArray.length; index++) {
|
|
|
|
|
const item = subObjArray[index];
|
|
|
|
|
if (item.id == targetDepartment) {
|
|
|
|
|
name = item.name;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (name) break;
|
|
|
|
|
}
|
|
|
|
|
return name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleViewDetail = async (row) => {
|
|
|
|
|
// 确保科室数据已加载,以便将 ID 解析为名称
|
|
|
|
|
if (!orgOptions.value || orgOptions.value.length === 0) {
|
|
|
|
|
await getLocationInfo();
|
|
|
|
|
}
|
|
|
|
|
console.log('targetDepartment========>', JSON.stringify(row));
|
|
|
|
|
|
|
|
|
|
currentDetail.value = row;
|
|
|
|
|
// 解析 descJson
|
|
|
|
|
if (row.descJson) {
|
|
|
|
|
try {
|
|
|
|
|
const obj = JSON.parse(row.descJson);
|
|
|
|
|
// 确保科室数据已加载
|
|
|
|
|
if (!orgOptions.value || orgOptions.value.length === 0) {
|
|
|
|
|
await new Promise((resolve) => {
|
|
|
|
|
getDepartmentList().then((res) => {
|
|
|
|
|
orgOptions.value = res.data || [];
|
|
|
|
|
resolve();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
|
|
|
|
descJsonData.value = obj;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|