lxf 1 рік тому
батько
коміт
33779cb50b

+ 9 - 0
src/components/byTable/index.vue

@@ -3,6 +3,15 @@
     <template v-for="item in searchConfig">
       <el-form-item v-if="item.type" :label="item.label + ':'" :prop="item.prop">
         <el-input v-if="item.type === 'input'" v-model="pagination[item.prop]" :placeholder="'请输入' + item.label" @keyup.enter.native="searchFn" clearable />
+        <el-input
+          v-if="item.type === 'textarea'"
+          type="textarea"
+          v-model="pagination[item.prop]"
+          :rows="4"
+          :placeholder="'请输入' + item.label"
+          @keyup.enter.native="searchFn"
+          style="width: 90vw"
+          clearable />
         <el-select
           v-else-if="item.type === 'select'"
           v-model="pagination[item.prop]"

+ 165 - 0
src/views/group/maintenance/order-comparison/index.vue

@@ -0,0 +1,165 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <byTable
+        :hideTable="true"
+        :hidePagination="true"
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :searchConfig="searchConfig"
+        highlight-current-row
+        @get-list="getList"
+        @clickReset="clickReset">
+      </byTable>
+      <div style="margin-left: 15px">系统缺少订单数组:</div>
+      <Editor :value="tableList.systemMissingOrderList" ref="systemMissingOrderList" />
+      <div style="margin-left: 15px; margin-top: 20px">系统多余订单数组:</div>
+      <Editor :value="tableList.systemSurplusOrderList" ref="systemSurplusOrderList" />
+    </el-card>
+  </div>
+</template>
+
+<script setup>
+import byTable from "/src/components/byTable/index";
+import { ElMessage } from "element-plus";
+import Editor from "/src/components/Editor/index.vue";
+
+const { proxy } = getCurrentInstance();
+const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    departmentId: "",
+    code: "",
+    wlnCode: "",
+    status: "",
+    settlementStatus: "",
+    exception: "0",
+    compareStr: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "订单号",
+    },
+    {
+      type: "input",
+      prop: "wlnCode",
+      label: "万里牛单号",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "select",
+      prop: "status",
+      dictKey: "order_status",
+      label: "订单状态",
+    },
+    {
+      type: "select",
+      prop: "settlementStatus",
+      label: "结算状态",
+      data: proxy.useUserStore().allDict["settlement_status"],
+    },
+    {
+      type: "textarea",
+      prop: "compareStr",
+      label: "对比字符串",
+    },
+  ];
+});
+const config = computed(() => {
+  return [];
+});
+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 tableList = ref({
+  systemMissingOrderList: "",
+  systemSurplusOrderList: "",
+});
+const getList = async (req, status) => {
+  if (status) {
+    sourceList.value.pagination = {
+      pageNum: sourceList.value.pagination.pageNum,
+      pageSize: sourceList.value.pagination.pageSize,
+      exception: "0",
+    };
+  } else {
+    sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  }
+  if (sourceList.value.pagination.compareStr) {
+    loading.value = true;
+    proxy.post("/orderInfo/compare", sourceList.value.pagination).then((res) => {
+      if (res.systemMissingOrderList && res.systemMissingOrderList.length > 0) {
+        tableList.value.systemMissingOrderList = Object.freeze(res.systemMissingOrderList.join(","));
+      } else {
+        tableList.value.systemMissingOrderList = "";
+      }
+      console.log(tableList.value.systemMissingOrderList);
+      proxy.$refs.systemMissingOrderList.changeHtml(tableList.value.systemMissingOrderList);
+      if (res.systemSurplusOrderList && res.systemSurplusOrderList.length > 0) {
+        tableList.value.systemSurplusOrderList = Object.freeze(res.systemSurplusOrderList.join(","));
+      } else {
+        tableList.value.systemSurplusOrderList = "";
+      }
+      proxy.$refs.systemSurplusOrderList.changeHtml(tableList.value.systemSurplusOrderList);
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+  } else {
+    return ElMessage("请输入对比字符串");
+  }
+};
+getList();
+const clickReset = () => {
+  tableList.value = {
+    systemMissingOrderList: "",
+    systemSurplusOrderList: "",
+  };
+  proxy.$refs.systemMissingOrderList.changeHtml("");
+  proxy.$refs.systemSurplusOrderList.changeHtml("");
+  getList("", true);
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+:deep(.el-dialog) {
+  margin-top: 10px !important;
+  margin-bottom: 10px !important;
+}
+.select-card {
+  height: calc(100vh - 184px);
+  overflow-y: auto;
+  overflow-x: hidden;
+}
+</style>