From 2942be453f8f80f3f9188cf3bd1d8e14e61d6b55 Mon Sep 17 00:00:00 2001 From: wjh Date: Thu, 5 Sep 2024 16:36:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=B7=BB=E5=8A=A0=E5=88=B0=E6=A3=80=E6=9F=A5=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=97=A0=E6=95=88=20(#1513)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1513 Reviewed-by: sealday Co-authored-by: wjh Co-committed-by: wjh --- .../src/client/hooks/useAddToChecklistActionProps.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@hera/plugin-rental/src/client/hooks/useAddToChecklistActionProps.tsx b/packages/plugins/@hera/plugin-rental/src/client/hooks/useAddToChecklistActionProps.tsx index 52f064175..f5d6d18ca 100644 --- a/packages/plugins/@hera/plugin-rental/src/client/hooks/useAddToChecklistActionProps.tsx +++ b/packages/plugins/@hera/plugin-rental/src/client/hooks/useAddToChecklistActionProps.tsx @@ -29,7 +29,13 @@ export const useAddToChecklistActionProps = () => { const numbers = []; result?.forEach((items) => { - numbers.push(...items.reduce((orders, current) => [...orders, ...current['单号']], [])); + numbers.push( + ...items.reduce((orders, current) => { + const numberList = [...orders]; + if (current['单号']) numberList.push(...current['单号']); + return numberList; + }, []), + ); }); await api.resource('detail_checks').create({ values: {