From 24368d99b575decb717bc5541457f614af9248a8 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 9 Jul 2024 14:09:04 +0200 Subject: [PATCH 1/3] fix: refs #6896 fixed list & lines error --- src/pages/Order/Card/OrderDescriptor.vue | 2 +- src/pages/Order/OrderLines.vue | 72 ++++++++++++------------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index f70ba4520..4d84a32fc 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -60,7 +60,7 @@ const filter = { const data = ref(useCardDescription()); const setData = (entity) => { if (!entity) return; - data.value = useCardDescription(entity.client.name, entity.id); + data.value = useCardDescription(entity?.client?.name, entity?.id); state.set('OrderDescriptor', entity); }; diff --git a/src/pages/Order/OrderLines.vue b/src/pages/Order/OrderLines.vue index e66a3f7c4..aebc2ed85 100644 --- a/src/pages/Order/OrderLines.vue +++ b/src/pages/Order/OrderLines.vue @@ -21,9 +21,6 @@ const quasar = useQuasar(); const componentKey = ref(0); const tableLinesRef = ref(); const order = ref(); -const refresh = () => { - componentKey.value += 1; -}; const orderSummary = ref({ total: null, vat: null, @@ -66,37 +63,6 @@ const lineFilter = ref({ where: { orderFk: route.params.id }, }); -function confirmRemove(item) { - quasar.dialog({ - component: VnConfirm, - componentProps: { - title: t('confirmDeletion'), - message: t('confirmDeletionMessage'), - promise: async () => remove(item), - }, - }); -} - -async function remove(item) { - await axios.post('OrderRows/removes', { - actualOrderId: route.params.id, - rows: [item.id], - }); - quasar.notify({ - message: t('globals.dataDeleted'), - type: 'positive', - }); - refresh(); -} - -async function confirmOrder() { - await axios.post(`Orders/${route.params.id}/confirm`); - quasar.notify({ - message: t('globals.confirm'), - type: 'positive', - }); -} - const columns = computed(() => [ { align: 'center', @@ -121,6 +87,7 @@ const columns = computed(() => [ condition: () => true, }, isId: true, + format: (row) => row?.item?.id, }, { align: 'left', @@ -190,12 +157,45 @@ const columns = computed(() => [ { title: t('delete'), icon: 'delete', - click: (row) => confirmRemove(row.item), + action: (row) => confirmRemove(row), isPrimary: true, }, ], }, ]); + +function confirmRemove(item) { + quasar.dialog({ + component: VnConfirm, + componentProps: { + title: t('confirmDeletion'), + message: t('confirmDeletionMessage'), + promise: async () => remove(item), + }, + }); +} + +async function remove(item) { + console.log('item: ', item); + console.log('id: ', route.params.id); + await axios.post('OrderRows/removes', { + actualOrderId: route.params.id, + rows: [item.id], + }); + quasar.notify({ + message: t('globals.dataDeleted'), + type: 'positive', + }); + tableLinesRef.value.reload(); +} + +async function confirmOrder() { + await axios.post(`Orders/${route.params.id}/confirm`); + quasar.notify({ + message: t('globals.confirm'), + type: 'positive', + }); +} - + {{ t('confirm') }} From 58a2a320272bcd14b5cf0389e8d22bdb81fcde78 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 9 Jul 2024 14:21:41 +0200 Subject: [PATCH 2/3] warmFix(workerDescriptor): ?. --- src/pages/Worker/Card/WorkerDescriptor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index 82a698878..951c8511e 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -71,7 +71,7 @@ watch( const data = ref(useCardDescription()); const setData = (entity) => { if (!entity) return; - data.value = useCardDescription(entity.user.nickname, entity.id); + data.value = useCardDescription(entity.user?.nickname, entity.id); }; const openChangePasswordForm = () => changePasswordFormDialog.value.show(); From 36fc988df2f0259e8d5da7c6e56841bc7ef6aec0 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 9 Jul 2024 14:56:27 +0200 Subject: [PATCH 3/3] fix(VnTable): visible if is nullish --- src/components/VnTable/VnTable.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 747ecd03b..31486091b 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -152,7 +152,7 @@ function splitColumns(columns) { columns: [], chips: [], create: [], - visible: [], + cardVisible: [], }; for (const col of columns) { @@ -160,7 +160,7 @@ function splitColumns(columns) { if (col.chip) splittedColumns.value.chips.push(col); if (col.isTitle) splittedColumns.value.title = col; if (col.create) splittedColumns.value.create.push(col); - if (col.cardVisible) splittedColumns.value.visible.push(col); + if (col.cardVisible) splittedColumns.value.cardVisible.push(col); if ($props.isEditable && col.disable == null) col.disable = false; if ($props.useModel) col.columnFilter = { ...col.columnFilter, inWhere: true }; splittedColumns.value.columns.push(col); @@ -311,7 +311,11 @@ defineExpose({ />