Compare commits
4 Commits
4069c452ba
...
c24520db74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c24520db74 | ||
|
|
091bf16df2 | ||
|
|
214e82ae29 | ||
|
|
655436bea9 |
@@ -78,7 +78,11 @@
|
||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||
SELECT wsr.quantity,
|
||||
wsr.unit_code,
|
||||
COALESCE(wad.NAME, wsr.content_json::jsonb->>'surgeryName') AS advice_name,
|
||||
COALESCE(
|
||||
wad.NAME,
|
||||
wsr.content_json::jsonb->>'surgeryName',
|
||||
'检验项目'
|
||||
) AS advice_name,
|
||||
aci.total_price
|
||||
FROM wor_service_request AS wsr
|
||||
LEFT JOIN wor_activity_definition AS wad ON wad.ID = wsr.activity_id
|
||||
@@ -88,6 +92,7 @@
|
||||
AND aci.delete_flag = '0'
|
||||
WHERE wsr.delete_flag = '0'
|
||||
AND wsr.prescription_no = #{prescriptionNo}
|
||||
ORDER BY wsr.id
|
||||
</select>
|
||||
|
||||
<select id="getActivityOrganizationConfig"
|
||||
|
||||
@@ -678,15 +678,16 @@ const handlePrint = async (row) => {
|
||||
}
|
||||
|
||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
const fieldKeys = ['targetDepartment', 'urgencyLevel', 'expectedExaminationTime', 'allergyHistory', 'examinationPurpose', 'medicalHistorySummary', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
let descFieldsHtml = '';
|
||||
fieldKeys.forEach((key) => {
|
||||
const label = labelMap[key] || key;
|
||||
if (descData[key] != null && descData[key] !== '') {
|
||||
const value = transformField(key, descData[key]);
|
||||
if (value != null && value !== '') {
|
||||
descFieldsHtml += `
|
||||
<div class="info-row">
|
||||
<span class="label">${label}:</span>
|
||||
<span class="value">${descData[key]}</span>
|
||||
<span class="value">${value}</span>
|
||||
</div>`;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
buildApplicationName(currentDetail)
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
|
||||
@@ -142,6 +142,11 @@
|
||||
<el-table-column label="医嘱" align="center" prop="productName" width="300">
|
||||
<template #default="scope">
|
||||
<template v-if="getRowDisabled(scope.row)">
|
||||
<!-- 当行的 adviceType 不在当前选项列表中时,显示标签而非下拉框 -->
|
||||
<template v-if="!hasAdviceTypeOption(scope.row)">
|
||||
<el-tag size="small" type="primary">{{ getAdviceTypeLabel(scope.row.adviceType) }}</el-tag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-select
|
||||
style="width: 35%; margin-right: 8px"
|
||||
:model-value="getRowSelectValue(scope.row)"
|
||||
@@ -216,6 +221,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</template>
|
||||
<span v-else>{{ scope.row.adviceName }}</span>
|
||||
</template>
|
||||
@@ -750,6 +756,31 @@ function getRowDisabled(row) {
|
||||
return row.isEdit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断行的 adviceType 是否在当前 adviceTypeList 选项中有匹配项
|
||||
* 修复 Bug #488:避免 el-select 因无匹配选项而回显为纯数字
|
||||
*/
|
||||
function hasAdviceTypeOption(row) {
|
||||
if (!row.adviceType && row.adviceType !== 0) return false;
|
||||
if (row.adviceType == 1 && row.categoryCode) {
|
||||
const compositeValue = '1-' + row.categoryCode;
|
||||
return adviceTypeList.value.some(item => item.value === compositeValue);
|
||||
}
|
||||
return adviceTypeList.value.some(item => item.value === row.adviceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将原始 adviceType 数字映射为人类可读标签
|
||||
* 修复 Bug #488:当 adviceType 不在选项列表中时,显示标签而非数字
|
||||
*/
|
||||
function getAdviceTypeLabel(type) {
|
||||
if (!type && type !== 0) return '';
|
||||
// 优先使用字典文本(如果后端返回了 adviceType_dictText)
|
||||
// 但由于当前行数据可能没有 dictText,提供兜底映射
|
||||
const fallbackMap = { 1: '西药', 2: '中成药', 3: '诊疗', 4: '耗材', 5: '会诊', 6: '手术', 23: '检查' };
|
||||
return fallbackMap[type] || String(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将行的 adviceType + categoryCode 映射为 el-select 的选中值
|
||||
* 药品子分类使用复合值如 '1-2'(adviceType-categoryCode),诊疗/手术/全部使用原始值
|
||||
@@ -910,9 +941,8 @@ function handleFocus(row, index) {
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row.adviceType为undefined),
|
||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
||||
const categoryCode = row.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
||||
// 当行没有显式选择医嘱类型时,使用已配置的默认categoryCode,确保后端能返回结果
|
||||
const categoryCode = row.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : (adviceQueryParams.value.categoryCode || '');
|
||||
const searchKey = row.adviceName || '';
|
||||
|
||||
nextTick(() => {
|
||||
@@ -949,9 +979,8 @@ function handleChange(value) {
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row?.adviceType为undefined),
|
||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
||||
const categoryCode = row?.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
||||
// 当行没有显式选择医嘱类型时,使用已配置的默认categoryCode,确保后端能返回结果
|
||||
const categoryCode = row?.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : (adviceQueryParams.value.categoryCode || '');
|
||||
// 修复Bug #453:当adviceType为空字符串或NaN时,不传具体类型,让refresh函数根据searchKey决定搜索范围
|
||||
const effectiveAdviceType = (adviceType && !isNaN(Number(adviceType))) ? adviceType : '';
|
||||
tableRef.refresh(effectiveAdviceType, categoryCode, value);
|
||||
@@ -1378,6 +1407,9 @@ function handleSaveSign(row, index) {
|
||||
bindMethod.value[itemNo] = true;
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
// 绑定设备接口失败不影响主流程保存,静默降级
|
||||
console.warn('绑定设备检查接口调用失败(adviceType=' + row.adviceType + ', itemNo=' + itemNo + ')');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user