From f80d798b83fabb038cf10d745acd34c9c42fed4c Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期一, 22 九月 2025 15:22:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/ywx' into dev

---
 src/views/inventoryManagement/stockReport/index.vue |   91 +++++++++++++++++++++++++++++++++------------
 1 files changed, 66 insertions(+), 25 deletions(-)

diff --git a/src/views/inventoryManagement/stockReport/index.vue b/src/views/inventoryManagement/stockReport/index.vue
index 79f1a02..354c775 100644
--- a/src/views/inventoryManagement/stockReport/index.vue
+++ b/src/views/inventoryManagement/stockReport/index.vue
@@ -33,8 +33,8 @@
           range-separator="鑷�"
           start-placeholder="寮�濮嬫湀浠�"
           end-placeholder="缁撴潫鏈堜唤"
-          format="YYYY-MM"
-          value-format="YYYY-MM"
+          format="YYYY-MM-DD"
+          value-format="YYYY-MM-DD"
           style="width: 240px;"
         />
         <el-date-picker
@@ -165,14 +165,14 @@
            <el-table-column
              v-if="searchForm.reportType === 'daily'"
              label="鏃ユ湡"
-             prop="date"
+             prop="createTime"
              width="100"
              align="center"
            />
            <el-table-column
              v-if="searchForm.reportType === 'monthly'"
              label="鏈堜唤"
-             prop="month"
+             prop="createTime"
              width="100"
              align="center"
            />
@@ -212,27 +212,27 @@
              width="70"
              show-overflow-tooltip
            />
-           <el-table-column
+           <!-- <el-table-column
              label="鏈熷垵搴撳瓨"
              prop="beginStock"
              width="100"
              align="center"
-           />
+           /> -->
            <el-table-column
              label="鍏ュ簱鏁伴噺"
              prop="inboundNum"
              width="100"
              align="center"
            />
-           <el-table-column
+           <!-- <el-table-column
              label="鍑哄簱鏁伴噺"
-             prop="outboundNum"
+             prop=""
              width="100"
              align="center"
-           />
+           /> -->
            <el-table-column
-             label="鏈熸湯搴撳瓨"
-             prop="endStock"
+             label="鐜板湪搴撳瓨"
+             prop="inboundNum0"
              width="100"
              align="center"
            />
@@ -298,6 +298,8 @@
   exportStockReport
 } from '@/api/inventoryManagement/stockReport'
 
+
+const { proxy } = getCurrentInstance()
 // 鍝嶅簲寮忔暟鎹�
 const tableLoading = ref(false)
 const trendChart = ref(null)
@@ -365,10 +367,14 @@
     }
     
     if (response.code === 200) {
-      reportData.value = response.data
+      // generateMockData()
+      reportData.value.tableData = response.data.tableData
+      reportData.value.summary = response.data.summary
+      reportData.value.chartData = response.data.chartData
       nextTick(() => {
         initCharts()
       })
+      
     }
   } catch (error) {
     ElMessage.error('鏌ヨ澶辫触锛�' + error.message)
@@ -376,7 +382,37 @@
     tableLoading.value = false
   }
 }
+// // 鐢熸垚鍋囨暟鎹�
+// const generateMockData = () => {
+//   // 鐢熸垚缁熻鍗$墖鍋囨暟鎹�
+//   const summary = {
+//     totalIn: 1000,
+//     totalOut: 600,
+//     currentStock: 400,
+//     turnoverRate: 30
+//   }
 
+//   // 鐢熸垚鍥捐〃鍋囨暟鎹�
+//   const trendDates = ['2025-09-15', '2025-09-16', '2025-09-17', '2025-09-18', '2025-09-19']
+//   const trendValues = [300, 350, 400, 380, 420]
+//   const comparisonDates = ['2025-09-15', '2025-09-16', '2025-09-17']
+//   const inValues = [100, 150, 200]
+//   const outValues = [80, 120, 100]
+
+//   const chartData = {
+//     trendDates,
+//     trendValues,
+//     comparisonDates,
+//     inValues,
+//     outValues
+//   }
+
+//   reportData.value = {
+//     summary,
+//     chartData,
+//     tableData: []
+//   }
+// }
 // 楠岃瘉鎼滅储琛ㄥ崟
 const validateSearchForm = () => {
   if (searchForm.reportType === 'daily') {
@@ -401,7 +437,12 @@
 // 鑾峰彇鏌ヨ鍙傛暟
 const getQueryParams = () => {
   const params = {
-    reportType: searchForm.reportType
+    reportType: searchForm.reportType,
+    reportDate: "",
+    startMonth: "",
+    endMonth: "",
+    startDate: "",
+    endDate: ""
   }
   
   if (searchForm.reportType === 'daily') {
@@ -438,20 +479,20 @@
   
   try {
     const params = getQueryParams()
-    const response = await exportStockReport(params)
-    
+    // const response = await exportStockReport(params)
+    proxy.download("/stockin/exportCopy", params, '搴撳瓨鎶ヨ〃.xlsx')
     // 鍒涘缓涓嬭浇閾炬帴
-    const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
-    const url = window.URL.createObjectURL(blob)
-    const link = document.createElement('a')
-    link.href = url
-    link.download = `${getTableTitle()}_${new Date().getTime()}.xlsx`
-    document.body.appendChild(link)
-    link.click()
-    document.body.removeChild(link)
-    window.URL.revokeObjectURL(url)
+    // const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
+    // const url = window.URL.createObjectURL(blob)
+    // const link = document.createElement('a')
+    // link.href = url
+    // link.download = `${getTableTitle()}_${new Date().getTime()}.xlsx`
+    // document.body.appendChild(link)
+    // link.click()
+    // document.body.removeChild(link)
+    // window.URL.revokeObjectURL(url)
     
-    ElMessage.success('瀵煎嚭鎴愬姛')
+    // ElMessage.success('瀵煎嚭鎴愬姛')
   } catch (error) {
     ElMessage.error('瀵煎嚭澶辫触锛�' + error.message)
   }

--
Gitblit v1.9.3