Quellcode durchsuchen

库存查询 物品类型字段

lxf vor 2 Jahren
Ursprung
Commit
fb26f9088a
1 geänderte Dateien mit 19 neuen und 18 gelöschten Zeilen
  1. 19 18
      src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

+ 19 - 18
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -31,6 +31,7 @@
 <script setup>
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
+import useUserStore from "@/store/modules/user";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -48,24 +49,7 @@ const sourceList = ref({
     id: "",
   },
 });
-const productType = ref([
-  {
-    label: "产品",
-    value: "1",
-  },
-  {
-    label: "物料",
-    value: "2",
-  },
-  {
-    label: "产品",
-    value: "10",
-  },
-  {
-    label: "物料",
-    value: "20",
-  },
-]);
+const productType = ref([]);
 const loading = ref(false);
 const selectConfig = computed(() => {
   if (props.warehouseId) {
@@ -165,6 +149,23 @@ const getDict = () => {
       });
     }
   });
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "product_type",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        productType.value = res.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };