diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java index 35f1eb7e..91ab725d 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java @@ -566,6 +566,7 @@ public class OrderDetailController extends BaseController { orderListResponse.setHandoverRemark(detail.getHandoverRemark()); orderListResponse.setGoods(goods); + orderListResponse.setOrderType(detail.getOrderType()); orderListResponse.setAfterPlatformServiceStatus(detail.getAfterServiceStatus()); orderListResponse.setAddMoneyRemark(addMoneyRemark); orderListResponse.setAddMoney(addMoneyTotal); diff --git a/ghy-admin/src/main/resources/templates/order/master.html b/ghy-admin/src/main/resources/templates/order/master.html index 662a7421..2759334f 100644 --- a/ghy-admin/src/main/resources/templates/order/master.html +++ b/ghy-admin/src/main/resources/templates/order/master.html @@ -1026,6 +1026,37 @@ return; } + // 直接获取订单详情来判断订单类型 + getOrderDetailInfo(orderDetailId, function(orderDetail) { + showDisputeModalWithOrderInfo(orderDetailId, disputeRecords, orderDetail); + }); + } + + // 获取订单详情信息 + function getOrderDetailInfo(orderDetailId, callback) { + $.ajax({ + type: "POST", + dataType: "json", + contentType: "application/json", + url: prefix + "/app/detail", + data: JSON.stringify({id: orderDetailId}), + success: function(result) { + if (result.code == web_status.SUCCESS) { + callback(result.data); + } else { + callback(null); + } + }, + error: function() { + callback(null); + } + }); + } + + // 根据订单信息显示售后纠纷处理弹窗 + function showDisputeModalWithOrderInfo(orderDetailId, disputeRecords, orderDetail) { + var isGoodsOrder = orderDetail && orderDetail.orderType === 1; // 1表示商品订单 + var modalContent = ''; @@ -1072,6 +1119,17 @@ }); } + // 获取师傅同意处理方式文本 + function getWorkerAgreeTypeText(type) { + var typeMap = { + 1: '即时退单退款', + 2: '货物拦截后退单退款', + 3: '快递返回货物后退单退款', + 4: '退回货物后退单退款' + }; + return typeMap[type] || '未知'; + } + // 处理退款 function processRefund(recordId, orderDetailId) { var refundAmount = $('#refundAmount_' + recordId).val(); diff --git a/ghy-admin/src/main/resources/templates/order/orderManager.html b/ghy-admin/src/main/resources/templates/order/orderManager.html index 24da34a6..e3d2b673 100644 --- a/ghy-admin/src/main/resources/templates/order/orderManager.html +++ b/ghy-admin/src/main/resources/templates/order/orderManager.html @@ -1254,8 +1254,49 @@ }); } + // 获取订单详情信息 + function getOrderDetailInfo(orderMasterId, callback) { + $.ajax({ + type: "POST", + dataType: "json", + url: prefix + "/app/detail", + contentType: "application/json", + data: JSON.stringify({id: orderMasterId}), + success: function (result) { + if (result.code == web_status.SUCCESS) { + callback(result.data); + } else { + $.modal.msgError("获取订单详情失败:" + result.msg); + } + }, + error: function() { + $.modal.msgError("获取订单详情失败,请重试!"); + } + }); + } + + // 获取师傅同意类型文本 + function getWorkerAgreeTypeText(type) { + var types = { + 1: '同意', + 2: '不同意', + 3: '部分同意' + }; + return types[type] || '未处理'; + } + // 显示售后纠纷处理弹窗 function showAfterServiceDisputeModal(orderMasterId, afterServiceRecords) { + // 先获取订单详情以判断订单类型 + getOrderDetailInfo(orderMasterId, function(orderDetail) { + showDisputeModalWithOrderInfo(orderMasterId, afterServiceRecords, orderDetail); + }); + } + + // 根据订单信息显示售后纠纷处理弹窗 + function showDisputeModalWithOrderInfo(orderMasterId, afterServiceRecords, orderDetail) { + var isGoodsOrder = orderDetail && orderDetail.orderType === 1; + var html = '