0
0
Fork 0

Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into CambiosSolicitadosSuppliers

This commit is contained in:
William Buezas 2024-02-26 11:25:03 -03:00
commit 59edfe8c0d
9 changed files with 135 additions and 59 deletions

View File

@ -188,16 +188,18 @@ const emit = defineEmits(['onFetch']);
.label {
color: var(--vn-label);
font-size: 12px;
width: 47%;
::after {
content: ':';
}
}
.value {
color: var(--vn-text);
font-size: 14px;
margin-left: 12px;
width: 47%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
.info {
margin-left: 5px;

View File

@ -1,8 +1,9 @@
<script setup>
import { computed } from 'vue';
import { dashIfEmpty } from 'src/filters';
import { useI18n } from 'vue-i18n';
import { useClipboard } from 'src/composables/useClipboard';
const $props = defineProps({
label: { type: String, default: null },
value: {
@ -13,8 +14,9 @@ const $props = defineProps({
dash: { type: Boolean, default: true },
copy: { type: Boolean, default: false },
});
const isBooleanValue = computed(() => typeof $props.value === 'boolean');
const { t } = useI18n();
const isBooleanValue = computed(() => typeof $props.value === 'boolean');
const { copyText } = useClipboard();
function copyValueText() {
@ -54,22 +56,29 @@ function copyValueText() {
</slot>
</div>
<div class="info" v-if="$props.info">
<QIcon name="info">
<QIcon name="info" class="cursor-pointer" size="xs" color="grey">
<QTooltip class="bg-dark text-white shadow-4" :offset="[10, 10]">
{{ $props.info }}
</QTooltip>
</QIcon>
</div>
<div class="copy" v-if="$props.copy && $props.value" @click="copyValueText()">
<QIcon name="Content_Copy" color="primary" />
<QIcon name="Content_Copy" color="primary">
<QTooltip>{{ t('globals.copyClipboard') }}</QTooltip>
</QIcon>
</div>
</div>
</template>
<style lang="scss" scoped>
.copy {
&:hover {
.vn-label-value:hover .copy {
visibility: visible;
cursor: pointer;
}
.copy {
visibility: hidden;
}
.info {
margin-left: 5px;
}
</style>

View File

@ -70,6 +70,7 @@ export default {
system: 'System',
fieldRequired: 'Field required',
allowedFilesText: 'Allowed file types: { allowedContentTypes }',
copyClipboard: 'Copy on clipboard',
},
errors: {
statusUnauthorized: 'Access denied',
@ -166,7 +167,7 @@ export default {
fiscalAddress: 'Fiscal address',
fiscalData: 'Fiscal data',
billingData: 'Billing data',
consignee: 'Consignee',
consignee: 'Default consignee',
businessData: 'Business data',
financialData: 'Financial data',
customerId: 'Customer ID',
@ -219,6 +220,8 @@ export default {
recoverySince: 'Recovery since',
businessType: 'Business Type',
city: 'City',
rating: 'Rating',
recommendCredit: 'Recommended credit',
},
basicData: {
socialName: 'Fiscal name',

View File

@ -70,6 +70,7 @@ export default {
system: 'Sistema',
fieldRequired: 'Campo requerido',
allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }',
copyClipboard: 'Copiar en portapapeles',
},
errors: {
statusUnauthorized: 'Acceso denegado',
@ -165,7 +166,7 @@ export default {
fiscalAddress: 'Dirección fiscal',
fiscalData: 'Datos fiscales',
billingData: 'Datos de facturación',
consignee: 'Consignatario',
consignee: 'Consignatario pred.',
businessData: 'Datos comerciales',
financialData: 'Datos financieros',
customerId: 'ID cliente',
@ -218,6 +219,8 @@ export default {
recoverySince: 'Recobro desde',
businessType: 'Tipo de negocio',
city: 'Población',
rating: 'Clasificación',
recommendCredit: 'Crédito recomendado',
},
basicData: {
socialName: 'Nombre fiscal',

View File

@ -35,7 +35,6 @@ const claimDmsFilter = ref({
relation: 'dms',
},
],
where: { claimFk: entityId.value },
});
onMounted(async () => {
@ -141,6 +140,11 @@ const claimDms = ref([]);
const multimediaDialog = ref();
const multimediaSlide = ref();
async function getClaimDms() {
claimDmsFilter.value.where = { claimFk: entityId.value };
await claimDmsRef.value.fetch();
}
function setClaimDms(data) {
claimDms.value = [];
data.forEach((media) => {
@ -163,10 +167,13 @@ function openDialog(dmsId) {
url="ClaimDms"
:filter="claimDmsFilter"
@on-fetch="(data) => setClaimDms(data)"
limit="20"
ref="claimDmsRef"
/>
<CardSummary ref="summary" :url="`Claims/${entityId}/getSummary`">
<CardSummary
ref="summary"
:url="`Claims/${entityId}/getSummary`"
@on-fetch="getClaimDms"
>
<template #header="{ entity: { claim } }">
{{ claim.id }} - {{ claim.client.name }}
</template>
@ -252,7 +259,8 @@ function openDialog(dmsId) {
>
<ItemDescriptorProxy
v-if="col.name == 'description'"
:id="2"
:id="props.row.id"
:sale-fk="props.row.saleFk"
></ItemDescriptorProxy>
</QTh>
</QTr>
@ -274,7 +282,6 @@ function openDialog(dmsId) {
</template>
</QTable>
</QCard>
<QCard class="vn-max" v-if="claimDms.length > 0">
<a class="header" :href="`#/claim/${entityId}/photos`">
{{ t('claim.summary.photos') }}

View File

@ -122,7 +122,7 @@ const creditWarning = computed(() => {
</QCard>
<QCard class="vn-one">
<a class="header link" :href="clientUrl + `fiscal-data`" link>
{{ t('customer.summary.fiscalAddress') }}
{{ t('customer.summary.fiscalData') }}
<QIcon name="open_in_new" color="primary" />
</a>
<VnLv
@ -235,7 +235,8 @@ const creditWarning = computed(() => {
link
>
{{ t('customer.summary.financialData') }}
<QIcon name="vn:grafana" color="primary" />
<QIcon name="open_in_new" color="primary" />
<!-- Pendiente de añadir el icono <QIcon name="vn:grafana" color="primary" /> -->
</a>
<VnLv
:label="t('customer.summary.risk')"
@ -276,7 +277,30 @@ const creditWarning = computed(() => {
:label="t('customer.summary.recoverySince')"
:value="toDate(entity.recovery.started)"
/>
<VnLv
:label="t('customer.summary.rating')"
:value="entity.rating"
:info="t('valueInfo', { min: 1, max: 20 })"
/>
<VnLv
:label="t('customer.summary.recommendCredit')"
:value="entity.recommendedCredit"
/>
</QCard>
</template>
</CardSummary>
</template>
<style lang="scss" scoped>
@media (min-width: $breakpoint-md) {
.summary .vn-one {
min-width: 300px;
}
}
</style>
<i18n>
en:
valueInfo: Value from {min} to {max}. The higher the better value
es:
valueInfo: Valor de {min} a {max}. Cuanto más alto, mejor valor
</i18n>

View File

@ -13,7 +13,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore';
import { dashIfEmpty, toDate } from 'src/filters';
import { toDate } from 'src/filters';
const { t } = useI18n();
const router = useRouter();
@ -477,17 +477,11 @@ const stopEventPropagation = (event, col) => {
event.stopPropagation();
};
const navigateToTravelId = (id) => {
router.push({ path: `/customer/${id}` });
};
const navigateToTravelId = (id) => router.push({ path: `/customer/${id}` });
const selectCustomerId = (id) => {
selectedCustomerId.value = id;
};
const selectCustomerId = (id) => (selectedCustomerId.value = id);
const selectSalesPersonId = (id) => {
selectedSalesPersonId.value = id;
};
const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id);
</script>
<template>
@ -521,37 +515,50 @@ const selectSalesPersonId = (id) => {
class="full-width q-mt-md"
row-key="id"
:visible-columns="visibleColumns"
@row-click="(evt, row, id) => navigateToTravelId(row.id)"
>
<template #body="props">
<QTr
:props="props"
@click="navigateToTravelId(props.row.id)"
class="cursor-pointer"
>
<QTd
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="stopEventPropagation($event, col)"
>
<template #body-cell="{ col, value }">
<QTd @click="stopEventPropagation($event, col)">
{{ value }}
</QTd>
</template>
<template #body-cell-id="props">
<QTd @click="stopEventPropagation($event, props.col)">
<component
:is="tableColumnComponents[col.name].component"
:is="tableColumnComponents[props.col.name].component"
class="col-content"
v-bind="tableColumnComponents[col.name].props(props)"
@click="tableColumnComponents[col.name].event(props)"
v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)"
>
{{ dashIfEmpty(col.value) }}
<WorkerDescriptorProxy
v-if="props.row.salesPersonFk"
:id="selectedSalesPersonId"
/>
<CustomerDescriptorProxy
v-if="props.row.id"
:id="selectedCustomerId"
/>
<CustomerDescriptorProxy :id="props.row.id" />
{{ props.row.id }}
</component>
</QTd>
</QTr>
</template>
<template #body-cell-salesPersonFk="props">
<QTd @click="stopEventPropagation($event, props.col)">
<component
v-if="props.row.salesPerson"
class="col-content"
:is="tableColumnComponents[props.col.name].component"
v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)"
>
<WorkerDescriptorProxy :id="props.row.salesPersonFk" />
{{ props.row.salesPerson }}
</component>
<span class="col-content" v-else>-</span>
</QTd>
</template>
<template #body-cell-actions="props">
<QTd @click="stopEventPropagation($event, props.col)">
<component
:is="tableColumnComponents[props.col.name].component"
class="col-content"
v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)"
/>
</QTd>
</template>
</QTable>
</QPage>

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, ref, onMounted, onUnmounted } from 'vue';
import { computed, ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
@ -14,6 +14,7 @@ import EditPictureForm from 'components/EditPictureForm.vue';
import { useState } from 'src/composables/useState';
import useCardDescription from 'src/composables/useCardDescription';
import { useSession } from 'src/composables/useSession';
import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
const $props = defineProps({
@ -30,6 +31,10 @@ const $props = defineProps({
type: String,
default: null,
},
saleFk: {
type: Number,
default: null,
},
});
const quasar = useQuasar();
@ -51,6 +56,7 @@ const available = ref(null);
const visible = ref(null);
const _warehouseFk = ref(null);
const warehouseText = ref(null);
const salixUrl = ref();
const warehouseFk = computed({
get() {
return _warehouseFk.value;
@ -69,6 +75,7 @@ const showEditPhotoForm = ref(false);
onMounted(async () => {
await getItemAvatar();
warehouseFk.value = user.value.warehouseFk;
salixUrl.value = await getUrl('');
});
const getItemAvatar = async () => {
@ -276,7 +283,16 @@ const openCloneDialog = async () => {
<template #actions="{}">
<QCardActions class="row justify-center">
<QBtn
:to="{ name: 'ItemDiary' }"
:href="
salixUrl +
'item/' +
entityId +
'/diary?' +
'warehouseFk=' +
warehouseFk +
'&lineFk=' +
$props.saleFk
"
size="md"
icon="vn:transaction"
color="primary"

View File

@ -11,6 +11,10 @@ const $props = defineProps({
type: String,
default: null,
},
saleFk: {
type: Number,
default: null,
},
});
</script>
@ -21,6 +25,7 @@ const $props = defineProps({
:id="$props.id"
:summary="ItemSummary"
:dated="dated"
:sale-fk="saleFk"
/>
</QPopupProxy>
</template>