lxf преди 1 година
родител
ревизия
a0ae6ec0d3
променени са 2 файла, в които са добавени 153 реда и са изтрити 0 реда
  1. 0 0
      src/views/group/data-board/material-control-purchasing/index.vue
  2. 153 0
      src/views/group/data-board/material-in-transit/index.vue

+ 0 - 0
src/views/group/purchase/material-in-transit/index.vue → src/views/group/data-board/material-control-purchasing/index.vue


+ 153 - 0
src/views/group/data-board/material-in-transit/index.vue

@@ -0,0 +1,153 @@
+<template>
+  <div>
+    <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"
+        :cellClassName="cellClassName">
+      </byTable>
+    </el-card>
+  </div>
+</template>
+
+<script setup>
+import byTable from "/src/components/byTable/index";
+import moment from "moment";
+
+const { proxy } = getCurrentInstance();
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    purchaseCode: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购单号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecCode",
+      label: "品号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecName",
+      label: "品名",
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "品号",
+        prop: "bomSpecCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "品名",
+        prop: "bomSpecName",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "采购单号",
+        prop: "purchaseCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "供应商",
+        prop: "supplierName",
+        width: 220,
+      },
+    },
+    {
+      attrs: {
+        label: "采购数量",
+        prop: "purchaseQuantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "在途数量",
+        prop: "inTransitQuantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "交期",
+        prop: "deliveryDate",
+        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("/purchaseInTransitBom/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 deriveExcel = () => {
+  proxy.postFile("/purchaseInTransitBom/export", sourceList.value.pagination).then((res) => {
+    proxy.downloadFile(res, "在途物料.xlsx");
+  });
+};
+const cellClassName = (val) => {
+  if (val.row.deliveryDate < moment().format("yyyy-MM-DD HH:mm:ss")) {
+    return "colorDim";
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.colorDim) {
+  color: red;
+}
+</style>