Compare commits
No commits in common. "72328b77c0a2ecfa951a93456acdf8a5f8f29a15" and "ad3613465531b7a098b914ab9d53503619232778" have entirely different histories.
72328b77c0
...
ad36134655
|
|
@ -362,7 +362,7 @@ export const createOrderColumns = (
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'deliveryLocal',
|
field: 'deliveryLocal',
|
||||||
headerName: 'Praça',
|
headerName: 'Local Entrega',
|
||||||
width: 180,
|
width: 180,
|
||||||
minWidth: 160,
|
minWidth: 160,
|
||||||
renderCell: (params: Readonly<GridRenderCellParams>) => (
|
renderCell: (params: Readonly<GridRenderCellParams>) => (
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,9 @@ interface LocalFilters {
|
||||||
sellerId: string | null;
|
sellerId: string | null;
|
||||||
sellerName: string | null;
|
sellerName: string | null;
|
||||||
deliveryType: string[] | null;
|
deliveryType: string[] | null;
|
||||||
statusTransfer: string[] | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DELIVERY_TYPES = ['RI', 'EN', 'EF', 'RP'];
|
const DELIVERY_TYPES = ['RI', 'EN', 'EF', 'RP'];
|
||||||
const STATUS_TRANSFER_OPTIONS = ['Em Trânsito', 'Em Separação', 'Aguardando Separação', 'Concluída'];
|
|
||||||
|
|
||||||
const getInitialLocalFilters = (
|
const getInitialLocalFilters = (
|
||||||
urlFilters: Partial<LocalFilters>
|
urlFilters: Partial<LocalFilters>
|
||||||
|
|
@ -80,7 +78,6 @@ const getInitialLocalFilters = (
|
||||||
sellerId: urlFilters.sellerId ?? null,
|
sellerId: urlFilters.sellerId ?? null,
|
||||||
sellerName: urlFilters.sellerName ?? null,
|
sellerName: urlFilters.sellerName ?? null,
|
||||||
deliveryType: urlFilters.deliveryType ?? null,
|
deliveryType: urlFilters.deliveryType ?? null,
|
||||||
statusTransfer: urlFilters.statusTransfer ?? null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const SearchBar = () => {
|
export const SearchBar = () => {
|
||||||
|
|
@ -143,7 +140,6 @@ export const SearchBar = () => {
|
||||||
productId: null,
|
productId: null,
|
||||||
productName: null,
|
productName: null,
|
||||||
deliveryType: null,
|
deliveryType: null,
|
||||||
statusTransfer: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
setLocalFilters(getInitialLocalFilters(resetState));
|
setLocalFilters(getInitialLocalFilters(resetState));
|
||||||
|
|
@ -209,7 +205,6 @@ export const SearchBar = () => {
|
||||||
localFilters.partnerId,
|
localFilters.partnerId,
|
||||||
localFilters.productId,
|
localFilters.productId,
|
||||||
localFilters.deliveryType?.length,
|
localFilters.deliveryType?.length,
|
||||||
localFilters.statusTransfer?.length,
|
|
||||||
].filter(Boolean).length;
|
].filter(Boolean).length;
|
||||||
|
|
||||||
const toggleDrawer = (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
const toggleDrawer = (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
||||||
|
|
@ -475,16 +470,6 @@ export const SearchBar = () => {
|
||||||
renderInput={(params) => <TextField {...params} label="Tipo de Entrega" placeholder="Selecione tipo" />}
|
renderInput={(params) => <TextField {...params} label="Tipo de Entrega" placeholder="Selecione tipo" />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Status de Transferência */}
|
|
||||||
<Autocomplete
|
|
||||||
multiple
|
|
||||||
size="small"
|
|
||||||
options={STATUS_TRANSFER_OPTIONS}
|
|
||||||
value={localFilters.statusTransfer ?? []}
|
|
||||||
onChange={(_, newValue) => updateLocalFilter('statusTransfer', newValue.length > 0 ? newValue : null)}
|
|
||||||
renderInput={(params) => <TextField {...params} label="Status Transferência" placeholder="Selecione status" />}
|
|
||||||
/>
|
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ export const useOrderFilters = () => {
|
||||||
|
|
||||||
searchTriggered: parseAsBoolean.withDefault(false),
|
searchTriggered: parseAsBoolean.withDefault(false),
|
||||||
deliveryType: parseAsArrayOf(parseAsString, ','),
|
deliveryType: parseAsArrayOf(parseAsString, ','),
|
||||||
statusTransfer: parseAsArrayOf(parseAsString, ','),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shallow: true,
|
shallow: true,
|
||||||
|
|
|
||||||
|
|
@ -45,22 +45,7 @@ export const findOrdersSchema = z.object({
|
||||||
onlyPendingTransfer: z.coerce.boolean().optional(),
|
onlyPendingTransfer: z.coerce.boolean().optional(),
|
||||||
|
|
||||||
statusTransfer: z
|
statusTransfer: z
|
||||||
.union([
|
.enum(['Em Trânsito', 'Em Separação', 'Aguardando Separação', 'Concluída'])
|
||||||
z.enum([
|
|
||||||
'Em Trânsito',
|
|
||||||
'Em Separação',
|
|
||||||
'Aguardando Separação',
|
|
||||||
'Concluída',
|
|
||||||
]),
|
|
||||||
z.array(
|
|
||||||
z.enum([
|
|
||||||
'Em Trânsito',
|
|
||||||
'Em Separação',
|
|
||||||
'Aguardando Separação',
|
|
||||||
'Concluída',
|
|
||||||
])
|
|
||||||
),
|
|
||||||
])
|
|
||||||
.optional(),
|
.optional(),
|
||||||
|
|
||||||
markId: z.coerce.number().optional(),
|
markId: z.coerce.number().optional(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue