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/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue
index f6013dea9..e9bb36be7 100644
--- a/src/pages/Customer/components/CustomerSummaryTable.vue
+++ b/src/pages/Customer/components/CustomerSummaryTable.vue
@@ -101,7 +101,7 @@ const columns = computed(() => [
align: 'left',
name: 'itemPackingTypeFk',
label: t('ticketSale.packaging'),
- format: (row) => getItemPackagingType(row),
+ format: (row) => getItemPackagingType(row.ticketSales),
},
{
align: 'right',
@@ -151,13 +151,21 @@ const setShippedColor = (date) => {
if (difference < 0) return 'success';
};
-const getItemPackagingType = (row) => {
- const packagingType = row?.ticketSales
- .map((sale) => sale.item?.itemPackingTypeFk || '-')
- .filter((value) => value !== '-')
- .join(', ');
+const getItemPackagingType = (ticketSales) => {
+ if (!ticketSales?.length) return '-';
- return dashIfEmpty(packagingType);
+ const packagingTypes = ticketSales.reduce((types, sale) => {
+ const { itemPackingTypeFk } = sale.item;
+ if (
+ !types.includes(itemPackingTypeFk) &&
+ (itemPackingTypeFk === 'H' || itemPackingTypeFk === 'V')
+ ) {
+ types.push(itemPackingTypeFk);
+ }
+ return types;
+ }, []);
+
+ return dashIfEmpty(packagingTypes.join(', ') || '-');
};
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index 61c430b23..119808176 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -23,7 +23,6 @@ const columns = [
return {
id: row.id,
size: '50x50',
- width: '50px',
};
},
},
@@ -34,21 +33,37 @@ const columns = [
label: t('entry.latestBuys.tableVisibleColumns.itemFk'),
name: 'itemFk',
isTitle: true,
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.packing'),
name: 'packing',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.grouping'),
name: 'grouping',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.quantity'),
name: 'quantity',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
@@ -59,6 +74,10 @@ const columns = [
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.size'),
name: 'size',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
@@ -84,6 +103,10 @@ const columns = [
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'),
name: 'weightByPiece',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
@@ -99,26 +122,46 @@ const columns = [
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.entryFk'),
name: 'entryFk',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.buyingValue'),
name: 'buyingValue',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.freightValue'),
name: 'freightValue',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.comissionValue'),
name: 'comissionValue',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.packageValue'),
name: 'packageValue',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
@@ -129,16 +172,28 @@ const columns = [
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.price2'),
name: 'price2',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.price3'),
name: 'price3',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.minPrice'),
name: 'minPrice',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
@@ -149,11 +204,19 @@ const columns = [
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.weight'),
name: 'weight',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
label: t('entry.latestBuys.tableVisibleColumns.packagingFk'),
name: 'packagingFk',
+ columnFilter: {
+ component: 'number',
+ inWhere: true,
+ },
},
{
align: 'left',
diff --git a/src/pages/Item/Card/ItemBasicData.vue b/src/pages/Item/Card/ItemBasicData.vue
index ae9e45983..1b0342668 100644
--- a/src/pages/Item/Card/ItemBasicData.vue
+++ b/src/pages/Item/Card/ItemBasicData.vue
@@ -63,7 +63,7 @@ const onIntrastatCreated = (response, formData) => {
{
-
-
-
-
-
+
+
+
+
+
{
{
{
-
-
+
+
- {{ 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 25082697d..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 }}
-
-
-
-
-
-
-
-
-
- {{ scope.opt?.name }}
- {{ scope.opt?.nickname }},
- {{ scope.opt?.code }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ 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/ItemType/Card/ItemTypeBasicData.vue b/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue
similarity index 68%
rename from src/pages/ItemType/Card/ItemTypeBasicData.vue
rename to src/pages/Item/ItemType/Card/ItemTypeBasicData.vue
index 1d4a5cf94..1a4a7c9f3 100644
--- a/src/pages/ItemType/Card/ItemTypeBasicData.vue
+++ b/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue
@@ -8,12 +8,14 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
+import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const categoriesOptions = ref([]);
const temperaturesOptions = ref([]);
+const itemPackingTypesOptions = ref([]);
+ (itemPackingTypesOptions = data)"
+ :filter="{
+ where: { isActive: true },
+ order: 'description ASC',
+ fields: ['code', 'description'],
+ }"
+ auto-load
+ />
+ >
+
+
+
+
{{ scope.opt?.name }}
@@ -80,6 +99,21 @@ const temperaturesOptions = ref([]);
option-label="name"
hide-selected
/>
+
+
+
+
+
+
+
+
diff --git a/src/pages/ItemType/Card/ItemTypeCard.vue b/src/pages/Item/ItemType/Card/ItemTypeCard.vue
similarity index 75%
rename from src/pages/ItemType/Card/ItemTypeCard.vue
rename to src/pages/Item/ItemType/Card/ItemTypeCard.vue
index 9daec7921..0a2706a07 100644
--- a/src/pages/ItemType/Card/ItemTypeCard.vue
+++ b/src/pages/Item/ItemType/Card/ItemTypeCard.vue
@@ -1,7 +1,7 @@
diff --git a/src/pages/ItemType/Card/ItemTypeDescriptor.vue b/src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue
similarity index 100%
rename from src/pages/ItemType/Card/ItemTypeDescriptor.vue
rename to src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue
diff --git a/src/pages/Item/ItemType/Card/ItemTypeLog.vue b/src/pages/Item/ItemType/Card/ItemTypeLog.vue
new file mode 100644
index 000000000..b3f7a6597
--- /dev/null
+++ b/src/pages/Item/ItemType/Card/ItemTypeLog.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/src/pages/ItemType/Card/ItemTypeSummary.vue b/src/pages/Item/ItemType/Card/ItemTypeSummary.vue
similarity index 100%
rename from src/pages/ItemType/Card/ItemTypeSummary.vue
rename to src/pages/Item/ItemType/Card/ItemTypeSummary.vue
diff --git a/src/pages/ItemType/ItemTypeFilter.vue b/src/pages/Item/ItemType/ItemTypeFilter.vue
similarity index 57%
rename from src/pages/ItemType/ItemTypeFilter.vue
rename to src/pages/Item/ItemType/ItemTypeFilter.vue
index 2a86795c2..f6fb73098 100644
--- a/src/pages/ItemType/ItemTypeFilter.vue
+++ b/src/pages/Item/ItemType/ItemTypeFilter.vue
@@ -12,6 +12,39 @@ const props = defineProps({
});
const emit = defineEmits(['search']);
+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}%`,
+ },
+ },
+ ],
+ };
+ }
+ }
+ }
+};
@@ -19,6 +52,8 @@ const emit = defineEmits(['search']);
:data-key="props.dataKey"
:search-button="true"
@search="emit('search')"
+ search-url="table"
+ :expr-builder="exprBuilder"
>
diff --git a/src/pages/ItemType/ItemTypeSearchbar.vue b/src/pages/Item/ItemType/ItemTypeSearchbar.vue
similarity index 94%
rename from src/pages/ItemType/ItemTypeSearchbar.vue
rename to src/pages/Item/ItemType/ItemTypeSearchbar.vue
index 749033d43..87903a517 100644
--- a/src/pages/ItemType/ItemTypeSearchbar.vue
+++ b/src/pages/Item/ItemType/ItemTypeSearchbar.vue
@@ -10,6 +10,7 @@ const { t } = useI18n();
url="ItemTypes"
:label="t('Search item type')"
:info="t('Search itemType by id, name or code')"
+ search-url="table"
/>
diff --git a/src/pages/ItemType/locale/en.yml b/src/pages/Item/ItemType/locale/en.yml
similarity index 69%
rename from src/pages/ItemType/locale/en.yml
rename to src/pages/Item/ItemType/locale/en.yml
index 7889418ea..575d5e402 100644
--- a/src/pages/ItemType/locale/en.yml
+++ b/src/pages/Item/ItemType/locale/en.yml
@@ -4,6 +4,10 @@ shared:
worker: Worker
category: Category
temperature: Temperature
+ life: Life
+ itemPackingType: Item packing type
+ maxRefs: Maximum references
+ fragile: Fragile
summary:
id: id
life: Life
diff --git a/src/pages/ItemType/locale/es.yml b/src/pages/Item/ItemType/locale/es.yml
similarity index 77%
rename from src/pages/ItemType/locale/es.yml
rename to src/pages/Item/ItemType/locale/es.yml
index 9a94dceb6..09ee5a1f7 100644
--- a/src/pages/ItemType/locale/es.yml
+++ b/src/pages/Item/ItemType/locale/es.yml
@@ -4,6 +4,10 @@ shared:
worker: Trabajador
category: Reino
temperature: Temperatura
+ life: Vida
+ itemPackingType: Tipo de embalaje
+ maxRefs: Referencias máximas
+ fragile: Frágil
summary:
id: id
code: Código
diff --git a/src/pages/Item/ItemTypeCreate.vue b/src/pages/Item/ItemTypeCreate.vue
deleted file mode 100644
index 60c037510..000000000
--- a/src/pages/Item/ItemTypeCreate.vue
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
- (categoriesOptions = data)"
- :filter="{ order: 'name ASC', fields: ['id', 'name'] }"
- auto-load
- />
- (temperaturesOptions = data)"
- :filter="{ order: 'name ASC', fields: ['code', 'name'] }"
- auto-load
- />
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.opt?.name }}
- {{ scope.opt?.nickname }},
- {{ scope.opt?.code }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue
index d874a5dcb..149de482d 100644
--- a/src/pages/Item/ItemTypeList.vue
+++ b/src/pages/Item/ItemTypeList.vue
@@ -1,113 +1,159 @@
-
+ (itemCategoriesOptions = data)"
+ auto-load
+ />
+ (temperatureOptions = 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/Parking/Card/ParkingCard.vue b/src/pages/Parking/Card/ParkingCard.vue
index ad37eb630..337106986 100644
--- a/src/pages/Parking/Card/ParkingCard.vue
+++ b/src/pages/Parking/Card/ParkingCard.vue
@@ -2,17 +2,11 @@
import VnCard from 'components/common/VnCard.vue';
import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue';
import ParkingFilter from 'pages/Parking/ParkingFilter.vue';
-
-const filter = {
- fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
- include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
-};
diff --git a/src/pages/Parking/ParkingList.vue b/src/pages/Parking/ParkingList.vue
index b6f4e8146..109613383 100644
--- a/src/pages/Parking/ParkingList.vue
+++ b/src/pages/Parking/ParkingList.vue
@@ -22,7 +22,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
- include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
};
function exprBuilder(param, value) {
@@ -55,10 +54,9 @@ function exprBuilder(param, value) {
diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue
index 5ad349942..4a691dbef 100644
--- a/src/pages/Route/RouteAutonomous.vue
+++ b/src/pages/Route/RouteAutonomous.vue
@@ -126,7 +126,7 @@ const columns = computed(() => [
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/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
index 834fced87..bf4a1efb4 100644
--- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue
+++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
@@ -348,7 +348,6 @@ async function hasDocuware() {
}
async function uploadDocuware(force) {
- console.log('force: ', force);
if (!force)
return quasar
.dialog({
diff --git a/src/pages/Ticket/Card/TicketExpedition.vue b/src/pages/Ticket/Card/TicketExpedition.vue
index 93749ebec..d682d0408 100644
--- a/src/pages/Ticket/Card/TicketExpedition.vue
+++ b/src/pages/Ticket/Card/TicketExpedition.vue
@@ -163,16 +163,12 @@ const showNewTicketDialog = (withRoute = false) => {
};
const deleteExpedition = async () => {
- try {
- const expeditionIds = selectedRows.value.map((expedition) => expedition.id);
- const params = { expeditionIds };
- await axios.post('Expeditions/deleteExpeditions', params);
- vnTableRef.value.reload();
- selectedExpeditions.value = [];
- notify(t('expedition.expeditionRemoved'), 'positive');
- } catch (error) {
- console.error(error);
- }
+ const expeditionIds = selectedRows.value.map((expedition) => expedition.id);
+ const params = { expeditionIds };
+ await axios.post('Expeditions/deleteExpeditions', params);
+ vnTableRef.value.reload();
+ selectedExpeditions.value = [];
+ notify(t('expedition.expeditionRemoved'), 'positive');
};
const showLog = async (expedition) => {
@@ -181,29 +177,19 @@ const showLog = async (expedition) => {
};
const getExpeditionState = async (expedition) => {
- try {
- const filter = {
- where: { expeditionFk: expedition.id },
- order: ['created DESC'],
- };
+ const filter = {
+ where: { expeditionFk: expedition.id },
+ order: ['created DESC'],
+ };
- const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
- params: { filter: JSON.stringify(filter) },
- });
- const { data: scannedStates } = await axios.get(`ExpeditionStates`, {
- params: { filter: JSON.stringify(filter), fields: ['id', 'isScanned'] },
- });
+ const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
+ params: { filter: JSON.stringify(filter) },
+ });
- expeditionsLogsData.value = expeditionStates.map((state) => {
- const scannedState = scannedStates.find((s) => s.id === state.id);
- return {
- ...state,
- isScanned: scannedState ? scannedState.isScanned : false,
- };
- });
- } catch (error) {
- console.error(error);
- }
+ expeditionsLogsData.value = expeditionStates.map((state) => ({
+ ...state,
+ isScanned: !!state.isScanned,
+ }));
};
onMounted(async () => {
@@ -225,22 +211,24 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@@ -309,7 +297,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
'row-key': 'id',
selection: 'multiple',
}"
- save-url="Expeditions/crud"
auto-load
:expr-builder="
(param, value) => {
@@ -355,11 +342,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
- {{
- row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
- }}
-
+
diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue
index c786c67e3..8b84a0463 100644
--- a/src/pages/Ticket/Card/TicketSale.vue
+++ b/src/pages/Ticket/Card/TicketSale.vue
@@ -539,6 +539,7 @@ watch(
:ticket-config="ticketConfig"
@get-mana="getMana()"
@update-discounts="updateDiscount"
+ @refresh-table="resetChanges"
/>
{
await axios.post(`Sales/recalculatePrice`, props.sales);
notify(t('globals.dataSaved'), 'positive');
+ emit('refreshTable', props.sales);
};
const changeMultipleDiscount = () => {
@@ -165,14 +166,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/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 7ac602679..bdd980c07 100644
--- a/src/pages/Ticket/TicketAdvance.vue
+++ b/src/pages/Ticket/TicketAdvance.vue
@@ -1,24 +1,19 @@
+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 21587dab3..a1d301f35 100644
--- a/src/pages/Ticket/TicketAdvanceFilter.vue
+++ b/src/pages/Ticket/TicketAdvanceFilter.vue
@@ -27,20 +27,16 @@ 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) => {
@@ -58,6 +54,7 @@ onMounted(async () => await getItemPackingTypes());
auto-load
/>
await getItemPackingTypes());
dense
outlined
rounded
+ :use-like="false"
>
@@ -118,6 +116,7 @@ onMounted(async () => await getItemPackingTypes());
dense
outlined
rounded
+ :use-like="false"
>
diff --git a/src/pages/Ticket/TicketFutureFilter.vue b/src/pages/Ticket/TicketFutureFilter.vue
index 6345f62b3..ffe967272 100644
--- a/src/pages/Ticket/TicketFutureFilter.vue
+++ b/src/pages/Ticket/TicketFutureFilter.vue
@@ -24,33 +24,25 @@ const itemPackingTypes = ref([]);
const stateOptions = 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 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/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index d131fea3e..6a13e3f39 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -1,5 +1,5 @@
-
{
+ Object.assign(data, advancedSummary);
+ }
+ "
>
@@ -134,7 +130,7 @@ const workerFilter = {
-
+
{
-
+
diff --git a/src/pages/Worker/Card/WorkerLocker.vue b/src/pages/Worker/Card/WorkerLocker.vue
index 4a19e472c..015bced35 100644
--- a/src/pages/Worker/Card/WorkerLocker.vue
+++ b/src/pages/Worker/Card/WorkerLocker.vue
@@ -18,7 +18,7 @@ const { store } = useArrayData('Worker');
const entityId = computed(() => useRoute().params.id);
const filter = computed(() => ({
where: {
- gender: store.data?.sex,
+ gender: store.data?.[0]?.sex,
or: [{ workerFk: null }, { workerFk: entityId.value }],
},
}));
@@ -51,6 +51,7 @@ const init = async (data) => {
>
$props.id || route.params.id);
const basicDataUrl = ref(null);
-const isHr = computed(() => useRole().hasAny(['hr']));
const advancedSummary = ref();
onBeforeMount(async () => {
- if (isHr.value) {
- advancedSummary.value = (
- await axios.get('Workers/advancedSummary', {
- params: { filter: { where: { id: entityId.value } } },
- })
- ).data[0];
- basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
- }
+ advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
+ basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
});
@@ -45,7 +37,7 @@ onBeforeMount(async () => {
ref="summary"
:url="`Workers/summary`"
:filter="{ where: { id: entityId } }"
- data-key="WorkerSummary"
+ data-key="Worker"
>
{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}
@@ -101,21 +93,27 @@ onBeforeMount(async () => {
:label="t('worker.summary.seniority')"
:value="toDate(worker.seniority)"
/>
-
-
+
+
+
-
diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue
index 7a3f760bc..022cecdc6 100644
--- a/src/pages/Worker/WorkerList.vue
+++ b/src/pages/Worker/WorkerList.vue
@@ -169,7 +169,7 @@ async function autofillBic(worker) {
@@ -191,13 +191,13 @@ async function autofillBic(worker) {
/>
-
+
describe('ParkingList', () => {
+ const searchbar = '#searchbar input';
const firstCard = '.q-card:nth-child(1)';
const firstChipId =
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
@@ -14,6 +15,7 @@ describe('ParkingList', () => {
});
it('should redirect on clicking a parking', () => {
+ cy.get(searchbar).type('{enter}');
cy.get(firstChipId)
.invoke('text')
.then((content) => {
@@ -24,6 +26,7 @@ describe('ParkingList', () => {
});
it('should open the details', () => {
+ cy.get(searchbar).type('{enter}');
cy.get(firstDetailBtn).click();
cy.get(summaryHeader).contains('Basic data');
});
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 353c5805b..fdfcd4286 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.checkNotification('Data created');
- it('delete workCenter', () => {
+ // expect error when duplicate
+ cy.get(createButton).click();
+ cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.checkNotification('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.checkNotification('WorkCenter removed successfully');
});
});
diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js
index 5eb2c1a2a..d4afd401f 100644
--- a/test/cypress/integration/ticket/ticketExpedition.spec.js
+++ b/test/cypress/integration/ticket/ticketExpedition.spec.js
@@ -11,15 +11,13 @@ describe('Ticket expedtion', () => {
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.intercept('GET', /\/api\/Expeditions\/filter/).as('show');
+ cy.intercept('POST', /\/api\/ExpeditionStates\/addExpeditionState/).as('add');
+ cy.wait('@show');
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.selectOption('[data-cy="change-state"]', 'Perdida');
+ cy.wait('@add');
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
cy.wrap($el).contains('Perdida');
diff --git a/test/cypress/integration/worker/workerList.spec.js b/test/cypress/integration/worker/workerList.spec.js
index 8a8bea443..c1c37fd32 100644
--- a/test/cypress/integration/worker/workerList.spec.js
+++ b/test/cypress/integration/worker/workerList.spec.js
@@ -11,7 +11,7 @@ describe('WorkerList', () => {
it('should open the worker summary', () => {
cy.get(inputName).type('jessica{enter}');
cy.get(searchBtn).click();
- cy.intercept('GET', /\/api\/Workers\/\d+/).as('worker');
+ cy.intercept('GET', /\/api\/Workers\/summary+/).as('worker');
cy.wait('@worker').then(() =>
cy.get(descriptorTitle).should('include.text', 'Jessica')
);
diff --git a/test/cypress/integration/worker/workerLocker.spec.js b/test/cypress/integration/worker/workerLocker.spec.js
index 8a169dfb2..c222414fd 100644
--- a/test/cypress/integration/worker/workerLocker.spec.js
+++ b/test/cypress/integration/worker/workerLocker.spec.js
@@ -1,8 +1,7 @@
describe('WorkerLocker', () => {
const productionId = 49;
- const lockerCode = '2F';
- const input = '.q-card input';
- const thirdOpt = '[role="listbox"] .q-item:nth-child(1)';
+ const lockerCode = '4F';
+ const lockerSelect = '[data-cy="locker"]';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('productionBoss');
@@ -10,10 +9,8 @@ describe('WorkerLocker', () => {
});
it('should allocates a locker', () => {
- cy.get(input).click();
- cy.waitForElement('[role="listbox"]');
- cy.get(thirdOpt).click();
+ cy.selectOption(lockerSelect, lockerCode);
cy.saveCard();
- cy.get(input).invoke('val').should('eq', lockerCode);
+ cy.get(lockerSelect).invoke('val').should('eq', lockerCode);
});
});
diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js
index ac452c4ff..f121b3894 100644
--- a/test/cypress/integration/worker/workerNotificationsManager.spec.js
+++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js
@@ -17,8 +17,7 @@ describe('WorkerNotificationsManager', () => {
cy.login('developer');
cy.visit(`/#/worker/${salesPersonId}/notifications`);
cy.get(firstAvailableNotification).click();
- cy.notificationHas(
- '.q-notification__message',
+ cy.checkNotification(
'The notification subscription of this worker cant be modified'
);
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 8d48dc71a..76bdefd27 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -82,7 +82,7 @@ Cypress.Commands.add('getValue', (selector) => {
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option) => {
cy.waitForElement(selector);
- cy.get(selector).find('.q-select__dropdown-icon').click();
+ cy.get(selector).click();
cy.get('.q-menu .q-item').contains(option).click();
});
@@ -253,6 +253,13 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
+Cypress.Commands.add('openActionDescriptor', (opt) => {
+ cy.openActionsDescriptor();
+ const listItem = '[role="menu"] .q-list .q-item';
+ cy.contains(listItem, opt).click();
+ 1;
+});
+
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
});
@@ -262,3 +269,21 @@ Cypress.Commands.add('openUserPanel', () => {
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
).click();
});
+
+Cypress.Commands.add('openActions', (row) => {
+ cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
+});
+
+Cypress.Commands.add('checkNotification', (text) => {
+ cy.get('.q-notification')
+ .should('be.visible')
+ .last()
+ .then(($lastNotification) => {
+ if (!Cypress.$($lastNotification).text().includes(text))
+ throw new Error(`Notification not found: "${text}"`);
+ });
+});
+
+Cypress.Commands.add('searchByLabel', (label, value) => {
+ cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
+});
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',
- })
- );
});
});
});