fix: Resolve TypeScript errors in page.tsx and phases-chantier/page.tsx

This commit is contained in:
dahoud
2025-10-15 20:01:04 +00:00
parent 763ab81da3
commit aed2ce0182
22 changed files with 152 additions and 118 deletions

View File

@@ -72,7 +72,7 @@ const MaintenancesPage = () => {
setMaintenance({
type: TypeMaintenance.PREVENTIVE,
statut: StatutMaintenance.PLANIFIEE,
datePrevue: new Date(),
datePrevue: new Date().toISOString(),
cout: 0
});
setSubmitted(false);
@@ -223,7 +223,7 @@ const MaintenancesPage = () => {
};
const dateRealisationBodyTemplate = (rowData: MaintenanceMateriel) => {
return formatDate(rowData.dateRealisation);
return formatDate(rowData.dateRealisee);
};
const actionBodyTemplate = (rowData: MaintenanceMateriel) => {
@@ -250,10 +250,12 @@ const MaintenancesPage = () => {
return 'success';
case TypeMaintenance.CORRECTIVE:
return 'danger';
case TypeMaintenance.PREDICTIVE:
case TypeMaintenance.REVISION:
return 'info';
case TypeMaintenance.CURATIVE:
case TypeMaintenance.CONTROLE_TECHNIQUE:
return 'warning';
case TypeMaintenance.NETTOYAGE:
return 'secondary';
default:
return undefined;
}
@@ -366,6 +368,7 @@ const MaintenancesPage = () => {
value={maintenances}
selection={selectedMaintenances}
onSelectionChange={(e) => setSelectedMaintenances(e.value)}
selectionMode="checkbox"
dataKey="id"
paginator
rows={10}
@@ -450,11 +453,11 @@ const MaintenancesPage = () => {
</div>
<div className="field col-12 md:col-6">
<label htmlFor="dateRealisation" className="font-bold">Date de réalisation</label>
<label htmlFor="dateRealisee" className="font-bold">Date de réalisation</label>
<Calendar
id="dateRealisation"
value={maintenance.dateRealisation ? new Date(maintenance.dateRealisation) : null}
onChange={(e) => onDateChange(e, 'dateRealisation')}
id="dateRealisee"
value={maintenance.dateRealisee ? new Date(maintenance.dateRealisee) : null}
onChange={(e) => onDateChange(e, 'dateRealisee')}
dateFormat="dd/mm/yy"
showIcon
/>