From 573e11132bd4a404934c03f9fd0802200e2ccd30 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期四, 03 九月 2026 08:59:57 +0800
Subject: [PATCH] feat: 报表新版式(上累计+下当月)与导入校验增强、I004 保护 + 09-02 测试文档
---
traffic-audit-web/src/views/DataImport.vue | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/traffic-audit-web/src/views/DataImport.vue b/traffic-audit-web/src/views/DataImport.vue
index 8e277e2..53ee36b 100644
--- a/traffic-audit-web/src/views/DataImport.vue
+++ b/traffic-audit-web/src/views/DataImport.vue
@@ -56,9 +56,9 @@
<div class="file-btns">
<el-upload action="#" :auto-upload="false" :show-file-list="false" multiple accept=".xlsx,.xls,.et"
:ref="'up' + g.key" :on-change="f => onFilePicked(g.key, f)" style="display:inline-block">
- <el-button size="mini" type="primary" plain icon="el-icon-folder-opened">閫夋嫨鏂囦欢</el-button>
+ <el-button size="mini" type="primary" plain icon="el-icon-folder-opened" :disabled="importing">閫夋嫨鏂囦欢</el-button>
</el-upload>
- <el-button size="mini" type="primary" icon="el-icon-upload2" :disabled="!fileCount(moduleSel[g.key])"
+ <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>
</div>
</div>
@@ -155,6 +155,7 @@
importType: 'h2032',
period: (() => { const d = new Date(); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') })(),
cityDirLoading: false,
+ importing: false,
sideOpen: false,
result: '',
error: '',
@@ -271,8 +272,8 @@
passengerIndividual: '鍏矾鏃呭/涓綋瀹㈣繍閲忔眹鎬�.xlsx',
energyMonthly: '鑳借��/妯℃澘_閬撹矾璐ц繍杞﹁締鑳芥簮娑堣�楁儏鍐碉紙2026锛�.xlsx',
energyAuth: '鑳借��/妯℃澘_鑳借�楄溅杈嗚繍鏀夸俊鎭�.xlsx',
- cityBus: '鍩庡競瀹㈣繍/瀵煎叆妯℃澘_鍩庡競鍏氦.xlsx',
- cityTaxi: '鍩庡競瀹㈣繍/瀵煎叆妯℃澘_宸℃父鍑虹.xlsx',
+ cityBus: '鍩庡競瀹㈣繍/鐢熸垚_鍩庡競鍏氦瀹㈣繍閲忓垎甯傚窞鏄庣粏.xlsx',
+ cityTaxi: '鍩庡競瀹㈣繍/鐢熸垚_宸℃父鍑虹瀹㈣繍閲忓垎甯傚窞鏄庣粏.xlsx',
cityTaxiAuth: '鍩庡競瀹㈣繍/瀵煎叆妯℃澘_鍑虹杞︿俊鎭�(杩愭斂杞﹁締淇℃伅).xlsx',
investment: '鎶曡祫/杈撳叆/瀹㈣繍锛堝杩愮珯锛�/鏇存柊_7鏈堝杩愮珯鎶曡祫鏄庣粏琛紙甯傚窞姹囨�诲ぇ琛紝缁欓瀵硷級.xlsx',
investmentLogistics: '鎶曡祫/杈撳叆/鐗╂祦锛堢墿娴佸洯鍖猴級/鏇存柊_7鏈堢墿娴佺珯鍦烘姇璧勬槑缁�.xls',
@@ -318,6 +319,7 @@
onFilePicked(key, file) {
const type = this.moduleSel[key]
if (!type) return
+ if (this.importing) { this.$message.warning('姝e湪瀵煎叆涓紝璇风◢鍊欏啀閫夋嫨鏂囦欢'); return }
const list = (this.files[type] || []).filter(f => f.name !== file.name)
list.push(file.raw)
this.$set(this.files, type, list)
@@ -336,12 +338,14 @@
}
const fileList = this.files[type] || []
if (!fileList.length) { this.$message.warning('璇峰厛涓鸿绫诲瀷閫夋嫨鏂囦欢'); return }
+ if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
+ if (this.importing) { this.$message.warning('姝e湪瀵煎叆涓紝璇风◢鍊欌��'); return }
+ this.importing = true
if (fileList.length > 1 || type === 'investment' || type === 'investmentLogistics') {
- this.batchImport(type, key, fileList)
+ this.batchImport(type, key, fileList).finally(() => { this.importing = false })
return
}
const file = fileList[0]
- if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
const g = this.groups.find(x => x.key === key)
const t = g.types.find(x => x.value === type)
const row = {
@@ -364,7 +368,7 @@
this.importType = ''
this.files[type] = null
this.$delete(this.fileNames, type)
- })
+ }).finally(() => { this.importing = false })
},
fileCount(type) { return (this.files[type] || []).length },
fileNamesText(type) {
@@ -380,7 +384,7 @@
const g = this.groups.find(x => x.key === key)
const label = g ? g.name : type
this.$message({ message: '姝e湪鎵归噺瀵煎叆 ' + fileList.length + ' 涓枃浠垛��', duration: 3000 })
- api.post('/import/batch', fd, { timeout: 600000 })
+ return api.post('/import/batch', fd, { timeout: 600000 })
.then(res => {
const d = (res && res.data) || {}
if (!d.files) {
--
Gitblit v1.9.1