| | |
| | | <template> |
| | | <el-container> |
| | | <el-header>交通统计报表审核系统 - 审核结果</el-header> |
| | | <el-container direction="vertical"> |
| | | <app-header title="交通统计报表审核系统 - 审核结果"></app-header> |
| | | <el-container> |
| | | <el-aside width="200px"> |
| | | <el-menu router default-active="/audit"> |
| | |
| | | <el-menu-item index="/report">报表生成</el-menu-item> |
| | | <el-menu-item index="/rules">规则管理</el-menu-item> |
| | | <el-menu-item index="/users">用户管理</el-menu-item> |
| | | <el-menu-item index="/login" @click="logout">退出登录</el-menu-item> |
| | | </el-menu> |
| | | </el-aside> |
| | | <el-main :class="{ 'main-focus': focusMode }" style="display:flex;flex-direction:column;min-height:0"> |
| | |
| | | </el-container> |
| | | </template> |
| | | <script> |
| | | import AppHeader from '@/components/AppHeader.vue' |
| | | import api from '@/api' |
| | | const DATA_TYPE_MAP = { H2032: 'h2032', H2031: 'h2031', CITY_BUS: 'cityBus', CITY_TAXI: 'cityTaxi' } |
| | | const EXPLAIN_TYPES = ['H2032', 'H2031', 'CITY_BUS', 'CITY_TAXI'] |
| | | export default { |
| | | components: { AppHeader }, |
| | | name: 'AuditResult', |
| | | data() { |
| | | return { |
| | |
| | | const fd = new FormData() |
| | | fd.append('period', this.period) |
| | | fd.append('reportType', this.reportType) |
| | | api.post('/audit/execute', fd) |
| | | api.post('/audit/execute', fd, { timeout: 120000 }) |
| | | .then(res => { |
| | | const count = (res.data || []).length |
| | | return api.get('/audit/ruleStats', { params: { period: this.period, reportType: this.reportType } }) |
| | |
| | | .then(() => api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } })) |
| | | .then(res => { this.applyResults(res.data) }) |
| | | .then(() => this.loadRuleStats()) |
| | | .catch(() => { this.$message.error('审核执行失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error('审核执行失败') }) |
| | | .finally(() => { this.loading = false }) |
| | | }, |
| | | markAudited() { |
| | |
| | | const fd = new FormData() |
| | | fd.append('period', this.period) |
| | | fd.append('reportType', this.reportType) |
| | | api.post('/audit/markAudited', fd) |
| | | api.post('/audit/markAudited', fd, { timeout: 60000 }) |
| | | .then(res => { |
| | | if (res.data) { |
| | | this.$message.success('已标记该期「' + this.reportType + '」为已审核,报表导出不再提示未审核') |
| | |
| | | return api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } }) |
| | | }) |
| | | .then(res => { this.applyResults(res.data) }) |
| | | .catch(() => { this.$message.error('标记失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error('标记失败') }) |
| | | .finally(() => { this.marking = false }) |
| | | }, |
| | | queryResults() { |
| | |
| | | api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } }) |
| | | .then(res => { this.applyResults(res.data) }) |
| | | .then(() => this.loadRuleStats()) |
| | | .catch(() => { this.$message.error('查询失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error('查询失败') }) |
| | | .finally(() => { this.loading = false }) |
| | | }, |
| | | toggleExplain(reportId) { |
| | |
| | | fd.append('reportType', this.reportType) |
| | | fd.append('reportId', reportId) |
| | | fd.append('explanation', explanation) |
| | | api.post('/explain/save', fd) |
| | | api.post('/explain/save', fd, { timeout: 60000 }) |
| | | .then(() => { |
| | | this.$message.success('企业解释已保存') |
| | | this.$set(this.explainDrafts, reportId, explanation) |
| | | this.results.forEach(r => { if (r.reportId === reportId) r.verifyExplanation = explanation }) |
| | | }) |
| | | .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.savingExplainId = null }) |
| | | }, |
| | | resetDraft(reportId) { |
| | |
| | | fd.append('id', row.id) |
| | | fd.append('status', status) |
| | | if (comment) fd.append('comment', comment) |
| | | api.post('/audit/review', fd) |
| | | api.post('/audit/review', fd, { timeout: 60000 }) |
| | | .then(() => { row.status = status; this.$message.success(status === 'CONFIRMED' ? '已确认' : '已忽略') }) |
| | | .catch(() => { this.$message.error('操作失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error('操作失败') }) |
| | | }, |
| | | updateBatchSelection() { this.batchSelection = this.filteredResults.filter(r => r._selected) }, |
| | | toggleSelectAll(value) { |
| | |
| | | fd.append('id', item.id) |
| | | fd.append('status', status) |
| | | if (comment) fd.append('comment', comment) |
| | | api.post('/audit/review', fd) |
| | | api.post('/audit/review', fd, { timeout: 60000 }) |
| | | .then(() => { item.status = status; done++; if (done === list.length) this.$message.success('已' + (status === 'CONFIRMED' ? '确认' : '忽略') + ' ' + done + ' 条') }) |
| | | .catch(() => { this.$message.error('部分操作失败') }) |
| | | .catch(e => { if (e && e._toast) return; this.$message.error('部分操作失败') }) |
| | | }) |
| | | }, |
| | | clearFilters() { this.enterpriseFilter = ''; this.ruleFilter = '' }, |