diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index f7f07a5b0..94adfe0ff 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'; import VnInput from 'components/common/VnInput.vue'; import FetchData from 'components/FetchData.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue'; import axios from 'axios'; @@ -207,7 +207,7 @@ const removeTag = (index, params, search) => { - { - + @@ -246,7 +246,7 @@ const removeTag = (index, params, search) => { class="q-mt-md filter-value" > - { /> - +import VnPaginate from 'src/components/ui/VnPaginate.vue'; +import CardList from 'src/components/ui/CardList.vue'; +import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; +import { useStateStore } from 'stores/useStateStore'; +import { useRouter } from 'vue-router'; +import { useI18n } from 'vue-i18n'; + +const { t } = useI18n(); +const router = useRouter(); +const stateStore = useStateStore(); +function navigate(id) { + router.push({ path: `/agency/${id}` }); +} +function exprBuilder(param, value) { + if (!value) return; + if (param !== 'search') return; + + if (!isNaN(value)) return { id: value }; + + return { name: { like: `%${value}%` } }; +} + + + + es: + isOwn: Tiene propietario + isAnyVolumeAllowed: Permite cualquier volumen + Search agency: Buscar agencia + You can search by name: Puedes buscar por nombre + en: + isOwn: Has owner + isAnyVolumeAllowed: Allows any volume + diff --git a/src/pages/Agency/Card/AgencyBasicData.vue b/src/pages/Agency/Card/AgencyBasicData.vue new file mode 100644 index 000000000..599058b3e --- /dev/null +++ b/src/pages/Agency/Card/AgencyBasicData.vue @@ -0,0 +1,52 @@ + + diff --git a/src/pages/Agency/Card/AgencyCard.vue b/src/pages/Agency/Card/AgencyCard.vue new file mode 100644 index 000000000..e78d1cc55 --- /dev/null +++ b/src/pages/Agency/Card/AgencyCard.vue @@ -0,0 +1,35 @@ + + diff --git a/src/pages/Agency/Card/AgencyDescriptor.vue b/src/pages/Agency/Card/AgencyDescriptor.vue new file mode 100644 index 000000000..0fa89d07d --- /dev/null +++ b/src/pages/Agency/Card/AgencyDescriptor.vue @@ -0,0 +1,35 @@ + + diff --git a/src/pages/Agency/Card/AgencyLog.vue b/src/pages/Agency/Card/AgencyLog.vue new file mode 100644 index 000000000..d4769a676 --- /dev/null +++ b/src/pages/Agency/Card/AgencyLog.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/Agency/Card/AgencyModes.vue b/src/pages/Agency/Card/AgencyModes.vue new file mode 100644 index 000000000..4fb81914a --- /dev/null +++ b/src/pages/Agency/Card/AgencyModes.vue @@ -0,0 +1,60 @@ + + + + es: + isOwn: Tiene propietario + isAnyVolumeAllowed: Permite cualquier volumen + Search agency: Buscar agencia + You can search by name: Puedes buscar por nombre + deliveryMethod: Método de entrega + inflation: Inflación + en: + isOwn: Has owner + isAnyVolumeAllowed: Allows any volume + diff --git a/src/pages/Agency/Card/AgencySummary.vue b/src/pages/Agency/Card/AgencySummary.vue new file mode 100644 index 000000000..a4a6a2a18 --- /dev/null +++ b/src/pages/Agency/Card/AgencySummary.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/pages/Agency/Card/AgencyWorkcenter.vue b/src/pages/Agency/Card/AgencyWorkcenter.vue new file mode 100644 index 000000000..f5beaab53 --- /dev/null +++ b/src/pages/Agency/Card/AgencyWorkcenter.vue @@ -0,0 +1,136 @@ + + + + + es: + workCenter removed successfully: Centro de trabajo eliminado correctamente + This workCenter is already assigned to this agency: Este workCenter ya está asignado a esta agencia + Add work center: Añadir centro de trabajo + workCenter: Centro de trabajo + diff --git a/src/pages/Agency/locale/en.yml b/src/pages/Agency/locale/en.yml new file mode 100644 index 000000000..3cc3d69e8 --- /dev/null +++ b/src/pages/Agency/locale/en.yml @@ -0,0 +1,11 @@ +agency: + isOwn: Own + isAnyVolumeAllowed: Any volume allowed + notification: + removeItemError: Error removing agency + removeItem: WorkCenter removed successfully + pageTitles: + agency: Agency + searchBar: + info: You can search by agency code + label: Search agency... diff --git a/src/pages/Agency/locale/es.yml b/src/pages/Agency/locale/es.yml new file mode 100644 index 000000000..2607472bd --- /dev/null +++ b/src/pages/Agency/locale/es.yml @@ -0,0 +1,12 @@ +agency: + isOwn: Propio + isAnyVolumeAllowed: Cualquier volumen + removeItem: Agencia eliminada correctamente + notification: + removeItemError: Error al eliminar la agencia + removeItem: Centro de trabajo eliminado correctamente + pageTitles: + agency: Agencia + searchBar: + info: Puedes buscar por nombre o id + label: Buscar agencia... diff --git a/src/pages/Claim/ClaimFilter.vue b/src/pages/Claim/ClaimFilter.vue index a0a3bedba..6b9e92d97 100644 --- a/src/pages/Claim/ClaimFilter.vue +++ b/src/pages/Claim/ClaimFilter.vue @@ -149,6 +149,15 @@ const states = ref(); /> + + + + + + + + {{ t('params.tags') }} + + + + + + + + + + + + + + + + + {{ t('More fields') }} + + + + + + + + + + + + + + + + + + + + + + + +en: + params: + search: General search + categoryFk: Category + typeFk: Type + buyerFk: Buyer + supplierFk: Supplier + tags: Tags + tag: Tag + value: Value + isFloramondo: Floramondo + isActive: Active + description: Description + name: Name + id: Id +es: + More fields: Más campos + params: + search: Búsqueda general + categoryFk: Reino + typeFk: Tipo + buyerFk: Comprador + supplierFk: Proveedor + tags: Etiquetas + tag: Etiqueta + value: Valor + isFloramondo: Floramondo + isActive: Activo + description: Descripción + name: Nombre + id: Id + diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue index 8b0b34e62..e142c28d3 100644 --- a/src/pages/Item/ItemRequestFilter.vue +++ b/src/pages/Item/ItemRequestFilter.vue @@ -3,7 +3,7 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; import FetchData from 'components/FetchData.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; @@ -126,7 +126,7 @@ const decrement = (paramsObj, key) => { - { - { - { - + @@ -261,7 +261,7 @@ const decrement = (paramsObj, key) => { - { const { defaultAddress } = selectedClient.value; formData.addressId = defaultAddress.id; - console.log(); } catch (err) { console.error(`Error fetching addresses`, err); return err.response; diff --git a/src/router/modules/agency.js b/src/router/modules/agency.js new file mode 100644 index 000000000..6f281e21d --- /dev/null +++ b/src/router/modules/agency.js @@ -0,0 +1,88 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/agency', + name: 'Agency', + meta: { + title: 'agency', + icon: 'garage_home', + moduleName: 'Agency', + }, + component: RouterView, + redirect: { name: 'AgencyCard' }, + menus: { + main: [], + card: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'], + }, + children: [ + { + path: '/agency/:id', + name: 'AgencyCard', + component: () => import('src/pages/Agency/Card/AgencyCard.vue'), + redirect: { name: 'AgencySummary' }, + children: [ + { + name: 'AgencySummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/Card/AgencySummary.vue'), + }, + { + name: 'AgencyBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('pages/Agency/Card/AgencyBasicData.vue'), + }, + { + path: 'workCenter', + name: 'AgencyWorkCenterCard', + redirect: { name: 'AgencyWorkCenters' }, + children: [ + { + path: '', + name: 'AgencyWorkCenters', + meta: { + icon: 'apartment', + title: 'workCenters', + }, + component: () => + import('src/pages/Agency/Card/AgencyWorkcenter.vue'), + }, + ], + }, + { + path: 'modes', + name: 'AgencyModesCard', + redirect: { name: 'AgencyModes' }, + children: [ + { + path: '', + name: 'AgencyModes', + meta: { + icon: 'format_list_bulleted', + title: 'modes', + }, + component: () => + import('src/pages/Agency/Card/AgencyModes.vue'), + }, + ], + }, + { + name: 'AgencyLog', + path: 'log', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Agency/Card/AgencyLog.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 302ba7fe0..6f4b0b35e 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -15,6 +15,7 @@ import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; +import Agency from './agency'; export default [ Item, @@ -34,4 +35,5 @@ export default [ Entry, roadmap, Parking, + Agency, ]; diff --git a/src/router/modules/item.js b/src/router/modules/item.js index ee5ab5d16..bc1e72a94 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -121,15 +121,6 @@ export default { }, component: () => import('src/pages/Item/Card/ItemTax.vue'), }, - { - path: 'botanical', - name: 'ItemBotanical', - meta: { - title: 'botanical', - icon: 'vn:botanical', - }, - component: () => import('src/pages/Item/Card/ItemBotanical.vue'), - }, { path: 'barcode', name: 'ItemBarcode', @@ -157,6 +148,15 @@ export default { }, component: () => import('src/pages/Item/Card/ItemLog.vue'), }, + { + path: 'botanical', + name: 'ItemBotanical', + meta: { + title: 'botanical', + icon: 'vn:botanical', + }, + component: () => import('src/pages/Item/Card/ItemBotanical.vue'), + }, ], }, ], diff --git a/src/router/modules/route.js b/src/router/modules/route.js index f8ededf55..8e08d7222 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -11,7 +11,7 @@ export default { component: RouterView, redirect: { name: 'RouteMain' }, menus: { - main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList'], + main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'], card: ['RouteBasicData', 'RouteTickets', 'RouteLog'], }, children: [ @@ -75,6 +75,21 @@ export default { }, component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, + { + path: '/agency', + redirect: { name: 'AgencyList' }, + children: [ + { + path: 'list', + name: 'AgencyList', + meta: { + title: 'agencyList', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/AgencyList.vue'), + }, + ], + }, ], }, { diff --git a/src/router/routes.js b/src/router/routes.js index 51e726a62..ca52441e7 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -15,6 +15,7 @@ import order from 'src/router/modules/order'; import entry from 'src/router/modules/entry'; import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; +import agency from 'src/router/modules/agency'; const routes = [ { @@ -71,6 +72,7 @@ const routes = [ roadmap, entry, parking, + agency, { path: '/:catchAll(.*)*', name: 'NotFound', diff --git a/test/cypress/integration/agency/agencyWorkCenter.spec.js b/test/cypress/integration/agency/agencyWorkCenter.spec.js new file mode 100644 index 000000000..ff3c53214 --- /dev/null +++ b/test/cypress/integration/agency/agencyWorkCenter.spec.js @@ -0,0 +1,50 @@ +describe('AgencyWorkCenter', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/agency`); + }); + + it('assign workCenter', () => { + cy.visit(`/#/agency`); + cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click(); + cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click(); + cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.get( + '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' + ).type('workCenterOne{enter}'); + cy.get('.q-btn--standard > .q-btn__content > .block').click(); + cy.get('.q-notification__message').should('have.text', 'Data created'); + }); + + it('delete workCenter', () => { + cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click(); + cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click(); + 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.visit(`/#/agency`); + cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click(); + cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click(); + cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.get( + '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' + ).type('workCenterOne{enter}'); + cy.get('.q-btn--standard > .q-btn__content > .block').click(); + cy.get('.q-notification__message').should('have.text', 'Data created'); + cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.get( + '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' + ).type('workCenterOne{enter}'); + cy.get('.q-btn--standard > .q-btn__content > .block').click(); + + 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'); + }); +}); diff --git a/test/vitest/setup-file.js b/test/vitest/setup-file.js index 499204981..288f80beb 100644 --- a/test/vitest/setup-file.js +++ b/test/vitest/setup-file.js @@ -1 +1 @@ -// This file will be run before each test file +// This file will be run before each test file, don't delete or vitest will not work.