| | |
| | | </div> |
| | | <div class="stat-item"> |
| | | <span class="stat-label">退款总额:</span> |
| | | <span class="stat-value">{{ businessSummaryStats.returnAmount }}</span> |
| | | <span class="stat-value">¥{{ businessSummaryStats.returnAmount.toLocaleString() }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import { ElMessage } from 'element-plus' |
| | | import { Download } from '@element-plus/icons-vue' |
| | | import PIMTable from '@/components/PIMTable/PIMTable.vue' |
| | | import { procurementBusinessSummaryListPage } from '@/api/procurementManagement/procurementReport' |
| | | import { procurementBusinessSummaryListPage, procurementBusinessSummaryStatistics } from '@/api/procurementManagement/procurementReport' |
| | | import { productTreeList } from '@/api/basicData/product' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | // 统计数据 |
| | | const businessSummaryStats = ref({ |
| | | totalAmount: 0, |
| | | productTypes: 0 |
| | | productTypes: 0, |
| | | returnAmount: 0 |
| | | }) |
| | | |
| | | // 表格列配置(根据后端字段定义) |
| | |
| | | { |
| | | label: '规格型号', |
| | | prop: 'specificationModel', |
| | | }, |
| | | { |
| | | label: '厚度(mm)', |
| | | prop: 'thickness', |
| | | }, |
| | | { |
| | | label: '采购数量', |
| | |
| | | page.current = Number(res.data.current ?? page.current) |
| | | page.size = Number(res.data.size ?? page.size) |
| | | } |
| | | |
| | | // 计算统计数据 |
| | | if (businessSummaryData.value.length > 0) { |
| | | businessSummaryStats.value.totalAmount = businessSummaryData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.purchaseAmount) || 0) |
| | | }, 0) |
| | | businessSummaryStats.value.returnAmount = businessSummaryData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.returnAmount) || 0) |
| | | }, 0) |
| | | } else { |
| | | businessSummaryStats.value = { |
| | | totalAmount: 0, |
| | | productTypes: 0 |
| | | } |
| | | } |
| | | |
| | | // 获取统计数据 |
| | | const statsRes = await procurementBusinessSummaryStatistics(params) |
| | | if (statsRes && statsRes.data) { |
| | | businessSummaryStats.value = { |
| | | totalAmount: statsRes.data.purchaseTotalAmount || 0, |
| | | productTypes: statsRes.data.productCategoryCount || 0, |
| | | returnAmount: statsRes.data.returnTotalAmount || 0 |
| | | } |
| | | } |
| | | } catch (error) { |