feat: refs #8246 added new field in list
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
27f7b6ce29
commit
b0cb3597de
|
@ -17,6 +17,7 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
|
|||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
||||
import ZoneSearchbar from './Card/ZoneSearchbar.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
@ -25,6 +26,7 @@ const { viewSummary } = useSummaryDialog();
|
|||
const { openConfirmationModal } = useVnConfirm();
|
||||
const tableRef = ref();
|
||||
const warehouseOptions = ref([]);
|
||||
const validAddresses = ref([]);
|
||||
|
||||
const tableFilter = {
|
||||
include: [
|
||||
|
@ -34,6 +36,32 @@ const tableFilter = {
|
|||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'address',
|
||||
scope: {
|
||||
fields: ['id', 'nickname', 'provinceFk', 'postalCode'],
|
||||
include: [
|
||||
{
|
||||
relation: 'province',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'postcode',
|
||||
scope: {
|
||||
fields: ['code', 'townFk'],
|
||||
include: {
|
||||
relation: 'town',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -95,7 +123,14 @@ const columns = computed(() => [
|
|||
label: t('list.close'),
|
||||
cardVisible: true,
|
||||
format: (row) => toTimeFormat(row.hour),
|
||||
hidden: true,
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'addressFk',
|
||||
label: t('list.addressFk'),
|
||||
cardVisible: true,
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
|
@ -129,9 +164,27 @@ const handleClone = (id) => {
|
|||
() => clone(id)
|
||||
);
|
||||
};
|
||||
|
||||
function showValidAddresses(row) {
|
||||
if (row.addressFk) {
|
||||
const isValid = validAddresses.value.some(
|
||||
(address) => address.addressFk === row.addressFk
|
||||
);
|
||||
if (isValid)
|
||||
return `${row.address?.nickname},
|
||||
${row.address?.postcode?.town?.name} (${row.address?.province?.name})`;
|
||||
else return '-';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="RoadmapAddresses"
|
||||
auto-load
|
||||
@on-fetch="(data) => (validAddresses = data)"
|
||||
/>
|
||||
<ZoneSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
|
@ -153,6 +206,9 @@ const handleClone = (id) => {
|
|||
redirect="zone"
|
||||
:right-search="false"
|
||||
>
|
||||
<template #column-addressFk="{ row }">
|
||||
{{ showValidAddresses(row) }}
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnSelect
|
||||
url="AgencyModes"
|
||||
|
|
|
@ -32,6 +32,7 @@ list:
|
|||
warehouse: Warehouse
|
||||
createZone: Create zone
|
||||
zoneSummary: Summary
|
||||
addressFk: Address
|
||||
create:
|
||||
name: Name
|
||||
closingHour: Closing hour
|
||||
|
|
|
@ -33,6 +33,7 @@ list:
|
|||
isVolumetric: Volumétrico
|
||||
createZone: Crear zona
|
||||
zoneSummary: Resumen
|
||||
addressFk: Consignatario
|
||||
create:
|
||||
closingHour: Hora de cierre
|
||||
itemMaxSize: Medida máxima
|
||||
|
|
Loading…
Reference in New Issue