feat: refs #8944 new date filter and make section use salix's back
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jon Elias 2025-04-25 12:50:28 +02:00
parent f145351cf1
commit c679b77bbd
5 changed files with 50 additions and 30 deletions

View File

@ -77,6 +77,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
hasDifferentVerb: {
type: Boolean,
default: false,
},
});
const isLoading = ref(false);
@ -87,7 +91,7 @@ const formData = ref();
const saveButtonRef = ref(null);
const watchChanges = ref();
const formUrl = computed(() => $props.url);
const saveData = ref();
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
defineExpose({
@ -181,6 +185,7 @@ async function saveChanges(data) {
return;
}
let changes = data || getChanges();
let url = $props.saveUrl || $props.url + '/crud';
if ($props.beforeSaveFn) changes = await $props.beforeSaveFn(changes, getChanges);
try {
@ -188,7 +193,8 @@ async function saveChanges(data) {
return;
}
await axios.post($props.saveUrl || $props.url + '/crud', changes);
if ($props.hasDifferentVerb) await axios.patch(url, saveData.value);
else await axios.post(url, changes);
} finally {
isLoading.value = false;
}
@ -265,6 +271,7 @@ function getChanges() {
} else if (originalData.value[i]) {
const data = getDifferences(originalData.value[i], row);
if (!isEmpty(data)) {
saveData.value = row;
updates.push({
data,
where: { [pk]: row[pk] },

View File

@ -888,6 +888,7 @@ components:
rate3: Packing price
minPrice: Min. Price
itemFk: Item id
dated: Date
userPanel:
copyToken: Token copied to clipboard
settings: Settings

View File

@ -972,6 +972,7 @@ components:
rate3: Precio packing
minPrice: Precio mínimo
itemFk: Id item
dated: Fecha
userPanel:
copyToken: Token copiado al portapapeles
settings: Configuración

View File

@ -273,7 +273,8 @@ watch(
data-key="ItemFixedPrices"
url="FixedPrices/filter"
:order="'name DESC'"
save-url="FixedPrices/crud"
save-url="FixedPrices/upsertFixedPrice"
:hasDifferentVerb="true"
:columns="columns"
:is-editable="true"
:right-search="false"

View File

@ -51,24 +51,32 @@ const props = defineProps({
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.started"
:label="t('params.started')"
filled
@update:model-value="searchFn()"
/>
</QItemSection>
<QItemSection>
<VnInputDate
v-model="params.ended"
:label="t('params.ended')"
filled
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>
<QSeparator />
<QItemSection>
<QIcon name="info" size="sm" class="info-icon cursor-pointer">
<QTooltip>{{ t('params.incompatibleFilters') }}</QTooltip>
</QIcon>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.dated"
:label="t('params.date')"
filled
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.showBadDates"
:label="t(`params.showBadDates`)"
toggle-indeterminate
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>
</QItemSection>
<QSeparator />
<QItem>
<QItemSection>
<QCheckbox
@ -77,15 +85,6 @@ const props = defineProps({
toggle-indeterminate
@update:model-value="searchFn()"
/>
<QCheckbox
v-model="params.showBadDates"
:label="t(`params.showBadDates`)"
toggle-indeterminate
@update:model-value="searchFn()"
>
</QCheckbox>
<QCheckbox
:label="t('params.hasMinPrice')"
v-model="params.hasMinPrice"
@ -97,6 +96,13 @@ const props = defineProps({
</template>
</ItemsFilterPanel>
</template>
<style lang="scss" scoped>
.info-icon {
position: relative;
top: 0;
left: 90%;
}
</style>
<i18n>
en:
params:
@ -107,6 +113,8 @@ en:
mine: Mine
showBadDates: Show future items
hasMinPrice: Has Min Price
date: Date
incompatibleFilters: Cannot select "Date" and "Show future items" at the same time
es:
params:
buyerFk: Comprador
@ -116,4 +124,6 @@ es:
mine: Para mi
showBadDates: Ver items a futuro
hasMinPrice: Precio mínimo
date: Fecha
incompatibleFilters: No se puede seleccionar "Fecha" y "Ver items a futuro" a la vez
</i18n>