lxf 1 year ago
parent
commit
d18fe4bf7d
1 changed files with 233 additions and 0 deletions
  1. 233 0
      src/views/production/shipment/print-order/index.vue

+ 233 - 0
src/views/production/shipment/print-order/index.vue

@@ -0,0 +1,233 @@
+<template>
+  <el-card class="box-card">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      :searchConfig="searchConfig"
+      highlight-current-row
+      :defaultExpandAll="true"
+      :table-events="{
+        select: selectRow,
+        'select-all': selectRow,
+      }"
+      :action-list="[
+        {
+          text: '拆分包裹',
+          action: () => clickUnpack(),
+        },
+        {
+          text: '合并订单',
+          action: () => clickMerge(),
+        },
+        {
+          text: '取消合并',
+          action: () => clickUnMerge(),
+        },
+        {
+          text: '修改收件信息',
+          action: () => clickModifyInformation(),
+        },
+        {
+          text: '修改快递',
+          action: () => clickModifiedExpress(),
+        },
+        {
+          text: '打印快递单',
+          action: () => clickPrint(),
+          type: 'warning',
+        },
+        {
+          text: '填写线下快递单号',
+          action: () => clickFillInExpressCode(),
+        },
+      ]"
+      @get-list="getList"
+      @clickReset="clickReset">
+      <template #typeExpand="{ item }">
+        <div v-html="item.remark"></div>
+      </template>
+      <template #code="{ item }">
+        <div>
+          <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
+        </div>
+      </template>
+      <template #groupOrderCodeList="{ item }">
+        <div>
+          <div v-if="item.groupOrderCodeList && item.groupOrderCodeList.length > 0">{{ item.groupOrderCodeList.join(",") }}</div>
+        </div>
+      </template>
+    </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,
+    code: "",
+    departmentId: "",
+    expressDeliveryCode: "",
+    printStatus: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "订单号",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "input",
+      prop: "expressDeliveryCode",
+      label: "快递单号",
+    },
+    {
+      type: "select",
+      prop: "printStatus",
+      data: [
+        {
+          dictKey: "1",
+          dictValue: "是",
+        },
+        {
+          dictKey: "0",
+          dictValue: "否",
+        },
+      ],
+      label: "打印状态",
+    },
+    {
+      type: "date",
+      propList: ["beginTime", "endTime"],
+      label: "交期",
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      type: "expand",
+      attrs: {
+        label: " ",
+        slot: "typeExpand",
+        width: 50,
+      },
+    },
+    {
+      type: "selection",
+      attrs: {
+        checkAtt: "isCheck",
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "日期",
+    //     slot: "backupDateStr",
+    //     width: 220,
+    //     align: "center",
+    //   },
+    // },
+    {
+      attrs: {
+        label: "主订单号",
+        slot: "code",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "合并订单号",
+        slot: "groupOrderCodeList",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "快照时间",
+        prop: "backupDate",
+      },
+    },
+  ];
+});
+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("/issueBill/page", sourceList.value.pagination).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      sourceList.value.data = res.rows.map((item) => {
+        return {
+          ...item,
+          isCheck: true,
+        };
+      });
+    } else {
+      sourceList.value.data = [];
+    }
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const clickReset = () => {
+  getList("", true);
+};
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+const clickCode = (row) => {
+  proxy.$router.replace({
+    path: "/order-detail",
+    query: {
+      detailId: row.id,
+      text: "订单详情",
+      random: proxy.random(),
+    },
+  });
+};
+</script>
+
+<style lang="scss" scoped></style>