feat: recycle system

This commit is contained in:
Timi
2026-11-12 16:51:57 +08:00
parent b1ba681042
commit 7e221e745a
90 changed files with 5981 additions and 3542 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import type { RouteRecordRaw } from "vue-router";
const chartRoutes: RouteRecordRaw[] = [
{
path: "/management/product-data-charts",
path: "/product/product-data-charts",
name: "ProductDataCharts",
component: () => import("@/pages/product/ProductDataCharts.vue"),
meta: {
@@ -13,7 +13,7 @@ const chartRoutes: RouteRecordRaw[] = [
}
},
{
path: "/management/order-data-charts",
path: "/product/order-data-charts",
name: "OrderDataCharts",
component: () => import("@/pages/product/OrderDataCharts.vue"),
meta: {
+4 -4
View File
@@ -6,25 +6,25 @@ function meta(depth = 3): RouteRecordRaw["meta"] {
export default [
{
path: "/management/order-fulfillments",
path: "/product/order-fulfillments",
name: "OrderFulfillmentList",
component: () => import("@/pages/fulfillment/OrderFulfillmentList.vue"),
meta: meta()
},
{
path: "/management/order-fulfillments/create",
path: "/product/order-fulfillments/create",
name: "OrderFulfillmentCreate",
component: () => import("@/pages/fulfillment/OrderFulfillmentCreate.vue"),
meta: meta(4)
},
{
path: "/management/order-fulfillments/quick",
path: "/product/order-fulfillments/quick",
name: "OrderFulfillmentQuick",
component: () => import("@/pages/fulfillment/OrderFulfillmentQuick.vue"),
meta: meta(4)
},
{
path: "/management/order-fulfillments/:id",
path: "/product/order-fulfillments/:id",
name: "OrderFulfillmentDetail",
component: () => import("@/pages/fulfillment/OrderFulfillmentDetail.vue"),
meta: meta(4)
+7 -7
View File
@@ -5,11 +5,11 @@ function pageMeta(depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
}
export default [
{ path: "/management/package-configs", name: "PackageConfigList", component: () => import("@/pages/package/PackageConfigList.vue"), meta: pageMeta() },
{ path: "/management/package-orders", name: "PackageOrderConfigList", component: () => import("@/pages/package/PackageOrderConfigList.vue"), meta: pageMeta() },
{ path: "/management/package-configs/create", name: "PackageConfigCreate", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta(4) },
{ path: "/management/package-configs/:id", name: "PackageConfigDetail", component: () => import("@/pages/package/PackageConfigDetail.vue"), meta: pageMeta(4) },
{ path: "/management/package-configs/:id/edit", name: "PackageConfigEdit", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta(5) },
{ path: "/management/package-configs/:id/purchase", name: "PackagePurchase", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta(5) },
{ path: "/management/customer-packages/create", name: "CustomerPackageCreate", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta(4) }
{ path: "/product/package-configs", name: "PackageConfigList", component: () => import("@/pages/package/PackageConfigList.vue"), meta: pageMeta() },
{ path: "/product/package-orders", name: "PackageOrderConfigList", component: () => import("@/pages/package/PackageOrderConfigList.vue"), meta: pageMeta() },
{ path: "/product/package-configs/create", name: "PackageConfigCreate", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta(4) },
{ path: "/product/package-configs/:id", name: "PackageConfigDetail", component: () => import("@/pages/package/PackageConfigDetail.vue"), meta: pageMeta(4) },
{ path: "/product/package-configs/:id/edit", name: "PackageConfigEdit", component: () => import("@/pages/package/PackageConfigEdit.vue"), meta: pageMeta(5) },
{ path: "/product/package-configs/:id/purchase", name: "PackagePurchase", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta(5) },
{ path: "/product/customer-packages/create", name: "CustomerPackageCreate", component: () => import("@/pages/package/PackagePurchase.vue"), meta: pageMeta(4) }
] as RouteRecordRaw[];
+6 -6
View File
@@ -2,27 +2,27 @@ import type { RouteRecordRaw } from "vue-router";
const pointRoutes: RouteRecordRaw[] = [
{
path: "/management/points/redeem-skus", name: "PointRedeemSkuList", component: () => import("@/pages/point/PointRedeemSkuList.vue"),
path: "/product/points/redeem-skus", name: "PointRedeemSkuList", component: () => import("@/pages/point/PointRedeemSkuList.vue"),
meta: { depth: 3, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
path: "/management/points/redeem-skus/create", name: "PointRedeemSkuCreate", component: () => import("@/pages/point/PointRedeemSkuEdit.vue"),
path: "/product/points/redeem-skus/create", name: "PointRedeemSkuCreate", component: () => import("@/pages/point/PointRedeemSkuEdit.vue"),
meta: { depth: 4, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
path: "/management/points/redeem-skus/:id/edit", name: "PointRedeemSkuEdit", component: () => import("@/pages/point/PointRedeemSkuEdit.vue"),
path: "/product/points/redeem-skus/:id/edit", name: "PointRedeemSkuEdit", component: () => import("@/pages/point/PointRedeemSkuEdit.vue"),
meta: { depth: 4, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
path: "/management/points/redemptions", name: "PointRedemptionList", component: () => import("@/pages/point/PointRedemptionList.vue"),
path: "/product/points/redemptions", name: "PointRedemptionList", component: () => import("@/pages/point/PointRedemptionList.vue"),
meta: { depth: 3, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
path: "/management/points/redemptions/create", name: "PointRedemptionCreate", component: () => import("@/pages/point/PointRedemptionCreate.vue"),
path: "/product/points/redemptions/create", name: "PointRedemptionCreate", component: () => import("@/pages/point/PointRedemptionCreate.vue"),
meta: { depth: 4, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
path: "/management/points/redemptions/:id", name: "PointRedemptionDetail", component: () => import("@/pages/point/PointRedemptionDetail.vue"),
path: "/product/points/redemptions/:id", name: "PointRedemptionDetail", component: () => import("@/pages/point/PointRedemptionDetail.vue"),
meta: { depth: 4, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" }
},
{
+19 -13
View File
@@ -11,79 +11,85 @@ function pageMeta(depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
const productRoutes: RouteRecordRaw[] = [
{
path: "/management/product-categories",
path: "/product/product-categories",
name: "ProductCategoryList",
component: () => import("@/pages/product/ProductCategoryList.vue"),
meta: pageMeta()
},
{
path: "/management/product-categories/rank",
path: "/product/product-categories/rank",
name: "ProductCategoryRank",
component: () => import("@/pages/product/ProductCategoryRank.vue"),
meta: pageMeta(4)
},
{
path: "/management/products",
path: "/product/products",
name: "ProductList",
component: () => import("@/pages/product/ProductList.vue"),
meta: pageMeta()
},
{
path: "/management/products/create",
path: "/product/products/create",
name: "ProductCreate",
component: () => import("@/pages/product/ProductEdit.vue"),
meta: pageMeta(4)
},
{
path: "/management/products/:id",
path: "/product/products/:id",
name: "ProductDetail",
component: () => import("@/pages/product/ProductDetail.vue"),
meta: pageMeta(4)
},
{
path: "/management/products/:id/edit",
path: "/product/products/:id/edit",
name: "ProductEdit",
component: () => import("@/pages/product/ProductEdit.vue"),
meta: pageMeta(5)
},
{
path: "/management/product-stocks",
path: "/product/products/:productId/skus/:skuId",
name: "ProductSkuDetail",
component: () => import("@/pages/product/ProductSkuDetail.vue"),
meta: pageMeta(5)
},
{
path: "/product/product-stocks",
name: "ProductStockList",
component: () => import("@/pages/product/ProductStockList.vue"),
meta: pageMeta()
},
{
path: "/management/product-stocks/:productId/skus",
path: "/product/product-stocks/:productId/skus",
name: "ProductStockSkuList",
component: () => import("@/pages/product/ProductStockSkuList.vue"),
meta: pageMeta(4)
},
{
path: "/management/product-stocks/batch/select",
path: "/product/product-stocks/batch/select",
name: "ProductStockBatchSelect",
component: () => import("@/pages/product/ProductStockBatchSelect.vue"),
meta: pageMeta(4)
},
{
path: "/management/product-stocks/batch/configure",
path: "/product/product-stocks/batch/configure",
name: "ProductStockBatchConfigure",
component: () => import("@/pages/product/ProductStockBatchConfigure.vue"),
meta: pageMeta(5)
},
{
path: "/management/product-stock-records",
path: "/product/product-stock-records",
name: "ProductStockRecordList",
component: () => import("@/pages/product/ProductStockRecordList.vue"),
meta: pageMeta()
},
{
path: "/management/product-stock-records/:id",
path: "/product/product-stock-records/:id",
name: "ProductStockRecordDetail",
component: () => import("@/pages/product/ProductStockRecordDetail.vue"),
meta: pageMeta(4)
},
{
path: "/management/product-stocks/:skuId",
path: "/product/product-stocks/:skuId",
name: "ProductStockDetail",
component: () => import("@/pages/product/ProductStockDetail.vue"),
meta: pageMeta(5)
+88 -17
View File
@@ -1,4 +1,7 @@
import type { RouteRecordRaw } from "vue-router";
import RecycleAPI from "@/api/RecycleAPI";
import { getErrorMessage } from "@/utils/error";
import { Message } from "@/utils/message";
function meta(depth = 3): RouteRecordRaw["meta"] {
return { depth, tabBarVisible: false, bodyBackground: "#F5F5F8", darkBodyBackground: "#10161f" };
@@ -6,61 +9,129 @@ function meta(depth = 3): RouteRecordRaw["meta"] {
export default [
{
path: "/management/recycle-exchanges",
name: "RecycleExchangeList",
component: () => import("@/pages/recycle/RecycleExchangeList.vue"),
path: "/product/recycle-payments",
name: "RecyclePaymentAll",
component: () => import("@/pages/recycle/RecyclePaymentList.vue"),
meta: meta()
},
{
path: "/management/recycle-exchanges/create",
path: "/product/recycle-exchanges",
name: "RecycleExchangeList",
redirect: to => {
const detail = typeof to.query.detail === "string" ? to.query.detail : "";
if (detail) {
return { name: "RecycleExchangeDetail", params: { id: detail } };
}
return { name: "SalesOrderList", query: { orderType: "RECYCLE", customerId: to.query.customerId } };
},
meta: meta()
},
{
path: "/product/recycle-exchanges/create",
name: "RecycleExchangeCreate",
component: () => import("@/pages/recycle/RecycleExchangeCreate.vue"),
meta: meta(4)
},
{
path: "/management/recycle-exchanges/:id",
path: "/product/recycle-exchanges/:id/payments/create",
name: "RecyclePaymentCreate",
component: () => import("@/pages/recycle/RecyclePaymentCreate.vue"),
meta: meta(6)
},
{
path: "/product/recycle-exchanges/:id/payments/:paymentId/revoke",
name: "RecyclePaymentRevoke",
component: () => import("@/pages/recycle/RecyclePaymentRevoke.vue"),
meta: meta(7)
},
{
path: "/product/recycle-exchanges/:id/payments/:paymentId",
name: "RecyclePaymentDetail",
component: () => import("@/pages/recycle/RecyclePaymentDetail.vue"),
meta: meta(6)
},
{
path: "/product/recycle-exchanges/:id/payments",
name: "RecyclePaymentList",
component: () => import("@/pages/recycle/RecyclePaymentList.vue"),
meta: meta(5)
},
{
// 兑换单详情已并入交易订单详情,这里保留旧路径与名称,按销售订单 ID 转发
path: "/product/recycle-exchanges/:id",
name: "RecycleExchangeDetail",
component: () => import("@/pages/recycle/RecycleExchangeDetail.vue"),
beforeEnter: async to => {
const id = String(to.params.id || "");
if (id) {
try {
const result = await RecycleAPI.detail(id);
if (result.exchange?.salesOrderId) {
return { name: "SalesOrderDetail", params: { id: result.exchange.salesOrderId }, replace: true };
}
} catch (error) {
Message.error(getErrorMessage(error, "兑换单加载失败"));
}
}
return { name: "SalesOrderList", query: { orderType: "RECYCLE" }, replace: true };
},
meta: meta(4)
},
{
path: "/management/recycle-items",
path: "/management/recycle-accounts",
name: "RecycleAccount",
component: () => import("@/pages/recycle/RecycleAccount.vue"),
meta: meta()
},
{
path: "/product/recycle-items",
name: "RecycleItemList",
component: () => import("@/pages/recycle/RecycleItemList.vue"),
meta: meta()
},
{
path: "/management/recycle-items/create",
path: "/product/recycle-items/create",
name: "RecycleItemCreate",
component: () => import("@/pages/recycle/RecycleItemEdit.vue"),
meta: meta(4)
},
{
path: "/management/recycle-items/:id",
name: "RecycleItemEdit",
component: () => import("@/pages/recycle/RecycleItemEdit.vue"),
path: "/product/recycle-items/:id",
name: "RecycleItemDetail",
component: () => import("@/pages/recycle/RecycleItemDetail.vue"),
meta: meta(4)
},
{
path: "/management/recycle-rules",
path: "/product/recycle-items/:id/edit",
name: "RecycleItemEdit",
component: () => import("@/pages/recycle/RecycleItemEdit.vue"),
meta: meta(5)
},
{
path: "/product/recycle-rules",
name: "RecycleRuleList",
component: () => import("@/pages/recycle/RecycleRuleList.vue"),
meta: meta()
},
{
path: "/management/recycle-rules/create",
path: "/product/recycle-rules/create",
name: "RecycleRuleCreate",
component: () => import("@/pages/recycle/RecycleRuleEdit.vue"),
meta: meta(4)
},
{
path: "/management/recycle-rules/:id",
name: "RecycleRuleEdit",
component: () => import("@/pages/recycle/RecycleRuleEdit.vue"),
path: "/product/recycle-rules/:id",
name: "RecycleRuleDetail",
component: () => import("@/pages/recycle/RecycleRuleDetail.vue"),
meta: meta(4)
},
{
path: "/management/recycle-stats",
path: "/product/recycle-rules/:id/edit",
name: "RecycleRuleEdit",
component: () => import("@/pages/recycle/RecycleRuleEdit.vue"),
meta: meta(5)
},
{
path: "/product/recycle-stats",
name: "RecycleStat",
component: () => import("@/pages/recycle/RecycleStat.vue"),
meta: meta()
+11 -11
View File
@@ -5,53 +5,53 @@ function meta(depth = 3, background = "#F5F5F8"): RouteRecordRaw["meta"] {
}
export default [
{ path: "/management/sales-orders", name: "SalesOrderList", component: () => import("@/pages/salesOrder/SalesOrderList.vue"), meta: meta() },
{ path: "/management/consumption-records", name: "ConsumptionRecordList", component: () => import("@/pages/salesOrder/ConsumptionRecordList.vue"), meta: meta() },
{ path: "/product/sales-orders", name: "SalesOrderList", component: () => import("@/pages/salesOrder/SalesOrderList.vue"), meta: meta() },
{ path: "/product/consumption-records", name: "ConsumptionRecordList", component: () => import("@/pages/salesOrder/ConsumptionRecordList.vue"), meta: meta() },
{
path: "/management/sales-orders/create",
path: "/product/sales-orders/create",
name: "SalesOrderCreate",
component: () => import("@/pages/salesOrder/SalesOrderCreate.vue"),
meta: meta(4)
},
{
path: "/management/sales-orders/:id",
path: "/product/sales-orders/:id",
name: "SalesOrderDetail",
component: () => import("@/pages/salesOrder/SalesOrderDetail.vue"),
meta: meta(4)
},
{
path: "/management/sales-orders/:id/payment",
path: "/product/sales-orders/:id/payment",
name: "SalesOrderPayment",
component: () => import("@/pages/salesOrder/SalesOrderPayment.vue"),
meta: meta(5)
},
{
path: "/management/sales-orders/:id/refund",
path: "/product/sales-orders/:id/refund",
name: "SalesOrderRefund",
component: () => import("@/pages/salesOrder/SalesOrderRefund.vue"),
meta: meta(5)
},
{
path: "/management/sales-orders/:id/no-refund",
path: "/product/sales-orders/:id/no-refund",
name: "SalesOrderNoRefund",
component: () => import("@/pages/salesOrder/SalesOrderNoRefund.vue"),
meta: meta(5)
},
{
path: "/management/sales-orders/:id/cancel",
path: "/product/sales-orders/:id/cancel",
name: "SalesOrderCancel",
component: () => import("@/pages/salesOrder/SalesOrderCancel.vue"),
meta: meta(5)
},
{ path: "/management/fund-records", name: "FundRecordList", component: () => import("@/pages/salesOrder/FundRecordList.vue"), meta: meta() },
{ path: "/product/fund-records", name: "FundRecordList", component: () => import("@/pages/salesOrder/FundRecordList.vue"), meta: meta() },
{
path: "/management/fund-records/:id",
path: "/product/fund-records/:id",
name: "FundRecordDetail",
component: () => import("@/pages/salesOrder/FundRecordDetail.vue"),
meta: meta(4)
},
{
path: "/management/fund-records/:id/revoke",
path: "/product/fund-records/:id/revoke",
name: "FundRecordRevoke",
component: () => import("@/pages/salesOrder/FundRecordRevoke.vue"),
meta: meta(5)