feat: refs #6897 refactor VnColor and EntryList components; update FormModelPopup button visibility
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
4950ca6822
commit
65e48f6194
|
@ -58,19 +58,6 @@ defineExpose({
|
||||||
<p>{{ subtitle }}</p>
|
<p>{{ subtitle }}</p>
|
||||||
<slot name="form-inputs" :data="data" :validate="validate" />
|
<slot name="form-inputs" :data="data" :validate="validate" />
|
||||||
<div class="q-mt-lg row justify-end">
|
<div class="q-mt-lg row justify-end">
|
||||||
<QBtn
|
|
||||||
v-if="showSaveAndContinueBtn"
|
|
||||||
:label="t('globals.isSaveAndContinue')"
|
|
||||||
:title="t('globals.isSaveAndContinue')"
|
|
||||||
type="submit"
|
|
||||||
color="primary"
|
|
||||||
class="q-ml-sm"
|
|
||||||
:disabled="isLoading"
|
|
||||||
:loading="isLoading"
|
|
||||||
data-cy="FormModelPopup_isSaveAndContinue"
|
|
||||||
z-max
|
|
||||||
@click="() => (isSaveAndContinue = true)"
|
|
||||||
/>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.cancel')"
|
:label="t('globals.cancel')"
|
||||||
:title="t('globals.cancel')"
|
:title="t('globals.cancel')"
|
||||||
|
@ -90,6 +77,20 @@ defineExpose({
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
v-if="showSaveAndContinueBtn"
|
||||||
|
:label="t('globals.isSaveAndContinue')"
|
||||||
|
:title="t('globals.isSaveAndContinue')"
|
||||||
|
type="submit"
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-sm"
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
data-cy="FormModelPopup_isSaveAndContinue"
|
||||||
|
z-max
|
||||||
|
@click="() => (isSaveAndContinue = true)"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-else
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
@ -340,8 +340,9 @@ const clickHandler = async (event) => {
|
||||||
|
|
||||||
const isDateElement = event.target.closest('.q-date');
|
const isDateElement = event.target.closest('.q-date');
|
||||||
const isTimeElement = event.target.closest('.q-time');
|
const isTimeElement = event.target.closest('.q-time');
|
||||||
|
const isQselectDropDown = event.target.closest('.q-select__dropdown-icon');
|
||||||
|
|
||||||
if (isDateElement || isTimeElement) return;
|
if (isDateElement || isTimeElement || isQselectDropDown) return;
|
||||||
|
|
||||||
if (clickedElement === null) {
|
if (clickedElement === null) {
|
||||||
destroyInput(editingRow.value, editingField.value);
|
destroyInput(editingRow.value, editingField.value);
|
||||||
|
@ -411,7 +412,7 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
focusOnMount: true,
|
focusOnMount: true,
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect) {
|
if (isSelect && value) {
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
row[column?.name + 'TextValue'] =
|
row[column?.name + 'TextValue'] =
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
@ -593,6 +594,7 @@ const checkbox = ref(null);
|
||||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
@selection="(details) => handleSelection(details, rows)"
|
@selection="(details) => handleSelection(details, rows)"
|
||||||
|
:hide-selected-banner="true"
|
||||||
>
|
>
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
<slot name="top-left"> </slot>
|
<slot name="top-left"> </slot>
|
||||||
|
@ -1042,7 +1044,7 @@ es:
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(300px, max-content));
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|
|
@ -11,7 +11,7 @@ const maxHeight = 30;
|
||||||
const colorHeight = maxHeight / colorArray?.length;
|
const colorHeight = maxHeight / colorArray?.length;
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="color-div" :style="{ height: `${maxHeight}px` }">
|
<div v-if="colors" class="color-div" :style="{ height: `${maxHeight}px` }">
|
||||||
<div
|
<div
|
||||||
v-for="(color, index) in colorArray"
|
v-for="(color, index) in colorArray"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
|
@ -156,6 +156,7 @@ globals:
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: No data available
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
|
|
@ -160,6 +160,7 @@ globals:
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: Datos no disponibles
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
|
|
@ -156,10 +156,10 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: t('Sti.'),
|
labelAbbreviation: t('Sti.'),
|
||||||
label: t('Printed Stickers/Stickers'),
|
label: t('Stickers'),
|
||||||
toolTip: t('Printed Stickers/Stickers'),
|
toolTip: t('Printed Stickers/Stickers'),
|
||||||
name: 'stickers',
|
name: 'stickers',
|
||||||
component: 'number',
|
component: 'input',
|
||||||
create: true,
|
create: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
positive: false,
|
positive: false,
|
||||||
|
@ -179,7 +179,7 @@ const columns = [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'packagings',
|
url: 'packagings',
|
||||||
fields: ['id', 'volume'],
|
fields: ['id'],
|
||||||
optionLabel: 'id',
|
optionLabel: 'id',
|
||||||
},
|
},
|
||||||
create: true,
|
create: true,
|
||||||
|
@ -192,10 +192,10 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
create: true,
|
create: true,
|
||||||
width: '35px',
|
width: '35px',
|
||||||
|
format: (row, dashIfEmpty) => parseFloat(row['weight']).toFixed(1),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
labelAbbreviation: 'P',
|
||||||
labelAbbreviation: 'Pack',
|
|
||||||
label: 'Packing',
|
label: 'Packing',
|
||||||
toolTip: 'Packing',
|
toolTip: 'Packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
|
@ -209,14 +209,13 @@ const columns = [
|
||||||
row['amount'] = row['quantity'] * row['buyingValue'];
|
row['amount'] = row['quantity'] * row['buyingValue'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '20px',
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'grouping')
|
if (row.groupingMode === 'grouping')
|
||||||
return { color: 'var(--vn-label-color)' };
|
return { color: 'var(--vn-label-color)' };
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
|
||||||
labelAbbreviation: 'GM',
|
labelAbbreviation: 'GM',
|
||||||
label: t('Grouping selector'),
|
label: t('Grouping selector'),
|
||||||
toolTip: t('Grouping selector'),
|
toolTip: t('Grouping selector'),
|
||||||
|
@ -229,7 +228,7 @@ const columns = [
|
||||||
indeterminateValue: null,
|
indeterminateValue: null,
|
||||||
},
|
},
|
||||||
size: 'xs',
|
size: 'xs',
|
||||||
width: '30px',
|
width: '25px',
|
||||||
create: true,
|
create: true,
|
||||||
rightFilter: false,
|
rightFilter: false,
|
||||||
getIcon: (value) => {
|
getIcon: (value) => {
|
||||||
|
@ -245,12 +244,12 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: 'Group',
|
labelAbbreviation: 'G',
|
||||||
label: 'Grouping',
|
label: 'Grouping',
|
||||||
toolTip: 'Grouping',
|
toolTip: 'Grouping',
|
||||||
name: 'grouping',
|
name: 'grouping',
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '20px',
|
||||||
create: true,
|
create: true,
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
||||||
|
@ -290,6 +289,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '45px',
|
width: '45px',
|
||||||
|
format: (row) => parseFloat(row['buyingValue']).toFixed(3),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -301,6 +301,7 @@ const columns = [
|
||||||
positive: false,
|
positive: false,
|
||||||
},
|
},
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
|
format: (row) => parseFloat(row['amount']).toFixed(2),
|
||||||
style: getAmountStyle,
|
style: getAmountStyle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -312,6 +313,7 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
|
format: (row) => parseFloat(row['price2']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -325,6 +327,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
|
format: (row) => parseFloat(row['price3']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -344,6 +347,7 @@ const columns = [
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
||||||
},
|
},
|
||||||
|
format: (row) => parseFloat(row['minPrice']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -518,7 +522,7 @@ onMounted(() => {
|
||||||
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
||||||
<QBtnGroup push style="column-gap: 1px">
|
<QBtnGroup push style="column-gap: 1px">
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
icon="exposure_neg_1"
|
label="+/-"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
:title="t('Invert quantity value')"
|
:title="t('Invert quantity value')"
|
||||||
|
@ -533,7 +537,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, -1)"
|
@click="invertQuantitySign(selectedRows, -1)"
|
||||||
data-cy="set-negative-quantity"
|
data-cy="set-negative-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">-1</span>
|
<span style="font-size: large">-</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -544,7 +548,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, 1)"
|
@click="invertQuantitySign(selectedRows, 1)"
|
||||||
data-cy="set-positive-quantity"
|
data-cy="set-positive-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">1</span>
|
<span style="font-size: large">+</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -558,11 +562,11 @@ onMounted(() => {
|
||||||
:disable="!selectedRows.length"
|
:disable="!selectedRows.length"
|
||||||
data-cy="check-buy-amount"
|
data-cy="check-buy-amount"
|
||||||
>
|
>
|
||||||
<QTooltip>{{}}</QTooltip>
|
|
||||||
<QList>
|
<QList>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="check"
|
icon="check"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, true)"
|
@click="setIsChecked(selectedRows, true)"
|
||||||
|
@ -573,6 +577,7 @@ onMounted(() => {
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="close"
|
icon="close"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, false)"
|
@click="setIsChecked(selectedRows, false)"
|
||||||
|
@ -662,7 +667,7 @@ onMounted(() => {
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" :columns="3" />
|
||||||
</template>
|
</template>
|
||||||
<template #column-stickers="{ row }">
|
<template #column-stickers="{ row }">
|
||||||
<span class="editable-text">
|
<span :class="editableMode ? 'editable-text' : ''">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ row.printedStickers }}
|
{{ row.printedStickers }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -693,20 +698,36 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-itemFk="{ data }">
|
<template #column-create-itemFk="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Items"
|
url="Items/search"
|
||||||
v-model="data.itemFk"
|
v-model="data.itemFk"
|
||||||
:label="t('Article')"
|
:label="t('Article')"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name', 'size', 'producerName']"
|
||||||
|
:filter-options="['id', 'name', 'size', 'producerName']"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
@update:modelValue="
|
@update:modelValue="
|
||||||
async (value) => {
|
async (value) => {
|
||||||
setBuyUltimate(value, data);
|
await setBuyUltimate(value, data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
:required="true"
|
:required="true"
|
||||||
data-cy="itemFk-create-popup"
|
data-cy="itemFk-create-popup"
|
||||||
/>
|
sort-by="nickname DESC"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
#{{ scope.opt.id }}, {{ scope.opt?.size }},
|
||||||
|
{{ scope.opt?.producerName }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-groupingMode="{ data }">
|
<template #column-create-groupingMode="{ data }">
|
||||||
<VnSelectEnum
|
<VnSelectEnum
|
||||||
|
@ -720,9 +741,14 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #previous-create-dialog="{ data }">
|
<template #previous-create-dialog="{ data }">
|
||||||
<div style="position: absolute">
|
<div
|
||||||
|
style="position: absolute"
|
||||||
|
:class="{ 'centered-container': !data.itemFk }"
|
||||||
|
>
|
||||||
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
||||||
<SkeletonDescriptor v-if="!data.itemFk" :has-image="true" />
|
<div v-else>
|
||||||
|
<span>{{ t('globals.noData') }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
@ -744,6 +770,7 @@ es:
|
||||||
Com.: Ref.
|
Com.: Ref.
|
||||||
Comment: Referencia
|
Comment: Referencia
|
||||||
Minimum price: Precio mínimo
|
Minimum price: Precio mínimo
|
||||||
|
Stickers: Etiquetas
|
||||||
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
||||||
Cost: Cost.
|
Cost: Cost.
|
||||||
Buying value: Coste
|
Buying value: Coste
|
||||||
|
@ -761,7 +788,12 @@ es:
|
||||||
Check buy amount: Marcar como correcta la cantidad de compra
|
Check buy amount: Marcar como correcta la cantidad de compra
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.test {
|
.centered-container {
|
||||||
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -182,14 +182,6 @@ const columns = computed(() => [
|
||||||
name: 'entryTypeCode',
|
name: 'entryTypeCode',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'dated',
|
|
||||||
label: t('entry.list.tableVisibleColumns.dated'),
|
|
||||||
component: 'date',
|
|
||||||
cardVisible: false,
|
|
||||||
visible: false,
|
|
||||||
create: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'companyFk',
|
name: 'companyFk',
|
||||||
label: t('entry.list.tableVisibleColumns.companyFk'),
|
label: t('entry.list.tableVisibleColumns.companyFk'),
|
||||||
|
@ -220,7 +212,8 @@ function getBadgeAttrs(row) {
|
||||||
|
|
||||||
let timeDiff = today - timeTicket;
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
if (timeDiff > 0) return { color: 'warning', 'text-color': 'black' };
|
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||||
|
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
switch (row.entryTypeCode) {
|
switch (row.entryTypeCode) {
|
||||||
case 'regularization':
|
case 'regularization':
|
||||||
case 'life':
|
case 'life':
|
||||||
|
@ -245,7 +238,6 @@ function getBadgeAttrs(row) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (timeDiff < 0) return { color: 'info', 'text-color': 'black' };
|
|
||||||
return { color: 'transparent' };
|
return { color: 'transparent' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue