0
0
Fork 0

Merge pull request 'fix: hotfix webAccess' (!1022) from hotfix-6943CustomerWebAccess into master

Reviewed-on: verdnatura/salix-front#1022
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Javier Segarra 2024-11-29 12:31:01 +00:00
commit d9d6819390
2 changed files with 12 additions and 10 deletions

View File

@ -42,13 +42,13 @@ async function hasCustomerRole() {
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<QCheckbox :label="t('Enable web access')" v-model="data.account.active" /> <QCheckbox :label="t('Enable web access')" v-model="data.account.active" />
<VnInput :label="t('User')" clearable v-model="data.name" /> <VnInput :label="t('User')" clearable v-model="data.account.name" />
<VnInput <VnInput
:label="t('Recovery email')" :label="t('Recovery email')"
:rules="validate('client.email')" :rules="validate('client.email')"
clearable clearable
type="email" type="email"
v-model="data.email" v-model="data.account.email"
class="q-mt-sm" class="q-mt-sm"
:info="t('This email is used for user to regain access their account')" :info="t('This email is used for user to regain access their account')"
/> />

View File

@ -18,8 +18,6 @@ const router = useRouter();
const formInitialData = reactive({ isDefaultAddress: false }); const formInitialData = reactive({ isDefaultAddress: false });
const urlCreate = ref('');
const agencyModes = ref([]); const agencyModes = ref([]);
const incoterms = ref([]); const incoterms = ref([]);
const customsAgents = ref([]); const customsAgents = ref([]);
@ -40,13 +38,18 @@ function handleLocation(data, location) {
data.countryFk = countryFk; data.countryFk = countryFk;
} }
function onAgentCreated(requestResponse, data) { function onAgentCreated({ id, fiscalName }, data) {
customsAgents.value.push(requestResponse); customsAgents.value.push({ id, fiscalName });
data.customsAgentFk = requestResponse.id; data.customsAgentFk = id;
} }
</script> </script>
<template> <template>
<FetchData
@on-fetch="(data) => (customsAgents = data)"
auto-load
url="CustomsAgents"
/>
<FetchData <FetchData
@on-fetch="(data) => (agencyModes = data)" @on-fetch="(data) => (agencyModes = data)"
auto-load auto-load
@ -57,7 +60,7 @@ function onAgentCreated(requestResponse, data) {
<FormModel <FormModel
:form-initial-data="formInitialData" :form-initial-data="formInitialData"
:observe-form-changes="false" :observe-form-changes="false"
:url-create="urlCreate" :url-create="`Clients/${route.params.id}/createAddress`"
@on-data-saved="toCustomerAddress()" @on-data-saved="toCustomerAddress()"
model="client" model="client"
> >
@ -141,8 +144,7 @@ function onAgentCreated(requestResponse, data) {
<template #form> <template #form>
<CustomerNewCustomsAgent <CustomerNewCustomsAgent
@on-data-saved=" @on-data-saved="
(_, requestResponse) => (requestResponse) => onAgentCreated(requestResponse, data)
onAgentCreated(requestResponse, data)
" "
/> />
</template> </template>