Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into beta
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
1a20a4348b
|
@ -75,6 +75,7 @@ const focus = () => {
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
focus,
|
focus,
|
||||||
|
vnInputRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mixinRules = [
|
const mixinRules = [
|
||||||
|
|
|
@ -119,7 +119,7 @@ watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
() => {
|
() => {
|
||||||
store.data = props.data;
|
store.data = props.data;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -128,12 +128,12 @@ watch(
|
||||||
if (!mounted.value) return;
|
if (!mounted.value) return;
|
||||||
emit('onChange', data);
|
emit('onChange', data);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [props.url, props.filter],
|
() => [props.url, props.filter],
|
||||||
([url, filter]) => mounted.value && fetch({ url, filter })
|
([url, filter]) => mounted.value && fetch({ url, filter }),
|
||||||
);
|
);
|
||||||
const addFilter = async (filter, params) => {
|
const addFilter = async (filter, params) => {
|
||||||
await arrayData.addFilter({ filter, params });
|
await arrayData.addFilter({ filter, params });
|
||||||
|
@ -166,7 +166,7 @@ function emitStoreData() {
|
||||||
async function paginate() {
|
async function paginate() {
|
||||||
const { page, rowsPerPage, sortBy, descending } = pagination.value;
|
const { page, rowsPerPage, sortBy, descending } = pagination.value;
|
||||||
|
|
||||||
if (!props.url) return;
|
if (!arrayData.store.url) return;
|
||||||
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await arrayData.loadMore();
|
await arrayData.loadMore();
|
||||||
|
@ -194,7 +194,7 @@ function endPagination() {
|
||||||
async function onLoad(index, done) {
|
async function onLoad(index, done) {
|
||||||
if (!store.data || !mounted.value) return done();
|
if (!store.data || !mounted.value) return done();
|
||||||
|
|
||||||
if (store.data.length === 0 || !props.url) return done(false);
|
if (store.data.length === 0 || !arrayData.store.url) return done(false);
|
||||||
|
|
||||||
pagination.value.page = pagination.value.page + 1;
|
pagination.value.page = pagination.value.page + 1;
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ onMounted(async () => {
|
||||||
inventoriedDate.value =
|
inventoriedDate.value =
|
||||||
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
||||||
|
|
||||||
if (query.warehouseFk) ref.warehouseFk = query.warehouseFk;
|
if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk;
|
||||||
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
|
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
|
||||||
if (ref.date) showWhatsBeforeInventory.value = true;
|
if (ref.date) showWhatsBeforeInventory.value = true;
|
||||||
ref.itemFk = route.params.id;
|
ref.itemFk = route.params.id;
|
||||||
|
@ -143,7 +143,7 @@ onMounted(async () => {
|
||||||
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
||||||
|
|
||||||
const getBadgeAttrs = (_date) => {
|
const getBadgeAttrs = (_date) => {
|
||||||
const isSameDate = date.isSameDate(today.value, _date);
|
const isSameDate = date.isSameDate(today, _date);
|
||||||
const attrs = {
|
const attrs = {
|
||||||
'text-color': isSameDate ? 'black' : 'white',
|
'text-color': isSameDate ? 'black' : 'white',
|
||||||
color: isSameDate ? 'warning' : 'transparent',
|
color: isSameDate ? 'warning' : 'transparent',
|
||||||
|
@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => {
|
||||||
|
|
||||||
const scrollToToday = async () => {
|
const scrollToToday = async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
const today = Date.vnNew();
|
|
||||||
today.setHours(0, 0, 0, 0);
|
|
||||||
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
||||||
if (todayCell) {
|
if (todayCell) {
|
||||||
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
|
|
@ -272,11 +272,12 @@ const onDenyAccept = (_, responseData) => {
|
||||||
<template #column-achieved="{ row }">
|
<template #column-achieved="{ row }">
|
||||||
<span>
|
<span>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
ref="achievedRef"
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="row.saleQuantity"
|
v-model.number="row.saleQuantity"
|
||||||
:disable="!row.itemFk || row.isOk != null"
|
:disable="!row.itemFk || row.isOk != null"
|
||||||
@blur="changeQuantity(row)"
|
@blur="changeQuantity(row)"
|
||||||
@keyup.enter="changeQuantity(row)"
|
@keyup.enter="$refs.achievedRef.vnInputRef.blur()"
|
||||||
dense
|
dense
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -48,14 +48,14 @@ const itemPackingTypesOptions = ref([]);
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.code" :label="t('shared.code')" />
|
<VnInput v-model="data.code" :label="t('itemType.shared.code')" />
|
||||||
<VnInput v-model="data.name" :label="t('shared.name')" />
|
<VnInput v-model="data.name" :label="t('itemType.shared.name')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Workers/search"
|
url="Workers/search"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
:label="t('shared.worker')"
|
:label="t('itemType.shared.worker')"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
|
@ -83,7 +83,7 @@ const itemPackingTypesOptions = ref([]);
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.categoryFk"
|
v-model="data.categoryFk"
|
||||||
:label="t('shared.category')"
|
:label="t('itemType.shared.category')"
|
||||||
:options="categoriesOptions"
|
:options="categoriesOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
@ -93,27 +93,30 @@ const itemPackingTypesOptions = ref([]);
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.temperatureFk"
|
v-model="data.temperatureFk"
|
||||||
:label="t('shared.temperature')"
|
:label="t('itemType.shared.temperature')"
|
||||||
:options="temperaturesOptions"
|
:options="temperaturesOptions"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
/>
|
||||||
<VnInput v-model="data.life" :label="t('shared.life')" />
|
<VnInput v-model="data.life" :label="t('itemType.summary.life')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.itemPackingTypeFk"
|
v-model="data.itemPackingTypeFk"
|
||||||
:label="t('shared.itemPackingType')"
|
:label="t('itemType.shared.itemPackingType')"
|
||||||
:options="itemPackingTypesOptions"
|
:options="itemPackingTypesOptions"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
/>
|
||||||
<VnInput v-model="data.maxRefs" :label="t('shared.maxRefs')" />
|
<VnInput v-model="data.maxRefs" :label="t('itemType.shared.maxRefs')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QCheckbox v-model="data.isFragile" :label="t('shared.fragile')" />
|
<QCheckbox
|
||||||
|
v-model="data.isFragile"
|
||||||
|
:label="t('itemType.shared.fragile')"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -50,15 +50,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('shared.code')" :value="entity.code" />
|
<VnLv :label="t('itemType.shared.code')" :value="entity.code" />
|
||||||
<VnLv :label="t('shared.name')" :value="entity.name" />
|
<VnLv :label="t('itemType.shared.name')" :value="entity.name" />
|
||||||
<VnLv :label="t('shared.worker')">
|
<VnLv :label="t('itemType.shared.worker')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">{{ entity.worker?.firstName }}</span>
|
<span class="link">{{ entity.worker?.firstName }}</span>
|
||||||
<WorkerDescriptorProxy :id="entity.worker?.id" />
|
<WorkerDescriptorProxy :id="entity.worker?.id" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('shared.category')" :value="entity.category?.name" />
|
<VnLv :label="t('itemType.shared.category')" :value="entity.category?.name" />
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -76,13 +76,6 @@ itemTags:
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Search item
|
label: Search item
|
||||||
info: Search by item id
|
info: Search by item id
|
||||||
itemType:
|
|
||||||
shared:
|
|
||||||
code: Code
|
|
||||||
name: Name
|
|
||||||
worker: Worker
|
|
||||||
category: Category
|
|
||||||
temperature: Temperature
|
|
||||||
item:
|
item:
|
||||||
params:
|
params:
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
|
|
|
@ -76,13 +76,6 @@ itemTags:
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Buscar artículo
|
label: Buscar artículo
|
||||||
info: Buscar por id de artículo
|
info: Buscar por id de artículo
|
||||||
itemType:
|
|
||||||
shared:
|
|
||||||
code: Código
|
|
||||||
name: Nombre
|
|
||||||
worker: Trabajador
|
|
||||||
category: Reino
|
|
||||||
temperature: Temperatura
|
|
||||||
params:
|
params:
|
||||||
state: asfsdf
|
state: asfsdf
|
||||||
item:
|
item:
|
||||||
|
|
|
@ -21,7 +21,6 @@ const catalogParams = {
|
||||||
};
|
};
|
||||||
const arrayData = useArrayData(dataKey, {
|
const arrayData = useArrayData(dataKey, {
|
||||||
url: 'Orders/CatalogFilter',
|
url: 'Orders/CatalogFilter',
|
||||||
limit: 50,
|
|
||||||
userParams: catalogParams,
|
userParams: catalogParams,
|
||||||
});
|
});
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
|
|
|
@ -81,7 +81,7 @@ const columns = computed(() => [
|
||||||
label: t('module.created'),
|
label: t('module.created'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
format: (row) => toDateTimeFormat(row?.landed),
|
format: (row) => toDateTimeFormat(row?.created),
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
|
|
|
@ -179,33 +179,31 @@ const entriesTableRows = computed(() => {
|
||||||
return entries.value;
|
return entries.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
const entriesTotalHb = computed(() =>
|
const entriesTotals = computed(() => {
|
||||||
entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0)
|
const totals = {
|
||||||
);
|
hb: 0,
|
||||||
|
freightValue: 0,
|
||||||
|
packageValue: 0,
|
||||||
|
cc: 0,
|
||||||
|
pallet: 0,
|
||||||
|
m3: 0,
|
||||||
|
};
|
||||||
|
|
||||||
const entriesTotalFreight = computed(() =>
|
entriesTableRows.value.forEach((row) => {
|
||||||
toCurrency(
|
for (const key in totals) {
|
||||||
entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0)
|
totals[key] += row[key] || 0;
|
||||||
)
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
const entriesTotalPackageValue = computed(() =>
|
return {
|
||||||
toCurrency(
|
hb: totals.hb.toFixed(2),
|
||||||
entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0)
|
freight: toCurrency(totals.freightValue),
|
||||||
)
|
packageValue: toCurrency(totals.packageValue),
|
||||||
);
|
cc: totals.cc.toFixed(2),
|
||||||
|
pallet: totals.pallet.toFixed(2),
|
||||||
const entriesTotalCc = computed(() =>
|
m3: totals.m3.toFixed(2),
|
||||||
entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0)
|
};
|
||||||
);
|
});
|
||||||
|
|
||||||
const entriesTotalPallet = computed(() =>
|
|
||||||
entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
const entriesTotalM3 = computed(() =>
|
|
||||||
entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
const getTravelEntries = async (id) => {
|
const getTravelEntries = async (id) => {
|
||||||
const { data } = await axios.get(`Travels/${id}/getEntries`);
|
const { data } = await axios.get(`Travels/${id}/getEntries`);
|
||||||
|
@ -368,12 +366,12 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalHb }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.hb }}</QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalFreight }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.freight }}</QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalPackageValue }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.packageValue }}</QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalCc }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.cc }}</QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalPallet }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.pallet }}</QTd>
|
||||||
<QTd class="text-bold">{{ entriesTotalM3 }}</QTd>
|
<QTd class="text-bold">{{ entriesTotals.m3 }}</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
Loading…
Reference in New Issue