Added ReprintPDFDataShare componnt
This commit is contained in:
parent
f9b0b9191c
commit
ede0fce223
|
|
@ -88,6 +88,8 @@ import { changeOrderOfferDetail } from '../../../../../Features/Offer/Offer.js';
|
||||||
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, changeLoyaltyConsumedQuantities } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, changeLoyaltyConsumedQuantities } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { ChangeTotalAmount } from '../../../../../Features/ExteraCharges/ExtraCharges.js';
|
import { ChangeTotalAmount } from '../../../../../Features/ExteraCharges/ExtraCharges.js';
|
||||||
import { Radio } from 'antd';
|
import { Radio } from 'antd';
|
||||||
|
import ReprintPDFDataShare from './ReprintPDFDataShare.jsx';
|
||||||
|
import { ImShare } from 'react-icons/im';
|
||||||
|
|
||||||
const RetailApiurl = import.meta.env.ENV_API_URL;
|
const RetailApiurl = import.meta.env.ENV_API_URL;
|
||||||
|
|
||||||
|
|
@ -116,7 +118,6 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
const [bulkMode, setBulkMode] = useState(false);
|
const [bulkMode, setBulkMode] = useState(false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [reprintData, setReprintData] = useState([]);
|
const [reprintData, setReprintData] = useState([]);
|
||||||
console.log(reprintData, 'reprintData');
|
|
||||||
const [reprintReasonList, setReprintReasonList] = useState([]);
|
const [reprintReasonList, setReprintReasonList] = useState([]);
|
||||||
const [isDuplicate, setIsDuplicate] = useState('Original');
|
const [isDuplicate, setIsDuplicate] = useState('Original');
|
||||||
const [BillSearch, setBillSearch] = useState('');
|
const [BillSearch, setBillSearch] = useState('');
|
||||||
|
|
@ -138,7 +139,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
SettingDataSelector?.[0]?.['SettingDtlDetails']?.find(
|
SettingDataSelector?.[0]?.['SettingDtlDetails']?.find(
|
||||||
(item) => item.SettingIdName === 'Estimation'
|
(item) => item.SettingIdName === 'Estimation'
|
||||||
)?.SettingValue === 'Y';
|
)?.SettingValue === 'Y';
|
||||||
console.log(preferenceEstimate, 'preferenceEstimate');
|
console.log(preferenceEstimate, 'preferenceEstimate');
|
||||||
const editBill = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
const editBill = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
setting?.SettingIdName?.toLowerCase() === 'editbill' &&
|
setting?.SettingIdName?.toLowerCase() === 'editbill' &&
|
||||||
|
|
@ -167,9 +168,10 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
const SessionMobileNo = getSession('MobileNo');
|
const SessionMobileNo = getSession('MobileNo');
|
||||||
const [dateStrings, setDateStrings] = useState([]);
|
const [dateStrings, setDateStrings] = useState([]);
|
||||||
const [type, setType] = useState("Sales");
|
const [type, setType] = useState("Sales");
|
||||||
|
const [showShareModal, setShowShareModal] = useState(false);
|
||||||
// ---- 1. Fetch Function ----
|
// ---- 1. Fetch Function ----
|
||||||
const fetchData = async ({ queryKey }) => {
|
const fetchData = async ({ queryKey }) => {
|
||||||
const [_, dates, page,type] = queryKey;
|
const [_, dates, page, type] = queryKey;
|
||||||
const Response = await dispatch(
|
const Response = await dispatch(
|
||||||
ReprintDetails({
|
ReprintDetails({
|
||||||
CompId,
|
CompId,
|
||||||
|
|
@ -178,7 +180,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
OrderFromDate: dates?.[0] ?? '',
|
OrderFromDate: dates?.[0] ?? '',
|
||||||
OrderToDate: dates?.[1] ?? '',
|
OrderToDate: dates?.[1] ?? '',
|
||||||
PageNumber: page,
|
PageNumber: page,
|
||||||
Type:type
|
Type: type
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Response?.data?.statusCode === 1) {
|
if (Response?.data?.statusCode === 1) {
|
||||||
|
|
@ -189,7 +191,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data, isLoading, error } = useQuery({
|
const { data, isLoading, error } = useQuery({
|
||||||
queryKey: ['reprint', dateStrings, page,type],
|
queryKey: ['reprint', dateStrings, page, type],
|
||||||
queryFn: fetchData,
|
queryFn: fetchData,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
staleTime: 1000 * 60 * 5,
|
staleTime: 1000 * 60 * 5,
|
||||||
|
|
@ -250,7 +252,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
};
|
};
|
||||||
commonMasterApiCall();
|
commonMasterApiCall();
|
||||||
}, []);
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
DefaultReprintReason();
|
DefaultReprintReason();
|
||||||
}, []);
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -1193,7 +1195,6 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
const mutiplePrint = async (printType) => {
|
const mutiplePrint = async (printType) => {
|
||||||
setIsProcessing(true);
|
setIsProcessing(true);
|
||||||
setProcessingProgress(0);
|
setProcessingProgress(0);
|
||||||
|
|
||||||
const result = await MobileMultiPdfPrint({
|
const result = await MobileMultiPdfPrint({
|
||||||
printerTemplateStyle,
|
printerTemplateStyle,
|
||||||
printDatas,
|
printDatas,
|
||||||
|
|
@ -1406,7 +1407,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeOptions = [
|
const typeOptions = [
|
||||||
{ label: "Sales", value: "Sales" },
|
{ label: "Sales", value: "Sales" },
|
||||||
{ label: "Estimate", value: "Est" },
|
{ label: "Estimate", value: "Est" },
|
||||||
];
|
];
|
||||||
|
|
@ -1490,7 +1491,9 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
Reprintformdata();
|
Reprintformdata();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
|
<ImShare fontSize={22} onClick={() => setShowShareModal(true)} style={{ cursor: 'pointer' }} />
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{selectedRows.length > 0 && (
|
{selectedRows.length > 0 && (
|
||||||
<div className="action-icons-reprint">
|
<div className="action-icons-reprint">
|
||||||
|
|
@ -1503,6 +1506,9 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
onClick={() => mutiplePrint('whatsapp')}
|
onClick={() => mutiplePrint('whatsapp')}
|
||||||
className="icon-whatsapp"
|
className="icon-whatsapp"
|
||||||
/>
|
/>
|
||||||
|
{/* <ReprintPDFDataShare
|
||||||
|
printData={selectedRows}
|
||||||
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1848,6 +1854,14 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{ showShareModal && <ReprintPDFDataShare
|
||||||
|
printerTemplateStyle={printerTemplateStyle}
|
||||||
|
printDatas={printDatas}
|
||||||
|
SettingDataSelector={SettingDataSelector}
|
||||||
|
open={showShareModal}
|
||||||
|
onClose={() => setShowShareModal(false)}
|
||||||
|
/>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue