feat: change skeleteon different components
This commit is contained in:
parent
aa007117a7
commit
a2316fb222
|
@ -100,6 +100,7 @@ globals:
|
||||||
zonesList: Zones
|
zonesList: Zones
|
||||||
deliveryList: Delivery days
|
deliveryList: Delivery days
|
||||||
upcomingList: Upcoming deliveries
|
upcomingList: Upcoming deliveries
|
||||||
|
role: Role
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
now: Now
|
now: Now
|
||||||
|
@ -1250,7 +1251,7 @@ zone:
|
||||||
upcomingList: Upcoming deliveries
|
upcomingList: Upcoming deliveries
|
||||||
role:
|
role:
|
||||||
pageTitles:
|
pageTitles:
|
||||||
zones: Zones
|
role: Zones
|
||||||
zonesList: Zones
|
zonesList: Zones
|
||||||
deliveryList: Delivery days
|
deliveryList: Delivery days
|
||||||
upcomingList: Upcoming deliveries
|
upcomingList: Upcoming deliveries
|
||||||
|
|
|
@ -100,6 +100,7 @@ globals:
|
||||||
zonesList: Zonas
|
zonesList: Zonas
|
||||||
deliveryList: Días de entrega
|
deliveryList: Días de entrega
|
||||||
upcomingList: Próximos repartos
|
upcomingList: Próximos repartos
|
||||||
|
role: Role
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
now: Ahora
|
now: Ahora
|
||||||
|
|
|
@ -1,113 +1,112 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toDate } from 'filters/index';
|
import { toDate } from 'src/filters';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import AccountFilter from './AccountFilter.vue';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
|
||||||
import AccountSummary from './Card/AccountSummary.vue';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
|
||||||
|
|
||||||
const STATE_COLOR = {
|
const newAccountForm = reactive({
|
||||||
pending: 'warning',
|
supplierFk: null,
|
||||||
managed: 'info',
|
travelFk: null,
|
||||||
resolved: 'positive',
|
companyFk: null,
|
||||||
};
|
});
|
||||||
function getApiUrl() {
|
|
||||||
return new URL(window.location).origin;
|
|
||||||
}
|
|
||||||
function stateColor(code) {
|
|
||||||
return STATE_COLOR[code];
|
|
||||||
}
|
|
||||||
function navigate(event, id) {
|
|
||||||
if (event.ctrlKey || event.metaKey)
|
|
||||||
return window.open(`${getApiUrl()}/#/account/${id}/summary`);
|
|
||||||
router.push({ path: `/account/${id}` });
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
<QPage>
|
||||||
<QScrollArea class="fit text-grey-8">
|
<VnSubToolbar />
|
||||||
<AccountFilter data-key="AccountList" />
|
<pre>TODO <b>Cuentas</b></pre>
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
<FormModel
|
||||||
<QPage class="column items-center q-pa-md">
|
url-create="Entries"
|
||||||
<div class="vn-card-list">
|
model="account"
|
||||||
<VnPaginate
|
:form-initial-data="newAccountForm"
|
||||||
data-key="AccountList"
|
@on-data-saved="redirectToAccountBasicData"
|
||||||
url="Accounts/filter"
|
>
|
||||||
:order="['priority ASC', 'created DESC']"
|
<template #form="{ data, validate }">
|
||||||
auto-load
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
>
|
<div class="col">
|
||||||
<template #body="{ rows }">
|
<VnSelect
|
||||||
<CardList
|
:label="t('Supplier')"
|
||||||
:id="row.id"
|
class="full-width"
|
||||||
:key="row.id"
|
v-model="data.supplierFk"
|
||||||
:title="row.clientName"
|
:options="suppliersOptions"
|
||||||
@click="navigate($event, row.id)"
|
option-value="id"
|
||||||
v-for="row of rows"
|
option-label="nickname"
|
||||||
>
|
hide-selected
|
||||||
<template #list-items>
|
:required="true"
|
||||||
<VnLv :label="t('account.list.customer')">
|
:rules="validate('account.supplierFk')"
|
||||||
<template #value>
|
>
|
||||||
<span class="link" @click.stop>
|
<template #option="scope">
|
||||||
{{ row.clientName }}
|
<QItem v-bind="scope.itemProps">
|
||||||
</span>
|
<QItemSection>
|
||||||
</template>
|
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
</VnLv>
|
<QItemLabel caption>
|
||||||
<VnLv :label="t('account.list.assignedTo')">
|
#{{ scope.opt?.id }}
|
||||||
<template #value>
|
</QItemLabel>
|
||||||
<span @click.stop>
|
</QItemSection>
|
||||||
<VnUserLink
|
</QItem>
|
||||||
:name="row.workerName"
|
</template>
|
||||||
:worker-id="row.workerFk"
|
</VnSelect>
|
||||||
/>
|
</div>
|
||||||
</span>
|
</VnRow>
|
||||||
</template>
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
</VnLv>
|
<div class="col">
|
||||||
<VnLv
|
<VnSelect
|
||||||
:label="t('account.list.created')"
|
:label="t('Travel')"
|
||||||
:value="toDate(row.created)"
|
class="full-width"
|
||||||
/>
|
v-model="data.travelFk"
|
||||||
<VnLv :label="t('account.list.state')">
|
:options="travelsOptions"
|
||||||
<template #value>
|
option-value="id"
|
||||||
<QBadge
|
option-label="warehouseInName"
|
||||||
text-color="black"
|
map-options
|
||||||
:color="stateColor(row.stateCode)"
|
hide-selected
|
||||||
dense
|
:required="true"
|
||||||
>
|
:rules="validate('account.travelFk')"
|
||||||
{{ row.stateDescription }}
|
>
|
||||||
</QBadge>
|
<template #option="scope">
|
||||||
</template>
|
<QItem v-bind="scope.itemProps">
|
||||||
</VnLv>
|
<QItemSection>
|
||||||
</template>
|
<QItemLabel
|
||||||
<template #actions>
|
>{{ scope.opt?.agencyModeName }} -
|
||||||
<QBtn
|
{{ scope.opt?.warehouseInName }} ({{
|
||||||
:label="t('globals.description')"
|
toDate(scope.opt?.shipped)
|
||||||
@click.stop
|
}}) →
|
||||||
outline
|
{{ scope.opt?.warehouseOutName }} ({{
|
||||||
style="margin-top: 15px"
|
toDate(scope.opt?.landed)
|
||||||
>
|
}})</QItemLabel
|
||||||
</QBtn>
|
>
|
||||||
<QBtn
|
</QItemSection>
|
||||||
:label="t('components.smartCard.openSummary')"
|
</QItem>
|
||||||
@click.stop="viewSummary(row.id, AccountSummary)"
|
</template>
|
||||||
color="primary"
|
</VnSelect>
|
||||||
style="margin-top: 15px"
|
</div>
|
||||||
/>
|
</VnRow>
|
||||||
</template>
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
</CardList>
|
<div class="col">
|
||||||
</template>
|
<VnSelect
|
||||||
</VnPaginate>
|
:label="t('Company')"
|
||||||
</div>
|
class="full-width"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
:options="companiesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.companyFk')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,113 +1,75 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onMounted, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import { toDate } from 'filters/index';
|
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import AccountFilter from './AccountFilter.vue';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
|
||||||
import AccountSummary from './Card/AccountSummary.vue';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const filter = computed(() => ({
|
||||||
|
fields: ['id', 'created', 'userId'],
|
||||||
|
include: { relation: 'user', scope: { fields: ['username'] } },
|
||||||
|
order: 'created DESC',
|
||||||
|
limit: 20,
|
||||||
|
}));
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const STATE_COLOR = {
|
const urlPath = computed(() => `AccessTokens`);
|
||||||
pending: 'warning',
|
const entityId = computed(() => $props.id || useRoute().params.id);
|
||||||
managed: 'info',
|
|
||||||
resolved: 'positive',
|
onMounted(async () => {});
|
||||||
};
|
|
||||||
function getApiUrl() {
|
|
||||||
return new URL(window.location).origin;
|
|
||||||
}
|
|
||||||
function stateColor(code) {
|
|
||||||
return STATE_COLOR[code];
|
|
||||||
}
|
|
||||||
function navigate(event, id) {
|
|
||||||
if (event.ctrlKey || event.metaKey)
|
|
||||||
return window.open(`${getApiUrl()}/#/account/${id}/summary`);
|
|
||||||
router.push({ path: `/account/${id}` });
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<AccountFilter data-key="AccountList" />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<div class="vn-card-list">
|
<div class="full-width" style="max-width: 400px">
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
data-key="AccountList"
|
ref="paginateRef"
|
||||||
url="Accounts/filter"
|
data-key="AccessTokens"
|
||||||
:order="['priority ASC', 'created DESC']"
|
:filter="filter"
|
||||||
|
:url="urlPath"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<CardList
|
<QTable :rows="data" :columns="columns" hide-header>
|
||||||
:id="row.id"
|
<template #body="{ row, rowIndex }">
|
||||||
:key="row.id"
|
<QTr>
|
||||||
:title="row.clientName"
|
<QTd>
|
||||||
@click="navigate($event, row.id)"
|
<span>{{ row.warehouse?.name }}</span>
|
||||||
v-for="row of rows"
|
</QTd>
|
||||||
>
|
<QTd style="width: 50px !important">
|
||||||
<template #list-items>
|
<QIcon
|
||||||
<VnLv :label="t('account.list.customer')">
|
name="delete"
|
||||||
<template #value>
|
size="sm"
|
||||||
<span class="link" @click.stop>
|
class="cursor-pointer"
|
||||||
{{ row.clientName }}
|
color="primary"
|
||||||
</span>
|
@click="
|
||||||
</template>
|
openConfirmationModal(
|
||||||
</VnLv>
|
t('warehouses.deleteTitle'),
|
||||||
<VnLv :label="t('account.list.assignedTo')">
|
t('warehouses.deleteSubtitle'),
|
||||||
<template #value>
|
() => deleteWarehouse(row, rows, rowIndex)
|
||||||
<span @click.stop>
|
)
|
||||||
<VnUserLink
|
"
|
||||||
:name="row.workerName"
|
|
||||||
:worker-id="row.workerFk"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
<VnLv
|
|
||||||
:label="t('account.list.created')"
|
|
||||||
:value="toDate(row.created)"
|
|
||||||
/>
|
|
||||||
<VnLv :label="t('account.list.state')">
|
|
||||||
<template #value>
|
|
||||||
<QBadge
|
|
||||||
text-color="black"
|
|
||||||
:color="stateColor(row.stateCode)"
|
|
||||||
dense
|
|
||||||
>
|
>
|
||||||
{{ row.stateDescription }}
|
<QTooltip>
|
||||||
</QBadge>
|
{{ t('warehouses.delete') }}
|
||||||
</template>
|
</QTooltip>
|
||||||
</VnLv>
|
</QIcon>
|
||||||
|
</QTd>
|
||||||
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
</QTable>
|
||||||
<QBtn
|
|
||||||
:label="t('globals.description')"
|
|
||||||
@click.stop
|
|
||||||
outline
|
|
||||||
style="margin-top: 15px"
|
|
||||||
>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openSummary')"
|
|
||||||
@click.stop="viewSummary(row.id, AccountSummary)"
|
|
||||||
color="primary"
|
|
||||||
style="margin-top: 15px"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</CardList>
|
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
|
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||||
|
<QBtn fab icon="add" color="primary" @click="createMailAlias()">
|
||||||
|
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,11 +1,75 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onMounted, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const filter = computed(() => ({
|
||||||
|
fields: ['id', 'created', 'userId'],
|
||||||
|
include: { relation: 'user', scope: { fields: ['username'] } },
|
||||||
|
order: 'created DESC',
|
||||||
|
limit: 20,
|
||||||
|
}));
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const urlPath = computed(() => `AccessTokens`);
|
||||||
|
const entityId = computed(() => $props.id || useRoute().params.id);
|
||||||
|
|
||||||
|
onMounted(async () => {});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<div class="vn-card-list"></div>
|
<div class="full-width" style="max-width: 400px">
|
||||||
|
<VnPaginate
|
||||||
|
ref="paginateRef"
|
||||||
|
data-key="AccessTokens"
|
||||||
|
:filter="filter"
|
||||||
|
:url="urlPath"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<QTable :rows="data" :columns="columns" hide-header>
|
||||||
|
<template #body="{ row, rowIndex }">
|
||||||
|
<QTr>
|
||||||
|
<QTd>
|
||||||
|
<span>{{ row.warehouse?.name }}</span>
|
||||||
|
</QTd>
|
||||||
|
<QTd style="width: 50px !important">
|
||||||
|
<QIcon
|
||||||
|
name="delete"
|
||||||
|
size="sm"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('warehouses.deleteTitle'),
|
||||||
|
t('warehouses.deleteSubtitle'),
|
||||||
|
() => deleteWarehouse(row, rows, rowIndex)
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('warehouses.delete') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</QTd>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
|
</QTable>
|
||||||
|
</template>
|
||||||
|
</VnPaginate>
|
||||||
|
</div>
|
||||||
|
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||||
|
<QBtn fab icon="refresh" color="primary" @click="refresh()">
|
||||||
|
<QTooltip>{{ t('warehouses.refresh') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,11 +1,111 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const newAccountForm = reactive({
|
||||||
|
supplierFk: null,
|
||||||
|
travelFk: null,
|
||||||
|
companyFk: null,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage>
|
||||||
<div class="vn-card-list"></div>
|
<VnSubToolbar />
|
||||||
|
<pre>TODO <b>LDAP</b></pre>
|
||||||
|
<FormModel
|
||||||
|
url-create="Entries"
|
||||||
|
model="account"
|
||||||
|
:form-initial-data="newAccountForm"
|
||||||
|
@on-data-saved="redirectToAccountBasicData"
|
||||||
|
>
|
||||||
|
<template #form="{ data, validate }">
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Supplier')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.supplierFk"
|
||||||
|
:options="suppliersOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.supplierFk')"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
#{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Travel')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.travelFk"
|
||||||
|
:options="travelsOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="warehouseInName"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.travelFk')"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
>{{ scope.opt?.agencyModeName }} -
|
||||||
|
{{ scope.opt?.warehouseInName }} ({{
|
||||||
|
toDate(scope.opt?.shipped)
|
||||||
|
}}) →
|
||||||
|
{{ scope.opt?.warehouseOutName }} ({{
|
||||||
|
toDate(scope.opt?.landed)
|
||||||
|
}})</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Company')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
:options="companiesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.companyFk')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,11 +1,111 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const newAccountForm = reactive({
|
||||||
|
supplierFk: null,
|
||||||
|
travelFk: null,
|
||||||
|
companyFk: null,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage>
|
||||||
<div class="vn-card-list"></div>
|
<VnSubToolbar />
|
||||||
|
<pre>TODO <b>SAMBA</b></pre>
|
||||||
|
<FormModel
|
||||||
|
url-create="Entries"
|
||||||
|
model="account"
|
||||||
|
:form-initial-data="newAccountForm"
|
||||||
|
@on-data-saved="redirectToAccountBasicData"
|
||||||
|
>
|
||||||
|
<template #form="{ data, validate }">
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Supplier')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.supplierFk"
|
||||||
|
:options="suppliersOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.supplierFk')"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
#{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Travel')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.travelFk"
|
||||||
|
:options="travelsOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="warehouseInName"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.travelFk')"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
>{{ scope.opt?.agencyModeName }} -
|
||||||
|
{{ scope.opt?.warehouseInName }} ({{
|
||||||
|
toDate(scope.opt?.shipped)
|
||||||
|
}}) →
|
||||||
|
{{ scope.opt?.warehouseOutName }} ({{
|
||||||
|
toDate(scope.opt?.landed)
|
||||||
|
}})</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Company')"
|
||||||
|
class="full-width"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
:options="companiesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
:rules="validate('account.companyFk')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue