refactor(FE): Show additional flock info in recording form

This commit is contained in:
rstubryan
2026-01-15 17:29:09 +07:00
parent 4a9cbdc219
commit 8fe51c976b
2 changed files with 50 additions and 0 deletions
@@ -1658,6 +1658,54 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
/>
</>
</div>
{/* Additional Information Fields */}
{(projectFlockKandangLookup || projectFlockKandangDetail) && (
<div
className={
'grid grid-cols-4 gap-4 pt-4 border-t border-gray-200'
}
>
<div>
<span className='text-sm text-gray-600'>Gudang</span>
<p className='font-semibold'>
{projectFlockKandangLookup?.warehouse?.name ||
initialValues?.warehouse?.name ||
'-'}
</p>
</div>
<div>
<span className='text-sm text-gray-600'>Umur</span>
<p className='font-semibold'>
{nextDayRecording
? `Hari ke-${nextDayRecording.next_day} (Minggu ke-${Math.ceil(nextDayRecording.next_day / 7)})`
: initialValues?.day
? `Hari ke-${initialValues.day} (Minggu ke-${Math.ceil(initialValues.day / 7)})`
: '-'}
</p>
</div>
<div>
<span className='text-sm text-gray-600'>Standard FCR</span>
<p className='font-semibold'>
{projectFlockKandangLookup?.project_flock?.fcr?.name ||
initialValues?.project_flock?.fcr?.name ||
'-'}
</p>
</div>
<div>
<span className='text-sm text-gray-600'>
Standard Produksi
</span>
<p className='font-semibold'>
{projectFlockKandangLookup?.project_flock
?.production_standard_id
? `ID: ${projectFlockKandangLookup.project_flock.production_standard_id}`
: initialValues?.project_flock?.production_standart
?.name || '-'}
</p>
</div>
</div>
)}
</Card>
)}
+2
View File
@@ -6,6 +6,7 @@ import { Location } from '@/types/api/master-data/location';
import { BaseApproval, BaseMetadata } from '@/types/api/api-general';
import { Nonstock } from '@/types/api/master-data/nonstock';
import { ProductionStandard } from '@/types/api/master-data/production-standard';
import { Warehouse } from '@/types/api/master-data/warehouse';
export type BaseProjectFlock = {
id: number;
@@ -71,6 +72,7 @@ export type ProjectFlockKandangLookup = {
kandang_id: number;
kandang: Kandang;
project_flock: ProjectFlock;
warehouse: Warehouse;
quantity: number;
available_quantity?: number;
population: number;