refs #5835
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2023-12-12 09:01:32 +01:00
parent 22a634e7eb
commit 2c5dc276b2
3 changed files with 32 additions and 29 deletions

View File

@ -4,12 +4,12 @@ import { dashIfEmpty } from 'src/filters';
const $props = defineProps({ const $props = defineProps({
label: { type: String, default: null }, label: { type: String, default: null },
value: { type: [Number, String, Boolean], default: null }, value: {
titleLabel: { type: String, default: null }, type: [String, Boolean],
titleValue: { type: [Number, String, Boolean], default: null }, default: null,
},
info: { type: String, default: null }, info: { type: String, default: null },
dash: { type: Boolean, default: true }, dash: { type: Boolean, default: true },
ellipsisValue: { type: Boolean, default: true },
}); });
const isBooleanValue = computed(() => typeof $props.value === 'boolean'); const isBooleanValue = computed(() => typeof $props.value === 'boolean');
</script> </script>
@ -17,10 +17,10 @@ const isBooleanValue = computed(() => typeof $props.value === 'boolean');
<div class="vn-label-value"> <div class="vn-label-value">
<div v-if="$props.label || $slots.label" class="label"> <div v-if="$props.label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span :title="$props.titleLabel ?? $props.label">{{ $props.label }}</span> <span>{{ $props.label }}</span>
</slot> </slot>
</div> </div>
<div class="value" :class="{ ellipsis: $props.ellipsisValue }"> <div class="value">
<span v-if="isBooleanValue"> <span v-if="isBooleanValue">
<QIcon <QIcon
:name="$props.value ? `check` : `close`" :name="$props.value ? `check` : `close`"
@ -43,8 +43,3 @@ const isBooleanValue = computed(() => typeof $props.value === 'boolean');
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped>
.ellipsis {
text-overflow: ellipsis !important;
}
</style>

View File

@ -405,7 +405,7 @@ export default {
pageTitles: { pageTitles: {
invoiceIns: 'Fact. recibidas', invoiceIns: 'Fact. recibidas',
list: 'Listado', list: 'Listado',
createInvoiceOut: 'Crear fact. recibida', createInvoiceIn: 'Crear fact. recibida',
summary: 'Resumen', summary: 'Resumen',
basicData: 'Datos básicos', basicData: 'Datos básicos',
vat: 'IVA', vat: 'IVA',

View File

@ -37,6 +37,10 @@ const inputFileRef = ref();
const editDmsRef = ref(); const editDmsRef = ref();
const createDmsRef = ref(); const createDmsRef = ref();
const requiredFieldRule = (val) => val || t('Required field');
const dateMask = '####-##-##';
const fillMask = '_';
async function checkFileExists(dmsId) { async function checkFileExists(dmsId) {
if (!dmsId) return; if (!dmsId) return;
try { try {
@ -212,10 +216,14 @@ async function upsert() {
<QInput <QInput
:label="t('Expedition date')" :label="t('Expedition date')"
v-model="data.issued" v-model="data.issued"
mask="####-##-##" :mask="dateMask"
> >
<template #append> <template #append>
<QIcon name="event" class="cursor-pointer" fill-mask="_"> <QIcon
name="event"
class="cursor-pointer"
:fill-mask="fillMask"
>
<QPopupProxy <QPopupProxy
cover cover
transition-show="scale" transition-show="scale"
@ -240,8 +248,8 @@ async function upsert() {
<QInput <QInput
:label="t('Operation date')" :label="t('Operation date')"
v-model="data.operated" v-model="data.operated"
mask="####-##-##" :mask="dateMask"
fill-mask="_" :fill-mask="fillMask"
autofocus autofocus
> >
<template #append> <template #append>
@ -251,7 +259,7 @@ async function upsert() {
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
> >
<QDate v-model="data.operated" mask="YYYY-MM-DD"> <QDate v-model="data.operated" :mask="dateMask">
<div class="row items-center justify-end"> <div class="row items-center justify-end">
<QBtn <QBtn
v-close-popup v-close-popup
@ -332,8 +340,8 @@ async function upsert() {
v-model="data.bookEntried" v-model="data.bookEntried"
clearable clearable
clear-icon="close" clear-icon="close"
mask="####-##-##" :mask="dateMask"
fill-mask="_" :fill-mask="fillMask"
> >
<template #append> <template #append>
<QIcon name="event" class="cursor-pointer"> <QIcon name="event" class="cursor-pointer">
@ -342,7 +350,7 @@ async function upsert() {
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
> >
<QDate v-model="data.bookEntried" mask="YYYY-MM-DD"> <QDate v-model="data.bookEntried" :mask="dateMask">
<div class="row items-center justify-end"> <div class="row items-center justify-end">
<QBtn <QBtn
v-close-popup v-close-popup
@ -363,8 +371,8 @@ async function upsert() {
v-model="data.booked" v-model="data.booked"
clearable clearable
clear-icon="close" clear-icon="close"
mask="####-##-##" :mask="dateMask"
fill-mask="_" :fill-mask="fillMask"
> >
<template #append> <template #append>
<QIcon name="event" class="cursor-pointer"> <QIcon name="event" class="cursor-pointer">
@ -373,7 +381,7 @@ async function upsert() {
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
> >
<QDate v-model="data.booked" mask="YYYY-MM-DD"> <QDate v-model="data.booked" :mask="maskDate">
<div class="row items-center justify-end"> <div class="row items-center justify-end">
<QBtn <QBtn
v-close-popup v-close-popup
@ -452,7 +460,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="code" option-label="code"
@input-value="companiesRef.fetch()" @input-value="companiesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
</QItem> </QItem>
<QItem> <QItem>
@ -464,7 +472,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="name" option-label="name"
@input-value="warehousesRef.fetch()" @input-value="warehousesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
<VnSelectFilter <VnSelectFilter
class="full-width q-pa-xs" class="full-width q-pa-xs"
@ -474,7 +482,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="name" option-label="name"
@input-value="dmsTypesRef.fetch()" @input-value="dmsTypesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
</QItem> </QItem>
<QItem> <QItem>
@ -564,7 +572,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="code" option-label="code"
@input-value="companiesRef.fetch()" @input-value="companiesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
</QItem> </QItem>
<QItem> <QItem>
@ -576,7 +584,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="name" option-label="name"
@input-value="warehousesRef.fetch()" @input-value="warehousesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
<VnSelectFilter <VnSelectFilter
class="full-width q-pa-xs" class="full-width q-pa-xs"
@ -586,7 +594,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="name" option-label="name"
@input-value="dmsTypesRef.fetch()" @input-value="dmsTypesRef.fetch()"
:rules="[(val) => val || t('Required field')]" :rules="[requiredFieldRule]"
/> />
</QItem> </QItem>
<QItem> <QItem>