#8448 - devToTest #1254
|
@ -55,6 +55,7 @@ const onDataSaved = (data) => {
|
||||||
v-model.number="data.quantity"
|
v-model.number="data.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
autofocus
|
autofocus
|
||||||
|
data-cy="regularizeStockInput"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnFilter from 'components/VnTable/VnFilter.vue';
|
import VnFilter from 'components/VnTable/VnFilter.vue';
|
||||||
|
@ -11,16 +10,11 @@ defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
chipLocale: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
searchUrl: {
|
searchUrl: {
|
||||||
type: [String, Boolean],
|
type: [String, Boolean],
|
||||||
default: 'table',
|
default: 'table',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const tableFilterRef = ref([]);
|
const tableFilterRef = ref([]);
|
||||||
|
|
||||||
|
@ -62,9 +56,9 @@ function columnName(col) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #tags="{ tag, formatFn }" v-if="chipLocale">
|
<template #tags="{ tag, formatFn, getLocale }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
|
<strong>{{ getLocale(`${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -190,7 +190,7 @@ const getLocale = (label) => {
|
||||||
const globalLocale = `globals.params.${param}`;
|
const globalLocale = `globals.params.${param}`;
|
||||||
if (te(globalLocale)) return t(globalLocale);
|
if (te(globalLocale)) return t(globalLocale);
|
||||||
else if (te(t(`params.${param}`)));
|
else if (te(t(`params.${param}`)));
|
||||||
else return t(`${route.meta.moduleName}.params.${param}`);
|
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -456,6 +456,11 @@ entry:
|
||||||
landing: Landing
|
landing: Landing
|
||||||
isExcludedFromAvailable: Es inventory
|
isExcludedFromAvailable: Es inventory
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: Ticket ID
|
||||||
|
weekDay: Weekday
|
||||||
|
agencyModeFk: Agency
|
||||||
|
id: Worker
|
||||||
card:
|
card:
|
||||||
customerId: Customer ID
|
customerId: Customer ID
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
@ -697,6 +702,11 @@ wagon:
|
||||||
minHeightBetweenTrays: 'The minimum height between trays is '
|
minHeightBetweenTrays: 'The minimum height between trays is '
|
||||||
maxWagonHeight: 'The maximum height of the wagon is '
|
maxWagonHeight: 'The maximum height of the wagon is '
|
||||||
uncompleteTrays: There are incomplete trays
|
uncompleteTrays: There are incomplete trays
|
||||||
|
params:
|
||||||
|
label: Label
|
||||||
|
plate: Plate
|
||||||
|
volume: Volume
|
||||||
|
name: Name
|
||||||
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
|
|
|
@ -457,6 +457,11 @@ entry:
|
||||||
landing: Llegada
|
landing: Llegada
|
||||||
isExcludedFromAvailable: Es inventario
|
isExcludedFromAvailable: Es inventario
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: ID de ticket
|
||||||
|
weekDay: Salida
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
id: Comercial
|
||||||
card:
|
card:
|
||||||
customerId: ID cliente
|
customerId: ID cliente
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
|
@ -700,6 +705,11 @@ wagon:
|
||||||
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
||||||
maxWagonHeight: 'La altura máxima del vagón es '
|
maxWagonHeight: 'La altura máxima del vagón es '
|
||||||
uncompleteTrays: Hay bandejas sin completar
|
uncompleteTrays: Hay bandejas sin completar
|
||||||
|
params:
|
||||||
|
label: Etiqueta
|
||||||
|
plate: Matrícula
|
||||||
|
volume: Volumen
|
||||||
|
name: Nombre
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Name
|
||||||
|
roleFk: Role
|
||||||
|
nickname: Nickname
|
||||||
|
password: Password
|
||||||
|
active: Active
|
||||||
|
search: Id
|
||||||
|
description: Description
|
||||||
|
alias: Alias
|
||||||
|
model: Model
|
||||||
|
principalId: Role
|
||||||
|
property: Property
|
||||||
|
accessType: Access
|
||||||
card:
|
card:
|
||||||
nickname: User
|
nickname: User
|
||||||
role: Role
|
role: Role
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
|
accessType: Acceso
|
||||||
|
property: Propiedad
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Nombre
|
||||||
|
roleFk: Rol
|
||||||
|
nickname: Nickname
|
||||||
|
password: Contraseña
|
||||||
|
active: Activo
|
||||||
|
search: Id
|
||||||
|
description: Descripción
|
||||||
|
alias: Alias
|
||||||
|
model: Modelo
|
||||||
|
principalId: Rol
|
||||||
|
property: Propiedad
|
||||||
|
accessType: Acceso
|
||||||
card:
|
card:
|
||||||
nickname: Usuario
|
nickname: Usuario
|
||||||
role: Rol
|
role: Rol
|
||||||
|
|
|
@ -94,3 +94,12 @@ customer:
|
||||||
hasToInvoiceByAddress: Invoice by address
|
hasToInvoiceByAddress: Invoice by address
|
||||||
isToBeMailed: Mailing
|
isToBeMailed: Mailing
|
||||||
hasSepaVnl: VNL B2B received
|
hasSepaVnl: VNL B2B received
|
||||||
|
params:
|
||||||
|
isWorker: Is Worker
|
||||||
|
payMethod: Payment Method
|
||||||
|
workerFk: Author
|
||||||
|
observation: Last Observation
|
||||||
|
created: Last Update Date
|
||||||
|
creditInsurance: Credit Insurance
|
||||||
|
defaulterSinced: Defaulted Since
|
||||||
|
hasRecovery: Has Recovery
|
|
@ -96,3 +96,12 @@ customer:
|
||||||
hasToInvoiceByAddress: Factura por consigna
|
hasToInvoiceByAddress: Factura por consigna
|
||||||
isToBeMailed: Env. emails
|
isToBeMailed: Env. emails
|
||||||
hasSepaVnl: Recibido B2B VNL
|
hasSepaVnl: Recibido B2B VNL
|
||||||
|
params:
|
||||||
|
isWorker: Es trabajador
|
||||||
|
payMethod: F. Pago
|
||||||
|
workerFk: Autor
|
||||||
|
observation: Última observación
|
||||||
|
created: Fecha Ú. O.
|
||||||
|
creditInsurance: Crédito A.
|
||||||
|
defaulterSinced: Desde
|
||||||
|
hasRecovery: Tiene recobro
|
|
@ -1,9 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue';
|
import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
class="q-pa-md column items-center"
|
class="q-pa-md column items-center"
|
||||||
v-bind="{ ...$attrs }"
|
v-bind="{ ...$attrs }"
|
||||||
data-key="Department"
|
data-key="Department"
|
||||||
|
|
|
@ -40,7 +40,7 @@ onMounted(async () => {
|
||||||
<template #body="{ entity: department }">
|
<template #body="{ entity: department }">
|
||||||
<QCard class="column">
|
<QCard class="column">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/department/department/${entityId}/basic-data`"
|
:url="`#/worker/department/${entityId}/basic-data`"
|
||||||
:text="t('Basic data')"
|
:text="t('Basic data')"
|
||||||
/>
|
/>
|
||||||
<div class="full-width row wrap justify-between content-between">
|
<div class="full-width row wrap justify-between content-between">
|
||||||
|
|
|
@ -19,3 +19,11 @@ myEntries:
|
||||||
daysAgo: Days ago
|
daysAgo: Days ago
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: The wastes were successfully recalculated
|
recalcOk: The wastes were successfully recalculated
|
||||||
|
entry:
|
||||||
|
params:
|
||||||
|
toShipped: To
|
||||||
|
fromShipped: From
|
||||||
|
warehouseiNFk: Warehouse
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
|
|
@ -22,3 +22,11 @@ myEntries:
|
||||||
daysAgo: Días atras
|
daysAgo: Días atras
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: Se han recalculado las mermas correctamente
|
recalcOk: Se han recalculado las mermas correctamente
|
||||||
|
entry:
|
||||||
|
params:
|
||||||
|
toShipped: Hasta
|
||||||
|
fromShipped: Desde
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
|
|
@ -25,3 +25,15 @@ negativeBases:
|
||||||
hasToInvoice: Has to invoice
|
hasToInvoice: Has to invoice
|
||||||
verifiedData: Verified data
|
verifiedData: Verified data
|
||||||
commercial: Commercial
|
commercial: Commercial
|
||||||
|
invoiceout:
|
||||||
|
params:
|
||||||
|
company: Company
|
||||||
|
country: Country
|
||||||
|
clientId: Client ID
|
||||||
|
clientSocialName: Client
|
||||||
|
taxableBase: Base
|
||||||
|
ticketFk: Ticket
|
||||||
|
isActive: Active
|
||||||
|
hasToInvoice: Has to invoice
|
||||||
|
hasVerifiedData: Verified data
|
||||||
|
workerName: Worker
|
|
@ -28,3 +28,15 @@ negativeBases:
|
||||||
hasToInvoice: Debe facturar
|
hasToInvoice: Debe facturar
|
||||||
verifiedData: Datos verificados
|
verifiedData: Datos verificados
|
||||||
commercial: Comercial
|
commercial: Comercial
|
||||||
|
invoiceout:
|
||||||
|
params:
|
||||||
|
company: Empresa
|
||||||
|
country: País
|
||||||
|
clientId: ID del cliente
|
||||||
|
clientSocialName: Cliente
|
||||||
|
taxableBase: Base
|
||||||
|
ticketFk: Ticket
|
||||||
|
isActive: Activo
|
||||||
|
hasToInvoice: Debe facturar
|
||||||
|
hasVerifiedData: Datos verificados
|
||||||
|
workerName: Comercial
|
|
@ -52,6 +52,7 @@ const entityId = computed(() => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
data-cy="AddGenusSelectDialog"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateGenusForm
|
<CreateGenusForm
|
||||||
|
@ -68,6 +69,7 @@ const entityId = computed(() => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
data-cy="AddSpeciesSelectDialog"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateSpecieForm
|
<CreateSpecieForm
|
||||||
|
|
|
@ -107,7 +107,7 @@ const submitTags = async (data) => {
|
||||||
@on-fetch="onItemTagsFetched"
|
@on-fetch="onItemTagsFetched"
|
||||||
>
|
>
|
||||||
<template #body="{ rows, validate }">
|
<template #body="{ rows, validate }">
|
||||||
<QCard class="q-px-lg q-pt-md q-pb-sm">
|
<QCard class="q-px-lg q-pt-md q-pb-sm" data-cy="itemTags">
|
||||||
<VnRow
|
<VnRow
|
||||||
v-for="(row, index) in rows"
|
v-for="(row, index) in rows"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onBeforeMount } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
@ -15,6 +15,9 @@ import ItemTypeDescriptorProxy from './ItemType/Card/ItemTypeDescriptorProxy.vue
|
||||||
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import ItemListFilter from './ItemListFilter.vue';
|
import ItemListFilter from './ItemListFilter.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
const entityId = computed(() => route.params.id);
|
const entityId = computed(() => route.params.id);
|
||||||
const { openCloneDialog } = cloneItem();
|
const { openCloneDialog } = cloneItem();
|
||||||
|
@ -22,7 +25,9 @@ const { viewSummary } = useSummaryDialog();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const validPriorities = ref([]);
|
||||||
|
const defaultTag = ref();
|
||||||
|
const defaultPriority = ref();
|
||||||
const itemFilter = {
|
const itemFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -90,7 +95,6 @@ const columns = computed(() => [
|
||||||
label: t('globals.description'),
|
label: t('globals.description'),
|
||||||
name: 'description',
|
name: 'description',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
create: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
},
|
},
|
||||||
|
@ -132,7 +136,6 @@ const columns = computed(() => [
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
visible: false,
|
visible: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -161,6 +164,11 @@ const columns = computed(() => [
|
||||||
name: 'intrastat',
|
name: 'intrastat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Intrastats',
|
||||||
|
optionValue: 'description',
|
||||||
|
optionLabel: 'description',
|
||||||
|
},
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'intrastat',
|
name: 'intrastat',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -172,7 +180,6 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -198,7 +205,6 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -297,12 +303,21 @@ const columns = computed(() => [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
const { data } = await axios.get('ItemConfigs');
|
||||||
|
defaultTag.value = data[0].defaultTag;
|
||||||
|
defaultPriority.value = data[0].defaultPriority;
|
||||||
|
data.forEach((priority) => {
|
||||||
|
validPriorities.value = priority.validPriorities;
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="ItemList"
|
data-key="ItemList"
|
||||||
:label="t('item.searchbar.label')"
|
:label="t('item.searchbar.label')"
|
||||||
:info="t('You can search by id')"
|
:info="t('item.searchbar.info')"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -310,15 +325,18 @@ const columns = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
v-if="defaultTag"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ItemList"
|
data-key="ItemList"
|
||||||
url="Items/filter"
|
url="Items/filter"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Items',
|
urlCreate: 'Items/new',
|
||||||
title: t('Create Item'),
|
title: t('item.list.newItem'),
|
||||||
onDataSaved: () => tableRef.redirect(),
|
onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
editorFk: entityId,
|
editorFk: entityId,
|
||||||
|
tag: defaultTag,
|
||||||
|
priority: defaultPriority,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:order="['isActive DESC', 'name', 'id']"
|
:order="['isActive DESC', 'name', 'id']"
|
||||||
|
@ -364,6 +382,96 @@ const columns = computed(() => [
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" :columns="3" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #more-create-dialog="{ data }">
|
||||||
|
<VnInput
|
||||||
|
v-model="data.provisionalName"
|
||||||
|
:label="t('globals.description')"
|
||||||
|
:is-required="true"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="Tags"
|
||||||
|
v-model="data.tag"
|
||||||
|
:label="t('globals.tag')"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
:options="validPriorities"
|
||||||
|
v-model="data.priority"
|
||||||
|
:label="t('item.create.priority')"
|
||||||
|
:is-required="true"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="ItemTypes"
|
||||||
|
v-model="data.typeFk"
|
||||||
|
:label="t('item.list.typeName')"
|
||||||
|
:fields="['id', 'code', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.code }} #{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
url="Intrastats"
|
||||||
|
v-model="data.intrastatFk"
|
||||||
|
:label="t('globals.intrastat')"
|
||||||
|
:fields="['id', 'description']"
|
||||||
|
option-label="description"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.description }}</QItemLabel>
|
||||||
|
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
url="Origins"
|
||||||
|
v-model="data.originFk"
|
||||||
|
:label="t('globals.origin')"
|
||||||
|
:fields="['id', 'code', 'name']"
|
||||||
|
option-label="code"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.code }} #{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -107,6 +107,7 @@ item:
|
||||||
scopeDays: Scope days
|
scopeDays: Scope days
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Search item
|
label: Search item
|
||||||
|
info: You can search by id
|
||||||
descriptor:
|
descriptor:
|
||||||
item: Item
|
item: Item
|
||||||
buyer: Buyer
|
buyer: Buyer
|
||||||
|
@ -139,6 +140,7 @@ item:
|
||||||
stemMultiplier: Multiplier
|
stemMultiplier: Multiplier
|
||||||
producer: Producer
|
producer: Producer
|
||||||
landed: Landed
|
landed: Landed
|
||||||
|
newItem: New item
|
||||||
basicData:
|
basicData:
|
||||||
type: Type
|
type: Type
|
||||||
reference: Reference
|
reference: Reference
|
||||||
|
|
|
@ -109,6 +109,7 @@ item:
|
||||||
scopeDays: Días en adelante
|
scopeDays: Días en adelante
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Buscar artículo
|
label: Buscar artículo
|
||||||
|
info: Puedes buscar por id
|
||||||
descriptor:
|
descriptor:
|
||||||
item: Artículo
|
item: Artículo
|
||||||
buyer: Comprador
|
buyer: Comprador
|
||||||
|
@ -141,6 +142,7 @@ item:
|
||||||
stemMultiplier: Multiplicador
|
stemMultiplier: Multiplicador
|
||||||
producer: Productor
|
producer: Productor
|
||||||
landed: F. entrega
|
landed: F. entrega
|
||||||
|
newItem: Nuevo artículo
|
||||||
basicData:
|
basicData:
|
||||||
type: Tipo
|
type: Tipo
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
|
|
|
@ -10,3 +10,4 @@ agency:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: Puedes buscar por nombre o id
|
info: Puedes buscar por nombre o id
|
||||||
label: Buscar agencia...
|
label: Buscar agencia...
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
route:
|
route:
|
||||||
|
params:
|
||||||
|
agencyModeName: Agencia Ruta
|
||||||
|
agencyAgreement: Agencia Acuerdo
|
||||||
|
id: Id
|
||||||
|
name: Troncal
|
||||||
|
etd: ETD
|
||||||
|
tractorPlate: Matrícula
|
||||||
|
price: Precio
|
||||||
|
observations: Observaciones
|
||||||
|
cmrFk: Id CMR
|
||||||
|
hasCmrDms: Gestdoc
|
||||||
|
ticketFk: Id ticket
|
||||||
|
routeFK: Id ruta
|
||||||
|
shipped: Fecha preparación
|
||||||
Worker: Trabajador
|
Worker: Trabajador
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Vehicle: Vehículo
|
Vehicle: Vehículo
|
||||||
|
|
|
@ -1,21 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
|
||||||
import WorkerDescriptor from './WorkerDescriptor.vue';
|
import WorkerDescriptor from './WorkerDescriptor.vue';
|
||||||
import WorkerFilter from '../WorkerFilter.vue';
|
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta data-key="Worker" custom-url="Workers/summary" :descriptor="WorkerDescriptor" />
|
||||||
data-key="Worker"
|
|
||||||
custom-url="Workers/summary"
|
|
||||||
:descriptor="WorkerDescriptor"
|
|
||||||
:filter-panel="WorkerFilter"
|
|
||||||
search-data-key="WorkerList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Workers/filter',
|
|
||||||
label: 'Search worker',
|
|
||||||
info: 'You can search by worker id or name',
|
|
||||||
order: 'id DESC',
|
|
||||||
}"
|
|
||||||
:redirect-on-error="true"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,254 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { onBeforeMount, ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import axios from 'axios';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
|
||||||
import VnRadio from 'src/components/common/VnRadio.vue';
|
|
||||||
import { useState } from 'src/composables/useState';
|
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const user = useState().getUser();
|
|
||||||
|
|
||||||
const companiesOptions = ref([]);
|
|
||||||
const payMethodsOptions = ref([]);
|
|
||||||
const bankEntitiesOptions = ref([]);
|
|
||||||
const formData = ref({ companyFk: user.value.companyFk, isFreelance: false });
|
|
||||||
const defaultPayMethod = ref();
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
defaultPayMethod.value = (
|
|
||||||
await axios.get('WorkerConfigs/findOne', {
|
|
||||||
params: { field: ['payMethodFk'] },
|
|
||||||
})
|
|
||||||
).data.payMethodFk;
|
|
||||||
formData.value.payMethodFk = defaultPayMethod.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleLocation(data, location) {
|
|
||||||
const { town, code, provinceFk, countryFk } = location ?? {};
|
|
||||||
data.postcode = code;
|
|
||||||
data.city = town;
|
|
||||||
data.provinceFk = provinceFk;
|
|
||||||
data.countryFk = countryFk;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateCodeUser(worker) {
|
|
||||||
if (!worker.firstName || !worker.lastNames) return;
|
|
||||||
|
|
||||||
const totalName = worker.firstName.concat(' ' + worker.lastNames).toLowerCase();
|
|
||||||
const totalNameArray = totalName.split(' ');
|
|
||||||
let newCode = '';
|
|
||||||
|
|
||||||
for (let part of totalNameArray) newCode += part.charAt(0);
|
|
||||||
|
|
||||||
worker.code = newCode.toUpperCase().slice(0, 3);
|
|
||||||
worker.name = totalNameArray[0] + newCode.slice(1);
|
|
||||||
|
|
||||||
if (!worker.companyFk) worker.companyFk = user.companyFk;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function autofillBic(worker) {
|
|
||||||
if (!worker || !worker.iban) return;
|
|
||||||
|
|
||||||
let bankEntityId = parseInt(worker.iban.substr(4, 4));
|
|
||||||
let filter = { where: { id: bankEntityId } };
|
|
||||||
|
|
||||||
const { data } = await axios.get(`BankEntities`, { params: { filter } });
|
|
||||||
const hasData = data && data[0];
|
|
||||||
if (hasData) worker.bankEntityFk = data[0].id;
|
|
||||||
else if (!hasData) worker.bankEntityFk = undefined;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<FetchData
|
|
||||||
url="Companies"
|
|
||||||
@on-fetch="(data) => (companiesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="Paymethods"
|
|
||||||
@on-fetch="(data) => (payMethodsOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="BankEntities"
|
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<QPage>
|
|
||||||
<VnSubToolbar>
|
|
||||||
<template #st-data>
|
|
||||||
<VnRadio
|
|
||||||
v-model="formData.isFreelance"
|
|
||||||
:val="false"
|
|
||||||
:label="`${t('Internal')}`"
|
|
||||||
@update:model-value="formData.payMethodFk = defaultPayMethod"
|
|
||||||
/>
|
|
||||||
<VnRadio
|
|
||||||
v-model="formData.isFreelance"
|
|
||||||
:val="true"
|
|
||||||
:label="`${t('External')}`"
|
|
||||||
@update:model-value="delete formData.payMethodFk"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnSubToolbar>
|
|
||||||
<FormModel
|
|
||||||
url-create="Workers/new"
|
|
||||||
model="worker"
|
|
||||||
:form-initial-data="formData"
|
|
||||||
@on-data-saved="(__, { id }) => $router.push({ path: `/worker/${id}` })"
|
|
||||||
>
|
|
||||||
<template #form="{ data, validate }">
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.firstName"
|
|
||||||
:label="t('globals.name')"
|
|
||||||
:rules="validate('Worker.firstName')"
|
|
||||||
@update:model-value="generateCodeUser(data)"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.lastNames"
|
|
||||||
:label="t('worker.create.lastName')"
|
|
||||||
:rules="validate('Worker.lastNames')"
|
|
||||||
@update:model-value="generateCodeUser(data)"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.code"
|
|
||||||
:label="t('worker.create.code')"
|
|
||||||
:rules="validate('Worker.code')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.name"
|
|
||||||
:label="t('worker.create.webUser')"
|
|
||||||
:rules="validate('Worker.name')"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.email"
|
|
||||||
:label="t('worker.create.personalEmail')"
|
|
||||||
:rules="validate('Worker.email')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('globals.company')"
|
|
||||||
v-model="data.companyFk"
|
|
||||||
:options="companiesOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="code"
|
|
||||||
hide-selected
|
|
||||||
:rules="validate('Worker.company')"
|
|
||||||
/>
|
|
||||||
<VnSelectWorker
|
|
||||||
:label="t('worker.summary.boss')"
|
|
||||||
v-model="data.bossFk"
|
|
||||||
:rules="validate('Worker.boss')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.fi"
|
|
||||||
:label="t('worker.create.fi')"
|
|
||||||
:rules="validate('Worker.fi')"
|
|
||||||
/>
|
|
||||||
<VnInputDate
|
|
||||||
v-model="data.birth"
|
|
||||||
:label="t('worker.create.birth')"
|
|
||||||
:rules="validate('Worker.birth')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.phone"
|
|
||||||
:label="t('globals.phone')"
|
|
||||||
:rules="validate('Worker.phone')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnLocation
|
|
||||||
:rules="validate('Worker.postcode')"
|
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
>
|
|
||||||
</VnLocation>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('globals.street')"
|
|
||||||
v-model="data.street"
|
|
||||||
:rules="validate('Worker.street')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('worker.create.payMethods')"
|
|
||||||
v-model="data.payMethodFk"
|
|
||||||
:options="payMethodsOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
map-options
|
|
||||||
hide-selected
|
|
||||||
:rules="validate('Worker.payMethodFk')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="(val) => !val && delete formData.payMethodFk"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.iban"
|
|
||||||
:label="t('worker.create.iban')"
|
|
||||||
:rules="validate('Worker.iban')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="autofillBic(data)"
|
|
||||||
>
|
|
||||||
<template #append>
|
|
||||||
<QIcon name="info" class="cursor-info">
|
|
||||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
<VnSelectDialog
|
|
||||||
:label="t('worker.create.bankEntity')"
|
|
||||||
v-model="data.bankEntityFk"
|
|
||||||
:options="bankEntitiesOptions"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
hide-selected
|
|
||||||
:roles-allowed-to-create="['salesAssistant', 'hr']"
|
|
||||||
:rules="validate('Worker.bankEntity')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="autofillBic(data)"
|
|
||||||
:filter-options="['bic', 'name']"
|
|
||||||
>
|
|
||||||
<template #form>
|
|
||||||
<CreateBankEntityForm
|
|
||||||
@on-data-saved="(data) => bankEntitiesOptions.push(data)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection v-if="scope.opt">
|
|
||||||
<QItemLabel
|
|
||||||
>{{ scope.opt.bic }}
|
|
||||||
{{ scope.opt.name }}</QItemLabel
|
|
||||||
>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelectDialog>
|
|
||||||
</VnRow>
|
|
||||||
</template>
|
|
||||||
</FormModel>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
|
|
@ -1,11 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<VnSection data-key="WorkerDepartment">
|
||||||
|
<template #body>
|
||||||
|
<div class="flex flex-center q-pa-md">
|
||||||
<WorkerDepartmentTree />
|
<WorkerDepartmentTree />
|
||||||
</QPage>
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -111,18 +111,16 @@ function handleEvent(type, event, node) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'path':
|
case 'path':
|
||||||
state.set('TreeState', lastId);
|
state.set('TreeState', lastId);
|
||||||
node.id && router.push({ path: `/department/department/${node.id}/summary` });
|
node.id && router.push({ path: `/worker/department/${node.id}/summary` });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tab':
|
case 'tab':
|
||||||
state.set('TreeState', lastId);
|
state.set('TreeState', lastId);
|
||||||
node.id &&
|
node.id && window.open(`#/worker/department/${node.id}/summary`, '_blank');
|
||||||
window.open(`#/department/department/${node.id}/summary`, '_blank');
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
node.id &&
|
node.id && router.push({ path: `#/worker/department/${node.id}/summary` });
|
||||||
router.push({ path: `#/department/department/${node.id}/summary` });
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { onBeforeMount, computed, ref } from 'vue';
|
import { onBeforeMount, computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import WorkerSummary from './Card/WorkerSummary.vue';
|
import WorkerSummary from './Card/WorkerSummary.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
@ -14,12 +13,11 @@ import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import WorkerFilter from './WorkerFilter.vue';
|
import WorkerFilter from './WorkerFilter.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -31,6 +29,7 @@ const postcodesOptions = ref([]);
|
||||||
const user = useState().getUser();
|
const user = useState().getUser();
|
||||||
const defaultPayMethod = ref();
|
const defaultPayMethod = ref();
|
||||||
const bankEntitiesRef = ref();
|
const bankEntitiesRef = ref();
|
||||||
|
const dataKey = 'WorkerList';
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -170,11 +169,6 @@ async function autofillBic(worker) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
|
||||||
data-key="WorkerList"
|
|
||||||
:label="t('Search worker')"
|
|
||||||
:info="t('You can search by worker id or name')"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Companies"
|
url="Companies"
|
||||||
@on-fetch="(data) => (companiesOptions = data)"
|
@on-fetch="(data) => (companiesOptions = data)"
|
||||||
|
@ -191,16 +185,24 @@ async function autofillBic(worker) {
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
|
||||||
<template #right-panel>
|
<VnSection
|
||||||
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
prefix="workerSearch"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Workers/filter',
|
||||||
|
order: ['id DESC'],
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<WorkerFilter data-key="WorkerList" />
|
<WorkerFilter data-key="WorkerList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
v-if="defaultPayMethod"
|
v-if="defaultPayMethod"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerList"
|
:data-key="dataKey"
|
||||||
url="Workers/filter"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Workers/new',
|
urlCreate: 'Workers/new',
|
||||||
title: t('Create worker'),
|
title: t('Create worker'),
|
||||||
|
@ -211,11 +213,10 @@ async function autofillBic(worker) {
|
||||||
isFreelance: false,
|
isFreelance: false,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:columns="columns"
|
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
|
:columns="columns"
|
||||||
redirect="worker"
|
redirect="worker"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:order="['id DESC']"
|
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<div class="q-pa-lg full-width">
|
<div class="q-pa-lg full-width">
|
||||||
|
@ -243,10 +244,16 @@ async function autofillBic(worker) {
|
||||||
:label="t('worker.create.lastName')"
|
:label="t('worker.create.lastName')"
|
||||||
@update:model-value="generateCodeUser(data)"
|
@update:model-value="generateCodeUser(data)"
|
||||||
/>
|
/>
|
||||||
<VnInput v-model="data.code" :label="t('worker.create.code')" />
|
<VnInput
|
||||||
|
v-model="data.code"
|
||||||
|
:label="t('worker.create.code')"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
|
<VnInput
|
||||||
|
v-model="data.name"
|
||||||
|
:label="t('worker.create.webUser')"
|
||||||
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.email"
|
v-model="data.email"
|
||||||
type="email"
|
type="email"
|
||||||
|
@ -283,9 +290,13 @@ async function autofillBic(worker) {
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[
|
||||||
|
{ model: 'Town', props: '*', accessType: 'WRITE' },
|
||||||
|
]"
|
||||||
:options="postcodesOptions"
|
:options="postcodesOptions"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="
|
||||||
|
(location) => handleLocation(data, location)
|
||||||
|
"
|
||||||
:disable="data.isFreelance"
|
:disable="data.isFreelance"
|
||||||
>
|
>
|
||||||
</VnLocation>
|
</VnLocation>
|
||||||
|
@ -308,7 +319,9 @@ async function autofillBic(worker) {
|
||||||
map-options
|
map-options
|
||||||
hide-selected
|
hide-selected
|
||||||
:disable="data.isFreelance"
|
:disable="data.isFreelance"
|
||||||
@update:model-value="(val) => !val && delete data.payMethodFk"
|
@update:model-value="
|
||||||
|
(val) => !val && delete data.payMethodFk
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.iban"
|
v-model="data.iban"
|
||||||
|
@ -318,7 +331,9 @@ async function autofillBic(worker) {
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="info" class="cursor-info">
|
<QIcon name="info" class="cursor-info">
|
||||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
<QTooltip>{{
|
||||||
|
t('components.iban_tooltip')
|
||||||
|
}}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
|
@ -331,7 +346,13 @@ async function autofillBic(worker) {
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
hide-selected
|
hide-selected
|
||||||
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
|
:acls="[
|
||||||
|
{
|
||||||
|
model: 'BankEntity',
|
||||||
|
props: '*',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
},
|
||||||
|
]"
|
||||||
:disable="data.isFreelance"
|
:disable="data.isFreelance"
|
||||||
@update:model-value="autofillBic(data)"
|
@update:model-value="autofillBic(data)"
|
||||||
:filter-options="['bic', 'name']"
|
:filter-options="['bic', 'name']"
|
||||||
|
@ -359,6 +380,8 @@ async function autofillBic(worker) {
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
</VnSection>
|
||||||
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
workerSearch:
|
||||||
|
search: Search worker
|
||||||
|
searchInfo: Search worker by id or name
|
||||||
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
||||||
tableColumns:
|
tableColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Search worker: Buscar trabajador
|
workerSearch:
|
||||||
You can search by worker id or name: Puedes buscar por id o nombre del trabajador
|
search: Buscar trabajador
|
||||||
|
searchInfo: Buscar trabajador por id o nombre
|
||||||
Locker: Taquilla
|
Locker: Taquilla
|
||||||
Internal: Interno
|
Internal: Interno
|
||||||
External: Externo
|
External: Externo
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import { RouterView } from 'vue-router';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
path: '/department',
|
|
||||||
name: 'Department',
|
|
||||||
meta: {
|
|
||||||
title: 'department',
|
|
||||||
icon: 'vn:greuge',
|
|
||||||
moduleName: 'Department',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'WorkerDepartment' },
|
|
||||||
menus: {
|
|
||||||
main: [],
|
|
||||||
card: ['DepartmentBasicData'],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'DepartmentCard',
|
|
||||||
path: 'department/:id',
|
|
||||||
component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
|
|
||||||
redirect: { name: 'DepartmentSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'DepartmentSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Department/Card/DepartmentSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'DepartmentBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Department/Card/DepartmentBasicData.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -11,7 +11,6 @@ import Route from './route';
|
||||||
import Supplier from './supplier';
|
import Supplier from './supplier';
|
||||||
import Travel from './travel';
|
import Travel from './travel';
|
||||||
import Order from './order';
|
import Order from './order';
|
||||||
import Department from './department';
|
|
||||||
import Entry from './entry';
|
import Entry from './entry';
|
||||||
import roadmap from './roadmap';
|
import roadmap from './roadmap';
|
||||||
import Parking from './parking';
|
import Parking from './parking';
|
||||||
|
@ -35,7 +34,6 @@ export default [
|
||||||
Travel,
|
Travel,
|
||||||
Order,
|
Order,
|
||||||
invoiceIn,
|
invoiceIn,
|
||||||
Department,
|
|
||||||
Entry,
|
Entry,
|
||||||
roadmap,
|
roadmap,
|
||||||
Parking,
|
Parking,
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
export default {
|
const workerCard = {
|
||||||
path: '/worker',
|
name: 'WorkerCard',
|
||||||
name: 'Worker',
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
|
||||||
|
redirect: { name: 'WorkerSummary' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'workers',
|
menu: [
|
||||||
icon: 'vn:worker',
|
|
||||||
moduleName: 'Worker',
|
|
||||||
keyBinding: 'w',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'WorkerMain' },
|
|
||||||
menus: {
|
|
||||||
main: ['WorkerList', 'WorkerDepartment'],
|
|
||||||
card: [
|
|
||||||
'WorkerBasicData',
|
'WorkerBasicData',
|
||||||
'WorkerNotes',
|
'WorkerNotes',
|
||||||
'WorkerPda',
|
'WorkerPda',
|
||||||
|
@ -31,47 +24,6 @@ export default {
|
||||||
'WorkerOperator',
|
'WorkerOperator',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: 'WorkerMain',
|
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
|
||||||
redirect: { name: 'WorkerList' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'list',
|
|
||||||
name: 'WorkerList',
|
|
||||||
meta: {
|
|
||||||
title: 'list',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/WorkerList.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'department',
|
|
||||||
name: 'WorkerDepartment',
|
|
||||||
meta: {
|
|
||||||
title: 'department',
|
|
||||||
icon: 'vn:greuge',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/WorkerDepartment.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'WorkerCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'workerCreate',
|
|
||||||
icon: 'add',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/WorkerCreate.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
|
|
||||||
redirect: { name: 'WorkerSummary' },
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'WorkerSummary',
|
name: 'WorkerSummary',
|
||||||
|
@ -110,8 +62,7 @@ export default {
|
||||||
title: 'notes',
|
title: 'notes',
|
||||||
icon: 'vn:notes',
|
icon: 'vn:notes',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () => import('src/pages/Worker/Card/WorkerNotes.vue'),
|
||||||
import('src/pages/Worker/Card/WorkerNotes.vue'),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -122,8 +73,7 @@ export default {
|
||||||
title: 'timeControl',
|
title: 'timeControl',
|
||||||
icon: 'access_time',
|
icon: 'access_time',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () => import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
||||||
import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'WorkerCalendar',
|
name: 'WorkerCalendar',
|
||||||
|
@ -236,6 +186,89 @@ export default {
|
||||||
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
|
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const departmentCard = {
|
||||||
|
name: 'DepartmentCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
|
||||||
|
redirect: { name: 'DepartmentSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: ['DepartmentBasicData'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'summary',
|
||||||
|
name: 'DepartmentSummary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'DepartmentBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentBasicData.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Worker',
|
||||||
|
path: '/worker',
|
||||||
|
meta: {
|
||||||
|
title: 'workers',
|
||||||
|
icon: 'vn:worker',
|
||||||
|
moduleName: 'Worker',
|
||||||
|
keyBinding: 'w',
|
||||||
|
menu: ['WorkerList', 'WorkerDepartment'],
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'WorkerMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'WorkerMain',
|
||||||
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
|
redirect: { name: 'WorkerIndexMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'WorkerIndexMain',
|
||||||
|
redirect: { name: 'WorkerList' },
|
||||||
|
component: () => import('src/pages/Worker/WorkerList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'WorkerList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
workerCard,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'department',
|
||||||
|
name: 'Department',
|
||||||
|
redirect: { name: 'WorkerDepartment' },
|
||||||
|
component: () => import('src/pages/Worker/WorkerDepartment.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'WorkerDepartment',
|
||||||
|
path: 'list',
|
||||||
|
meta: { title: 'department', icon: 'vn:greuge' },
|
||||||
|
},
|
||||||
|
departmentCard,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,6 @@ import invoiceIn from './modules/invoiceIn';
|
||||||
import wagon from './modules/wagon';
|
import wagon from './modules/wagon';
|
||||||
import supplier from './modules/supplier';
|
import supplier from './modules/supplier';
|
||||||
import travel from './modules/travel';
|
import travel from './modules/travel';
|
||||||
import department from './modules/department';
|
|
||||||
import ItemType from './modules/itemType';
|
import ItemType from './modules/itemType';
|
||||||
import shelving from 'src/router/modules/shelving';
|
import shelving from 'src/router/modules/shelving';
|
||||||
import order from 'src/router/modules/order';
|
import order from 'src/router/modules/order';
|
||||||
|
@ -85,7 +84,6 @@ const routes = [
|
||||||
route,
|
route,
|
||||||
supplier,
|
supplier,
|
||||||
travel,
|
travel,
|
||||||
department,
|
|
||||||
roadmap,
|
roadmap,
|
||||||
entry,
|
entry,
|
||||||
parking,
|
parking,
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item shelving', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/list`);
|
||||||
|
cy.typeSearchbar('1{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if the barcode exists', () => {
|
||||||
|
cy.get('[href="#/item/1/barcode"]').click();
|
||||||
|
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.dataCy('Code_input').eq(3).type('1111111111');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Codes can not be repeated');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new barcode', () => {
|
||||||
|
cy.get('[href="#/item/1/barcode"]').click();
|
||||||
|
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.dataCy('Code_input').eq(3).type('1231231231');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item botanical', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/botanical`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should modify the botanical', () => {
|
||||||
|
cy.dataCy('AddGenusSelectDialog').type('Abies');
|
||||||
|
cy.get('.q-menu .q-item').contains('Abies').click();
|
||||||
|
cy.dataCy('AddSpeciesSelectDialog').type('dealbata');
|
||||||
|
cy.get('.q-menu .q-item').contains('dealbata').click();
|
||||||
|
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new Genus', () => {
|
||||||
|
cy.dataCy('Genus_icon').click();
|
||||||
|
cy.dataCy('Latin genus name_input').type('Test');
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new specie', () => {
|
||||||
|
cy.dataCy('Species_icon').click();
|
||||||
|
cy.dataCy('Latin species name_input').type('Test specie');
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,34 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
describe('Item list', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter the items and redirect to the summary', () => {
|
||||||
|
cy.dataCy('Category_select').type('Plant');
|
||||||
|
cy.get('.q-menu .q-item').contains('Plant').click();
|
||||||
|
cy.dataCy('Type_select').type('Anthurium');
|
||||||
|
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||||||
|
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create an item', () => {
|
||||||
|
const data = {
|
||||||
|
Description: { val: `Test item` },
|
||||||
|
Type: { val: `Crisantemo`, type: 'select' },
|
||||||
|
Intrastat: { val: `Coral y materiales similares`, type: 'select' },
|
||||||
|
Origin: { val: `SPA`, type: 'select' },
|
||||||
|
};
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.get(
|
||||||
|
':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
|
||||||
|
).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,24 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item summary', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/summary`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should clone the item', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(2) > .q-item__section').click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.waitForElement('[data-cy="itemTags"]');
|
||||||
|
cy.dataCy('itemTags').should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should regularize stock', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(1) > .q-item__section').click();
|
||||||
|
cy.dataCy('regularizeStockInput').type('10');
|
||||||
|
cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,39 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item tag', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/tags`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error adding an existent tag', () => {
|
||||||
|
cy.get('.q-page').should('be.visible');
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
||||||
|
cy.get('.q-menu .q-item').contains('Tallos').click();
|
||||||
|
cy.get(
|
||||||
|
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
|
||||||
|
).type('1');
|
||||||
|
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add a new tag', () => {
|
||||||
|
cy.get('.q-page').should('be.visible');
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.dataCy('Tag_select').eq(7).click();
|
||||||
|
cy.get('.q-menu .q-item').contains('Ancho de la base').click();
|
||||||
|
cy.get(
|
||||||
|
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
|
||||||
|
).type('50');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="itemTags"] > :nth-child(7) > .justify-center > .q-icon'
|
||||||
|
).click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,14 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item tax', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/tax`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should modify the tax for Spain', () => {
|
||||||
|
cy.dataCy('Class_select').eq(1).type('General VAT{enter}');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,40 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item type', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/item-type`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if the code already exists', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
|
||||||
|
).type('ALS');
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
|
||||||
|
).type('Alstroemeria');
|
||||||
|
cy.dataCy('Worker_select').type('employeeNick');
|
||||||
|
cy.get('.q-menu .q-item').contains('employeeNick').click();
|
||||||
|
cy.dataCy('ItemCategory_select').type('Artificial');
|
||||||
|
cy.get('.q-menu .q-item').contains('Artificial').click();
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('An item type with the same code already exists');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new type', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
|
||||||
|
).type('LIL');
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
|
||||||
|
).type('Lilium');
|
||||||
|
cy.dataCy('Worker_select').type('buyerNick');
|
||||||
|
cy.get('.q-menu .q-item').contains('buyerNick').click();
|
||||||
|
cy.dataCy('ItemCategory_select').type('Flower');
|
||||||
|
cy.get('.q-menu .q-item').contains('Flower').click();
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -16,17 +16,17 @@ describe('VnSearchBar', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stay on the list page if there are several results or none', () => {
|
it('should stay on the list page if there are several results or none', () => {
|
||||||
cy.writeSearchbar('salesA{enter}');
|
cy.typeSearchbar('salesA{enter}');
|
||||||
checkTableLength(2);
|
checkTableLength(2);
|
||||||
|
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
cy.writeSearchbar('0{enter}');
|
cy.typeSearchbar('0{enter}');
|
||||||
checkTableLength(0);
|
checkTableLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchAndCheck = (searchTerm, expectedText) => {
|
const searchAndCheck = (searchTerm, expectedText) => {
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
cy.writeSearchbar(`${searchTerm}{enter}`);
|
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||||
cy.get(idGap).should('have.text', expectedText);
|
cy.get(idGap).should('have.text', expectedText);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue