From 5d9dd76c75b748c99499b0d8283c6325aca61b3f Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Tue, 26 Aug 2025 15:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bfix=EF=BC=9A=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=BB=B7=E6=A0=BC=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=96=B0=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Products/Index.js | 12 +++++------- src/views/products/Detail/ProductInfoQuotation.jsx | 6 +++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 7f173c6..d66b067 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -415,16 +415,14 @@ export const useProductsStore = create( quotationList: newQuotationList }) - let promiseDelete = Promise.resolve(newQuotationList) - if (isNotEmpty(quotationId)) { - const { result, success } = await deleteQuotationAction(quotationId) - if (!success) { - promiseDelete = Promise.reject(result) + const { success } = await deleteQuotationAction(quotationId) + if (success) { + return Promise.resolve(newQuotationList) + } else { + return Promise.reject(newQuotationList) } } - - return promiseDelete }, // side effects diff --git a/src/views/products/Detail/ProductInfoQuotation.jsx b/src/views/products/Detail/ProductInfoQuotation.jsx index 47cd2e0..9e12784 100644 --- a/src/views/products/Detail/ProductInfoQuotation.jsx +++ b/src/views/products/Detail/ProductInfoQuotation.jsx @@ -294,7 +294,11 @@ const ProductInfoQuotation = ({ editable, ...props }) => { title="请确认" description="你要删除这条价格吗?" onConfirm={() => { - deleteQuotation(quotation).catch((ex) => { + deleteQuotation(quotation) + .then((res) => { + triggerChange(res); + }) + .catch((ex) => { notification.error({ message: "Notification", description: ex.message,