diff --git a/src/pages/Wagon/Card/WagonCard.vue b/src/pages/Wagon/Card/WagonCard.vue
index 644a30ffa..1694dad7b 100644
--- a/src/pages/Wagon/Card/WagonCard.vue
+++ b/src/pages/Wagon/Card/WagonCard.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue
index e716686d1..16c5fca63 100644
--- a/src/pages/Wagon/WagonList.vue
+++ b/src/pages/Wagon/WagonList.vue
@@ -8,6 +8,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import { computed, ref } from 'vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
+import VnSection from 'src/components/common/VnSection.vue';
const quasar = useQuasar();
const arrayData = useArrayData('WagonList');
@@ -15,6 +16,7 @@ const store = arrayData.store;
const router = useRouter();
const { t } = useI18n();
const tableRef = ref();
+const dataKey = 'WagonList';
const filter = {
include: {
relation: 'type',
@@ -75,101 +77,110 @@ function navigate(id) {
}
async function remove(row) {
- try {
- await axios.delete(`Wagons/${row.id}`).then(async () => {
- quasar.notify({
- message: t('wagon.list.removeItem'),
- type: 'positive',
- });
- store.data.splice(store.data.indexOf(row), 1);
- window.location.reload();
+ await axios.delete(`Wagons/${row.id}`).then(async () => {
+ quasar.notify({
+ message: t('wagon.list.removeItem'),
+ type: 'positive',
});
- } catch (error) {
- //
- }
+ store.data.splice(store.data.indexOf(row), 1);
+ window.location.reload();
+ });
}
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ t('wagon.warnings.noData') }}
+
+
+
+
-
-
-
- {{ t('wagon.warnings.noData') }}
-
-
-
-
+
-
+
es:
Create new wagon: Crear nuevo vagón
-
\ No newline at end of file
+
diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js
index 4a322d305..798c671eb 100644
--- a/src/router/modules/wagon.js
+++ b/src/router/modules/wagon.js
@@ -1,52 +1,60 @@
import { RouterView } from 'vue-router';
+const wagonCard = {
+ name: 'WagonCard',
+ path: ':id',
+ component: () => import('src/pages/Wagon/Card/WagonCard.vue'),
+ redirect: { name: 'WagonEdit' },
+ meta: {
+ menu: ['WagonEdit'],
+ },
+ children: [
+ {
+ path: 'edit',
+ name: 'WagonEdit',
+ meta: {
+ title: 'wagonEdit',
+ icon: 'edit',
+ },
+ component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ },
+ ],
+};
+
export default {
- path: '/wagon',
name: 'Wagon',
+ path: '/wagon',
meta: {
title: 'wagons',
icon: 'vn:trolley',
moduleName: 'Wagon',
+ menu: ['WagonList', 'WagonTypeList', 'WagonCounter'],
},
component: RouterView,
redirect: { name: 'WagonMain' },
- menus: {
- main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
- card: [],
- },
children: [
{
- path: '/wagon',
+ path: '',
name: 'WagonMain',
component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonList' },
+ redirect: { name: 'WagonIndexMain' },
children: [
{
- path: 'list',
- name: 'WagonList',
- meta: {
- title: 'list',
- icon: 'vn:trolley',
- },
+ path: '',
+ name: 'WagonIndexMain',
+ redirect: { name: 'WagonList' },
component: () => import('src/pages/Wagon/WagonList.vue'),
- },
- {
- path: 'create',
- name: 'WagonCreate',
- meta: {
- title: 'wagonCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonEdit',
- meta: {
- title: 'wagonEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ children: [
+ {
+ name: 'WagonList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ wagonCard,
+ ],
},
{
path: 'counter',
@@ -57,40 +65,32 @@ export default {
},
component: () => import('src/pages/Wagon/WagonCounter.vue'),
},
- ],
- },
- {
- path: '/wagon/type',
- name: 'WagonTypeMain',
- component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonTypeList' },
- children: [
{
- path: 'list',
- name: 'WagonTypeList',
- meta: {
- title: 'typesList',
- icon: 'view_list',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: 'create',
- name: 'WagonTypeCreate',
- meta: {
- title: 'typeCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonTypeEdit',
- meta: {
- title: 'typeEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ path: 'type',
+ name: 'WagonTypeMain',
+ redirect: { name: 'WagonTypeList' },
+ children: [
+ {
+ path: 'list',
+ name: 'WagonTypeList',
+ meta: {
+ title: 'typesList',
+ icon: 'view_list',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeList.vue'),
+ },
+ {
+ path: ':id/edit',
+ name: 'WagonTypeEdit',
+ meta: {
+ title: 'typeEdit',
+ icon: 'edit',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ },
+ ],
},
],
},
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index 6d185ea69..88855fdf9 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -1,4 +1,4 @@
-describe.skip('WagonCreate', () => {
+describe('WagonCreate', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -17,7 +17,7 @@ describe.skip('WagonCreate', () => {
'.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]',
).type('100');
cy.selectOption('[data-cy="Type_select"]', '1');
-
+ cy.dataCy('FormModelPopup_save').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});
diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
index 49d7d9f01..915927a6d 100644
--- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
@@ -2,7 +2,7 @@ describe('WagonTypeCreate', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit('/#/wagon/type/create');
+ cy.visit('/#/wagon/type/list');
cy.waitForElement('.q-page', 6000);
});