58 lines
1.3 KiB
Vue
58 lines
1.3 KiB
Vue
<script setup>
|
|
import { onMounted, reactive } from 'vue';
|
|
import { useI18n } from 'vue-i18n';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
import FormModel from 'components/FormModel.vue';
|
|
import VnRow from 'components/ui/VnRow.vue';
|
|
|
|
const { t } = useI18n();
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
|
|
const initialData = reactive({});
|
|
|
|
onMounted(() => {
|
|
initialData.clientFk = `${route.params.id}`;
|
|
});
|
|
|
|
const toCustomerNotes = () => {
|
|
router.push({
|
|
name: 'CustomerNotes',
|
|
params: {
|
|
id: route.params.id,
|
|
},
|
|
});
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<FormModel
|
|
:form-initial-data="initialData"
|
|
:observe-form-changes="false"
|
|
@on-data-saved="toCustomerNotes()"
|
|
url-create="ClientObservations"
|
|
>
|
|
<template #moreActions>
|
|
<QBtn
|
|
:label="t('globals.cancel')"
|
|
@click="toCustomerNotes"
|
|
color="primary"
|
|
flat
|
|
icon="close"
|
|
/>
|
|
</template>
|
|
|
|
<template #form="{ data }">
|
|
<VnRow class="row q-gutter-md q-mb-md">
|
|
<QInput :label="t('Note')" type="textarea" v-model="data.text" />
|
|
</VnRow>
|
|
</template>
|
|
</FormModel>
|
|
</template>
|
|
|
|
<i18n>
|
|
es:
|
|
Note: Nota
|
|
</i18n>
|