forked from verdnatura/salix-front
Compare commits
140 Commits
8004-liliu
...
dev
Author | SHA1 | Date |
---|---|---|
|
fd72f4dd45 | |
|
9daed096db | |
|
e86afd57a0 | |
|
d529676ab5 | |
|
4828e32c9e | |
|
e26692fa51 | |
|
823c354ef1 | |
|
f52b4c9a59 | |
|
cb2780fe6f | |
|
c9cfb2b1cf | |
|
48fdc9e624 | |
|
f1350dece5 | |
|
2779e7ac8d | |
|
d918b76010 | |
|
6f57d9e490 | |
|
de7f55c589 | |
|
32b4636706 | |
|
f26976b744 | |
|
a0a37a68a0 | |
|
1bfede4a55 | |
|
4e31566ddd | |
|
33ee1ea01b | |
|
126bb3f039 | |
|
9673f7be1e | |
|
d1e4017869 | |
|
5d4b5ad598 | |
|
2420c6dee2 | |
|
0528474250 | |
|
e7acdfd4f7 | |
|
3cbd294168 | |
|
1bf1844c8f | |
|
ae56c06628 | |
|
735ee09ef8 | |
|
aaf749db6c | |
|
81a55a9e7a | |
|
41509c60dd | |
|
033d6bddbe | |
|
da4c1e9c12 | |
|
9f3c834ce4 | |
|
b1a511ff6f | |
|
f9392464e5 | |
|
ee31bc8262 | |
|
0d3e8bb5d2 | |
|
dd2dc86eea | |
|
93025007f1 | |
|
cd00a3c67f | |
|
0c9c01b6e9 | |
|
2d81cffb33 | |
|
f751408de2 | |
|
a732ec05fb | |
|
9db1c4f721 | |
|
ffd4a402ab | |
|
c799d17e19 | |
|
36221121f5 | |
|
b4d4844100 | |
|
0fbd5f45e1 | |
|
665e84d338 | |
|
cd4b17048c | |
|
c69f7af390 | |
|
8478d89183 | |
|
9780fe596f | |
|
6f79275521 | |
|
52981953f7 | |
|
bc1a082fe1 | |
|
e5064e8a37 | |
|
76b69a7588 | |
|
cdce4d063c | |
|
fbd6633bdb | |
|
0afcba0b07 | |
|
d61c690a70 | |
|
a4358ec0ed | |
|
2b2ccbc6a1 | |
|
d221b8e3c4 | |
|
fcc213f307 | |
|
2a7bebb0b6 | |
|
f2147311d3 | |
|
0cc1090739 | |
|
fbfb1c654a | |
|
11092866b8 | |
|
64c0496f7a | |
|
f4caf6aecc | |
|
175ebbc343 | |
|
55f8b78eba | |
|
2aaba93c3c | |
|
0c2d9e6ec6 | |
|
5c5393db6d | |
|
7d78ce7781 | |
|
da3364b424 | |
|
8bc06593c5 | |
|
1f4b681b5b | |
|
c42c811444 | |
|
e47cdff4ca | |
|
98a380e026 | |
|
3cdba5dafa | |
|
70ae50a5f1 | |
|
4115b1b303 | |
|
6b9dc8f3a6 | |
|
8262406eda | |
|
3069ac27d0 | |
|
e0c294bce6 | |
|
e06ce4f8a4 | |
|
cad3fddc3e | |
|
a30915f99e | |
|
b4245d05fb | |
|
af830591b3 | |
|
cdce0771c9 | |
|
d416a34560 | |
|
dfceb9403c | |
|
6633e65ee2 | |
|
1a2c5c96fa | |
|
1183d86867 | |
|
0aab17becc | |
|
720042bed9 | |
|
0fae36c239 | |
|
b6bce0c2f3 | |
|
3d9d08146c | |
|
2dd3e09928 | |
|
801b6585e8 | |
|
9edf35fba2 | |
|
855032e4a6 | |
|
73e5039ec3 | |
|
27dca7c35f | |
|
afc52f6cea | |
|
33d6d529c5 | |
|
bd3de77cbd | |
|
b93375f5a4 | |
|
6a1bb6d41f | |
|
8ee4edc5d5 | |
|
fef875270e | |
|
be53b466b9 | |
|
0b76d0d556 | |
|
0650380b7b | |
|
692c649b8c | |
|
2bd004f52b | |
|
1a697aa018 | |
|
9386d648d0 | |
|
1c99c01d1d | |
|
51aae0f726 | |
|
6d5a8cba6f | |
|
56af4d3736 |
|
@ -2,9 +2,11 @@ import axios from 'axios';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { Router } from 'src/router';
|
import { Router } from 'src/router';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
const stateQuery = useStateQueryStore();
|
||||||
const baseUrl = '/api/';
|
const baseUrl = '/api/';
|
||||||
|
|
||||||
axios.defaults.baseURL = baseUrl;
|
axios.defaults.baseURL = baseUrl;
|
||||||
|
@ -15,7 +17,7 @@ const onRequest = (config) => {
|
||||||
if (token.length && !config.headers.Authorization) {
|
if (token.length && !config.headers.Authorization) {
|
||||||
config.headers.Authorization = token;
|
config.headers.Authorization = token;
|
||||||
}
|
}
|
||||||
|
stateQuery.add(config);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,10 +26,10 @@ const onRequestError = (error) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onResponse = (response) => {
|
const onResponse = (response) => {
|
||||||
const { method } = response.config;
|
const config = response.config;
|
||||||
|
stateQuery.remove(config);
|
||||||
|
|
||||||
const isSaveRequest = method === 'patch';
|
if (config.method === 'patch') {
|
||||||
if (isSaveRequest) {
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,37 +37,9 @@ const onResponse = (response) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onResponseError = (error) => {
|
const onResponseError = (error) => {
|
||||||
let message = '';
|
stateQuery.remove(error.config);
|
||||||
|
|
||||||
const response = error.response;
|
if (session.isLoggedIn() && error.response?.status === 401) {
|
||||||
const responseData = response && response.data;
|
|
||||||
const responseError = responseData && response.data.error;
|
|
||||||
if (responseError) {
|
|
||||||
message = responseError.message;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (response?.status) {
|
|
||||||
case 422:
|
|
||||||
if (error.name == 'ValidationError')
|
|
||||||
message +=
|
|
||||||
' "' +
|
|
||||||
responseError.details.context +
|
|
||||||
'.' +
|
|
||||||
Object.keys(responseError.details.codes).join(',') +
|
|
||||||
'"';
|
|
||||||
break;
|
|
||||||
case 500:
|
|
||||||
message = 'errors.statusInternalServerError';
|
|
||||||
break;
|
|
||||||
case 502:
|
|
||||||
message = 'errors.statusBadGateway';
|
|
||||||
break;
|
|
||||||
case 504:
|
|
||||||
message = 'errors.statusGatewayTimeout';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (session.isLoggedIn() && response?.status === 401) {
|
|
||||||
session.destroy(false);
|
session.destroy(false);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
const url = hash.slice(1);
|
const url = hash.slice(1);
|
||||||
|
@ -74,8 +48,6 @@ const onResponseError = (error) => {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
notify(message, 'negative');
|
|
||||||
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,51 @@ 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';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { CanceledError } from 'axios';
|
||||||
|
|
||||||
const { notify } = useNotify();
|
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) {
|
app.config.errorHandler = (error) => {
|
||||||
console.error(err);
|
let message;
|
||||||
notify('globals.error', 'negative', 'error');
|
const response = error.response;
|
||||||
|
const responseData = response?.data;
|
||||||
|
const responseError = responseData && response.data.error;
|
||||||
|
if (responseError) {
|
||||||
|
message = responseError.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (response?.status) {
|
||||||
|
case 422:
|
||||||
|
if (error.name == 'ValidationError')
|
||||||
|
message +=
|
||||||
|
' "' +
|
||||||
|
responseError.details.context +
|
||||||
|
'.' +
|
||||||
|
Object.keys(responseError.details.codes).join(',') +
|
||||||
|
'"';
|
||||||
|
break;
|
||||||
|
case 500:
|
||||||
|
message = 'errors.statusInternalServerError';
|
||||||
|
break;
|
||||||
|
case 502:
|
||||||
|
message = 'errors.statusBadGateway';
|
||||||
|
break;
|
||||||
|
case 504:
|
||||||
|
message = 'errors.statusGatewayTimeout';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error(error);
|
||||||
|
if (error instanceof CanceledError) {
|
||||||
|
const env = process.env.NODE_ENV;
|
||||||
|
if (env && env !== 'development') return;
|
||||||
|
message = 'Duplicate request';
|
||||||
|
}
|
||||||
|
|
||||||
|
notify(message ?? 'globals.error', 'negative', 'error');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -79,14 +79,20 @@ async function onProvinceCreated(data) {
|
||||||
watch(
|
watch(
|
||||||
() => [postcodeFormData.countryFk],
|
() => [postcodeFormData.countryFk],
|
||||||
async (newCountryFk, oldValueFk) => {
|
async (newCountryFk, oldValueFk) => {
|
||||||
if (!!oldValueFk[0] && newCountryFk[0] !== oldValueFk[0]) {
|
if (Array.isArray(newCountryFk)) {
|
||||||
|
newCountryFk = newCountryFk[0];
|
||||||
|
}
|
||||||
|
if (Array.isArray(oldValueFk)) {
|
||||||
|
oldValueFk = oldValueFk[0];
|
||||||
|
}
|
||||||
|
if (!!oldValueFk && newCountryFk !== oldValueFk) {
|
||||||
postcodeFormData.provinceFk = null;
|
postcodeFormData.provinceFk = null;
|
||||||
postcodeFormData.townFk = null;
|
postcodeFormData.townFk = null;
|
||||||
}
|
}
|
||||||
if ((newCountryFk, newCountryFk !== postcodeFormData.countryFk)) {
|
if (oldValueFk !== newCountryFk) {
|
||||||
await provincesFetchDataRef.value.fetch({
|
await provincesFetchDataRef.value.fetch({
|
||||||
where: {
|
where: {
|
||||||
countryFk: newCountryFk[0],
|
countryFk: newCountryFk,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await townsFetchDataRef.value.fetch({
|
await townsFetchDataRef.value.fetch({
|
||||||
|
@ -103,9 +109,12 @@ watch(
|
||||||
watch(
|
watch(
|
||||||
() => postcodeFormData.provinceFk,
|
() => postcodeFormData.provinceFk,
|
||||||
async (newProvinceFk) => {
|
async (newProvinceFk) => {
|
||||||
if (newProvinceFk[0] && newProvinceFk[0] !== postcodeFormData.provinceFk) {
|
if (Array.isArray(newProvinceFk)) {
|
||||||
|
newProvinceFk = newProvinceFk[0];
|
||||||
|
}
|
||||||
|
if (newProvinceFk !== postcodeFormData.provinceFk) {
|
||||||
await townsFetchDataRef.value.fetch({
|
await townsFetchDataRef.value.fetch({
|
||||||
where: { provinceFk: newProvinceFk[0] },
|
where: { provinceFk: newProvinceFk },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,16 +134,26 @@ async function handleCountries(data) {
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
@on-fetch="handleProvinces"
|
@on-fetch="handleProvinces"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
:limit="30"
|
||||||
auto-load
|
auto-load
|
||||||
url="Provinces/location"
|
url="Provinces/location"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="townsFetchDataRef"
|
ref="townsFetchDataRef"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
:limit="30"
|
||||||
@on-fetch="handleTowns"
|
@on-fetch="handleTowns"
|
||||||
auto-load
|
auto-load
|
||||||
url="Towns/location"
|
url="Towns/location"
|
||||||
/>
|
/>
|
||||||
<FetchData @on-fetch="handleCountries" auto-load url="Countries" />
|
<FetchData
|
||||||
|
@on-fetch="handleCountries"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
:limit="30"
|
||||||
|
auto-load
|
||||||
|
url="Countries"
|
||||||
|
/>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
model="postcode"
|
model="postcode"
|
||||||
|
|
|
@ -46,6 +46,8 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
:limit="30"
|
||||||
/>
|
/>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
:title="t('New province')"
|
:title="t('New province')"
|
||||||
|
|
|
@ -217,9 +217,6 @@ async function save() {
|
||||||
updateAndEmit('onDataSaved', formData.value, response?.data);
|
updateAndEmit('onDataSaved', formData.value, response?.data);
|
||||||
if ($props.reload) await arrayData.fetch({});
|
if ($props.reload) await arrayData.fetch({});
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
notify('errors.writeRequest', 'negative');
|
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ defineExpose({
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
@click="emit('onDataCanceled')"
|
@click="emit('onDataCanceled')"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
data-cy="FormModelPopup_cancel"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
|
@ -70,6 +71,7 @@ defineExpose({
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
|
data-cy="FormModelPopup_save"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import PinnedModules from './PinnedModules.vue';
|
import PinnedModules from './PinnedModules.vue';
|
||||||
import UserPanel from 'components/UserPanel.vue';
|
import UserPanel from 'components/UserPanel.vue';
|
||||||
|
@ -12,6 +13,7 @@ import VnAvatar from './ui/VnAvatar.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
const stateQuery = useStateQueryStore();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const appName = 'Lilium';
|
const appName = 'Lilium';
|
||||||
|
@ -50,6 +52,14 @@ const pinnedModulesRef = ref();
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<VnBreadcrumbs v-if="$q.screen.gt.sm" />
|
<VnBreadcrumbs v-if="$q.screen.gt.sm" />
|
||||||
|
<QSpinner
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-md"
|
||||||
|
:class="{
|
||||||
|
'no-visible': !stateQuery.isLoading().value,
|
||||||
|
}"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div id="searchbar" class="searchbar"></div>
|
<div id="searchbar" class="searchbar"></div>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ const splittedColumns = ref({ columns: [] });
|
||||||
const columnsVisibilitySkipped = ref();
|
const columnsVisibilitySkipped = ref();
|
||||||
const createForm = ref();
|
const createForm = ref();
|
||||||
const tableFilterRef = ref([]);
|
const tableFilterRef = ref([]);
|
||||||
|
const tableRef = ref();
|
||||||
|
|
||||||
const tableModes = [
|
const tableModes = [
|
||||||
{
|
{
|
||||||
|
@ -315,12 +316,20 @@ defineExpose({
|
||||||
selected,
|
selected,
|
||||||
CrudModelRef,
|
CrudModelRef,
|
||||||
params,
|
params,
|
||||||
|
tableRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_) {
|
||||||
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
||||||
else $props.create.onDataSaved(_);
|
else $props.create.onDataSaved(_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleScroll() {
|
||||||
|
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
|
||||||
|
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
|
||||||
|
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
||||||
|
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<QDrawer
|
||||||
|
@ -405,8 +414,10 @@ function handleOnDataSaved(_) {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QTable
|
<QTable
|
||||||
|
ref="tableRef"
|
||||||
v-bind="table"
|
v-bind="table"
|
||||||
class="vnTable"
|
class="vnTable"
|
||||||
|
:class="{ 'last-row-sticky': $props.footer }"
|
||||||
:columns="splittedColumns.columns"
|
:columns="splittedColumns.columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
@ -416,12 +427,7 @@ function handleOnDataSaved(_) {
|
||||||
flat
|
flat
|
||||||
:style="isTableMode && `max-height: ${tableHeight}`"
|
:style="isTableMode && `max-height: ${tableHeight}`"
|
||||||
:virtual-scroll="isTableMode"
|
:virtual-scroll="isTableMode"
|
||||||
@virtual-scroll="
|
@virtual-scroll="handleScroll"
|
||||||
(event) =>
|
|
||||||
event.index > rows.length - 2 &&
|
|
||||||
($props.crudModel?.paginate ?? true) &&
|
|
||||||
CrudModelRef.vnPaginateRef.paginate()
|
|
||||||
"
|
|
||||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
>
|
>
|
||||||
|
@ -451,7 +457,11 @@ function handleOnDataSaved(_) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh v-if="col.visible ?? true">
|
<QTh
|
||||||
|
v-if="col.visible ?? true"
|
||||||
|
:style="col.headerStyle"
|
||||||
|
:class="col.headerClass"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="column self-start q-ml-xs ellipsis"
|
class="column self-start q-ml-xs ellipsis"
|
||||||
:class="`text-${col?.align ?? 'left'}`"
|
:class="`text-${col?.align ?? 'left'}`"
|
||||||
|
@ -811,6 +821,7 @@ es:
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vnTable {
|
.vnTable {
|
||||||
thead tr th {
|
thead tr th {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
@ -849,6 +860,9 @@ es:
|
||||||
table tbody th {
|
table tbody th {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.last-row-sticky {
|
||||||
tbody:nth-last-child(1) {
|
tbody:nth-last-child(1) {
|
||||||
@extend .bg-header;
|
@extend .bg-header;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<script setup>
|
||||||
|
import VnSelect from './VnSelect.vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
selectProps: { type: Object, required: true },
|
||||||
|
promise: { type: Function, default: () => {} },
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QBtnDropdown v-bind="$attrs" color="primary">
|
||||||
|
<VnSelect
|
||||||
|
v-bind="selectProps"
|
||||||
|
hide-selected
|
||||||
|
hide-dropdown-icon
|
||||||
|
focus-on-mount
|
||||||
|
@update:model-value="promise"
|
||||||
|
/>
|
||||||
|
</QBtnDropdown>
|
||||||
|
</template>
|
|
@ -9,10 +9,6 @@ const $props = defineProps({
|
||||||
type: Number, //Progress value (1.0 > x > 0.0)
|
type: Number, //Progress value (1.0 > x > 0.0)
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
showDialog: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
cancelled: {
|
cancelled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
|
@ -24,30 +20,22 @@ const emit = defineEmits(['cancel', 'close']);
|
||||||
|
|
||||||
const dialogRef = ref(null);
|
const dialogRef = ref(null);
|
||||||
|
|
||||||
const _showDialog = computed({
|
const showDialog = defineModel('showDialog', {
|
||||||
get: () => $props.showDialog,
|
type: Boolean,
|
||||||
set: (value) => {
|
default: false,
|
||||||
if (value) dialogRef.value.show();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const _progress = computed(() => $props.progress);
|
const _progress = computed(() => $props.progress);
|
||||||
|
|
||||||
const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`);
|
const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`);
|
||||||
|
|
||||||
const cancel = () => {
|
|
||||||
dialogRef.value.hide();
|
|
||||||
emit('cancel');
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QDialog ref="dialogRef" v-model="_showDialog" @hide="onDialogHide">
|
<QDialog ref="dialogRef" v-model="showDialog" @hide="emit('close')">
|
||||||
<QCard class="full-width dialog">
|
<QCard class="full-width dialog">
|
||||||
<QCardSection class="row">
|
<QCardSection class="row">
|
||||||
<span class="text-h6">{{ t('Progress') }}</span>
|
<span class="text-h6">{{ t('Progress') }}</span>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<QBtn icon="close" flat round dense @click="emit('close')" />
|
<QBtn icon="close" flat round dense v-close-popup />
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
@ -80,7 +68,7 @@ const cancel = () => {
|
||||||
type="button"
|
type="button"
|
||||||
flat
|
flat
|
||||||
class="text-primary"
|
class="text-primary"
|
||||||
@click="cancel()"
|
v-close-popup
|
||||||
>
|
>
|
||||||
{{ t('globals.cancel') }}
|
{{ t('globals.cancel') }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -141,6 +141,7 @@ function findKeyInOptions() {
|
||||||
function setOptions(data) {
|
function setOptions(data) {
|
||||||
myOptions.value = JSON.parse(JSON.stringify(data));
|
myOptions.value = JSON.parse(JSON.stringify(data));
|
||||||
myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
|
myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
|
||||||
|
emit('update:options', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter(val, options) {
|
function filter(val, options) {
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<script setup>
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { defineProps } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
routeName: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
entityId: {
|
||||||
|
type: [String, Number],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const id = props.entityId;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<router-link
|
||||||
|
v-if="route?.name !== routeName"
|
||||||
|
:to="{ name: routeName, params: { id: id } }"
|
||||||
|
class="header link"
|
||||||
|
:href="url"
|
||||||
|
>
|
||||||
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
|
</router-link>
|
||||||
|
</template>
|
|
@ -0,0 +1,55 @@
|
||||||
|
<script setup>
|
||||||
|
import { defineProps, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
usesMana: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
manaCode: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
manaVal: {
|
||||||
|
type: String,
|
||||||
|
default: 'mana',
|
||||||
|
},
|
||||||
|
manaLabel: {
|
||||||
|
type: String,
|
||||||
|
default: 'Promotion mana',
|
||||||
|
},
|
||||||
|
manaClaimVal: {
|
||||||
|
type: String,
|
||||||
|
default: 'manaClaim',
|
||||||
|
},
|
||||||
|
claimLabel: {
|
||||||
|
type: String,
|
||||||
|
default: 'Claim mana',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const manaCode = ref(props.manaCode);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<QRadio
|
||||||
|
v-model="manaCode"
|
||||||
|
dense
|
||||||
|
:val="manaVal"
|
||||||
|
:label="t(manaLabel)"
|
||||||
|
:dark="true"
|
||||||
|
class="q-mb-sm"
|
||||||
|
/>
|
||||||
|
<QRadio
|
||||||
|
v-model="manaCode"
|
||||||
|
dense
|
||||||
|
:val="manaClaimVal"
|
||||||
|
:label="t(claimLabel)"
|
||||||
|
:dark="true"
|
||||||
|
class="q-mb-sm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -288,3 +288,7 @@ input::-webkit-inner-spin-button {
|
||||||
color: $info;
|
color: $info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-visible {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
|
@ -277,6 +277,7 @@ globals:
|
||||||
medical: Mutual
|
medical: Mutual
|
||||||
RouteExtendedList: Router
|
RouteExtendedList: Router
|
||||||
wasteRecalc: Waste recaclulate
|
wasteRecalc: Waste recaclulate
|
||||||
|
operator: Operator
|
||||||
supplier: Supplier
|
supplier: Supplier
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
|
@ -303,12 +304,14 @@ globals:
|
||||||
from: From
|
from: From
|
||||||
To: To
|
To: To
|
||||||
stateFk: State
|
stateFk: State
|
||||||
departmentFk: Department
|
|
||||||
email: Email
|
email: Email
|
||||||
SSN: SSN
|
SSN: SSN
|
||||||
fi: FI
|
fi: FI
|
||||||
|
myTeam: My team
|
||||||
|
departmentFk: Department
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
|
changeState: Change state
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
statusInternalServerError: An internal server error has ocurred
|
statusInternalServerError: An internal server error has ocurred
|
||||||
|
@ -555,7 +558,6 @@ ticket:
|
||||||
package: Package
|
package: Package
|
||||||
taxClass: Tax class
|
taxClass: Tax class
|
||||||
services: Services
|
services: Services
|
||||||
changeState: Change state
|
|
||||||
requester: Requester
|
requester: Requester
|
||||||
atender: Atender
|
atender: Atender
|
||||||
request: Request
|
request: Request
|
||||||
|
@ -743,6 +745,7 @@ worker:
|
||||||
locker: Locker
|
locker: Locker
|
||||||
balance: Balance
|
balance: Balance
|
||||||
medical: Medical
|
medical: Medical
|
||||||
|
operator: Operator
|
||||||
list:
|
list:
|
||||||
name: Name
|
name: Name
|
||||||
email: Email
|
email: Email
|
||||||
|
@ -840,6 +843,18 @@ worker:
|
||||||
debit: Debt
|
debit: Debt
|
||||||
credit: Have
|
credit: Have
|
||||||
concept: Concept
|
concept: Concept
|
||||||
|
operator:
|
||||||
|
numberOfWagons: Number of wagons
|
||||||
|
train: Train
|
||||||
|
itemPackingType: Item packing type
|
||||||
|
warehouse: Warehouse
|
||||||
|
sector: Sector
|
||||||
|
labeler: Printer
|
||||||
|
linesLimit: Lines limit
|
||||||
|
volumeLimit: Volume limit
|
||||||
|
sizeLimit: Size limit
|
||||||
|
isOnReservationMode: Reservation mode
|
||||||
|
machine: Machine
|
||||||
wagon:
|
wagon:
|
||||||
pageTitles:
|
pageTitles:
|
||||||
wagons: Wagons
|
wagons: Wagons
|
||||||
|
|
|
@ -281,6 +281,7 @@ globals:
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
wasteRecalc: Recalcular mermas
|
wasteRecalc: Recalcular mermas
|
||||||
|
operator: Operario
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
|
@ -311,8 +312,10 @@ globals:
|
||||||
email: Correo
|
email: Correo
|
||||||
SSN: NSS
|
SSN: NSS
|
||||||
fi: NIF
|
fi: NIF
|
||||||
|
myTeam: Mi equipo
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
|
changeState: Cambiar estado
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
|
@ -564,7 +567,6 @@ ticket:
|
||||||
package: Embalaje
|
package: Embalaje
|
||||||
taxClass: Tipo IVA
|
taxClass: Tipo IVA
|
||||||
services: Servicios
|
services: Servicios
|
||||||
changeState: Cambiar estado
|
|
||||||
requester: Solicitante
|
requester: Solicitante
|
||||||
atender: Comprador
|
atender: Comprador
|
||||||
request: Petición de compra
|
request: Petición de compra
|
||||||
|
@ -750,6 +752,7 @@ worker:
|
||||||
balance: Balance
|
balance: Balance
|
||||||
formation: Formación
|
formation: Formación
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
|
operator: Operario
|
||||||
list:
|
list:
|
||||||
name: Nombre
|
name: Nombre
|
||||||
email: Email
|
email: Email
|
||||||
|
@ -838,6 +841,19 @@ worker:
|
||||||
debit: Debe
|
debit: Debe
|
||||||
credit: Haber
|
credit: Haber
|
||||||
concept: Concepto
|
concept: Concepto
|
||||||
|
operator:
|
||||||
|
numberOfWagons: Número de vagones
|
||||||
|
train: tren
|
||||||
|
itemPackingType: Tipo de embalaje
|
||||||
|
warehouse: Almacén
|
||||||
|
sector: Sector
|
||||||
|
labeler: Impresora
|
||||||
|
linesLimit: Líneas límite
|
||||||
|
volumeLimit: Volumen límite
|
||||||
|
sizeLimit: Tamaño límite
|
||||||
|
isOnReservationMode: Modo de reserva
|
||||||
|
machine: Máquina
|
||||||
|
|
||||||
wagon:
|
wagon:
|
||||||
pageTitles:
|
pageTitles:
|
||||||
wagons: Vagones
|
wagons: Vagones
|
||||||
|
|
|
@ -46,13 +46,9 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const deleteAlias = async (row) => {
|
const deleteAlias = async (row) => {
|
||||||
try {
|
await axios.delete(`${urlPath.value}/${row.id}`);
|
||||||
await axios.delete(`${urlPath.value}/${row.id}`);
|
notify(t('User removed'), 'positive');
|
||||||
notify(t('User removed'), 'positive');
|
fetchAliases();
|
||||||
fetchAliases();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
|
@ -61,23 +61,15 @@ const fetchAccountExistence = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteMailAlias = async (row) => {
|
const deleteMailAlias = async (row) => {
|
||||||
try {
|
await axios.delete(`${urlPath}/${row.id}`);
|
||||||
await axios.delete(`${urlPath}/${row.id}`);
|
fetchMailAliases();
|
||||||
fetchMailAliases();
|
notify(t('Unsubscribed from alias!'), 'positive');
|
||||||
notify(t('Unsubscribed from alias!'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createMailAlias = async (mailAliasFormData) => {
|
const createMailAlias = async (mailAliasFormData) => {
|
||||||
try {
|
await axios.post(urlPath, mailAliasFormData);
|
||||||
await axios.post(urlPath, mailAliasFormData);
|
notify(t('Subscribed to alias!'), 'positive');
|
||||||
notify(t('Subscribed to alias!'), 'positive');
|
fetchMailAliases();
|
||||||
fetchMailAliases();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchMailAliases = async () => {
|
const fetchMailAliases = async () => {
|
||||||
|
|
|
@ -46,29 +46,15 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const deleteSubRole = async (row) => {
|
const deleteSubRole = async (row) => {
|
||||||
try {
|
await axios.delete(`${urlPath.value}/${row.id}`);
|
||||||
await axios.delete(`${urlPath.value}/${row.id}`);
|
fetchSubRoles();
|
||||||
fetchSubRoles();
|
notify(t('Role removed. Changes will take a while to fully propagate.'), 'positive');
|
||||||
notify(
|
|
||||||
t('Role removed. Changes will take a while to fully propagate.'),
|
|
||||||
'positive'
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createSubRole = async (subRoleFormData) => {
|
const createSubRole = async (subRoleFormData) => {
|
||||||
try {
|
await axios.post(urlPath.value, subRoleFormData);
|
||||||
await axios.post(urlPath.value, subRoleFormData);
|
notify(t('Role added! Changes will take a while to fully propagate.'), 'positive');
|
||||||
notify(
|
fetchSubRoles();
|
||||||
t('Role added! Changes will take a while to fully propagate.'),
|
|
||||||
'positive'
|
|
||||||
);
|
|
||||||
fetchSubRoles();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
|
@ -204,7 +204,7 @@ function claimUrl(section) {
|
||||||
top
|
top
|
||||||
color="black"
|
color="black"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
:label="t('ticket.summary.changeState')"
|
:label="t('globals.changeState')"
|
||||||
>
|
>
|
||||||
<QList>
|
<QList>
|
||||||
<QVirtualScroll
|
<QVirtualScroll
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useRoute, useRouter } from 'vue-router';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { toDateFormat } from 'src/filters/date.js';
|
import { toDateFormat } from 'src/filters/date.js';
|
||||||
|
|
||||||
import { toCurrency } from 'src/filters';
|
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||||
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
||||||
|
@ -32,6 +32,16 @@ const filter = {
|
||||||
},
|
},
|
||||||
{ relation: 'invoiceOut', scope: { fields: ['id'] } },
|
{ relation: 'invoiceOut', scope: { fields: ['id'] } },
|
||||||
{ relation: 'agencyMode', scope: { fields: ['name'] } },
|
{ relation: 'agencyMode', scope: { fields: ['name'] } },
|
||||||
|
{
|
||||||
|
relation: 'ticketSales',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'concept', 'itemFk'],
|
||||||
|
include: { relation: 'item' },
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name', 'itemPackingTypeFk'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
where: { clientFk: route.params.id },
|
where: { clientFk: route.params.id },
|
||||||
order: ['shipped DESC', 'id'],
|
order: ['shipped DESC', 'id'],
|
||||||
|
@ -87,7 +97,12 @@ const columns = computed(() => [
|
||||||
label: t('Total'),
|
label: t('Total'),
|
||||||
name: 'total',
|
name: 'total',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'itemPackingTypeFk',
|
||||||
|
label: t('ticketSale.packaging'),
|
||||||
|
format: (row) => getItemPackagingType(row),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -135,6 +150,15 @@ const setShippedColor = (date) => {
|
||||||
if (difference == 0) return 'warning';
|
if (difference == 0) return 'warning';
|
||||||
if (difference < 0) return 'success';
|
if (difference < 0) return 'success';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getItemPackagingType = (row) => {
|
||||||
|
const packagingType = row?.ticketSales
|
||||||
|
.map((sale) => sale.item?.itemPackingTypeFk || '-')
|
||||||
|
.filter((value) => value !== '-')
|
||||||
|
.join(', ');
|
||||||
|
|
||||||
|
return dashIfEmpty(packagingType);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -11,6 +11,7 @@ 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';
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -163,14 +164,12 @@ const fetchEntryBuys = async () => {
|
||||||
data-key="EntrySummary"
|
data-key="EntrySummary"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<router-link
|
<VnToSummary
|
||||||
v-if="route?.name !== 'EntrySummary'"
|
v-if="route?.name !== 'EntrySummary'"
|
||||||
:to="{ name: 'EntrySummary', params: { id: entityId } }"
|
:route-name="'EntrySummary'"
|
||||||
class="header link"
|
:entity-id="entityId"
|
||||||
:href="entryUrl"
|
:url="entryUrl"
|
||||||
>
|
/>
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
|
||||||
</router-link>
|
|
||||||
</template>
|
</template>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
||||||
|
|
|
@ -78,7 +78,7 @@ const ticketsColumns = ref([
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'quantity',
|
name: 'nickname',
|
||||||
label: t('invoiceOut.summary.nickname'),
|
label: t('invoiceOut.summary.nickname'),
|
||||||
field: (row) => row.nickname,
|
field: (row) => row.nickname,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -172,11 +172,11 @@ const ticketsColumns = ref([
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-quantity="{ value, row }">
|
<template #body-cell-nickname="{ value, row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn class="no-uppercase link" flat dense>
|
<QBtn class="no-uppercase link" flat dense>
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<CustomerDescriptorProxy :id="row.id" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -229,7 +229,7 @@ onBeforeMount(() => {
|
||||||
>
|
>
|
||||||
<template #body-cell-id="{ row }">
|
<template #body-cell-id="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat color="primary"> {{ row.ticketFk }}</QBtn>
|
<QBtn flat class="link"> {{ row.ticketFk }}</QBtn>
|
||||||
<TicketDescriptorProxy :id="row.ticketFk" />
|
<TicketDescriptorProxy :id="row.ticketFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
@ -251,22 +251,35 @@ onBeforeMount(() => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-requester="{ row }">
|
<template #body-cell-requester="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat dense color="primary"> {{ row.requesterName }}</QBtn>
|
<QBtn flat dense class="link"> {{ row.requesterName }}</QBtn>
|
||||||
<WorkerDescriptorProxy :id="row.requesterFk" />
|
<WorkerDescriptorProxy :id="row.requesterFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-attender="{ row }">
|
<template #body-cell-attender="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Workers/search"
|
||||||
v-model="row.attenderFk"
|
v-model="row.attenderFk"
|
||||||
:where="{ role: 'buyer' }"
|
:params="{ departmentCodes: ['shopping'] }"
|
||||||
sort-by="id"
|
:fields="['id', 'nickname']"
|
||||||
url="Workers"
|
sort-by="nickname ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="firstName"
|
option-label="nickname"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
dense
|
dense
|
||||||
/>
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption
|
||||||
|
>{{ scope.opt?.nickname }},
|
||||||
|
{{ scope.opt?.code }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-item="{ row }">
|
<template #body-cell-item="{ row }">
|
||||||
|
@ -292,7 +305,7 @@ onBeforeMount(() => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-concept="{ row }">
|
<template #body-cell-concept="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat dense color="primary"> {{ row.itemDescription }}</QBtn>
|
<QBtn flat dense class="link"> {{ row.itemDescription }}</QBtn>
|
||||||
<ItemDescriptorProxy :id="row.itemFk" />
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -174,6 +174,16 @@ const decrement = (paramsObj, key) => {
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
v-model="params.myTeam"
|
||||||
|
:label="t('params.myTeam')"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
toggle-indeterminate
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QCard bordered>
|
<QCard bordered>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
|
@ -274,11 +284,11 @@ en:
|
||||||
to: To
|
to: To
|
||||||
mine: For me
|
mine: For me
|
||||||
state: State
|
state: State
|
||||||
|
myTeam: My team
|
||||||
dateFiltersTooltip: Cannot choose a range of dates and days onward at the same time
|
dateFiltersTooltip: Cannot choose a range of dates and days onward at the same time
|
||||||
denied: Denied
|
denied: Denied
|
||||||
accepted: Accepted
|
accepted: Accepted
|
||||||
pending: Pending
|
pending: Pending
|
||||||
|
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
|
@ -291,6 +301,7 @@ es:
|
||||||
to: Hasta
|
to: Hasta
|
||||||
mine: Para mi
|
mine: Para mi
|
||||||
state: Estado
|
state: Estado
|
||||||
|
myTeam: Mi equipo
|
||||||
dateFiltersTooltip: No se puede seleccionar un rango de fechas y días en adelante a la vez
|
dateFiltersTooltip: No se puede seleccionar un rango de fechas y días en adelante a la vez
|
||||||
denied: Denegada
|
denied: Denegada
|
||||||
accepted: Aceptada
|
accepted: Aceptada
|
||||||
|
|
|
@ -52,15 +52,27 @@ const redirectToItemTypeBasicData = (_, { id }) => {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Workers/search"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
:label="t('itemType.shared.worker')"
|
:label="t('shared.worker')"
|
||||||
url="Workers"
|
sort-by="nickname ASC"
|
||||||
sort-by="firstName ASC"
|
:fields="['id', 'nickname']"
|
||||||
:fields="['id', 'firstName']"
|
:params="{ departmentCodes: ['shopping'] }"
|
||||||
|
option-label="nickname"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="firstName"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
><template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption
|
||||||
|
>{{ scope.opt?.nickname }},
|
||||||
|
{{ scope.opt?.code }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.categoryFk"
|
v-model="data.categoryFk"
|
||||||
:label="t('itemType.shared.category')"
|
:label="t('itemType.shared.category')"
|
||||||
|
|
|
@ -41,15 +41,27 @@ const temperaturesOptions = ref([]);
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Workers/search"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
:label="t('shared.worker')"
|
:label="t('shared.worker')"
|
||||||
url="Workers"
|
sort-by="nickname ASC"
|
||||||
sort-by="firstName ASC"
|
:fields="['id', 'nickname']"
|
||||||
:fields="['id', 'firstName']"
|
:params="{ departmentCodes: ['shopping'] }"
|
||||||
|
option-label="nickname"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="firstName"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
><template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption
|
||||||
|
>{{ scope.opt?.nickname }},
|
||||||
|
{{ scope.opt?.code }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template></VnSelect
|
||||||
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.categoryFk"
|
v-model="data.categoryFk"
|
||||||
:label="t('shared.category')"
|
:label="t('shared.category')"
|
||||||
|
|
|
@ -6,6 +6,7 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.v
|
||||||
|
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
|
||||||
onUpdated(() => summaryRef.value.fetch());
|
onUpdated(() => summaryRef.value.fetch());
|
||||||
|
|
||||||
|
@ -55,6 +56,11 @@ async function setItemTypeData(data) {
|
||||||
>
|
>
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<VnToSummary
|
||||||
|
v-if="route?.name !== 'ItemTypeSummary'"
|
||||||
|
:route-name="'ItemTypeSummary'"
|
||||||
|
:entity-id="entityId"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>
|
<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 { useAcl } from 'src/composables/useAcl';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import { toTimeFormat } from 'filters/date.js';
|
import { toTimeFormat } from 'filters/date.js';
|
||||||
|
|
||||||
|
@ -28,14 +29,17 @@ const { validate } = useValidator();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const agencyFetchRef = ref(null);
|
const canEditZone = useAcl().hasAny([
|
||||||
const zonesFetchRef = ref(null);
|
{ model: 'Ticket', props: 'editZone', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const agencyFetchRef = ref();
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const zonesOptions = ref([]);
|
const zonesOptions = ref([]);
|
||||||
const addresses = ref([]);
|
const addresses = ref([]);
|
||||||
|
const zoneSelectRef = ref();
|
||||||
const formData = ref($props.formData);
|
const formData = ref($props.formData);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -44,6 +48,8 @@ watch(
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
onMounted(() => onFormModelInit());
|
||||||
|
|
||||||
const agencyByWarehouseFilter = computed(() => ({
|
const agencyByWarehouseFilter = computed(() => ({
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
order: 'name ASC',
|
order: 'name ASC',
|
||||||
|
@ -52,18 +58,16 @@ const agencyByWarehouseFilter = computed(() => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function zoneWhere() {
|
const zoneWhere = computed(() => {
|
||||||
if (formData?.value?.agencyModeFk) {
|
return formData.value?.agencyModeFk
|
||||||
return 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 {
|
||||||
|
@ -108,32 +112,20 @@ const getShipped = async (params) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangeZone = async (zoneId) => {
|
const onChangeZone = async (zoneId) => {
|
||||||
try {
|
formData.value.agencyModeFk = null;
|
||||||
formData.value.agencyModeFk = null;
|
const { data } = await axios.get(`Zones/${zoneId}`);
|
||||||
const { data } = await axios.get(`Zones/${zoneId}`);
|
formData.value.agencyModeFk = data.agencyModeFk;
|
||||||
formData.value.agencyModeFk = data.agencyModeFk;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangeAddress = async (addressId) => {
|
const onChangeAddress = async (addressId) => {
|
||||||
try {
|
formData.value.nickname = null;
|
||||||
formData.value.nickname = null;
|
const { data } = await axios.get(`Addresses/${addressId}`);
|
||||||
const { data } = await axios.get(`Addresses/${addressId}`);
|
formData.value.nickname = data.nickname;
|
||||||
formData.value.nickname = data.nickname;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getClientDefaultAddress = async (clientId) => {
|
const getClientDefaultAddress = async (clientId) => {
|
||||||
try {
|
const { data } = await axios.get(`Clients/${clientId}`);
|
||||||
const { data } = await axios.get(`Clients/${clientId}`);
|
if (data) addressId.value = data.defaultAddressFk;
|
||||||
if (data) addressId.value = data.defaultAddressFk;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clientAddressesList = async (value) => {
|
const clientAddressesList = async (value) => {
|
||||||
|
@ -270,7 +262,17 @@ const redirectToCustomerAddress = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => onFormModelInit());
|
async function getZone(options) {
|
||||||
|
if (!zoneId.value) return;
|
||||||
|
|
||||||
|
const zone = options.find((z) => z.id == zoneId.value);
|
||||||
|
if (zone) return;
|
||||||
|
|
||||||
|
const { data } = await axios.get('Zones/' + zoneId.value, {
|
||||||
|
params: { filter: JSON.stringify({ fields: ['id', 'name'] }) },
|
||||||
|
});
|
||||||
|
zoneSelectRef.value.opts.push(data);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -416,6 +418,7 @@ onMounted(() => onFormModelInit());
|
||||||
:rules="validate('basicData.agency')"
|
:rules="validate('basicData.agency')"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
ref="zoneSelectRef"
|
||||||
:label="t('basicData.zone')"
|
:label="t('basicData.zone')"
|
||||||
v-model="zoneId"
|
v-model="zoneId"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -424,11 +427,10 @@ onMounted(() => onFormModelInit());
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="id"
|
sort-by="id"
|
||||||
:where="zoneWhere"
|
:where="zoneWhere"
|
||||||
hide-selected
|
|
||||||
map-options
|
|
||||||
:required="true"
|
|
||||||
@focus="zonesFetchRef.fetch()"
|
|
||||||
:rules="validate('basicData.zone')"
|
:rules="validate('basicData.zone')"
|
||||||
|
:required="true"
|
||||||
|
:disable="!canEditZone"
|
||||||
|
@update:options="getZone"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
|
@ -70,60 +70,51 @@ const isFormInvalid = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPriceDifference = async () => {
|
const getPriceDifference = async () => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
landed: formData.value.landed,
|
||||||
landed: formData.value.landed,
|
addressId: formData.value.addressFk,
|
||||||
addressId: formData.value.addressFk,
|
agencyModeId: formData.value.agencyModeFk,
|
||||||
agencyModeId: formData.value.agencyModeFk,
|
zoneId: formData.value.zoneFk,
|
||||||
zoneId: formData.value.zoneFk,
|
warehouseId: formData.value.warehouseFk,
|
||||||
warehouseId: formData.value.warehouseFk,
|
shipped: formData.value.shipped,
|
||||||
shipped: formData.value.shipped,
|
};
|
||||||
};
|
const { data } = await axios.post(
|
||||||
const { data } = await axios.post(
|
`tickets/${formData.value.id}/priceDifference`,
|
||||||
`tickets/${formData.value.id}/priceDifference`,
|
params
|
||||||
params
|
);
|
||||||
);
|
formData.value.sale = data;
|
||||||
formData.value.sale = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
try {
|
if (!formData.value.option) return notify(t('basicData.chooseAnOption'), 'negative');
|
||||||
if (!formData.value.option)
|
|
||||||
return notify(t('basicData.chooseAnOption'), 'negative');
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
clientFk: formData.value.clientFk,
|
clientFk: formData.value.clientFk,
|
||||||
nickname: formData.value.nickname,
|
nickname: formData.value.nickname,
|
||||||
agencyModeFk: formData.value.agencyModeFk,
|
agencyModeFk: formData.value.agencyModeFk,
|
||||||
addressFk: formData.value.addressFk,
|
addressFk: formData.value.addressFk,
|
||||||
zoneFk: formData.value.zoneFk,
|
zoneFk: formData.value.zoneFk,
|
||||||
warehouseFk: formData.value.warehouseFk,
|
warehouseFk: formData.value.warehouseFk,
|
||||||
companyFk: formData.value.companyFk,
|
companyFk: formData.value.companyFk,
|
||||||
shipped: formData.value.shipped,
|
shipped: formData.value.shipped,
|
||||||
landed: formData.value.landed,
|
landed: formData.value.landed,
|
||||||
isDeleted: formData.value.isDeleted,
|
isDeleted: formData.value.isDeleted,
|
||||||
option: formData.value.option,
|
option: formData.value.option,
|
||||||
isWithoutNegatives: formData.value.withoutNegatives,
|
isWithoutNegatives: formData.value.withoutNegatives,
|
||||||
withWarningAccept: formData.value.withWarningAccept,
|
withWarningAccept: formData.value.withWarningAccept,
|
||||||
keepPrice: false,
|
keepPrice: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await axios.post(
|
const { data } = await axios.post(
|
||||||
`tickets/${formData.value.id}/componentUpdate`,
|
`tickets/${formData.value.id}/componentUpdate`,
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
const ticketToMove = data.id;
|
const ticketToMove = data.id;
|
||||||
notify(t('basicData.unroutedTicket'), 'positive');
|
notify(t('basicData.unroutedTicket'), 'positive');
|
||||||
router.push({ name: 'TicketSummary', params: { id: ticketToMove } });
|
router.push({ name: 'TicketSummary', params: { id: ticketToMove } });
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitWithNegatives = async () => {
|
const submitWithNegatives = async () => {
|
||||||
|
|
|
@ -34,26 +34,20 @@ const newTicketFormData = reactive({});
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
||||||
const createTicket = async () => {
|
const createTicket = async () => {
|
||||||
try {
|
const expeditionIds = $props.selectedExpeditions.map((expedition) => expedition.id);
|
||||||
const expeditionIds = $props.selectedExpeditions.map(
|
const params = {
|
||||||
(expedition) => expedition.id
|
clientId: $props.ticket.clientFk,
|
||||||
);
|
landed: newTicketFormData.landed,
|
||||||
const params = {
|
warehouseId: $props.ticket.warehouseFk,
|
||||||
clientId: $props.ticket.clientFk,
|
addressId: $props.ticket.addressFk,
|
||||||
landed: newTicketFormData.landed,
|
agencyModeId: $props.ticket.agencyModeFk,
|
||||||
warehouseId: $props.ticket.warehouseFk,
|
routeId: newTicketFormData.routeFk,
|
||||||
addressId: $props.ticket.addressFk,
|
expeditionIds: expeditionIds,
|
||||||
agencyModeId: $props.ticket.agencyModeFk,
|
};
|
||||||
routeId: newTicketFormData.routeFk,
|
|
||||||
expeditionIds: expeditionIds,
|
|
||||||
};
|
|
||||||
|
|
||||||
const { data } = await axios.post('Expeditions/moveExpeditions', params);
|
const { data } = await axios.post('Expeditions/moveExpeditions', params);
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
router.push({ name: 'TicketSummary', params: { id: data.id } });
|
router.push({ name: 'TicketSummary', params: { id: data.id } });
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -150,31 +150,19 @@ const getTotal = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const getComponentsSum = async () => {
|
const getComponentsSum = async () => {
|
||||||
try {
|
const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`);
|
||||||
const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`);
|
componentsList.value = data;
|
||||||
componentsList.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTheoricalCost = async () => {
|
const getTheoricalCost = async () => {
|
||||||
try {
|
const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`);
|
||||||
const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`);
|
theoricalCost.value = data;
|
||||||
theoricalCost.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTicketVolume = async () => {
|
const getTicketVolume = async () => {
|
||||||
try {
|
if (!ticketData.value) return;
|
||||||
if (!ticketData.value) return;
|
const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
|
||||||
const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
|
ticketVolume.value = data[0].volume;
|
||||||
ticketVolume.value = data[0].volume;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import axios from 'axios';
|
||||||
import { ref, toRefs } 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 { useRoute, useRouter } from 'vue-router';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
|
@ -23,6 +23,7 @@ const props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const { push, currentRoute } = useRouter();
|
const { push, currentRoute } = useRouter();
|
||||||
const { dialog, notify } = useQuasar();
|
const { dialog, notify } = useQuasar();
|
||||||
|
@ -40,6 +41,8 @@ const isEditable = ref();
|
||||||
const hasInvoicing = useAcl('invoicing');
|
const hasInvoicing = useAcl('invoicing');
|
||||||
const hasPdf = ref();
|
const hasPdf = ref();
|
||||||
const weight = ref();
|
const weight = ref();
|
||||||
|
const hasDocuwareFile = ref();
|
||||||
|
const quasar = useQuasar();
|
||||||
const actions = {
|
const actions = {
|
||||||
clone: async () => {
|
clone: async () => {
|
||||||
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
||||||
|
@ -331,10 +334,49 @@ async function handleInvoiceOutData() {
|
||||||
});
|
});
|
||||||
hasPdf.value = data[0]?.hasPdf;
|
hasPdf.value = data[0]?.hasPdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function docuwareDownload() {
|
||||||
|
await axios.get(`Tickets/${ticketId}/docuwareDownload`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function hasDocuware() {
|
||||||
|
const { data } = await axios.post(`Docuwares/${ticketId}/checkFile`, {
|
||||||
|
fileCabinet: 'deliveryNote',
|
||||||
|
signed: true,
|
||||||
|
});
|
||||||
|
hasDocuwareFile.value = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function uploadDocuware(force) {
|
||||||
|
console.log('force: ', force);
|
||||||
|
if (!force)
|
||||||
|
return quasar
|
||||||
|
.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('Send PDF to tablet'),
|
||||||
|
message: t('Are you sure you want to replace this delivery note?'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(async () => {
|
||||||
|
uploadDocuware(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
const { data } = await axios.post(`Docuwares/upload`, {
|
||||||
|
fileCabinet: 'deliveryNote',
|
||||||
|
ticketIds: [parseInt(ticketId)],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
:url="`Tickets/${ticketId}/isEditable`"
|
:url="
|
||||||
|
route.path.startsWith('/ticket')
|
||||||
|
? `Tickets/${ticketId}/isEditable`
|
||||||
|
: `Tickets/${ticket}/isEditable`
|
||||||
|
"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="handleFetchData"
|
@on-fetch="handleFetchData"
|
||||||
/>
|
/>
|
||||||
|
@ -452,7 +494,13 @@ async function handleInvoiceOutData() {
|
||||||
<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
|
||||||
|
@click="hasDocuware()"
|
||||||
|
>
|
||||||
<QList>
|
<QList>
|
||||||
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('as PDF') }}</QItemSection>
|
<QItemSection>{{ t('as PDF') }}</QItemSection>
|
||||||
|
@ -460,6 +508,14 @@ async function handleInvoiceOutData() {
|
||||||
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
|
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="hasDocuwareFile"
|
||||||
|
@click="docuwareDownload()"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('as PDF signed') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="openDeliveryNote('deliveryNote', 'csv')"
|
@click="openDeliveryNote('deliveryNote', 'csv')"
|
||||||
v-ripple
|
v-ripple
|
||||||
|
@ -478,7 +534,7 @@ async function handleInvoiceOutData() {
|
||||||
<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>
|
<QMenu anchor="top end" self="top start" auto-close @click="hasDocuware()">
|
||||||
<QList>
|
<QList>
|
||||||
<QItem
|
<QItem
|
||||||
@click="sendDeliveryNoteConfirmation('deliveryNote')"
|
@click="sendDeliveryNoteConfirmation('deliveryNote')"
|
||||||
|
@ -487,11 +543,7 @@ async function handleInvoiceOutData() {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem @click="uploadDocuware(!hasDocuwareFile)" v-ripple clickable>
|
||||||
@click="sendDeliveryNoteConfirmation('withoutPrices')"
|
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
>
|
|
||||||
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
|
@ -695,4 +747,6 @@ es:
|
||||||
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?
|
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
|
You are going to delete this ticket: Vas a eliminar este ticket
|
||||||
|
as PDF signed: como PDF firmado
|
||||||
|
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán?
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
|
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
mana: {
|
mana: {
|
||||||
|
@ -13,12 +13,21 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
usesMana: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
manaCode: {
|
||||||
|
type: String,
|
||||||
|
default: 'mana',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['save', 'cancel']);
|
const emit = defineEmits(['save', 'cancel']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const QPopupProxyRef = ref(null);
|
const QPopupProxyRef = ref(null);
|
||||||
|
const manaCode = ref($props.manaCode);
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
emit('save');
|
emit('save');
|
||||||
|
@ -47,6 +56,9 @@ const cancel = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<VnUsesMana :mana-code="manaCode" />
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
|
import { onMounted, ref, computed, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ 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';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import VnBtnSelect from 'src/components/common/VnBtnSelect.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -23,50 +25,24 @@ const { notify } = useNotify();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const newTicketDialogRef = ref(null);
|
const newTicketDialogRef = ref(null);
|
||||||
const logsTableDialogRef = ref(null);
|
const logsTableDialogRef = ref(null);
|
||||||
const tableRef = ref();
|
const vnTableRef = ref();
|
||||||
const expeditionsLogsData = ref([]);
|
const expeditionsLogsData = ref([]);
|
||||||
const selectedExpeditions = ref([]);
|
const selectedExpeditions = ref([]);
|
||||||
const allColumnNames = ref([]);
|
const allColumnNames = ref([]);
|
||||||
const newTicketWithRoute = ref(false);
|
const newTicketWithRoute = ref(false);
|
||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const hasSelectedRows = computed(() => selectedRows.value.length > 0);
|
const hasSelectedRows = computed(() => selectedRows.value.length > 0);
|
||||||
|
const expeditionStateTypes = ref([]);
|
||||||
const exprBuilder = (param, value) => {
|
|
||||||
switch (param) {
|
|
||||||
case 'expeditionFk':
|
|
||||||
return { id: value };
|
|
||||||
case 'packageItemName':
|
|
||||||
return { packagingItemFk: value };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const expeditionsFilter = computed(() => ({
|
const expeditionsFilter = computed(() => ({
|
||||||
where: { ticketFk: route.params.id },
|
where: { ticketFk: route.params.id },
|
||||||
order: ['created DESC'],
|
order: ['created DESC'],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const expeditionsArrayData = useArrayData('ticketExpeditions', {
|
|
||||||
url: 'Expeditions/filter',
|
|
||||||
filter: expeditionsFilter.value,
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
});
|
|
||||||
|
|
||||||
const ticketArrayData = useArrayData('ticketData');
|
const ticketArrayData = useArrayData('ticketData');
|
||||||
const ticketStore = ticketArrayData.store;
|
const ticketStore = ticketArrayData.store;
|
||||||
const ticketData = computed(() => ticketStore.data);
|
const ticketData = computed(() => ticketStore.data);
|
||||||
|
|
||||||
const refetchExpeditions = async () => {
|
|
||||||
await expeditionsArrayData.applyFilter({
|
|
||||||
filter: expeditionsFilter.value,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => route.params.id,
|
|
||||||
async () => await refetchExpeditions(),
|
|
||||||
{ immediate: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -187,18 +163,12 @@ const showNewTicketDialog = (withRoute = false) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteExpedition = async () => {
|
const deleteExpedition = async () => {
|
||||||
try {
|
const expeditionIds = selectedRows.value.map((expedition) => expedition.id);
|
||||||
const expeditionIds = selectedExpeditions.value.map(
|
const params = { expeditionIds };
|
||||||
(expedition) => expedition.id
|
await axios.post('Expeditions/deleteExpeditions', params);
|
||||||
);
|
vnTableRef.value.reload();
|
||||||
const params = { expeditionIds };
|
selectedExpeditions.value = [];
|
||||||
await axios.post('Expeditions/deleteExpeditions', params);
|
notify(t('expedition.expeditionRemoved'), 'positive');
|
||||||
await refetchExpeditions();
|
|
||||||
selectedExpeditions.value = [];
|
|
||||||
notify(t('expedition.expeditionRemoved'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showLog = async (expedition) => {
|
const showLog = async (expedition) => {
|
||||||
|
@ -207,29 +177,19 @@ const showLog = async (expedition) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getExpeditionState = async (expedition) => {
|
const getExpeditionState = async (expedition) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
where: { expeditionFk: expedition.id },
|
||||||
where: { expeditionFk: expedition.id },
|
order: ['created DESC'],
|
||||||
order: ['created DESC'],
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
|
const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
|
||||||
params: { filter: JSON.stringify(filter) },
|
params: { filter: JSON.stringify(filter) },
|
||||||
});
|
});
|
||||||
const { data: scannedStates } = await axios.get(`ExpeditionStates`, {
|
|
||||||
params: { filter: JSON.stringify(filter), fields: ['id', 'isScanned'] },
|
|
||||||
});
|
|
||||||
|
|
||||||
expeditionsLogsData.value = expeditionStates.map((state) => {
|
expeditionsLogsData.value = expeditionStates.map((state) => ({
|
||||||
const scannedState = scannedStates.find((s) => s.id === state.id);
|
...state,
|
||||||
return {
|
isScanned: !!state.isScanned,
|
||||||
...state,
|
}));
|
||||||
isScanned: scannedState ? scannedState.isScanned : false,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
@ -242,9 +202,35 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="expeditionStateTypes"
|
||||||
|
@on-fetch="(data) => (expeditionStateTypes = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-actions>
|
<template #st-actions>
|
||||||
<QBtnGroup push class="q-gutter-x-sm" flat>
|
<QBtnGroup push class="q-gutter-x-sm" flat>
|
||||||
|
<VnBtnSelect
|
||||||
|
:disable="!hasSelectedRows"
|
||||||
|
color="primary"
|
||||||
|
:label="t('globals.changeState')"
|
||||||
|
:select-props="{
|
||||||
|
options: expeditionStateTypes,
|
||||||
|
optionLabel: 'description',
|
||||||
|
optionValue: 'code',
|
||||||
|
}"
|
||||||
|
:promise="
|
||||||
|
async (stateCode) => {
|
||||||
|
await axios.post('ExpeditionStates/addExpeditionState', {
|
||||||
|
expeditions: selectedRows.map(({ id }) => {
|
||||||
|
return { expeditionFk: id, stateCode };
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
vnTableRef.tableRef.clearSelection();
|
||||||
|
vnTableRef.reload();
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
ref="btnDropdownRef"
|
ref="btnDropdownRef"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -298,11 +284,11 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="vnTableRef"
|
||||||
data-key="TicketExpedition"
|
data-key="TicketExpedition"
|
||||||
url="Expeditions/filter"
|
url="Expeditions/filter"
|
||||||
|
search-url="expeditions"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="expeditionsFilter"
|
:filter="expeditionsFilter"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
@ -311,6 +297,16 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
|
:expr-builder="
|
||||||
|
(param, value) => {
|
||||||
|
switch (param) {
|
||||||
|
case 'expeditionFk':
|
||||||
|
return { id: value };
|
||||||
|
case 'packageItemName':
|
||||||
|
return { packagingItemFk: value };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
>
|
>
|
||||||
<template #column-packagingItemFk="{ row }">
|
<template #column-packagingItemFk="{ row }">
|
||||||
|
@ -324,7 +320,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
<ExpeditionNewTicket
|
<ExpeditionNewTicket
|
||||||
:ticket="ticketData"
|
:ticket="ticketData"
|
||||||
:with-route="newTicketWithRoute"
|
:with-route="newTicketWithRoute"
|
||||||
:selected-expeditions="selectedExpeditions"
|
:selected-expeditions="selectedRows"
|
||||||
/>
|
/>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<QDialog ref="logsTableDialogRef" transition-show="scale" transition-hide="scale">
|
<QDialog ref="logsTableDialogRef" transition-show="scale" transition-hide="scale">
|
||||||
|
@ -345,11 +341,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-isScanned="{ row }">
|
<template #body-cell-isScanned="{ row }">
|
||||||
<QTd style="text-align: center">
|
<QTd style="text-align: center">
|
||||||
<QCheckbox disable v-model="row.isScanned">
|
<QCheckbox disable v-model="row.isScanned" />
|
||||||
{{
|
|
||||||
row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
|
|
||||||
}}
|
|
||||||
</QCheckbox>
|
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -768,6 +769,8 @@ watch(
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
:mana="mana"
|
:mana="mana"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
|
:uses-mana="usesMana"
|
||||||
|
:mana-code="manaCode"
|
||||||
@save="changeDiscount(row)"
|
@save="changeDiscount(row)"
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -775,6 +778,9 @@ watch(
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<VnUsesMana :mana-code="manaCode" />
|
||||||
|
</div>
|
||||||
</TicketEditManaProxy>
|
</TicketEditManaProxy>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
||||||
|
|
|
@ -165,14 +165,10 @@ const createRefund = async (withWarehouse) => {
|
||||||
negative: true,
|
negative: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
const { data } = await axios.post('Tickets/cloneAll', params);
|
||||||
const { data } = await axios.post('Tickets/cloneAll', params);
|
const [refundTicket] = data;
|
||||||
const [refundTicket] = data;
|
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
||||||
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||||
push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -150,18 +150,14 @@ const shelvingsTableColumns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getSaleTrackings = async (sale) => {
|
const getSaleTrackings = async (sale) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
where: { saleFk: sale.saleFk },
|
||||||
where: { saleFk: sale.saleFk },
|
order: ['itemFk DESC'],
|
||||||
order: ['itemFk DESC'],
|
};
|
||||||
};
|
const { data } = await axios.get(`SaleTrackings/listSaleTracking`, {
|
||||||
const { data } = await axios.get(`SaleTrackings/listSaleTracking`, {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
saleTrackings.value = data;
|
||||||
saleTrackings.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showLog = async (sale) => {
|
const showLog = async (sale) => {
|
||||||
|
@ -170,17 +166,13 @@ const showLog = async (sale) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getItemShelvingSales = async (sale) => {
|
const getItemShelvingSales = async (sale) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
where: { saleFk: sale.saleFk },
|
||||||
where: { saleFk: sale.saleFk },
|
};
|
||||||
};
|
const { data } = await axios.get(`ItemShelvingSales/filter`, {
|
||||||
const { data } = await axios.get(`ItemShelvingSales/filter`, {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
itemShelvingsSales.value = data;
|
||||||
itemShelvingsSales.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showShelving = async (sale) => {
|
const showShelving = async (sale) => {
|
||||||
|
@ -189,36 +181,28 @@ const showShelving = async (sale) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
try {
|
if (oldQuantity.value === sale.quantity) return;
|
||||||
if (oldQuantity.value === sale.quantity) return;
|
const params = {
|
||||||
const params = {
|
quantity: sale.quantity,
|
||||||
quantity: sale.quantity,
|
};
|
||||||
};
|
await axios.patch(`ItemShelvingSales/${sale.id}`, params);
|
||||||
await axios.patch(`ItemShelvingSales/${sale.id}`, params);
|
oldQuantity.value = null;
|
||||||
oldQuantity.value = null;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateParking = async (sale) => {
|
const updateParking = async (sale) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
fields: ['id'],
|
||||||
fields: ['id'],
|
where: {
|
||||||
where: {
|
code: sale.shelvingFk,
|
||||||
code: sale.shelvingFk,
|
},
|
||||||
},
|
};
|
||||||
};
|
const { data } = await axios.get(`Shelvings/findOne`, {
|
||||||
const { data } = await axios.get(`Shelvings/findOne`, {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
const params = {
|
||||||
const params = {
|
parkingFk: sale.parkingFk,
|
||||||
parkingFk: sale.parkingFk,
|
};
|
||||||
};
|
await axios.patch(`Shelvings/${data.id}`, params);
|
||||||
await axios.patch(`Shelvings/${data.id}`, params);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateShelving = async (sale) => {
|
const updateShelving = async (sale) => {
|
||||||
|
@ -241,61 +225,41 @@ const updateShelving = async (sale) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const saleTrackingNew = async (sale, stateCode, isChecked) => {
|
const saleTrackingNew = async (sale, stateCode, isChecked) => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
saleFk: sale.saleFk,
|
||||||
saleFk: sale.saleFk,
|
isChecked,
|
||||||
isChecked,
|
quantity: sale.quantity,
|
||||||
quantity: sale.quantity,
|
stateCode,
|
||||||
stateCode,
|
};
|
||||||
};
|
await axios.post(`SaleTrackings/new`, params);
|
||||||
await axios.post(`SaleTrackings/new`, params);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const saleTrackingDel = async ({ saleFk }, stateCode) => {
|
const saleTrackingDel = async ({ saleFk }, stateCode) => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
saleFk,
|
||||||
saleFk,
|
stateCodes: [stateCode],
|
||||||
stateCodes: [stateCode],
|
};
|
||||||
};
|
await axios.post(`SaleTrackings/delete`, params);
|
||||||
await axios.post(`SaleTrackings/delete`, params);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickSaleGroupDetail = async (sale) => {
|
const clickSaleGroupDetail = async (sale) => {
|
||||||
try {
|
if (!sale.saleGroupDetailFk) return;
|
||||||
if (!sale.saleGroupDetailFk) return;
|
|
||||||
|
|
||||||
await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`);
|
await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`);
|
||||||
sale.hasSaleGroupDetail = false;
|
sale.hasSaleGroupDetail = false;
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickPreviousSelected = (sale) => {
|
const clickPreviousSelected = (sale) => {
|
||||||
try {
|
qCheckBoxController(sale, 'isPreviousSelected');
|
||||||
qCheckBoxController(sale, 'isPreviousSelected');
|
if (!sale.isPreviousSelected) sale.isPrevious = false;
|
||||||
if (!sale.isPreviousSelected) sale.isPrevious = false;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickPrevious = (sale) => {
|
const clickPrevious = (sale) => {
|
||||||
try {
|
qCheckBoxController(sale, 'isPrevious');
|
||||||
qCheckBoxController(sale, 'isPrevious');
|
if (sale.isPrevious) sale.isPreviousSelected = true;
|
||||||
if (sale.isPrevious) sale.isPreviousSelected = true;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const qCheckBoxController = (sale, action) => {
|
const qCheckBoxController = (sale, action) => {
|
||||||
|
@ -306,16 +270,12 @@ const qCheckBoxController = (sale, action) => {
|
||||||
isPreviousSelected: 'PREVIOUS_PREPARATION',
|
isPreviousSelected: 'PREVIOUS_PREPARATION',
|
||||||
};
|
};
|
||||||
const stateCode = STATE_CODES[action];
|
const stateCode = STATE_CODES[action];
|
||||||
try {
|
if (!sale[action]) {
|
||||||
if (!sale[action]) {
|
saleTrackingNew(sale, stateCode, true);
|
||||||
saleTrackingNew(sale, stateCode, true);
|
sale[action] = true;
|
||||||
sale[action] = true;
|
} else {
|
||||||
} else {
|
saleTrackingDel(sale, stateCode);
|
||||||
saleTrackingDel(sale, stateCode);
|
sale[action] = false;
|
||||||
sale[action] = false;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -46,40 +46,32 @@ watch(
|
||||||
onMounted(async () => await getDefaultTaxClass());
|
onMounted(async () => await getDefaultTaxClass());
|
||||||
|
|
||||||
const createRefund = async () => {
|
const createRefund = async () => {
|
||||||
try {
|
if (!selected.value.length) return;
|
||||||
if (!selected.value.length) return;
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
servicesIds: selected.value.map((s) => +s.id),
|
servicesIds: selected.value.map((s) => +s.id),
|
||||||
withWarehouse: false,
|
withWarehouse: false,
|
||||||
negative: true,
|
negative: true,
|
||||||
};
|
};
|
||||||
const { data } = await axios.post('Sales/clone', params);
|
const { data } = await axios.post('Sales/clone', params);
|
||||||
const [refundTicket] = data;
|
const [refundTicket] = data;
|
||||||
notify(
|
notify(
|
||||||
t('service.createRefundSuccess', {
|
t('service.createRefundSuccess', {
|
||||||
ticketId: refundTicket.id,
|
ticketId: refundTicket.id,
|
||||||
}),
|
}),
|
||||||
'positive'
|
'positive'
|
||||||
);
|
);
|
||||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDefaultTaxClass = async () => {
|
const getDefaultTaxClass = async () => {
|
||||||
try {
|
let filter = {
|
||||||
let filter = {
|
where: { code: 'G' },
|
||||||
where: { code: 'G' },
|
};
|
||||||
};
|
const { data } = await axios.get('TaxClasses/findOne', {
|
||||||
const { data } = await axios.get('TaxClasses/findOne', {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
defaultTaxClass.value = data;
|
||||||
defaultTaxClass.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
|
|
@ -19,6 +19,8 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
|
||||||
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -68,7 +70,7 @@ function isEditable() {
|
||||||
|
|
||||||
async function changeState(value) {
|
async function changeState(value) {
|
||||||
try {
|
try {
|
||||||
stateBtnDropdownRef.value.hide();
|
stateBtnDropdownRef.value?.hide();
|
||||||
const formData = {
|
const formData = {
|
||||||
ticketFk: entityId.value,
|
ticketFk: entityId.value,
|
||||||
code: value,
|
code: value,
|
||||||
|
@ -85,6 +87,10 @@ async function changeState(value) {
|
||||||
function toTicketUrl(section) {
|
function toTicketUrl(section) {
|
||||||
return '#/ticket/' + entityId.value + '/' + section;
|
return '#/ticket/' + entityId.value + '/' + section;
|
||||||
}
|
}
|
||||||
|
function isOnTicketCard() {
|
||||||
|
const currentPath = route.path;
|
||||||
|
return currentPath.startsWith('/ticket');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -99,6 +105,14 @@ function toTicketUrl(section) {
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
>
|
>
|
||||||
|
<template #header-left>
|
||||||
|
<VnToSummary
|
||||||
|
v-if="route?.name !== 'TicketSummary'"
|
||||||
|
:route-name="'TicketSummary'"
|
||||||
|
:entity-id="entityId"
|
||||||
|
:url="ticketUrl"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>
|
<div>
|
||||||
Ticket #{{ entity.id }} - {{ entity.client?.name }} ({{
|
Ticket #{{ entity.id }} - {{ entity.client?.name }} ({{
|
||||||
|
@ -112,7 +126,7 @@ function toTicketUrl(section) {
|
||||||
ref="stateBtnDropdownRef"
|
ref="stateBtnDropdownRef"
|
||||||
color="black"
|
color="black"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
:label="t('ticket.summary.changeState')"
|
:label="t('globals.changeState')"
|
||||||
:disable="!isEditable()"
|
:disable="!isEditable()"
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
|
@ -75,22 +75,18 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const applyVolumes = async (salesData) => {
|
const applyVolumes = async (salesData) => {
|
||||||
try {
|
if (!salesData.length) return;
|
||||||
if (!salesData.length) return;
|
|
||||||
|
|
||||||
sales.value = salesData;
|
sales.value = salesData;
|
||||||
const ticket = sales.value[0].ticketFk;
|
const ticket = sales.value[0].ticketFk;
|
||||||
const { data } = await axios.get(`Tickets/${ticket}/getVolume`);
|
const { data } = await axios.get(`Tickets/${ticket}/getVolume`);
|
||||||
const volumes = new Map(data.saleVolume.map((volume) => [volume.saleFk, volume]));
|
const volumes = new Map(data.saleVolume.map((volume) => [volume.saleFk, volume]));
|
||||||
|
|
||||||
sales.value.forEach((sale) => {
|
sales.value.forEach((sale) => {
|
||||||
sale.saleVolume = volumes.get(sale.id);
|
sale.saleVolume = volumes.get(sale.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
packingTypeVolume.value = data.packingTypeVolume;
|
packingTypeVolume.value = data.packingTypeVolume;
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
onMounted(() => (stateStore.rightDrawer = true));
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, reactive } from 'vue';
|
import { ref, computed, reactive, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnProgress from 'src/components/common/VnProgressModal.vue';
|
import VnProgress from 'src/components/common/VnProgressModal.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import TicketAdvanceFilter from './TicketAdvanceFilter.vue';
|
import TicketAdvanceFilter from './TicketAdvanceFilter.vue';
|
||||||
|
|
||||||
import { dashIfEmpty, toCurrency } from 'src/filters';
|
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { toDateFormat } from 'src/filters/date.js';
|
import { toDateFormat } from 'src/filters/date.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -29,109 +25,58 @@ const user = state.getUser();
|
||||||
const itemPackingTypesOptions = ref([]);
|
const itemPackingTypesOptions = ref([]);
|
||||||
const zonesOptions = ref([]);
|
const zonesOptions = ref([]);
|
||||||
const selectedTickets = ref([]);
|
const selectedTickets = ref([]);
|
||||||
|
const vnTableRef = ref({});
|
||||||
const exprBuilder = (param, value) => {
|
const originElRef = ref(null);
|
||||||
switch (param) {
|
const destinationElRef = ref(null);
|
||||||
case 'id':
|
let today = Date.vnNew().toISOString();
|
||||||
case 'futureId':
|
const tomorrow = new Date(today);
|
||||||
case 'liters':
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||||
case 'futureLiters':
|
const userParams = reactive({
|
||||||
case 'lines':
|
dateFuture: tomorrow,
|
||||||
case 'futureLines':
|
dateToAdvance: today,
|
||||||
case 'totalWithVat':
|
warehouseFk: user.value.warehouseFk,
|
||||||
case 'futureTotalWithVat':
|
ipt: 'H',
|
||||||
case 'futureZone':
|
futureIpt: 'H',
|
||||||
case 'notMovableLines':
|
isFullMovable: true,
|
||||||
case 'futureZoneFk':
|
|
||||||
return { [param]: value };
|
|
||||||
case 'iptColFilter':
|
|
||||||
return { ipt: { like: `%${value}%` } };
|
|
||||||
case 'futureIptColFilter':
|
|
||||||
return { futureIpt: { like: `%${value}%` } };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const userParams = reactive({});
|
|
||||||
|
|
||||||
const arrayData = useArrayData('AdvanceTickets', {
|
|
||||||
url: 'Tickets/getTicketsAdvance',
|
|
||||||
userParams: userParams,
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
limit: 0,
|
|
||||||
});
|
});
|
||||||
const { store } = arrayData;
|
|
||||||
const tickets = computed(() =>
|
|
||||||
(store.data || []).map((ticket, index) => ({ ...ticket, index: index }))
|
|
||||||
);
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
try {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
userParams[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await arrayData.addFilter({ params: userParams });
|
|
||||||
} 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 ticketColumns = computed(() => [
|
const ticketColumns = computed(() => [
|
||||||
{
|
{
|
||||||
label: '',
|
label: '',
|
||||||
name: 'icons',
|
name: 'icons',
|
||||||
align: 'left',
|
hidden: true,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.ticketId'),
|
|
||||||
name: 'ticketId',
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
label: t('advanceTickets.ticketId'),
|
||||||
columnFilter: {
|
name: 'id',
|
||||||
component: VnInput,
|
headerClass: 'horizontal-separator',
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'id',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.ipt'),
|
label: t('advanceTickets.ipt'),
|
||||||
name: 'ipt',
|
name: 'ipt',
|
||||||
field: 'ipt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'iptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
|
inWhere: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.ipt),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.state'),
|
label: t('advanceTickets.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
align: 'left',
|
headerClass: 'horizontal-separator',
|
||||||
sortable: true,
|
hidden: true,
|
||||||
columnFilter: null,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.preparation'),
|
label: t('advanceTickets.preparation'),
|
||||||
|
@ -139,171 +84,105 @@ const ticketColumns = computed(() => [
|
||||||
field: 'preparation',
|
field: 'preparation',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.liters'),
|
|
||||||
name: 'liters',
|
|
||||||
field: 'liters',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
label: t('advanceTickets.liters'),
|
||||||
columnFilter: {
|
headerClass: 'horizontal-separator',
|
||||||
component: VnInput,
|
name: 'liters',
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.lines'),
|
label: t('advanceTickets.lines'),
|
||||||
name: 'lines',
|
name: 'lines',
|
||||||
field: 'lines',
|
headerClass: 'horizontal-separator',
|
||||||
align: 'left',
|
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.import'),
|
label: t('advanceTickets.import'),
|
||||||
field: 'import',
|
name: 'totalWithVat',
|
||||||
name: 'import',
|
hidden: true,
|
||||||
align: 'left',
|
headerClass: 'horizontal-separator',
|
||||||
sortable: true,
|
format: (row) => toCurrency(row.totalWithVat),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureId'),
|
label: t('advanceTickets.futureId'),
|
||||||
name: 'futureId',
|
name: 'futureId',
|
||||||
align: 'left',
|
headerClass: 'vertical-separator horizontal-separator',
|
||||||
sortable: true,
|
columnClass: 'vertical-separator',
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'futureId',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureIpt'),
|
label: t('advanceTickets.futureIpt'),
|
||||||
name: 'futureIpt',
|
name: 'futureIpt',
|
||||||
field: 'futureIpt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'futureIptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
headerClass: 'horizontal-separator',
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureIpt),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureState'),
|
label: t('advanceTickets.futureState'),
|
||||||
name: 'futureState',
|
name: 'futureState',
|
||||||
align: 'left',
|
headerClass: 'horizontal-separator',
|
||||||
sortable: true,
|
hidden: true,
|
||||||
columnFilter: null,
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureLiters'),
|
label: t('advanceTickets.futureLiters'),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
name: 'futureLiters',
|
name: 'futureLiters',
|
||||||
field: 'futureLiters',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureZone'),
|
label: t('advanceTickets.futureZone'),
|
||||||
name: 'futureZoneName',
|
name: 'futureZoneFk',
|
||||||
field: 'futureZoneName',
|
columnClass: 'expand',
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
type: 'select',
|
inWhere: true,
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'futureZoneFk',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: zonesOptions.value,
|
url: 'Zones',
|
||||||
'option-value': 'id',
|
fields: ['id', 'name'],
|
||||||
'option-label': 'name',
|
|
||||||
dense: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureZoneName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.notMovableLines'),
|
label: t('advanceTickets.notMovableLines'),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
name: 'notMovableLines',
|
name: 'notMovableLines',
|
||||||
field: 'notMovableLines',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
label: t('advanceTickets.futureLines'),
|
label: t('advanceTickets.futureLines'),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
name: 'futureLines',
|
name: 'futureLines',
|
||||||
field: 'futureLines',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.futureImport'),
|
|
||||||
name: 'futureImport',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
label: t('advanceTickets.futureImport'),
|
||||||
columnFilter: null,
|
name: 'futureTotalWithVat',
|
||||||
|
hidden: true,
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
|
format: (row) => toCurrency(row.futureTotalWithVat),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -329,7 +208,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
const query = `tickets/${ticket.futureId}/componentUpdate`;
|
const query = `tickets/${ticket.futureId}/componentUpdate`;
|
||||||
if (!ticket.landed) {
|
if (!ticket.landed) {
|
||||||
const newLanded = await getLanded({
|
const newLanded = await getLanded({
|
||||||
shipped: userParams.dateToAdvance,
|
shipped: vnTableRef.value.params.dateToAdvance,
|
||||||
addressFk: ticket.futureAddressFk,
|
addressFk: ticket.futureAddressFk,
|
||||||
agencyModeFk: ticket.agencyModeFk ?? ticket.futureAgencyModeFk,
|
agencyModeFk: ticket.agencyModeFk ?? ticket.futureAgencyModeFk,
|
||||||
warehouseFk: ticket.futureWarehouseFk,
|
warehouseFk: ticket.futureWarehouseFk,
|
||||||
|
@ -352,7 +231,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
zoneFk: ticket.zoneFk ?? ticket.futureZoneFk,
|
zoneFk: ticket.zoneFk ?? ticket.futureZoneFk,
|
||||||
warehouseFk: ticket.futureWarehouseFk,
|
warehouseFk: ticket.futureWarehouseFk,
|
||||||
companyFk: ticket.futureCompanyFk,
|
companyFk: ticket.futureCompanyFk,
|
||||||
shipped: userParams.dateToAdvance,
|
shipped: vnTableRef.value.params.dateToAdvance,
|
||||||
landed: ticket.landed,
|
landed: ticket.landed,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
isWithoutNegatives,
|
isWithoutNegatives,
|
||||||
|
@ -364,36 +243,31 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const moveTicketsAdvance = async () => {
|
const moveTicketsAdvance = async () => {
|
||||||
try {
|
let ticketsToMove = [];
|
||||||
let ticketsToMove = [];
|
for (const ticket of selectedTickets.value) {
|
||||||
for (const ticket of selectedTickets.value) {
|
if (!ticket.id) {
|
||||||
if (!ticket.id) {
|
try {
|
||||||
try {
|
const { query, params } = await requestComponentUpdate(ticket, false);
|
||||||
const { query, params } = await requestComponentUpdate(ticket, false);
|
axios.post(query, params);
|
||||||
axios.post(query, params);
|
} catch (e) {
|
||||||
} catch (e) {
|
console.error('Error moving ticket', e);
|
||||||
console.error('Error moving ticket', e);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
ticketsToMove.push({
|
continue;
|
||||||
originId: ticket.futureId,
|
|
||||||
destinationId: ticket.id,
|
|
||||||
originShipped: ticket.futureShipped,
|
|
||||||
destinationShipped: ticket.shipped,
|
|
||||||
workerFk: ticket.workerFk,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
ticketsToMove.push({
|
||||||
const params = { tickets: ticketsToMove };
|
originId: ticket.futureId,
|
||||||
await axios.post('Tickets/merge', params);
|
destinationId: ticket.id,
|
||||||
arrayData.fetch({ append: false });
|
originShipped: ticket.futureShipped,
|
||||||
selectedTickets.value = [];
|
destinationShipped: ticket.shipped,
|
||||||
if (ticketsToMove.length)
|
workerFk: ticket.workerFk,
|
||||||
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
});
|
||||||
} catch (error) {
|
|
||||||
console.error('Error moving tickets', error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const params = { tickets: ticketsToMove };
|
||||||
|
await axios.post('Tickets/merge', params);
|
||||||
|
vnTableRef.value.reload();
|
||||||
|
selectedTickets.value = [];
|
||||||
|
if (ticketsToMove.length) notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
||||||
};
|
};
|
||||||
|
|
||||||
const progressLength = ref(0);
|
const progressLength = ref(0);
|
||||||
|
@ -434,10 +308,8 @@ const splitTickets = async () => {
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error('Error splitting tickets', error);
|
|
||||||
} finally {
|
} finally {
|
||||||
arrayData.fetch({ append: false });
|
vnTableRef.value.reload();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -455,19 +327,52 @@ const handleCloseProgressDialog = () => {
|
||||||
|
|
||||||
const handleCancelProgress = () => (cancelProgress.value = true);
|
const handleCancelProgress = () => (cancelProgress.value = true);
|
||||||
|
|
||||||
onMounted(async () => {
|
watch(
|
||||||
let today = Date.vnNew();
|
() => vnTableRef.value.tableRef?.$el,
|
||||||
const tomorrow = new Date(today);
|
($el) => {
|
||||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
if (!$el) return;
|
||||||
userParams.dateFuture = tomorrow;
|
const head = $el.querySelector('thead');
|
||||||
userParams.dateToAdvance = today;
|
const firstRow = $el.querySelector('thead > tr');
|
||||||
userParams.scopeDays = 1;
|
|
||||||
userParams.warehouseFk = user.value.warehouseFk;
|
|
||||||
const filter = { limit: 0 };
|
|
||||||
await arrayData.addFilter({ filter, userParams });
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
const newRow = document.createElement('tr');
|
||||||
|
destinationElRef.value = document.createElement('th');
|
||||||
|
originElRef.value = document.createElement('th');
|
||||||
|
|
||||||
|
newRow.classList.add('bg-header');
|
||||||
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
|
||||||
|
destinationElRef.value.setAttribute('colspan', '7');
|
||||||
|
originElRef.value.setAttribute('colspan', '9');
|
||||||
|
|
||||||
|
destinationElRef.value.textContent = `${t(
|
||||||
|
'advanceTickets.destination'
|
||||||
|
)} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`;
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat(
|
||||||
|
vnTableRef.value.params.dateFuture
|
||||||
|
)}`;
|
||||||
|
|
||||||
|
newRow.append(destinationElRef.value, originElRef.value);
|
||||||
|
head.insertBefore(newRow, firstRow);
|
||||||
|
},
|
||||||
|
{ once: true, inmmediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => vnTableRef.value.params,
|
||||||
|
() => {
|
||||||
|
if (originElRef.value && destinationElRef.value) {
|
||||||
|
destinationElRef.value.textContent = `${t(
|
||||||
|
'advanceTickets.destination'
|
||||||
|
)} ${toDateFormat(vnTableRef.value.params.dateToAdvance)}`;
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.origin')} ${toDateFormat(
|
||||||
|
vnTableRef.value.params.dateFuture
|
||||||
|
)}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="itemPackingTypes"
|
url="itemPackingTypes"
|
||||||
|
@ -488,11 +393,6 @@ onMounted(async () => {
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (zonesOptions = data)"
|
@on-fetch="(data) => (zonesOptions = data)"
|
||||||
/>
|
/>
|
||||||
<VnSearchbar
|
|
||||||
data-key="WeeklyTickets"
|
|
||||||
:label="t('weeklyTickets.search')"
|
|
||||||
:info="t('weeklyTickets.searchInfo')"
|
|
||||||
/>
|
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -536,174 +436,109 @@ onMounted(async () => {
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<TicketAdvanceFilter data-key="AdvanceTickets" />
|
<TicketAdvanceFilter data-key="advanceTickets" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<VnTable
|
||||||
:rows="tickets"
|
data-key="advanceTickets"
|
||||||
|
ref="vnTableRef"
|
||||||
|
url="Tickets/getTicketsAdvance"
|
||||||
|
search-url="advanceTickets"
|
||||||
|
:user-params="userParams"
|
||||||
|
:limit="0"
|
||||||
:columns="ticketColumns"
|
:columns="ticketColumns"
|
||||||
row-key="index"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': '$index',
|
||||||
|
selection: 'multiple',
|
||||||
|
}"
|
||||||
v-model:selected="selectedTickets"
|
v-model:selected="selectedTickets"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
:pagination="{ rowsPerPage: 0 }"
|
||||||
:no-data-label="t('globals.noResults')"
|
:no-data-label="t('globals.noResults')"
|
||||||
style="max-width: 99%"
|
:right-search="false"
|
||||||
|
auto-load
|
||||||
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #column-icons="{ row }">
|
||||||
{{ userParams.scopeDays }}
|
<QIcon
|
||||||
<QTr :props="props">
|
v-if="row.futureAgency !== row.agency && row.agency"
|
||||||
<QTh
|
color="primary"
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
name="vn:agency-term"
|
||||||
colspan="7"
|
size="xs"
|
||||||
translate
|
>
|
||||||
>
|
<QTooltip class="column">
|
||||||
{{ t('advanceTickets.destination') }}
|
<span>
|
||||||
{{ toDateFormat(userParams.dateToAdvance) }}
|
{{
|
||||||
</QTh>
|
t('advanceTickets.originAgency', {
|
||||||
<QTh
|
agency: row.futureAgency,
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
})
|
||||||
colspan="9"
|
}}
|
||||||
translate
|
</span>
|
||||||
>
|
<span>
|
||||||
{{ t('advanceTickets.origin') }}
|
{{
|
||||||
{{ toDateFormat(userParams.dateFuture) }}
|
t('advanceTickets.destinationAgency', {
|
||||||
</QTh>
|
agency: row.agency,
|
||||||
</QTr>
|
})
|
||||||
<QTr>
|
}}
|
||||||
<QTh>
|
</span>
|
||||||
<QCheckbox v-model="props.selected" />
|
</QTooltip>
|
||||||
</QTh>
|
</QIcon>
|
||||||
<QTh
|
|
||||||
v-for="(col, index) in ticketColumns"
|
|
||||||
:key="index"
|
|
||||||
:class="{ 'vertical-separator': col.name === 'futureId' }"
|
|
||||||
>
|
|
||||||
{{ col.label }}
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
</template>
|
||||||
<template #top-row="{ cols }">
|
<template #column-id="{ row }">
|
||||||
<QTr>
|
<QBtn flat class="link">
|
||||||
<QTd />
|
{{ row.id }}
|
||||||
<QTd
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
v-for="(col, index) in cols"
|
</QBtn>
|
||||||
: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>
|
||||||
<template #header-cell-availableLines="{ col }">
|
<template #column-state="{ row }">
|
||||||
<QTh class="vertical-separator">
|
<QBadge
|
||||||
{{ col.label }}
|
v-if="row.state"
|
||||||
</QTh>
|
text-color="black"
|
||||||
|
:color="row.classColor"
|
||||||
|
class="q-ma-none"
|
||||||
|
dense
|
||||||
|
>
|
||||||
|
{{ row.state }}
|
||||||
|
</QBadge>
|
||||||
|
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-icons="{ row }">
|
<template #column-import="{ row }">
|
||||||
<QTd class="q-gutter-x-xs">
|
<QBadge
|
||||||
<QIcon
|
:text-color="isLessThan50(row.totalWithVat) ? 'black' : 'white'"
|
||||||
v-if="row.futureAgency !== row.agency && row.agency"
|
:color="totalPriceColor(row.totalWithVat)"
|
||||||
color="primary"
|
class="q-ma-none"
|
||||||
name="vn:agency-term"
|
dense
|
||||||
size="xs"
|
>
|
||||||
>
|
{{ toCurrency(row.totalWithVat || 0) }}
|
||||||
<QTooltip class="column">
|
</QBadge>
|
||||||
<span>
|
|
||||||
{{
|
|
||||||
t('advanceTickets.originAgency', {
|
|
||||||
agency: row.futureAgency,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
{{
|
|
||||||
t('advanceTickets.destinationAgency', {
|
|
||||||
agency: row.agency,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-futureId="{ row }">
|
||||||
<template #body-cell-ticketId="{ row }">
|
<QBtn flat class="link" dense>
|
||||||
<QTd>
|
{{ row.futureId }}
|
||||||
<QBtn flat class="link">
|
<TicketDescriptorProxy :id="row.futureId" />
|
||||||
{{ row.id }}
|
</QBtn>
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-state="{ row }">
|
<template #column-futureState="{ row }">
|
||||||
<QTd>
|
<QBadge
|
||||||
<QBadge
|
text-color="black"
|
||||||
v-if="row.state"
|
:color="row.futureClassColor"
|
||||||
text-color="black"
|
class="q-ma-none"
|
||||||
:color="row.classColor"
|
dense
|
||||||
class="q-ma-none"
|
>
|
||||||
dense
|
{{ row.futureState }}
|
||||||
>
|
</QBadge>
|
||||||
{{ row.state }}
|
|
||||||
</QBadge>
|
|
||||||
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-import="{ row }">
|
<template #column-futureImport="{ row }">
|
||||||
<QTd>
|
<QBadge
|
||||||
<QBadge
|
:text-color="isLessThan50(row.futureTotalWithVat) ? 'black' : 'white'"
|
||||||
:text-color="isLessThan50(row.totalWithVat) ? 'black' : 'white'"
|
:color="totalPriceColor(row.futureTotalWithVat)"
|
||||||
:color="totalPriceColor(row.totalWithVat)"
|
class="q-ma-none"
|
||||||
class="q-ma-none"
|
dense
|
||||||
dense
|
>
|
||||||
>
|
{{ toCurrency(row.futureTotalWithVat || 0) }}
|
||||||
{{ toCurrency(row.totalWithVat || 0) }}
|
</QBadge>
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureId="{ row }">
|
</VnTable>
|
||||||
<QTd class="vertical-separator">
|
|
||||||
<QBtn flat class="link" dense>
|
|
||||||
{{ row.futureId }}
|
|
||||||
<TicketDescriptorProxy :id="row.futureId" />
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-futureState="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<QBadge
|
|
||||||
text-color="black"
|
|
||||||
:color="row.futureClassColor"
|
|
||||||
class="q-ma-none"
|
|
||||||
dense
|
|
||||||
>
|
|
||||||
{{ row.futureState }}
|
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-futureImport="{ row }">
|
|
||||||
<QTd>
|
|
||||||
<QBadge
|
|
||||||
:text-color="
|
|
||||||
isLessThan50(row.futureTotalWithVat) ? 'black' : 'white'
|
|
||||||
"
|
|
||||||
:color="totalPriceColor(row.futureTotalWithVat)"
|
|
||||||
class="q-ma-none"
|
|
||||||
dense
|
|
||||||
>
|
|
||||||
{{ toCurrency(row.futureTotalWithVat || 0) }}
|
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
<VnProgress
|
<VnProgress
|
||||||
:progress="progressPercentage"
|
:progress="progressPercentage"
|
||||||
:cancelled="cancelProgress"
|
:cancelled="cancelProgress"
|
||||||
|
@ -722,11 +557,11 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.vertical-separator {
|
:deep(.vertical-separator) {
|
||||||
border-left: 4px solid white !important;
|
border-left: 4px solid white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.horizontal-separator {
|
:deep(.horizontal-separator) {
|
||||||
border-bottom: 4px solid white !important;
|
border-top: 4px solid white !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import axios from 'axios';
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -27,20 +27,21 @@ const warehousesOptions = ref([]);
|
||||||
const itemPackingTypes = ref([]);
|
const itemPackingTypes = ref([]);
|
||||||
|
|
||||||
const getItemPackingTypes = async () => {
|
const getItemPackingTypes = async () => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
where: { isActive: true },
|
||||||
where: { isActive: true },
|
};
|
||||||
};
|
const { data } = await axios.get('ItemPackingTypes', {
|
||||||
const { data } = await axios.get('ItemPackingTypes', {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
itemPackingTypes.value = data.map((ipt) => ({
|
||||||
itemPackingTypes.value = data.map((ipt) => ({
|
description: t(ipt.description),
|
||||||
description: t(ipt.description),
|
code: ipt.code,
|
||||||
code: ipt.code,
|
}));
|
||||||
}));
|
};
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
const getLocale = (val) => {
|
||||||
}
|
const param = `params.${val}`;
|
||||||
|
return te(param) ? t(param) : t(`globals.${param}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => await getItemPackingTypes());
|
onMounted(async () => await getItemPackingTypes());
|
||||||
|
@ -53,6 +54,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
|
search-url="advanceTickets"
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:search-button="true"
|
:search-button="true"
|
||||||
:hidden-tags="['search']"
|
:hidden-tags="['search']"
|
||||||
|
@ -60,7 +62,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
>
|
>
|
||||||
<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>{{ getLocale(tag.label) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -96,6 +98,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
:use-like="false"
|
||||||
>
|
>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -113,6 +116,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
:use-like="false"
|
||||||
>
|
>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -136,6 +140,19 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('globals.params.departmentFk')"
|
||||||
|
v-model="params.departmentFk"
|
||||||
|
url="Departments"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
|
@ -20,11 +20,31 @@ const provinces = ref([]);
|
||||||
const states = ref([]);
|
const states = ref([]);
|
||||||
const agencies = ref([]);
|
const agencies = ref([]);
|
||||||
const warehouses = ref([]);
|
const warehouses = ref([]);
|
||||||
|
const groupedStates = ref([]);
|
||||||
|
|
||||||
|
const getGroupedStates = (data) => {
|
||||||
|
for (const state of data) {
|
||||||
|
groupedStates.value.push({
|
||||||
|
id: state.id,
|
||||||
|
name: t(`${state.code}`),
|
||||||
|
code: state.code,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Provinces" @on-fetch="(data) => (provinces = data)" auto-load />
|
<FetchData url="Provinces" @on-fetch="(data) => (provinces = data)" auto-load />
|
||||||
<FetchData url="States" @on-fetch="(data) => (states = data)" auto-load />
|
<FetchData url="States" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
|
<FetchData
|
||||||
|
url="AlertLevels"
|
||||||
|
@on-fetch="
|
||||||
|
(data) => {
|
||||||
|
getGroupedStates(data);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<FetchData url="AgencyModes" @on-fetch="(data) => (agencies = data)" auto-load />
|
<FetchData url="AgencyModes" @on-fetch="(data) => (agencies = data)" auto-load />
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
||||||
|
@ -90,12 +110,35 @@ const warehouses = ref([]);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection v-if="!groupedStates">
|
||||||
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection v-if="groupedStates">
|
||||||
|
<QSelect
|
||||||
|
:label="t('Grouped state')"
|
||||||
|
v-model="params.groupedStates"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
:options="groupedStates"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
use-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
sort-by="name ASC"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -114,6 +157,15 @@ const warehouses = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.nickname"
|
||||||
|
:label="t('Nickname')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
@ -176,6 +228,7 @@ const warehouses = ref([]);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -196,6 +249,7 @@ const warehouses = ref([]);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -216,12 +270,22 @@ const warehouses = ref([]);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.collectionFk"
|
||||||
|
:label="t('Collection')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
</QExpansionItem>
|
</QExpansionItem>
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
|
@ -245,6 +309,11 @@ en:
|
||||||
provinceFk: Province
|
provinceFk: Province
|
||||||
agencyModeFk: Agency
|
agencyModeFk: Agency
|
||||||
warehouseFk: Warehouse
|
warehouseFk: Warehouse
|
||||||
|
FREE: Free
|
||||||
|
ON_PREPARATION: On preparation
|
||||||
|
PACKED: Packed
|
||||||
|
DELIVERED: Delivered
|
||||||
|
ON_PREVIOUS: ON_PREVIOUS
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Contiene
|
search: Contiene
|
||||||
|
@ -278,4 +347,12 @@ es:
|
||||||
Yes: Si
|
Yes: Si
|
||||||
No: No
|
No: No
|
||||||
Days onward: Días adelante
|
Days onward: Días adelante
|
||||||
|
Grouped state: Estado agrupado
|
||||||
|
FREE: Libre
|
||||||
|
ON_PREPARATION: En preparación
|
||||||
|
PACKED: Encajado
|
||||||
|
DELIVERED: Servido
|
||||||
|
ON_PREVIOUS: ON_PREVIOUS
|
||||||
|
Collection: Colección
|
||||||
|
Nickname: Nombre mostrado
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -24,33 +24,25 @@ const itemPackingTypes = ref([]);
|
||||||
const stateOptions = ref([]);
|
const stateOptions = ref([]);
|
||||||
|
|
||||||
const getItemPackingTypes = async () => {
|
const getItemPackingTypes = async () => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
where: { isActive: true },
|
||||||
where: { isActive: true },
|
};
|
||||||
};
|
const { data } = await axios.get('ItemPackingTypes', {
|
||||||
const { data } = await axios.get('ItemPackingTypes', {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
itemPackingTypes.value = data.map((ipt) => ({
|
||||||
itemPackingTypes.value = data.map((ipt) => ({
|
description: t(ipt.description),
|
||||||
description: t(ipt.description),
|
code: ipt.code,
|
||||||
code: ipt.code,
|
}));
|
||||||
}));
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getGroupedStates = async () => {
|
const getGroupedStates = async () => {
|
||||||
try {
|
const { data } = await axios.get('AlertLevels');
|
||||||
const { data } = await axios.get('AlertLevels');
|
stateOptions.value = data.map((state) => ({
|
||||||
stateOptions.value = data.map((state) => ({
|
id: state.id,
|
||||||
id: state.id,
|
name: t(`futureTickets.${state.code}`),
|
||||||
name: t(`futureTickets.${state.code}`),
|
code: state.code,
|
||||||
code: state.code,
|
}));
|
||||||
}));
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
@ -95,6 +95,7 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
|
columnClass: 'expand',
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -153,11 +154,6 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
columnClass: 'expand',
|
columnClass: 'expand',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'refFk',
|
|
||||||
label: t('ticketList.ref'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'zoneFk',
|
name: 'zoneFk',
|
||||||
|
@ -191,6 +187,12 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
format: (row) => toCurrency(row.totalWithVat),
|
format: (row) => toCurrency(row.totalWithVat),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'packing',
|
||||||
|
label: t('ticketSale.packaging'),
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.packing),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
|
@ -548,7 +550,7 @@ function setReference(data) {
|
||||||
</template>
|
</template>
|
||||||
<template #column-salesPersonFk="{ row }">
|
<template #column-salesPersonFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row.salesPerson }}
|
{{ dashIfEmpty(row.userName) }}
|
||||||
<CustomerDescriptorProxy :id="row.salesPersonFk" />
|
<CustomerDescriptorProxy :id="row.salesPersonFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -577,16 +579,16 @@ function setReference(data) {
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QChip>
|
</QChip>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else-if="row.state === 'Entregado'">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.refFk }}
|
||||||
|
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-refFk="{ row }">
|
|
||||||
<span class="link" @click.stop>
|
|
||||||
{{ dashIfEmpty(row.refFk) }}
|
|
||||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template #column-zoneFk="{ row }">
|
<template #column-zoneFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ dashIfEmpty(row.zoneName) }}
|
{{ dashIfEmpty(row.zoneName) }}
|
||||||
|
|
|
@ -100,7 +100,7 @@ weeklyTickets:
|
||||||
advanceTickets:
|
advanceTickets:
|
||||||
preparation: Preparación
|
preparation: Preparación
|
||||||
origin: Origen
|
origin: Origen
|
||||||
destination: Destinatario
|
destination: Destino
|
||||||
originAgency: 'Agencia origen: {agency}'
|
originAgency: 'Agencia origen: {agency}'
|
||||||
destinationAgency: 'Agencia destino: {agency}'
|
destinationAgency: 'Agencia destino: {agency}'
|
||||||
ticketId: ID
|
ticketId: ID
|
||||||
|
|
|
@ -17,6 +17,11 @@ const $props = defineProps({
|
||||||
required: false,
|
required: false,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'workerData',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const image = ref(null);
|
const image = ref(null);
|
||||||
|
|
||||||
|
@ -65,7 +70,7 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="Worker"
|
module="Worker"
|
||||||
data-key="workerData"
|
:data-key="dataKey"
|
||||||
url="Workers/descriptor"
|
url="Workers/descriptor"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
title="user.nickname"
|
title="user.nickname"
|
||||||
|
|
|
@ -12,6 +12,11 @@ const $props = defineProps({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" />
|
<WorkerDescriptor
|
||||||
|
v-if="$props.id"
|
||||||
|
:id="$props.id"
|
||||||
|
:summary="WorkerSummary"
|
||||||
|
data-key="workerDescriptorProxy"
|
||||||
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -44,8 +44,9 @@ async function toggleNotification(notification) {
|
||||||
`worker.notificationsManager.${notification.active ? '' : 'un'}subscribed`
|
`worker.notificationsManager.${notification.active ? '' : 'un'}subscribed`
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (e) {
|
||||||
notification.active = !notification.active;
|
notification.active = !notification.active;
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,204 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import CrudModel from 'components/CrudModel.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const crudModelRef = ref();
|
||||||
|
const warehousesData = ref([]);
|
||||||
|
const itemPackingTypesData = ref([]);
|
||||||
|
const sectorsData = ref([]);
|
||||||
|
const trainsData = ref([]);
|
||||||
|
const machinesData = ref([]);
|
||||||
|
const route = useRoute();
|
||||||
|
const routeId = computed(() => route.params.id);
|
||||||
|
|
||||||
|
const initialData = computed(() => {
|
||||||
|
return {
|
||||||
|
workerFk: routeId.value,
|
||||||
|
numberOfWagons: 2,
|
||||||
|
trainFk: 1,
|
||||||
|
itemPackingTypeFk: 'H',
|
||||||
|
warehouseFk: 60,
|
||||||
|
sectorFk: null,
|
||||||
|
labelerFk: null,
|
||||||
|
linesLimit: 20,
|
||||||
|
volumenLimit: 0.5,
|
||||||
|
sizeLimit: null,
|
||||||
|
isOnReservationMode: 0,
|
||||||
|
machineFk: null,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
async function insert() {
|
||||||
|
await axios.post('Operators', initialData.value);
|
||||||
|
crudModelRef.value.reload();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QPage class="column items-center q-pa-md centerCard">
|
||||||
|
<FetchData url="Trains" @on-fetch="(data) => (trainsData = data)" auto-load />
|
||||||
|
<FetchData
|
||||||
|
url="ItemPackingTypes"
|
||||||
|
@on-fetch="(data) => (itemPackingTypesData = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Warehouses"
|
||||||
|
@on-fetch="(data) => (warehousesData = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData url="Printers" @on-fetch="(data) => (PrintersData = data)" auto-load />
|
||||||
|
<FetchData url="Sectors" @on-fetch="(data) => (sectorsData = data)" auto-load />
|
||||||
|
<FetchData url="Machines" @on-fetch="(data) => (machinesData = data)" auto-load />
|
||||||
|
<CrudModel
|
||||||
|
data-key="workerOperator"
|
||||||
|
url="Operators"
|
||||||
|
primary-key="workerFk"
|
||||||
|
:filter="{ where: { workerFk: route.params.id } }"
|
||||||
|
:data-required="{ workerFk: route.params.id }"
|
||||||
|
ref="crudModelRef"
|
||||||
|
search-url="operator"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<div v-if="rows.length">
|
||||||
|
<QCard
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:key="row.$index"
|
||||||
|
v-for="row of rows"
|
||||||
|
class="card q-px-md q-mb-sm container"
|
||||||
|
>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.operator.numberOfWagons')"
|
||||||
|
v-model="row.numberOfWagons"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.train')"
|
||||||
|
:options="trainsData"
|
||||||
|
hide-selected
|
||||||
|
v-model="row.trainFk"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.itemPackingType')"
|
||||||
|
:options="itemPackingTypesData"
|
||||||
|
hide-selected
|
||||||
|
option-label="code"
|
||||||
|
option-value="code"
|
||||||
|
v-model="row.itemPackingTypeFk"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.warehouse')"
|
||||||
|
:options="warehousesData"
|
||||||
|
hide-selected
|
||||||
|
v-model="row.warehouseFk"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.sector')"
|
||||||
|
:options="sectorsData"
|
||||||
|
hide-selected
|
||||||
|
option-label="description"
|
||||||
|
v-model="row.sectorFk"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.labeler')"
|
||||||
|
:options="PrintersData"
|
||||||
|
hide-selected
|
||||||
|
option-label="name"
|
||||||
|
v-model="row.labelerFk"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
>ID: {{ scope.opt?.id }}</QItemLabel
|
||||||
|
>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.id }},
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.operator.linesLimit')"
|
||||||
|
v-model="row.linesLimit"
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.operator.volumeLimit')"
|
||||||
|
v-model="row.volumeLimit"
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.operator.sizeLimit')"
|
||||||
|
v-model="row.sizeLimit"
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('worker.operator.isOnReservationMode')"
|
||||||
|
v-model="row.isOnReservationMode"
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('worker.operator.machine')"
|
||||||
|
:options="machinesData"
|
||||||
|
hide-selected
|
||||||
|
option-label="plate"
|
||||||
|
v-model="row.machineFk"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</QCard>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</CrudModel>
|
||||||
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
|
<QBtn
|
||||||
|
fab
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
@click="insert()"
|
||||||
|
v-if="!crudModelRef?.formData?.length"
|
||||||
|
/>
|
||||||
|
</QPageSticky>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.btn-delete {
|
||||||
|
max-width: 4%;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Model: Modelo
|
||||||
|
Serial number: Número de serie
|
||||||
|
Current SIM: SIM actual
|
||||||
|
Add new device: Añadir nuevo dispositivo
|
||||||
|
PDA deallocated: PDA desasignada
|
||||||
|
Remove PDA: Eliminar PDA
|
||||||
|
Do you want to remove this PDA?: ¿Desea eliminar este PDA?
|
||||||
|
You can only have one PDA: Solo puedes tener un PDA si no eres autonomo
|
||||||
|
This PDA is already assigned to another user: Este PDA ya está asignado a otro usuario
|
||||||
|
</i18n>
|
|
@ -34,21 +34,13 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const deleteWarehouse = async (row) => {
|
const deleteWarehouse = async (row) => {
|
||||||
try {
|
await axios.delete(`${urlPath.value}/${row.id}`);
|
||||||
await axios.delete(`${urlPath.value}/${row.id}`);
|
fetchWarehouses();
|
||||||
fetchWarehouses();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const createZoneWarehouse = async (ZoneWarehouseFormData) => {
|
const createZoneWarehouse = async (ZoneWarehouseFormData) => {
|
||||||
try {
|
await axios.post(urlPath.value, ZoneWarehouseFormData);
|
||||||
await axios.post(urlPath.value, ZoneWarehouseFormData);
|
fetchWarehouses();
|
||||||
fetchWarehouses();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
|
@ -27,6 +27,7 @@ export default {
|
||||||
'WorkerBalance',
|
'WorkerBalance',
|
||||||
'WorkerFormation',
|
'WorkerFormation',
|
||||||
'WorkerMedical',
|
'WorkerMedical',
|
||||||
|
'WorkerOperator',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -208,6 +209,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerOperator',
|
||||||
|
path: 'operator',
|
||||||
|
meta: {
|
||||||
|
title: 'operator',
|
||||||
|
icon: 'person',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
export const useStateQueryStore = defineStore('stateQueryStore', () => {
|
||||||
|
const queries = ref(new Set());
|
||||||
|
|
||||||
|
function add(query) {
|
||||||
|
queries.value.add(query);
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isLoading() {
|
||||||
|
return computed(() => queries.value.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(query) {
|
||||||
|
queries.value.delete(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
queries.value = new Set();
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
add,
|
||||||
|
isLoading,
|
||||||
|
remove,
|
||||||
|
queries,
|
||||||
|
reset,
|
||||||
|
};
|
||||||
|
});
|
|
@ -33,7 +33,8 @@ describe('ClaimDevelopment', () => {
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add and remove new line', () => {
|
// TODO: #8112
|
||||||
|
xit('should add and remove new line', () => {
|
||||||
cy.wait(['@workers', '@workers']);
|
cy.wait(['@workers', '@workers']);
|
||||||
cy.addCard();
|
cy.addCard();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client consignee', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/address', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client balance', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/balance', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client basic data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/basic-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client billing data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/billing-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client credits', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/credits', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client fiscal data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/fiscal-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client greuges', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/greuges', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,63 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client list', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/customer/list', {
|
||||||
|
timeout: 5000,
|
||||||
|
onBeforeLoad(win) {
|
||||||
|
cy.stub(win, 'open');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Client list create new client', () => {
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
const data = {
|
||||||
|
Name: { val: 'Name 1' },
|
||||||
|
'Social name': { val: 'TEST 1' },
|
||||||
|
'Tax number': { val: '20852113Z' },
|
||||||
|
'Web user': { val: 'user_test_1' },
|
||||||
|
Street: { val: 'C/ STREET 1' },
|
||||||
|
Email: { val: 'user.test@1.com' },
|
||||||
|
'Business type': { val: 'Otros', type: 'select' },
|
||||||
|
'Sales person': { val: 'salesboss', type: 'select' },
|
||||||
|
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
||||||
|
};
|
||||||
|
cy.fillInForm(data);
|
||||||
|
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
|
||||||
|
cy.checkNotification('created');
|
||||||
|
cy.url().should('include', '/summary');
|
||||||
|
});
|
||||||
|
it('Client list search client', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
|
||||||
|
cy.get('.title > span').should('have.text', search);
|
||||||
|
let id = null;
|
||||||
|
cy.get('.q-item > .q-item__label').then((text) => {
|
||||||
|
id = text.text().trim().split('#')[1];
|
||||||
|
cy.get('.q-item > .q-item__label').should('have.text', ` #${id}`);
|
||||||
|
cy.url().should('include', `/customer/${id}/summary`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Client founded create ticket', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
cy.clickButtonsDescriptor(2);
|
||||||
|
cy.waitForElement('#formModel');
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
cy.checkValueForm(1, search);
|
||||||
|
});
|
||||||
|
it('Client founded create order', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
cy.clickButtonsDescriptor(4);
|
||||||
|
cy.waitForElement('#formModel');
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
cy.checkValueForm(2, search);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client notes', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/notes', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client recoveries', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/recoveries', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client web-access', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/web-access', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client credit opinion', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/credit-management/credit-contracts', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client credit opinion', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/credit-management/credit-opinion', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client consumption', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/others/consumption', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client contacts', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/others/contacts', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client mandates', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/mandates', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client samples', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/others/samples', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client unpaid', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/unpaid', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Client web payments', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1101/others/web-payments', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Should load layout', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -13,7 +13,7 @@ describe('Logout', () => {
|
||||||
});
|
});
|
||||||
describe('not user', () => {
|
describe('not user', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept('GET', '**/VnUsers/acl', {
|
cy.intercept('GET', '**DefaultViewConfigs**', {
|
||||||
statusCode: 401,
|
statusCode: 401,
|
||||||
body: {
|
body: {
|
||||||
error: {
|
error: {
|
||||||
|
@ -24,10 +24,11 @@ describe('Logout', () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
statusMessage: 'AUTHORIZATION_REQUIRED',
|
statusMessage: 'AUTHORIZATION_REQUIRED',
|
||||||
}).as('someRoute');
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when token not exists', () => {
|
it('when token not exists', () => {
|
||||||
cy.reload();
|
cy.get('.q-list > [href="#/item"]').click();
|
||||||
cy.get('.q-notification__message').should(
|
cy.get('.q-notification__message').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
'Authorization Required'
|
'Authorization Required'
|
||||||
|
|
|
@ -7,31 +7,20 @@ describe('AgencyWorkCenter', () => {
|
||||||
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
||||||
const workCenterCombobox = 'input[role="combobox"]';
|
const workCenterCombobox = 'input[role="combobox"]';
|
||||||
|
|
||||||
it('assign workCenter', () => {
|
it('check workCenter crud', () => {
|
||||||
|
// create
|
||||||
cy.get(createButton).click();
|
cy.get(createButton).click();
|
||||||
cy.get(workCenterCombobox).type('workCenterOne{enter}');
|
cy.get(workCenterCombobox).type('workCenterOne{enter}');
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
cy.hasNotify('Data created');
|
||||||
});
|
|
||||||
|
|
||||||
it('delete workCenter', () => {
|
// expect error when duplicate
|
||||||
|
cy.get(createButton).click();
|
||||||
|
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||||
|
cy.hasNotify('This workCenter is already assigned to this agency');
|
||||||
|
cy.get('[data-cy="FormModelPopup_cancel"]').click();
|
||||||
|
|
||||||
|
// delete
|
||||||
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
|
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
cy.get('.q-notification__message').should(
|
cy.hasNotify('WorkCenter removed successfully');
|
||||||
'have.text',
|
|
||||||
'WorkCenter removed successfully'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('error on duplicate workCenter', () => {
|
|
||||||
cy.get(createButton).click();
|
|
||||||
cy.get(workCenterCombobox).type('workCenterOne{enter}');
|
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
|
||||||
cy.get(createButton).click();
|
|
||||||
cy.get(
|
|
||||||
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
||||||
).type('workCenterOne{enter}');
|
|
||||||
|
|
||||||
cy.get(
|
|
||||||
':nth-child(2) > .q-notification__wrapper > .q-notification__content > .q-notification__message'
|
|
||||||
).should('have.text', 'This workCenter is already assigned to this agency');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
describe('Ticket expedtion', () => {
|
||||||
|
const tableContent = '.q-table .q-virtual-scroll__content';
|
||||||
|
const stateTd = 'td:nth-child(9)';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('developer');
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should change the state', () => {
|
||||||
|
cy.visit('#/ticket/1/expedition');
|
||||||
|
cy.intercept('GET', /\/api\/Expeditions\/filter/).as('expeditions');
|
||||||
|
cy.intercept('POST', /\/api\/Expeditions\/crud/).as('crud');
|
||||||
|
|
||||||
|
cy.wait('@expeditions');
|
||||||
|
|
||||||
|
cy.selectRows([1, 2]);
|
||||||
|
cy.get('#subToolbar [aria-controls]:nth-child(1)').click();
|
||||||
|
cy.get('.q-menu .q-item').contains('Perdida').click();
|
||||||
|
cy.wait('@crud');
|
||||||
|
|
||||||
|
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
|
||||||
|
cy.wrap($el).contains('Perdida');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -17,10 +17,7 @@ describe('WorkerNotificationsManager', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/worker/${salesPersonId}/notifications`);
|
cy.visit(`/#/worker/${salesPersonId}/notifications`);
|
||||||
cy.get(firstAvailableNotification).click();
|
cy.get(firstAvailableNotification).click();
|
||||||
cy.notificationHas(
|
cy.hasNotify('The notification subscription of this worker cant be modified');
|
||||||
'.q-notification__message',
|
|
||||||
'The notification subscription of this worker cant be modified'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should active a notification that is yours', () => {
|
it('should active a notification that is yours', () => {
|
||||||
|
|
|
@ -152,6 +152,14 @@ Cypress.Commands.add('notificationHas', (selector, text) => {
|
||||||
cy.get(selector).should('have.text', text);
|
cy.get(selector).should('have.text', text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('selectRows', (rows) => {
|
||||||
|
rows.forEach((row) => {
|
||||||
|
cy.get('.q-table .q-virtual-scroll__content tr .q-checkbox__inner')
|
||||||
|
.eq(row - 1)
|
||||||
|
.click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('fillRow', (rowSelector, data) => {
|
Cypress.Commands.add('fillRow', (rowSelector, data) => {
|
||||||
// Usar el selector proporcionado para obtener la fila deseada
|
// Usar el selector proporcionado para obtener la fila deseada
|
||||||
cy.waitForElement('tbody');
|
cy.waitForElement('tbody');
|
||||||
|
@ -254,3 +262,14 @@ Cypress.Commands.add('openUserPanel', () => {
|
||||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
|
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
|
||||||
).click();
|
).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('hasNotify', (text) => {
|
||||||
|
//last
|
||||||
|
cy.get('.q-notification')
|
||||||
|
.should('be.visible')
|
||||||
|
.last()
|
||||||
|
.then(($lastNotification) => {
|
||||||
|
if (!Cypress.$($lastNotification).text().includes(text))
|
||||||
|
throw new Error(`Notification not found: "${text}"`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -7,75 +7,59 @@ vi.mock('src/composables/useSession', () => ({
|
||||||
getToken: () => 'DEFAULT_TOKEN',
|
getToken: () => 'DEFAULT_TOKEN',
|
||||||
isLoggedIn: () => vi.fn(),
|
isLoggedIn: () => vi.fn(),
|
||||||
destroy: () => vi.fn(),
|
destroy: () => vi.fn(),
|
||||||
})
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock('src/stores/useStateQueryStore', () => ({
|
||||||
|
useStateQueryStore: () => ({
|
||||||
|
add: () => vi.fn(),
|
||||||
|
remove: () => vi.fn(),
|
||||||
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('Axios boot', () => {
|
describe('Axios boot', () => {
|
||||||
|
|
||||||
describe('onRequest()', async () => {
|
describe('onRequest()', async () => {
|
||||||
it('should set the "Authorization" property on the headers', async () => {
|
it('should set the "Authorization" property on the headers', async () => {
|
||||||
const config = { headers: {} };
|
const config = { headers: {} };
|
||||||
|
|
||||||
const resultConfig = onRequest(config);
|
const resultConfig = onRequest(config);
|
||||||
|
|
||||||
expect(resultConfig).toEqual(expect.objectContaining({
|
expect(resultConfig).toEqual(
|
||||||
headers: {
|
|
||||||
Authorization: 'DEFAULT_TOKEN'
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
describe('onResponseError()', async () => {
|
|
||||||
it('should call to the Notify plugin with a message error for an status code "500"', async () => {
|
|
||||||
Notify.create = vi.fn()
|
|
||||||
|
|
||||||
const error = {
|
|
||||||
response: {
|
|
||||||
status: 500
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = onResponseError(error);
|
|
||||||
|
|
||||||
|
|
||||||
expect(result).rejects.toEqual(
|
|
||||||
expect.objectContaining(error)
|
|
||||||
);
|
|
||||||
expect(Notify.create).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
message: 'An internal server error has ocurred',
|
headers: {
|
||||||
type: 'negative',
|
Authorization: 'DEFAULT_TOKEN',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('onResponseError()', async () => {
|
||||||
|
it('should call to the Notify plugin with a message error for an status code "500"', async () => {
|
||||||
|
const error = {
|
||||||
|
response: {
|
||||||
|
status: 500,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = onResponseError(error);
|
||||||
|
expect(result).rejects.toEqual(expect.objectContaining(error));
|
||||||
|
});
|
||||||
|
|
||||||
it('should call to the Notify plugin with a message from the response property', async () => {
|
it('should call to the Notify plugin with a message from the response property', async () => {
|
||||||
Notify.create = vi.fn()
|
|
||||||
|
|
||||||
const error = {
|
const error = {
|
||||||
response: {
|
response: {
|
||||||
status: 401,
|
status: 401,
|
||||||
data: {
|
data: {
|
||||||
error: {
|
error: {
|
||||||
message: 'Invalid user or password'
|
message: 'Invalid user or password',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = onResponseError(error);
|
const result = onResponseError(error);
|
||||||
|
expect(result).rejects.toEqual(expect.objectContaining(error));
|
||||||
|
|
||||||
expect(result).rejects.toEqual(
|
|
||||||
expect.objectContaining(error)
|
|
||||||
);
|
|
||||||
expect(Notify.create).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
message: 'Invalid user or password',
|
|
||||||
type: 'negative',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
import { describe, expect, it, beforeEach, beforeAll } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
|
||||||
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
|
||||||
|
describe('useStateQueryStore', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
createWrapper({}, {});
|
||||||
|
});
|
||||||
|
|
||||||
|
const stateQueryStore = useStateQueryStore();
|
||||||
|
const { add, isLoading, remove, reset } = useStateQueryStore();
|
||||||
|
const firstQuery = { url: 'myQuery' };
|
||||||
|
|
||||||
|
function getQueries() {
|
||||||
|
return stateQueryStore.queries;
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
reset();
|
||||||
|
expect(getQueries().size).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add two queries', async () => {
|
||||||
|
expect(getQueries().size).toBeFalsy();
|
||||||
|
add(firstQuery);
|
||||||
|
|
||||||
|
expect(getQueries().size).toBeTruthy();
|
||||||
|
expect(getQueries().has(firstQuery)).toBeTruthy();
|
||||||
|
|
||||||
|
add();
|
||||||
|
expect(getQueries().size).toBe(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add and remove loading state', async () => {
|
||||||
|
expect(isLoading().value).toBeFalsy();
|
||||||
|
add(firstQuery);
|
||||||
|
expect(isLoading().value).toBeTruthy();
|
||||||
|
remove(firstQuery);
|
||||||
|
expect(isLoading().value).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add and remove query', async () => {
|
||||||
|
const secondQuery = { ...firstQuery };
|
||||||
|
const thirdQuery = { ...firstQuery };
|
||||||
|
|
||||||
|
add(firstQuery);
|
||||||
|
add(secondQuery);
|
||||||
|
|
||||||
|
const beforeCount = getQueries().size;
|
||||||
|
add(thirdQuery);
|
||||||
|
expect(getQueries().has(thirdQuery)).toBeTruthy();
|
||||||
|
|
||||||
|
remove(thirdQuery);
|
||||||
|
expect(getQueries().has(thirdQuery)).toBeFalsy();
|
||||||
|
expect(getQueries().size).toBe(beforeCount);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue