lqh 1 жил өмнө
parent
commit
1b03e447a6
1 өөрчлөгдсөн 219 нэмэгдсэн , 0 устгасан
  1. 219 0
      src/views/xiaoman/index.vue

+ 219 - 0
src/views/xiaoman/index.vue

@@ -0,0 +1,219 @@
+<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: () => initAllList(),
+          },
+             {
+            text: '更新近8小时内数据',
+            action: () => updateList(),
+          },
+        ]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import moment from "moment";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const accountList = ref([]);
+const corporationList = ref([]);
+const tradeMethods = ref([]);
+const accountCurrency = ref([]);
+const shippingMethod = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    status: "",
+    sellCorporationId: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "公司客户ID",
+        prop: "company_id",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "小满用户ID",
+        prop: "user_id",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "公司名称",
+        prop: "name",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "公司简称",
+        prop: "short_name",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "客户编号id",
+        prop: "serial_id",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "最近更新时间",
+        prop: "order_time",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "建档时间",
+        prop: "create_time",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "更新时间",
+        prop: "update_time",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "匹配客户列表信息",
+        prop: "customer_id",
+        width: 120,
+      },
+    },
+
+  ];
+});
+
+const getDict = () => {
+  proxy
+    .getDictOne([
+      "trade_mode",
+      "account_currency",
+      "shipping_method",
+      "customer_tag",
+    ])
+    .then((res) => {
+      tradeMethods.value = res["trade_mode"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      accountCurrency.value = res["account_currency"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      shippingMethod.value = res["shipping_method"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      customerTag.value = res["customer_tag"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/xiaomanCustomer/page", sourceList.value.pagination).then((res) => {
+    res.rows.forEach((x) => {
+      x.addTagShow = false;
+      if (x.tag) {
+        x.tags = x.tag.split(",");
+      } else {
+        x.tags = [];
+      }
+    });
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+
+const getLabel = (key, list, label) => {
+  let text = "";
+  if (list && list.length > 0) {
+    let data = list.filter((item) => item.id === key);
+    if (data && data.length > 0) {
+      text = data[0][label];
+    }
+  }
+  return text;
+};
+
+const initAllList = () => {
+
+  proxy.post("/xiaomanCustomer/initAllList").then((res) => {
+
+
+  });
+};
+const updateList = () => {
+
+  proxy.post("/xiaomanCustomer/updateList").then((res) => {
+
+
+  });
+};
+
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>