@@ -80,7 +68,7 @@ const cancel = () => {
type="button"
flat
class="text-primary"
- @click="cancel()"
+ v-close-popup
>
{{ t('globals.cancel') }}
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index 30bcac66b..a2eaa649a 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -247,6 +247,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
}
function updateStateParams() {
+ if (!route) return;
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
newUrl.query[store.searchUrl] = JSON.stringify(store.currentFilter);
diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml
index fa0a14f45..c1748c8ff 100644
--- a/src/i18n/locale/en.yml
+++ b/src/i18n/locale/en.yml
@@ -304,12 +304,14 @@ globals:
from: From
To: To
stateFk: State
- departmentFk: Department
email: Email
SSN: SSN
fi: FI
+ myTeam: My team
+ departmentFk: Department
changePass: Change password
deleteConfirmTitle: Delete selected elements
+ changeState: Change state
errors:
statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred
@@ -556,7 +558,6 @@ ticket:
package: Package
taxClass: Tax class
services: Services
- changeState: Change state
requester: Requester
atender: Atender
request: Request
@@ -1054,92 +1055,6 @@ travel:
warehouse: Warehouse
travelFileDescription: 'Travel id { travelId }'
file: File
-item:
- descriptor:
- item: Item
- buyer: Buyer
- color: Color
- category: Category
- stems: Stems
- visible: Visible
- available: Available
- warehouseText: 'Calculated on the warehouse of { warehouseName }'
- itemDiary: Item diary
- producer: Producer
- list:
- id: Identifier
- grouping: Grouping
- packing: Packing
- description: Description
- stems: Stems
- category: Category
- typeName: Type
- intrastat: Intrastat
- isActive: Active
- size: Size
- origin: Origin
- userName: Buyer
- weightByPiece: Weight/Piece
- stemMultiplier: Multiplier
- producer: Producer
- landed: Landed
- fixedPrice:
- itemFk: Item ID
- groupingPrice: Grouping price
- packingPrice: Packing price
- hasMinPrice: Has min price
- minPrice: Min price
- started: Started
- ended: Ended
- warehouse: Warehouse
- create:
- name: Name
- tag: Tag
- priority: Priority
- type: Type
- intrastat: Intrastat
- origin: Origin
- buyRequest:
- ticketId: 'Ticket ID'
- shipped: 'Shipped'
- requester: 'Requester'
- requested: 'Requested'
- price: 'Price'
- attender: 'Atender'
- item: 'Item'
- achieved: 'Achieved'
- concept: 'Concept'
- state: 'State'
- summary:
- basicData: 'Basic data'
- otherData: 'Other data'
- description: 'Description'
- tax: 'Tax'
- tags: 'Tags'
- botanical: 'Botanical'
- barcode: 'Barcode'
- name: 'Nombre'
- completeName: 'Nombre completo'
- family: 'Familia'
- size: 'Medida'
- origin: 'Origen'
- stems: 'Tallos'
- multiplier: 'Multiplicador'
- buyer: 'Comprador'
- doPhoto: 'Do photo'
- intrastatCode: 'Código intrastat'
- intrastat: 'Intrastat'
- ref: 'Referencia'
- relevance: 'Relevancia'
- weight: 'Peso (gramos)/tallo'
- units: 'Unidades/caja'
- expense: 'Gasto'
- generic: 'Genérico'
- recycledPlastic: 'Plástico reciclado'
- nonRecycledPlastic: 'Plástico no reciclado'
- minSalesQuantity: 'Cantidad mínima de venta'
- genus: 'Genus'
- specie: 'Specie'
components:
topbar: {}
itemsFilterPanel:
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index 5dfe90e98..bd414a793 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -312,8 +312,10 @@ globals:
email: Correo
SSN: NSS
fi: NIF
+ myTeam: Mi equipo
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
+ changeState: Cambiar estado
errors:
statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor
@@ -565,7 +567,6 @@ ticket:
package: Embalaje
taxClass: Tipo IVA
services: Servicios
- changeState: Cambiar estado
requester: Solicitante
atender: Comprador
request: Petición de compra
@@ -1052,92 +1053,6 @@ travel:
warehouse: Almacén
travelFileDescription: 'Id envío { travelId }'
file: Fichero
-item:
- descriptor:
- item: Artículo
- buyer: Comprador
- color: Color
- category: Categoría
- stems: Tallos
- visible: Visible
- available: Disponible
- warehouseText: 'Calculado sobre el almacén de { warehouseName }'
- itemDiary: Registro de compra-venta
- producer: Productor
- list:
- id: Identificador
- grouping: Grouping
- packing: Packing
- description: Descripción
- stems: Tallos
- category: Reino
- typeName: Tipo
- intrastat: Intrastat
- isActive: Activo
- size: Medida
- origin: Origen
- weightByPiece: Peso (gramos)/tallo
- userName: Comprador
- stemMultiplier: Multiplicador
- producer: Productor
- landed: F. entrega
- fixedPrice:
- itemFk: ID Artículo
- groupingPrice: Precio grouping
- packingPrice: Precio packing
- hasMinPrice: Tiene precio mínimo
- minPrice: Precio min
- started: Inicio
- ended: Fin
- warehouse: Almacén
- create:
- name: Nombre
- tag: Etiqueta
- priority: Prioridad
- type: Tipo
- intrastat: Intrastat
- origin: Origen
- summary:
- basicData: 'Datos básicos'
- otherData: 'Otros datos'
- description: 'Descripción'
- tax: 'IVA'
- tags: 'Etiquetas'
- botanical: 'Botánico'
- barcode: 'Código de barras'
- name: 'Nombre'
- completeName: 'Nombre completo'
- family: 'Familia'
- size: 'Medida'
- origin: 'Origen'
- stems: 'Tallos'
- multiplier: 'Multiplicador'
- buyer: 'Comprador'
- doPhoto: 'Hacer foto'
- intrastatCode: 'Código intrastat'
- intrastat: 'Intrastat'
- ref: 'Referencia'
- relevance: 'Relevancia'
- weight: 'Peso (gramos)/tallo'
- units: 'Unidades/caja'
- expense: 'Gasto'
- generic: 'Genérico'
- recycledPlastic: 'Plástico reciclado'
- nonRecycledPlastic: 'Plástico no reciclado'
- minSalesQuantity: 'Cantidad mínima de venta'
- genus: 'Genus'
- specie: 'Specie'
- buyRequest:
- ticketId: 'ID Ticket'
- shipped: 'F. envío'
- requester: 'Solicitante'
- requested: 'Solicitado'
- price: 'Precio'
- attender: 'Comprador'
- item: 'Artículo'
- achieved: 'Conseguido'
- concept: 'Concepto'
- state: 'Estado'
components:
topbar: {}
itemsFilterPanel:
diff --git a/src/pages/Account/AccountAcls.vue b/src/pages/Account/AccountAcls.vue
index dd93a0cb5..63cdac9c7 100644
--- a/src/pages/Account/AccountAcls.vue
+++ b/src/pages/Account/AccountAcls.vue
@@ -9,6 +9,8 @@ import { useQuasar } from 'quasar';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
+import FetchData from 'src/components/FetchData.vue';
+import { useValidator } from 'src/composables/useValidator';
defineProps({
id: {
@@ -23,11 +25,18 @@ const stateStore = useStateStore();
const quasar = useQuasar();
const tableRef = ref();
-
+const roles = ref();
+const validationsStore = useValidator();
+const { models } = validationsStore;
const exprBuilder = (param, value) => {
switch (param) {
case 'search':
- return { model: { like: `%${value}%` } };
+ return {
+ or: [
+ { model: { like: `%${value}%` } },
+ { property: { like: `%${value}%` } },
+ ],
+ };
default:
return { [param]: value };
}
@@ -47,6 +56,13 @@ const columns = computed(() => [
label: t('model'),
cardVisible: true,
create: true,
+ columnCreate: {
+ label: t('model'),
+ component: 'select',
+ attrs: {
+ options: Object.keys(models),
+ },
+ },
},
{
align: 'left',
@@ -55,9 +71,10 @@ const columns = computed(() => [
cardVisible: true,
component: 'select',
attrs: {
- url: 'VnRoles',
+ options: roles,
optionLabel: 'name',
optionValue: 'name',
+ inputDebounce: 0,
},
create: true,
},
@@ -130,6 +147,11 @@ const deleteAcl = async ({ id }) => {
/>
+
(roles = data)"
+ />
diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue
index 72c445fa9..9e7f1b10a 100644
--- a/src/pages/Account/AccountList.vue
+++ b/src/pages/Account/AccountList.vue
@@ -74,7 +74,7 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
- title: t('View Summary'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, AccountSummary),
isPrimary: true,
diff --git a/src/pages/Account/Alias/Card/AliasUsers.vue b/src/pages/Account/Alias/Card/AliasUsers.vue
index 4a9c449e4..4aad68f1a 100644
--- a/src/pages/Account/Alias/Card/AliasUsers.vue
+++ b/src/pages/Account/Alias/Card/AliasUsers.vue
@@ -46,13 +46,9 @@ const columns = computed(() => [
]);
const deleteAlias = async (row) => {
- try {
- await axios.delete(`${urlPath.value}/${row.id}`);
- notify(t('User removed'), 'positive');
- fetchAliases();
- } catch (error) {
- console.error(error);
- }
+ await axios.delete(`${urlPath.value}/${row.id}`);
+ notify(t('User removed'), 'positive');
+ fetchAliases();
};
watch(
diff --git a/src/pages/Account/Card/AccountMailAlias.vue b/src/pages/Account/Card/AccountMailAlias.vue
index 15d03c665..8d3bd3b67 100644
--- a/src/pages/Account/Card/AccountMailAlias.vue
+++ b/src/pages/Account/Card/AccountMailAlias.vue
@@ -61,23 +61,15 @@ const fetchAccountExistence = async () => {
};
const deleteMailAlias = async (row) => {
- try {
- await axios.delete(`${urlPath}/${row.id}`);
- fetchMailAliases();
- notify(t('Unsubscribed from alias!'), 'positive');
- } catch (error) {
- console.error(error);
- }
+ await axios.delete(`${urlPath}/${row.id}`);
+ fetchMailAliases();
+ notify(t('Unsubscribed from alias!'), 'positive');
};
const createMailAlias = async (mailAliasFormData) => {
- try {
- await axios.post(urlPath, mailAliasFormData);
- notify(t('Subscribed to alias!'), 'positive');
- fetchMailAliases();
- } catch (error) {
- console.error(error);
- }
+ await axios.post(urlPath, mailAliasFormData);
+ notify(t('Subscribed to alias!'), 'positive');
+ fetchMailAliases();
};
const fetchMailAliases = async () => {
diff --git a/src/pages/Account/Role/AccountRoles.vue b/src/pages/Account/Role/AccountRoles.vue
index ea175d913..5398485e3 100644
--- a/src/pages/Account/Role/AccountRoles.vue
+++ b/src/pages/Account/Role/AccountRoles.vue
@@ -54,7 +54,7 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
- title: t('View Summary'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, RoleSummary),
isPrimary: true,
diff --git a/src/pages/Account/Role/Card/SubRoles.vue b/src/pages/Account/Role/Card/SubRoles.vue
index d17f96dd8..6cac94667 100644
--- a/src/pages/Account/Role/Card/SubRoles.vue
+++ b/src/pages/Account/Role/Card/SubRoles.vue
@@ -46,29 +46,15 @@ const columns = computed(() => [
]);
const deleteSubRole = async (row) => {
- try {
- await axios.delete(`${urlPath.value}/${row.id}`);
- fetchSubRoles();
- notify(
- t('Role removed. Changes will take a while to fully propagate.'),
- 'positive'
- );
- } catch (error) {
- console.error(error);
- }
+ await axios.delete(`${urlPath.value}/${row.id}`);
+ fetchSubRoles();
+ notify(t('Role removed. Changes will take a while to fully propagate.'), 'positive');
};
const createSubRole = async (subRoleFormData) => {
- try {
- await axios.post(urlPath.value, subRoleFormData);
- notify(
- t('Role added! Changes will take a while to fully propagate.'),
- 'positive'
- );
- fetchSubRoles();
- } catch (error) {
- console.error(error);
- }
+ await axios.post(urlPath.value, subRoleFormData);
+ notify(t('Role added! Changes will take a while to fully propagate.'), 'positive');
+ fetchSubRoles();
};
watch(
diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue
index d77f718c6..edfa52b4b 100644
--- a/src/pages/Claim/Card/ClaimSummary.vue
+++ b/src/pages/Claim/Card/ClaimSummary.vue
@@ -204,7 +204,7 @@ function claimUrl(section) {
top
color="black"
text-color="white"
- :label="t('ticket.summary.changeState')"
+ :label="t('globals.changeState')"
>
{
{
-
-
-
-
-
+
+
+
+
+
{
{
{
-
-
+
+
- {{ t('itemBasicData.isFragileTooltip') }}
+ {{ t('item.basicData.isFragileTooltip') }}
- {{ t('itemBasicData.isPhotoRequestedTooltip') }}
+ {{ t('item.basicData.isPhotoRequestedTooltip') }}
{
return route.params.id;
});
-onMounted(async () => {
- itemBotanicalsForm.itemFk = entityId.value;
- itemBotanicals.value = await itemBotanicalsRef.value.fetch();
- if (itemBotanicals.value.length > 0)
- Object.assign(itemBotanicalsForm, itemBotanicals.value[0]);
-});
{
@on-fetch="(data) => (itemBotanicals = data)"
/>
(itemBotanicalsForm = data)"
>
diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue
index ef844824f..243d4c7cb 100644
--- a/src/pages/Item/Card/ItemDescriptor.vue
+++ b/src/pages/Item/Card/ItemDescriptor.vue
@@ -1,18 +1,18 @@
@@ -151,7 +118,7 @@ const openCloneDialog = async () => {
-
+
{{ t('globals.clone') }}
@@ -160,8 +127,8 @@ const openCloneDialog = async () => {
@@ -194,6 +161,18 @@ const openCloneDialog = async () => {
:value="entity.value7"
/>
+
+
+
+ {{ t('Inactive article') }}
+
+
+
{
es:
Regularize stock: Regularizar stock
- All its properties will be copied: Todas sus propiedades serán copiadas
- Do you want to clone this item?: ¿Desea clonar este artículo?
+ Inactive article: Artículo inactivo
es:
New item: Nuevo artículo
- All it's properties will be copied: Todas sus propiedades serán copiadas
- Do you want to clone this item?: ¿Desea clonar este artículo?
Preview: Vista previa
+ Regularize stock: Regularizar stock
diff --git a/src/pages/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue
index 82c3b48e0..450031a0e 100644
--- a/src/pages/Item/ItemRequest.vue
+++ b/src/pages/Item/ItemRequest.vue
@@ -1,23 +1,17 @@
-
-
-
-
+
+
+
+ {{ row.ticketFk }}
+
+
+
+
+
+
+ {{ toDate(row.shipped) }}
+
+
+
+
+
+ {{ row.attenderName }}
+
+
-
-
-
-
-
- {{ row.ticketFk }}
-
-
-
-
-
-
- {{ toDateFormat(row.shipped) }}
-
- {{ toDateFormat(row.shipped) }}
-
-
-
-
- {{ row.requesterName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ row.itemDescription }}
-
-
-
-
-
- {{ getState(row.isOk) }}
-
-
-
-
-
-
- {{ row.response }}
-
-
-
-
- {{ t('Discard') }}
-
-
-
-
-
-
-
+
+ {{ row.requesterName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.itemDescription }}
+
+
+
+ handleScopeDays(evt.target.value)"
+ @remove="handleScopeDays()"
+ class="q-px-xs q-pr-lg"
+ filled
+ dense
/>
-
-
+
+
+
+
+
+ {{ row.response }}
+
+
+
+
+ {{ t('Discard') }}
+
+
+
+
+
+
+
+
diff --git a/src/pages/Item/ItemRequestDenyForm.vue b/src/pages/Item/ItemRequestDenyForm.vue
index be70fb799..c9a4cbe9c 100644
--- a/src/pages/Item/ItemRequestDenyForm.vue
+++ b/src/pages/Item/ItemRequestDenyForm.vue
@@ -10,6 +10,7 @@ defineProps({
requestId: {
type: Number,
default: null,
+ required: true,
},
});
@@ -43,6 +44,7 @@ onMounted(async () => {
type="textarea"
v-model="data.observation"
fill-input
+ :required="true"
autogrow
/>
diff --git a/src/pages/Item/ItemTypeCreate.vue b/src/pages/Item/ItemTypeCreate.vue
index 290a40389..60c037510 100644
--- a/src/pages/Item/ItemTypeCreate.vue
+++ b/src/pages/Item/ItemTypeCreate.vue
@@ -52,15 +52,27 @@ const redirectToItemTypeBasicData = (_, { id }) => {
+ >
+
+
+ {{ scope.opt?.name }}
+ {{ scope.opt?.nickname }},
+ {{ scope.opt?.code }}
+
+
+
+
import { useI18n } from 'vue-i18n';
-import { useRouter } from 'vue-router';
-
-import VnPaginate from 'src/components/ui/VnPaginate.vue';
-import VnLv from 'src/components/ui/VnLv.vue';
-import CardList from 'src/components/ui/CardList.vue';
-import ItemTypeSummary from 'src/pages/ItemType/Card/ItemTypeSummary.vue';
-import ItemTypeFilter from 'src/pages/ItemType/ItemTypeFilter.vue';
+import { ref, computed } from 'vue';
import ItemTypeSearchbar from '../ItemType/ItemTypeSearchbar.vue';
-import { useSummaryDialog } from 'src/composables/useSummaryDialog';
-import RightMenu from 'src/components/common/RightMenu.vue';
+import VnTable from 'components/VnTable/VnTable.vue';
+import FetchData from 'components/FetchData.vue';
-const router = useRouter();
const { t } = useI18n();
-const { viewSummary } = useSummaryDialog();
+const tableRef = ref();
+const workerOptions = ref([]);
+const ItemCategoriesOptions = ref([]);
-const redirectToItemTypeSummary = (id) => {
- router.push({ name: 'ItemTypeSummary', params: { id } });
-};
-
-const redirectToCreateView = () => {
- router.push({ name: 'ItemTypeCreate' });
-};
-
-const exprBuilder = (param, value) => {
- switch (param) {
- case 'name':
- return {
- name: { like: `%${value}%` },
- };
- case 'code':
- return {
- code: { like: `%${value}%` },
- };
- case 'search':
- if (value) {
- if (!isNaN(value)) {
- return { id: value };
- } else {
- return {
- or: [
- {
- name: {
- like: `%${value}%`,
- },
- },
- {
- code: {
- like: `%${value}%`,
- },
- },
- ],
- };
- }
- }
- }
-};
+const columns = computed(() => [
+ {
+ align: 'left',
+ name: 'id',
+ label: t('id'),
+ isId: true,
+ cardVisible: true,
+ },
+ {
+ align: 'left',
+ name: 'code',
+ label: t('code'),
+ isTitle: true,
+ cardVisible: true,
+ create: true,
+ },
+ {
+ align: 'left',
+ name: 'name',
+ label: t('name'),
+ cardVisible: true,
+ create: true,
+ },
+ {
+ align: 'left',
+ name: 'workerFk',
+ label: t('worker'),
+ create: true,
+ component: 'select',
+ attrs: {
+ options: workerOptions.value,
+ optionLabel: 'firstName',
+ optionValue: 'id',
+ },
+ cardVisible: false,
+ visible: false,
+ },
+ {
+ align: 'left',
+ name: 'categoryFk',
+ label: t('ItemCategory'),
+ create: true,
+ component: 'select',
+ attrs: {
+ options: ItemCategoriesOptions.value,
+ fields: ['id', 'name'],
+ order: 'name ASC',
+ },
+ cardVisible: false,
+ visible: false,
+ },
+ {
+ align: 'left',
+ name: 'Temperature',
+ label: t('Temperature'),
+ create: true,
+ component: 'select',
+ attrs: {
+ url: 'Temperatures',
+ fields: ['id', 'name'],
+ },
+ cardVisible: false,
+ visible: false,
+ },
+]);
+ (workerOptions = data)"
+ auto-load
+ />
+ (ItemCategoriesOptions = data)"
+ auto-load
+ />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('New item type') }}
-
-
+
+
+
+ es:
+ id: Id
+ code: Código
+ name: Nombre
+ worker: Trabajador
+ ItemCategory: Reino
+ Temperature: Temperatura
+ Create ItemTypes: Crear familia
+ en:
+ code: Code
+ name: Name
+ worker: Worker
+ ItemCategory: ItemCategory
+ Temperature: Temperature
+
diff --git a/src/pages/Item/composables/cloneItem.js b/src/pages/Item/composables/cloneItem.js
new file mode 100644
index 000000000..2421c0808
--- /dev/null
+++ b/src/pages/Item/composables/cloneItem.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import { useRouter } from 'vue-router';
+import { useI18n } from 'vue-i18n';
+import { useQuasar } from 'quasar';
+import VnConfirm from 'components/ui/VnConfirm.vue';
+
+export function cloneItem() {
+ const { t } = useI18n();
+
+ const quasar = useQuasar();
+ const router = useRouter();
+ const cloneItem = async (entityId) => {
+ const { id } = entityId;
+ try {
+ const { data } = await axios.post(`Items/${id ?? entityId}/clone`);
+ router.push({ name: 'ItemTags', params: { id: data.id } });
+ } catch (err) {
+ console.error('Error cloning item');
+ }
+ };
+
+ const openCloneDialog = async (entityId) => {
+ quasar
+ .dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t('item.descriptor.clone.title'),
+ message: t('item.descriptor.clone.subTitle'),
+ },
+ })
+ .onOk(async () => {
+ await cloneItem(entityId);
+ });
+ };
+ return { openCloneDialog };
+}
diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml
index c32ee493c..e99853760 100644
--- a/src/pages/Item/locale/en.yml
+++ b/src/pages/Item/locale/en.yml
@@ -88,3 +88,127 @@ itemType:
worker: Worker
category: Category
temperature: Temperature
+item:
+ params:
+ daysOnward: Days onward
+ search: General search
+ ticketFk: Ticket id
+ attenderFk: Atender
+ clientFk: Client id
+ warehouseFk: Warehouse
+ requesterFk: Salesperson
+ from: From
+ to: To
+ mine: For me
+ state: State
+ myTeam: My team
+ searchbar:
+ label: Search item
+ descriptor:
+ item: Item
+ buyer: Buyer
+ color: Color
+ category: Category
+ stems: Stems
+ visible: Visible
+ available: Available
+ warehouseText: 'Calculated on the warehouse of { warehouseName }'
+ itemDiary: Item diary
+ producer: Producer
+ clone:
+ title: All its properties will be copied
+ subTitle: Do you want to clone this item?
+ list:
+ id: Identifier
+ grouping: Grouping
+ packing: Packing
+ description: Description
+ stems: Stems
+ category: Category
+ typeName: Type
+ intrastat: Intrastat
+ isActive: Active
+ size: Size
+ origin: Origin
+ userName: Buyer
+ weightByPiece: Weight/Piece
+ stemMultiplier: Multiplier
+ producer: Producer
+ landed: Landed
+ basicData:
+ type: Type
+ reference: Reference
+ relevancy: Relevancy
+ stems: Stems
+ multiplier: Multiplier
+ generic: Generic
+ intrastat: Intrastat
+ expense: Expense
+ weightByPiece: Weight/Piece
+ boxUnits: Units/Box
+ recycledPlastic: Recycled Plastic
+ nonRecycledPlastic: Non recycled plastic
+ isActive: Active
+ hasKgPrice: Price in kg
+ isFragile: Fragile
+ isFragileTooltip: Is shown at website, app that this item cannot travel (wreath, palms, ...)
+ isPhotoRequested: Do photo
+ isPhotoRequestedTooltip: This item does need a photo
+ description: Description
+ fixedPrice:
+ itemFk: Item ID
+ groupingPrice: Grouping price
+ packingPrice: Packing price
+ hasMinPrice: Has min price
+ minPrice: Min price
+ started: Started
+ ended: Ended
+ warehouse: Warehouse
+ create:
+ name: Name
+ tag: Tag
+ priority: Priority
+ type: Type
+ intrastat: Intrastat
+ origin: Origin
+ buyRequest:
+ ticketId: 'Ticket ID'
+ shipped: 'Shipped'
+ requester: 'Requester'
+ requested: 'Requested'
+ price: 'Price'
+ attender: 'Attender'
+ item: 'Item'
+ achieved: 'Achieved'
+ concept: 'Concept'
+ state: 'State'
+ summary:
+ basicData: 'Basic data'
+ otherData: 'Other data'
+ description: 'Description'
+ tax: 'Tax'
+ tags: 'Tags'
+ botanical: 'Botanical'
+ barcode: 'Barcode'
+ name: 'Nombre'
+ completeName: 'Nombre completo'
+ family: 'Familia'
+ size: 'Medida'
+ origin: 'Origen'
+ stems: 'Tallos'
+ multiplier: 'Multiplicador'
+ buyer: 'Comprador'
+ doPhoto: 'Do photo'
+ intrastatCode: 'Código intrastat'
+ intrastat: 'Intrastat'
+ ref: 'Referencia'
+ relevance: 'Relevancia'
+ weight: 'Peso (gramos)/tallo'
+ units: 'Unidades/caja'
+ expense: 'Gasto'
+ generic: 'Genérico'
+ recycledPlastic: 'Plástico reciclado'
+ nonRecycledPlastic: 'Plástico no reciclado'
+ minSalesQuantity: 'Cantidad mínima de venta'
+ genus: 'Genus'
+ specie: 'Specie'
diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml
index d32cb7885..56c6ec317 100644
--- a/src/pages/Item/locale/es.yml
+++ b/src/pages/Item/locale/es.yml
@@ -88,3 +88,129 @@ itemType:
worker: Trabajador
category: Reino
temperature: Temperatura
+params:
+ state: asfsdf
+item:
+ params:
+ daysOnward: Días adelante
+ search: Búsqueda general
+ ticketFk: Id ticket
+ attenderFk: Comprador
+ clientFk: Id cliente
+ warehouseFk: Almacén
+ requesterFk: Comercial
+ from: Desde
+ to: Hasta
+ mine: Para mi
+ state: Estado
+ myTeam: Mi equipo
+ searchbar:
+ label: Buscar artículo
+ descriptor:
+ item: Artículo
+ buyer: Comprador
+ color: Color
+ category: Categoría
+ stems: Tallos
+ visible: Visible
+ available: Disponible
+ warehouseText: 'Calculado sobre el almacén de { warehouseName }'
+ itemDiary: Registro de compra-venta
+ producer: Productor
+ clone:
+ title: Todas sus propiedades serán copiadas
+ subTitle: ¿Desea clonar este artículo?
+ list:
+ id: Identificador
+ grouping: Grouping
+ packing: Packing
+ description: Descripción
+ stems: Tallos
+ category: Reino
+ typeName: Tipo
+ intrastat: Intrastat
+ isActive: Activo
+ size: Medida
+ origin: Origen
+ weightByPiece: Peso (gramos)/tallo
+ userName: Comprador
+ stemMultiplier: Multiplicador
+ producer: Productor
+ landed: F. entrega
+ basicData:
+ type: Tipo
+ reference: Referencia
+ relevancy: Relevancia
+ stems: Tallos
+ multiplier: Multiplicador
+ generic: Genérico
+ intrastat: Intrastat
+ expense: Gasto
+ weightByPiece: Peso (gramos)/tallo
+ boxUnits: Unidades/caja
+ recycledPlastic: Plastico reciclado
+ nonRecycledPlastic: Plático no reciclado
+ isActive: Activo
+ hasKgPrice: Precio en kg
+ isFragile: Frágil
+ isFragileTooltip: Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...)
+ isPhotoRequested: Hacer foto
+ isPhotoRequestedTooltip: Este artículo necesita una foto
+ description: Descripción
+ fixedPrice:
+ itemFk: ID Artículo
+ groupingPrice: Precio grouping
+ packingPrice: Precio packing
+ hasMinPrice: Tiene precio mínimo
+ minPrice: Precio min
+ started: Inicio
+ ended: Fin
+ warehouse: Almacén
+ create:
+ name: Nombre
+ tag: Etiqueta
+ priority: Prioridad
+ type: Tipo
+ intrastat: Intrastat
+ origin: Origen
+ summary:
+ basicData: 'Datos básicos'
+ otherData: 'Otros datos'
+ description: 'Descripción'
+ tax: 'IVA'
+ tags: 'Etiquetas'
+ botanical: 'Botánico'
+ barcode: 'Código de barras'
+ name: 'Nombre'
+ completeName: 'Nombre completo'
+ family: 'Familia'
+ size: 'Medida'
+ origin: 'Origen'
+ stems: 'Tallos'
+ multiplier: 'Multiplicador'
+ buyer: 'Comprador'
+ doPhoto: 'Hacer foto'
+ intrastatCode: 'Código intrastat'
+ intrastat: 'Intrastat'
+ ref: 'Referencia'
+ relevance: 'Relevancia'
+ weight: 'Peso (gramos)/tallo'
+ units: 'Unidades/caja'
+ expense: 'Gasto'
+ generic: 'Genérico'
+ recycledPlastic: 'Plástico reciclado'
+ nonRecycledPlastic: 'Plástico no reciclado'
+ minSalesQuantity: 'Cantidad mínima de venta'
+ genus: 'Genus'
+ specie: 'Specie'
+ buyRequest:
+ ticketId: 'ID Ticket'
+ shipped: 'F. envío'
+ requester: 'Solicitante'
+ requested: 'Solicitado'
+ price: 'Precio'
+ attender: 'Comprador'
+ item: 'Artículo'
+ achieved: 'Conseguido'
+ concept: 'Concepto'
+ state: 'Estado'
diff --git a/src/pages/ItemType/Card/ItemTypeBasicData.vue b/src/pages/ItemType/Card/ItemTypeBasicData.vue
index d35fbb17d..1d4a5cf94 100644
--- a/src/pages/ItemType/Card/ItemTypeBasicData.vue
+++ b/src/pages/ItemType/Card/ItemTypeBasicData.vue
@@ -41,15 +41,27 @@ const temperaturesOptions = ref([]);
+ >
+
+
+ {{ scope.opt?.name }}
+ {{ scope.opt?.nickname }},
+ {{ scope.opt?.code }}
+
+
+
[
name: 'tableActions',
actions: [
{
- title: t('Preview'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row?.routeFk, RouteSummary),
diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue
index 51da4ec12..dbf646935 100644
--- a/src/pages/Route/RouteExtendedList.vue
+++ b/src/pages/Route/RouteExtendedList.vue
@@ -204,7 +204,7 @@ const columns = computed(() => [
isPrimary: true,
},
{
- title: t('route.components.smartCard.viewSummary'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row?.id, RouteSummary),
isPrimary: true,
diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
index f5ce8a0f3..f6c20c514 100644
--- a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
+++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
@@ -112,32 +112,20 @@ const getShipped = async (params) => {
};
const onChangeZone = async (zoneId) => {
- try {
- formData.value.agencyModeFk = null;
- const { data } = await axios.get(`Zones/${zoneId}`);
- formData.value.agencyModeFk = data.agencyModeFk;
- } catch (error) {
- console.error(error);
- }
+ formData.value.agencyModeFk = null;
+ const { data } = await axios.get(`Zones/${zoneId}`);
+ formData.value.agencyModeFk = data.agencyModeFk;
};
const onChangeAddress = async (addressId) => {
- try {
- formData.value.nickname = null;
- const { data } = await axios.get(`Addresses/${addressId}`);
- formData.value.nickname = data.nickname;
- } catch (error) {
- console.error(error);
- }
+ formData.value.nickname = null;
+ const { data } = await axios.get(`Addresses/${addressId}`);
+ formData.value.nickname = data.nickname;
};
const getClientDefaultAddress = async (clientId) => {
- try {
- const { data } = await axios.get(`Clients/${clientId}`);
- if (data) addressId.value = data.defaultAddressFk;
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.get(`Clients/${clientId}`);
+ if (data) addressId.value = data.defaultAddressFk;
};
const clientAddressesList = async (value) => {
diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
index 92640f898..fb7881403 100644
--- a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
+++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue
@@ -70,60 +70,51 @@ const isFormInvalid = () => {
};
const getPriceDifference = async () => {
- try {
- const params = {
- landed: formData.value.landed,
- addressId: formData.value.addressFk,
- agencyModeId: formData.value.agencyModeFk,
- zoneId: formData.value.zoneFk,
- warehouseId: formData.value.warehouseFk,
- shipped: formData.value.shipped,
- };
- const { data } = await axios.post(
- `tickets/${formData.value.id}/priceDifference`,
- params
- );
- formData.value.sale = data;
- } catch (error) {
- console.error(error);
- }
+ const params = {
+ landed: formData.value.landed,
+ addressId: formData.value.addressFk,
+ agencyModeId: formData.value.agencyModeFk,
+ zoneId: formData.value.zoneFk,
+ warehouseId: formData.value.warehouseFk,
+ shipped: formData.value.shipped,
+ };
+ const { data } = await axios.post(
+ `tickets/${formData.value.id}/priceDifference`,
+ params
+ );
+ formData.value.sale = data;
};
const submit = async () => {
- try {
- if (!formData.value.option)
- return notify(t('basicData.chooseAnOption'), 'negative');
+ if (!formData.value.option) return notify(t('basicData.chooseAnOption'), 'negative');
- const params = {
- clientFk: formData.value.clientFk,
- nickname: formData.value.nickname,
- agencyModeFk: formData.value.agencyModeFk,
- addressFk: formData.value.addressFk,
- zoneFk: formData.value.zoneFk,
- warehouseFk: formData.value.warehouseFk,
- companyFk: formData.value.companyFk,
- shipped: formData.value.shipped,
- landed: formData.value.landed,
- isDeleted: formData.value.isDeleted,
- option: formData.value.option,
- isWithoutNegatives: formData.value.withoutNegatives,
- withWarningAccept: formData.value.withWarningAccept,
- keepPrice: false,
- };
+ const params = {
+ clientFk: formData.value.clientFk,
+ nickname: formData.value.nickname,
+ agencyModeFk: formData.value.agencyModeFk,
+ addressFk: formData.value.addressFk,
+ zoneFk: formData.value.zoneFk,
+ warehouseFk: formData.value.warehouseFk,
+ companyFk: formData.value.companyFk,
+ shipped: formData.value.shipped,
+ landed: formData.value.landed,
+ isDeleted: formData.value.isDeleted,
+ option: formData.value.option,
+ isWithoutNegatives: formData.value.withoutNegatives,
+ withWarningAccept: formData.value.withWarningAccept,
+ keepPrice: false,
+ };
- const { data } = await axios.post(
- `tickets/${formData.value.id}/componentUpdate`,
- params
- );
+ const { data } = await axios.post(
+ `tickets/${formData.value.id}/componentUpdate`,
+ params
+ );
- if (!data) return;
+ if (!data) return;
- const ticketToMove = data.id;
- notify(t('basicData.unroutedTicket'), 'positive');
- router.push({ name: 'TicketSummary', params: { id: ticketToMove } });
- } catch (error) {
- console.error(error);
- }
+ const ticketToMove = data.id;
+ notify(t('basicData.unroutedTicket'), 'positive');
+ router.push({ name: 'TicketSummary', params: { id: ticketToMove } });
};
const submitWithNegatives = async () => {
diff --git a/src/pages/Ticket/Card/ExpeditionNewTicket.vue b/src/pages/Ticket/Card/ExpeditionNewTicket.vue
index 9183ae405..c288f6cc2 100644
--- a/src/pages/Ticket/Card/ExpeditionNewTicket.vue
+++ b/src/pages/Ticket/Card/ExpeditionNewTicket.vue
@@ -34,26 +34,20 @@ const newTicketFormData = reactive({});
const date = new Date();
const createTicket = async () => {
- try {
- const expeditionIds = $props.selectedExpeditions.map(
- (expedition) => expedition.id
- );
- const params = {
- clientId: $props.ticket.clientFk,
- landed: newTicketFormData.landed,
- warehouseId: $props.ticket.warehouseFk,
- addressId: $props.ticket.addressFk,
- agencyModeId: $props.ticket.agencyModeFk,
- routeId: newTicketFormData.routeFk,
- expeditionIds: expeditionIds,
- };
+ const expeditionIds = $props.selectedExpeditions.map((expedition) => expedition.id);
+ const params = {
+ clientId: $props.ticket.clientFk,
+ landed: newTicketFormData.landed,
+ warehouseId: $props.ticket.warehouseFk,
+ addressId: $props.ticket.addressFk,
+ agencyModeId: $props.ticket.agencyModeFk,
+ routeId: newTicketFormData.routeFk,
+ expeditionIds: expeditionIds,
+ };
- const { data } = await axios.post('Expeditions/moveExpeditions', params);
- notify(t('globals.dataSaved'), 'positive');
- router.push({ name: 'TicketSummary', params: { id: data.id } });
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.post('Expeditions/moveExpeditions', params);
+ notify(t('globals.dataSaved'), 'positive');
+ router.push({ name: 'TicketSummary', params: { id: data.id } });
};
diff --git a/src/pages/Ticket/Card/TicketComponents.vue b/src/pages/Ticket/Card/TicketComponents.vue
index 0bccdaacd..b5b3c430c 100644
--- a/src/pages/Ticket/Card/TicketComponents.vue
+++ b/src/pages/Ticket/Card/TicketComponents.vue
@@ -150,31 +150,19 @@ const getTotal = computed(() => {
});
const getComponentsSum = async () => {
- try {
- const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`);
- componentsList.value = data;
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`);
+ componentsList.value = data;
};
const getTheoricalCost = async () => {
- try {
- const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`);
- theoricalCost.value = data;
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`);
+ theoricalCost.value = data;
};
const getTicketVolume = async () => {
- try {
- if (!ticketData.value) return;
- const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
- ticketVolume.value = data[0].volume;
- } catch (error) {
- console.error(error);
- }
+ if (!ticketData.value) return;
+ const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
+ ticketVolume.value = data[0].volume;
};
onMounted(() => {
diff --git a/src/pages/Ticket/Card/TicketExpedition.vue b/src/pages/Ticket/Card/TicketExpedition.vue
index 4becb3db3..8041ad069 100644
--- a/src/pages/Ticket/Card/TicketExpedition.vue
+++ b/src/pages/Ticket/Card/TicketExpedition.vue
@@ -1,5 +1,5 @@
+ (expeditionStateTypes = data)"
+ auto-load
+ />
+
(stateStore.rightDrawer = false));
-
(stateStore.rightDrawer = false));
selection: 'multiple',
}"
auto-load
+ :expr-builder="
+ (param, value) => {
+ switch (param) {
+ case 'expeditionFk':
+ return { id: value };
+ case 'packageItemName':
+ return { packagingItemFk: value };
+ }
+ }
+ "
order="created DESC"
>
@@ -324,7 +320,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@@ -345,11 +341,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
- {{
- row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
- }}
-
+
diff --git a/src/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
index 2ec519d2d..588f78a7b 100644
--- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue
+++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
@@ -165,14 +165,10 @@ const createRefund = async (withWarehouse) => {
negative: true,
};
- try {
- const { data } = await axios.post('Tickets/cloneAll', params);
- const [refundTicket] = data;
- notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
- push({ name: 'TicketSale', params: { id: refundTicket.id } });
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.post('Tickets/cloneAll', params);
+ const [refundTicket] = data;
+ notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
+ push({ name: 'TicketSale', params: { id: refundTicket.id } });
};
diff --git a/src/pages/Ticket/Card/TicketSaleTracking.vue b/src/pages/Ticket/Card/TicketSaleTracking.vue
index e7830bf37..1083393c4 100644
--- a/src/pages/Ticket/Card/TicketSaleTracking.vue
+++ b/src/pages/Ticket/Card/TicketSaleTracking.vue
@@ -150,18 +150,14 @@ const shelvingsTableColumns = computed(() => [
]);
const getSaleTrackings = async (sale) => {
- try {
- const filter = {
- where: { saleFk: sale.saleFk },
- order: ['itemFk DESC'],
- };
- const { data } = await axios.get(`SaleTrackings/listSaleTracking`, {
- params: { filter: JSON.stringify(filter) },
- });
- saleTrackings.value = data;
- } catch (error) {
- console.error(error);
- }
+ const filter = {
+ where: { saleFk: sale.saleFk },
+ order: ['itemFk DESC'],
+ };
+ const { data } = await axios.get(`SaleTrackings/listSaleTracking`, {
+ params: { filter: JSON.stringify(filter) },
+ });
+ saleTrackings.value = data;
};
const showLog = async (sale) => {
@@ -170,17 +166,13 @@ const showLog = async (sale) => {
};
const getItemShelvingSales = async (sale) => {
- try {
- const filter = {
- where: { saleFk: sale.saleFk },
- };
- const { data } = await axios.get(`ItemShelvingSales/filter`, {
- params: { filter: JSON.stringify(filter) },
- });
- itemShelvingsSales.value = data;
- } catch (error) {
- console.error(error);
- }
+ const filter = {
+ where: { saleFk: sale.saleFk },
+ };
+ const { data } = await axios.get(`ItemShelvingSales/filter`, {
+ params: { filter: JSON.stringify(filter) },
+ });
+ itemShelvingsSales.value = data;
};
const showShelving = async (sale) => {
@@ -189,36 +181,28 @@ const showShelving = async (sale) => {
};
const updateQuantity = async (sale) => {
- try {
- if (oldQuantity.value === sale.quantity) return;
- const params = {
- quantity: sale.quantity,
- };
- await axios.patch(`ItemShelvingSales/${sale.id}`, params);
- oldQuantity.value = null;
- } catch (error) {
- console.error(error);
- }
+ if (oldQuantity.value === sale.quantity) return;
+ const params = {
+ quantity: sale.quantity,
+ };
+ await axios.patch(`ItemShelvingSales/${sale.id}`, params);
+ oldQuantity.value = null;
};
const updateParking = async (sale) => {
- try {
- const filter = {
- fields: ['id'],
- where: {
- code: sale.shelvingFk,
- },
- };
- const { data } = await axios.get(`Shelvings/findOne`, {
- params: { filter: JSON.stringify(filter) },
- });
- const params = {
- parkingFk: sale.parkingFk,
- };
- await axios.patch(`Shelvings/${data.id}`, params);
- } catch (error) {
- console.error(error);
- }
+ const filter = {
+ fields: ['id'],
+ where: {
+ code: sale.shelvingFk,
+ },
+ };
+ const { data } = await axios.get(`Shelvings/findOne`, {
+ params: { filter: JSON.stringify(filter) },
+ });
+ const params = {
+ parkingFk: sale.parkingFk,
+ };
+ await axios.patch(`Shelvings/${data.id}`, params);
};
const updateShelving = async (sale) => {
@@ -241,61 +225,41 @@ const updateShelving = async (sale) => {
};
const saleTrackingNew = async (sale, stateCode, isChecked) => {
- try {
- const params = {
- saleFk: sale.saleFk,
- isChecked,
- quantity: sale.quantity,
- stateCode,
- };
- await axios.post(`SaleTrackings/new`, params);
- notify(t('globals.dataSaved'), 'positive');
- } catch (error) {
- console.error(error);
- }
+ const params = {
+ saleFk: sale.saleFk,
+ isChecked,
+ quantity: sale.quantity,
+ stateCode,
+ };
+ await axios.post(`SaleTrackings/new`, params);
+ notify(t('globals.dataSaved'), 'positive');
};
const saleTrackingDel = async ({ saleFk }, stateCode) => {
- try {
- const params = {
- saleFk,
- stateCodes: [stateCode],
- };
- await axios.post(`SaleTrackings/delete`, params);
- notify(t('globals.dataSaved'), 'positive');
- } catch (error) {
- console.error(error);
- }
+ const params = {
+ saleFk,
+ stateCodes: [stateCode],
+ };
+ await axios.post(`SaleTrackings/delete`, params);
+ notify(t('globals.dataSaved'), 'positive');
};
const clickSaleGroupDetail = async (sale) => {
- try {
- if (!sale.saleGroupDetailFk) return;
+ if (!sale.saleGroupDetailFk) return;
- await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`);
- sale.hasSaleGroupDetail = false;
- notify(t('globals.dataSaved'), 'positive');
- } catch (error) {
- console.error(error);
- }
+ await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`);
+ sale.hasSaleGroupDetail = false;
+ notify(t('globals.dataSaved'), 'positive');
};
const clickPreviousSelected = (sale) => {
- try {
- qCheckBoxController(sale, 'isPreviousSelected');
- if (!sale.isPreviousSelected) sale.isPrevious = false;
- } catch (error) {
- console.error(error);
- }
+ qCheckBoxController(sale, 'isPreviousSelected');
+ if (!sale.isPreviousSelected) sale.isPrevious = false;
};
const clickPrevious = (sale) => {
- try {
- qCheckBoxController(sale, 'isPrevious');
- if (sale.isPrevious) sale.isPreviousSelected = true;
- } catch (error) {
- console.error(error);
- }
+ qCheckBoxController(sale, 'isPrevious');
+ if (sale.isPrevious) sale.isPreviousSelected = true;
};
const qCheckBoxController = (sale, action) => {
@@ -306,16 +270,12 @@ const qCheckBoxController = (sale, action) => {
isPreviousSelected: 'PREVIOUS_PREPARATION',
};
const stateCode = STATE_CODES[action];
- try {
- if (!sale[action]) {
- saleTrackingNew(sale, stateCode, true);
- sale[action] = true;
- } else {
- saleTrackingDel(sale, stateCode);
- sale[action] = false;
- }
- } catch (error) {
- console.error(error);
+ if (!sale[action]) {
+ saleTrackingNew(sale, stateCode, true);
+ sale[action] = true;
+ } else {
+ saleTrackingDel(sale, stateCode);
+ sale[action] = false;
}
};
diff --git a/src/pages/Ticket/Card/TicketService.vue b/src/pages/Ticket/Card/TicketService.vue
index 45a870f7f..47c28a422 100644
--- a/src/pages/Ticket/Card/TicketService.vue
+++ b/src/pages/Ticket/Card/TicketService.vue
@@ -46,40 +46,32 @@ watch(
onMounted(async () => await getDefaultTaxClass());
const createRefund = async () => {
- try {
- if (!selected.value.length) return;
+ if (!selected.value.length) return;
- const params = {
- servicesIds: selected.value.map((s) => +s.id),
- withWarehouse: false,
- negative: true,
- };
- const { data } = await axios.post('Sales/clone', params);
- const [refundTicket] = data;
- notify(
- t('service.createRefundSuccess', {
- ticketId: refundTicket.id,
- }),
- 'positive'
- );
- router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
- } catch (error) {
- console.error(error);
- }
+ const params = {
+ servicesIds: selected.value.map((s) => +s.id),
+ withWarehouse: false,
+ negative: true,
+ };
+ const { data } = await axios.post('Sales/clone', params);
+ const [refundTicket] = data;
+ notify(
+ t('service.createRefundSuccess', {
+ ticketId: refundTicket.id,
+ }),
+ 'positive'
+ );
+ router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
};
const getDefaultTaxClass = async () => {
- try {
- let filter = {
- where: { code: 'G' },
- };
- const { data } = await axios.get('TaxClasses/findOne', {
- params: { filter: JSON.stringify(filter) },
- });
- defaultTaxClass.value = data;
- } catch (error) {
- console.error(error);
- }
+ let filter = {
+ where: { code: 'G' },
+ };
+ const { data } = await axios.get('TaxClasses/findOne', {
+ params: { filter: JSON.stringify(filter) },
+ });
+ defaultTaxClass.value = data;
};
const columns = computed(() => [
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index 1e14b0402..5fb99b849 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -122,37 +122,23 @@ function isOnTicketCard() {
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/src/pages/Ticket/Card/TicketVolume.vue b/src/pages/Ticket/Card/TicketVolume.vue
index 2cf7ffc42..edfe489d9 100644
--- a/src/pages/Ticket/Card/TicketVolume.vue
+++ b/src/pages/Ticket/Card/TicketVolume.vue
@@ -75,22 +75,18 @@ const columns = computed(() => [
]);
const applyVolumes = async (salesData) => {
- try {
- if (!salesData.length) return;
+ if (!salesData.length) return;
- sales.value = salesData;
- const ticket = sales.value[0].ticketFk;
- const { data } = await axios.get(`Tickets/${ticket}/getVolume`);
- const volumes = new Map(data.saleVolume.map((volume) => [volume.saleFk, volume]));
+ sales.value = salesData;
+ const ticket = sales.value[0].ticketFk;
+ const { data } = await axios.get(`Tickets/${ticket}/getVolume`);
+ const volumes = new Map(data.saleVolume.map((volume) => [volume.saleFk, volume]));
- sales.value.forEach((sale) => {
- sale.saleVolume = volumes.get(sale.id);
- });
+ sales.value.forEach((sale) => {
+ sale.saleVolume = volumes.get(sale.id);
+ });
- packingTypeVolume.value = data.packingTypeVolume;
- } catch (error) {
- console.error(error);
- }
+ packingTypeVolume.value = data.packingTypeVolume;
};
onMounted(() => (stateStore.rightDrawer = true));
diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue
index 43b500dc0..7db2b54b3 100644
--- a/src/pages/Ticket/TicketAdvance.vue
+++ b/src/pages/Ticket/TicketAdvance.vue
@@ -1,24 +1,20 @@
+watch(
+ () => vnTableRef.value.tableRef?.$el,
+ ($el) => {
+ if (!$el) return;
+ const head = $el.querySelector('thead');
+ const firstRow = $el.querySelector('thead > tr');
+ const newRow = document.createElement('tr');
+ destinationElRef.value = document.createElement('th');
+ originElRef.value = document.createElement('th');
+
+ newRow.classList.add('bg-header');
+ destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
+ originElRef.value.classList.add('text-uppercase', 'color-vn-label');
+
+ destinationElRef.value.setAttribute('colspan', '7');
+ originElRef.value.setAttribute('colspan', '9');
+
+ destinationElRef.value.textContent = `${t(
+ 'advanceTickets.destination'
+ )} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`;
+ originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat(
+ vnTableRef.value.params.dateFuture
+ )}`;
+
+ newRow.append(destinationElRef.value, originElRef.value);
+ head.insertBefore(newRow, firstRow);
+ },
+ { once: true, inmmediate: true }
+);
+
+watch(
+ () => vnTableRef.value.params,
+ () => {
+ if (originElRef.value && destinationElRef.value) {
+ destinationElRef.value.textContent = `${t(
+ 'advanceTickets.destination'
+ )} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`;
+ originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat(
+ vnTableRef.value.params.dateFuture
+ )}`;
+ }
+ },
+ { deep: true }
+);
+
{
auto-load
@on-fetch="(data) => (zonesOptions = data)"
/>
-
{
-
+
-
-
- {{ userParams.scopeDays }}
-
-
- {{ t('advanceTickets.destination') }}
- {{ toDateFormat(userParams.dateToAdvance) }}
-
-
- {{ t('advanceTickets.origin') }}
- {{ toDateFormat(userParams.dateFuture) }}
-
-
-
-
-
-
-
- {{ col.label }}
-
-
+
+
+
+
+ {{
+ t('advanceTickets.originAgency', {
+ agency: row.futureAgency,
+ })
+ }}
+
+
+ {{
+ t('advanceTickets.destinationAgency', {
+ agency: row.agency,
+ })
+ }}
+
+
+
-
-
-
-
-
-
-
+
+
+ {{ row.id }}
+
+
-
-
- {{ col.label }}
-
+
+
+ {{ row.state }}
+
+ {{ dashIfEmpty(row.state) }}
-
-
-
-
-
- {{
- t('advanceTickets.originAgency', {
- agency: row.futureAgency,
- })
- }}
-
-
- {{
- t('advanceTickets.destinationAgency', {
- agency: row.agency,
- })
- }}
-
-
-
-
+
+
+ {{ toCurrency(row.totalWithVat || 0) }}
+
-
-
-
-
- {{ row.id }}
-
-
-
+
+
+ {{ row.futureId }}
+
+
-
-
-
- {{ row.state }}
-
- {{ dashIfEmpty(row.state) }}
-
+
+
+ {{ row.futureState }}
+
-
-
-
- {{ toCurrency(row.totalWithVat || 0) }}
-
-
+
+
+ {{ toCurrency(row.futureTotalWithVat || 0) }}
+
-
-
-
- {{ row.futureId }}
-
-
-
-
-
-
-
- {{ row.futureState }}
-
-
-
-
-
-
- {{ toCurrency(row.futureTotalWithVat || 0) }}
-
-
-
-
+
{
diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue
index b25ebdea6..a1d301f35 100644
--- a/src/pages/Ticket/TicketAdvanceFilter.vue
+++ b/src/pages/Ticket/TicketAdvanceFilter.vue
@@ -11,7 +11,7 @@ import axios from 'axios';
import { onMounted } from 'vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
-const { t } = useI18n();
+const { t, te } = useI18n();
const props = defineProps({
dataKey: {
type: String,
@@ -27,20 +27,21 @@ const warehousesOptions = ref([]);
const itemPackingTypes = ref([]);
const getItemPackingTypes = async () => {
- try {
- const filter = {
- where: { isActive: true },
- };
- const { data } = await axios.get('ItemPackingTypes', {
- params: { filter: JSON.stringify(filter) },
- });
- itemPackingTypes.value = data.map((ipt) => ({
- description: t(ipt.description),
- code: ipt.code,
- }));
- } catch (error) {
- console.error(error);
- }
+ const filter = {
+ where: { isActive: true },
+ };
+ const { data } = await axios.get('ItemPackingTypes', {
+ params: { filter: JSON.stringify(filter) },
+ });
+ itemPackingTypes.value = data.map((ipt) => ({
+ description: t(ipt.description),
+ code: ipt.code,
+ }));
+};
+
+const getLocale = (val) => {
+ const param = `params.${val}`;
+ return te(param) ? t(param) : t(`globals.${param}`);
};
onMounted(async () => await getItemPackingTypes());
@@ -53,6 +54,7 @@ onMounted(async () => await getItemPackingTypes());
auto-load
/>
await getItemPackingTypes());
>
- {{ t(`params.${tag.label}`) }}:
+ {{ getLocale(tag.label) }}:
{{ formatFn(tag.value) }}
@@ -96,6 +98,7 @@ onMounted(async () => await getItemPackingTypes());
dense
outlined
rounded
+ :use-like="false"
>
@@ -113,6 +116,7 @@ onMounted(async () => await getItemPackingTypes());
dense
outlined
rounded
+ :use-like="false"
>
@@ -136,6 +140,19 @@ onMounted(async () => await getItemPackingTypes());
/>
+
+
+
+
+
{
- try {
- const filter = {
- where: { isActive: true },
- };
- const { data } = await axios.get('ItemPackingTypes', {
- params: { filter: JSON.stringify(filter) },
- });
- itemPackingTypes.value = data.map((ipt) => ({
- description: t(ipt.description),
- code: ipt.code,
- }));
- } catch (error) {
- console.error(error);
- }
+ const filter = {
+ where: { isActive: true },
+ };
+ const { data } = await axios.get('ItemPackingTypes', {
+ params: { filter: JSON.stringify(filter) },
+ });
+ itemPackingTypes.value = data.map((ipt) => ({
+ description: t(ipt.description),
+ code: ipt.code,
+ }));
};
const getGroupedStates = async () => {
- try {
- const { data } = await axios.get('AlertLevels');
- stateOptions.value = data.map((state) => ({
- id: state.id,
- name: t(`futureTickets.${state.code}`),
- code: state.code,
- }));
- } catch (error) {
- console.error(error);
- }
+ const { data } = await axios.get('AlertLevels');
+ stateOptions.value = data.map((state) => ({
+ id: state.id,
+ name: t(`futureTickets.${state.code}`),
+ code: state.code,
+ }));
};
onMounted(async () => {
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index c8687ed5f..dd1f2d69a 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -204,7 +204,7 @@ const columns = computed(() => [
action: (row) => redirectToLines(row.id),
},
{
- title: t('ticketList.summary'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary),
diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml
index b372e48ef..eab38a402 100644
--- a/src/pages/Ticket/locale/es.yml
+++ b/src/pages/Ticket/locale/es.yml
@@ -100,7 +100,7 @@ weeklyTickets:
advanceTickets:
preparation: Preparación
origin: Origen
- destination: Destinatario
+ destination: Destino
originAgency: 'Agencia origen: {agency}'
destinationAgency: 'Agencia destino: {agency}'
ticketId: ID
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index 1cb42bbfb..e3eb9ab82 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -17,6 +17,11 @@ const $props = defineProps({
required: false,
default: null,
},
+ dataKey: {
+ type: String,
+ required: false,
+ default: 'workerData',
+ },
});
const image = ref(null);
@@ -65,7 +70,7 @@ const handlePhotoUpdated = (evt = false) => {
-
+
diff --git a/src/pages/Worker/Card/WorkerNotificationsManager.vue b/src/pages/Worker/Card/WorkerNotificationsManager.vue
index 731e073cd..53571fb93 100644
--- a/src/pages/Worker/Card/WorkerNotificationsManager.vue
+++ b/src/pages/Worker/Card/WorkerNotificationsManager.vue
@@ -44,8 +44,9 @@ async function toggleNotification(notification) {
`worker.notificationsManager.${notification.active ? '' : 'un'}subscribed`
),
});
- } catch {
+ } catch (e) {
notification.active = !notification.active;
+ throw e;
}
}
diff --git a/src/pages/Zone/Card/ZoneWarehouses.vue b/src/pages/Zone/Card/ZoneWarehouses.vue
index 6b2933224..98e446797 100644
--- a/src/pages/Zone/Card/ZoneWarehouses.vue
+++ b/src/pages/Zone/Card/ZoneWarehouses.vue
@@ -34,21 +34,13 @@ const columns = computed(() => [
]);
const deleteWarehouse = async (row) => {
- try {
- await axios.delete(`${urlPath.value}/${row.id}`);
- fetchWarehouses();
- } catch (error) {
- console.error(error);
- }
+ await axios.delete(`${urlPath.value}/${row.id}`);
+ fetchWarehouses();
};
const createZoneWarehouse = async (ZoneWarehouseFormData) => {
- try {
- await axios.post(urlPath.value, ZoneWarehouseFormData);
- fetchWarehouses();
- } catch (error) {
- console.error(error);
- }
+ await axios.post(urlPath.value, ZoneWarehouseFormData);
+ fetchWarehouses();
};
watch(
diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue
index d160ea6b5..89f2dd42c 100644
--- a/src/pages/Zone/ZoneList.vue
+++ b/src/pages/Zone/ZoneList.vue
@@ -103,7 +103,7 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
- title: t('list.zoneSummary'),
+ title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ZoneSummary),
isPrimary: true,
diff --git a/src/router/modules/item.js b/src/router/modules/item.js
index 48e19dd54..2838c3be7 100644
--- a/src/router/modules/item.js
+++ b/src/router/modules/item.js
@@ -48,6 +48,28 @@ export default {
},
component: () => import('src/pages/Item/ItemList.vue'),
},
+ {
+ path: 'request',
+ name: 'ItemRequest',
+ meta: {
+ title: 'buyRequest',
+ icon: 'vn:buyrequest',
+ },
+ component: () => import('src/pages/Item/ItemRequest.vue'),
+ },
+ {
+ path: 'waste-breakdown',
+ name: 'WasteBreakdown',
+ meta: {
+ title: 'wasteBreakdown',
+ icon: 'vn:claims',
+ },
+ beforeEnter: (to, from, next) => {
+ next({ name: 'ItemList' });
+ window.location.href =
+ 'https://grafana.verdnatura.es/d/TTNXQAxVk';
+ },
+ },
{
path: 'fixed-price',
name: 'ItemFixedPrice',
@@ -65,19 +87,7 @@ export default {
},
component: () => import('src/pages/Item/ItemCreate.vue'),
},
- {
- path: 'waste-breakdown',
- name: 'WasteBreakdown',
- meta: {
- title: 'wasteBreakdown',
- icon: 'vn:claims',
- },
- beforeEnter: (to, from, next) => {
- next({ name: 'ItemList' });
- window.location.href =
- 'https://grafana.verdnatura.es/d/TTNXQAxVk';
- },
- },
+
{
path: 'item-type-list',
name: 'ItemTypeList',
@@ -95,15 +105,6 @@ export default {
},
component: () => import('src/pages/Item/ItemTypeCreate.vue'),
},
- {
- path: 'request',
- name: 'ItemRequest',
- meta: {
- title: 'buyRequest',
- icon: 'vn:buyrequest',
- },
- component: () => import('src/pages/Item/ItemRequest.vue'),
- },
],
},
{
diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js
index 423189908..8d4e90aac 100644
--- a/test/cypress/integration/outLogin/logout.spec.js
+++ b/test/cypress/integration/outLogin/logout.spec.js
@@ -13,7 +13,7 @@ describe('Logout', () => {
});
describe('not user', () => {
beforeEach(() => {
- cy.intercept('GET', '**/VnUsers/acl', {
+ cy.intercept('GET', '**DefaultViewConfigs**', {
statusCode: 401,
body: {
error: {
@@ -24,10 +24,11 @@ describe('Logout', () => {
},
},
statusMessage: 'AUTHORIZATION_REQUIRED',
- }).as('someRoute');
+ });
});
+
it('when token not exists', () => {
- cy.reload();
+ cy.get('.q-list > [href="#/item"]').click();
cy.get('.q-notification__message').should(
'have.text',
'Authorization Required'
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 353c5805b..6a3cab664 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -7,31 +7,20 @@ describe('AgencyWorkCenter', () => {
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
const workCenterCombobox = 'input[role="combobox"]';
- it('assign workCenter', () => {
+ it('check workCenter crud', () => {
+ // create
cy.get(createButton).click();
cy.get(workCenterCombobox).type('workCenterOne{enter}');
- cy.get('.q-notification__message').should('have.text', 'Data created');
- });
+ cy.hasNotify('Data created');
- it('delete workCenter', () => {
+ // expect error when duplicate
+ cy.get(createButton).click();
+ cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.hasNotify('This workCenter is already assigned to this agency');
+ cy.get('[data-cy="FormModelPopup_cancel"]').click();
+
+ // delete
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
- cy.get('.q-notification__message').should(
- 'have.text',
- 'WorkCenter removed successfully'
- );
- });
-
- it('error on duplicate workCenter', () => {
- cy.get(createButton).click();
- cy.get(workCenterCombobox).type('workCenterOne{enter}');
- cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.get(createButton).click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
-
- cy.get(
- ':nth-child(2) > .q-notification__wrapper > .q-notification__content > .q-notification__message'
- ).should('have.text', 'This workCenter is already assigned to this agency');
+ cy.hasNotify('WorkCenter removed successfully');
});
});
diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js
new file mode 100644
index 000000000..5eb2c1a2a
--- /dev/null
+++ b/test/cypress/integration/ticket/ticketExpedition.spec.js
@@ -0,0 +1,28 @@
+///
+
+describe('Ticket expedtion', () => {
+ const tableContent = '.q-table .q-virtual-scroll__content';
+ const stateTd = 'td:nth-child(9)';
+
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ });
+
+ it('should change the state', () => {
+ cy.visit('#/ticket/1/expedition');
+ cy.intercept('GET', /\/api\/Expeditions\/filter/).as('expeditions');
+ cy.intercept('POST', /\/api\/Expeditions\/crud/).as('crud');
+
+ cy.wait('@expeditions');
+
+ cy.selectRows([1, 2]);
+ cy.get('#subToolbar [aria-controls]:nth-child(1)').click();
+ cy.get('.q-menu .q-item').contains('Perdida').click();
+ cy.wait('@crud');
+
+ cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
+ cy.wrap($el).contains('Perdida');
+ });
+ });
+});
diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js
index ac452c4ff..367287a5a 100644
--- a/test/cypress/integration/worker/workerNotificationsManager.spec.js
+++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js
@@ -17,10 +17,7 @@ describe('WorkerNotificationsManager', () => {
cy.login('developer');
cy.visit(`/#/worker/${salesPersonId}/notifications`);
cy.get(firstAvailableNotification).click();
- cy.notificationHas(
- '.q-notification__message',
- 'The notification subscription of this worker cant be modified'
- );
+ cy.hasNotify('The notification subscription of this worker cant be modified');
});
it('should active a notification that is yours', () => {
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 33dfa85df..dcfb54a3e 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -152,6 +152,14 @@ Cypress.Commands.add('notificationHas', (selector, text) => {
cy.get(selector).should('have.text', text);
});
+Cypress.Commands.add('selectRows', (rows) => {
+ rows.forEach((row) => {
+ cy.get('.q-table .q-virtual-scroll__content tr .q-checkbox__inner')
+ .eq(row - 1)
+ .click();
+ });
+});
+
Cypress.Commands.add('fillRow', (rowSelector, data) => {
// Usar el selector proporcionado para obtener la fila deseada
cy.waitForElement('tbody');
@@ -278,3 +286,14 @@ Cypress.Commands.add('checkNotification', (type) => {
Cypress.Commands.add('searchByLabel', (label, value) => {
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
});
+
+Cypress.Commands.add('hasNotify', (text) => {
+ //last
+ cy.get('.q-notification')
+ .should('be.visible')
+ .last()
+ .then(($lastNotification) => {
+ if (!Cypress.$($lastNotification).text().includes(text))
+ throw new Error(`Notification not found: "${text}"`);
+ });
+});
diff --git a/test/vitest/__tests__/boot/axios.spec.js b/test/vitest/__tests__/boot/axios.spec.js
index 7a802b4d2..19d396ec5 100644
--- a/test/vitest/__tests__/boot/axios.spec.js
+++ b/test/vitest/__tests__/boot/axios.spec.js
@@ -36,8 +36,6 @@ describe('Axios boot', () => {
describe('onResponseError()', async () => {
it('should call to the Notify plugin with a message error for an status code "500"', async () => {
- Notify.create = vi.fn();
-
const error = {
response: {
status: 500,
@@ -45,19 +43,10 @@ describe('Axios boot', () => {
};
const result = onResponseError(error);
-
expect(result).rejects.toEqual(expect.objectContaining(error));
- expect(Notify.create).toHaveBeenCalledWith(
- expect.objectContaining({
- message: 'An internal server error has ocurred',
- type: 'negative',
- })
- );
});
it('should call to the Notify plugin with a message from the response property', async () => {
- Notify.create = vi.fn();
-
const error = {
response: {
status: 401,
@@ -70,14 +59,7 @@ describe('Axios boot', () => {
};
const result = onResponseError(error);
-
expect(result).rejects.toEqual(expect.objectContaining(error));
- expect(Notify.create).toHaveBeenCalledWith(
- expect.objectContaining({
- message: 'Invalid user or password',
- type: 'negative',
- })
- );
});
});
});