forked from verdnatura/salix-front
Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7702_fix_setPassword
This commit is contained in:
commit
fc23f9a8dd
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 🆕
|
||||||
|
|
|
@ -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 };
|
||||||
|
|
|
@ -2,9 +2,15 @@ import { boot } from 'quasar/wrappers';
|
||||||
import qFormMixin from './qformMixin';
|
import qFormMixin from './qformMixin';
|
||||||
import mainShortcutMixin from './mainShortcutMixin';
|
import mainShortcutMixin from './mainShortcutMixin';
|
||||||
import keyShortcut from './keyShortcut';
|
import keyShortcut from './keyShortcut';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
export default boot(({ app }) => {
|
export default boot(({ app }) => {
|
||||||
app.mixin(qFormMixin);
|
app.mixin(qFormMixin);
|
||||||
app.mixin(mainShortcutMixin);
|
app.mixin(mainShortcutMixin);
|
||||||
app.directive('shortcut', keyShortcut);
|
app.directive('shortcut', keyShortcut);
|
||||||
|
app.config.errorHandler = function (err) {
|
||||||
|
console.error(err);
|
||||||
|
notify('globals.error', 'negative', 'error');
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -297,11 +297,12 @@ const removeTag = (index, params, search) => {
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mt-lg">
|
<QItem class="q-mt-lg">
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add_circle"
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
class="fill-icon-on-hover q-px-xs"
|
class="fill-icon-on-hover q-px-xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="sm"
|
|
||||||
@click="tagValues.push({})"
|
@click="tagValues.push({})"
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -69,10 +69,7 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
disableInfiniteScroll: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
hasSubToolbar: {
|
hasSubToolbar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -101,6 +98,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();
|
||||||
|
@ -146,7 +147,7 @@ onMounted(() => {
|
||||||
quasar.platform.is.mobile && !$props.disableOption?.card
|
quasar.platform.is.mobile && !$props.disableOption?.card
|
||||||
? CARD_MODE
|
? CARD_MODE
|
||||||
: $props.defaultMode;
|
: $props.defaultMode;
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = quasar.screen.gt.xs;
|
||||||
columnsVisibilitySkipped.value = [
|
columnsVisibilitySkipped.value = [
|
||||||
...splittedColumns.value.columns
|
...splittedColumns.value.columns
|
||||||
.filter((c) => c.visible == false)
|
.filter((c) => c.visible == false)
|
||||||
|
@ -196,7 +197,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('%', '');
|
||||||
}
|
}
|
||||||
|
@ -301,6 +302,7 @@ defineExpose({
|
||||||
redirect: redirectFn,
|
redirect: redirectFn,
|
||||||
selected,
|
selected,
|
||||||
CrudModelRef,
|
CrudModelRef,
|
||||||
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_) {
|
||||||
|
@ -368,9 +370,7 @@ function handleOnDataSaved(_) {
|
||||||
ref="CrudModelRef"
|
ref="CrudModelRef"
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:disable-infinite-scroll="
|
:disable-infinite-scroll="isTableMode"
|
||||||
$attrs['disableInfiniteScroll'] ? isTableMode : !disableInfiniteScroll
|
|
||||||
"
|
|
||||||
@save-changes="reload"
|
@save-changes="reload"
|
||||||
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
||||||
:auto-load="hasParams || $attrs['auto-load']"
|
:auto-load="hasParams || $attrs['auto-load']"
|
||||||
|
@ -390,7 +390,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 &&
|
||||||
|
@ -632,6 +632,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>
|
||||||
|
@ -699,7 +721,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,9 +731,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) {
|
||||||
|
|
|
@ -400,7 +400,14 @@ defineExpose({
|
||||||
/>
|
/>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<QBtn fab color="primary" icon="add" @click="showFormDialog()" class="fill-icon">
|
<QBtn
|
||||||
|
fab
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
|
@click="showFormDialog()"
|
||||||
|
class="fill-icon"
|
||||||
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Upload file') }}
|
{{ t('Upload file') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -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,16 +39,13 @@ 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.length >= 10) {
|
|
||||||
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
||||||
value = date.formatDate(
|
value = date.formatDate(
|
||||||
new Date(value).toISOString(),
|
new Date(value).toISOString(),
|
||||||
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
'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);
|
||||||
if (model.value) {
|
if (model.value) {
|
||||||
|
@ -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">
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -10,7 +11,9 @@ const $props = defineProps({
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
|
onMounted(
|
||||||
|
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false)
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -20,6 +23,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',
|
||||||
|
|
|
@ -268,6 +268,7 @@ input::-webkit-inner-spin-button {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-photo-btn {
|
.edit-photo-btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 12px;
|
right: 12px;
|
||||||
|
@ -280,3 +281,10 @@ input::-webkit-inner-spin-button {
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-date {
|
||||||
|
&__today {
|
||||||
|
border: 2px solid $info;
|
||||||
|
color: $info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -103,8 +103,10 @@ globals:
|
||||||
ticket: Ticket
|
ticket: Ticket
|
||||||
campaign: Campaign
|
campaign: Campaign
|
||||||
weight: Weight
|
weight: Weight
|
||||||
|
error: Ups! Something went wrong
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
|
addressEdit: Update address
|
||||||
summary: Summary
|
summary: Summary
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
log: Logs
|
log: Logs
|
||||||
|
@ -157,6 +159,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
|
||||||
|
|
|
@ -105,8 +105,10 @@ globals:
|
||||||
ticket: Ticket
|
ticket: Ticket
|
||||||
campaign: Campaña
|
campaign: Campaña
|
||||||
weight: Peso
|
weight: Peso
|
||||||
|
error: ¡Ups! Algo salió mal
|
||||||
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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -142,7 +142,13 @@ const redirectToRoleSummary = (id) =>
|
||||||
<SubRoleCreateForm @on-submit-create-subrole="createSubRole" />
|
<SubRoleCreateForm @on-submit-create-subrole="createSubRole" />
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||||
<QBtn fab icon="add" color="primary" @click="openCreateSubRoleForm()">
|
<QBtn
|
||||||
|
fab
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
|
color="primary"
|
||||||
|
@click="openCreateSubRoleForm()"
|
||||||
|
>
|
||||||
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -317,7 +317,7 @@ async function saveWhenHasChanges() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<QBtn fab color="primary" icon="add" @click="showImportDialog()" />
|
<QBtn fab color="primary" shortcut="+" icon="add" @click="showImportDialog()" />
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -246,7 +246,13 @@ function onDrag() {
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<label for="fileInput">
|
<label for="fileInput">
|
||||||
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
|
<QBtn
|
||||||
|
fab
|
||||||
|
@click="inputFile.nativeEl.click()"
|
||||||
|
shortcut="+"
|
||||||
|
icon="add"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
<QInput
|
<QInput
|
||||||
ref="inputFile"
|
ref="inputFile"
|
||||||
type="file"
|
type="file"
|
||||||
|
|
|
@ -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,7 @@ 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>
|
||||||
<div>
|
<div>
|
||||||
{{ item.phone }}
|
{{ item.phone }}
|
||||||
|
|
|
@ -56,17 +56,18 @@ const customerContactsRef = ref(null);
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QIcon
|
<QBtn
|
||||||
@click="customerContactsRef.insert()"
|
@click="customerContactsRef.insert()"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add contact') }}
|
{{ t('Add contact') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -236,6 +236,7 @@ const toCustomerFileManagementCreate = () => {
|
||||||
@click.stop="toCustomerFileManagementCreate()"
|
@click.stop="toCustomerFileManagementCreate()"
|
||||||
color="primary"
|
color="primary"
|
||||||
fab
|
fab
|
||||||
|
shortcut="+"
|
||||||
icon="add"
|
icon="add"
|
||||||
/>
|
/>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -99,7 +99,13 @@ const tableRef = ref();
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
|
||||||
<QPageSticky :offset="[18, 18]">
|
<QPageSticky :offset="[18, 18]">
|
||||||
<QBtn @click.stop="toCustomerSamplesCreate()" color="primary" fab icon="add" />
|
<QBtn
|
||||||
|
@click.stop="toCustomerSamplesCreate()"
|
||||||
|
color="primary"
|
||||||
|
fab
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
|
/>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Send sample') }}
|
{{ t('Send sample') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -267,16 +272,17 @@ function handleLocation(data, location) {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<QIcon
|
<QBtn
|
||||||
@click.stop="addNote()"
|
@click.stop="addNote()"
|
||||||
class="cursor-pointer add-icon q-mt-md"
|
class="cursor-pointer add-icon q-mt-md"
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add note') }}
|
{{ t('Add note') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -35,6 +35,7 @@ const filter = {
|
||||||
],
|
],
|
||||||
where: { clientFk: route.params.id },
|
where: { clientFk: route.params.id },
|
||||||
order: ['shipped DESC', 'id'],
|
order: ['shipped DESC', 'id'],
|
||||||
|
limit: 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -149,7 +150,6 @@ const setShippedColor = (date) => {
|
||||||
auto-load
|
auto-load
|
||||||
order="shipped DESC, id"
|
order="shipped DESC, id"
|
||||||
:disable-option="{ card: true, table: true }"
|
:disable-option="{ card: true, table: true }"
|
||||||
limit="5"
|
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:disable-infinite-scroll="true"
|
:disable-infinite-scroll="true"
|
||||||
>
|
>
|
||||||
|
|
|
@ -138,7 +138,13 @@ const columns = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<QBtn fab color="primary" icon="add" @click="entryObservationsRef.insert()" />
|
<QBtn
|
||||||
|
fab
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
|
@click="entryObservationsRef.insert()"
|
||||||
|
/>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -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>
|
|
@ -281,6 +281,7 @@ async function onSubmit() {
|
||||||
v-else
|
v-else
|
||||||
icon="add_circle"
|
icon="add_circle"
|
||||||
round
|
round
|
||||||
|
shortcut="+"
|
||||||
padding="xs"
|
padding="xs"
|
||||||
@click="setCreateDms()"
|
@click="setCreateDms()"
|
||||||
>
|
>
|
||||||
|
|
|
@ -230,7 +230,7 @@ async function insert() {
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<QBtn color="primary" icon="add" size="lg" round @click="insert" />
|
<QBtn color="primary" icon="add" shortcut="+" size="lg" round @click="insert" />
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -224,6 +224,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="add"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
size="lg"
|
size="lg"
|
||||||
round
|
round
|
||||||
@click="invoiceInFormRef.insert()"
|
@click="invoiceInFormRef.insert()"
|
||||||
|
|
|
@ -405,6 +405,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="add"
|
icon="add"
|
||||||
size="lg"
|
size="lg"
|
||||||
|
shortcut="+"
|
||||||
round
|
round
|
||||||
@click="invoiceInFormRef.insert()"
|
@click="invoiceInFormRef.insert()"
|
||||||
>
|
>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -65,17 +65,18 @@ const focusLastInput = () => {
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</div>
|
</div>
|
||||||
<QIcon
|
<QBtn
|
||||||
@click="insertRow()"
|
@click="insertRow()"
|
||||||
class="cursor-pointer fill-icon-on-hover"
|
class="cursor-pointer fill-icon-on-hover"
|
||||||
color="primary"
|
color="primary"
|
||||||
name="add_circle"
|
icon="add_circle"
|
||||||
size="sm"
|
shortcut="+"
|
||||||
|
flat
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add barcode') }}
|
{{ t('Add barcode') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -168,19 +168,20 @@ const insertTag = (rows) => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="justify-center items-center">
|
<VnRow class="justify-center items-center">
|
||||||
<QIcon
|
<QBtn
|
||||||
@click="insertTag(rows)"
|
@click="insertTag(rows)"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
:disable="!validRow"
|
:disable="!validRow"
|
||||||
color="primary"
|
color="primary"
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
style="flex: 0"
|
style="flex: 0"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('itemTags.addTag') }}
|
{{ t('itemTags.addTag') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -212,6 +212,7 @@ const decrement = (paramsObj, key) => {
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
size="12px"
|
size="12px"
|
||||||
|
shortcut="+"
|
||||||
@click="add(params, 'scopeDays')"
|
@click="add(params, 'scopeDays')"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
|
|
@ -11,7 +11,7 @@ import FetchData from 'src/components/FetchData.vue';
|
||||||
import { dateRange } from 'src/filters';
|
import { dateRange } from 'src/filters';
|
||||||
|
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
const warehouses = ref();
|
const warehouses = ref();
|
||||||
const groupedStates = ref();
|
const groupedStates = ref();
|
||||||
|
|
||||||
|
@ -26,6 +26,12 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
}
|
}
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getLocale = (label) => {
|
||||||
|
const param = label.split('.').at(-1);
|
||||||
|
const globalLocale = `globals.params.${param}`;
|
||||||
|
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" />
|
<FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" />
|
||||||
|
@ -43,10 +49,11 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
:hidden-tags="['from', 'to', 'search']"
|
:hidden-tags="['from', 'to', 'search']"
|
||||||
:custom-tags="['scopeDays']"
|
:custom-tags="['scopeDays']"
|
||||||
:unremovable-params="['from', 'to', 'scopeDays']"
|
:unremovable-params="['from', 'to', 'scopeDays']"
|
||||||
|
search-url="saleMonitorTickets"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong v-text="`${t(`params.${tag.label}`)}:`" />
|
<strong v-text="`${getLocale(tag.label)}:`" />
|
||||||
<span v-text="formatFn(tag.value)" />
|
<span v-text="formatFn(tag.value)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -110,7 +117,7 @@ const handleScopeDays = (params, days, callback) => {
|
||||||
url="Workers/search"
|
url="Workers/search"
|
||||||
:params="{ departmentCodes: ['VT'] }"
|
:params="{ departmentCodes: ['VT'] }"
|
||||||
is-outlined
|
is-outlined
|
||||||
option-value="code"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:no-one="true"
|
:no-one="true"
|
||||||
>
|
>
|
||||||
|
|
|
@ -374,8 +374,10 @@ function addOrder(value, field, params) {
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mt-lg">
|
<QItem class="q-mt-lg">
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add_circle"
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
class="filter-icon"
|
class="filter-icon"
|
||||||
@click="tagValues.push({})"
|
@click="tagValues.push({})"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -88,7 +88,7 @@ async function deleteWorCenter(id) {
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky :offset="[18, 18]">
|
<QPageSticky :offset="[18, 18]">
|
||||||
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add">
|
<QBtn @click.stop="dialog.show()" color="primary" fab shortcut="+" icon="add">
|
||||||
<QDialog ref="dialog">
|
<QDialog ref="dialog">
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
:title="t('Add work center')"
|
:title="t('Add work center')"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -103,8 +103,8 @@ es:
|
||||||
Roadmap: Troncal
|
Roadmap: Troncal
|
||||||
ETD date: Fecha ETD
|
ETD date: Fecha ETD
|
||||||
ETD hour: Hora ETD
|
ETD hour: Hora ETD
|
||||||
Tractor plate: Matrícula tractor
|
Tractor plate: Matrícula tractora
|
||||||
Trailer plate: Matrícula trailer
|
Trailer plate: Matrícula remolque
|
||||||
Carrier: Transportista
|
Carrier: Transportista
|
||||||
Price: Precio
|
Price: Precio
|
||||||
Driver name: Nombre del conductor
|
Driver name: Nombre del conductor
|
||||||
|
|
|
@ -164,8 +164,8 @@ en:
|
||||||
to: To
|
to: To
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
tractorPlate: Matrícula del tractor
|
tractorPlate: Matrícula tractora
|
||||||
trailerPlate: Matrícula del trailer
|
trailerPlate: Matrícula remolque
|
||||||
supplierFk: Transportista
|
supplierFk: Transportista
|
||||||
price: Precio
|
price: Precio
|
||||||
driverName: Nombre del conductor
|
driverName: Nombre del conductor
|
||||||
|
@ -174,8 +174,8 @@ es:
|
||||||
to: Hasta
|
to: Hasta
|
||||||
From: Desde
|
From: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
Tractor Plate: Matrícula del tractor
|
Tractor Plate: Matrícula tractora
|
||||||
Trailer Plate: Matrícula del trailer
|
Trailer Plate: Matrícula remolque
|
||||||
Carrier: Transportista
|
Carrier: Transportista
|
||||||
Price: Precio
|
Price: Precio
|
||||||
Driver name: Nombre del conductor
|
Driver name: Nombre del conductor
|
||||||
|
|
|
@ -65,9 +65,10 @@ const updateDefaultStop = (data) => {
|
||||||
</div>
|
</div>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="roadmapStopsCrudRef.insert()"
|
@click="roadmapStopsCrudRef.insert()"
|
||||||
|
@ -75,7 +76,7 @@ const updateDefaultStop = (data) => {
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add stop') }}
|
{{ t('Add stop') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -149,8 +149,8 @@ const filter = {
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Carrier: Transportista
|
Carrier: Transportista
|
||||||
Tractor Plate: Matrícula tractor
|
Tractor Plate: Matrícula tractora
|
||||||
Trailer Plate: Matrícula trailer
|
Trailer Plate: Matrícula remolque
|
||||||
Phone: Teléfono
|
Phone: Teléfono
|
||||||
Worker: Trabajador
|
Worker: Trabajador
|
||||||
Observations: Observaciones
|
Observations: Observaciones
|
||||||
|
|
|
@ -237,4 +237,5 @@ es:
|
||||||
Price: Precio
|
Price: Precio
|
||||||
Observations: Observaciones
|
Observations: Observaciones
|
||||||
Preview: Vista previa
|
Preview: Vista previa
|
||||||
|
Select the estimated date of departure (ETD): Selecciona la fecha estimada de salida
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -396,7 +396,7 @@ const openSmsDialog = async () => {
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]">
|
||||||
<QBtn fab icon="add" color="primary" @click="openTicketsDialog">
|
<QBtn fab icon="add" shortcut="+" color="primary" @click="openTicketsDialog">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add ticket') }}
|
{{ t('Add ticket') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -102,9 +102,7 @@ const setWireTransfer = async () => {
|
||||||
<VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
|
<VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="info" class="cursor-info">
|
<QIcon name="info" class="cursor-info">
|
||||||
<QTooltip>{{
|
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
||||||
t('components.iban_tooltip')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
|
@ -165,9 +163,10 @@ const setWireTransfer = async () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="supplierAccountRef.insert()"
|
@click="supplierAccountRef.insert()"
|
||||||
|
@ -175,7 +174,7 @@ const setWireTransfer = async () => {
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add account') }}
|
{{ t('Add account') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -84,9 +84,10 @@ const insertRow = () => {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add"
|
flat
|
||||||
size="sm"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="insertRow()"
|
@click="insertRow()"
|
||||||
|
@ -94,7 +95,7 @@ const insertRow = () => {
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add contact') }}
|
{{ t('Add contact') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -109,7 +109,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="supplier"
|
data-key="supplierDescriptor"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -87,17 +87,18 @@ watch(
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</div>
|
</div>
|
||||||
<VnRow v-if="observationTypes.length > rows.length">
|
<VnRow v-if="observationTypes.length > rows.length">
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add_circle"
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
class="fill-icon-on-hover q-ml-md"
|
class="fill-icon-on-hover q-ml-md"
|
||||||
size="sm"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="ticketNotesCrudRef.insert()"
|
@click="ticketNotesCrudRef.insert()"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketNotes.addNote') }}
|
{{ t('ticketNotes.addNote') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -114,17 +114,20 @@ watch(
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</div>
|
</div>
|
||||||
<QIcon
|
<VnRow>
|
||||||
name="add_circle"
|
<QBtn
|
||||||
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
class="fill-icon-on-hover q-ml-md"
|
class="fill-icon-on-hover q-ml-md"
|
||||||
size="sm"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="ticketPackagingsCrudRef.insert()"
|
@click="ticketPackagingsCrudRef.insert()"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('package.addPackage') }}
|
{{ t('package.addPackage') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
|
|
|
@ -735,6 +735,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
size="md"
|
size="md"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
|
shortcut="+"
|
||||||
:disable="!isTicketEditable"
|
:disable="!isTicketEditable"
|
||||||
@click="insertRow()"
|
@click="insertRow()"
|
||||||
>
|
>
|
||||||
|
@ -746,7 +747,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]">
|
||||||
<QBtn @click="newOrderFromTicket()" color="primary" fab icon="add" />
|
<QBtn @click="newOrderFromTicket()" color="primary" fab icon="add" shortcut="+" />
|
||||||
<QTooltip class="text-no-wrap">
|
<QTooltip class="text-no-wrap">
|
||||||
{{ t('Add item to basket') }}
|
{{ t('Add item to basket') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -184,6 +184,12 @@ const columns = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<QBtn fab color="primary" icon="add" @click="ticketServiceCrudRef.insert()" />
|
<QBtn
|
||||||
|
fab
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
@click="ticketServiceCrudRef.insert()"
|
||||||
|
shortcut="+"
|
||||||
|
/>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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')"
|
||||||
|
|
|
@ -112,6 +112,7 @@ warehouses();
|
||||||
<template #append>
|
<template #append>
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="add"
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
size="12px"
|
size="12px"
|
||||||
|
|
|
@ -11,6 +11,9 @@ import TravelSummary from './Card/TravelSummary.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
||||||
|
import { dateRange } from 'src/filters';
|
||||||
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -24,11 +27,27 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
handleScopeDays();
|
||||||
|
});
|
||||||
|
|
||||||
const cloneTravel = (travelData) => {
|
const cloneTravel = (travelData) => {
|
||||||
const stringifiedTravelData = JSON.stringify(travelData);
|
const stringifiedTravelData = JSON.stringify(travelData);
|
||||||
redirectToCreateView(stringifiedTravelData);
|
redirectToCreateView(stringifiedTravelData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function handleScopeDays(days = 7) {
|
||||||
|
days = +days;
|
||||||
|
tableRef.value.params.scopeDays = days;
|
||||||
|
const [landedFrom, landedTo] = dateRange(Date.vnNew());
|
||||||
|
landedTo.setDate(landedTo.getDate() + days);
|
||||||
|
|
||||||
|
tableRef.value.params.landedFrom = landedFrom;
|
||||||
|
tableRef.value.params.landedTo = landedTo;
|
||||||
|
}
|
||||||
|
|
||||||
const redirectToCreateView = (queryParams) => {
|
const redirectToCreateView = (queryParams) => {
|
||||||
router.push({ name: 'TravelCreate', query: { travelData: queryParams } });
|
router.push({ name: 'TravelCreate', query: { travelData: queryParams } });
|
||||||
};
|
};
|
||||||
|
@ -37,10 +56,6 @@ const redirectCreateEntryView = (travelData) => {
|
||||||
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
|
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -241,6 +256,17 @@ const columns = computed(() => [
|
||||||
:class="{ 'is-active': row.isReceived }"
|
:class="{ 'is-active': row.isReceived }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #moreFilterPanel="{ params }">
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('params.scopeDays')"
|
||||||
|
v-model.number="params.scopeDays"
|
||||||
|
@keyup.enter="(evt) => handleScopeDays(evt.target.value)"
|
||||||
|
@remove="handleScopeDays()"
|
||||||
|
class="q-px-xs q-pr-lg"
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
import { ref, computed } from 'vue';
|
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 FormModelPopup from 'src/components/FormModelPopup.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.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');
|
||||||
|
@ -17,7 +16,7 @@ const store = arrayData.store;
|
||||||
const dialog = ref();
|
const dialog = ref();
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const paginate = ref();
|
const tableRef = ref();
|
||||||
|
|
||||||
const initialData = computed(() => {
|
const initialData = computed(() => {
|
||||||
return {
|
return {
|
||||||
|
@ -25,10 +24,46 @@ const initialData = computed(() => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
function reloadData() {
|
const columns = computed(() => [
|
||||||
initialData.value.name = null;
|
{
|
||||||
paginate.value.fetch();
|
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) {
|
function navigate(id, name) {
|
||||||
push({ path: `/wagon/type/${id}/edit`, query: { name } });
|
push({ path: `/wagon/type/${id}/edit`, query: { name } });
|
||||||
|
@ -41,51 +76,25 @@ 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();
|
||||||
}
|
}
|
||||||
</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"
|
||||||
ref="paginate"
|
|
||||||
data-key="WagonTypeList"
|
data-key="WagonTypeList"
|
||||||
url="WagonTypes"
|
url="WagonTypes"
|
||||||
order="id DESC"
|
:columns="columns"
|
||||||
auto-load
|
auto-load
|
||||||
|
order="id DESC"
|
||||||
|
:right-search="false"
|
||||||
|
:column-search="false"
|
||||||
|
:default-mode="'card'"
|
||||||
|
:disable-option="{ table: true }"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
</VnTable>
|
||||||
<CardList
|
|
||||||
v-for="row of rows"
|
|
||||||
:key="row.id"
|
|
||||||
:title="(row.name || '').toString()"
|
|
||||||
:id="row.id"
|
|
||||||
@click="navigate(row.id, row.name)"
|
|
||||||
>
|
|
||||||
<template #list-items>
|
|
||||||
<QCheckbox
|
|
||||||
:label="t('Divisble')"
|
|
||||||
:model-value="row.divisible"
|
|
||||||
disable
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #actions>
|
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openCard')"
|
|
||||||
@click.stop="navigate(row.id, row.name)"
|
|
||||||
outline
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
:label="t('wagon.list.remove')"
|
|
||||||
@click.stop="remove(row)"
|
|
||||||
color="primary"
|
|
||||||
style="margin-top: 15px"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</CardList>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
|
||||||
<QPageSticky :offset="[18, 18]">
|
<QPageSticky :offset="[18, 18]">
|
||||||
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add" shortcut="+">
|
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add" shortcut="+">
|
||||||
<QDialog ref="dialog">
|
<QDialog ref="dialog">
|
||||||
|
@ -94,7 +103,7 @@ async function remove(row) {
|
||||||
url-create="WagonTypes"
|
url-create="WagonTypes"
|
||||||
model="WagonType"
|
model="WagonType"
|
||||||
:form-initial-data="initialData"
|
:form-initial-data="initialData"
|
||||||
@on-data-saved="reloadData()"
|
@on-data-saved="tableRef.reload()"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
<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, ref } 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');
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
const filter = {
|
const filter = {
|
||||||
include: {
|
include: {
|
||||||
relation: 'type',
|
relation: 'type',
|
||||||
|
@ -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,81 @@ 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"
|
||||||
|
:right-search="false"
|
||||||
|
:column-search="false"
|
||||||
|
:default-mode="'card'"
|
||||||
|
:disable-option="{ table: true }"
|
||||||
|
:create="{
|
||||||
|
urlCreate: 'Wagons',
|
||||||
|
title: t('Create new wagon'),
|
||||||
|
onDataSaved: () => tableRef.reload(),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #more-create-dialog="{ data }">
|
||||||
<CardList
|
<VnInput
|
||||||
v-for="row of rows"
|
filled
|
||||||
:key="row.id"
|
v-model="data.label"
|
||||||
:title="(row.label || '').toString()"
|
:label="t('wagon.create.label')"
|
||||||
:id="row.id"
|
type="number"
|
||||||
@click="navigate(row.id)"
|
min="0"
|
||||||
|
:rules="[(val) => !!val || t('wagon.warnings.labelNotEmpty')]"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
filled
|
||||||
|
v-model="data.plate"
|
||||||
|
:label="t('wagon.create.plate')"
|
||||||
|
:rules="[(val) => !!val || t('wagon.warnings.plateNotEmpty')]"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
filled
|
||||||
|
v-model="data.volume"
|
||||||
|
:label="t('wagon.create.volume')"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
:rules="[(val) => !!val || t('wagon.warnings.volumeNotEmpty')]"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="WagonTypes"
|
||||||
|
filled
|
||||||
|
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 #list-items>
|
<template v-if="data.typeFk" #append>
|
||||||
<VnLv
|
<QIcon
|
||||||
:label="t('wagon.list.plate')"
|
name="cancel"
|
||||||
:title-label="t('wagon.list.plate')"
|
@click.stop.prevent="data.typeFk = null"
|
||||||
:value="row.plate"
|
class="cursor-pointer"
|
||||||
/>
|
|
||||||
<VnLv :label="t('wagon.list.volume')" :value="row?.volume" />
|
|
||||||
<VnLv
|
|
||||||
:label="t('wagon.list.type')"
|
|
||||||
:value="row?.type?.name"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
<template #no-option>
|
||||||
<QBtn
|
<QItem>
|
||||||
:label="t('components.smartCard.openCard')"
|
<QItemSection class="text-grey">
|
||||||
@click.stop="navigate(row.id)"
|
{{ t('wagon.warnings.noData') }}
|
||||||
outline
|
</QItemSection>
|
||||||
/>
|
</QItem>
|
||||||
<QBtn
|
|
||||||
:label="t('wagon.list.remove')"
|
|
||||||
@click.stop="remove(row)"
|
|
||||||
color="primary"
|
|
||||||
style="margin-top: 15px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</CardList>
|
</VnSelect>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnTable>
|
||||||
</div>
|
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
|
||||||
<QBtn @click="create" fab icon="add" color="primary" shortcut="+" />
|
|
||||||
</QPageSticky>
|
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -139,7 +139,11 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('worker.card.user')" :value="entity.user?.name" />
|
<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?.emailUser?.email"
|
||||||
|
copy
|
||||||
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.list.department')"
|
:label="t('worker.list.department')"
|
||||||
:value="entity.department ? entity.department.department.name : null"
|
:value="entity.department ? entity.department.department.name : null"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from 'vue';
|
import { ref, onBeforeMount, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import axios from 'axios';
|
||||||
import { dashIfEmpty, toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
|
@ -11,6 +11,7 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy.vue';
|
import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy.vue';
|
||||||
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
||||||
|
import { useRole } from 'src/composables/useRole';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -23,64 +24,27 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
const workerUrl = ref();
|
const basicDataUrl = ref(null);
|
||||||
|
const isHr = computed(() => useRole().hasAny(['hr']));
|
||||||
|
const advancedSummary = ref();
|
||||||
|
|
||||||
onMounted(async () => {
|
onBeforeMount(async () => {
|
||||||
workerUrl.value = (await getUrl('')) + `worker/${entityId.value}/`;
|
if (isHr.value) {
|
||||||
|
advancedSummary.value = (
|
||||||
|
await axios.get('Workers/advancedSummary', {
|
||||||
|
params: { filter: { where: { id: entityId.value } } },
|
||||||
|
})
|
||||||
|
).data[0];
|
||||||
|
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const filter = {
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'user',
|
|
||||||
scope: {
|
|
||||||
fields: ['name', 'nickname', 'roleFk'],
|
|
||||||
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'role',
|
|
||||||
scope: {
|
|
||||||
fields: ['name'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'emailUser',
|
|
||||||
scope: {
|
|
||||||
fields: ['email'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'department',
|
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'department',
|
|
||||||
scope: {
|
|
||||||
fields: ['name'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'boss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'client',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'sip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summary"
|
ref="summary"
|
||||||
:url="`Workers/${entityId}`"
|
:url="`Workers/summary`"
|
||||||
:filter="filter"
|
:filter="{ where: { id: entityId } }"
|
||||||
data-key="WorkerSummary"
|
data-key="WorkerSummary"
|
||||||
>
|
>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
|
@ -88,10 +52,7 @@ const filter = {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: worker }">
|
<template #body="{ entity: worker }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle :url="basicDataUrl" :text="t('worker.summary.basicData')" />
|
||||||
:url="`#/worker/${entityId}/basic-data`"
|
|
||||||
:text="t('worker.summary.basicData')"
|
|
||||||
/>
|
|
||||||
<VnLv :label="t('worker.card.name')" :value="worker.user?.nickname" />
|
<VnLv :label="t('worker.card.name')" :value="worker.user?.nickname" />
|
||||||
<VnLv :label="t('worker.list.department')">
|
<VnLv :label="t('worker.list.department')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
@ -128,13 +89,9 @@ const filter = {
|
||||||
<VnLinkPhone :phone-number="worker.client?.phone" />
|
<VnLinkPhone :phone-number="worker.client?.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one" v-if="advancedSummary">
|
||||||
<VnTitle
|
<VnTitle :url="basicDataUrl" :text="t('worker.summary.basicData')" />
|
||||||
:url="`#/worker/${entityId}/basic-data`"
|
|
||||||
:text="t('worker.summary.basicData')"
|
|
||||||
/>
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.summary.fiDueDate')"
|
:label="t('worker.summary.fiDueDate')"
|
||||||
:value="toDate(worker.fiDueDate)"
|
:value="toDate(worker.fiDueDate)"
|
||||||
|
@ -162,7 +119,6 @@ const filter = {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle :text="t('worker.summary.userData')" />
|
<VnTitle :text="t('worker.summary.userData')" />
|
||||||
<VnLv :label="t('worker.summary.userId')" :value="worker?.user?.id" />
|
|
||||||
<VnLv :label="t('worker.card.name')" :value="worker?.user?.nickname" />
|
<VnLv :label="t('worker.card.name')" :value="worker?.user?.nickname" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.list.email')"
|
:label="t('worker.list.email')"
|
||||||
|
|
|
@ -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 () => {
|
||||||
try {
|
const where = {
|
||||||
const filter = {
|
year: selectedDate.value.getFullYear(),
|
||||||
where: {
|
|
||||||
workerFk: route.params.id,
|
|
||||||
year: selectedDate.value ? selectedDate.value?.getFullYear() : null,
|
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
|
const mail = (
|
||||||
|
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||||
|
params: { filter: { where } },
|
||||||
|
})
|
||||||
|
).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"
|
||||||
|
@ -584,15 +561,16 @@ onMounted(async () => {
|
||||||
<span class="q-mb-md text-sm text-body1">
|
<span class="q-mb-md text-sm text-body1">
|
||||||
{{ secondsToHoursMinutes(day.dayData?.workedHours) }}
|
{{ secondsToHoursMinutes(day.dayData?.workedHours) }}
|
||||||
</span>
|
</span>
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add_circle"
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
color="primary"
|
color="primary"
|
||||||
class="fill-icon cursor-pointer"
|
class="fill-icon cursor-pointer"
|
||||||
size="sm"
|
|
||||||
@click="showWorkerTimeForm(day.dayData?.dated, 'create')"
|
@click="showWorkerTimeForm(day.dayData?.dated, 'create')"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Add time') }}</QTooltip>
|
<QTooltip>{{ t('Add time') }}</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
|
|
|
@ -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"
|
||||||
>
|
>
|
||||||
|
|
|
@ -180,17 +180,18 @@ function handleEvent(type, event, node) {
|
||||||
{{ t('Remove') }}
|
{{ t('Remove') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QBtn
|
||||||
name="add"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
size="sm"
|
flat
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click.stop="showCreateNodeForm(node.id)"
|
@click.stop="showCreateNodeForm(node.id)"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Create') }}
|
{{ t('Create') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QBtn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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"
|
||||||
>
|
>
|
||||||
|
|
|
@ -74,7 +74,7 @@ async function remove(row) {
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||||
<QBtn @click="create" fab icon="add" color="primary" />
|
<QBtn @click="create" fab icon="add" shortcut="+" color="primary" />
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -74,7 +74,7 @@ async function remove(row) {
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||||
<QBtn @click="create" fab icon="add" color="primary" />
|
<QBtn @click="create" fab icon="add" shortcut="+" color="primary" />
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue