Solucion a comentarios 29
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
carlosfonseca 2024-03-04 06:27:17 -05:00
parent f8b698e4e7
commit 09a2af4124
2 changed files with 69 additions and 144 deletions

View File

@ -1,17 +1,17 @@
version: '3.7' version: '3.7'
services: services:
main: main:
image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?} image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?}
build: build:
context: . context: .
dockerfile: ./Dockerfile dockerfile: ./Dockerfile
ports: ports:
- 4000 - 4000
deploy: deploy:
replicas: ${FRONT_REPLICAS:?} replicas: ${FRONT_REPLICAS:?}
placement: placement:
constraints: constraints:
- node.role == worker - node.role == worker
resources: resources:
limits: limits:
memory: 1G memory: 1G

View File

@ -12,12 +12,11 @@ import { useStateStore } from 'stores/useStateStore';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
import { usePrintService } from 'src/composables/usePrintService'; import { usePrintService } from 'src/composables/usePrintService';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue'; import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
const { sendEmail } = usePrintService(); const { sendEmail } = usePrintService();
const { t } = useI18n(); const { t } = useI18n();
@ -30,18 +29,15 @@ const user = state.getUser();
const clientRisks = ref(null); const clientRisks = ref(null);
const clientRisksRef = ref(null); const clientRisksRef = ref(null);
const closeButton = ref(null);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const companyId = ref(null); const companyId = ref(null);
const receiptsRef = ref(null); const receiptsRef = ref(null);
const rows = ref([]); const data = ref([]);
const showDialog = ref(false);
const filterCompanies = { order: ['code'] }; const filterCompanies = { order: ['code'] };
const params = { const userParams = {
clientId: route.params.id, clientId: route.params.id,
companyId: user.value.companyFk, companyId: user.value.companyFk,
filter: { limit: 20 },
}; };
const filter = { const filter = {
include: { relation: 'company', scope: { fields: ['code'] } }, include: { relation: 'company', scope: { fields: ['code'] } },
@ -180,7 +176,7 @@ onBeforeMount(() => {
watch( watch(
() => route.params.id, () => route.params.id,
(newValue) => { (newValue) => {
params.clientId = newValue; userParams.clientId = newValue;
filter.where.clientFk = newValue; filter.where.clientFk = newValue;
getData(); getData();
} }
@ -191,6 +187,10 @@ const getData = () => {
clientRisksRef.value?.fetch(); clientRisksRef.value?.fetch();
}; };
const onFetch = (data) => {
data.value = data;
};
const showNewPaymentDialog = () => { const showNewPaymentDialog = () => {
quasar.dialog({ quasar.dialog({
component: CustomerNewPayment, component: CustomerNewPayment,
@ -205,7 +205,7 @@ const showNewPaymentDialog = () => {
const updateCompanyId = (id) => { const updateCompanyId = (id) => {
if (id) { if (id) {
companyId.value = id; companyId.value = id;
params.companyId = id; userParams.companyId = id;
filter.where.companyFk = id; filter.where.companyFk = id;
} }
getData(); getData();
@ -232,13 +232,7 @@ const sendEmailAction = () => {
auto-load auto-load
url="Companies" url="Companies"
/> />
<FetchData
:params="params"
@on-fetch="(data) => (rows = data)"
auto-load
ref="receiptsRef"
url="Receipts/filter"
/>
<FetchData <FetchData
:filter="filter" :filter="filter"
@on-fetch="(data) => (clientRisks = data)" @on-fetch="(data) => (clientRisks = data)"
@ -247,121 +241,52 @@ const sendEmailAction = () => {
url="ClientRisks" url="ClientRisks"
/> />
<QTable <VnPaginate
:columns="columns" auto-load
:no-data-label="t('globals.noResults')" data-key="CustomerBalance"
:pagination="{ rowsPerPage: 12 }" order="id DESC"
:rows="rows" url="Receipts/filter"
class="full-width q-mt-md" :user-params="userParams"
row-key="id" ref="receiptsRef"
@on-fetch="onFetch"
@on-paginate="onPaginate"
> >
<template #body-cell="props"> <template #body="{ rows }">
<QTd :props="props"> <QTable
<QTr :props="props" class="cursor-pointer"> :columns="columns"
<component :no-data-label="t('globals.noResults')"
:is="tableColumnComponents[props.col.name].component" :rows-per-page-options="[0]"
class="col-content" :rows="rows"
v-bind="tableColumnComponents[props.col.name].props(props)" class="full-width q-mt-md"
@click="tableColumnComponents[props.col.name].event(props)" row-key="id"
> >
<template <template #body-cell="props">
v-if=" <QTd :props="props">
props.col.name !== 'conciliated' && <QTr :props="props" class="cursor-pointer">
props.col.name !== 'reference' <component
" :is="tableColumnComponents[props.col.name].component"
> class="col-content"
{{ props.value }} v-bind="
</template> tableColumnComponents[props.col.name].props(props)
"
<template v-if="props.col.name === 'reference'"> @click="
<div v-if="props.row.isInvoice"> tableColumnComponents[props.col.name].event(props)
<QBtn color="blue" dense flat> "
{{ t('bill', { ref: props.value }) }}
</QBtn>
<InvoiceOutDescriptorProxy
:id="props.row.id"
v-if="props.col.name === 'reference'"
/>
</div>
<div v-else>
<VnInput
@keyup.enter="saveFieldValue(props)"
autofocus
clearable
dense
v-model="props.row.description"
/>
</div>
</template>
<template
v-if="
props.col.name === 'actions' && props.row.isCompensation
"
>
<QIcon
@click.stop="showDialog = true"
class="q-ml-md"
color="primary"
name="add"
size="sm"
> >
<QTooltip> <template v-if="props.col.name !== 'isConciliate'">
{{ t('Send compensation') }} {{ props.value }}
</QTooltip> </template>
</QIcon> <WorkerDescriptorProxy
:id="props.row.clientFk"
<QDialog v-model="showDialog"> v-if="props.col.name === 'userName'"
<QCard class="q-pa-sm"> />
<QCardSection> </component>
<span </QTr>
ref="closeButton" </QTd>
class="flex justify-end color-vn-label" </template>
v-close-popup </QTable>
>
<QIcon name="close" size="sm" />
</span>
<div class="text-h6">
{{ t('Send compensation') }}
</div>
</QCardSection>
<QCardSection>
<div>
{{
t(
'Do you want to report compensation to the client by mail?'
)
}}
</div>
</QCardSection>
<QCardActions class="flex justify-end q-mb-sm">
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.save')"
@click="sendEmailAction"
class="q-ml-sm"
color="primary"
/>
</QCardActions>
</QCard>
</QDialog>
</template>
<WorkerDescriptorProxy
:id="props.row.workerFk"
v-if="props.col.name === 'employee'"
/>
</component>
</QTr>
</QTd>
</template> </template>
</QTable> </VnPaginate>
<QDrawer :width="256" show-if-above side="right" v-model="stateStore.rightDrawer"> <QDrawer :width="256" show-if-above side="right" v-model="stateStore.rightDrawer">
<div class="q-mt-xl q-px-md"> <div class="q-mt-xl q-px-md">
@ -377,7 +302,7 @@ const sendEmailAction = () => {
/> />
</div> </div>
<QCard class="q-ma-md q-pa-md q-mt-lg" v-if="rows?.length"> <QCard class="q-ma-md q-pa-md q-mt-lg" v-if="data?.length">
<QCardSection> <QCardSection>
<div class="flex justify-center text-subtitle1 text-bold"> <div class="flex justify-center text-subtitle1 text-bold">
{{ t('Total by company') }} {{ t('Total by company') }}