PR-CUSTOMER #186

Merged
jsegarra merged 105 commits from :PR-CUSTOMER into dev 2024-04-19 15:55:53 +00:00
6 changed files with 93 additions and 79 deletions
Showing only changes of commit 5e2c668fec - Show all commits

View File

@ -114,7 +114,7 @@ const toCustomerCreditCreate = () => {
</template>
</QTable>
<h5 class="flex justify-center label-color" v-else>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</QPage>
@ -127,12 +127,6 @@ const toCustomerCreditCreate = () => {
</QPageSticky>
</template>
<style lang="scss">
.label-color {
color: var(--vn-label);
}
</style>
<i18n>
es:
Since: Desde

View File

@ -22,7 +22,6 @@ const quasar = useQuasar();
const route = useRoute();
const showSmsDialog = () => {
console.log('showSmsDialog()');
quasar.dialog({
component: VnSmsDialog,
componentProps: {

View File

@ -226,7 +226,7 @@ const toCustomerFileManagementCreate = () => {
</template>
</QTable>
<h5 class="flex justify-center label-color" v-else>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</QPage>
@ -244,12 +244,6 @@ const toCustomerFileManagementCreate = () => {
</QPageSticky>
</template>
<style lang="scss">
.label-color {
color: var(--vn-label);
}
</style>
<i18n>
es:
Id: Id

View File

@ -119,7 +119,7 @@ const columns = computed(() => [
</template>
</QTable>
<h5 class="flex justify-center label-color" v-else>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</QPage>

View File

@ -1,24 +1,41 @@
<script setup>
jsegarra marked this conversation as resolved
Review

Falta botón de cambiar contraseña
Los campos no son clearables

Falta botón de cambiar contraseña Los campos no son clearables
Review

Corregido: c0a9835e80

Corregido: c0a9835e80
Review

Aparece el botón de cambiar contraseña, sin embargo, el formato del layout no es el estándar

Aparece el botón de cambiar contraseña, sin embargo, el formato del layout no es el estándar
Review

Corregido: ebd1ee07f4

Corregido: ebd1ee07f4
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import axios from 'axios';
import { useQuasar } from 'quasar';
import { useValidator } from 'src/composables/useValidator';
import useNotify from 'src/composables/useNotify';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';

desde salix http://localhost:9000/#/customer/1101/web-access cambio BruceWayne por BruceWayne4 y funciona, desde http://localhost:9000/#/customer/1101/web-access me da dos errores

message
"ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id=1101' at line 1"
name
"Error"
sql

"UPDATE account.user SET WHERE id=1101"

Parece que en el set falta el name = xx

desde salix http://localhost:9000/#/customer/1101/web-access cambio BruceWayne por BruceWayne4 y funciona, desde http://localhost:9000/#/customer/1101/web-access me da dos errores message : "ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `id`=1101' at line 1" name : "Error" sql : "UPDATE `account`.`user` SET WHERE `id`=1101" Parece que en el set falta el name = xx

Corregido: 5e2c668fec

Corregido: 5e2c668fec

Yo lo he visto OK

Yo lo he visto OK
const { notify } = useNotify();
const { t } = useI18n();
const { validate } = useValidator();
const quasar = useQuasar();
const route = useRoute();
const updateUserRef = ref(null);
const active = ref(false);
const canChangePassword = ref(0);
const userPasswords = ref(0);
const email = ref(null);
const isLoading = ref(false);
const name = ref(null);
const usersPreviewRef = ref(null);
const user = ref([]);
const userPasswords = ref(0);
const dataChanges = computed(() => {
return (
user.value.active !== active.value ||
user.value.email !== email.value ||
user.value.name !== name.value
);
});
const filter = { where: { id: `${route.params.id}` } };
@ -28,17 +45,46 @@ const showChangePasswordDialog = () => {
componentProps: {
id: route.params.id,
userPasswords: userPasswords.value,
promise: refreshData,
promise: getData,
},
});
};
const refreshData = () => {
updateUserRef.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 onSubmit = async () => {
isLoading.value = true;
const payload = {
active: active.value,
email: email.value,
name: name.value,
};
try {
await axios.patch(`Clients/${route.params.id}/updateUser`, payload);
notify('globals.dataSaved', 'positive');
if (usersPreviewRef.value) usersPreviewRef.value.fetch();
} catch (error) {
notify('errors.create', 'negative');
} finally {
isLoading.value = false;
}
};
</script>
<template>
<FetchData
:filter="filter"
@on-fetch="getData"
auto-load
ref="usersPreviewRef"
url="VnUsers/preview"
/>
<FetchData
:url="`Clients/${route.params.id}/hasCustomerRole`"
@on-fetch="(data) => (canChangePassword = data)"
@ -50,58 +96,39 @@ const refreshData = () => {
url="UserPasswords"
/>
<FormModel
:default-actions="false"
:filter="filter"
:observe-form-changes="false"
:url-update="`Clients/${route.params.id}/updateUser`"
:url="'VnUsers/preview'"
model="client"
ref="updateUserRef"
>
<template #form="{ data, validate }">
<div v-if="data?.length">
<div
v-for="(item, index) in data"
:key="index"
:class="{
'q-mb-md': index < data.length - 1,
}"
>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox
:label="t('Enable web access')"
v-model="item.active"
/>
</div>
</VnRow>
<QCard class="q-pa-lg">
<QCardSection>
<QForm @submit.prevent="onSubmit">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox :label="t('Enable web access')" v-model="active" />
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput :label="t('User')" clearable v-model="item.name" />
</div>
<div class="col">
<VnInput
:label="t('Recovery email')"
:rules="validate('client.email')"
clearable
type="email"
v-model="item.email"
>
<template #append>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t(
'This email is used for user to regain access their account'
)
}}</QTooltip>
</QIcon>
</template>
</VnInput>
</div>
</VnRow>
</div>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput :label="t('User')" clearable v-model="name" />
</div>
<div class="col">
<VnInput
:label="t('Recovery email')"
:rules="validate('client.email')"
clearable
type="email"
v-model="email"
>
<template #append>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t(
'This email is used for user to regain access their account'
)
}}</QTooltip>
</QIcon>
</template>
</VnInput>
</div>
</VnRow>
<div class="q-mt-lg row justify-end">
<QBtn
@ -124,16 +151,16 @@ const refreshData = () => {
v-if="canChangePassword"
/>

ubicar el mail bajo del usuario como en salix, solo hay 3 campos la lectura es mas facil

ubicar el mail bajo del usuario como en salix, solo hay 3 campos la lectura es mas facil

Corregido: 3bcd4984f5

Corregido: 3bcd4984f5

Lo veo OK

Lo veo OK
<QBtn
:disabled="isLoading || canChangePassword"
:disabled="isLoading || !dataChanges"
:label="t('globals.save')"
:loading="isLoading"
color="primary"
type="submit"
/>
</div>
</div>
</template>
</FormModel>
</QForm>
</QCardSection>
</QCard>
</template>
<i18n>

View File

@ -129,7 +129,7 @@ const refreshData = () => {
</template>
</QTable>
<h5 class="flex justify-center label-color" v-else>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</QPage>