fix(ui): 修复多个功能模块的验证和数据处理问题

- 在医生工作站退费功能中添加患者选择验证
- 统一药品管理中的仓库类型选择逻辑,移除重复代码
- 修复统计管理页面清空按钮的数据重置问题
- 修正西药管理页面处方打印按钮的功能绑定
- 完善库存报表查询的SQL过滤条件实现
- 更新多个控制器接口参数类型以支持业务流程
- 优化退费列表对话框的数据加载和错误处理
This commit is contained in:
2026-03-02 23:27:11 +08:00
parent ce8b0b16b1
commit 9116ea4a84
22 changed files with 447 additions and 155 deletions

View File

@@ -696,7 +696,9 @@ import {
delProductStocktaking,
getCount,
getDetailInit,
getDispensaryList,
getInit,
getPharmacyList,
getstocktakingDetail,
getStocktakingReceiptBatch,
productStocktakingApproved,
@@ -2295,7 +2297,7 @@ function handleChangePurposeTypeEnum(value, type) {
}
// getinitValue()
});
} else if (numValue === 17) {
} else if (value === 17) {
// 处理耗材库类型
// 参考采购订单模块的实现,硬编码设置中心耗材库信息
purposeTypeListOptions.value = [

View File

@@ -1174,44 +1174,40 @@ function handleChangePurposeTypeEnum(value, type) {
receiptHeaderForm.purposeLocationId = '';
}
});
} else if (value === 17) {
// 处理耗材库类型
// 参考采购订单模块的实现,硬编码设置中心耗材库信息
purposeTypeListOptions.value = [
{
id: "1",
name: "中心耗材库",
formEnum: 17,
children: []
}
];
// 设置默认仓库和货位
getinitValue();
} else {
console.log('未知的仓库类型值:', value);
purposeTypeListOptions.value = [];
freightListOptions.value = [];
}
if (numValue === 16 || numValue === 11) {
console.log('Calling getpharmacyCabinetList for warehouse type:', numValue);
// 使用统一接口获取药房或药库列表
getpharmacyCabinetList().then((res) => {
console.log('getPharmacyCabinetList response:', res);
// 过滤出符合当前类型的仓库列表
const filteredList = res.data.filter(item => item.formEnum === numValue);
purposeTypeListOptions.value = filteredList;
console.log('purposeTypeListOptions set to filtered list:', purposeTypeListOptions.value);
// 设置默认仓库和货位
getinitValue();
}).catch((error) => {
console.error('getPharmacyCabinetList error:', error);
purposeTypeListOptions.value = [];
freightListOptions.value = [];
});
} else if (numValue === 17) {
console.log('Setting hardcoded consumable warehouse');
// 处理耗材库类型
// 参考采购订单模块的实现,硬编码设置中心耗材库信息
purposeTypeListOptions.value = [
{
id: "1",
name: "中心耗材库",
formEnum: 17,
children: []
}
];
console.log('purposeTypeListOptions set to:', purposeTypeListOptions.value);
// 设置默认仓库和货位
getinitValue();
} else {
console.log('Unknown value:', value);
purposeTypeListOptions.value = [];
freightListOptions.value = [];
}
// 获取默认值
function getinitValue() {
if (purposeTypeListOptions.value.length > 0) {
// 判断是否有盘点仓库
receiptHeaderForm.purposeLocationId = purposeTypeListOptions.value[0].id; // 盘点仓库默认值
if (
purposeTypeListOptions.value[0].children &&
purposeTypeListOptions.value[0].children.length > 0
) {
// 判断盘点仓库内是否有货位
freightListOptions.value = purposeTypeListOptions.value[0].children;
receiptHeaderForm.purposeLocation = purposeTypeListOptions.value[0].children[0].name;
}
}
}
// 切换仓库获取货位列表 -20250414

View File

@@ -114,6 +114,14 @@ export function getDispensaryList() {
})
}
// 获取耗材库列表
export function getWarehouseList() {
return request({
url: '/app-common/warehouse-list',
method: 'get',
})
}
/**
* 审批驳回
*/

View File

@@ -536,6 +536,7 @@ import {
getMedicineList,
getPharmacyCabinetList,
getPharmacyList,
getWarehouseList,
getTransferProductDetail,
lossReportApproved,
reject,
@@ -857,10 +858,26 @@ function handleBlur(row, index) {
row.applicantId = userStore.id;
}
function handleChangeSourceTypeEnum(value) {
// 无论选择哪种仓库类型,都显示药房、药库、耗材库的选项
getPharmacyCabinetList().then((res) => {
sourceTypeListOptions.value = res.data;
});
// 根据仓库类型获取对应的仓库列表
// 16: 药房, 11: 药库, 17: 耗材库
if (value == 16) {
// 药房
getPharmacyList().then((res) => {
sourceTypeListOptions.value = res.data;
});
} else if (value == 11) {
// 药库
getDispensaryList().then((res) => {
sourceTypeListOptions.value = res.data;
});
} else if (value == 17) {
// 耗材库
getWarehouseList().then((res) => {
sourceTypeListOptions.value = res.data;
});
} else {
sourceTypeListOptions.value = [];
}
}
// 获取详情
function getTransferProductDetails() {
@@ -1242,13 +1259,39 @@ function handleChangePurposeTypeEnum(value) {
}
// 源仓库切换
function handleChangelossTypeEnum(value) {
// 无论选择哪种仓库类型,都显示药房、药库、耗材库的选项
getPharmacyCabinetList().then((res) => {
sourceTypeListOptions.value = res.data;
// 根据仓库类型获取对应的仓库列表
// 16: 药房, 11: 药库, 17: 耗材库
if (value == 16) {
// 药房
getPharmacyList().then((res) => {
sourceTypeListOptions.value = res.data;
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
});
} else if (value == 11) {
// 药库
getDispensaryList().then((res) => {
sourceTypeListOptions.value = res.data;
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
});
} else if (value == 17) {
// 耗材库
getWarehouseList().then((res) => {
sourceTypeListOptions.value = res.data;
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
});
} else {
// 其他情况清空列表
sourceTypeListOptions.value = [];
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
});
}
}
// 单位处理
function handleUnitCodeChange(row, index, value) {

View File

@@ -57,7 +57,7 @@ export function submitApproval(busNo) {
return request({
url: '/inventory-manage/purchase/submit-approval',
method: 'put',
data: busNo
data: { busNo }
})
}
@@ -66,7 +66,7 @@ export function withdrawApproval(busNo) {
return request({
url: '/inventory-manage/purchase/withdraw-approval',
method: 'put',
data: busNo
data: { busNo }
})
}

View File

@@ -58,7 +58,7 @@ export function submitApproval(busNo) {
url: '/issue-manage/requisition/submit-approval',
// '/inventory-manage/purchase/submit-approval',
method: 'put',
data: busNo
data: { busNo }
})
}
@@ -68,7 +68,7 @@ export function withdrawApproval(busNo) {
url: '/issue-manage/requisition/withdraw-approval',
// '/inventory-manage/purchase/withdraw-approval',
method: 'put',
data: busNo
data: { busNo }
})
}
@@ -173,7 +173,7 @@ export function submitTHApproval(busNo) {
url: '/issue-manage/return/submit-approval',
// '/inventory-manage/purchase/submit-approval',
method: 'put',
data: busNo
data: { busNo }
})
}
@@ -183,7 +183,7 @@ export function withdrawTHApproval(busNo) {
url: '/issue-manage/return/withdraw-approval',
// '/inventory-manage/purchase/withdraw-approval',
method: 'put',
data: busNo
data: { busNo }
})
}
/**

View File

@@ -61,10 +61,10 @@
</el-select>
</el-form-item>
<el-form-item label="停供状态" prop="categoryCode">
<el-form-item label="停供状态" prop="inventoryStatusEnum">
<el-select
v-model="queryParams.inventoryStatusEnum"
placeholder="请选择药品类别"
placeholder="请选择停供状态"
clearable
style="width: 150px"
@change="handleQuery"
@@ -525,6 +525,7 @@ const data = reactive({
medCategoryCodes: [],
devCategoryCodes: [],
backUpDate: undefined,
inventoryStatusEnum: undefined,
},
rules: {},
});
@@ -737,8 +738,6 @@ function handleClear() {
// 清空不在 queryParams 中的字段
locationId.value = [];
supplierId.value = [];
// 清空 prop 与 v-model 不匹配的字段
queryParams.value.inventoryStatusEnum = undefined;
getList();
}