forked from verdnatura/salix-front
Merge branch 'dev' into add_shortcut_add_subSections
This commit is contained in:
commit
98411d3c29
|
@ -305,6 +305,7 @@ defineExpose({
|
|||
redirect: redirectFn,
|
||||
selected,
|
||||
CrudModelRef,
|
||||
params,
|
||||
});
|
||||
|
||||
function handleOnDataSaved(_) {
|
||||
|
|
|
@ -11,6 +11,9 @@ import TravelSummary from './Card/TravelSummary.vue';
|
|||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import { toDate } from 'src/filters';
|
||||
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
||||
import { dateRange } from 'src/filters';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
@ -24,11 +27,27 @@ const $props = defineProps({
|
|||
},
|
||||
});
|
||||
const entityId = computed(() => $props.id || route.params.id);
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
handleScopeDays();
|
||||
});
|
||||
|
||||
const cloneTravel = (travelData) => {
|
||||
const stringifiedTravelData = JSON.stringify(travelData);
|
||||
redirectToCreateView(stringifiedTravelData);
|
||||
};
|
||||
|
||||
function handleScopeDays(days = 7) {
|
||||
days = +days;
|
||||
tableRef.value.params.scopeDays = days;
|
||||
const [landedFrom, landedTo] = dateRange(Date.vnNew());
|
||||
landedTo.setDate(landedTo.getDate() + days);
|
||||
|
||||
tableRef.value.params.landedFrom = landedFrom;
|
||||
tableRef.value.params.landedTo = landedTo;
|
||||
}
|
||||
|
||||
const redirectToCreateView = (queryParams) => {
|
||||
router.push({ name: 'TravelCreate', query: { travelData: queryParams } });
|
||||
};
|
||||
|
@ -37,10 +56,6 @@ const redirectCreateEntryView = (travelData) => {
|
|||
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -241,6 +256,17 @@ const columns = computed(() => [
|
|||
:class="{ 'is-active': row.isReceived }"
|
||||
/>
|
||||
</template>
|
||||
<template #moreFilterPanel="{ params }">
|
||||
<VnInputNumber
|
||||
:label="t('params.scopeDays')"
|
||||
v-model.number="params.scopeDays"
|
||||
@keyup.enter="(evt) => handleScopeDays(evt.target.value)"
|
||||
@remove="handleScopeDays()"
|
||||
class="q-px-xs q-pr-lg"
|
||||
filled
|
||||
dense
|
||||
/>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue