仓库bug
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
clearable
|
||||
style="width: 150px"
|
||||
:disabled="data.isEdit"
|
||||
@change="handleChangePurposeTypeEnum"
|
||||
@change="(value) => handleChangePurposeTypeEnum(value, 0)"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in warehous_type"
|
||||
@@ -736,16 +736,15 @@ import {
|
||||
submitApproval,
|
||||
getInit,
|
||||
delProductStocktaking,
|
||||
getPharmacyList,
|
||||
getCount,
|
||||
getDispensaryList,
|
||||
getMedicineList,
|
||||
getDetailInit,
|
||||
getstocktakingDetail, //查询盘点详情
|
||||
getStocktakingReceiptBatch, //生成批量盘点
|
||||
addBatch, //保存批量盘点
|
||||
productStocktakingApproved,
|
||||
reject
|
||||
reject,
|
||||
getpharmacyCabinetList
|
||||
} from "../components/api";
|
||||
import PopoverList from "@/components/OpenHis/popoverList/index.vue";
|
||||
import MedicineList from "../components/medicineList.vue";
|
||||
@@ -2015,8 +2014,6 @@ function getStockReceiptTypeList() {
|
||||
|
||||
// categoryListOptions.value = response.data.categoryListOptions; // 药品类型
|
||||
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏原因
|
||||
// receiptHeaderForm.purposeTypeEnum = warehous_type.value[0].value // 仓库类型默认值
|
||||
// handleChangePurposeTypeEnum(receiptHeaderForm.purposeTypeEnum)
|
||||
// cabinetListOptionsBk.value = response.data.purposeTypeListOptions; // 盘点仓库列表(未过滤)
|
||||
|
||||
// purposeTypeListOptions.value = cabinetListOptionsBk.value.filter(item => item.formEnum === receiptHeaderForm.purposeTypeEnum) // 盘点仓库列表
|
||||
@@ -2107,24 +2104,46 @@ function totalQuantityChange(rowData,index,value) {
|
||||
}
|
||||
// 切换仓库类型获取药房/药库列表 目的仓库切换
|
||||
function handleChangePurposeTypeEnum(value,type) {
|
||||
if (value == 16) {
|
||||
getPharmacyList().then((res) => {
|
||||
purposeTypeListOptions.value = res.data
|
||||
if(!route.query.supplyBusNo&&!type){
|
||||
receiptHeaderForm.purposeLocationId = ''
|
||||
receiptHeaderForm.purposeLocationId1 = ''
|
||||
}
|
||||
// getinitValue()
|
||||
});
|
||||
} else if (value == 11) {
|
||||
getDispensaryList().then((res) => {
|
||||
purposeTypeListOptions.value = res.data
|
||||
if(!route.query.supplyBusNo&&!type){
|
||||
receiptHeaderForm.purposeLocationId = ''
|
||||
receiptHeaderForm.purposeLocationId1 = ''
|
||||
}
|
||||
// getinitValue()
|
||||
// 确保value是数字类型
|
||||
const numValue = Number(value);
|
||||
|
||||
// 清空已选择的盘点仓库
|
||||
if(!route.query.supplyBusNo&&!type){
|
||||
receiptHeaderForm.purposeLocationId = ''
|
||||
receiptHeaderForm.purposeLocationId1 = ''
|
||||
}
|
||||
|
||||
// 根据选择的仓库类型调用不同的API获取对应类型的仓库列表
|
||||
if (numValue === 16 || numValue === 11) {
|
||||
// 使用统一接口获取药房或药库列表
|
||||
getpharmacyCabinetList().then((res) => {
|
||||
// 过滤出符合当前类型的仓库列表
|
||||
const filteredList = res.data.filter(item => item.formEnum === numValue);
|
||||
purposeTypeListOptions.value = filteredList;
|
||||
// 调用getinitValue设置默认仓库和货位
|
||||
getinitValue();
|
||||
}).catch((error) => {
|
||||
console.error('获取仓库列表失败:', error);
|
||||
purposeTypeListOptions.value = [];
|
||||
freightListOptions.value = [];
|
||||
});
|
||||
} else if (numValue === 17) {
|
||||
// 处理耗材库类型
|
||||
// 参考采购订单模块的实现,硬编码设置中心耗材库信息
|
||||
purposeTypeListOptions.value = [
|
||||
{
|
||||
id: "1",
|
||||
name: "中心耗材库",
|
||||
formEnum: 17,
|
||||
children: []
|
||||
}
|
||||
];
|
||||
// 设置默认仓库和货位
|
||||
getinitValue();
|
||||
} else {
|
||||
console.log('未知的仓库类型值:', value);
|
||||
purposeTypeListOptions.value = [];
|
||||
freightListOptions.value = [];
|
||||
}
|
||||
}
|
||||
// 获取默认值
|
||||
|
||||
Reference in New Issue
Block a user