ZN
2026-03-21 f3cec0341563c2c0dd4f5df609d0689c6c450bfc
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)
@@ -103,12 +109,10 @@
  {
    label: '产品大类',
    prop: 'productCategory',
    width: 150,
  },
  {
    label: '规格型号',
    prop: 'specificationModel',
    width: 180
  },
  {
    label: '采购数量',
@@ -119,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'
    }
@@ -142,7 +161,6 @@
  {
    label: '供应商名称',
    prop: 'supplierName',
    width: 200
  },
  {
    label: '录入日期',
@@ -241,7 +259,9 @@
        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.returnAmount = businessSummaryData.value.reduce((sum, item) => {
          return sum + (parseFloat(item.returnAmount) || 0)
        }, 0)
      } else {
        businessSummaryStats.value = {
          totalAmount: 0,
@@ -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")
}