feat(US-137): update RecordingTable to enhance data display and add new columns for project details

This commit is contained in:
rstubryan
2025-10-24 11:36:14 +07:00
parent 12a69b7c6c
commit 258324f092
@@ -286,31 +286,99 @@ const RecordingTable = () => {
cell: (props) => pageSize * (page - 1) + props.row.index + 1,
},
{
header: 'Flock Kandang ID',
cell: (props) => props.row.original.project_flock_kandang_id,
header: 'ID',
cell: (props) => props.row.original.id,
},
{
header: 'Nama Project',
cell: (props) => `Project ${props.row.original.project_flock_kandang_id}`,
},
{
header: 'Periode',
cell: (props) => props.row.original.day,
},
{
header: 'Umur (hari)',
cell: (props) => props.row.original.day,
},
{
accessorKey: 'record_date',
header: 'Tanggal Recording',
header: 'Waktu Recording',
cell: (props) =>
new Date(props.row.original.record_date).toLocaleDateString(),
},
{
header: 'Day',
cell: (props) => props.row.original.day,
header: 'Populasi Awal',
cell: (props) => props.row.original.total_chick?.toLocaleString() || '-',
},
{
header: 'Status',
cell: (props) => props.row.original.status,
header: 'Ekor Panen',
cell: (props) => '-',
},
{
header: 'KG Panen',
cell: (props) => '-',
},
{
header: 'BW',
cell: (props) => props.row.original.avg_daily_gain?.toFixed(2) || '-',
},
{
header: 'Pakan',
cell: (props) => props.row.original.cum_intake?.toLocaleString() || '-',
},
{
header: 'FCR',
cell: (props) => props.row.original.fcr_value?.toFixed(2) || '-',
},
{
header: 'Deplesi Culling',
cell: (props) => '-',
},
{
header: 'Deplesi Mati',
cell: (props) => '-',
},
{
header: 'Deplesi Afkir',
cell: (props) => '-',
},
{
accessorKey: 'total_depletion',
header: 'Total Depletion',
header: 'Total Deplesi',
cell: (props) => props.row.original.total_depletion,
},
{
header: 'Created By',
cell: (props) => props.row.original.created_user.name,
header: 'Deplesi (%)',
cell: (props) => props.row.original.daily_depletion_rate?.toFixed(2) || '-',
},
{
header: 'Populasi Akhir',
cell: (props) => (props.row.original.total_chick - props.row.original.total_depletion)?.toLocaleString() || '-',
},
{
header: 'IP',
cell: (props) => '-',
},
{
header: 'Status Recording',
cell: (props) => {
const status = props.row.original.status;
return status === 1 ? 'Menunggu Persetujuan' : 'Disetujui';
},
},
{
header: 'Ketepatan Waktu',
cell: (props) => props.row.original.ontime ? 'Tepat Waktu' : 'Terlambat',
},
{
header: 'Status Perubahan',
cell: (props) => 'Tidak ada perubahan',
},
{
header: 'Tanggal Submit',
cell: (props) =>
new Date(props.row.original.created_at).toLocaleString(),
},
{
header: 'Aksi',