diff --git a/core/api/src/main/java/com/wansenai/api/RetailController.java b/core/api/src/main/java/com/wansenai/api/RetailController.java index caa5f5ea..c8d09487 100644 --- a/core/api/src/main/java/com/wansenai/api/RetailController.java +++ b/core/api/src/main/java/com/wansenai/api/RetailController.java @@ -15,7 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.wansenai.dto.receipt.QueryShipmentsDTO; import com.wansenai.dto.receipt.RetailShipmentsDTO; -import com.wansenai.service.receipt.RetailService; +import com.wansenai.service.receipt.ReceiptService; import com.wansenai.utils.response.Response; import com.wansenai.vo.receipt.RetailShipmentsDetailVO; import com.wansenai.vo.receipt.RetailShipmentsVO; @@ -27,34 +27,34 @@ @RequestMapping("/retail") public class RetailController { - private final RetailService retailService; + private final ReceiptService receiptService; - public RetailController(RetailService retailService) { - this.retailService = retailService; + public RetailController(ReceiptService receiptService) { + this.receiptService = receiptService; } @PostMapping("/shipments/pageList") public Response> pageList(@RequestBody QueryShipmentsDTO queryShipmentsDTO) { - return retailService.getRetailShipments(queryShipmentsDTO); + return receiptService.getRetailShipments(queryShipmentsDTO); } @PostMapping("/shipments/addOrUpdate") public Response addOrUpdate(@RequestBody RetailShipmentsDTO retailShipmentsDTO) { - return retailService.addOrUpdateRetailShipments(retailShipmentsDTO); + return receiptService.addOrUpdateRetailShipments(retailShipmentsDTO); } @PostMapping("/shipments/deleteByIds") public Response deleteByIds(@RequestParam("ids") List ids) { - return retailService.deleteRetailShipments(ids); + return receiptService.deleteRetailShipments(ids); } @PutMapping("/shipments/updateStatus") public Response updateStatus(@RequestParam("ids") List ids, @RequestParam("status") Integer status) { - return retailService.updateRetailShipmentsStatus(ids, status); + return receiptService.updateRetailShipmentsStatus(ids, status); } @GetMapping("/shipments/detail/{id}") public Response detail(@PathVariable("id") Long id) { - return retailService.getRetailShipmentsDetail(id); + return receiptService.getRetailShipmentsDetail(id); } } diff --git a/core/api/src/main/java/com/wansenai/api/report/ReportController.java b/core/api/src/main/java/com/wansenai/api/report/ReportController.java new file mode 100644 index 00000000..ead88fc6 --- /dev/null +++ b/core/api/src/main/java/com/wansenai/api/report/ReportController.java @@ -0,0 +1,36 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.api.report; + +import com.wansenai.service.receipt.ReceiptService; +import com.wansenai.utils.response.Response; +import com.wansenai.vo.receipt.RetailStatisticalDataVO; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/report") +public class ReportController { + + private final ReceiptService receiptService; + + public ReportController(ReceiptService receiptService) { + this.receiptService = receiptService; + } + + @GetMapping("homePage/statistics") + public Response getStatisticalData() { + return receiptService.getRetailStatistics(); + } +} diff --git a/core/dao/src/main/resources/mapper_xml/WarehouseMapper.xml b/core/dao/src/main/resources/mapper_xml/ReceiptService.xml similarity index 71% rename from core/dao/src/main/resources/mapper_xml/WarehouseMapper.xml rename to core/dao/src/main/resources/mapper_xml/ReceiptService.xml index 2566d483..71ff3462 100644 --- a/core/dao/src/main/resources/mapper_xml/WarehouseMapper.xml +++ b/core/dao/src/main/resources/mapper_xml/ReceiptService.xml @@ -1,5 +1,5 @@ - + diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/RetailStatisticalDataVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/RetailStatisticalDataVO.java new file mode 100644 index 00000000..9208c5b7 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/RetailStatisticalDataVO.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.receipt; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RetailStatisticalDataVO { + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal todaySales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yesterdaySales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal todayRetailSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yesterdayRetailSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal todayPurchase; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yesterdayPurchase; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal monthSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal monthRetailSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal monthPurchase; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yearSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yearRetailSales; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal yearPurchase; +} diff --git a/core/domain/src/main/kotlin/com/wansenai/bo/BigDecimalSerializerBO.kt b/core/domain/src/main/kotlin/com/wansenai/bo/BigDecimalSerializerBO.kt index b83faa3f..1b09148e 100644 --- a/core/domain/src/main/kotlin/com/wansenai/bo/BigDecimalSerializerBO.kt +++ b/core/domain/src/main/kotlin/com/wansenai/bo/BigDecimalSerializerBO.kt @@ -21,7 +21,7 @@ import java.math.RoundingMode class BigDecimalSerializerBO : JsonSerializer() { override fun serialize(value: BigDecimal?, gen: JsonGenerator, serializers: SerializerProvider) { if (value != null) { - val scaledValue = value.setScale(3, RoundingMode.HALF_UP) + val scaledValue = value.setScale(2, RoundingMode.HALF_UP) if (scaledValue.stripTrailingZeros().scale() <= 0) { gen.writeNumber(scaledValue.toBigInteger()) } else { diff --git a/core/service/src/main/java/com/wansenai/service/receipt/RetailService.java b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptService.java similarity index 87% rename from core/service/src/main/java/com/wansenai/service/receipt/RetailService.java rename to core/service/src/main/java/com/wansenai/service/receipt/ReceiptService.java index 0bd36764..fe4a6a8b 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/RetailService.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptService.java @@ -20,10 +20,11 @@ import com.wansenai.utils.response.Response; import com.wansenai.vo.receipt.RetailShipmentsVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wansenai.vo.receipt.RetailStatisticalDataVO; import java.util.List; -public interface RetailService extends IService { +public interface ReceiptService extends IService { /** * Query retail shipment orders with pagination. @@ -83,4 +84,14 @@ public interface RetailService extends IService { */ Response updateRetailShipmentsStatus(List ids, Integer status); + + /** + * Query the data summary of the six columns on the tenant's homepage. + *

+ * 根据id集合和状态批量修改零售出库单状态 + * + * @return Return to homepage data summary + * 返回首页数据汇总 + */ + Response getRetailStatistics(); } diff --git a/core/service/src/main/java/com/wansenai/service/receipt/impl/RetailServiceImpl.java b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptServiceImpl.java similarity index 79% rename from core/service/src/main/java/com/wansenai/service/receipt/impl/RetailServiceImpl.java rename to core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptServiceImpl.java index 038f9e89..f7d7f2eb 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/impl/RetailServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptServiceImpl.java @@ -7,18 +7,15 @@ import com.wansenai.bo.ShipmentsDataBO; import com.wansenai.dto.receipt.QueryShipmentsDTO; import com.wansenai.dto.receipt.RetailShipmentsDTO; -import com.wansenai.entities.product.ProductStock; -import com.wansenai.entities.product.ProductStockKeepUnit; import com.wansenai.entities.receipt.ReceiptMain; import com.wansenai.entities.receipt.ReceiptSub; import com.wansenai.entities.system.SysFile; import com.wansenai.mappers.product.ProductStockKeepUnitMapper; -import com.wansenai.mappers.product.ProductStockMapper; import com.wansenai.mappers.receipt.ReceiptMainMapper; import com.wansenai.mappers.system.SysFileMapper; import com.wansenai.service.basic.MemberService; import com.wansenai.service.receipt.ReceiptSubService; -import com.wansenai.service.receipt.RetailService; +import com.wansenai.service.receipt.ReceiptService; import com.wansenai.service.user.ISysUserService; import com.wansenai.utils.SnowflakeIdUtil; import com.wansenai.utils.constants.CommonConstants; @@ -27,12 +24,19 @@ import com.wansenai.utils.response.Response; import com.wansenai.vo.receipt.RetailShipmentsDetailVO; import com.wansenai.vo.receipt.RetailShipmentsVO; +import com.wansenai.vo.receipt.RetailStatisticalDataVO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalAdjusters; +import java.time.temporal.TemporalUnit; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -40,7 +44,7 @@ @Service @Slf4j -public class RetailServiceImpl extends ServiceImpl implements RetailService { +public class ReceiptServiceImpl extends ServiceImpl implements ReceiptService { private final ReceiptMainMapper receiptMainMapper; @@ -54,7 +58,7 @@ public class RetailServiceImpl extends ServiceImpl updateRetailShipmentsStatus(List ids, Integer stat return Response.responseMsg(RetailCodeEnum.UPDATE_RETAIL_SHIPMENTS_ERROR); } } + + @Override + public Response getRetailStatistics() { + var now = LocalDateTime.now(); + + var retailData = lambdaQuery() + .eq(ReceiptMain::getType, "出库") + .in(ReceiptMain::getSubType, "零售出库") + .eq(ReceiptMain::getStatus, 1) + .eq(ReceiptMain::getDeleteFlag, 0) + .list(); + + var salesData = lambdaQuery() + .eq(ReceiptMain::getType, "出库") + .in(ReceiptMain::getSubType, "销售出库") + .eq(ReceiptMain::getStatus, 1) + .eq(ReceiptMain::getDeleteFlag, 0) + .list(); + + var purchaseData = lambdaQuery() + .eq(ReceiptMain::getType, "入库") + .eq(ReceiptMain::getSubType, "采购入库") + .eq(ReceiptMain::getStatus, 1) + .eq(ReceiptMain::getDeleteFlag, 0) + .list(); + + var todayRetailSales = calculateTotalPrice(retailData, now.with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yesterdayRetailSales = calculateTotalPrice(retailData, now.minusDays(1).with(LocalTime.MIN), now.minusDays(1).with(LocalTime.MAX)); + var monthRetailSales = calculateTotalPrice(retailData, now.withDayOfMonth(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yearRetailSales = calculateTotalPrice(retailData, now.withDayOfYear(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + + var todaySales = calculateTotalPrice(salesData, now.with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yesterdaySales = calculateTotalPrice(salesData, now.minusDays(1).with(LocalTime.MIN), now.minusDays(1).with(LocalTime.MAX)); + var monthSales = calculateTotalPrice(salesData, now.withDayOfMonth(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yearSales = calculateTotalPrice(salesData, now.withDayOfYear(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + + var todayPurchase = calculateTotalPrice(purchaseData, now.with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yesterdayPurchase = calculateTotalPrice(purchaseData, now.minusDays(1).with(LocalTime.MIN), now.minusDays(1).with(LocalTime.MAX)); + var monthPurchase = calculateTotalPrice(purchaseData, now.withDayOfMonth(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + var yearPurchase = calculateTotalPrice(purchaseData, now.withDayOfYear(1).with(LocalTime.MIN), now.with(LocalTime.MAX)); + + var retailStatisticalDataVO = RetailStatisticalDataVO.builder() + .todayRetailSales(todayRetailSales) + .yesterdayRetailSales(yesterdayRetailSales) + .monthRetailSales(monthRetailSales) + .yearRetailSales(yearRetailSales) + + .todaySales(todaySales) + .yesterdaySales(yesterdaySales) + .monthSales(monthSales) + .yearSales(yearSales) + + .todayPurchase(todayPurchase) + .yesterdayPurchase(yesterdayPurchase) + .monthPurchase(monthPurchase) + .yearPurchase(yearPurchase) + .build(); + + return Response.responseData(retailStatisticalDataVO); + } + + private BigDecimal calculateTotalPrice(List data, LocalDateTime start, LocalDateTime end) { + return data.stream() + .filter(item -> item.getCreateTime().isAfter(start) && item.getCreateTime().isBefore(end)) + .map(ReceiptMain::getTotalPrice) + .reduce(BigDecimal.ZERO, BigDecimal::add) + .setScale(2, RoundingMode.HALF_UP); + } + } diff --git a/web/src/api/report/report.ts b/web/src/api/report/report.ts new file mode 100644 index 00000000..a5326727 --- /dev/null +++ b/web/src/api/report/report.ts @@ -0,0 +1,16 @@ +import {defHttp} from '/@/utils/http/axios'; +import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; +import {reportModel} from "@/api/report/model/reportModel"; + +enum API { + getStatisticalData = '/report/homePage/statistics' +} + + +export function getStatistical() { + return defHttp.get>( + { + url: API.getStatisticalData, + }, + ); +} \ No newline at end of file diff --git a/web/src/api/report/reportModel.ts b/web/src/api/report/reportModel.ts new file mode 100644 index 00000000..944b5c59 --- /dev/null +++ b/web/src/api/report/reportModel.ts @@ -0,0 +1,14 @@ +export interface RetailStatisticalResp { + todaySales: number; + yesterdaySales: number; + todayRetailSales: number; + yesterdayRetailSales: number; + todayPurchase: number; + yesterdayPurchase: number; + monthSales: number; + monthRetailSales: number; + monthPurchase: number; + yearSales: number; + yearRetailSales: number; + yearPurchase: number; +} \ No newline at end of file diff --git a/web/src/components/VxeTable/src/css/component.scss b/web/src/components/VxeTable/src/css/component.scss index 12b46154..a9f7ba2f 100644 --- a/web/src/components/VxeTable/src/css/component.scss +++ b/web/src/components/VxeTable/src/css/component.scss @@ -52,7 +52,6 @@ & > .ant-input-number, & > .ant-cascader-picker .ant-cascader-input, & > .ant-calendar-picker .ant-calendar-picker-input { - // border-color: $vxe-table-validate-error-color; box-shadow: none; } } @@ -121,4 +120,4 @@ } } } -} +} \ No newline at end of file diff --git a/web/src/components/VxeTable/src/css/index.scss b/web/src/components/VxeTable/src/css/index.scss index 6023205c..7f34cabb 100644 --- a/web/src/components/VxeTable/src/css/index.scss +++ b/web/src/components/VxeTable/src/css/index.scss @@ -1,6 +1,5 @@ @import './common'; @import './variable'; -@import './scrollbar'; @import './toolbar'; @import './component'; -@import 'vxe-table/styles/index'; +@import 'vxe-table/styles/index'; \ No newline at end of file diff --git a/web/src/components/VxeTable/src/css/scrollbar.scss b/web/src/components/VxeTable/src/css/scrollbar.scss index beea2d71..4464aa2d 100644 --- a/web/src/components/VxeTable/src/css/scrollbar.scss +++ b/web/src/components/VxeTable/src/css/scrollbar.scss @@ -26,4 +26,4 @@ ::-webkit-scrollbar-corner { background-color: #fff; } -} +} \ No newline at end of file diff --git a/web/src/components/VxeTable/src/css/toolbar.scss b/web/src/components/VxeTable/src/css/toolbar.scss index 8b30e3ae..4a8897b5 100644 --- a/web/src/components/VxeTable/src/css/toolbar.scss +++ b/web/src/components/VxeTable/src/css/toolbar.scss @@ -10,7 +10,7 @@ .vxe-toolbar .vxe-tools--wrapper, .vxe-toolbar .vxe-tools--operate .vxe-button { - margin-left: 1px; + margin-left: 10px; border-radius: 0 !important; } @@ -22,5 +22,5 @@ .vxe-toolbar .vxe-tools--wrapper, .vxe-toolbar .vxe-tools--operate .vxe-custom--wrapper .vxe-button { - margin-left: 1px; -} + margin-left: 10px; +} \ No newline at end of file diff --git a/web/src/components/VxeTable/src/css/variable.scss b/web/src/components/VxeTable/src/css/variable.scss index eedcf8b4..56bf2139 100644 --- a/web/src/components/VxeTable/src/css/variable.scss +++ b/web/src/components/VxeTable/src/css/variable.scss @@ -1,6 +1,54 @@ -$vxe-primary-color: rgb(9 96 189) !default; -$vxe-table-row-current-background-color: rgb(9 96 189 / 30%); -$vxe-table-row-hover-current-background-color: rgb(9 96 189 / 20%); -$vxe-table-column-hover-background-color: rgb(9 96 189 / 30%); -$vxe-table-column-current-background-color: rgb(9 96 189 / 20%); -$vxe-table-validate-error-color: #f56c6c; +/* stylelint-disable scss/no-global-function-names */ +html[data-theme='dark'] { + // $bg-color: #151515; + // $tooltip-bg-color: #303133; + // $text-color: #c9d1d9; + // $border-color: #303030; + // $selected-bg-color: #1e1e1e; + // $striped-bg-color: #1e1e1e; + + --vxe-form-background-color: #151515; + --vxe-toolbar-background-color: #151515; + --vxe-pager-background-color: #151515; + --vxe-button-default-background-color: lighten(#151515, 15%); + --vxe-table-header-background-color: lighten(#151515, 5%); + --vxe-font-color: darken(#c9d1d9, 12%); + --vxe-table-header-font-color: #c9d1d9; + --vxe-table-footer-font-color: #c9d1d9; + --vxe-table-body-background-color: #151515; + --vxe-table-footer-background-color: #151515; + --vxe-table-row-striped-background-color: #1e1e1e; + --vxe-table-border-color: #303030; + --vxe-table-row-hover-background-color: #1e1e1e; + --vxe-table-row-hover-striped-background-color: darken(#1e1e1e, 10%); + --vxe-table-row-current-background-color: fade(#1e1e1e, 20%); + --vxe-table-row-hover-current-background-color: fade(#1e1e1e, 20%); + --vxe-table-column-hover-background-color: fade(#1e1e1e, 20%); + --vxe-table-column-current-background-color: fade(#1e1e1e, 20%); + --vxe-table-row-checkbox-checked-background-color: fade(#1e1e1e, 15%); + --vxe-table-row-hover-checkbox-checked-background-color: fade(#1e1e1e, 20%); + --vxe-table-menu-background-color: lighten(#303133, 10%); + --vxe-table-filter-panel-background-color: lighten(#151515, 5%); + --vxe-grid-maximize-background-color: #151515; + --vxe-pager-perfect-background-color: #151515; + --vxe-pager-perfect-button-background-color: lighten(#151515, 15%); + --vxe-input-background-color: #151515; + --vxe-input-border-color: #303030; + --vxe-select-panel-background-color: #151515; + --vxe-table-popup-border-color: #303030; + --vxe-select-option-hover-background-color: lighten(#1e1e1e, 15%); + --vxe-pulldown-panel-background-color: #151515; + --vxe-table-fixed-left-scrolling-box-shadow: 8px 0px 10px -5px rgb(255 255 255 / 12%); + --vxe-table-fixed-right-scrolling-box-shadow: -8px 0px 10px -5px rgb(255 255 255 / 12%); + --vxe-loading-background-color: rgb(0 0 0 / 50%); + --vxe-tooltip-dark-background-color: lighten(#303133, 25%); + --vxe-modal-header-background-color: #1e1e1e; + --vxe-modal-body-background-color: #303133; + --vxe-modal-border-color: #303030; + --vxe-toolbar-panel-background-color: #151515; + --vxe-input-disabled-color: lighten(#1e1e1e, 20%); + --vxe-input-disabled-background-color: lighten(#1e1e1e, 25%); + --vxe-checkbox-icon-background-color: lighten(#1e1e1e, 15%); + --vxe-checkbox-checked-icon-border-color: #303030; + --vxe-checkbox-indeterminate-icon-background-color: lighten(#1e1e1e, 15%); +} \ No newline at end of file diff --git a/web/src/views/dashboard/analysis/components/GrowCard.vue b/web/src/views/dashboard/analysis/components/GrowCard.vue index cda9cb46..a8f7f58e 100644 --- a/web/src/views/dashboard/analysis/components/GrowCard.vue +++ b/web/src/views/dashboard/analysis/components/GrowCard.vue @@ -13,13 +13,13 @@

- +
总{{ item.title }} - +
diff --git a/web/src/views/dashboard/analysis/components/GrowCardFour.vue b/web/src/views/dashboard/analysis/components/GrowCardFour.vue new file mode 100644 index 00000000..0b516216 --- /dev/null +++ b/web/src/views/dashboard/analysis/components/GrowCardFour.vue @@ -0,0 +1,39 @@ + + diff --git a/web/src/views/dashboard/analysis/components/GrowCardThree.vue b/web/src/views/dashboard/analysis/components/GrowCardThree.vue index a1872388..e5fe166c 100644 --- a/web/src/views/dashboard/analysis/components/GrowCardThree.vue +++ b/web/src/views/dashboard/analysis/components/GrowCardThree.vue @@ -13,13 +13,13 @@
- +
总{{ item.title }} - +
diff --git a/web/src/views/dashboard/analysis/components/GrowCardTwo.vue b/web/src/views/dashboard/analysis/components/GrowCardTwo.vue index 800fb20a..b896b65f 100644 --- a/web/src/views/dashboard/analysis/components/GrowCardTwo.vue +++ b/web/src/views/dashboard/analysis/components/GrowCardTwo.vue @@ -13,13 +13,13 @@
- +
总{{ item.title }} - +
diff --git a/web/src/views/dashboard/analysis/data.ts b/web/src/views/dashboard/analysis/data.ts index 4d359e44..2aa412a9 100644 --- a/web/src/views/dashboard/analysis/data.ts +++ b/web/src/views/dashboard/analysis/data.ts @@ -1,5 +1,6 @@ export interface GrowCardItem { icon: string; + dataIndex: string; title: string; value: number; total: number; @@ -9,104 +10,119 @@ export interface GrowCardItem { export const growCardList: GrowCardItem[] = [ { - title: '今日销售', + title: '今日零售', + dataIndex: 'todayRetailSales', icon: 'visit-count|svg', - value: 1750, - total: 1750, + value: 0, + total: 0, color: 'green', action: '今日', }, { - title: '今日零售', - icon: 'total-sales|svg', - value: 800, - total: 800, + title: '今日销售', + dataIndex: 'todaySales', + icon: 'visit-count|svg', + value: 0, + total: 0, color: 'green', action: '今日', }, { title: '今日采购', - icon: 'download-count|svg', - value: 378, - total: 378, + dataIndex: 'todayPurchase', + icon: 'visit-count|svg', + value: 0, + total: 0, color: 'green', action: '今日', }, - { - title: '昨日销售', - icon: 'transaction|svg', - value: 2500, - total: 2500, - color: 'blue', - action: '昨日', - }, ]; export const growCardTwoList: GrowCardItem[] = [ { title: '昨日零售', + dataIndex: 'yesterdayRetailSales', icon: 'visit-count|svg', - value: 1300, - total: 1300, + value: 0, + total: 0, color: 'blue', action: '昨日', }, { - title: '昨日采购', + title: '昨日销售', + dataIndex: 'yesterdaySales', icon: 'total-sales|svg', - value: 20, - total: 26, + value: 0, + total: 0, color: 'blue', action: '昨日', }, { - title: '本月累计销售', + title: '昨日采购', + dataIndex: 'yesterdayPurchase', icon: 'download-count|svg', - value: 4278, - total: 4200, + value: 0, + total: 0, + color: 'blue', + action: '昨日', + }, +]; + +export const growCardThreeList: GrowCardItem[] = [ + { + title: '本月累计零售', + dataIndex: 'monthRetailSales', + icon: 'total-sales|svg', + value: 0, + total: 0, color: 'orange', action: '本月', }, { - title: '本月累计零售', - icon: 'transaction|svg', - value: 3500, - total: 3500, + title: '本月累计销售', + dataIndex: 'monthSales', + icon: 'total-sales|svg', + value: 0, + total: 0, color: 'orange', action: '本月', }, -]; - -export const growCardThreeList: GrowCardItem[] = [ { title: '本月累计采购', - icon: 'visit-count|svg', - value: 1050, - total: 1050, + dataIndex: 'monthPurchase', + icon: 'total-sales|svg', + value: 0, + total: 0, color: 'orange', - action: '昨日', + action: '本月', }, +]; + +export const growCardFourList: GrowCardItem[] = [ { - title: '今年累计销售', + title: '今年累计零售', + dataIndex: 'yearRetailSales', icon: 'transaction|svg', - value: 57168, - total: 57168, + value: 0, + total: 0, color: 'purple', action: '今年', }, { - title: '今年累计零售', + title: '今年累计销售', + dataIndex: 'yearSales', icon: 'transaction|svg', - value: 30821, - total: 30821, + value: 0, + total: 0, color: 'purple', action: '今年', }, { title: '今年累计采购', + dataIndex: 'yearPurchase', icon: 'transaction|svg', - value: 8765, - total: 8765, + value: 0, + total: 0, color: 'purple', action: '今年', }, diff --git a/web/src/views/dashboard/analysis/index.vue b/web/src/views/dashboard/analysis/index.vue index 251bbfd3..628f0ff8 100644 --- a/web/src/views/dashboard/analysis/index.vue +++ b/web/src/views/dashboard/analysis/index.vue @@ -1,8 +1,9 @@