diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index b54e44398..72ac0a8f0 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -73,6 +73,7 @@ watch(props, async () => { .cardSummary { width: 100%; + .summaryHeader { text-align: center; font-size: 20px; @@ -85,6 +86,7 @@ watch(props, async () => { justify-content: space-evenly; gap: 15px; padding: 15px; + background-color: var(--vn-gray); > .q-card.vn-one { flex: 1; diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index e3b9b9533..b4761a77f 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -402,6 +402,11 @@ export default { noTicketsToInvoice: "There aren't clients to invoice", criticalInvoiceError: 'Critical invoicing error, process stopped', }, + table: { + client: 'Client', + addressId: 'Address id', + streetAddress: 'Street', + }, }, negativeBases: { from: 'From', @@ -533,6 +538,49 @@ export default { }, }, }, + supplier: { + pageTitles: { + suppliers: 'Suppliers', + list: 'List', + create: 'Create', + summary: 'Summary', + }, + list: { + payMethod: 'Pay method', + payDeadline: 'Pay deadline', + payDay: 'Pay day', + account: 'Account', + newSupplier: 'New supplier', + }, + summary: { + responsible: 'Responsible', + notes: 'Notes', + verified: 'Verified', + isActive: 'Is active', + billingData: 'Billing data', + payMethod: 'Pay method', + payDeadline: 'Pay deadline', + payDay: 'Día de pago', + account: 'Account', + fiscalData: 'Fiscal data', + sageTaxType: 'Sage tax type', + sageTransactionType: 'Sage transaction type', + sageWithholding: 'Sage withholding', + supplierActivity: 'Supplier activity', + healthRegister: 'Healt register', + fiscalAddress: 'Fiscal address', + socialName: 'Social name', + taxNumber: 'Tax number', + street: 'Street', + city: 'City', + postCode: 'Postcode', + province: 'Province', + country: 'Country', + }, + create: { + supplierName: 'Supplier name', + }, + }, components: { topbar: {}, userPanel: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 8343f525c..85fb6b6e6 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -404,6 +404,11 @@ export default { noTicketsToInvoice: 'No hay clientes para facturar', criticalInvoiceError: 'Error crítico en la facturación, proceso detenido', }, + table: { + client: 'Cliente', + addressId: 'Id dirección', + streetAddress: 'Dirección fiscal', + }, }, negativeBases: { from: 'Desde', @@ -535,6 +540,49 @@ export default { }, }, }, + supplier: { + pageTitles: { + suppliers: 'Proveedores', + list: 'Listado', + create: 'Crear', + summary: 'Resumen', + }, + list: { + payMethod: 'Método de pago', + payDeadline: 'Plazo de pago', + payDay: 'Día de pago', + account: 'Cuenta', + newSupplier: 'Nuevo proveedor', + }, + summary: { + responsible: 'Responsable', + notes: 'Notas', + verified: 'Verificado', + isActive: 'Está activo', + billingData: 'Billing data', + payMethod: 'Método de pago', + payDeadline: 'Plazo de pago', + payDay: 'Día de pago', + account: 'Account', + fiscalData: 'Data fiscal', + sageTaxType: 'Tipo de impuesto Sage', + sageTransactionType: 'Tipo de transacción Sage', + sageWithholding: 'Retención sage', + supplierActivity: 'Actividad proveedor', + healthRegister: 'Pasaporte sanitario', + fiscalAddress: 'Dirección fiscal', + socialName: 'Razón social', + taxNumber: 'NIF/CIF', + street: 'Dirección', + city: 'Población', + postCode: 'Código postal', + province: 'Provincia', + country: 'País', + }, + create: { + supplierName: 'Nombre del proveedor', + }, + }, components: { topbar: {}, userPanel: { diff --git a/src/pages/InvoiceOut/InvoiceOutGlobal.vue b/src/pages/InvoiceOut/InvoiceOutGlobal.vue index 2b260ae9e..a73ec590f 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobal.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobal.vue @@ -49,13 +49,30 @@ const tableColumnComponents = { }, }; -const columns = ref([ - { label: 'Id', field: 'clientId', name: 'clientId', align: 'left' }, - { label: 'Cliente', field: 'clientName', name: 'clientName', align: 'left' }, - { label: 'Id dirección', field: 'id', name: 'id', align: 'left' }, - { label: 'Dirección fiscal', field: 'nickname', name: 'nickname', align: 'left' }, - { label: 'Error', field: 'message', name: 'message', align: 'left' }, -]); +const columns = computed(() => { + return [ + { label: 'Id', field: 'clientId', name: 'clientId', align: 'left' }, + { + label: t('invoiceOut.globalInvoices.table.client'), + field: 'clientName', + name: 'clientName', + align: 'left', + }, + { + label: t('invoiceOut.globalInvoices.table.addressId'), + field: 'id', + name: 'id', + align: 'left', + }, + { + label: t('invoiceOut.globalInvoices.table.streetAddress'), + field: 'nickname', + name: 'nickname', + align: 'left', + }, + { label: 'Error', field: 'message', name: 'message', align: 'left' }, + ]; +}); const cardStatusText = computed(() => { return t(`status.${status.value}`); diff --git a/src/pages/Supplier/Card/SupplierCard.vue b/src/pages/Supplier/Card/SupplierCard.vue new file mode 100644 index 000000000..12c6df20c --- /dev/null +++ b/src/pages/Supplier/Card/SupplierCard.vue @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/Supplier/Card/SupplierSummary.vue b/src/pages/Supplier/Card/SupplierSummary.vue new file mode 100644 index 000000000..120ae8713 --- /dev/null +++ b/src/pages/Supplier/Card/SupplierSummary.vue @@ -0,0 +1,187 @@ + + + + setData(data)" + > + + + + + {{ supplier.name }} - {{ supplier.id }} + + + + + + {{ t('globals.summary.basicData') }} + + + {{ t('globals.summary.basicData') }} + + + + + + {{ supplier.worker?.user?.nickname || '-' }} + + + + + + + {{ supplier.note || '-' }} + + + + + + + + {{ t('supplier.summary.billingData') }} + + + {{ t('supplier.summary.billingData') }} + + + + + + + + {{ t('supplier.summary.fiscalData') }} + + + {{ t('supplier.summary.fiscalData') }} + + + + + + + + + {{ t('supplier.summary.fiscalAddress') }} + + + {{ t('supplier.summary.fiscalAddress') }} + + + + + + + + + + + + diff --git a/src/pages/Supplier/Card/SupplierSummaryDialog.vue b/src/pages/Supplier/Card/SupplierSummaryDialog.vue new file mode 100644 index 000000000..6353caa38 --- /dev/null +++ b/src/pages/Supplier/Card/SupplierSummaryDialog.vue @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/src/pages/Supplier/SupplierCreate.vue b/src/pages/Supplier/SupplierCreate.vue new file mode 100644 index 000000000..a27c6fd37 --- /dev/null +++ b/src/pages/Supplier/SupplierCreate.vue @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue new file mode 100644 index 000000000..d18ef9bb3 --- /dev/null +++ b/src/pages/Supplier/SupplierList.vue @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('components.smartCard.openSummary') }} + + + + + + + + + + + {{ t('supplier.list.newSupplier') }} + + + + + + + + + { + "en": { + Search suppliers: Search suppliers + }, + "es": { + Search suppliers: Buscar proveedores + } + } + diff --git a/src/pages/Supplier/SupplierMain.vue b/src/pages/Supplier/SupplierMain.vue new file mode 100644 index 000000000..66ce78f23 --- /dev/null +++ b/src/pages/Supplier/SupplierMain.vue @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js new file mode 100644 index 000000000..198a9581e --- /dev/null +++ b/src/router/modules/Supplier.js @@ -0,0 +1,61 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/supplier', + name: 'Supplier', + meta: { + title: 'suppliers', + icon: 'vn:supplier', + }, + component: RouterView, + redirect: { name: 'SupplierMain' }, + menus: { + main: ['SupplierList'], + card: [], + }, + children: [ + { + path: '', + name: 'SupplierMain', + component: () => import('src/pages/Supplier/SupplierMain.vue'), + redirect: { name: 'SupplierList' }, + children: [ + { + path: 'list', + name: 'SupplierList', + meta: { + title: 'list', + icon: 'view_list', + }, + component: () => import('src/pages/Supplier/SupplierList.vue'), + }, + { + path: 'create', + name: 'SupplierCreate', + meta: { + title: 'create', + }, + component: () => import('src/pages/Supplier/SupplierCreate.vue'), + }, + ], + }, + { + name: 'SupplierCard', + path: ':id', + component: () => import('src/pages/Supplier/Card/SupplierCard.vue'), + redirect: { name: 'SupplierSummary' }, + children: [ + { + name: 'SupplierSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => + import('src/pages/Supplier/Card/SupplierSummary.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 2916b98ef..2456e57aa 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -5,13 +5,6 @@ import InvoiceOut from './invoiceOut'; import Worker from './worker'; import Wagon from './wagon'; import Route from './route'; +import Supplier from './Supplier'; -export default [ - Customer, - Ticket, - Claim, - InvoiceOut, - Worker, - Wagon, - Route -] +export default [Customer, Ticket, Claim, InvoiceOut, Worker, Wagon, Route, Supplier]; diff --git a/src/router/routes.js b/src/router/routes.js index e3aa22a06..faf340e0c 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -4,6 +4,7 @@ import claim from './modules/claim'; import worker from './modules/worker'; import invoiceOut from './modules/invoiceOut'; import wagon from './modules/wagon'; +import supplier from './modules/Supplier'; import route from './modules/route'; const routes = [ @@ -49,13 +50,14 @@ const routes = [ claim, worker, invoiceOut, + wagon, + route, + supplier, { path: '/:catchAll(.*)*', name: 'NotFound', component: () => import('../pages/NotFound.vue'), }, - wagon, - route, ], }, ]; diff --git a/src/services/Suppliers.service.js b/src/services/Suppliers.service.js new file mode 100644 index 000000000..fa1023f27 --- /dev/null +++ b/src/services/Suppliers.service.js @@ -0,0 +1,14 @@ +import axios from 'axios'; + +const suppliersService = { + createSupplier: async (formData) => { + try { + return await axios.post('Suppliers/newSupplier', formData); + } catch (err) { + console.error(`Error creating new supplier`, err); + return err.response; + } + }, +}; + +export default suppliersService; diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index 168c1f9dc..ea4e175ab 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -6,7 +6,16 @@ import { useRole } from 'src/composables/useRole'; import routes from 'src/router/modules'; export const useNavigationStore = defineStore('navigationStore', () => { - const modules = ['customer', 'claim', 'ticket', 'invoiceOut', 'worker', 'wagon', 'route']; + const modules = [ + 'customer', + 'claim', + 'ticket', + 'invoiceOut', + 'worker', + 'wagon', + 'route', + 'supplier', + ]; const pinnedModules = ref([]); const role = useRole();