Browse Source

库存查询

lxf 2 years ago
parent
commit
7186916b56

+ 170 - 0
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -0,0 +1,170 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :selectConfig="selectConfig"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '新增调仓',
+            action: () => openModal(),
+          },
+        ]"
+        @get-list="getList">
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+
+const { proxy } = getCurrentInstance();
+const warehouseList = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    id: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "仓库名称",
+      prop: "id",
+      data: warehouseList.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseId",
+        width: 220,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, warehouseList.value);
+      },
+    },
+    {
+      attrs: {
+        label: "物品类型",
+        prop: "productCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "所属分类",
+        prop: "productCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "物品名称",
+        slot: "productName",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "productModel",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "unit",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "库存数量",
+        prop: "quantity",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看流水",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              checkTheFlow(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      warehouseList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/stock/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const checkTheFlow = (item) => {
+  proxy.$router.replace({
+    path: "/purchaseSales/outAndInWarehouse/record",
+    query: {
+      warehouseId: item.warehouseId,
+      productId: item.productId,
+    },
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 1 - 0
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -74,6 +74,7 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
+    warehouseId: "",
     type: "2",
   },
 });

+ 1 - 0
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -74,6 +74,7 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
+    warehouseId: "",
     type: "1",
   },
 });

+ 2 - 0
src/views/purchaseSales/outAndInWarehouse/warehouseAdjustment/index.vue

@@ -74,6 +74,8 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
+    warehouseId: "",
+    toWarehouseId: "",
     type: "3",
   },
 });