-
-
申请退款信息-用户全部退款
-
-
{{item.productName}}
-
X{{item.quantity}}
-
¥{{item.price}}
-
-
-
餐盒费
-
¥{{orderData.packageFee}}
-
-
-
配送费
-
¥{{orderData.deliveryFee}}
-
-
- 合计退款:¥{{orderData.totalAmount}}
-
-
+
售后原因说明
-
+
-
同意退款
-
拒绝退款
+
同意退款
+
拒绝退款
商品信息
-
-
{{item.productName}}
+
+
![]()
+
+
{{item.productName}}
+
{{formatSpecs(item.specs)}}
+
X{{item.quantity}}
¥{{item.price}}
-
+
餐盒费
¥{{orderData.packageFee}}
-
+
配送费
¥{{orderData.deliveryFee}}
-
活动优惠:¥0 下单返佣:¥0
- 合计:¥{{orderData.totalAmount}}
+
+
锦鲤免单
+
¥{{orderData.freeAmount}}
+
+
+
优惠券
+
-¥{{orderData.userCouponNum}}
+
+
{{orderData.status == 0 ? '待支付' : '实付'}}:¥{{orderData.totalAmount}}
平台服务费:¥{{(orderData.chouyong).toFixed(2)}}
商家预计收入:¥{{(orderData.yujishouru).toFixed(2)}}
@@ -92,6 +90,59 @@
+
+
退款/售后
+
+
+ 申请时间
+ {{item.createTime | formatDateTime}}
+
+
+ 金额
+ ¥{{item.refundAmount}}
+
+
+
![]()
+
+
{{goods.productName}}
+
{{formatSpecs(goods.specs)}}
+
餐盒费 ¥{{goods.packageFee}}
+
+
X{{goods.quantity}}
+
¥{{goods.price}}
+
+
+ 原因
+ {{item.reason || ""}}
+
+
+
图片
+
+
+
+
+
+ 退款/售后类型
+ {{getRefundTypeText(item)}} | {{getRefundTypeStatusText(item)}}
+
+
+ 退款/售后状态
+ {{getRefundStatusText(item.status)}}
+
+
+ 拒绝原因
+ {{item.rejectReason}}
+
+
+ 自动退款时间
+ {{getAutoRefundTime(item.createTime)}} 之前对方未处理系统会自动退款
+
+
+ 处理退款/售后时间
+ {{item.successTime | formatDateTime}}
+
+
+
@@ -108,10 +159,15 @@
name: "logisticsAddress",
data() {
return {
- orderData: {},
+ orderData: {
+ deliveryInfo: {},
+ goodsList: [],
+ mallRefundRecord: []
+ },
returnFormData:{},
refundReason: "",
- refundLoading: false
+ refundLoading: false,
+ refundActionData: null
};
},
filters: {
@@ -130,43 +186,69 @@
methods: {
initRecharge(data) {
this.refundReason = "";
- if(data.status == 7 || data.status == 11){
- this.orderData = data
- this.orderData.goodsList = this.orderData.items
- this.orderData.deliveryInfo = this.orderData.mallDeliveryOrder
- this.orderData.deliveryType = this.orderData.deliveryInfo.deliveryType
- this.orderData.deliveryFee = this.orderData.deliveryInfo.deliveryFee
- this.orderData.packageFee = data.mallOrder.packageFee
- this.orderData.numberCode = this.orderData.mallDeliveryOrder.numberCode
- }else{
+ this.refundActionData = data;
+ const orderId = data.orderId || (data.mallOrder && data.mallOrder.id) || data.id;
+ const shopId = data.shopId || (data.mallOrder && data.mallOrder.shopId);
+ if (shopId) {
getByShopId({
- "shopId": data.shopId
+ "shopId": shopId
}).then((res) => {
if (res.success) {
- this.orderDetail(data.id,res.result)
+ this.orderDetail(orderId, res.result, data)
+ } else {
+ this.orderDetail(orderId, {}, data)
}
});
+ } else {
+ this.orderDetail(orderId, {}, data)
}
},
- orderDetail(id,shopTakeaway) {
+ orderDetail(id,shopTakeaway, sourceData) {
getOrderDetail(id).then((res) => {
this.loading = false;
if (res.success) {
- this.orderData = res.result
+ this.orderData = this.normalizeOrderData(res.result)
+ if ((!this.orderData.mallRefundRecord || this.orderData.mallRefundRecord.length == 0) && sourceData && sourceData.refundAmount != null) {
+ this.orderData.mallRefundRecord = [sourceData];
+ }
//商家预计收入的计算
- let price = this.orderData.goodsAmount+this.orderData.packageFee
+ let price = (this.orderData.goodsAmount || 0) + (this.orderData.packageFee || 0)
if(this.orderData.orderType == 1){
- this.orderData.chouyong = price/100 * shopTakeaway.commissionRateOne
+ this.orderData.chouyong = price/100 * (shopTakeaway.commissionRateOne || 0)
this.orderData.yujishouru = price - this.orderData.chouyong
}else{
- this.orderData.chouyong = price/100 * shopTakeaway.commissionRateMore
+ this.orderData.chouyong = price/100 * (shopTakeaway.commissionRateMore || 0)
this.orderData.yujishouru = price - this.orderData.chouyong
}
}
});
},
+ normalizeOrderData(data) {
+ return Object.assign({
+ deliveryInfo: {},
+ goodsList: [],
+ mallRefundRecord: []
+ }, data || {}, {
+ deliveryInfo: (data && data.deliveryInfo) || {},
+ goodsList: (data && data.goodsList) || [],
+ mallRefundRecord: (data && data.mallRefundRecord) || []
+ });
+ },
+ getCurrentRefundRecord() {
+ const records = this.orderData.mallRefundRecord || [];
+ const pendingRecord = records.find((item) => item.status == 0 || item.status == 3);
+ return pendingRecord || this.refundActionData || this.orderData;
+ },
+ getRefundItems(item) {
+ if (item && item.items && item.items.length > 0) return item.items;
+ return [];
+ },
returnAmountAllow(item,status){
+ if (!item) {
+ this.$Message.warning("未找到退款/售后记录");
+ return;
+ }
let titleText = status == 1 ? '确定同意该申请吗?' : '确定拒绝该申请吗?';
//退款提示
@@ -199,16 +281,17 @@
});
},
processReturn(item,status){
+ if (!item) return;
let url = ''
//退款
- if(item.status == 7){
+ if(item.status == 7 || item.status == 0){
//不同意
if(status == 0){
this.returnFormData.status = 2
}else{
this.returnFormData.status = 1
}
- }else if(item.status == 11){
+ }else if(item.status == 11 || item.status == 3){
//售后
if(status == 0){
this.returnFormData.status = 5
@@ -216,11 +299,12 @@
this.returnFormData.status = 4
}
}
+ const order = item.mallOrder || this.orderData || {};
this.returnFormData.id = item.id;
this.returnFormData.linkId = item.linkId;
- this.returnFormData.orderId = item.orderId;
- this.returnFormData.deliveryType = item.mallOrder.deliveryType;
- this.returnFormData.orderType = item.mallOrder.orderType;
+ this.returnFormData.orderId = item.orderId || order.id;
+ this.returnFormData.deliveryType = order.deliveryType;
+ this.returnFormData.orderType = order.orderType;
this.returnFormData.refundAmount = item.refundAmount;
this.returnFormData.refundType = item.refundType;
this.returnFormData.refundTypeStatus = item.refundTypeStatus;
@@ -246,7 +330,73 @@
return diffMinutes;
},
canAdminRefundOrder() {
- return this.orderData.status != 6 && this.orderData.status != 8 && this.orderData.status != 12;
+ return this.orderData.status != 0 && this.orderData.status != 6 && this.orderData.status != 8 && this.orderData.status != 12;
+ },
+ formatSpecs(data) {
+ if (data == null || data === "") return "";
+ let str = typeof data === "object" ? JSON.stringify(data) : String(data);
+ return str.replace(/[{}"]/g, "");
+ },
+ getPictureList(pictures) {
+ if (pictures == null || pictures === "") return [];
+ if (Array.isArray(pictures)) {
+ return pictures.filter((item) => item != null && item !== "");
+ }
+ return String(pictures).split(",").map((item) => item.trim()).filter((item) => item !== "");
+ },
+ getRefundTypeText(item) {
+ if (!item) return "";
+ if (item.refundType == 1) return "退商品";
+ if (item.refundType == 2) return "退配送费";
+ return "全额退款";
+ },
+ getRefundTypeStatusText(item) {
+ if (!item) return "";
+ if (item.refundTypeStatus == 1) return "商家退款";
+ if (item.refundTypeStatus == 2) return "配送员退款";
+ if (item.refundTypeStatus == 3) {
+ return item.linkId && String(item.linkId).indexOf("W") != -1 ? "配送员退款" : "商家退款";
+ }
+ return "平台退款";
+ },
+ getRefundStatusText(status) {
+ if (status == 0) return "处理退款中";
+ if (status == 1) return "同意退款";
+ if (status == 2) return "拒绝退款";
+ if (status == 3) return "处理售后中";
+ if (status == 4) return "同意售后";
+ if (status == 5) return "拒绝售后";
+ return "";
+ },
+ getOrderStatusText(item) {
+ if (!item) return "";
+ if (item.status == 0) return "待支付";
+ if (item.status == 2) return item.shopDelivery == 1 ? "等待商家配送接单" : "等待配送员接单";
+ if (item.status == 3 && item.deliveryType == 1 && item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 && !item.deliveryInfo.transferArriveTime) return "等待商家送达中转点";
+ if (item.status == 3 && item.deliveryType == 1 && item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 && item.deliveryInfo.transferArriveTime) return "待配送员取货";
+ if (item.status == 3 && item.deliveryType == 1) return item.shopDelivery == 1 ? "商家配送已接单" : "配送员已接单";
+ if (item.status == 3 && item.deliveryType == 2) return "待消费";
+ if (item.status == 4 && item.deliveryType == 1) return item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 ? "中转配送中" : "配送员已取货";
+ if (item.status == 5) return "订单已完成";
+ if (item.status == 6) return "订单已取消";
+ if (item.status == 7) return "等待同意退款";
+ if (item.status == 8) return "订单已退款";
+ if (item.status == 11) return "售后中";
+ if (item.status == 12) return "订单已售后";
+ return "";
+ },
+ getAutoRefundTime(value) {
+ if (!value) return "";
+ const date = new Date(value);
+ if (isNaN(date.getTime())) return "";
+ date.setHours(date.getHours() + 1);
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, "0");
+ const day = String(date.getDate()).padStart(2, "0");
+ const hours = String(date.getHours()).padStart(2, "0");
+ const minutes = String(date.getMinutes()).padStart(2, "0");
+ const seconds = String(date.getSeconds()).padStart(2, "0");
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
adminRefundOrder() {
if (this.refundLoading || !this.orderData.id) return;
@@ -320,6 +470,63 @@
height: 30px px;
}
+ .goods-row,
+ .refund-goods-row {
+ display: flex;
+ align-items: center;
+ padding: 8px 0;
+ border-bottom: 1px solid #eee;
+ }
+
+ .goods-img {
+ width: 54px;
+ height: 54px;
+ margin-right: 10px;
+ border-radius: 4px;
+ object-fit: cover;
+ }
+
+ .goods-info {
+ flex: 2;
+ }
+
+ .goods-spec {
+ margin-top: 4px;
+ color: #999;
+ font-size: 12px;
+ }
+
+ .refund-card {
+ margin-top: 10px;
+ padding: 10px;
+ border: 1px solid #eee;
+ border-radius: 6px;
+ }
+
+ .refund-row {
+ display: flex;
+ padding: 6px 0;
+ border-bottom: 1px solid #f3f3f3;
+ }
+
+ .refund-row span:first-child {
+ width: 130px;
+ color: #777;
+ font-weight: 700;
+ }
+
+ .refund-row span:last-child {
+ flex: 1;
+ }
+
+ .refund-image {
+ width: 80px;
+ height: 80px;
+ margin-right: 8px;
+ border-radius: 4px;
+ object-fit: cover;
+ }
+
.text {
font-weight: bold;
color: #777;
diff --git a/src/views/sys/order-manage/orderManage.vue b/src/views/sys/order-manage/orderManage.vue
index 0dce3b4..4763897 100644
--- a/src/views/sys/order-manage/orderManage.vue
+++ b/src/views/sys/order-manage/orderManage.vue
@@ -287,6 +287,7 @@
selectList: [],
tabName: "1",
tabName1: "10",
+ statusTabOrder: ["10", "0", "1", "2", "13", "3", "4", "5", "6", "8", "9", "11", "12"],
orderTypeTabs: [{
label: "饭团订单",
name: "1"
@@ -409,6 +410,10 @@
}
],
deliveryStatusTabs: [{
+ label: "全部",
+ name: "10"
+ },
+ {
label: "待接单",
name: "3"
},
@@ -641,15 +646,6 @@
return h("span", this.getRefundStatusText(params.row.status));
}
},
- {
- title: "退款原因",
- key: "refundTypeStatus",
- width: 210,
- align: "center",
- render: (h, params) => {
- return h("span", this.getRefundTypeStatusText(params.row.refundTypeStatus));
- }
- },
{
title: "退款类型",
key: "refundType",
@@ -673,6 +669,15 @@
}, [h("span", params.row.reason || "无")]);
}
},
+ {
+ title: "退款责任方",
+ key: "refundTypeStatus",
+ width: 210,
+ align: "center",
+ render: (h, params) => {
+ return h("span", this.getRefundTypeStatusText(params.row.refundTypeStatus));
+ }
+ },
{
title: "原因图片",
key: "pictures",
@@ -865,10 +870,11 @@
return !e.hidden;
})
},
+ availableStatusTabs() {
+ return this.getStatusTabsByType(this.searchForm.searchType);
+ },
currentStatusTabs() {
- if (this.searchForm.searchType == "2") return this.deliveryStatusTabs;
- if (this.searchForm.searchType == "3" || this.searchForm.searchType == "4") return this.groupStatusTabs;
- return this.statusTabs;
+ return this.sortStatusTabs(this.availableStatusTabs);
},
currentColumns() {
if (this.isRefundTab) return this.refundColumns;
@@ -994,12 +1000,35 @@
return;
}
this.searchForm.searchType = v
- if (!this.currentStatusTabs.some((item) => item.name == this.tabName1)) {
- this.tabName1 = this.currentStatusTabs[0].name;
+ if (!this.availableStatusTabs.some((item) => item.name == this.tabName1)) {
+ this.tabName1 = this.getDefaultStatusTabName(v);
this.searchForm.searchStatus = this.tabName1;
}
this.getLogisticsInfo()
},
+ getStatusTabsByType(type) {
+ if (type == "2") return this.deliveryStatusTabs;
+ if (type == "3" || type == "4") return this.groupStatusTabs;
+ return this.statusTabs;
+ },
+ sortStatusTabs(tabs) {
+ return tabs.slice().sort((a, b) => {
+ const aIndex = this.statusTabOrder.indexOf(a.name);
+ const bIndex = this.statusTabOrder.indexOf(b.name);
+ return (aIndex == -1 ? Number.MAX_SAFE_INTEGER : aIndex) - (bIndex == -1 ? Number.MAX_SAFE_INTEGER : bIndex);
+ });
+ },
+ getDefaultStatusTabName(type) {
+ const defaultStatusMap = {
+ "2": "10",
+ "3": "10",
+ "4": "10"
+ };
+ const statusTabs = this.availableStatusTabs;
+ const defaultStatus = defaultStatusMap[type];
+ if (defaultStatus && statusTabs.some((item) => item.name == defaultStatus)) return defaultStatus;
+ return statusTabs[0].name;
+ },
checkStatus(v) {
this.searchForm.orderStatus = v
},
diff --git a/vue.config.js b/vue.config.js
index bad737b..cc370ea 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -8,7 +8,7 @@ module.exports = {
proxy: {
'/hiver': {
target: 'https://hbkuaishi.com', // 正式1
- // target: 'http://192.168.100.30:8888', // 本地
+ // target: 'http://192.168.100.34:8888', // 本地
ws: false
},
'/foo': {