0
0
Fork 0

Merge branch 'dev' into 6943_fix_customer_module

This commit is contained in:
Javier Segarra 2024-09-16 10:11:29 +00:00
commit 27069e56b8
13 changed files with 94 additions and 103 deletions

View File

@ -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),

View File

@ -285,6 +285,14 @@ globals:
createInvoiceIn: Create invoice in createInvoiceIn: Create invoice in
myAccount: My account myAccount: My account
noOne: No one noOne: No one
params:
clientFk: Client id
salesPersonFk: Sales person
warehouseFk: Warehouse
provinceFk: Province
from: From
To: To
stateFk: State
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred
@ -722,6 +730,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

View File

@ -289,6 +289,14 @@ globals:
createInvoiceIn: Crear factura recibida createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta myAccount: Mi cuenta
noOne: Nadie noOne: Nadie
params:
clientFk: Id cliente
salesPersonFk: Comercial
warehouseFk: Almacén
provinceFk: Provincia
from: Desde
To: Hasta
stateFk: Estado
errors: errors:
statusUnauthorized: Acceso denegado statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor statusInternalServerError: Ha ocurrido un error interno del servidor
@ -729,6 +737,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

View File

@ -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"

View File

@ -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',

View File

@ -116,7 +116,7 @@ const entriesTableColumns = computed(() => [
{{ col.value }} {{ col.value }}
</QTd> </QTd>
<QBtn <QBtn
icon="print" icon="visibility"
v-if="props.row.stickers > 0" v-if="props.row.stickers > 0"
:loading="isLoading" :loading="isLoading"
@click=" @click="
@ -126,7 +126,7 @@ const entriesTableColumns = computed(() => [
" "
unelevated unelevated
> >
<QTooltip>{{ t('printLabel') }}</QTooltip> <QTooltip>{{ t('viewLabel') }}</QTooltip>
</QBtn> </QBtn>
</QTr> </QTr>
</template> </template>

View File

@ -11,4 +11,4 @@ shipped: Shipped
fromShipped: Shipped(from) fromShipped: Shipped(from)
toShipped: Shipped(to) toShipped: Shipped(to)
printLabels: Print stickers printLabels: Print stickers
printLabel: Print sticker viewLabel: View sticker

View File

@ -15,4 +15,4 @@ shipped: F. salida
fromShipped: F. salida(desde) fromShipped: F. salida(desde)
toShipped: F. salida(hasta) toShipped: F. salida(hasta)
printLabels: Imprimir etiquetas printLabels: Imprimir etiquetas
printLabel: Imprimir etiqueta viewLabel: Ver etiqueta

View File

@ -76,16 +76,8 @@ const columns = computed(() => [
name: 'rate2', name: 'rate2',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true, cardVisible: true,
columnField: { component: 'input',
class: 'expand', type: 'number',
component: 'input',
type: 'number',
},
columnFilter: {
class: 'expand',
component: 'input',
type: 'number',
},
}, },
{ {
label: t('item.fixedPrice.packingPrice'), label: t('item.fixedPrice.packingPrice'),
@ -93,35 +85,18 @@ const columns = computed(() => [
name: 'rate3', name: 'rate3',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true, cardVisible: true,
columnField: { component: 'input',
class: 'expand', type: 'number',
component: 'input',
type: 'number',
},
columnFilter: {
class: 'expand',
component: 'input',
type: 'number',
},
}, },
{ {
label: t('item.fixedPrice.minPrice'), label: t('item.fixedPrice.minPrice'),
field: 'minPrice', field: 'minPrice',
columnClass: 'shrink',
name: 'minPrice', name: 'minPrice',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true, cardVisible: true,
columnField: { component: 'input',
class: 'expand', type: 'number',
component: 'input',
type: 'number',
},
columnFilter: {
class: 'expand',
component: 'input',
type: 'number',
},
}, },
{ {
label: t('item.fixedPrice.started'), label: t('item.fixedPrice.started'),
@ -162,16 +137,9 @@ const columns = computed(() => [
name: 'warehouseFk', name: 'warehouseFk',
...defaultColumnAttrs, ...defaultColumnAttrs,
columnClass: 'shrink', columnClass: 'shrink',
columnFilter: { component: 'select',
component: 'select',
}, options: warehousesOptions,
columnField: {
component: 'select',
class: 'expand',
},
attrs: {
options: warehousesOptions,
},
}, },
{ {
align: 'right', align: 'right',
@ -518,29 +486,35 @@ function handleOnDataSave({ CrudModelRef }) {
</span> </span>
<span class="subName">{{ row.subName }}</span> <span class="subName">{{ row.subName }}</span>
<ItemDescriptorProxy :id="row.itemFk" /> <ItemDescriptorProxy :id="row.itemFk" />
<FetchedTags style="width: max-content; max-width: 220px" :item="row" /> <FetchedTags :item="row" />
</template> </template>
<template #column-rate2="props"> <template #column-rate2="props">
<VnInput <QTd class="col">
mask="###.##" <VnInput
v-model.number="props.row.rate2" type="currency"
v-on="getRowUpdateInputEvents(props)" style="width: 75px"
> v-model.number="props.row.rate2"
<template #append></template> v-on="getRowUpdateInputEvents(props)"
</VnInput> >
<template #append></template>
</VnInput>
</QTd>
</template> </template>
<template #column-rate3="props"> <template #column-rate3="props">
<VnInput <QTd class="col">
mask="###.##" <VnInput
v-model.number="props.row.rate3" style="width: 75px"
v-on="getRowUpdateInputEvents(props)" type="currency"
> v-model.number="props.row.rate3"
<template #append></template> v-on="getRowUpdateInputEvents(props)"
</VnInput> >
<template #append></template>
</VnInput>
</QTd>
</template> </template>
<template #column-minPrice="props"> <template #column-minPrice="props">
<QTd class="col"> <QTd class="col">
<div class="row" style="width: 115px"> <div class="row">
<QCheckbox <QCheckbox
:model-value="props.row.hasMinPrice" :model-value="props.row.hasMinPrice"
@update:model-value="updateMinPrice($event, props)" @update:model-value="updateMinPrice($event, props)"
@ -549,6 +523,8 @@ function handleOnDataSave({ CrudModelRef }) {
/> />
<VnInput <VnInput
class="col" class="col"
type="currency"
mask="###.##"
:disable="props.row.hasMinPrice === 1" :disable="props.row.hasMinPrice === 1"
v-model.number="props.row.minPrice" v-model.number="props.row.minPrice"
v-on="getRowUpdateInputEvents(props)" v-on="getRowUpdateInputEvents(props)"
@ -577,15 +553,17 @@ function handleOnDataSave({ CrudModelRef }) {
/> />
</template> </template>
<template #column-warehouseFk="props"> <template #column-warehouseFk="props">
<VnSelect <QTd class="col">
style="max-width: 150px" <VnSelect
:options="warehousesOptions" style="max-width: 150px"
hide-selected :options="warehousesOptions"
option-label="name" hide-selected
option-value="id" option-label="name"
v-model="props.row.warehouseFk" option-value="id"
v-on="getRowUpdateInputEvents(props, false, 'select')" v-model="props.row.warehouseFk"
/> v-on="getRowUpdateInputEvents(props, false, 'select')"
/>
</QTd>
</template> </template>
<template #column-deleteAction="{ row, rowIndex }"> <template #column-deleteAction="{ row, rowIndex }">
<QIcon <QIcon

View File

@ -40,7 +40,7 @@ const handleScopeDays = (params, days, callback) => {
<VnFilterPanel <VnFilterPanel
:data-key="dataKey" :data-key="dataKey"
:search-button="true" :search-button="true"
:hidden-tags="['from', 'to']" :hidden-tags="['from', 'to', 'search']"
:custom-tags="['scopeDays']" :custom-tags="['scopeDays']"
:unremovable-params="['from', 'to', 'scopeDays']" :unremovable-params="['from', 'to', 'scopeDays']"
> >
@ -64,7 +64,7 @@ const handleScopeDays = (params, days, callback) => {
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('params.clientFk')" :label="t('globals.params.clientFk')"
v-model="params.clientFk" v-model="params.clientFk"
is-outlined is-outlined
/> />
@ -105,7 +105,7 @@ const handleScopeDays = (params, days, callback) => {
outlined outlined
dense dense
rounded rounded
:label="t('params.salesPersonFk')" :label="t('globals.params.salesPersonFk')"
v-model="params.salesPersonFk" v-model="params.salesPersonFk"
url="Workers/search" url="Workers/search"
:params="{ departmentCodes: ['VT'] }" :params="{ departmentCodes: ['VT'] }"
@ -158,7 +158,7 @@ const handleScopeDays = (params, days, callback) => {
outlined outlined
dense dense
rounded rounded
:label="t('params.stateFk')" :label="t('globals.params.stateFk')"
v-model="params.stateFk" v-model="params.stateFk"
url="States" url="States"
is-outlined is-outlined
@ -184,7 +184,7 @@ const handleScopeDays = (params, days, callback) => {
outlined outlined
dense dense
rounded rounded
:label="t('params.warehouseFk')" :label="t('globals.params.warehouseFk')"
v-model="params.warehouseFk" v-model="params.warehouseFk"
:options="warehouses" :options="warehouses"
/> />
@ -196,7 +196,7 @@ const handleScopeDays = (params, days, callback) => {
outlined outlined
dense dense
rounded rounded
:label="t('params.provinceFk')" :label="t('globals.params.provinceFk')"
v-model="params.provinceFk" v-model="params.provinceFk"
url="Provinces" url="Provinces"
/> />
@ -235,22 +235,15 @@ const handleScopeDays = (params, days, callback) => {
<i18n> <i18n>
en: en:
params: params:
clientFk: Client id
orderFk: Order id orderFk: Order id
scopeDays: Days onward scopeDays: Days onward
nickname: Nickname nickname: Nickname
salesPersonFk: Sales person
refFk: Invoice refFk: Invoice
agencyModeFk: Agency agencyModeFk: Agency
stateFk: State
groupedStates: Grouped State groupedStates: Grouped State
warehouseFk: Warehouse
provinceFk: Province
myTeam: My team myTeam: My team
problems: With problems problems: With problems
pending: Pending pending: Pending
from: From
to: To
alertLevel: Grouped State alertLevel: Grouped State
FREE: Free FREE: Free
DELIVERED: Delivered DELIVERED: Delivered
@ -261,22 +254,15 @@ en:
es: es:
params: params:
clientFk: Id cliente
orderFk: Id cesta orderFk: Id cesta
scopeDays: Días en adelante scopeDays: Días en adelante
nickname: Nombre mostrado nickname: Nombre mostrado
salesPersonFk: Comercial
refFk: Factura refFk: Factura
agencyModeFk: Agencia agencyModeFk: Agencia
stateFk: Estado
groupedStates: Estado agrupado groupedStates: Estado agrupado
warehouseFk: Almacén
provinceFk: Provincia
myTeam: Mi equipo myTeam: Mi equipo
problems: Con problemas problems: Con problemas
pending: Pendiente pending: Pendiente
from: Desde
To: Hasta
alertLevel: Estado agrupado alertLevel: Estado agrupado
FREE: Libre FREE: Libre
DELIVERED: Servido DELIVERED: Servido

View File

@ -3,7 +3,7 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
</script> </script>
<template> <template>
<VnSearchbar <VnSearchbar
data-key="SalesMonitorTickets" data-key="saleMonitorTickets"
url="SalesMonitors/salesFilter" url="SalesMonitors/salesFilter"
:redirect="false" :redirect="false"
:label="$t('searchBar.label')" :label="$t('searchBar.label')"

View File

@ -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')"

View File

@ -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();