From 3c54b47940e7cc784f4cc2400b23f4ef0fbcec0b Mon Sep 17 00:00:00 2001 From: wangyang <123456@123.com> Date: Thu, 28 Aug 2025 15:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E7=BB=93=E8=B4=A6=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ts/core/work/financial/period.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ts/core/work/financial/period.ts b/src/ts/core/work/financial/period.ts index adb1315b7..531d0b981 100644 --- a/src/ts/core/work/financial/period.ts +++ b/src/ts/core/work/financial/period.ts @@ -158,7 +158,9 @@ export class Period extends Entity implements IPeriod { } async resetOperationLog(): Promise { if (this.metadata.operationId) { - return await this.operationColl.remove({ id: this.metadata.operationId } as schema.XOperationLog); + return await this.operationColl.remove({ + id: this.metadata.operationId, + } as schema.XOperationLog); } return true; } @@ -434,6 +436,8 @@ export class Period extends Entity implements IPeriod { }, }); const balance = await this.loadBalance(); + const form = await this.financial.loadBalance(); + form?.loadFields(true); for (const child of answer.root.children.flatMap((item) => item.children)) { if (child.id == 'S' + item.accountingValue) { item.assetStartAmount = child.data['start-root-' + amountId]; @@ -442,7 +446,25 @@ export class Period extends Entity implements IPeriod { item.assetEndAmount = child.data['end-root-' + amountId]; item.assetBalanced = child.data.balance['root-' + amountId]; if (balance) { - item.financialAmount = balance['T' + item.financial.id]; + const firstField = form?.fields && Object.values(form.fields)[0]; + const rootCode = firstField?.code; + const codeMap: Record = { + 长期股权投资: 'B24', + 固定资产: 'B26', + 固定资产累计折旧: 'B27', + 在建工程: 'B30', + 无形资产: 'B32', + 无形资产累计摊销: 'B33', + 公共基础设施: 'B36', + 公共基础设施累计折旧: 'B41', + 政府储备物资: 'B51', + 文物文化资产: 'B52', + }; + const subjectCode = codeMap[item.name]; + const rootBlock = rootCode ? balance[rootCode] : null; + if (rootBlock && subjectCode in rootBlock) { + item.financialAmount = rootBlock[subjectCode]; + } } const first = formatNumber(item.assetEndAmount ?? 0, 2); const second = formatNumber(item.financialAmount ?? 0, 2); -- Gitee