This commit is contained in:
parent
36fc988df2
commit
05fcff1cbf
|
@ -937,6 +937,7 @@ worker:
|
||||||
debit: Debt
|
debit: Debt
|
||||||
credit: Have
|
credit: Have
|
||||||
concept: Concept
|
concept: Concept
|
||||||
|
id: id
|
||||||
wagon:
|
wagon:
|
||||||
type:
|
type:
|
||||||
name: Name
|
name: Name
|
||||||
|
|
|
@ -930,6 +930,7 @@ worker:
|
||||||
debit: Debe
|
debit: Debe
|
||||||
credit: Haber
|
credit: Haber
|
||||||
concept: Concepto
|
concept: Concepto
|
||||||
|
id: id
|
||||||
wagon:
|
wagon:
|
||||||
type:
|
type:
|
||||||
name: Nombre
|
name: Nombre
|
||||||
|
|
|
@ -1,14 +1,27 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import axios from 'axios';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const entityId = computed(() => route.params.id);
|
const entityId = computed(() => route.params.id);
|
||||||
|
const quasar = useQuasar();
|
||||||
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: t('worker.balance.tableVisibleColumns.id'),
|
||||||
|
field: 'id',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'paymentDate',
|
name: 'paymentDate',
|
||||||
|
@ -57,11 +70,43 @@ const columns = computed(() => [
|
||||||
field: 'concept',
|
field: 'concept',
|
||||||
cardVisible: true,
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
class="column flex-center"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerBalance"
|
data-key="WorkerBalance"
|
||||||
:url="`Workers/${entityId}/incomes`"
|
:url="`Workers/${entityId}/incomes`"
|
||||||
|
|
Loading…
Reference in New Issue