forked from verdnatura/salix-front
refs #7409 fix balance
This commit is contained in:
parent
36fc988df2
commit
05fcff1cbf
|
@ -937,6 +937,7 @@ worker:
|
|||
debit: Debt
|
||||
credit: Have
|
||||
concept: Concept
|
||||
id: id
|
||||
wagon:
|
||||
type:
|
||||
name: Name
|
||||
|
|
|
@ -930,6 +930,7 @@ worker:
|
|||
debit: Debe
|
||||
credit: Haber
|
||||
concept: Concepto
|
||||
id: id
|
||||
wagon:
|
||||
type:
|
||||
name: Nombre
|
||||
|
|
|
@ -1,14 +1,27 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
|
||||
const tableRef = ref();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const entityId = computed(() => route.params.id);
|
||||
const quasar = useQuasar();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('worker.balance.tableVisibleColumns.id'),
|
||||
field: 'id',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'paymentDate',
|
||||
|
@ -57,11 +70,43 @@ const columns = computed(() => [
|
|||
field: 'concept',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: '',
|
||||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('Remove'),
|
||||
icon: 'delete',
|
||||
action: (row) =>
|
||||
openConfirmationModal(t('CHANGE ME!'), t('CHANGE ME!'), () =>
|
||||
deleteBalance(row)
|
||||
),
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
async function deleteBalance({ id }) {
|
||||
try {
|
||||
await axios.delete(`workerIncomes/${id}`);
|
||||
quasar.notify({
|
||||
message: t('Remove incomes'),
|
||||
type: 'positive',
|
||||
});
|
||||
tableRef.value.reload();
|
||||
} catch (error) {
|
||||
quasar.notify({
|
||||
message: t('Error'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnTable
|
||||
class="column flex-center"
|
||||
ref="tableRef"
|
||||
data-key="WorkerBalance"
|
||||
:url="`Workers/${entityId}/incomes`"
|
||||
|
|
Loading…
Reference in New Issue