refactor: refs #8201 added onMounted to stablish the value to show icons
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2024-12-17 06:27:03 +01:00
parent 7fc0d0bcfe
commit fe1d9e93a3
3 changed files with 11 additions and 17 deletions

View File

@ -164,19 +164,7 @@ const columns = computed(() => [
:autofocus="col.tabIndex == 1"
input-debounce="0"
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
v-else
v-model="row[col.model]"

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
@ -14,7 +14,13 @@ import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
import { useState } from 'src/composables/useState';
const state = useState();
const customer = computed(() => state.get('customer'));
const customer = ref();
onMounted(async () => {
console.log('state.get(customer): ', state.get('customer'));
customer.value = state.get('customer');
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
});
const $props = defineProps({
id: {
@ -38,7 +44,6 @@ const entityId = computed(() => {
const data = ref(useCardDescription());
const setData = (entity) => {
data.value = useCardDescription(entity?.name, entity?.id);
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
};
const debtWarning = computed(() => {
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
@ -94,6 +99,7 @@ const debtWarning = computed(() => {
/>
</template>
<template #icons>
{{ console.log('customer: ', customer) }}
<QCardActions v-if="customer" class="q-gutter-x-md">
<QIcon
v-if="!customer.isActive"

View File

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