From 7db8484a7c2f85d75fc704764798e39fe15e9110 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Fri, 29 Aug 2025 11:36:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=94=AE=E5=90=8E=E8=AE=A2=E5=8D=95):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=94=AE=E5=90=8E=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=98=BE=E7=A4=BA=E5=9C=A8?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在manager和seller端添加获取售后数量统计的API接口 - 修改售后订单页面,显示各状态对应的数量统计 - 新增计算属性serviceStatusWithCount动态生成带数量的标签页 - 在初始化、搜索和状态切换时调用统计接口更新数据 --- manager/src/api/order.js | 5 +++ .../order/after-order/afterSaleOrder.vue | 37 ++++++++++++++-- seller/src/api/order.js | 5 +++ .../order/after-order/returnGoodsOrder.vue | 43 ++++++++++++++++--- 4 files changed, 81 insertions(+), 9 deletions(-) diff --git a/manager/src/api/order.js b/manager/src/api/order.js index 1ba03b63..d729f54f 100644 --- a/manager/src/api/order.js +++ b/manager/src/api/order.js @@ -165,3 +165,8 @@ export const storeAddress = (sn) => { export const getOrderNum = (params) => { return getRequest(`/order/order/orderNum`, params) } + +// 获取售后数量统计 +export const getAfterSaleNumVO = (params) => { + return getRequest(`/order/afterSale/afterSaleNumVO`, params) +} diff --git a/manager/src/views/order/after-order/afterSaleOrder.vue b/manager/src/views/order/after-order/afterSaleOrder.vue index cffbbf85..9f8b2ad1 100644 --- a/manager/src/views/order/after-order/afterSaleOrder.vue +++ b/manager/src/views/order/after-order/afterSaleOrder.vue @@ -90,7 +90,7 @@
- +
@@ -316,13 +316,15 @@ export default { {title: '卖家终止售后', value: 'SELLER_TERMINATION'}, {title: '买家取消售后', value: 'BUYER_CANCEL'} ], - currentStatus: '' + currentStatus: '', + afterSaleNumData: {} // 售后数量统计数据 }; }, methods: { // 初始化数据 init() { this.getDataList(); + this.getAfterSaleNumData(); }, // 分页 改变页码 changePage(v) { @@ -340,6 +342,7 @@ export default { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 20; this.getDataList(); + this.getAfterSaleNumData(); }, // 开始结束时间分别赋值 selectDateRange(v) { @@ -358,9 +361,19 @@ export default { this.total = res.result.total; } }); + // 获取售后状态数量 this.total = this.data.length; this.loading = false; }, + // 获取售后数量统计 + getAfterSaleNumData() { + const { serviceStatus, ...searchParams } = this.searchForm; + API_Order.getAfterSaleNumVO(searchParams).then((res) => { + if (res.success) { + this.afterSaleNumData = res.result; + } + }); + }, // 跳转售后详情 detail(v) { let sn = v.sn; @@ -379,12 +392,30 @@ export default { this.searchForm.serviceStatus = item; } this.getDataList(); + this.getAfterSaleNumData(); }, }, mounted() { this.init(); }, -}; + computed: { + // 带数量的售后状态 + serviceStatusWithCount() { + return [ + {title: '全部', value: ''}, + {title: `申请售后${this.afterSaleNumData.applyNum ? '(' + this.afterSaleNumData.applyNum + ')' : ''}`, value: 'APPLY'}, + {title: `通过售后${this.afterSaleNumData.passNum ? '(' + this.afterSaleNumData.passNum + ')' : ''}`, value: 'PASS'}, + {title: `拒绝售后${this.afterSaleNumData.refuseNum ? '(' + this.afterSaleNumData.refuseNum + ')' : ''}`, value: 'REFUSE'}, + {title: `待收货${this.afterSaleNumData.buyerReturnNum ? '(' + this.afterSaleNumData.buyerReturnNum + ')' : ''}`, value: 'BUYER_RETURN'}, + {title: `确认收货${this.afterSaleNumData.sellerConfirmNum ? '(' + this.afterSaleNumData.sellerConfirmNum + ')' : ''}`, value: 'SELLER_CONFIRM'}, + {title: `完成售后${this.afterSaleNumData.completeNum ? '(' + this.afterSaleNumData.completeNum + ')' : ''}`, value: 'COMPLETE'}, + {title: `卖家终止售后${this.afterSaleNumData.sellerTerminationNum ? '(' + this.afterSaleNumData.sellerTerminationNum + ')' : ''}`, value: 'SELLER_TERMINATION'}, + {title: `买家取消售后${this.afterSaleNumData.buyerCancelNum ? '(' + this.afterSaleNumData.buyerCancelNum + ')' : ''}`, value: 'BUYER_CANCEL'}, + {title: `等待平台退款${this.afterSaleNumData.waitRefundNum ? '(' + this.afterSaleNumData.waitRefundNum + ')' : ''}`, value: 'WAIT_REFUND'} + ]; + } + } + }