From af8cab142a6b15c06e131a8474574dd5b00df982 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 04 十二月 2025 22:09:58 +0800
Subject: [PATCH] feat: 改造微信accesstoken存放在系统配置表中

---
 ruoyi-ui/src/views/system/mileageStats/index.vue |  103 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/ruoyi-ui/src/views/system/mileageStats/index.vue b/ruoyi-ui/src/views/system/mileageStats/index.vue
index 8a6738c..4468509 100644
--- a/ruoyi-ui/src/views/system/mileageStats/index.vue
+++ b/ruoyi-ui/src/views/system/mileageStats/index.vue
@@ -131,9 +131,7 @@
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="GPS鐐规暟" align="center" prop="gpsPointCount" width="90" />
-      <el-table-column label="浠诲姟鏁�" align="center" prop="taskCount" width="80" />
-      <el-table-column label="鍒嗘鏁�" align="center" prop="segmentCount" width="80" />
+      
       <el-table-column label="缁熻鏃堕棿" align="center" prop="createTime" width="160">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -216,7 +214,7 @@
     </el-dialog>
 
     <!-- 璇︽儏瀵硅瘽妗� -->
-    <el-dialog title="閲岀▼缁熻璇︽儏" :visible.sync="detailOpen" width="600px" append-to-body>
+    <el-dialog title="閲岀▼缁熻璇︽儏" :visible.sync="detailOpen" width="900px" append-to-body>
       <el-descriptions :column="2" border>
         <el-descriptions-item label="杞︾墝鍙�">{{ detailData.vehicleNo }}</el-descriptions-item>
         <el-descriptions-item label="褰掑睘鍒嗗叕鍙�">{{ detailData.deptName || '-' }}</el-descriptions-item>
@@ -237,18 +235,58 @@
             {{ formatRatio(detailData.taskRatio) }}
           </el-tag>
         </el-descriptions-item>
-        <el-descriptions-item label="GPS鐐规暟">{{ detailData.gpsPointCount }}</el-descriptions-item>
-        <el-descriptions-item label="浠诲姟鏁�">{{ detailData.taskCount }}</el-descriptions-item>
-        <el-descriptions-item label="鍒嗘鏁�">{{ detailData.segmentCount }}</el-descriptions-item>
-        <el-descriptions-item label="鏁版嵁鏉ユ簮">
-          <el-tag :type="detailData.dataSource === 'segment' ? 'success' : 'info'" size="small">
-            {{ detailData.dataSource === 'segment' ? '浠庡垎娈垫眹鎬�' : '鐩存帴璁$畻' }}
-          </el-tag>
-        </el-descriptions-item>
         <el-descriptions-item label="缁熻鏃堕棿" :span="2">
           {{ parseTime(detailData.createTime) }}
         </el-descriptions-item>
       </el-descriptions>
+      
+      <!-- 鍒嗘鏄庣粏琛ㄦ牸 -->
+      <div v-if="segmentList.length > 0" style="margin-top: 20px;">
+        <el-divider content-position="left">
+          <i class="el-icon-tickets"></i> 閲岀▼鍒嗘鏄庣粏
+        </el-divider>
+        
+        <el-table 
+          :data="segmentList" 
+          size="small"
+          :max-height="400"
+          stripe
+          border
+          v-loading="segmentLoading"
+        >
+          <el-table-column type="index" label="搴忓彿" width="50" align="center" />
+          <el-table-column label="寮�濮嬫椂闂�" prop="segmentStartTime" width="160" align="center">
+            <template slot-scope="scope">
+              {{ parseTime(scope.row.segmentStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
+            </template>
+          </el-table-column>
+          <el-table-column label="缁撴潫鏃堕棿" prop="segmentEndTime" width="160" align="center">
+            <template slot-scope="scope">
+              {{ parseTime(scope.row.segmentEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
+            </template>
+          </el-table-column>
+          <el-table-column label="閲岀▼(km)" prop="segmentDistance" width="100" align="center">
+            <template slot-scope="scope">
+              <span class="mileage-value">{{ (scope.row.segmentDistance || 0).toFixed(2) }}</span>
+            </template>
+          </el-table-column>
+        
+          <el-table-column label="鍏宠仈浠诲姟" prop="taskCode" align="center" min-width="120">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.taskCode" size="small" type="success">{{ scope.row.taskCode }}</el-tag>
+              <span v-else style="color: #909399;">鏃犱换鍔�</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="璁$畻鏂瑰紡" prop="calculateMethod" align="center" width="100">
+            <template slot-scope="scope">
+              <el-tag size="small" :type="scope.row.calculateMethod === 'haversine' ? 'primary' : 'info'">
+                {{ scope.row.calculateMethod === 'haversine' ? '鐞冮潰璺濈' : '鐩寸嚎璺濈' }}
+              </el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      
       <div slot="footer" class="dialog-footer">
         <el-button @click="detailOpen = false">鍏� 闂�</el-button>
       </div>
@@ -257,7 +295,7 @@
 </template>
 
 <script>
-import { listMileageStats, getMileageStats, delMileageStats, calculateMileageStats, batchCalculateMileageStats } from "@/api/system/mileageStats";
+import { listMileageStats, getMileageStats, delMileageStats, calculateMileageStats, batchCalculateMileageStats, getSegmentsByDateRange } from "@/api/system/mileageStats";
 import { listDept } from "@/api/system/dept";
 
 export default {
@@ -292,6 +330,10 @@
       detailOpen: false,
       // 璇︽儏鏁版嵁
       detailData: {},
+      // 鍒嗘鏄庣粏鍒楄〃
+      segmentList: [],
+      // 鍒嗘鏄庣粏鍔犺浇鐘舵��
+      segmentLoading: false,
       // 鎵嬪姩缁熻鍔犺浇鐘舵��
       calculateLoading: false,
       // 鎵归噺缁熻鍔犺浇鐘舵��
@@ -417,9 +459,44 @@
     /** 鏌ョ湅璇︽儏鎸夐挳鎿嶄綔 */
     handleView(row) {
       const statsId = row.statsId;
+      
+      // 閲嶇疆鍒嗘鏄庣粏
+      this.segmentList = [];
+      
+      // 鍔犺浇缁熻璇︽儏
       getMileageStats(statsId).then(response => {
         this.detailData = response.data;
         this.detailOpen = true;
+        
+        // 濡傛灉鏈夎溅杈咺D鍜岀粺璁℃棩鏈燂紝鍔犺浇鍒嗘鏄庣粏
+        if (this.detailData.vehicleId && this.detailData.statDate) {
+          this.loadSegmentDetails(this.detailData.vehicleId, this.detailData.statDate);
+        }
+      });
+    },
+    
+    /** 鍔犺浇鍒嗘鏄庣粏 */
+    loadSegmentDetails(vehicleId, statDate) {
+      this.segmentLoading = true;
+      
+      // 鏍煎紡鍖栨棩鏈燂細缁熻鏃ユ湡鐨勫紑濮嬪拰缁撴潫鏃堕棿
+      const startDate = this.parseTime(statDate, '{y}-{m}-{d}');
+      const endDate = this.parseTime(statDate, '{y}-{m}-{d}');
+      
+      // 鏌ヨ璇ユ棩鏈熺殑鍒嗘閲岀▼鏄庣粏
+      getSegmentsByDateRange(vehicleId, startDate, endDate).then(response => {
+        if (response.code === 200 && response.data) {
+          this.segmentList = response.data;
+          console.log('鍒嗘鏄庣粏鏁版嵁锛�', this.segmentList);
+        } else {
+          this.segmentList = [];
+        }
+      }).catch(error => {
+        console.error('鍔犺浇鍒嗘鏄庣粏澶辫触', error);
+        this.segmentList = [];
+        this.$modal.msgWarning('鍔犺浇鍒嗘鏄庣粏澶辫触锛屼絾涓嶅奖鍝嶇粺璁℃暟鎹煡鐪�');
+      }).finally(() => {
+        this.segmentLoading = false;
       });
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */

--
Gitblit v1.9.1