0
0
Fork 0

feat: copy customer countryFk

This commit is contained in:
Javier Segarra 2024-08-29 14:23:18 +02:00
parent 375e65aed0
commit c727e5f669
5 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { reactive, ref, onMounted, nextTick } from 'vue'; import { reactive, ref, onMounted, nextTick, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
@ -7,16 +7,21 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import FormModelPopup from './FormModelPopup.vue'; import FormModelPopup from './FormModelPopup.vue';
import { useState } from 'src/composables/useState';
defineProps({ showEntityField: { type: Boolean, default: true } }); defineProps({ showEntityField: { type: Boolean, default: true } });
const emit = defineEmits(['onDataSaved']); const emit = defineEmits(['onDataSaved']);
const { t } = useI18n(); const { t } = useI18n();
const bicInputRef = ref(null); const bicInputRef = ref(null);
const state = useState();
const customer = computed(() => state.get('customer'));
const bankEntityFormData = reactive({ const bankEntityFormData = reactive({
name: null, name: null,
bic: null, bic: null,
countryFk: null, countryFk: customer.value.countryFk,
id: null, id: null,
}); });

View File

@ -25,6 +25,7 @@ const title = ref();
/> />
<FetchData <FetchData
url="BusinessTypes" url="BusinessTypes"
:filter="{ fields: ['code', 'description'], order: 'description ASC ' }"
@on-fetch="(data) => (businessTypes = data)" @on-fetch="(data) => (businessTypes = data)"
auto-load auto-load
/> />

View File

@ -85,9 +85,8 @@ const getBankEntities = (data, formData) => {
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection v-if="scope.opt"> <QItemSection v-if="scope.opt">
<QItemLabel <QItemLabel>{{ scope.opt.bic }} </QItemLabel>
>{{ scope.opt.bic }} {{ scope.opt.name }}</QItemLabel <QItemLabel caption> {{ scope.opt.name }}</QItemLabel>
>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -98,7 +98,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip> <QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="!customer.account.active" v-if="!customer.account?.active"
color="primary" color="primary"
name="vn:noweb" name="vn:noweb"
size="xs" size="xs"

View File

@ -353,7 +353,7 @@ const columns = computed(() => [
{ {
title: t('Client ticket list'), title: t('Client ticket list'),
icon: 'vn:ticket', icon: 'vn:ticket',
action: redirectToCreateView, action: redirectToTicketsList,
isPrimary: true, isPrimary: true,
}, },
{ {
@ -367,11 +367,12 @@ const columns = computed(() => [
]); ]);
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const redirectToCreateView = (row) => { const redirectToTicketsList = (row) => {
router.push({ router.push({
name: 'TicketList', name: 'TicketList',
query: { query: {
params: JSON.stringify({ table: JSON.stringify({
clientFk: row.id, clientFk: row.id,
}), }),
}, },