|
@@ -156,9 +156,9 @@ export function useOrder(tableRef: Ref) {
|
|
|
minWidth: 85,
|
|
minWidth: 85,
|
|
|
cellRenderer: ({ row }) => {
|
|
cellRenderer: ({ row }) => {
|
|
|
const statusMap: Record<number, { text: string; type: string }> = {
|
|
const statusMap: Record<number, { text: string; type: string }> = {
|
|
|
- 0: { text: "已取消", type: "info" },
|
|
|
|
|
- 1: { text: "待支付", type: "warning" },
|
|
|
|
|
- 2: { text: "已完成", type: "success" },
|
|
|
|
|
|
|
+ 0: { text: "待支付", type: "warning" },
|
|
|
|
|
+ 1: { text: "已完成", type: "success" },
|
|
|
|
|
+ 2: { text: "已取消", type: "info" },
|
|
|
3: { text: "已关闭", type: "info" }
|
|
3: { text: "已关闭", type: "info" }
|
|
|
};
|
|
};
|
|
|
const status = statusMap[row.status] || { text: "未知", type: "info" };
|
|
const status = statusMap[row.status] || { text: "未知", type: "info" };
|
|
@@ -267,11 +267,10 @@ export function useOrder(tableRef: Ref) {
|
|
|
? "danger" : "warning";
|
|
? "danger" : "warning";
|
|
|
const payStatusText = order.payStatusLabel || (order.payStatus === "PAID" ? "已支付" : order.payStatus === "REFUND" ? "已退款" : "待支付");
|
|
const payStatusText = order.payStatusLabel || (order.payStatus === "PAID" ? "已支付" : order.payStatus === "REFUND" ? "已退款" : "待支付");
|
|
|
|
|
|
|
|
- const statusStyle = order.status === 2
|
|
|
|
|
|
|
+ const statusStyle = order.status === 1
|
|
|
? "success" : order.status === 0
|
|
? "success" : order.status === 0
|
|
|
- ? "info" : order.status === 3
|
|
|
|
|
- ? "info" : "warning";
|
|
|
|
|
- const statusText = order.statusText || (order.status === 0 ? "已取消" : order.status === 1 ? "待支付" : order.status === 2 ? "已完成" : "已关闭");
|
|
|
|
|
|
|
+ ? "warning" : "info";
|
|
|
|
|
+ const statusText = order.statusText || (order.status === 0 ? "待支付" : order.status === 1 ? "已完成" : order.status === 2 ? "已取消" : "已关闭");
|
|
|
|
|
|
|
|
const payTypeMap: Record<string, { text: string; type: string }> = {
|
|
const payTypeMap: Record<string, { text: string; type: string }> = {
|
|
|
"wechat": { text: "微信支付", type: "success" },
|
|
"wechat": { text: "微信支付", type: "success" },
|
|
@@ -398,7 +397,7 @@ export function useOrder(tableRef: Ref) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function handleRefund(row: OrderItem) {
|
|
async function handleRefund(row: OrderItem) {
|
|
|
- if (row.status !== 2) {
|
|
|
|
|
|
|
+ if (row.status !== 1) {
|
|
|
message("只有已完成的订单才能退款", { type: "warning" });
|
|
message("只有已完成的订单才能退款", { type: "warning" });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|