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>
import { reactive, ref, onMounted, nextTick } from 'vue';
import { reactive, ref, onMounted, nextTick, computed } from 'vue';
import { useI18n } from 'vue-i18n';
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 VnRow from 'components/ui/VnRow.vue';
import FormModelPopup from './FormModelPopup.vue';
import { useState } from 'src/composables/useState';
defineProps({ showEntityField: { type: Boolean, default: true } });
const emit = defineEmits(['onDataSaved']);
const { t } = useI18n();
const bicInputRef = ref(null);
const state = useState();
const customer = computed(() => state.get('customer'));
const bankEntityFormData = reactive({
name: null,
bic: null,
countryFk: null,
countryFk: customer.value.countryFk,
id: null,
});

View File

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

View File

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

View File

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

View File

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