Merge pull request '#7206 added inactive label and corrected minor errors' (!889) from 7206-ModifySelectAddress into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #889
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jon Elias 2024-10-29 13:05:38 +00:00
commit e26fdfe4a3
6 changed files with 50 additions and 21 deletions

View File

@ -31,10 +31,10 @@ const props = defineProps({
});
const emit = defineEmits(['confirm', 'cancel', ...useDialogPluginComponent.emits]);
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
useDialogPluginComponent();
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
const title = props.title || t('Confirm');
const message =

View File

@ -63,7 +63,7 @@ const columns = computed(() => [
},
{
align: 'left',
format: (row) => row.agencyMode.name,
format: (row, dashIfEmpty) => dashIfEmpty(row.agencyMode?.name),
columnClass: 'expand',
label: t('Agency'),
},

View File

@ -10,7 +10,6 @@ import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import { useDialogPluginComponent } from 'quasar';
import { reactive } from 'vue';
import FetchData from 'components/FetchData.vue';
const { t } = useI18n();
const state = useState();

View File

@ -233,7 +233,20 @@ onMounted(() => {
v-model="data.clientFk"
:label="t('module.customer')"
@update:model-value="(id) => fetchClientAddress(id, data)"
/>
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt.name }}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
v-model="data.addressId"
:options="addressesList"
@ -245,10 +258,21 @@ onMounted(() => {
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
{{ scope.opt?.city }}</QItemLabel
<QItemLabel
:class="{
'color-vn-label': !scope.opt?.isActive,
}"
>
{{
`${
!scope.opt?.isActive
? t('basicData.inactive')
: ''
} `
}}
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
{{ scope.opt?.city }}
</QItemLabel>
</QItemSection>
</QItem>
</template>

View File

@ -19,7 +19,6 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
const route = useRoute();
@ -87,10 +86,6 @@ async function changeState(value) {
function toTicketUrl(section) {
return '#/ticket/' + entityId.value + '/' + section;
}
function isOnTicketCard() {
const currentPath = route.path;
return currentPath.startsWith('/ticket');
}
</script>
<template>

View File

@ -268,8 +268,7 @@ const fetchAddresses = async (formData) => {
if (!formData.clientId) return;
const filter = {
fields: ['nickname', 'street', 'city', 'id'],
where: { isActive: true },
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
order: 'nickname ASC',
};
const params = { filter: JSON.stringify(filter) };
@ -635,24 +634,36 @@ function setReference(data) {
</VnRow>
<VnRow>
<VnSelect
url="Addresses"
:label="t('ticket.create.address')"
:label="t('basicData.address')"
v-model="data.addressId"
:options="addressesOptions"
option-value="id"
option-label="nickname"
hide-selected
map-options
:disable="!data.clientId"
:sort-by="'isActive DESC'"
@update:model-value="() => fetchAvailableAgencies(data)"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt.nickname }}
</QItemLabel>
<QItemLabel caption>
{{ `${scope.opt.street}, ${scope.opt.city}` }}
<QItemLabel
:class="{
'color-vn-label': !scope.opt?.isActive,
}"
>
{{
`${
!scope.opt?.isActive
? t('basicData.inactive')
: ''
} `
}}
<span>
{{ scope.opt?.nickname }}:
{{ scope.opt?.street }}, {{ scope.opt?.city }}
</span>
</QItemLabel>
</QItemSection>
</QItem>