7837-testToMaster_2432 #592
|
@ -1,28 +1,11 @@
|
|||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
const filterAvailableInput = (element) => {
|
||||
return element.classList.contains('q-field__native') && !element.disabled;
|
||||
};
|
||||
const filterAvailableText = (element) => {
|
||||
return (
|
||||
element.__vueParentComponent.type.name === 'QInput' &&
|
||||
element.__vueParentComponent?.attrs?.class !== 'vn-input-date'
|
||||
);
|
||||
};
|
||||
|
||||
export default {
|
||||
mounted: function () {
|
||||
const vm = getCurrentInstance();
|
||||
if (vm.type.name === 'QForm') {
|
||||
if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id)) {
|
||||
// AUTOFOCUS
|
||||
const elementsArray = Array.from(this.$el.elements);
|
||||
const availableInputs = elementsArray.filter(filterAvailableInput);
|
||||
const firstInputElement = availableInputs.find(filterAvailableText);
|
||||
|
||||
if (firstInputElement) {
|
||||
firstInputElement.focus();
|
||||
}
|
||||
// TODO: AUTOFOCUS IS NOT FOCUSING
|
||||
const that = this;
|
||||
this.$el.addEventListener('keyup', function (evt) {
|
||||
if (evt.key === 'Enter') {
|
||||
|
|
|
@ -15,7 +15,7 @@ const props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
warehouseFk: {
|
||||
type: Boolean,
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ const props = defineProps({
|
|||
const { t } = useI18n();
|
||||
|
||||
const regularizeFormData = reactive({
|
||||
itemFk: props.itemFk,
|
||||
itemFk: Number(props.itemFk),
|
||||
warehouseFk: props.warehouseFk,
|
||||
quantity: null,
|
||||
});
|
||||
|
@ -53,6 +53,7 @@ const onDataSaved = (data) => {
|
|||
<QInput
|
||||
:label="t('Type the visible quantity')"
|
||||
v-model.number="data.quantity"
|
||||
type="number"
|
||||
autofocus
|
||||
/>
|
||||
</VnRow>
|
||||
|
@ -60,7 +61,7 @@ const onDataSaved = (data) => {
|
|||
<div class="col">
|
||||
<VnSelect
|
||||
:label="t('Warehouse')"
|
||||
v-model="data.warehouseFk"
|
||||
v-model.number="data.warehouseFk"
|
||||
:options="warehousesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
|
@ -45,7 +45,7 @@ const defaultAttrs = {
|
|||
};
|
||||
|
||||
const forceAttrs = {
|
||||
label: $props.showTitle ? '' : $props.column.label,
|
||||
label: $props.showTitle ? '' : columnFilter.value?.label ?? $props.column.label,
|
||||
};
|
||||
|
||||
const selectComponent = {
|
||||
|
|
|
@ -313,11 +313,6 @@ defineExpose({
|
|||
:params="params"
|
||||
:columns="splittedColumns.columns"
|
||||
/>
|
||||
<slot
|
||||
name="moreFilterPanel"
|
||||
:params="params"
|
||||
:columns="splittedColumns.columns"
|
||||
/>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</QScrollArea>
|
||||
|
|
|
@ -81,7 +81,7 @@ async function fetchViewConfigData() {
|
|||
return;
|
||||
}
|
||||
} catch (err) {
|
||||
console.err('Error fetching config view data', err);
|
||||
console.error('Error fetching config view data', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ const fetchViewConfigData = async () => {
|
|||
setUserConfigViewData(defaultColumns);
|
||||
}
|
||||
} catch (err) {
|
||||
console.err('Error fetching config view data', err);
|
||||
console.error('Error fetching config view data', err);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -209,27 +209,29 @@ input::-webkit-inner-spin-button {
|
|||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* ===== Scrollbar CSS ===== /
|
||||
/ Firefox */
|
||||
.q-table__container {
|
||||
/* ===== Scrollbar CSS ===== /
|
||||
/ Firefox */
|
||||
|
||||
* {
|
||||
scrollbar-width: auto;
|
||||
scrollbar-color: var(--vn-label-color) transparent;
|
||||
}
|
||||
* {
|
||||
scrollbar-width: auto;
|
||||
scrollbar-color: var(--vn-label-color) transparent;
|
||||
}
|
||||
|
||||
/* Chrome, Edge, and Safari */
|
||||
*::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
/* Chrome, Edge, and Safari */
|
||||
*::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: var(--vn-label-color);
|
||||
border-radius: 10px;
|
||||
}
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: var(--vn-label-color);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
*::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.q-table {
|
||||
|
|
|
@ -1,71 +1,89 @@
|
|||
<script setup>
|
||||
import { computed, onMounted } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { toDate } from 'src/filters/index';
|
||||
import { useQuasar } from 'quasar';
|
||||
import EntryBuysTableDialog from './EntryBuysTableDialog.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('customer.extendedList.tableVisibleColumns.id'),
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
isId: true,
|
||||
isTitle: false,
|
||||
columnFilter: false,
|
||||
isTitle: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
visible: false,
|
||||
align: 'right',
|
||||
label: t('shipped'),
|
||||
name: 'shipped',
|
||||
isTitle: false,
|
||||
create: true,
|
||||
cardVisible: true,
|
||||
component: 'date',
|
||||
columnField: {
|
||||
component: null,
|
||||
columnFilter: {
|
||||
name: 'fromShipped',
|
||||
label: t('fromShipped'),
|
||||
component: 'date',
|
||||
},
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
},
|
||||
{
|
||||
visible: false,
|
||||
align: 'left',
|
||||
label: t('shipped'),
|
||||
name: 'shipped',
|
||||
columnFilter: {
|
||||
name: 'toShipped',
|
||||
label: t('toShipped'),
|
||||
component: 'date',
|
||||
},
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: t('shipped'),
|
||||
name: 'shipped',
|
||||
columnFilter: false,
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: t('landed'),
|
||||
name: 'landed',
|
||||
isTitle: false,
|
||||
create: true,
|
||||
cardVisible: false,
|
||||
component: 'date',
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
columnFilter: false,
|
||||
format: ({ landed }) => toDate(landed),
|
||||
},
|
||||
|
||||
{
|
||||
align: 'right',
|
||||
label: t('globals.wareHouseIn'),
|
||||
name: 'warehouseInFk',
|
||||
format: (row) => row.warehouseInName,
|
||||
cardVisible: true,
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'warehouses',
|
||||
fields: ['id', 'name'],
|
||||
optionLabel: 'name',
|
||||
optionValue: 'id',
|
||||
},
|
||||
alias: 't',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.wareHouseIn'),
|
||||
name: 'warehouseInName',
|
||||
isTitle: false,
|
||||
cardVisible: true,
|
||||
create: false,
|
||||
label: t('globals.daysOnward'),
|
||||
name: 'days',
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
computed,
|
||||
actions: [
|
||||
{
|
||||
title: t('printBuys'),
|
||||
|
@ -87,35 +105,19 @@ const printBuys = (rowId) => {
|
|||
</script>
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="EntryList"
|
||||
data-key="myEntriesList"
|
||||
url="Entries/filter"
|
||||
:label="t('Search entries')"
|
||||
:info="t('You can search by entry reference')"
|
||||
/>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<div class="vn-card-list">
|
||||
<VnTable
|
||||
ref="myEntriesRef"
|
||||
data-key="myEntriesList"
|
||||
url="Entries/filter"
|
||||
:columns="columns"
|
||||
default-mode="card"
|
||||
auto-load
|
||||
:right-search="true"
|
||||
>
|
||||
<template #moreFilterPanel="{ params }">
|
||||
<VnInput
|
||||
:label="t('globals.daysOnward')"
|
||||
v-model="params.days"
|
||||
class="q-px-xs row"
|
||||
dense
|
||||
filled
|
||||
outlined
|
||||
></VnInput>
|
||||
</template>
|
||||
</VnTable>
|
||||
</div>
|
||||
</QPage>
|
||||
<VnTable
|
||||
data-key="myEntriesList"
|
||||
url="Entries/filter"
|
||||
:columns="columns"
|
||||
default-mode="card"
|
||||
order="shipped DESC"
|
||||
auto-load
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -8,4 +8,6 @@ entryFilter:
|
|||
reference: Reference
|
||||
landed: Landed
|
||||
shipped: Shipped
|
||||
fromShipped: Shipped(from)
|
||||
toShipped: Shipped(to)
|
||||
printBuys: Print buys
|
||||
|
|
|
@ -12,4 +12,6 @@ entryFilter:
|
|||
|
||||
landed: F. llegada
|
||||
shipped: F. salida
|
||||
fromShipped: F. salida(desde)
|
||||
toShipped: F. salida(hasta)
|
||||
Print buys: Imprimir etiquetas
|
||||
|
|
|
@ -207,8 +207,14 @@ async function cloneInvoice() {
|
|||
|
||||
const isAdministrative = () => hasAny(['administrative']);
|
||||
|
||||
const isAgricultural = () =>
|
||||
invoiceIn.value?.supplier?.sageWithholdingFk === config.value[0]?.sageWithholdingFk;
|
||||
const isAgricultural = () => {
|
||||
console.error(config);
|
||||
if (!config.value) return false;
|
||||
return (
|
||||
invoiceIn.value?.supplier?.sageFarmerWithholdingFk ===
|
||||
config?.value[0]?.sageWithholdingFk
|
||||
);
|
||||
};
|
||||
|
||||
function showPdfInvoice() {
|
||||
if (isAgricultural()) openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, computed, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, computed, onUnmounted, reactive, ref, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -113,18 +113,36 @@ const getBadgeAttrs = (_date) => {
|
|||
return attrs;
|
||||
};
|
||||
|
||||
const scrollToToday = async () => {
|
||||
await nextTick();
|
||||
const today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
||||
if (todayCell) {
|
||||
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
};
|
||||
|
||||
const formatDateForAttribute = (dateValue) => {
|
||||
if (dateValue instanceof Date) return date.formatDate(dateValue, 'YYYY-MM-DD');
|
||||
return dateValue;
|
||||
};
|
||||
|
||||
const originTypeMap = {
|
||||
entry: {
|
||||
descriptor: EntryDescriptorProxy,
|
||||
icon: 'vn:entry',
|
||||
color: 'green',
|
||||
},
|
||||
ticket: {
|
||||
descriptor: TicketDescriptorProxy,
|
||||
icon: 'vn:ticket',
|
||||
color: 'red',
|
||||
},
|
||||
order: {
|
||||
descriptor: OrderDescriptorProxy,
|
||||
icon: 'vn:basket',
|
||||
color: 'yellow',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -143,6 +161,7 @@ onMounted(async () => {
|
|||
else if (user.value) warehouseFk.value = user.value.warehouseFk;
|
||||
itemsBalanceFilter.where.warehouseFk = warehouseFk.value;
|
||||
await fetchItemBalances();
|
||||
await scrollToToday();
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
@ -215,7 +234,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-date="{ row }">
|
||||
<QTd @click.stop>
|
||||
<QTd @click.stop :data-date="formatDateForAttribute(row.shipped)">
|
||||
<QBadge
|
||||
v-bind="getBadgeAttrs(row.shipped)"
|
||||
class="q-ma-none"
|
||||
|
@ -237,12 +256,13 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
>
|
||||
{{ row.originId }}
|
||||
</component>
|
||||
<QIcon
|
||||
:name="originTypeMap[row.originType]?.icon"
|
||||
class="fill-icon q-mr-sm"
|
||||
size="sm"
|
||||
:color="originTypeMap[row.originType]?.color"
|
||||
/>
|
||||
<span class="link">
|
||||
<QIcon
|
||||
:name="originTypeMap[row.originType]?.icon"
|
||||
class="fill-icon q-mr-sm"
|
||||
size="xs"
|
||||
/>
|
||||
{{ row.originId }}
|
||||
</span>
|
||||
</QTd>
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -15,12 +13,6 @@ const { t } = useI18n();
|
|||
const workersOptions = ref([]);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
url="Workers/search"
|
||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
||||
@on-fetch="(data) => (workersOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FormModel
|
||||
:url="`Suppliers/${route.params.id}`"
|
||||
:url-update="`Suppliers/${route.params.id}`"
|
||||
|
@ -44,6 +36,8 @@ const workersOptions = ref([]);
|
|||
option-label="name"
|
||||
hide-selected
|
||||
map-options
|
||||
url="Workers/search"
|
||||
sort-by="nickname ASC"
|
||||
:rules="validate('supplier.workerFk')"
|
||||
>
|
||||
<template #append>
|
||||
|
|
|
@ -38,7 +38,7 @@ const cloneTravelWithEntries = async () => {
|
|||
notify('globals.dataSaved', 'positive');
|
||||
router.push({ name: 'TravelBasicData', params: { id: data.id } });
|
||||
} catch (err) {
|
||||
console.err('Error cloning travel with entries');
|
||||
console.error('Error cloning travel with entries');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
|||
<VnImg
|
||||
:id="parseInt(entityId)"
|
||||
collection="user"
|
||||
size="160x160"
|
||||
size="520x520"
|
||||
class="photo"
|
||||
>
|
||||
<template #error>
|
||||
|
|
|
@ -7,7 +7,6 @@ describe('EntryMy when is supplier', () => {
|
|||
cy.stub(win, 'open');
|
||||
},
|
||||
});
|
||||
cy.waitForElement('.q-page', 6000);
|
||||
});
|
||||
|
||||
it('should open buyLabel when is supplier', () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('InvoiceInCorrective', () => {
|
||||
const createRectificative = '.q-menu > .q-list > :nth-child(4) > .q-item__section';
|
||||
const createRectificative = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
||||
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
||||
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ describe('Route', () => {
|
|||
cy.get(getRowColumn(1, 4) + getVnSelect).type('{downArrow}{enter}');
|
||||
cy.get(getRowColumn(1, 5) + getVnSelect).type('{downArrow}{enter}');
|
||||
cy.get('button[title="Save"]').click();
|
||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue