0
0
Fork 0

Solucion a comentarios 11

This commit is contained in:
carlosfonseca 2024-02-16 13:12:57 -05:00
parent 17a0afda73
commit ebd1ee07f4
15 changed files with 267 additions and 151 deletions

View File

@ -154,6 +154,7 @@ export default {
customerId: 'Claim ID',
salesPerson: 'Sales person',
credit: 'Credit',
risk: 'Risk',
securedCredit: 'Secured credit',
payMethod: 'Pay method',
debt: 'Debt',

View File

@ -153,6 +153,7 @@ export default {
customerId: 'ID cliente',
salesPerson: 'Comercial',
credit: 'Crédito',
risk: 'Riesgo',
securedCredit: 'Crédito asegurado',
payMethod: 'Método de pago',
debt: 'Riesgo',

View File

@ -77,9 +77,20 @@ const onSubmit = async () => {
</script>
<template>
<Teleport to="#st-actions">
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
@click="onSubmit"
color="primary"
icon="save"
/>
</Teleport>
<QCard class="q-pa-lg">
<QCardSection>
<QForm @submit.prevent="onSubmit">
<QForm>
<VnRow
:key="index"
class="row q-gutter-md q-mb-md"
@ -113,11 +124,9 @@ const onSubmit = async () => {
</div>
</VnRow>
<div class="flex justify-between q-mt-xl">
<div class="flex items-center">
<QIcon
@click.stop="addNote({ name: '', phone: '', isNew: true })"
class="cursor-pointer add-icon"
class="cursor-pointer add-icon q-mt-lg"
name="add"
size="sm"
>
@ -125,16 +134,6 @@ const onSubmit = async () => {
{{ t('Add contact') }}
</QTooltip>
</QIcon>
</div>
<QBtn
:label="t('globals.save')"
type="submit"
color="primary"
:disabled="isLoading"
:loading="isLoading"
/>
</div>
</QForm>
</QCardSection>
</QCard>

View File

@ -57,7 +57,21 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
/>
</template>
</VnLv>
<VnLv :label="t('customer.card.credit')" :value="toCurrency(entity.credit)" />
<VnLv
:label="t('customer.card.credit')"
:value="toCurrency(entity.credit)"
class="col-11"
/>
<div class="row">
<VnLv
:label="t('customer.card.risk')"
:value="toCurrency(entity.debt)"
class="col-11"
/>
<QIcon name="info" size="xs" class="col-1 color-vn-label">
<QTooltip>{{ t('info') }}</QTooltip>
</QIcon>
</div>
<VnLv
:label="t('customer.card.securedCredit')"
:value="toCurrency(entity.creditInsurance)"
@ -155,11 +169,13 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
{
"en": {
"ticketList": "Customer ticket list",
"invoiceOutList": "Customer invoice out list"
"invoiceOutList": "Customer invoice out list",
"info": "Invoices minus payments plus orders not yet"
},
"es": {
"ticketList": "Listado de tickets del cliente",
"invoiceOutList": "Listado de facturas del cliente"
"invoiceOutList": "Listado de facturas del cliente",
"info": "Facturas menos recibos mas pedidos sin facturar"
}
}
</i18n>

View File

@ -45,16 +45,17 @@ const showChangePasswordDialog = () => {
componentProps: {
id: route.params.id,
userPasswords: userPasswords.value,
promise: getData,
promise: usersPreviewRef.value.fetch(),
},
});
};
const getData = (data) => {
active.value = data[0].active;
email.value = data[0].email;
name.value = data[0].name;
user.value = data[0];
const setInitialData = () => {
if (user.value.length) {
active.value = user.value[0].active;
email.value = user.value[0].email;
name.value = user.value[0].name;
}
};
const onSubmit = async () => {
@ -80,7 +81,12 @@ const onSubmit = async () => {
<template>
<FetchData
:filter="filter"
@on-fetch="getData"
@on-fetch="
(data) => {
user = data;
setInitialData();
}
"
auto-load
ref="usersPreviewRef"
url="VnUsers/preview"
@ -96,9 +102,42 @@ const onSubmit = async () => {
url="UserPasswords"
/>
<Teleport to="#st-actions">
<QBtnGroup push class="q-gutter-x-sm">
<QBtn
:disabled="isLoading"
:label="t('globals.reset')"
:loading="isLoading"
@click="setInitialData"
color="primary"
flat
icon="restart_alt"
type="reset"
/>
<QBtn
:disabled="isLoading"
:label="t('Change password')"
:loading="isLoading"
@click.stop="showChangePasswordDialog()"
color="primary"
flat
icon="edit"
v-if="canChangePassword"
/>
<QBtn
:disabled="isLoading || !dataChanges"
:label="t('globals.save')"
:loading="isLoading"
@click="onSubmit"
color="primary"
icon="save"
/>
</QBtnGroup>
</Teleport>
<QCard class="q-pa-lg">
<QCardSection>
<QForm @submit.prevent="onSubmit">
<QForm>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox :label="t('Enable web access')" v-model="active" />
@ -129,35 +168,6 @@ const onSubmit = async () => {
</VnInput>
</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('Change password')"
:loading="isLoading"
@click.stop="showChangePasswordDialog()"
class="q-mr-sm"
color="primary"
v-if="canChangePassword"
/>
<QBtn
:disabled="isLoading || !dataChanges"
:label="t('globals.save')"
:loading="isLoading"
color="primary"
type="submit"
/>
</div>
</QForm>
</QCardSection>
</QCard>

View File

@ -95,6 +95,16 @@ const toCustomerAddress = () => {
@on-data-saved="toCustomerAddress()"
model="client"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerAddress"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -1,7 +1,7 @@
<script setup>
import { onBeforeMount, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
@ -16,6 +16,7 @@ import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCus
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const townsFetchDataRef = ref(null);
const postcodeFetchDataRef = ref(null);
@ -91,11 +92,21 @@ const deleteNote = (index) => {
notes.value.splice(index, 1);
};
const onDataSaved = () => {
const onDataSaved = async () => {
const payload = {
creates: notes.value,
};
axios.post('AddressObservations/crud', payload);
await axios.post('AddressObservations/crud', payload);
toCustomerAddress();
};
const toCustomerAddress = () => {
router.push({
name: 'CustomerAddress',
params: {
id: route.params.id,
},
});
};
</script>
@ -138,6 +149,16 @@ const onDataSaved = () => {
auto-load
model="client"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerAddress"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -16,8 +16,8 @@ const initialData = reactive({
clientFK: Number(route.params.id),
});
const onDataSaved = () => {
router.push({ name: 'CustomerCreditContractsCreate' });
const toCustomerCreditContracts = () => {
router.push({ name: 'CustomerCreditContracts' });
};
</script>
@ -27,8 +27,18 @@ const onDataSaved = () => {
:observe-form-changes="false"
:default-actions="true"
url-create="creditClassifications/createWithInsurance"
@on-data-saved="onDataSaved()"
@on-data-saved="toCustomerCreditContracts()"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerCreditContracts"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -31,6 +31,16 @@ const toCustomerCredits = () => {
:url-update="`/Clients/${route.params.id}`"
@on-data-saved="toCustomerCredits()"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerCredits"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -26,6 +26,7 @@ const filterFindOne = { where: { code: 'paymentsLaw' } };
const filterCompanies = { order: ['code'] };
const filterWarehouses = { order: ['name'] };
const inputFileRef = ref();
const client = ref({});
const findOne = ref([]);
const allowedContentTypes = ref([]);
@ -67,13 +68,15 @@ const saveData = async () => {
params: dms.value,
});
notify('globals.dataSaved', 'positive');
router.push({ name: 'CustomerFileManagement' });
toCustomerFileManagement();
} catch (error) {
notify(error.message, 'negative');
}
};
const inputFileRef = ref();
const toCustomerFileManagement = () => {
router.push({ name: 'CustomerFileManagement' });
};
</script>
<template>
@ -112,9 +115,31 @@ const inputFileRef = ref();
url="DmsTypes"
/>
<QForm>
<Teleport to="#st-actions">
<QBtnGroup push class="q-gutter-x-sm">
<QBtn
:disabled="isLoading"
:label="t('globals.cancel')"
:loading="isLoading"
@click="toCustomerFileManagement"
color="primary"
flat
icon="close"
/>
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
@click.stop="saveData"
color="primary"
icon="save"
/>
</QBtnGroup>
</Teleport>
<QCard class="q-pa-lg">
<QCardSection>
<QForm>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
@ -210,27 +235,9 @@ const inputFileRef = ref();
:label="t('Generate identifier for original file')"
v-model="dms.hasFile"
/>
</QCardSection>
<QCardActions class="flex justify-end">
<QBtn
:disabled="isLoading"
:label="t('globals.cancel')"
:loading="isLoading"
class="q-mr-xl"
color="primary"
flat
/>
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
color="primary"
@click.stop="saveData"
/>
</QCardActions>
</QCard>
</QForm>
</QCardSection>
</QCard>
</template>
<i18n>

View File

@ -22,6 +22,7 @@ const router = useRouter();
const filterCompanies = { order: ['code'] };
const filterWarehouses = { order: ['name'] };
const inputFileRef = ref();
const allowedContentTypes = ref([]);
const optionsCompanies = ref([]);
const optionsWarehouses = ref([]);
@ -55,13 +56,15 @@ const saveData = async () => {
});
notify('globals.dataSaved', 'positive');
router.push({ name: 'CustomerFileManagement' });
toCustomerFileManagement();
} catch (error) {
notify(error.message, 'negative');
}
};
const inputFileRef = ref();
const toCustomerFileManagement = () => {
router.push({ name: 'CustomerFileManagement' });
};
</script>
<template>
@ -90,9 +93,31 @@ const inputFileRef = ref();
url="DmsTypes"
/>
<QForm>
<Teleport to="#st-actions">
<QBtnGroup push class="q-gutter-x-sm">
<QBtn
:disabled="isLoading"
:label="t('globals.cancel')"
:loading="isLoading"
@click="toCustomerFileManagement"
color="primary"
flat
icon="close"
/>
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
@click.stop="saveData"
color="primary"
icon="save"
/>
</QBtnGroup>
</Teleport>
<QCard class="q-pa-lg">
<QCardSection>
<QForm>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
@ -189,27 +214,9 @@ const inputFileRef = ref();
v-model="dms.hasFile"
disable
/>
</QCardSection>
<QCardActions class="flex justify-end">
<QBtn
:disabled="isLoading"
:label="t('globals.cancel')"
:loading="isLoading"
class="q-mr-xl"
color="primary"
flat
/>
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
color="primary"
@click.stop="saveData"
/>
</QCardActions>
</QCard>
</QForm>
</QCardSection>
</QCard>
</template>
<i18n>

View File

@ -47,6 +47,16 @@ const toCustomerGreuges = () => {
model="client"
url-create="Greuges"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerGreuges"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -35,6 +35,16 @@ const toCustomerNotes = () => {
@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">
<div class="col">

View File

@ -41,6 +41,16 @@ const toCustomerRecoveries = () => {
model="client"
url-create="Recoveries"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerRecoveries"
color="primary"
flat
icon="close"
/>
</template>
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">

View File

@ -94,7 +94,7 @@ const onDataSaved = async ({
recipient,
replyTo,
});
router.push({ name: 'CustomerSamples' });
toCustomerSamples();
};
const getPreview = async () => {
@ -122,6 +122,10 @@ const getPreview = async () => {
return error;
}
};
const toCustomerSamples = () => {
router.push({ name: 'CustomerSamples' });
};
</script>
<template>
@ -151,13 +155,31 @@ const getPreview = async () => {
/>
<FormModel
:default-actions="false"
:form-initial-data="initialData"
:observe-form-changes="false"
@on-data-saved="onDataSaved"
model="client"
url-create="ClientSamples"
>
<template #moreActions>
<QBtn
:label="t('globals.cancel')"
@click="toCustomerSamples"
color="primary"
flat
icon="close"
/>
<QBtn
:disabled="isLoading || !sampleType.hasPreview"
:label="t('Preview')"
:loading="isLoading"
@click.stop="getPreview()"
color="primary"
flat
icon="preview"
/>
</template>
<template #form="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
@ -266,34 +288,6 @@ const getPreview = 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 || !sampleType.hasPreview"
:label="t('Preview')"
:loading="isLoading"
@click.stop="getPreview()"
class="q-mr-sm"
color="primary"
/>
<QBtn
:disabled="isLoading"
:label="t('globals.save')"
:loading="isLoading"
color="primary"
type="submit"
/>
</div>
</template>
</FormModel>
</template>