feat: 🚀 物料列表刷新
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
|
||||
<script setup lang="ts" name="home">
|
||||
//登录请求接口
|
||||
import { getOrgsApi } from "@/api/modules/global";
|
||||
import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
|
||||
|
||||
//用户信息存储
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
//setOrgIdArr
|
||||
const userStore = useUserStore();
|
||||
//获取组织
|
||||
const getOrgs = async () => {
|
||||
@@ -30,16 +30,24 @@ const getOrgs = async () => {
|
||||
}
|
||||
};
|
||||
getOrgs();
|
||||
|
||||
// //获取供应商
|
||||
// const getSupplier = async () => {
|
||||
// const result = await getSupplierApi();
|
||||
// if (result?.code === 0) {
|
||||
// const { data } = result;
|
||||
// console.log(data, "=============>");
|
||||
// }
|
||||
// };
|
||||
// getSupplier();
|
||||
const getWarehousesList = async () => {
|
||||
const result = await getWarehousesListApi();
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
if (data?.length) {
|
||||
let options: any = [];
|
||||
data.forEach((item: any) => {
|
||||
options.push({
|
||||
id: item.id,
|
||||
value: item.warehouse_number,
|
||||
label: item.warehouse_name
|
||||
});
|
||||
});
|
||||
userStore.setWarehouse(options);
|
||||
}
|
||||
}
|
||||
};
|
||||
getWarehousesList();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user