diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue index f24b2d348..9c06b4241 100755 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue @@ -473,15 +473,12 @@ function calculateTotalPrice() { } }); totalPrice.value = sum.toFixed(2); - // Bug #464: 零售价与诊疗子项合计总价实时同步 + // Bug #464: 零售价与诊疗子项合计总价实时同步,直接赋值不使用nextTick避免多调用方竞争 const hasValidItem = treatmentItems.value.some( (item) => item.adviceDefinitionId && item.adviceDefinitionId !== '' ); if (hasValidItem) { - // 使用 nextTick 确保总价更新后零售价才更新,避免 Vue 响应式时序问题 - nextTick(() => { - form.value.retailPrice = parseFloat(totalPrice.value) || 0; - }); + form.value.retailPrice = parseFloat(totalPrice.value) || 0; } else { form.value.retailPrice = undefined; } @@ -763,10 +760,7 @@ function selectRow(row, index) { treatmentItems.value[index].adviceDefinitionId = row.id; treatmentItems.value[index].retailPrice = row.retailPrice || 0; medicineSearchKey.value = ''; - // 使用 nextTick 确保 DOM 更新后再计算总价 - nextTick(() => { - calculateTotalPrice(); - }); + calculateTotalPrice(); } // 清空诊疗子项