forked from verdnatura/salix-front
Merge branch 'dev' into 7155-scopeDays
This commit is contained in:
commit
364ce63545
181
CHANGELOG.md
181
CHANGELOG.md
|
@ -1,3 +1,184 @@
|
||||||
|
# Version 24.38 - 2024-09-17
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
|
||||||
|
- chore: refs #7323 worker changes by:jorgep
|
||||||
|
- chore: refs #7353 fix warnings by:jorgep
|
||||||
|
- chore: refs #7353 use Vue component nomenclature by:jorgep
|
||||||
|
- chore: refs #7356 fix type by:jorgep
|
||||||
|
- feat(AccountConnections): use VnToken by:alexm
|
||||||
|
- feat: add key to routerView by:Javier Segarra
|
||||||
|
- feat: add plus shortcut in VnTable by:Javier Segarra
|
||||||
|
- feat: add row by:Javier Segarra
|
||||||
|
- feat: addRow withour dialog by:Javier Segarra
|
||||||
|
- feat: apply mixin by:Javier Segarra
|
||||||
|
- feat by:Javier Segarra
|
||||||
|
- feat: change navBar buttons by:Javier Segarra
|
||||||
|
- feat: dense rows by:Javier Segarra
|
||||||
|
- feat: fields with wrong name by:jgallego
|
||||||
|
- feat: fix bugs and filters by:Javier Segarra
|
||||||
|
- feat: fix refund parameters by:jgallego
|
||||||
|
- feat: handle create row by:Javier Segarra
|
||||||
|
- feat: handle dates by:Javier Segarra
|
||||||
|
- feat: handle qCheckbox 3rd state by:Javier Segarra
|
||||||
|
- feat: imrpove VnInputTime to set cursor at start by:Javier Segarra
|
||||||
|
- feat: keyShortcut directive by:Javier Segarra
|
||||||
|
- feat: minor fixes by:jgallego
|
||||||
|
- feat: only filter by isDestiny by:Javier Segarra
|
||||||
|
- feat: refs #211153 businessDataLinkGrafana by:robert
|
||||||
|
- feat: refs #7129 add km start and end on create form by:pablone
|
||||||
|
- feat: refs #7353 add filter & fix customTags by:jorgep
|
||||||
|
- feat: refs #7353 add locale by:jorgep
|
||||||
|
- feat: refs #7353 add no one opt by:jorgep
|
||||||
|
- feat: refs #7353 add right icons by:jorgep
|
||||||
|
- feat: refs #7353 imporve toDateFormat by:jorgep
|
||||||
|
- feat: refs #7353 salesPerson nickname & id by:jorgep
|
||||||
|
- feat: refs #7353 split sections by:jorgep
|
||||||
|
- feat: refs #7847 remove reload btn by:jorgep
|
||||||
|
- feat: refs #7847 remove reload fn by:jorgep
|
||||||
|
- feat: refs #7889 added shortcuts to modules by:Jon
|
||||||
|
- feat: refs #7911 added shortcut to modules by:Jon
|
||||||
|
- feat: refuncInvoiceForm component by:jgallego
|
||||||
|
- feat: remove duplicity by:Javier Segarra
|
||||||
|
- feat: remove future itemFixedPrices by:Javier Segarra
|
||||||
|
- feat: replace stickyButtons by subtoolbar by:Javier Segarra
|
||||||
|
- feat: required validation by:Javier Segarra
|
||||||
|
- feat: show bad dates by:Javier Segarra
|
||||||
|
- feat: showdate icons by:Javier Segarra
|
||||||
|
- feat: solve ItemFixedFilterPanel by:Javier Segarra
|
||||||
|
- feat: transfer an invoice by:jgallego
|
||||||
|
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
|
||||||
|
- feat: unnecessary changes by:Javier Segarra
|
||||||
|
- feat: update changelog (origin/7896_down_devToTest_2436) by:Javier Segarra
|
||||||
|
- feat: updates by:Javier Segarra
|
||||||
|
- feat: update version and changelog by:Javier Segarra
|
||||||
|
- feat: vnInput\* by:Javier Segarra
|
||||||
|
- feat: with VnTable by:Javier Segarra
|
||||||
|
- refs #6772 feat: fix approach by:Javier Segarra
|
||||||
|
- refs #6772 feat: refresh shelving.basic-data by:Javier Segarra
|
||||||
|
- style: show subName value by:Javier Segarra
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: add v-shortcut in VnCard by:Javier Segarra
|
||||||
|
- perf: approach by:Javier Segarra
|
||||||
|
- perf: change directive location by:Javier Segarra
|
||||||
|
- perf: change slots order by:Javier Segarra
|
||||||
|
- perf: examples by:Javier Segarra
|
||||||
|
- perf: hide icon for VnInputDate by:Javier Segarra
|
||||||
|
- perf: improve ItemFixedPricefilterPanel by:Javier Segarra
|
||||||
|
- perf: improve mainShrotcutMixin by:Javier Segarra
|
||||||
|
- perf: minor clean code by:Javier Segarra
|
||||||
|
- perf: onRowchange by:Javier Segarra
|
||||||
|
- perf: order by by:Javier Segarra
|
||||||
|
- perf: order components by:Javier Segarra
|
||||||
|
- perf: refs #7889 perf shortcut test by:Jon
|
||||||
|
- perf: remove console.log by:Javier Segarra
|
||||||
|
- perf: remove icons in header slot by:Javier Segarra
|
||||||
|
- perf: remove print variables by:Javier Segarra
|
||||||
|
- perf: restore CustomerBasicData by:Javier Segarra
|
||||||
|
- refactor: deleted useless prop by:Jon
|
||||||
|
- refactor: deleted useless prop in FetchedTags by:Jon
|
||||||
|
- refactor: refs #7323 drop useless code by:jorgep
|
||||||
|
- refactor: refs #7353 clients correction by:jorgep
|
||||||
|
- refactor: refs #7353 clients correction wip by:jorgep
|
||||||
|
- refactor: refs #7353 ease logic by:jorgep
|
||||||
|
- refactor: refs #7353 order correction by:jorgep
|
||||||
|
- refactor: refs #7353 simplify code by:jorgep
|
||||||
|
- refactor: refs #7353 tickets correction by:jorgep
|
||||||
|
- refactor: refs #7353 use global locales by:jorgep
|
||||||
|
- refactor: refs #7354 changed descriptor menu options by:Jon
|
||||||
|
- refactor: refs #7354 changed icon color in table and notification when deleting a zone by:Jon
|
||||||
|
- refactor: refs #7354 fix tableFilters by:Jon
|
||||||
|
- refactor: refs #7354 modified VnInputTime by:Jon
|
||||||
|
- refactor: refs #7354 refactor deliveryPanel by:Jon
|
||||||
|
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
|
||||||
|
- refactor: refs #7354 requested changes by:Jon
|
||||||
|
- refactor: refs #7354 reverse deliveryPanel changes by:Jon
|
||||||
|
- refactor: refs #7354 Zone migration changes by:Jon
|
||||||
|
- refactor: refs #7889 deleted subtitle attr and use keyBinding instead by:Jon
|
||||||
|
- refactor: refs #7889 modified shortcut and dashboard, and added tootlip in LeftMenu by:Jon
|
||||||
|
- refs #6722 perf: not fetch when id not exists by:Javier Segarra
|
||||||
|
- refs #6772 perf: change variable name by:JAVIER SEGARRA MARTINEZ
|
||||||
|
- refs #6772 perf: use ArrayData (6772_reload_sections) by:Javier Segarra
|
||||||
|
- refs #7283 refactor fix ItemDescriptor by:carlossa
|
||||||
|
- refs #7283 refactor ItexDescriptor by:carlossa
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
|
||||||
|
- chore: refs #7353 fix warnings by:jorgep
|
||||||
|
- chore: refs #7356 fix type by:jorgep
|
||||||
|
- feat: fix bugs and filters by:Javier Segarra
|
||||||
|
- feat: fix refund parameters by:jgallego
|
||||||
|
- feat: minor fixes by:jgallego
|
||||||
|
- feat: refs #7353 add filter & fix customTags by:jorgep
|
||||||
|
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
|
||||||
|
- fix: add border-top by:Javier Segarra
|
||||||
|
- fix: added missing descriptors and small details by:Jon
|
||||||
|
- fix branch by:carlossa
|
||||||
|
- fix: call upsert when crudModel haschanges by:Javier Segarra
|
||||||
|
- fix(ClaimList): fix summary by:alexm
|
||||||
|
- fix: cli warnings by:Javier Segarra
|
||||||
|
- fix: editTableOptions by:Javier Segarra
|
||||||
|
- fix events and descriptor menu by:Jon
|
||||||
|
- fix: InvoiceIn sections (origin/6772_reload_sections) by:Javier Segarra
|
||||||
|
- fix: minor changes by:Javier Segarra
|
||||||
|
- fix: minor error whit dates by:Javier Segarra
|
||||||
|
- fix: module icon by:Javier Segarra
|
||||||
|
- fix: options QDate by:Javier Segarra
|
||||||
|
- fix: refs #6900 e2e error by:jorgep
|
||||||
|
- fix: refs #6900 rollback by:jorgep
|
||||||
|
- fix: refs #7353 css by:jorgep
|
||||||
|
- fix: refs #7353 hide search param (origin/7353-warmfix-fixSearchbar) by:jorgep
|
||||||
|
- fix: refs #7353 iron out filter by:jorgep
|
||||||
|
- fix: refs #7353 iron out ticket table by:jorgep
|
||||||
|
- fix: refs #7353 padding by:jorgep
|
||||||
|
- fix: refs #7353 salesClientTable by:jorgep
|
||||||
|
- fix: refs #7353 salesorderTable by:jorgep
|
||||||
|
- fix: refs #7353 saleTicketMonitors by:jorgep
|
||||||
|
- fix: refs #7353 use same datakey by:jorgep
|
||||||
|
- fix: refs #7353 vnTable colors by:jorgep
|
||||||
|
- fix: refs #7354 e2e tests by:Jon
|
||||||
|
- fix: refs #7354 fix delivery days by:Jon
|
||||||
|
- fix: refs #7354 fix list searchbar and filters by:Jon
|
||||||
|
- fix: refs #7354 fix VnSearchbar search for zone section & finished basic tests by:Jon
|
||||||
|
- fix: refs #7354 fix VnTable filters and agency field by:Jon
|
||||||
|
- fix: refs #7354 fix zoneSearchbar by:Jon
|
||||||
|
- fix: refs #7354 requested changes by:Jon
|
||||||
|
- fix: refs #7356 colors by:jorgep
|
||||||
|
- fix: refs #7356 create claim dialog by:jorgep
|
||||||
|
- fix: refs #7889 fixed shortcut test by:Jon
|
||||||
|
- fix: refs #7903 fixed ticket's search bar and keybinding tooltip by:Jon
|
||||||
|
- fix: refs #7911 fixed shortcut and related files by:Jon
|
||||||
|
- fix: remove condition duplicated by:Javier Segarra
|
||||||
|
- fix: remove property by:Javier Segarra
|
||||||
|
- fix tootltip by:carlossa
|
||||||
|
- fix traduction by:carlossa
|
||||||
|
- fix(VnSectionMain): add QPage by:alexm
|
||||||
|
- fix(zone): zoneLocation and the others searchbar by:alexm
|
||||||
|
- refactor: refs #7354 fix tableFilters by:Jon
|
||||||
|
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
|
||||||
|
- refs #6772 feat: fix approach by:Javier Segarra
|
||||||
|
- refs #6772 fix: claimPhoto reload by:Javier Segarra
|
||||||
|
- refs #6896 fix searchbar by:carlossa
|
||||||
|
- refs #6897 fix entry by:carlossa
|
||||||
|
- refs #6899 fix invoiceFix by:carlossa
|
||||||
|
- refs #6899 fix order by:carlossa
|
||||||
|
- refs #7283 fix by:carlossa
|
||||||
|
- refs #7283 fix ItemDescriptor warehouse by:carlossa
|
||||||
|
- refs #7283 refactor fix ItemDescriptor by:carlossa
|
||||||
|
- refs #7355 #7366 fix account, summary, list, travelList, tooltip by:carlossa
|
||||||
|
- refs #7355 fix accountPrivileges by:carlossa
|
||||||
|
- refs #7355 fix accounts, vnTable by:carlossa
|
||||||
|
- refs #7355 fix privileges by:carlossa
|
||||||
|
- refs #7355 fix roles filters by:carlossa
|
||||||
|
- refs #7355 fix total by:carlossa
|
||||||
|
- refs #7355 fix views summarys, entryList, travelList refact by:carlossa
|
||||||
|
- refs #7366 fix travel hours by:carlossa
|
||||||
|
- test: fix e2e by:Javier Segarra
|
||||||
|
|
||||||
# Version 24.36 - 2024-08-27
|
# Version 24.36 - 2024-08-27
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -62,4 +62,4 @@
|
||||||
"vite": "^5.1.4",
|
"vite": "^5.1.4",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,10 @@ import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
const baseUrl = '/api/';
|
||||||
|
|
||||||
axios.defaults.baseURL = '/api/';
|
axios.defaults.baseURL = baseUrl;
|
||||||
|
const axiosNoError = axios.create({ baseURL: baseUrl });
|
||||||
|
|
||||||
const onRequest = (config) => {
|
const onRequest = (config) => {
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
|
@ -79,5 +81,7 @@ const onResponseError = (error) => {
|
||||||
|
|
||||||
axios.interceptors.request.use(onRequest, onRequestError);
|
axios.interceptors.request.use(onRequest, onRequestError);
|
||||||
axios.interceptors.response.use(onResponse, onResponseError);
|
axios.interceptors.response.use(onResponse, onResponseError);
|
||||||
|
axiosNoError.interceptors.request.use(onRequest);
|
||||||
|
axiosNoError.interceptors.response.use(onResponse);
|
||||||
|
|
||||||
export { onRequest, onResponseError };
|
export { onRequest, onResponseError, axiosNoError };
|
||||||
|
|
|
@ -34,7 +34,7 @@ const model = defineModel(undefined, { required: true });
|
||||||
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
||||||
const columnFilter = computed(() => $props.column?.columnFilter);
|
const columnFilter = computed(() => $props.column?.columnFilter);
|
||||||
|
|
||||||
const updateEvent = { 'update:modelValue': addFilter, remove: () => addFilter(null) };
|
const updateEvent = { 'update:modelValue': addFilter };
|
||||||
const enterEvent = {
|
const enterEvent = {
|
||||||
'keyup.enter': () => addFilter(model.value),
|
'keyup.enter': () => addFilter(model.value),
|
||||||
remove: () => addFilter(null),
|
remove: () => addFilter(null),
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
const model = defineModel({ type: Object });
|
const model = defineModel({ type: Object });
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: [String, Boolean],
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
|
|
|
@ -101,6 +101,10 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '90vh',
|
default: '90vh',
|
||||||
},
|
},
|
||||||
|
footer: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -196,7 +200,7 @@ function setUserParams(watchedParams, watchedOrder) {
|
||||||
|
|
||||||
function sanitizer(params) {
|
function sanitizer(params) {
|
||||||
for (const [key, value] of Object.entries(params)) {
|
for (const [key, value] of Object.entries(params)) {
|
||||||
if (typeof value == 'object') {
|
if (value && typeof value == 'object') {
|
||||||
const param = Object.values(value)[0];
|
const param = Object.values(value)[0];
|
||||||
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
|
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
|
||||||
}
|
}
|
||||||
|
@ -370,7 +374,7 @@ function handleOnDataSaved(_) {
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:disable-infinite-scroll="
|
:disable-infinite-scroll="
|
||||||
$attrs['disableInfiniteScroll'] ? isTableMode : disableInfiniteScroll
|
$attrs['disableInfiniteScroll'] ? isTableMode : !disableInfiniteScroll
|
||||||
"
|
"
|
||||||
@save-changes="reload"
|
@save-changes="reload"
|
||||||
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
||||||
|
@ -391,7 +395,7 @@ function handleOnDataSaved(_) {
|
||||||
card-container-class="grid-three"
|
card-container-class="grid-three"
|
||||||
flat
|
flat
|
||||||
:style="isTableMode && `max-height: ${tableHeight}`"
|
:style="isTableMode && `max-height: ${tableHeight}`"
|
||||||
virtual-scroll
|
:virtual-scroll="!isTableMode"
|
||||||
@virtual-scroll="
|
@virtual-scroll="
|
||||||
(event) =>
|
(event) =>
|
||||||
event.index > rows.length - 2 &&
|
event.index > rows.length - 2 &&
|
||||||
|
@ -508,11 +512,8 @@ function handleOnDataSaved(_) {
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="btn.title"
|
:title="btn.title"
|
||||||
:icon="btn.icon"
|
:icon="btn.icon"
|
||||||
class="q-px-sm"
|
class="q-px-sm text-primary-light"
|
||||||
flat
|
flat
|
||||||
:class="
|
|
||||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
|
||||||
"
|
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
||||||
}`"
|
}`"
|
||||||
|
@ -636,6 +637,28 @@ function handleOnDataSaved(_) {
|
||||||
</QCard>
|
</QCard>
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
|
<template #bottom-row="{ cols }" v-if="footer">
|
||||||
|
<QTr v-if="rows.length" class="bg-header" style="height: 30px">
|
||||||
|
<QTh
|
||||||
|
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
||||||
|
:key="col?.id"
|
||||||
|
class="text-center"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="col?.summation"
|
||||||
|
:class="`text-${col?.align ?? 'left'}`"
|
||||||
|
class="text-bold q-pa-sm"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
rows.reduce(
|
||||||
|
(sum, currentRow) => sum + currentRow[col.name],
|
||||||
|
0
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</QTh>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
|
@ -703,7 +726,7 @@ es:
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-header {
|
.bg-header {
|
||||||
background-color: var(--vn-header-color);
|
background-color: var(--vn-accent-color);
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,9 +736,7 @@ es:
|
||||||
|
|
||||||
.q-table--dark .q-table__bottom,
|
.q-table--dark .q-table__bottom,
|
||||||
.q-table--dark thead,
|
.q-table--dark thead,
|
||||||
.q-table--dark tr,
|
.q-table--dark tr {
|
||||||
.q-table--dark th,
|
|
||||||
.q-table--dark td {
|
|
||||||
border-color: var(--vn-section-color);
|
border-color: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const url = computed(() => {
|
const url = computed(() => {
|
||||||
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
|
if (props.baseUrl) {
|
||||||
|
return `${props.baseUrl}/${route.params.id}`;
|
||||||
|
}
|
||||||
return props.customUrl;
|
return props.customUrl;
|
||||||
});
|
});
|
||||||
const searchRightDataKey = computed(() => {
|
const searchRightDataKey = computed(() => {
|
||||||
|
@ -40,8 +42,10 @@ onBeforeMount(async () => {
|
||||||
try {
|
try {
|
||||||
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
} catch (e) {
|
} catch {
|
||||||
router.push({ name: 'WorkerList' });
|
const { matched: matches } = router.currentRoute.value;
|
||||||
|
const { path } = matches.at(-1);
|
||||||
|
router.push({ path: path.replace(/:id.*/, '') });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,17 +17,15 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let mixed;
|
|
||||||
const componentArray = computed(() => {
|
const componentArray = computed(() => {
|
||||||
if (typeof $props.prop === 'object') return [$props.prop];
|
if (typeof $props.prop === 'object') return [$props.prop];
|
||||||
return $props.prop;
|
return $props.prop;
|
||||||
});
|
});
|
||||||
|
|
||||||
function mix(toComponent) {
|
function mix(toComponent) {
|
||||||
if (mixed) return mixed;
|
|
||||||
const { component, attrs, event } = toComponent;
|
const { component, attrs, event } = toComponent;
|
||||||
const customComponent = $props.components[component];
|
const customComponent = $props.components[component];
|
||||||
mixed = {
|
return {
|
||||||
component: customComponent?.component ?? component,
|
component: customComponent?.component ?? component,
|
||||||
attrs: {
|
attrs: {
|
||||||
...toValueAttrs(attrs),
|
...toValueAttrs(attrs),
|
||||||
|
@ -37,7 +35,6 @@ function mix(toComponent) {
|
||||||
},
|
},
|
||||||
event: { ...customComponent?.event, ...event },
|
event: { ...customComponent?.event, ...event },
|
||||||
};
|
};
|
||||||
return mixed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toValueAttrs(attrs) {
|
function toValueAttrs(attrs) {
|
||||||
|
|
|
@ -5,12 +5,14 @@ import { useRoute } from 'vue-router';
|
||||||
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
|
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
import VnUserLink from '../ui/VnUserLink.vue';
|
||||||
|
import { downloadFile } from 'src/composables/downloadFile';
|
||||||
|
import VnImg from 'components/ui/VnImg.vue';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
import VnDms from 'src/components/common/VnDms.vue';
|
import VnDms from 'src/components/common/VnDms.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnUserLink from '../ui/VnUserLink.vue';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { downloadFile } from 'src/composables/downloadFile';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -18,6 +20,7 @@ const { t } = useI18n();
|
||||||
const rows = ref();
|
const rows = ref();
|
||||||
const dmsRef = ref();
|
const dmsRef = ref();
|
||||||
const formDialog = ref({});
|
const formDialog = ref({});
|
||||||
|
const token = useSession().getTokenMultimedia();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
model: {
|
model: {
|
||||||
|
@ -89,6 +92,23 @@ const dmsFilter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
name: 'file',
|
||||||
|
align: 'left',
|
||||||
|
component: VnImg,
|
||||||
|
props: (prop) => {
|
||||||
|
return {
|
||||||
|
storage: 'dms',
|
||||||
|
collection: null,
|
||||||
|
resolution: null,
|
||||||
|
id: prop.row.file.split('.')[0],
|
||||||
|
token: token,
|
||||||
|
class: 'rounded',
|
||||||
|
ratio: 1,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
|
@ -142,13 +162,6 @@ const columns = computed(() => [
|
||||||
'model-value': Boolean(prop.value),
|
'model-value': Boolean(prop.value),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
field: 'file',
|
|
||||||
label: t('globals.file'),
|
|
||||||
name: 'file',
|
|
||||||
component: 'span',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'worker',
|
field: 'worker',
|
||||||
|
@ -395,10 +408,6 @@ defineExpose({
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.q-gutter-y-ms {
|
|
||||||
display: grid;
|
|
||||||
row-gap: 20px;
|
|
||||||
}
|
|
||||||
.labelColor {
|
.labelColor {
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,9 +67,13 @@ const mixinRules = [
|
||||||
requiredFieldRule,
|
requiredFieldRule,
|
||||||
...($attrs.rules ?? []),
|
...($attrs.rules ?? []),
|
||||||
(val) => {
|
(val) => {
|
||||||
const { min } = vnInputRef.value.$attrs;
|
const { min, max } = vnInputRef.value.$attrs;
|
||||||
if (!min) return null;
|
if (!min) return null;
|
||||||
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
||||||
|
if (!max) return null;
|
||||||
|
if (max > 0) {
|
||||||
|
if (Math.floor(val) > max) return t('inputMax', { value: max });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
@ -116,8 +120,10 @@ const mixinRules = [
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
inputMin: Must be more than {value}
|
inputMin: Must be more than {value}
|
||||||
|
inputMax: Must be less than {value}
|
||||||
es:
|
es:
|
||||||
inputMin: Debe ser mayor a {value}
|
inputMin: Debe ser mayor a {value}
|
||||||
|
inputMax: Debe ser menor a {value}
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.q-field__append {
|
.q-field__append {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { onMounted, watch, computed, ref } from 'vue';
|
import { onMounted, watch, computed, ref } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useAttrs } from 'vue';
|
||||||
|
|
||||||
const model = defineModel({ type: [String, Date] });
|
const model = defineModel({ type: [String, Date] });
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -14,29 +15,19 @@ const $props = defineProps({
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
|
const { validations } = useValidator();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||||
|
|
||||||
const dateFormat = 'DD/MM/YYYY';
|
const dateFormat = 'DD/MM/YYYY';
|
||||||
const isPopupOpen = ref();
|
const isPopupOpen = ref();
|
||||||
const hover = ref();
|
const hover = ref();
|
||||||
const mask = ref();
|
const mask = ref();
|
||||||
|
const $attrs = useAttrs();
|
||||||
|
|
||||||
onMounted(() => {
|
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||||
// fix quasar bug
|
|
||||||
mask.value = '##/##/####';
|
|
||||||
});
|
|
||||||
|
|
||||||
const styleAttrs = computed(() => {
|
|
||||||
return $props.isOutlined
|
|
||||||
? {
|
|
||||||
dense: true,
|
|
||||||
outlined: true,
|
|
||||||
rounded: true,
|
|
||||||
}
|
|
||||||
: {};
|
|
||||||
});
|
|
||||||
|
|
||||||
const formattedDate = computed({
|
const formattedDate = computed({
|
||||||
get() {
|
get() {
|
||||||
|
@ -48,15 +39,12 @@ const formattedDate = computed({
|
||||||
let newDate;
|
let newDate;
|
||||||
if (value) {
|
if (value) {
|
||||||
// parse input
|
// parse input
|
||||||
if (value.includes('/')) {
|
if (value.includes('/') && value.length >= 10) {
|
||||||
if (value.length == 6) value = value + new Date().getFullYear();
|
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
||||||
if (value.length >= 10) {
|
value = date.formatDate(
|
||||||
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
new Date(value).toISOString(),
|
||||||
value = date.formatDate(
|
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
||||||
new Date(value).toISOString(),
|
);
|
||||||
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
||||||
newDate = new Date(year, month - 1, day);
|
newDate = new Date(year, month - 1, day);
|
||||||
|
@ -79,12 +67,25 @@ const formattedDate = computed({
|
||||||
const popupDate = computed(() =>
|
const popupDate = computed(() =>
|
||||||
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value
|
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value
|
||||||
);
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
// fix quasar bug
|
||||||
|
mask.value = '##/##/####';
|
||||||
|
});
|
||||||
watch(
|
watch(
|
||||||
() => model.value,
|
() => model.value,
|
||||||
(val) => (formattedDate.value = val),
|
(val) => (formattedDate.value = val),
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const styleAttrs = computed(() => {
|
||||||
|
return $props.isOutlined
|
||||||
|
? {
|
||||||
|
dense: true,
|
||||||
|
outlined: true,
|
||||||
|
rounded: true,
|
||||||
|
}
|
||||||
|
: {};
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -96,9 +97,10 @@ watch(
|
||||||
placeholder="dd/mm/aaaa"
|
placeholder="dd/mm/aaaa"
|
||||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
:rules="mixinRules"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
@click="isPopupOpen = true"
|
@click="isPopupOpen = true"
|
||||||
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref, useAttrs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
|
const { validations } = useValidator();
|
||||||
|
const $attrs = useAttrs();
|
||||||
const model = defineModel({ type: String });
|
const model = defineModel({ type: String });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
timeOnly: {
|
timeOnly: {
|
||||||
|
@ -16,8 +18,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
const initialDate = ref(model.value ?? Date.vnNew());
|
const initialDate = ref(model.value ?? Date.vnNew());
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||||
|
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||||
const dateFormat = 'HH:mm';
|
const dateFormat = 'HH:mm';
|
||||||
const isPopupOpen = ref();
|
const isPopupOpen = ref();
|
||||||
const hover = ref();
|
const hover = ref();
|
||||||
|
@ -74,9 +76,10 @@ function dateToTime(newDate) {
|
||||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
style="min-width: 100px"
|
style="min-width: 100px"
|
||||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
:rules="mixinRules"
|
||||||
@click="isPopupOpen = false"
|
@click="isPopupOpen = false"
|
||||||
type="time"
|
type="time"
|
||||||
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -2,21 +2,37 @@
|
||||||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { ref } from 'vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const value = defineModel({ type: [String, Number, Object] });
|
const emit = defineEmits(['update:model-value', 'update:options']);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
location: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const modelValue = ref(
|
||||||
|
props.location
|
||||||
|
? `${props.location?.postcode} - ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
|
||||||
|
: null
|
||||||
|
);
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
|
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
|
||||||
}
|
}
|
||||||
|
const handleModelValue = (data) => {
|
||||||
|
emit('update:model-value', data);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
v-model="value"
|
v-model="modelValue"
|
||||||
option-value="code"
|
|
||||||
option-filter-value="search"
|
option-filter-value="search"
|
||||||
:option-label="(opt) => showLabel(opt)"
|
:option-label="
|
||||||
|
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
|
||||||
|
"
|
||||||
url="Postcodes/filter"
|
url="Postcodes/filter"
|
||||||
|
@update:model-value="handleModelValue"
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
:label="t('Location')"
|
:label="t('Location')"
|
||||||
:placeholder="t('search_by_postalcode')"
|
:placeholder="t('search_by_postalcode')"
|
||||||
|
@ -27,7 +43,14 @@ function showLabel(data) {
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewPostcode @on-data-saved="(newValue) => (value = newValue)" />
|
<CreateNewPostcode
|
||||||
|
@on-data-saved="
|
||||||
|
(newValue) => {
|
||||||
|
modelValue = newValue;
|
||||||
|
emit('update:model-value', newValue);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="{ itemProps, opt }">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="itemProps">
|
||||||
|
|
|
@ -20,6 +20,8 @@ onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<RouterView></RouterView>
|
<QPage>
|
||||||
|
<RouterView />
|
||||||
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, toRefs, computed, watch, onMounted } from 'vue';
|
import { ref, toRefs, computed, watch, onMounted, useAttrs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
const emit = defineEmits(['update:modelValue', 'update:options', 'remove']);
|
const emit = defineEmits(['update:modelValue', 'update:options', 'remove']);
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -82,10 +83,11 @@ const $props = defineProps({
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const { validations } = useValidator();
|
||||||
|
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||||
|
const $attrs = useAttrs();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => val ?? t('globals.fieldRequired');
|
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||||
|
|
||||||
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
||||||
toRefs($props);
|
toRefs($props);
|
||||||
const myOptions = ref([]);
|
const myOptions = ref([]);
|
||||||
|
@ -248,8 +250,9 @@ const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
|
||||||
ref="vnSelectRef"
|
ref="vnSelectRef"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
:rules="mixinRules"
|
||||||
virtual-scroll-slice-size="options.length"
|
virtual-scroll-slice-size="options.length"
|
||||||
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template v-if="isClearable" #append>
|
<template v-if="isClearable" #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
<script setup>
|
||||||
|
import { onBeforeMount, ref, useAttrs } from 'vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
|
||||||
|
const { schema, table, column, translation, defaultOptions } = defineProps({
|
||||||
|
schema: {
|
||||||
|
type: String,
|
||||||
|
default: 'vn',
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
column: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
translation: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
defaultOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const $attrs = useAttrs();
|
||||||
|
const options = ref([]);
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
options.value = [].concat(defaultOptions);
|
||||||
|
const { data } = await axios.get(`Applications/get-enum-values`, {
|
||||||
|
params: { schema, table, column },
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const value of data)
|
||||||
|
options.value.push({
|
||||||
|
[$attrs['option-value'] ?? 'id']: value,
|
||||||
|
[$attrs['option-label'] ?? 'name']: translation ? translation(value) : value,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSelect
|
||||||
|
v-bind="$attrs"
|
||||||
|
:options="options"
|
||||||
|
:key="options.length"
|
||||||
|
:input-debounce="0"
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -59,6 +59,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ search, sanitizer });
|
defineExpose({ search, sanitizer });
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
'update:modelValue',
|
'update:modelValue',
|
||||||
'refresh',
|
'refresh',
|
||||||
|
|
|
@ -39,6 +39,8 @@ const getUrl = (zoom = false) => {
|
||||||
const curResolution = zoom
|
const curResolution = zoom
|
||||||
? $props.zoomResolution || $props.resolution
|
? $props.zoomResolution || $props.resolution
|
||||||
: $props.resolution;
|
: $props.resolution;
|
||||||
|
if ($props.storage === 'dms')
|
||||||
|
return `/api/${$props.storage}/${$props.id}/downloadFile?access_token=${token}`;
|
||||||
return isEmployee
|
return isEmployee
|
||||||
? `/api/${$props.storage}/${$props.collection}/${curResolution}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
|
? `/api/${$props.storage}/${$props.collection}/${curResolution}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
|
||||||
: noImage;
|
: noImage;
|
||||||
|
@ -66,6 +68,7 @@ defineExpose({
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
spinner-color="primary"
|
spinner-color="primary"
|
||||||
class="img_zoom"
|
class="img_zoom"
|
||||||
|
:ratio="0"
|
||||||
/>
|
/>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -231,20 +231,20 @@ defineExpose({ fetch, addFilter, paginate });
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.spinner {
|
.spinner {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
align-content: end;
|
align-content: end;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
.info-row {
|
.info-row {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
h5 {
|
h5 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -16,7 +16,7 @@ export function usePrintService() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openReport(path, params) {
|
function openReport(path, params, isNewTab = '_self') {
|
||||||
if (typeof params === 'string') params = JSON.parse(params);
|
if (typeof params === 'string') params = JSON.parse(params);
|
||||||
params = Object.assign(
|
params = Object.assign(
|
||||||
{
|
{
|
||||||
|
@ -26,8 +26,7 @@ export function usePrintService() {
|
||||||
);
|
);
|
||||||
|
|
||||||
const query = new URLSearchParams(params).toString();
|
const query = new URLSearchParams(params).toString();
|
||||||
|
window.open(`api/${path}?${query}`, isNewTab);
|
||||||
window.open(`api/${path}?${query}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -105,6 +105,7 @@ globals:
|
||||||
weight: Weight
|
weight: Weight
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
|
addressEdit: Update address
|
||||||
summary: Summary
|
summary: Summary
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
log: Logs
|
log: Logs
|
||||||
|
@ -133,6 +134,7 @@ globals:
|
||||||
fiscalData: Fiscal data
|
fiscalData: Fiscal data
|
||||||
billingData: Billing data
|
billingData: Billing data
|
||||||
consignees: Consignees
|
consignees: Consignees
|
||||||
|
'address-create': New address
|
||||||
notes: Notes
|
notes: Notes
|
||||||
credits: Credits
|
credits: Credits
|
||||||
greuges: Greuges
|
greuges: Greuges
|
||||||
|
@ -156,6 +158,7 @@ globals:
|
||||||
dms: File management
|
dms: File management
|
||||||
entryCreate: New entry
|
entryCreate: New entry
|
||||||
latestBuys: Latest buys
|
latestBuys: Latest buys
|
||||||
|
reserves: Reserves
|
||||||
tickets: Tickets
|
tickets: Tickets
|
||||||
ticketCreate: New Tickets
|
ticketCreate: New Tickets
|
||||||
boxing: Boxing
|
boxing: Boxing
|
||||||
|
@ -284,6 +287,14 @@ globals:
|
||||||
createInvoiceIn: Create invoice in
|
createInvoiceIn: Create invoice in
|
||||||
myAccount: My account
|
myAccount: My account
|
||||||
noOne: No one
|
noOne: No one
|
||||||
|
params:
|
||||||
|
clientFk: Client id
|
||||||
|
salesPersonFk: Sales person
|
||||||
|
warehouseFk: Warehouse
|
||||||
|
provinceFk: Province
|
||||||
|
from: From
|
||||||
|
To: To
|
||||||
|
stateFk: State
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
statusInternalServerError: An internal server error has ocurred
|
statusInternalServerError: An internal server error has ocurred
|
||||||
|
@ -721,6 +732,7 @@ worker:
|
||||||
newWorker: New worker
|
newWorker: New worker
|
||||||
card:
|
card:
|
||||||
workerId: Worker ID
|
workerId: Worker ID
|
||||||
|
user: User
|
||||||
name: Name
|
name: Name
|
||||||
email: Email
|
email: Email
|
||||||
phone: Phone
|
phone: Phone
|
||||||
|
@ -807,6 +819,16 @@ worker:
|
||||||
credit: Have
|
credit: Have
|
||||||
concept: Concept
|
concept: Concept
|
||||||
wagon:
|
wagon:
|
||||||
|
pageTitles:
|
||||||
|
wagons: Wagons
|
||||||
|
wagonsList: Wagons List
|
||||||
|
wagonCreate: Create wagon
|
||||||
|
wagonEdit: Edit wagon
|
||||||
|
typesList: Types List
|
||||||
|
typeCreate: Create type
|
||||||
|
typeEdit: Edit type
|
||||||
|
wagonCounter: Trolley counter
|
||||||
|
wagonTray: Tray List
|
||||||
type:
|
type:
|
||||||
name: Name
|
name: Name
|
||||||
submit: Submit
|
submit: Submit
|
||||||
|
|
|
@ -107,6 +107,7 @@ globals:
|
||||||
weight: Peso
|
weight: Peso
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
|
addressEdit: Modificar consignatario
|
||||||
summary: Resumen
|
summary: Resumen
|
||||||
basicData: Datos básicos
|
basicData: Datos básicos
|
||||||
log: Historial
|
log: Historial
|
||||||
|
@ -136,6 +137,7 @@ globals:
|
||||||
fiscalData: Datos fiscales
|
fiscalData: Datos fiscales
|
||||||
billingData: Forma de pago
|
billingData: Forma de pago
|
||||||
consignees: Consignatarios
|
consignees: Consignatarios
|
||||||
|
'address-create': Nuevo consignatario
|
||||||
notes: Notas
|
notes: Notas
|
||||||
credits: Créditos
|
credits: Créditos
|
||||||
greuges: Greuges
|
greuges: Greuges
|
||||||
|
@ -288,6 +290,14 @@ globals:
|
||||||
createInvoiceIn: Crear factura recibida
|
createInvoiceIn: Crear factura recibida
|
||||||
myAccount: Mi cuenta
|
myAccount: Mi cuenta
|
||||||
noOne: Nadie
|
noOne: Nadie
|
||||||
|
params:
|
||||||
|
clientFk: Id cliente
|
||||||
|
salesPersonFk: Comercial
|
||||||
|
warehouseFk: Almacén
|
||||||
|
provinceFk: Provincia
|
||||||
|
from: Desde
|
||||||
|
To: Hasta
|
||||||
|
stateFk: Estado
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
|
@ -728,6 +738,7 @@ worker:
|
||||||
newWorker: Nuevo trabajador
|
newWorker: Nuevo trabajador
|
||||||
card:
|
card:
|
||||||
workerId: ID Trabajador
|
workerId: ID Trabajador
|
||||||
|
user: Usuario
|
||||||
name: Nombre
|
name: Nombre
|
||||||
email: Correo personal
|
email: Correo personal
|
||||||
phone: Teléfono
|
phone: Teléfono
|
||||||
|
@ -805,6 +816,16 @@ worker:
|
||||||
credit: Haber
|
credit: Haber
|
||||||
concept: Concepto
|
concept: Concepto
|
||||||
wagon:
|
wagon:
|
||||||
|
pageTitles:
|
||||||
|
wagons: Vagones
|
||||||
|
wagonsList: Listado vagones
|
||||||
|
wagonCreate: Crear tipo
|
||||||
|
wagonEdit: Editar tipo
|
||||||
|
typesList: Listado tipos
|
||||||
|
typeCreate: Crear tipo
|
||||||
|
typeEdit: Editar tipo
|
||||||
|
wagonCounter: Contador de carros
|
||||||
|
wagonTray: Listado bandejas
|
||||||
type:
|
type:
|
||||||
name: Nombre
|
name: Nombre
|
||||||
submit: Guardar
|
submit: Guardar
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
@ -24,7 +25,7 @@ watch(
|
||||||
<template>
|
<template>
|
||||||
<FormModel
|
<FormModel
|
||||||
ref="formModelRef"
|
ref="formModelRef"
|
||||||
:url="`VnUsers/preview`"
|
url="VnUsers/preview"
|
||||||
:url-update="`VnUsers/${route.params.id}/update-user`"
|
:url-update="`VnUsers/${route.params.id}/update-user`"
|
||||||
:filter="accountFilter"
|
:filter="accountFilter"
|
||||||
model="Accounts"
|
model="Accounts"
|
||||||
|
@ -43,6 +44,15 @@ watch(
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="code"
|
option-label="code"
|
||||||
/>
|
/>
|
||||||
|
<VnSelectEnum
|
||||||
|
schema="account"
|
||||||
|
table="user"
|
||||||
|
column="twoFactor"
|
||||||
|
v-model="data.twoFactor"
|
||||||
|
:label="t('account.card.twoFactor')"
|
||||||
|
option-value="code"
|
||||||
|
option-label="code"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -35,6 +35,7 @@ account:
|
||||||
willDeactivated: User will be deactivated
|
willDeactivated: User will be deactivated
|
||||||
activated: User activated!
|
activated: User activated!
|
||||||
deactivated: User deactivated!
|
deactivated: User deactivated!
|
||||||
|
twoFactor: Two factor
|
||||||
actions:
|
actions:
|
||||||
setPassword: Set password
|
setPassword: Set password
|
||||||
disableAccount:
|
disableAccount:
|
||||||
|
|
|
@ -32,6 +32,7 @@ account:
|
||||||
activated: ¡Usuario activado!
|
activated: ¡Usuario activado!
|
||||||
deactivated: ¡Usuario desactivado!
|
deactivated: ¡Usuario desactivado!
|
||||||
newUser: Nuevo usuario
|
newUser: Nuevo usuario
|
||||||
|
twoFactor: Doble factor
|
||||||
privileges:
|
privileges:
|
||||||
delegate: Puede delegar privilegios
|
delegate: Puede delegar privilegios
|
||||||
actions:
|
actions:
|
||||||
|
|
|
@ -3,58 +3,18 @@ import { ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const claimStates = ref([]);
|
|
||||||
const claimStatesCopy = ref([]);
|
|
||||||
const optionsList = ref([]);
|
|
||||||
|
|
||||||
const workersOptions = ref([]);
|
const workersOptions = ref([]);
|
||||||
|
|
||||||
function setClaimStates(data) {
|
|
||||||
claimStates.value = data;
|
|
||||||
claimStatesCopy.value = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getEnumValues() {
|
|
||||||
optionsList.value = [{ id: null, description: t('claim.null') }];
|
|
||||||
const { data } = await axios.get(`Applications/get-enum-values`, {
|
|
||||||
params: {
|
|
||||||
schema: 'vn',
|
|
||||||
table: 'claim',
|
|
||||||
column: 'pickup',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
for (let value of data)
|
|
||||||
optionsList.value.push({ id: value, description: t(`claim.${value}`) });
|
|
||||||
}
|
|
||||||
|
|
||||||
getEnumValues();
|
|
||||||
|
|
||||||
const statesFilter = {
|
|
||||||
options: claimStates,
|
|
||||||
filterFn: (options, value) => {
|
|
||||||
const search = value.toLowerCase();
|
|
||||||
|
|
||||||
if (value === '') return claimStatesCopy.value;
|
|
||||||
|
|
||||||
return options.value.filter((row) => {
|
|
||||||
const description = row.description.toLowerCase();
|
|
||||||
|
|
||||||
return description.indexOf(search) > -1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -70,7 +30,7 @@ const statesFilter = {
|
||||||
auto-load
|
auto-load
|
||||||
:reload="true"
|
:reload="true"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate, filter }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.client.name"
|
v-model="data.client.name"
|
||||||
|
@ -101,20 +61,14 @@ const statesFilter = {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
<QSelect
|
<VnSelect
|
||||||
v-model="data.claimStateFk"
|
v-model="data.claimStateFk"
|
||||||
:options="claimStates"
|
url="ClaimStates"
|
||||||
option-value="id"
|
|
||||||
option-label="description"
|
|
||||||
emit-value
|
|
||||||
:label="t('claim.state')"
|
:label="t('claim.state')"
|
||||||
map-options
|
option-label="description"
|
||||||
use-input
|
|
||||||
@filter="(value, update) => filter(value, update, statesFilter)"
|
|
||||||
:rules="validate('claim.claimStateFk')"
|
:rules="validate('claim.claimStateFk')"
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
>
|
/>
|
||||||
</QSelect>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
|
@ -123,16 +77,14 @@ const statesFilter = {
|
||||||
:rules="validate('claim.packages')"
|
:rules="validate('claim.packages')"
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
<QSelect
|
<VnSelectEnum
|
||||||
v-model="data.pickup"
|
v-model="data.pickup"
|
||||||
:options="optionsList"
|
|
||||||
option-value="id"
|
|
||||||
option-label="description"
|
|
||||||
emit-value
|
|
||||||
:label="t('claim.pickup')"
|
:label="t('claim.pickup')"
|
||||||
map-options
|
table="claim"
|
||||||
use-input
|
column="pickup"
|
||||||
:input-debounce="0"
|
option-label="description"
|
||||||
|
:translation="(value) => t(`claim.${value}`)"
|
||||||
|
:default-options="[{ id: null, description: t('claim.null') }]"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -16,7 +16,6 @@ const claimReasons = ref([]);
|
||||||
const claimResults = ref([]);
|
const claimResults = ref([]);
|
||||||
const claimResponsibles = ref([]);
|
const claimResponsibles = ref([]);
|
||||||
const claimRedeliveries = ref([]);
|
const claimRedeliveries = ref([]);
|
||||||
const workers = ref([]);
|
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
const saveButtonRef = ref();
|
const saveButtonRef = ref();
|
||||||
|
|
||||||
|
@ -82,7 +81,9 @@ const columns = computed(() => [
|
||||||
label: t('Worker'),
|
label: t('Worker'),
|
||||||
field: (row) => row.workerFk,
|
field: (row) => row.workerFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
options: workers.value,
|
url: 'Workers/search',
|
||||||
|
where: { active: 1 },
|
||||||
|
sortBy: 'name ASC',
|
||||||
model: 'workerFk',
|
model: 'workerFk',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
optionLabel: 'nickname',
|
optionLabel: 'nickname',
|
||||||
|
@ -129,13 +130,6 @@ const columns = computed(() => [
|
||||||
@on-fetch="(data) => (claimRedeliveries = data)"
|
@on-fetch="(data) => (claimRedeliveries = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
url="Workers/search"
|
|
||||||
:where="{ active: 1 }"
|
|
||||||
order="name ASC"
|
|
||||||
@on-fetch="(data) => (workers = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<CrudModel
|
<CrudModel
|
||||||
data-key="ClaimDevelopments"
|
data-key="ClaimDevelopments"
|
||||||
url="ClaimDevelopments"
|
url="ClaimDevelopments"
|
||||||
|
@ -165,6 +159,9 @@ const columns = computed(() => [
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
|
:url="col.url"
|
||||||
|
:where="col.where"
|
||||||
|
:sort-by="col.sortBy"
|
||||||
:options="col.options"
|
:options="col.options"
|
||||||
:option-value="col.optionValue"
|
:option-value="col.optionValue"
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
|
|
|
@ -52,6 +52,7 @@ const columns = computed(() => [
|
||||||
name: 'attendedBy',
|
name: 'attendedBy',
|
||||||
orderBy: 'workerFk',
|
orderBy: 'workerFk',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
name: 'attenderFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
|
|
@ -5,15 +5,12 @@ import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const addresses = ref([]);
|
const addresses = ref([]);
|
||||||
const client = ref(null);
|
const client = ref(null);
|
||||||
const provincesLocation = ref([]);
|
|
||||||
|
|
||||||
const addressFilter = {
|
const addressFilter = {
|
||||||
fields: [
|
fields: [
|
||||||
|
@ -41,7 +38,13 @@ const addressFilter = {
|
||||||
{
|
{
|
||||||
relation: 'province',
|
relation: 'province',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'countryFk'],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'country',
|
||||||
|
scope: { fields: ['id', 'name'] },
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -83,13 +86,6 @@ const getClientData = async (id) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const setProvince = (provinceFk) => {
|
|
||||||
const result = provincesLocation.value.filter(
|
|
||||||
(province) => province.id === provinceFk
|
|
||||||
);
|
|
||||||
return result[0]?.name || '';
|
|
||||||
};
|
|
||||||
|
|
||||||
const isDefaultAddress = (address) => {
|
const isDefaultAddress = (address) => {
|
||||||
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
||||||
};
|
};
|
||||||
|
@ -128,12 +124,6 @@ const toCustomerAddressEdit = (addressId) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
@on-fetch="(data) => (provincesLocation = data)"
|
|
||||||
auto-load
|
|
||||||
url="Provinces/location"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="full-width flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
<QCard class="card-width q-pa-lg" v-if="addresses.length">
|
<QCard class="card-width q-pa-lg" v-if="addresses.length">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
|
@ -177,7 +167,14 @@ const toCustomerAddressEdit = (addressId) => {
|
||||||
<div>{{ item.street }}</div>
|
<div>{{ item.street }}</div>
|
||||||
<div>
|
<div>
|
||||||
{{ item.postalCode }} - {{ item.city }},
|
{{ item.postalCode }} - {{ item.city }},
|
||||||
{{ setProvince(item.provinceFk) }}
|
{{ item.province.name }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ item.phone }}
|
||||||
|
<span v-if="item.mobile"
|
||||||
|
>,
|
||||||
|
{{ item.mobile }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { useRoute } from 'vue-router';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
import { toCurrency, toDate, toDateHourMin } from 'src/filters';
|
import { toCurrency, toDate, toDateHourMin } from 'src/filters';
|
||||||
import { useState } from 'composables/useState';
|
import { useState } from 'composables/useState';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import { useSession } from 'composables/useSession';
|
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
@ -22,12 +22,10 @@ import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment
|
||||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
|
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const { sendEmail } = usePrintService();
|
const { sendEmail, openReport } = usePrintService();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { hasAny } = useAcl();
|
const { hasAny } = useAcl();
|
||||||
|
const currentBalance = ref({});
|
||||||
const session = useSession();
|
|
||||||
const tokenMultimedia = session.getTokenMultimedia();
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -36,7 +34,7 @@ const user = state.getUser();
|
||||||
|
|
||||||
const clientRisk = ref([]);
|
const clientRisk = ref([]);
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const companyId = ref();
|
const companyId = ref(user.value.companyFk);
|
||||||
const companyLastId = ref(user.value.companyFk);
|
const companyLastId = ref(user.value.companyFk);
|
||||||
const balances = ref([]);
|
const balances = ref([]);
|
||||||
const vnFilterRef = ref({});
|
const vnFilterRef = ref({});
|
||||||
|
@ -76,14 +74,14 @@ const companyFilterColumn = {
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'payed',
|
name: 'payed',
|
||||||
label: t('Date'),
|
label: t('Date'),
|
||||||
format: ({ payed }) => toDate(payed),
|
format: ({ payed }) => toDate(payed),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'created',
|
name: 'created',
|
||||||
label: t('Creation date'),
|
label: t('Creation date'),
|
||||||
format: ({ created }) => toDateHourMin(created),
|
format: ({ created }) => toDateHourMin(created),
|
||||||
|
@ -91,11 +89,10 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerFk',
|
|
||||||
label: t('Employee'),
|
label: t('Employee'),
|
||||||
columnField: {
|
columnField: {
|
||||||
component: 'userLink',
|
component: 'userLink',
|
||||||
attrs: ({ row }) => ({ workerId: row.workerFk, tag: row.userName }),
|
attrs: ({ row }) => ({ workerId: row.workerFk, name: row.userName }),
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
@ -120,14 +117,14 @@ const columns = computed(() => [
|
||||||
isId: true,
|
isId: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'left',
|
||||||
name: 'credit',
|
name: 'credit',
|
||||||
label: t('Havings'),
|
label: t('Havings'),
|
||||||
format: ({ credit }) => credit && toCurrency(credit),
|
format: ({ credit }) => credit && toCurrency(credit),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'left',
|
||||||
name: 'balance',
|
name: 'balance',
|
||||||
label: t('Balance'),
|
label: t('Balance'),
|
||||||
format: ({ balance }) => toCurrency(balance),
|
format: ({ balance }) => toCurrency(balance),
|
||||||
|
@ -166,41 +163,15 @@ const columns = computed(() => [
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
companyId.value = user.value.companyFk;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getClientRisk() {
|
async function getCurrentBalance(data) {
|
||||||
const { data } = await axios.get(`clientRisks`, {
|
for (const balance of data) {
|
||||||
params: {
|
currentBalance.value[balance.companyFk] = {
|
||||||
filter: JSON.stringify({
|
code: balance.company.code,
|
||||||
include: { relation: 'company', scope: { fields: ['code'] } },
|
amount: balance.amount,
|
||||||
where: { clientFk: route.params.id, companyFk: user.value.companyFk },
|
};
|
||||||
}),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
clientRisk.value = data;
|
|
||||||
return clientRisk.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getCurrentBalance() {
|
|
||||||
const currentBalance = (await getClientRisk()).find((balance) => {
|
|
||||||
return balance.companyFk === companyId.value;
|
|
||||||
});
|
|
||||||
return currentBalance && currentBalance.amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onFetch(data) {
|
|
||||||
balances.value = [];
|
|
||||||
for (const [index, balance] of data.entries()) {
|
|
||||||
if (index === 0) {
|
|
||||||
balance.balance = await getCurrentBalance();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const previousBalance = data[index - 1];
|
|
||||||
balance.balance =
|
|
||||||
previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit);
|
|
||||||
}
|
}
|
||||||
balances.value = data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const showNewPaymentDialog = () => {
|
const showNewPaymentDialog = () => {
|
||||||
|
@ -215,19 +186,27 @@ const showNewPaymentDialog = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const showBalancePdf = ({ id }) => {
|
const showBalancePdf = ({ id }) => {
|
||||||
const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`;
|
openReport(`InvoiceOuts/${id}/download`, {}, '_blank');
|
||||||
window.open(url, '_blank');
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="clientRisks"
|
||||||
|
:filter="{
|
||||||
|
include: { relation: 'company', scope: { fields: ['code'] } },
|
||||||
|
where: { clientFk: route.params.id, companyFk: companyId },
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="getCurrentBalance"
|
||||||
|
></FetchData>
|
||||||
<VnSubToolbar class="q-mb-md">
|
<VnSubToolbar class="q-mb-md">
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<div class="column justify-center q-px-md q-py-sm">
|
<div class="column justify-center q-px-md q-py-sm">
|
||||||
<span class="text-bold">{{ t('Total by company') }}</span>
|
<span class="text-bold">{{ t('Total by company') }}</span>
|
||||||
<div class="row justify-center" v-if="clientRisk?.length">
|
<div class="row justify-center">
|
||||||
{{ clientRisk[0].company.code }}:
|
{{ currentBalance[companyId]?.code }}:
|
||||||
{{ toCurrency(clientRisk[0].amount) }}
|
{{ toCurrency(currentBalance[companyId]?.amount) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -253,7 +232,6 @@ const showBalancePdf = ({ id }) => {
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:is-editable="false"
|
:is-editable="false"
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
@on-fetch="onFetch"
|
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
|
@ -262,7 +240,7 @@ const showBalancePdf = ({ id }) => {
|
||||||
</template>
|
</template>
|
||||||
<template #column-description="{ row }">
|
<template #column-description="{ row }">
|
||||||
<div class="link" v-if="row.isInvoice">
|
<div class="link" v-if="row.isInvoice">
|
||||||
{{ row.description }}
|
{{ t('bill', { ref: row.description }) }}
|
||||||
<InvoiceOutDescriptorProxy :id="row.description" />
|
<InvoiceOutDescriptorProxy :id="row.description" />
|
||||||
</div>
|
</div>
|
||||||
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
||||||
|
|
|
@ -137,7 +137,6 @@ const title = ref();
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Clients"
|
url="Clients"
|
||||||
:where="{ id: { neq: $route.params.id } }"
|
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
:label="t('customer.basicData.previousClient')"
|
:label="t('customer.basicData.previousClient')"
|
||||||
:options="clients"
|
:options="clients"
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -14,8 +13,6 @@ import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const payMethods = ref([]);
|
|
||||||
const bankEntitiesOptions = ref([]);
|
|
||||||
const bankEntitiesRef = ref(null);
|
const bankEntitiesRef = ref(null);
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
|
@ -31,15 +28,6 @@ const getBankEntities = (data, formData) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" />
|
|
||||||
<FetchData
|
|
||||||
ref="bankEntitiesRef"
|
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
|
||||||
:filter="filter"
|
|
||||||
auto-load
|
|
||||||
url="BankEntities"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModel
|
<FormModel
|
||||||
:url-update="`Clients/${route.params.id}`"
|
:url-update="`Clients/${route.params.id}`"
|
||||||
:url="`Clients/${route.params.id}/getCard`"
|
:url="`Clients/${route.params.id}/getCard`"
|
||||||
|
@ -49,8 +37,9 @@ const getBankEntities = (data, formData) => {
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
auto-load
|
||||||
|
url="PayMethods"
|
||||||
:label="t('Billing data')"
|
:label="t('Billing data')"
|
||||||
:options="payMethods"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -69,7 +58,10 @@ const getBankEntities = (data, formData) => {
|
||||||
</VnInput>
|
</VnInput>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('Swift / BIC')"
|
:label="t('Swift / BIC')"
|
||||||
:options="bankEntitiesOptions"
|
ref="bankEntitiesRef"
|
||||||
|
:filter="filter"
|
||||||
|
auto-load
|
||||||
|
url="BankEntities"
|
||||||
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
|
||||||
:rules="validate('Worker.bankEntity')"
|
:rules="validate('Worker.bankEntity')"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
|
|
@ -44,7 +44,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
field: 'rating',
|
field: 'rating',
|
||||||
label: t('Rating'),
|
label: t('customer.summary.rating'),
|
||||||
name: 'rating',
|
name: 'rating',
|
||||||
create: true,
|
create: true,
|
||||||
columnCreate: {
|
columnCreate: {
|
||||||
|
@ -56,7 +56,7 @@ const columns = computed(() => [
|
||||||
align: 'right',
|
align: 'right',
|
||||||
field: 'recommendedCredit',
|
field: 'recommendedCredit',
|
||||||
format: ({ recommendedCredit }) => toCurrency(recommendedCredit),
|
format: ({ recommendedCredit }) => toCurrency(recommendedCredit),
|
||||||
label: t('Recommended credit'),
|
label: t('customer.summary.recommendCredit'),
|
||||||
name: 'recommendedCredit',
|
name: 'recommendedCredit',
|
||||||
create: true,
|
create: true,
|
||||||
columnCreate: {
|
columnCreate: {
|
||||||
|
@ -89,8 +89,8 @@ const columns = computed(() => [
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #column-employee="{ row }">
|
<template #column-employee="{ row }">
|
||||||
<span class="link" @click.stop>{{ row.worker.user.nickname }}</span>
|
<span class="link">{{ row.worker.user.nickname }}</span>
|
||||||
<WorkerDescriptorProxy :id="row.clientFk" />
|
<WorkerDescriptorProxy :id="row.worker.id" />
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
<!-- <QTable
|
<!-- <QTable
|
||||||
|
@ -113,7 +113,6 @@ const columns = computed(() => [
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Rating: Clasificación
|
|
||||||
Recommended credit: Crédito recomendado
|
Recommended credit: Crédito recomendado
|
||||||
Since: Desde
|
Since: Desde
|
||||||
Employee: Empleado
|
Employee: Empleado
|
||||||
|
|
|
@ -94,7 +94,7 @@ function handleLocation(data, location) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.postcode"
|
:location="data"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
|
@ -5,10 +5,10 @@ import { useRoute } from 'vue-router';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
const entityId = computed(() => route.params.id);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const rows = ref([]);
|
|
||||||
const totalAmount = ref();
|
const totalAmount = ref();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const filter = computed(() => {
|
const filter = computed(() => {
|
||||||
|
@ -28,7 +28,7 @@ const filter = computed(() => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
where: {
|
where: {
|
||||||
clientFk: route.params.id,
|
clientFk: entityId,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -84,14 +84,14 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const setRows = (data) => {
|
|
||||||
rows.value = data;
|
|
||||||
totalAmount.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0);
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
:url="`Greuges/${entityId}/sumAmount`"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="({ sumAmount }) => (totalAmount = sumAmount)"
|
||||||
|
></FetchData>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="Greuges"
|
data-key="Greuges"
|
||||||
|
@ -104,7 +104,6 @@ const setRows = (data) => {
|
||||||
:is-editable="false"
|
:is-editable="false"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
@on-fetch="(data) => setRows(data)"
|
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: `Greuges`,
|
urlCreate: `Greuges`,
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const rows = ref([]);
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
{ relation: 'mandateType', scope: { fields: ['id', 'name'] } },
|
{ relation: 'mandateType', scope: { fields: ['id', 'code'] } },
|
||||||
{ relation: 'company', scope: { fields: ['id', 'code'] } },
|
{ relation: 'company', scope: { fields: ['id', 'code'] } },
|
||||||
],
|
],
|
||||||
where: { clientFk: route.params.id },
|
where: { clientFk: route.params.id },
|
||||||
|
@ -22,114 +21,61 @@ const filter = {
|
||||||
limit: 20,
|
limit: 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
const tableColumnComponents = {
|
|
||||||
id: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
company: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
registerDate: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
endDate: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'id',
|
|
||||||
label: t('Id'),
|
|
||||||
name: 'id',
|
name: 'id',
|
||||||
|
label: t('globals.id'),
|
||||||
|
field: 'id',
|
||||||
|
isId: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: (row) => row.company.code,
|
cardVisible: true,
|
||||||
label: t('Company'),
|
format: ({ company }) => company.code,
|
||||||
|
label: t('globals.company'),
|
||||||
name: 'company',
|
name: 'company',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: (row) => row.mandateType.name,
|
cardVisible: true,
|
||||||
label: t('Type'),
|
format: ({ mandateType }) => mandateType.code,
|
||||||
|
label: t('globals.type'),
|
||||||
name: 'type',
|
name: 'type',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'created',
|
cardVisible: true,
|
||||||
label: t('Register date'),
|
label: t('Register date'),
|
||||||
name: 'registerDate',
|
name: 'created',
|
||||||
format: (value) => toDateTimeFormat(value),
|
format: ({ created }) => toDateTimeFormat(created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
field: 'finished',
|
cardVisible: true,
|
||||||
|
name: 'finished',
|
||||||
label: t('End date'),
|
label: t('End date'),
|
||||||
name: 'endDate',
|
format: ({ finished }) => dashIfEmpty(toDateTimeFormat(finished)),
|
||||||
format: (value) => (value ? toDateTimeFormat(value) : '-'),
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
:filter="filter"
|
|
||||||
@on-fetch="(data) => (rows = data)"
|
|
||||||
auto-load
|
|
||||||
url="Mandates"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<VnTable
|
||||||
|
:filter="filter"
|
||||||
|
auto-load
|
||||||
|
url="Mandates"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
:right-search="false"
|
||||||
v-if="rows?.length"
|
:row-click="false"
|
||||||
>
|
/>
|
||||||
<template #body-cell="props">
|
|
||||||
<QTd :props="props">
|
|
||||||
<QTr :props="props" class="cursor-pointer">
|
|
||||||
<component
|
|
||||||
:is="tableColumnComponents[props.col.name].component"
|
|
||||||
@click="tableColumnComponents[props.col.name].event(props)"
|
|
||||||
class="rounded-borders q-pa-sm"
|
|
||||||
v-bind="tableColumnComponents[props.col.name].props(props)"
|
|
||||||
>
|
|
||||||
{{ props.value }}
|
|
||||||
</component>
|
|
||||||
</QTr>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
|
|
||||||
<h5 class="flex justify-center color-vn-label" v-else>
|
|
||||||
{{ t('globals.noResults') }}
|
|
||||||
</h5>
|
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Id: Id
|
|
||||||
Company: Empresa
|
|
||||||
Type: Tipo
|
|
||||||
Register date: Fecha alta
|
Register date: Fecha alta
|
||||||
End date: Fecha baja
|
End date: Fecha baja
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -92,7 +92,7 @@ function setFinished(id) {
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Recoveries',
|
urlCreate: 'Recoveries',
|
||||||
title: 'New recovery',
|
title: t('New recovery'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: () => tableRef.reload(),
|
||||||
formInitialData: { clientFk: route.params.id, started: Date.vnNew() },
|
formInitialData: { clientFk: route.params.id, started: Date.vnNew() },
|
||||||
}"
|
}"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { QBtn, useQuasar } from 'quasar';
|
import { QBtn, useQuasar } from 'quasar';
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import CustomerSamplesCreate from '../components/CustomerSamplesCreate.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -42,7 +41,16 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('Worker'),
|
label: t('Worker'),
|
||||||
name: 'worker',
|
columnField: {
|
||||||
|
component: 'userLink',
|
||||||
|
attrs: ({ row }) => {
|
||||||
|
return {
|
||||||
|
defaultName: true,
|
||||||
|
workerId: row?.user?.id,
|
||||||
|
name: row?.user?.name,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -73,7 +81,9 @@ const tableRef = ref();
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
:pagination="{ rowsPerPage: 12 }"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
|
:right-search="false"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:order="['created DESC']"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:create="false"
|
:create="false"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import { toCurrency, toDateHourMinSec } from 'src/filters';
|
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||||
|
|
||||||
import CustomerCloseIconTooltip from '../components/CustomerCloseIconTooltip.vue';
|
import CustomerCloseIconTooltip from '../components/CustomerCloseIconTooltip.vue';
|
||||||
import CustomerCheckIconTooltip from '../components/CustomerCheckIconTooltip.vue';
|
import CustomerCheckIconTooltip from '../components/CustomerCheckIconTooltip.vue';
|
||||||
|
@ -74,7 +74,7 @@ const columns = computed(() => [
|
||||||
field: 'created',
|
field: 'created',
|
||||||
label: t('Date'),
|
label: t('Date'),
|
||||||
name: 'date',
|
name: 'date',
|
||||||
format: (value) => toDateHourMinSec(value),
|
format: (value) => toDateHourMin(value),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -177,7 +177,12 @@ function handleLocation(data, location) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.postalCode"
|
:location="{
|
||||||
|
postcode: data.postalCode,
|
||||||
|
city: data.city,
|
||||||
|
province: data.province,
|
||||||
|
country: data.province.country,
|
||||||
|
}"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
></VnLocation>
|
></VnLocation>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -151,6 +151,7 @@ const setShippedColor = (date) => {
|
||||||
:disable-option="{ card: true, table: true }"
|
:disable-option="{ card: true, table: true }"
|
||||||
limit="5"
|
limit="5"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
|
:disable-infinite-scroll="true"
|
||||||
>
|
>
|
||||||
<template #column-nickname="{ row }">
|
<template #column-nickname="{ row }">
|
||||||
<span class="link">
|
<span class="link">
|
||||||
|
|
|
@ -116,7 +116,7 @@ const entriesTableColumns = computed(() => [
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="print"
|
icon="visibility"
|
||||||
v-if="props.row.stickers > 0"
|
v-if="props.row.stickers > 0"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
@click="
|
@click="
|
||||||
|
@ -126,7 +126,7 @@ const entriesTableColumns = computed(() => [
|
||||||
"
|
"
|
||||||
unelevated
|
unelevated
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('printLabel') }}</QTooltip>
|
<QTooltip>{{ t('viewLabel') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,251 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import EntryStockBoughtFilter from './EntryStockBoughtFilter.vue';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import EntryStockBoughtDetail from 'src/pages/Entry/EntryStockBoughtDetail.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const quasar = useQuasar();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: 'Id',
|
||||||
|
name: 'id',
|
||||||
|
isId: true,
|
||||||
|
columnFilter: false,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'workerFk',
|
||||||
|
label: t('Buyer'),
|
||||||
|
isTitle: true,
|
||||||
|
component: 'select',
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
where: { role: 'buyer' },
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
optionLabel: 'name',
|
||||||
|
optionValue: 'id',
|
||||||
|
useLike: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Reserve'),
|
||||||
|
name: 'reserve',
|
||||||
|
columnFilter: false,
|
||||||
|
create: true,
|
||||||
|
component: 'number',
|
||||||
|
summation: true,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Bought'),
|
||||||
|
name: 'bought',
|
||||||
|
summation: true,
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Date'),
|
||||||
|
name: 'dated',
|
||||||
|
component: 'date',
|
||||||
|
visible: false,
|
||||||
|
create: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('More'),
|
||||||
|
icon: 'search',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => {
|
||||||
|
quasar.dialog({
|
||||||
|
component: EntryStockBoughtDetail,
|
||||||
|
componentProps: {
|
||||||
|
workerFk: row.workerFk,
|
||||||
|
dated: userParams.value.dated,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const fetchDataRef = ref();
|
||||||
|
const travelDialogRef = ref(false);
|
||||||
|
const tableRef = ref();
|
||||||
|
const travel = ref(null);
|
||||||
|
const userParams = ref({
|
||||||
|
dated: Date.vnNew(),
|
||||||
|
});
|
||||||
|
const filter = ref({
|
||||||
|
where: {
|
||||||
|
shipped: (userParams.value.dated
|
||||||
|
? new Date(userParams.value.dated)
|
||||||
|
: Date.vnNew()
|
||||||
|
).setHours(0, 0, 0, 0),
|
||||||
|
m3: { neq: null },
|
||||||
|
},
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'warehouseIn',
|
||||||
|
scope: {
|
||||||
|
fields: ['code'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const setUserParams = async ({ dated }) => {
|
||||||
|
const shipped = (dated ? new Date(dated) : Date.vnNew()).setHours(0, 0, 0, 0);
|
||||||
|
filter.value.where.shipped = shipped;
|
||||||
|
fetchDataRef.value?.fetch();
|
||||||
|
};
|
||||||
|
|
||||||
|
function openDialog() {
|
||||||
|
travelDialogRef.value = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnSubToolbar>
|
||||||
|
<template #st-data>
|
||||||
|
<FetchData
|
||||||
|
ref="fetchDataRef"
|
||||||
|
url="Travels"
|
||||||
|
auto-load
|
||||||
|
:filter="filter"
|
||||||
|
@on-fetch="
|
||||||
|
(data) => {
|
||||||
|
travel = data.filter((data) => data.warehouseIn.code === 'VNH');
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<VnRow class="travel">
|
||||||
|
<div v-if="travel">
|
||||||
|
<span style="color: var(--vn-label-color)">
|
||||||
|
{{ t('Booked trucks') }}:
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{{ travel[0]?.m3 }}
|
||||||
|
</span>
|
||||||
|
<QBtn
|
||||||
|
v-if="travel[0]?.m3"
|
||||||
|
style="max-width: 20%"
|
||||||
|
flat
|
||||||
|
icon="edit"
|
||||||
|
@click="openDialog()"
|
||||||
|
:title="t('Edit travel')"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</VnSubToolbar>
|
||||||
|
<QDialog v-model="travelDialogRef" :maximized="true" :class="['vn-row', 'wrap']">
|
||||||
|
<FormModelPopup
|
||||||
|
:url-update="`Travels/${travel[0].id}`"
|
||||||
|
model="travel"
|
||||||
|
:title="t('Travel m3')"
|
||||||
|
:form-initial-data="{ id: travel[0].id, m3: travel[0].m3 }"
|
||||||
|
@on-data-saved="fetchDataRef.fetch()"
|
||||||
|
>
|
||||||
|
<template #form-inputs="{ data }">
|
||||||
|
<VnInput
|
||||||
|
v-model="data.id"
|
||||||
|
:label="t('id')"
|
||||||
|
type="number"
|
||||||
|
disable
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<VnInput v-model="data.m3" :label="t('m3')" type="number" />
|
||||||
|
</template>
|
||||||
|
</FormModelPopup>
|
||||||
|
</QDialog>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<EntryStockBoughtFilter
|
||||||
|
data-key="StockBoughts"
|
||||||
|
@set-user-params="setUserParams"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
|
<QPage class="column items-center q-pa-md">
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="StockBoughts"
|
||||||
|
url="StockBoughts/getStockBought"
|
||||||
|
save-url="StockBoughts/crud"
|
||||||
|
order="reserve DESC"
|
||||||
|
:right-search="false"
|
||||||
|
:is-editable="true"
|
||||||
|
:create="{
|
||||||
|
urlCreate: 'StockBoughts',
|
||||||
|
title: t('Reserve some space'),
|
||||||
|
onDataSaved: () => tableRef.reload(),
|
||||||
|
formInitialData: {
|
||||||
|
workerFk: user.id,
|
||||||
|
dated: Date.vnNow(),
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
:columns="columns"
|
||||||
|
:user-params="userParams"
|
||||||
|
:footer="true"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #column-workerFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.worker?.user?.name }}
|
||||||
|
<WorkerDescriptorProxy :id="row?.workerFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
<style lang="css" scoped>
|
||||||
|
.travel {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
Buyer: Buyer
|
||||||
|
Reserve: Reserve
|
||||||
|
Bought: Bought
|
||||||
|
More: More
|
||||||
|
Date: Date
|
||||||
|
This buyer has already made a reservation for this date: This buyer has already made a reservation for this date
|
||||||
|
es:
|
||||||
|
Edit travel: Editar envío
|
||||||
|
Travel: Envíos
|
||||||
|
Booked trucks: Camiones reservados
|
||||||
|
Buyer: Comprador
|
||||||
|
Reserve: Reservado
|
||||||
|
Bought: Comprado
|
||||||
|
More: Más
|
||||||
|
Date: Fecha
|
||||||
|
Reserve some space: Reservar espacio
|
||||||
|
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
|
||||||
|
</i18n>
|
|
@ -0,0 +1,113 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||||
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
|
const $props = defineProps({
|
||||||
|
workerFk: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
dated: {
|
||||||
|
type: Date,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&date=${$props.dated}`;
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: 'Entry',
|
||||||
|
name: 'entryFk',
|
||||||
|
isTitle: true,
|
||||||
|
isId: true,
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'itemFk',
|
||||||
|
label: t('Item'),
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Name'),
|
||||||
|
name: 'itemName',
|
||||||
|
create: true,
|
||||||
|
columnClass: 'expand',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'volume',
|
||||||
|
label: t('Volume'),
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Packaging'),
|
||||||
|
name: 'packagingFk',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: 'Packing',
|
||||||
|
name: 'packing',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QDialog :maximized="true">
|
||||||
|
<div class="container">
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="StockBoughtsDetail"
|
||||||
|
:url="customUrl"
|
||||||
|
order="itemName DESC"
|
||||||
|
:columns="columns"
|
||||||
|
:right-search="false"
|
||||||
|
:disable-infinite-scroll="true"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
|
:limit="0"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #column-entryFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.entryFk }}
|
||||||
|
<EntryDescriptorProxy :id="row.entryFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-itemName="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.itemName }}
|
||||||
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</div>
|
||||||
|
</QDialog>
|
||||||
|
</template>
|
||||||
|
<style lang="css">
|
||||||
|
.q-dialog__inner {
|
||||||
|
max-width: 50vw;
|
||||||
|
overflow: auto;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Buyer: Comprador
|
||||||
|
Reserve: Reservado
|
||||||
|
Bought: Comprado
|
||||||
|
More: Más
|
||||||
|
Date: Fecha
|
||||||
|
</i18n>
|
|
@ -0,0 +1,63 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const emit = defineEmits(['set-user-params']);
|
||||||
|
const setUserParams = (params) => {
|
||||||
|
emit('set-user-params', params);
|
||||||
|
};
|
||||||
|
onMounted(async () => {
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnFilterPanel
|
||||||
|
:data-key="props.dataKey"
|
||||||
|
:search-button="true"
|
||||||
|
search-url="table"
|
||||||
|
@set-user-params="setUserParams"
|
||||||
|
>
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params }">
|
||||||
|
<QItem class="q-my-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
id="date"
|
||||||
|
v-model="params.dated"
|
||||||
|
:label="t('Date')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
dated: Date
|
||||||
|
workerFk: Worker
|
||||||
|
es:
|
||||||
|
Date: Fecha
|
||||||
|
params:
|
||||||
|
dated: Date
|
||||||
|
workerFk: Trabajador
|
||||||
|
</i18n>
|
|
@ -11,4 +11,4 @@ shipped: Shipped
|
||||||
fromShipped: Shipped(from)
|
fromShipped: Shipped(from)
|
||||||
toShipped: Shipped(to)
|
toShipped: Shipped(to)
|
||||||
printLabels: Print stickers
|
printLabels: Print stickers
|
||||||
printLabel: Print sticker
|
viewLabel: View sticker
|
||||||
|
|
|
@ -15,4 +15,4 @@ shipped: F. salida
|
||||||
fromShipped: F. salida(desde)
|
fromShipped: F. salida(desde)
|
||||||
toShipped: F. salida(hasta)
|
toShipped: F. salida(hasta)
|
||||||
printLabels: Imprimir etiquetas
|
printLabels: Imprimir etiquetas
|
||||||
printLabel: Imprimir etiqueta
|
viewLabel: Ver etiqueta
|
||||||
|
|
|
@ -41,8 +41,7 @@ const invoiceFormType = ref('pdf');
|
||||||
const defaultEmailAddress = ref($props.invoiceOutData.client?.email);
|
const defaultEmailAddress = ref($props.invoiceOutData.client?.email);
|
||||||
|
|
||||||
const showInvoicePdf = () => {
|
const showInvoicePdf = () => {
|
||||||
const url = `api/InvoiceOuts/${$props.invoiceOutData.id}/download?access_token=${token}`;
|
openReport(`InvoiceOuts/${$props.invoiceOutData.id}/download`, {}, '_blank');
|
||||||
window.open(url, '_blank');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showInvoiceCsv = () => {
|
const showInvoiceCsv = () => {
|
||||||
|
|
|
@ -177,7 +177,7 @@ watchEffect(selectedRows);
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
:info="t('youCanSearchByInvoiceReference')"
|
:info="t('youCanSearchByInvoiceReference')"
|
||||||
:label="t('searchInvoice')"
|
:label="t('searchInvoice')"
|
||||||
data-key="InvoiceOutList"
|
data-key="invoiceOut"
|
||||||
/>
|
/>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import ItemListFilter from '../ItemListFilter.vue';
|
||||||
search-data-key="ItemList"
|
search-data-key="ItemList"
|
||||||
:searchbar-props="{
|
:searchbar-props="{
|
||||||
url: 'Items/filter',
|
url: 'Items/filter',
|
||||||
label: 'searchbar.labelr',
|
label: 'searchbar.label',
|
||||||
info: 'searchbar.info',
|
info: 'searchbar.info',
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -11,7 +11,6 @@ import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
||||||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
|
@ -51,10 +50,8 @@ const entityId = computed(() => {
|
||||||
const regularizeStockFormDialog = ref(null);
|
const regularizeStockFormDialog = ref(null);
|
||||||
const available = ref(null);
|
const available = ref(null);
|
||||||
const visible = ref(null);
|
const visible = ref(null);
|
||||||
const salixUrl = ref();
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
salixUrl.value = await getUrl('');
|
|
||||||
await getItemConfigs();
|
await getItemConfigs();
|
||||||
await updateStock();
|
await updateStock();
|
||||||
});
|
});
|
||||||
|
@ -200,16 +197,11 @@ const openCloneDialog = async () => {
|
||||||
<template #actions="{}">
|
<template #actions="{}">
|
||||||
<QCardActions class="row justify-center">
|
<QCardActions class="row justify-center">
|
||||||
<QBtn
|
<QBtn
|
||||||
:href="
|
:to="{
|
||||||
salixUrl +
|
name: 'ItemDiary',
|
||||||
'item/' +
|
params: { id: entityId },
|
||||||
entityId +
|
query: { warehouseFk, lineFk: $props.saleFk },
|
||||||
'/diary?' +
|
}"
|
||||||
'warehouseFk=' +
|
|
||||||
warehouseFk +
|
|
||||||
'&lineFk=' +
|
|
||||||
$props.saleFk
|
|
||||||
"
|
|
||||||
size="md"
|
size="md"
|
||||||
icon="vn:transaction"
|
icon="vn:transaction"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -76,16 +76,8 @@ const columns = computed(() => [
|
||||||
name: 'rate2',
|
name: 'rate2',
|
||||||
...defaultColumnAttrs,
|
...defaultColumnAttrs,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnField: {
|
component: 'input',
|
||||||
class: 'expand',
|
type: 'number',
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
class: 'expand',
|
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('item.fixedPrice.packingPrice'),
|
label: t('item.fixedPrice.packingPrice'),
|
||||||
|
@ -93,35 +85,18 @@ const columns = computed(() => [
|
||||||
name: 'rate3',
|
name: 'rate3',
|
||||||
...defaultColumnAttrs,
|
...defaultColumnAttrs,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnField: {
|
component: 'input',
|
||||||
class: 'expand',
|
type: 'number',
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
class: 'expand',
|
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: t('item.fixedPrice.minPrice'),
|
label: t('item.fixedPrice.minPrice'),
|
||||||
field: 'minPrice',
|
field: 'minPrice',
|
||||||
columnClass: 'shrink',
|
|
||||||
name: 'minPrice',
|
name: 'minPrice',
|
||||||
...defaultColumnAttrs,
|
...defaultColumnAttrs,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnField: {
|
component: 'input',
|
||||||
class: 'expand',
|
type: 'number',
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
class: 'expand',
|
|
||||||
component: 'input',
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('item.fixedPrice.started'),
|
label: t('item.fixedPrice.started'),
|
||||||
|
@ -162,16 +137,9 @@ const columns = computed(() => [
|
||||||
name: 'warehouseFk',
|
name: 'warehouseFk',
|
||||||
...defaultColumnAttrs,
|
...defaultColumnAttrs,
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
columnFilter: {
|
component: 'select',
|
||||||
component: 'select',
|
|
||||||
},
|
options: warehousesOptions,
|
||||||
columnField: {
|
|
||||||
component: 'select',
|
|
||||||
class: 'expand',
|
|
||||||
},
|
|
||||||
attrs: {
|
|
||||||
options: warehousesOptions,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
@ -518,29 +486,35 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
</span>
|
</span>
|
||||||
<span class="subName">{{ row.subName }}</span>
|
<span class="subName">{{ row.subName }}</span>
|
||||||
<ItemDescriptorProxy :id="row.itemFk" />
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
<FetchedTags style="width: max-content; max-width: 220px" :item="row" />
|
<FetchedTags :item="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #column-rate2="props">
|
<template #column-rate2="props">
|
||||||
<VnInput
|
<QTd class="col">
|
||||||
mask="###.##"
|
<VnInput
|
||||||
v-model.number="props.row.rate2"
|
type="currency"
|
||||||
v-on="getRowUpdateInputEvents(props)"
|
style="width: 75px"
|
||||||
>
|
v-model.number="props.row.rate2"
|
||||||
<template #append>€</template>
|
v-on="getRowUpdateInputEvents(props)"
|
||||||
</VnInput>
|
>
|
||||||
|
<template #append>€</template>
|
||||||
|
</VnInput>
|
||||||
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #column-rate3="props">
|
<template #column-rate3="props">
|
||||||
<VnInput
|
<QTd class="col">
|
||||||
mask="###.##"
|
<VnInput
|
||||||
v-model.number="props.row.rate3"
|
style="width: 75px"
|
||||||
v-on="getRowUpdateInputEvents(props)"
|
type="currency"
|
||||||
>
|
v-model.number="props.row.rate3"
|
||||||
<template #append>€</template>
|
v-on="getRowUpdateInputEvents(props)"
|
||||||
</VnInput>
|
>
|
||||||
|
<template #append>€</template>
|
||||||
|
</VnInput>
|
||||||
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #column-minPrice="props">
|
<template #column-minPrice="props">
|
||||||
<QTd class="col">
|
<QTd class="col">
|
||||||
<div class="row" style="width: 115px">
|
<div class="row">
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:model-value="props.row.hasMinPrice"
|
:model-value="props.row.hasMinPrice"
|
||||||
@update:model-value="updateMinPrice($event, props)"
|
@update:model-value="updateMinPrice($event, props)"
|
||||||
|
@ -549,6 +523,8 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
class="col"
|
class="col"
|
||||||
|
type="currency"
|
||||||
|
mask="###.##"
|
||||||
:disable="props.row.hasMinPrice === 1"
|
:disable="props.row.hasMinPrice === 1"
|
||||||
v-model.number="props.row.minPrice"
|
v-model.number="props.row.minPrice"
|
||||||
v-on="getRowUpdateInputEvents(props)"
|
v-on="getRowUpdateInputEvents(props)"
|
||||||
|
@ -577,15 +553,17 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #column-warehouseFk="props">
|
<template #column-warehouseFk="props">
|
||||||
<VnSelect
|
<QTd class="col">
|
||||||
style="max-width: 150px"
|
<VnSelect
|
||||||
:options="warehousesOptions"
|
style="max-width: 150px"
|
||||||
hide-selected
|
:options="warehousesOptions"
|
||||||
option-label="name"
|
hide-selected
|
||||||
option-value="id"
|
option-label="name"
|
||||||
v-model="props.row.warehouseFk"
|
option-value="id"
|
||||||
v-on="getRowUpdateInputEvents(props, false, 'select')"
|
v-model="props.row.warehouseFk"
|
||||||
/>
|
v-on="getRowUpdateInputEvents(props, false, 'select')"
|
||||||
|
/>
|
||||||
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #column-deleteAction="{ row, rowIndex }">
|
<template #column-deleteAction="{ row, rowIndex }">
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -40,7 +40,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:search-button="true"
|
:search-button="true"
|
||||||
:hidden-tags="['from', 'to']"
|
:hidden-tags="['from', 'to', 'search']"
|
||||||
:custom-tags="['scopeDays']"
|
:custom-tags="['scopeDays']"
|
||||||
:unremovable-params="['from', 'to', 'scopeDays']"
|
:unremovable-params="['from', 'to', 'scopeDays']"
|
||||||
>
|
>
|
||||||
|
@ -64,7 +64,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('params.clientFk')"
|
:label="t('globals.params.clientFk')"
|
||||||
v-model="params.clientFk"
|
v-model="params.clientFk"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
|
@ -105,7 +105,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
rounded
|
rounded
|
||||||
:label="t('params.salesPersonFk')"
|
:label="t('globals.params.salesPersonFk')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
url="Workers/search"
|
url="Workers/search"
|
||||||
:params="{ departmentCodes: ['VT'] }"
|
:params="{ departmentCodes: ['VT'] }"
|
||||||
|
@ -158,7 +158,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
rounded
|
rounded
|
||||||
:label="t('params.stateFk')"
|
:label="t('globals.params.stateFk')"
|
||||||
v-model="params.stateFk"
|
v-model="params.stateFk"
|
||||||
url="States"
|
url="States"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -184,7 +184,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
rounded
|
rounded
|
||||||
:label="t('params.warehouseFk')"
|
:label="t('globals.params.warehouseFk')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
:options="warehouses"
|
:options="warehouses"
|
||||||
/>
|
/>
|
||||||
|
@ -196,7 +196,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
rounded
|
rounded
|
||||||
:label="t('params.provinceFk')"
|
:label="t('globals.params.provinceFk')"
|
||||||
v-model="params.provinceFk"
|
v-model="params.provinceFk"
|
||||||
url="Provinces"
|
url="Provinces"
|
||||||
/>
|
/>
|
||||||
|
@ -235,22 +235,15 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
params:
|
params:
|
||||||
clientFk: Client id
|
|
||||||
orderFk: Order id
|
orderFk: Order id
|
||||||
scopeDays: Days onward
|
scopeDays: Days onward
|
||||||
nickname: Nickname
|
nickname: Nickname
|
||||||
salesPersonFk: Sales person
|
|
||||||
refFk: Invoice
|
refFk: Invoice
|
||||||
agencyModeFk: Agency
|
agencyModeFk: Agency
|
||||||
stateFk: State
|
|
||||||
groupedStates: Grouped State
|
groupedStates: Grouped State
|
||||||
warehouseFk: Warehouse
|
|
||||||
provinceFk: Province
|
|
||||||
myTeam: My team
|
myTeam: My team
|
||||||
problems: With problems
|
problems: With problems
|
||||||
pending: Pending
|
pending: Pending
|
||||||
from: From
|
|
||||||
to: To
|
|
||||||
alertLevel: Grouped State
|
alertLevel: Grouped State
|
||||||
FREE: Free
|
FREE: Free
|
||||||
DELIVERED: Delivered
|
DELIVERED: Delivered
|
||||||
|
@ -261,22 +254,15 @@ en:
|
||||||
|
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
clientFk: Id cliente
|
|
||||||
orderFk: Id cesta
|
orderFk: Id cesta
|
||||||
scopeDays: Días en adelante
|
scopeDays: Días en adelante
|
||||||
nickname: Nombre mostrado
|
nickname: Nombre mostrado
|
||||||
salesPersonFk: Comercial
|
|
||||||
refFk: Factura
|
refFk: Factura
|
||||||
agencyModeFk: Agencia
|
agencyModeFk: Agencia
|
||||||
stateFk: Estado
|
|
||||||
groupedStates: Estado agrupado
|
groupedStates: Estado agrupado
|
||||||
warehouseFk: Almacén
|
|
||||||
provinceFk: Provincia
|
|
||||||
myTeam: Mi equipo
|
myTeam: Mi equipo
|
||||||
problems: Con problemas
|
problems: Con problemas
|
||||||
pending: Pendiente
|
pending: Pendiente
|
||||||
from: Desde
|
|
||||||
To: Hasta
|
|
||||||
alertLevel: Estado agrupado
|
alertLevel: Estado agrupado
|
||||||
FREE: Libre
|
FREE: Libre
|
||||||
DELIVERED: Servido
|
DELIVERED: Servido
|
||||||
|
|
|
@ -3,7 +3,7 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="SalesMonitorTickets"
|
data-key="saleMonitorTickets"
|
||||||
url="SalesMonitors/salesFilter"
|
url="SalesMonitors/salesFilter"
|
||||||
:redirect="false"
|
:redirect="false"
|
||||||
:label="$t('searchBar.label')"
|
:label="$t('searchBar.label')"
|
||||||
|
|
|
@ -3,7 +3,6 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="RouteList"
|
data-key="RouteList"
|
||||||
|
|
|
@ -17,7 +17,9 @@ import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
|
|
||||||
|
const { openReport } = usePrintService();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -235,18 +237,15 @@ const cloneRoutes = () => {
|
||||||
const showRouteReport = () => {
|
const showRouteReport = () => {
|
||||||
const ids = selectedRows.value.map((row) => row?.id);
|
const ids = selectedRows.value.map((row) => row?.id);
|
||||||
const idString = ids.join(',');
|
const idString = ids.join(',');
|
||||||
let url;
|
let url = `Routes/${idString}/driver-route-pdf`;
|
||||||
|
let params = {};
|
||||||
if (selectedRows.value.length <= 1) {
|
if (selectedRows.value.length >= 1) {
|
||||||
url = `api/Routes/${idString}/driver-route-pdf?access_token=${session.getTokenMultimedia()}`;
|
params = {
|
||||||
} else {
|
|
||||||
const params = new URLSearchParams({
|
|
||||||
access_token: session.getTokenMultimedia(),
|
|
||||||
id: idString,
|
id: idString,
|
||||||
});
|
};
|
||||||
url = `api/Routes/downloadZip?${params.toString()}`;
|
url = `Routes/downloadZip`;
|
||||||
}
|
}
|
||||||
window.open(url, '_blank');
|
openReport(url, params, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
function markAsServed() {
|
function markAsServed() {
|
||||||
|
|
|
@ -26,7 +26,13 @@ const addressesFilter = {
|
||||||
{
|
{
|
||||||
relation: 'province',
|
relation: 'province',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'countryFk'],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'country',
|
||||||
|
scope: { fields: ['id', 'name'] },
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -21,6 +21,7 @@ const newAddressForm = reactive({
|
||||||
provinceFk: null,
|
provinceFk: null,
|
||||||
phone: null,
|
phone: null,
|
||||||
mobile: null,
|
mobile: null,
|
||||||
|
province: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDataSaved = () => {
|
const onDataSaved = () => {
|
||||||
|
@ -84,7 +85,16 @@ function handleLocation(data, location) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.location"
|
:location="
|
||||||
|
data.postalCode
|
||||||
|
? {
|
||||||
|
postcode: data.postalCode,
|
||||||
|
city: data.city,
|
||||||
|
province: data.province,
|
||||||
|
country: data.province.country,
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
>
|
>
|
||||||
</VnLocation>
|
</VnLocation>
|
||||||
|
|
|
@ -51,6 +51,23 @@ function handleLocation(data, location) {
|
||||||
:url="`Suppliers/${route.params.id}`"
|
:url="`Suppliers/${route.params.id}`"
|
||||||
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name', 'city', 'postCode', 'countryFk', 'provinceFk'],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'province',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'country',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
:clear-store-on-unmount="false"
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
|
@ -130,7 +147,12 @@ function handleLocation(data, location) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.postCode"
|
:location="{
|
||||||
|
postcode: data.postCode,
|
||||||
|
city: data.city,
|
||||||
|
province: data.province,
|
||||||
|
country: data.country,
|
||||||
|
}"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
>
|
>
|
||||||
</VnLocation>
|
</VnLocation>
|
||||||
|
|
|
@ -153,7 +153,7 @@ onMounted(async () => {
|
||||||
:label="t('params.state')"
|
:label="t('params.state')"
|
||||||
v-model="params.state"
|
v-model="params.state"
|
||||||
:options="stateOptions"
|
:options="stateOptions"
|
||||||
option-value="code"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
|
@ -169,7 +169,7 @@ onMounted(async () => {
|
||||||
:label="t('params.futureState')"
|
:label="t('params.futureState')"
|
||||||
v-model="params.futureState"
|
v-model="params.futureState"
|
||||||
:options="stateOptions"
|
:options="stateOptions"
|
||||||
option-value="code"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -70,6 +70,9 @@ const agenciesOptions = ref([]);
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.m3" label="m3" />
|
||||||
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('travel.basicData.delivered')"
|
:label="t('travel.basicData.delivered')"
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import FormPopup from 'src/components/FormPopup.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
entityId: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const entityId = ref($props.entityId);
|
||||||
|
const selectedTrayColor = ref();
|
||||||
|
const trayHeight = ref();
|
||||||
|
const wagonColors = ref([]);
|
||||||
|
const wagonColorTranslated = ref();
|
||||||
|
const heights = ref();
|
||||||
|
const existingTrayHeight = ref($props.height);
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
watch(wagonColors, () => {
|
||||||
|
wagonColorTranslated.value = wagonColors.value.map((color) => {
|
||||||
|
return { ...color, name: t(`colors.${color.name}`) };
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const emit = defineEmits(['onSubmit']);
|
||||||
|
|
||||||
|
async function getTrays() {
|
||||||
|
const { data } = await axios.get('WagonTypeTrays', undefined, {
|
||||||
|
filter: { wagonTypeFk: entityId.value },
|
||||||
|
});
|
||||||
|
existingTrayHeight.value = data.filter((item) => item.wagonTypeFk == entityId.value);
|
||||||
|
heights.value = existingTrayHeight.value.map((item) => item.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit() {
|
||||||
|
emit('onSubmit', {
|
||||||
|
wagonTypeFk: entityId.value,
|
||||||
|
wagonTypeColorFk: selectedTrayColor.value,
|
||||||
|
height: trayHeight.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getTrays();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="WagonTypeColors"
|
||||||
|
@on-fetch="(data) => (wagonColors = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FormPopup
|
||||||
|
ref="createTrayFormDialogRef"
|
||||||
|
@on-submit="onSubmit()"
|
||||||
|
:title="t('Add new tray')"
|
||||||
|
:entity-id="selectedEntityId"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
<VnSelect
|
||||||
|
v-model="selectedTrayColor"
|
||||||
|
:options="wagonColorTranslated"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
id="id"
|
||||||
|
:label="t('Select a tray color')"
|
||||||
|
:required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps" clickable>
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnInput v-model="trayHeight" :label="t('Height')" type="number" />
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
Select a tray: Select a tray
|
||||||
|
colors:
|
||||||
|
white: White
|
||||||
|
red: Red
|
||||||
|
green: Green
|
||||||
|
blue: Blue
|
||||||
|
es:
|
||||||
|
Select a tray color: Seleccione un color
|
||||||
|
Add new tray: Añadir nueva bandeja
|
||||||
|
Height: Altura
|
||||||
|
The minimum height between trays is 50cm: La altura mínima entre bandejas es de 50cm
|
||||||
|
The maximum height of the wagon is 200cm: La altura máxima del vagón es de 200cm
|
||||||
|
A tray with the same height already exists, try with a different height: Ya existe una bandeja con la misma altura, prueba con una diferente
|
||||||
|
colors:
|
||||||
|
white: Blanco
|
||||||
|
red: Rojo
|
||||||
|
green: Verde
|
||||||
|
blue: Azul
|
||||||
|
</i18n>
|
|
@ -1,433 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { computed, ref, onMounted, onUpdated } from 'vue';
|
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
onMounted(() => fetch());
|
|
||||||
onUpdated(() => fetch());
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const route = useRoute();
|
|
||||||
const quasar = useQuasar();
|
|
||||||
const router = useRouter();
|
|
||||||
const $props = defineProps({
|
|
||||||
id: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
|
||||||
|
|
||||||
const wagon = ref([]);
|
|
||||||
const divisible = ref(false);
|
|
||||||
const name = ref('');
|
|
||||||
const colorPickerActive = ref(false);
|
|
||||||
let originalData = { trays: [] };
|
|
||||||
let wagonConfig;
|
|
||||||
let wagonTypeColors;
|
|
||||||
let currentTrayColorPicked;
|
|
||||||
|
|
||||||
async function fetch() {
|
|
||||||
try {
|
|
||||||
await axios.get('WagonConfigs').then(async (res) => {
|
|
||||||
if (res.data) {
|
|
||||||
wagonConfig = res.data[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await axios.get(`WagonTypeColors`).then(async (res) => {
|
|
||||||
if (res.data) {
|
|
||||||
wagonTypeColors = res.data;
|
|
||||||
if (!entityId.value)
|
|
||||||
wagon.value.push({
|
|
||||||
id: 0,
|
|
||||||
position: 0,
|
|
||||||
color: { ...wagonTypeColors[0] },
|
|
||||||
action: 'add',
|
|
||||||
});
|
|
||||||
else {
|
|
||||||
await axios
|
|
||||||
.get(`WagonTypeTrays`, {
|
|
||||||
params: { filter: { where: { typeFk: entityId.value } } },
|
|
||||||
})
|
|
||||||
.then(async (res) => {
|
|
||||||
if (res.data) {
|
|
||||||
for (let i = 0; i < res.data.length; i++) {
|
|
||||||
const tray = res.data[i];
|
|
||||||
wagon.value.push({
|
|
||||||
id: res.data.length - i - 1,
|
|
||||||
position: tray.height,
|
|
||||||
color: {
|
|
||||||
...wagonTypeColors.find((color) => {
|
|
||||||
return color.id === tray.colorFk;
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
action: tray.height == 0 ? 'add' : 'delete',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
wagon.value.forEach((value) => {
|
|
||||||
originalData.trays.push({ ...value });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (entityId.value) {
|
|
||||||
await axios.get(`WagonTypes/${entityId.value}`).then((res) => {
|
|
||||||
if (res.data) {
|
|
||||||
originalData.name = name.value = res.data.name;
|
|
||||||
originalData.divisible = divisible.value = res.data.divisible;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addTray() {
|
|
||||||
if (
|
|
||||||
wagon.value.find((tray) => {
|
|
||||||
return tray.position == null;
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
quasar.notify({
|
|
||||||
message: t('wagon.warnings.uncompleteTrays'),
|
|
||||||
type: 'warning',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wagon.value.length < wagonConfig.maxTrays) {
|
|
||||||
wagon.value.unshift({
|
|
||||||
id: wagon.value.length,
|
|
||||||
position: null,
|
|
||||||
color: { ...wagonTypeColors[0] },
|
|
||||||
action: 'delete',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
quasar.notify({
|
|
||||||
message: t('wagon.warnings.maxTrays'),
|
|
||||||
type: 'warning',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteTray(trayToDelete) {
|
|
||||||
wagon.value = wagon.value.filter((tray) => tray.id !== trayToDelete.id);
|
|
||||||
reorderIds();
|
|
||||||
}
|
|
||||||
|
|
||||||
function reorderIds() {
|
|
||||||
for (let index = wagon.value.length - 1; index >= 0; index--) {
|
|
||||||
wagon.value[index].id = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onSubmit() {
|
|
||||||
try {
|
|
||||||
const path = entityId.value
|
|
||||||
? 'WagonTypes/editWagonType'
|
|
||||||
: 'WagonTypes/createWagonType';
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
id: entityId.value,
|
|
||||||
name: name.value,
|
|
||||||
divisible: divisible.value,
|
|
||||||
trays: wagon.value,
|
|
||||||
};
|
|
||||||
|
|
||||||
await axios.patch(path, params).then((res) => {
|
|
||||||
if (res.status == 204) router.push({ path: `/wagon/type/list` });
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onReset() {
|
|
||||||
name.value = entityId.value ? originalData.name : null;
|
|
||||||
divisible.value = entityId.value ? originalData.divisible : false;
|
|
||||||
wagon.value = entityId.value
|
|
||||||
? [...originalData.trays]
|
|
||||||
: [
|
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
position: 0,
|
|
||||||
color: { ...wagonTypeColors[0] },
|
|
||||||
action: 'add',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
function doAction(tray) {
|
|
||||||
if (tray.action == 'add') {
|
|
||||||
addTray();
|
|
||||||
} else {
|
|
||||||
deleteTray(tray);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showColorPicker(tray) {
|
|
||||||
colorPickerActive.value = true;
|
|
||||||
currentTrayColorPicked = wagon.value.findIndex((val) => {
|
|
||||||
return val.id === tray.id;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateColor(newColor) {
|
|
||||||
wagon.value[currentTrayColorPicked].color = {
|
|
||||||
...wagonTypeColors.find((color) => {
|
|
||||||
return color.rgb === newColor;
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function onPositionBlur(tray) {
|
|
||||||
if (tray.position) {
|
|
||||||
if (tray.position == '' || tray.position < 0) {
|
|
||||||
tray.position = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
tray.position = parseInt(tray.position);
|
|
||||||
wagon.value.sort((a, b) => b.position - a.position);
|
|
||||||
reorderIds();
|
|
||||||
for (let index = wagon.value.length - 1; index > 0; index--) {
|
|
||||||
if (exceedMaxHeight(index - 1)) continue;
|
|
||||||
if (
|
|
||||||
wagon.value[index - 1].position - wagon.value[index].position >=
|
|
||||||
wagonConfig.minHeightBetweenTrays
|
|
||||||
) {
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
wagon.value[index - 1].position +=
|
|
||||||
wagonConfig.minHeightBetweenTrays -
|
|
||||||
(wagon.value[index - 1].position - wagon.value[index].position);
|
|
||||||
|
|
||||||
quasar.notify({
|
|
||||||
message:
|
|
||||||
t('wagon.warnings.minHeightBetweenTrays') +
|
|
||||||
wagonConfig.minHeightBetweenTrays +
|
|
||||||
' cm',
|
|
||||||
type: 'warning',
|
|
||||||
});
|
|
||||||
|
|
||||||
exceedMaxHeight(index - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function exceedMaxHeight(pos) {
|
|
||||||
if (wagon.value[pos].position > wagonConfig.maxWagonHeight) {
|
|
||||||
wagon.value.splice(pos, 1);
|
|
||||||
quasar.notify({
|
|
||||||
message:
|
|
||||||
t('wagon.warnings.maxWagonHeight') + wagonConfig.maxWagonHeight + ' cm',
|
|
||||||
type: 'warning',
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QPage class="q-pa-sm q-mx-xl">
|
|
||||||
<QForm @submit="onSubmit()" @reset="onReset()" class="q-pa-sm">
|
|
||||||
<QCard class="q-pa-md">
|
|
||||||
<VnInput
|
|
||||||
filled
|
|
||||||
v-model="name"
|
|
||||||
:label="t('wagon.type.name')"
|
|
||||||
:rules="[(val) => !!val || t('wagon.warnings.nameNotEmpty')]"
|
|
||||||
/>
|
|
||||||
<QCheckbox class="q-mb-sm" v-model="divisible" label="Divisible" />
|
|
||||||
<div class="wagon-tray q-mx-lg" v-for="tray in wagon" :key="tray.id">
|
|
||||||
<div class="position">
|
|
||||||
<QInput
|
|
||||||
autofocus
|
|
||||||
filled
|
|
||||||
type="number"
|
|
||||||
:class="{ isVisible: tray.action == 'add' }"
|
|
||||||
v-model="tray.position"
|
|
||||||
@blur="onPositionBlur(tray)"
|
|
||||||
>
|
|
||||||
<QTooltip :delay="2000">
|
|
||||||
{{
|
|
||||||
t('wagon.warnings.minHeightBetweenTrays') +
|
|
||||||
wagonConfig.minHeightBetweenTrays +
|
|
||||||
' cm'
|
|
||||||
}}
|
|
||||||
<QSpace />
|
|
||||||
{{
|
|
||||||
t('wagon.warnings.maxWagonHeight') +
|
|
||||||
wagonConfig.maxWagonHeight +
|
|
||||||
' cm'
|
|
||||||
}}
|
|
||||||
</QTooltip>
|
|
||||||
</QInput>
|
|
||||||
</div>
|
|
||||||
<div class="shelving">
|
|
||||||
<div class="shelving-half">
|
|
||||||
<div class="shelving-up"></div>
|
|
||||||
<div
|
|
||||||
class="shelving-down"
|
|
||||||
:style="{ backgroundColor: tray.color.rgb }"
|
|
||||||
@click="showColorPicker(tray)"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="shelving-divisible"
|
|
||||||
:class="{ isVisible: !divisible }"
|
|
||||||
></div>
|
|
||||||
<div class="shelving-half">
|
|
||||||
<div class="shelving-up"></div>
|
|
||||||
<div
|
|
||||||
class="shelving-down"
|
|
||||||
:style="{ backgroundColor: tray.color.rgb }"
|
|
||||||
@click="showColorPicker(tray)"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="action-button">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="primary"
|
|
||||||
:icon="tray.action"
|
|
||||||
@click="doAction(tray)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="q-mb-sm wheels">
|
|
||||||
<QIcon color="grey-6" name="trip_origin" size="xl" />
|
|
||||||
<QIcon color="grey-6" name="trip_origin" size="xl" />
|
|
||||||
</div>
|
|
||||||
<QDialog
|
|
||||||
v-model="colorPickerActive"
|
|
||||||
position="right"
|
|
||||||
:no-backdrop-dismiss="false"
|
|
||||||
>
|
|
||||||
<QCard>
|
|
||||||
<QCardSection>
|
|
||||||
<div class="text-h6">{{ t('wagon.type.trayColor') }}</div>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection class="row items-center no-wrap">
|
|
||||||
<QColor
|
|
||||||
flat
|
|
||||||
v-model="wagon[currentTrayColorPicked].color.rgb"
|
|
||||||
no-header
|
|
||||||
no-footer
|
|
||||||
default-view="palette"
|
|
||||||
:palette="
|
|
||||||
wagonTypeColors.map((color) => {
|
|
||||||
return color.rgb;
|
|
||||||
})
|
|
||||||
"
|
|
||||||
@change="updateColor($event)"
|
|
||||||
/>
|
|
||||||
<QBtn flat round icon="close" v-close-popup />
|
|
||||||
</QCardSection>
|
|
||||||
</QCard>
|
|
||||||
</QDialog>
|
|
||||||
</QCard>
|
|
||||||
<div class="q-mt-md">
|
|
||||||
<QBtn :label="t('wagon.type.submit')" type="submit" color="primary" />
|
|
||||||
<QBtn
|
|
||||||
:label="t('wagon.type.reset')"
|
|
||||||
type="reset"
|
|
||||||
color="primary"
|
|
||||||
flat
|
|
||||||
class="q-ml-sm"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</QForm>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.q-page {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-form {
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-dialog {
|
|
||||||
.q-card {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.wheels {
|
|
||||||
margin-left: 5%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wagon-tray {
|
|
||||||
display: flex;
|
|
||||||
height: 6rem;
|
|
||||||
|
|
||||||
.position {
|
|
||||||
width: 20%;
|
|
||||||
border-right: 1rem solid gray;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-right: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shelving {
|
|
||||||
display: flex;
|
|
||||||
width: 75%;
|
|
||||||
|
|
||||||
.shelving-half {
|
|
||||||
width: 50%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.shelving-up {
|
|
||||||
height: 80%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shelving-down {
|
|
||||||
height: 20%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.shelving-divisible {
|
|
||||||
width: 1%;
|
|
||||||
height: 100%;
|
|
||||||
border-left: 0.5rem dashed grey;
|
|
||||||
border-right: 0.5rem dashed grey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-button {
|
|
||||||
width: 10%;
|
|
||||||
border-left: 1rem solid gray;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding-left: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isVisible {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -0,0 +1,293 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import axios from 'axios';
|
||||||
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
|
import WagonCreateTray from './WagonCreateTray.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { notify } = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
|
const entityId = computed(() => route.params.id);
|
||||||
|
const wagonTrays = ref([]);
|
||||||
|
const createTrayFormDialogRef = ref();
|
||||||
|
const selectedEntityId = ref();
|
||||||
|
|
||||||
|
async function loadTrays() {
|
||||||
|
try {
|
||||||
|
const res = await axios.get('WagonTypeTrays');
|
||||||
|
const filteredTrays = res.data.filter(
|
||||||
|
(tray) => tray.wagonTypeFk === entityId.value
|
||||||
|
);
|
||||||
|
wagonTrays.value = filteredTrays;
|
||||||
|
return;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error loading trays:', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addTray(newTray) {
|
||||||
|
const res = await axios.post(`WagonTypeTrays`, newTray);
|
||||||
|
wagonTrays.value.push(res.data);
|
||||||
|
notify({
|
||||||
|
message: t(`Tray added successfully`),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteTray(trayToDelete) {
|
||||||
|
await axios.delete(`WagonTypeTrays/${trayToDelete.id}`);
|
||||||
|
const index = wagonTrays.value.findIndex((tray) => tray.id === trayToDelete.id);
|
||||||
|
if (index !== -1) {
|
||||||
|
wagonTrays.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
notify({
|
||||||
|
message: t('Tray deleted successfully'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
where: { wagonTypeFk: entityId.value },
|
||||||
|
include: {
|
||||||
|
relation: 'color',
|
||||||
|
scope: {
|
||||||
|
fields: ['rgb'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const formFilter = { where: { wagonTypeFk: entityId.value } };
|
||||||
|
|
||||||
|
const showCreateTrayForm = (id) => {
|
||||||
|
selectedEntityId.value = id;
|
||||||
|
createTrayFormDialogRef.value.show();
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => wagonTrays.value,
|
||||||
|
async (newVal, oldVal) => {
|
||||||
|
if (newVal.length !== oldVal.length) {
|
||||||
|
await loadTrays();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSubToolbar />
|
||||||
|
<QPage class="q-pa-sm q-mx-xl">
|
||||||
|
<FormModel
|
||||||
|
:url="`WagonTypes/ ${entityId}`"
|
||||||
|
:url-update="`WagonTypes/ ${entityId}`"
|
||||||
|
:filter="formFilter"
|
||||||
|
model="WagonType"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #form="{ data }">
|
||||||
|
<QCard class="q-pa-md">
|
||||||
|
<VnInput
|
||||||
|
filled
|
||||||
|
v-model="data.name"
|
||||||
|
:label="t('wagon.type.name')"
|
||||||
|
:rules="[(val) => !!val || t('wagon.warnings.nameNotEmpty')]"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
class="q-mb-sm"
|
||||||
|
v-model="data.divisible"
|
||||||
|
label="Divisible"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<VnPaginate
|
||||||
|
data-key="wagonTypeTray"
|
||||||
|
url="WagonTypeTrays"
|
||||||
|
order="id DESC"
|
||||||
|
:filter="filter"
|
||||||
|
auto-load
|
||||||
|
ref="vnPaginateRef"
|
||||||
|
v-bind="$attrs"
|
||||||
|
:key="wagonTrays.length"
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<div v-for="row in rows" :key="row.id">
|
||||||
|
<div class="shelving"></div>
|
||||||
|
<div class="action-button">
|
||||||
|
<div class="wagon-tray q-mx-lg">
|
||||||
|
<div class="position">
|
||||||
|
<VnInput
|
||||||
|
borderless
|
||||||
|
type="number"
|
||||||
|
disable
|
||||||
|
class="input-tray q-mb-sm"
|
||||||
|
:label="t('Height') + ': '"
|
||||||
|
v-model="row.height"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="shelving">
|
||||||
|
<div class="shelving-half">
|
||||||
|
<div class="shelving-up"></div>
|
||||||
|
<div
|
||||||
|
class="shelving-down"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: row.color.rgb,
|
||||||
|
}"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="shelving-divisible"
|
||||||
|
:class="{ isVisible: !data.divisible }"
|
||||||
|
></div>
|
||||||
|
<div class="shelving-half">
|
||||||
|
<div class="shelving-up"></div>
|
||||||
|
<div
|
||||||
|
class="shelving-down"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: row.color.rgb,
|
||||||
|
}"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="action-button">
|
||||||
|
<QBtn
|
||||||
|
v-if="row.height === 0"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
:icon="'add'"
|
||||||
|
class="btn-tray"
|
||||||
|
@click="showCreateTrayForm(entityId)"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-else
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
:icon="'delete'"
|
||||||
|
class="btn-tray"
|
||||||
|
@click="deleteTray(row)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnPaginate>
|
||||||
|
<div class="q-mb-sm wheels">
|
||||||
|
<QIcon color="grey-6" name="trip_origin" size="xl" />
|
||||||
|
<QIcon color="grey-6" name="trip_origin" size="xl" />
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
|
<QDialog ref="createTrayFormDialogRef">
|
||||||
|
<WagonCreateTray :entity-id="entityId" @on-submit="addTray($event)" />
|
||||||
|
</QDialog>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.q-page {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-form {
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-dialog {
|
||||||
|
.q-card {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wheels {
|
||||||
|
margin-left: 5%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wagon-tray {
|
||||||
|
display: flex;
|
||||||
|
height: 6rem;
|
||||||
|
|
||||||
|
.position {
|
||||||
|
width: 26%;
|
||||||
|
border-right: 1rem solid gray;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
padding-right: 2rem;
|
||||||
|
padding-left: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shelving {
|
||||||
|
display: flex;
|
||||||
|
width: 54%;
|
||||||
|
|
||||||
|
.shelving-half {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.shelving-up {
|
||||||
|
height: 80%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shelving-down {
|
||||||
|
height: 20%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shelving-divisible {
|
||||||
|
width: 1%;
|
||||||
|
height: 100%;
|
||||||
|
border-left: 0.5rem dashed grey;
|
||||||
|
border-right: 0.5rem dashed grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button {
|
||||||
|
width: 20%;
|
||||||
|
border-left: 1rem solid gray;
|
||||||
|
align-items: baseline;
|
||||||
|
padding-left: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isVisible {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn-tray {
|
||||||
|
margin-right: 100%;
|
||||||
|
margin-top: 100%;
|
||||||
|
}
|
||||||
|
.input-tray {
|
||||||
|
margin-top: 100%;
|
||||||
|
margin-left: 40%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
tray: Tray
|
||||||
|
wagonColor: Wagon color
|
||||||
|
Select a tray: Select a tray
|
||||||
|
es:
|
||||||
|
tray: Bandeja
|
||||||
|
wagonColor: Color de la bandeja
|
||||||
|
Select a tray: Seleccione una bandeja
|
||||||
|
Create new Wagon type: Crear nuevo tipo de vagón
|
||||||
|
Add new tray: Añadir nueva bandeja
|
||||||
|
Height: Altura
|
||||||
|
Tray added successfully: Bandeja añadida correctamente
|
||||||
|
Tray deleted successfully: Bandeja eliminada correctamente
|
||||||
|
</i18n>
|
|
@ -1,80 +1,136 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import CardList from 'components/ui/CardList.vue';
|
import FormModelPopup from 'src/components/FormModelPopup.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const arrayData = useArrayData('WagonTypeList');
|
const arrayData = useArrayData('WagonTypeList');
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
const router = useRouter();
|
const dialog = ref();
|
||||||
|
const { push } = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
|
|
||||||
function navigate(id) {
|
const initialData = computed(() => {
|
||||||
router.push({ path: `/wagon/type/${id}/edit` });
|
return {
|
||||||
}
|
name: null,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
function create() {
|
const columns = computed(() => [
|
||||||
router.push({ path: `/wagon/type/create` });
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: t('ID'),
|
||||||
|
isId: true,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'name',
|
||||||
|
label: t('Name'),
|
||||||
|
isTitle: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'divisible',
|
||||||
|
label: t('Divisible'),
|
||||||
|
cardVisible: true,
|
||||||
|
component: 'checkbox',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('components.smartCard.openCard'),
|
||||||
|
icon: 'arrow_forward',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => navigate(row.id, row.name),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('wagon.list.remove'),
|
||||||
|
icon: 'delete',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => remove(row),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
function navigate(id, name) {
|
||||||
|
push({ path: `/wagon/type/${id}/edit`, query: { name } });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function remove(row) {
|
async function remove(row) {
|
||||||
try {
|
await axios.delete(`WagonTypes/${row.id}`);
|
||||||
const id = row.id;
|
quasar.notify({
|
||||||
await axios
|
message: t('wagon.type.removeItem'),
|
||||||
.delete(`WagonTypes/deleteWagonType`, { params: { id } })
|
type: 'positive',
|
||||||
.then(async () => {
|
});
|
||||||
quasar.notify({
|
store.data.splice(store.data.indexOf(row), 1);
|
||||||
message: t('wagon.type.removeItem'),
|
window.location.reload();
|
||||||
type: 'positive',
|
|
||||||
});
|
|
||||||
store.data.splice(store.data.indexOf(row), 1);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</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">
|
<VnTable
|
||||||
<VnPaginate
|
ref="tableRef"
|
||||||
data-key="WagonTypeList"
|
data-key="WagonTypeList"
|
||||||
url="/WagonTypes"
|
url="WagonTypes"
|
||||||
order="id DESC"
|
:columns="columns"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
order="id DESC"
|
||||||
<template #body="{ rows }">
|
:right-search="false"
|
||||||
<CardList
|
:column-search="false"
|
||||||
v-for="row of rows"
|
:default-mode="'card'"
|
||||||
:key="row.id"
|
:disable-option="{ table: true }"
|
||||||
:title="(row.name || '').toString()"
|
>
|
||||||
:id="row.id"
|
</VnTable>
|
||||||
@click="navigate(row.id)"
|
<QPageSticky :offset="[18, 18]">
|
||||||
|
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add" shortcut="+">
|
||||||
|
<QDialog ref="dialog">
|
||||||
|
<FormModelPopup
|
||||||
|
:title="t('Create new Wagon type')"
|
||||||
|
url-create="WagonTypes"
|
||||||
|
model="WagonType"
|
||||||
|
:form-initial-data="initialData"
|
||||||
|
@on-data-saved="window.location.reload()"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #actions>
|
<template #form-inputs="{ data }">
|
||||||
<QBtn
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
:label="t('components.smartCard.openCard')"
|
<VnInput
|
||||||
@click.stop="navigate(row.id)"
|
filled
|
||||||
outline
|
v-model="data.name"
|
||||||
/>
|
:label="t('Name')"
|
||||||
<QBtn
|
:rules="[(val) => !!val || t('nameNotEmpty')]"
|
||||||
:label="t('wagon.list.remove')"
|
/>
|
||||||
@click.stop="remove(row)"
|
</VnRow>
|
||||||
color="primary"
|
|
||||||
style="margin-top: 15px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</CardList>
|
</FormModelPopup>
|
||||||
</template>
|
</QDialog>
|
||||||
</VnPaginate>
|
</QBtn>
|
||||||
</div>
|
<QTooltip>
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
{{ t('globals.new') }}
|
||||||
<QBtn @click="create" fab icon="add" color="primary" shortcut="+" />
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
nameNotEmpty: The name cannot be empty
|
||||||
|
es:
|
||||||
|
Create new Wagon type: Crear nuevo tipo de vagón
|
||||||
|
Name: Nombre
|
||||||
|
nameNotEmpty: El nombre no puede estar vacío
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import CardList from 'components/ui/CardList.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import { computed } from 'vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const arrayData = useArrayData('WagonList');
|
const arrayData = useArrayData('WagonList');
|
||||||
|
@ -23,14 +24,56 @@ const filter = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'label',
|
||||||
|
label: t('Label'),
|
||||||
|
isTitle: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'plate',
|
||||||
|
label: t('wagon.list.plate'),
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'volume',
|
||||||
|
label: t('wagon.list.volume'),
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'name',
|
||||||
|
label: t('wagon.list.type'),
|
||||||
|
cardVisible: true,
|
||||||
|
format: (row) => row?.type?.name,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('components.smartCard.openCard'),
|
||||||
|
icon: 'arrow_forward',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => navigate(row.id),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('wagon.list.remove'),
|
||||||
|
icon: 'delete',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => remove(row),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
function navigate(id) {
|
function navigate(id) {
|
||||||
router.push({ path: `/wagon/${id}/edit` });
|
router.push({ path: `/wagon/${id}/edit` });
|
||||||
}
|
}
|
||||||
|
|
||||||
function create() {
|
|
||||||
router.push({ path: `/wagon/create` });
|
|
||||||
}
|
|
||||||
|
|
||||||
async function remove(row) {
|
async function remove(row) {
|
||||||
try {
|
try {
|
||||||
await axios.delete(`Wagons/${row.id}`).then(async () => {
|
await axios.delete(`Wagons/${row.id}`).then(async () => {
|
||||||
|
@ -39,6 +82,7 @@ async function remove(row) {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
store.data.splice(store.data.indexOf(row), 1);
|
store.data.splice(store.data.indexOf(row), 1);
|
||||||
|
window.location.reload();
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//
|
//
|
||||||
|
@ -48,53 +92,83 @@ async function remove(row) {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<div class="vn-card-list">
|
<VnTable
|
||||||
<VnPaginate
|
ref="tableRef"
|
||||||
data-key="WagonList"
|
data-key="WagonList"
|
||||||
url="/Wagons"
|
url="Wagons"
|
||||||
order="id DESC"
|
:filter="filter"
|
||||||
:filter="filter"
|
:columns="columns"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
order="id DESC"
|
||||||
<template #body="{ rows }">
|
:right-search="false"
|
||||||
<CardList
|
:column-search="false"
|
||||||
v-for="row of rows"
|
:default-mode="'card'"
|
||||||
:key="row.id"
|
:disable-option="{ table: true }"
|
||||||
:title="(row.label || '').toString()"
|
:create="{
|
||||||
:id="row.id"
|
urlCreate: 'Wagons',
|
||||||
@click="navigate(row.id)"
|
title: t('Create new wagon'),
|
||||||
>
|
onDataSaved: () => {
|
||||||
<template #list-items>
|
window.location.reload();
|
||||||
<VnLv
|
},
|
||||||
:label="t('wagon.list.plate')"
|
formInitialData: {},
|
||||||
:title-label="t('wagon.list.plate')"
|
}"
|
||||||
:value="row.plate"
|
>
|
||||||
/>
|
<template #more-create-dialog="{ data }">
|
||||||
<VnLv :label="t('wagon.list.volume')" :value="row?.volume" />
|
<VnInput
|
||||||
<VnLv
|
filled
|
||||||
:label="t('wagon.list.type')"
|
v-model="data.label"
|
||||||
:value="row?.type?.name"
|
:label="t('wagon.create.label')"
|
||||||
/>
|
type="number"
|
||||||
</template>
|
min="0"
|
||||||
<template #actions>
|
:rules="[(val) => !!val || t('wagon.warnings.labelNotEmpty')]"
|
||||||
<QBtn
|
/>
|
||||||
:label="t('components.smartCard.openCard')"
|
<VnInput
|
||||||
@click.stop="navigate(row.id)"
|
filled
|
||||||
outline
|
v-model="data.plate"
|
||||||
/>
|
:label="t('wagon.create.plate')"
|
||||||
<QBtn
|
:rules="[(val) => !!val || t('wagon.warnings.plateNotEmpty')]"
|
||||||
:label="t('wagon.list.remove')"
|
/>
|
||||||
@click.stop="remove(row)"
|
<VnInput
|
||||||
color="primary"
|
filled
|
||||||
style="margin-top: 15px"
|
v-model="data.volume"
|
||||||
/>
|
:label="t('wagon.create.volume')"
|
||||||
</template>
|
type="number"
|
||||||
</CardList>
|
min="0"
|
||||||
</template>
|
:rules="[(val) => !!val || t('wagon.warnings.volumeNotEmpty')]"
|
||||||
</VnPaginate>
|
/>
|
||||||
</div>
|
<VnSelect
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
url="WagonTypes"
|
||||||
<QBtn @click="create" fab icon="add" color="primary" shortcut="+" />
|
filled
|
||||||
</QPageSticky>
|
v-model="data.typeFk"
|
||||||
|
use-input
|
||||||
|
fill-input
|
||||||
|
hide-selected
|
||||||
|
input-debounce="0"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:label="t('wagon.create.type')"
|
||||||
|
:options="filteredWagonTypes"
|
||||||
|
:rules="[(val) => !!val || t('wagon.warnings.typeNotEmpty')]"
|
||||||
|
@filter="filterType"
|
||||||
|
>
|
||||||
|
<template v-if="data.typeFk" #append>
|
||||||
|
<QIcon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="data.typeFk = null"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #no-option>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection class="text-grey">
|
||||||
|
{{ t('wagon.warnings.noData') }}
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -151,7 +151,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('worker.card.name')" :value="entity.user?.nickname" />
|
<VnLv :label="t('worker.card.user')" :value="entity.user?.name" />
|
||||||
<VnLv :label="t('worker.card.email')" :value="entity.user?.email" copy />
|
<VnLv :label="t('worker.card.email')" :value="entity.user?.email" copy />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.list.department')"
|
:label="t('worker.list.department')"
|
||||||
|
|
|
@ -10,6 +10,6 @@ const route = useRoute();
|
||||||
delete-model="WorkerDms"
|
delete-model="WorkerDms"
|
||||||
download-model="WorkerDms"
|
download-model="WorkerDms"
|
||||||
default-dms-code="hhrrData"
|
default-dms-code="hhrrData"
|
||||||
filter="worker"
|
filter="wd.workerFk"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
||||||
|
import { axiosNoError } from 'src/boot/axios';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
||||||
|
@ -12,7 +13,6 @@ import WorkerTimeControlCalendar from 'pages/Worker/Card/WorkerTimeControlCalend
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useRole } from 'src/composables/useRole';
|
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
@ -63,13 +63,16 @@ const selectedCalendarDates = ref([]);
|
||||||
const selectedDateFormatted = ref(toDateString(defaultDate.value));
|
const selectedDateFormatted = ref(toDateString(defaultDate.value));
|
||||||
|
|
||||||
const arrayData = useArrayData('workerData');
|
const arrayData = useArrayData('workerData');
|
||||||
|
const acl = useAcl();
|
||||||
const worker = computed(() => arrayData.store?.data);
|
const worker = computed(() => arrayData.store?.data);
|
||||||
|
const canSend = computed(() =>
|
||||||
const isHr = computed(() => useRole().hasAny(['hr']));
|
acl.hasAny([{ model: 'WorkerTimeControl', props: 'sendMail', accessType: 'WRITE' }])
|
||||||
|
);
|
||||||
const canSend = computed(() => useAcl().hasAny('WorkerTimeControl', 'sendMail', 'WRITE'));
|
const canUpdate = computed(() =>
|
||||||
|
acl.hasAny([
|
||||||
|
{ model: 'WorkerTimeControl', props: 'updateMailState', accessType: 'WRITE' },
|
||||||
|
])
|
||||||
|
);
|
||||||
const isHimself = computed(() => user.value.id === Number(route.params.id));
|
const isHimself = computed(() => user.value.id === Number(route.params.id));
|
||||||
|
|
||||||
const columns = computed(() => {
|
const columns = computed(() => {
|
||||||
|
@ -257,58 +260,32 @@ const fetchHours = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchWorkerTimeControlMails = async (filter) => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get('WorkerTimeControlMails', {
|
|
||||||
params: { filter: JSON.stringify(filter) },
|
|
||||||
});
|
|
||||||
|
|
||||||
return data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching worker time control mails');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchWeekData = async () => {
|
const fetchWeekData = async () => {
|
||||||
|
const where = {
|
||||||
|
year: selectedDate.value.getFullYear(),
|
||||||
|
week: selectedWeekNumber.value,
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
const filter = {
|
const mail = (
|
||||||
where: {
|
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||||
workerFk: route.params.id,
|
params: { filter: { where } },
|
||||||
year: selectedDate.value ? selectedDate.value?.getFullYear() : null,
|
})
|
||||||
week: selectedWeekNumber.value,
|
).data[0];
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const data = await fetchWorkerTimeControlMails(filter);
|
if (!mail) state.value = null;
|
||||||
if (!data.length) {
|
else {
|
||||||
state.value = null;
|
|
||||||
} else {
|
|
||||||
const [mail] = data;
|
|
||||||
state.value = mail.state;
|
state.value = mail.state;
|
||||||
reason.value = mail.reason;
|
reason.value = mail.reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
await canBeResend();
|
canResend.value = !!(
|
||||||
|
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
|
||||||
|
).data.count;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error fetching week data');
|
console.error('Error fetching week data');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const canBeResend = async () => {
|
|
||||||
canResend.value = false;
|
|
||||||
|
|
||||||
const filter = {
|
|
||||||
where: {
|
|
||||||
year: selectedDate.value.getFullYear(),
|
|
||||||
week: selectedWeekNumber.value,
|
|
||||||
},
|
|
||||||
limit: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
const data = await fetchWorkerTimeControlMails(filter);
|
|
||||||
if (data.length) canResend.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const setHours = (data) => {
|
const setHours = (data) => {
|
||||||
for (const weekDay of weekDays.value) {
|
for (const weekDay of weekDays.value) {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -449,7 +426,7 @@ onMounted(async () => {
|
||||||
<div>
|
<div>
|
||||||
<QBtnGroup push class="q-gutter-x-sm" flat>
|
<QBtnGroup push class="q-gutter-x-sm" flat>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="isHimself && state"
|
v-if="canUpdate && state"
|
||||||
:label="t('Satisfied')"
|
:label="t('Satisfied')"
|
||||||
color="primary"
|
color="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -457,7 +434,7 @@ onMounted(async () => {
|
||||||
@click="isSatisfied()"
|
@click="isSatisfied()"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="isHimself && state"
|
v-if="canUpdate && state"
|
||||||
:label="t('Not satisfied')"
|
:label="t('Not satisfied')"
|
||||||
color="primary"
|
color="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -468,7 +445,7 @@ onMounted(async () => {
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
<QBtnGroup push class="q-gutter-x-sm q-ml-none" flat>
|
<QBtnGroup push class="q-gutter-x-sm q-ml-none" flat>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="reason && state && (isHimself || isHr)"
|
v-if="reason && state && canUpdate"
|
||||||
:label="t('Reason')"
|
:label="t('Reason')"
|
||||||
color="primary"
|
color="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
@ -194,7 +194,6 @@ async function autofillBic(worker) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
v-model="data.location"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
:disable="formData.isFreelance"
|
:disable="formData.isFreelance"
|
||||||
>
|
>
|
||||||
|
|
|
@ -264,7 +264,6 @@ async function autofillBic(worker) {
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:options="postcodesOptions"
|
:options="postcodesOptions"
|
||||||
v-model="data.location"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
:disable="data.isFreelance"
|
:disable="data.isFreelance"
|
||||||
>
|
>
|
||||||
|
|
|
@ -175,7 +175,7 @@ export default {
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
name: 'CustomerAddressEdit',
|
name: 'CustomerAddressEdit',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'address-edit',
|
title: 'addressEdit',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () =>
|
||||||
import(
|
import(
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'EntryMain' },
|
redirect: { name: 'EntryMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['EntryList', 'MyEntries', 'EntryLatestBuys'],
|
main: ['EntryList', 'MyEntries', 'EntryLatestBuys', 'EntryStockBought'],
|
||||||
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
|
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -58,6 +58,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Entry/EntryLatestBuys.vue'),
|
component: () => import('src/pages/Entry/EntryLatestBuys.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'stock-Bought',
|
||||||
|
name: 'EntryStockBought',
|
||||||
|
meta: {
|
||||||
|
title: 'reserves',
|
||||||
|
icon: 'deployed_code_history',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/EntryStockBought.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default {
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'WagonMain' },
|
redirect: { name: 'WagonMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['WagonList', 'WagonTypeList', 'WagonCounter'],
|
main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
|
||||||
card: [],
|
card: [],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -81,7 +81,7 @@ export default {
|
||||||
title: 'typeCreate',
|
title: 'typeCreate',
|
||||||
icon: 'create',
|
icon: 'create',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Wagon/Type/WagonTypeCreate.vue'),
|
component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id/edit',
|
path: ':id/edit',
|
||||||
|
@ -90,7 +90,7 @@ export default {
|
||||||
title: 'typeEdit',
|
title: 'typeEdit',
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Wagon/Type/WagonTypeCreate.vue'),
|
component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,6 +8,8 @@ describe('ClaimDevelopment', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/claim/${claimId}/development`);
|
cy.visit(`/#/claim/${claimId}/development`);
|
||||||
|
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
|
||||||
|
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
|
||||||
cy.waitForElement('tbody');
|
cy.waitForElement('tbody');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,10 +34,19 @@ describe('ClaimDevelopment', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add and remove new line', () => {
|
it('should add and remove new line', () => {
|
||||||
|
cy.wait(['@workers', '@workers']);
|
||||||
cy.addCard();
|
cy.addCard();
|
||||||
|
|
||||||
cy.get(thirdRow).should('exist');
|
cy.get(thirdRow).should('exist');
|
||||||
|
|
||||||
const rowData = [false, 'Novato', 'Roces', 'Compradores', 'employeeNick', 'Tour'];
|
const rowData = [
|
||||||
|
false,
|
||||||
|
'Novato',
|
||||||
|
'Roces',
|
||||||
|
'Compradores',
|
||||||
|
'administrativeNick',
|
||||||
|
'Tour',
|
||||||
|
];
|
||||||
cy.fillRow(thirdRow, rowData);
|
cy.fillRow(thirdRow, rowData);
|
||||||
|
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
|
|
|
@ -23,7 +23,7 @@ describe('EntryDms', () => {
|
||||||
expect(value).to.have.length(newFileTd++);
|
expect(value).to.have.length(newFileTd++);
|
||||||
const newRowSelector = `tbody > :nth-child(${newFileTd})`;
|
const newRowSelector = `tbody > :nth-child(${newFileTd})`;
|
||||||
cy.waitForElement(newRowSelector);
|
cy.waitForElement(newRowSelector);
|
||||||
cy.validateRow(newRowSelector, [u, u, u, u, 'ENTRADA ID 1']);
|
cy.validateRow(newRowSelector, [u, u, u, u, u, 'ENTRADA ID 1']);
|
||||||
|
|
||||||
//Edit new dms
|
//Edit new dms
|
||||||
const newDescription = 'entry id 1 modified';
|
const newDescription = 'entry id 1 modified';
|
||||||
|
@ -38,7 +38,7 @@ describe('EntryDms', () => {
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
|
||||||
cy.validateRow(newRowSelector, [u, u, u, u, newDescription]);
|
cy.validateRow(newRowSelector, [u, u, u, u, u, newDescription]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
describe('EntryStockBought', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('buyer');
|
||||||
|
cy.visit(`/#/entry/stock-Bought`);
|
||||||
|
});
|
||||||
|
it('Should edit the reserved space', () => {
|
||||||
|
cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001');
|
||||||
|
cy.get('tBody > tr').its('length').should('eq', 2);
|
||||||
|
cy.get('input[name="reserve"]').type('10{enter}');
|
||||||
|
cy.get('button[title="Save"]').click();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||||
|
});
|
||||||
|
it('Should add a new reserved space for buyerBoss', () => {
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.get('input[aria-label="Reserve"]').type('1');
|
||||||
|
cy.get('input[aria-label="Date"]').eq(1).clear();
|
||||||
|
cy.get('input[aria-label="Date"]').eq(1).type('01-01');
|
||||||
|
cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}');
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||||
|
cy.get('tBody > tr').its('length').should('eq', 3);
|
||||||
|
});
|
||||||
|
it('Should check detail for the buyer', () => {
|
||||||
|
cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.get('tBody > tr').eq(1).its('length').should('eq', 1);
|
||||||
|
});
|
||||||
|
it('Should check detail for the buyerBoss and had no content', () => {
|
||||||
|
cy.get(':nth-child(2) > .sticky > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.get('.q-table__bottom.row.items-center.q-table__bottom--nodata').should(
|
||||||
|
'have.text',
|
||||||
|
'warningNo data available'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Should edit travel m3 and refresh', () => {
|
||||||
|
cy.get('.vn-row > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.get('input[aria-label="m3"]').clear();
|
||||||
|
cy.get('input[aria-label="m3"]').type('60');
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard > .q-btn__content > .block').click();
|
||||||
|
cy.get('.vn-row > div > :nth-child(2)').should('have.text', '60');
|
||||||
|
});
|
||||||
|
});
|
|
@ -5,7 +5,7 @@ describe('Ticket descriptor', () => {
|
||||||
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
||||||
const summaryHeader = '.summaryHeader > div';
|
const summaryHeader = '.summaryHeader > div';
|
||||||
const weight = 25;
|
const weight = 25;
|
||||||
const weightValue = ':nth-child(10) > .value > span';
|
const weightValue = '.summaryBody.row :nth-child(1) > :nth-child(9) > .value > span';
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe('VnLocation', () => {
|
||||||
cy.get(inputLocation).click();
|
cy.get(inputLocation).click();
|
||||||
cy.get(inputLocation).clear();
|
cy.get(inputLocation).clear();
|
||||||
cy.get(inputLocation).type('al');
|
cy.get(inputLocation).type('al');
|
||||||
cy.get(locationOptions).should('have.length.at.least', 3);
|
cy.get(locationOptions).should('have.length.at.least', 4);
|
||||||
});
|
});
|
||||||
it('input filter location as "ecuador"', function () {
|
it('input filter location as "ecuador"', function () {
|
||||||
cy.get(inputLocation).click();
|
cy.get(inputLocation).click();
|
||||||
|
@ -33,11 +33,29 @@ describe('VnLocation', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
});
|
});
|
||||||
|
it('Fin by postalCode', () => {
|
||||||
|
const postCode = '46600';
|
||||||
|
const firstOption = '[role="listbox"] .q-item:nth-child(1)';
|
||||||
|
|
||||||
|
cy.get(inputLocation).click();
|
||||||
|
cy.get(inputLocation).clear();
|
||||||
|
cy.get(inputLocation).type(postCode);
|
||||||
|
cy.get(locationOptions).should('have.length.at.least', 2);
|
||||||
|
cy.get(firstOption).click();
|
||||||
|
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
|
||||||
|
cy.reload();
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
cy.get(inputLocation).should(
|
||||||
|
'have.value',
|
||||||
|
'46600 - Valencia(Province one), España'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('Create postCode', () => {
|
it('Create postCode', () => {
|
||||||
const postCode = '1234475';
|
const postCode = '1234475';
|
||||||
const province = 'Valencia';
|
const province = 'Valencia';
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||||
cy.get(dialogInputs).eq(0).clear();
|
cy.get(dialogInputs).eq(0).clear();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
|
@ -54,6 +72,7 @@ describe('VnLocation', () => {
|
||||||
it('Create city', () => {
|
it('Create city', () => {
|
||||||
const postCode = '9011';
|
const postCode = '9011';
|
||||||
const province = 'Saskatchew';
|
const province = 'Saskatchew';
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
// city create button
|
// city create button
|
||||||
cy.get(
|
cy.get(
|
||||||
|
|
|
@ -6,50 +6,12 @@ describe('WagonTypeCreate', () => {
|
||||||
cy.waitForElement('.q-page', 6000);
|
cy.waitForElement('.q-page', 6000);
|
||||||
});
|
});
|
||||||
|
|
||||||
function chooseColor(color) {
|
it('should create a new wagon type', () => {
|
||||||
cy.get('div.shelving-down').eq(1).click();
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
cy.get('div.q-color-picker__cube').eq(color).click();
|
|
||||||
cy.get('div.q-card__section').find('button').click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function addTray(position) {
|
|
||||||
cy.get('div.action-button').last().find('button').click();
|
|
||||||
cy.focused().type(position);
|
|
||||||
cy.focused().blur();
|
|
||||||
}
|
|
||||||
|
|
||||||
it('should create and delete a new wagon type', () => {
|
|
||||||
cy.get('input').first().type('Example for testing');
|
cy.get('input').first().type('Example for testing');
|
||||||
cy.get('div.q-checkbox__bg').click();
|
|
||||||
chooseColor(1);
|
|
||||||
|
|
||||||
// Insert invalid position (not minimal height)
|
|
||||||
addTray(20);
|
|
||||||
cy.get('div[role="alert"]').should('exist');
|
|
||||||
chooseColor(2);
|
|
||||||
addTray(150);
|
|
||||||
chooseColor(3);
|
|
||||||
addTray(100);
|
|
||||||
|
|
||||||
// Insert invalid position (max height reached)
|
|
||||||
addTray(210);
|
|
||||||
cy.get('div[role="alert"]').should('exist');
|
|
||||||
|
|
||||||
// Save
|
|
||||||
cy.get('button[type="submit"]').click();
|
cy.get('button[type="submit"]').click();
|
||||||
|
});
|
||||||
// Check data has been saved successfully
|
it('delete a wagon type', () => {
|
||||||
cy.get(':nth-child(1) > :nth-child(1) > .justify-between > .flex > .title')
|
|
||||||
.contains('Example for testing')
|
|
||||||
.click();
|
|
||||||
cy.get('input').first().should('have.value', 'Example for testing');
|
|
||||||
cy.get('div.wagon-tray').should('have.length', 4);
|
|
||||||
cy.get('div.position').eq(0).find('input').should('have.value', '150');
|
|
||||||
cy.get('div.position').eq(1).find('input').should('have.value', '100');
|
|
||||||
cy.get('div.position').eq(2).find('input').should('have.value', '50');
|
|
||||||
|
|
||||||
// Delete wagon type created
|
|
||||||
cy.go('back');
|
|
||||||
cy.get(
|
cy.get(
|
||||||
':nth-child(2) > :nth-child(1) > .card-list-body > .actions > .q-btn--standard'
|
':nth-child(2) > :nth-child(1) > .card-list-body > .actions > .q-btn--standard'
|
||||||
).click();
|
).click();
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
describe('WagonTypeEdit', () => {
|
||||||
|
const trayColorRow =
|
||||||
|
'.q-select > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/wagon/type/2/edit');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should edit the name and the divisible field of the wagon type', () => {
|
||||||
|
cy.get('.q-card');
|
||||||
|
cy.get('input').first().type(' changed');
|
||||||
|
cy.get('div.q-checkbox__bg').first().click();
|
||||||
|
cy.get('.q-btn--standard').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a tray', () => {
|
||||||
|
cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.get('input').last().type('150');
|
||||||
|
cy.get(trayColorRow).type('{downArrow}{downArrow}{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should delete a tray', () => {
|
||||||
|
cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').first().click();
|
||||||
|
cy.reload();
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,271 +0,0 @@
|
||||||
import { axios, createWrapper } from 'app/test/vitest/helper';
|
|
||||||
import WagonTypeCreate from 'pages/Wagon/Type/WagonTypeCreate.vue';
|
|
||||||
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
||||||
|
|
||||||
describe('WagonTypeCreate', () => {
|
|
||||||
let vmCreate, vmEdit;
|
|
||||||
const entityId = 1;
|
|
||||||
|
|
||||||
beforeAll(() => {
|
|
||||||
vmEdit = createWrapper(WagonTypeCreate, {propsData: {
|
|
||||||
id: entityId,
|
|
||||||
}}).vm;
|
|
||||||
vmCreate = createWrapper(WagonTypeCreate).vm;
|
|
||||||
vmEdit.wagonConfig = vmCreate.wagonConfig = {maxTrays: 2 ,minHeightBetweenTrays: 50, maxWagonHeight: 200 };
|
|
||||||
vmEdit.wagonTypeColors = vmCreate.wagonTypeColors = [{id: 1, color:'white', rgb:'#000000'}];
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
vi.clearAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('addTray()', () => {
|
|
||||||
it('should throw message if there are uncomplete trays', async () => {
|
|
||||||
vi.spyOn(vmEdit.quasar, 'notify');
|
|
||||||
vmEdit.wagon = [{
|
|
||||||
id: 1,
|
|
||||||
position: null,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
|
|
||||||
await vmEdit.addTray();
|
|
||||||
|
|
||||||
expect(vmEdit.quasar.notify).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create a new tray if the limit has not been reached', async () => {
|
|
||||||
vmEdit.wagon = [{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
|
|
||||||
await vmEdit.addTray();
|
|
||||||
expect(vmEdit.wagon.length).toEqual(2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw message if there are uncomplete trays', async () => {
|
|
||||||
vi.spyOn(vmEdit.quasar, 'notify');
|
|
||||||
vmEdit.wagon = [{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
},{
|
|
||||||
id: 2,
|
|
||||||
position: 50,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
|
|
||||||
await vmEdit.addTray();
|
|
||||||
|
|
||||||
expect(vmEdit.quasar.notify).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('deleteTray() reorderIds()', () => {
|
|
||||||
it('should delete a tray and reorder the ids', async () => {
|
|
||||||
const trayToDelete = {
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
const trayMaintained = {
|
|
||||||
id: 2,
|
|
||||||
position: 50,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
vmEdit.wagon = [trayToDelete,trayMaintained];
|
|
||||||
|
|
||||||
await vmEdit.deleteTray(trayToDelete);
|
|
||||||
|
|
||||||
expect(vmEdit.wagon.length).toEqual(1);
|
|
||||||
expect(vmEdit.wagon[0].id).toEqual(0);
|
|
||||||
expect(vmEdit.wagon[0].position).toEqual(50);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('onSubmit()', () => {
|
|
||||||
it('should make a patch to editWagonType if have id', async () => {
|
|
||||||
vi.spyOn(axios, 'patch').mockResolvedValue({ data: true });
|
|
||||||
const wagon = {
|
|
||||||
id: entityId,
|
|
||||||
name: "Mock name",
|
|
||||||
divisible: true,
|
|
||||||
trays: [{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
vmEdit.name = wagon.name;
|
|
||||||
vmEdit.divisible = wagon.divisible;
|
|
||||||
vmEdit.wagon = wagon.trays;
|
|
||||||
|
|
||||||
await vmEdit.onSubmit();
|
|
||||||
|
|
||||||
expect(axios.patch).toHaveBeenCalledWith(
|
|
||||||
`WagonTypes/editWagonType`, wagon
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should make a patch to createtWagonType if not have id', async () => {
|
|
||||||
vi.spyOn(axios, 'patch').mockResolvedValue({ data: true });
|
|
||||||
const wagon = {
|
|
||||||
name: "Mock name",
|
|
||||||
divisible: true,
|
|
||||||
trays: [{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
vmCreate.name = wagon.name;
|
|
||||||
vmCreate.divisible = wagon.divisible;
|
|
||||||
vmCreate.wagon = wagon.trays;
|
|
||||||
|
|
||||||
await vmCreate.onSubmit();
|
|
||||||
|
|
||||||
expect(axios.patch).toHaveBeenCalledWith(
|
|
||||||
`WagonTypes/createWagonType`, wagon
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('onReset()', () => {
|
|
||||||
it('should reset if have id', async () => {
|
|
||||||
vmEdit.name = 'Changed name';
|
|
||||||
vmEdit.divisible = false;
|
|
||||||
vmEdit.wagon = [];
|
|
||||||
vmEdit.originalData = {
|
|
||||||
name: 'Original name',
|
|
||||||
divisible: true,
|
|
||||||
trays: [{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
},{
|
|
||||||
id: 2,
|
|
||||||
position: 50,
|
|
||||||
color: vmEdit.wagonTypeColors[0]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
vmEdit.onReset();
|
|
||||||
|
|
||||||
expect(vmEdit.name).toEqual(vmEdit.originalData.name);
|
|
||||||
expect(vmEdit.divisible).toEqual(vmEdit.originalData.divisible);
|
|
||||||
expect(vmEdit.wagon).toEqual(vmEdit.originalData.trays);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should reset if not have id', async () => {
|
|
||||||
vmCreate.name = 'Changed name';
|
|
||||||
vmCreate.divisible = false;
|
|
||||||
vmCreate.wagon = [];
|
|
||||||
|
|
||||||
vmCreate.onReset();
|
|
||||||
|
|
||||||
expect(vmCreate.name).toEqual(null);
|
|
||||||
expect(vmCreate.divisible).toEqual(false);
|
|
||||||
expect(vmCreate.wagon.length).toEqual(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('onPositionBlur()', () => {
|
|
||||||
it('should set position null if position is negative', async () => {
|
|
||||||
const negativeTray = {
|
|
||||||
id: 1,
|
|
||||||
position: -1,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
|
|
||||||
vmCreate.onPositionBlur(negativeTray);
|
|
||||||
|
|
||||||
expect(negativeTray.position).toEqual(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should set position and reorder array', async () => {
|
|
||||||
const trays = [{
|
|
||||||
id: 0,
|
|
||||||
position: 100,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
},{
|
|
||||||
id: 1,
|
|
||||||
position: 0,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
const newTray = {
|
|
||||||
id: 2,
|
|
||||||
position: 50,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
trays.push(newTray);
|
|
||||||
vmCreate.wagon = trays;
|
|
||||||
|
|
||||||
vmCreate.onPositionBlur(newTray);
|
|
||||||
|
|
||||||
expect(vmCreate.wagon[0].position).toEqual(100);
|
|
||||||
expect(vmCreate.wagon[1].position).toEqual(50);
|
|
||||||
expect(vmCreate.wagon[2].position).toEqual(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw message if not have min height between trays and should set new adequate positions', async () => {
|
|
||||||
vi.spyOn(vmCreate.quasar, 'notify');
|
|
||||||
const trays = [{
|
|
||||||
id: 0,
|
|
||||||
position: 0,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
const newTray = {
|
|
||||||
id: 1,
|
|
||||||
position: 20,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
trays.push(newTray);
|
|
||||||
vmCreate.wagon = trays;
|
|
||||||
|
|
||||||
vmCreate.onPositionBlur(newTray);
|
|
||||||
|
|
||||||
expect(vmCreate.wagon[0].position).toEqual(50);
|
|
||||||
expect(vmCreate.wagon[1].position).toEqual(0);
|
|
||||||
expect(vmCreate.quasar.notify).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw message if max height has been exceed', async () => {
|
|
||||||
vi.spyOn(vmCreate.quasar, 'notify');
|
|
||||||
const trays = [{
|
|
||||||
id: 0,
|
|
||||||
position: 0,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
}];
|
|
||||||
const newTray = {
|
|
||||||
id: 1,
|
|
||||||
position: 210,
|
|
||||||
color: vmCreate.wagonTypeColors[0]
|
|
||||||
};
|
|
||||||
trays.push(newTray);
|
|
||||||
vmCreate.wagon = trays;
|
|
||||||
|
|
||||||
vmCreate.onPositionBlur(newTray);
|
|
||||||
|
|
||||||
expect(vmCreate.wagon.length).toEqual(1);
|
|
||||||
expect(vmCreate.quasar.notify).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue