Explorar o código

Merge branch '出入库流水' into 测试

lxf hai 1 ano
pai
achega
4431cb4950
Modificáronse 1 ficheiros con 252 adicións e 0 borrados
  1. 252 0
      src/views/production/warehouse/flow-record/index.vue

+ 252 - 0
src/views/production/warehouse/flow-record/index.vue

@@ -0,0 +1,252 @@
+<template>
+  <el-card class="box-card">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      :searchConfig="searchConfig"
+      highlight-current-row
+      :action-list="[
+        {
+          text: '导出Excel',
+          action: () => deriveExcel(),
+        },
+      ]"
+      @get-list="getList"
+      @clickReset="clickReset">
+    </byTable>
+  </el-card>
+</template>
+
+<script setup>
+import byTable from "/src/components/byTable/index";
+
+const { proxy } = getCurrentInstance();
+const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    code: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+    departmentId: "",
+    warehouseName: "",
+    detailType: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "单号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecCode",
+      label: "品号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecName",
+      label: "品名",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "input",
+      prop: "warehouseName",
+      label: "仓库名称",
+    },
+    {
+      type: "select",
+      prop: "type",
+      data: [
+        {
+          dictKey: 1,
+          dictValue: "入库",
+        },
+        {
+          dictKey: 0,
+          dictValue: "出库",
+        },
+      ],
+      label: "出入库",
+    },
+    sourceList.value.pagination.type === 1
+      ? {
+          type: "select",
+          prop: "detailType",
+          dictKey: "put_stock_type",
+          label: "入库类型",
+        }
+      : {},
+    sourceList.value.pagination.type === 0
+      ? {
+          type: "select",
+          prop: "detailType",
+          dictKey: "come_stock_type",
+          label: "出库类型",
+        }
+      : {},
+    {
+      type: "date",
+      propList: ["beginTime", "endTime"],
+      label: "日期",
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "出入库单号",
+        prop: "code",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "采购单号",
+        prop: "purchaseCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "归属事业部",
+        prop: "departmentName",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "仓库类型",
+        prop: "warehouseType",
+        width: 140,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["warehouse_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "出入库类型",
+        prop: "detailType",
+        width: 140,
+      },
+      render(val, row) {
+        if (row.type === 1) {
+          return proxy.dictKeyValue(val, proxy.useUserStore().allDict["put_stock_type"]);
+        } else {
+          return proxy.dictKeyValue(val, proxy.useUserStore().allDict["come_stock_type"]);
+        }
+      },
+    },
+    {
+      attrs: {
+        label: "品号",
+        prop: "bomSpecCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "品品名",
+        prop: "bomSpecName",
+        "min-width": 240,
+      },
+    },
+    {
+      attrs: {
+        label: "数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "出入库时间",
+        prop: "createTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "出入库申请人",
+        prop: "applicant",
+        width: 160,
+        align: "center",
+      },
+    },
+  ];
+});
+const getList = async (req, status) => {
+  if (status) {
+    sourceList.value.pagination = {
+      pageNum: sourceList.value.pagination.pageNum,
+      pageSize: sourceList.value.pagination.pageSize,
+    };
+  } else {
+    sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  }
+  loading.value = true;
+  proxy.post("/inOutStorageBom/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const clickReset = () => {
+  getList("", true);
+};
+const getDemandData = () => {
+  proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      departmentList.value = departmentList.value.concat(
+        res.rows.map((item) => {
+          return {
+            dictKey: item.id,
+            dictValue: item.name,
+          };
+        })
+      );
+    }
+  });
+};
+getDemandData();
+const deriveExcel = () => {
+  proxy.postFile("/inOutStorageBom/exportExcelSummary", sourceList.value.pagination).then((res) => {
+    proxy.downloadFile(res, "出入库流水.xlsx");
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>