提交 9086c34e authored 作者: 朱政's avatar 朱政

Merge branch 'master' into zz-dev

...@@ -162,6 +162,47 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -162,6 +162,47 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
} }
}, },
// ========== 获取政令基础信息 (翻译栏数据) ==========
async fetchOrderBaseInfo(orderId) {
try {
const response = await fetch('/reportData/get-order-base-info', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ order_id: Number(orderId) })
});
const data = await response.json();
if (data.status === 'success' && data.result) {
const res = data.result;
// 1. 填充元数据 (用于翻译栏顶部的标题卡片)
this.pdfMetadata = {
name: res.order_name_zh,
order_title: res.order_name,
signing_date: res.post_date
};
// 2. 填充条款翻译内容
this.clauseTranslationMessages = (res.clauses || []).map(item => ({
event: 'clause_translation',
payload: {
clause_number: item.section_num,
clause_section: item.section_num, // 这里根据结构复用 section_num
clause_content: item.section_text,
clause_content_zh: item.section_text_zh
}
}));
// 3. 自动展示翻译栏
this.isShowClauseTranslation = true;
this.isShowSteps = true;
console.log('政令基础信息获取并回填成功:', res);
}
} catch (error) {
console.error('获取政令基础信息失败:', error);
}
},
// ========== 获取业务数据并触发生成 (业务封装) ========== // ========== 获取业务数据并触发生成 (业务封装) ==========
async fetchOrderReportData(orderId) { async fetchOrderReportData(orderId) {
await this._fetchBusinessData({ await this._fetchBusinessData({
...@@ -425,7 +466,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -425,7 +466,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
this.isShowProcess = true; this.isShowProcess = true;
if (Object.keys(this.routeQuery).length !== 0) { if (Object.keys(this.routeQuery).length !== 0) {
const { fileId, topic } = this.routeQuery; const { fileId } = this.routeQuery;
// 外部跳转:根据 topic 决定调用哪种数据获取接口,再触发生成 // 外部跳转:根据 topic 决定调用哪种数据获取接口,再触发生成
if (fileId) { if (fileId) {
...@@ -434,6 +475,8 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -434,6 +475,8 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
} else if (this.curTempTitle === '清单') { } else if (this.curTempTitle === '清单') {
await this.fetchListReportData(fileId); await this.fetchListReportData(fileId);
} else { } else {
// 政令:先获取基础信息(用于翻译栏),再获取写报数据并生成
await this.fetchOrderBaseInfo(fileId);
await this.fetchOrderReportData(fileId); await this.fetchOrderReportData(fileId);
} }
return; return;
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<el-select <el-select
v-model="methodValue" v-model="methodValue"
placeholder="全部制裁手段" placeholder="全部制裁手段"
placement="bottom-end"
class="custom-select" class="custom-select"
@change="getUSChinaSanctionTrendData" @change="getUSChinaSanctionTrendData"
> >
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论