diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index c6d4d8ef2..fd3c29fa3 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -34,7 +34,7 @@ const model = defineModel(undefined, { required: true }); const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl }); const columnFilter = computed(() => $props.column?.columnFilter); -const updateEvent = { 'update:modelValue': addFilter, remove: () => addFilter(null) }; +const updateEvent = { 'update:modelValue': addFilter }; const enterEvent = { 'keyup.enter': () => addFilter(model.value), remove: () => addFilter(null), diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 689be76ee..d6008de0b 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -507,11 +507,8 @@ function handleOnDataSaved(_) { :key="index" :title="btn.title" :icon="btn.icon" - class="q-px-sm" + class="q-px-sm text-primary-light" flat - :class=" - btn.isPrimary ? 'text-primary-light' : 'color-vn-text ' - " :style="`visibility: ${ (btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden' }`" diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 68ff0e359..16e3c641f 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -5,12 +5,14 @@ import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; import axios from 'axios'; +import VnUserLink from '../ui/VnUserLink.vue'; +import { downloadFile } from 'src/composables/downloadFile'; +import VnImg from 'components/ui/VnImg.vue'; import VnPaginate from 'components/ui/VnPaginate.vue'; import VnDms from 'src/components/common/VnDms.vue'; import VnConfirm from 'components/ui/VnConfirm.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; -import VnUserLink from '../ui/VnUserLink.vue'; -import { downloadFile } from 'src/composables/downloadFile'; +import { useSession } from 'src/composables/useSession'; const route = useRoute(); const quasar = useQuasar(); @@ -18,6 +20,7 @@ const { t } = useI18n(); const rows = ref(); const dmsRef = ref(); const formDialog = ref({}); +const token = useSession().getTokenMultimedia(); const $props = defineProps({ model: { @@ -89,6 +92,23 @@ const dmsFilter = { }; const columns = computed(() => [ + { + label: '', + name: 'file', + align: 'left', + component: VnImg, + props: (prop) => { + return { + storage: 'dms', + collection: null, + resolution: null, + id: prop.row.file.split('.')[0], + token: token, + class: 'rounded', + ratio: 1, + }; + }, + }, { align: 'left', field: 'id', @@ -142,13 +162,6 @@ const columns = computed(() => [ 'model-value': Boolean(prop.value), }), }, - { - align: 'left', - field: 'file', - label: t('globals.file'), - name: 'file', - component: 'span', - }, { align: 'left', field: 'worker', @@ -395,10 +408,6 @@ defineExpose({ diff --git a/src/composables/usePrintService.js b/src/composables/usePrintService.js index ff43c65a1..68a009d7b 100644 --- a/src/composables/usePrintService.js +++ b/src/composables/usePrintService.js @@ -16,7 +16,7 @@ export function usePrintService() { ); } - function openReport(path, params) { + function openReport(path, params, isNewTab = '_self') { if (typeof params === 'string') params = JSON.parse(params); params = Object.assign( { @@ -26,8 +26,7 @@ export function usePrintService() { ); const query = new URLSearchParams(params).toString(); - - window.open(`api/${path}?${query}`); + window.open(`api/${path}?${query}`, isNewTab); } return { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index d29b864b9..940c29a5c 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -133,6 +133,7 @@ globals: fiscalData: Fiscal data billingData: Billing data consignees: Consignees + 'address-create': New address notes: Notes credits: Credits greuges: Greuges @@ -721,6 +722,7 @@ worker: newWorker: New worker card: workerId: Worker ID + user: User name: Name email: Email phone: Phone @@ -807,6 +809,16 @@ worker: credit: Have concept: Concept wagon: + pageTitles: + wagons: Wagons + wagonsList: Wagons List + wagonCreate: Create wagon + wagonEdit: Edit wagon + typesList: Types List + typeCreate: Create type + typeEdit: Edit type + wagonCounter: Trolley counter + wagonTray: Tray List type: name: Name submit: Submit diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 3d905509d..75bc0513a 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -136,6 +136,7 @@ globals: fiscalData: Datos fiscales billingData: Forma de pago consignees: Consignatarios + 'address-create': Nuevo consignatario notes: Notas credits: Créditos greuges: Greuges @@ -728,6 +729,7 @@ worker: newWorker: Nuevo trabajador card: workerId: ID Trabajador + user: Usuario name: Nombre email: Correo personal phone: Teléfono @@ -805,6 +807,16 @@ worker: credit: Haber concept: Concepto wagon: + pageTitles: + wagons: Vagones + wagonsList: Listado vagones + wagonCreate: Crear tipo + wagonEdit: Editar tipo + typesList: Listado tipos + typeCreate: Crear tipo + typeEdit: Editar tipo + wagonCounter: Contador de carros + wagonTray: Listado bandejas type: name: Nombre submit: Guardar diff --git a/src/pages/Claim/Card/ClaimDevelopment.vue b/src/pages/Claim/Card/ClaimDevelopment.vue index f7e8131c6..61d9f5858 100644 --- a/src/pages/Claim/Card/ClaimDevelopment.vue +++ b/src/pages/Claim/Card/ClaimDevelopment.vue @@ -16,7 +16,6 @@ const claimReasons = ref([]); const claimResults = ref([]); const claimResponsibles = ref([]); const claimRedeliveries = ref([]); -const workers = ref([]); const selected = ref([]); const saveButtonRef = ref(); @@ -82,7 +81,9 @@ const columns = computed(() => [ label: t('Worker'), field: (row) => row.workerFk, sortable: true, - options: workers.value, + url: 'Workers/search', + where: { active: 1 }, + sortBy: 'name ASC', model: 'workerFk', optionValue: 'id', optionLabel: 'nickname', @@ -129,13 +130,6 @@ const columns = computed(() => [ @on-fetch="(data) => (claimRedeliveries = data)" auto-load /> - [ > [ name: 'attendedBy', orderBy: 'workerFk', columnFilter: { + name: 'attenderFk', component: 'select', attrs: { url: 'Workers/activeWithInheritedRole', diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index a9e7affef..d76707079 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -179,6 +179,13 @@ const toCustomerAddressEdit = (addressId) => { {{ item.postalCode }} - {{ item.city }}, {{ setProvince(item.provinceFk) }} +
+ {{ item.phone }} + , + {{ item.mobile }} + +
[ { - align: 'left', + align: 'right', name: 'payed', label: t('Date'), format: ({ payed }) => toDate(payed), cardVisible: true, }, { - align: 'left', + align: 'right', name: 'created', label: t('Creation date'), format: ({ created }) => toDateHourMin(created), @@ -91,11 +89,10 @@ const columns = computed(() => [ }, { align: 'left', - name: 'workerFk', label: t('Employee'), columnField: { component: 'userLink', - attrs: ({ row }) => ({ workerId: row.workerFk, tag: row.userName }), + attrs: ({ row }) => ({ workerId: row.workerFk, name: row.userName }), }, cardVisible: true, }, @@ -120,14 +117,14 @@ const columns = computed(() => [ isId: true, }, { - align: 'right', + align: 'left', name: 'credit', label: t('Havings'), format: ({ credit }) => credit && toCurrency(credit), cardVisible: true, }, { - align: 'right', + align: 'left', name: 'balance', label: t('Balance'), format: ({ balance }) => toCurrency(balance), @@ -166,41 +163,15 @@ const columns = computed(() => [ onBeforeMount(() => { stateStore.rightDrawer = true; - companyId.value = user.value.companyFk; }); -async function getClientRisk() { - const { data } = await axios.get(`clientRisks`, { - params: { - filter: JSON.stringify({ - include: { relation: 'company', scope: { fields: ['code'] } }, - where: { clientFk: route.params.id, companyFk: user.value.companyFk }, - }), - }, - }); - clientRisk.value = data; - return clientRisk.value; -} - -async function getCurrentBalance() { - const currentBalance = (await getClientRisk()).find((balance) => { - return balance.companyFk === companyId.value; - }); - return currentBalance && currentBalance.amount; -} - -async function onFetch(data) { - balances.value = []; - for (const [index, balance] of data.entries()) { - if (index === 0) { - balance.balance = await getCurrentBalance(); - continue; - } - const previousBalance = data[index - 1]; - balance.balance = - previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit); +async function getCurrentBalance(data) { + for (const balance of data) { + currentBalance.value[balance.companyFk] = { + code: balance.company.code, + amount: balance.amount, + }; } - balances.value = data; } const showNewPaymentDialog = () => { @@ -215,19 +186,27 @@ const showNewPaymentDialog = () => { }; const showBalancePdf = ({ id }) => { - const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`; - window.open(url, '_blank'); + openReport(`InvoiceOuts/${id}/download`, {}, '_blank'); };