feat: Implementar ingreso de bobinas por lote
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 2m13s
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 2m13s
Se introduce una nueva funcionalidad para el ingreso masivo de bobinas a partir de un único remito. Esto agiliza significativamente la carga de datos y reduce errores al evitar la repetición de la planta, número y fecha de remito. La implementación incluye: - Un modal maestro-detalle de dos pasos que primero verifica el remito y luego permite la carga de las bobinas. - Lógica de autocompletado de fecha y feedback al usuario si el remito ya existe. - Un nuevo endpoint en el backend para procesar el lote de forma transaccional.
This commit is contained in:
@@ -3,6 +3,8 @@ import type { StockBobinaDto } from '../../models/dtos/Impresion/StockBobinaDto'
|
||||
import type { CreateStockBobinaDto } from '../../models/dtos/Impresion/CreateStockBobinaDto';
|
||||
import type { UpdateStockBobinaDto } from '../../models/dtos/Impresion/UpdateStockBobinaDto';
|
||||
import type { CambiarEstadoBobinaDto } from '../../models/dtos/Impresion/CambiarEstadoBobinaDto';
|
||||
import type { CreateStockBobinaLoteDto } from '../../models/dtos/Impresion/CreateStockBobinaLoteDto';
|
||||
import type { UpdateFechaRemitoLoteDto } from '../../models/dtos/Impresion/UpdateFechaRemitoLoteDto';
|
||||
|
||||
interface GetAllStockBobinasParams {
|
||||
idTipoBobina?: number | null;
|
||||
@@ -50,6 +52,23 @@ const deleteIngresoBobina = async (idBobina: number): Promise<void> => {
|
||||
await apiClient.delete(`/stockbobinas/${idBobina}`);
|
||||
};
|
||||
|
||||
const verificarRemitoExistente = async (idPlanta: number, remito: string, fechaRemito?: string | null): Promise<StockBobinaDto[]> => {
|
||||
const params: { idPlanta: number; remito: string; fechaRemito?: string } = { idPlanta, remito };
|
||||
if (fechaRemito) {
|
||||
params.fechaRemito = fechaRemito;
|
||||
}
|
||||
const response = await apiClient.get<StockBobinaDto[]>('/stockbobinas/verificar-remito', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const ingresarLoteBobinas = async (data: CreateStockBobinaLoteDto): Promise<void> => {
|
||||
await apiClient.post('/stockbobinas/lote', data);
|
||||
};
|
||||
|
||||
const actualizarFechaRemitoLote = async (data: UpdateFechaRemitoLoteDto): Promise<void> => {
|
||||
await apiClient.put('/stockbobinas/actualizar-fecha-remito', data);
|
||||
};
|
||||
|
||||
const stockBobinaService = {
|
||||
getAllStockBobinas,
|
||||
getStockBobinaById,
|
||||
@@ -57,6 +76,9 @@ const stockBobinaService = {
|
||||
updateDatosBobinaDisponible,
|
||||
cambiarEstadoBobina,
|
||||
deleteIngresoBobina,
|
||||
verificarRemitoExistente,
|
||||
ingresarLoteBobinas,
|
||||
actualizarFechaRemitoLote,
|
||||
};
|
||||
|
||||
export default stockBobinaService;
|
||||
Reference in New Issue
Block a user