From 9b25e5c7a4e2e300b213ad4d5fb4d4b72cdced39 Mon Sep 17 00:00:00 2001
From: zhang_nuo <zhang_12370@163.com>
Date: 星期日, 13 九月 2026 11:40:54 +0800
Subject: [PATCH] fix(monitor/operlog): 修复操作日志表格操作日期显示错误
---
src/views/procurementManagement/procurementReport/index.vue | 86 +++++++++++++++++++++++++++++++------------
1 files changed, 62 insertions(+), 24 deletions(-)
diff --git a/src/views/procurementManagement/procurementReport/index.vue b/src/views/procurementManagement/procurementReport/index.vue
index 60a900d..c109af3 100644
--- a/src/views/procurementManagement/procurementReport/index.vue
+++ b/src/views/procurementManagement/procurementReport/index.vue
@@ -48,11 +48,15 @@
<div class="summary-stats">
<div class="stat-item">
<span class="stat-label">閲囪喘鎬婚锛�</span>
- <span class="stat-value">楼{{ businessSummaryStats.totalAmount.toLocaleString() }}</span>
+ <span class="stat-value">楼{{ formatStatAmount(businessSummaryStats.totalAmount) }}</span>
</div>
<div class="stat-item">
<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">楼{{ formatStatAmount(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,36 +101,57 @@
// 缁熻鏁版嵁
const businessSummaryStats = ref({
totalAmount: 0,
- productTypes: 0,
- supplierCount: 0
+ returnAmount: 0,
+ productTypes: 0
})
+
+// 姹囨�婚噾棰濆睍绀猴紝淇濈暀6浣嶅皬鏁�
+const formatStatAmount = (val) => {
+ return Number(val || 0).toLocaleString('zh-CN', {
+ minimumFractionDigits: 6,
+ maximumFractionDigits: 6
+ })
+}
// 琛ㄦ牸鍒楅厤缃紙鏍规嵁鍚庣瀛楁瀹氫箟锛�
const tableColumns = ref([
{
label: '浜у搧澶х被',
prop: 'productCategory',
- width: 150,
},
{
label: '瑙勬牸鍨嬪彿',
prop: 'specificationModel',
- width: 180
},
{
label: '閲囪喘鏁伴噺',
prop: 'purchaseNum',
width: 120,
formatData: (val) => {
- return val ? parseFloat(val).toLocaleString() : '0'
+ return val ? parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 }) : '0'
}
},
{
- label: '閲囪喘閲戦',
- prop: 'purchaseAmount',
- width: 140,
+ label: '閫�璐ф暟閲�',
+ prop: 'returnQuantity',
+ width: 120,
formatData: (val) => {
- return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : '楼0.00'
+ return val ? parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 }) : '0'
+ }
+ },
+ {
+ label: '閫�璐ч噾棰�',
+ prop: 'returnAmount',
+ width: 120,
+ formatData: (val) => {
+ return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 })}` : '楼0.000000'
+ }
+ },
+ {
+ label: '閫�娆惧偍閲�',
+ prop: 'purchaseAmount',
+ formatData: (val) => {
+ return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 })}` : '楼0.000000'
}
},
{
@@ -137,13 +164,12 @@
prop: 'averagePrice',
width: 120,
formatData: (val) => {
- return val ? `楼${parseFloat(val).toFixed(2)}` : '楼0.00'
+ return val ? `楼${parseFloat(val).toFixed(6)}` : '楼0.000000'
}
},
{
label: '渚涘簲鍟嗗悕绉�',
prop: 'supplierName',
- width: 200
},
{
label: '褰曞叆鏃ユ湡',
@@ -242,13 +268,15 @@
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)
+ businessSummaryStats.value.productTypes = businessSummaryData.value.length
} else {
businessSummaryStats.value = {
totalAmount: 0,
- productTypes: 0,
- supplierCount: 0
+ returnAmount: 0,
+ productTypes: 0
}
}
}
@@ -276,7 +304,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")
}
@@ -300,12 +344,6 @@
</script>
<style scoped>
-.app-container {
- padding: 20px;
- background-color: #f5f7fa;
- min-height: 100vh;
-}
-
.page-header {
text-align: center;
margin-bottom: 20px;
--
Gitblit v1.9.3