fix: 🧩 修复金蝶仓库和子仓库options无法清空
This commit is contained in:
@@ -29,3 +29,19 @@ export const getProductLinesApi = (params: any) => {
|
||||
export const getWarehousesListApi = () => {
|
||||
return http.get<any>(`basicinfo/warehouses`);
|
||||
};
|
||||
|
||||
//获取金蝶仓库
|
||||
export const getWarehousesKingdeeListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/kingdee`, params);
|
||||
};
|
||||
//获取金蝶子仓库
|
||||
export const getSubwarehouseskingdeeListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/subwarehouses/kingdee`, params);
|
||||
};
|
||||
//获取聚水潭仓库 /admapi/basicinfo/warehouses/jushuitan
|
||||
export const getWarehousesJushuitanListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/jushuitan`, params);
|
||||
};
|
||||
export const getWarehousesLingXingListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/lingxing`, params);
|
||||
};
|
||||
|
||||
@@ -22,18 +22,18 @@ export const getWarehouseDetailsApi = (id: any) => {
|
||||
return http.get<any>(`warehouse/relationship/${id}`);
|
||||
};
|
||||
|
||||
//获取金蝶仓库
|
||||
export const getSetWarehouseKingdeeListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/kingdee`, params);
|
||||
};
|
||||
//获取金蝶子仓库
|
||||
export const getSetWarehouseSubwarehousesListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/subwarehouses/kingdee`, params);
|
||||
};
|
||||
//获取聚水潭仓库 /admapi/basicinfo/warehouses/jushuitan
|
||||
export const getSetWarehouseSubwarehousesJushuitanListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/jushuitan`, params);
|
||||
};
|
||||
export const getSetWarehouseSubwarehousesLingXingListApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/warehouses/lingxing`, params);
|
||||
};
|
||||
// //获取金蝶仓库
|
||||
// export const getSetWarehouseKingdeeListApi = (params: any) => {
|
||||
// return http.get<any>(`basicinfo/warehouses/kingdee`, params);
|
||||
// };
|
||||
// //获取金蝶子仓库
|
||||
// export const getSetWarehouseSubwarehousesListApi = (params: any) => {
|
||||
// return http.get<any>(`basicinfo/subwarehouses/kingdee`, params);
|
||||
// };
|
||||
// //获取聚水潭仓库 /admapi/basicinfo/warehouses/jushuitan
|
||||
// export const getSetWarehouseSubwarehousesJushuitanListApi = (params: any) => {
|
||||
// return http.get<any>(`basicinfo/warehouses/jushuitan`, params);
|
||||
// };
|
||||
// export const getSetWarehouseSubwarehousesLingXingListApi = (params: any) => {
|
||||
// return http.get<any>(`basicinfo/warehouses/lingxing`, params);
|
||||
// };
|
||||
|
||||
@@ -183,8 +183,15 @@
|
||||
</template>
|
||||
<script setup lang="ts" name="SearchForm">
|
||||
import { verificationInput } from "./components/utils/verificationInput";
|
||||
import { getSupplierApi, getCustomersApi, getProductLinesApi } from "@/api/modules/global";
|
||||
import { getSetWarehouseKingdeeListApi, getSetWarehouseSubwarehousesListApi } from "@/api/modules/setWarehouse";
|
||||
import {
|
||||
getSupplierApi,
|
||||
getCustomersApi,
|
||||
getProductLinesApi,
|
||||
getWarehousesKingdeeListApi,
|
||||
getSubwarehouseskingdeeListApi
|
||||
} from "@/api/modules/global";
|
||||
// // getWarehousesKingdeeListApi getSubwarehouseskingdeeListApi getWarehousesJushuitanListApi getWarehousesLingXingListApi
|
||||
// import { getWarehousesKingdeeListApi, getSubwarehouseskingdeeListApi } from "@/api/modules/setWarehouse";
|
||||
const props = defineProps<{
|
||||
formData: any[];
|
||||
searchParams: Record<string, any>;
|
||||
@@ -269,49 +276,49 @@ const getProductLines = async (keywords: any, item: any) => {
|
||||
|
||||
//金蝶仓库
|
||||
const getSetWarehouseKingdeeList = async (keywords: any, item: any) => {
|
||||
item.options = [];
|
||||
let use_org_number = "";
|
||||
if (Array.isArray(_searchParams.value.use_org_number) ** _searchParams.value.use_org_number.length) {
|
||||
item.options = [];
|
||||
let use_org_number = "";
|
||||
use_org_number = _searchParams.value.use_org_number.join(",");
|
||||
}
|
||||
const result = await getSetWarehouseKingdeeListApi({
|
||||
keywords: keywords,
|
||||
use_org_number
|
||||
});
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((it: any) => {
|
||||
options.push({
|
||||
label: it.warehouse_name,
|
||||
value: it.warehouse_number,
|
||||
use_org_number: it.use_org_number
|
||||
});
|
||||
const result = await getWarehousesKingdeeListApi({
|
||||
keywords: keywords,
|
||||
use_org_number
|
||||
});
|
||||
item.options = options;
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((it: any) => {
|
||||
options.push({
|
||||
label: it.warehouse_name,
|
||||
value: it.warehouse_number,
|
||||
use_org_number: it.use_org_number
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
}
|
||||
}
|
||||
};
|
||||
//获取金蝶子仓库
|
||||
const getSetWarehouseSubwarehousesList = async (keywords: any, item: any) => {
|
||||
//先清空一下
|
||||
item.options = [];
|
||||
let kd_warehouse_number = "";
|
||||
if (Array.isArray(_searchParams.value.kd_warehouse_number) ** _searchParams.value.kd_warehouse_number.length) {
|
||||
if (Array.isArray(_searchParams?.value?.kd_warehouse_number) ** _searchParams?.value?.kd_warehouse_number?.length) {
|
||||
//先清空一下
|
||||
item.options = [];
|
||||
let kd_warehouse_number = "";
|
||||
kd_warehouse_number = _searchParams.value.kd_warehouse_number.join(",");
|
||||
}
|
||||
const result = await getSetWarehouseSubwarehousesListApi({
|
||||
keywords,
|
||||
warehouse_number: kd_warehouse_number
|
||||
});
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((it: any) => {
|
||||
options.push({
|
||||
label: it.sub_warehouse_name,
|
||||
value: it.sub_warehouse_number,
|
||||
warehouse_number: it.warehouse_number
|
||||
});
|
||||
const result = await getSubwarehouseskingdeeListApi({
|
||||
keywords,
|
||||
warehouse_number: kd_warehouse_number
|
||||
});
|
||||
item.options = options;
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((it: any) => {
|
||||
options.push({
|
||||
label: it.sub_warehouse_name,
|
||||
value: it.sub_warehouse_number,
|
||||
warehouse_number: it.warehouse_number
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -41,7 +41,13 @@ const breadcrumbList = computed(() => {
|
||||
item.meta.title = route.query.title;
|
||||
}
|
||||
});
|
||||
console.log("");
|
||||
}
|
||||
if (route.query.title === "新增仓位找货优先级" || "编辑仓位找货优先级") {
|
||||
breadcrumbData.forEach((item: any) => {
|
||||
if (item.name === "foundationSetGoodsAdd") {
|
||||
item.meta.title = route.query.title;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return breadcrumbData;
|
||||
|
||||
@@ -34,7 +34,7 @@ import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
||||
// import { useMsg } from "@/hooks/useMsg";
|
||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||
|
||||
// import { getWarehousesListApi } from "@/api/modules/global";
|
||||
// 表格TS
|
||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
|
||||
@@ -62,7 +62,7 @@ const selectionChange = (selection: any) => {
|
||||
// 顶部按钮点击事件
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
console.log(item);
|
||||
$router.push({ path: "/foundation/set/goods/add" });
|
||||
$router.push({ path: "/foundation/set/goods/add", query: { title: "编辑仓位找货优先级" } });
|
||||
};
|
||||
|
||||
// 搜索
|
||||
|
||||
@@ -66,7 +66,6 @@ const selectionChange = (selection: any) => {
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
|
||||
btnClick[type]({
|
||||
selectionList: dataStore.selectionList,
|
||||
proTableRef,
|
||||
|
||||
@@ -61,12 +61,15 @@ import {
|
||||
getWarehouseDelApi,
|
||||
getWarehouseAddApi,
|
||||
getWarehouseUpApi,
|
||||
getWarehouseDetailsApi,
|
||||
getSetWarehouseKingdeeListApi,
|
||||
getSetWarehouseSubwarehousesListApi,
|
||||
getSetWarehouseSubwarehousesLingXingListApi,
|
||||
getSetWarehouseSubwarehousesJushuitanListApi
|
||||
getWarehouseDetailsApi
|
||||
} from "@/api/modules/setWarehouse";
|
||||
|
||||
import {
|
||||
getWarehousesKingdeeListApi,
|
||||
getSubwarehouseskingdeeListApi,
|
||||
getWarehousesJushuitanListApi,
|
||||
getWarehousesLingXingListApi
|
||||
} from "@/api/modules/global";
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||
import { DETAILS_RULE_FORM, DETAILS_FORM_DATA } from "./constant/list/details";
|
||||
@@ -176,7 +179,7 @@ const getWarehouseDetails = async (id: any) => {
|
||||
//获取金蝶仓库
|
||||
const getSetWarehouseKingdeeList = async () => {
|
||||
dataStore.detailsFormData[1].options = [];
|
||||
const result = await getSetWarehouseKingdeeListApi({ use_org_number: dataStore.detailsRuleForm.use_org_number });
|
||||
const result = await getWarehousesKingdeeListApi({ use_org_number: dataStore.detailsRuleForm.use_org_number });
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((item: any) => {
|
||||
@@ -192,7 +195,7 @@ const getSetWarehouseKingdeeList = async () => {
|
||||
const getSetWarehouseSubwarehousesList = async () => {
|
||||
//先清空一下
|
||||
dataStore.detailsFormData[2].options = [];
|
||||
const result = await getSetWarehouseSubwarehousesListApi({
|
||||
const result = await getSubwarehouseskingdeeListApi({
|
||||
warehouse_number: dataStore.detailsRuleForm.kd_warehouse_number
|
||||
});
|
||||
if (result?.code === 0) {
|
||||
@@ -209,7 +212,7 @@ const getSetWarehouseSubwarehousesList = async () => {
|
||||
|
||||
//获取领星仓库
|
||||
const getSetWarehouseSubwarehousesLingXingList = async () => {
|
||||
const result = await getSetWarehouseSubwarehousesLingXingListApi();
|
||||
const result = await getWarehousesLingXingListApi();
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((item: any) => {
|
||||
@@ -223,7 +226,7 @@ const getSetWarehouseSubwarehousesLingXingList = async () => {
|
||||
};
|
||||
//获取聚水潭仓库
|
||||
const getSetWarehouseSubwarehousesJushuitanList = async () => {
|
||||
const result = await getSetWarehouseSubwarehousesJushuitanListApi();
|
||||
const result = await getWarehousesJushuitanListApi();
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((item: any) => {
|
||||
@@ -305,6 +308,8 @@ const handleSelectMultipleDClear = (params: any) => {
|
||||
item: { prop }
|
||||
} = params;
|
||||
dataStore.detailsRuleForm[prop] = "";
|
||||
// if(dataStore.)
|
||||
// console.log("1232322222222");
|
||||
};
|
||||
/**
|
||||
* 监听查询条件标签关闭(统一处理组织、仓库、子仓库联动,修复split类型错误)
|
||||
@@ -406,6 +411,7 @@ watch(
|
||||
watch(
|
||||
() => dataStore.detailsRuleForm.use_org_number,
|
||||
(newVal: any) => {
|
||||
console.log(newVal, "==============value=============");
|
||||
if (newVal) {
|
||||
dataStore.detailsRuleForm.kd_warehouse_number = "";
|
||||
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
|
||||
@@ -413,6 +419,8 @@ watch(
|
||||
} else {
|
||||
dataStore.detailsRuleForm.kd_warehouse_number = "";
|
||||
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
|
||||
dataStore.detailsFormData[1].options = [];
|
||||
dataStore.detailsFormData[2].options = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -425,6 +433,7 @@ watch(
|
||||
getSetWarehouseSubwarehousesList();
|
||||
} else {
|
||||
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
|
||||
dataStore.detailsFormData[2].options = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user