Merge branch 'dev' into Fix-OrderCatalogAddToOrder
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:
commit
585bb9973e
|
@ -18,7 +18,12 @@ import VnInput from 'components/common/VnInput.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const $attrs = useAttrs();
|
const originalAttrs = useAttrs();
|
||||||
|
|
||||||
|
const $attrs = computed(() => {
|
||||||
|
const { style, ...rest } = originalAttrs;
|
||||||
|
return rest;
|
||||||
|
});
|
||||||
|
|
||||||
const isRequired = computed(() => {
|
const isRequired = computed(() => {
|
||||||
return Object.keys($attrs).includes('required')
|
return Object.keys($attrs).includes('required')
|
||||||
|
|
|
@ -86,7 +86,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.zone')">
|
<VnLv v-if="entity.ticket?.zone?.id" :label="t('claim.zone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ entity.ticket?.zone?.name }}
|
{{ entity.ticket?.zone?.name }}
|
||||||
|
@ -98,11 +98,10 @@ onMounted(async () => {
|
||||||
:label="t('claim.province')"
|
:label="t('claim.province')"
|
||||||
:value="entity.ticket?.address?.province?.name"
|
:value="entity.ticket?.address?.province?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('claim.ticketId')">
|
<VnLv v-if="entity.ticketFk" :label="t('claim.ticketId')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ entity.ticketFk }}
|
{{ entity.ticketFk }}
|
||||||
|
|
||||||
<TicketDescriptorProxy :id="entity.ticketFk" />
|
<TicketDescriptorProxy :id="entity.ticketFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed, useAttrs } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
@ -7,6 +7,7 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
|
const $attrs = useAttrs();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: { type: [Number, String], default: null },
|
id: { type: [Number, String], default: null },
|
||||||
|
|
|
@ -131,7 +131,7 @@ const STATE_COLOR = {
|
||||||
prefix="claim"
|
prefix="claim"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Claims/filter',
|
url: 'Claims/filter',
|
||||||
order: ['cs.priority ASC', 'created ASC'],
|
order: 'cs.priority ASC, created ASC',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'src/components/FormModel.vue';
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -7,10 +9,33 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const agencyFilter = {
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'name ASC',
|
||||||
|
limit: 30,
|
||||||
|
};
|
||||||
|
const agencyOptions = ref([]);
|
||||||
|
const validAddresses = ref([]);
|
||||||
|
|
||||||
|
const filterWhere = computed(() => ({
|
||||||
|
id: { inq: validAddresses.value.map((item) => item.addressFk) },
|
||||||
|
}));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FormModel :url="`Zones/${$route.params.id}`" auto-load model="zone">
|
<FetchData
|
||||||
|
:filter="agencyFilter"
|
||||||
|
@on-fetch="(data) => (agencyOptions = data)"
|
||||||
|
auto-load
|
||||||
|
url="AgencyModes/isActive"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="RoadmapAddresses"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (validAddresses = data)"
|
||||||
|
/>
|
||||||
|
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -109,6 +134,8 @@ const { t } = useI18n();
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:rules="validate('data.addressFk')"
|
:rules="validate('data.addressFk')"
|
||||||
|
:filter-options="['id']"
|
||||||
|
:where="filterWhere"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -22,15 +22,50 @@ const exprBuilder = (param, value) => {
|
||||||
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
|
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const tableFilter = {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'agencyMode',
|
||||||
|
scope: {
|
||||||
|
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'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="ZonesList"
|
data-key="ZonesList"
|
||||||
url="Zones"
|
url="Zones"
|
||||||
:filter="{
|
:filter="tableFilter"
|
||||||
include: { relation: 'agencyMode', scope: { fields: ['name'] } },
|
|
||||||
}"
|
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:label="t('list.searchZone')"
|
:label="t('list.searchZone')"
|
||||||
:info="t('list.searchInfo')"
|
:info="t('list.searchInfo')"
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useRouter } from 'vue-router';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import { toCurrency } from 'src/filters';
|
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||||
import { toTimeFormat } from 'src/filters/date';
|
import { toTimeFormat } from 'src/filters/date';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
@ -17,7 +17,6 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
||||||
import ZoneSearchbar from './Card/ZoneSearchbar.vue';
|
import ZoneSearchbar from './Card/ZoneSearchbar.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -26,7 +25,6 @@ const { viewSummary } = useSummaryDialog();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const warehouseOptions = ref([]);
|
const warehouseOptions = ref([]);
|
||||||
const validAddresses = ref([]);
|
|
||||||
|
|
||||||
const tableFilter = {
|
const tableFilter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -161,30 +159,18 @@ const handleClone = (id) => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('list.confirmCloneTitle'),
|
t('list.confirmCloneTitle'),
|
||||||
t('list.confirmCloneSubtitle'),
|
t('list.confirmCloneSubtitle'),
|
||||||
() => clone(id)
|
() => clone(id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function showValidAddresses(row) {
|
function formatRow(row) {
|
||||||
if (row.addressFk) {
|
if (!row?.address) return '-';
|
||||||
const isValid = validAddresses.value.some(
|
return dashIfEmpty(`${row?.address?.nickname},
|
||||||
(address) => address.addressFk === row.addressFk
|
${row?.address?.postcode?.town?.name} (${row?.address?.province?.name})`);
|
||||||
);
|
|
||||||
if (isValid)
|
|
||||||
return `${row.address?.nickname},
|
|
||||||
${row.address?.postcode?.town?.name} (${row.address?.province?.name})`;
|
|
||||||
else return '-';
|
|
||||||
}
|
|
||||||
return '-';
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="RoadmapAddresses"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (validAddresses = data)"
|
|
||||||
/>
|
|
||||||
<ZoneSearchbar />
|
<ZoneSearchbar />
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -207,7 +193,7 @@ function showValidAddresses(row) {
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
>
|
>
|
||||||
<template #column-addressFk="{ row }">
|
<template #column-addressFk="{ row }">
|
||||||
{{ showValidAddresses(row) }}
|
{{ dashIfEmpty(formatRow(row)) }}
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
Loading…
Reference in New Issue