WIP
This commit is contained in:
parent
41605db454
commit
c43e7011a4
|
@ -67,3 +67,13 @@ body.body--dark {
|
|||
.q-field.required .q-field__label:after {
|
||||
content: ' *';
|
||||
}
|
||||
|
||||
input[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
|
|
@ -266,6 +266,7 @@ export default {
|
|||
buys: 'Buys',
|
||||
notes: 'Notes',
|
||||
log: 'Log',
|
||||
create: 'Create',
|
||||
},
|
||||
list: {
|
||||
newEntry: 'New entry',
|
||||
|
|
|
@ -265,6 +265,7 @@ export default {
|
|||
buys: 'Compras',
|
||||
notes: 'Notas',
|
||||
log: 'Historial',
|
||||
create: 'Crear',
|
||||
},
|
||||
list: {
|
||||
newEntry: 'Nueva entrada',
|
||||
|
|
|
@ -163,8 +163,9 @@ const currenciesOptions = ref([]);
|
|||
:label="t('entry.basicData.observation')"
|
||||
type="textarea"
|
||||
v-model="data.observation"
|
||||
:maxlength="45"
|
||||
counter
|
||||
fill-input
|
||||
autogrow
|
||||
/>
|
||||
</div>
|
||||
</VnRow>
|
||||
|
|
|
@ -256,6 +256,33 @@ const deleteBuys = async () => {
|
|||
const importBuys = () => {
|
||||
router.push({ name: 'EntryBuysImport' });
|
||||
};
|
||||
|
||||
const toggleGroupingMode = async (buy, mode) => {
|
||||
try {
|
||||
const grouping = 1;
|
||||
const packing = 2;
|
||||
const groupingMode = mode === 'grouping' ? grouping : packing;
|
||||
|
||||
const newGroupingMode = buy.groupingMode === groupingMode ? 0 : groupingMode;
|
||||
|
||||
const params = {
|
||||
groupingMode: newGroupingMode,
|
||||
};
|
||||
|
||||
await axios.patch(`Buys/${buy.id}`, params);
|
||||
buy.groupingMode = newGroupingMode;
|
||||
} catch (err) {
|
||||
console.error('Error toggling grouping mode');
|
||||
}
|
||||
};
|
||||
|
||||
const showLockIcon = (groupingMode, mode) => {
|
||||
if (mode === 'packing') {
|
||||
return groupingMode === 2 ? 'lock' : 'lock_open';
|
||||
} else {
|
||||
return groupingMode === 1 ? 'lock' : 'lock_open';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -309,6 +336,25 @@ const importBuys = () => {
|
|||
v-model="props.row[col.field]"
|
||||
v-on="tableColumnComponents[col.name].event(props)"
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
col.name === 'grouping' || col.name === 'packing'
|
||||
"
|
||||
#append
|
||||
>
|
||||
<QBtn
|
||||
:icon="
|
||||
showLockIcon(props.row.groupingMode, col.name)
|
||||
"
|
||||
@click="toggleGroupingMode(props.row, col.name)"
|
||||
class="cursor-pointer"
|
||||
size="sm"
|
||||
flat
|
||||
dense
|
||||
unelevated
|
||||
push
|
||||
/>
|
||||
</template>
|
||||
<template
|
||||
v-if="col.name === 'item' || col.name === 'import'"
|
||||
>
|
||||
|
@ -381,6 +427,7 @@ const importBuys = () => {
|
|||
</QTable>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
|
||||
<QPageSticky :offset="[20, 20]">
|
||||
<QBtn fab icon="upload" color="primary" @click="importBuys()" />
|
||||
<QTooltip class="text-no-wrap">
|
||||
|
|
|
@ -16,6 +16,7 @@ const stateStore = useStateStore();
|
|||
<Teleport to="#searchbar">
|
||||
<VnSearchbar
|
||||
data-key="EntryList"
|
||||
url="Entries/filter"
|
||||
:label="t('Search entries')"
|
||||
:info="t('You can search by entry reference')"
|
||||
/>
|
||||
|
|
|
@ -111,13 +111,6 @@ const showEntryReport = () => {
|
|||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
||||
<QItemSection>{{ t('Show entry report') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection>
|
||||
<RouterLink :to="{ name: 'EntryList' }" class="color-vn-text">
|
||||
{{ t('Go to module index') }}
|
||||
</RouterLink>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv
|
||||
|
|
|
@ -49,6 +49,7 @@ onMounted(() => {
|
|||
:label="t('entry.notes.observationType')"
|
||||
v-model="row.observationTypeFk"
|
||||
:options="entryObservationsOptions"
|
||||
:disable="!!row.id"
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
|
@ -9,20 +9,27 @@ import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { toDate } from 'src/filters';
|
||||
|
||||
const state = useState();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const user = state.getUser();
|
||||
const newEntryForm = reactive({
|
||||
supplierFk: null,
|
||||
travelFk: route.query?.travelFk || null,
|
||||
companyFk: null,
|
||||
companyFk: user.value.companyFk || null,
|
||||
});
|
||||
|
||||
const suppliersOptions = ref([]);
|
||||
const travelsOptionsOptions = ref([]);
|
||||
const companiesOptions = ref([]);
|
||||
|
||||
const redirectToEntryBasicData = (_, { id }) => {
|
||||
router.push({ name: 'EntryBasicData', params: { id } });
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -48,12 +55,14 @@ const companiesOptions = ref([]);
|
|||
@on-fetch="(data) => (companiesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
||||
<!-- Agregar searchbar de entries -->
|
||||
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<FormModel url-create="Entries" model="entry" :form-initial-data="newEntryForm">
|
||||
<FormModel
|
||||
url-create="Entries"
|
||||
model="entry"
|
||||
:form-initial-data="newEntryForm"
|
||||
@on-data-saved="redirectToEntryBasicData"
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
|
|
|
@ -53,7 +53,7 @@ const suppliersOptions = ref([]);
|
|||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params }">
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
|
@ -95,6 +95,7 @@ const suppliersOptions = ref([]);
|
|||
<VnSelectFilter
|
||||
:label="t('params.companyFk')"
|
||||
v-model="params.companyFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="companiesOptions"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
|
@ -110,6 +111,7 @@ const suppliersOptions = ref([]);
|
|||
<VnSelectFilter
|
||||
:label="t('params.currencyFk')"
|
||||
v-model="params.currencyFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="currenciesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
@ -125,6 +127,7 @@ const suppliersOptions = ref([]);
|
|||
<VnSelectFilter
|
||||
:label="t('params.supplierFk')"
|
||||
v-model="params.supplierFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="suppliersOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
@ -149,8 +152,9 @@ const suppliersOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.created')"
|
||||
is-outlined
|
||||
v-model="params.created"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -158,8 +162,9 @@ const suppliersOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.from')"
|
||||
is-outlined
|
||||
v-model="params.from"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -167,8 +172,9 @@ const suppliersOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.to')"
|
||||
is-outlined
|
||||
v-model="params.to"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -14,6 +14,7 @@ const stateStore = useStateStore();
|
|||
<Teleport to="#searchbar">
|
||||
<VnSearchbar
|
||||
data-key="EntryList"
|
||||
url="Entries/filter"
|
||||
:label="t('Search entries')"
|
||||
:info="t('You can search by entry reference')"
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue