From 303d6d618512fb0d1ff1cbade0ddcb0da290a8f5 Mon Sep 17 00:00:00 2001 From: wintsa <770775984@qq.com> Date: Thu, 19 Mar 2026 10:23:24 +0800 Subject: [PATCH] 1 --- src/components/ht/Ht.vue | 23 +- src/components/ht/HtFeeRateMethodForm.vue | 19 +- src/components/ht/htCard.vue | 16 +- src/components/ht/zxFw.vue | 537 +++++++--------------- src/components/shared/HtFeeMethodGrid.vue | 32 +- src/pinia/zxFwPricing.ts | 92 ++-- src/pinia/zxFwPricingKeys.ts | 25 +- 7 files changed, 274 insertions(+), 470 deletions(-) diff --git a/src/components/ht/Ht.vue b/src/components/ht/Ht.vue index 6cf83b7..3696bc9 100644 --- a/src/components/ht/Ht.vue +++ b/src/components/ht/Ht.vue @@ -205,19 +205,23 @@ const projectTotalBudget = computed(() => { const budgetRefreshSignature = computed(() => { const ids = contracts.value.map(item => String(item.id || '').trim()).filter(Boolean) if (ids.length === 0) return '' - const keyVersionEntries = Object.entries(zxFwPricingStore.keyVersions) return ids .map(id => { - const contractVersion = zxFwPricingStore.contractVersions[id] || 0 const additionalMainKey = `htExtraFee-${id}-additional-work` const reserveMainKey = `htExtraFee-${id}-reserve` - const mainKeySig = `${zxFwPricingStore.getKeyVersion(additionalMainKey)}:${zxFwPricingStore.getKeyVersion(reserveMainKey)}` - const methodKeySig = keyVersionEntries - .filter(([key]) => key.startsWith(`${additionalMainKey}-`) || key.startsWith(`${reserveMainKey}-`)) - .sort((a, b) => a[0].localeCompare(b[0])) - .map(([key, version]) => `${key}:${version}`) - .join(',') - return `${id}:${contractVersion}:${mainKeySig}:${methodKeySig}` + const contractState = zxFwPricingStore.contracts[id] || null + const addMain = zxFwPricingStore.htFeeMainStates[additionalMainKey] || null + const reserveMain = zxFwPricingStore.htFeeMainStates[reserveMainKey] || null + const addMethods = zxFwPricingStore.htFeeMethodStates[additionalMainKey] || null + const reserveMethods = zxFwPricingStore.htFeeMethodStates[reserveMainKey] || null + return JSON.stringify({ + id, + contractState, + addMain, + reserveMain, + addMethods, + reserveMethods + }) }) .join('|') }) @@ -1881,3 +1885,4 @@ watch(budgetRefreshSignature, (next, prev) => { } } + diff --git a/src/components/ht/HtFeeRateMethodForm.vue b/src/components/ht/HtFeeRateMethodForm.vue index 165edef..9339923 100644 --- a/src/components/ht/HtFeeRateMethodForm.vue +++ b/src/components/ht/HtFeeRateMethodForm.vue @@ -36,17 +36,17 @@ const isReserveFee = computed(() => { if (mainKey) return mainKey.endsWith('-reserve') return String(props.storageKey || '').includes('-reserve') }) -const contractVersion = computed(() => { +const contractStateSignature = computed(() => { const contractId = contractIdText.value - if (!contractId) return 0 - return zxFwPricingStore.contractVersions[contractId] || 0 + if (!contractId) return '' + return JSON.stringify(zxFwPricingStore.contracts[contractId] || null) }) -const additionalWorkKeyVersion = computed(() => { - if (!isReserveFee.value) return 0 +const additionalWorkStateSignature = computed(() => { + if (!isReserveFee.value) return '' const contractId = contractIdText.value - if (!contractId) return 0 + if (!contractId) return '' const additionalStorageKey = `htExtraFee-${contractId}-additional-work` - return zxFwPricingStore.getKeyVersion(additionalStorageKey) + return JSON.stringify(zxFwPricingStore.htFeeMainStates[additionalStorageKey] || null) }) const baseLabel = computed(() => isReserveFee.value ? '基数(咨询服务总计 + 附加工作费总计)' : '基数(所有服务费预算合计)' @@ -180,8 +180,8 @@ watch( } ) -watch([contractVersion, additionalWorkKeyVersion], ([nextContract, nextAdditional], [prevContract, prevAdditional]) => { - if (nextContract === prevContract && nextAdditional === prevAdditional) return +watch([contractStateSignature, additionalWorkStateSignature], ([nextContractSig, nextAdditionalSig], [prevContractSig, prevAdditionalSig]) => { + if (nextContractSig === prevContractSig && nextAdditionalSig === prevAdditionalSig) return void ensureContractLoaded() }) @@ -230,3 +230,4 @@ onBeforeUnmount(() => { + diff --git a/src/components/ht/htCard.vue b/src/components/ht/htCard.vue index f5fdd84..dc7c426 100644 --- a/src/components/ht/htCard.vue +++ b/src/components/ht/htCard.vue @@ -159,16 +159,15 @@ const refreshContractBudget = async () => { } const budgetRefreshSignature = computed(() => { - const contractVersion = zxFwPricingStore.contractVersions[props.contractId] || 0 const additionalMainKey = `htExtraFee-${props.contractId}-additional-work` const reserveMainKey = `htExtraFee-${props.contractId}-reserve` - const keyVersionEntries = Object.entries(zxFwPricingStore.keyVersions) - const methodKeySig = keyVersionEntries - .filter(([key]) => key.startsWith(`${additionalMainKey}-`) || key.startsWith(`${reserveMainKey}-`)) - .sort((a, b) => a[0].localeCompare(b[0])) - .map(([key, version]) => `${key}:${version}`) - .join(',') - return `${contractVersion}:${zxFwPricingStore.getKeyVersion(additionalMainKey)}:${zxFwPricingStore.getKeyVersion(reserveMainKey)}:${methodKeySig}` + return JSON.stringify({ + contractState: zxFwPricingStore.contracts[props.contractId] || null, + addMain: zxFwPricingStore.htFeeMainStates[additionalMainKey] || null, + reserveMain: zxFwPricingStore.htFeeMainStates[reserveMainKey] || null, + addMethods: zxFwPricingStore.htFeeMethodStates[additionalMainKey] || null, + reserveMethods: zxFwPricingStore.htFeeMethodStates[reserveMainKey] || null + }) }) const scheduleRefreshContractBudget = () => { @@ -349,3 +348,4 @@ onBeforeUnmount(() => { if (budgetRefreshTimer) clearTimeout(budgetRefreshTimer) }) + diff --git a/src/components/ht/zxFw.vue b/src/components/ht/zxFw.vue index a616d58..937215d 100644 --- a/src/components/ht/zxFw.vue +++ b/src/components/ht/zxFw.vue @@ -1,6 +1,6 @@