#8201: Fix descriptor icons error #1080

Merged
jon merged 12 commits from 8201-DescriptorIcons into dev 2024-12-27 09:55:46 +00:00
6 changed files with 19 additions and 25 deletions

View File

@ -53,7 +53,6 @@ const hasAccount = ref(false);
<AccountDescriptorMenu :has-account="hasAccount" /> <AccountDescriptorMenu :has-account="hasAccount" />
</template> </template>
<template #before> <template #before>
<!-- falla id :id="entityId.value" collection="user" size="160x160" -->
<VnImg :id="entityId" collection="user" resolution="520x520" class="photo"> <VnImg :id="entityId" collection="user" resolution="520x520" class="photo">
<template #error> <template #error>
<div <div
@ -75,7 +74,7 @@ const hasAccount = ref(false);
<VnLv :label="t('account.card.nickname')" :value="entity.name" /> <VnLv :label="t('account.card.nickname')" :value="entity.name" />
<VnLv :label="t('account.card.role')" :value="entity.role.name" /> <VnLv :label="t('account.card.role')" :value="entity.role.name" />
</template> </template>
<template #actions="{ entity }"> <template #icons="{ entity }">
<QCardActions class="q-gutter-x-md"> <QCardActions class="q-gutter-x-md">
jon marked this conversation as resolved Outdated

en el archivo solo hay una ocurrencia de accountData

en el archivo solo hay una ocurrencia de accountData
<QIcon <QIcon
v-if="!entity.active" v-if="!entity.active"
@ -83,7 +82,7 @@ const hasAccount = ref(false);
name="vn:disabled" name="vn:disabled"
flat flat
round round
size="sm" size="xs"
class="fill-icon" class="fill-icon"
> >
<QTooltip>{{ t('account.card.deactivated') }}</QTooltip> <QTooltip>{{ t('account.card.deactivated') }}</QTooltip>
@ -91,10 +90,10 @@ const hasAccount = ref(false);
<QIcon <QIcon
color="primary" color="primary"
name="contact_mail" name="contact_mail"
v-if="entity.hasAccount" v-if="hasAccount"
flat flat
round round
size="sm" size="xs"
jon marked this conversation as resolved Outdated

El tamaño es diferente, cambiar los sm por xs

El tamaño es diferente, cambiar los sm por xs
class="fill-icon" class="fill-icon"
> >
<QTooltip>{{ t('account.card.enabled') }}</QTooltip> <QTooltip>{{ t('account.card.enabled') }}</QTooltip>

View File

@ -164,19 +164,7 @@ const columns = computed(() => [
:autofocus="col.tabIndex == 1" :autofocus="col.tabIndex == 1"
input-debounce="0" input-debounce="0"
hide-selected hide-selected
> />
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.nickname }}
{{ scope.opt?.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectWorker>
<VnSelect <VnSelect
v-else v-else
v-model="row[col.model]" v-model="row[col.model]"

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -14,7 +14,12 @@ import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
const state = useState(); const state = useState();
const customer = computed(() => state.get('customer')); const customer = ref();
onMounted(async () => {
customer.value = state.get('customer');
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
});
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -38,7 +43,6 @@ const entityId = computed(() => {
const data = ref(useCardDescription()); const data = ref(useCardDescription());
const setData = (entity) => { const setData = (entity) => {
data.value = useCardDescription(entity?.name, entity?.id); data.value = useCardDescription(entity?.name, entity?.id);
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
}; };
const debtWarning = computed(() => { const debtWarning = computed(() => {
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary'; return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';

View File

@ -52,7 +52,7 @@ const { t } = useI18n();
<VnSelectWorker <VnSelectWorker
:label="t('department.bossDepartment')" :label="t('department.bossDepartment')"
v-model="data.workerFk" v-model="data.workerFk"
:rules="validate('department.workerFk')" :rules="validate('department.bossDepartment')"
/> />
<VnSelect <VnSelect
:label="t('department.selfConsumptionCustomer')" :label="t('department.selfConsumptionCustomer')"

View File

@ -6,9 +6,11 @@ import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import { useArrayData } from 'src/composables/useArrayData';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const arrayData = useArrayData();
const companySizes = [ const companySizes = [
{ id: 'small', name: t('globals.small'), size: '1-5' }, { id: 'small', name: t('globals.small'), size: '1-5' },
{ id: 'medium', name: t('globals.medium'), size: '6-50' }, { id: 'medium', name: t('globals.medium'), size: '6-50' },
@ -22,6 +24,7 @@ const companySizes = [
model="supplier" model="supplier"
auto-load auto-load
:clear-store-on-unmount="false" :clear-store-on-unmount="false"
@on-data-saved="arrayData.fetch({})"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<VnRow> <VnRow>

View File

@ -9,7 +9,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
import { toDateString } from 'src/filters'; import { toDateString } from 'src/filters';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import { useState } from 'src/composables/useState'; import { useArrayData } from 'src/composables/useArrayData';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -26,7 +26,7 @@ const $props = defineProps({
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const url = ref(); const url = ref();
const state = useState(); const arrayData = useArrayData();
const filter = { const filter = {
fields: [ fields: [
@ -77,7 +77,7 @@ const setData = (entity) => {
data.value = useCardDescription(entity.ref, entity.id); data.value = useCardDescription(entity.ref, entity.id);
}; };
const supplier = computed(() => state.get('supplier')); const supplier = computed(() => arrayData.store.data);
const getEntryQueryParams = (supplier) => { const getEntryQueryParams = (supplier) => {
if (!supplier) return null; if (!supplier) return null;