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]); const emit = defineEmits(['confirm', 'cancel', ...useDialogPluginComponent.emits]);
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
useDialogPluginComponent(); useDialogPluginComponent();
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
const title = props.title || t('Confirm'); const title = props.title || t('Confirm');
const message = const message =

View File

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

View File

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

View File

@ -233,7 +233,20 @@ onMounted(() => {
v-model="data.clientFk" v-model="data.clientFk"
:label="t('module.customer')" :label="t('module.customer')"
@update:model-value="(id) => fetchClientAddress(id, data)" @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 <VnSelect
v-model="data.addressId" v-model="data.addressId"
:options="addressesList" :options="addressesList"
@ -245,10 +258,21 @@ onMounted(() => {
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel> <QItemLabel
{{ scope.opt?.nickname }}: {{ scope.opt?.street }}, :class="{
{{ scope.opt?.city }}</QItemLabel 'color-vn-label': !scope.opt?.isActive,
}"
> >
{{
`${
!scope.opt?.isActive
? t('basicData.inactive')
: ''
} `
}}
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
{{ scope.opt?.city }}
</QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </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 ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue'; import VnToSummary from 'src/components/ui/VnToSummary.vue';
const route = useRoute(); const route = useRoute();
@ -87,10 +86,6 @@ async function changeState(value) {
function toTicketUrl(section) { function toTicketUrl(section) {
return '#/ticket/' + entityId.value + '/' + section; return '#/ticket/' + entityId.value + '/' + section;
} }
function isOnTicketCard() {
const currentPath = route.path;
return currentPath.startsWith('/ticket');
}
</script> </script>
<template> <template>

View File

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