修复bug375:住院医生站点击“签发”按钮后系统提示语错误,显示为“保存成功”并且签发业务功能未实现。
bug376:【门诊医生站】检查页签申请单列表过滤异常,显示了历史检查就诊记录 bug377:【门诊医生站】检查申请单“执行科室”未获取配置默认值且字段交互逻辑不规范
This commit is contained in:
@@ -116,7 +116,29 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="执行科室" prop="performDeptCode">
|
||||
<el-input v-model="form.performDeptCode" />
|
||||
<el-select
|
||||
v-model="form.performDeptCode"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
clearable
|
||||
placeholder="请选择执行科室(支持模糊查询)"
|
||||
:remote-method="handleOrgRemoteSearch"
|
||||
:loading="orgLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in orgFilteredOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
<template #empty>
|
||||
<div style="padding: 10px 0; color: #909399; text-align: center;">
|
||||
{{ orgLoading ? '加载中...' : '暂无匹配科室' }}
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -383,6 +405,11 @@ const activeNames = ref([]); // 当前展开的折叠项
|
||||
|
||||
const allMethods = ref([]);
|
||||
|
||||
// ====== 科室下拉(来源:科室管理)======
|
||||
const orgLoading = ref(false);
|
||||
const orgOptions = ref([]); // { label, value }
|
||||
const orgFilteredOptions = ref([]); // 展示用(截断前200条)
|
||||
|
||||
// 加载所有检查方法
|
||||
async function loadAllMethods() {
|
||||
try {
|
||||
@@ -408,10 +435,61 @@ async function loadAllMethods() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadOrgOptions();
|
||||
await loadAllMethods();
|
||||
await loadCategoryList();
|
||||
});
|
||||
|
||||
async function loadOrgOptions() {
|
||||
orgLoading.value = true;
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
});
|
||||
const records = res?.data?.records || res?.data || [];
|
||||
|
||||
const flat = [];
|
||||
const walk = (nodes) => {
|
||||
if (!Array.isArray(nodes)) return;
|
||||
for (const n of nodes) {
|
||||
if (!n) continue;
|
||||
// 约定:typeEnum=2 为科室;若没有 typeEnum 也兜底收集
|
||||
if (n.name && (n.typeEnum === 2 || n.typeEnum === '2' || n.typeEnum == null)) {
|
||||
flat.push({ label: n.name, value: n.name });
|
||||
}
|
||||
if (Array.isArray(n.children) && n.children.length > 0) walk(n.children);
|
||||
}
|
||||
};
|
||||
walk(records);
|
||||
|
||||
// 去重 + 排序
|
||||
const uniq = Array.from(new Map(flat.map(o => [o.value, o])).values())
|
||||
.filter(o => o?.value)
|
||||
.sort((a, b) => (a.label || '').localeCompare(b.label || '', 'zh-CN'));
|
||||
|
||||
orgOptions.value = uniq;
|
||||
orgFilteredOptions.value = uniq.slice(0, 200);
|
||||
} catch (e) {
|
||||
console.error('加载科室列表失败', e);
|
||||
orgOptions.value = [];
|
||||
orgFilteredOptions.value = [];
|
||||
} finally {
|
||||
orgLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleOrgRemoteSearch(keyword) {
|
||||
const key = (keyword || '').trim().toLowerCase();
|
||||
if (!key) {
|
||||
orgFilteredOptions.value = orgOptions.value.slice(0, 200);
|
||||
return;
|
||||
}
|
||||
orgFilteredOptions.value = orgOptions.value
|
||||
.filter((o) => (o.label || '').toLowerCase().includes(key))
|
||||
.slice(0, 200);
|
||||
}
|
||||
|
||||
// 动态可用的检查方法(根据已选部位所属的检查类型进行过滤)
|
||||
const normalizeTypeValue = value => String(value ?? '').trim().toLowerCase();
|
||||
|
||||
@@ -497,6 +575,8 @@ async function loadCategoryList() {
|
||||
orgType: t.type, // 保存 type 用于后备匹配
|
||||
typeName: t.name, // 保存 name
|
||||
categoryName: t.name,
|
||||
// “检查类型管理”里配置的执行科室(图三)
|
||||
performDeptName: t.department || '',
|
||||
items: []
|
||||
});
|
||||
}
|
||||
@@ -591,7 +671,8 @@ function getList() {
|
||||
request({
|
||||
url: '/exam/apply/list',
|
||||
method: 'get',
|
||||
params: { visitNo: props.patientInfo?.visitNo || '' }
|
||||
// 默认只展示本次就诊(encounterId)产生的检查申请单
|
||||
params: { encounterId: props.patientInfo?.encounterId || '' }
|
||||
}).then(res => {
|
||||
applicationList.value = res.rows || res.data || [];
|
||||
}).catch(err => console.error('获取申请单列表失败', err))
|
||||
@@ -705,6 +786,12 @@ function handleItemSelect(checked, item, cat) {
|
||||
nationalCode: item.nationalCode || '',
|
||||
checked: true
|
||||
});
|
||||
|
||||
// 自动回填执行科室:按检查项目类型 → 检查类型管理里配置的执行科室
|
||||
// 仅在未手动选择时自动填充,避免覆盖用户输入
|
||||
if (!form.performDeptCode && cat?.performDeptName) {
|
||||
form.performDeptCode = cat.performDeptName;
|
||||
}
|
||||
} else {
|
||||
const idx = selectedItems.value.findIndex(s => s.id === item.id);
|
||||
if (idx > -1) selectedItems.value.splice(idx, 1);
|
||||
|
||||
@@ -2272,7 +2272,26 @@ function handleNumberClick(item, index, row) {
|
||||
|
||||
// 选择执行科室处理
|
||||
function handleOrgChange(value, index, row) {
|
||||
// 这里的“执行科室”在后端通常以 organizationId / positionId 参与业务校验;
|
||||
// 列表展示用的是 positionName,因此需要同步写入名称,避免“选了但显示空”的问题。
|
||||
row.orgId = value;
|
||||
row.positionId = value;
|
||||
row.positionName = findOrgNameById(value) || row.positionName || '';
|
||||
}
|
||||
|
||||
function findOrgNameById(id) {
|
||||
if (!id) return '';
|
||||
const targetId = String(id);
|
||||
const stack = Array.isArray(organization.value) ? [...organization.value] : [];
|
||||
while (stack.length > 0) {
|
||||
const node = stack.shift();
|
||||
if (!node) continue;
|
||||
if (String(node.id) === targetId) return node.name || '';
|
||||
if (Array.isArray(node.children) && node.children.length > 0) {
|
||||
stack.unshift(...node.children);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<PatientRegister
|
||||
v-model="patientRegisterVisible"
|
||||
v-model:dialogVisible="patientRegisterVisible"
|
||||
:patientInfo="patient"
|
||||
:inHospitalInfo="inHospitalInfo"
|
||||
title="登记"
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<PatientRegister
|
||||
v-model="patientRegisterVisible"
|
||||
v-model:dialogVisible="patientRegisterVisible"
|
||||
:patientInfo="patient"
|
||||
:inHospitalInfo="inHospitalInfo"
|
||||
title="登记"
|
||||
|
||||
@@ -220,17 +220,6 @@ const { in_way_code, admit_source_code, med_type } = proxy.useDict(
|
||||
'med_type'
|
||||
);
|
||||
|
||||
// 监听诊断类别字典加载,默认选择第一项
|
||||
watch(
|
||||
med_type,
|
||||
(newVal) => {
|
||||
if (newVal && newVal.length > 0 && !submitForm.medTypeCode) {
|
||||
submitForm.medTypeCode = newVal[0].value;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emits = defineEmits([]);
|
||||
const props = defineProps({
|
||||
patientInfo: {
|
||||
@@ -351,6 +340,17 @@ const submitForm = reactive({
|
||||
ambDiagnosisName: props.inHospitalInfo.ambDiagnosisName,
|
||||
medTypeCode: '', // 从字典动态获取默认值
|
||||
});
|
||||
|
||||
// 监听诊断类别字典加载,默认选择第一项
|
||||
watch(
|
||||
med_type,
|
||||
(newVal) => {
|
||||
if (newVal && newVal.length > 0 && !submitForm.medTypeCode) {
|
||||
submitForm.medTypeCode = newVal[0].value;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// /* 科室 病区 */
|
||||
// watch(
|
||||
// () => submitForm.inDocterWorkGroupCode,
|
||||
|
||||
@@ -833,7 +833,16 @@ function handleSave() {
|
||||
isAdding.value = false;
|
||||
expandOrder.value = [];
|
||||
}
|
||||
let saveList = prescriptionList.value.filter((item) => {
|
||||
|
||||
const selectedRows = prescriptionRef.value ? prescriptionRef.value.getSelectionRows() : [];
|
||||
let sourceList = [];
|
||||
if (selectedRows.length > 0) {
|
||||
sourceList = selectedRows;
|
||||
} else {
|
||||
sourceList = prescriptionList.value;
|
||||
}
|
||||
|
||||
let saveList = sourceList.filter((item) => {
|
||||
return item.statusEnum == 1;
|
||||
});
|
||||
|
||||
@@ -907,7 +916,7 @@ function handleSave() {
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('保存成功');
|
||||
proxy.$modal.msgSuccess('签发成功');
|
||||
isSaving.value = false;
|
||||
getListInfo(false);
|
||||
bindMethod.value = {};
|
||||
|
||||
Reference in New Issue
Block a user