feat: add section name field to DetailPlantSection and update ListPlantSection to include section name in data handling

This commit is contained in:
2025-10-17 00:09:39 +07:00
parent 2f621fc6c2
commit 6348c1e2b4
2 changed files with 49 additions and 8 deletions

View File

@@ -16,16 +16,25 @@ const initialPlantSectionData = [
{
plant_section_id: 1,
plantName: 'Assembly',
sectionName: 'Line 1',
status: 'Active',
},
{
plant_section_id: 2,
plantName: 'Painting',
plantName: 'Assembly',
sectionName: 'Line 2',
status: 'Active',
},
{
plant_section_id: 3,
plantName: 'Painting',
sectionName: 'Booth A',
status: 'Active',
},
{
plant_section_id: 4,
plantName: 'Warehouse',
sectionName: 'Receiving',
status: 'Inactive',
},
];
@@ -42,7 +51,13 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [
title: 'Plant Name',
dataIndex: 'plantName',
key: 'plantName',
width: '65%',
width: '30%',
},
{
title: 'Section Name',
dataIndex: 'sectionName',
key: 'sectionName',
width: '30%',
},
{
title: 'Status',
@@ -122,7 +137,8 @@ const ListPlantSection = memo(function ListPlantSection(props) {
const searchLower = searchParam.toLowerCase();
filteredPlantSections = plantSectionData.filter(
(plant) =>
plant.plantName.toLowerCase().includes(searchLower)
plant.plantName.toLowerCase().includes(searchLower) ||
plant.sectionName.toLowerCase().includes(searchLower)
);
}
@@ -194,7 +210,7 @@ const ListPlantSection = memo(function ListPlantSection(props) {
NotifConfirmDialog({
icon: 'question',
title: 'Konfirmasi',
message: 'Apakah anda yakin hapus data "' + param.plantName + '" ?',
message: 'Apakah anda yakin hapus data "' + param.plantName + ' - ' + param.sectionName + '" ?',
onConfirm: () => handleDelete(param.plant_section_id),
onCancel: () => props.setSelectedData(null),
});
@@ -211,7 +227,7 @@ const ListPlantSection = memo(function ListPlantSection(props) {
NotifAlert({
icon: 'success',
title: 'Berhasil',
message: `Data Plant Section "${plantToDelete?.plantName || ''}" berhasil dihapus.`,
message: `Data Plant Section "${plantToDelete?.plantName || ''} - ${plantToDelete?.sectionName || ''}" berhasil dihapus.`,
});
};
@@ -285,6 +301,7 @@ const ListPlantSection = memo(function ListPlantSection(props) {
mobile
cardColor={'#42AAFF'}
header={'plantName'}
subHeader={'sectionName'}
showPreviewModal={showPreviewModal}
showEditModal={showEditModal}
showDeleteDialog={showDeleteDialog}
@@ -300,4 +317,4 @@ const ListPlantSection = memo(function ListPlantSection(props) {
);
});
export default ListPlantSection;
export default ListPlantSection;