From 081b87df7bfab1becf1c14ead40e46a66fae2924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E7=8F=91?= Date: Mon, 11 Aug 2025 15:13:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A2=E5=8D=95=E5=93=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=8C=E5=8F=96=E6=B6=88=E7=89=A9=E6=B5=81=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/pages/Logistics/List/index.tsx | 41 +++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 970b7b7..b09cc56 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "file-saver": "^2.0.5", "print-js": "^1.6.0", "react-phone-input-2": "^2.15.1", + "react-toastify": "^11.0.5", "xlsx": "^0.18.5" }, "devDependencies": { diff --git a/src/pages/Logistics/List/index.tsx b/src/pages/Logistics/List/index.tsx index 96779ef..9fc33f9 100644 --- a/src/pages/Logistics/List/index.tsx +++ b/src/pages/Logistics/List/index.tsx @@ -5,19 +5,21 @@ import { stockcontrollerGetallstockpoints } from '@/servers/api/stock'; import { formatShipmentState } from '@/utils/format'; import { printPDF } from '@/utils/util'; import { CopyOutlined } from '@ant-design/icons'; +import { ToastContainer, toast } from 'react-toastify'; import { ActionType, PageContainer, ProColumns, ProTable, } from '@ant-design/pro-components'; -import { App, Button, Divider } from 'antd'; +import { App, Button, Divider, Popconfirm } from 'antd'; import { useRef, useState } from 'react'; const ListPage: React.FC = () => { const actionRef = useRef(); const { message } = App.useApp(); const [selectedRows, setSelectedRows] = useState([]); + const [isLoading, setIsLoading] = useState(false); const columns: ProColumns[] = [ { @@ -86,24 +88,55 @@ const ListPage: React.FC = () => { <> - - + */} + { + try { + setIsLoading(true); + const { success, message: errMsg } = + await logisticscontrollerDeleteShipment(record.id); + if (!success) { + throw new Error(errMsg); + } + setIsLoading(false); + actionRef.current?.reload(); + } catch (error: any) { + setIsLoading(false); + message.error(error.message); + } + }} + > + + + ); },