PR-CUSTOMER #186
|
@ -15,6 +15,7 @@ const route = useRoute();
|
|||
const { notify } = useNotify();
|
||||
|
||||
let notes = reactive([]);
|
||||
let deletes = reactive([]);
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
|
@ -51,14 +52,16 @@ const addNote = ({ id, name, phone, isNew }) => {
|
|||
}
|
||||
};
|
||||
|
||||
const deleteNote = (index) => {
|
||||
const deleteNote = (note, index) => {
|
||||
deletes.push(note.id);
|
||||
notes.splice(index, 1);
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
isLoading.value = true;
|
||||
const payload = {
|
||||
creates: notes.filter((element) => element.$isNew),
|
||||
creates: notes.filter((element) => element.$isNew) || null,
|
||||
deletes: deletes || null,
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
};
|
||||
try {
|
||||
await axios.post('ClientContacts/crud', payload);
|
||||
|
@ -91,7 +94,7 @@ const onSubmit = async () => {
|
|||
|
||||
<div class="flex items-center">
|
||||
<QIcon
|
||||
@click.stop="deleteNote(index)"
|
||||
@click.stop="deleteNote(note, index)"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
name="delete"
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import axios from 'axios';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
|
@ -13,8 +14,10 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const state = useState();
|
||||
|
@ -57,6 +60,7 @@ onBeforeMount(async () => {
|
|||
initialData.companyFk = companyFk;
|
||||
initialData.companyId = companyFk;
|
||||
initialData.recipient = data.email;
|
||||
initialData.recipientId = data.id;
|
||||
});
|
||||
|
||||
const setEmailUser = (data) => {
|
||||
|
@ -88,6 +92,32 @@ const onDataSaved = async ({
|
|||
});
|
||||
router.push({ name: 'CustomerSamples' });
|
||||
};
|
||||
|
||||
const getPreview = async () => {
|
||||
const { addressId, companyId, recipientId } = initialData;
|
||||
const path = `Clients/${route.params.id}/incoterms-authorization-html`;
|
||||
const params = {
|
||||
addressId,
|
||||
companyId,
|
||||
recipientId,
|
||||
};
|
||||
const queryParams = Object.keys(params)
|
||||
.map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
|
||||
.join('&');
|
||||
const url = `${path}?${queryParams}`;
|
||||
|
||||
try {
|
||||
const { data } = await axios.get(url);
|
||||
quasar.dialog({
|
||||
component: CustomerSamplesPreview,
|
||||
componentProps: {
|
||||
htmlContent: data,
|
||||
},
|
||||
jgallego
commented
abrir como en salix que es mas ancho, mas similar a un dina4 que es lo que intuitivamente espera el usuario abrir como en salix que es mas ancho, mas similar a un dina4 que es lo que intuitivamente espera el usuario
cfonseca
commented
Corregido: Corregido: 90ee50eab5
jsegarra
commented
Yo lo veo OK Yo lo veo OK
|
||||
});
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
No hay botón de vista previa No hay botón de vista previa
cfonseca
commented
Corregido: Corregido: d0e98010a5
jsegarra
commented
Aparece el botón de vista previa, sin embargo, el formato del layout no es el estándar Aparece el botón de vista previa, sin embargo, el formato del layout no es el estándar
cfonseca
commented
Corregido: Corregido: ebd1ee07f4
jsegarra
commented
Revisar ya que el boton de vista previa está activo a pesar de no tener seleccionada la plantilla. Revisar ya que el boton de vista previa está activo a pesar de no tener seleccionada la plantilla.
Si haces F5, el campo plantilla, por defecto no está seleccionada y el boton desactivado, eso está OK.
|
||||
};
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
Cuando se muestra el campo dirección,. no muestra el nombre del consignatario sino otro valor Cuando se muestra el campo dirección,. no muestra el nombre del consignatario sino otro valor
La label del campo debería ser consignatario
¿Debería tener el icono del lápiz para editar dirección? @alexm
cfonseca
commented
Corrección: Corrección: 08e072100b
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -117,6 +147,7 @@ const onDataSaved = async ({
|
|||
/>
|
||||
|
||||
<FormModel
|
||||
:default-actions="false"
|
||||
:form-initial-data="initialData"
|
||||
:observe-form-changes="false"
|
||||
@on-data-saved="onDataSaved"
|
||||
|
@ -226,6 +257,34 @@ const onDataSaved = async ({
|
|||
/>
|
||||
</div>
|
||||
</VnRow>
|
||||
|
||||
<div class="q-mt-lg row justify-end">
|
||||
<QBtn
|
||||
:disabled="isLoading"
|
||||
:label="t('globals.cancel')"
|
||||
:loading="isLoading"
|
||||
class="q-mr-sm"
|
||||
color="primary"
|
||||
flat
|
||||
type="reset"
|
||||
v-close-popup
|
||||
/>
|
||||
<QBtn
|
||||
:disabled="isLoading"
|
||||
:label="t('Preview')"
|
||||
:loading="isLoading"
|
||||
@click.stop="getPreview()"
|
||||
class="q-mr-sm"
|
||||
color="primary"
|
||||
/>
|
||||
<QBtn
|
||||
:disabled="isLoading || canChangePassword"
|
||||
:label="t('globals.save')"
|
||||
:loading="isLoading"
|
||||
color="primary"
|
||||
type="submit"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</FormModel>
|
||||
</template>
|
||||
|
@ -240,4 +299,5 @@ es:
|
|||
Since: Desde
|
||||
Its only used when sample is sent: Se utiliza únicamente cuando se envía la plantilla
|
||||
To who should the recipient replay?: ¿A quien debería responder el destinatario?
|
||||
Preview: Vista previa
|
||||
</i18n>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
|
||||
const closeButton = ref(null);
|
||||
|
||||
const $props = defineProps({
|
||||
htmlContent: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<QDialog ref="dialogRef">
|
||||
<QCard class="q-pa-lg">
|
||||
<QCardSection>
|
||||
<span ref="closeButton" class="row justify-end close-icon" v-close-popup>
|
||||
<QIcon name="close" size="sm" />
|
||||
</span>
|
||||
<div>{{ $props.htmlContent }}</div>
|
||||
<template>
|
||||
<div v-html="$props.htmlContent"></div>
|
||||
</template>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QDialog>
|
||||
</template>
|
Loading…
Reference in New Issue
No hay notificación de guardado?
Corregido:
ab20ec1738