forked from verdnatura/salix-front
Merge branch 'test' into 7353-warmfix-fixSearchbar
This commit is contained in:
commit
dcde6a1b9d
|
@ -35,7 +35,7 @@ const itemComputed = computed(() => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t(itemComputed.title) }}
|
{{ t(itemComputed.title) }}
|
||||||
<QTooltip>
|
<QTooltip v-if="item.keyBinding">
|
||||||
{{ 'Ctrl + Alt + ' + item?.keyBinding?.toUpperCase() }}
|
{{ 'Ctrl + Alt + ' + item?.keyBinding?.toUpperCase() }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -34,7 +34,7 @@ const model = defineModel(undefined, { required: true });
|
||||||
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
||||||
const columnFilter = computed(() => $props.column?.columnFilter);
|
const columnFilter = computed(() => $props.column?.columnFilter);
|
||||||
|
|
||||||
const updateEvent = { 'update:modelValue': addFilter, remove: () => addFilter(null) };
|
const updateEvent = { 'update:modelValue': addFilter };
|
||||||
const enterEvent = {
|
const enterEvent = {
|
||||||
'keyup.enter': () => addFilter(model.value),
|
'keyup.enter': () => addFilter(model.value),
|
||||||
remove: () => addFilter(null),
|
remove: () => addFilter(null),
|
||||||
|
|
|
@ -852,6 +852,7 @@ worker:
|
||||||
newWorker: New worker
|
newWorker: New worker
|
||||||
card:
|
card:
|
||||||
workerId: Worker ID
|
workerId: Worker ID
|
||||||
|
user: User
|
||||||
name: Name
|
name: Name
|
||||||
email: Email
|
email: Email
|
||||||
phone: Phone
|
phone: Phone
|
||||||
|
|
|
@ -858,6 +858,7 @@ worker:
|
||||||
newWorker: Nuevo trabajador
|
newWorker: Nuevo trabajador
|
||||||
card:
|
card:
|
||||||
workerId: ID Trabajador
|
workerId: ID Trabajador
|
||||||
|
user: Usuario
|
||||||
name: Nombre
|
name: Nombre
|
||||||
email: Correo personal
|
email: Correo personal
|
||||||
phone: Teléfono
|
phone: Teléfono
|
||||||
|
|
|
@ -19,7 +19,15 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
|
<FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
|
||||||
<FormModel ref="formModelRef" model="AccountPrivileges" url="VnUsers" auto-load>
|
<FormModel
|
||||||
|
ref="formModelRef"
|
||||||
|
model="AccountPrivileges"
|
||||||
|
url="VnUsers/preview"
|
||||||
|
:filter="{ where: { id: route.params.id } }"
|
||||||
|
:url-create="`VnUsers/${route.params.id}/privileges`"
|
||||||
|
:id="route.params.id"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<div class="q-gutter-y-sm">
|
<div class="q-gutter-y-sm">
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
|
|
@ -16,7 +16,6 @@ const claimReasons = ref([]);
|
||||||
const claimResults = ref([]);
|
const claimResults = ref([]);
|
||||||
const claimResponsibles = ref([]);
|
const claimResponsibles = ref([]);
|
||||||
const claimRedeliveries = ref([]);
|
const claimRedeliveries = ref([]);
|
||||||
const workers = ref([]);
|
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
const saveButtonRef = ref();
|
const saveButtonRef = ref();
|
||||||
|
|
||||||
|
@ -82,7 +81,9 @@ const columns = computed(() => [
|
||||||
label: t('Worker'),
|
label: t('Worker'),
|
||||||
field: (row) => row.workerFk,
|
field: (row) => row.workerFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
options: workers.value,
|
url: 'Workers/search',
|
||||||
|
where: { active: 1 },
|
||||||
|
sortBy: 'name ASC',
|
||||||
model: 'workerFk',
|
model: 'workerFk',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
optionLabel: 'nickname',
|
optionLabel: 'nickname',
|
||||||
|
@ -129,13 +130,6 @@ const columns = computed(() => [
|
||||||
@on-fetch="(data) => (claimRedeliveries = data)"
|
@on-fetch="(data) => (claimRedeliveries = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
url="Workers/search"
|
|
||||||
:where="{ active: 1 }"
|
|
||||||
order="name ASC"
|
|
||||||
@on-fetch="(data) => (workers = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<CrudModel
|
<CrudModel
|
||||||
data-key="ClaimDevelopments"
|
data-key="ClaimDevelopments"
|
||||||
url="ClaimDevelopments"
|
url="ClaimDevelopments"
|
||||||
|
@ -165,6 +159,9 @@ const columns = computed(() => [
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
|
:url="col.url"
|
||||||
|
:where="col.where"
|
||||||
|
:sort-by="col.sortBy"
|
||||||
:options="col.options"
|
:options="col.options"
|
||||||
:option-value="col.optionValue"
|
:option-value="col.optionValue"
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
|
|
|
@ -45,7 +45,7 @@ async function onFetchClaim(data) {
|
||||||
|
|
||||||
const amount = ref();
|
const amount = ref();
|
||||||
const amountClaimed = ref();
|
const amountClaimed = ref();
|
||||||
async function onFetch(rows, newRows) {
|
function onFetch(rows, newRows) {
|
||||||
if (newRows) rows = newRows;
|
if (newRows) rows = newRows;
|
||||||
amount.value = 0;
|
amount.value = 0;
|
||||||
amountClaimed.value = 0;
|
amountClaimed.value = 0;
|
||||||
|
@ -155,7 +155,7 @@ function showImportDialog() {
|
||||||
async function saveWhenHasChanges() {
|
async function saveWhenHasChanges() {
|
||||||
if (claimLinesForm.value.getChanges().updates) {
|
if (claimLinesForm.value.getChanges().updates) {
|
||||||
await claimLinesForm.value.onSubmit();
|
await claimLinesForm.value.onSubmit();
|
||||||
await claimLinesForm.value.reload();
|
onFetch(claimLinesForm.value.formData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -211,7 +211,7 @@ async function saveWhenHasChanges() {
|
||||||
<template #body-cell-claimed="{ row }">
|
<template #body-cell-claimed="{ row }">
|
||||||
<QTd auto-width align="right" class="text-primary">
|
<QTd auto-width align="right" class="text-primary">
|
||||||
<QInput
|
<QInput
|
||||||
v-model="row.quantity"
|
v-model.number="row.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
dense
|
dense
|
||||||
@keyup.enter="saveWhenHasChanges()"
|
@keyup.enter="saveWhenHasChanges()"
|
||||||
|
@ -266,7 +266,9 @@ async function saveWhenHasChanges() {
|
||||||
<template v-if="column.name === 'claimed'">
|
<template v-if="column.name === 'claimed'">
|
||||||
<QItemLabel class="text-primary">
|
<QItemLabel class="text-primary">
|
||||||
<QInput
|
<QInput
|
||||||
v-model="props.row.quantity"
|
v-model.number="
|
||||||
|
props.row.quantity
|
||||||
|
"
|
||||||
type="number"
|
type="number"
|
||||||
dense
|
dense
|
||||||
autofocus
|
autofocus
|
||||||
|
|
|
@ -94,8 +94,8 @@ const detailsColumns = ref([
|
||||||
{
|
{
|
||||||
name: 'total',
|
name: 'total',
|
||||||
label: 'claim.total',
|
label: 'claim.total',
|
||||||
field: ({ sale }) =>
|
field: (row) =>
|
||||||
toCurrency(sale.quantity * sale.price * ((100 - sale.discount) / 100)),
|
toCurrency(row.quantity * row.sale.price * ((100 - row.sale.discount) / 100)),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -52,6 +52,7 @@ const columns = computed(() => [
|
||||||
name: 'attendedBy',
|
name: 'attendedBy',
|
||||||
orderBy: 'workerFk',
|
orderBy: 'workerFk',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
name: 'attenderFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { computed } from 'vue';
|
|
||||||
|
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
import TicketDescriptor from './TicketDescriptor.vue';
|
import TicketDescriptor from './TicketDescriptor.vue';
|
||||||
import TicketFilter from '../TicketFilter.vue';
|
import TicketFilter from '../TicketFilter.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const routeName = computed(() => route.name);
|
|
||||||
const customRouteRedirectName = computed(() => routeName.value);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
|
@ -21,7 +15,7 @@ const customRouteRedirectName = computed(() => routeName.value);
|
||||||
:descriptor="TicketDescriptor"
|
:descriptor="TicketDescriptor"
|
||||||
search-data-key="TicketList"
|
search-data-key="TicketList"
|
||||||
:searchbar-props="{
|
:searchbar-props="{
|
||||||
customRouteRedirectName,
|
url: 'Tickets/filter',
|
||||||
label: t('card.search'),
|
label: t('card.search'),
|
||||||
info: t('card.searchInfo'),
|
info: t('card.searchInfo'),
|
||||||
}"
|
}"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, onMounted } from 'vue';
|
import { computed, ref, onMounted } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toDate, toCurrency } from 'src/filters/index';
|
import { toDate, toCurrency } from 'src/filters/index';
|
||||||
|
@ -22,8 +23,11 @@ const addressesOptions = ref([]);
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const selectedClient = ref();
|
const selectedClient = ref();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
const route = useRoute();
|
||||||
const from = Date.vnNew();
|
const from = Date.vnNew();
|
||||||
|
from.setHours(0, 0, 0, 0);
|
||||||
const to = Date.vnNew();
|
const to = Date.vnNew();
|
||||||
|
to.setHours(23, 59, 0, 0);
|
||||||
to.setDate(to.getDate() + 1);
|
to.setDate(to.getDate() + 1);
|
||||||
|
|
||||||
const userParams = {
|
const userParams = {
|
||||||
|
@ -31,6 +35,16 @@ const userParams = {
|
||||||
to: to.toISOString(),
|
to: to.toISOString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Método para inicializar las variables desde la query string
|
||||||
|
const initializeFromQuery = () => {
|
||||||
|
const query = route.query.table ? JSON.parse(route.query.table) : {};
|
||||||
|
|
||||||
|
// Asigna los valores a las variables correspondientes
|
||||||
|
from.value = query.from || from.toISOString();
|
||||||
|
to.value = query.to || to.toISOString();
|
||||||
|
Object.assign(userParams, { from, to });
|
||||||
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -200,23 +214,26 @@ const getColor = (row) => {
|
||||||
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
onMounted(() => {
|
||||||
|
initializeFromQuery();
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="Tickets"
|
data-key="Ticket"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<TicketFilter data-key="Tickets" />
|
<TicketFilter data-key="Ticket" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="Tickets"
|
data-key="Ticket"
|
||||||
url="Tickets/filter"
|
url="Tickets/filter"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Tickets/new',
|
urlCreate: 'Tickets/new',
|
||||||
|
@ -225,7 +242,7 @@ onMounted(() => (stateStore.rightDrawer = true));
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
order="id DESC"
|
:order="['shippedDate DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id']"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:user-params="userParams"
|
:user-params="userParams"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
|
|
@ -151,7 +151,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('worker.card.name')" :value="entity.user?.nickname" />
|
<VnLv :label="t('worker.card.user')" :value="entity.user?.name" />
|
||||||
<VnLv :label="t('worker.card.email')" :value="entity.user?.email" copy />
|
<VnLv :label="t('worker.card.email')" :value="entity.user?.email" copy />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.list.department')"
|
:label="t('worker.list.department')"
|
||||||
|
|
|
@ -8,6 +8,8 @@ describe('ClaimDevelopment', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/claim/${claimId}/development`);
|
cy.visit(`/#/claim/${claimId}/development`);
|
||||||
|
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
|
||||||
|
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
|
||||||
cy.waitForElement('tbody');
|
cy.waitForElement('tbody');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,10 +34,19 @@ describe('ClaimDevelopment', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add and remove new line', () => {
|
it('should add and remove new line', () => {
|
||||||
|
cy.wait(['@workers', '@workers']);
|
||||||
cy.addCard();
|
cy.addCard();
|
||||||
|
|
||||||
cy.get(thirdRow).should('exist');
|
cy.get(thirdRow).should('exist');
|
||||||
|
|
||||||
const rowData = [false, 'Novato', 'Roces', 'Compradores', 'employeeNick', 'Tour'];
|
const rowData = [
|
||||||
|
false,
|
||||||
|
'Novato',
|
||||||
|
'Roces',
|
||||||
|
'Compradores',
|
||||||
|
'administrativeNick',
|
||||||
|
'Tour',
|
||||||
|
];
|
||||||
cy.fillRow(thirdRow, rowData);
|
cy.fillRow(thirdRow, rowData);
|
||||||
|
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
|
|
Loading…
Reference in New Issue