fix: 优化审计报告生成页
This commit is contained in:
@@ -5,19 +5,49 @@ import type { PageParam } from '@/api';
|
||||
*/
|
||||
export interface AuditReport {
|
||||
// 审计标题
|
||||
from0?: string;
|
||||
from00?: string;
|
||||
// 审计依据
|
||||
from1?: string;
|
||||
from10?: string;
|
||||
// 审计目标
|
||||
from2?: string;
|
||||
from20?: string;
|
||||
// 审计对象和范围
|
||||
from3?: string;
|
||||
from30?: string;
|
||||
// 被审计单位基本情况-单位概况
|
||||
from41?: string;
|
||||
// 被审计单位基本情况-机构和人员相关情况
|
||||
from42?: string;
|
||||
// 审计内容和重点及审计方法
|
||||
from5?: string;
|
||||
// 被审计单位基本情况-财务会计、重大会计政策选用及变动情况
|
||||
from43?: string;
|
||||
// 审计期间合并口径年度资产负债及各项业务总体情况
|
||||
from44?: string[];
|
||||
// 被审计单位基本情况-相关内部控制
|
||||
from45?: string;
|
||||
// 审计内容和重点及审计方法-贯彻执行党和国家有关经济方针和上级决策部署情况
|
||||
from51?: string;
|
||||
// 审计内容和重点及审计方法-公司发展战略规划的制定、执行和效果情况以及年度责任目标完成情况
|
||||
from52?: string;
|
||||
// 审计内容和重点及审计方法-重大经济事项的决策、执行和效果情况
|
||||
from53?: string;
|
||||
// 审计内容和重点及审计方法-公司法人治理结构的建立、健全和运行情况,内部控制制度的制定和执行情况
|
||||
from54?: string;
|
||||
// 审计内容和重点及审计方法-公司财务的真实合法效益情况,风险管控情况,境外资产管理情况
|
||||
from55?: string;
|
||||
// 审计内容和重点及审计方法-在经济活动中落实有关党风廉政建设责任和遵守廉洁从业规定情况
|
||||
from56?: string;
|
||||
// 审计内容和重点及审计方法-对以往审计中发现问题的整改情况
|
||||
from57?: string;
|
||||
// 审计内容和重点及审计方法-其他需要审计的事项
|
||||
from58?: string;
|
||||
// 重要风险的识别及应对-重要风险的识别
|
||||
from61?: string;
|
||||
// 重要风险的识别及应对-风险的应对策略
|
||||
from62?: string;
|
||||
// 审计技术方法
|
||||
from70?: string;
|
||||
// 工作步骤与时间安排
|
||||
from80?: string;
|
||||
// 审计工作的组织实施
|
||||
from90?: string;
|
||||
// 知识库ID
|
||||
kbId?: string;
|
||||
// 生成模块:AuditReportEnum.code
|
||||
|
||||
@@ -425,6 +425,9 @@ export const getDictionaryOptions = (dictCode) => {
|
||||
* @param: fileName - 文件名称
|
||||
*/
|
||||
export const isImage = (fileName) => {
|
||||
// 添加空值检查
|
||||
if (!fileName) return false;
|
||||
|
||||
const split = fileName.split('?');
|
||||
// 后缀获取
|
||||
let suffix = '';
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<!-- 用户编辑弹窗 -->
|
||||
<template>
|
||||
<a-drawer
|
||||
:width="`80%`"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:maxable="maxAble"
|
||||
title="AI审计方案生成器"
|
||||
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||
@update:visible="updateVisible"
|
||||
:maskClosable="false"
|
||||
:footer="null"
|
||||
@ok="save"
|
||||
:width="`80%`"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:maxable="maxAble"
|
||||
title="AI审计方案生成器"
|
||||
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||
@update:visible="updateVisible"
|
||||
:maskClosable="false"
|
||||
:footer="null"
|
||||
@ok="save"
|
||||
>
|
||||
<a-card title="基本信息" style="margin-bottom: 20px" :bordered="false">
|
||||
<a-descriptions>
|
||||
<a-descriptions-item
|
||||
label="公司名称"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
label="公司名称"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
>
|
||||
<span @click="copyText(form.name)">{{ form.name }}</span>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item
|
||||
label="被审计人"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
label="被审计人"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
>
|
||||
<span>{{ form.nickname || '暂无' }}</span>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item
|
||||
label="审计时间"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
label="审计时间"
|
||||
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||
>
|
||||
<span>{{ form.expirationTime }}</span>
|
||||
</a-descriptions-item>
|
||||
@@ -78,13 +78,13 @@
|
||||
<div class="navigation-container">
|
||||
<div class="nav-grid">
|
||||
<a-button
|
||||
v-for="(item, index) in navigationItems"
|
||||
:key="index"
|
||||
:type="currentSection === index ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="scrollToSection(index)"
|
||||
class="nav-button"
|
||||
:class="{ 'active': currentSection === index }"
|
||||
v-for="(item, index) in navigationItems"
|
||||
:key="index"
|
||||
:type="currentSection === index ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="scrollToSection(index)"
|
||||
class="nav-button"
|
||||
:class="{ 'active': currentSection === index }"
|
||||
>
|
||||
<span class="nav-number">{{ item.number }}</span>
|
||||
<span class="nav-text">{{ item.name }}</span>
|
||||
@@ -95,8 +95,8 @@
|
||||
<div class="progress-container">
|
||||
<div class="progress-bar">
|
||||
<div
|
||||
class="progress-fill"
|
||||
:style="{ width: `${((currentSection + 1) / navigationItems.length) * 100}%` }"
|
||||
class="progress-fill"
|
||||
:style="{ width: `${((currentSection + 1) / navigationItems.length) * 100}%` }"
|
||||
></div>
|
||||
</div>
|
||||
<div class="progress-text">
|
||||
@@ -109,22 +109,22 @@
|
||||
<!-- 审计方案内容 -->
|
||||
<div class="audit-content">
|
||||
<div
|
||||
v-for="(item, index) in navigationItems"
|
||||
:key="index"
|
||||
:id="`section-${index}`"
|
||||
class="audit-section"
|
||||
v-for="(item, index) in navigationItems"
|
||||
:key="index"
|
||||
:id="`section-${index}`"
|
||||
class="audit-section"
|
||||
>
|
||||
<a-card
|
||||
:title="`${item.number}、${item.name}`"
|
||||
style="margin-bottom: 20px"
|
||||
:bordered="false"
|
||||
:title="`${item.number}、${item.name}`"
|
||||
style="margin-bottom: 20px"
|
||||
:bordered="false"
|
||||
>
|
||||
<template #extra>
|
||||
<a-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="generateContent(index)"
|
||||
:loading="item.generating"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="generateContent(index)"
|
||||
:loading="item.generating"
|
||||
>
|
||||
<template #icon>
|
||||
<RobotOutlined/>
|
||||
@@ -133,27 +133,58 @@
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<div class="section-description">
|
||||
<div v-if="item.description" class="section-description">
|
||||
{{ item.description }}
|
||||
</div>
|
||||
|
||||
<a-textarea
|
||||
v-model:value="item.content"
|
||||
:rows="item.rows || 8"
|
||||
:placeholder="item.placeholder"
|
||||
class="content-textarea"
|
||||
style="margin-top: 16px"
|
||||
/>
|
||||
|
||||
<div style="margin-top: 12px">
|
||||
<div class="question-prompt">点此开始提问</div>
|
||||
<!-- 单内容部分 -->
|
||||
<template v-if="!item.children">
|
||||
<a-textarea
|
||||
v-model:value="item.suggestion"
|
||||
:rows="3"
|
||||
placeholder="请在此输入您的优化建议或疑问..."
|
||||
class="suggestion-textarea"
|
||||
v-model:value="item.content"
|
||||
:rows="item.rows || 8"
|
||||
:placeholder="item.placeholder"
|
||||
class="content-textarea"
|
||||
style="margin-top: 16px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 12px">
|
||||
<div class="question-prompt">点此开始提问</div>
|
||||
<a-textarea
|
||||
v-model:value="item.suggestion"
|
||||
:rows="3"
|
||||
placeholder="请在此输入您的优化建议或疑问..."
|
||||
class="suggestion-textarea"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 多内容部分 -->
|
||||
<template v-else>
|
||||
<div v-for="(child, childIndex) in item.children" :key="childIndex" class="child-section">
|
||||
<div class="child-title">
|
||||
{{ child.name }}
|
||||
<a-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="generateContent(index, childIndex)"
|
||||
:loading="child.generating"
|
||||
style="margin-left: 12px"
|
||||
>
|
||||
<template #icon>
|
||||
<RobotOutlined/>
|
||||
</template>
|
||||
AI生成
|
||||
</a-button>
|
||||
</div>
|
||||
<a-textarea
|
||||
v-model:value="child.content"
|
||||
:rows="child.rows || 6"
|
||||
:placeholder="child.placeholder"
|
||||
class="content-textarea"
|
||||
style="margin-top: 12px"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,12 +192,11 @@
|
||||
<!-- 返回顶部按钮 -->
|
||||
<a-back-top :target="getScrollContainer"/>
|
||||
</a-drawer>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, reactive, watch, onMounted, onUnmounted} from 'vue';
|
||||
import {Form} from 'ant-design-vue';
|
||||
import {Form, message} from 'ant-design-vue';
|
||||
import {assignObject} from 'ele-admin-pro';
|
||||
import {copyText} from '@/utils/common';
|
||||
import {PwlProject} from "@/api/pwl/pwlProject/model";
|
||||
@@ -204,19 +234,9 @@ const navigationItems = ref([
|
||||
title: '1、审计依据',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入审计依据内容...',
|
||||
content: `(一)中共中央办公厅、国务院办公厅《党政主要领导干部和国有企业领导人员经济责任审计规定》(2019年7月7日起实施);
|
||||
|
||||
(二)XXX有限公司经济责任审计管理办法》(XX(**)**号(待补充));
|
||||
|
||||
(三)国家有关法律、法规及相关文件;
|
||||
|
||||
(四)XXX有限公司下达的年度工作目标;
|
||||
|
||||
(五)XXX有限公司各项管理制度;
|
||||
|
||||
(六)双方签订的审计业务约定书。`,
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 1,
|
||||
formCommit: 10,
|
||||
rows: 10,
|
||||
generating: false
|
||||
},
|
||||
@@ -226,9 +246,9 @@ const navigationItems = ref([
|
||||
title: '2、审计目标',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入审计目标内容...',
|
||||
content: `通过对XXX同志、XXX同志任职期间所负责公司资产、负债情况的真实性、合法性和效益性及其相关经济活动进行审计,查清其任职期间公司财经政策指导和财务收支工作目标完成情况,重大决策执行及交接情况,遵守国家财经法规情况及公司资产保值增值情况,分清其经济责任,评价其工作业绩,对其任职期间履行经济责任情况作出客观公正的评价。`,
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 2,
|
||||
formCommit: 20,
|
||||
rows: 6,
|
||||
generating: false
|
||||
},
|
||||
@@ -240,57 +260,161 @@ const navigationItems = ref([
|
||||
placeholder: '请输入审计对象和范围内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 3,
|
||||
formCommit: 30,
|
||||
rows: 8,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
number: '四',
|
||||
name: '被审计单位基本情况'+'|'+'(一)单位概况',
|
||||
name: '被审计单位基本情况',
|
||||
title: '4、被审计单位基本情况',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入被审计单位基本情况内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 41,
|
||||
rows: 10,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
number: '四',
|
||||
name: '被审计单位基本情况'+'|'+'(二)机构和人员相关情况',
|
||||
title: '4、被审计单位基本情况',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入被审计单位基本情况内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 42,
|
||||
rows: 10,
|
||||
generating: false
|
||||
generating: false,
|
||||
children: [
|
||||
{
|
||||
name: '(一)单位概况',
|
||||
placeholder: '请输入单位概况内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 41,
|
||||
rows: 6,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
name: '(二)机构和人员相关情况',
|
||||
placeholder: '请输入机构和人员相关情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 42,
|
||||
rows: 6,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
name: '(三)财务会计、重大会计政策选用及变动情况',
|
||||
placeholder: '请输入财务会计、重大会计政策选用及变动情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 43,
|
||||
rows: 6,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
name: '(四)审计期间合并口径年度资产负债及各项业务总体情况',
|
||||
placeholder: '请输入审计期间合并口径年度资产负债及各项业务总体情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 44,
|
||||
rows: 6,
|
||||
generating: false
|
||||
},
|
||||
{
|
||||
name: '(五)相关内部控制',
|
||||
placeholder: '请输入相关内部控制内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 45,
|
||||
rows: 6,
|
||||
generating: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
number: '五',
|
||||
name: '审计内容和重点及审计方法',
|
||||
title: '5、审计内容和重点及审计方法',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入审计内容和重点及审计方法内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 5,
|
||||
rows: 12,
|
||||
generating: false
|
||||
generating: false,
|
||||
children: [
|
||||
{
|
||||
name: '(一)贯彻执行党和国家有关经济方针和上级决策部署情况',
|
||||
placeholder: '请输入贯彻执行党和国家有关经济方针和上级决策部署情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 51,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(二)公司发展战略规划的制定、执行和效果情况以及年度责任目标完成情况',
|
||||
placeholder: '请输入公司发展战略规划的制定、执行和效果情况以及年度责任目标完成情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 52,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(三)重大经济事项的决策、执行和效果情况',
|
||||
placeholder: '请输入重大经济事项的决策、执行和效果情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 53,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(四)公司法人治理结构的建立、健全和运行情况,内部控制制度的制定和执行情况',
|
||||
placeholder: '请输入公司法人治理结构的建立、健全和运行情况,内部控制制度的制定和执行情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 54,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(五)公司财务的真实合法效益情况,风险管控情况,境外资产管理情况',
|
||||
placeholder: '请输入公司财务的真实合法效益情况,风险管控情况,境外资产管理情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 55,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(六)在经济活动中落实有关党风廉政建设责任和遵守廉洁从业规定情况',
|
||||
placeholder: '请输入在经济活动中落实有关党风廉政建设责任和遵守廉洁从业规定情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 56,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(七)对以往审计中发现问题的整改情况',
|
||||
placeholder: '请输入对以往审计中发现问题的整改情况...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 57,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(八)其他需要审计的事项',
|
||||
placeholder: '请输入其他需要审计的事项...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 58,
|
||||
rows: 6
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
number: '六',
|
||||
name: '重要风险的识别及应对',
|
||||
title: '6、重要风险的识别及应对',
|
||||
description: '点击"AI生成"按钮让AI为您生成该部分内容,或直接在下方编辑',
|
||||
placeholder: '请输入重要风险的识别及应对内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 6,
|
||||
rows: 10,
|
||||
generating: false
|
||||
generating: false,
|
||||
children: [
|
||||
{
|
||||
name: '(一)重要风险的识别',
|
||||
placeholder: '请输入重要风险的识别内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 61,
|
||||
rows: 6
|
||||
},
|
||||
{
|
||||
name: '(二)风险的应对策略',
|
||||
placeholder: '请输入风险的应对策略内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 62,
|
||||
rows: 6
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
number: '七',
|
||||
@@ -300,7 +424,7 @@ const navigationItems = ref([
|
||||
placeholder: '请输入审计技术方法内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 7,
|
||||
formCommit: 70,
|
||||
rows: 8,
|
||||
generating: false
|
||||
},
|
||||
@@ -312,7 +436,7 @@ const navigationItems = ref([
|
||||
placeholder: '请输入工作步骤与时间安排内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 8,
|
||||
formCommit: 80,
|
||||
rows: 10,
|
||||
generating: false
|
||||
},
|
||||
@@ -324,7 +448,7 @@ const navigationItems = ref([
|
||||
placeholder: '请输入审计工作的组织实施内容...',
|
||||
content: '',
|
||||
suggestion: '',
|
||||
formCommit: 9,
|
||||
formCommit: 90,
|
||||
rows: 8,
|
||||
generating: false
|
||||
}
|
||||
@@ -460,11 +584,25 @@ const getScrollContainer = () => {
|
||||
};
|
||||
|
||||
/* 批量生成全部内容 */
|
||||
const handleGenerateAll = async () => {
|
||||
const handleGenerateAll2 = async () => {
|
||||
generatingAll.value = true;
|
||||
try {
|
||||
// 使用Promise.all进行并行生成
|
||||
await Promise.all(navigationItems.value.map((_, index) => generateContent(index)));
|
||||
const promises: Promise<void>[] = [];
|
||||
|
||||
navigationItems.value.forEach((item, index) => {
|
||||
if (item.children) {
|
||||
// 有子项的章节,为每个子项生成内容
|
||||
item.children.forEach((child, childIndex) => {
|
||||
promises.push(generateContent(index, childIndex));
|
||||
});
|
||||
} else {
|
||||
// 没有子项的章节
|
||||
promises.push(generateContent(index));
|
||||
}
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
message.success('全部内容生成完成');
|
||||
} catch (error) {
|
||||
console.error('批量生成失败:', error);
|
||||
@@ -474,18 +612,102 @@ const handleGenerateAll = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
/* 导出审计报告 */
|
||||
/* 批量生成全部内容 */
|
||||
const handleGenerateAll = async () => {
|
||||
generatingAll.value = true;
|
||||
try {
|
||||
// 改为顺序生成
|
||||
for (const [index, item] of navigationItems.value.entries()) {
|
||||
// 跳过未完成的依赖项
|
||||
if (index === 4 && !hasContent(3)) {
|
||||
message.warning('请先生成第四项「被审计单位基本情况」');
|
||||
continue;
|
||||
}
|
||||
if (index === 5 && !hasContent(4)) {
|
||||
message.warning('请先生成第五项「审计内容和重点及审计方法」');
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.children) {
|
||||
for (const [childIndex] of item.children.entries()) {
|
||||
await generateContent(index, childIndex);
|
||||
}
|
||||
} else {
|
||||
await generateContent(index);
|
||||
}
|
||||
}
|
||||
message.success('全部内容生成完成');
|
||||
} catch (error) {
|
||||
console.error('批量生成失败:', error);
|
||||
message.error('部分内容生成失败,请检查');
|
||||
} finally {
|
||||
generatingAll.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 新增内容检查方法
|
||||
const hasContent = (index: number) => {
|
||||
const section = navigationItems.value[index];
|
||||
if (!section) return false;
|
||||
|
||||
if (section.children) {
|
||||
return section.children.some(child => child.content?.trim());
|
||||
}
|
||||
return !!section.content?.trim();
|
||||
};
|
||||
|
||||
/* 新增:构建导出数据的公共方法 */
|
||||
const buildExportData = () => {
|
||||
const exportData: any = {
|
||||
from00: form.name,
|
||||
from10: navigationItems.value[0].content,
|
||||
from20: navigationItems.value[1].content,
|
||||
from30: navigationItems.value[2].content,
|
||||
};
|
||||
|
||||
// 被审计单位基本情况
|
||||
const basicInfoSection = navigationItems.value[3];
|
||||
if (basicInfoSection?.children) {
|
||||
exportData.from41 = basicInfoSection.children[0].content;
|
||||
exportData.from42 = basicInfoSection.children[1].content;
|
||||
exportData.from43 = basicInfoSection.children[2].content;
|
||||
exportData.from44 = [basicInfoSection.children[3].content];
|
||||
exportData.from45 = basicInfoSection.children[4].content;
|
||||
}
|
||||
|
||||
// 审计内容和重点及审计方法
|
||||
const auditContentSection = navigationItems.value[4];
|
||||
if (auditContentSection?.children) {
|
||||
exportData.from51 = auditContentSection.children[0].content;
|
||||
exportData.from52 = auditContentSection.children[1].content;
|
||||
exportData.from53 = auditContentSection.children[2].content;
|
||||
exportData.from54 = auditContentSection.children[3].content;
|
||||
exportData.from55 = auditContentSection.children[4].content;
|
||||
exportData.from56 = auditContentSection.children[5].content;
|
||||
exportData.from57 = auditContentSection.children[6].content;
|
||||
exportData.from58 = auditContentSection.children[7].content;
|
||||
}
|
||||
|
||||
// 重要风险的识别及应对
|
||||
const riskSection = navigationItems.value[5];
|
||||
if (riskSection?.children) {
|
||||
exportData.from61 = riskSection.children[0].content;
|
||||
exportData.from62 = riskSection.children[1].content;
|
||||
}
|
||||
|
||||
// 其他部分
|
||||
exportData.from70 = navigationItems.value[6].content;
|
||||
exportData.from80 = navigationItems.value[7].content;
|
||||
exportData.from90 = navigationItems.value[8].content;
|
||||
|
||||
return exportData;
|
||||
};
|
||||
|
||||
/* 修改导出方法使用公共构建方法 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const blob = await downloadAuditReport({
|
||||
from0: form.code,
|
||||
from1: navigationItems.value[0].content,
|
||||
from2: navigationItems.value[1].content,
|
||||
from3: navigationItems.value[2].content,
|
||||
from41: navigationItems.value[3].content,
|
||||
from42: navigationItems.value[4].content,
|
||||
from5: navigationItems.value[5].content,
|
||||
});
|
||||
const exportData = buildExportData();
|
||||
const blob = await downloadAuditReport(exportData);
|
||||
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(new Blob([blob]));
|
||||
@@ -495,6 +717,7 @@ const handleExport = async () => {
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(url);
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
message.error('文档导出失败');
|
||||
@@ -502,149 +725,58 @@ const handleExport = async () => {
|
||||
};
|
||||
|
||||
/* AI生成内容 */
|
||||
const generateContent = async (index: number) => {
|
||||
const item = navigationItems.value[index];
|
||||
item.generating = true;
|
||||
const generateContent = async (sectionIndex: number, childIndex?: number) => {
|
||||
const section = navigationItems.value[sectionIndex];
|
||||
|
||||
// 处理主项生成(当主项没有formCommit时)
|
||||
if (childIndex === undefined && !section.formCommit && section.children) {
|
||||
section.generating = true;
|
||||
try {
|
||||
await Promise.all(section.children.map((_, i) =>
|
||||
generateContent(sectionIndex, i)
|
||||
));
|
||||
} finally {
|
||||
section.generating = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理单个项生成
|
||||
let item: any;
|
||||
let formCommit: number;
|
||||
const isChild = childIndex !== undefined;
|
||||
|
||||
if (isChild) {
|
||||
item = section.children[childIndex];
|
||||
formCommit = item.formCommit;
|
||||
} else {
|
||||
item = section;
|
||||
formCommit = item.formCommit;
|
||||
}
|
||||
|
||||
// 新增:构建上下文数据
|
||||
const contextData = await buildExportData(); // 复用导出数据的构建逻辑
|
||||
|
||||
item.generating = true;
|
||||
try {
|
||||
// 调用生成接口
|
||||
const result = await generateAuditReport({
|
||||
kbId: form.kbId || '',
|
||||
formCommit: item.formCommit,
|
||||
formCommit: formCommit,
|
||||
history: item.content || '',
|
||||
suggestion: item.suggestion || '',
|
||||
// ...form, // 传递表单数据
|
||||
// moduleId: index + 1, // 假设章节对应模块ID
|
||||
// section: item.name // 当前生成章节名称
|
||||
// 新增:传递完整的上下文数据
|
||||
...contextData
|
||||
});
|
||||
|
||||
item.content = result; // 直接使用接口返回内容
|
||||
|
||||
} catch (error) {
|
||||
console.error('AI生成失败:', error);
|
||||
item.content = result;
|
||||
} finally {
|
||||
item.generating = false;
|
||||
}
|
||||
};
|
||||
|
||||
/* 获取示例内容 */
|
||||
const getSampleContent = (index: number) => {
|
||||
const samples = [
|
||||
// 审计依据
|
||||
`(一)中共中央办公厅、国务院办公厅《党政主要领导干部和国有企业领导人员经济责任审计规定》(2019年7月7日起实施);
|
||||
|
||||
(二)${form.name}经济责任审计管理办法》(相关文件编号);
|
||||
|
||||
(三)国家有关法律、法规及相关文件;
|
||||
|
||||
(四)${form.name}下达的年度工作目标;
|
||||
|
||||
(五)${form.name}各项管理制度;
|
||||
|
||||
(六)双方签订的审计业务约定书。`,
|
||||
|
||||
// 审计目标
|
||||
`通过对${form.name}相关负责人任职期间所负责公司资产、负债情况的真实性、合法性和效益性及其相关经济活动进行审计,查清其任职期间公司财经政策指导和财务收支工作目标完成情况,重大决策执行及交接情况,遵守国家财经法规情况及公司资产保值增值情况,分清其经济责任,评价其工作业绩,对其任职期间履行经济责任情况作出客观公正的评价。`,
|
||||
|
||||
// 审计对象和范围
|
||||
`审计对象:${form.name}及其相关负责人
|
||||
审计范围:${form.itemYear || '相关年度'}年度财务收支情况、资产管理情况、重大经济决策情况等。
|
||||
具体包括:
|
||||
1. 财务收支的真实性、合法性;
|
||||
2. 资产、负债、损益的真实性;
|
||||
3. 重大经济决策的程序性和效果性;
|
||||
4. 内部控制制度的建立和执行情况。`,
|
||||
|
||||
// 被审计单位基本情况
|
||||
`${form.name}基本情况:
|
||||
成立时间:[待补充]
|
||||
注册资本:[待补充]
|
||||
经营范围:[待补充]
|
||||
组织架构:[待补充]
|
||||
主要业务:[待补充]
|
||||
年末资产总额:${form.totalAssets ? form.totalAssets + '万元' : '[待补充]'}`,
|
||||
|
||||
// 审计内容和重点及审计方法
|
||||
`审计内容:
|
||||
1. 财务收支审计
|
||||
2. 资产负债审计
|
||||
3. 经营管理审计
|
||||
4. 内部控制审计
|
||||
|
||||
审计重点:
|
||||
1. 重大经济决策的合规性
|
||||
2. 资产保值增值情况
|
||||
3. 财务管理制度执行情况
|
||||
4. 风险控制措施有效性
|
||||
|
||||
审计方法:
|
||||
1. 账项基础审计
|
||||
2. 制度基础审计
|
||||
3. 风险导向审计
|
||||
4. 计算机辅助审计`,
|
||||
|
||||
// 重要风险的识别及应对
|
||||
`重要风险识别:
|
||||
1. 财务报告风险
|
||||
2. 合规性风险
|
||||
3. 经营风险
|
||||
4. 信息系统风险
|
||||
|
||||
应对措施:
|
||||
1. 加强内部控制测试
|
||||
2. 扩大实质性程序范围
|
||||
3. 增加专业判断和职业怀疑
|
||||
4. 运用专家工作和外部确认`,
|
||||
|
||||
// 审计技术方法
|
||||
`主要采用的审计技术方法:
|
||||
1. 检查:检查记录或文件
|
||||
2. 观察:观察流程或程序的执行
|
||||
3. 询问:向相关人员询问
|
||||
4. 函证:向第三方函证
|
||||
5. 重新计算:重新计算相关数据
|
||||
6. 重新执行:重新执行相关控制
|
||||
7. 分析程序:分析财务和非财务信息`,
|
||||
|
||||
// 工作步骤与时间安排
|
||||
`工作步骤:
|
||||
第一阶段:审计准备(X天)
|
||||
- 了解被审计单位情况
|
||||
- 制定审计计划
|
||||
- 组建审计组
|
||||
|
||||
第二阶段:现场审计(X天)
|
||||
- 内部控制测试
|
||||
- 实质性程序执行
|
||||
- 获取审计证据
|
||||
|
||||
第三阶段:审计报告(X天)
|
||||
- 汇总审计发现
|
||||
- 撰写审计报告
|
||||
- 与被审计单位沟通`,
|
||||
|
||||
// 审计工作的组织实施
|
||||
`组织架构:
|
||||
审计组长:[待指定]
|
||||
审计组员:[待指定]
|
||||
技术复核:[待指定]
|
||||
|
||||
实施要求:
|
||||
1. 严格按照审计准则执行
|
||||
2. 保持职业怀疑态度
|
||||
3. 获取充分适当的审计证据
|
||||
4. 及时与被审计单位沟通
|
||||
5. 按时完成审计工作
|
||||
6. 确保审计质量`
|
||||
];
|
||||
|
||||
return samples[index] || '请输入相关内容...';
|
||||
};
|
||||
|
||||
/* 监听滚动位置更新当前章节 */
|
||||
const handleScroll = () => {
|
||||
const sections = navigationItems.value.map((_, index) =>
|
||||
document.getElementById(`section-${index}`)
|
||||
document.getElementById(`section-${index}`)
|
||||
);
|
||||
|
||||
const scrollContainer = getScrollContainer();
|
||||
@@ -713,19 +845,19 @@ onUnmounted(() => {
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
loading.value = true;
|
||||
assignObject(form, props.data);
|
||||
// 重置到第一个章节
|
||||
currentSection.value = 0;
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
loading.value = true;
|
||||
assignObject(form, props.data);
|
||||
// 重置到第一个章节
|
||||
currentSection.value = 0;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -739,6 +871,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.audit-content {
|
||||
.audit-section {
|
||||
.child-title {
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
padding-left: 8px;
|
||||
border-left: 3px solid #1890ff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.ant-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.question-prompt {
|
||||
color: #1677ff;
|
||||
font-weight: 500;
|
||||
@@ -862,6 +1014,26 @@ export default {
|
||||
border-left: 4px solid #1890ff;
|
||||
}
|
||||
|
||||
.child-section {
|
||||
margin-bottom: 24px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px dashed #e8e8e8;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.child-title {
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
padding-left: 8px;
|
||||
border-left: 3px solid #1890ff;
|
||||
}
|
||||
|
||||
.content-textarea {
|
||||
border-radius: 6px;
|
||||
transition: all 0.3s ease;
|
||||
@@ -888,4 +1060,4 @@ export default {
|
||||
bottom: 30px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user