| | |
| | | <el-button size="small" v-else type="primary" @click="closeTask">关闭</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 汇总大表导出前缺数清单弹窗(2026-10-12 用户要求:缺数摆到台面上) --> |
| | | <el-dialog title="生成前提示 - 数据缺失清单" :visible.sync="missDialogVisible" width="720px" top="6vh"> |
| | | <div class="miss-body"> |
| | | <p class="miss-lead">报表期 <b>{{ missDialogPeriod }}</b>:以下数据本次生成会缺失/异常,生成件末尾也会附《数据缺失清单》页。</p> |
| | | <template v-if="missDialogMissing.length"> |
| | | <div class="miss-sec">一、缺数清单(该有的数没有) 共 {{ missDialogMissing.length }} 条</div> |
| | | <ul class="miss-list"><li v-for="(t, i) in missDialogMissing" :key="'m' + i">{{ t }}</li></ul> |
| | | </template> |
| | | <template v-if="missDialogCheck.length"> |
| | | <div class="miss-sec">二、数据体检(数值不合理) 共 {{ missDialogCheck.length }} 条</div> |
| | | <ul class="miss-list"><li v-for="(t, i) in missDialogCheck" :key="'c' + i">{{ t }}</li></ul> |
| | | </template> |
| | | <p class="miss-tip">缺数多为源数据尚未导入,导入后重新生成即可;体检项请核对源文件。</p> |
| | | </div> |
| | | <span slot="footer"> |
| | | <el-button size="small" @click="missDialogVisible = false">取消</el-button> |
| | | <el-button size="small" type="primary" @click="confirmMissDialog">仍要生成</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | taskFileName: '', |
| | | taskFileSize: 0, |
| | | taskKey: 'summaryWorkbook', |
| | | // 导出前缺数清单弹窗(2026-10-12):缺数/体检摆到台面上,确认后再生成 |
| | | missDialogVisible: false, |
| | | missDialogPeriod: '', |
| | | missDialogMissing: [], |
| | | missDialogCheck: [], |
| | | missDialogRefresh: false, |
| | | modules: [ |
| | | { |
| | | key: 'summary', title: '汇总大表', items: [ |
| | |
| | | }) |
| | | .catch(err => this.failWith(err)) |
| | | }, |
| | | // 导出前缺数检查:调只读接口把缺数/体检结果摆到用户面前,确认后再走异步生成任务 |
| | | generateSummaryWorkbook(refresh) { |
| | | if (!this.period) { this.$message.warning('请先选择周期和月份'); return } |
| | | const params = { period: this.period } |
| | | Promise.all([ |
| | | api.get('/report/summaryWorkbook/missing', { params, timeout: 60000 }).catch(() => null), |
| | | api.get('/report/summaryWorkbook/freightCheck', { params, timeout: 60000 }).catch(() => null) |
| | | ]).then(res => { |
| | | const miss = (res[0] && res[0].code === 200 && res[0].data) || [] |
| | | const chk = (res[1] && res[1].code === 200 && res[1].data) || [] |
| | | if (!miss.length && !chk.length) { this.startSummaryTask(refresh); return } |
| | | this.missDialogPeriod = this.period |
| | | this.missDialogMissing = miss |
| | | this.missDialogCheck = chk |
| | | this.missDialogRefresh = refresh |
| | | this.missDialogVisible = true |
| | | }) |
| | | }, |
| | | confirmMissDialog() { |
| | | this.missDialogVisible = false |
| | | this.startSummaryTask(this.missDialogRefresh) |
| | | }, |
| | | restartTask() { this.startSummaryTask(true) }, |
| | | closeTask() { this.taskVisible = false; this.stopTaskPolling(); this.loading = '' }, |
| | | // 生成中收起弹窗:任务继续在后台执行,完成后仍会自动下载(与原来同步导出的「点完即下载」一致) |
| | |
| | | const doExport = () => { |
| | | if (items.length === 1) { |
| | | // 汇总大表生成一次约 10~20 秒,走异步任务(进度弹窗),避免点击后长时间无响应 |
| | | if (items[0].key === 'summaryWorkbook') { this.startSummaryTask(false); return } |
| | | if (items[0].key === 'summaryWorkbook') { this.generateSummaryWorkbook(false); return } |
| | | api.get('/report/export/' + items[0].key, { params, responseType: 'blob', timeout: 120000 }) |
| | | .then(res => { this.downloadBlob(res, this.fileNameOf(items[0])); this.$message.success('报表导出成功'); this.loading = '' }) |
| | | .catch(err => this.failWith(err)) |
| | |
| | | .task-meta { margin: 2px 0; font-size: 12px; color:#909399; line-height: 1.6; } |
| | | .task-error { margin: 8px 0 0; font-size: 13px; color:#F56C6C; word-break: break-all; } |
| | | .task-done { margin: 8px 0 0; font-size: 13px; color:#67C23A; line-height: 1.6; } |
| | | /* 导出前缺数清单弹窗 */ |
| | | .miss-body { max-height: 62vh; overflow-y: auto; } |
| | | .miss-lead { font-size: 13px; color: #303133; margin: 0 0 10px; line-height: 1.7; } |
| | | .miss-sec { font-size: 13px; font-weight: 600; color: #F56C6C; margin: 10px 0 4px; } |
| | | .miss-list { margin: 0; padding-left: 20px; font-size: 13px; color: #303133; line-height: 1.7; } |
| | | .miss-list li { margin: 2px 0; } |
| | | .miss-tip { font-size: 12px; color: #909399; margin: 10px 0 0; } |
| | | </style> |
| | | |
| | | <style> |