From c51c3ffbe6826c5d102e4d2b5dfaa6ddf5d17601 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 27 Jan 2026 15:13:31 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-27=20=E9=94=80=E5=94=AE=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/quote/detail/quoteDetail.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/views/modules/quote/detail/quoteDetail.vue b/src/views/modules/quote/detail/quoteDetail.vue index 84ae7cc..da4ea2f 100644 --- a/src/views/modules/quote/detail/quoteDetail.vue +++ b/src/views/modules/quote/detail/quoteDetail.vue @@ -1112,9 +1112,12 @@ export default { watch:{ quote(newVal,oldVal){ if (newVal.id){ - this.quoteDetail.profitRate = this.quote.markup - this.quoteDetail.quoteProfitRate = this.quote.markup - this.handleQueryQuoteDetail(); + // 只有当 quote.id 真正变化时才重新查询,避免重复查询 + if (newVal.id !== (oldVal && oldVal.id)) { + this.quoteDetail.profitRate = this.quote.markup + this.quoteDetail.quoteProfitRate = this.quote.markup + this.handleQueryQuoteDetail(); + } }else { this.dataList = []; } @@ -1149,7 +1152,10 @@ export default { created() { this.quoteDetail.profitRate = this.quote.markup this.quoteDetail.quoteProfitRate = this.quote.markup - this.handleQueryQuoteDetail(); + // 只有当 quote.id 存在时才查询,避免和 watch 重复查询 + if (this.quote.id) { + this.handleQueryQuoteDetail(); + } } }