({
value: option.value,
label: option.label
}))}
label={}
className="field-DropDown"
// isOnchanges={
// editstate?.UOM || SelectedUom ? true : false
// }
onChangeFunction={handleActionModeChange}
// valueData={SelectedUom}
// disabled={formType == 'edit' ? true : false}
/>
{actionMode &&
({
value: option.value,
label: option.label
}))}
label={}
className="field-DropDown"
isOnchanges={
closureType ? true : false
}
onChangeFunction={handleClosureTypeChange}
valueData={closureType}
// disabled={formType == 'edit' ? true : false}
/>
{/* */}
}
{closureType &&
current && current < moment().startOf('day')}
/>
}
{/*
*/}
{/* Closure Specific Fields */}
{ShouldCategoryShow() &&
({
value: option.ProdCat,
label: option.ProdCatName
}))}
label={}
className="field-DropDown"
isOnchanges={
selectedCategory ? true : false
}
onChangeFunction={handleCategoryChange}
valueData={selectedCategory}
// disabled={formType == 'edit' ? true : false}
/>
}
{ShouldSubCategoryShow() && (
({
value: option.ProdSubCat,
label: option.ProdSubCatName
}))}
label={}
className="field-DropDown"
isOnchanges={
selectedSubCategory ? true : false
}
onChangeFunction={handleSubCategoryChange}
valueData={selectedSubCategory}
// disabled={formType == 'edit' ? true : false}
/>
)}
{ShouldFacilityShow() &&
({
value: option.ProdId,
label: option.ProdName
}))}
label={}
className="field-DropDown"
isOnchanges={
selectedFacility ? true : false
}
onChangeFunction={handleFacilityChange}
valueData={selectedFacility}
// disabled={formType == 'edit' ? true : false}
/>
{/* */}
}
{showslotselection() &&
SlotTypeChange(e)}
value={SlotChangeType}
>
All Slots
Individual Slots
}
{/* {renderClosureSpecificFields()} */}
{/* Reason Input for Block Actions */}
{shouldShowReasonInput() && (
Reason for Block}
rules={[{ required: true, message: 'Please provide a reason for the block' }]}
>
)}
{/* Day Selection Section for Time Slot Operations */}
{shouldShowDaySelection() && (
Price Change Configuration
{/*
PriceTypeChange(e) }
value={priceChangeType}
>
Full Slot Price
Individual Slot Price
*/}
setNewPrice(e.target.value)}
min={0}
style={{ width: '100%' }}
placeholder={"Enter new price"}
inputMode="decimal"
onInput={(e) => {
let cleanedValue = e.target.value.replace(
/[^0-9.]/g,
''
); // Remove invalid characters
const parts = cleanedValue.split('.');
if (cleanedValue.startsWith('.')) {
cleanedValue = '0' + cleanedValue;
}
e.target.value =
parts.length > 2
? `${parts[0]}.${parts.slice(1).join('')}`
: cleanedValue;
}}
/>
setIndividualPricing(e.target.checked)}
>
Enable Individual Pricing
{individualPricing && (
`₹ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
parser={value => value.replace(/₹\s?|(,*)/g, '')}
onChange={(e) => setIndividualDefaultPrice(e.target.value)}
value={individualDefaultPrice}
placeholder={"Enter individual price"}
inputMode="decimal"
onInput={(e) => {
let cleanedValue = e.target.value.replace(
/[^0-9.]/g,
''
); // Remove invalid characters
const parts = cleanedValue.split('.');
if (cleanedValue.startsWith('.')) {
cleanedValue = '0' + cleanedValue;
}
e.target.value =
parts.length > 2
? `${parts[0]}.${parts.slice(1).join('')}`
: cleanedValue;
}}
/>
)}
{SlotChangeType == 'individual' ?
: ''
}
{/* Individual Slot Price Table */}
{shouldShowIndividualSlotPriceTable() && (
Individual Slot Prices ({selectedSlots.length} slots selected)
{/*
}
size="small"
>
Apply Base Price to All Selected Slots
Base Price: ₹{newPrice || 0}
*/}
{/*
({ slot }))}
pagination={{ pageSize: 10 }}
rowKey="slot"
size="small"
scroll={{ x: 600 }}
/> */}
({ slot }))}
dataSource={selectedSlots.map(slotId => {
const slotObj = Slots.find(s => s.ProdInwardDtlId === slotId);
return {
slot: slotId,
time: slotObj ? `${to12Hour(slotObj.AvailableFrom)} - ${to12Hour(slotObj.AvailableTo)}` : ''
};
})}
pagination={{ pageSize: 10 }}
rowKey="slot"
size="small"
scroll={{ x: 600 }}
/>
)}
)}
{/* Action Summary */}
{(actionMode && closureType && dateRange?.length > 0) && (
Slot Action
{getActionModeText()}
Activity Type
{getClosureTypeText()}
Category
{selectedCategory ? CategoriesData?.find(c => c.ProdCat === selectedCategory)?.ProdCatName : '-'}
Sub Category
{selectedSubCategory ? SubCategoriesData?.find(s => s.ProdSubCat === selectedSubCategory)?.ProdSubCatName : '-'}
Date Range
{dateRange[0]?.format('DD-MMM-YY')} - {dateRange[1]?.format('DD-MMM-YY')}
{shouldShowDaySelection() && (
Days: {getSelectedDaysText()}
{shouldShowTimeSlotSelection() && (
Time Slots: {selectedSlots.length} selected
)}
)}
{actionMode === 'block' && closureReason && (
)}
{/* {actionMode === 'priceChange' && (
Price Type: {priceChangeType === 'individual' ? 'Individual Slots' : 'Full Day'}
{priceChangeType === 'full' && (
Price: ₹{newPrice}
{weekendPremium && (
Weekend Price: ₹{weekendPrice}
)}
)}
{priceChangeType === 'individual' && (
Individual Prices Set for: {selectedSlots.length} slots
)}
)} */}
)}
{/* Apply Action Button */}
applyManagementAction()}
color="901D77"
icon={}
/>
{/* }
disabled={!actionMode || !closureType || !dateRange || dateRange.length === 0}
style={{
height: '50px',
fontSize: '16px',
padding: '0 30px'
}}
>
Apply {getActionModeText()}
*/}
);
};
export default SlotManagementForm;