From ea7142e7ec94d4896c8d0c9af85656edb24e32e1 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 21 四月 2026 15:48:33 +0800
Subject: [PATCH] 保养项目
---
src/views/procurementManagement/procurementReport/index.vue | 78 ++++++++++++++++++++++++++++----------
1 files changed, 57 insertions(+), 21 deletions(-)
diff --git a/src/views/procurementManagement/procurementReport/index.vue b/src/views/procurementManagement/procurementReport/index.vue
index 8c8f3f6..182e164 100644
--- a/src/views/procurementManagement/procurementReport/index.vue
+++ b/src/views/procurementManagement/procurementReport/index.vue
@@ -54,6 +54,10 @@
<span class="stat-label">鍟嗗搧绉嶇被锛�</span>
<span class="stat-value">{{ businessSummaryStats.productTypes }}</span>
</div>
+ <div class="stat-item">
+ <span class="stat-label">閫�娆炬�婚锛�</span>
+ <span class="stat-value">楼{{ businessSummaryStats.returnAmount.toLocaleString() }}</span>
+ </div>
</div>
</div>
@@ -73,12 +77,14 @@
</template>
<script setup>
-import { ref, reactive, onMounted } from 'vue'
+import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
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 loading = ref(false)
@@ -95,7 +101,8 @@
// 缁熻鏁版嵁
const businessSummaryStats = ref({
totalAmount: 0,
- productTypes: 0
+ productTypes: 0,
+ returnAmount: 0
})
// 琛ㄦ牸鍒楅厤缃紙鏍规嵁鍚庣瀛楁瀹氫箟锛�
@@ -103,12 +110,14 @@
{
label: '浜у搧澶х被',
prop: 'productCategory',
- width: 150,
},
{
label: '瑙勬牸鍨嬪彿',
prop: 'specificationModel',
- width: 180
+ },
+ {
+ label: '鍘氬害(mm)',
+ prop: 'thickness',
},
{
label: '閲囪喘鏁伴噺',
@@ -119,9 +128,24 @@
}
},
{
- label: '閲囪喘閲戦',
+ label: '閫�璐ф暟閲�',
+ prop: 'returnQuantity',
+ width: 120,
+ formatData: (val) => {
+ return val ? parseFloat(val).toLocaleString() : '0'
+ }
+ },
+ {
+ label: '閫�璐ч噾棰�',
+ prop: 'returnAmount',
+ width: 120,
+ formatData: (val) => {
+ return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : '楼0.00'
+ }
+ },
+ {
+ label: '閫�娆惧偍閲�',
prop: 'purchaseAmount',
- width: 140,
formatData: (val) => {
return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : '楼0.00'
}
@@ -142,7 +166,6 @@
{
label: '渚涘簲鍟嗗悕绉�',
prop: 'supplierName',
- width: 200
},
{
label: '褰曞叆鏃ユ湡',
@@ -235,18 +258,15 @@
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.productTypes = new Set(businessSummaryData.value.map(item => item.productCategory)).size
- } 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) {
@@ -273,7 +293,23 @@
}
const exportReport = () => {
- ElMessage.success('瀵煎嚭鍔熻兘寮�鍙戜腑...')
+ const params = {}
+
+ // 鏃堕棿鑼冨洿
+ if (searchForm.dateRange && searchForm.dateRange.length === 2) {
+ params.entryDateStart = searchForm.dateRange[0]
+ params.entryDateEnd = searchForm.dateRange[1]
+ }
+
+ // 浜у搧绫诲埆
+ if (searchForm.productCategory) {
+ const categoryName = findNodeLabelById(productOptions.value, searchForm.productCategory)
+ if (categoryName) {
+ params.productCategory = categoryName
+ }
+ }
+
+ proxy.download("/procurementBusinessSummary/export", params, "閲囪喘涓氬姟姹囨�昏〃.xlsx")
}
--
Gitblit v1.9.3