forked from verdnatura/salix-front
Merge branch '7884-AddLabelerField' of https://gitea.verdnatura.es/verdnatura/salix-front into 7884-AddLabelerField
This commit is contained in:
commit
90ce9b2cd3
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 🆕
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.40.0",
|
"version": "24.42.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -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');
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -234,6 +234,8 @@ async function remove(data) {
|
||||||
newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
|
newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
|
||||||
fetch(newData);
|
fetch(newData);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
emit('update:selected', []);
|
emit('update:selected', []);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -53,6 +53,10 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
bottom: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
cardClass: {
|
cardClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'flex-one',
|
default: 'flex-one',
|
||||||
|
@ -69,10 +73,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 +102,14 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '90vh',
|
default: '90vh',
|
||||||
},
|
},
|
||||||
|
footer: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
disabledAttr: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -146,7 +155,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 +205,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 +310,7 @@ defineExpose({
|
||||||
redirect: redirectFn,
|
redirect: redirectFn,
|
||||||
selected,
|
selected,
|
||||||
CrudModelRef,
|
CrudModelRef,
|
||||||
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_) {
|
||||||
|
@ -368,9 +378,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 +398,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 &&
|
||||||
|
@ -420,7 +428,7 @@ function handleOnDataSaved(_) {
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="$props.rightSearch"
|
v-if="$props.rightSearch"
|
||||||
icon="filter_alt"
|
icon="filter_alt"
|
||||||
class="bg-vn-section-color q-ml-md"
|
class="bg-vn-section-color q-ml-sm"
|
||||||
dense
|
dense
|
||||||
@click="stateStore.toggleRightDrawer()"
|
@click="stateStore.toggleRightDrawer()"
|
||||||
/>
|
/>
|
||||||
|
@ -507,8 +515,12 @@ function handleOnDataSaved(_) {
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="btn.title"
|
:title="btn.title"
|
||||||
:icon="btn.icon"
|
:icon="btn.icon"
|
||||||
class="q-px-sm text-primary-light"
|
class="q-pa-xs"
|
||||||
flat
|
flat
|
||||||
|
dense
|
||||||
|
:class="
|
||||||
|
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
||||||
|
"
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
||||||
}`"
|
}`"
|
||||||
|
@ -516,6 +528,29 @@ function handleOnDataSaved(_) {
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
<template #bottom v-if="bottom">
|
||||||
|
<slot name="bottom-table">
|
||||||
|
<QBtn
|
||||||
|
@click="
|
||||||
|
() =>
|
||||||
|
createAsDialog
|
||||||
|
? (showForm = !showForm)
|
||||||
|
: handleOnDataSaved(create)
|
||||||
|
"
|
||||||
|
class="cursor-pointer fill-icon"
|
||||||
|
color="primary"
|
||||||
|
icon="add_circle"
|
||||||
|
size="md"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
shortcut="+"
|
||||||
|
:disabled="!disabledAttr"
|
||||||
|
/>
|
||||||
|
<QTooltip>
|
||||||
|
{{ createForm.title }}
|
||||||
|
</QTooltip>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
<template #item="{ row, colsMap }">
|
<template #item="{ row, colsMap }">
|
||||||
<component
|
<component
|
||||||
:is="$props.redirect ? 'router-link' : 'span'"
|
:is="$props.redirect ? 'router-link' : 'span'"
|
||||||
|
@ -632,6 +667,20 @@ 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"
|
||||||
|
>
|
||||||
|
<slot
|
||||||
|
:name="`column-footer-${col.name}`"
|
||||||
|
:class="getColAlign(col)"
|
||||||
|
/>
|
||||||
|
</QTh>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
|
@ -699,7 +748,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 +758,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,10 +794,16 @@ es:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-table th {
|
.q-table {
|
||||||
|
th {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__top {
|
||||||
|
padding: 12px 0px;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.vnTable {
|
.vnTable {
|
||||||
thead tr th {
|
thead tr th {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
@ -831,4 +884,13 @@ es:
|
||||||
cursor: text;
|
cursor: text;
|
||||||
user-select: all;
|
user-select: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full-width-slot {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--vn-text-color);
|
||||||
|
margin-bottom: -1%;
|
||||||
|
background-color: var(--vn-header-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -135,7 +135,7 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-md q-px-sm" dense>
|
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-sm q-px-sm" dense>
|
||||||
<QPopupProxy ref="popupProxyRef">
|
<QPopupProxy ref="popupProxyRef">
|
||||||
<QCard class="column q-pa-md">
|
<QCard class="column q-pa-md">
|
||||||
<QIcon name="info" size="sm" class="info-icon">
|
<QIcon name="info" size="sm" class="info-icon">
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -103,6 +103,7 @@ const mixinRules = [
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
value = null;
|
value = null;
|
||||||
|
vnInputRef.focus();
|
||||||
emit('remove');
|
emit('remove');
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|
|
@ -20,6 +20,7 @@ const { validations } = useValidator();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||||
|
const vnInputDateRef = ref(null);
|
||||||
|
|
||||||
const dateFormat = 'DD/MM/YYYY';
|
const dateFormat = 'DD/MM/YYYY';
|
||||||
const isPopupOpen = ref();
|
const isPopupOpen = ref();
|
||||||
|
@ -91,6 +92,7 @@ const styleAttrs = computed(() => {
|
||||||
<template>
|
<template>
|
||||||
<div @mouseover="hover = true" @mouseleave="hover = false">
|
<div @mouseover="hover = true" @mouseleave="hover = false">
|
||||||
<QInput
|
<QInput
|
||||||
|
ref="vnInputDateRef"
|
||||||
v-model="formattedDate"
|
v-model="formattedDate"
|
||||||
class="vn-input-date"
|
class="vn-input-date"
|
||||||
:mask="mask"
|
:mask="mask"
|
||||||
|
@ -113,6 +115,7 @@ const styleAttrs = computed(() => {
|
||||||
!$attrs.disable
|
!$attrs.disable
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
|
vnInputDateRef.focus();
|
||||||
model = null;
|
model = null;
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
|
|
|
@ -16,6 +16,7 @@ const props = defineProps({
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const vnInputTimeRef = ref(null);
|
||||||
const initialDate = ref(model.value ?? Date.vnNew());
|
const initialDate = ref(model.value ?? Date.vnNew());
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||||
|
@ -69,6 +70,7 @@ function dateToTime(newDate) {
|
||||||
<template>
|
<template>
|
||||||
<div @mouseover="hover = true" @mouseleave="hover = false">
|
<div @mouseover="hover = true" @mouseleave="hover = false">
|
||||||
<QInput
|
<QInput
|
||||||
|
ref="vnInputTimeRef"
|
||||||
class="vn-input-time"
|
class="vn-input-time"
|
||||||
mask="##:##"
|
mask="##:##"
|
||||||
placeholder="--:--"
|
placeholder="--:--"
|
||||||
|
@ -92,6 +94,7 @@ function dateToTime(newDate) {
|
||||||
!$attrs.disable
|
!$attrs.disable
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
|
vnInputTimeRef.focus();
|
||||||
model = null;
|
model = null;
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -38,6 +38,10 @@ const $props = defineProps({
|
||||||
type: [Array],
|
type: [Array],
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
exprBuilder: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
isClearable: {
|
isClearable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -179,6 +183,7 @@ async function fetchFilter(val) {
|
||||||
}, {});
|
}, {});
|
||||||
} else defaultWhere = { [key]: getVal(val) };
|
} else defaultWhere = { [key]: getVal(val) };
|
||||||
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
||||||
|
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
||||||
const fetchOptions = { where, include, limit };
|
const fetchOptions = { where, include, limit };
|
||||||
if (fields) fetchOptions.fields = fields;
|
if (fields) fetchOptions.fields = fields;
|
||||||
if (sortBy) fetchOptions.order = sortBy;
|
if (sortBy) fetchOptions.order = sortBy;
|
||||||
|
|
|
@ -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>
|
|
@ -47,6 +47,7 @@ let store;
|
||||||
let entity;
|
let entity;
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
||||||
|
const menuRef = ref();
|
||||||
defineExpose({ getData });
|
defineExpose({ getData });
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
@ -170,7 +171,7 @@ const toModule = computed(() =>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('components.cardDescriptor.moreOptions') }}
|
{{ t('components.cardDescriptor.moreOptions') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
<QMenu ref="menuRef">
|
<QMenu :ref="menuRef">
|
||||||
<QList>
|
<QList>
|
||||||
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
||||||
</QList>
|
</QList>
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -131,9 +131,8 @@ async function fetch(params) {
|
||||||
useArrayData(props.dataKey, params);
|
useArrayData(props.dataKey, params);
|
||||||
arrayData.reset(['filter.skip', 'skip']);
|
arrayData.reset(['filter.skip', 'skip']);
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
if (!store.hasMoreData) {
|
if (!store.hasMoreData) isLoading.value = false;
|
||||||
isLoading.value = false;
|
|
||||||
}
|
|
||||||
emit('onFetch', store.data);
|
emit('onFetch', store.data);
|
||||||
return store.data;
|
return store.data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
import { useSession } from './useSession';
|
import { useSession } from './useSession';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
export function usePrintService() {
|
export function usePrintService() {
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const { getTokenMultimedia } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
|
|
||||||
function sendEmail(path, params) {
|
function sendEmail(path, params) {
|
||||||
return axios.post(path, params).then(() =>
|
return axios.post(path, params).then(() =>
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: 'Notification sent',
|
message: t('globals.notificationSent'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
icon: 'check',
|
icon: 'check',
|
||||||
})
|
})
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ $color-font-secondary: #777;
|
||||||
.bg-success {
|
.bg-success {
|
||||||
background-color: $positive;
|
background-color: $positive;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-notice {
|
.bg-notice {
|
||||||
background-color: $info;
|
background-color: $info;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,8 +104,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
|
||||||
|
@ -158,6 +160,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
|
||||||
|
@ -493,6 +496,8 @@ ticket:
|
||||||
warehouse: Warehouse
|
warehouse: Warehouse
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
alias: Alias
|
alias: Alias
|
||||||
|
ticketList: Ticket List
|
||||||
|
newOrder: New Order
|
||||||
boxing:
|
boxing:
|
||||||
expedition: Expedition
|
expedition: Expedition
|
||||||
item: Item
|
item: Item
|
||||||
|
@ -514,6 +519,7 @@ ticket:
|
||||||
landed: Landed
|
landed: Landed
|
||||||
consigneePhone: Consignee phone
|
consigneePhone: Consignee phone
|
||||||
consigneeMobile: Consignee mobile
|
consigneeMobile: Consignee mobile
|
||||||
|
consigneeAddress: Consignee address
|
||||||
clientPhone: Client phone
|
clientPhone: Client phone
|
||||||
clientMobile: Client mobile
|
clientMobile: Client mobile
|
||||||
consignee: Consignee
|
consignee: Consignee
|
||||||
|
@ -543,6 +549,11 @@ ticket:
|
||||||
weight: Weight
|
weight: Weight
|
||||||
goTo: Go to
|
goTo: Go to
|
||||||
summaryAmount: Summary
|
summaryAmount: Summary
|
||||||
|
purchaseRequest: Purchase request
|
||||||
|
service: Service
|
||||||
|
description: Description
|
||||||
|
attender: Attender
|
||||||
|
ok: Ok
|
||||||
create:
|
create:
|
||||||
client: Client
|
client: Client
|
||||||
address: Address
|
address: Address
|
||||||
|
@ -566,7 +577,6 @@ invoiceOut:
|
||||||
client: Client
|
client: Client
|
||||||
company: Company
|
company: Company
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
ticketList: Ticket List
|
|
||||||
summary:
|
summary:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
created: Created
|
created: Created
|
||||||
|
@ -899,6 +909,7 @@ supplier:
|
||||||
account: Account
|
account: Account
|
||||||
payMethod: Pay Method
|
payMethod: Pay Method
|
||||||
payDay: Pay Day
|
payDay: Pay Day
|
||||||
|
country: Country
|
||||||
summary:
|
summary:
|
||||||
responsible: Responsible
|
responsible: Responsible
|
||||||
notes: Notes
|
notes: Notes
|
||||||
|
@ -1072,7 +1083,7 @@ item:
|
||||||
producer: Producer
|
producer: Producer
|
||||||
landed: Landed
|
landed: Landed
|
||||||
fixedPrice:
|
fixedPrice:
|
||||||
itemId: Item ID
|
itemFk: Item ID
|
||||||
groupingPrice: Grouping price
|
groupingPrice: Grouping price
|
||||||
packingPrice: Packing price
|
packingPrice: Packing price
|
||||||
hasMinPrice: Has min price
|
hasMinPrice: Has min price
|
||||||
|
|
|
@ -64,7 +64,7 @@ globals:
|
||||||
shipped: F. envío
|
shipped: F. envío
|
||||||
totalEntries: Ent. totales
|
totalEntries: Ent. totales
|
||||||
amount: Importe
|
amount: Importe
|
||||||
packages: Bultos
|
packages: Embalajes
|
||||||
download: Descargar
|
download: Descargar
|
||||||
downloadPdf: Descargar PDF
|
downloadPdf: Descargar PDF
|
||||||
selectRows: 'Seleccionar las { numberRows } filas(s)'
|
selectRows: 'Seleccionar las { numberRows } filas(s)'
|
||||||
|
@ -106,8 +106,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
|
||||||
|
@ -161,6 +163,7 @@ globals:
|
||||||
dms: Gestión documental
|
dms: Gestión documental
|
||||||
entryCreate: Nueva entrada
|
entryCreate: Nueva entrada
|
||||||
latestBuys: Últimas compras
|
latestBuys: Últimas compras
|
||||||
|
reserves: Reservas
|
||||||
tickets: Tickets
|
tickets: Tickets
|
||||||
ticketCreate: Nuevo ticket
|
ticketCreate: Nuevo ticket
|
||||||
boxing: Encajado
|
boxing: Encajado
|
||||||
|
@ -265,7 +268,7 @@ globals:
|
||||||
tracking: Estados
|
tracking: Estados
|
||||||
components: Componentes
|
components: Componentes
|
||||||
pictures: Fotos
|
pictures: Fotos
|
||||||
packages: Bultos
|
packages: Embalajes
|
||||||
ldap: LDAP
|
ldap: LDAP
|
||||||
samba: Samba
|
samba: Samba
|
||||||
twoFactor: Doble factor
|
twoFactor: Doble factor
|
||||||
|
@ -484,7 +487,7 @@ ticket:
|
||||||
tracking: Estados
|
tracking: Estados
|
||||||
components: Componentes
|
components: Componentes
|
||||||
pictures: Fotos
|
pictures: Fotos
|
||||||
packages: Bultos
|
packages: Embalajes
|
||||||
list:
|
list:
|
||||||
nickname: Alias
|
nickname: Alias
|
||||||
state: Estado
|
state: Estado
|
||||||
|
@ -502,6 +505,8 @@ ticket:
|
||||||
warehouse: Almacén
|
warehouse: Almacén
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
alias: Alias
|
alias: Alias
|
||||||
|
ticketList: Listado de tickets
|
||||||
|
newOrder: Nuevo pedido
|
||||||
boxing:
|
boxing:
|
||||||
expedition: Expedición
|
expedition: Expedición
|
||||||
item: Artículo
|
item: Artículo
|
||||||
|
@ -523,6 +528,7 @@ ticket:
|
||||||
landed: Entregado
|
landed: Entregado
|
||||||
consigneePhone: Tel. consignatario
|
consigneePhone: Tel. consignatario
|
||||||
consigneeMobile: Móv. consignatario
|
consigneeMobile: Móv. consignatario
|
||||||
|
consigneeAddress: Dir. consignatario
|
||||||
clientPhone: Tel. cliente
|
clientPhone: Tel. cliente
|
||||||
clientMobile: Móv. cliente
|
clientMobile: Móv. cliente
|
||||||
consignee: Consignatario
|
consignee: Consignatario
|
||||||
|
@ -552,6 +558,10 @@ ticket:
|
||||||
weight: Peso
|
weight: Peso
|
||||||
goTo: Ir a
|
goTo: Ir a
|
||||||
summaryAmount: Resumen
|
summaryAmount: Resumen
|
||||||
|
purchaseRequest: Petición de compra
|
||||||
|
service: Servicio
|
||||||
|
description: Descripción
|
||||||
|
attender: Consignatario
|
||||||
create:
|
create:
|
||||||
client: Cliente
|
client: Cliente
|
||||||
address: Dirección
|
address: Dirección
|
||||||
|
@ -884,6 +894,7 @@ supplier:
|
||||||
account: Cuenta
|
account: Cuenta
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
payDay: Dia de pago
|
payDay: Dia de pago
|
||||||
|
country: País
|
||||||
summary:
|
summary:
|
||||||
responsible: Responsable
|
responsible: Responsable
|
||||||
notes: Notas
|
notes: Notas
|
||||||
|
@ -1057,7 +1068,7 @@ item:
|
||||||
producer: Productor
|
producer: Productor
|
||||||
landed: F. entrega
|
landed: F. entrega
|
||||||
fixedPrice:
|
fixedPrice:
|
||||||
itemId: ID Artículo
|
itemFk: ID Artículo
|
||||||
groupingPrice: Precio grouping
|
groupingPrice: Precio grouping
|
||||||
packingPrice: Precio packing
|
packingPrice: Precio packing
|
||||||
hasMinPrice: Tiene precio mínimo
|
hasMinPrice: Tiene precio mínimo
|
||||||
|
|
|
@ -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 }}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
|
||||||
import VnFilter from 'components/VnTable/VnFilter.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue';
|
import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue';
|
||||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
|
@ -33,9 +33,9 @@ const stateStore = useStateStore();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
|
|
||||||
const clientRisk = ref([]);
|
const clientRisk = ref([]);
|
||||||
|
const companies = ref([]);
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const companyId = ref(user.value.companyFk);
|
const companyId = ref(user.value.companyFk);
|
||||||
const companyLastId = ref(user.value.companyFk);
|
|
||||||
const balances = ref([]);
|
const balances = ref([]);
|
||||||
const vnFilterRef = ref({});
|
const vnFilterRef = ref({});
|
||||||
const filter = computed(() => {
|
const filter = computed(() => {
|
||||||
|
@ -45,33 +45,6 @@ const filter = computed(() => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const companyFilterColumn = {
|
|
||||||
align: 'left',
|
|
||||||
name: 'companyId',
|
|
||||||
label: t('Company'),
|
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'Companies',
|
|
||||||
optionLabel: 'code',
|
|
||||||
sortBy: 'code',
|
|
||||||
limit: 0,
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
event: {
|
|
||||||
remove: () => (companyId.value = null),
|
|
||||||
'update:modelValue': (newCompanyFk) => {
|
|
||||||
if (!newCompanyFk) return;
|
|
||||||
vnFilterRef.value.addFilter(newCompanyFk);
|
|
||||||
companyLastId.value = newCompanyFk;
|
|
||||||
},
|
|
||||||
blur: () =>
|
|
||||||
!companyId.value &&
|
|
||||||
(companyId.value = companyLastId.value ?? user.value.companyFk),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
@ -166,6 +139,11 @@ onBeforeMount(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getCurrentBalance(data) {
|
async function getCurrentBalance(data) {
|
||||||
|
currentBalance.value[companyId.value] = {
|
||||||
|
amount: 0,
|
||||||
|
code: companies.value.find((c) => c.id === companyId.value)?.code,
|
||||||
|
};
|
||||||
|
|
||||||
for (const balance of data) {
|
for (const balance of data) {
|
||||||
currentBalance.value[balance.companyFk] = {
|
currentBalance.value[balance.companyFk] = {
|
||||||
code: balance.company.code,
|
code: balance.company.code,
|
||||||
|
@ -192,14 +170,21 @@ const showBalancePdf = ({ id }) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
url="Companies"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (companies = data)"
|
||||||
|
></FetchData>
|
||||||
|
<FetchData
|
||||||
|
v-if="companies.length > 0"
|
||||||
url="clientRisks"
|
url="clientRisks"
|
||||||
:filter="{
|
:filter="{
|
||||||
include: { relation: 'company', scope: { fields: ['code'] } },
|
include: { relation: 'company', scope: { fields: ['code'] } },
|
||||||
where: { clientFk: route.params.id, companyFk: companyId },
|
where: { clientFk: route.params.id },
|
||||||
}"
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="getCurrentBalance"
|
@on-fetch="getCurrentBalance"
|
||||||
></FetchData>
|
></FetchData>
|
||||||
|
|
||||||
<VnSubToolbar class="q-mb-md">
|
<VnSubToolbar class="q-mb-md">
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<div class="column justify-center q-px-md q-py-sm">
|
<div class="column justify-center q-px-md q-py-sm">
|
||||||
|
@ -212,13 +197,15 @@ const showBalancePdf = ({ id }) => {
|
||||||
</template>
|
</template>
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
<div>
|
<div>
|
||||||
<VnFilter
|
<VnSelect
|
||||||
|
:label="t('Company')"
|
||||||
ref="vnFilterRef"
|
ref="vnFilterRef"
|
||||||
v-model="companyId"
|
v-model="companyId"
|
||||||
data-key="CustomerBalance"
|
data-key="CustomerBalance"
|
||||||
:column="companyFilterColumn"
|
:options="companies"
|
||||||
search-url="balance"
|
option-label="code"
|
||||||
/>
|
option-value="id"
|
||||||
|
></VnSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
|
|
@ -16,6 +16,19 @@ const { t } = useI18n();
|
||||||
const businessTypes = ref([]);
|
const businessTypes = ref([]);
|
||||||
const contactChannels = ref([]);
|
const contactChannels = ref([]);
|
||||||
const title = ref();
|
const title = ref();
|
||||||
|
const handleSalesModelValue = (val) => ({
|
||||||
|
or: [
|
||||||
|
{ name: val },
|
||||||
|
{ nickname: { like: '%' + val + '%' } },
|
||||||
|
{ code: { like: `${val}%` } },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const exprBuilder = (param, value) => {
|
||||||
|
return {
|
||||||
|
and: [{ active: { neq: false } }, handleSalesModelValue(value)],
|
||||||
|
};
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -34,7 +47,7 @@ const title = ref();
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('globals.name')"
|
:label="t('globals.name')"
|
||||||
:rules="validate('client.socialName')"
|
:rules="validate('client.name')"
|
||||||
autofocus
|
autofocus
|
||||||
clearable
|
clearable
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
|
@ -98,8 +111,10 @@ const title = ref();
|
||||||
}"
|
}"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
|
option-label="nickname"
|
||||||
|
option-value="id"
|
||||||
:rules="validate('client.salesPersonFk')"
|
:rules="validate('client.salesPersonFk')"
|
||||||
:use-like="false"
|
:expr-builder="exprBuilder"
|
||||||
emit-value
|
emit-value
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
|
|
|
@ -0,0 +1,177 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { QItem } from 'quasar';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import { QItemSection } from 'quasar';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||||
|
<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>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.item')"
|
||||||
|
v-model="params.itemId"
|
||||||
|
is-outlined
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.buyerId"
|
||||||
|
url="TicketRequests/getItemTypeWorker"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
|
sort-by="nickname ASC"
|
||||||
|
:label="t('params.buyer')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.typeId"
|
||||||
|
url="ItemTypes"
|
||||||
|
:include="['category']"
|
||||||
|
:fields="['id', 'name', 'categoryFk']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
:label="t('params.typeId')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>{{
|
||||||
|
scope.opt?.category?.name
|
||||||
|
}}</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.categoryId"
|
||||||
|
url="ItemCategories"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
:label="t('params.categoryId')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.campaignId"
|
||||||
|
url="Campaigns/latest"
|
||||||
|
sort-by="dated DESC"
|
||||||
|
:label="t('params.campaignId')"
|
||||||
|
option-label="code"
|
||||||
|
option-value="id"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{
|
||||||
|
t(`params.${scope.opt?.code}`)
|
||||||
|
}}</QItemLabel>
|
||||||
|
<QItemLabel caption>{{
|
||||||
|
toDate(scope.opt.dated)
|
||||||
|
}}</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.from')"
|
||||||
|
v-model="params.from"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.to')"
|
||||||
|
v-model="params.to"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
item: Item id
|
||||||
|
buyer: Buyer
|
||||||
|
type: Type
|
||||||
|
category: Category
|
||||||
|
itemId: Item id
|
||||||
|
buyerId: Buyer
|
||||||
|
typeId: Type
|
||||||
|
categoryId: Category
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
|
campaignId: Campaña
|
||||||
|
valentinesDay: Valentine's Day
|
||||||
|
mothersDay: Mother's Day
|
||||||
|
allSaints: All Saints' Day
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
item: Id artículo
|
||||||
|
buyer: Comprador
|
||||||
|
type: Tipo
|
||||||
|
category: Categoría
|
||||||
|
itemId: Id Artículo
|
||||||
|
buyerId: Comprador
|
||||||
|
typeId: Tipo
|
||||||
|
categoryId: Reino
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
campaignId: Campaña
|
||||||
|
valentinesDay: Día de San Valentín
|
||||||
|
mothersDay: Día de la Madre
|
||||||
|
allSaints: Día de Todos los Santos
|
||||||
|
</i18n>
|
|
@ -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>
|
||||||
|
|
|
@ -190,6 +190,18 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Go to user') }}</QTooltip>
|
<QTooltip>{{ t('Go to user') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
v-if="entity.supplier"
|
||||||
|
:to="{
|
||||||
|
name: 'SupplierSummary',
|
||||||
|
params: { id: entity.supplier.id },
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
icon="vn:supplier"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Go to supplier') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
|
@ -204,6 +216,7 @@ es:
|
||||||
Customer ticket list: Listado de tickets del cliente
|
Customer ticket list: Listado de tickets del cliente
|
||||||
Customer invoice out list: Listado de facturas del cliente
|
Customer invoice out list: Listado de facturas del cliente
|
||||||
Go to user: Ir al usuario
|
Go to user: Ir al usuario
|
||||||
|
Go to supplier: Ir al proveedor
|
||||||
Customer unpaid: Cliente impago
|
Customer unpaid: Cliente impago
|
||||||
Unpaid: Impagado
|
Unpaid: Impagado
|
||||||
unpaidDated: 'Fecha {dated}'
|
unpaidDated: 'Fecha {dated}'
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -134,15 +134,17 @@ function handleLocation(data, location) {
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</div>
|
</div>
|
||||||
<QCheckbox :label="t('Verified data')" v-model="data.isTaxDataChecked" />
|
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('Electronic invoice')"
|
:label="t('Electronic invoice')"
|
||||||
v-model="data.hasElectronicInvoice"
|
v-model="data.hasElectronicInvoice"
|
||||||
|
/><QCheckbox
|
||||||
|
:label="t('Verified data')"
|
||||||
|
v-model="data.isTaxDataChecked"
|
||||||
/>
|
/>
|
||||||
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -1,35 +1,20 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const provinces = ref();
|
|
||||||
const workers = ref();
|
|
||||||
const zones = ref();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Provinces" @on-fetch="(data) => (provinces = data)" auto-load />
|
<VnFilterPanel :data-key="dataKey" :search-button="true" search-url="table">
|
||||||
<FetchData url="Zones" @on-fetch="(data) => (zones = data)" auto-load />
|
|
||||||
<FetchData
|
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
:filter="{ where: { role: 'salesPerson' } }"
|
|
||||||
@on-fetch="(data) => (workers = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
@ -65,15 +50,14 @@ const zones = ref();
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
<QItemSection v-if="!workers">
|
<QItemSection>
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection v-if="workers">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Workers/activeWithInheritedRole"
|
||||||
|
:filter="{ where: { role: 'salesPerson' } }"
|
||||||
|
auto-load
|
||||||
:label="t('Salesperson')"
|
:label="t('Salesperson')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="workers"
|
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
|
@ -88,15 +72,12 @@ const zones = ref();
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
<QItemSection v-if="!provinces">
|
<QItemSection
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
><VnSelect
|
||||||
</QItemSection>
|
url="Provinces"
|
||||||
<QItemSection v-if="provinces">
|
|
||||||
<VnSelect
|
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
v-model="params.provinceFk"
|
v-model="params.provinceFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="provinces"
|
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
|
@ -105,6 +86,7 @@ const zones = ref();
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
auto-load
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -135,15 +117,11 @@ const zones = ref();
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection v-if="!zones">
|
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection v-if="zones">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Zones"
|
||||||
:label="t('Zone')"
|
:label="t('Zone')"
|
||||||
v-model="params.zoneFk"
|
v-model="params.zoneFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="zones"
|
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
|
@ -152,8 +130,8 @@ const zones = ref();
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
auto-load
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
|
|
|
@ -8,10 +8,10 @@ import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import CustomerSummary from './Card/CustomerSummary.vue';
|
import CustomerSummary from './Card/CustomerSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
|
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
import CustomerFilter from './CustomerFilter.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -397,6 +397,11 @@ function handleLocation(data, location) {
|
||||||
:label="t('Search customer')"
|
:label="t('Search customer')"
|
||||||
data-key="Customer"
|
data-key="Customer"
|
||||||
/>
|
/>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<CustomerFilter data-key="Customer" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="Customer"
|
data-key="Customer"
|
||||||
|
@ -413,6 +418,7 @@ function handleLocation(data, location) {
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="customer"
|
redirect="customer"
|
||||||
|
:right-search="false"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
|
@ -423,9 +429,10 @@ function handleLocation(data, location) {
|
||||||
:params="{
|
:params="{
|
||||||
departmentCodes: ['VT', 'shopping'],
|
departmentCodes: ['VT', 'shopping'],
|
||||||
}"
|
}"
|
||||||
|
option-label="nickname"
|
||||||
|
option-value="id"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
:use-like="false"
|
|
||||||
emit-value
|
emit-value
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
|
|
|
@ -134,6 +134,7 @@ function handleLocation(data, location) {
|
||||||
option-label="fiscalName"
|
option-label="fiscalName"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="data.customsAgentFk"
|
v-model="data.customsAgentFk"
|
||||||
|
:tooltip="t('Create a new expense')"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CustomerNewCustomsAgent @on-data-saved="refreshData()" />
|
<CustomerNewCustomsAgent @on-data-saved="refreshData()" />
|
||||||
|
|
|
@ -11,7 +11,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -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>
|
||||||
|
@ -221,9 +226,10 @@ function handleLocation(data, location) {
|
||||||
option-label="fiscalName"
|
option-label="fiscalName"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="data.customsAgentFk"
|
v-model="data.customsAgentFk"
|
||||||
|
:tooltip="t('New customs agent')"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CustomsNewCustomsAgent />
|
<CustomerNewCustomsAgent />
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -267,16 +273,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>
|
||||||
|
@ -303,6 +310,7 @@ es:
|
||||||
Mobile: Movíl
|
Mobile: Movíl
|
||||||
Incoterms: Incoterms
|
Incoterms: Incoterms
|
||||||
Customs agent: Agente de aduanas
|
Customs agent: Agente de aduanas
|
||||||
|
New customs agent: Nuevo agente de aduanas
|
||||||
Notes: Notas
|
Notes: Notas
|
||||||
Observation type: Tipo de observación
|
Observation type: Tipo de observación
|
||||||
Description: Descripción
|
Description: Descripción
|
||||||
|
|
|
@ -46,7 +46,6 @@ const onSubmit = async () => {
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
await axios.patch(`Clients/${$props.id}/setPassword`, payload);
|
await axios.patch(`Clients/${$props.id}/setPassword`, payload);
|
||||||
await $props.promise();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notify('errors.create', 'negative');
|
notify('errors.create', 'negative');
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -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"
|
||||||
>
|
>
|
||||||
|
|
|
@ -58,7 +58,7 @@ customer:
|
||||||
vies: VIES
|
vies: VIES
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
bankAccount: Cuenta bancaria
|
bankAccount: Cuenta bancaria
|
||||||
dueDay: Día de pago
|
dueDay: Vencimiento
|
||||||
hasLcr: Recibido LCR
|
hasLcr: Recibido LCR
|
||||||
hasCoreVnl: Recibido core VNL
|
hasCoreVnl: Recibido core VNL
|
||||||
hasB2BVnl: Recibido B2B VNL
|
hasB2BVnl: Recibido B2B VNL
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.v
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency } from 'src/filters';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -163,7 +164,7 @@ const fetchEntryBuys = async () => {
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<router-link
|
<router-link
|
||||||
v-if="route.name !== 'EntrySummary'"
|
v-if="route?.name !== 'EntrySummary'"
|
||||||
:to="{ name: 'EntrySummary', params: { id: entityId } }"
|
:to="{ name: 'EntrySummary', params: { id: entityId } }"
|
||||||
class="header link"
|
class="header link"
|
||||||
:href="entryUrl"
|
:href="entryUrl"
|
||||||
|
@ -184,7 +185,10 @@ const fetchEntryBuys = async () => {
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
||||||
<VnLv :label="t('entry.summary.currency')" :value="entry.currency.name" />
|
<VnLv
|
||||||
|
:label="t('entry.summary.currency')"
|
||||||
|
:value="entry.currency?.name"
|
||||||
|
/>
|
||||||
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
|
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
|
||||||
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
|
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -210,12 +214,12 @@ const fetchEntryBuys = async () => {
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelAgency')"
|
:label="t('entry.summary.travelAgency')"
|
||||||
:value="entry.travel.agency.name"
|
:value="entry.travel.agency?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
|
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelWarehouseOut')"
|
:label="t('entry.summary.travelWarehouseOut')"
|
||||||
:value="entry.travel.warehouseOut.name"
|
:value="entry.travel.warehouseOut?.name"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelDelivered')"
|
:label="t('entry.summary.travelDelivered')"
|
||||||
|
@ -225,7 +229,7 @@ const fetchEntryBuys = async () => {
|
||||||
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
|
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelWarehouseIn')"
|
:label="t('entry.summary.travelWarehouseIn')"
|
||||||
:value="entry.travel.warehouseIn.name"
|
:value="entry.travel.warehouseIn?.name"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelReceived')"
|
:label="t('entry.summary.travelReceived')"
|
||||||
|
@ -281,17 +285,17 @@ const fetchEntryBuys = async () => {
|
||||||
>
|
>
|
||||||
<template #body="{ cols, row, rowIndex }">
|
<template #body="{ cols, row, rowIndex }">
|
||||||
<QTr no-hover>
|
<QTr no-hover>
|
||||||
<QTd v-for="col in cols" :key="col.name">
|
<QTd v-for="col in cols" :key="col?.name">
|
||||||
<component
|
<component
|
||||||
:is="tableColumnComponents[col.name].component(props)"
|
:is="tableColumnComponents[col?.name].component()"
|
||||||
v-bind="tableColumnComponents[col.name].props(props)"
|
v-bind="tableColumnComponents[col?.name].props()"
|
||||||
@click="tableColumnComponents[col.name].event(props)"
|
@click="tableColumnComponents[col?.name].event()"
|
||||||
class="col-content"
|
class="col-content"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
v-if="
|
v-if="
|
||||||
col.name !== 'observation' &&
|
col?.name !== 'observation' &&
|
||||||
col.name !== 'isConfirmed'
|
col?.name !== 'isConfirmed'
|
||||||
"
|
"
|
||||||
>{{ col.value }}</template
|
>{{ col.value }}</template
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, onUnmounted, ref } from 'vue';
|
import { onMounted, onUnmounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
|
||||||
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
import { toDate } from 'src/filters';
|
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
||||||
|
|
||||||
|
@ -18,6 +19,7 @@ defineProps({
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
const itemTypeWorkersOptions = ref([]);
|
||||||
const suppliersOptions = ref([]);
|
const suppliersOptions = ref([]);
|
||||||
|
const tagValues = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -0,0 +1,293 @@
|
||||||
|
<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,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'center',
|
||||||
|
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({
|
||||||
|
fields: ['id', 'm3', 'warehouseInFk'],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'warehouseIn',
|
||||||
|
scope: {
|
||||||
|
fields: ['code'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
where: {
|
||||||
|
shipped: (userParams.value.dated
|
||||||
|
? new Date(userParams.value.dated)
|
||||||
|
: Date.vnNew()
|
||||||
|
).setHours(0, 0, 0, 0),
|
||||||
|
m3: { neq: null },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setFooter(data) {
|
||||||
|
const footer = {
|
||||||
|
bought: 0,
|
||||||
|
reserve: 0,
|
||||||
|
};
|
||||||
|
data.forEach((row) => {
|
||||||
|
footer.bought += row?.bought;
|
||||||
|
footer.reserve += row?.reserve;
|
||||||
|
});
|
||||||
|
tableRef.value.footer = footer;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnSubToolbar>
|
||||||
|
<template #st-data>
|
||||||
|
<FetchData
|
||||||
|
ref="fetchDataRef"
|
||||||
|
url="Travels"
|
||||||
|
auto-load
|
||||||
|
:filter="filter"
|
||||||
|
@on-fetch="
|
||||||
|
(data) => {
|
||||||
|
travel = data.find((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?.m3 }}
|
||||||
|
</span>
|
||||||
|
<QBtn
|
||||||
|
v-if="travel?.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?.id}`"
|
||||||
|
model="travel"
|
||||||
|
:title="t('Travel m3')"
|
||||||
|
:form-initial-data="{ id: travel?.id, m3: travel?.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>
|
||||||
|
<div class="table-container">
|
||||||
|
<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"
|
||||||
|
@on-fetch="(data) => setFooter(data)"
|
||||||
|
: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>
|
||||||
|
<template #column-bought="{ row }">
|
||||||
|
<span :class="{ 'text-negative': row.reserve < row.bought }">
|
||||||
|
{{ row?.bought }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-footer-reserve>
|
||||||
|
<span>
|
||||||
|
{{ tableRef.footer.reserve }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-footer-bought>
|
||||||
|
<span
|
||||||
|
:class="{
|
||||||
|
'text-negative':
|
||||||
|
tableRef.footer.reserve < tableRef.footer.bought,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ tableRef.footer.bought }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</QPage>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.travel {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
.table-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
.text-negative {
|
||||||
|
color: $negative !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<i18n>
|
||||||
|
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,129 @@
|
||||||
|
<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: t('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,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'volume',
|
||||||
|
label: t('Volume'),
|
||||||
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('Packaging'),
|
||||||
|
name: 'packagingFk',
|
||||||
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: 'Packing',
|
||||||
|
name: 'packing',
|
||||||
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QDialog>
|
||||||
|
<div class="container">
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="StockBoughtsDetail"
|
||||||
|
:url="customUrl"
|
||||||
|
order="itemName DESC"
|
||||||
|
:columns="columns"
|
||||||
|
:right-search="false"
|
||||||
|
:disable-infinite-scroll="true"
|
||||||
|
:limit="0"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #top-left>
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
icon="Close"
|
||||||
|
color="primary"
|
||||||
|
class="bg-vn-section-color q-pa-xs"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #column-entryFk="{ row }">
|
||||||
|
<span class="link">
|
||||||
|
{{ row?.entryFk }}
|
||||||
|
<EntryDescriptorProxy :id="row.entryFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-itemName="{ row }">
|
||||||
|
<span class="link">
|
||||||
|
{{ row?.itemName }}
|
||||||
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</div>
|
||||||
|
</QDialog>
|
||||||
|
</template>
|
||||||
|
<style lang="css" scoped>
|
||||||
|
.container {
|
||||||
|
max-width: 50vw;
|
||||||
|
overflow: auto;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Buyer: Comprador
|
||||||
|
Reserve: Reservado
|
||||||
|
Bought: Comprado
|
||||||
|
More: Más
|
||||||
|
Date: Fecha
|
||||||
|
Entry: Entrada
|
||||||
|
Item: Artículo
|
||||||
|
Name: Nombre
|
||||||
|
Volume: Volumen
|
||||||
|
Packaging: Embalage
|
||||||
|
</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()"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
||||||
|
import InvoiceOutSummary from './InvoiceOutSummary.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -10,6 +11,10 @@ const $props = defineProps({
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<InvoiceOutDescriptor v-if="$props.id" :id="$props.id" />
|
<InvoiceOutDescriptor
|
||||||
|
v-if="$props.id"
|
||||||
|
:id="$props.id"
|
||||||
|
:summary="InvoiceOutSummary"
|
||||||
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -36,23 +36,23 @@ const user = state.getUser();
|
||||||
const fixedPrices = ref([]);
|
const fixedPrices = ref([]);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
|
|
||||||
const itemFixedPriceFilterRef = ref();
|
const itemFixedPriceFilterRef = ref();
|
||||||
|
|
||||||
const params = reactive({});
|
const params = reactive({});
|
||||||
const defaultColumnAttrs = {
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
};
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
params.warehouseFk = user.value.warehouseFk;
|
params.warehouseFk = user.value.warehouseFk;
|
||||||
});
|
});
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
|
const defaultColumnAttrs = {
|
||||||
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
};
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('item.fixedPrice.itemId'),
|
label: t('item.fixedPrice.itemFk'),
|
||||||
name: 'itemId',
|
name: 'itemFk',
|
||||||
...defaultColumnAttrs,
|
...defaultColumnAttrs,
|
||||||
isId: true,
|
isId: true,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -426,7 +426,7 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
:default-save="false"
|
:default-save="false"
|
||||||
data-key="ItemFixedPrices"
|
data-key="ItemFixedPrices"
|
||||||
url="FixedPrices/filter"
|
url="FixedPrices/filter"
|
||||||
:order="['itemFk ASC']"
|
:order="['description DESC']"
|
||||||
save-url="FixedPrices/crud"
|
save-url="FixedPrices/crud"
|
||||||
:user-params="{ warehouseFk: user.warehouseFk }"
|
:user-params="{ warehouseFk: user.warehouseFk }"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
@ -460,7 +460,7 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
<QCheckbox flat v-model="scope.selected" />
|
<QCheckbox flat v-model="scope.selected" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-itemId="props">
|
<template #column-itemFk="props">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
style="max-width: 100px"
|
style="max-width: 100px"
|
||||||
url="Items/withName"
|
url="Items/withName"
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -139,7 +139,11 @@ const columns = computed(() => [
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.full-width .vn-row > * {
|
.full-width .vn-row {
|
||||||
flex: 0.4;
|
margin-bottom: 0;
|
||||||
|
flex-direction: row;
|
||||||
|
> * {
|
||||||
|
max-width: 125px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -132,7 +132,6 @@ const openTab = (id) =>
|
||||||
:table="{
|
:table="{
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
'hide-bottom': true,
|
|
||||||
}"
|
}"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
:row-click="({ id }) => openTab(id)"
|
:row-click="({ id }) => openTab(id)"
|
||||||
|
|
|
@ -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"
|
||||||
>
|
>
|
||||||
|
|
|
@ -54,7 +54,6 @@ const columns = computed(() => [
|
||||||
label: t('salesTicketsTable.problems'),
|
label: t('salesTicketsTable.problems'),
|
||||||
name: 'totalProblems',
|
name: 'totalProblems',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
dense: true,
|
||||||
|
@ -65,7 +64,6 @@ const columns = computed(() => [
|
||||||
name: 'id',
|
name: 'id',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
|
@ -108,9 +106,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('salesTicketsTable.date'),
|
label: t('salesTicketsTable.date'),
|
||||||
name: 'shippedDate',
|
name: 'shippedDate',
|
||||||
style: { 'max-width': '100px' },
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'date',
|
component: 'date',
|
||||||
name: 'shippedDate',
|
name: 'shippedDate',
|
||||||
|
@ -164,7 +160,6 @@ const columns = computed(() => [
|
||||||
label: t('salesTicketsTable.state'),
|
label: t('salesTicketsTable.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
style: { 'max-width': '100px' },
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
name: 'stateFk',
|
name: 'stateFk',
|
||||||
|
@ -193,7 +188,6 @@ const columns = computed(() => [
|
||||||
label: t('salesTicketsTable.zone'),
|
label: t('salesTicketsTable.zone'),
|
||||||
name: 'zoneFk',
|
name: 'zoneFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
name: 'zoneFk',
|
name: 'zoneFk',
|
||||||
|
@ -210,8 +204,6 @@ const columns = computed(() => [
|
||||||
name: 'totalWithVat',
|
name: 'totalWithVat',
|
||||||
field: 'totalWithVat',
|
field: 'totalWithVat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
style: { 'max-width': '75px' },
|
|
||||||
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
name: 'totalWithVat',
|
name: 'totalWithVat',
|
||||||
|
@ -370,7 +362,7 @@ const openTab = (id) =>
|
||||||
</QCheckbox>
|
</QCheckbox>
|
||||||
</template>
|
</template>
|
||||||
<template #column-totalProblems="{ row }">
|
<template #column-totalProblems="{ row }">
|
||||||
<QTd class="no-padding" style="max-width: 60px">
|
<span>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isTaxDataChecked === 0"
|
v-if="row.isTaxDataChecked === 0"
|
||||||
name="vn:no036"
|
name="vn:no036"
|
||||||
|
@ -424,30 +416,27 @@ const openTab = (id) =>
|
||||||
>
|
>
|
||||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-id="{ row }">
|
<template #column-id="{ row }">
|
||||||
<QTd class="no-padding">
|
|
||||||
<span class="link" @click.stop.prevent>
|
<span class="link" @click.stop.prevent>
|
||||||
{{ row.id }}
|
{{ row.id }}
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
</span>
|
</span>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-clientFk="{ row }">
|
<template #column-clientFk="{ row }">
|
||||||
<QTd class="no-padding" @click.stop :title="row.nickname">
|
<div @click.stop :title="row.nickname">
|
||||||
<span class="link">{{ row.nickname }}</span>
|
<span class="link" v-text="row.nickname" />
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</QTd>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-salesPersonFk="{ row }">
|
<template #column-salesPersonFk="{ row }">
|
||||||
<QTd class="no-padding" @click.stop :title="row.userName">
|
<div @click.stop :title="row.userName">
|
||||||
<span class="link" v-text="dashIfEmpty(row.userName)" />
|
<span class="link" v-text="dashIfEmpty(row.userName)" />
|
||||||
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
||||||
</QTd>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-shippedDate="{ row }">
|
<template #column-shippedDate="{ row }">
|
||||||
<QTd class="no-padding">
|
|
||||||
<QBadge
|
<QBadge
|
||||||
v-bind="getBadgeAttrs(row.shippedDate)"
|
v-bind="getBadgeAttrs(row.shippedDate)"
|
||||||
class="q-pa-sm"
|
class="q-pa-sm"
|
||||||
|
@ -455,15 +444,12 @@ const openTab = (id) =>
|
||||||
>
|
>
|
||||||
{{ formatShippedDate(row.shippedDate) }}
|
{{ formatShippedDate(row.shippedDate) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-provinceFk="{ row }">
|
<template #column-provinceFk="{ row }">
|
||||||
<QTd class="no-padding">
|
|
||||||
<span :title="row.province" v-text="row.province" />
|
<span :title="row.province" v-text="row.province" />
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-state="{ row }">
|
<template #column-state="{ row }">
|
||||||
<QTd class="no-padding" @click.stop.prevent>
|
<div @click.stop.prevent>
|
||||||
<div v-if="row.refFk">
|
<div v-if="row.refFk">
|
||||||
<span class="link">{{ row.refFk }}</span>
|
<span class="link">{{ row.refFk }}</span>
|
||||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||||
|
@ -477,23 +463,20 @@ const openTab = (id) =>
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-isFragile="{ row }">
|
<template #column-isFragile="{ row }">
|
||||||
<QTd class="no-padding">
|
|
||||||
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
|
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
|
||||||
<QTooltip>{{ $t('salesTicketsTable.isFragile') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.isFragile') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-zoneFk="{ row }">
|
<template #column-zoneFk="{ row }">
|
||||||
<QTd class="no-padding" @click.stop.prevent :title="row.zoneName">
|
<div @click.stop.prevent :title="row.zoneName">
|
||||||
<span class="link">{{ row.zoneName }}</span>
|
<span class="link">{{ row.zoneName }}</span>
|
||||||
<ZoneDescriptorProxy :id="row.zoneFk" />
|
<ZoneDescriptorProxy :id="row.zoneFk" />
|
||||||
</QTd>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-totalWithVat="{ row }">
|
<template #column-totalWithVat="{ row }">
|
||||||
<QTd class="no-padding">
|
|
||||||
<QBadge
|
<QBadge
|
||||||
:color="totalPriceColor(row) || 'transparent'"
|
:color="totalPriceColor(row) || 'transparent'"
|
||||||
:text-color="totalPriceColor(row) ? 'black' : 'white'"
|
:text-color="totalPriceColor(row) ? 'black' : 'white'"
|
||||||
|
@ -502,7 +485,11 @@ const openTab = (id) =>
|
||||||
>
|
>
|
||||||
{{ toCurrency(row.totalWithVat) }}
|
{{ toCurrency(row.totalWithVat) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
td .q-icon {
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -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({})"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -249,7 +249,7 @@ watch(
|
||||||
@on-fetch="(data) => (orderSummary.vat = data)"
|
@on-fetch="(data) => (orderSummary.vat = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
|
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||||
<QCard
|
<QCard
|
||||||
class="order-lines-summary q-pa-lg"
|
class="order-lines-summary q-pa-lg"
|
||||||
v-if="orderSummary.vat && orderSummary.total"
|
v-if="orderSummary.vat && orderSummary.total"
|
||||||
|
|
|
@ -14,14 +14,15 @@ import OrderFilter from './Card/OrderFilter.vue';
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const agencyList = ref([]);
|
const agencyList = ref([]);
|
||||||
const addressesList = ref([]);
|
const addressesList = ref([]);
|
||||||
const clientId = ref();
|
const route = useRoute();
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -169,6 +170,13 @@ const getDateColor = (date) => {
|
||||||
if (comparation == 0) return 'bg-warning';
|
if (comparation == 0) return 'bg-warning';
|
||||||
if (comparation < 0) return 'bg-success';
|
if (comparation < 0) return 'bg-success';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (!route.query.createForm) return;
|
||||||
|
const clientId = route.query.createForm;
|
||||||
|
const id = JSON.parse(clientId);
|
||||||
|
fetchClientAddress(id.clientFk, id);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<OrderSearchbar />
|
<OrderSearchbar />
|
||||||
|
@ -184,13 +192,14 @@ const getDateColor = (date) => {
|
||||||
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
|
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Orders/new',
|
urlCreate: 'Orders/new',
|
||||||
title: 'Create Order',
|
title: t('module.cerateOrder'),
|
||||||
onDataSaved: (url) => {
|
onDataSaved: (url) => {
|
||||||
tableRef.redirect(url);
|
tableRef.redirect(url);
|
||||||
},
|
},
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
active: true,
|
active: true,
|
||||||
addressId: null,
|
addressId: null,
|
||||||
|
clientFk: null,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:user-params="{ showEmpty: false }"
|
:user-params="{ showEmpty: false }"
|
||||||
|
@ -221,7 +230,7 @@ const getDateColor = (date) => {
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Clients"
|
url="Clients"
|
||||||
:include="{ relation: 'addresses' }"
|
:include="{ relation: 'addresses' }"
|
||||||
v-model="clientId"
|
v-model="data.clientFk"
|
||||||
:label="t('module.customer')"
|
:label="t('module.customer')"
|
||||||
@update:model-value="(id) => fetchClientAddress(id, data)"
|
@update:model-value="(id) => fetchClientAddress(id, data)"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -10,6 +10,7 @@ module:
|
||||||
total: Total
|
total: Total
|
||||||
salesPerson: Sales Person
|
salesPerson: Sales Person
|
||||||
address: Address
|
address: Address
|
||||||
|
cerateOrder: Create order
|
||||||
lines:
|
lines:
|
||||||
item: Item
|
item: Item
|
||||||
warehouse: Warehouse
|
warehouse: Warehouse
|
||||||
|
|
|
@ -10,6 +10,7 @@ module:
|
||||||
total: Total
|
total: Total
|
||||||
salesPerson: Comercial
|
salesPerson: Comercial
|
||||||
address: Dirección
|
address: Dirección
|
||||||
|
cerateOrder: Crear cesta
|
||||||
lines:
|
lines:
|
||||||
item: Artículo
|
item: Artículo
|
||||||
warehouse: Almacén
|
warehouse: Almacén
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -75,6 +75,19 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('supplier.list.tableVisibleColumns.country'),
|
||||||
|
name: 'country',
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'countryFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'countries',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
@ -115,7 +114,7 @@ const totalNewPrice = computed(() => {
|
||||||
const totalDifference = computed(() => {
|
const totalDifference = computed(() => {
|
||||||
return rows.value.reduce((acc, item) => acc + item.component?.difference || 0, 0);
|
return rows.value.reduce((acc, item) => acc + item.component?.difference || 0, 0);
|
||||||
});
|
});
|
||||||
const showMovablecolumn = computed(() => (haveDifferences.value > 0 ? ['movable'] : []));
|
const showMovableColumn = computed(() => (haveDifferences.value > 0 ? ['movable'] : []));
|
||||||
const haveDifferences = computed(() => _ticketData.value.sale?.haveDifferences);
|
const haveDifferences = computed(() => _ticketData.value.sale?.haveDifferences);
|
||||||
const ticketHaveNegatives = () => {
|
const ticketHaveNegatives = () => {
|
||||||
let _haveNegatives = false;
|
let _haveNegatives = false;
|
||||||
|
@ -145,8 +144,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
@on-fetch="(data) => (ticketUpdateActions = data)"
|
@on-fetch="(data) => (ticketUpdateActions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||||
<template #right-panel>
|
|
||||||
<QCard
|
<QCard
|
||||||
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
||||||
bordered
|
bordered
|
||||||
|
@ -158,18 +156,18 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
{{ t('basicData.total') }}
|
{{ t('basicData.total') }}
|
||||||
</span>
|
</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="column items-center" horizontal>
|
<QCardSection class="column items-left" horizontal>
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.price') }}:
|
{{ t('basicData.price') }}:
|
||||||
{{ toCurrency(totalPrice) }}
|
{{ toCurrency(totalPrice) }}
|
||||||
</span>
|
</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="column items-center" horizontal>
|
<QCardSection class="column items-left" horizontal>
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.newPrice') }}: {{ toCurrency(totalNewPrice) }}
|
{{ t('basicData.newPrice') }}: {{ toCurrency(totalNewPrice) }}
|
||||||
</span>
|
</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="column items-center" horizontal>
|
<QCardSection class="column items-left" horizontal>
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.difference') }}: {{ toCurrency(totalDifference) }}
|
{{ t('basicData.difference') }}: {{ toCurrency(totalDifference) }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -220,10 +218,9 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</QDrawer>
|
||||||
</RightMenu>
|
|
||||||
<QTable
|
<QTable
|
||||||
:visible-columns="showMovablecolumn"
|
:visible-columns="showMovableColumn"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
@ -233,15 +230,15 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
flat
|
flat
|
||||||
>
|
>
|
||||||
<template #body-cell-item="{ row }">
|
<template #body-cell-item="{ row }">
|
||||||
<QTd>
|
<QTd @click.stop class="link">
|
||||||
<QBtn flat color="primary">
|
<QBtn flat>
|
||||||
{{ row.itemFk }}
|
{{ row.itemFk }}
|
||||||
<ItemDescriptorProxy :id="row.itemFk" />
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-description="{ row }">
|
<template #body-cell-description="{ row }">
|
||||||
<QTd>
|
<QTd style="display: contents">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<span>{{ row.item.name }}</span>
|
<span>{{ row.item.name }}</span>
|
||||||
<span class="color-vn-label">{{ row.item.subName }}</span>
|
<span class="color-vn-label">{{ row.item.subName }}</span>
|
|
@ -12,6 +12,7 @@ import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import { toTimeFormat } from 'filters/date.js';
|
import { toTimeFormat } from 'filters/date.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -23,7 +24,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['updateForm']);
|
const emit = defineEmits(['updateForm']);
|
||||||
|
const { validate } = useValidator();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -51,18 +52,18 @@ const agencyByWarehouseFilter = computed(() => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const zonesFilter = computed(() => ({
|
function zoneWhere() {
|
||||||
fields: ['id', 'name'],
|
if (formData?.value?.agencyModeFk) {
|
||||||
order: 'name ASC',
|
return formData.value?.agencyModeFk
|
||||||
where: formData.value?.agencyModeFk
|
|
||||||
? {
|
? {
|
||||||
shipped: formData.value?.shipped,
|
shipped: formData.value?.shipped,
|
||||||
addressFk: formData.value?.addressFk,
|
addressFk: formData.value?.addressFk,
|
||||||
agencyModeFk: formData.value?.agencyModeFk,
|
agencyModeFk: formData.value?.agencyModeFk,
|
||||||
warehouseFk: formData.value?.warehouseFk,
|
warehouseFk: formData.value?.warehouseFk,
|
||||||
}
|
}
|
||||||
: {},
|
: {};
|
||||||
}));
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getLanded = async (params) => {
|
const getLanded = async (params) => {
|
||||||
try {
|
try {
|
||||||
|
@ -293,13 +294,6 @@ onMounted(() => onFormModelInit());
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
ref="zonesFetchRef"
|
|
||||||
url="Zones/includingExpired"
|
|
||||||
:filter="zonesFilter"
|
|
||||||
@on-fetch="(data) => (zonesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<QForm>
|
<QForm>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -313,6 +307,7 @@ onMounted(() => onFormModelInit());
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.client')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -333,6 +328,7 @@ onMounted(() => onFormModelInit());
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.warehouse')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -345,6 +341,7 @@ onMounted(() => onFormModelInit());
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.address')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -392,6 +389,7 @@ onMounted(() => onFormModelInit());
|
||||||
:label="t('basicData.alias')"
|
:label="t('basicData.alias')"
|
||||||
v-model="formData.nickname"
|
v-model="formData.nickname"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.alias')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md no-wrap">
|
<VnRow class="row q-gutter-md q-mb-md no-wrap">
|
||||||
|
@ -404,6 +402,7 @@ onMounted(() => onFormModelInit());
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.company')"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('basicData.agency')"
|
:label="t('basicData.agency')"
|
||||||
|
@ -414,17 +413,22 @@ onMounted(() => onFormModelInit());
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
@focus="agencyFetchRef.fetch()"
|
@focus="agencyFetchRef.fetch()"
|
||||||
|
:rules="validate('basicData.agency')"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('basicData.zone')"
|
:label="t('basicData.zone')"
|
||||||
v-model="zoneId"
|
v-model="zoneId"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="zonesOptions"
|
url="Zones/includingExpired"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
sort-by="id"
|
||||||
|
:where="zoneWhere"
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
@focus="zonesFetchRef.fetch()"
|
@focus="zonesFetchRef.fetch()"
|
||||||
|
:rules="validate('basicData.zone')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -444,16 +448,19 @@ onMounted(() => onFormModelInit());
|
||||||
:label="t('basicData.shipped')"
|
:label="t('basicData.shipped')"
|
||||||
v-model="formData.shipped"
|
v-model="formData.shipped"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.shipped')"
|
||||||
/>
|
/>
|
||||||
<VnInputTime
|
<VnInputTime
|
||||||
:label="t('basicData.shippedHour')"
|
:label="t('basicData.shippedHour')"
|
||||||
v-model="formData.shipped"
|
v-model="formData.shipped"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.shippedHour')"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('basicData.landed')"
|
:label="t('basicData.landed')"
|
||||||
v-model="formData.landed"
|
v-model="formData.landed"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:rules="validate('basicData.landed')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</QForm>
|
</QForm>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ref, onBeforeMount } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import BasicDataTable from './BasicDataTable.vue';
|
import TicketBasicData from './TicketBasicData.vue';
|
||||||
import TicketBasicDataForm from './TicketBasicDataForm.vue';
|
import TicketBasicDataForm from './TicketBasicDataForm.vue';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
|
||||||
|
@ -158,7 +158,10 @@ onBeforeMount(async () => await getTicketData());
|
||||||
color="primary"
|
color="primary"
|
||||||
animated
|
animated
|
||||||
keep-alive
|
keep-alive
|
||||||
style="max-width: 800px; margin: auto"
|
style="margin: auto"
|
||||||
|
:style="{
|
||||||
|
'max-width': step > 1 ? 'none' : '800px',
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<QStep :name="1" :title="t('globals.pageTitles.basicData')" :done="step > 1">
|
<QStep :name="1" :title="t('globals.pageTitles.basicData')" :done="step > 1">
|
||||||
<TicketBasicDataForm
|
<TicketBasicDataForm
|
||||||
|
@ -168,7 +171,7 @@ onBeforeMount(async () => await getTicketData());
|
||||||
/>
|
/>
|
||||||
</QStep>
|
</QStep>
|
||||||
<QStep :name="2" :title="t('basicData.priceDifference')">
|
<QStep :name="2" :title="t('basicData.priceDifference')">
|
||||||
<BasicDataTable
|
<TicketBasicData
|
||||||
:form-data="formData"
|
:form-data="formData"
|
||||||
v-model:haveNegatives="haveNegatives"
|
v-model:haveNegatives="haveNegatives"
|
||||||
@update-form="($event) => (formData = $event)"
|
@update-form="($event) => (formData = $event)"
|
||||||
|
|
|
@ -31,6 +31,7 @@ const router = useRouter();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const newTicketFormData = reactive({});
|
const newTicketFormData = reactive({});
|
||||||
|
const date = new Date();
|
||||||
|
|
||||||
const createTicket = async () => {
|
const createTicket = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -64,7 +65,11 @@ const createTicket = async () => {
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInputDate :label="t('expedition.landed')" v-model="data.landed" />
|
<VnInputDate
|
||||||
|
:label="t('expedition.landed')"
|
||||||
|
v-model="data.landed"
|
||||||
|
:model-value="date"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -5,15 +5,16 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { toCurrency } from 'filters/index';
|
import { toCurrency } from 'filters/index';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -75,22 +76,39 @@ const columns = computed(() => [
|
||||||
name: 'item',
|
name: 'item',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('lines.image'),
|
||||||
|
name: 'image',
|
||||||
|
columnField: {
|
||||||
|
component: VnImg,
|
||||||
|
attrs: (id) => {
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
width: '50px',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketComponents.description'),
|
label: t('ticketComponents.description'),
|
||||||
name: 'description',
|
name: 'description',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
columnClass: 'expand',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketComponents.quantity'),
|
label: t('ticketComponents.quantity'),
|
||||||
name: 'quantity',
|
name: 'quantity',
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row) => dashIfEmpty(row.quantity),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketComponents.serie'),
|
label: t('ticketComponents.serie'),
|
||||||
name: 'serie',
|
name: 'serie',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
format: (row) => dashIfEmpty(row.serie),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketComponents.components'),
|
label: t('ticketComponents.components'),
|
||||||
|
@ -174,14 +192,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
@on-fetch="(data) => (components = data)"
|
@on-fetch="(data) => (components = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||||
<template #right-panel>
|
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
||||||
<QCard
|
|
||||||
class="q-pa-sm color-vn-text"
|
|
||||||
bordered
|
|
||||||
flat
|
|
||||||
style="border-color: black"
|
|
||||||
>
|
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.total') }}
|
{{ t('ticketComponents.total') }}
|
||||||
|
@ -200,12 +212,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
<span>{{ toCurrency(getTotal) }}</span>
|
<span>{{ toCurrency(getTotal) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard
|
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
||||||
class="q-pa-sm color-vn-text"
|
|
||||||
bordered
|
|
||||||
flat
|
|
||||||
style="border-color: black"
|
|
||||||
>
|
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.components') }}
|
{{ t('ticketComponents.components') }}
|
||||||
|
@ -224,12 +231,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
}}</span>
|
}}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard
|
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
||||||
class="q-pa-sm color-vn-text"
|
|
||||||
bordered
|
|
||||||
flat
|
|
||||||
style="border-color: black"
|
|
||||||
>
|
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.zoneBreakdown') }}
|
{{ t('ticketComponents.zoneBreakdown') }}
|
||||||
|
@ -269,12 +271,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard
|
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
||||||
class="q-pa-sm color-vn-text"
|
|
||||||
bordered
|
|
||||||
flat
|
|
||||||
style="border-color: black"
|
|
||||||
>
|
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.theoricalCost') }}
|
{{ t('ticketComponents.theoricalCost') }}
|
||||||
|
@ -287,68 +284,74 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</QDrawer>
|
||||||
</RightMenu>
|
<VnTable
|
||||||
<QTable
|
ref="tableRef"
|
||||||
:rows="components"
|
data-key="TicketComponents"
|
||||||
|
url="Sales"
|
||||||
|
:user-filter="salesFilter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
:right-search="false"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
auto-load
|
||||||
class="full-width q-mt-md"
|
:disable-option="{ card: true }"
|
||||||
:no-data-label="t('globals.noResults')"
|
:column-search="false"
|
||||||
>
|
>
|
||||||
<template #body-cell-item="{ row }">
|
<template #column-item="{ row }">
|
||||||
<QTd>
|
<span @click.stop flat class="link">
|
||||||
<QBtn flat color="primary">
|
{{ row.itemFk }}
|
||||||
<span class="link">{{ row.itemFk }}</span>
|
|
||||||
<ItemDescriptorProxy :id="row.itemFk" />
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
</QBtn>
|
</span>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-description="{ row }">
|
<template #column-image="{ row }">
|
||||||
<QTd>
|
<div class="image-wrapper">
|
||||||
|
<VnImg :id="parseInt(row?.item?.id)" class="rounded" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #column-description="{ row }">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<span>{{ row.item.name }}</span>
|
<span>{{ row.item.name }}</span>
|
||||||
<span class="color-vn-label">{{ row.item.subName }}</span>
|
<span class="color-vn-label">{{ row.item.subName }}</span>
|
||||||
<FetchedTags :item="row.item" />
|
<FetchedTags :item="row.item" />
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-serie="{ row }">
|
<template #column-serie="{ row }">
|
||||||
<QTd>
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||||
{{ saleComponent.component?.componentType?.name }}
|
{{ saleComponent.component?.componentType?.name }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-components="{ row }">
|
<template #column-components="{ row }">
|
||||||
<QTd>
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||||
{{ saleComponent.component?.name }}
|
{{ saleComponent.component?.name }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-import="{ row }">
|
<template #column-import="{ row }">
|
||||||
<QTd>
|
<div class="column text-left">
|
||||||
<div class="column text-right">
|
|
||||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||||
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
|
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-total="{ row }">
|
<template #column-total="{ row }">
|
||||||
<QTd>
|
<div class="column">
|
||||||
<div class="column text-right">
|
|
||||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||||
{{ toCurrency(saleComponent.value * row.quantity, 'EUR', 3) }}
|
{{ toCurrency(saleComponent.value * row.quantity, 'EUR', 3) }}
|
||||||
|
<!-- <QTooltip>
|
||||||
|
{{ saleComponent.component?.name }}:
|
||||||
|
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
|
||||||
|
</QTooltip> -->
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.image-wrapper {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toDate } from 'src/filters';
|
|
||||||
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
|
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -30,13 +30,24 @@ const filter = {
|
||||||
{
|
{
|
||||||
relation: 'address',
|
relation: 'address',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name', 'mobile', 'phone'],
|
fields: ['id', 'name', 'mobile', 'phone', 'incotermsFk'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
relation: 'client',
|
relation: 'client',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'name', 'salesPersonFk', 'phone', 'mobile', 'email'],
|
fields: [
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
'salesPersonFk',
|
||||||
|
'phone',
|
||||||
|
'mobile',
|
||||||
|
'email',
|
||||||
|
'isActive',
|
||||||
|
'isFreezed',
|
||||||
|
'isTaxDataChecked',
|
||||||
|
'hasElectronicInvoice',
|
||||||
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'user',
|
relation: 'user',
|
||||||
|
@ -87,6 +98,10 @@ const filter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
|
|
||||||
|
function ticketFilter(ticket) {
|
||||||
|
return JSON.stringify({ clientFk: ticket.clientFk });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -128,7 +143,10 @@ const data = ref(useCardDescription());
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
|
<VnLv
|
||||||
|
:label="t('ticket.card.shipped')"
|
||||||
|
:value="toDateTimeFormat(entity.shipped)"
|
||||||
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
v-if="entity.agencyMode"
|
v-if="entity.agencyMode"
|
||||||
:label="t('ticket.card.agency')"
|
:label="t('ticket.card.agency')"
|
||||||
|
@ -138,7 +156,39 @@ const data = ref(useCardDescription());
|
||||||
<VnLv :label="t('ticket.card.alias')" :value="entity.nickname" />
|
<VnLv :label="t('ticket.card.alias')" :value="entity.nickname" />
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions class="q-gutter-x-xs">
|
||||||
|
<QIcon
|
||||||
|
v-if="entity.client.isActive == false"
|
||||||
|
name="vn:disabled"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Client inactive') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="entity.client.isFreezed == true"
|
||||||
|
name="vn:frozen"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="entity.problem.includes('hasRisk')"
|
||||||
|
name="vn:risk"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Client has debt') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="entity.client.isTaxDataChecked == false"
|
||||||
|
name="vn:no036"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('Client not checked') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="entity.isDeleted == true"
|
v-if="entity.isDeleted == true"
|
||||||
name="vn:deletedTicket"
|
name="vn:deletedTicket"
|
||||||
|
@ -159,6 +209,27 @@ const data = ref(useCardDescription());
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('ticket.card.customerCard') }}</QTooltip>
|
<QTooltip>{{ t('ticket.card.customerCard') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
size="md"
|
||||||
|
icon="vn:ticket"
|
||||||
|
color="primary"
|
||||||
|
:to="{ name: 'TicketList', query: { table: ticketFilter(entity) } }"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('ticket.card.ticketList') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
size="md"
|
||||||
|
icon="vn:basketadd"
|
||||||
|
color="primary"
|
||||||
|
:to="{
|
||||||
|
name: 'OrderList',
|
||||||
|
query: {
|
||||||
|
createForm: JSON.stringify({ clientFk: entity.clientFk }),
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('ticket.card.newOrder') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
|
@ -168,4 +239,8 @@ const data = ref(useCardDescription());
|
||||||
es:
|
es:
|
||||||
This ticket is deleted: Este ticket está eliminado
|
This ticket is deleted: Este ticket está eliminado
|
||||||
Go to module index: Ir al índice del modulo
|
Go to module index: Ir al índice del modulo
|
||||||
|
Client inactive: Cliente inactivo
|
||||||
|
Client not checked: Cliente no verificado
|
||||||
|
Client has debt: Cliente con deuda
|
||||||
|
Client Frozen: Cliente congelado
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { ref } from 'vue';
|
import { ref, toRefs } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
@ -9,6 +9,11 @@ import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import VnSmsDialog from 'components/common/VnSmsDialog.vue';
|
import VnSmsDialog from 'components/common/VnSmsDialog.vue';
|
||||||
import toDate from 'filters/toDate';
|
import toDate from 'filters/toDate';
|
||||||
|
import FormPopup from 'components/FormPopup.vue';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
@ -24,8 +29,16 @@ const { dialog, notify } = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openReport, sendEmail } = usePrintService();
|
const { openReport, sendEmail } = usePrintService();
|
||||||
const ticketSummary = useArrayData('TicketSummary');
|
const ticketSummary = useArrayData('TicketSummary');
|
||||||
const ticket = ref(props.ticket);
|
const { ticket } = toRefs(props);
|
||||||
const ticketId = currentRoute.value.params.id;
|
const ticketId = currentRoute.value.params.id;
|
||||||
|
const client = ref();
|
||||||
|
const showTransferDialog = ref(false);
|
||||||
|
const showTurnDialog = ref(false);
|
||||||
|
const showChangeTimeDialog = ref(false);
|
||||||
|
const dialogRef = ref();
|
||||||
|
const isEditable = ref();
|
||||||
|
const hasInvoicing = useAcl('invoicing');
|
||||||
|
const hasPdf = ref();
|
||||||
const weight = ref();
|
const weight = ref();
|
||||||
const actions = {
|
const actions = {
|
||||||
clone: async () => {
|
clone: async () => {
|
||||||
|
@ -76,6 +89,7 @@ const actions = {
|
||||||
notify({
|
notify({
|
||||||
message: t('You can undo this action within the first hour'),
|
message: t('You can undo this action within the first hour'),
|
||||||
icon: 'info',
|
icon: 'info',
|
||||||
|
type: 'warning',
|
||||||
});
|
});
|
||||||
|
|
||||||
push({ name: 'TicketList' });
|
push({ name: 'TicketList' });
|
||||||
|
@ -87,10 +101,14 @@ const actions = {
|
||||||
|
|
||||||
function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
|
function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
|
||||||
const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`;
|
const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`;
|
||||||
openReport(path, {
|
openReport(
|
||||||
|
path,
|
||||||
|
{
|
||||||
recipientId: ticket.value.clientFk,
|
recipientId: ticket.value.clientFk,
|
||||||
type: type,
|
type: type,
|
||||||
});
|
},
|
||||||
|
'_blank'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') {
|
function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') {
|
||||||
|
@ -173,34 +191,280 @@ function openConfirmDialog(callback) {
|
||||||
dialog({
|
dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
title: t('This ticket will be removed from current route! Continue anyway?'),
|
||||||
|
message: t('You are going to delete this ticket'),
|
||||||
promise: actions[callback],
|
promise: actions[callback],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generatePdfDialog() {
|
||||||
|
dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
promise: generatePdfInvoice,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generatePdfInvoice() {
|
||||||
|
const { data } = await axios.get('invoiceOuts', {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
where: { ref: ticket.value.refFk },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const invoiceId = data[0].id;
|
||||||
|
const { response } = await axios.post(`InvoiceOuts/${invoiceId}/createPdf`);
|
||||||
|
if (!response) {
|
||||||
|
notify({
|
||||||
|
message: 'The invoice PDF document has been regenerated',
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeInvoiceDialog() {
|
||||||
|
dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('Are you sure you want to invoice this ticket?'),
|
||||||
|
message: t('You are going to invoice this ticket'),
|
||||||
|
promise: makeInvoice,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function makeInvoice() {
|
||||||
|
const params = {
|
||||||
|
ticketsIds: [parseInt(ticketId)],
|
||||||
|
};
|
||||||
|
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
|
||||||
|
|
||||||
|
notify({
|
||||||
|
message: t('Ticket invoiced'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function transferClient(client) {
|
||||||
|
const params = {
|
||||||
|
clientFk: client,
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await axios.patch(`Tickets/${ticketId}/transferClient`, params);
|
||||||
|
|
||||||
|
if (data) window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addTurn(day) {
|
||||||
|
const params = {
|
||||||
|
ticketFk: parseInt(ticketId),
|
||||||
|
weekDay: day,
|
||||||
|
agencyModeFk: ticket.value.agencyModeFk,
|
||||||
|
};
|
||||||
|
await axios.patch(`TicketWeeklies`, params);
|
||||||
|
|
||||||
|
notify({
|
||||||
|
message: t('Current ticket deleted and added to shift'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createRefund(withWarehouse) {
|
||||||
|
const params = {
|
||||||
|
ticketsIds: [parseInt(ticketId)],
|
||||||
|
withWarehouse: withWarehouse,
|
||||||
|
};
|
||||||
|
const { data } = await axios.post(`Tickets/refund`, params);
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
const refundTicket = data;
|
||||||
|
|
||||||
|
push({ name: 'TicketSale', params: { id: refundTicket[0].id } });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function changeShippedHour(time) {
|
||||||
|
const params = {
|
||||||
|
shipped: time,
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await axios.post(`Tickets/${ticketId}/updateEditableTicket`, params);
|
||||||
|
|
||||||
|
if (data) window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function openRecalculateDialog() {
|
||||||
|
dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('Recalculate components'),
|
||||||
|
message: t('Are you sure you want to recalculate components?'),
|
||||||
|
promise: recalculateComponents,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function recalculateComponents() {
|
||||||
|
await axios.post(`Tickets/${ticketId}/recalculateComponents`);
|
||||||
|
notify({
|
||||||
|
message: t('Data saved'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFetchData = (data) => {
|
||||||
|
isEditable.value = data;
|
||||||
|
handleInvoiceOutData();
|
||||||
|
};
|
||||||
|
|
||||||
|
async function handleInvoiceOutData() {
|
||||||
|
const { data } = await axios.get(`InvoiceOuts`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({ where: { ref: ticket.value.refFk } }),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
hasPdf.value = data[0]?.hasPdf;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
:url="`Tickets/${ticketId}/isEditable`"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="handleFetchData"
|
||||||
|
/>
|
||||||
|
<QItem @click="showTransferDialog = !showTransferDialog" v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="content_paste" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Transfer client') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QDialog ref="dialogRef" v-model="showTransferDialog">
|
||||||
|
<FormPopup
|
||||||
|
@on-submit="transferClient(client)"
|
||||||
|
:title="t('Transfer client')"
|
||||||
|
:custom-submit-button-label="t('Transfer client')"
|
||||||
|
:default-cancel-button="false"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnSelect
|
||||||
|
url="Clients"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="client"
|
||||||
|
:label="t('Client')"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ `#${scope.opt.id} - ` }}
|
||||||
|
{{ scope.opt.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</QDialog>
|
||||||
|
<QItem @click="showTurnDialog = !showTurnDialog" v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="vn:calendar" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('addTurn') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QDialog ref="dialogRef" v-model="showTurnDialog">
|
||||||
|
<FormPopup
|
||||||
|
@on-submit="addTurn"
|
||||||
|
:title="t('What is the day of receipt of the ticket?')"
|
||||||
|
:default-submit-button="false"
|
||||||
|
:default-cancel-button="false"
|
||||||
|
style="text-align: center"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<QBtnGroup spread>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.mon')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(0)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.tue')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(1)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.wed')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(2)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.thu')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(3)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.fri')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(4)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.sat')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(5)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('weekdays.sun')"
|
||||||
|
color="primary"
|
||||||
|
@click="addTurn(6)"
|
||||||
|
v-ripple
|
||||||
|
class="weekdaysBtn"
|
||||||
|
/>
|
||||||
|
</QBtnGroup>
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</QDialog>
|
||||||
<QItem v-ripple clickable>
|
<QItem v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="picture_as_pdf" />
|
<QIcon name="picture_as_pdf" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t('Open Delivery Note...') }}</QItemSection>
|
<QItemSection>{{ t('Show Delivery Note...') }}</QItemSection>
|
||||||
<QItemSection side>
|
<QItemSection side>
|
||||||
<QIcon name="keyboard_arrow_right" />
|
<QIcon name="keyboard_arrow_right" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QMenu anchor="top end" self="top start" auto-close bordered>
|
<QMenu anchor="top end" self="top start" auto-close bordered>
|
||||||
<QList>
|
<QList>
|
||||||
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('With prices') }}</QItemSection>
|
<QItemSection>{{ t('as PDF') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('Without prices') }}</QItemSection>
|
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="openDeliveryNote('deliveryNote', 'csv')"
|
@click="openDeliveryNote('deliveryNote', 'csv')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('As CSV') }}</QItemSection>
|
<QItemSection>{{ t('as CSV') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</QMenu>
|
</QMenu>
|
||||||
|
@ -220,21 +484,21 @@ function openConfirmDialog(callback) {
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('With prices') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="sendDeliveryNoteConfirmation('withoutPrices')"
|
@click="sendDeliveryNoteConfirmation('withoutPrices')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('Without prices') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="sendDeliveryNoteConfirmation('deliveryNote', 'csv')"
|
@click="sendDeliveryNoteConfirmation('deliveryNote', 'csv')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('As CSV') }}</QItemSection>
|
<QItemSection>{{ t('Send CSV') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</QMenu>
|
</QMenu>
|
||||||
|
@ -243,8 +507,26 @@ function openConfirmDialog(callback) {
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="receipt" />
|
<QIcon name="receipt" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t('Open Proforma Invoice') }}</QItemSection>
|
<QItemSection>{{ t('Show Proforma') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="isEditable"
|
||||||
|
@click="showChangeTimeDialog = !showChangeTimeDialog"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="schedule" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Change shipped hour') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QDialog ref="dialogRef" v-model="showChangeTimeDialog">
|
||||||
|
<FormPopup @on-submit="changeShippedHour(time)" :title="t('Change shipped hour')">
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnInputTime v-model="time" :label="t('Shipped hour')" clearable />
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</QDialog>
|
||||||
<QItem v-ripple clickable>
|
<QItem v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="sms" />
|
<QIcon name="sms" />
|
||||||
|
@ -259,24 +541,72 @@ function openConfirmDialog(callback) {
|
||||||
<QItemSection>{{ t('Pending payment') }}</QItemSection>
|
<QItemSection>{{ t('Pending payment') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem @click="showSmsDialog('minAmount')" v-ripple clickable>
|
<QItem @click="showSmsDialog('minAmount')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('Minimum amount') }}</QItemSection>
|
<QItemSection>{{ t('Minimum import') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="showSmsDialogWithChanges('orderChanges')"
|
@click="showSmsDialogWithChanges('orderChanges')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('Order changes') }}</QItemSection>
|
<QItemSection>{{ t('Notify changes') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</QMenu>
|
</QMenu>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem @click="makeInvoiceDialog()" v-ripple clickable v-if="isEditable">
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="picture_as_pdf" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Make invoice') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
@click="generatePdfDialog()"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
v-if="ticket.refFk !== null && (hasInvoicing || hasPdf)"
|
||||||
|
>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="picture_as_pdf" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{
|
||||||
|
hasPdf ? t('Regenerate PDF invoice') : t('Generate PDF invoice')
|
||||||
|
}}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem @click="openConfirmDialog('clone')" v-ripple clickable>
|
<QItem @click="openConfirmDialog('clone')" v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="content_copy" />
|
<QIcon name="content_copy" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem v-if="isEditable" @click="openRecalculateDialog()" v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="refresh" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Recalculate components') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="monetization_on" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Refund all...') }}</QItemSection>
|
||||||
|
<QItemSection side>
|
||||||
|
<QIcon name="keyboard_arrow_right" />
|
||||||
|
</QItemSection>
|
||||||
|
<QMenu anchor="top end" self="top start" auto-close bordered>
|
||||||
|
<QList>
|
||||||
|
<QItem v-ripple clickable @click="createRefund(true)">
|
||||||
|
<QItemSection>
|
||||||
|
{{ t('with warehouse') }}
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-ripple clickable @click="createRefund(false)">
|
||||||
|
<QItemSection>
|
||||||
|
{{ t('without warehouse') }}
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QItem>
|
||||||
<QItem @click="$refs.weightDialog.show()" v-ripple clickable>
|
<QItem @click="$refs.weightDialog.show()" v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="weight" />
|
<QIcon name="weight" />
|
||||||
|
@ -307,29 +637,61 @@ function openConfirmDialog(callback) {
|
||||||
</template>
|
</template>
|
||||||
</VnConfirm>
|
</VnConfirm>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.weekdaysBtn {
|
||||||
|
margin: 1%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
|
addTurn: Add turn
|
||||||
invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}"
|
invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}"
|
||||||
|
|
||||||
es:
|
es:
|
||||||
Open Delivery Note...: Abrir albarán...
|
Show Delivery Note...: Ver albarán...
|
||||||
Send Delivery Note...: Enviar albarán...
|
Send Delivery Note...: Enviar albarán...
|
||||||
With prices: Con precios
|
as PDF: como PDF
|
||||||
Without prices: Sin precios
|
as PDF without prices: como PDF sin precios
|
||||||
As CSV: Como CSV
|
as CSV: Como CSV
|
||||||
Open Proforma Invoice: Abrir factura proforma
|
Send PDF: Enviar PDF
|
||||||
|
Send PDF to tablet: Enviar PDF a tablet
|
||||||
|
Send CSV: Enviar CSV
|
||||||
|
Show Proforma: Ver proforma
|
||||||
Delete ticket: Eliminar ticket
|
Delete ticket: Eliminar ticket
|
||||||
Send SMS...: Enviar SMS
|
Send SMS...: Enviar SMS...
|
||||||
Pending payment: Pago pendiente
|
Pending payment: Pago pendiente
|
||||||
Minimum amount: Importe mínimo
|
Minimum import: Importe mínimo
|
||||||
Order changes: Cambios del pedido
|
Notify changes: Notificar cambios
|
||||||
Ticket deleted: Ticket eliminado
|
Ticket deleted: Ticket eliminado
|
||||||
You can undo this action within the first hour: Puedes deshacer esta acción dentro de la primera hora
|
You can undo this action within the first hour: Puedes deshacer esta acción dentro de la primera hora
|
||||||
To clone ticket: Clonar ticket
|
To clone ticket: Clonar ticket
|
||||||
Ticket cloned: Ticked clonado
|
Ticket cloned: Ticked clonado
|
||||||
It was not able to clone the ticket: No se pudo clonar el ticket
|
It was not able to clone the ticket: No se pudo clonar el ticket
|
||||||
|
Generate PDF invoice: Generar PDF factura
|
||||||
|
Regenerate PDF invoice: Regenerar PDF factura
|
||||||
|
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
||||||
|
Transfer client: Transferir cliente
|
||||||
|
Client: Cliente
|
||||||
|
addTurn: Añadir a turno
|
||||||
|
What is the day of receipt of the ticket?: ¿Cuál es el día de preparación del pedido?
|
||||||
|
Current ticket deleted and added to shift: Ticket actual eliminado y añadido al turno
|
||||||
|
Refund all...: Abonar todo...
|
||||||
|
with warehouse: con almacén
|
||||||
|
without warehouse: sin almacén
|
||||||
|
Make invoice: Crear factura
|
||||||
|
Change shipped hour: Cambiar hora de envío
|
||||||
|
Shipped hour: Hora de envío
|
||||||
|
Recalculate components: Recalcular componentes
|
||||||
|
Are you sure you want to recalculate components?: ¿Seguro que quieres recalcular los componentes?
|
||||||
|
Data saved: Datos guardados
|
||||||
|
Are you sure you want to invoice this ticket?: ¿Seguro que quieres facturar este ticket?
|
||||||
|
You are going to invoice this ticket: Vas a facturar este ticket
|
||||||
|
Ticket invoiced: Ticket facturado
|
||||||
Set weight: Establecer peso
|
Set weight: Establecer peso
|
||||||
Weight set: Peso establecido
|
Weight set: Peso establecido
|
||||||
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
||||||
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||||
|
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
||||||
|
You are going to delete this ticket: Vas a eliminar este ticket
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,39 +1,35 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, onUnmounted, reactive, watch } from 'vue';
|
import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import TicketEditManaProxy from './TicketEditMana.vue';
|
|
||||||
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import ExpeditionNewTicket from './ExpeditionNewTicket.vue';
|
import ExpeditionNewTicket from './ExpeditionNewTicket.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toCurrency, toPercentage } from 'src/filters';
|
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const editPriceProxyRef = ref(null);
|
|
||||||
const newTicketDialogRef = ref(null);
|
const newTicketDialogRef = ref(null);
|
||||||
const logsTableDialogRef = ref(null);
|
const logsTableDialogRef = ref(null);
|
||||||
|
const tableRef = ref();
|
||||||
const expeditionsLogsData = ref([]);
|
const expeditionsLogsData = ref([]);
|
||||||
const selectedExpeditions = ref([]);
|
const selectedExpeditions = ref([]);
|
||||||
const allColumnNames = ref([]);
|
const allColumnNames = ref([]);
|
||||||
const visibleColumns = ref([]);
|
|
||||||
const newTicketWithRoute = ref(false);
|
const newTicketWithRoute = ref(false);
|
||||||
|
const selectedRows = ref([]);
|
||||||
|
const hasSelectedRows = computed(() => selectedRows.value.length > 0);
|
||||||
|
|
||||||
const exprBuilder = (param, value) => {
|
const exprBuilder = (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -54,8 +50,6 @@ const expeditionsArrayData = useArrayData('ticketExpeditions', {
|
||||||
filter: expeditionsFilter.value,
|
filter: expeditionsFilter.value,
|
||||||
exprBuilder: exprBuilder,
|
exprBuilder: exprBuilder,
|
||||||
});
|
});
|
||||||
const expeditionsStore = expeditionsArrayData.store;
|
|
||||||
const ticketExpeditions = computed(() => expeditionsStore.data);
|
|
||||||
|
|
||||||
const ticketArrayData = useArrayData('ticketData');
|
const ticketArrayData = useArrayData('ticketData');
|
||||||
const ticketStore = ticketArrayData.store;
|
const ticketStore = ticketArrayData.store;
|
||||||
|
@ -73,129 +67,87 @@ watch(
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const params = reactive({});
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
try {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await expeditionsArrayData.addFilter({ filter: expeditionsFilter.value, params });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
|
||||||
return col.columnFilter.type === 'select'
|
|
||||||
? { 'update:modelValue': () => applyColumnFilter(col) }
|
|
||||||
: {
|
|
||||||
'keyup.enter': () => applyColumnFilter(col),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('expedition.id'),
|
label: t('expedition.id'),
|
||||||
name: 'id',
|
name: 'id',
|
||||||
field: 'id',
|
chip: {
|
||||||
align: 'left',
|
condition: () => true,
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterParamKey: 'expeditionFk',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
},
|
||||||
|
isId: true,
|
||||||
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.item'),
|
label: t('expedition.item'),
|
||||||
name: 'item',
|
name: 'packagingItemFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
cardVisible: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
inWhere: true,
|
||||||
type: 'text',
|
|
||||||
filterParamKey: 'packageItemName',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.name'),
|
label: t('expedition.name'),
|
||||||
name: 'name',
|
name: 'packageItemName',
|
||||||
field: 'packageItemName',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
isTitle: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
inWhere: true,
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
url: 'Items',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
'sort-by': 'name ASC',
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'name',
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.packageType'),
|
label: t('expedition.packageType'),
|
||||||
name: 'packageType',
|
name: 'freightItemName',
|
||||||
field: 'freightItemName',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
inWhere: true,
|
||||||
type: 'text',
|
|
||||||
// filterParamKey: 'expeditionFk',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.counter'),
|
label: t('expedition.counter'),
|
||||||
name: 'counter',
|
name: 'counter',
|
||||||
field: 'counter',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.externalId'),
|
label: t('expedition.externalId'),
|
||||||
name: 'externalId',
|
name: 'externalId',
|
||||||
field: 'externalId',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.created'),
|
label: t('expedition.created'),
|
||||||
name: 'created',
|
name: 'created',
|
||||||
field: 'created',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
cardVisible: true,
|
||||||
format: (value) => toDateTimeFormat(value),
|
format: (row) => toDateTimeFormat(row.created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.state'),
|
label: t('expedition.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
field: 'state',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
cardVisible: true,
|
||||||
|
columnFilter: { inWhere: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '',
|
align: 'right',
|
||||||
name: 'history',
|
name: 'tableActions',
|
||||||
align: 'left',
|
actions: [
|
||||||
columnFilter: null,
|
{
|
||||||
|
title: t('expedition.historyAction'),
|
||||||
|
icon: 'history',
|
||||||
|
isPrimary: true,
|
||||||
|
action: (row) => showLog(row),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -204,23 +156,29 @@ const logTableColumns = computed(() => [
|
||||||
label: t('expedition.state'),
|
label: t('expedition.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.name'),
|
label: t('expedition.name'),
|
||||||
name: 'name',
|
name: 'name',
|
||||||
align: 'name',
|
field: 'name',
|
||||||
|
align: 'center',
|
||||||
columnFilter: null,
|
columnFilter: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('expedition.created'),
|
label: t('expedition.created'),
|
||||||
name: 'created',
|
name: 'created',
|
||||||
field: 'created',
|
field: 'created',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
columnFilter: null,
|
|
||||||
format: (value) => toDateTimeFormat(value),
|
format: (value) => toDateTimeFormat(value),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('expedition.isScanned'),
|
||||||
|
name: 'isScanned',
|
||||||
|
field: 'isScanned',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const showNewTicketDialog = (withRoute = false) => {
|
const showNewTicketDialog = (withRoute = false) => {
|
||||||
|
@ -255,10 +213,20 @@ const getExpeditionState = async (expedition) => {
|
||||||
order: ['created DESC'],
|
order: ['created DESC'],
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await axios.get(`ExpeditionStates/filter`, {
|
const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
|
||||||
params: { filter: JSON.stringify(filter) },
|
params: { filter: JSON.stringify(filter) },
|
||||||
});
|
});
|
||||||
expeditionsLogsData.value = data;
|
const { data: scannedStates } = await axios.get(`ExpeditionStates`, {
|
||||||
|
params: { filter: JSON.stringify(filter), fields: ['id', 'isScanned'] },
|
||||||
|
});
|
||||||
|
|
||||||
|
expeditionsLogsData.value = expeditionStates.map((state) => {
|
||||||
|
const scannedState = scannedStates.find((s) => s.id === state.id);
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
isScanned: scannedState ? scannedState.isScanned : false,
|
||||||
|
};
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
@ -275,21 +243,13 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
|
||||||
<TableVisibleColumns
|
|
||||||
:all-columns="allColumnNames"
|
|
||||||
table-code="expeditionIndex"
|
|
||||||
labels-traductions-path="expedition"
|
|
||||||
@on-config-saved="visibleColumns = [...$event, 'history']"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
<QBtnGroup push class="q-gutter-x-sm" flat>
|
<QBtnGroup push class="q-gutter-x-sm" flat>
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
ref="btnDropdownRef"
|
ref="btnDropdownRef"
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('expedition.move')"
|
:label="t('expedition.move')"
|
||||||
:disable="!selectedExpeditions.length"
|
:disable="!hasSelectedRows"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
||||||
|
@ -322,7 +282,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QList>
|
</QList>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
<QBtn
|
<QBtn
|
||||||
:disable="!selectedExpeditions.length"
|
:disable="!hasSelectedRows"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="
|
@click="
|
||||||
|
@ -332,115 +292,34 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
deleteExpedition
|
deleteExpedition
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
>
|
||||||
|
<QTooltip>{{ t('expedition.removeExpedition') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
|
||||||
<QTable
|
<VnTable
|
||||||
:rows="ticketExpeditions"
|
ref="tableRef"
|
||||||
|
data-key="TicketExpedition"
|
||||||
|
url="Expeditions/filter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="id"
|
:filter="expeditionsFilter"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
v-model:selected="selectedRows"
|
||||||
class="full-width q-mt-md"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': 'id',
|
||||||
v-model:selected="selectedExpeditions"
|
selection: 'multiple',
|
||||||
:visible-columns="visibleColumns"
|
}"
|
||||||
:no-data-label="t('globals.noResults')"
|
auto-load
|
||||||
|
order="created DESC"
|
||||||
>
|
>
|
||||||
<template #top-row="{ cols }">
|
<template #column-packagingItemFk="{ row }">
|
||||||
<QTr>
|
<span class="link" @click.stop>
|
||||||
<QTd />
|
{{ row.packagingItemFk }}
|
||||||
<QTd v-for="(col, index) in cols" :key="index" style="max-width: 100px">
|
|
||||||
<component
|
|
||||||
:is="col.columnFilter.component"
|
|
||||||
v-if="col.columnFilter"
|
|
||||||
v-model="col.columnFilter.filterValue"
|
|
||||||
v-bind="col.columnFilter.attrs"
|
|
||||||
v-on="col.columnFilter.event(col)"
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-item="{ row }">
|
|
||||||
<QTd auto-width @click.stop>
|
|
||||||
<QBtn flat color="primary">{{ row.packagingItemFk }}</QBtn>
|
|
||||||
<ItemDescriptorProxy :id="row.packagingItemFk" />
|
<ItemDescriptorProxy :id="row.packagingItemFk" />
|
||||||
</QTd>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-available="{ row }">
|
</VnTable>
|
||||||
<QTd @click.stop>
|
|
||||||
<QBadge :color="row.available < 0 ? 'alert' : 'transparent'" dense>
|
|
||||||
{{ row.available }}
|
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #body-cell-price="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<template v-if="isTicketEditable && row.id">
|
|
||||||
<QBtn flat color="primary" dense @click="onOpenEditPricePopover(row)">
|
|
||||||
{{ toCurrency(row.price) }}
|
|
||||||
</QBtn>
|
|
||||||
<TicketEditManaProxy
|
|
||||||
ref="editPriceProxyRef"
|
|
||||||
:mana="mana"
|
|
||||||
:new-price="getNewPrice"
|
|
||||||
@save="updatePrice(row)"
|
|
||||||
>
|
|
||||||
<VnInput
|
|
||||||
v-model.number="edit.price"
|
|
||||||
:label="t('ticketSale.price')"
|
|
||||||
type="number"
|
|
||||||
/>
|
|
||||||
</TicketEditManaProxy>
|
|
||||||
</template>
|
|
||||||
<span v-else>{{ toCurrency(row.price) }}</span>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-discount="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<template v-if="!isLocked && row.id">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
@click="onOpenEditDiscountPopover(row)"
|
|
||||||
>
|
|
||||||
{{ toPercentage(row.discount / 100) }}
|
|
||||||
</QBtn>
|
|
||||||
<TicketEditManaProxy
|
|
||||||
:mana="mana"
|
|
||||||
:new-price="getNewPrice"
|
|
||||||
@save="changeDiscount(row)"
|
|
||||||
>
|
|
||||||
<VnInput
|
|
||||||
v-model.number="edit.discount"
|
|
||||||
:label="t('ticketSale.discount')"
|
|
||||||
type="number"
|
|
||||||
/>
|
|
||||||
</TicketEditManaProxy>
|
|
||||||
</template>
|
|
||||||
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-history="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<QBtn
|
|
||||||
@click.stop="showLog(row)"
|
|
||||||
color="primary"
|
|
||||||
icon="history"
|
|
||||||
size="md"
|
|
||||||
flat
|
|
||||||
>
|
|
||||||
<QTooltip class="text-no-wrap">
|
|
||||||
{{ t('expedition.historyAction') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
<QDialog ref="newTicketDialogRef" transition-show="scale" transition-hide="scale">
|
<QDialog ref="newTicketDialogRef" transition-show="scale" transition-hide="scale">
|
||||||
<ExpeditionNewTicket
|
<ExpeditionNewTicket
|
||||||
:ticket="ticketData"
|
:ticket="ticketData"
|
||||||
|
@ -454,12 +333,23 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
data-key="TicketExpeditionLog"
|
data-key="TicketExpeditionLog"
|
||||||
:rows="expeditionsLogsData"
|
:rows="expeditionsLogsData"
|
||||||
:columns="logTableColumns"
|
:columns="logTableColumns"
|
||||||
class="q-pa-sm"
|
class="q-pa-md full-width"
|
||||||
>
|
>
|
||||||
<template #body-cell-name="{ row }">
|
<template #body-cell-name="{ row }">
|
||||||
<QTd auto-width>
|
<QTd style="text-align: center">
|
||||||
<QBtn flat dense color="primary">{{ row.name }}</QBtn>
|
<span class="link" @click.stop>
|
||||||
|
<QBtn flat dense>{{ row.name }}</QBtn>
|
||||||
<WorkerDescriptorProxy :id="row.workerFk" />
|
<WorkerDescriptorProxy :id="row.workerFk" />
|
||||||
|
</span>
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
<template #body-cell-isScanned="{ row }">
|
||||||
|
<QTd style="text-align: center">
|
||||||
|
<QCheckbox disable v-model="row.isScanned">
|
||||||
|
{{
|
||||||
|
row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
|
||||||
|
}}
|
||||||
|
</QCheckbox>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue