From 4effba1580c4afa70c1fe2c01e3685a0b8e5b420 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:38:41 -0300 Subject: [PATCH 01/78] Ticket dms --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketDms.vue | 13 +++++++++++++ src/router/modules/ticket.js | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/pages/Ticket/Card/TicketDms.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index b3a85eefa..63d5f630a 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -443,6 +443,7 @@ ticket: sms: Sms notes: Notes sale: Sale + dms: File management list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d03ee9d5c..92b77a351 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -441,6 +441,7 @@ ticket: sms: Sms notes: Notas sale: Lineas del pedido + dms: Gestión documental list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketDms.vue b/src/pages/Ticket/Card/TicketDms.vue new file mode 100644 index 000000000..ae44fb795 --- /dev/null +++ b/src/pages/Ticket/Card/TicketDms.vue @@ -0,0 +1,13 @@ + + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 6cb7291dc..05e323d50 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms', 'TicketSale'], + card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketDms'], }, children: [ { @@ -93,6 +93,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketSms.vue'), }, + { + path: 'dms', + name: 'TicketDms', + meta: { + title: 'dms', + icon: 'cloud_upload', + }, + component: () => import('src/pages/Ticket/Card/TicketDms.vue'), + }, ], }, ], From c500dd6346479852457472558403e5bdfcf6a1d1 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:58:26 -0300 Subject: [PATCH 02/78] Add allow import feature in VnDmsList --- src/components/common/VnDmsImportForm.vue | 81 +++++++++++++++++++++++ src/components/common/VnDmsList.vue | 12 ++++ src/pages/Ticket/Card/TicketDms.vue | 1 + 3 files changed, 94 insertions(+) create mode 100644 src/components/common/VnDmsImportForm.vue diff --git a/src/components/common/VnDmsImportForm.vue b/src/components/common/VnDmsImportForm.vue new file mode 100644 index 000000000..b31197bbc --- /dev/null +++ b/src/components/common/VnDmsImportForm.vue @@ -0,0 +1,81 @@ + + + + + +es: + Select document id: Introduzca id de gestion documental + Document: Documento + The document indentifier can't be empty: El número de documento no puede estar vacío + diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 769ba9959..0576ba266 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -3,6 +3,7 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; +import VnDmsImportForm from 'src/components/common/VnDmsImportForm.vue'; import axios from 'axios'; import VnPaginate from 'components/ui/VnPaginate.vue'; @@ -18,6 +19,7 @@ const { t } = useI18n(); const rows = ref(); const dmsRef = ref(); const formDialog = ref({}); +const showImportDialog = ref(false); const $props = defineProps({ model: { @@ -45,6 +47,10 @@ const $props = defineProps({ type: String, required: true, }, + allowImport: { + type: Boolean, + default: false, + }, }); const dmsFilter = { @@ -373,9 +379,15 @@ function shouldRenderButton(button, isExternal = false) { :description="$props.description" /> + + + + + + From 4a01f1d930b750c82b7ed6979b28a3aa2ad589c4 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 10:40:11 +0200 Subject: [PATCH 11/78] perf: cleancode --- src/pages/Ticket/Card/TicketSaleTracking.vue | 66 +++++++------------- 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSaleTracking.vue b/src/pages/Ticket/Card/TicketSaleTracking.vue index 823fe762f..858a35e61 100644 --- a/src/pages/Ticket/Card/TicketSaleTracking.vue +++ b/src/pages/Ticket/Card/TicketSaleTracking.vue @@ -246,9 +246,9 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { try { const params = { saleFk: sale.saleFk, - isChecked: isChecked, + isChecked, quantity: sale.quantity, - stateCode: stateCode, + stateCode, }; await axios.post(`SaleTrackings/new`, params); notify(t('globals.dataSaved'), 'positive'); @@ -257,10 +257,10 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { } }; -const saleTrackingDel = async (sale, stateCode) => { +const saleTrackingDel = async ({ saleFk }, stateCode) => { try { const params = { - saleFk: sale.saleFk, + saleFk, stateCodes: [stateCode], }; await axios.post(`SaleTrackings/delete`, params); @@ -284,14 +284,8 @@ const clickSaleGroupDetail = async (sale) => { const clickPreviousSelected = (sale) => { try { - if (!sale.isPreviousSelected) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPreviousSelected = true; - } else { - saleTrackingDel(sale, 'PREVIOUS_PREPARATION'); - sale.isPreviousSelected = false; - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPreviousSelected'); + if (!sale.isPreviousSelected) sale.isPrevious = false; } catch (error) { console.error(error); } @@ -299,41 +293,28 @@ const clickPreviousSelected = (sale) => { const clickPrevious = (sale) => { try { - if (!sale.isPrevious) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', true); - sale.isPrevious = true; - sale.isPreviousSelected = true; - } else { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPrevious'); + if (sale.isPrevious) sale.isPreviousSelected = true; } catch (error) { console.error(error); } }; -const clickPrepared = (sale) => { +const qCheckBoxController = (sale, action) => { + const STATE_CODES = { + isControled: 'CHECKED', + isPrepared: 'PREPARED', + isPrevious: 'PREVIOUS_PREPARATION', + isPreviousSelected: 'PREVIOUS_PREPARATION', + }; + const stateCode = STATE_CODES[action]; try { - if (!sale.isPrepared) { - saleTrackingNew(sale, 'PREPARED', true); - sale.isPrepared = true; + if (!sale[action]) { + saleTrackingNew(sale, stateCode, true); + sale[action] = true; } else { - saleTrackingDel(sale, 'PREPARED'); - sale.isPrepared = false; - } - } catch (error) { - console.error(error); - } -}; - -const clickControled = (sale) => { - try { - if (!sale.isControled) { - saleTrackingNew(sale, 'CHECKED', true); - sale.isControled = true; - } else { - saleTrackingDel(sale, 'CHECKED'); - sale.isControled = false; + saleTrackingDel(sale, stateCode); + sale[action] = false; } } catch (error) { console.error(error); @@ -403,7 +384,7 @@ const clickControled = (sale) => { color="warning" class="warning" :toggle-indeterminate="false" - @update:model-value="clickPrepared(row)" + @update:model-value="qCheckBoxController(row, 'isPrepared')" > {{ t('ticketSaleTracking.prepared') }} @@ -413,9 +394,8 @@ const clickControled = (sale) => { :model-value="!!row.isControled" color="yellow" class="yellow" - style="stroke: red" :toggle-indeterminate="false" - @update:model-value="clickControled(row)" + @update:model-value="qCheckBoxController(row, 'isControled')" > {{ t('ticketSaleTracking.checked') }} From 317746b1f5ed078064be819ef0c71d9b59c60ee6 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 5 Jul 2024 07:10:41 +0200 Subject: [PATCH 12/78] hotfix: refs #6769 Changes --- src/pages/Item/Card/ItemDiary.vue | 71 +++++++++++++++---- src/pages/Item/locale/en.yml | 4 +- src/pages/Item/locale/es.yml | 4 +- src/pages/Order/Card/OrderDescriptorProxy.vue | 17 +++++ 4 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 src/pages/Order/Card/OrderDescriptorProxy.vue diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index c2687e0fd..9e2deef1c 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -5,7 +5,9 @@ import { useRoute } from 'vue-router'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; +import OrderDescriptorProxy from 'src/pages/Order/Card/OrderDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import FetchData from 'components/FetchData.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; @@ -45,8 +47,8 @@ const columns = computed(() => [ align: 'left', }, { - label: t('itemDiary.id'), - name: 'id', + label: t('itemDiary.origin'), + name: 'origin', align: 'left', }, { @@ -65,8 +67,8 @@ const columns = computed(() => [ }, { - label: t('itemDiary.client'), - name: 'client', + label: t('itemDiary.entity'), + name: 'entity', align: 'left', format: (val) => dashIfEmpty(val), }, @@ -111,10 +113,30 @@ const getBadgeAttrs = (_date) => { return attrs; }; -const getIdDescriptor = (row) => { - let descriptor = EntryDescriptorProxy; - if (row.isTicket) descriptor = TicketDescriptorProxy; - return descriptor; +const originTypeMap = { + entry: { + descriptor: EntryDescriptorProxy, + icon: 'vn:entry', + }, + ticket: { + descriptor: TicketDescriptorProxy, + icon: 'vn:ticket', + }, + order: { + descriptor: OrderDescriptorProxy, + icon: 'vn:basket', + }, +}; + +const entityTypeMap = { + client: { + descriptor: CustomerDescriptorProxy, + icon: 'vn:client', + }, + supplier: { + descriptor: SupplierDescriptorProxy, + icon: 'vn:supplier', + }, }; onMounted(async () => { @@ -206,10 +228,10 @@ onUnmounted(() => (stateStore.rightDrawer = false)); -