diff --git a/src/pages/Zone/Card/ZoneBasicData.vue b/src/pages/Zone/Card/ZoneBasicData.vue
index c38da614c..52fb12b35 100644
--- a/src/pages/Zone/Card/ZoneBasicData.vue
+++ b/src/pages/Zone/Card/ZoneBasicData.vue
@@ -1,7 +1,7 @@
@@ -28,7 +33,11 @@ const agencyOptions = ref([]);
auto-load
url="AgencyModes/isActive"
/>
-
+ (validAddresses = data)"
+ />
@@ -128,6 +137,8 @@ const agencyOptions = ref([]);
hide-selected
map-options
:rules="validate('data.addressFk')"
+ :filter-options="['id']"
+ :where="filterWhere"
/>
diff --git a/src/pages/Zone/Card/ZoneSearchbar.vue b/src/pages/Zone/Card/ZoneSearchbar.vue
index f7a59e97f..dd6a1cc3f 100644
--- a/src/pages/Zone/Card/ZoneSearchbar.vue
+++ b/src/pages/Zone/Card/ZoneSearchbar.vue
@@ -28,9 +28,6 @@ const exprBuilder = (param, value) => {
({
include: [
{
relation: 'agencyMode',
@@ -63,7 +61,7 @@ const tableFilter = {
},
},
],
-};
+}));
const columns = computed(() => [
{
@@ -165,26 +163,14 @@ const handleClone = (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 '-';
+function formatRow(row) {
+ if (!row?.address) return '-';
+ return dashIfEmpty(`${row?.address?.nickname},
+ ${row?.address?.postcode?.town?.name} (${row?.address?.province?.name})`);
}
- (validAddresses = data)"
- />
@@ -207,7 +193,7 @@ function showValidAddresses(row) {
:right-search="false"
>
- {{ showValidAddresses(row) }}
+ {{ dashIfEmpty(formatRow(row)) }}