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(); + } } }