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/DataImport.vue | 83 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 1 deletions(-)
diff --git a/traffic-audit-web/src/views/DataImport.vue b/traffic-audit-web/src/views/DataImport.vue
index b6a2ba8..4de3895 100644
--- a/traffic-audit-web/src/views/DataImport.vue
+++ b/traffic-audit-web/src/views/DataImport.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>
@@ -51,6 +52,20 @@
@click="downloadTemplate">涓嬭浇妯℃澘</el-link>
<span v-if="importType === 'cityTaxiAuth'" class="slow-tip">璇ョ被鍨嬬害 4 涓�+ 琛岋紝棰勮鑰楁椂 1 鍒嗛挓浠ュ唴</span>
</div>
+ <template v-if="moduleSel[g.key] === 'trackMileage'">
+ <span class="source-label">鏁版嵁鏉ユ簮</span>
+ <el-select v-model="trackMileageSource" size="small" style="width:150px" @change="onTrackSourceChange">
+ <el-option label="鐪侀噸杞藉钩鍙�" value="PROVINCIAL"></el-option>
+ <el-option label="甯傚窞绗笁鏂�" value="CITY_THIRD_PARTY"></el-option>
+ </el-select>
+ <template v-if="trackMileageSource === 'CITY_THIRD_PARTY'">
+ <span class="source-label">甯傚窞</span>
+ <el-select v-model="trackMileageCity" size="small" style="width:130px" filterable
+ placeholder="閫夋嫨甯傚窞">
+ <el-option v-for="city in cities" :key="city" :label="city" :value="city"></el-option>
+ </el-select>
+ </template>
+ </template>
</div>
<div v-if="isCityDirType(moduleSel[g.key])" class="module-file">
<div class="tip">鏃犻渶閫夋枃浠讹細鑷姩鎵弿 docs/鎶曡祫/杈撳叆/鈥�/{{ period ? Number(period.slice(5)) : 'X' }}鏈� 鐩綍涓嬪叏閮ㄥ競宸炴姤琛紝閫愭枃浠跺閿欒В鏋愬叆搴擄紙椤圭洰涓绘。+鏈堝害锛屽惈鏈湀瀹屾垚/寤鸿闃舵/褰㈣薄杩涘害锛涘崄浜斾簲椤圭洰鑷姩鏍囪锛夈��</div>
@@ -59,6 +74,7 @@
</div>
<div v-else-if="moduleSel[g.key] && !isDirOnlyType(moduleSel[g.key])" class="module-file">
<div class="file-name" :title="fileNamesText(moduleSel[g.key])">{{ fileNamesText(moduleSel[g.key]) || '鏈�夋嫨鏂囦欢' }}</div>
+ <div v-if="isTrackCity(moduleSel[g.key])" class="tip" style="margin:0 0 6px">鍚屼竴浼佷笟鐨勫涓枃浠躲�佸涓〉绛句細鍚堝苟璁$畻锛岃溅鐗屽幓閲嶏紱鏈浼氭暣浣撹鐩栨墍閫夊競宸炲悓鎶ヨ〃鏈熺殑绗笁鏂硅建杩归噷绋嬨�傚鏍告祴绠楁椂锛屽瓭鎰熻涓婁紒涓氫竴寰嬮噰鐢ㄦ湰甯傜涓夋柟鏁版嵁锛屼笉閲囩敤鐪侀噸杞藉钩鍙帮紱鍏朵粬甯傚窞鎸夆�滄湁鏁堣建杩归噷绋嬅锋湁杞ㄨ抗杞﹁締鏁扳�濇嫨浼樸��</div>
<div v-if="moduleSel[g.key] === 'h202'" class="tip" style="margin:0 0 6px">閫夋嫨鏂囦欢澶瑰悗锛岃嚜鍔ㄨ瘑鍒苟瀵煎叆鐩綍鍐呯鍚� H202 鍛藉悕瑙勫垯鐨勫叏閮� .xlsx 鏂囦欢銆�</div>
<div class="file-btns">
<el-upload action="#" :auto-upload="false" :show-file-list="false" multiple :accept="acceptOf(moduleSel[g.key])"
@@ -71,7 +87,7 @@
:disabled="importing" title="閫夋嫨鏂囦欢澶瑰悗鑷姩鎵归噺瀵煎叆"
@click="pickH202Folder(g.key)">閫夋嫨鏂囦欢澶瑰苟瀵煎叆</el-button>
<el-button size="mini" type="primary" icon="el-icon-upload2" :loading="importing" :disabled="importing || !fileCount(moduleSel[g.key])"
- @click="importNow(g.key)">{{ fileCount(moduleSel[g.key]) > 1 ? '鎵归噺瀵煎叆 ' + fileCount(moduleSel[g.key]) + ' 涓枃浠�' : '绔嬪嵆瀵煎叆' }}</el-button>
+ @click="importNow(g.key)">{{ importButtonText(moduleSel[g.key]) }}</el-button>
</div>
</div>
</div>
@@ -215,10 +231,12 @@
H2032: 'H203-2鏈堟姤', H2031: 'H203-1鏃呭鏈堟姤', H204: 'H204鑳借�楀鎶�', PASSENGER_AUTH: '鏃呭杩愭斂杞﹁締鏁�',
PASSENGER_INDIVIDUAL: '涓綋瀹㈣繍閲�/鍛ㄨ浆閲�', ENERGY_AUTH: '鑳借�楄溅杈嗚繍鏀夸俊鎭�', TRANSPORT_AUTH: '杩愭斂杞﹁締',
TRACK_MILEAGE: '杞ㄨ抗閲岀▼', SCALE_SPLIT: '瑙勪笂瑙勪笅鎷嗗垎', FREIGHT_TURNOVER: '璐ц繍閲忓懆杞噺',
+ TRACK_MILEAGE_CITY: '甯傚窞绗笁鏂硅建杩归噷绋�',
INVEST_SYSTEM: '鎶曡祫绯荤粺瀵煎嚭', CITY_BUS: '鍩庡競鍏氦鏈堟姤', CITY_TAXI: '宸℃父鍑虹鏈堟姤', CITY_TAXI_AUTH: '鍑虹杞﹁繍鏀胯溅杈�', WYC_TOTAL: '缃戠害杞︽�绘暟', WYC_ORDER: '缃戠害杞﹁鍗曞強鍏ㄧ渷鎬婚噺', WYC_ORDER_REPORT: '缃戠害杞﹁鍗曟姤鍛�'
}
const BATCH_TYPE_MAP = {
H2032: 'h2032', H202: 'h202', TRANSPORT_AUTH: 'transportAuth', TRACK_MILEAGE: 'trackMileage',
+ TRACK_MILEAGE_CITY: 'trackMileage',
SCALE_SPLIT: 'scaleSplit', FREIGHT_TURNOVER: 'freightTurnover',
H2031: 'passengerMonthly', PASSENGER_AUTH: 'passengerAuth', PASSENGER_INDIVIDUAL: 'passengerIndividual',
H204: 'energyMonthly', ENERGY_AUTH: 'energyAuth',
@@ -248,6 +266,10 @@
batchLoading: false,
moduleSel: { freight: 'h2032', passenger: '', city: '', energy: '', invest: '' },
activeModule: 'freight',
+ trackMileageSource: 'PROVINCIAL',
+ trackMileageCity: '',
+ cities: ['姝︽眽甯�', '榛勭煶甯�', '鍗佸牥甯�', '瀹滄槍甯�', '瑗勯槼甯�', '閯傚窞甯�', '鑽嗛棬甯�', '瀛濇劅甯�', '鑽嗗窞甯�', '榛勫唸甯�',
+ '鍜稿畞甯�', '闅忓窞甯�', '鎭╂柦宸�', '浠欐甯�', '娼滄睙甯�', '澶╅棬甯�', '绁炲啘鏋舵灄鍖�'],
files: {},
fileNames: {},
overview: {},
@@ -440,6 +462,24 @@
onModuleChange(key) {
this.importType = this.moduleSel[key] || ''
},
+ onTrackSourceChange() {
+ this.clearTrackMileageFiles()
+ },
+ isTrackCity(type) {
+ return type === 'trackMileage' && this.trackMileageSource === 'CITY_THIRD_PARTY'
+ },
+ importButtonText(type) {
+ const count = this.fileCount(type)
+ if (this.isTrackCity(type)) return count > 1 ? '鍚堝苟瀵煎叆 ' + count + ' 涓枃浠�' : '鍚堝苟瀵煎叆'
+ return count > 1 ? '鎵归噺瀵煎叆 ' + count + ' 涓枃浠�' : '绔嬪嵆瀵煎叆'
+ },
+ clearTrackMileageFiles() {
+ this.$set(this.files, 'trackMileage', [])
+ this.$set(this.fileNames, 'trackMileage', [])
+ const refs = this.$refs.upfreight
+ const up = Array.isArray(refs) ? refs[0] : refs
+ if (up && up.clearFiles) up.clearFiles()
+ },
onModuleSwitch() {
this.importType = this.moduleSel[this.activeModule] || ''
},
@@ -524,6 +564,16 @@
if (!fileList.length) { this.$message.warning('璇峰厛涓鸿绫诲瀷閫夋嫨鏂囦欢'); return }
if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
if (this.importing) { this.$message.warning('姝e湪瀵煎叆涓紝璇风◢鍊欌��'); return }
+ if (this.isTrackCity(type)) {
+ if (!this.trackMileageCity) { this.$message.warning('璇峰厛閫夋嫨甯傚窞'); return }
+ this.importing = true
+ this.importCityTrackMileage(fileList).finally(() => { this.importing = false })
+ return
+ }
+ if (type === 'trackMileage' && fileList.length > 1) {
+ this.$message.warning('鐪侀噸杞藉钩鍙拌建杩归噷绋嬩竴娆″彧鑳藉鍏� 1 涓枃浠讹紱澶氫釜鏂囦欢鍚堝苟璇烽�夋嫨鈥滃競宸炵涓夋柟鈥濄��')
+ return
+ }
this.importing = true
if (fileList.length > 1 || type === 'investment' || type === 'investmentLogistics') {
this.batchImport(type, key, fileList).finally(() => { this.importing = false })
@@ -559,6 +609,36 @@
fileNamesText(type) {
const list = this.fileNames[type] || []
return list.length ? '宸查�� ' + list.length + ' 涓枃浠讹細' + list.join('銆�') : ''
+ },
+ importCityTrackMileage(fileList) {
+ const fd = new FormData()
+ fd.append('period', this.period)
+ fd.append('city', this.trackMileageCity)
+ fileList.forEach(f => fd.append('files', f))
+ this.$message({ message: '姝e湪鍚堝苟瀵煎叆 ' + fileList.length + ' 涓競宸炶建杩规枃浠垛��', duration: 3000 })
+ return api.post('/import/trackMileageCity', fd, { timeout: 600000 })
+ .then(res => {
+ if (res && res.code !== undefined && res.code !== 200) {
+ this.showResultDialog({
+ title: '甯傚窞绗笁鏂硅建杩归噷绋嬪鍏ュけ璐�',
+ html: this.escapeHtml(res.message || '瀵煎叆澶辫触').replace(/\n/g, '<br>'),
+ level: 'error'
+ })
+ return
+ }
+ this.$message.success((res && res.data) || '甯傚窞绗笁鏂硅建杩归噷绋嬪鍏ユ垚鍔�')
+ this.afterImport()
+ this.clearTrackMileageFiles()
+ })
+ .catch(e => {
+ if (e && e._toast) return
+ const message = (e.response && e.response.data && e.response.data.message) || e.message || '瀵煎叆澶辫触'
+ this.showResultDialog({
+ title: '甯傚窞绗笁鏂硅建杩归噷绋嬪鍏ュけ璐�',
+ html: this.escapeHtml(message).replace(/\n/g, '<br>'),
+ level: 'error'
+ })
+ })
},
batchImport(type, key, fileList) {
if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
@@ -918,6 +998,7 @@
.card-head { font-weight: 600; margin-bottom: 6px; }
.module-sel { max-width: 1100px; }
.module-sel-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
+.source-label { font-size: 13px; color: #606266; font-weight: 600; white-space: nowrap; }
.tpl-box { display: flex; align-items: center; gap: 8px; min-width: 0; color: #606266; font-size: 13px; }
.tpl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.group-label { font-size: 13px; color: #606266; font-weight: 600; margin-bottom: 6px; padding-left: 6px; border-left: 3px solid #409EFF; }
--
Gitblit v1.9.1