Browse Source

新需求

潘超林 6 days ago
parent
commit
ff2b167b24

+ 59 - 38
src/api/manage/order.js

@@ -2,71 +2,92 @@ import request from '@/utils/request'
 
 // 销量管理分页接口
 export function queryUserOrderByShopId(query) {
-    return request({
-        url: '/system/order/queryUserOrderByShopIdNew',
-        method: 'get',
-        params: query
-    })
+  return request({
+    url: '/system/order/queryUserOrderByShopIdNew',
+    method: 'get',
+    params: query
+  })
 }
 
 // 销量管理顶部统计接口
 export function statisticsOrderNum(query) {
-    return request({
-        url: '/system/order/statisticsOrderNum',
-        method: 'get',
-        params: query
-    })
+  return request({
+    url: '/system/order/statisticsOrderNum',
+    method: 'get',
+    params: query
+  })
 }
 
 // 销量管理顶部统计接口
 export function userOrderInfo(query) {
-    return request({
-        url: '/system/order/userOrderInfo/' + query,
-        method: 'get',
-    })
+  return request({
+    url: '/system/order/userOrderInfo/' + query,
+    method: 'get',
+  })
 }
 
 
 
 // 销量管理顶部统计接口
 export function statisticsAfterSaleOrder(query) {
-    return request({
-        url: '/system/afterSale/statisticsAfterSaleOrder',
-        method: 'get',
-        params: query
-    })
+  return request({
+    url: '/system/afterSale/statisticsAfterSaleOrder',
+    method: 'get',
+    params: query
+  })
 }
 
 
 
 export function queryAfterSalePage(query) {
-    return request({
-        url: '/system/afterSale/queryAfterSalePage',
-        method: 'get',
-        params: query
-    })
+  return request({
+    url: '/system/afterSale/queryAfterSalePage',
+    method: 'get',
+    params: query
+  })
 }
 
 
 export function afterSaleOrderInfo(query) {
-    return request({
-        url: '/system/afterSale/afterSaleOrderInfo/' + query,
-        method: 'get',
-    })
+  return request({
+    url: '/system/afterSale/afterSaleOrderInfo/' + query,
+    method: 'get',
+  })
 }
 
 export function auditFirstUserOrder(data) {
-    return request({
-        url: '/system/order/auditFirstUserOrder',
-        method: 'post',
-        data: data
-    })
+  return request({
+    url: '/system/order/auditFirstUserOrder',
+    method: 'post',
+    data: data
+  })
 }
 
 export function confirmUserOfflinePayment(data) {
-    return request({
-        url: '/system/order/confirmUserOfflinePayment',
-        method: 'post',
-        data: data
-    })
+  return request({
+    url: '/system/order/confirmUserOfflinePayment',
+    method: 'post',
+    data: data
+  })
+}
+
+/**
+ * 秒送
+ * @param {*} data
+ * @returns
+ */
+export function merchantSecondOrderList(data) {
+  return request({
+    url: '/system/order/merchantSecondOrderList',
+    method: 'get',
+    params: data
+  })
+}
+
+
+export function sendSecondOrderInfo(data) {
+  return request({
+    url: '/system/order/sendSecondOrderInfo/' + data,
+    method: 'get',
+  })
 }

+ 87 - 0
src/components/DictText/index.vue

@@ -0,0 +1,87 @@
+<template>
+  <div>
+    <template v-for="(item, index) in options">
+      <template v-if="values.includes(item.value)">
+        <span :key="item.value" :index="index" :class="item.raw.cssClass">{{
+          item.label + " "
+        }}</span>
+      </template>
+    </template>
+    <template v-if="unmatch && showValue">
+      {{ unmatchArray | handleArray }}
+    </template>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "DictText",
+  props: {
+    options: {
+      type: Array,
+      default: null,
+    },
+    value: [Number, String, Array],
+    // 当未找到匹配的数据时,显示value
+    showValue: {
+      type: Boolean,
+      default: true,
+    },
+    separator: {
+      type: String,
+      default: ",",
+    },
+  },
+  data() {
+    return {
+      unmatchArray: [], // 记录未匹配的项
+    };
+  },
+  computed: {
+    values() {
+      if (
+        this.value === null ||
+        typeof this.value === "undefined" ||
+        this.value === ""
+      )
+        return [];
+      return Array.isArray(this.value)
+        ? this.value.map((item) => "" + item)
+        : String(this.value).split(this.separator);
+    },
+    unmatch() {
+      this.unmatchArray = [];
+      // 没有value不显示
+      if (
+        this.value === null ||
+        typeof this.value === "undefined" ||
+        this.value === "" ||
+        this.options.length === 0
+      )
+        return false;
+      // 传入值为数组
+      let unmatch = false; // 添加一个标志来判断是否有未匹配项
+      this.values.forEach((item) => {
+        if (!this.options.some((v) => v.value === item)) {
+          this.unmatchArray.push(item);
+          unmatch = true; // 如果有未匹配项,将标志设置为true
+        }
+      });
+      return unmatch; // 返回标志的值
+    },
+  },
+  filters: {
+    handleArray(array) {
+      if (array.length === 0) return "";
+      return array.reduce((pre, cur) => {
+        return pre + " " + cur;
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+</style>

+ 84 - 82
src/utils/derive.js

@@ -2,94 +2,96 @@ import ExcelJS from 'exceljs';
 import moment from 'moment'
 
 function getDateStr(AddDayCount) {
-    var dd = new Date();
-    dd.setDate(dd.getDate() + AddDayCount);//获取AddDayCount天后的日期
-    var y = dd.getFullYear();
-    var m = dd.getMonth() + 1;//获取当前月份的日期
-    var d = dd.getDate();
-    return y + '-' + (m < 10 ? '0' + m : m) + '-' + d;
+  var dd = new Date();
+  dd.setDate(dd.getDate() + AddDayCount);//获取AddDayCount天后的日期
+  var y = dd.getFullYear();
+  var m = dd.getMonth() + 1;//获取当前月份的日期
+  var d = dd.getDate();
+  return y + '-' + (m < 10 ? '0' + m : m) + '-' + d;
 }
 
 function exportExcel(columns, datas, downloadName) {
-    let datalist = JSON.parse(JSON.stringify(datas));
-    let tableData = dataImpl(datalist)
-    const workbook = new ExcelJS.Workbook();
-    const worksheet = workbook.addWorksheet('Sheet 1'); // 创建一个工作表
-    // 设置列标题
-    worksheet.columns = columns
-    // 准备数据并添加到工作表中
-    const data = tableData
-    worksheet.addRows(data); // 添加数据行
-    // 创建一个 Blob 并下载文件
-
-    workbook.xlsx.writeBuffer().then((buffer) => {
-        const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
-        const link = document.createElement('a');
-        link.href = URL.createObjectURL(blob);
-        link.download = downloadName + moment().format('YYYY-MM-DD HH:mm:ss') || 'example.xlsx';
-        link.click(); // 模拟点击下载文件
-    });
+  let datalist = JSON.parse(JSON.stringify(datas));
+  let tableData = dataImpl(datalist)
+  const workbook = new ExcelJS.Workbook();
+  const worksheet = workbook.addWorksheet('Sheet 1'); // 创建一个工作表
+  // 设置列标题
+  worksheet.columns = columns
+  // 准备数据并添加到工作表中
+  const data = tableData
+  worksheet.addRows(data); // 添加数据行
+  // 创建一个 Blob 并下载文件
+  workbook.xlsx.writeBuffer().then((buffer) => {
+    const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
+    const link = document.createElement('a');
+    link.href = URL.createObjectURL(blob);
+    link.download = downloadName + moment().format('YYYY-MM-DD HH:mm:ss') || 'example.xlsx';
+    link.click(); // 模拟点击下载文件
+  });
 }
 function dataImpl(data) {
-    data.forEach(e => {
-        if (e.goodsAmount) {
-            e.goodsAmount = e.goodsAmount.toFixed(2)
-        }
-
-        if (e.specsValue?.length < 1) {
-            e.specsValue = ""
-        }
-        if (e.orderStatus == '0') {
-            e.orderStatus = '待商家确认修改运费';
-        } else if (e.orderStatus == '10') {
-            e.orderStatus = '等待买家支付';
-        } else if (e.orderStatus == '20') {
-            e.orderStatus = '等待商家发布货运信息';
-        } else if (e.orderStatus == '90') {
-            e.orderStatus = '等待司机接单';
-        } else if (e.orderStatus == '100') {
-            e.orderStatus = '等待司机支付保证金';
-        } else if (e.orderStatus == '110') {
-            e.orderStatus = '等待司机装货';
-        } else if (e.orderStatus == '120') {
-            e.orderStatus = '已装货,运输中';
-        } else if (e.orderStatus == '30') {
-            e.orderStatus = '司机已到达,等待买家签收';
-        } else if (e.orderStatus == '40') {
-            e.orderStatus = '买家已收货';
-        } else if (e.orderStatus == '50') {
-            e.orderStatus = '已取消';
-        } else if (e.orderStatus == '60') {
-            e.orderStatus = '退款中';
-        } else if (e.orderStatus == '70') {
-            e.orderStatus = '退款成功';
-        } else if (e.orderStatus == '80') {
-            e.orderStatus = '退款失败';
-        } else if (e.orderStatus == '130') {
-            e.orderStatus = '待处理售后';
-        } else if (e.orderStatus == '140') {
-            e.orderStatus = '已处理售后';
-        }
-
-        if (e.afterSaleStatus == '0') {
-            e.afterSaleStatus = '未申请';
-        } else if (e.afterSaleStatus == '1') {
-            e.afterSaleStatus = '已申请';
-        } else if (e.afterSaleStatus == '2') {
-            e.afterSaleStatus = '审核失败';
-        } else if (e.afterSaleStatus == '3') {
-            e.afterSaleStatus = '审核成功(退款中)';
-        } else if (e.afterSaleStatus == '4') {
-            e.afterSaleStatus = '退款成功';
-        } else if (e.afterSaleStatus == '5') {
-            e.afterSaleStatus = '退款失败(联系客服解决)';
-        }
-
-
+  data.forEach(e => {
+    if (e.deliveryType) {
+      switch (e.deliveryType) {
+        case 0:
+          e.deliveryType = "到店"
+          break;
+        case 1:
+          e.deliveryType = "上门"
+          break;
+        case '':
+          e.deliveryType = ""
+          break;
+      }
+    }
+    if (e.afterSaleStatus) {
+      switch (e.afterSaleStatus) {
+        case 0:
+          e.afterSaleStatus = "未申请"
+          break;
+        case 1:
+          e.afterSaleStatus = "已申请"
+          break;
+        case 2:
+          e.afterSaleStatus = "审核失败"
+          break;
+        case 3:
+          e.afterSaleStatus = "审核成功(退款中)"
+          break;
+        case 4:
+          e.afterSaleStatus = "退款成功"
+          break;
+        case 4:
+          e.afterSaleStatus = "退款失败(联系客服解决)"
+          break;
+      }
+    }
+    if (e.orderStatusEnum) {
+      switch (e.orderStatusEnum) {
+        case 'WAIT_DRIVER_ORDER':
+          e.orderStatusEnum = "待接单"
+          break;
+        case 'WAIT_PENDING_ORDERS':
+          e.orderStatusEnum = "待出单"
+          break;
+        case 'IN_PROGRESS':
+          e.orderStatusEnum = "进行中"
+          break;
+        case 'TRADE_COMPLETED':
+          e.orderStatusEnum = "交易完成"
+          break;
+        case 'TRADE_CLOSED':
+          e.orderStatusEnum = "交易关闭"
+          break;
+        case '':
+          e.orderStatusEnum = ""
+          break;
+      }
+    }
+  });
 
-    });
-    return data;
+  return data;
 }
 export default {
-    exportExcel
+  exportExcel
 }

+ 11 - 9
src/views/manage/order.vue

@@ -1042,20 +1042,22 @@ export default {
           }
 
           totalList.forEach((e) => {
-            console.log("zxczxc", JSON.parse(e.goodsInfo));
-            let goos = JSON.parse(e.goodsInfo);
-            let detail = "";
-            if (goos) {
-              goos.forEach((a) => {
-                detail += `${a.skuName}(${a.specsValue[0]?.specsName})-数量:${a.quantity}${a.unit};`;
-              });
+            try {
+              let goos = JSON.parse(e.goodsInfo);
+              let detail = "";
+              if (goos && goos.length > 0) {
+                // 检查 goos 是否为空
+                goos.forEach((a) => {
+                  detail += `${a.skuName}(${a.specsValue[0]?.specsName})-数量:${a.quantity}${a.unit};`;
+                });
+              }
               e.goodsDetails = detail;
-              console.log(e);
+            } catch (error) {
+              console.error("解析 goodsInfo 时出错:", error);
             }
           });
 
           this.spuList = totalList;
-
           this.total = response.data.total;
           this.loading = false;
         }

+ 208 - 0
src/views/order/common/orderDialog.vue

@@ -0,0 +1,208 @@
+<template>
+  <div class="dialogs">
+    <!-- 订单打印 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="dialogShow"
+      width="500px"
+      append-to-body
+    >
+      <div v-if="type == 'print'">
+        <el-form
+          ref="form"
+          :model="printForm"
+          :rules="rules"
+          label-width="100px"
+        >
+          <el-form-item label="选择打印机" prop="sn">
+            <el-select v-model="printForm.sn" placeholder="请选择打印机">
+              <el-option
+                v-for="item in printList"
+                :key="item.value"
+                :label="item.name"
+                :value="item.sn"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div v-if="type == 'offline'">
+        <el-form ref="form" :model="offline" :rules="rules" label-width="100px">
+          <el-form-item label="是否同意" prop="auditFirstUse">
+            <el-radio-group v-model="offlineForm.confirmOfflinePayment">
+              <el-radio :label="0" :name="0">用户已支付</el-radio>
+              <el-radio :label="1" :name="1">用户未支付</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div v-if="type == 'prior'">
+        <el-form
+          ref="form"
+          :model="priorForm"
+          :rules="rules"
+          label-width="100px"
+        >
+          <el-form-item label="是否同意" prop="auditFirstUse">
+            <el-radio-group v-model="priorForm.auditFirstUse">
+              <el-radio :label="0" :name="0">同意</el-radio>
+              <el-radio :label="1" :name="1">拒绝</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <div>同意时:确认收货3天内.需确认用户是否完成支付</div>
+          <div>拒绝时:将自动取消该订单.用户支付服务费将原路退回</div>
+        </el-form>
+      </div>
+      <div v-if="type == 'taking'">
+        <el-form
+          ref="form"
+          :model="priorForm"
+          :rules="rules"
+          label-width="100px"
+        >
+          <el-form-item label="配送方式" prop="auditFirstUse">
+            <el-radio-group v-model="priorForm.auditFirstUse">
+              <el-radio :label="0" :name="0">找骑手</el-radio>
+              <el-radio :label="1" :name="1">自行配送</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogSubmit">确 定</el-button>
+        <el-button @click="dialogShow = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  auditFirstUserOrder,
+  confirmUserOfflinePayment,
+} from "@/api/manage/order";
+import { printOrder, equipmentList } from "@/api/manage/equipment";
+export default {
+  props: {},
+  data() {
+    return {
+      rules: {
+        sn: [{ required: true, message: "请选择打印机", trigger: "blur" }],
+        auditFirstUse: [{ required: true, message: "请选择", trigger: "blur" }],
+      },
+      title: "",
+      printList: [],
+      printForm: {
+        sn: "",
+      },
+      offlineForm: {
+        confirmOfflinePayment: "",
+      },
+      priorForm: {
+        auditFirstUse: "",
+      },
+      dialogShow: false,
+      type: "",
+      tableInfo: null,
+    };
+  },
+  mounted() {
+    this.getEquipmentList();
+  },
+  methods: {
+    getEquipmentList() {
+      equipmentList().then((res) => {
+        if (res.code == 200) {
+          this.printList = res.data.records;
+        }
+      });
+    },
+    openDialog(type, list) {
+      this.type = type;
+      if (type == "print") {
+        this.title = "打印订单";
+        this.dialogShow = true;
+        this.tableInfo = list;
+      } else if (type == "prior") {
+        this.title = "确认是否同意所选用户使用先用后付";
+        this.tableInfo = list;
+        this.dialogShow = true;
+      } else if (type == "offline") {
+        this.title = "确认所选用户是否已进行线下协商支付";
+        this.tableInfo = list;
+        this.dialogShow = true;
+      } else if (type == "taking") {
+        this.title = "选择配送方式";
+        this.tableInfo = list;
+        this.dialogShow = true;
+      }
+    },
+
+    dialogSubmit() {
+      if (this.type == "print") {
+        this.printSubmit();
+      } else if (this.type == "prior") {
+        this.priorSubmit();
+      } else if (this.type == "offline") {
+        this.offlineSubmit();
+      } else if (this.type == "taking") {
+        this.takingSubmit();
+      }
+    },
+    takingSubmit() {
+      //接单
+    },
+    offlineSubmit() {
+      confirmUserOfflinePayment({
+        id: this.tableInfo.id,
+        confirmOfflinePayment: this.offlineForm.confirmOfflinePayment,
+      }).then((res) => {
+        if (res.code == 200) {
+          this.dialogShow = false;
+          this.$modal.msgSuccess("操作成功!");
+          this.$emit("orderDialogReturn", "offline");
+        } else {
+          this.dialogShow = false;
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+    priorSubmit() {
+      auditFirstUserOrder({
+        id: this.tableInfo.id,
+        auditFirstUse: this.priorForm.auditFirstUse,
+      }).then((res) => {
+        if (res.code == 200) {
+          this.dialogShow = false;
+          this.$modal.msgSuccess("操作成功!");
+          this.$emit("orderDialogReturn", "prior");
+        } else {
+          this.dialogShow = false;
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+    printSubmit() {
+      if (!this.printForm.sn) {
+        this.$message.error("请选择打印机!");
+        return;
+      }
+      this.printForm.carPayNos = this.tableInfo.toString();
+      printOrder(this.printForm).then((res) => {
+        if (res.code == 200) {
+          this.dialogShow = false;
+          this.tableInfo = [];
+          this.$modal.msgSuccess("操作成功!");
+          this.$emit("orderDialogReturn", "print");
+        } else {
+          this.dialogShow = false;
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 614 - 0
src/views/order/components/instantDelivery.vue

@@ -0,0 +1,614 @@
+<template>
+  <div class="app-container">
+    <div class="header" style="width: 100%">
+      <el-row class="row" :gutter="12">
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>今日新增订单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.AllOrder : 0 }} 个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待接单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitOrderCount : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待出单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitPendingOrders : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>进行中</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.inProgress : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待处理取消单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitCancelOrder : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待处理售后</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.afterSalesOrder : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>到账金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideSuccessPrice : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>冻结金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideWaitPrice : 0 }}元
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="radio">
+      <el-radio-group
+        v-model="queryParams.orderStatusKey"
+        @change="handleQuery"
+      >
+        <el-radio-button size="medium" :label="0" :name="0">
+          全部
+        </el-radio-button>
+        <el-radio-button
+          size="medium"
+          :label="item.value"
+          :name="item.value"
+          v-for="item in dict.type.sys_order_query_orderstatus_transmission"
+          :key="item.value"
+        >
+          {{ item.label }}
+        </el-radio-button>
+      </el-radio-group>
+    </div>
+
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="100px"
+    >
+      <el-form-item label="关键字" prop="key" label-width="100px">
+        <el-input
+          v-model="queryParams.key"
+          placeholder="请输入订单编号/商品ID/商品名称/买家手机号/买家ID搜索"
+          clearable
+          style="width: 420px"
+        />
+      </el-form-item>
+
+      <el-form-item label="下单时间" prop="createTime">
+        <el-date-picker
+          v-model="createTime"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="dateChange"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="配送方式" prop="deliveryType">
+        <el-select
+          v-model="queryParams.deliveryType"
+          placeholder="请选择配送方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_transmission_deliveryType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="支付方式" prop="paymentType" label-width="100px">
+        <el-select
+          v-model="queryParams.paymentType"
+          placeholder="请选择支付方式"
+          style="width: 22 0px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_paymentType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="售后状态" prop="afterSaleStatus">
+        <el-select
+          v-model="queryParams.afterSaleStatus"
+          placeholder="请选择售后状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_aftersalestatus"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量接单</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量出单</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button plain size="mini" type="primary" @click="handleExport"
+          >批量导出</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="printOrder"
+          :disabled="!selectList.length > 0"
+          >订单打印</el-button
+        >
+      </el-col>
+    </el-row>
+    <el-table
+      ref="multipleTable"
+      v-loading="loading"
+      :span-method="objectSpanMethod"
+      :data="spuList"
+      :border="true"
+      @selection-change="handleSelectionChange"
+      row-key="id"
+    >
+      <el-table-column type="selection" align="center" />
+      <el-table-column
+        label="订单编号"
+        align="center"
+        prop="carPayNo"
+        width="220"
+      />
+      <el-table-column label="取货号" align="center" prop="pickupCode" />
+      <el-table-column
+        label="商品信息"
+        align="center"
+        prop="skuName"
+        width="200"
+      >
+        <template slot-scope="scope">
+          <div>
+            <div>
+              {{ scope.row.skuName }}
+            </div>
+            <div>{{ scope.row.specsName }} : {{ scope.row.specsValue }}</div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="单价/数量" align="center" prop="price">
+        <template slot-scope="scope">
+          <span>
+            ¥{{ scope.row.amount }}
+            <br />
+            <span> {{ scope.row.quantity }}{{ scope.row.unit }}</span>
+          </span>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="实付款(元)"
+        align="center"
+        prop="paymentAmount"
+        width="100"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.paymentAmount ? "¥" + scope.row.paymentAmount : "" }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="订单状态" align="center" width="120">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_query_orderstatus_transmission"
+            :value="scope.row.orderStatusEnum"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="售后状态" align="center">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_aftersalestatus"
+            :value="scope.row.afterSaleStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="下单人ID"
+        align="center"
+        prop="userId"
+        width="100"
+      />
+      <el-table-column
+        label="收货人/提货人信息"
+        align="center"
+        prop="createTime"
+        width="160"
+      >
+        <template slot-scope="scope">
+          <div style="text-align: left">
+            {{ scope.row.consignee_contact_mobile }}
+            <br />
+            {{ scope.row.consignee_address_detail }}
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="预计送达/提货时间"
+        align="center"
+        prop="exceptArriveTime"
+      >
+      </el-table-column>
+
+      <el-table-column label="配送方式" align="center" width="120">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_transmission_deliveryType"
+            :value="scope.row.deliveryType"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作" align="center" width="150" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleTaking(scope.row)"
+            v-if="scope.row.orderStatusEnum == 'WAIT_DRIVER_ORDER'"
+            >接单</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleIssue(scope.row)"
+            v-if="scope.row.orderStatusEnum == 'WAIT_PENDING_ORDERS'"
+            >确认出单</el-button
+          >
+          <el-button size="mini" type="text" @click="handleDetail(scope.row)"
+            >订单详情</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <dialogOrder
+      ref="orderDialogRef"
+      @orderDialogReturn="orderReturn"
+    ></dialogOrder>
+  </div>
+</template>
+
+<script>
+import {
+  statisticsOrderNum,
+  merchantSecondOrderList,
+} from "@/api/manage/order";
+import Utils from "@/utils/derive";
+import dialogOrder from "../common/orderDialog.vue";
+export default {
+  name: "instantDelivery",
+  components: {
+    dialogOrder,
+  },
+  dicts: [
+    "sys_order_transmission_deliveryType",
+    "sys_order_orderStatusKey",
+    "sys_order_paymentType",
+    "sys_order_aftersalestatus",
+    "sys_order_payStatus",
+    "sys_order_query_orderstatus_transmission",
+    "sys_order_audit",
+  ],
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      total: 0,
+      // 参数表格数据
+      spuList: [],
+      // 查询参数
+      createTime: [],
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        orderStatusKey: 0,
+        afterSaleStatus: "",
+        paymentType: "",
+        deliveryType: "",
+        key: "",
+        createStartTime: "",
+        createEndTime: "",
+      },
+      printForm: {
+        sn: "",
+      },
+      column: [
+        { header: "订单编号", key: "carPayNo", width: 20 },
+        { header: "取货号", key: "pickupCode", width: 20 },
+        { header: "商品名称", key: "skuName", width: 20 },
+        { header: "规格名称", key: "specsName", width: 20 },
+        { header: "规格值", key: "specsValue", width: 20 },
+        { header: "单价", key: "amount", width: 20 },
+        { header: "数量", key: "quantity", width: 20 },
+        { header: "实付款", key: "paymentAmount", width: 20 },
+        { header: "订单状态", key: "orderStatusEnum", width: 20 },
+        { header: "售后状态", key: "afterSaleStatus", width: 20 },
+        { header: "下单人id", key: "userId", width: 20 },
+        { header: "收货人手机号", key: "consignee_contact_mobile", width: 20 },
+        {
+          header: "收货人详细地址",
+          key: "consignee_address_detail",
+          width: 20,
+        },
+        { header: "预计送达/提货时间", key: "exceptArriveTime", width: 20 },
+        { header: "配送方式", key: "deliveryType", width: 20 },
+      ],
+      // 表单参数
+      form: {},
+      // 表单校验
+      orderStatistics: {},
+      selectList: [],
+      selectListDC: [],
+    };
+  },
+  mounted() {
+    this.getList();
+    this.getstatisticsOrder();
+  },
+  methods: {
+    dateChange(val) {
+      this.queryParams.createStartTime = val[0];
+      this.queryParams.createEndTime = val[1];
+    },
+
+    handleDetail(record) {
+      this.$router.push({
+        path: "/order/order/detail/transmission",
+        query: { carPayNo: record.carPayNo },
+      });
+    },
+    handleIssue(record) {},
+
+    handleTaking(record) {
+      this.$refs.orderDialogRef.openDialog("taking", record);
+    },
+
+    orderReturn(type) {
+      switch (type) {
+        case "taking":
+          this.getList();
+      }
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0 || columnIndex === 1) {
+        if (
+          rowIndex === 0 ||
+          row.carPayNo != this.spuList[rowIndex - 1].carPayNo
+        ) {
+          let rowspan = 0;
+          this.spuList.forEach((element) => {
+            if (element.carPayNo === row.carPayNo) {
+              rowspan++;
+            }
+          });
+          return [rowspan, 1];
+        } else {
+          return [0, 0];
+        }
+      }
+    },
+
+    getstatisticsOrder() {
+      statisticsOrderNum({ spuType: 1 }).then((res) => {
+        if (res.code == 200) {
+          this.orderStatistics = res.data;
+        } else {
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.selectList = [];
+      this.loading = true;
+      merchantSecondOrderList(this.queryParams).then((response) => {
+        if (response.code == 200) {
+          let list = response.data.records;
+          const newData = [];
+          list.forEach((item) => {
+            item.goodsInfoList.forEach((goods) => {
+              if (goods.specsValue) {
+                goods = { ...goods, ...goods.specsValue[0] };
+              }
+
+              newData.push({
+                ...item,
+                ...goods,
+              });
+            });
+          });
+          this.spuList = newData;
+
+          console.log(this.spuList);
+
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      });
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.createTime = [];
+      this.queryParams.createStartTime = "";
+      this.queryParams.createEndTime = "val[1]";
+      this.resetForm("queryForm");
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.selectList = selection.map((item) => item.carPayNo);
+      this.selectListDC = selection.map((item) => item);
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      let lists = [];
+      for (let index = 0; index < this.spuList.length; index++) {
+        for (let a = 0; a < this.selectListDC.length; a++) {
+          if (this.spuList[index].id == this.selectListDC[a].id) {
+            lists.push(this.spuList[index]);
+          }
+        }
+      }
+
+      Utils.exportExcel(this.column, lists, "订单列表"); //导出方法
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.header {
+  .item {
+    height: 100px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    line-height: 40px;
+  }
+  .row {
+    background: #f4f4f4;
+    padding: 10px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    .title {
+      text-align: center;
+    }
+    .count {
+      text-align: center;
+      font-size: 20px;
+      font-weight: bold;
+      color: rgb(64, 158, 255);
+    }
+    .zz {
+      font-size: 14px;
+      color: red;
+      padding: 0px 10px;
+    }
+  }
+}
+.radio {
+  margin: 20px 0px;
+}
+</style>
+<style>
+.el-radio-button__inner {
+  width: 150px;
+}
+</style>

File diff suppressed because it is too large
+ 1146 - 0
src/views/order/components/welfareZone.vue


+ 766 - 0
src/views/order/components/wholesale.vue

@@ -0,0 +1,766 @@
+<template>
+  <div class="app-container">
+    <div class="header" style="width: 100%">
+      <el-row class="row" :gutter="12">
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>今日新增订单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.AllOrder : 0 }} 个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待接单</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitOrderCount : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期待审核</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitAuditOrderCount : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待发货</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitDelivery : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>未发货待退款</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.waitDeliveryRefund : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>待处理售后</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.afterSalesOrder : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>到账金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideSuccessPrice : 0 }}个
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>冻结金额</span>
+            </div>
+            <div class="count">
+              {{ orderStatistics ? orderStatistics.divideWaitPrice : 0 }}元
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期待付款</span>
+            </div>
+            <div class="count">
+              {{
+                orderStatistics.divideWaitPayPrice
+                  ? orderStatistics.divideWaitPayPrice
+                  : 0
+              }}元
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="3">
+          <div class="item">
+            <div class="title">
+              <span>账期逾期金额</span>
+            </div>
+            <div class="count">
+              {{
+                orderStatistics.divideOverduePrice
+                  ? orderStatistics.divideOverduePrice
+                  : 0
+              }}元
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="radio">
+      <el-radio-group
+        v-model="queryParams.queryOrderStatus"
+        @change="radioChange"
+      >
+        <el-radio-button size="medium" label="0" name="0">
+          全部
+        </el-radio-button>
+        <el-radio-button
+          size="medium"
+          :label="item.value"
+          :name="item.value"
+          v-for="item in dict.type.sys_order_query_orderStatus"
+          :key="item.value"
+        >
+          {{ item.label }}
+        </el-radio-button>
+      </el-radio-group>
+    </div>
+
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="100px"
+    >
+      <el-form-item label="关键字" prop="key" label-width="100px">
+        <el-input
+          v-model="queryParams.spuName"
+          placeholder="请输入订单编号/商品ID/商品名称/买家手机号/买家ID搜索"
+          clearable
+          style="width: 420px"
+        />
+      </el-form-item>
+
+      <el-form-item label="下单时间" prop="createTime">
+        <el-date-picker
+          v-model="queryParams.createTime"
+          value-format="yyyy-MM-dd"
+          format="yyyy-MM-dd"
+          type="date"
+          placeholder="请选择下单时间"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="配送方式" prop="deliveryType">
+        <el-select
+          v-model="queryParams.deliveryType"
+          placeholder="请选择配送方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_deliveryType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单状态" prop="orderStatusKey">
+        <el-select
+          v-model="queryParams.orderStatusKey"
+          placeholder="请选择订单状态"
+          style="width: 220px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_orderStatusKey"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="支付方式" prop="paymentType" label-width="100px">
+        <el-select
+          v-model="queryParams.paymentType"
+          placeholder="请选择支付方式"
+          style="width: 22 0px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_paymentType"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        label="先用后付支付状态"
+        prop="paymentType"
+        label-width="140px"
+      >
+        <el-select
+          v-model="queryParams.paymentStatus"
+          placeholder="请选择支付状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_payStatus"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="售后状态" prop="afterSaleStatus">
+        <el-select
+          v-model="queryParams.afterSaleStatus"
+          placeholder="请选择售后状态"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_aftersalestatus"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="先用后付审核" prop="paymentType" label-width="140px">
+        <el-select
+          v-model="queryParams.paymentType"
+          placeholder="请选择支付方式"
+          style="width: 180px"
+        >
+          <el-option label="全部" value=""> </el-option>
+          <el-option
+            :label="item.label"
+            :value="item.value"
+            v-for="item in dict.type.sys_order_audit"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量接单</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >批量发货</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="printOrderBtn"
+          :disabled="!selectList.length > 0"
+          >订单打印</el-button
+        >
+      </el-col>
+
+      <el-col :span="1.5">
+        <el-dropdown :hide-on-click="false" trigger="click">
+          <el-button type="primary" plain size="mini">
+            更多批量操作<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item @click.native=""
+              >批量先用后付审核</el-dropdown-item
+            >
+            <el-dropdown-item @click.native=""
+              >批量确认是否线下支付</el-dropdown-item
+            >
+            <el-dropdown-item @click.native="handleExport"
+              >批量导出</el-dropdown-item
+            >
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+    </el-row>
+    <el-table
+      ref="multipleTable"
+      v-loading="loading"
+      :span-method="objectSpanMethod"
+      :data="spuList"
+      :border="true"
+      @selection-change="handleSelectionChange"
+      row-key="id"
+    >
+      <el-table-column type="selection" align="center" />
+      <el-table-column
+        label="订单编号"
+        align="center"
+        prop="carPayNo"
+        width="230"
+      />
+
+      <el-table-column
+        label="商品名称"
+        align="center"
+        prop="skuName"
+        width="200"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.goodsInfo
+              ? JSON.parse(scope.row.goodsInfo)[0].skuName
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="单价" align="center" prop="price">
+        <template slot-scope="scope">
+          <span>
+            {{
+              scope.row.goodsInfo
+                ? JSON.parse(scope.row.goodsInfo)[0].price + "元"
+                : ""
+            }}
+          </span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="数量" align="center" prop="price">
+        <template slot-scope="scope">
+          <span>
+            {{
+              scope.row.goodsInfo
+                ? JSON.parse(scope.row.goodsInfo)[0].quantity
+                : ""
+            }}{{
+              scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].unit : ""
+            }}</span
+          >
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="交易金额(元)"
+        align="center"
+        prop="paymentAmount"
+        width="100"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.goodsAmount.toFixed(2) }}元
+        </template>
+      </el-table-column>
+
+      <el-table-column label="订单状态" align="center" width="120">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_orderStatus_table"
+            :value="scope.row.orderStatus"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="售后状态" align="center">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_aftersalestatus"
+            :value="scope.row.afterSaleStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="下单人ID"
+        align="center"
+        prop="userId"
+        width="100"
+      />
+      <el-table-column
+        label="下单时间"
+        align="center"
+        prop="createTime"
+        width="160"
+      />
+      <el-table-column label="支付方式" align="center">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_paymentType"
+            :value="scope.row.paymentType"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="支付状态" align="center" prop="paymentStatus">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_payStatus"
+            :value="scope.row.paymentStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="配送方式"
+        align="center"
+        prop="paymentType"
+        width="120"
+      >
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_order_deliveryType"
+            :value="scope.row.deliveryType"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作" align="center" width="150" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handlePrior(scope.row)"
+            v-if="
+              scope.row.paymentType == 'firstuse' &&
+              scope.row.auditFirstUse != 0
+            "
+            >先用后付审核</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleOffline(scope.row)"
+            v-if="
+              scope.row.paymentStatus == '2' &&
+              scope.row.confirmOfflinePayment != 0
+            "
+            >确认是否已线下支付</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDetail(scope.row)"
+            v-hasPermi="['manage:order:detail']"
+            >订单详情</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNo"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <dialogOrder
+      ref="orderDialogRef"
+      @orderDialogReturn="orderReturn"
+    ></dialogOrder>
+  </div>
+</template>
+
+<script>
+import { statisticsOrderNum, queryUserOrderByShopId } from "@/api/manage/order";
+import Utils from "@/utils/derive";
+import dialogOrder from "../common/orderDialog.vue";
+export default {
+  name: "wholesale",
+  components: {
+    dialogOrder,
+  },
+  dicts: [
+    "sys_order_deliveryType",
+    "sys_order_orderStatusKey",
+    "sys_order_paymentType",
+    "sys_order_aftersalestatus",
+    "sys_order_payStatus",
+    "sys_order_orderStatus_table",
+    "sys_order_query_orderStatus",
+    "sys_order_audit",
+  ],
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      total: 0,
+      // 参数表格数据
+      spuList: [],
+      // 弹出层标题
+      title: "订单详情",
+      // 查询参数
+      queryParams: {
+        queryOrderStatus: "0",
+        spuType: 0,
+        userId: "",
+        pageNo: 1,
+        pageSize: 10,
+        spuName: "",
+        userOrderSn: "",
+        userPhone: "",
+        createTime: "",
+        orderStatusKey: "",
+        afterSaleStatus: "",
+        paymentType: "",
+        deliveryType: "",
+      },
+      printForm: {
+        sn: "",
+      },
+      column: [
+        { header: "订单编号", key: "userOrderSn", width: 20 },
+        { header: "买家姓名", key: "userNick", width: 20 },
+        { header: "买家手机号", key: "userPhone", width: 20 },
+        { header: "商品名称", key: "skuName", width: 20 },
+        { header: "商品类型", key: "categoryName", width: 20 },
+        { header: "商品价格", key: "price", width: 20 },
+        { header: "包装方式", key: "packageType", width: 20 },
+        { header: "规格名称", key: "specsName", width: 20 },
+        { header: "规格值", key: "specsValue", width: 20 },
+        { header: "实付金额(元)", key: "goodsAmount", width: 20 },
+        { header: "商品数量", key: "goodsDetails", width: 20 },
+        { header: "运费", key: "freightFee", width: 20 },
+        { header: "订单状态", key: "orderStatus", width: 20 },
+        { header: "售后状态", key: "afterSaleStatus", width: 20 },
+        { header: "下单时间", key: "createTime", width: 20 },
+        { header: "付款时间 ", key: "paymentTime", width: 20 },
+      ],
+      // 表单参数
+      form: {},
+      // 表单校验
+      orderStatistics: {},
+      selectList: [],
+      selectListDC: [],
+      queryOrderStatus: 0,
+    };
+  },
+  mounted() {
+    this.getList();
+    this.getstatisticsOrder();
+  },
+  methods: {
+    radioChange() {
+      this.getList();
+    },
+    orderReturn(type) {
+      switch (type) {
+        case "print":
+          this.$refs.multipleTable.clearSelection();
+          this.getList();
+        case "prior":
+          this.getList();
+        case "offline":
+          this.getList();
+      }
+    },
+    handleOffline(record) {
+      this.$refs.orderDialogRef.openDialog("offline", record);
+    },
+    handlePrior(record) {
+      this.$refs.orderDialogRef.openDialog("prior", record);
+    },
+    printOrderBtn() {
+      this.$refs.orderDialogRef.openDialog("print", this.selectList);
+    },
+
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0 || columnIndex === 1) {
+        if (
+          rowIndex === 0 ||
+          row.carPayNo != this.spuList[rowIndex - 1].carPayNo
+        ) {
+          let rowspan = 0;
+          this.spuList.forEach((element) => {
+            if (element.carPayNo === row.carPayNo) {
+              rowspan++;
+            }
+          });
+          return [rowspan, 1];
+        } else {
+          return [0, 0];
+        }
+      }
+    },
+
+    getstatisticsOrder() {
+      statisticsOrderNum({ spuType: 0 }).then((res) => {
+        if (res.code == 200) {
+          this.orderStatistics = res.data;
+        } else {
+          this.$modal.msgError(res.msg);
+        }
+      });
+    },
+
+    /** 查询参数列表 */
+    getList() {
+      this.selectList = [];
+      this.loading = true;
+      queryUserOrderByShopId(this.queryParams).then((response) => {
+        if (response.code == 200) {
+          let list = response.data.records;
+          let infoList = [];
+          for (let index = 0; index < list.length; index++) {
+            let e = list[index];
+            if (e.dxUserOrderVOList) {
+              for (let i = 0; i < e.dxUserOrderVOList.length; i++) {
+                let a = e.dxUserOrderVOList[i];
+                let c = { ...e, ...a };
+                infoList.push(c);
+              }
+            } else {
+              infoList.push(e);
+            }
+          }
+          let totalList = [];
+          for (let index = 0; index < infoList.length; index++) {
+            let e = infoList[index];
+            if (e.goodsInfo) {
+              try {
+                var goods = JSON.parse(e.goodsInfo);
+                e = { ...e, ...goods[0] };
+              } catch (error) {
+                console.error("解析 JSON 时出错:", error);
+                // 跳出当前循环,继续处理下一个元素
+                continue;
+              }
+            }
+            if (e.specsValue) {
+              for (let i = 0; i < e.specsValue.length; i++) {
+                let a = e.specsValue[i];
+                e = { ...e, ...a };
+              }
+            }
+
+            totalList.push(e);
+          }
+
+          totalList.forEach((e) => {
+            try {
+              let goos = JSON.parse(e.goodsInfo);
+              let detail = "";
+              if (goos && goos.length > 0) {
+                // 检查 goos 是否为空
+                goos.forEach((a) => {
+                  detail += `${a.skuName}(${a.specsValue[0]?.specsName})-数量:${a.quantity}${a.unit};`;
+                });
+              }
+              e.goodsDetails = detail;
+            } catch (error) {
+              console.error("解析 goodsInfo 时出错:", error);
+            }
+          });
+
+          this.spuList = totalList;
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      });
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.selectList = selection.map((item) => item.carPayNo);
+      this.selectListDC = selection.map((item) => item);
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      let lists = [];
+      for (let index = 0; index < this.spuList.length; index++) {
+        for (let a = 0; a < this.selectListDC.length; a++) {
+          if (this.spuList[index].id == this.selectListDC[a].id) {
+            lists.push(this.spuList[index]);
+          }
+        }
+      }
+      Utils.exportExcel(this.column, lists, "订单列表"); //导出方法
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.header {
+  .item {
+    height: 100px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    line-height: 40px;
+  }
+  .row {
+    background: #f4f4f4;
+    padding: 10px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    .title {
+      text-align: center;
+    }
+    .count {
+      text-align: center;
+      font-size: 20px;
+      font-weight: bold;
+      color: rgb(64, 158, 255);
+    }
+    .zz {
+      font-size: 14px;
+      color: red;
+      padding: 0px 10px;
+    }
+  }
+}
+.radio {
+  margin: 20px 0px;
+}
+</style>
+<style>
+.el-radio-button__inner {
+  width: 150px;
+}
+</style>

+ 440 - 0
src/views/order/detail/transmission.vue

@@ -0,0 +1,440 @@
+<template>
+  <div class="app-container">
+    <div class="header">
+      <div class="left">
+        <div class="title">
+          <div class="status">
+            订单状态:
+            <dict-text
+              :options="dict.type.sys_order_query_orderstatus_transmission"
+              :value="spuInfo.orderStatusEnum"
+            />
+            {{ spuInfo.pickupCode }}
+            <el-tag
+              type="warning"
+              style="margin-left: 10px"
+              v-if="spuInfo.deliveryType == 1"
+              >上门服务</el-tag
+            >
+            <el-tag
+              type="success"
+              style="margin-left: 10px"
+              v-if="spuInfo.deliveryType == 0"
+              >到店</el-tag
+            >
+          </div>
+          <div style="display: flex; flex-direction: row; align-items: center">
+            <div style="margin-right: 10px">
+              预计
+              {{
+                spuInfo.receiveTime
+                  ? $moment(spuInfo.receiveTime).format("HH:mm")
+                  : $moment().format("HH:mm")
+              }}
+              -
+              {{
+                spuInfo.exceptArriveTime
+                  ? $moment(spuInfo.exceptArriveTime).format("HH:mm")
+                  : ""
+              }}
+              送达
+            </div>
+            <el-button size="small" @click="cancalOrder">取消订单</el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              @click="takingOrder"
+              v-if="spuInfo.orderStatusEnum == 'WAIT_DRIVER_ORDER'"
+              >接单</el-button
+            >
+            <el-button
+              size="small"
+              type="primary"
+              @click="takingOrder"
+              v-if="spuInfo.orderStatusEnum == 'WAIT_PENDING_ORDERS'"
+              >确认出单</el-button
+            >
+          </div>
+        </div>
+        <div class="info">
+          <div class="remark">备注:{{ spuInfo.porderRemark }}</div>
+          <div
+            class="surplus"
+            v-if="spuInfo.orderStatusEnum == 'WAIT_DRIVER_ORDER'"
+          >
+            距离接单还剩:{{ countdown }}
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="main">
+      <div class="subTitle">订单信息</div>
+      <div class="main-info">
+        <el-row>
+          <el-col :span="8">
+            <el-descriptions title="交易信息" column="1">
+              <el-descriptions-item label="订单编号">
+                {{ spuInfo ? spuInfo.carPayNo : "" }}</el-descriptions-item
+              >
+              <el-descriptions-item label="下单时间">
+                {{
+                  spuInfo.createTime
+                    ? $moment(spuInfo.createTime).format("HH:mm")
+                    : ""
+                }}</el-descriptions-item
+              >
+              <el-descriptions-item label="支付总金额">
+                {{ spuInfo ? spuInfo.totalOrderAmount : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="支付方式">
+                <dict-text
+                  :options="dict.type.sys_order_paymentType"
+                  :value="spuInfo.paymentType"
+                />
+              </el-descriptions-item>
+              <el-descriptions-item label="支付时间">
+                {{
+                  spuInfo.paymentTime
+                    ? $moment(spuInfo.paymentTime).format("yyyy-MM-DD HH:mm:ss")
+                    : ""
+                }}
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-col>
+          <el-col :span="8">
+            <el-descriptions title="买家信息" column="1">
+              <el-descriptions-item label="昵称">
+                {{ spuInfo ? spuInfo.nick : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="ID">
+                {{ spuInfo ? spuInfo.userId : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="注册手机号">
+                {{
+                  spuInfo ? spuInfo.consigneeContactMobile : ""
+                }}</el-descriptions-item
+              >
+              <el-descriptions-item label="提货人">
+                {{ spuInfo ? spuInfo.consigneeContactName : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="提货时间">
+                {{
+                  spuInfo.receiveTime
+                    ? $moment(spuInfo.receiveTime).format("yyyy-MM-DD HH:mm:ss")
+                    : ""
+                }}
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-col>
+          <el-col :span="8">
+            <el-descriptions title="配送信息" column="1">
+              <el-descriptions-item label="骑手">
+                {{ spuInfo ? spuInfo.riderName : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="手机号">
+                {{ spuInfo ? spuInfo.riderPhone : "" }}
+              </el-descriptions-item>
+              <el-descriptions-item label="接单时间">
+                {{
+                  spuInfo.riderReceiveTime
+                    ? $moment(spuInfo.riderReceiveTime).format(
+                        "yyyy-MM-DD HH:mm:ss"
+                      )
+                    : ""
+                }}
+              </el-descriptions-item>
+              <el-descriptions-item label="送达时间">
+                {{
+                  spuInfo.deliveryTime
+                    ? $moment(spuInfo.deliveryTime).format(
+                        "yyyy-MM-DD HH:mm:ss"
+                      )
+                    : ""
+                }}
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+
+    <div class="table">
+      <el-table
+        ref="multipleTable"
+        v-loading="loading"
+        :data="spuList"
+        :border="true"
+        @selection-change="handleSelectionChange"
+        row-key="id"
+      >
+        <el-table-column label="商品信息" align="center" width="200">
+          <template slot-scope="scope">
+            <div class="tableRow">
+              <div>
+                <img :src="scope.row.goodsInfo[0].skuPic" style="width: 50px" />
+              </div>
+              <div style="margin-left: 10px">
+                <div>{{ scope.row.goodsInfo[0].skuName }}</div>
+                <div>ID:{{ scope.row.goodsInfo[0].skuId }}</div>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="商品规格" align="center" prop="price">
+          <template slot-scope="scope">
+            <div>
+              <div>
+                {{ scope.row.goodsInfo[0].specsValue[0].specsName }}:{{
+                  scope.row.goodsInfo[0].specsValue[0].specsValue
+                }}
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="退款售后状态" align="center" prop="price">
+          <template slot-scope="scope">
+            <dict-tag
+              :options="dict.type.sys_order_aftersalestatus"
+              :value="scope.row.afterSaleStatus"
+            />
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          label="单价"
+          align="center"
+          prop="paymentAmount"
+          width="100"
+        >
+          <template slot-scope="scope">
+            ¥{{ scope.row.goodsInfo[0].price }}/{{
+              scope.row.goodsInfo[0].unit
+            }}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="数量" align="center" width="120">
+          <template slot-scope="scope">
+            {{ scope.row.goodsInfo[0].quantity
+            }}{{ scope.row.goodsInfo[0].unit }}
+          </template>
+        </el-table-column>
+        <el-table-column label="优惠" align="center">
+          <template slot-scope="scope">
+            {{
+              scope.row.discountAmount == 0
+                ? 0
+                : "-¥" + scope.row.discountAmount
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column label="包装费" align="center">
+          <template slot-scope="scope">
+            {{
+              scope.row.packingPrice == 0 ? 0 : "¥" + scope.row.packingPrice
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column label="配送费" align="center">
+          <template slot-scope="scope">
+            {{
+              scope.row.freightFee == 0 ? 0 : "¥" + scope.row.freightFee
+            }}</template
+          >
+        </el-table-column>
+        <el-table-column label="总金额" align="center">
+          <template slot-scope="scope">
+            {{
+              scope.row.totalOrderAmount == 0
+                ? 0
+                : "¥" + scope.row.totalOrderAmount
+            }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import moment from "moment";
+import { sendSecondOrderInfo } from "@/api/manage/order";
+export default {
+  dicts: [
+    "sys_order_query_orderstatus_transmission",
+    "sys_order_paymentType",
+    "sys_order_aftersalestatus",
+  ],
+  data() {
+    return {
+      activeName: "1",
+      spuList: [],
+      spuInfo: {},
+      countdown: "", // 初始倒计时为30分钟
+      timer: null, // 用于存储定时器ID
+      endTime: null,
+      loading: false,
+    };
+  },
+  mounted() {
+    this.getSecondOrderInfo();
+    // 计算30分钟后的结束时间
+  },
+
+  methods: {
+    updateCountdown() {
+      const now = moment();
+      let end = moment(this.spuInfo.paymentTime).add(30, "minutes");
+      // 使用 diff 方法计算差值,并指定单位为秒
+      const diff = end.diff(now, "seconds");
+      if (diff > 0) {
+        const minutes = Math.floor(diff / 60);
+        const seconds = diff % 60;
+        this.countdown = `${minutes.toString().padStart(2, "0")}:${seconds
+          .toString()
+          .padStart(2, "0")}`;
+      } else {
+        clearInterval(this.timer);
+        this.countdown = "00:00";
+        this.isCountingDown = false;
+      }
+    },
+    getSecondOrderInfo() {
+      sendSecondOrderInfo(this.$route.query.carPayNo).then((res) => {
+        if (res.code == 200) {
+          this.spuList = res.data;
+
+          if (this.spuList.length > 0) {
+            this.spuList.forEach((e) => {
+              if (e.goodsInfo) {
+                e.goodsInfo = JSON.parse(e.goodsInfo);
+              }
+            });
+            this.spuInfo = this.spuList[0];
+          }
+          if (this.spuInfo.orderStatusEnum == "WAIT_DRIVER_ORDER") {
+            this.timer = setInterval(() => {
+              this.updateCountdown();
+            }, 1000);
+          }
+        }
+      });
+    },
+    //倒计时
+    getCountdown() {},
+    takingOrder() {
+      this.$confirm("是否确认接单?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {})
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消",
+          });
+        });
+    },
+    cancalOrder() {
+      this.$confirm("是否确认取消订单?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {})
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消",
+          });
+        });
+    },
+  },
+  beforeDestroy() {
+    if (this.timer) {
+      clearInterval(this.timer);
+    }
+  },
+};
+</script>
+<style>
+.el-descriptions__body {
+  background: none;
+}
+</style>
+<style scoped lang="scss">
+.tableRow {
+  text-align: left;
+  display: flex;
+  flex-direction: row;
+  // justify-content: center;
+  align-items: center;
+}
+.header {
+  border-radius: 10px;
+  height: 150px;
+  background: #f4f4f4;
+  padding: 30px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  .left {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: flex-start;
+    line-height: 30px;
+    .title {
+      font-size: 20px;
+      font-weight: bold;
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+      width: 100%;
+      .status {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+      }
+    }
+    .info {
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+      .remark {
+        min-width: 70vw;
+        min-height: 50px;
+        width: 70%;
+        margin-top: 10px;
+        color: orange;
+        font-size: 16px;
+      }
+      .surplus {
+        font-weight: bold;
+      }
+    }
+  }
+}
+.main {
+  .subTitle {
+    font-size: 18px;
+    font-weight: bold;
+    margin: 20px 0px;
+  }
+  .main-info {
+    border-radius: 10px;
+    padding: 20px;
+    background: #f4f4f4;
+  }
+}
+.table {
+  margin-top: 20px;
+}
+</style>

+ 47 - 0
src/views/order/index.vue

@@ -0,0 +1,47 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="农商批发订单" :name="0"></el-tab-pane>
+      <el-tab-pane label="同城秒送订单" :name="1"></el-tab-pane>
+      <el-tab-pane label="福利专区订单" :name="2"></el-tab-pane>
+    </el-tabs>
+    <component :is="componentName"></component>
+  </div>
+</template>
+<script>
+import wholesale from "./components/wholesale.vue";
+import instantDelivery from "./components/instantDelivery.vue";
+import welfareZone from "./components/welfareZone.vue";
+export default {
+  components: {
+    wholesale,
+    instantDelivery,
+    welfareZone,
+  },
+  name: "order",
+  data() {
+    return {
+      activeName: 0,
+      componentName: wholesale,
+    };
+  },
+  mounted() {},
+  methods: {
+    handleClick(tab) {
+      switch (parseInt(tab.name)) {
+        case 0:
+          this.componentName = wholesale;
+          break;
+        case 1:
+          this.componentName = instantDelivery;
+          break;
+        case 2:
+          this.componentName = welfareZone;
+          break;
+        default:
+          this.componentName = wholesale;
+      }
+    },
+  },
+};
+</script>