@@ -17,6 +17,7 @@ type Line = {
|
||||
quantity: string;
|
||||
use: string;
|
||||
equipment_id: string;
|
||||
production_reference: string;
|
||||
};
|
||||
type Snapshot = {
|
||||
requester: { name: string };
|
||||
@@ -31,6 +32,10 @@ type Snapshot = {
|
||||
use: string;
|
||||
destination: string;
|
||||
equipment: { code: string; description: string } | null;
|
||||
production?: {
|
||||
reference: string | null;
|
||||
verification: 'user_supplied';
|
||||
};
|
||||
}[];
|
||||
};
|
||||
type Props = {
|
||||
@@ -68,6 +73,7 @@ const blank = (): Line => ({
|
||||
quantity: '',
|
||||
use: 'internal',
|
||||
equipment_id: '',
|
||||
production_reference: '',
|
||||
});
|
||||
export default function Requests(props: Props) {
|
||||
const filters = useForm({
|
||||
@@ -429,6 +435,8 @@ export default function Requests(props: Props) {
|
||||
line(index, {
|
||||
use: e.target.value,
|
||||
equipment_id: '',
|
||||
production_reference:
|
||||
'',
|
||||
})
|
||||
}
|
||||
>
|
||||
@@ -439,8 +447,38 @@ export default function Requests(props: Props) {
|
||||
<option value="equipment">
|
||||
Em equipamento
|
||||
</option>
|
||||
<option value="production">
|
||||
Insumos para produção
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
{row.use === 'production' && (
|
||||
<label>
|
||||
Referência de produção (se
|
||||
disponível)
|
||||
<input
|
||||
className={controlClass}
|
||||
maxLength={120}
|
||||
value={
|
||||
row.production_reference
|
||||
}
|
||||
onChange={(e) =>
|
||||
line(index, {
|
||||
production_reference:
|
||||
e.target
|
||||
.value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Ordem, lote ou
|
||||
actividade indicada por
|
||||
si. Não é conferida num
|
||||
sistema de produção
|
||||
externo.
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
{row.use === 'equipment' && (
|
||||
<label>
|
||||
Equipamento de destino
|
||||
@@ -617,6 +655,16 @@ export default function Requests(props: Props) {
|
||||
{item.equipment
|
||||
? `Equipamento ${item.equipment.code} · ${item.equipment.description}`
|
||||
: item.destination}
|
||||
{item.use === 'production' && (
|
||||
<span>
|
||||
{' '}
|
||||
· Insumos para produção
|
||||
{item.production
|
||||
?.reference
|
||||
? ` · Referência declarada: ${item.production.reference}`
|
||||
: ''}
|
||||
</span>
|
||||
)}
|
||||
{record.progress && (
|
||||
<span>
|
||||
{' '}
|
||||
|
||||
Reference in New Issue
Block a user