From 626b3b502a5004af2328540cb89a1f32bfd6da9d Mon Sep 17 00:00:00 2001 From: Srinath Date: Fri, 20 Mar 2026 11:00:25 +0530 Subject: [PATCH 1/2] loader funtion change --- .../OtherConponents/Reprint/BSReprint.jsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx index df2594e..344c815 100644 --- a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx +++ b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx @@ -1158,10 +1158,10 @@ function BSReprint({ setOpenModel = () => { } }) { }; const handleSendEmail = async (value) => { + const toEmail = value.email; + setLoading(true); try { - const toEmail = value.email; if (selectedRows.length === 0) { - setLoading(true); const result = await MobilePdfPrint({ printerTemplateStyle, printDatas, @@ -1172,16 +1172,25 @@ function BSReprint({ setOpenModel = () => { } }) { }); if (result?.data?.status === 1) { - setEmailModalOpen(false); // ✅ Close modal - setEmailId(''); // ✅ Reset email input (optional) - setLoading(false); + setMessage({ type: 'success', data: result?.data?.response || 'Email sent successfully' }); + setEmailModalOpen(false); + setEmailId(''); form.resetFields(); + } else { + setMessage({ type: 'error', data: result?.data?.response || 'Email sending failed' }); } } else { - mutiplePrint('email',toEmail); + await mutiplePrint('email', toEmail); } } catch (err) { console.error('❌ Email error:', err); + setMessage({ type: 'error', data: err?.message || 'Something went wrong while sending email' }); + } finally { + setLoading(false); + if (selectedRows.length === 0) { + // for single row, form already reset on success; for failure, still reset to clear bad input + form.resetFields(); + } } }; @@ -1844,10 +1853,10 @@ function BSReprint({ setOpenModel = () => { } }) { /> */} - {(emailModalOpen || isProcessing) && ( + {(emailModalOpen || loading) && ( setEmailModalOpen(false)} form={form} handleSendEmailWithEnteredEmail={handleSendEmail} From c01a3baa98279973a433aa61a933c511151369f3 Mon Sep 17 00:00:00 2001 From: Srinath Date: Fri, 20 Mar 2026 11:01:28 +0530 Subject: [PATCH 2/2] RePrint Detailds if no found data Print Icon Disable --- .../ReprintReasonReportList.jsx | 72 ++++++++++--------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/src/Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx b/src/Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx index e9d29cd..5d6092e 100644 --- a/src/Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx +++ b/src/Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx @@ -90,6 +90,8 @@ const ReprintReasonReportList = () => { const [message, setMessage] = useState({ type: null, data: null }); const [searchedText, setSearchedText] = useState(''); const [tableData, setTableData] = useState([]); + console.log(tableData, 'tableData23232'); + const [fromDate, setFromDate] = useState(); const [toDate, setToDate] = useState(); const [page, setpage] = useState(1); @@ -103,21 +105,21 @@ const ReprintReasonReportList = () => { index: index + 1 })); - const items = [ - { - name: 'Home', - link: `${subDirectory}app-page/home`, - }, - - { - name: 'Reprint Details', - link: `${subDirectory}report/reprintreasonreport`, - }, - ]; - - useEffect(() => { - dispatch(changeBreadCrumb({ items: items })); - }, []); + const items = [ + { + name: 'Home', + link: `${subDirectory}app-page/home`, + }, + + { + name: 'Reprint Details', + link: `${subDirectory}report/reprintreasonreport`, + }, + ]; + + useEffect(() => { + dispatch(changeBreadCrumb({ items: items })); + }, []); const columns = [ { title: 'Sl.No', @@ -463,11 +465,13 @@ const ReprintReasonReportList = () => { > 0 - ? 'ItemWiseReport-printerIcon' - : 'ItemWiseReport-printerIcon-disabled' - } + style={{ + fontSize: '24px', + cursor: tableData?.length > 0 ? 'pointer' : 'not-allowed', + opacity: tableData?.length > 0 ? 1 : 0.5, + pointerEvents: tableData?.length > 0 ? 'auto' : 'none' + }} + /> {/*
{
*/} -
- - current && current > dayjs()} - /> - -
+
+ + current && current > dayjs()} + /> + +