diff --git a/src/views/pwl/pwlProject/components/components/EvidenceModal.vue b/src/views/pwl/pwlProject/components/components/EvidenceModal.vue new file mode 100644 index 0000000..4d486ad --- /dev/null +++ b/src/views/pwl/pwlProject/components/components/EvidenceModal.vue @@ -0,0 +1,543 @@ + + + + + diff --git a/src/views/pwl/pwlProject/components/data/navigationItems.ts b/src/views/pwl/pwlProject/components/data/navigationItems.ts index ff87b63..bd8a076 100644 --- a/src/views/pwl/pwlProject/components/data/navigationItems.ts +++ b/src/views/pwl/pwlProject/components/data/navigationItems.ts @@ -17,8 +17,11 @@ export function initNavigationItems() { mode: 'table', showFileSelect: true, // 所有项都显示文件选择 data: [], + extraData: [], currentTableIndex: 0, // 当前选中的表格索引 columns: null, + extraTableTitle: config?.extraTableTitle || null, + extraColumns: config?.extraColumns || [], tableOptions: config?.options || [], count: index + 1, tableType: config?.type || `auditContent${index + 1}`, @@ -42,4 +45,4 @@ export default function useNavigationItems() { initNavigationItems(); } return navigationItems; -} \ No newline at end of file +} diff --git a/src/views/pwl/pwlProject/components/data/table10Columns.ts b/src/views/pwl/pwlProject/components/data/table10Columns.ts index 1260b8c..76db238 100644 --- a/src/views/pwl/pwlProject/components/data/table10Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table10Columns.ts @@ -68,14 +68,14 @@ export const partyConductColumns = [ width: 200, // ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { partyConductColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table11Columns.ts b/src/views/pwl/pwlProject/components/data/table11Columns.ts index 17cd8c5..ca7bc78 100644 --- a/src/views/pwl/pwlProject/components/data/table11Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table11Columns.ts @@ -81,14 +81,14 @@ export const auditHistoryColumns = [ width: 200, // ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { auditHistoryColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table1Columns.ts b/src/views/pwl/pwlProject/components/data/table1Columns.ts index 5251378..e40b29b 100644 --- a/src/views/pwl/pwlProject/components/data/table1Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table1Columns.ts @@ -429,12 +429,12 @@ export const eightRegColumns = [ width: 200, ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 140 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 140 + // } ]; export default { @@ -443,4 +443,4 @@ export default { expenseColumns, eightRegColumns, createTestResultRender -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table2Columns.ts b/src/views/pwl/pwlProject/components/data/table2Columns.ts index e6b97d9..10ce334 100644 --- a/src/views/pwl/pwlProject/components/data/table2Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table2Columns.ts @@ -48,15 +48,15 @@ export const strategyAuditColumns = [ align: 'center', // ellipsis: true }, - { - title: '操作', - key: 'action', - width: 100, - align: 'center' - } + // { + // title: '操作', + // key: 'action', + // width: 100, + // align: 'center' + // } ]; export default { strategyAuditColumns, createTestResultRender -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table3Columns.ts b/src/views/pwl/pwlProject/components/data/table3Columns.ts index eedea1b..0ff7326 100644 --- a/src/views/pwl/pwlProject/components/data/table3Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table3Columns.ts @@ -126,15 +126,15 @@ export const decisionTableColumns = [ } ] }, - { - title: '操作', - key: 'action', - align: 'center', - width: 140 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 140 + // } ]; export default { tripleOneColumns, decisionTableColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table5Columns.ts b/src/views/pwl/pwlProject/components/data/table5Columns.ts index 07807e8..2fbc93f 100644 --- a/src/views/pwl/pwlProject/components/data/table5Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table5Columns.ts @@ -164,15 +164,15 @@ export const budgetExecutionColumns = [ width: 200, ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { budgetManageColumns, budgetExecutionColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table6Columns.ts b/src/views/pwl/pwlProject/components/data/table6Columns.ts index bb0dec9..b043cf3 100644 --- a/src/views/pwl/pwlProject/components/data/table6Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table6Columns.ts @@ -105,14 +105,14 @@ export const stateAssetsManageColumns = [ width: 200, ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { stateAssetsManageColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table7Columns.ts b/src/views/pwl/pwlProject/components/data/table7Columns.ts index 6b9b58e..c1a4859 100644 --- a/src/views/pwl/pwlProject/components/data/table7Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table7Columns.ts @@ -41,15 +41,15 @@ export const investmentSituationColumns = [ width: 200, // ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; // 删除不再需要的单独列配置 export default { investmentSituationColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table8Columns.ts b/src/views/pwl/pwlProject/components/data/table8Columns.ts index f175310..a3f576d 100644 --- a/src/views/pwl/pwlProject/components/data/table8Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table8Columns.ts @@ -70,14 +70,14 @@ export const internalControlTestColumns = [ width: 200, // ellipsis: true }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { internalControlTestColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table9Columns.ts b/src/views/pwl/pwlProject/components/data/table9Columns.ts index 4b881e3..69d431d 100644 --- a/src/views/pwl/pwlProject/components/data/table9Columns.ts +++ b/src/views/pwl/pwlProject/components/data/table9Columns.ts @@ -42,14 +42,14 @@ export const personnelEstablishmentColumns = [ align: 'center', width: 200, }, - { - title: '操作', - key: 'action', - align: 'center', - width: 100 - } + // { + // title: '操作', + // key: 'action', + // align: 'center', + // width: 100 + // } ]; export default { personnelEstablishmentColumns -}; \ No newline at end of file +}; diff --git a/src/views/pwl/pwlProject/components/data/table9ExtraColumns.ts b/src/views/pwl/pwlProject/components/data/table9ExtraColumns.ts new file mode 100644 index 0000000..be04964 --- /dev/null +++ b/src/views/pwl/pwlProject/components/data/table9ExtraColumns.ts @@ -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; diff --git a/src/views/pwl/pwlProject/components/data/tableCommon.ts b/src/views/pwl/pwlProject/components/data/tableCommon.ts index aad43fd..4f80881 100644 --- a/src/views/pwl/pwlProject/components/data/tableCommon.ts +++ b/src/views/pwl/pwlProject/components/data/tableCommon.ts @@ -1,329 +1,457 @@ +import table9ExtraColumns from './table9ExtraColumns'; + export const tableConfigs = { - // 审计内容1表格配置 - auditContent1: { - type: 'auditContent1', - title: '贯彻决策部署情况', - options: [ - // { 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: '八项规定', value: 'eightReg', columns: () => import('./table1Columns').then(m => m.eightRegColumns) } - ], - // 接口映射 - interfaceMap: { - default1: '/api/ai/auditContent1/generateDefault1Table', - leaderList: '/api/ai/auditContent1/generateLeaderListTable', - expense: '/api/ai/auditContent1/generateExpenseTable', - eightReg: '/api/ai/auditContent1/generateEightRegTable' - } - }, - // 审计内容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) } - ], - 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' - } + // 审计内容1表格配置 + auditContent1: { + type: 'auditContent1', + title: '贯彻决策部署情况', + options: [ + // { 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: '八项规定', + value: 'eightReg', + columns: () => import('./table1Columns').then((m) => m.eightRegColumns) + } + ], + // 接口映射 + interfaceMap: { + default1: '/api/ai/auditContent1/generateDefault1Table', + leaderList: '/api/ai/auditContent1/generateLeaderListTable', + expense: '/api/ai/auditContent1/generateExpenseTable', + eightReg: '/api/ai/auditContent1/generateEightRegTable' } + }, + // 审计内容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) { - const configKeys = Object.keys(tableConfigs); - if (sectionIndex >= 0 && sectionIndex < configKeys.length) { - return tableConfigs[configKeys[sectionIndex]]; - } - return null; + const configKeys = Object.keys(tableConfigs); + if (sectionIndex >= 0 && sectionIndex < configKeys.length) { + return tableConfigs[configKeys[sectionIndex]]; + } + return null; } // 获取所有表格配置 export function getAllTableConfigs() { - return tableConfigs; + return tableConfigs; } // 通过接口名称查找表格配置 export function findTableConfigByInterface(interfaceName: string) { - for (const [key, config] of Object.entries(tableConfigs)) { - for (const [tableValue, tableInterface] of Object.entries(config.interfaceMap || {})) { - if (tableInterface === interfaceName) { - return { - sectionType: key, - tableValue, - config - }; - } - } + for (const [key, config] of Object.entries(tableConfigs)) { + for (const [tableValue, tableInterface] of Object.entries( + config.interfaceMap || {} + )) { + if (tableInterface === interfaceName) { + return { + sectionType: key, + tableValue, + config + }; + } } - return null; + } + return null; } // 解析workPaperIndex字符串为对象数组 function parseWorkPaperIndex(workPaperIndex) { - if (!workPaperIndex || !Array.isArray(workPaperIndex)) return []; + if (!workPaperIndex || !Array.isArray(workPaperIndex)) return []; - return workPaperIndex.map(item => { - if (item && typeof item === 'object') { - return { - fileId: item.fileId || item.file_id || '', - fileName: item.fileName || item.file_name || '', - fileUrl: item.fileUrl || item.url || '' - }; - } - if (typeof item === 'string') { - const parts = item.split('||'); - if (parts.length >= 3) { - return { - fileId: parts[0] || '', - fileName: parts[1] || '', - fileUrl: parts[2] || '' - }; - } - } - // 兼容旧格式 + return workPaperIndex.map((item) => { + if (item && typeof item === 'object') { + return { + fileId: item.fileId || item.file_id || '', + fileName: item.fileName || item.file_name || '', + fileUrl: item.fileUrl || item.url || '' + }; + } + if (typeof item === 'string') { + const parts = item.split('||'); + if (parts.length >= 3) { return { - fileId: '', - fileName: typeof item === 'string' ? item : '', - fileUrl: '' + fileId: parts[0] || '', + fileName: parts[1] || '', + fileUrl: parts[2] || '' }; - }); + } + } + // 兼容旧格式 + return { + fileId: '', + fileName: typeof item === 'string' ? item : '', + fileUrl: '' + }; + }); } // 通用数据映射函数 export function createDataMapper(type: string) { - const mappers = { - default1: (data) => data.map((item, index) => ({ - key: index, - index: index + 1, - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - leaderList: (data) => data.map((item, index) => ({ - key: index, - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - expense: (data) => data.map((item, index) => ({ - key: index, - ...item, - finalStatementAmount: formatAmount(item.finalStatementAmount), - initialBudgetAmount: formatAmount(item.initialBudgetAmount), - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - eightReg: (data) => data.map((item, index) => ({ - key: index, - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - strategyAudit: (data) => data.map((item, index) => ({ - key: index, - index: index + 1, - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - tripleOne: (data) => data.map((item, index) => ({ - key: index, - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - decisionTable: (data) => data.map((item, index) => ({ - key: index, - index: index + 1, - goods: item.executionEffect?.good || item.goods || '否', - normal: item.executionEffect?.normal || item.normal || '否', - bad: item.executionEffect?.bad || item.bad || '否', - ...item, - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) - })), - budgetManage: (data) => data.map((item, index) => ({ - key: index, - index: index + 1, - ...item, - budgetSubject: item.budgetSubject || '-', - indicatorSource: item.indicatorSource, - total: formatAmount(item.indicatorSourceTotal), - lastYearBalance: formatAmount(item.indicatorSourceLastYearBalance), - initialBudget: formatAmount(item.indicatorSourceInitialBudget), - additionalBudget: formatAmount(item.indicatorSourceAdditionalBudget), - indicatorUseTotal: formatAmount(item.indicatorUseTotal), - appropriationSubtotal: formatAmount(item.indicatorUseAppropriationSubtotal), - appropriation: formatAmount(item.indicatorUseAppropriation), - salaryPayment: formatAmount(item.indicatorUseSalaryPayment), - govProcurement: formatAmount(item.indicatorUseGovProcurement), - indicatorBalance: formatAmount(item.indicatorBalance), - workPaperIndex: parseWorkPaperIndex(item.workPaperIndex), - })), - investmentSituation: (data) => data.map((item, index) => ({ - key: index, - index: index + 1, - category: item.category || '未分类', - 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) - })) - }; + const mappers = { + default1: (data) => + data.map((item, index) => ({ + key: index, + index: index + 1, + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + leaderList: (data) => + data.map((item, index) => ({ + key: index, + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + expense: (data) => + data.map((item, index) => ({ + key: index, + ...item, + finalStatementAmount: formatAmount(item.finalStatementAmount), + initialBudgetAmount: formatAmount(item.initialBudgetAmount), + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + eightReg: (data) => + data.map((item, index) => ({ + key: index, + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + strategyAudit: (data) => + data.map((item, index) => ({ + key: index, + index: index + 1, + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + tripleOne: (data) => + data.map((item, index) => ({ + key: index, + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + decisionTable: (data) => + data.map((item, index) => ({ + key: index, + index: index + 1, + goods: item.executionEffect?.good || item.goods || '否', + normal: item.executionEffect?.normal || item.normal || '否', + bad: item.executionEffect?.bad || item.bad || '否', + ...item, + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + budgetManage: (data) => + data.map((item, index) => ({ + key: index, + index: index + 1, + ...item, + budgetSubject: item.budgetSubject || '-', + indicatorSource: item.indicatorSource, + total: formatAmount(item.indicatorSourceTotal), + lastYearBalance: formatAmount(item.indicatorSourceLastYearBalance), + initialBudget: formatAmount(item.indicatorSourceInitialBudget), + additionalBudget: formatAmount(item.indicatorSourceAdditionalBudget), + indicatorUseTotal: formatAmount(item.indicatorUseTotal), + appropriationSubtotal: formatAmount( + item.indicatorUseAppropriationSubtotal + ), + appropriation: formatAmount(item.indicatorUseAppropriation), + salaryPayment: formatAmount(item.indicatorUseSalaryPayment), + govProcurement: formatAmount(item.indicatorUseGovProcurement), + indicatorBalance: formatAmount(item.indicatorBalance), + workPaperIndex: parseWorkPaperIndex(item.workPaperIndex) + })), + investmentSituation: (data) => + data.map((item, index) => ({ + key: index, + index: index + 1, + category: item.category || '未分类', + 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) { - if (!amount) return '0.00'; - if (typeof amount === 'string' && amount.includes(',')) return amount; - const num = parseFloat(amount); - return isNaN(num) ? '0.00' : num.toLocaleString('zh-CN', { + if (!amount) return '0.00'; + if (typeof amount === 'string' && amount.includes(',')) return amount; + const num = parseFloat(amount); + return isNaN(num) + ? '0.00' + : num.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 - }); + }); } // 生成接口映射 export const apiMethodMap = { - // 审计内容1 - default1: { generate: 'generateDefault1Table', export: 'exportDefault1Table' }, - leaderList: { generate: 'generateLeaderListTable', export: 'exportLeaderListTable' }, - expense: { generate: 'generateExpenseTable', export: 'exportExpenseTable' }, - eightReg: { generate: 'generateEightRegTable', export: 'exportEightRegTable' }, - // 审计内容2 - strategyAudit: { generate: 'generateStrategyAuditTable', export: 'exportStrategyAuditTable' }, - // 审计内容3 - tripleOne: { generate: 'generateTripleOneTable', export: 'exportTripleOneTable' }, - decisionTable: { generate: 'generateDecisionTable', export: 'exportDecisionTable' }, - // 审计内容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' } + // 审计内容1 + default1: { + generate: 'generateDefault1Table', + export: 'exportDefault1Table' + }, + leaderList: { + generate: 'generateLeaderListTable', + export: 'exportLeaderListTable' + }, + expense: { generate: 'generateExpenseTable', export: 'exportExpenseTable' }, + eightReg: { + generate: 'generateEightRegTable', + export: 'exportEightRegTable' + }, + // 审计内容2 + strategyAudit: { + generate: 'generateStrategyAuditTable', + export: 'exportStrategyAuditTable' + }, + // 审计内容3 + tripleOne: { + generate: 'generateTripleOneTable', + export: 'exportTripleOneTable' + }, + decisionTable: { + generate: 'generateDecisionTable', + export: 'exportDecisionTable' + }, + // 审计内容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 { - tableConfigs, - getTableConfig, - getAllTableConfigs, - findTableConfigByInterface, - createDataMapper, - apiMethodMap -}; \ No newline at end of file + tableConfigs, + getTableConfig, + getAllTableConfigs, + findTableConfigByInterface, + createDataMapper, + apiMethodMap +}; diff --git a/src/views/pwl/pwlProject/components/reportContent.vue b/src/views/pwl/pwlProject/components/reportContent.vue index 535cc7f..e865035 100644 --- a/src/views/pwl/pwlProject/components/reportContent.vue +++ b/src/views/pwl/pwlProject/components/reportContent.vue @@ -1,25 +1,34 @@