优化数据显示

This commit is contained in:
gyq
2026-01-05 13:36:24 +08:00
parent 01c2cbcfb4
commit fb13b0a502
2 changed files with 16 additions and 13 deletions

View File

@@ -56,7 +56,7 @@
</el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.totalAmount || 0 }}</div>
<div class="m">{{ multiplyAndFormat(payCount.totalAmount || 0) }}</div>
<div class="t">总金额</div>
</div>
</div>
@@ -67,7 +67,7 @@
</el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.refundAmount || 0 }}</div>
<div class="m">{{ multiplyAndFormat(payCount.refundAmount || 0) }}</div>
<div class="t">退款金额</div>
</div>
</div>
@@ -100,7 +100,7 @@
</el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.totalAmount - payCount.refundAmount || 0 }}</div>
<div class="m">{{ multiplyAndFormat((payCount.totalAmount - payCount.refundAmount) || 0) }}</div>
<div class="t">实际销售额总和</div>
</div>
</div>
@@ -111,7 +111,7 @@
</el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.saleCount - payCount.refundCount || 0 }}</div>
<div class="m">{{ multiplyAndFormat((payCount.saleCount - payCount.refundCount) || 0) }}</div>
<div class="t">实际销量总和</div>
</div>
</div>
@@ -152,10 +152,10 @@
<template v-slot="scope">{{ scope.row.refund }}</template>
</el-table-column>
<el-table-column label="实际销量" prop="refundCount">
<template v-slot="scope"> {{ scope.row.saleCount - scope.row.refundCount }} </template>
<template v-slot="scope"> {{ multiplyAndFormat(scope.row.saleCount - scope.row.refundCount) }} </template>
</el-table-column>
<el-table-column label="实际销售额" prop="refundCount">
<template v-slot="scope"> {{ scope.row.saleAmount - scope.row.refundAmount }} </template>
<template v-slot="scope"> {{ multiplyAndFormat(scope.row.saleAmount - scope.row.refundAmount) }} </template>
</el-table-column>
</el-table>
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
@@ -165,17 +165,17 @@
<el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="销量" prop="saleCount" sortable></el-table-column>
<el-table-column label="销售金额" prop="saleAmount" sortable>
<template v-slot="scope">{{ scope.row.saleAmount }}</template>
<template v-slot="scope">{{ multiplyAndFormat(scope.row.saleAmount) }}</template>
</el-table-column>
<el-table-column label="退单量" prop="refundCount" sortable></el-table-column>
<el-table-column label="退款金额" prop="refundAmount" sortable>
<template v-slot="scope">{{ scope.row.refundAmount }}</template>
<template v-slot="scope">{{ multiplyAndFormat(scope.row.refundAmount) }}</template>
</el-table-column>
<el-table-column label="实际销量" prop="refundCount" sortable>
<template v-slot="scope"> {{ scope.row.saleCount - scope.row.refundCount }} </template>
<template v-slot="scope"> {{ multiplyAndFormat(scope.row.saleCount - scope.row.refundCount) }} </template>
</el-table-column>
<el-table-column label="实际销售额" prop="refundCount" sortable>
<template v-slot="scope"> {{ scope.row.saleAmount - scope.row.refundAmount }} </template>
<template v-slot="scope"> {{ multiplyAndFormat(scope.row.saleAmount - scope.row.refundAmount) }} </template>
</el-table-column>
</el-table>
</div>
@@ -193,12 +193,13 @@ import saleSummaryApi from "@/api/order/sale-summary";
import categoryApi from "@/api/product/productclassification";
import ShopApi from "@/api/account/shop";
import dayjs from "dayjs";
import { downloadFile } from "@/utils/index";
import { downloadFile, multiplyAndFormat } from "@/utils/index";
import { formatDateRange } from './utils/index.js'
export default {
data() {
return {
multiplyAndFormat,
timeValue: "today",
resetQuery: null,
orderType: "2",
@@ -314,7 +315,8 @@ export default {
endDate: this.query.createdAt[1],
categoryId: this.query.prodCategoryId,
productName: this.query.productName,
shopId: this.shopId
shopId: this.shopId,
rangeType: this.timeValue,
});
downloadFile(file, "数据", "xlsx");
} catch (error) {

View File

@@ -187,7 +187,8 @@ export default {
const file = await tableSummaryApi.export({
beginDate: this.query.createdAt[0],
endDate: this.query.createdAt[1],
shopId: this.shopId
shopId: this.shopId,
rangeType: this.timeValue,
});
downloadFile(file, "数据", "xlsx");
this.downloadLoading = false;