From 5b41c8896ef7850be2672e45b69bb58e149729ec Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 01 十二月 2026 09:03:48 +0800
Subject: [PATCH] feat(货运统计): 完善台账核查与轨迹里程管理功能

---
 traffic-audit-web/src/views/DataView.vue |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/traffic-audit-web/src/views/DataView.vue b/traffic-audit-web/src/views/DataView.vue
index f82a3b3..0d04f4c 100644
--- a/traffic-audit-web/src/views/DataView.vue
+++ b/traffic-audit-web/src/views/DataView.vue
@@ -10,6 +10,7 @@
           <el-menu-item index="/explain">浼佷笟瑙i噴</el-menu-item>
           <el-menu-item index="/audit">瀹℃牳缁撴灉</el-menu-item>
           <el-menu-item index="/report">鎶ヨ〃鐢熸垚</el-menu-item>
+          <el-menu-item index="/ledger-audit">浜嬪悗鏍告煡</el-menu-item>
           <el-submenu index="/special-stats">
             <template slot="title">涓撻」缁熻</template>
             <el-menu-item index="/holiday-stat">鑺傚亣鏃�</el-menu-item>
@@ -37,12 +38,26 @@
             </el-option-group>
           </el-select>
           <template v-if="!isRollup && type === 'trackMileage'">
+            <span class="toolbar-label">鏁版嵁鏉ユ簮</span>
+            <el-select v-model="dataSource" size="small" style="width:150px" @change="doQuery">
+              <el-option label="鍏ㄩ儴鏉ユ簮" value=""></el-option>
+              <el-option label="鐪侀噸杞藉钩鍙�" value="PROVINCIAL"></el-option>
+              <el-option label="甯傚窞绗笁鏂�" value="CITY_THIRD_PARTY"></el-option>
+            </el-select>
+            <span class="toolbar-label">甯傚窞</span>
+            <el-select v-model="cityName" size="small" style="width:130px" filterable clearable @change="doQuery">
+              <el-option label="鍏ㄩ儴甯傚窞" value=""></el-option>
+              <el-option v-for="city in cities" :key="city" :label="city" :value="city"></el-option>
+            </el-select>
             <span class="toolbar-label">浼佷笟绫诲埆</span>
             <el-select v-model="enterpriseCategory" size="small" style="width:140px" @change="doQuery">
               <el-option label="鍏ㄩ儴" value=""></el-option>
               <el-option label="瑙勪笂浼佷笟" value="ABOVE_SCALE"></el-option>
               <el-option label="涓ゅ浼佷笟" value="PASSENGER"></el-option>
+              <el-option label="鏈叆瑙勪紒涓�" value="UNREGISTERED"></el-option>
             </el-select>
+            <el-button type="success" size="small" icon="el-icon-download" :loading="exportingCityTrack"
+                       @click="exportTrackMileageCity">鐢熸垚鍒嗗競宸炶建杩�</el-button>
           </template>
           <template v-if="canRollup">
             <span class="toolbar-label">瑙嗗浘</span>
@@ -149,7 +164,11 @@
       type: 'h2032',
       period: '',
       periodType: '',
+      dataSource: '',
+      cityName: '',
       enterpriseCategory: '',
+      cities: ['姝︽眽甯�', '榛勭煶甯�', '鍗佸牥甯�', '瀹滄槍甯�', '瑗勯槼甯�', '閯傚窞甯�', '鑽嗛棬甯�', '瀛濇劅甯�', '鑽嗗窞甯�', '榛勫唸甯�',
+        '鍜稿畞甯�', '闅忓窞甯�', '鎭╂柦宸�', '浠欐甯�', '娼滄睙甯�', '澶╅棬甯�', '绁炲啘鏋舵灄鍖�'],
       viewMode: 'detail',
       rollupTypes: [],
       from: '',
@@ -163,7 +182,8 @@
       records: [],
       columns: [],
       loading: false,
-      loadingMore: false
+      loadingMore: false,
+      exportingCityTrack: false
     }
   },
   computed: {
@@ -294,11 +314,35 @@
         this.$message.success('姹囨�昏〃宸插鍑�')
       }).catch(() => this.$message.error('瀵煎嚭澶辫触'))
     },
+    exportTrackMileageCity() {
+      if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
+      this.exportingCityTrack = true
+      api.get('/data/trackMileageCityExport', {
+        params: { period: this.period },
+        responseType: 'blob',
+        timeout: 180000
+      }).then(res => {
+        const blob = res instanceof Blob ? res : new Blob([res], { type: 'application/zip' })
+        const url = window.URL.createObjectURL(blob)
+        const a = document.createElement('a')
+        const fileName = this.period.replace('-', '骞�') + '鏈堝垎甯傚窞杞ㄨ抗.zip'
+        a.href = url
+        a.download = fileName
+        document.body.appendChild(a)
+        a.click()
+        document.body.removeChild(a)
+        window.URL.revokeObjectURL(url)
+        this.$message.success('鍒嗗競宸炶建杩瑰凡鐢熸垚')
+      }).catch(() => this.$message.error('鐢熸垚鍒嗗競宸炶建杩瑰け璐�'))
+        .finally(() => { this.exportingCityTrack = false })
+    },
     onTypeSelect() {
       const g = this.modules.find(x => x.types.some(t => t.value === this.type))
       if (g) this.activeModule = g.key
       this.periodType = ''
       this.enterpriseCategory = ''
+      this.dataSource = ''
+      this.cityName = ''
       this.viewMode = 'detail'
       this.summaryHint = ''
       this.doQuery()
@@ -318,6 +362,8 @@
           keyword: this.keyword || undefined,
           periodType: this.periodType || undefined,
           enterpriseCategory: this.type === 'trackMileage' ? (this.enterpriseCategory || undefined) : undefined,
+          dataSource: this.type === 'trackMileage' ? (this.dataSource || undefined) : undefined,
+          cityName: this.type === 'trackMileage' ? (this.cityName || undefined) : undefined,
           page: this.page,
           size: this.size
         }
@@ -362,6 +408,8 @@
           keyword: this.keyword || undefined,
           periodType: this.periodType || undefined,
           enterpriseCategory: this.type === 'trackMileage' ? (this.enterpriseCategory || undefined) : undefined,
+          dataSource: this.type === 'trackMileage' ? (this.dataSource || undefined) : undefined,
+          cityName: this.type === 'trackMileage' ? (this.cityName || undefined) : undefined,
           page: nextPage,
           size: this.size
         }

--
Gitblit v1.9.1