forked from verdnatura/salix-front
Merge branch 'dev' into 7790_formFocus_mixin
This commit is contained in:
commit
532306c4ef
180
CHANGELOG.md
180
CHANGELOG.md
|
@ -1,3 +1,183 @@
|
||||||
|
# Version 24.40 - 2024-10-02
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #4074 admit several acls by:jorgep
|
||||||
|
- chore: refs #4074 drop workerCreate by:jorgep
|
||||||
|
- chore: refs #4074 fix tests by:jorgep
|
||||||
|
- chore: refs #4074 wip replace useRole for useAcl by:jorgep
|
||||||
|
- chore: refs #7155 remove console.log by:alexm
|
||||||
|
- chore: refs #7155 typo by:alexm
|
||||||
|
- chore: refs #7663 add test by:jorgep
|
||||||
|
- chore: refs #7663 create test wip by:jorgep
|
||||||
|
- chore: refs #7663 drop useless code (origin/7663-setWeight) by:jorgep
|
||||||
|
- chore: refs #7828 fix e2e by:jorgep
|
||||||
|
- feat(AccountBasicData): add twoFactorFk by:alexm
|
||||||
|
- feat: add max rule by:Javier Segarra
|
||||||
|
- feat: add shortcut add event in some subSections by:Javier Segarra
|
||||||
|
- feat: add shortcut more buttons (origin/add_shortcut_add_subSections) by:Javier Segarra
|
||||||
|
- feat: add tooltip CustomerNewCustomAgent by:Javier Segarra
|
||||||
|
- feat: apply color when today by:Javier Segarra
|
||||||
|
- feat: change label because its more natural by:Javier Segarra
|
||||||
|
- feat: change order by:Javier Segarra
|
||||||
|
- feat: change QBadge color by:Javier Segarra
|
||||||
|
- feat: change url CustomerList by:Javier Segarra
|
||||||
|
- feat: copy customer countryFk by:Javier Segarra
|
||||||
|
- feat: create VnSelectEnum and add in AccountBasicData and ClaimBasicData by:alexm
|
||||||
|
- feat: CustomerBalance by:Javier Segarra
|
||||||
|
- feat: CustomerConsumptionFilter by:Javier Segarra
|
||||||
|
- feat: customer consumption (origin/7830-customerDesplegables, 7830-customerDesplegables) by:alexm
|
||||||
|
- feat: CustomerCreateTicket by:Javier Segarra
|
||||||
|
- feat: CustomerCredit section by:Javier Segarra
|
||||||
|
- feat: CustomerGreuges by:Javier Segarra
|
||||||
|
- feat: CustomerSample to VnTable by:Javier Segarra
|
||||||
|
- feat: global handler (origin/fix_global_handler, fix_global_handler) by:alexm
|
||||||
|
- feat: goToSupplier by:Javier Segarra
|
||||||
|
- feat: handle newValue by:Javier Segarra
|
||||||
|
- feat: handle same multiple CP by:Javier Segarra
|
||||||
|
- feat: hide menus on small view (origin/hideMenu) by:jorgep
|
||||||
|
- feat: minor changes by:Javier Segarra
|
||||||
|
- feat: orderCreateDialog by:Javier Segarra
|
||||||
|
- feat: refs #4074 drop useless code by:jorgep
|
||||||
|
- feat: refs #4074 useAcl in vnSelectDialog by:jorgep
|
||||||
|
- feat: refs #6346 new wagon type section by:Jon
|
||||||
|
- feat: refs #7404 add m3 and fix detail by:pablone
|
||||||
|
- feat: refs #7404 add some style to the form and reorganize fields by:pablone
|
||||||
|
- feat: refs #7404 add travel m3 to reserves form by:pablone
|
||||||
|
- feat: refs #7404 style dynamic text color by:pablone
|
||||||
|
- feat: refs #7404 travel m3 form by:pablone
|
||||||
|
- feat: refs #7500 added VnImg to show files by:Jon
|
||||||
|
- feat: refs #7663 add setWeight menu opt (wip) by:jorgep
|
||||||
|
- feat: refs #7663 fine tunning by:jorgep
|
||||||
|
- feat: refs #7828 create axios instance which no manage errors (origin/7828-makeCorrectCalls) by:jorgep
|
||||||
|
- feat: refs #7828 useAcl & cherry pick mail data worker by:jorgep
|
||||||
|
- feat: remove cli warnings by:Javier Segarra
|
||||||
|
- feat: show preparation field by:Javier Segarra
|
||||||
|
- feat: stateGroupedFilter by:Javier Segarra
|
||||||
|
- feat: translations fixed by:jgallego
|
||||||
|
- feat(TravelList): add daysOnward by:alexm
|
||||||
|
- feat: travel m3 by:pablone
|
||||||
|
- feat: use disableInifiniteScroll property by:Javier Segarra
|
||||||
|
- feat: VnImg draggable by:Javier Segarra
|
||||||
|
- feat: vnLocation changes by:Javier Segarra
|
||||||
|
- feat: vnSelect exprBuilder by:Javier Segarra
|
||||||
|
- fix: refs #7404 remove some style by:pablone
|
||||||
|
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
|
||||||
|
- fix: refs #7404 translates and some minor style fixes by:pablone
|
||||||
|
- fix: styles by:Javier Segarra
|
||||||
|
- perf: improve style by:Javier Segarra
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: CustomerBalance by:Javier Segarra
|
||||||
|
- perf: CustomerBasicData by:Javier Segarra
|
||||||
|
- perf: CustomerBasicData.salesPersonFk by:Javier Segarra
|
||||||
|
- perf: CustomerSummary by:Javier Segarra
|
||||||
|
- perf: customerSummaryTable by:Javier Segarra
|
||||||
|
- perf: disable card option by:Javier Segarra
|
||||||
|
- perf: i18n by:Javier Segarra
|
||||||
|
- perf: improve by:Javier Segarra
|
||||||
|
- perf: improve style by:Javier Segarra
|
||||||
|
- perf: imrpove exprBuilder by:Javier Segarra
|
||||||
|
- perf: minor comments by:Javier Segarra
|
||||||
|
- perf: refs #6346 previous changes by:Jon
|
||||||
|
- perf: sendEmail customerConsumption by:Javier Segarra
|
||||||
|
- perf: solve reload CardSummary component by:Javier Segarra
|
||||||
|
- perf: update CustommerDescriptor by:Javier Segarra
|
||||||
|
- refactor: refs #4074 accept array by:jorgep
|
||||||
|
- refactor: refs #4074 rollback by:jorgep
|
||||||
|
- refactor: refs #4074 use acl & drop useless roles by:jorgep
|
||||||
|
- refactor: refs #4074 useAcl in navigationStore & router by:jorgep
|
||||||
|
- refactor: refs #4074 use fn (origin/4074-useAcls) by:jorgep
|
||||||
|
- refactor: refs #4074 use VnTitle by:jorgep
|
||||||
|
- refactor: refs #6346 deleted front error checking by:Jon
|
||||||
|
- refactor: refs #6346 requested changes by:Jon
|
||||||
|
- refactor: refs #6346 wagons to VnTable by:Jon
|
||||||
|
- refactor: refs #7500 deleted useless code by:Jon
|
||||||
|
- refactor: refs #7500 refactor vnimg when storage is dms by:Jon
|
||||||
|
- refactor: refs #7828 wip by:jorgep
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- chore: refs #4074 fix tests by:jorgep
|
||||||
|
- chore: refs #7828 fix e2e by:jorgep
|
||||||
|
- feat: refs #7404 add m3 and fix detail by:pablone
|
||||||
|
- feat: translations fixed by:jgallego
|
||||||
|
- fix: #5938 grouped filter by:Javier Segarra
|
||||||
|
- fix: #6943 fix customerSummaryTable by:Javier Segarra
|
||||||
|
- fix: #6943 show nickname salesPerson by:Javier Segarra
|
||||||
|
- fix: address-create i18n by:Javier Segarra
|
||||||
|
- fix: comments (origin/6943_fix_customer_module, 6943_fix_customer_module) by:Javier Segarra
|
||||||
|
- fix: CusomerSummary to Address by:Javier Segarra
|
||||||
|
- fix: CustomerAddress mobile by:Javier Segarra
|
||||||
|
- fix: CustomerBillingData by:Javier Segarra
|
||||||
|
- fix: Customerconsumption by:Javier Segarra
|
||||||
|
- fix: customer credit opinion by:alexm
|
||||||
|
- fix: CustomerCreditOpinion workerDescriptor by:Javier Segarra
|
||||||
|
- fix: CustomerDescriptorAccount by:Javier Segarra
|
||||||
|
- fix: CustomerDescriptor.bussinessTypeFk by:Javier Segarra
|
||||||
|
- fix: CustomerFilter by:Javier Segarra
|
||||||
|
- fix: CustomerGreuges by:Javier Segarra
|
||||||
|
- fix: CustomerMandates by:Javier Segarra
|
||||||
|
- fix: Customer module find salesPersons out of first get by:Javier Segarra
|
||||||
|
- fix: CustomerRecovery transalate label by:Javier Segarra
|
||||||
|
- fix: CustomerSamples by:Javier Segarra
|
||||||
|
- fix: customerSummaryToTicketList button by:Javier Segarra
|
||||||
|
- fix: CustomerWebPayment by:Javier Segarra
|
||||||
|
- fix: CustommerSummaryTable Proxy by:Javier Segarra
|
||||||
|
- fix: deleted code by:Jon
|
||||||
|
- fix: duplicate code by:alexm
|
||||||
|
- fix: emit:updateModelValue by:Javier Segarra
|
||||||
|
- fix: fixed wagon tests by:Jon
|
||||||
|
- fix: fix wagon list reload by:Jon
|
||||||
|
- fix: i18n en preparation label by:Javier Segarra
|
||||||
|
- fix: infiniteScroll by:Javier Segarra
|
||||||
|
- fix: isFullMovable checkbox by:Javier Segarra
|
||||||
|
- fix: merge conflicts by:Javier Segarra
|
||||||
|
- fix: merge in dev by:alexm
|
||||||
|
- fix: missing code by:Jon
|
||||||
|
- fix: Options VnSelect properties by:Javier Segarra
|
||||||
|
- fix: refs #4074 await to watch by:jorgep
|
||||||
|
- fix: refs #4074 drop wrong acl by:jorgep
|
||||||
|
- fix: refs #4074 workerCard data-key by:jorgep
|
||||||
|
- fix: refs #6346 fix list and create by:pablone
|
||||||
|
- fix: refs #6943 prevent null (origin/6943-warmfix-preventNull) by:jorgep
|
||||||
|
- fix: refs #7155 remove userParams in watcher (7155-travel_daysOnward) by:alexm
|
||||||
|
- fix: refs #7155 use chip-locale (origin/7155-travel_daysOnward_2, 7155-travel_daysOnward_2) by:alexm
|
||||||
|
- fix: refs #7404 remove console.log by:pablone
|
||||||
|
- fix: refs #7404 remove from test by:pablone
|
||||||
|
- fix: refs #7404 remove some style by:pablone
|
||||||
|
- fix: refs #7404 revert commit prevent production access by:pablone
|
||||||
|
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
|
||||||
|
- fix: refs #7404 translates and some minor style fixes by:pablone
|
||||||
|
- fix: refs #7500 fixed e2e test by:Jon
|
||||||
|
- fix: refs #7500 fixed showing images wrongly by:Jon
|
||||||
|
- fix: refs #7830 customer credit by:pablone
|
||||||
|
- fix: refs #7830 remove console.log by:pablone
|
||||||
|
- fix: remove console.log by:pablone
|
||||||
|
- fix: remove FetchData by:Javier Segarra
|
||||||
|
- fix: remove FIXME (origin/6943_fix_customerSummaryTable) by:Javier Segarra
|
||||||
|
- fix: remove print variable by:Javier Segarra
|
||||||
|
- fix: remove promise execution by:Javier Segarra
|
||||||
|
- fix: reset VnTable scroll properties by:Javier Segarra
|
||||||
|
- fix: rule by:Javier Segarra
|
||||||
|
- fix: solve conflicts from master to test by:Javier Segarra
|
||||||
|
- fix: split params (origin/warmfix-addSearchUrl) by:jorgep
|
||||||
|
- fix: state cell by:Javier Segarra
|
||||||
|
- fix: stop call back event hasMoreData by:Javier Segarra
|
||||||
|
- fix: styles by:Javier Segarra
|
||||||
|
- fix: SupplierFiscalData VnLocation (origin/fix_supplierFD_location) by:Javier Segarra
|
||||||
|
- fix: VnLocation test by:Javier Segarra
|
||||||
|
- fix(VnTable): header background-color by:alexm
|
||||||
|
- fix(VnTable): sanitizer value is defined by:carlossa
|
||||||
|
- fix: wagon reload (origin/FixWagonRedirect) by:Jon
|
||||||
|
- fix: workerDms filter workerFk by:alexm
|
||||||
|
- fix(WorkerList): add type email by:alexm
|
||||||
|
- Merge remote-tracking branch 'origin/7830-customerDesplegables' into 6943_fix_customerSummaryTable by:Javier Segarra
|
||||||
|
- refs #7155 scopeDays fix (origin/7155-scopeDays) by:carlossa
|
||||||
|
- revert: vnUSerLink change by:Javier Segarra
|
||||||
|
- test: fix test (7677_vnLocation_perf) by:Javier Segarra
|
||||||
|
|
||||||
# Version 24.38 - 2024-09-17
|
# Version 24.38 - 2024-09-17
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { QInput } from 'quasar';
|
||||||
|
import setDefault from './setDefault';
|
||||||
|
|
||||||
|
setDefault(QInput, 'dense', true);
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { QSelect } from 'quasar';
|
||||||
|
import setDefault from './setDefault';
|
||||||
|
|
||||||
|
setDefault(QSelect, 'dense', true);
|
|
@ -1 +1,3 @@
|
||||||
export * from './defaults/qTable';
|
export * from './defaults/qTable';
|
||||||
|
export * from './defaults/qInput';
|
||||||
|
export * from './defaults/qSelect';
|
||||||
|
|
|
@ -1,35 +1,42 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnSelectProvince from 'components/VnSelectProvince.vue';
|
import VnSelectProvince from 'components/VnSelectProvince.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import FormModelPopup from './FormModelPopup.vue';
|
import FormModelPopup from './FormModelPopup.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved']);
|
const emit = defineEmits(['onDataSaved']);
|
||||||
|
const $props = defineProps({
|
||||||
|
countryFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
provinceSelected: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
provinces: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const cityFormData = reactive({
|
const cityFormData = ref({
|
||||||
name: null,
|
name: null,
|
||||||
provinceFk: null,
|
provinceFk: null,
|
||||||
});
|
});
|
||||||
|
onMounted(() => {
|
||||||
const provincesOptions = ref([]);
|
cityFormData.value.provinceFk = $props.provinceSelected;
|
||||||
|
});
|
||||||
const onDataSaved = (...args) => {
|
const onDataSaved = (...args) => {
|
||||||
emit('onDataSaved', ...args);
|
emit('onDataSaved', ...args);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
@on-fetch="(data) => (provincesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
url="Provinces"
|
|
||||||
/>
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
:title="t('New city')"
|
:title="t('New city')"
|
||||||
:subtitle="t('Please, ensure you put the correct data!')"
|
:subtitle="t('Please, ensure you put the correct data!')"
|
||||||
|
@ -41,11 +48,16 @@ const onDataSaved = (...args) => {
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Name')"
|
:label="t('Names')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:rules="validate('city.name')"
|
:rules="validate('city.name')"
|
||||||
/>
|
/>
|
||||||
<VnSelectProvince v-model="data.provinceFk" />
|
<VnSelectProvince
|
||||||
|
:province-selected="$props.provinceSelected"
|
||||||
|
:country-fk="$props.countryFk"
|
||||||
|
v-model="data.provinceFk"
|
||||||
|
:provinces="$props.provinces"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, 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';
|
||||||
|
@ -22,9 +22,11 @@ const postcodeFormData = reactive({
|
||||||
townFk: null,
|
townFk: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const townsFetchDataRef = ref(null);
|
||||||
const provincesFetchDataRef = ref(null);
|
const provincesFetchDataRef = ref(null);
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
const provincesOptions = ref([]);
|
const provincesOptions = ref([]);
|
||||||
|
const townsOptions = ref([]);
|
||||||
const town = ref({});
|
const town = ref({});
|
||||||
|
|
||||||
function onDataSaved(formData) {
|
function onDataSaved(formData) {
|
||||||
|
@ -61,26 +63,78 @@ function setTown(newTown, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setProvince(id, data) {
|
async function setProvince(id, data) {
|
||||||
await provincesFetchDataRef.value.fetch();
|
|
||||||
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
||||||
if (!newProvince) return;
|
if (!newProvince) return;
|
||||||
|
|
||||||
data.countryFk = newProvince.countryFk;
|
data.countryFk = newProvince.countryFk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onProvinceCreated(data) {
|
||||||
|
await provincesFetchDataRef.value.fetch({
|
||||||
|
where: { countryFk: postcodeFormData.countryFk },
|
||||||
|
});
|
||||||
|
postcodeFormData.provinceFk.value = data.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => [postcodeFormData.countryFk],
|
||||||
|
async (newCountryFk, oldValueFk) => {
|
||||||
|
if (!!oldValueFk[0] && newCountryFk[0] !== oldValueFk[0]) {
|
||||||
|
postcodeFormData.provinceFk = null;
|
||||||
|
postcodeFormData.townFk = null;
|
||||||
|
}
|
||||||
|
if ((newCountryFk, newCountryFk !== postcodeFormData.countryFk)) {
|
||||||
|
await provincesFetchDataRef.value.fetch({
|
||||||
|
where: {
|
||||||
|
countryFk: newCountryFk[0],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await townsFetchDataRef.value.fetch({
|
||||||
|
where: {
|
||||||
|
provinceFk: {
|
||||||
|
inq: provincesOptions.value.map(({ id }) => id),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => postcodeFormData.provinceFk,
|
||||||
|
async (newProvinceFk) => {
|
||||||
|
if (newProvinceFk[0] && newProvinceFk[0] !== postcodeFormData.provinceFk) {
|
||||||
|
await townsFetchDataRef.value.fetch({
|
||||||
|
where: { provinceFk: newProvinceFk[0] },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
async function handleProvinces(data) {
|
||||||
|
provincesOptions.value = data;
|
||||||
|
}
|
||||||
|
async function handleTowns(data) {
|
||||||
|
townsOptions.value = data;
|
||||||
|
}
|
||||||
|
async function handleCountries(data) {
|
||||||
|
countriesOptions.value = data;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
@on-fetch="(data) => (provincesOptions = data)"
|
@on-fetch="handleProvinces"
|
||||||
auto-load
|
auto-load
|
||||||
url="Provinces/location"
|
url="Provinces/location"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (countriesOptions = data)"
|
ref="townsFetchDataRef"
|
||||||
|
@on-fetch="handleTowns"
|
||||||
auto-load
|
auto-load
|
||||||
url="Countries"
|
url="Towns/location"
|
||||||
/>
|
/>
|
||||||
|
<FetchData @on-fetch="handleCountries" auto-load url="Countries" />
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
model="postcode"
|
model="postcode"
|
||||||
|
@ -96,18 +150,20 @@ async function setProvince(id, data) {
|
||||||
:label="t('Postcode')"
|
:label="t('Postcode')"
|
||||||
v-model="data.code"
|
v-model="data.code"
|
||||||
:rules="validate('postcode.code')"
|
:rules="validate('postcode.code')"
|
||||||
|
clearable
|
||||||
/>
|
/>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('City')"
|
:label="t('City')"
|
||||||
url="Towns/location"
|
|
||||||
@update:model-value="(value) => setTown(value, data)"
|
@update:model-value="(value) => setTown(value, data)"
|
||||||
|
:tooltip="t('Create city')"
|
||||||
v-model="data.townFk"
|
v-model="data.townFk"
|
||||||
|
:options="townsOptions"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:rules="validate('postcode.city')"
|
:rules="validate('postcode.city')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
clearable
|
:clearable="true"
|
||||||
>
|
>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="{ itemProps, opt }">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="itemProps">
|
||||||
|
@ -122,6 +178,9 @@ async function setProvince(id, data) {
|
||||||
</template>
|
</template>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewCityForm
|
<CreateNewCityForm
|
||||||
|
:country-fk="data.countryFk"
|
||||||
|
:province-selected="data.provinceFk"
|
||||||
|
:provinces="provincesOptions"
|
||||||
@on-data-saved="
|
@on-data-saved="
|
||||||
(_, requestResponse) =>
|
(_, requestResponse) =>
|
||||||
onCityCreated(requestResponse, data)
|
onCityCreated(requestResponse, data)
|
||||||
|
@ -132,8 +191,13 @@ async function setProvince(id, data) {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelectProvince
|
<VnSelectProvince
|
||||||
|
:country-fk="data.countryFk"
|
||||||
|
:province-selected="data.provinceFk"
|
||||||
@update:model-value="(value) => setProvince(value, data)"
|
@update:model-value="(value) => setProvince(value, data)"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
|
:clearable="true"
|
||||||
|
:provinces="provincesOptions"
|
||||||
|
@on-province-created="onProvinceCreated"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
|
@ -152,6 +216,7 @@ async function setProvince(id, data) {
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
New postcode: Nuevo código postal
|
New postcode: Nuevo código postal
|
||||||
|
Create city: Crear población
|
||||||
Please, ensure you put the correct data!: ¡Por favor, asegúrese de poner los datos correctos!
|
Please, ensure you put the correct data!: ¡Por favor, asegúrese de poner los datos correctos!
|
||||||
City: Población
|
City: Población
|
||||||
Province: Provincia
|
Province: Provincia
|
||||||
|
|
|
@ -16,7 +16,16 @@ const provinceFormData = reactive({
|
||||||
name: null,
|
name: null,
|
||||||
autonomyFk: null,
|
autonomyFk: null,
|
||||||
});
|
});
|
||||||
|
const $props = defineProps({
|
||||||
|
countryFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
provinces: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
const autonomiesOptions = ref([]);
|
const autonomiesOptions = ref([]);
|
||||||
|
|
||||||
const onDataSaved = (dataSaved, requestResponse) => {
|
const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
|
@ -31,6 +40,11 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (autonomiesOptions = data)"
|
@on-fetch="(data) => (autonomiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
|
:filter="{
|
||||||
|
where: {
|
||||||
|
countryFk: $props.countryFk,
|
||||||
|
},
|
||||||
|
}"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
/>
|
/>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
|
|
|
@ -50,7 +50,7 @@ const onDataSaved = (dataSaved) => {
|
||||||
model="thermograph"
|
model="thermograph"
|
||||||
:title="t('New thermograph')"
|
:title="t('New thermograph')"
|
||||||
:form-initial-data="thermographFormData"
|
:form-initial-data="thermographFormData"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="(_, response) => onDataSaved(response)"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -44,7 +44,6 @@ const itemComputed = computed(() => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.q-item {
|
.q-item {
|
||||||
min-height: 5vh;
|
min-height: 5vh;
|
||||||
|
|
|
@ -24,9 +24,9 @@ const { notify } = useNotify();
|
||||||
|
|
||||||
const rectificativeTypeOptions = ref([]);
|
const rectificativeTypeOptions = ref([]);
|
||||||
const siiTypeInvoiceOutsOptions = ref([]);
|
const siiTypeInvoiceOutsOptions = ref([]);
|
||||||
const inheritWarehouse = ref(true);
|
|
||||||
const invoiceParams = reactive({
|
const invoiceParams = reactive({
|
||||||
id: $props.invoiceOutData?.id,
|
id: $props.invoiceOutData?.id,
|
||||||
|
inheritWarehouse: true,
|
||||||
});
|
});
|
||||||
const invoiceCorrectionTypesOptions = ref([]);
|
const invoiceCorrectionTypesOptions = ref([]);
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ const refund = async () => {
|
||||||
<div>
|
<div>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('Inherit warehouse')"
|
:label="t('Inherit warehouse')"
|
||||||
v-model="inheritWarehouse"
|
v-model="invoiceParams.inheritWarehouse"
|
||||||
/>
|
/>
|
||||||
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
||||||
<QTooltip>{{ t('Inherit warehouse tooltip') }}</QTooltip>
|
<QTooltip>{{ t('Inherit warehouse tooltip') }}</QTooltip>
|
||||||
|
|
|
@ -13,12 +13,14 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import { useClipboard } from 'src/composables/useClipboard';
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import VnAvatar from './ui/VnAvatar.vue';
|
import VnAvatar from './ui/VnAvatar.vue';
|
||||||
|
import useNotify from 'src/composables/useNotify';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
const { copyText } = useClipboard();
|
const { copyText } = useClipboard();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const userLocale = computed({
|
const userLocale = computed({
|
||||||
get() {
|
get() {
|
||||||
|
@ -53,6 +55,7 @@ const user = state.getUser();
|
||||||
const warehousesData = ref();
|
const warehousesData = ref();
|
||||||
const companiesData = ref();
|
const companiesData = ref();
|
||||||
const accountBankData = ref();
|
const accountBankData = ref();
|
||||||
|
const isEmployee = computed(() => useRole().isEmployee());
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
updatePreferences();
|
updatePreferences();
|
||||||
|
@ -70,18 +73,28 @@ function updatePreferences() {
|
||||||
|
|
||||||
async function saveDarkMode(value) {
|
async function saveDarkMode(value) {
|
||||||
const query = `/UserConfigs/${user.value.id}`;
|
const query = `/UserConfigs/${user.value.id}`;
|
||||||
await axios.patch(query, {
|
try {
|
||||||
darkMode: value,
|
await axios.patch(query, {
|
||||||
});
|
darkMode: value,
|
||||||
user.value.darkMode = value;
|
});
|
||||||
|
user.value.darkMode = value;
|
||||||
|
onDataSaved();
|
||||||
|
} catch (error) {
|
||||||
|
onDataError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveLanguage(value) {
|
async function saveLanguage(value) {
|
||||||
const query = `/VnUsers/${user.value.id}`;
|
const query = `/VnUsers/${user.value.id}`;
|
||||||
await axios.patch(query, {
|
try {
|
||||||
lang: value,
|
await axios.patch(query, {
|
||||||
});
|
lang: value,
|
||||||
user.value.lang = value;
|
});
|
||||||
|
user.value.lang = value;
|
||||||
|
onDataSaved();
|
||||||
|
} catch (error) {
|
||||||
|
onDataError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
|
@ -97,11 +110,23 @@ function localUserData() {
|
||||||
state.setUser(user.value);
|
state.setUser(user.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveUserData(param, value) {
|
async function saveUserData(param, value) {
|
||||||
axios.post('UserConfigs/setUserConfig', { [param]: value });
|
try {
|
||||||
localUserData();
|
await axios.post('UserConfigs/setUserConfig', { [param]: value });
|
||||||
|
localUserData();
|
||||||
|
onDataSaved();
|
||||||
|
} catch (error) {
|
||||||
|
onDataError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const isEmployee = computed(() => useRole().isEmployee());
|
|
||||||
|
const onDataSaved = () => {
|
||||||
|
notify('globals.dataSaved', 'positive');
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDataError = () => {
|
||||||
|
notify('errors.updateUserConfig', 'negative');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -8,33 +8,55 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onProvinceCreated']);
|
const emit = defineEmits(['onProvinceCreated']);
|
||||||
const provinceFk = defineModel({ type: Number });
|
const $props = defineProps({
|
||||||
watch(provinceFk, async () => await provincesFetchDataRef.value.fetch());
|
countryFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
provinceSelected: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
provinces: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const provinceFk = defineModel({ type: Number, default: null });
|
||||||
|
|
||||||
const { validate } = useValidator();
|
const { validate } = useValidator();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const provincesOptions = ref();
|
const provincesOptions = ref($props.provinces);
|
||||||
|
provinceFk.value = $props.provinceSelected;
|
||||||
const provincesFetchDataRef = ref();
|
const provincesFetchDataRef = ref();
|
||||||
|
|
||||||
async function onProvinceCreated(_, data) {
|
async function onProvinceCreated(_, data) {
|
||||||
await provincesFetchDataRef.value.fetch();
|
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
||||||
provinceFk.value = data.id;
|
provinceFk.value = data.id;
|
||||||
emit('onProvinceCreated', data);
|
emit('onProvinceCreated', data);
|
||||||
}
|
}
|
||||||
|
async function handleProvinces(data) {
|
||||||
|
provincesOptions.value = data;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
:filter="{ include: { relation: 'country' } }"
|
:filter="{
|
||||||
@on-fetch="(data) => (provincesOptions = data)"
|
include: { relation: 'country' },
|
||||||
auto-load
|
where: {
|
||||||
|
countryFk: $props.countryFk,
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
@on-fetch="handleProvinces"
|
||||||
url="Provinces"
|
url="Provinces"
|
||||||
/>
|
/>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
:options="provincesOptions"
|
:options="$props.provinces"
|
||||||
|
:tooltip="t('Create province')"
|
||||||
hide-selected
|
hide-selected
|
||||||
v-model="provinceFk"
|
v-model="provinceFk"
|
||||||
:rules="validate && validate('postcode.provinceFk')"
|
:rules="validate && validate('postcode.provinceFk')"
|
||||||
|
@ -49,11 +71,15 @@ async function onProvinceCreated(_, data) {
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewProvinceForm @on-data-saved="onProvinceCreated" />
|
<CreateNewProvinceForm
|
||||||
|
:country-fk="$props.countryFk"
|
||||||
|
@on-data-saved="onProvinceCreated"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Province: Provincia
|
Province: Provincia
|
||||||
|
Create province: Crear provincia
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -10,7 +10,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
|
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnTableColumn from 'components/VnTable/VnColumn.vue';
|
import VnTableColumn from 'components/VnTable/VnColumn.vue';
|
||||||
import VnTableFilter from 'components/VnTable/VnFilter.vue';
|
import VnFilter from 'components/VnTable/VnFilter.vue';
|
||||||
import VnTableChip from 'components/VnTable/VnChip.vue';
|
import VnTableChip from 'components/VnTable/VnChip.vue';
|
||||||
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
|
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
|
@ -73,7 +73,6 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
hasSubToolbar: {
|
hasSubToolbar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -319,7 +318,7 @@ defineExpose({
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_) {
|
||||||
if (_.onDataSaved) _.onDataSaved(this);
|
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
||||||
else $props.create.onDataSaved(_);
|
else $props.create.onDataSaved(_);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -355,7 +354,7 @@ function handleOnDataSaved(_) {
|
||||||
)"
|
)"
|
||||||
:key="col.id"
|
:key="col.id"
|
||||||
>
|
>
|
||||||
<VnTableFilter
|
<VnFilter
|
||||||
ref="tableFilterRef"
|
ref="tableFilterRef"
|
||||||
:column="col"
|
:column="col"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
|
@ -468,7 +467,7 @@ function handleOnDataSaved(_) {
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<VnTableFilter
|
<VnFilter
|
||||||
v-if="$props.columnSearch"
|
v-if="$props.columnSearch"
|
||||||
:column="col"
|
:column="col"
|
||||||
:show-title="true"
|
:show-title="true"
|
||||||
|
@ -498,6 +497,7 @@ function handleOnDataSaved(_) {
|
||||||
auto-width
|
auto-width
|
||||||
class="no-margin q-px-xs"
|
class="no-margin q-px-xs"
|
||||||
:class="[getColAlign(col), col.columnClass]"
|
:class="[getColAlign(col), col.columnClass]"
|
||||||
|
:style="col.style"
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
@click.ctrl="
|
@click.ctrl="
|
||||||
($event) =>
|
($event) =>
|
||||||
|
@ -526,6 +526,7 @@ function handleOnDataSaved(_) {
|
||||||
:class="getColAlign(col)"
|
:class="getColAlign(col)"
|
||||||
class="sticky no-padding"
|
class="sticky no-padding"
|
||||||
@click="stopEventPropagation($event)"
|
@click="stopEventPropagation($event)"
|
||||||
|
:style="col.style"
|
||||||
>
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-for="(btn, index) of col.actions"
|
v-for="(btn, index) of col.actions"
|
||||||
|
@ -685,17 +686,15 @@ function handleOnDataSaved(_) {
|
||||||
</QCard>
|
</QCard>
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
<template #bottom-row="{ cols }" v-if="footer">
|
<template #bottom-row="{ cols }" v-if="$props.footer">
|
||||||
<QTr v-if="rows.length" class="bg-header" style="height: 30px">
|
<QTr v-if="rows.length" style="height: 30px">
|
||||||
<QTh
|
<QTh
|
||||||
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
||||||
:key="col?.id"
|
:key="col?.id"
|
||||||
class="text-center"
|
class="text-center"
|
||||||
|
:class="getColAlign(col)"
|
||||||
>
|
>
|
||||||
<slot
|
<slot :name="`column-footer-${col.name}`" />
|
||||||
:name="`column-footer-${col.name}`"
|
|
||||||
:class="getColAlign(col)"
|
|
||||||
/>
|
|
||||||
</QTh>
|
</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
@ -713,7 +712,7 @@ function handleOnDataSaved(_) {
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
shortcut="+"
|
||||||
/>
|
/>
|
||||||
<QTooltip>
|
<QTooltip self="top right">
|
||||||
{{ createForm?.title }}
|
{{ createForm?.title }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
|
@ -774,16 +773,6 @@ es:
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-table--dark .q-table__bottom,
|
|
||||||
.q-table--dark thead,
|
|
||||||
.q-table--dark tr {
|
|
||||||
border-color: var(--vn-section-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table__container > div:first-child {
|
|
||||||
background-color: var(--vn-page-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
|
||||||
|
@ -857,6 +846,15 @@ es:
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
table tbody th {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
tbody:nth-last-child(1) {
|
||||||
|
@extend .bg-header;
|
||||||
|
position: sticky;
|
||||||
|
z-index: 2;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vn-label-value {
|
.vn-label-value {
|
||||||
|
@ -903,12 +901,11 @@ es:
|
||||||
user-select: all;
|
user-select: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-width-slot {
|
.q-table__container {
|
||||||
width: 100%;
|
background-color: transparent;
|
||||||
display: flex;
|
}
|
||||||
text-align: center;
|
|
||||||
color: var(--vn-text-color);
|
.q-table__middle.q-virtual-scroll.q-virtual-scroll--vertical.scroll {
|
||||||
margin-bottom: -1%;
|
background-color: var(--vn-section-color);
|
||||||
background-color: var(--vn-header-color);
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,136 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnRow from '../ui/VnRow.vue';
|
||||||
|
import VnInput from './VnInput.vue';
|
||||||
|
import FetchData from '../FetchData.vue';
|
||||||
|
import useNotify from 'src/composables/useNotify';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
submitFn: { type: Function, default: () => {} },
|
||||||
|
askOldPass: { type: Boolean, default: false },
|
||||||
|
});
|
||||||
|
const emit = defineEmits(['onSubmit']);
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
const form = ref();
|
||||||
|
const changePassDialog = ref();
|
||||||
|
const passwords = ref({ newPassword: null, repeatPassword: null });
|
||||||
|
const requirements = ref([]);
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
|
const validate = async () => {
|
||||||
|
const { newPassword, repeatPassword, oldPassword } = passwords.value;
|
||||||
|
|
||||||
|
if (!newPassword) {
|
||||||
|
notify(t('You must enter a new password'), 'negative');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newPassword !== repeatPassword) {
|
||||||
|
notify(t("Passwords don't match"), 'negative');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
isLoading.value = true;
|
||||||
|
await props.submitFn(newPassword, oldPassword);
|
||||||
|
emit('onSubmit');
|
||||||
|
} catch (e) {
|
||||||
|
notify('errors.writeRequest', 'negative');
|
||||||
|
} finally {
|
||||||
|
changePassDialog.value.hide();
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({ show: () => changePassDialog.value.show() });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="UserPasswords/findOne"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (requirements = data)"
|
||||||
|
/>
|
||||||
|
<QDialog ref="changePassDialog">
|
||||||
|
<QCard style="width: 350px">
|
||||||
|
<QCardSection>
|
||||||
|
<slot name="header">
|
||||||
|
<VnRow class="items-center" style="flex-direction: row">
|
||||||
|
<span class="text-h6" v-text="t('globals.changePass')" />
|
||||||
|
<QIcon
|
||||||
|
class="cursor-pointer"
|
||||||
|
name="close"
|
||||||
|
size="xs"
|
||||||
|
style="flex: 0"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</slot>
|
||||||
|
</QCardSection>
|
||||||
|
<QForm ref="form">
|
||||||
|
<QCardSection>
|
||||||
|
<VnInput
|
||||||
|
v-if="props.askOldPass"
|
||||||
|
:label="t('Old password')"
|
||||||
|
v-model="passwords.oldPassword"
|
||||||
|
type="password"
|
||||||
|
:required="true"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('New password')"
|
||||||
|
v-model="passwords.newPassword"
|
||||||
|
type="password"
|
||||||
|
:required="true"
|
||||||
|
:info="
|
||||||
|
t('passwordRequirements', {
|
||||||
|
length: requirements.length,
|
||||||
|
nAlpha: requirements.nAlpha,
|
||||||
|
nUpper: requirements.nUpper,
|
||||||
|
nDigits: requirements.nDigits,
|
||||||
|
nPunct: requirements.nPunct,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
|
||||||
|
<VnInput
|
||||||
|
:label="t('Repeat password')"
|
||||||
|
v-model="passwords.repeatPassword"
|
||||||
|
type="password"
|
||||||
|
/>
|
||||||
|
</QCardSection>
|
||||||
|
</QForm>
|
||||||
|
<QCardActions>
|
||||||
|
<slot name="actions">
|
||||||
|
<QBtn
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
:label="t('globals.cancel')"
|
||||||
|
class="q-ml-sm"
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
type="reset"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
:label="t('globals.confirm')"
|
||||||
|
color="primary"
|
||||||
|
@click="validate"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</QCardActions>
|
||||||
|
</QCard>
|
||||||
|
</QDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
New password: Nueva contraseña
|
||||||
|
Repeat password: Repetir contraseña
|
||||||
|
You must enter a new password: Debes introducir la nueva contraseña
|
||||||
|
Passwords don't match: Las contraseñas no coinciden
|
||||||
|
</i18n>
|
|
@ -12,14 +12,46 @@ const props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const locationProperties = [
|
||||||
|
'postcode',
|
||||||
|
(obj) =>
|
||||||
|
obj.city
|
||||||
|
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
|
||||||
|
: null,
|
||||||
|
(obj) => obj.country?.name,
|
||||||
|
];
|
||||||
|
|
||||||
|
const formatLocation = (obj, properties) => {
|
||||||
|
const parts = properties.map((prop) => {
|
||||||
|
if (typeof prop === 'string') {
|
||||||
|
return obj[prop];
|
||||||
|
} else if (typeof prop === 'function') {
|
||||||
|
return prop(obj);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
const filteredParts = parts.filter(
|
||||||
|
(part) => part !== null && part !== undefined && part !== ''
|
||||||
|
);
|
||||||
|
|
||||||
|
return filteredParts.join(', ');
|
||||||
|
};
|
||||||
|
|
||||||
const modelValue = ref(
|
const modelValue = ref(
|
||||||
props.location
|
props.location ? formatLocation(props.location, locationProperties) : null
|
||||||
? `${props.location?.postcode}, ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
|
|
||||||
: null
|
|
||||||
);
|
);
|
||||||
|
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
return `${data.code}, ${data.town}(${data.province}), ${data.country}`;
|
const dataProperties = [
|
||||||
|
'code',
|
||||||
|
(obj) => (obj.town ? `${obj.town}(${obj.province})` : null),
|
||||||
|
'country',
|
||||||
|
];
|
||||||
|
return formatLocation(data, dataProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleModelValue = (data) => {
|
const handleModelValue = (data) => {
|
||||||
emit('update:model-value', data);
|
emit('update:model-value', data);
|
||||||
};
|
};
|
||||||
|
@ -41,6 +73,7 @@ const handleModelValue = (data) => {
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
clearable
|
clearable
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
|
:tooltip="t('Create new location')"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewPostcode
|
<CreateNewPostcode
|
||||||
|
@ -73,7 +106,9 @@ const handleModelValue = (data) => {
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
search_by_postalcode: Search by postalcode, town, province or country
|
search_by_postalcode: Search by postalcode, town, province or country
|
||||||
|
Create new location: Create new location
|
||||||
es:
|
es:
|
||||||
Location: Ubicación
|
Location: Ubicación
|
||||||
|
Create new location: Crear nueva ubicación
|
||||||
search_by_postalcode: Buscar por código postal, ciudad o país
|
search_by_postalcode: Buscar por código postal, ciudad o país
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -406,6 +406,7 @@ watch(
|
||||||
:skeleton="false"
|
:skeleton="false"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="setLogTree"
|
@on-fetch="setLogTree"
|
||||||
|
search-url="logs"
|
||||||
>
|
>
|
||||||
<template #body>
|
<template #body>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ const dialog = ref(null);
|
||||||
<div class="container order-catalog-item overflow-hidden">
|
<div class="container order-catalog-item overflow-hidden">
|
||||||
<QCard class="card shadow-6">
|
<QCard class="card shadow-6">
|
||||||
<div class="img-wrapper">
|
<div class="img-wrapper">
|
||||||
<VnImg :id="item.id" class="image" />
|
<VnImg :id="item.id" class="image" zoom-resolution="1600x900" />
|
||||||
<div v-if="item.hex && isCatalog" class="item-color-container">
|
<div v-if="item.hex && isCatalog" class="item-color-container">
|
||||||
<div
|
<div
|
||||||
class="item-color"
|
class="item-color"
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { onMounted, ref, computed, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { date } from 'quasar';
|
|
||||||
import toDate from 'filters/toDate';
|
import toDate from 'filters/toDate';
|
||||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||||
|
|
||||||
|
@ -59,7 +58,6 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ search, sanitizer });
|
defineExpose({ search, sanitizer });
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
'update:modelValue',
|
'update:modelValue',
|
||||||
'refresh',
|
'refresh',
|
||||||
|
@ -114,9 +112,9 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
async function search() {
|
async function search(evt) {
|
||||||
try {
|
try {
|
||||||
if ($props.disableSubmitEvent) return;
|
if (evt && $props.disableSubmitEvent) return;
|
||||||
|
|
||||||
store.filter.where = {};
|
store.filter.where = {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
@ -167,7 +165,7 @@ const tagsList = computed(() => {
|
||||||
for (const key of Object.keys(userParams.value)) {
|
for (const key of Object.keys(userParams.value)) {
|
||||||
const value = userParams.value[key];
|
const value = userParams.value[key];
|
||||||
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
|
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
|
||||||
tagList.push({ label: aliasField(key), value });
|
tagList.push({ label: key, value });
|
||||||
}
|
}
|
||||||
return tagList;
|
return tagList;
|
||||||
});
|
});
|
||||||
|
@ -187,7 +185,6 @@ async function remove(key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatValue(value) {
|
function formatValue(value) {
|
||||||
if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
|
|
||||||
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
|
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
|
||||||
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
|
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
|
||||||
|
|
||||||
|
@ -203,11 +200,6 @@ function sanitizer(params) {
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
function aliasField(field) {
|
|
||||||
const split = field.split('.');
|
|
||||||
return split[1] ?? split[0];
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -219,7 +211,7 @@ function aliasField(field) {
|
||||||
icon="search"
|
icon="search"
|
||||||
@click="search()"
|
@click="search()"
|
||||||
></QBtn>
|
></QBtn>
|
||||||
<QForm @submit="search" id="filterPanelForm">
|
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()">
|
||||||
<QList dense>
|
<QList dense>
|
||||||
<QItem class="q-mt-xs">
|
<QItem class="q-mt-xs">
|
||||||
<QItemSection top>
|
<QItemSection top>
|
||||||
|
|
|
@ -56,7 +56,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: undefined,
|
||||||
},
|
},
|
||||||
skeleton: {
|
skeleton: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
|
@ -108,6 +108,7 @@ async function search() {
|
||||||
...Object.fromEntries(staticParams),
|
...Object.fromEntries(staticParams),
|
||||||
search: searchText.value,
|
search: searchText.value,
|
||||||
},
|
},
|
||||||
|
...{ filter: props.filter },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (props.whereFilter) {
|
if (props.whereFilter) {
|
||||||
|
|
|
@ -114,7 +114,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
for (const row of response.data) store.data.push(row);
|
for (const row of response.data) store.data.push(row);
|
||||||
} else {
|
} else {
|
||||||
store.data = response.data;
|
store.data = response.data;
|
||||||
if (!document.querySelectorAll('[role="dialog"]').length)
|
if (!document.querySelectorAll('[role="dialog"][aria-modal="true"]').length)
|
||||||
updateRouter && updateStateParams();
|
updateRouter && updateStateParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ export default function toHour(date) {
|
||||||
if (!isValidDate(date)) {
|
if (!isValidDate(date)) {
|
||||||
return '--:--';
|
return '--:--';
|
||||||
}
|
}
|
||||||
return (new Date(date || '')).toLocaleTimeString([], {
|
return new Date(date || '').toLocaleTimeString([], {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
});
|
});
|
||||||
|
|
|
@ -50,6 +50,7 @@ globals:
|
||||||
summary:
|
summary:
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
today: Today
|
today: Today
|
||||||
yesterday: Yesterday
|
yesterday: Yesterday
|
||||||
dateFormat: en-GB
|
dateFormat: en-GB
|
||||||
|
@ -104,6 +105,7 @@ globals:
|
||||||
campaign: Campaign
|
campaign: Campaign
|
||||||
weight: Weight
|
weight: Weight
|
||||||
error: Ups! Something went wrong
|
error: Ups! Something went wrong
|
||||||
|
recalc: Recalculate
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
@ -111,7 +113,7 @@ globals:
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
log: Logs
|
log: Logs
|
||||||
parkingList: Parkings list
|
parkingList: Parkings list
|
||||||
agencyList: Agencies list
|
agencyList: Agencies
|
||||||
agency: Agency
|
agency: Agency
|
||||||
workCenters: Work centers
|
workCenters: Work centers
|
||||||
modes: Modes
|
modes: Modes
|
||||||
|
@ -135,7 +137,7 @@ globals:
|
||||||
fiscalData: Fiscal data
|
fiscalData: Fiscal data
|
||||||
billingData: Billing data
|
billingData: Billing data
|
||||||
consignees: Consignees
|
consignees: Consignees
|
||||||
'address-create': New address
|
address-create: New address
|
||||||
notes: Notes
|
notes: Notes
|
||||||
credits: Credits
|
credits: Credits
|
||||||
greuges: Greuges
|
greuges: Greuges
|
||||||
|
@ -207,7 +209,7 @@ globals:
|
||||||
roadmap: Roadmap
|
roadmap: Roadmap
|
||||||
stops: Stops
|
stops: Stops
|
||||||
routes: Routes
|
routes: Routes
|
||||||
cmrsList: CMRs list
|
cmrsList: CMRs
|
||||||
RouteList: List
|
RouteList: List
|
||||||
routeCreate: New route
|
routeCreate: New route
|
||||||
RouteRoadmap: Roadmaps
|
RouteRoadmap: Roadmaps
|
||||||
|
@ -273,6 +275,8 @@ globals:
|
||||||
clientsActionsMonitor: Clients and actions
|
clientsActionsMonitor: Clients and actions
|
||||||
serial: Serial
|
serial: Serial
|
||||||
medical: Mutual
|
medical: Mutual
|
||||||
|
RouteExtendedList: Router
|
||||||
|
wasteRecalc: Waste recaclulate
|
||||||
supplier: Supplier
|
supplier: Supplier
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
|
@ -288,7 +292,10 @@ globals:
|
||||||
createInvoiceIn: Create invoice in
|
createInvoiceIn: Create invoice in
|
||||||
myAccount: My account
|
myAccount: My account
|
||||||
noOne: No one
|
noOne: No one
|
||||||
|
maxTemperature: Max
|
||||||
|
minTemperature: Min
|
||||||
params:
|
params:
|
||||||
|
id: ID
|
||||||
clientFk: Client id
|
clientFk: Client id
|
||||||
salesPersonFk: Sales person
|
salesPersonFk: Sales person
|
||||||
warehouseFk: Warehouse
|
warehouseFk: Warehouse
|
||||||
|
@ -296,12 +303,19 @@ globals:
|
||||||
from: From
|
from: From
|
||||||
To: To
|
To: To
|
||||||
stateFk: State
|
stateFk: State
|
||||||
|
departmentFk: Department
|
||||||
|
email: Email
|
||||||
|
SSN: SSN
|
||||||
|
fi: FI
|
||||||
|
changePass: Change password
|
||||||
|
deleteConfirmTitle: Delete selected elements
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
statusInternalServerError: An internal server error has ocurred
|
statusInternalServerError: An internal server error has ocurred
|
||||||
statusBadGateway: It seems that the server has fall down
|
statusBadGateway: It seems that the server has fall down
|
||||||
statusGatewayTimeout: Could not contact the server
|
statusGatewayTimeout: Could not contact the server
|
||||||
userConfig: Error fetching user config
|
userConfig: Error fetching user config
|
||||||
|
updateUserConfig: Error updating user config
|
||||||
tokenConfig: Error fetching token config
|
tokenConfig: Error fetching token config
|
||||||
writeRequest: The requested operation could not be completed
|
writeRequest: The requested operation could not be completed
|
||||||
login:
|
login:
|
||||||
|
@ -801,14 +815,14 @@ worker:
|
||||||
bankEntity: Swift / BIC
|
bankEntity: Swift / BIC
|
||||||
formation:
|
formation:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
course: Curso
|
course: Course
|
||||||
startDate: Fecha Inicio
|
startDate: Start date
|
||||||
endDate: Fecha Fin
|
endDate: End date
|
||||||
center: Centro Formación
|
center: Training center
|
||||||
invoice: Factura
|
invoice: Invoice
|
||||||
amount: Importe
|
amount: Amount
|
||||||
remark: Bonficado
|
remark: Remark
|
||||||
hasDiploma: Diploma
|
hasDiploma: Has diploma
|
||||||
medical:
|
medical:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
date: Date
|
date: Date
|
||||||
|
@ -865,34 +879,7 @@ wagon:
|
||||||
minHeightBetweenTrays: 'The minimum height between trays is '
|
minHeightBetweenTrays: 'The minimum height between trays is '
|
||||||
maxWagonHeight: 'The maximum height of the wagon is '
|
maxWagonHeight: 'The maximum height of the wagon is '
|
||||||
uncompleteTrays: There are incomplete trays
|
uncompleteTrays: There are incomplete trays
|
||||||
route:
|
|
||||||
pageTitles:
|
|
||||||
agency: Agency List
|
|
||||||
routes: Routes
|
|
||||||
cmrsList: CMRs list
|
|
||||||
RouteList: List
|
|
||||||
routeCreate: New route
|
|
||||||
basicData: Basic Data
|
|
||||||
summary: Summary
|
|
||||||
RouteRoadmap: Roadmaps
|
|
||||||
RouteRoadmapCreate: Create roadmap
|
|
||||||
tickets: Tickets
|
|
||||||
log: Log
|
|
||||||
autonomous: Autonomous
|
|
||||||
cmr:
|
|
||||||
list:
|
|
||||||
results: results
|
|
||||||
cmrFk: CMR id
|
|
||||||
hasCmrDms: Attached in gestdoc
|
|
||||||
'true': 'Yes'
|
|
||||||
'false': 'No'
|
|
||||||
ticketFk: Ticketd id
|
|
||||||
routeFk: Route id
|
|
||||||
country: Country
|
|
||||||
clientFk: Client id
|
|
||||||
shipped: Preparation date
|
|
||||||
viewCmr: View CMR
|
|
||||||
downloadCmrs: Download CMRs
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Pay method
|
payMethod: Pay method
|
||||||
|
|
|
@ -49,6 +49,7 @@ globals:
|
||||||
summary:
|
summary:
|
||||||
basicData: Datos básicos
|
basicData: Datos básicos
|
||||||
daysOnward: Días adelante
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
today: Hoy
|
today: Hoy
|
||||||
yesterday: Ayer
|
yesterday: Ayer
|
||||||
dateFormat: es-ES
|
dateFormat: es-ES
|
||||||
|
@ -106,6 +107,7 @@ globals:
|
||||||
campaign: Campaña
|
campaign: Campaña
|
||||||
weight: Peso
|
weight: Peso
|
||||||
error: ¡Ups! Algo salió mal
|
error: ¡Ups! Algo salió mal
|
||||||
|
recalc: Recalcular
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
@ -113,7 +115,7 @@ globals:
|
||||||
basicData: Datos básicos
|
basicData: Datos básicos
|
||||||
log: Historial
|
log: Historial
|
||||||
parkingList: Listado de parkings
|
parkingList: Listado de parkings
|
||||||
agencyList: Listado de agencias
|
agencyList: Agencias
|
||||||
agency: Agencia
|
agency: Agencia
|
||||||
workCenters: Centros de trabajo
|
workCenters: Centros de trabajo
|
||||||
modes: Modos
|
modes: Modos
|
||||||
|
@ -211,12 +213,13 @@ globals:
|
||||||
roadmap: Troncales
|
roadmap: Troncales
|
||||||
stops: Paradas
|
stops: Paradas
|
||||||
routes: Rutas
|
routes: Rutas
|
||||||
cmrsList: Listado de CMRs
|
cmrsList: CMRs
|
||||||
RouteList: Listado
|
RouteList: Listado
|
||||||
routeCreate: Nueva ruta
|
routeCreate: Nueva ruta
|
||||||
RouteRoadmap: Troncales
|
RouteRoadmap: Troncales
|
||||||
RouteRoadmapCreate: Crear troncal
|
RouteRoadmapCreate: Crear troncal
|
||||||
autonomous: Autónomos
|
autonomous: Autónomos
|
||||||
|
RouteExtendedList: Enrutador
|
||||||
suppliers: Proveedores
|
suppliers: Proveedores
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
supplierCreate: Nuevo proveedor
|
supplierCreate: Nuevo proveedor
|
||||||
|
@ -277,6 +280,7 @@ globals:
|
||||||
clientsActionsMonitor: Clientes y acciones
|
clientsActionsMonitor: Clientes y acciones
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
|
wasteRecalc: Recalcular mermas
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
|
@ -292,7 +296,10 @@ globals:
|
||||||
createInvoiceIn: Crear factura recibida
|
createInvoiceIn: Crear factura recibida
|
||||||
myAccount: Mi cuenta
|
myAccount: Mi cuenta
|
||||||
noOne: Nadie
|
noOne: Nadie
|
||||||
|
maxTemperature: Máx
|
||||||
|
minTemperature: Mín
|
||||||
params:
|
params:
|
||||||
|
id: Id
|
||||||
clientFk: Id cliente
|
clientFk: Id cliente
|
||||||
salesPersonFk: Comercial
|
salesPersonFk: Comercial
|
||||||
warehouseFk: Almacén
|
warehouseFk: Almacén
|
||||||
|
@ -300,12 +307,19 @@ globals:
|
||||||
from: Desde
|
from: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
stateFk: Estado
|
stateFk: Estado
|
||||||
|
departmentFk: Departamento
|
||||||
|
email: Correo
|
||||||
|
SSN: NSS
|
||||||
|
fi: NIF
|
||||||
|
changePass: Cambiar contraseña
|
||||||
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
statusBadGateway: Parece ser que el servidor ha caído
|
statusBadGateway: Parece ser que el servidor ha caído
|
||||||
statusGatewayTimeout: No se ha podido contactar con el servidor
|
statusGatewayTimeout: No se ha podido contactar con el servidor
|
||||||
userConfig: Error al obtener configuración de usuario
|
userConfig: Error al obtener configuración de usuario
|
||||||
|
updateUserConfig: Error al actualizar la configuración de usuario
|
||||||
tokenConfig: Error al obtener configuración de token
|
tokenConfig: Error al obtener configuración de token
|
||||||
writeRequest: No se pudo completar la operación solicitada
|
writeRequest: No se pudo completar la operación solicitada
|
||||||
login:
|
login:
|
||||||
|
@ -863,21 +877,6 @@ wagon:
|
||||||
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
||||||
maxWagonHeight: 'La altura máxima del vagón es '
|
maxWagonHeight: 'La altura máxima del vagón es '
|
||||||
uncompleteTrays: Hay bandejas sin completar
|
uncompleteTrays: Hay bandejas sin completar
|
||||||
route:
|
|
||||||
cmr:
|
|
||||||
list:
|
|
||||||
results: resultados
|
|
||||||
cmrFk: Id CMR
|
|
||||||
hasCmrDms: Gestdoc
|
|
||||||
'true': Sí
|
|
||||||
'false': 'No'
|
|
||||||
ticketFk: Id ticket
|
|
||||||
routeFk: Id ruta
|
|
||||||
country: País
|
|
||||||
clientFk: Id cliente
|
|
||||||
shipped: Fecha preparación
|
|
||||||
viewCmr: Ver CMR
|
|
||||||
downloadCmrs: Descargar CMRs
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
|
|
|
@ -5,11 +5,14 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import AccountSummary from './Card/AccountSummary.vue';
|
import AccountSummary from './Card/AccountSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import AccountFilter from './AccountFilter.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const filter = {
|
||||||
|
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||||
|
};
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -18,27 +21,31 @@ const columns = computed(() => [
|
||||||
isId: true,
|
isId: true,
|
||||||
field: 'id',
|
field: 'id',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnFilter: {
|
|
||||||
component: 'select',
|
|
||||||
name: 'search',
|
|
||||||
attrs: {
|
|
||||||
url: 'VnUsers/preview',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'username',
|
name: 'roleFk',
|
||||||
|
label: t('role'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'roleFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'VnRoles',
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'name',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'nickname',
|
||||||
label: t('Nickname'),
|
label: t('Nickname'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'input',
|
component: 'input',
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
columnFilter: {
|
|
||||||
inWhere: true,
|
|
||||||
},
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
|
@ -50,9 +57,6 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
columnFilter: {
|
|
||||||
inWhere: true,
|
|
||||||
},
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
|
@ -104,17 +108,25 @@ const exprBuilder = (param, value) => {
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:label="t('account.search')"
|
:label="t('account.search')"
|
||||||
:info="t('account.searchInfo')"
|
:info="t('account.searchInfo')"
|
||||||
|
:filter="filter"
|
||||||
/>
|
/>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<AccountFilter data-key="AccountUsers" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="AccountUsers"
|
data-key="AccountUsers"
|
||||||
url="VnUsers/preview"
|
url="VnUsers/preview"
|
||||||
|
:filter="filter"
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
redirect="account"
|
redirect="account"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search="false"
|
||||||
|
auto-load
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ const { t } = useI18n();
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
:descriptor="AccountDescriptor"
|
:descriptor="AccountDescriptor"
|
||||||
search-data-key="AccountUsers"
|
search-data-key="AccountList"
|
||||||
:searchbar-props="{
|
:searchbar-props="{
|
||||||
url: 'VnUsers/preview',
|
url: 'VnUsers/preview',
|
||||||
label: t('account.search'),
|
label: t('account.search'),
|
||||||
|
|
|
@ -4,9 +4,12 @@ import { computed, ref, toRefs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
hasAccount: {
|
hasAccount: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -62,6 +65,19 @@ async function sync() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<VnChangePassword
|
||||||
|
ref="changePassRef"
|
||||||
|
:ask-old-pass="true"
|
||||||
|
:submit-fn="
|
||||||
|
async (newPassword, oldPassword) => {
|
||||||
|
await axios.patch(`Accounts/change-password`, {
|
||||||
|
userId: entityId,
|
||||||
|
newPassword,
|
||||||
|
oldPassword,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
<VnConfirm
|
<VnConfirm
|
||||||
v-model="showSyncDialog"
|
v-model="showSyncDialog"
|
||||||
:message="t('account.card.actions.sync.message')"
|
:message="t('account.card.actions.sync.message')"
|
||||||
|
@ -92,6 +108,17 @@ async function sync() {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnConfirm>
|
</VnConfirm>
|
||||||
|
<QItem
|
||||||
|
v-if="
|
||||||
|
entityId == account.id &&
|
||||||
|
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
|
||||||
|
"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="$refs.changePassRef.show()"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('globals.changePass') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.hasAccount"
|
v-if="account.hasAccount"
|
||||||
v-ripple
|
v-ripple
|
||||||
|
@ -138,6 +165,5 @@ async function sync() {
|
||||||
<QItem v-ripple clickable @click="showSyncDialog = true">
|
<QItem v-ripple clickable @click="showSyncDialog = true">
|
||||||
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -18,6 +18,7 @@ const contactChannels = ref([]);
|
||||||
const title = ref();
|
const title = ref();
|
||||||
const handleSalesModelValue = (val) => ({
|
const handleSalesModelValue = (val) => ({
|
||||||
or: [
|
or: [
|
||||||
|
{ id: val },
|
||||||
{ name: val },
|
{ name: val },
|
||||||
{ nickname: { like: '%' + val + '%' } },
|
{ nickname: { like: '%' + val + '%' } },
|
||||||
{ code: { like: `${val}%` } },
|
{ code: { like: `${val}%` } },
|
||||||
|
|
|
@ -93,6 +93,7 @@ function handleLocation(data, location) {
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:location="data"
|
:location="data"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
|
|
|
@ -13,6 +13,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
|
|
@ -92,7 +92,7 @@ const onSubmit = async () => {
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
unpaidClient.value = true;
|
unpaidClient.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notify('errors.create', 'negative');
|
notify('errors.writeRequest', 'negative');
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,11 @@ import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const canChangePassword = ref(0);
|
const canChangePassword = ref(0);
|
||||||
|
|
||||||
|
@ -21,21 +18,11 @@ const filter = computed(() => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const showChangePasswordDialog = () => {
|
|
||||||
quasar.dialog({
|
|
||||||
component: CustomerChangePassword,
|
|
||||||
componentProps: {
|
|
||||||
id: route.params.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
async function hasCustomerRole() {
|
async function hasCustomerRole() {
|
||||||
const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`);
|
const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`);
|
||||||
canChangePassword.value = data;
|
canChangePassword.value = data;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FormModel
|
<FormModel
|
||||||
url="VnUsers/preview"
|
url="VnUsers/preview"
|
||||||
|
@ -69,21 +56,29 @@ async function hasCustomerRole() {
|
||||||
</template>
|
</template>
|
||||||
<template #moreActions>
|
<template #moreActions>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('Change password')"
|
:label="t('globals.changePass')"
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="edit"
|
icon="edit"
|
||||||
:disable="!canChangePassword"
|
:disable="!canChangePassword"
|
||||||
@click="showChangePasswordDialog()"
|
@click="$refs.changePassRef.show"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
<VnChangePassword
|
||||||
|
ref="changePassRef"
|
||||||
|
:submit-fn="
|
||||||
|
async (newPass) => {
|
||||||
|
await axios.patch(`Clients/${$route.params.id}/setPassword`, {
|
||||||
|
newPassword: newPass,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Enable web access: Habilitar acceso web
|
Enable web access: Habilitar acceso web
|
||||||
User: Usuario
|
User: Usuario
|
||||||
Recovery email: Correo de recuperacion
|
Recovery email: Correo de recuperacion
|
||||||
This email is used for user to regain access their account: Este correo electrónico se usa para que el usuario recupere el acceso a su cuenta
|
This email is used for user to regain access their account: Este correo electrónico se usa para que el usuario recupere el acceso a su cuenta
|
||||||
Change password: Cambiar contraseña
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -429,10 +429,9 @@ function handleLocation(data, location) {
|
||||||
:params="{
|
:params="{
|
||||||
departmentCodes: ['VT', 'shopping'],
|
departmentCodes: ['VT', 'shopping'],
|
||||||
}"
|
}"
|
||||||
option-label="nickname"
|
|
||||||
option-value="id"
|
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
|
:use-like="false"
|
||||||
emit-value
|
emit-value
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { toCurrency, toDate, dateRange } from 'filters/index';
|
import { toCurrency, toDate, dateRange } from 'filters/index';
|
||||||
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
|
|
||||||
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
|
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
@ -11,7 +10,6 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
||||||
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -192,11 +190,6 @@ function exprBuilder(param, value) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RightMenu>
|
|
||||||
<template #right-panel>
|
|
||||||
<CustomerNotificationsFilter data-key="CustomerDefaulter" />
|
|
||||||
</template>
|
|
||||||
</RightMenu>
|
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<CustomerBalanceDueTotal :amount="balanceDueTotal" />
|
<CustomerBalanceDueTotal :amount="balanceDueTotal" />
|
||||||
|
|
|
@ -1,138 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import { useDialogPluginComponent } from 'quasar';
|
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify';
|
|
||||||
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
|
|
||||||
const { dialogRef } = useDialogPluginComponent();
|
|
||||||
const { notify } = useNotify();
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const $props = defineProps({
|
|
||||||
id: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
promise: {
|
|
||||||
type: Function,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const userPasswords = ref({});
|
|
||||||
|
|
||||||
const closeButton = ref(null);
|
|
||||||
const isLoading = ref(false);
|
|
||||||
const newPassword = ref('');
|
|
||||||
const requestPassword = ref('');
|
|
||||||
|
|
||||||
const onSubmit = async () => {
|
|
||||||
isLoading.value = true;
|
|
||||||
|
|
||||||
if (newPassword.value !== requestPassword.value) {
|
|
||||||
notify(t("Passwords don't match"), 'negative');
|
|
||||||
isLoading.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const payload = {
|
|
||||||
newPassword: newPassword.value,
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
await axios.patch(`Clients/${$props.id}/setPassword`, payload);
|
|
||||||
} catch (error) {
|
|
||||||
notify('errors.create', 'negative');
|
|
||||||
} finally {
|
|
||||||
isLoading.value = false;
|
|
||||||
if (closeButton.value) closeButton.value.click();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDialog ref="dialogRef">
|
|
||||||
<FetchData
|
|
||||||
@on-fetch="(data) => (userPasswords = data[0])"
|
|
||||||
auto-load
|
|
||||||
url="UserPasswords"
|
|
||||||
/>
|
|
||||||
<QCard class="q-pa-lg">
|
|
||||||
<QCardSection>
|
|
||||||
<QForm @submit.prevent="onSubmit">
|
|
||||||
<span
|
|
||||||
ref="closeButton"
|
|
||||||
class="row justify-end close-icon"
|
|
||||||
v-close-popup
|
|
||||||
>
|
|
||||||
<QIcon name="close" size="sm" />
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md" style="flex-direction: column">
|
|
||||||
<div class="col">
|
|
||||||
<VnInput
|
|
||||||
:label="t('New password')"
|
|
||||||
clearable
|
|
||||||
v-model="newPassword"
|
|
||||||
type="password"
|
|
||||||
>
|
|
||||||
<template #append>
|
|
||||||
<QIcon name="info" class="cursor-info">
|
|
||||||
<QTooltip>
|
|
||||||
{{
|
|
||||||
t('customer.card.passwordRequirements', {
|
|
||||||
...userPasswords,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<VnInput
|
|
||||||
:label="t('Request password')"
|
|
||||||
clearable
|
|
||||||
v-model="requestPassword"
|
|
||||||
type="password"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</VnRow>
|
|
||||||
|
|
||||||
<div class="q-mt-lg row justify-end">
|
|
||||||
<QBtn
|
|
||||||
:disabled="isLoading"
|
|
||||||
:label="t('globals.cancel')"
|
|
||||||
:loading="isLoading"
|
|
||||||
class="q-ml-sm"
|
|
||||||
color="primary"
|
|
||||||
flat
|
|
||||||
type="reset"
|
|
||||||
v-close-popup
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
:disabled="isLoading"
|
|
||||||
:label="t('Change password')"
|
|
||||||
:loading="isLoading"
|
|
||||||
color="primary"
|
|
||||||
type="submit"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</QForm>
|
|
||||||
</QCardSection>
|
|
||||||
</QCard>
|
|
||||||
</QDialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
New password: Nueva contraseña
|
|
||||||
Request password: Repetir contraseña
|
|
||||||
Change password: Cambiar contraseña
|
|
||||||
Passwords don't match: Las contraseñas no coinciden
|
|
||||||
</i18n>
|
|
|
@ -138,7 +138,7 @@ const onSubmit = async () => {
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
onDataSaved(data);
|
onDataSaved(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notify('errors.create', 'negative');
|
notify('errors.writeRequest', 'negative');
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,10 @@ const columns = [
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
useLike: false,
|
useLike: false,
|
||||||
},
|
},
|
||||||
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('Reserve'),
|
label: t('Reserve'),
|
||||||
name: 'reserve',
|
name: 'reserve',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -76,7 +77,7 @@ const columns = [
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('More'),
|
title: t('View more details'),
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => {
|
action: (row) => {
|
||||||
|
@ -141,6 +142,10 @@ function setFooter(data) {
|
||||||
});
|
});
|
||||||
tableRef.value.footer = footer;
|
tableRef.value.footer = footer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function round(value) {
|
||||||
|
return Math.round(value * 100) / 100;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
|
@ -152,14 +157,16 @@ function setFooter(data) {
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
travel = data.find((data) => data.warehouseIn.code === 'VNH');
|
travel = data.find(
|
||||||
|
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<VnRow class="travel">
|
<VnRow class="travel">
|
||||||
<div v-if="travel">
|
<div v-if="travel">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ t('Booked trucks') }}:
|
{{ t('Purchase Spaces') }}:
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{{ travel?.m3 }}
|
{{ travel?.m3 }}
|
||||||
|
@ -206,7 +213,7 @@ function setFooter(data) {
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<QPage class="column items-center q-pa-md">
|
<div class="column items-center">
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="StockBoughts"
|
data-key="StockBoughts"
|
||||||
|
@ -228,7 +235,9 @@ function setFooter(data) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:user-params="userParams"
|
:user-params="userParams"
|
||||||
:footer="true"
|
:footer="true"
|
||||||
|
table-height="80vh"
|
||||||
auto-load
|
auto-load
|
||||||
|
:column-search="false"
|
||||||
>
|
>
|
||||||
<template #column-workerFk="{ row }">
|
<template #column-workerFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
@ -243,7 +252,7 @@ function setFooter(data) {
|
||||||
</template>
|
</template>
|
||||||
<template #column-footer-reserve>
|
<template #column-footer-reserve>
|
||||||
<span>
|
<span>
|
||||||
{{ tableRef.footer.reserve }}
|
{{ round(tableRef.footer.reserve) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-footer-bought>
|
<template #column-footer-bought>
|
||||||
|
@ -253,11 +262,11 @@ function setFooter(data) {
|
||||||
tableRef.footer.reserve < tableRef.footer.bought,
|
tableRef.footer.reserve < tableRef.footer.bought,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ tableRef.footer.bought }}
|
{{ round(tableRef.footer.bought) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</QPage>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -272,7 +281,6 @@ function setFooter(data) {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 40%;
|
|
||||||
}
|
}
|
||||||
.text-negative {
|
.text-negative {
|
||||||
color: $negative !important;
|
color: $negative !important;
|
||||||
|
@ -282,12 +290,12 @@ function setFooter(data) {
|
||||||
es:
|
es:
|
||||||
Edit travel: Editar envío
|
Edit travel: Editar envío
|
||||||
Travel: Envíos
|
Travel: Envíos
|
||||||
Booked trucks: Camiones reservados
|
Purchase Spaces: Espacios de compra
|
||||||
Buyer: Comprador
|
Buyer: Comprador
|
||||||
Reserve: Reservado
|
Reserve: Reservado
|
||||||
Bought: Comprado
|
Bought: Comprado
|
||||||
More: Más
|
|
||||||
Date: Fecha
|
Date: Fecha
|
||||||
|
View more details: Ver más detalles
|
||||||
Reserve some space: Reservar espacio
|
Reserve some space: Reservar espacio
|
||||||
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
|
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -77,18 +77,10 @@ const columns = [
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:disable-infinite-scroll="true"
|
:disable-infinite-scroll="true"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #top-left>
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
icon="Close"
|
|
||||||
color="primary"
|
|
||||||
class="bg-vn-section-color q-pa-xs"
|
|
||||||
v-close-popup
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #column-entryFk="{ row }">
|
<template #column-entryFk="{ row }">
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ row?.entryFk }}
|
{{ row?.entryFk }}
|
||||||
|
@ -112,6 +104,11 @@ const columns = [
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
background-color: var(--vn-section-color);
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.container > div > div > .q-table__top.relative-position.row.items-center {
|
||||||
|
background-color: red !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, watch } from 'vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const isLoading = ref(false);
|
||||||
|
const dateFrom = ref();
|
||||||
|
const dateTo = ref();
|
||||||
|
|
||||||
|
const optionsTo = computed(() => (date) => {
|
||||||
|
if (!dateFrom.value) return true;
|
||||||
|
return new Date(date) >= new Date(dateFrom.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(dateFrom, (newDateFrom) => {
|
||||||
|
if (dateTo.value && new Date(dateTo.value) < new Date(newDateFrom))
|
||||||
|
dateTo.value = newDateFrom;
|
||||||
|
});
|
||||||
|
|
||||||
|
const recalc = async () => {
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
schema: 'bs',
|
||||||
|
params: [new Date(dateFrom.value), new Date(dateTo.value)],
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
isLoading.value = true;
|
||||||
|
await axios.post('Applications/waste_addSales/execute-proc', params);
|
||||||
|
notify('wasteRecalc.recalcOk', 'positive');
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="q-pa-lg row justify-center">
|
||||||
|
<QCard class="bg-light" style="width: 300px">
|
||||||
|
<QCardSection>
|
||||||
|
<VnInputDate
|
||||||
|
class="q-mb-lg"
|
||||||
|
v-model="dateFrom"
|
||||||
|
:label="$t('globals.from')"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
class="q-mb-lg"
|
||||||
|
v-model="dateTo"
|
||||||
|
:options="optionsTo"
|
||||||
|
:label="$t('globals.to')"
|
||||||
|
:disable="!dateFrom"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
color="primary"
|
||||||
|
text-color="white"
|
||||||
|
:label="$t('globals.recalc')"
|
||||||
|
:loading="isLoading"
|
||||||
|
:disable="isLoading || !(dateFrom && dateTo)"
|
||||||
|
@click="recalc()"
|
||||||
|
/>
|
||||||
|
</QCardSection>
|
||||||
|
</QCard>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -9,22 +9,27 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
const params = {
|
||||||
|
daysOnward: 7,
|
||||||
|
daysAgo: 3,
|
||||||
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('customer.extendedList.tableVisibleColumns.id'),
|
label: t('myEntries.id'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
visible: false,
|
visible: false,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
label: t('shipped'),
|
label: t('myEntries.shipped'),
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'fromShipped',
|
name: 'fromShipped',
|
||||||
label: t('fromShipped'),
|
label: t('myEntries.fromShipped'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
},
|
},
|
||||||
format: ({ shipped }) => toDate(shipped),
|
format: ({ shipped }) => toDate(shipped),
|
||||||
|
@ -32,11 +37,11 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
visible: false,
|
visible: false,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('shipped'),
|
label: t('myEntries.shipped'),
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'toShipped',
|
name: 'toShipped',
|
||||||
label: t('toShipped'),
|
label: t('myEntries.toShipped'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
},
|
},
|
||||||
format: ({ shipped }) => toDate(shipped),
|
format: ({ shipped }) => toDate(shipped),
|
||||||
|
@ -44,14 +49,14 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
label: t('shipped'),
|
label: t('myEntries.shipped'),
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
format: ({ shipped }) => toDate(shipped),
|
format: ({ shipped }) => toDate(shipped),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
label: t('landed'),
|
label: t('myEntries.landed'),
|
||||||
name: 'landed',
|
name: 'landed',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
format: ({ landed }) => toDate(landed),
|
format: ({ landed }) => toDate(landed),
|
||||||
|
@ -59,26 +64,36 @@ const columns = computed(() => [
|
||||||
|
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
label: t('globals.wareHouseIn'),
|
label: t('myEntries.wareHouseIn'),
|
||||||
name: 'warehouseInFk',
|
name: 'warehouseInFk',
|
||||||
format: (row) => row.warehouseInName,
|
format: (row) => {
|
||||||
|
row.warehouseInName;
|
||||||
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
name: 'warehouseInFk',
|
||||||
|
label: t('myEntries.warehouseInFk'),
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'warehouses',
|
url: 'warehouses',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
|
alias: 't',
|
||||||
},
|
},
|
||||||
alias: 't',
|
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.daysOnward'),
|
label: t('myEntries.daysOnward'),
|
||||||
name: 'days',
|
name: 'daysOnward',
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('myEntries.daysAgo'),
|
||||||
|
name: 'daysAgo',
|
||||||
visible: false,
|
visible: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -88,6 +103,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('printLabels'),
|
title: t('printLabels'),
|
||||||
icon: 'print',
|
icon: 'print',
|
||||||
|
isPrimary: true,
|
||||||
action: (row) => printBuys(row.id),
|
action: (row) => printBuys(row.id),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -114,9 +130,11 @@ const printBuys = (rowId) => {
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
:user-params="params"
|
||||||
default-mode="card"
|
default-mode="card"
|
||||||
order="shipped DESC"
|
order="shipped DESC"
|
||||||
auto-load
|
auto-load
|
||||||
|
chip-locale="myEntries"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,17 @@ entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
landed: Landed
|
myEntries:
|
||||||
shipped: Shipped
|
id: ID
|
||||||
fromShipped: Shipped(from)
|
landed: Landed
|
||||||
toShipped: Shipped(to)
|
shipped: Shipped
|
||||||
printLabels: Print stickers
|
fromShipped: Shipped(from)
|
||||||
viewLabel: View sticker
|
toShipped: Shipped(to)
|
||||||
|
printLabels: Print stickers
|
||||||
|
viewLabel: View sticker
|
||||||
|
wareHouseIn: Warehouse in
|
||||||
|
warehouseInFk: Warehouse in
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
wasteRecalc:
|
||||||
|
recalcOk: The wastes were successfully recalculated
|
||||||
|
|
|
@ -9,10 +9,17 @@ entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
|
myEntries:
|
||||||
landed: F. llegada
|
id: ID
|
||||||
shipped: F. salida
|
landed: F. llegada
|
||||||
fromShipped: F. salida(desde)
|
shipped: F. salida
|
||||||
toShipped: F. salida(hasta)
|
fromShipped: F. salida(desde)
|
||||||
printLabels: Imprimir etiquetas
|
toShipped: F. salida(hasta)
|
||||||
viewLabel: Ver etiqueta
|
printLabels: Imprimir etiquetas
|
||||||
|
viewLabel: Ver etiqueta
|
||||||
|
wareHouseIn: Alm. entrada
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
wasteRecalc:
|
||||||
|
recalcOk: Se han recalculado las mermas correctamente
|
||||||
|
|
|
@ -274,10 +274,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
:label="t('invoiceIn.summary.company')"
|
:label="t('invoiceIn.summary.company')"
|
||||||
:value="entity.company?.code"
|
:value="entity.company?.code"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
|
||||||
:label="t('invoiceIn.summary.booked')"
|
|
||||||
:value="invoiceIn?.isBooked"
|
|
||||||
/>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
|
|
|
@ -116,7 +116,7 @@ const activities = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isBooked')"
|
:label="t('invoiceIn.isBooked')"
|
||||||
v-model="params.isBooked"
|
v-model="params.isBooked"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
|
@ -170,7 +170,7 @@ es:
|
||||||
awb: AWB
|
awb: AWB
|
||||||
amount: Importe
|
amount: Importe
|
||||||
issued: Emitida
|
issued: Emitida
|
||||||
isBooked: Conciliada
|
isBooked: Contabilizada
|
||||||
account: Cuenta contable
|
account: Cuenta contable
|
||||||
created: Creada
|
created: Creada
|
||||||
dued: Vencida
|
dued: Vencida
|
||||||
|
|
|
@ -65,7 +65,7 @@ const cols = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'isBooked',
|
name: 'isBooked',
|
||||||
label: t('invoiceIn.list.isBooked'),
|
label: t('invoiceIn.isBooked'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
invoiceIn:
|
invoiceIn:
|
||||||
serial: Serial
|
serial: Serial
|
||||||
|
isBooked: Is booked
|
||||||
list:
|
list:
|
||||||
ref: Reference
|
ref: Reference
|
||||||
supplier: Supplier
|
supplier: Supplier
|
||||||
|
@ -7,7 +8,6 @@ invoiceIn:
|
||||||
serial: Serial
|
serial: Serial
|
||||||
file: File
|
file: File
|
||||||
issued: Issued
|
issued: Issued
|
||||||
isBooked: Is booked
|
|
||||||
awb: AWB
|
awb: AWB
|
||||||
amount: Amount
|
amount: Amount
|
||||||
card:
|
card:
|
||||||
|
@ -31,7 +31,6 @@ invoiceIn:
|
||||||
sage: Sage withholding
|
sage: Sage withholding
|
||||||
vat: Undeductible VAT
|
vat: Undeductible VAT
|
||||||
company: Company
|
company: Company
|
||||||
booked: Booked
|
|
||||||
expense: Expense
|
expense: Expense
|
||||||
taxableBase: Taxable base
|
taxableBase: Taxable base
|
||||||
rate: Rate
|
rate: Rate
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
invoiceIn:
|
invoiceIn:
|
||||||
serial: Serie
|
serial: Serie
|
||||||
|
isBooked: Contabilizada
|
||||||
list:
|
list:
|
||||||
ref: Referencia
|
ref: Referencia
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
|
@ -7,7 +8,6 @@ invoiceIn:
|
||||||
shortIssued: F. emisión
|
shortIssued: F. emisión
|
||||||
file: Fichero
|
file: Fichero
|
||||||
issued: Fecha emisión
|
issued: Fecha emisión
|
||||||
isBooked: Conciliada
|
|
||||||
awb: AWB
|
awb: AWB
|
||||||
amount: Importe
|
amount: Importe
|
||||||
card:
|
card:
|
||||||
|
@ -31,7 +31,6 @@ invoiceIn:
|
||||||
sage: Retención sage
|
sage: Retención sage
|
||||||
vat: Iva no deducible
|
vat: Iva no deducible
|
||||||
company: Empresa
|
company: Empresa
|
||||||
booked: Contabilizada
|
|
||||||
expense: Gasto
|
expense: Gasto
|
||||||
taxableBase: Base imp.
|
taxableBase: Base imp.
|
||||||
rate: Tasa
|
rate: Tasa
|
||||||
|
|
|
@ -9,7 +9,6 @@ import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify';
|
import useNotify from 'src/composables/useNotify';
|
||||||
import { useSession } from 'src/composables/useSession';
|
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
@ -30,8 +29,6 @@ const $props = defineProps({
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const session = useSession();
|
|
||||||
const token = session.getToken();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openReport, sendEmail } = usePrintService();
|
const { openReport, sendEmail } = usePrintService();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
|
@ -27,13 +27,16 @@ const { openReport } = usePrintService();
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'center',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.id'),
|
label: t('invoiceOutList.tableVisibleColumns.id'),
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
isId: true,
|
isId: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'search',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -64,7 +65,8 @@ const columns = computed(() => [
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Clients',
|
url: 'Clients',
|
||||||
fields: ['id', 'name'],
|
optionLabel: 'socialName',
|
||||||
|
optionValue: 'socialName',
|
||||||
},
|
},
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
|
@ -192,10 +194,33 @@ const downloadCSV = async () => {
|
||||||
<WorkerDescriptorProxy :id="row.comercialId" />
|
<WorkerDescriptorProxy :id="row.comercialId" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #moreFilterPanel="{ params }">
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.from')"
|
||||||
|
v-model="params.from"
|
||||||
|
class="q-px-xs q-pr-lg"
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.to')"
|
||||||
|
v-model="params.to"
|
||||||
|
class="q-px-xs q-pr-lg"
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Download as CSV: Descargar como CSV
|
Download as CSV: Descargar como CSV
|
||||||
|
params:
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -171,7 +171,6 @@ const insertTag = (rows) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
@click="insertTag(rows)"
|
@click="insertTag(rows)"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
:disable="!validRow"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
icon="add"
|
icon="add"
|
||||||
|
|
|
@ -514,7 +514,7 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
</template>
|
</template>
|
||||||
<template #column-minPrice="props">
|
<template #column-minPrice="props">
|
||||||
<QTd class="col">
|
<QTd class="col">
|
||||||
<div class="row">
|
<div class="row" style="align-items: center">
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:model-value="props.row.hasMinPrice"
|
:model-value="props.row.hasMinPrice"
|
||||||
@update:model-value="updateMinPrice($event, props)"
|
@update:model-value="updateMinPrice($event, props)"
|
||||||
|
@ -600,11 +600,14 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
.q-table th,
|
.q-table th,
|
||||||
.q-table td {
|
.q-table td {
|
||||||
padding-inline: 5px !important;
|
padding-inline: 5px !important;
|
||||||
// text-align: -webkit-right;
|
}
|
||||||
|
.q-table tr td {
|
||||||
|
font-size: 10pt;
|
||||||
|
border-top: none;
|
||||||
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
.q-table tbody td {
|
.q-table tbody td {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
|
|
||||||
.q-td.col {
|
.q-td.col {
|
||||||
& .vnInputDate {
|
& .vnInputDate {
|
||||||
min-width: 90px;
|
min-width: 90px;
|
||||||
|
|
|
@ -491,9 +491,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnImg
|
<VnImg
|
||||||
size="50x50"
|
size="50x50"
|
||||||
|
zoom-resolution="1600x900"
|
||||||
:id="row.id"
|
:id="row.id"
|
||||||
height="50px"
|
|
||||||
width="50px"
|
|
||||||
class="image"
|
class="image"
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
|
|
|
@ -139,33 +139,35 @@ const openTab = (id) =>
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #top-left>
|
<template #top-left>
|
||||||
<QBtn
|
<div class="q-mt-sm">
|
||||||
icon="refresh"
|
<QBtn
|
||||||
size="md"
|
icon="refresh"
|
||||||
color="primary"
|
size="md"
|
||||||
dense
|
color="primary"
|
||||||
flat
|
dense
|
||||||
@click="$refs.table.reload()"
|
flat
|
||||||
>
|
@click="$refs.table.reload()"
|
||||||
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
>
|
||||||
</QBtn>
|
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
||||||
<QBtn
|
</QBtn>
|
||||||
v-if="selectedRows.length"
|
<QBtn
|
||||||
icon="delete"
|
v-if="selectedRows.length"
|
||||||
size="md"
|
icon="delete"
|
||||||
dense
|
size="md"
|
||||||
flat
|
dense
|
||||||
color="primary"
|
flat
|
||||||
@click="
|
color="primary"
|
||||||
openConfirmationModal(
|
@click="
|
||||||
$t('salesOrdersTable.deleteConfirmTitle'),
|
openConfirmationModal(
|
||||||
$t('salesOrdersTable.deleteConfirmMessage'),
|
$t('globals.deleteConfirmTitle'),
|
||||||
removeOrders
|
$t('salesOrdersTable.deleteConfirmMessage'),
|
||||||
)
|
removeOrders
|
||||||
"
|
)
|
||||||
>
|
"
|
||||||
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
|
>
|
||||||
</QBtn>
|
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-dateSend="{ row }">
|
<template #column-dateSend="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
|
|
|
@ -15,7 +15,6 @@ salesOrdersTable:
|
||||||
dateMake: Make date
|
dateMake: Make date
|
||||||
client: Client
|
client: Client
|
||||||
salesPerson: Salesperson
|
salesPerson: Salesperson
|
||||||
deleteConfirmTitle: Delete selected elements
|
|
||||||
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
|
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
|
||||||
agency: Agency
|
agency: Agency
|
||||||
import: Import
|
import: Import
|
||||||
|
|
|
@ -15,7 +15,6 @@ salesOrdersTable:
|
||||||
dateMake: Fecha de realización
|
dateMake: Fecha de realización
|
||||||
client: Cliente
|
client: Cliente
|
||||||
salesPerson: Comercial
|
salesPerson: Comercial
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
|
||||||
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
|
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
|
||||||
agency: Agencia
|
agency: Agencia
|
||||||
import: Importe
|
import: Importe
|
||||||
|
|
|
@ -130,4 +130,5 @@ function extractValueTags(items) {
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
You can search items by name or id: Puedes buscar items por nombre o id
|
You can search items by name or id: Puedes buscar items por nombre o id
|
||||||
|
Search items: Buscar items
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -247,6 +247,7 @@ function addOrder(value, field, params) {
|
||||||
rounded
|
rounded
|
||||||
emit-value
|
emit-value
|
||||||
use-input
|
use-input
|
||||||
|
sort-by="name ASC"
|
||||||
:disable="!selectedCategoryFk"
|
:disable="!selectedCategoryFk"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(value) => {
|
(value) => {
|
||||||
|
|
|
@ -20,8 +20,10 @@ const props = defineProps({
|
||||||
|
|
||||||
const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 })));
|
const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 })));
|
||||||
const descriptorData = useArrayData('orderData');
|
const descriptorData = useArrayData('orderData');
|
||||||
|
const isLoading = ref(false);
|
||||||
const addToOrder = async () => {
|
const addToOrder = async () => {
|
||||||
|
if (isLoading.value) return;
|
||||||
|
isLoading.value = true;
|
||||||
const items = (fields.value || []).filter((item) => Number(item.quantity) > 0);
|
const items = (fields.value || []).filter((item) => Number(item.quantity) > 0);
|
||||||
await axios.post('/OrderRows/addToOrder', {
|
await axios.post('/OrderRows/addToOrder', {
|
||||||
items,
|
items,
|
||||||
|
@ -30,6 +32,10 @@ const addToOrder = async () => {
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
emit('added');
|
emit('added');
|
||||||
descriptorData.fetch({});
|
descriptorData.fetch({});
|
||||||
|
isLoading.value = false;
|
||||||
|
};
|
||||||
|
const canAddToOrder = () => {
|
||||||
|
return (fields.value || []).some((item) => Number(item.quantity) > 0);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -68,7 +74,11 @@ const addToOrder = async () => {
|
||||||
</tbody>
|
</tbody>
|
||||||
</QMarkupTable>
|
</QMarkupTable>
|
||||||
<div class="flex justify-center q-mt-lg">
|
<div class="flex justify-center q-mt-lg">
|
||||||
<QBtn color="primary" type="submit">
|
<QBtn
|
||||||
|
color="primary"
|
||||||
|
type="submit"
|
||||||
|
:disable="!isLoading && !canAddToOrder()"
|
||||||
|
>
|
||||||
{{ t('globals.add') }}
|
{{ t('globals.add') }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,3 +91,10 @@ const addToOrder = async () => {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
noAmount: La cantidad no puede ser 0
|
||||||
|
en:
|
||||||
|
noAmount: Amount can not be 0
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -13,12 +13,10 @@ import { reactive } from 'vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const ORDER_MODEL = 'order';
|
const ORDER_MODEL = 'order';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const clientList = ref([]);
|
|
||||||
const agencyList = ref([]);
|
const agencyList = ref([]);
|
||||||
const addressList = ref([]);
|
const addressList = ref([]);
|
||||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||||
|
|
|
@ -278,7 +278,11 @@ watch(
|
||||||
>
|
>
|
||||||
<template #column-image="{ row }">
|
<template #column-image="{ row }">
|
||||||
<div class="image-wrapper">
|
<div class="image-wrapper">
|
||||||
<VnImg :id="parseInt(row?.item?.image)" class="rounded" />
|
<VnImg
|
||||||
|
:id="parseInt(row?.item?.image)"
|
||||||
|
class="rounded"
|
||||||
|
zoom-resolution="1600x900"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-id="{ row }">
|
<template #column-id="{ row }">
|
||||||
|
|
|
@ -27,12 +27,15 @@ const columns = computed(() => [
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
isId: true,
|
isId: true,
|
||||||
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.name'),
|
label: t('globals.name'),
|
||||||
name: 'name',
|
name: 'name',
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
|
columnFilter: false,
|
||||||
|
columnClass: 'expand',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -70,18 +73,33 @@ const columns = computed(() => [
|
||||||
data-key="AgencyList"
|
data-key="AgencyList"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
/>
|
/>
|
||||||
<VnTable
|
<div class="list-container">
|
||||||
ref="tableRef"
|
<div class="list">
|
||||||
data-key="AgencyList"
|
<VnTable
|
||||||
url="Agencies"
|
data-key="AgencyList"
|
||||||
order="name"
|
url="Agencies"
|
||||||
:columns="columns"
|
order="name"
|
||||||
:right-search="false"
|
:columns="columns"
|
||||||
:use-model="true"
|
:right-search="false"
|
||||||
redirect="agency"
|
:use-model="true"
|
||||||
default-mode="card"
|
redirect="agency"
|
||||||
/>
|
default-mode="card"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 55%;
|
||||||
|
}
|
||||||
|
.list-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
isOwn: Tiene propietario
|
isOwn: Tiene propietario
|
||||||
|
|
|
@ -46,13 +46,13 @@ async function deleteWorCenter(id) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="workCenters"
|
||||||
|
sort-by="name"
|
||||||
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<div class="centerCard">
|
<div class="centerCard">
|
||||||
<FetchData
|
|
||||||
url="workCenters"
|
|
||||||
sort-by="name"
|
|
||||||
@on-fetch="(data) => (warehouses = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
ref="paginate"
|
ref="paginate"
|
||||||
data-key="AgencyWorkCenters"
|
data-key="AgencyWorkCenters"
|
||||||
|
|
|
@ -167,8 +167,8 @@ const setTicketsRoute = async () => {
|
||||||
<QTd :props="props">
|
<QTd :props="props">
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ props.value }}
|
{{ props.value }}
|
||||||
<TicketDescriptorProxy :id="props?.row?.id" />
|
|
||||||
</span>
|
</span>
|
||||||
|
<TicketDescriptorProxy :id="props?.row?.id" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-client="props">
|
<template #body-cell-client="props">
|
||||||
|
|
|
@ -0,0 +1,360 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
|
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
||||||
|
import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue';
|
||||||
|
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
|
const { openReport } = usePrintService();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
const quasar = useQuasar();
|
||||||
|
const selectedRows = ref([]);
|
||||||
|
const tableRef = ref([]);
|
||||||
|
const confirmationDialog = ref(false);
|
||||||
|
const startingDate = ref(null);
|
||||||
|
const router = useRouter();
|
||||||
|
const routeFilter = {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'workers',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'firstName'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'id',
|
||||||
|
label: 'Id',
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
|
isId: true,
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'workerFk',
|
||||||
|
label: t('route.Worker'),
|
||||||
|
create: true,
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
useLike: false,
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
find: {
|
||||||
|
value: 'workerFk',
|
||||||
|
label: 'workerUserName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
useLike: false,
|
||||||
|
cardVisible: true,
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'agencyModeFk',
|
||||||
|
label: t('route.Agency'),
|
||||||
|
isTitle: true,
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'agencyModes',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
find: {
|
||||||
|
value: 'agencyModeFk',
|
||||||
|
label: 'agencyName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnClass: 'expand',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'vehicleFk',
|
||||||
|
label: t('route.Vehicle'),
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'vehicles',
|
||||||
|
fields: ['id', 'numberPlate'],
|
||||||
|
optionLabel: 'numberPlate',
|
||||||
|
optionFilterValue: 'numberPlate',
|
||||||
|
find: {
|
||||||
|
value: 'vehicleFk',
|
||||||
|
label: 'vehiclePlateNumber',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'created',
|
||||||
|
label: t('route.Date'),
|
||||||
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
component: 'date',
|
||||||
|
format: ({ date }) => toDate(date),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'from',
|
||||||
|
label: t('route.From'),
|
||||||
|
visible: false,
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
component: 'date',
|
||||||
|
format: ({ date }) => toDate(date),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'to',
|
||||||
|
label: t('route.To'),
|
||||||
|
visible: false,
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
component: 'date',
|
||||||
|
format: ({ date }) => toDate(date),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'center',
|
||||||
|
name: 'm3',
|
||||||
|
label: 'm3',
|
||||||
|
cardVisible: true,
|
||||||
|
columnClass: 'shrink',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'started',
|
||||||
|
label: t('route.hourStarted'),
|
||||||
|
component: 'time',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'finished',
|
||||||
|
label: t('route.hourFinished'),
|
||||||
|
component: 'time',
|
||||||
|
columnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'center',
|
||||||
|
name: 'kmStart',
|
||||||
|
label: t('route.KmStart'),
|
||||||
|
columnClass: 'shrink',
|
||||||
|
create: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'center',
|
||||||
|
name: 'kmEnd',
|
||||||
|
label: t('route.KmEnd'),
|
||||||
|
columnClass: 'shrink',
|
||||||
|
create: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'description',
|
||||||
|
label: t('route.Description'),
|
||||||
|
isTitle: true,
|
||||||
|
create: true,
|
||||||
|
component: 'input',
|
||||||
|
field: 'description',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'isOk',
|
||||||
|
label: t('route.Served'),
|
||||||
|
component: 'checkbox',
|
||||||
|
columnFilter: false,
|
||||||
|
columnClass: 'shrink',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('route.Add tickets'),
|
||||||
|
icon: 'vn:ticketAdd',
|
||||||
|
action: (row) => openTicketsDialog(row?.id),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('route.components.smartCard.viewSummary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row?.id, RouteSummary),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('route.Route summary'),
|
||||||
|
icon: 'arrow_forward',
|
||||||
|
action: (row) => navigate(row?.id),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
function navigate(id) {
|
||||||
|
router.push({ path: `/route/${id}` });
|
||||||
|
}
|
||||||
|
|
||||||
|
const cloneRoutes = () => {
|
||||||
|
if (!selectedRows.value.length || !startingDate.value) return;
|
||||||
|
axios.post('Routes/clone', {
|
||||||
|
created: startingDate.value,
|
||||||
|
ids: selectedRows.value.map((row) => row?.id),
|
||||||
|
});
|
||||||
|
startingDate.value = null;
|
||||||
|
tableRef.value.reload();
|
||||||
|
};
|
||||||
|
|
||||||
|
const showRouteReport = () => {
|
||||||
|
const ids = selectedRows.value.map((row) => row?.id);
|
||||||
|
const idString = ids.join(',');
|
||||||
|
let url = `Routes/${idString}/driver-route-pdf`;
|
||||||
|
let params = {};
|
||||||
|
if (selectedRows.value.length >= 1) {
|
||||||
|
params = {
|
||||||
|
id: idString,
|
||||||
|
};
|
||||||
|
url = `Routes/downloadZip`;
|
||||||
|
}
|
||||||
|
openReport(url, params, '_blank');
|
||||||
|
};
|
||||||
|
|
||||||
|
function markAsServed() {
|
||||||
|
selectedRows.value.forEach(async (row) => {
|
||||||
|
await axios.patch(`Routes/${row?.id}`, { isOk: true });
|
||||||
|
});
|
||||||
|
tableRef.value.reload();
|
||||||
|
startingDate.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const openTicketsDialog = (id) => {
|
||||||
|
quasar
|
||||||
|
.dialog({
|
||||||
|
component: RouteListTicketsDialog,
|
||||||
|
componentProps: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(() => tableRef.value.reload());
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<RouteSearchbar />
|
||||||
|
<QDialog v-model="confirmationDialog">
|
||||||
|
<QCard style="min-width: 350px">
|
||||||
|
<QCardSection>
|
||||||
|
<p class="text-h6 q-ma-none">{{ t('route.Select the starting date') }}</p>
|
||||||
|
</QCardSection>
|
||||||
|
|
||||||
|
<QCardSection class="q-pt-none">
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('route.Stating date')"
|
||||||
|
v-model="startingDate"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardActions align="right">
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
:label="t('route.Cancel')"
|
||||||
|
v-close-popup
|
||||||
|
class="text-primary"
|
||||||
|
/>
|
||||||
|
<QBtn color="primary" v-close-popup @click="cloneRoutes">
|
||||||
|
{{ t('globals.clone') }}
|
||||||
|
</QBtn>
|
||||||
|
</QCardActions>
|
||||||
|
</QCard>
|
||||||
|
</QDialog>
|
||||||
|
<VnSubToolbar />
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<RouteFilter data-key="RouteList" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
|
<VnTable
|
||||||
|
class="route-list"
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="RouteList"
|
||||||
|
url="Routes/filter"
|
||||||
|
:columns="columns"
|
||||||
|
:right-search="false"
|
||||||
|
:is-editable="true"
|
||||||
|
:filter="routeFilter"
|
||||||
|
redirect="route"
|
||||||
|
:row-click="false"
|
||||||
|
:create="{
|
||||||
|
urlCreate: 'Routes',
|
||||||
|
title: t('route.createRoute'),
|
||||||
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
|
save-url="Routes/crud"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
|
table-height="85vh"
|
||||||
|
v-model:selected="selectedRows"
|
||||||
|
:table="{
|
||||||
|
'row-key': 'id',
|
||||||
|
selection: 'multiple',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #moreBeforeActions>
|
||||||
|
<QBtn
|
||||||
|
icon="vn:clone"
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
:disable="!selectedRows?.length"
|
||||||
|
@click="confirmationDialog = true"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('route.Clone Selected Routes') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
icon="cloud_download"
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
:disable="!selectedRows?.length"
|
||||||
|
@click="showRouteReport"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('route.Download selected routes as PDF') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
icon="check"
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
:disable="!selectedRows?.length"
|
||||||
|
@click="markAsServed()"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('route.Mark as served') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</template>
|
|
@ -1,34 +1,19 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSession } from 'composables/useSession';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useQuasar } from 'quasar';
|
import { toHour } from 'src/filters';
|
||||||
import { toDate } from 'src/filters';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
||||||
import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue';
|
|
||||||
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { usePrintService } from 'src/composables/usePrintService';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
|
||||||
const { openReport } = usePrintService();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const quasar = useQuasar();
|
|
||||||
const session = useSession();
|
|
||||||
const selectedRows = ref([]);
|
|
||||||
const tableRef = ref([]);
|
const tableRef = ref([]);
|
||||||
const confirmationDialog = ref(false);
|
|
||||||
const startingDate = ref(null);
|
|
||||||
const router = useRouter();
|
|
||||||
const routeFilter = {
|
const routeFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -42,156 +27,70 @@ const routeFilter = {
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
isId: true,
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: 'Id',
|
label: 'Id',
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
isId: true,
|
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerFk',
|
name: 'workerFk',
|
||||||
label: t('Worker'),
|
label: t('route.Worker'),
|
||||||
create: true,
|
create: true,
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'Workers/activeWithInheritedRole',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
useLike: false,
|
|
||||||
optionFilter: 'firstName',
|
|
||||||
find: {
|
|
||||||
value: 'workerFk',
|
|
||||||
label: 'workerUserName',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
inWhere: true,
|
|
||||||
},
|
|
||||||
useLike: false,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'agencyModeFk',
|
|
||||||
label: t('Agency'),
|
|
||||||
isTitle: true,
|
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'agencyModes',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
find: {
|
|
||||||
value: 'agencyModeFk',
|
|
||||||
label: 'agencyName',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columnClass: 'expand',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'vehicleFk',
|
|
||||||
label: t('Vehicle'),
|
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'vehicles',
|
|
||||||
fields: ['id', 'numberPlate'],
|
|
||||||
optionLabel: 'numberPlate',
|
|
||||||
optionFilterValue: 'numberPlate',
|
|
||||||
find: {
|
|
||||||
value: 'vehicleFk',
|
|
||||||
label: 'vehiclePlateNumber',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columnFilter: {
|
|
||||||
inWhere: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'created',
|
|
||||||
label: t('Date'),
|
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
|
||||||
component: 'date',
|
|
||||||
format: ({ date }) => toDate(date),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'from',
|
name: 'agencyName',
|
||||||
label: t('From'),
|
label: t('route.Agency'),
|
||||||
visible: false,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
component: 'date',
|
columnClass: 'expand',
|
||||||
format: ({ date }) => toDate(date),
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'to',
|
name: 'vehiclePlateNumber',
|
||||||
label: t('To'),
|
label: t('route.Vehicle'),
|
||||||
visible: false,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
component: 'date',
|
columnFilter: false,
|
||||||
format: ({ date }) => toDate(date),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
name: 'm3',
|
|
||||||
label: t('Volume'),
|
|
||||||
cardVisible: true,
|
|
||||||
columnClass: 'shrink',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'started',
|
name: 'started',
|
||||||
label: t('hourStarted'),
|
label: t('route.hourStarted'),
|
||||||
component: 'time',
|
cardVisible: true,
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
format: (row) => toHour(row.started),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'finished',
|
name: 'finished',
|
||||||
label: t('hourFinished'),
|
label: t('route.hourFinished'),
|
||||||
component: 'time',
|
cardVisible: true,
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
format: (row) => toHour(row.started),
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
name: 'kmStart',
|
|
||||||
label: t('KmStart'),
|
|
||||||
columnClass: 'shrink',
|
|
||||||
create: true,
|
|
||||||
visible: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
name: 'kmEnd',
|
|
||||||
label: t('KmEnd'),
|
|
||||||
columnClass: 'shrink',
|
|
||||||
create: true,
|
|
||||||
visible: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
label: t('Description'),
|
label: t('route.Description'),
|
||||||
|
cardVisible: true,
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
create: true,
|
create: true,
|
||||||
component: 'input',
|
|
||||||
field: 'description',
|
field: 'description',
|
||||||
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'isOk',
|
name: 'isOk',
|
||||||
label: t('Served'),
|
label: t('route.Served'),
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
|
@ -200,212 +99,43 @@ const columns = computed(() => [
|
||||||
align: 'right',
|
align: 'right',
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
|
||||||
title: t('Add tickets'),
|
|
||||||
icon: 'vn:ticketAdd',
|
|
||||||
action: (row) => openTicketsDialog(row?.id),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: t('components.smartCard.viewSummary'),
|
title: t('components.smartCard.viewSummary'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
action: (row) => viewSummary(row?.id, RouteSummary),
|
action: (row) => viewSummary(row?.id, RouteSummary),
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('Route summary'),
|
|
||||||
icon: 'arrow_forward',
|
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => navigate(row?.id),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function navigate(id) {
|
|
||||||
router.push({ path: `/route/${id}` });
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloneRoutes = () => {
|
|
||||||
if (!selectedRows.value.length || !startingDate.value) return;
|
|
||||||
axios.post('Routes/clone', {
|
|
||||||
created: startingDate.value,
|
|
||||||
ids: selectedRows.value.map((row) => row?.id),
|
|
||||||
});
|
|
||||||
startingDate.value = null;
|
|
||||||
tableRef.value.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
const showRouteReport = () => {
|
|
||||||
const ids = selectedRows.value.map((row) => row?.id);
|
|
||||||
const idString = ids.join(',');
|
|
||||||
let url = `Routes/${idString}/driver-route-pdf`;
|
|
||||||
let params = {};
|
|
||||||
if (selectedRows.value.length >= 1) {
|
|
||||||
params = {
|
|
||||||
id: idString,
|
|
||||||
};
|
|
||||||
url = `Routes/downloadZip`;
|
|
||||||
}
|
|
||||||
openReport(url, params, '_blank');
|
|
||||||
};
|
|
||||||
|
|
||||||
function markAsServed() {
|
|
||||||
selectedRows.value.forEach(async (row) => {
|
|
||||||
await axios.patch(`Routes/${row?.id}`, { isOk: true });
|
|
||||||
});
|
|
||||||
tableRef.value.reload();
|
|
||||||
startingDate.value = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const openTicketsDialog = (id) => {
|
|
||||||
quasar
|
|
||||||
.dialog({
|
|
||||||
component: RouteListTicketsDialog,
|
|
||||||
componentProps: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.onOk(() => tableRef.value.reload());
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RouteSearchbar />
|
<RouteSearchbar />
|
||||||
<QDialog v-model="confirmationDialog">
|
|
||||||
<QCard style="min-width: 350px">
|
|
||||||
<QCardSection>
|
|
||||||
<p class="text-h6 q-ma-none">{{ t('Select the starting date') }}</p>
|
|
||||||
</QCardSection>
|
|
||||||
|
|
||||||
<QCardSection class="q-pt-none">
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('Stating date')"
|
|
||||||
v-model="startingDate"
|
|
||||||
autofocus
|
|
||||||
/>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardActions align="right">
|
|
||||||
<QBtn flat :label="t('Cancel')" v-close-popup class="text-primary" />
|
|
||||||
<QBtn color="primary" v-close-popup @click="cloneRoutes">
|
|
||||||
{{ t('globals.clone') }}
|
|
||||||
</QBtn>
|
|
||||||
</QCardActions>
|
|
||||||
</QCard>
|
|
||||||
</QDialog>
|
|
||||||
<VnSubToolbar />
|
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<RouteFilter data-key="RouteList" />
|
<RouteFilter data-key="RouteList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
class="route-list"
|
|
||||||
ref="tableRef"
|
|
||||||
data-key="RouteList"
|
data-key="RouteList"
|
||||||
url="Routes/filter"
|
url="Routes/filter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:is-editable="true"
|
|
||||||
:filter="routeFilter"
|
:filter="routeFilter"
|
||||||
redirect="route"
|
redirect="route"
|
||||||
:row-click="false"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Routes',
|
urlCreate: 'Routes',
|
||||||
title: t('Create route'),
|
title: t('route.createRoute'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
save-url="Routes/crud"
|
|
||||||
:disable-option="{ card: true }"
|
|
||||||
table-height="85vh"
|
table-height="85vh"
|
||||||
v-model:selected="selectedRows"
|
|
||||||
:table="{
|
|
||||||
'row-key': 'id',
|
|
||||||
selection: 'multiple',
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<template #moreBeforeActions>
|
<template #column-workerFk="{ row }">
|
||||||
<QBtn
|
<span class="link" @click.stop>
|
||||||
icon="vn:clone"
|
{{ row?.workerUserName }}
|
||||||
color="primary"
|
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||||
class="q-mr-sm"
|
</span>
|
||||||
:disable="!selectedRows?.length"
|
|
||||||
@click="confirmationDialog = true"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('Clone Selected Routes') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
|
||||||
icon="cloud_download"
|
|
||||||
color="primary"
|
|
||||||
class="q-mr-sm"
|
|
||||||
:disable="!selectedRows?.length"
|
|
||||||
@click="showRouteReport"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('Download selected routes as PDF') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
|
||||||
icon="check"
|
|
||||||
color="primary"
|
|
||||||
class="q-mr-sm"
|
|
||||||
:disable="!selectedRows?.length"
|
|
||||||
@click="markAsServed()"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('Mark as served') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.table-input-cell {
|
|
||||||
max-width: 143px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.route-list {
|
|
||||||
width: 100%;
|
|
||||||
max-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-actions {
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
th:last-child,
|
|
||||||
td:last-child {
|
|
||||||
background-color: var(--vn-section-color);
|
|
||||||
position: sticky;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
newRoute: New Route
|
|
||||||
hourStarted: Started hour
|
|
||||||
hourFinished: Finished hour
|
|
||||||
es:
|
|
||||||
From: Desde
|
|
||||||
To: Hasta
|
|
||||||
Worker: Trabajador
|
|
||||||
Agency: Agencia
|
|
||||||
Vehicle: Vehículo
|
|
||||||
Volume: Volumen
|
|
||||||
Date: Fecha
|
|
||||||
Description: Descripción
|
|
||||||
Hour started: Hora inicio
|
|
||||||
Hour finished: Hora fin
|
|
||||||
KmStart: Km inicio
|
|
||||||
KmEnd: Km fin
|
|
||||||
Served: Servida
|
|
||||||
newRoute: Nueva Ruta
|
|
||||||
Clone Selected Routes: Clonar rutas seleccionadas
|
|
||||||
Select the starting date: Seleccione la fecha de inicio
|
|
||||||
Stating date: Fecha de inicio
|
|
||||||
Cancel: Cancelar
|
|
||||||
Mark as served: Marcar como servidas
|
|
||||||
Download selected routes as PDF: Descargar rutas seleccionadas como PDF
|
|
||||||
Add ticket: Añadir tickets
|
|
||||||
Preview: Vista previa
|
|
||||||
Summary: Resumen
|
|
||||||
Route is closed: La ruta está cerrada
|
|
||||||
Route is not served: La ruta no está servida
|
|
||||||
hourStarted: Hora de inicio
|
|
||||||
hourFinished: Hora de fin
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ const columns = computed(() => [
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('Ver cmr'),
|
title: t('Ver cmr'),
|
||||||
icon: 'visibility',
|
icon: 'preview',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => viewSummary(row?.id, RoadmapSummary),
|
action: (row) => viewSummary(row?.id, RoadmapSummary),
|
||||||
},
|
},
|
||||||
|
|
|
@ -342,10 +342,7 @@ const openSmsDialog = async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-city="{ value, row }">
|
<template #body-cell-city="{ value, row }">
|
||||||
<QTd auto-width>
|
<QTd auto-width>
|
||||||
<span
|
<span class="link" @click="goToBuscaman(row)">
|
||||||
class="text-primary cursor-pointer"
|
|
||||||
@click="goToBuscaman(row)"
|
|
||||||
>
|
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<QTooltip>{{ t('Open buscaman') }}</QTooltip>
|
<QTooltip>{{ t('Open buscaman') }}</QTooltip>
|
||||||
</span>
|
</span>
|
||||||
|
@ -353,7 +350,7 @@ const openSmsDialog = async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-client="{ value, row }">
|
<template #body-cell-client="{ value, row }">
|
||||||
<QTd auto-width>
|
<QTd auto-width>
|
||||||
<span class="text-primary cursor-pointer">
|
<span class="link">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<CustomerDescriptorProxy :id="row?.clientFk" />
|
<CustomerDescriptorProxy :id="row?.clientFk" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -361,7 +358,7 @@ const openSmsDialog = async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-ticket="{ value, row }">
|
<template #body-cell-ticket="{ value, row }">
|
||||||
<QTd auto-width class="text-center">
|
<QTd auto-width class="text-center">
|
||||||
<span class="text-primary cursor-pointer">
|
<span class="link">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<TicketDescriptorProxy :id="row?.id" />
|
<TicketDescriptorProxy :id="row?.id" />
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
route:
|
||||||
|
Worker: Worker
|
||||||
|
Agency: Agency
|
||||||
|
Vehicle: Vehicle
|
||||||
|
Description: Description
|
||||||
|
hourStarted: H.Start
|
||||||
|
hourFinished: H.End
|
||||||
|
createRoute: Create route
|
||||||
|
From: From
|
||||||
|
To: To
|
||||||
|
Date: Date
|
||||||
|
KmStart: Km start
|
||||||
|
KmEnd: Km end
|
||||||
|
Served: Served
|
||||||
|
Clone Selected Routes: Clone selected routes
|
||||||
|
Select the starting date: Select the starting date
|
||||||
|
Stating date: Starting date
|
||||||
|
Cancel: Cancel
|
||||||
|
Mark as served: Mark as served
|
||||||
|
Download selected routes as PDF: Download selected routes as PDF
|
||||||
|
Add ticket: Add ticket
|
||||||
|
Preview: Preview
|
||||||
|
Summary: Summary
|
||||||
|
Route is closed: Route is closed
|
||||||
|
Route is not served: Route is not served
|
||||||
|
cmr:
|
||||||
|
list:
|
||||||
|
results: results
|
||||||
|
cmrFk: CMR id
|
||||||
|
hasCmrDms: Attached in gestdoc
|
||||||
|
'true': 'Yes'
|
||||||
|
'false': 'No'
|
||||||
|
ticketFk: Ticketd id
|
||||||
|
routeFk: Route id
|
||||||
|
country: Country
|
||||||
|
clientFk: Client id
|
||||||
|
shipped: Preparation date
|
||||||
|
viewCmr: View CMR
|
||||||
|
downloadCmrs: Download CMRs
|
|
@ -0,0 +1,39 @@
|
||||||
|
route:
|
||||||
|
Worker: Trabajador
|
||||||
|
Agency: Agencia
|
||||||
|
Vehicle: Vehículo
|
||||||
|
Description: Descripción
|
||||||
|
hourStarted: H.Inicio
|
||||||
|
hourFinished: H.Fin
|
||||||
|
createRoute: Crear ruta
|
||||||
|
From: Desde
|
||||||
|
To: Hasta
|
||||||
|
Date: Fecha
|
||||||
|
KmStart: Km inicio
|
||||||
|
KmEnd: Km fin
|
||||||
|
Served: Servida
|
||||||
|
Clone Selected Routes: Clonar rutas seleccionadas
|
||||||
|
Select the starting date: Seleccione la fecha de inicio
|
||||||
|
Stating date: Fecha de inicio
|
||||||
|
Cancel: Cancelar
|
||||||
|
Mark as served: Marcar como servidas
|
||||||
|
Download selected routes as PDF: Descargar rutas seleccionadas como PDF
|
||||||
|
Add ticket: Añadir tickets
|
||||||
|
Preview: Vista previa
|
||||||
|
Summary: Resumen
|
||||||
|
Route is closed: La ruta está cerrada
|
||||||
|
Route is not served: La ruta no está servida
|
||||||
|
cmr:
|
||||||
|
list:
|
||||||
|
results: resultados
|
||||||
|
cmrFk: Id CMR
|
||||||
|
hasCmrDms: Gestdoc
|
||||||
|
'true': Sí
|
||||||
|
'false': 'No'
|
||||||
|
ticketFk: Id ticket
|
||||||
|
routeFk: Id ruta
|
||||||
|
country: País
|
||||||
|
clientFk: Id cliente
|
||||||
|
shipped: Fecha preparación
|
||||||
|
viewCmr: Ver CMR
|
||||||
|
downloadCmrs: Descargar CMRs
|
|
@ -84,6 +84,7 @@ function handleLocation(data, location) {
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:location="
|
:location="
|
||||||
data.postalCode
|
data.postalCode
|
||||||
|
|
|
@ -15,12 +15,12 @@ const route = useRoute();
|
||||||
const agenciesOptions = ref(null);
|
const agenciesOptions = ref(null);
|
||||||
const newAgencyTermForm = reactive({
|
const newAgencyTermForm = reactive({
|
||||||
agencyFk: null,
|
agencyFk: null,
|
||||||
minimumM3: null,
|
minimumM3: 0,
|
||||||
packagePrice: null,
|
packagePrice: 0,
|
||||||
kmPrice: null,
|
kmPrice: 0,
|
||||||
m3Price: null,
|
m3Price: 0,
|
||||||
routePrice: null,
|
routePrice: null,
|
||||||
minimumKm: null,
|
minimumKm: 0,
|
||||||
supplierFk: route.params.id,
|
supplierFk: route.params.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,22 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
:filter="{
|
:filter="{
|
||||||
fields: ['id', 'name', 'city', 'postCode', 'countryFk', 'provinceFk'],
|
fields: [
|
||||||
|
'id',
|
||||||
|
'nif',
|
||||||
|
'city',
|
||||||
|
'name',
|
||||||
|
'account',
|
||||||
|
'postCode',
|
||||||
|
'countryFk',
|
||||||
|
'provinceFk',
|
||||||
|
'sageTaxTypeFk',
|
||||||
|
'sageWithholdingFk',
|
||||||
|
'sageTransactionTypeFk',
|
||||||
|
'supplierActivityFk',
|
||||||
|
'healthRegister',
|
||||||
|
'street',
|
||||||
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'province',
|
relation: 'province',
|
||||||
|
@ -146,6 +161,7 @@ function handleLocation(data, location) {
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:location="{
|
:location="{
|
||||||
postcode: data.postCode,
|
postcode: data.postCode,
|
||||||
|
|
|
@ -277,13 +277,14 @@ async function createRefund(withWarehouse) {
|
||||||
const params = {
|
const params = {
|
||||||
ticketsIds: [parseInt(ticketId)],
|
ticketsIds: [parseInt(ticketId)],
|
||||||
withWarehouse: withWarehouse,
|
withWarehouse: withWarehouse,
|
||||||
|
negative: true,
|
||||||
};
|
};
|
||||||
const { data } = await axios.post(`Tickets/refund`, params);
|
const { data } = await axios.post(`Tickets/cloneAll`, params);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
const refundTicket = data;
|
const [refundTicket] = data;
|
||||||
|
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
||||||
push({ name: 'TicketSale', params: { id: refundTicket[0].id } });
|
push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,13 @@ async function handleSave() {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (observationTypes = data)"
|
@on-fetch="
|
||||||
|
(data) =>
|
||||||
|
(observationTypes = data.map((type) => {
|
||||||
|
type.label = t(`ticketNotes.observationTypes.${type.description}`);
|
||||||
|
return type;
|
||||||
|
}))
|
||||||
|
"
|
||||||
auto-load
|
auto-load
|
||||||
url="ObservationTypes"
|
url="ObservationTypes"
|
||||||
/>
|
/>
|
||||||
|
@ -76,7 +82,7 @@ async function handleSave() {
|
||||||
:label="t('ticketNotes.observationType')"
|
:label="t('ticketNotes.observationType')"
|
||||||
:options="observationTypes"
|
:options="observationTypes"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="description"
|
option-label="label"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.observationTypeFk"
|
v-model="row.observationTypeFk"
|
||||||
:disable="!!row.id"
|
:disable="!!row.id"
|
||||||
|
|
|
@ -53,7 +53,7 @@ const tableRef = ref([]);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.params.id,
|
() => route.params.id,
|
||||||
async () => await getSales()
|
() => tableRef.value.reload()
|
||||||
);
|
);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -161,15 +161,6 @@ const onSalesFetched = (salesData) => {
|
||||||
for (let sale of salesData) sale.amount = getSaleTotal(sale);
|
for (let sale of salesData) sale.amount = getSaleTotal(sale);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSales = async () => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Tickets/${route.params.id}/getSales`);
|
|
||||||
onSalesFetched(data);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching sales', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getSaleTotal = (sale) => {
|
const getSaleTotal = (sale) => {
|
||||||
if (sale.quantity == null || sale.price == null) return null;
|
if (sale.quantity == null || sale.price == null) return null;
|
||||||
|
|
||||||
|
@ -181,7 +172,7 @@ const getSaleTotal = (sale) => {
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
getSales();
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
|
@ -434,8 +425,6 @@ const setTransferParams = async () => {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
getConfig();
|
getConfig();
|
||||||
getSales();
|
|
||||||
getItems();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
@ -443,11 +432,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
const items = ref([]);
|
const items = ref([]);
|
||||||
const newRow = ref({});
|
const newRow = ref({});
|
||||||
|
|
||||||
async function getItems() {
|
|
||||||
const { data } = await axios.get(`Items/withName`);
|
|
||||||
items.value = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateItem = (row) => {
|
const updateItem = (row) => {
|
||||||
const selectedItem = items.value.find((item) => item.id === row.itemFk);
|
const selectedItem = items.value.find((item) => item.id === row.itemFk);
|
||||||
if (selectedItem) {
|
if (selectedItem) {
|
||||||
|
@ -623,6 +607,7 @@ watch(
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
auto-load
|
auto-load
|
||||||
|
@on-fetch="onSalesFetched"
|
||||||
:create="{
|
:create="{
|
||||||
onDataSaved: handleOnDataSave,
|
onDataSaved: handleOnDataSave,
|
||||||
}"
|
}"
|
||||||
|
@ -678,6 +663,13 @@ watch(
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
|
<template #body-cell-picture="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<div class="image-wrapper">
|
||||||
|
<VnImg :id="row.itemFk" class="rounded" zoom-resolution="1600x900" />
|
||||||
|
</div>
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
<template #column-image="{ row }">
|
<template #column-image="{ row }">
|
||||||
<div class="image-wrapper">
|
<div class="image-wrapper">
|
||||||
<VnImg :id="parseInt(row?.item?.id)" class="rounded" />
|
<VnImg :id="parseInt(row?.item?.id)" class="rounded" />
|
||||||
|
|
|
@ -44,7 +44,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const { push } = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { dialog } = useQuasar();
|
const { dialog } = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => {
|
||||||
try {
|
try {
|
||||||
const params = { ticketId: ticket.value.id, sales: props.sales };
|
const params = { ticketId: ticket.value.id, sales: props.sales };
|
||||||
const { data } = await axios.post(`Claims/createFromSales`, params);
|
const { data } = await axios.post(`Claims/createFromSales`, params);
|
||||||
router.push({ name: 'ClaimBasicData', params: { id: data.id } });
|
push({ name: 'ClaimBasicData', params: { id: data.id } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error creating claim: ', error);
|
console.error('Error creating claim: ', error);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
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');
|
||||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
|
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
|
||||||
import { onMounted, ref, computed } from 'vue';
|
import { onMounted, ref, computed } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
|
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
|
||||||
|
@ -12,6 +12,8 @@ import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescripto
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
@ -19,8 +21,7 @@ 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';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -38,6 +39,8 @@ const ticket = computed(() => summaryRef.value?.entity);
|
||||||
const editableStates = ref([]);
|
const editableStates = ref([]);
|
||||||
const ticketUrl = ref();
|
const ticketUrl = ref();
|
||||||
const grafanaUrl = 'https://grafana.verdnatura.es';
|
const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||||
|
const stateBtnDropdownRef = ref();
|
||||||
|
const descriptorData = useArrayData('ticketData');
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
||||||
|
@ -64,37 +67,18 @@ function isEditable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeState(value) {
|
async function changeState(value) {
|
||||||
if (!ticket.value.id) return;
|
try {
|
||||||
|
stateBtnDropdownRef.value.hide();
|
||||||
const formData = {
|
const formData = {
|
||||||
ticketFk: ticket.value.id,
|
ticketFk: entityId.value,
|
||||||
code: value,
|
code: value,
|
||||||
};
|
};
|
||||||
|
await axios.post(`Tickets/state`, formData);
|
||||||
await axios.post(`Tickets/state`, formData);
|
notify('globals.dataSaved', 'positive');
|
||||||
router.go(route.fullPath);
|
summaryRef.value?.fetch();
|
||||||
}
|
descriptorData.fetch({});
|
||||||
|
} catch (err) {
|
||||||
function getNoteValue(description) {
|
console.error('Error changing ticket state', err);
|
||||||
switch (description) {
|
|
||||||
case 'ItemPicker':
|
|
||||||
return t('ItemPicker');
|
|
||||||
case 'Packager':
|
|
||||||
return t('Packager');
|
|
||||||
case 'Delivery':
|
|
||||||
return t('Delivery');
|
|
||||||
case 'SalesPerson':
|
|
||||||
return t('SalesPerson');
|
|
||||||
case 'Administrative':
|
|
||||||
return t('Administrative');
|
|
||||||
case 'Weight':
|
|
||||||
return t('Weight');
|
|
||||||
case 'InvoiceOut':
|
|
||||||
return t('InvoiceOut');
|
|
||||||
case 'DropOff':
|
|
||||||
return t('DropOff');
|
|
||||||
case 'Sustitución':
|
|
||||||
return t('Sustitución');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,6 +109,7 @@ function toTicketUrl(section) {
|
||||||
</template>
|
</template>
|
||||||
<template #header-right>
|
<template #header-right>
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
|
ref="stateBtnDropdownRef"
|
||||||
color="black"
|
color="black"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
:label="t('ticket.summary.changeState')"
|
:label="t('ticket.summary.changeState')"
|
||||||
|
@ -137,7 +122,7 @@ function toTicketUrl(section) {
|
||||||
option-value="code"
|
option-value="code"
|
||||||
hide-dropdown-icon
|
hide-dropdown-icon
|
||||||
focus-on-mount
|
focus-on-mount
|
||||||
@update:model-value="changeState(item.code)"
|
@update:model-value="changeState"
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
@ -268,23 +253,32 @@ function toTicketUrl(section) {
|
||||||
:url="toTicketUrl('observation')"
|
:url="toTicketUrl('observation')"
|
||||||
:text="t('ticket.pageTitles.notes')"
|
:text="t('ticket.pageTitles.notes')"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QVirtualScroll
|
||||||
v-for="note in entity.notes"
|
:items="entity.notes"
|
||||||
:key="note.id"
|
v-slot="{ item, index }"
|
||||||
:label="getNoteValue(note.observationType.description)"
|
style="max-height: 300px"
|
||||||
:value="note.description"
|
separator
|
||||||
>
|
>
|
||||||
<template #value>
|
<QItem
|
||||||
<QInput
|
:key="index"
|
||||||
v-model="note.description"
|
class="vn-label-value"
|
||||||
filled
|
style="
|
||||||
type="textarea"
|
display: inline-block;
|
||||||
class="notes"
|
padding: unset;
|
||||||
readonly
|
min-height: max-content;
|
||||||
autogrow
|
"
|
||||||
/>
|
>
|
||||||
</template>
|
<span class="label" style="margin-right: 4px">
|
||||||
</VnLv>
|
({{
|
||||||
|
t(
|
||||||
|
`ticketNotes.observationTypes.${item.observationType.description}`
|
||||||
|
)
|
||||||
|
}}):
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span>{{ item.description }}</span>
|
||||||
|
</QItem>
|
||||||
|
</QVirtualScroll>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle :text="t('ticket.summary.summaryAmount')" />
|
<VnTitle :text="t('ticket.summary.summaryAmount')" />
|
||||||
|
@ -613,28 +607,3 @@ function toTicketUrl(section) {
|
||||||
color: $primary-light;
|
color: $primary-light;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
ItemPicker: Item Picker
|
|
||||||
Packager: Packager
|
|
||||||
Delivery: Delivery
|
|
||||||
SalesPerson: Sales Person
|
|
||||||
Administrative: Administrative
|
|
||||||
Weight: Weight
|
|
||||||
InvoiceOut: Invoice Out
|
|
||||||
DropOff: Drop Off
|
|
||||||
Sustitución: Sustitution
|
|
||||||
es:
|
|
||||||
ItemPicker: Items
|
|
||||||
Packager: Encajador
|
|
||||||
Delivery: Envío
|
|
||||||
SalesPerson: Comercial
|
|
||||||
Administrative: Administrativa
|
|
||||||
Weight: Peso
|
|
||||||
InvoiceOut: Facturas
|
|
||||||
DropOff: Despacho
|
|
||||||
Sustitución: Sustitución
|
|
||||||
Accepted: Aceptado
|
|
||||||
Denied: Denegado
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -14,6 +14,16 @@ ticketNotes:
|
||||||
description: Description
|
description: Description
|
||||||
removeNote: Remove note
|
removeNote: Remove note
|
||||||
addNote: Add note
|
addNote: Add note
|
||||||
|
observationTypes:
|
||||||
|
ItemPicker: Item picker
|
||||||
|
Packager: Packager
|
||||||
|
Delivery: Delivery
|
||||||
|
SalesPerson: Sales person
|
||||||
|
Administrative: Administrative
|
||||||
|
Weight: Weight
|
||||||
|
InvoiceOut: Invoice Out
|
||||||
|
DropOff: Drop Off
|
||||||
|
Sustitución: Sustitution
|
||||||
ticketSale:
|
ticketSale:
|
||||||
id: Id
|
id: Id
|
||||||
visible: Visible
|
visible: Visible
|
||||||
|
|
|
@ -29,6 +29,18 @@ ticketNotes:
|
||||||
description: Descripción
|
description: Descripción
|
||||||
removeNote: Quitar nota
|
removeNote: Quitar nota
|
||||||
addNote: Añadir nota
|
addNote: Añadir nota
|
||||||
|
observationTypes:
|
||||||
|
ItemPicker: Sacador
|
||||||
|
Packager: Encajador
|
||||||
|
Delivery: Envío
|
||||||
|
SalesPerson: Comercial
|
||||||
|
Administrative: Administrativa
|
||||||
|
Weight: Peso
|
||||||
|
InvoiceOut: Facturas
|
||||||
|
DropOff: Despacho
|
||||||
|
Sustitución: Sustitución
|
||||||
|
Accepted: Aceptado
|
||||||
|
Denied: Denegado
|
||||||
purchaseRequest:
|
purchaseRequest:
|
||||||
Id: Id
|
Id: Id
|
||||||
description: Descripción
|
description: Descripción
|
||||||
|
|
|
@ -121,6 +121,20 @@ const thermographsTableColumns = computed(() => {
|
||||||
name: 'temperatureFk',
|
name: 'temperatureFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.maxTemperature'),
|
||||||
|
field: 'maxTemperature',
|
||||||
|
name: 'maxTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.minTemperature'),
|
||||||
|
field: 'minTemperature',
|
||||||
|
name: 'minTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.thermographs.state'),
|
label: t('travel.thermographs.state'),
|
||||||
field: 'result',
|
field: 'result',
|
||||||
|
@ -133,7 +147,7 @@ const thermographsTableColumns = computed(() => {
|
||||||
name: 'destination',
|
name: 'destination',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) =>
|
format: (val) =>
|
||||||
warehouses.value.find((warehouse) => warehouse.id === val).name,
|
warehouses.value.find((warehouse) => warehouse.id === val)?.name,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.thermographs.created'),
|
label: t('travel.thermographs.created'),
|
||||||
|
@ -319,7 +333,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-id="{ col, value }">
|
<template #body-cell-id="{ col, value }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn v-if="col.name === 'id'" flat color="blue">
|
<QBtn v-if="col.name === 'id'" flat class="link">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<EntryDescriptorProxy :id="value" />
|
<EntryDescriptorProxy :id="value" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -47,6 +47,20 @@ const TableColumns = computed(() => {
|
||||||
name: 'temperatureFk',
|
name: 'temperatureFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.maxTemperature'),
|
||||||
|
field: 'maxTemperature',
|
||||||
|
name: 'maxTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.minTemperature'),
|
||||||
|
field: 'minTemperature',
|
||||||
|
name: 'minTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.thermographs.state'),
|
label: t('travel.thermographs.state'),
|
||||||
field: 'result',
|
field: 'result',
|
||||||
|
@ -92,11 +106,7 @@ const openRemoveDialog = async (id) => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
try {
|
await removeThermograph(id);
|
||||||
await removeThermograph(id);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing thermograph');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,9 +116,7 @@ const redirectToThermographForm = (action, id) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (action === 'edit' && id) {
|
if (action === 'edit' && id) {
|
||||||
const params = {};
|
routeDetails.query = { travelThermographFk: id };
|
||||||
params.thermographId = id;
|
|
||||||
routeDetails.params = params;
|
|
||||||
}
|
}
|
||||||
router.push(routeDetails);
|
router.push(routeDetails);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { reactive, ref, onBeforeMount } from 'vue';
|
import { ref, onBeforeMount } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -14,6 +14,7 @@ import { useState } from 'src/composables/useState';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
viewAction: {
|
viewAction: {
|
||||||
|
@ -28,24 +29,17 @@ const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
const fetchTravelThermographsRef = ref(null);
|
||||||
const allowedContentTypes = ref('');
|
const allowedContentTypes = ref('');
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const dmsTypesOptions = ref([]);
|
const dmsTypesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
|
const temperaturesOptions = ref([]);
|
||||||
|
const thermographForm = ref({});
|
||||||
const inputFileRef = ref(null);
|
const inputFileRef = ref(null);
|
||||||
|
|
||||||
const thermographForm = reactive({
|
|
||||||
thermographId: null,
|
|
||||||
state: null,
|
|
||||||
reference: null,
|
|
||||||
dmsTypeId: null,
|
|
||||||
companyId: null,
|
|
||||||
warehouseId: null,
|
|
||||||
files: [],
|
|
||||||
description: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
if (props.viewAction === 'create') {
|
if (props.viewAction === 'create') {
|
||||||
setCreateDefaultParams();
|
setCreateDefaultParams();
|
||||||
|
@ -65,7 +59,7 @@ const fetchDmsTypes = async () => {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
filter: {
|
filter: {
|
||||||
where: { code: 'miscellaneous' },
|
where: { code: 'thermograph' },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const { data } = await axios.get('DmsTypes/findOne', { params });
|
const { data } = await axios.get('DmsTypes/findOne', { params });
|
||||||
|
@ -77,88 +71,67 @@ const fetchDmsTypes = async () => {
|
||||||
|
|
||||||
const setCreateDefaultParams = async () => {
|
const setCreateDefaultParams = async () => {
|
||||||
const dataResponse = await fetchDmsTypes();
|
const dataResponse = await fetchDmsTypes();
|
||||||
thermographForm.companyId = user.value.companyFk;
|
thermographForm.value.companyId = user.value.companyFk;
|
||||||
thermographForm.warehouseId = user.value.warehouseFk;
|
thermographForm.value.warehouseId = user.value.warehouseFk;
|
||||||
thermographForm.reference = route.params.id;
|
thermographForm.value.reference = route.params.id;
|
||||||
thermographForm.dmsTypeId = dataResponse.id;
|
thermographForm.value.dmsTypeId = dataResponse.id;
|
||||||
thermographForm.state = 'Ok';
|
thermographForm.value.state = 'Ok';
|
||||||
thermographForm.description = t('travel.thermographs.travelFileDescription', {
|
thermographForm.value.description = t('travel.thermographs.travelFileDescription', {
|
||||||
travelId: route.params.id,
|
travelId: route.params.id,
|
||||||
}).toUpperCase();
|
}).toUpperCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
const setEditDefaultParams = async () => {
|
const setEditDefaultParams = async () => {
|
||||||
try {
|
const filterObj = { include: { relation: 'dms' } };
|
||||||
const filterObj = { include: { relation: 'dms' } };
|
const filter = encodeURIComponent(JSON.stringify(filterObj));
|
||||||
const filter = encodeURIComponent(JSON.stringify(filterObj));
|
const { data } = await axios.get(
|
||||||
const { data } = await axios.get(
|
`TravelThermographs/${route.query.travelThermographFk}?filter=${filter}`
|
||||||
`TravelThermographs/${route.params.thermographId}?filter=${filter}`
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
thermographForm.thermographId = data.thermographFk;
|
thermographForm.value.thermographFk = data.thermographFk;
|
||||||
thermographForm.state = data.result;
|
thermographForm.value.state = data.result;
|
||||||
thermographForm.reference = data.dms?.reference;
|
thermographForm.value.reference = data.dms?.reference;
|
||||||
thermographForm.warehouseId = data.dms?.warehouseFk;
|
thermographForm.value.warehouseId = data.warehouseFk;
|
||||||
thermographForm.companyId = data.dms?.companyFk;
|
thermographForm.value.companyId = data.dms?.companyFk;
|
||||||
thermographForm.dmsTypeId = data.dms?.dmsTypeFk;
|
thermographForm.value.dmsTypeId = data.dms?.dmsTypeFk;
|
||||||
thermographForm.description = data.dms?.description || '';
|
thermographForm.value.description = data.dms?.description || '';
|
||||||
thermographForm.hasFile = data.dms?.hasFile;
|
thermographForm.value.hasFile = data.dms?.hasFile;
|
||||||
thermographForm.hasFileAttached = false;
|
thermographForm.value.hasFileAttached = false;
|
||||||
}
|
thermographForm.value.maxTemperature = data.maxTemperature;
|
||||||
} catch (err) {
|
thermographForm.value.minTemperature = data.minTemperature;
|
||||||
console.error('Error fetching termograph');
|
thermographForm.value.temperatureFk = data.temperatureFk;
|
||||||
|
thermographForm.value.travelThermographFk = data.id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = async () => {
|
||||||
props.viewAction === 'create' ? createThermograph() : updateThermograph();
|
|
||||||
};
|
|
||||||
|
|
||||||
const createThermograph = async () => {
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
if (Array.isArray(thermographForm.value.files)) {
|
||||||
thermographForm.files.forEach((file) => {
|
thermographForm.value.hasFileAttached = true;
|
||||||
formData.append(file.name, file);
|
thermographForm.value.files.forEach((file) => {
|
||||||
});
|
formData.append(file.name, file);
|
||||||
|
|
||||||
try {
|
|
||||||
await axios.post(`/travels/${route.params.id}/createThermograph`, formData, {
|
|
||||||
params: thermographForm,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
router.push({ name: 'TravelThermographsIndex' });
|
|
||||||
notify(t('Thermograph created'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error creating thermograph');
|
|
||||||
}
|
}
|
||||||
};
|
delete thermographForm.value.files;
|
||||||
|
await axios.post(`/travels/${route.params.id}/saveThermograph`, formData, {
|
||||||
const updateThermograph = async () => {
|
params: thermographForm.value,
|
||||||
const formData = new FormData();
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
thermographForm.files.forEach((file) => {
|
},
|
||||||
formData.append(file.name, file);
|
|
||||||
});
|
});
|
||||||
|
router.push({ name: 'TravelThermographsIndex' });
|
||||||
try {
|
notify(t('Thermograph created'), 'positive');
|
||||||
await axios.post(`travels/${route.params.id}/updateThermograph`, formData, {
|
|
||||||
params: thermographForm,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
router.push({ name: 'TravelThermographsIndex' });
|
|
||||||
notify(t('Thermograph created'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error creating thermograph');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onThermographCreated = async (data) => {
|
const onThermographCreated = async (data) => {
|
||||||
thermographForm.thermographId = data.id;
|
await fetchTravelThermographsRef.value.fetch();
|
||||||
|
thermographForm.value = {
|
||||||
|
...thermographForm.value,
|
||||||
|
...data,
|
||||||
|
travelThermographFk: data.id,
|
||||||
|
warehouseId: data.warehouseFk,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -185,6 +158,11 @@ const onThermographCreated = async (data) => {
|
||||||
:filter="{ order: 'name' }"
|
:filter="{ order: 'name' }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
<FetchData
|
||||||
|
@on-fetch="(data) => (temperaturesOptions = data)"
|
||||||
|
auto-load
|
||||||
|
url="Temperatures"
|
||||||
|
/>
|
||||||
<QPage class="column items-center full-width">
|
<QPage class="column items-center full-width">
|
||||||
<QForm
|
<QForm
|
||||||
model="travel"
|
model="travel"
|
||||||
|
@ -219,21 +197,20 @@ const onThermographCreated = async (data) => {
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('travel.thermographs.thermograph')"
|
:label="t('travel.thermographs.thermograph')"
|
||||||
v-model="thermographForm.thermographId"
|
v-model="thermographForm.travelThermographFk"
|
||||||
url="TravelThermographs"
|
url="TravelThermographs"
|
||||||
option-value="thermographFk"
|
:fields="['id', 'thermographFk']"
|
||||||
option-label="thermographFk"
|
:where="{
|
||||||
:fields="['thermographFk']"
|
or: [{ travelFk: null }, { travelFk: $route.params.id }],
|
||||||
:where="{ travelFk: null }"
|
}"
|
||||||
sort-by="thermographFk ASC"
|
sort-by="thermographFk ASC"
|
||||||
|
option-label="thermographFk"
|
||||||
:disable="viewAction === 'edit'"
|
:disable="viewAction === 'edit'"
|
||||||
:tooltip="t('New thermograph')"
|
:tooltip="t('New thermograph')"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateThermographForm
|
<CreateThermographForm
|
||||||
@on-data-saved="
|
@on-data-saved="onThermographCreated"
|
||||||
(data) => (thermographForm.thermographId = data.id)
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
|
@ -271,6 +248,26 @@ const onThermographCreated = async (data) => {
|
||||||
option-label="name"
|
option-label="name"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('travel.thermographs.temperature')"
|
||||||
|
:options="temperaturesOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="name"
|
||||||
|
option-value="code"
|
||||||
|
v-model="thermographForm.temperatureFk"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
|
<VnInputNumber
|
||||||
|
v-model="thermographForm.maxTemperature"
|
||||||
|
:label="t('globals.maxTemperature')"
|
||||||
|
/>
|
||||||
|
<VnInputNumber
|
||||||
|
v-model="thermographForm.minTemperature"
|
||||||
|
:label="t('globals.minTemperature')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
|
||||||
<VnRow v-if="viewAction === 'edit'" class="row q-gutter-md q-mb-md">
|
<VnRow v-if="viewAction === 'edit'" class="row q-gutter-md q-mb-md">
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('globals.description')"
|
:label="t('globals.description')"
|
||||||
|
@ -310,8 +307,8 @@ const onThermographCreated = async (data) => {
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Select files: Selecciona ficheros
|
Select files: Selecciona ficheros
|
||||||
Thermograph created: Termógrafo creado
|
Thermograph created: Termógrafo creado
|
||||||
New thermograph: Nuevo termógrafo
|
New thermograph: Nuevo termógrafo
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -0,0 +1,157 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const states = ref([]);
|
||||||
|
|
||||||
|
defineExpose({ states });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData url="warehouses" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params, searchFn }">
|
||||||
|
<div class="q-pa-sm q-gutter-y-sm">
|
||||||
|
<VnInput
|
||||||
|
:label="t('travel.Id')"
|
||||||
|
v-model="params.id"
|
||||||
|
lazy-rules
|
||||||
|
is-outlined
|
||||||
|
>
|
||||||
|
<template #prepend> <QIcon name="badge" size="xs" /></template>
|
||||||
|
</VnInput>
|
||||||
|
<VnInput
|
||||||
|
:label="t('travel.ref')"
|
||||||
|
v-model="params.ref"
|
||||||
|
lazy-rules
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('travel.agency')"
|
||||||
|
v-model="params.agencyModeFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
url="agencyModes"
|
||||||
|
:use-like="false"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
option-filter="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('travel.warehouseInFk')"
|
||||||
|
v-model="params.warehouseInFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
url="warehouses"
|
||||||
|
:use-like="false"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
option-filter="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('travel.shipped')"
|
||||||
|
v-model="params.shipped"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
<VnInputTime
|
||||||
|
v-model="params.shipmentHour"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
:label="t('travel.shipmentHour')"
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('travel.warehouseOut')"
|
||||||
|
v-model="params.warehouseOut"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
url="warehouses"
|
||||||
|
:use-like="false"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
option-filter="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('travel.landed')"
|
||||||
|
v-model="params.landed"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
<VnInputTime
|
||||||
|
v-model="params.landingHour"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
:label="t('travel.landingHour')"
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('travel.totalEntries')"
|
||||||
|
v-model="params.totalEntries"
|
||||||
|
lazy-rules
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
travel:
|
||||||
|
Id: Contains
|
||||||
|
ref: Reference
|
||||||
|
agency: Agency
|
||||||
|
warehouseInFk: W. In
|
||||||
|
shipped: Shipped
|
||||||
|
shipmentHour: Shipment Hour
|
||||||
|
warehouseOut: W. Out
|
||||||
|
landed: Landed
|
||||||
|
landingHour: Landing Hour
|
||||||
|
totalEntries: Σ
|
||||||
|
es:
|
||||||
|
travel:
|
||||||
|
Id: Id
|
||||||
|
ref: Referencia
|
||||||
|
agency: Agencia
|
||||||
|
warehouseInFk: Alm.Salida
|
||||||
|
shipped: F.Envío
|
||||||
|
shipmentHour: Hora de envío
|
||||||
|
warehouseOut: Alm.Entrada
|
||||||
|
landed: F.Entrega
|
||||||
|
landingHour: Hora de entrega
|
||||||
|
totalEntries: Σ
|
||||||
|
</i18n>
|
|
@ -9,6 +9,8 @@ import TravelSummary from './Card/TravelSummary.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import TravelFilter from './TravelFilter.vue';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -24,6 +26,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
|
const travelFilterRef = ref();
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
});
|
});
|
||||||
|
@ -201,6 +204,11 @@ const columns = computed(() => [
|
||||||
:label="t('Search travel')"
|
:label="t('Search travel')"
|
||||||
data-key="TravelList"
|
data-key="TravelList"
|
||||||
/>
|
/>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<TravelFilter data-key="TravelList" ref="travelFilterRef" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="TravelList"
|
data-key="TravelList"
|
||||||
|
@ -213,6 +221,7 @@ const columns = computed(() => [
|
||||||
editorFk: entityId,
|
editorFk: entityId,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
:right-search="false"
|
||||||
:user-params="{ daysOnward: 7 }"
|
:user-params="{ daysOnward: 7 }"
|
||||||
order="landed DESC"
|
order="landed DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -220,7 +229,6 @@ const columns = computed(() => [
|
||||||
redirect="travel"
|
redirect="travel"
|
||||||
:is-editable="false"
|
:is-editable="false"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
chip-locale="travel.travelList.tableVisibleColumns"
|
|
||||||
>
|
>
|
||||||
<template #column-shipped="{ row }">
|
<template #column-shipped="{ row }">
|
||||||
<QBadge
|
<QBadge
|
||||||
|
|
|
@ -57,9 +57,21 @@ const columns = computed(() => [
|
||||||
field: 'concept',
|
field: 'concept',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
style: 'max-width: 20px; text-align: initial;',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('delete'),
|
||||||
|
icon: 'delete',
|
||||||
|
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
@ -69,7 +81,7 @@ const columns = computed(() => [
|
||||||
save-url="WorkerIncomes/crud"
|
save-url="WorkerIncomes/crud"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'workerIncomes',
|
urlCreate: 'workerIncomes',
|
||||||
title: t('Create workerBalance'),
|
title: t('Create balance'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: () => tableRef.reload(),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
workerFk: entityId,
|
workerFk: entityId,
|
||||||
|
@ -81,10 +93,10 @@ const columns = computed(() => [
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:default-remove="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Create workerBalance: Crear balance
|
Create balance: Crear balance
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,99 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
|
||||||
import FormPopup from 'src/components/FormPopup.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
|
||||||
|
|
||||||
const $props = defineProps({
|
|
||||||
id: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['onSubmit']);
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const { notify } = useNotify();
|
|
||||||
|
|
||||||
const formData = reactive({
|
|
||||||
newPassword: null,
|
|
||||||
repeatPassword: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
const passRequirements = ref([]);
|
|
||||||
|
|
||||||
const setPassword = async () => {
|
|
||||||
try {
|
|
||||||
if (!formData.newPassword) {
|
|
||||||
notify(t('You must enter a new password'), 'negative');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (formData.newPassword != formData.repeatPassword) {
|
|
||||||
notify(t(`Passwords don't match`), 'negative');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await axios.patch(`Workers/${$props.id}/setPassword`, {
|
|
||||||
newPass: formData.newPassword,
|
|
||||||
});
|
|
||||||
notify(t('Password changed!'), 'positive');
|
|
||||||
emit('onSubmit');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error setting password', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getPassRequirements = async () => {
|
|
||||||
const { data } = await axios.get('UserPasswords/findOne');
|
|
||||||
passRequirements.value = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(async () => await getPassRequirements());
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<FormPopup :title="t('Reset password')" @on-submit="setPassword()">
|
|
||||||
<template #form-inputs>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('New password')"
|
|
||||||
v-model="formData.newPassword"
|
|
||||||
type="password"
|
|
||||||
:required="true"
|
|
||||||
:info="
|
|
||||||
t('passwordRequirements', {
|
|
||||||
length: passRequirements.length,
|
|
||||||
nAlpha: passRequirements.nAlpha,
|
|
||||||
nUpper: passRequirements.nUpper,
|
|
||||||
nDigits: passRequirements.nDigits,
|
|
||||||
nPunct: passRequirements.nPunct,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('Repeat password')"
|
|
||||||
v-model="formData.repeatPassword"
|
|
||||||
type="password"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
</template>
|
|
||||||
</FormPopup>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Reset password: Restablecer contraseña
|
|
||||||
New password: Nueva contraseña
|
|
||||||
Repeat password: Repetir contraseña
|
|
||||||
You must enter a new password: Debes introducir la nueva contraseña
|
|
||||||
Passwords don't match: Las contraseñas no coinciden
|
|
||||||
</i18n>
|
|
|
@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import WorkerChangePasswordForm from 'src/pages/Worker/Card/WorkerChangePasswordForm.vue';
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
@ -24,18 +24,13 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const changePasswordFormDialog = ref(null);
|
|
||||||
const cardDescriptorRef = ref(null);
|
|
||||||
const showEditPhotoForm = ref(false);
|
const showEditPhotoForm = ref(false);
|
||||||
const toggleEditPictureForm = () => {
|
const toggleEditPictureForm = () => {
|
||||||
showEditPhotoForm.value = !showEditPhotoForm.value;
|
showEditPhotoForm.value = !showEditPhotoForm.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const worker = ref();
|
|
||||||
const workerExcluded = ref(false);
|
const workerExcluded = ref(false);
|
||||||
|
|
||||||
const getIsExcluded = async () => {
|
const getIsExcluded = async () => {
|
||||||
|
@ -61,10 +56,10 @@ const handleExcluded = async () => {
|
||||||
|
|
||||||
workerExcluded.value = !workerExcluded.value;
|
workerExcluded.value = !workerExcluded.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePhotoUpdated = (evt = false) => {
|
const handlePhotoUpdated = (evt = false) => {
|
||||||
image.value.reload(evt);
|
image.value.reload(evt);
|
||||||
};
|
};
|
||||||
const refetch = async () => await cardDescriptorRef.value.getData();
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
|
@ -74,15 +69,10 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
url="Workers/descriptor"
|
url="Workers/descriptor"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
title="user.nickname"
|
title="user.nickname"
|
||||||
@on-fetch="
|
@on-fetch="getIsExcluded"
|
||||||
(data) => {
|
|
||||||
worker = data;
|
|
||||||
getIsExcluded();
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template #menu="{}">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="handleExcluded()">
|
<QItem v-ripple clickable @click="handleExcluded">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{
|
{{
|
||||||
workerExcluded
|
workerExcluded
|
||||||
|
@ -92,16 +82,13 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!worker.user.emailVerified && user.id != worker.id"
|
v-if="!entity.user.emailVerified && user.id != entity.id"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="$refs.changePasswordFormDialog.show()"
|
@click="$refs.changePassRef.show"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('Change password') }}
|
{{ t('globals.changePass') }}
|
||||||
<QDialog ref="changePasswordFormDialog">
|
|
||||||
<WorkerChangePasswordForm @on-submit="refetch()" :id="entityId" />
|
|
||||||
</QDialog>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
@ -167,10 +154,10 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
<VnLinkPhone :phone-number="entity.phone" />
|
<VnLinkPhone :phone-number="entity.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="worker?.sip?.extension">
|
<VnLv :value="entity?.sip?.extension">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('worker.summary.sipExtension') }}
|
{{ t('worker.summary.sipExtension') }}
|
||||||
<VnLinkPhone :phone-number="worker?.sip?.extension" />
|
<VnLinkPhone :phone-number="entity?.sip?.extension" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</template>
|
</template>
|
||||||
|
@ -201,6 +188,15 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
|
<VnChangePassword
|
||||||
|
ref="changePassRef"
|
||||||
|
:submit-fn="
|
||||||
|
async (newPass) => {
|
||||||
|
await axios.patch(`Workers/${$route.params.id}/setPassword`, { newPass });
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@on-submit="$refs.cardDescriptorRef?.getData"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -213,5 +209,4 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
es:
|
es:
|
||||||
Click to allow the user to be disabled: Marcar para deshabilitar
|
Click to allow the user to be disabled: Marcar para deshabilitar
|
||||||
Click to exclude the user from getting disabled: Marcar para no deshabilitar
|
Click to exclude the user from getting disabled: Marcar para no deshabilitar
|
||||||
Change password: Cambiar contraseña
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -96,10 +96,23 @@ const columns = computed(() => [
|
||||||
label: t('worker.formation.tableVisibleColumns.hasDiploma'),
|
label: t('worker.formation.tableVisibleColumns.hasDiploma'),
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('delete'),
|
||||||
|
icon: 'delete',
|
||||||
|
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
class="worker-formation"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerFormation"
|
data-key="WorkerFormation"
|
||||||
:url="`Workers/${entityId}/trainingCourse`"
|
:url="`Workers/${entityId}/trainingCourse`"
|
||||||
|
@ -120,8 +133,15 @@ const columns = computed(() => [
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:default-remove="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:global(.worker-formation thead > tr > th:nth-child(7)),
|
||||||
|
:global(.worker-formation thead > tr > th:nth-child(8)) {
|
||||||
|
max-width: 50px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Create training course: Crear curso de formación
|
Create training course: Crear curso de formación
|
||||||
|
|
|
@ -65,6 +65,18 @@ const columns = [
|
||||||
create: true,
|
create: true,
|
||||||
component: 'input',
|
component: 'input',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('delete'),
|
||||||
|
icon: 'delete',
|
||||||
|
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -87,5 +99,6 @@ const columns = [
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:default-remove="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -139,6 +139,7 @@ onBeforeMount(async () => {
|
||||||
<VnLinkPhone :phone-number="worker?.sip?.extension" />
|
<VnLinkPhone :phone-number="worker?.sip?.extension" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
<VnLv :label="t('queue')" :value="worker.sip?.queueMember?.queue" />
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
|
|
|
@ -326,16 +326,20 @@ const updateData = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMailStates = async (date) => {
|
const getMailStates = async (date) => {
|
||||||
|
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
|
||||||
|
const month = date.getMonth() + 1;
|
||||||
|
const prevMonth = month == 1 ? 12 : month - 1;
|
||||||
const params = {
|
const params = {
|
||||||
month: date.getMonth() + 1,
|
month,
|
||||||
year: date.getFullYear(),
|
year: date.getFullYear(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const curMonthStates = (await axios.get(url, { params })).data;
|
||||||
`WorkerTimeControls/${route.params.id}/getMailStates`,
|
const prevMonthStates = (
|
||||||
{ params }
|
await axios.get(url, { params: { ...params, month: prevMonth } })
|
||||||
);
|
).data;
|
||||||
workerTimeControlMails.value = data;
|
|
||||||
|
workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
|
||||||
};
|
};
|
||||||
|
|
||||||
const showWorkerTimeForm = (propValue, formType) => {
|
const showWorkerTimeForm = (propValue, formType) => {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -16,6 +16,11 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const departments = ref();
|
const departments = ref();
|
||||||
|
|
||||||
|
const getLocale = (label) => {
|
||||||
|
const globalLocale = `globals.params.${label}`;
|
||||||
|
return te(globalLocale) ? t(globalLocale) : t(`params.${label}`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -23,7 +28,7 @@ const departments = ref();
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<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>
|
||||||
|
@ -64,10 +69,7 @@ const departments = ref();
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection v-if="!departments">
|
<QItemSection>
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection v-if="departments">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Department')"
|
:label="t('Department')"
|
||||||
v-model="params.departmentFk"
|
v-model="params.departmentFk"
|
||||||
|
@ -82,6 +84,11 @@ const departments = ref();
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput :label="t('Email')" v-model="params.email" is-outlined />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -99,23 +106,17 @@ const departments = ref();
|
||||||
en:
|
en:
|
||||||
params:
|
params:
|
||||||
search: Contains
|
search: Contains
|
||||||
fi: FI
|
|
||||||
firstName: First name
|
firstName: First name
|
||||||
lastName: Last name
|
lastName: Last name
|
||||||
userName: User
|
userName: User
|
||||||
extension: Extension
|
extension: Extension
|
||||||
departmentFk: Department
|
|
||||||
id: ID
|
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Contiene
|
search: Contiene
|
||||||
fi: NIF
|
|
||||||
firstName: Nombre
|
firstName: Nombre
|
||||||
lastName: Apellidos
|
lastName: Apellidos
|
||||||
userName: Usuario
|
userName: Usuario
|
||||||
extension: Extensión
|
extension: Extensión
|
||||||
departmentFk: Departamento
|
|
||||||
id: ID
|
|
||||||
FI: NIF
|
FI: NIF
|
||||||
First Name: Nombre
|
First Name: Nombre
|
||||||
Last Name: Apellidos
|
Last Name: Apellidos
|
||||||
|
|
|
@ -39,13 +39,31 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'nickname',
|
name: 'firstName',
|
||||||
label: t('tableColumns.name'),
|
label: t('tableColumns.firstName'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'firstName',
|
name: 'firstName',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'lastName',
|
||||||
|
label: t('tableColumns.lastName'),
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'lastName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'nickname',
|
||||||
|
label: t('tableColumns.userName'),
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'userName',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'departmentFk',
|
name: 'departmentFk',
|
||||||
|
@ -66,10 +84,17 @@ const columns = computed(() => [
|
||||||
label: t('tableColumns.email'),
|
label: t('tableColumns.email'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
alias: 'mu',
|
name: 'email',
|
||||||
inWhere: true,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'extension',
|
||||||
|
label: t('tableColumns.extension'),
|
||||||
|
cardVisible: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'extension',
|
||||||
},
|
},
|
||||||
hidden: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
@ -180,7 +205,7 @@ async function autofillBic(worker) {
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
redirect="worker"
|
redirect="worker"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
auto-load
|
:order="['id DESC']"
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<div class="q-pa-lg full-width">
|
<div class="q-pa-lg full-width">
|
||||||
|
@ -214,6 +239,7 @@ async function autofillBic(worker) {
|
||||||
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
|
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.email"
|
v-model="data.email"
|
||||||
|
type="email"
|
||||||
:label="t('worker.create.personalEmail')"
|
:label="t('worker.create.personalEmail')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
@ -262,6 +288,7 @@ async function autofillBic(worker) {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:options="postcodesOptions"
|
:options="postcodesOptions"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
||||||
tableColumns:
|
tableColumns:
|
||||||
id: ID
|
id: ID
|
||||||
name: Name
|
firstName: First name
|
||||||
|
lastName: Last Name
|
||||||
|
userName: User Name
|
||||||
department: Department
|
department: Department
|
||||||
email: Email
|
email: Email
|
||||||
|
fi: FI
|
||||||
|
SSN: SSN
|
||||||
|
extension: Extension
|
||||||
|
queue: Queue
|
||||||
|
|
|
@ -6,6 +6,12 @@ External: Externo
|
||||||
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
|
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
|
||||||
tableColumns:
|
tableColumns:
|
||||||
id: ID
|
id: ID
|
||||||
name: Nombre
|
firstName: Nombre
|
||||||
|
lastName: Apellidos
|
||||||
|
userName: Nombre de usuario
|
||||||
department: Departamento
|
department: Departamento
|
||||||
email: Email
|
email: Email
|
||||||
|
fi: NIF
|
||||||
|
SSN: NSS
|
||||||
|
extension: Extensión
|
||||||
|
queue: Cola
|
||||||
|
|
|
@ -154,7 +154,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="excludeType === 'specificLocations'"
|
v-if="excludeType === 'specificLocations'"
|
||||||
style="min-height: 60vh; overflow-y: scroll"
|
style="max-height: 60vh; overflow-y: scroll"
|
||||||
>
|
>
|
||||||
<ZoneLocationsTree
|
<ZoneLocationsTree
|
||||||
:root-label="t('eventsExclusionForm.rootTreeLabel')"
|
:root-label="t('eventsExclusionForm.rootTreeLabel')"
|
||||||
|
|
|
@ -44,23 +44,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="stateStore.isHeaderMounted()">
|
|
||||||
<Teleport to="#actions-append">
|
|
||||||
<div class="row q-gutter-x-sm">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
@click="stateStore.toggleRightDrawer()"
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
icon="dock_to_left"
|
|
||||||
>
|
|
||||||
<QTooltip bottom anchor="bottom right">
|
|
||||||
{{ t('globals.collapseMenu') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</div>
|
|
||||||
</Teleport>
|
|
||||||
</template>
|
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
<QScrollArea class="fit text-grey-8">
|
<QScrollArea class="fit text-grey-8">
|
||||||
<ZoneEventsPanel
|
<ZoneEventsPanel
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, watch, onUnmounted } from 'vue';
|
import { onMounted, ref, computed, watch, onUnmounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
@ -144,7 +144,8 @@ watch(storeData, async (val) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const reFetch = async () => {
|
const reFetch = async () => {
|
||||||
await arrayData.fetch({ append: false });
|
const { data } = await arrayData.fetch({ append: false });
|
||||||
|
nodes.value = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
@ -182,6 +183,16 @@ onUnmounted(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<VnInput
|
||||||
|
v-if="showSearchBar"
|
||||||
|
v-model="store.userParams.search"
|
||||||
|
:placeholder="$t('globals.search')"
|
||||||
|
@update:model-value="reFetch()"
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<QBtn color="primary" icon="search" dense flat @click="reFetch()" />
|
||||||
|
</template>
|
||||||
|
</VnInput>
|
||||||
<QTree
|
<QTree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:nodes="nodes"
|
:nodes="nodes"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue