| | |
| | | <div class="card-head">选择类型并挂载文件 |
| | | <span class="tip" style="float:right;line-height:24px">各模块互不影响:先选类型、挂载文件,可「立即导入」或「加入队列」统一执行;也可在下方粘贴目录路径点「导入该目录」,文件夹里多个月的 Excel 会按文件名自动识别月份、分别导入对应报表期</span> |
| | | </div> |
| | | <el-tabs v-model="activeModule" class="module-tabs"> |
| | | <el-tab-pane v-for="g in groups" :key="g.key" :label="g.name" :name="g.key"> |
| | | <div class="module-tabs-head"> |
| | | <el-radio-group v-model="activeModule" size="small"> |
| | | <el-radio-button v-for="g in groups" :key="g.key" :label="g.key">{{ g.name }}</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | <div v-for="g in groups" :key="g.key" v-show="activeModule === g.key" class="module-tab-pane"> |
| | | <div class="module-sel"> |
| | | <el-select v-model="moduleSel[g.key]" placeholder="选择导入类型" style="width:260px" |
| | | @change="onModuleChange(g.key)" clearable> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | <div v-if="importType" class="type-info"> |
| | | <div>模板:{{ templateName }} |
| | | <el-link v-if="templateUrl" type="primary" icon="el-icon-download" :underline="false" |
| | |
| | | this.dirFiles = d.files || [] |
| | | this.dirFilesTruncated = !!d.filesTruncated |
| | | }) |
| | | .catch(e => { this.$message.error((e.response && e.response.data && e.response.data.message) || '目录加载失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error((e.response && e.response.data && e.response.data.message) || '目录加载失败') }) |
| | | .finally(() => { this.dirLoading = false }) |
| | | }, |
| | | goDirParent() { if (this.dirParent) this.loadDirs(this.dirParent) }, |
| | |
| | | }) |
| | | .catch(e => { |
| | | this.dirImporting = false |
| | | if (e && e._toast) return |
| | | this.$message.error((e.response && e.response.data && e.response.data.message) || '目录不存在或无法访问:' + dir) |
| | | }) |
| | | }, |
| | |
| | | this.afterImport() |
| | | }) |
| | | .catch(e => { |
| | | if (e && e._toast) return |
| | | this.$message.error((e.response && e.response.data && e.response.data.message) || '批量导入失败') |
| | | }) |
| | | .finally(() => { this.cityDirLoading = false }) |
| | |
| | | }) |
| | | this.overview = map |
| | | }) |
| | | .catch(() => {}) |
| | | .catch(e => { if (!e || !e._toast) this.$message.error('导入记录加载失败,请刷新重试') }) |
| | | .finally(() => { this.batchLoading = false }) |
| | | }, |
| | | batchKeyToType(k) { |
| | |
| | | .el-header { background: #409EFF; color: white; line-height: 60px; font-size: 18px; } |
| | | .import-card { margin-bottom: 0; } |
| | | .card-head { font-weight: 600; margin-bottom: 6px; } |
| | | .module-tabs >>> .el-tabs__header { margin-bottom: 12px; } |
| | | .module-sel { max-width: 480px; } |
| | | .group-label { font-size: 13px; color: #606266; font-weight: 600; margin-bottom: 6px; padding-left: 6px; border-left: 3px solid #409EFF; } |
| | | .module-file { margin-top: 8px; } |
| | |
| | | .dir-empty { padding: 14px; font-size: 12px; color: #909399; text-align: center; } |
| | | .dir-files { margin-top: 8px; } |
| | | |
| | | .module-tabs-head { margin-bottom: 10px; } |
| | | .module-tab-pane { min-height: 120px; } |
| | | </style> |