From 1a0e97011f4c7c33fd93830aaf84144fe0386a2f Mon Sep 17 00:00:00 2001
From: wintsa <770775984@qq.com>
Date: Thu, 19 Mar 2026 10:56:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E7=BD=AE=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/ht/HtContractSummary.vue | 437 ++++++++++++++++++++++
src/components/ht/HtFeeRateMethodForm.vue | 2 +-
src/components/ht/htCard.vue | 17 +-
src/components/ht/zxFw.vue | 1 -
src/layout/tab.vue | 37 +-
src/main.ts | 4 +-
src/pinia/zxFwPricing.ts | 4 +-
7 files changed, 493 insertions(+), 9 deletions(-)
create mode 100644 src/components/ht/HtContractSummary.vue
diff --git a/src/components/ht/HtContractSummary.vue b/src/components/ht/HtContractSummary.vue
new file mode 100644
index 0000000..ae8a1b3
--- /dev/null
+++ b/src/components/ht/HtContractSummary.vue
@@ -0,0 +1,437 @@
+
+
+
+
+
+
+
diff --git a/src/components/ht/HtFeeRateMethodForm.vue b/src/components/ht/HtFeeRateMethodForm.vue
index 9339923..c85c113 100644
--- a/src/components/ht/HtFeeRateMethodForm.vue
+++ b/src/components/ht/HtFeeRateMethodForm.vue
@@ -54,7 +54,7 @@ const baseLabel = computed(() =>
const budgetFee = computed(() => {
if (baseValue.value == null || rate.value == null) return null
- return Number((baseValue.value * rate.value).toFixed(3))
+ return Number((baseValue.value * rate.value/100).toFixed(3))
})
const formatAmount = (value: number | null) =>
diff --git a/src/components/ht/htCard.vue b/src/components/ht/htCard.vue
index dc7c426..4cccd7c 100644
--- a/src/components/ht/htCard.vue
+++ b/src/components/ht/htCard.vue
@@ -317,6 +317,21 @@ const reserveFeeView = markRaw(
})
);
+const summaryView = markRaw(
+ defineComponent({
+ name: 'HtContractSummaryWithProps',
+ setup() {
+ const AsyncSummary = defineAsyncComponent({
+ loader: () => import('@/components/ht/HtContractSummary.vue'),
+ onError: (err) => {
+ console.error('加载 HtContractSummary 组件失败:', err)
+ }
+ })
+ return () => h(AsyncSummary, { contractId: props.contractId })
+ }
+ })
+)
+
// 4. 给分类数组添加严格类型标注
const xmCategories: XmCategoryItem[] = [
{ key: 'base-info', label: '基础信息', component: htBaseInfoView },
@@ -326,7 +341,7 @@ const xmCategories: XmCategoryItem[] = [
{ key: 'contract', label: '咨询服务', component: zxfwView },
{ key: 'additional-work-fee', label: '附加工作费', component: additionalWorkFeeView },
{ key: 'reserve-fee', label: '预备费', component: reserveFeeView },
- { key: 'all', label: '汇总', component: reserveFeeView },
+ { key: 'all', label: '汇总', component: summaryView },
];
diff --git a/src/components/ht/zxFw.vue b/src/components/ht/zxFw.vue
index 937215d..87e9709 100644
--- a/src/components/ht/zxFw.vue
+++ b/src/components/ht/zxFw.vue
@@ -632,7 +632,6 @@ const columnDefs: ColDef[] = [
editable: params => !isFixedRow(params.data),
valueGetter: params => {
if (!params.data) return null
- console.log(detailRows.value)
return params.data.finalFee
},
// valueSetter: params => {
diff --git a/src/layout/tab.vue b/src/layout/tab.vue
index 904ff0a..cedb471 100644
--- a/src/layout/tab.vue
+++ b/src/layout/tab.vue
@@ -1732,20 +1732,51 @@ const confirmImportOverride = async () => {
const handleReset = async () => {
try {
+ dataMenuOpen.value = false
+
+ // 1) 先清运行时内存态,避免旧状态在清库过程被再次持久化
+ tabStore.resetTabs()
+ zxFwPricingStore.$patch({
+ contracts: {},
+ contractLoaded: {},
+ servicePricingStates: {},
+ htFeeMainStates: {},
+ htFeeMethodStates: {},
+ keyedStates: {}
+ } as any)
+ await kvStore.clear()
+
+ // 2) 清浏览器存储与默认 localforage 数据
localStorage.clear()
sessionStorage.clear()
await localforage.clear()
+
+ // 3) 清 pinia 分库持久化
await Promise.all(
getPiniaPersistStores().map(async ({ store }) => {
await store.clear()
})
)
+
+ // 4) 清插件按 store 维护的持久化 key(双保险)
+ const clearTasks: Promise[] = []
+ if (tabStore.$clearPersisted) clearTasks.push(tabStore.$clearPersisted())
+ if (zxFwPricingStore.$clearPersisted) clearTasks.push(zxFwPricingStore.$clearPersisted())
+ if (kvStore.$clearPersisted) clearTasks.push(kvStore.$clearPersisted())
+ await Promise.all(clearTasks)
+
+ // 5) 需要保留的引导标记恢复
localStorage.setItem(USER_GUIDE_COMPLETED_KEY, '1')
+
+ // 6) 持久化当前“空状态”并刷新页面
+ const persistTasks: Promise[] = []
+ if (tabStore.$persistNow) persistTasks.push(tabStore.$persistNow())
+ if (zxFwPricingStore.$persistNow) persistTasks.push(zxFwPricingStore.$persistNow())
+ if (kvStore.$persistNow) persistTasks.push(kvStore.$persistNow())
+ await Promise.all(persistTasks)
+ window.location.reload()
} catch (error) {
console.error('reset failed:', error)
- } finally {
- tabStore.resetTabs()
- await tabStore.$persistNow?.()
}
}
diff --git a/src/main.ts b/src/main.ts
index 75f42e4..ab6be9e 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -10,7 +10,7 @@ import {
RowAutoHeightModule,
TextEditorModule,
TooltipModule,
- UndoRedoEditModule,RenderApiModule ,ColumnApiModule ,CellSpanModule
+ UndoRedoEditModule,RenderApiModule ,ColumnApiModule ,CellSpanModule ,RowStyleModule ,RowSelectionModule
} from 'ag-grid-community'
import {
@@ -47,7 +47,7 @@ const AG_GRID_MODULES = [
RowGroupingModule,
CellSelectionModule,
ClipboardModule,
- LocaleModule,ValidationModule ,CellSpanModule
+ LocaleModule,ValidationModule ,CellSpanModule ,RowStyleModule ,RowSelectionModule
]
const pinia = createPinia()
diff --git a/src/pinia/zxFwPricing.ts b/src/pinia/zxFwPricing.ts
index 8772e9e..8ff7c0e 100644
--- a/src/pinia/zxFwPricing.ts
+++ b/src/pinia/zxFwPricing.ts
@@ -635,7 +635,9 @@ export const useZxFwPricingStore = defineStore('zxFwPricing', () => {
if (!changed) return false
const rowsWithSyncedFinalFee = updatedRows.map(row => {
- if (String(row.id || '') === FIXED_ROW_ID) return row
+ const rowId = String(row.id || '')
+ if (rowId === FIXED_ROW_ID) return row
+ if (rowId !== targetServiceId) return row
const rowSubtotal = sumNullableNumbers([
toFiniteNumberOrNull(row.investScale),
toFiniteNumberOrNull(row.landScale),