Fix Bug #542: 补费界面耗材类型检索不到数据 — 根因:drord_doctor_type字典中耗材值=4但后端SQL查询adviceTypes.contains(2)仅匹配2;修复:filter扩展为2/3/4并通过map将字典值4映射为2,使前端选择的耗材类型(adviceType=2)与后端SQL查询条件一致
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -342,13 +342,14 @@ const dialogVisible = computed({
|
|||||||
// 使用 drord_doctor_type 字典
|
// 使用 drord_doctor_type 字典
|
||||||
const adviceTypeList = computed(() => {
|
const adviceTypeList = computed(() => {
|
||||||
if (drord_doctor_type.value && drord_doctor_type.value.length > 0) {
|
if (drord_doctor_type.value && drord_doctor_type.value.length > 0) {
|
||||||
// 只保留耗材(4)和诊疗(3)类型,并添加全部选项
|
// 只保留耗材(2)和诊疗(3)类型,并添加全部选项
|
||||||
|
// 注意:后端SQL只认 adviceType=2(耗材) 和 3(诊疗),字典值4需映射为2
|
||||||
const filtered = drord_doctor_type.value.filter(item => {
|
const filtered = drord_doctor_type.value.filter(item => {
|
||||||
const val = parseInt(item.value);
|
const val = parseInt(item.value);
|
||||||
return val === 3 || val === 4;
|
return val === 2 || val === 3 || val === 4;
|
||||||
}).map(item => ({
|
}).map(item => ({
|
||||||
label: item.label,
|
label: item.label,
|
||||||
// 将前端字典值映射为后端SQL值: 耗材4→2, 诊疗3→3
|
// 后端SQL只有adviceTypes.contains(2)查询耗材,字典值4映射为2
|
||||||
value: parseInt(item.value) === 4 ? 2 : parseInt(item.value)
|
value: parseInt(item.value) === 4 ? 2 : parseInt(item.value)
|
||||||
}));
|
}));
|
||||||
return [...filtered, { label: '全部', value: '' }];
|
return [...filtered, { label: '全部', value: '' }];
|
||||||
|
|||||||
Reference in New Issue
Block a user