feat: refs #6321 requested changes

This commit is contained in:
Javier Segarra 2025-02-06 18:00:18 +01:00
parent ceef46eccc
commit 220fb057e6
7 changed files with 136 additions and 114 deletions

View File

@ -291,9 +291,9 @@ globals:
buyRequest: Peticiones de compra
wasteBreakdown: Deglose de mermas
itemCreate: Nuevo artículo
tax: 'IVA'
botanical: 'Botánico'
barcode: 'Código de barras'
tax: IVA
botanical: Botánico
barcode: Código de barras
itemTypeCreate: Nueva familia
family: Familia
lastEntries: Últimas entradas
@ -668,8 +668,8 @@ wagon:
volumeNotEmpty: El volumen no puede estar vacío
typeNotEmpty: El tipo no puede estar vacío
maxTrays: Has alcanzado el número máximo de bandejas
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
maxWagonHeight: 'La altura máxima del vagón es '
minHeightBetweenTrays: La distancia mínima entre bandejas es
maxWagonHeight: La altura máxima del vagón es
uncompleteTrays: Hay bandejas sin completar
params:
label: Etiqueta
@ -814,7 +814,7 @@ components:
cardDescriptor:
mainList: Listado principal
summary: Resumen
moreOptions: 'Más opciones'
moreOptions: Más opciones
leftMenu:
addToPinned: Añadir a fijados
removeFromPinned: Eliminar de fijados

View File

@ -46,7 +46,8 @@ const defaultColumnAttrs = {
};
const emit = defineEmits(['onDialogClosed', 'itemReplaced']);
const conditionalValuePrice = (price) => (price > 1.3 ? 'match' : 'not-match');
const conditionalValuePrice = (price) =>
price > 1 + ticketConfig.value.lackAlertPrice / 100 ? 'match' : 'not-match';
const columns = computed(() => [
{
@ -189,7 +190,8 @@ const isSelectionAvailable = (itemProposal) => {
return byPrice;
}
const byQuantity =
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) < 30;
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) <
ticketConfig.value.lackAlertPrice;
return byQuantity;
};

View File

@ -42,7 +42,13 @@ const reload = async () => {
tableRef.value.tableRef.reload();
};
defineExpose({ reload });
const filter = computed(() => ({
scopeDays: route.query.days,
showType: true,
alertLevelCode: 'FREE',
date: Date.vnNew(),
warehouseFk: useState().getUser().value.warehouseFk,
}));
const itemProposalEvt = (data) => {
const { itemProposal } = data;
itemProposalSelected.value = itemProposal;
@ -54,7 +60,6 @@ function onBuysFetched(data) {
}
const showItemProposal = () => {
quasar
.dialog({
component: ItemProposalProxy,
componentProps: {
@ -65,13 +70,6 @@ const showItemProposal = () => {
})
.onOk(itemProposalEvt);
};
const filter = computed(() => ({
scopeDays: 2,
showType: true,
alertLevelCode: 'FREE',
date: Date.vnNew(),
warehouseFk: useState().getUser().value.warehouseFk,
}));
</script>
<template>
@ -89,7 +87,7 @@ const filter = computed(() => ({
<FetchData
:url="`Buys/latestBuysFilter`"
:fields="['longName']"
:filter="{ where: { 'i.id': '2' } }"
:filter="{ where: { 'i.id': entityId } }"
@on-fetch="onBuysFetched"
auto-load
/>

View File

@ -38,6 +38,11 @@ const onCategoryChange = async (categoryFk, search) => {
search();
await itemTypesRef.value.fetch();
};
const emit = defineEmits(['set-user-params']);
const setUserParams = (params) => {
emit('set-user-params', params);
};
</script>
<template>
@ -57,7 +62,11 @@ const onCategoryChange = async (categoryFk, search) => {
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
@set-user-params="setUserParams"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`negative.${tag.label}`) }}</strong>
@ -74,6 +83,11 @@ const onCategoryChange = async (categoryFk, search) => {
dense
is-outlined
type="number"
@update:model-value="
(value) => {
setUserParams(params);
}
"
/>
</QItemSection>
</QItem>

View File

@ -11,18 +11,25 @@ import { useRole } from 'src/composables/useRole';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import TicketLackFilter from './TicketLackFilter.vue';
onBeforeMount(() => {
stateStore.$state.rightDrawer = true;
});
const router = useRouter();
const stateStore = useStateStore();
const { t } = useI18n();
const selectedRows = ref([]);
const tableRef = ref();
const filterParams = ref({});
const negativeParams = reactive({
days: useRole().likeAny('buyer') ? 2 : 0,
warehouseFk: useState().getUser().value.warehouseFk,
});
const redirectToCreateView = ({ itemFk }) => {
router.push({ name: 'NegativeDetail', params: { id: itemFk } });
router.push({
name: 'NegativeDetail',
params: { id: itemFk },
query: { days: filterParams.value.days ?? negativeParams.days },
});
};
const columns = computed(() => [
{
@ -136,18 +143,19 @@ const columns = computed(() => [
],
},
]);
const tableRef = ref();
onBeforeMount(() => {
stateStore.$state.rightDrawer = true;
});
const setUserParams = (params) => {
filterParams.value = params;
};
</script>
<template>
<RightMenu>
<template #right-panel>
<TicketLackFilter data-key="NegativeList" />
<TicketLackFilter data-key="NegativeList" @set-user-params="setUserParams" />
</template>
</RightMenu>
{{ filterRef }}
<VnTable
ref="tableRef"
data-key="NegativeList"

View File

@ -187,59 +187,59 @@ ticketList:
client: Customer
createTicket: Create ticket
negative:
hour: 'Hour'
id: 'Id Article'
longName: 'Article'
supplier: 'Supplier'
colour: 'Colour'
size: 'Size'
origen: 'Origin'
value: 'Negative'
itemFk: 'Article'
producer: 'Producer'
warehouse: 'Warehouse'
warehouseFk: 'Warehouse'
category: 'Category'
categoryFk: 'Family'
type: 'Type'
typeFk: 'Type'
lack: 'Negative'
inkFk: 'inkFk'
timed: 'timed'
date: 'Date'
minTimed: 'minTimed'
negativeAction: 'Negative'
totalNegative: 'Total negatives'
hour: Hour
id: Id Article
longName: Article
supplier: Supplier
colour: Colour
size: Size
origen: Origin
value: Negative
itemFk: Article
producer: Producer
warehouse: Warehouse
warehouseFk: Warehouse
category: Category
categoryFk: Family
type: Type
typeFk: Type
lack: Negative
inkFk: inkFk
timed: timed
date: Date
minTimed: minTimed
negativeAction: Negative
totalNegative: Total negatives
days: Days
buttonsUpdate:
item: Item
state: State
quantity: Quantity
modalOrigin:
title: 'Update negatives'
question: 'Select a state to update'
title: Update negatives
question: Select a state to update
modalSplit:
title: Confirm split selected
question: 'Select a state to update'
question: Select a state to update
detail:
saleFk: 'Sale'
itemFk: 'Article'
ticketFk: 'Ticket'
code: 'Code'
nickname: 'Alias'
name: 'Name'
zoneName: 'Agency name'
shipped: 'Date'
theoreticalhour: 'Theoretical hour'
agName: 'Agency'
quantity: 'Quantity'
alertLevelCode: 'Group state'
state: 'State'
peticionCompra: 'Ticket request'
isRookie: 'Is rookie'
turno: 'Turn line'
isBasket: 'Basket'
hasObservation: 'Has substitution'
saleFk: Sale
itemFk: Article
ticketFk: Ticket
code: Code
nickname: Alias
name: Name
zoneName: Agency name
shipped: Date
theoreticalhour: Theoretical hour
agName: Agency
quantity: Quantity
alertLevelCode: Group state
state: State
peticionCompra: Ticket request
isRookie: Is rookie
turno: Turn line
isBasket: Basket
hasObservation: Has substitution
hasToIgnore: VIP
modal:
changeItem:

View File

@ -216,58 +216,58 @@ ticketList:
addressNickname: Alias consignatario
ref: Referencia
negative:
hour: 'Hora'
id: 'Id Articulo'
longName: 'Articulo'
supplier: 'Productor'
colour: 'Color'
size: 'Medida'
origen: 'Origen'
value: 'Negativo'
warehouseFk: 'Almacen'
producer: 'Producer'
category: 'Categoría'
categoryFk: 'Familia'
typeFk: 'Familia'
warehouse: 'Almacen'
lack: 'Negativo'
inkFk: 'Color'
timed: 'Hora'
date: 'Fecha'
minTimed: 'Hora'
type: 'Tipo'
negativeAction: 'Negativo'
totalNegative: 'Total negativos'
hour: Hora
id: Id Articulo
longName: Articulo
supplier: Productor
colour: Color
size: Medida
origen: Origen
value: Negativo
warehouseFk: Almacen
producer: Producer
category: Categoría
categoryFk: Familia
typeFk: Familia
warehouse: Almacen
lack: Negativo
inkFk: Color
timed: Hora
date: Fecha
minTimed: Hora
type: Tipo
negativeAction: Negativo
totalNegative: Total negativos
days: Rango de dias
buttonsUpdate:
item: artículo
state: Estado
quantity: Cantidad
modalOrigin:
title: 'Actualizar negativos'
question: 'Seleccione un estado para guardar'
title: Actualizar negativos
question: Seleccione un estado para guardar
modalSplit:
title: Confirmar acción de split
question: 'Selecciona un estado'
question: Selecciona un estado
detail:
saleFk: 'Línea'
itemFk: 'Artículo'
ticketFk: 'Ticket'
code: 'code'
nickname: 'Alias'
name: 'Nombre'
zoneName: 'Agencia'
shipped: 'F. envío'
theoreticalhour: 'Hora teórica'
agName: 'Agencia'
quantity: 'Cantidad'
alertLevelCode: 'Estado agrupado'
state: 'Estado'
peticionCompra: 'Petición compra'
isRookie: 'Cliente nuevo'
turno: 'Linea turno'
isBasket: 'Cesta'
hasObservation: 'Tiene sustitución'
saleFk: Línea
itemFk: Artículo
ticketFk: Ticket
code: code
nickname: Alias
name: Nombre
zoneName: Agencia
shipped: F. envío
theoreticalhour: Hora teórica
agName: Agencia
quantity: Cantidad
alertLevelCode: Estado agrupado
state: Estado
peticionCompra: Petición compra
isRookie: Cliente nuevo
turno: Linea turno
isBasket: Cesta
hasObservation: Tiene sustitución
hasToIgnore: VIP
modal:
changeItem: