瀏覽代碼

Merge branch '销售退货表'

lxf 1 年之前
父節點
當前提交
f2613acbc3
共有 1 個文件被更改,包括 198 次插入0 次删除
  1. 198 0
      src/views/group/finance/sales-return/index.vue

+ 198 - 0
src/views/group/finance/sales-return/index.vue

@@ -0,0 +1,198 @@
+<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"
+      @changeRadioGroup="changeRadioGroup">
+    </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: "",
+    departmentId: "",
+    skuSpecCode: "",
+    skuSpecName: "",
+    orderCode: "",
+    orderWlnCode: "",
+    code: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "type",
+      data: [
+        {
+          dictKey: "1",
+          dictValue: "退货",
+        },
+        {
+          dictKey: "2",
+          dictValue: "换货",
+        },
+      ],
+      label: "类型",
+    },
+    {
+      type: "input",
+      prop: "skuSpecCode",
+      label: "SKU品号",
+    },
+    {
+      type: "input",
+      prop: "skuSpecName",
+      label: "SKU品名",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "input",
+      prop: "orderCode",
+      label: "订单号",
+    },
+    {
+      type: "input",
+      prop: "orderWlnCode",
+      label: "万里牛单号",
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "退换货单号",
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "退换货单号",
+        prop: "code",
+        width: 146,
+      },
+    },
+    {
+      attrs: {
+        label: "订单号",
+        prop: "orderCode",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "万里牛单号",
+        prop: "orderWlnCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "事业部",
+        prop: "departmentName",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "SKU品号",
+        prop: "skuSpecCode",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "SKU品名",
+        prop: "skuSpecName",
+        "min-width": 240,
+      },
+    },
+    {
+      attrs: {
+        label: "退换货数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "退换货时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+  ];
+});
+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 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("/orderExchangeDetail/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.getFile("/orderExchangeDetail/excelExport", sourceList.value.pagination).then((res) => {
+    proxy.downloadFile(res, "销售退货明细表.xlsx");
+  });
+};
+</script>
+
+<style lang="scss" scoped></style>