This commit is contained in:
parent
02129591cf
commit
f7fb18cf0a
|
@ -182,7 +182,7 @@ async function saveChanges(data) {
|
|||
|
||||
hasChanges.value = false;
|
||||
isLoading.value = false;
|
||||
emit('saveChanges', data);
|
||||
emit('saveChanges', changes);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
message: t('globals.dataSaved'),
|
||||
|
|
|
@ -258,6 +258,7 @@ function stopEventPropagation(event) {
|
|||
function reload(params) {
|
||||
selected.value = [];
|
||||
CrudModelRef.value.reload(params);
|
||||
emit('saveChanges', params);
|
||||
}
|
||||
|
||||
function columnName(col) {
|
||||
|
|
|
@ -4,28 +4,42 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRoute } from 'vue-router';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import { toDate } from 'src/filters';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import axios from 'axios';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const tableRef = ref();
|
||||
const entityId = computed(() => route.params.id);
|
||||
const quasar = useQuasar();
|
||||
|
||||
async function reactivateWorker(data) {
|
||||
console.log('value: ', data);
|
||||
// if (business === null) return;
|
||||
// quasar
|
||||
// .dialog({
|
||||
// message: t('Do you want to reactivate the user?'),
|
||||
// ok: {
|
||||
// push: true,
|
||||
// color: 'primary',
|
||||
// },
|
||||
// cancel: true,
|
||||
// })
|
||||
// .onOk(async () => {
|
||||
// business.isDisable = false;
|
||||
// });
|
||||
console.log('value: ', data.updates[0].data.ended);
|
||||
console.log('data: ', entityId.value);
|
||||
// const filter = {
|
||||
// where: { id: entityId.value },
|
||||
// };
|
||||
// console.log('filter: ', filter);
|
||||
const { worker } = await axios.get(`Workers`, {
|
||||
params: {
|
||||
filter: JSON.stringify({ id: entityId.value }),
|
||||
},
|
||||
});
|
||||
console.log('worker', worker);
|
||||
if (!data.updates[0].data.ended) {
|
||||
quasar
|
||||
.dialog({
|
||||
message: t('Do you want to reactivate the user?'),
|
||||
ok: {
|
||||
push: true,
|
||||
color: 'primary',
|
||||
},
|
||||
cancel: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
worker.isDisable = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -218,12 +232,12 @@ const columns = computed(() => [
|
|||
card-class="grid-two q-gutter-x-md"
|
||||
:is-editable="true"
|
||||
:use-model="true"
|
||||
@on-data-saved="tableRef.reactivateWorker()"
|
||||
@save-changes="(data) => reactivateWorker(data)"
|
||||
>
|
||||
<template #column-ended="{ row }">
|
||||
<!-- <template #column-ended="{ row }">
|
||||
<VnInputDate v-model="row.ended" />
|
||||
<QForm v-if="!row.ended"></QForm>
|
||||
</template>
|
||||
</template> -->
|
||||
</VnTable>
|
||||
</template>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
@ -225,7 +225,7 @@ const filter = {
|
|||
|
||||
<VnLv
|
||||
:label="t('worker.summary.reasonEnd')"
|
||||
:value="worker.business[0].reasonEnd.reason"
|
||||
:value="worker.business[0].reasonEnd?.reason"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('worker.summary.department')"
|
||||
|
|
Loading…
Reference in New Issue