From f3cec0341563c2c0dd4f5df609d0689c6c450bfc Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期六, 21 三月 2026 17:11:12 +0800
Subject: [PATCH] feat(采购退货): 增加退货详情查看功能并完善退货流程

---
 src/views/procurementManagement/procurementReport/index.vue |   59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/src/views/procurementManagement/procurementReport/index.vue b/src/views/procurementManagement/procurementReport/index.vue
index 60a900d..93eb7d9 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 }}</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 { productTreeList } from '@/api/basicData/product'
+
+const { proxy } = getCurrentInstance()
 
 // 鍝嶅簲寮忔暟鎹�
 const loading = ref(false)
@@ -95,8 +101,7 @@
 // 缁熻鏁版嵁
 const businessSummaryStats = ref({
   totalAmount: 0,
-  productTypes: 0,
-  supplierCount: 0
+  productTypes: 0
 })
 
 // 琛ㄦ牸鍒楅厤缃紙鏍规嵁鍚庣瀛楁瀹氫箟锛�
@@ -104,12 +109,10 @@
   {
     label: '浜у搧澶х被',
     prop: 'productCategory',
-    width: 150,
   },
   {
     label: '瑙勬牸鍨嬪彿',
     prop: 'specificationModel',
-    width: 180
   },
   {
     label: '閲囪喘鏁伴噺',
@@ -120,9 +123,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'
     }
@@ -143,7 +161,6 @@
   {
     label: '渚涘簲鍟嗗悕绉�',
     prop: 'supplierName',
-    width: 200
   },
   {
     label: '褰曞叆鏃ユ湡',
@@ -242,13 +259,13 @@
         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
-        businessSummaryStats.value.supplierCount = new Set(businessSummaryData.value.map(item => item.supplierName).filter(Boolean)).size
+        businessSummaryStats.value.returnAmount = businessSummaryData.value.reduce((sum, item) => {
+          return sum + (parseFloat(item.returnAmount) || 0)
+        }, 0)
       } else {
         businessSummaryStats.value = {
           totalAmount: 0,
-          productTypes: 0,
-          supplierCount: 0
+          productTypes: 0
         }
       }
     }
@@ -276,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