diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/CompanyOverviewQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/CompanyOverviewQueryDTO.java index 5cceb3ed..baad6912 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/CompanyOverviewQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/CompanyOverviewQueryDTO.java @@ -3,6 +3,7 @@ package top.xyquan.ecomdmbbackend.modules.ecom.overview.model.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.math.BigDecimal; @@ -13,6 +14,7 @@ import java.util.List; * 全店铺概览查询DTO */ @Data +@JsonIgnoreProperties(ignoreUnknown = true) @Schema(description = "全店铺概览查询DTO") public class CompanyOverviewQueryDTO { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/ShopOverviewQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/ShopOverviewQueryDTO.java index cc81fede..b6c6bd0e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/ShopOverviewQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/dto/ShopOverviewQueryDTO.java @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.math.BigDecimal; @@ -14,6 +15,7 @@ import java.util.List; * 单店铺概览查询DTO */ @Data +@JsonIgnoreProperties(ignoreUnknown = true) @Schema(description = "单店铺概览查询DTO") public class ShopOverviewQueryDTO { diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue index 911c0bd9..570cd1cf 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue @@ -50,12 +50,13 @@ const dateRange = ref<[dayjs.Dayjs, dayjs.Dayjs]>([ dayjs(), ]); -// 税率(持久化) -const TAX_RATE_KEY = 'company-overview-tax-rate'; +// 税率(公司/店铺概览共用持久化) +const TAX_RATE_KEY = 'overview-tax-rate'; const taxRate = ref(0.04); taxRate.value = Number(localStorage.getItem(TAX_RATE_KEY)) || 0.04; watch(taxRate, (val) => { localStorage.setItem(TAX_RATE_KEY, String(val)); + loadOverviewData(); }); // 当前选中的时间范围类型 @@ -591,72 +592,10 @@ const handleExportSelectedShops = async () => { @@ -797,7 +796,7 @@ const handleExportSelectedShops = async () => { v-if="overviewData?.totalTaxAmount !== undefined" class="mt-6 flex justify-between border-t border-slate-100 pt-4 text-[11px] font-bold text-slate-400" > - 已扣除预扣税额 (4%) + 已扣除预扣税额 ({{ (taxRate * 100).toFixed(0) }}%) {{ formatAmount(overviewData.totalTaxAmount) }} @@ -998,7 +997,7 @@ const handleExportSelectedShops = async () => { 税前盈亏 - 4%税额 + {{ (taxRate * 100).toFixed(0) }}%税额 ROI diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue index fa564857..5c08da75 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue @@ -62,11 +62,12 @@ const lastRequestKey = ref(''); const isSyncingRouteQuery = ref(false); // 税率(持久化) -const TAX_RATE_KEY = 'shop-overview-tax-rate'; +const TAX_RATE_KEY = 'overview-tax-rate'; const taxRate = ref(0.04); taxRate.value = Number(localStorage.getItem(TAX_RATE_KEY)) || 0.04; watch(taxRate, (val) => { localStorage.setItem(TAX_RATE_KEY, String(val)); + loadOverviewData(); }); // 切换时间范围 @@ -718,70 +719,10 @@ onActivated(async () => { @@ -947,7 +946,7 @@ onActivated(async () => { v-if="overviewData?.totalTaxAmount !== undefined" class="mt-6 flex justify-between border-t border-slate-100 pt-4 text-[11px] font-bold text-slate-400" > - 已扣除 4% 税额 + 已扣除 {{ (taxRate * 100).toFixed(0) }}% 税额 -{{ formatAmount(overviewData.totalTaxAmount) }} @@ -1012,7 +1011,7 @@ onActivated(async () => {
- 销售额 4% 税额 + 销售额 {{ (taxRate * 100).toFixed(0) }}% 税额 {{ overviewData?.totalTaxAmount @@ -1122,7 +1121,7 @@ onActivated(async () => { 单品 ROI 税前盈亏 - 4%税额 + {{ (taxRate * 100).toFixed(0) }}%税额