1、审计内容里的操作功能优化

2、审计内容9增加一个表的内容生成
3、添加取证单弹窗
This commit is contained in:
2026-01-13 12:19:08 +08:00
parent d574975c97
commit d8b4cba12d
15 changed files with 2365 additions and 1381 deletions

View File

@@ -0,0 +1,543 @@
<template>
<a-modal
:visible="visible"
title="审计取证单预览"
:width="1100"
:footer="null"
@cancel="handleCancel"
destroy-on-close
>
<div class="evidence-actions">
<a-space>
<a-button @click="resetFields">重置内容</a-button>
<a-button type="primary" @click="printEvidence">打印/导出</a-button>
</a-space>
<div class="action-tip">可直接在表格中编辑打印即可生成与效果图一致的取证单</div>
</div>
<div class="evidence-container">
<div class="evidence-sheet" ref="printArea">
<div class="sheet-title">审计取证单</div>
<div class="sheet-meta">
<div class="meta-left">
<span>案引号</span>
<input
v-model="form.caseIndex"
class="inline-input long"
placeholder="填写案件编号"
/>
</div>
<div class="meta-right">
<span></span>
<input v-model="form.pageIndex" class="inline-input small" />
<span></span>
<input v-model="form.pageTotal" class="inline-input small" />
<span></span>
</div>
</div>
<table class="sheet-table">
<colgroup>
<col style="width: 18%" />
<col style="width: 32%" />
<col style="width: 18%" />
<col style="width: 32%" />
</colgroup>
<tbody>
<tr>
<th>项目名称</th>
<td colspan="3">
<textarea
v-model="form.projectName"
class="cell-input single"
placeholder="填写项目名称"
></textarea>
</td>
</tr>
<tr>
<th>被审计调查单位或个人</th>
<td colspan="3">
<textarea
v-model="form.auditedTarget"
class="cell-input single"
placeholder="填写被审计(调查)单位或个人"
></textarea>
</td>
</tr>
<tr>
<th>审计调查事项</th>
<td colspan="3">
<textarea
v-model="form.auditMatter"
class="cell-input single"
placeholder="填写审计(调查)事项"
></textarea>
</td>
</tr>
<tr>
<th>摘要提示</th>
<td colspan="3" class="summary-cell">
<div class="summary-title">
审计调查事项摘要包括标题审计记录审计发现定性依据
</div>
<div class="summary-hint">
1. 标题突出核心问题采用观点性语句可作为审计内容审计目标的结论性描述
</div>
<div class="summary-hint">
2. 审计记录客观记录审计核查的具体事实时间地点主体行为数据等避免主观评价
</div>
<div class="summary-hint">
3. 审计发现基于审计记录提出具体问题性质先事实后定性避免夸大
</div>
</td>
</tr>
<tr>
<th>标题</th>
<td colspan="3">
<textarea
v-model="form.summaryTitle"
class="cell-input"
placeholder="填写核心标题或要点"
></textarea>
</td>
</tr>
<tr>
<th>审计记录</th>
<td colspan="3">
<textarea
v-model="form.auditRecord"
class="cell-input tall"
placeholder="客观记录审计核查的过程与事实"
></textarea>
</td>
</tr>
<tr>
<th>审计发现</th>
<td colspan="3">
<textarea
v-model="form.auditFinding"
class="cell-input tall"
placeholder="写明审计发现的事实、性质及影响"
></textarea>
</td>
</tr>
<tr>
<th>定性依据</th>
<td colspan="3">
<textarea
v-model="form.evidenceBasis"
class="cell-input"
placeholder="引用法规、制度或合同条款作为依据"
></textarea>
</td>
</tr>
<tr>
<th>处理</th>
<td colspan="3">
<textarea
v-model="form.handling"
class="cell-input"
placeholder="拟采取的处理措施"
></textarea>
</td>
</tr>
<tr>
<th>建议</th>
<td colspan="3">
<textarea
v-model="form.suggestion"
class="cell-input"
placeholder="提出改进或整改建议"
></textarea>
</td>
</tr>
<tr>
<th>附件</th>
<td colspan="3">
<textarea
v-model="form.attachment"
class="cell-input"
placeholder="列示随附的证明材料"
></textarea>
</td>
</tr>
<tr>
<th>审计人员</th>
<td colspan="2">
<input
v-model="form.auditors"
class="cell-input input-line"
placeholder="填写审计人员"
/>
</td>
<th>编制日期</th>
<td>
<input
v-model="form.compileDate"
class="cell-input input-line"
placeholder="YYYY-MM-DD"
/>
</td>
</tr>
<tr>
<th>证据提供单位或个人意见</th>
<td colspan="2">
<textarea
v-model="form.providerOpinion"
class="cell-input tall"
placeholder="盖章并填写确认意见"
></textarea>
</td>
<td class="date-cell">
<div class="date-label">日期</div>
<input
v-model="form.providerDate"
class="cell-input input-line"
placeholder="YYYY-MM-DD"
/>
</td>
</tr>
</tbody>
</table>
<div class="footer-note">
<div class="note-row">
附件
<input
v-model="form.attachmentPages"
class="inline-input small"
placeholder="页数"
/>
</div>
<div class="note">
说明1. 请你单位在
<input
v-model="form.feedbackDeadline"
class="inline-input long"
placeholder="填写反馈期限"
/>
前反馈意见逾期未反馈视为无异议
</div>
<div class="note">
2. 证据提供单位意见栏如填写不下可另附说明
</div>
</div>
</div>
</div>
</a-modal>
</template>
<script lang="ts" setup>
import { PropType, reactive, ref, watch } from 'vue';
import { message } from 'ant-design-vue';
type BaseInfo = {
caseIndex?: string;
projectName?: string;
auditedTarget?: string;
auditMatter?: string;
};
const props = defineProps({
visible: {
type: Boolean,
default: false
},
baseInfo: {
type: Object as PropType<BaseInfo>,
default: () => ({})
},
selectedRows: {
type: Array as PropType<any[]>,
default: () => []
}
});
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
}>();
const printArea = ref<HTMLElement | null>(null);
const defaultForm = () => ({
caseIndex: '',
pageIndex: '1',
pageTotal: '1',
projectName: '',
auditedTarget: '',
auditMatter: '',
summaryTitle: '',
auditRecord: '',
auditFinding: '',
evidenceBasis: '',
handling: '',
suggestion: '',
attachment: '',
auditors: '',
compileDate: '',
providerOpinion: '',
providerDate: '',
attachmentPages: '',
feedbackDeadline: ''
});
const form = reactive(defaultForm());
const applyBaseInfo = () => {
Object.assign(form, defaultForm(), props.baseInfo || {});
if (props.selectedRows && props.selectedRows.length > 0) {
const firstRow: any = props.selectedRows[0] || {};
form.summaryTitle =
firstRow.title || firstRow.name || form.summaryTitle || '';
form.auditRecord =
firstRow.auditRecord ||
firstRow.auditContent ||
firstRow.content ||
form.auditRecord ||
'';
form.auditFinding =
firstRow.auditFinding || firstRow.testResult || form.auditFinding || '';
}
if (!form.compileDate) {
const now = new Date();
form.compileDate = `${now.getFullYear()}-${String(
now.getMonth() + 1
).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
}
};
watch(
() => props.visible,
(visible) => {
if (visible) {
applyBaseInfo();
}
}
);
watch(
() => props.baseInfo,
() => {
if (props.visible) {
applyBaseInfo();
}
},
{ deep: true }
);
const handleCancel = () => {
emit('update:visible', false);
};
const resetFields = () => {
applyBaseInfo();
message.success('内容已重置');
};
const printEvidence = () => {
const area = printArea.value;
if (!area) {
message.warning('暂无可导出的内容');
return;
}
const newWindow = window.open('', '_blank');
if (!newWindow) {
message.error('浏览器阻止了弹窗,请允许弹窗后重试');
return;
}
const style = `
* { box-sizing: border-box; }
body { margin: 0; padding: 24px; font-family: 'Songti SC', 'SimSun', serif; }
.sheet-title { text-align: center; font-size: 28px; letter-spacing: 4px; margin-bottom: 12px; }
.sheet-meta { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.inline-input { border: none; border-bottom: 1px solid #000; min-width: 60px; padding: 2px 4px; font-size: 14px; }
.inline-input.small { width: 48px; text-align: center; }
.inline-input.long { min-width: 180px; }
.sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet-table th, .sheet-table td { border: 1px solid #000; padding: 8px 10px; vertical-align: top; font-size: 14px; }
.sheet-table th { background: #fafafa; font-weight: 600; text-align: center; }
.cell-input { width: 100%; border: none; resize: vertical; min-height: 34px; font-size: 14px; line-height: 1.5; font-family: inherit; }
.cell-input:focus { outline: none; }
.cell-input.single { min-height: 32px; }
.cell-input.tall { min-height: 120px; }
.input-line { height: 32px; }
.summary-title { font-weight: 700; margin-bottom: 4px; }
.summary-hint { color: #555; line-height: 1.5; margin-bottom: 2px; }
.summary-cell { background: #fcfcfc; }
.date-cell { display: flex; flex-direction: column; gap: 6px; }
.date-label { font-weight: 600; }
.footer-note { margin-top: 12px; font-size: 14px; line-height: 1.6; }
.note-row { margin-bottom: 4px; }
.note input { vertical-align: middle; }
`;
newWindow.document.write(`
<html>
<head>
<title>审计取证单</title>
<style>${style}</style>
</head>
<body>${area.innerHTML}</body>
</html>
`);
newWindow.document.close();
newWindow.focus();
newWindow.print();
};
</script>
<style scoped>
.evidence-actions {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.action-tip {
color: #666;
font-size: 13px;
}
.evidence-container {
max-height: 70vh;
overflow: auto;
background: #f5f5f5;
padding: 12px;
}
.evidence-sheet {
background: #fff;
padding: 16px 20px;
border: 1px solid #e5e5e5;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.sheet-title {
text-align: center;
font-size: 28px;
letter-spacing: 4px;
margin-bottom: 12px;
font-weight: 600;
}
.sheet-meta {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 10px;
}
.inline-input {
border: none;
border-bottom: 1px solid #000;
min-width: 60px;
padding: 2px 4px;
font-size: 14px;
}
.inline-input.small {
width: 48px;
text-align: center;
}
.inline-input.long {
min-width: 180px;
}
.sheet-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
.sheet-table th,
.sheet-table td {
border: 1px solid #000;
padding: 8px 10px;
vertical-align: top;
font-size: 14px;
}
.sheet-table th {
background: #fafafa;
font-weight: 600;
text-align: center;
}
.cell-input {
width: 100%;
border: none;
resize: vertical;
min-height: 34px;
font-size: 14px;
line-height: 1.5;
font-family: inherit;
}
.cell-input:focus {
outline: none;
}
.cell-input.single {
min-height: 32px;
}
.cell-input.tall {
min-height: 120px;
}
.input-line {
height: 32px;
}
.summary-cell {
background: #fcfcfc;
}
.summary-title {
font-weight: 700;
margin-bottom: 4px;
}
.summary-hint {
color: #555;
line-height: 1.5;
margin-bottom: 2px;
}
.date-cell {
display: flex;
flex-direction: column;
gap: 6px;
}
.date-label {
font-weight: 600;
}
.footer-note {
margin-top: 12px;
font-size: 14px;
line-height: 1.6;
}
.note-row {
margin-bottom: 4px;
}
</style>

View File

@@ -17,8 +17,11 @@ export function initNavigationItems() {
mode: 'table', mode: 'table',
showFileSelect: true, // 所有项都显示文件选择 showFileSelect: true, // 所有项都显示文件选择
data: [], data: [],
extraData: [],
currentTableIndex: 0, // 当前选中的表格索引 currentTableIndex: 0, // 当前选中的表格索引
columns: null, columns: null,
extraTableTitle: config?.extraTableTitle || null,
extraColumns: config?.extraColumns || [],
tableOptions: config?.options || [], tableOptions: config?.options || [],
count: index + 1, count: index + 1,
tableType: config?.type || `auditContent${index + 1}`, tableType: config?.type || `auditContent${index + 1}`,

View File

@@ -68,12 +68,12 @@ export const partyConductColumns = [
width: 200, width: 200,
// ellipsis: true // ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -81,12 +81,12 @@ export const auditHistoryColumns = [
width: 200, width: 200,
// ellipsis: true // ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -429,12 +429,12 @@ export const eightRegColumns = [
width: 200, width: 200,
ellipsis: true ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 140 // width: 140
} // }
]; ];
export default { export default {

View File

@@ -48,12 +48,12 @@ export const strategyAuditColumns = [
align: 'center', align: 'center',
// ellipsis: true // ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
width: 100, // width: 100,
align: 'center' // align: 'center'
} // }
]; ];
export default { export default {

View File

@@ -126,12 +126,12 @@ export const decisionTableColumns = [
} }
] ]
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 140 // width: 140
} // }
]; ];
export default { export default {

View File

@@ -164,12 +164,12 @@ export const budgetExecutionColumns = [
width: 200, width: 200,
ellipsis: true ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -105,12 +105,12 @@ export const stateAssetsManageColumns = [
width: 200, width: 200,
ellipsis: true ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -41,12 +41,12 @@ export const investmentSituationColumns = [
width: 200, width: 200,
// ellipsis: true // ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
// 删除不再需要的单独列配置 // 删除不再需要的单独列配置

View File

@@ -70,12 +70,12 @@ export const internalControlTestColumns = [
width: 200, width: 200,
// ellipsis: true // ellipsis: true
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -42,12 +42,12 @@ export const personnelEstablishmentColumns = [
align: 'center', align: 'center',
width: 200, width: 200,
}, },
{ // {
title: '操作', // title: '操作',
key: 'action', // key: 'action',
align: 'center', // align: 'center',
width: 100 // width: 100
} // }
]; ];
export default { export default {

View File

@@ -0,0 +1,60 @@
export const benefitEstablishmentColumns = [
{
title: '序号',
dataIndex: 'index',
key: 'index',
width: 80,
align: 'center'
},
{
title: '凭证号',
dataIndex: 'voucher',
key: 'voucher',
align: 'center'
},
{
title: '支出日期',
dataIndex: 'expenditureDate',
key: 'expenditureDate',
align: 'center'
},
{
title: '用途',
dataIndex: 'usage',
key: 'usage',
align: 'center'
},
{
title: '收款方',
dataIndex: 'payee',
key: 'payee',
align: 'center'
},
{
title: '金额(元)',
dataIndex: 'amount',
key: 'amount',
align: 'center'
},
{
title: '归属部门/人员',
dataIndex: 'belongTo',
key: 'belongTo',
align: 'center'
},
{
title: '款项性质说明',
dataIndex: 'natureDesc',
key: 'natureDesc',
align: 'center'
},
{
title: '违规说明',
dataIndex: 'violationDesc',
key: 'violationDesc',
align: 'center'
}
];
export default benefitEstablishmentColumns;

View File

@@ -1,329 +1,457 @@
import table9ExtraColumns from './table9ExtraColumns';
export const tableConfigs = { export const tableConfigs = {
// 审计内容1表格配置 // 审计内容1表格配置
auditContent1: { auditContent1: {
type: 'auditContent1', type: 'auditContent1',
title: '贯彻决策部署情况', title: '贯彻决策部署情况',
options: [ options: [
// { title: '贯彻决策部署', value: 'default1', columns: () => import('./table1Columns').then(m => m.default1Columns) }, // { title: '贯彻决策部署', value: 'default1', columns: () => import('./table1Columns').then(m => m.default1Columns) },
{ title: '领导班子名单', value: 'leaderList', columns: () => import('./table1Columns').then(m => m.leaderListColumns) }, {
{ title: '决策支出表', value: 'expense', columns: () => import('./table1Columns').then(m => m.expenseColumns) }, title: '领导班子名单',
{ title: '八项规定', value: 'eightReg', columns: () => import('./table1Columns').then(m => m.eightRegColumns) } value: 'leaderList',
], columns: () =>
// 接口映射 import('./table1Columns').then((m) => m.leaderListColumns)
interfaceMap: { },
default1: '/api/ai/auditContent1/generateDefault1Table', {
leaderList: '/api/ai/auditContent1/generateLeaderListTable', title: '决策支出表',
expense: '/api/ai/auditContent1/generateExpenseTable', value: 'expense',
eightReg: '/api/ai/auditContent1/generateEightRegTable' columns: () => import('./table1Columns').then((m) => m.expenseColumns)
} },
}, {
// 审计内容2表格配置 title: '八项规定',
auditContent2: { value: 'eightReg',
type: 'auditContent2', columns: () => import('./table1Columns').then((m) => m.eightRegColumns)
title: '单位发展战略执行', }
options: [ ],
{ title: '单位发展战略执行', value: 'strategyAudit', columns: () => import('./table2Columns').then(m => m.strategyAuditColumns) } // 接口映射
], interfaceMap: {
interfaceMap: { default1: '/api/ai/auditContent1/generateDefault1Table',
strategyAudit: '/api/ai/auditContent2/generateStrategyAuditTable' leaderList: '/api/ai/auditContent1/generateLeaderListTable',
} expense: '/api/ai/auditContent1/generateExpenseTable',
}, eightReg: '/api/ai/auditContent1/generateEightRegTable'
// 审计内容3表格配置
auditContent3: {
type: 'auditContent3',
title: '重大经济决策调查',
options: [
{ title: '重大经济决策调查表', value: 'decisionTable', columns: () => import('./table3Columns').then(m => m.decisionTableColumns) },
{ title: '三重一大', value: 'tripleOne', columns: () => import('./table3Columns').then(m => m.tripleOneColumns) }
],
interfaceMap: {
tripleOne: '/api/ai/auditContent3/generateTripleOneTable',
decisionTable: '/api/ai/auditContent3/generateDecisionTable'
}
},
// 审计内容4表格配置
auditContent4: {
type: 'auditContent4',
title: '目标完成情况',
options: [
{ title: '目标责任完成情况表', value: 'target', columns: () => import('./table4Columns').then(m => m.columns0) }
],
interfaceMap: {
target: '/api/ai/auditContent4/generateTargetTable'
}
},
// 审计内容5表格配置
auditContent5: {
type: 'auditContent5',
title: '财务管理情况',
options: [
{ title: '预算管理审计', value: 'budgetManage', columns: () => import('./table5Columns').then(m => m.budgetManageColumns) },
{ title: '预算执行情况审计', value: 'budgetExecution', columns: () => import('./table5Columns').then(m => m.budgetExecutionColumns) }
],
interfaceMap: {
budgetManage: '/api/ai/auditContent5/generateBudgetManageTable',
budgetExecution: '/api/ai/auditContent5/generateBudgetExecutionTable'
}
},
// 审计内容6表格配置
auditContent6: {
type: 'auditContent6',
title: '国资管理情况',
options: [
{ title: '国有资产管理审计', value: 'assets', columns: () => import('./table6Columns').then(m => m.stateAssetsManageColumns) }
],
interfaceMap: {
assets: '/api/ai/auditContent6/generateAssetsTable'
}
},
auditContent7: {
type: 'auditContent7',
title: '重大投资情况',
options: [
{ title: '重大投资情况审计', value: 'investmentSituation', columns: () => import('./table7Columns').then(m => m.investmentSituationColumns) },
],
interfaceMap: {
investmentSituation: '/api/ai/auditContent7/generateInvestmentSituationTable'
}
},
auditContent8: {
type: 'auditContent8',
title: '治理结构与内部控制',
options: [
{ title: '内部控制测试', value: 'internalControl', columns: () => import('./table8Columns').then(m => m.internalControlTestColumns) }
],
interfaceMap: {
internalControl: '/api/ai/auditContent8/generateInternalControlTable'
}
},
auditContent9: {
type: 'auditContent9',
title: '人员编制管理',
options: [
{ title: '人员编制管理审计', value: 'personnel', columns: () => import('./table9Columns').then(m => m.personnelEstablishmentColumns) }
],
interfaceMap: {
personnel: '/api/ai/auditContent9/generatePersonnelTable'
}
},
auditContent10: {
type: 'auditContent10',
title: '廉政情况',
options: [
{ title: '党风廉政建设责任制审计', value: 'partyConduct', columns: () => import('./table10Columns').then(m => m.partyConductColumns) }
],
interfaceMap: {
partyConduct: '/api/ai/auditContent10/generatePartyConductTable'
}
},
auditContent11: {
type: 'auditContent11',
title: '历史审计问题整改',
options: [
{ title: '历史审计问题整改', value: 'history', columns: () => import('./table11Columns').then(m => m.auditHistoryColumns) }
],
interfaceMap: {
history: '/api/ai/auditContent11/generateHistoryTable'
}
} }
},
// 审计内容2表格配置
auditContent2: {
type: 'auditContent2',
title: '单位发展战略执行',
options: [
{
title: '单位发展战略执行',
value: 'strategyAudit',
columns: () =>
import('./table2Columns').then((m) => m.strategyAuditColumns)
}
],
interfaceMap: {
strategyAudit: '/api/ai/auditContent2/generateStrategyAuditTable'
}
},
// 审计内容3表格配置
auditContent3: {
type: 'auditContent3',
title: '重大经济决策调查',
options: [
{
title: '重大经济决策调查表',
value: 'decisionTable',
columns: () =>
import('./table3Columns').then((m) => m.decisionTableColumns)
},
{
title: '三重一大',
value: 'tripleOne',
columns: () => import('./table3Columns').then((m) => m.tripleOneColumns)
}
],
interfaceMap: {
tripleOne: '/api/ai/auditContent3/generateTripleOneTable',
decisionTable: '/api/ai/auditContent3/generateDecisionTable'
}
},
// 审计内容4表格配置
auditContent4: {
type: 'auditContent4',
title: '目标完成情况',
options: [
{
title: '目标责任完成情况表',
value: 'target',
columns: () => import('./table4Columns').then((m) => m.columns0)
}
],
interfaceMap: {
target: '/api/ai/auditContent4/generateTargetTable'
}
},
// 审计内容5表格配置
auditContent5: {
type: 'auditContent5',
title: '财务管理情况',
options: [
{
title: '预算管理审计',
value: 'budgetManage',
columns: () =>
import('./table5Columns').then((m) => m.budgetManageColumns)
},
{
title: '预算执行情况审计',
value: 'budgetExecution',
columns: () =>
import('./table5Columns').then((m) => m.budgetExecutionColumns)
}
],
interfaceMap: {
budgetManage: '/api/ai/auditContent5/generateBudgetManageTable',
budgetExecution: '/api/ai/auditContent5/generateBudgetExecutionTable'
}
},
// 审计内容6表格配置
auditContent6: {
type: 'auditContent6',
title: '国资管理情况',
options: [
{
title: '国有资产管理审计',
value: 'assets',
columns: () =>
import('./table6Columns').then((m) => m.stateAssetsManageColumns)
}
],
interfaceMap: {
assets: '/api/ai/auditContent6/generateAssetsTable'
}
},
auditContent7: {
type: 'auditContent7',
title: '重大投资情况',
options: [
{
title: '重大投资情况审计',
value: 'investmentSituation',
columns: () =>
import('./table7Columns').then((m) => m.investmentSituationColumns)
}
],
interfaceMap: {
investmentSituation:
'/api/ai/auditContent7/generateInvestmentSituationTable'
}
},
auditContent8: {
type: 'auditContent8',
title: '治理结构与内部控制',
options: [
{
title: '内部控制测试',
value: 'internalControl',
columns: () =>
import('./table8Columns').then((m) => m.internalControlTestColumns)
}
],
interfaceMap: {
internalControl: '/api/ai/auditContent8/generateInternalControlTable'
}
},
auditContent9: {
type: 'auditContent9',
title: '人员编制管理',
options: [
{
title: '人员编制管理审计',
value: 'personnel',
columns: () =>
import('./table9Columns').then((m) => m.personnelEstablishmentColumns)
}
],
extraTableTitle: '福利费超范围支出明细清单',
extraColumns: table9ExtraColumns,
interfaceMap: {
personnel: '/api/ai/auditContent9/generatePersonnelTable'
}
},
auditContent10: {
type: 'auditContent10',
title: '廉政情况',
options: [
{
title: '党风廉政建设责任制审计',
value: 'partyConduct',
columns: () =>
import('./table10Columns').then((m) => m.partyConductColumns)
}
],
interfaceMap: {
partyConduct: '/api/ai/auditContent10/generatePartyConductTable'
}
},
auditContent11: {
type: 'auditContent11',
title: '历史审计问题整改',
options: [
{
title: '历史审计问题整改',
value: 'history',
columns: () =>
import('./table11Columns').then((m) => m.auditHistoryColumns)
}
],
interfaceMap: {
history: '/api/ai/auditContent11/generateHistoryTable'
}
}
}; };
// 获取表格配置 // 获取表格配置
export function getTableConfig(sectionIndex: number) { export function getTableConfig(sectionIndex: number) {
const configKeys = Object.keys(tableConfigs); const configKeys = Object.keys(tableConfigs);
if (sectionIndex >= 0 && sectionIndex < configKeys.length) { if (sectionIndex >= 0 && sectionIndex < configKeys.length) {
return tableConfigs[configKeys[sectionIndex]]; return tableConfigs[configKeys[sectionIndex]];
} }
return null; return null;
} }
// 获取所有表格配置 // 获取所有表格配置
export function getAllTableConfigs() { export function getAllTableConfigs() {
return tableConfigs; return tableConfigs;
} }
// 通过接口名称查找表格配置 // 通过接口名称查找表格配置
export function findTableConfigByInterface(interfaceName: string) { export function findTableConfigByInterface(interfaceName: string) {
for (const [key, config] of Object.entries(tableConfigs)) { for (const [key, config] of Object.entries(tableConfigs)) {
for (const [tableValue, tableInterface] of Object.entries(config.interfaceMap || {})) { for (const [tableValue, tableInterface] of Object.entries(
if (tableInterface === interfaceName) { config.interfaceMap || {}
return { )) {
sectionType: key, if (tableInterface === interfaceName) {
tableValue, return {
config sectionType: key,
}; tableValue,
} config
} };
}
} }
return null; }
return null;
} }
// 解析workPaperIndex字符串为对象数组 // 解析workPaperIndex字符串为对象数组
function parseWorkPaperIndex(workPaperIndex) { function parseWorkPaperIndex(workPaperIndex) {
if (!workPaperIndex || !Array.isArray(workPaperIndex)) return []; if (!workPaperIndex || !Array.isArray(workPaperIndex)) return [];
return workPaperIndex.map(item => { return workPaperIndex.map((item) => {
if (item && typeof item === 'object') { if (item && typeof item === 'object') {
return { return {
fileId: item.fileId || item.file_id || '', fileId: item.fileId || item.file_id || '',
fileName: item.fileName || item.file_name || '', fileName: item.fileName || item.file_name || '',
fileUrl: item.fileUrl || item.url || '' fileUrl: item.fileUrl || item.url || ''
}; };
} }
if (typeof item === 'string') { if (typeof item === 'string') {
const parts = item.split('||'); const parts = item.split('||');
if (parts.length >= 3) { if (parts.length >= 3) {
return {
fileId: parts[0] || '',
fileName: parts[1] || '',
fileUrl: parts[2] || ''
};
}
}
// 兼容旧格式
return { return {
fileId: '', fileId: parts[0] || '',
fileName: typeof item === 'string' ? item : '', fileName: parts[1] || '',
fileUrl: '' fileUrl: parts[2] || ''
}; };
}); }
}
// 兼容旧格式
return {
fileId: '',
fileName: typeof item === 'string' ? item : '',
fileUrl: ''
};
});
} }
// 通用数据映射函数 // 通用数据映射函数
export function createDataMapper(type: string) { export function createDataMapper(type: string) {
const mappers = { const mappers = {
default1: (data) => data.map((item, index) => ({ default1: (data) =>
key: index, data.map((item, index) => ({
index: index + 1, key: index,
...item, index: index + 1,
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) ...item,
})), workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
leaderList: (data) => data.map((item, index) => ({ })),
key: index, leaderList: (data) =>
...item, data.map((item, index) => ({
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) key: index,
})), ...item,
expense: (data) => data.map((item, index) => ({ workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
key: index, })),
...item, expense: (data) =>
finalStatementAmount: formatAmount(item.finalStatementAmount), data.map((item, index) => ({
initialBudgetAmount: formatAmount(item.initialBudgetAmount), key: index,
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) ...item,
})), finalStatementAmount: formatAmount(item.finalStatementAmount),
eightReg: (data) => data.map((item, index) => ({ initialBudgetAmount: formatAmount(item.initialBudgetAmount),
key: index, workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
...item, })),
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) eightReg: (data) =>
})), data.map((item, index) => ({
strategyAudit: (data) => data.map((item, index) => ({ key: index,
key: index, ...item,
index: index + 1, workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
...item, })),
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) strategyAudit: (data) =>
})), data.map((item, index) => ({
tripleOne: (data) => data.map((item, index) => ({ key: index,
key: index, index: index + 1,
...item, ...item,
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
})), })),
decisionTable: (data) => data.map((item, index) => ({ tripleOne: (data) =>
key: index, data.map((item, index) => ({
index: index + 1, key: index,
goods: item.executionEffect?.good || item.goods || '否', ...item,
normal: item.executionEffect?.normal || item.normal || '否', workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
bad: item.executionEffect?.bad || item.bad || '否', })),
...item, decisionTable: (data) =>
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) data.map((item, index) => ({
})), key: index,
budgetManage: (data) => data.map((item, index) => ({ index: index + 1,
key: index, goods: item.executionEffect?.good || item.goods || '否',
index: index + 1, normal: item.executionEffect?.normal || item.normal || '否',
...item, bad: item.executionEffect?.bad || item.bad || '否',
budgetSubject: item.budgetSubject || '-', ...item,
indicatorSource: item.indicatorSource, workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
total: formatAmount(item.indicatorSourceTotal), })),
lastYearBalance: formatAmount(item.indicatorSourceLastYearBalance), budgetManage: (data) =>
initialBudget: formatAmount(item.indicatorSourceInitialBudget), data.map((item, index) => ({
additionalBudget: formatAmount(item.indicatorSourceAdditionalBudget), key: index,
indicatorUseTotal: formatAmount(item.indicatorUseTotal), index: index + 1,
appropriationSubtotal: formatAmount(item.indicatorUseAppropriationSubtotal), ...item,
appropriation: formatAmount(item.indicatorUseAppropriation), budgetSubject: item.budgetSubject || '-',
salaryPayment: formatAmount(item.indicatorUseSalaryPayment), indicatorSource: item.indicatorSource,
govProcurement: formatAmount(item.indicatorUseGovProcurement), total: formatAmount(item.indicatorSourceTotal),
indicatorBalance: formatAmount(item.indicatorBalance), lastYearBalance: formatAmount(item.indicatorSourceLastYearBalance),
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex), initialBudget: formatAmount(item.indicatorSourceInitialBudget),
})), additionalBudget: formatAmount(item.indicatorSourceAdditionalBudget),
investmentSituation: (data) => data.map((item, index) => ({ indicatorUseTotal: formatAmount(item.indicatorUseTotal),
key: index, appropriationSubtotal: formatAmount(
index: index + 1, item.indicatorUseAppropriationSubtotal
category: item.category || '未分类', ),
auditContent: item.auditContent || item.content || '', appropriation: formatAmount(item.indicatorUseAppropriation),
checkEvidence: item.checkEvidence || item.evidence || '', salaryPayment: formatAmount(item.indicatorUseSalaryPayment),
testResult: item.testResult || '待检查', govProcurement: formatAmount(item.indicatorUseGovProcurement),
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex), indicatorBalance: formatAmount(item.indicatorBalance),
...item workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
})), })),
// 其他类型的映射... investmentSituation: (data) =>
default: (data) => data.map((item, index) => ({ data.map((item, index) => ({
key: index, key: index,
index: index + 1, index: index + 1,
...item, category: item.category || '未分类',
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) auditContent: item.auditContent || item.content || '',
})) checkEvidence: item.checkEvidence || item.evidence || '',
}; testResult: item.testResult || '待检查',
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex),
...item
})),
// 其他类型的映射...
default: (data) =>
data.map((item, index) => ({
key: index,
index: index + 1,
...item,
workPaperIndex: parseWorkPaperIndex(item.workPaperIndex)
}))
};
return mappers[type] || mappers.default; return mappers[type] || mappers.default;
} }
// 格式化金额 // 格式化金额
function formatAmount(amount) { function formatAmount(amount) {
if (!amount) return '0.00'; if (!amount) return '0.00';
if (typeof amount === 'string' && amount.includes(',')) return amount; if (typeof amount === 'string' && amount.includes(',')) return amount;
const num = parseFloat(amount); const num = parseFloat(amount);
return isNaN(num) ? '0.00' : num.toLocaleString('zh-CN', { return isNaN(num)
? '0.00'
: num.toLocaleString('zh-CN', {
minimumFractionDigits: 2, minimumFractionDigits: 2,
maximumFractionDigits: 2 maximumFractionDigits: 2
}); });
} }
// 生成接口映射 // 生成接口映射
export const apiMethodMap = { export const apiMethodMap = {
// 审计内容1 // 审计内容1
default1: { generate: 'generateDefault1Table', export: 'exportDefault1Table' }, default1: {
leaderList: { generate: 'generateLeaderListTable', export: 'exportLeaderListTable' }, generate: 'generateDefault1Table',
expense: { generate: 'generateExpenseTable', export: 'exportExpenseTable' }, export: 'exportDefault1Table'
eightReg: { generate: 'generateEightRegTable', export: 'exportEightRegTable' }, },
// 审计内容2 leaderList: {
strategyAudit: { generate: 'generateStrategyAuditTable', export: 'exportStrategyAuditTable' }, generate: 'generateLeaderListTable',
// 审计内容3 export: 'exportLeaderListTable'
tripleOne: { generate: 'generateTripleOneTable', export: 'exportTripleOneTable' }, },
decisionTable: { generate: 'generateDecisionTable', export: 'exportDecisionTable' }, expense: { generate: 'generateExpenseTable', export: 'exportExpenseTable' },
// 审计内容4 eightReg: {
target: { generate: 'generateTargetTable', export: 'exportTargetTable' }, generate: 'generateEightRegTable',
// 审计内容5 export: 'exportEightRegTable'
budgetManage: { generate: 'generateBudgetManageTable', export: 'exportBudgetManageTable' }, },
budgetExecution: { generate: 'generateBudgetExecutionTable', export: 'exportBudgetExecutionTable' }, // 审计内容2
// 审计内容6 strategyAudit: {
assets: { generate: 'generateAssetsTable', export: 'exportAssetsTable' }, generate: 'generateStrategyAuditTable',
// 审计内容7 export: 'exportStrategyAuditTable'
investmentSituation: { generate: 'generateInvestmentSituationTable', export: 'exportInvestmentSituationTable' }, },
// 审计内容8 // 审计内容3
internalControl: { generate: 'generateInternalControlTable', export: 'exportInternalControlTable' }, tripleOne: {
// 审计内容9 generate: 'generateTripleOneTable',
personnel: { generate: 'generatePersonnelTable', export: 'exportPersonnelTable' }, export: 'exportTripleOneTable'
// 审计内容10 },
partyConduct: { generate: 'generatePartyConductTable', export: 'exportPartyConductTable' }, decisionTable: {
// 审计内容11 generate: 'generateDecisionTable',
history: { generate: 'generateHistoryTable', export: 'exportHistoryTable' }, export: 'exportDecisionTable'
// 默认 },
default: { generate: 'generateDefaultTable', export: 'exportDefaultTable' } // 审计内容4
target: { generate: 'generateTargetTable', export: 'exportTargetTable' },
// 审计内容5
budgetManage: {
generate: 'generateBudgetManageTable',
export: 'exportBudgetManageTable'
},
budgetExecution: {
generate: 'generateBudgetExecutionTable',
export: 'exportBudgetExecutionTable'
},
// 审计内容6
assets: { generate: 'generateAssetsTable', export: 'exportAssetsTable' },
// 审计内容7
investmentSituation: {
generate: 'generateInvestmentSituationTable',
export: 'exportInvestmentSituationTable'
},
// 审计内容8
internalControl: {
generate: 'generateInternalControlTable',
export: 'exportInternalControlTable'
},
// 审计内容9
personnel: {
generate: 'generatePersonnelTable',
export: 'exportPersonnelTable'
},
// 审计内容10
partyConduct: {
generate: 'generatePartyConductTable',
export: 'exportPartyConductTable'
},
// 审计内容11
history: { generate: 'generateHistoryTable', export: 'exportHistoryTable' },
// 默认
default: { generate: 'generateDefaultTable', export: 'exportDefaultTable' }
}; };
export default { export default {
tableConfigs, tableConfigs,
getTableConfig, getTableConfig,
getAllTableConfigs, getAllTableConfigs,
findTableConfigByInterface, findTableConfigByInterface,
createDataMapper, createDataMapper,
apiMethodMap apiMethodMap
}; };

File diff suppressed because it is too large Load Diff