Compare commits
2 Commits
b3de1dec38
...
d3d144bb18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3d144bb18 | ||
|
|
6d766b09a7 |
@@ -61,15 +61,14 @@
|
|||||||
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||||
drf.requester_id, drf.create_time, ap.name
|
drf.requester_id, drf.create_time, ap.name
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
HAVING CASE MIN(wsr.status_enum)
|
HAVING CASE
|
||||||
WHEN 1 THEN 0
|
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||||
WHEN 2 THEN 1
|
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||||
WHEN 3 THEN 4
|
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||||
WHEN 4 THEN 4
|
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||||
WHEN 5 THEN 5
|
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||||
WHEN 6 THEN 5
|
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||||
WHEN 7 THEN 5
|
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||||
WHEN 8 THEN 6
|
|
||||||
ELSE NULL
|
ELSE NULL
|
||||||
END = #{status}::integer
|
END = #{status}::integer
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -521,31 +521,28 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 加载科室选项(支持树形/扁平两种数据结构)
|
// 加载科室选项(递归扁平化树形结构)
|
||||||
function loadDepartmentOptions() {
|
function loadDepartmentOptions() {
|
||||||
getOrgList()
|
getOrgList()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data) {
|
if (!res?.data?.records?.length) {
|
||||||
// 尝试从树形结构中取:records[0].children
|
|
||||||
if (res.data.records && res.data.records.length > 0) {
|
|
||||||
if (res.data.records[0].children && res.data.records[0].children.length > 0) {
|
|
||||||
departmentOptions.value = res.data.records[0].children;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 如果 records[0] 有 id 和 name(非树根节点),直接用所有 records
|
|
||||||
if (res.data.records[0].id) {
|
|
||||||
departmentOptions.value = res.data.records;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 兜底:如果 records 不存在或为空,尝试直接使用 data 本身
|
|
||||||
if (Array.isArray(res.data)) {
|
|
||||||
departmentOptions.value = res.data;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 所有方式都失败,置空
|
|
||||||
departmentOptions.value = [];
|
departmentOptions.value = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 递归扁平化树形结构,提取所有科室节点
|
||||||
|
const flattenTree = (nodes) => {
|
||||||
|
const result = [];
|
||||||
|
for (const node of nodes) {
|
||||||
|
if (node?.id && node?.name) {
|
||||||
|
result.push(node);
|
||||||
|
}
|
||||||
|
if (node?.children?.length) {
|
||||||
|
result.push(...flattenTree(node.children));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
departmentOptions.value = flattenTree(res.data.records);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.warn('科室列表加载失败(可能无权限)');
|
console.warn('科室列表加载失败(可能无权限)');
|
||||||
@@ -611,13 +608,13 @@ function getUnitCodeOptions(row) {
|
|||||||
const unitCodes = [];
|
const unitCodes = [];
|
||||||
// 大单位:优先用 code,code 缺失时用字典文本兜底
|
// 大单位:优先用 code,code 缺失时用字典文本兜底
|
||||||
if (row.unitCode != null && String(row.unitCode) !== '') {
|
if (row.unitCode != null && String(row.unitCode) !== '') {
|
||||||
unitCodes.push({ code: String(row.unitCode), codeText: row.unitCode_dictText });
|
unitCodes.push({ code: String(row.unitCode), codeText: row.unitCode_dictText || String(row.unitCode) });
|
||||||
} else if (row.unitCode_dictText) {
|
} else if (row.unitCode_dictText) {
|
||||||
unitCodes.push({ code: row.unitCode_dictText, codeText: row.unitCode_dictText });
|
unitCodes.push({ code: row.unitCode_dictText, codeText: row.unitCode_dictText });
|
||||||
}
|
}
|
||||||
// 小单位:同上
|
// 小单位:同上
|
||||||
if (row.minUnitCode != null && String(row.minUnitCode) !== '') {
|
if (row.minUnitCode != null && String(row.minUnitCode) !== '') {
|
||||||
unitCodes.push({ code: String(row.minUnitCode), codeText: row.minUnitCode_dictText });
|
unitCodes.push({ code: String(row.minUnitCode), codeText: row.minUnitCode_dictText || String(row.minUnitCode) });
|
||||||
} else if (row.minUnitCode_dictText) {
|
} else if (row.minUnitCode_dictText) {
|
||||||
unitCodes.push({ code: row.minUnitCode_dictText, codeText: row.minUnitCode_dictText });
|
unitCodes.push({ code: row.minUnitCode_dictText, codeText: row.minUnitCode_dictText });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user