fix: refs #8138 sme minor issues
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Pablo Natek 2024-11-19 07:59:45 +01:00
parent e119bf5bfc
commit f999760205
3 changed files with 57 additions and 20 deletions

View File

@ -0,0 +1,40 @@
<script setup>
defineProps({ row: { type: Object, required: true } });
</script>
<template>
<span>
<QIcon
v-if="row.isTaxDataChecked === 0"
name="vn:no036"
color="primary"
size="xs"
>
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
</QIcon>
<QIcon v-if="row.hasTicketRequest" name="vn:buyrequest" color="primary" size="xs">
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
</QIcon>
<QIcon v-if="row.itemShortage" name="vn:unavailable" color="primary" size="xs">
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
</QIcon>
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.risk"
name="vn:risk"
:color="row.hasHighRisk ? 'negative' : 'primary'"
size="xs"
>
<QTooltip>
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
</QTooltip>
</QIcon>
<QIcon v-if="row.hasComponentLack" name="vn:components" color="primary" size="xs">
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
</QIcon>
<QIcon v-if="row.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
</QIcon>
</span>
</template>

View File

@ -320,7 +320,7 @@ const sumRisk = ({ clientRisks }) => {
:value="entity.recommendedCredit" :value="entity.recommendedCredit"
/> />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-max">
<VnTitle :text="t('Latest tickets')" /> <VnTitle :text="t('Latest tickets')" />
<CustomerSummaryTable /> <CustomerSummaryTable />
</QCard> </QCard>

View File

@ -24,13 +24,18 @@ const tableRef = ref(null);
const provinceOpts = ref([]); const provinceOpts = ref([]);
const stateOpts = ref([]); const stateOpts = ref([]);
const zoneOpts = ref([]); const zoneOpts = ref([]);
const visibleColumns = ref([]);
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const from = Date.vnNew(); const from = Date.vnNew();
from.setHours(0, 0, 0, 0); from.setHours(0, 0, 0, 0);
const to = new Date(from.getTime()); const to = new Date(from.getTime());
to.setDate(to.getDate() + 1); to.setDate(to.getDate() + 1);
to.setHours(23, 59, 59, 999); to.setHours(23, 59, 59, 999);
const stateColors = {
notice: 'info',
success: 'positive',
warning: 'warning',
alert: 'negative',
};
function exprBuilder(param, value) { function exprBuilder(param, value) {
switch (param) { switch (param) {
@ -225,7 +230,7 @@ const columns = computed(() => [
{ {
title: t('salesTicketsTable.goToLines'), title: t('salesTicketsTable.goToLines'),
icon: 'vn:lines', icon: 'vn:lines',
color: 'priamry', color: 'primary',
action: (row) => openTab(row.id), action: (row) => openTab(row.id),
isPrimary: true, isPrimary: true,
attrs: { attrs: {
@ -236,7 +241,7 @@ const columns = computed(() => [
{ {
title: t('salesTicketsTable.preview'), title: t('salesTicketsTable.preview'),
icon: 'preview', icon: 'preview',
color: 'priamry', color: 'primary',
action: (row) => viewSummary(row.id, TicketSummary), action: (row) => viewSummary(row.id, TicketSummary),
isPrimary: true, isPrimary: true,
attrs: { attrs: {
@ -254,10 +259,10 @@ const getBadgeAttrs = (date) => {
let timeTicket = new Date(date); let timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0); timeTicket.setHours(0, 0, 0, 0);
let comparation = today - timeTicket; let timeDiff = today - timeTicket;
if (comparation == 0) return { color: 'warning', 'text-color': 'black' }; if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
if (comparation < 0) return { color: 'success', 'text-color': 'black' }; if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
return { color: 'transparent', 'text-color': 'white' }; return { color: 'transparent', 'text-color': 'white' };
}; };
@ -272,13 +277,6 @@ const autoRefreshHandler = (value) => {
} }
}; };
const stateColors = {
notice: 'info',
success: 'positive',
warning: 'warning',
alert: 'negative',
};
const totalPriceColor = (ticket) => { const totalPriceColor = (ticket) => {
const total = parseInt(ticket.totalWithVat); const total = parseInt(ticket.totalWithVat);
if (total > 0 && total < 50) return 'warning'; if (total > 0 && total < 50) return 'warning';
@ -286,10 +284,10 @@ const totalPriceColor = (ticket) => {
const formatShippedDate = (date) => { const formatShippedDate = (date) => {
if (!date) return '-'; if (!date) return '-';
const split1 = date.split('T'); const dateSplit = date.split('T');
const [year, month, day] = split1[0].split('-'); const [year, month, day] = dateSplit[0].split('-');
const _date = new Date(year, month - 1, day); const newDate = new Date(year, month - 1, day);
return toDateFormat(_date); return toDateFormat(newDate);
}; };
const openTab = (id) => const openTab = (id) =>
@ -337,7 +335,6 @@ const openTab = (id) =>
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:offset="50" :offset="50"
:columns="columns" :columns="columns"
:visible-columns="visibleColumns"
:right-search="false" :right-search="false"
default-mode="table" default-mode="table"
auto-load auto-load
@ -422,7 +419,7 @@ const openTab = (id) =>
</QIcon> </QIcon>
</template> </template>
<template #column-zoneFk="{ row }"> <template #column-zoneFk="{ row }">
<div @click.stop.prevent :title="row.zoneName"> <div v-if="row.zoneFk" @click.stop.prevent :title="row.zoneName">
<span class="link">{{ row.zoneName }}</span> <span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" /> <ZoneDescriptorProxy :id="row.zoneFk" />
</div> </div>