forked from verdnatura/salix-front
Merge branch 'dev' of https: refs #7323//gitea.verdnatura.es/verdnatura/salix-front into 7323-fineTunningWorker
This commit is contained in:
commit
b735ccb3a0
|
@ -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
|
||||||
|
|
|
@ -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}`;
|
||||||
|
try {
|
||||||
await axios.patch(query, {
|
await axios.patch(query, {
|
||||||
darkMode: value,
|
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}`;
|
||||||
|
try {
|
||||||
await axios.patch(query, {
|
await axios.patch(query, {
|
||||||
lang: value,
|
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 {
|
||||||
|
await axios.post('UserConfigs/setUserConfig', { [param]: value });
|
||||||
localUserData();
|
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>
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -318,8 +317,8 @@ defineExpose({
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_, res) {
|
||||||
if (_.onDataSaved) _.onDataSaved(this);
|
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
||||||
else $props.create.onDataSaved(_);
|
else $props.create.onDataSaved(_);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -687,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"
|
||||||
>
|
|
||||||
<slot
|
|
||||||
:name="`column-footer-${col.name}`"
|
|
||||||
:class="getColAlign(col)"
|
:class="getColAlign(col)"
|
||||||
/>
|
>
|
||||||
|
<slot :name="`column-footer-${col.name}`" />
|
||||||
</QTh>
|
</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
@ -776,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));
|
||||||
|
@ -859,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 {
|
||||||
|
@ -905,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>
|
|
@ -130,4 +130,24 @@ const mixinRules = [
|
||||||
.q-field__append {
|
.q-field__append {
|
||||||
padding-inline: 0;
|
padding-inline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-field__append.q-field__marginal.row.no-wrap.items-center.row {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.q-field--outlined .q-field__append.q-field__marginal.row.no-wrap.items-center.row {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.q-field__control {
|
||||||
|
height: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-field--labeled {
|
||||||
|
.q-field__native,
|
||||||
|
.q-field__prefix,
|
||||||
|
.q-field__suffix,
|
||||||
|
.q-field__input {
|
||||||
|
padding-bottom: 0;
|
||||||
|
min-height: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -12,14 +12,46 @@ const props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const modelValue = ref(
|
|
||||||
props.location
|
const locationProperties = [
|
||||||
? `${props.location?.postcode}, ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
|
'postcode',
|
||||||
: null
|
(obj) =>
|
||||||
);
|
obj.city
|
||||||
function showLabel(data) {
|
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
|
||||||
return `${data.code}, ${data.town}(${data.province}), ${data.country}`;
|
: 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(
|
||||||
|
props.location ? formatLocation(props.location, locationProperties) : null
|
||||||
|
);
|
||||||
|
|
||||||
|
function showLabel(data) {
|
||||||
|
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
|
||||||
|
|
|
@ -283,4 +283,15 @@ const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
|
||||||
.q-field--outlined {
|
.q-field--outlined {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.q-field__inner {
|
||||||
|
.q-field__control {
|
||||||
|
min-height: auto !important;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
.q-field__native.row {
|
||||||
|
min-height: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -9,6 +9,7 @@ defineProps({ wrap: { type: Boolean, default: false } });
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.vn-row {
|
.vn-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
> :deep(*) {
|
> :deep(*) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -288,3 +288,14 @@ input::-webkit-inner-spin-button {
|
||||||
color: $info;
|
color: $info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.q-field__inner {
|
||||||
|
.q-field__control {
|
||||||
|
min-height: auto !important;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
.q-field__native.row {
|
||||||
|
min-height: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
@ -289,8 +290,8 @@ globals:
|
||||||
createInvoiceIn: Create invoice in
|
createInvoiceIn: Create invoice in
|
||||||
myAccount: My account
|
myAccount: My account
|
||||||
noOne: No one
|
noOne: No one
|
||||||
maxTemperature: Maximum Temperature
|
maxTemperature: Max
|
||||||
minTemperature: Minimum Temperatura
|
minTemperature: Min
|
||||||
params:
|
params:
|
||||||
id: ID
|
id: ID
|
||||||
clientFk: Client id
|
clientFk: Client id
|
||||||
|
@ -304,6 +305,7 @@ globals:
|
||||||
email: Email
|
email: Email
|
||||||
SSN: SSN
|
SSN: SSN
|
||||||
fi: FI
|
fi: FI
|
||||||
|
changePass: Change password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
|
@ -311,6 +313,7 @@ errors:
|
||||||
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:
|
||||||
|
@ -874,35 +877,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
|
|
||||||
RouteExtendedList: Router
|
|
||||||
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
|
||||||
|
@ -293,8 +294,8 @@ globals:
|
||||||
createInvoiceIn: Crear factura recibida
|
createInvoiceIn: Crear factura recibida
|
||||||
myAccount: Mi cuenta
|
myAccount: Mi cuenta
|
||||||
noOne: Nadie
|
noOne: Nadie
|
||||||
maxTemperature: Temperatura máxima
|
maxTemperature: Máx
|
||||||
minTemperature: Temperatura mínima
|
minTemperature: Mín
|
||||||
params:
|
params:
|
||||||
id: Id
|
id: Id
|
||||||
clientFk: Id cliente
|
clientFk: Id cliente
|
||||||
|
@ -308,14 +309,15 @@ globals:
|
||||||
email: Correo
|
email: Correo
|
||||||
SSN: NSS
|
SSN: NSS
|
||||||
fi: NIF
|
fi: NIF
|
||||||
|
changePass: Cambiar contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
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:
|
||||||
|
@ -873,21 +875,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
|
||||||
|
|
|
@ -9,7 +9,9 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
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',
|
||||||
|
@ -29,7 +31,22 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
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',
|
||||||
|
@ -104,12 +121,13 @@ 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"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<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"
|
||||||
|
|
|
@ -11,6 +11,9 @@ const { t } = useI18n();
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
:descriptor="AccountDescriptor"
|
:descriptor="AccountDescriptor"
|
||||||
search-data-key="AccountUsers"
|
search-data-key="AccountUsers"
|
||||||
|
:filter="{
|
||||||
|
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||||
|
}"
|
||||||
: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>
|
||||||
|
|
|
@ -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,15 @@ entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
|
myEntries:
|
||||||
|
id: ID
|
||||||
landed: Landed
|
landed: Landed
|
||||||
shipped: Shipped
|
shipped: Shipped
|
||||||
fromShipped: Shipped(from)
|
fromShipped: Shipped(from)
|
||||||
toShipped: Shipped(to)
|
toShipped: Shipped(to)
|
||||||
printLabels: Print stickers
|
printLabels: Print stickers
|
||||||
viewLabel: View sticker
|
viewLabel: View sticker
|
||||||
|
wareHouseIn: Warehouse in
|
||||||
|
warehouseInFk: Warehouse in
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
|
|
@ -9,10 +9,15 @@ entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
|
myEntries:
|
||||||
|
id: ID
|
||||||
landed: F. llegada
|
landed: F. llegada
|
||||||
shipped: F. salida
|
shipped: F. salida
|
||||||
fromShipped: F. salida(desde)
|
fromShipped: F. salida(desde)
|
||||||
toShipped: F. salida(hasta)
|
toShipped: F. salida(hasta)
|
||||||
printLabels: Imprimir etiquetas
|
printLabels: Imprimir etiquetas
|
||||||
viewLabel: Ver etiqueta
|
viewLabel: Ver etiqueta
|
||||||
|
wareHouseIn: Alm. entrada
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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)"
|
||||||
|
@ -601,6 +601,11 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
.q-table td {
|
.q-table td {
|
||||||
padding-inline: 5px !important;
|
padding-inline: 5px !important;
|
||||||
}
|
}
|
||||||
|
.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 {
|
||||||
|
|
|
@ -23,3 +23,17 @@ route:
|
||||||
Summary: Summary
|
Summary: Summary
|
||||||
Route is closed: Route is closed
|
Route is closed: Route is closed
|
||||||
Route is not served: Route is not served
|
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
|
||||||
|
|
|
@ -23,3 +23,17 @@ route:
|
||||||
Summary: Resumen
|
Summary: Resumen
|
||||||
Route is closed: La ruta está cerrada
|
Route is closed: La ruta está cerrada
|
||||||
Route is not served: La ruta no está servida
|
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
|
||||||
|
|
|
@ -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 } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
}"
|
}"
|
||||||
|
|
|
@ -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,15 +67,19 @@ 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);
|
||||||
router.go(route.fullPath);
|
notify('globals.dataSaved', 'positive');
|
||||||
|
summaryRef.value?.fetch();
|
||||||
|
descriptorData.fetch({});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error changing ticket state', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNoteValue(description) {
|
function getNoteValue(description) {
|
||||||
|
@ -125,6 +132,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 +145,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>
|
||||||
|
|
|
@ -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'),
|
||||||
|
|
|
@ -52,12 +52,14 @@ const TableColumns = computed(() => {
|
||||||
field: 'maxTemperature',
|
field: 'maxTemperature',
|
||||||
name: 'maxTemperature',
|
name: 'maxTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.minTemperature'),
|
label: t('globals.minTemperature'),
|
||||||
field: 'minTemperature',
|
field: 'minTemperature',
|
||||||
name: 'minTemperature',
|
name: 'minTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
format: (val) => (val ? `${val}°` : ''),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.thermographs.state'),
|
label: t('travel.thermographs.state'),
|
||||||
|
@ -219,6 +221,4 @@ es:
|
||||||
Thermograph removed: Termógrafo eliminado
|
Thermograph removed: Termógrafo eliminado
|
||||||
Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo?
|
Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo?
|
||||||
No results: Sin resultados
|
No results: Sin resultados
|
||||||
Max Temperature: Temperatura máxima
|
|
||||||
Min Temperature: Temperatura mínima
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -30,18 +30,9 @@ const router = useRouter();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const thermographFilter = {
|
|
||||||
fields: ['id', 'thermographFk'],
|
|
||||||
where: {
|
|
||||||
or: [{ travelFk: null }, { travelFk: route.params.id }],
|
|
||||||
},
|
|
||||||
order: 'thermographFk ASC',
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchTravelThermographsRef = ref(null);
|
const fetchTravelThermographsRef = ref(null);
|
||||||
const allowedContentTypes = ref('');
|
const allowedContentTypes = ref('');
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const thermographsOptions = ref([]);
|
|
||||||
const dmsTypesOptions = ref([]);
|
const dmsTypesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
|
@ -101,7 +92,7 @@ const setEditDefaultParams = async () => {
|
||||||
thermographForm.value.thermographFk = data.thermographFk;
|
thermographForm.value.thermographFk = data.thermographFk;
|
||||||
thermographForm.value.state = data.result;
|
thermographForm.value.state = data.result;
|
||||||
thermographForm.value.reference = data.dms?.reference;
|
thermographForm.value.reference = data.dms?.reference;
|
||||||
thermographForm.value.warehouseId = data.dms?.warehouseFk;
|
thermographForm.value.warehouseId = data.warehouseFk;
|
||||||
thermographForm.value.companyId = data.dms?.companyFk;
|
thermographForm.value.companyId = data.dms?.companyFk;
|
||||||
thermographForm.value.dmsTypeId = data.dms?.dmsTypeFk;
|
thermographForm.value.dmsTypeId = data.dms?.dmsTypeFk;
|
||||||
thermographForm.value.description = data.dms?.description || '';
|
thermographForm.value.description = data.dms?.description || '';
|
||||||
|
@ -172,13 +163,6 @@ const onThermographCreated = async (data) => {
|
||||||
auto-load
|
auto-load
|
||||||
url="Temperatures"
|
url="Temperatures"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
ref="fetchTravelThermographsRef"
|
|
||||||
url="TravelThermographs"
|
|
||||||
@on-fetch="(data) => (thermographsOptions = data)"
|
|
||||||
:filter="thermographFilter"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<QPage class="column items-center full-width">
|
<QPage class="column items-center full-width">
|
||||||
<QForm
|
<QForm
|
||||||
model="travel"
|
model="travel"
|
||||||
|
@ -214,7 +198,12 @@ const onThermographCreated = async (data) => {
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('travel.thermographs.thermograph')"
|
:label="t('travel.thermographs.thermograph')"
|
||||||
v-model="thermographForm.travelThermographFk"
|
v-model="thermographForm.travelThermographFk"
|
||||||
:options="thermographsOptions"
|
url="TravelThermographs"
|
||||||
|
:fields="['id', 'thermographFk']"
|
||||||
|
:where="{
|
||||||
|
or: [{ travelFk: null }, { travelFk: $route.params.id }],
|
||||||
|
}"
|
||||||
|
sort-by="thermographFk ASC"
|
||||||
option-label="thermographFk"
|
option-label="thermographFk"
|
||||||
:disable="viewAction === 'edit'"
|
:disable="viewAction === 'edit'"
|
||||||
:tooltip="t('New thermograph')"
|
:tooltip="t('New thermograph')"
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -239,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>
|
||||||
|
@ -287,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)"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -87,7 +87,7 @@ eventsPanel:
|
||||||
travelingDays: Días de viaje
|
travelingDays: Días de viaje
|
||||||
price: Precio
|
price: Precio
|
||||||
bonus: Bonificación
|
bonus: Bonificación
|
||||||
m3Max: Meidida máxima
|
m3Max: Medida máxima
|
||||||
everyday: Todos los días
|
everyday: Todos los días
|
||||||
delete: Eliminar
|
delete: Eliminar
|
||||||
deleteTitle: Este elemento será eliminado
|
deleteTitle: Este elemento será eliminado
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('UserPanel', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#dashboard`);
|
||||||
|
cy.waitForElement('.q-page', 6000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should notify when update user warehouse', () => {
|
||||||
|
const userWarehouse =
|
||||||
|
'.q-menu .q-gutter-xs > :nth-child(3) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
|
||||||
|
|
||||||
|
// Abro el panel
|
||||||
|
cy.openUserPanel();
|
||||||
|
|
||||||
|
// Compruebo la opcion inicial
|
||||||
|
cy.get(userWarehouse).should('have.value', 'VNL').click();
|
||||||
|
|
||||||
|
// Actualizo la opción
|
||||||
|
getOption(3);
|
||||||
|
|
||||||
|
//Compruebo la notificación
|
||||||
|
cy.get('.q-notification').should('be.visible');
|
||||||
|
cy.get(userWarehouse).should('have.value', 'VNH');
|
||||||
|
|
||||||
|
//Restauro el valor
|
||||||
|
cy.get(userWarehouse).click();
|
||||||
|
getOption(2);
|
||||||
|
});
|
||||||
|
it('should notify when update user company', () => {
|
||||||
|
const userCompany =
|
||||||
|
'.q-menu .q-gutter-xs > :nth-child(2) > .q-field--float > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
|
||||||
|
|
||||||
|
// Abro el panel
|
||||||
|
cy.openUserPanel();
|
||||||
|
|
||||||
|
// Compruebo la opcion inicial
|
||||||
|
cy.get(userCompany).should('have.value', 'Warehouse One').click();
|
||||||
|
|
||||||
|
//Actualizo la opción
|
||||||
|
getOption(2);
|
||||||
|
|
||||||
|
//Compruebo la notificación
|
||||||
|
cy.get('.q-notification').should('be.visible');
|
||||||
|
cy.get(userCompany).should('have.value', 'Warehouse Two');
|
||||||
|
|
||||||
|
//Restauro el valor
|
||||||
|
cy.get(userCompany).click();
|
||||||
|
getOption(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function getOption(index) {
|
||||||
|
cy.waitForElement('[role="listbox"]');
|
||||||
|
const option = `[role="listbox"] .q-item:nth-child(${index})`;
|
||||||
|
cy.get(option).click();
|
||||||
|
}
|
|
@ -3,25 +3,90 @@ describe('VnLocation', () => {
|
||||||
const dialogInputs = '.q-dialog label input';
|
const dialogInputs = '.q-dialog label input';
|
||||||
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';
|
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';
|
||||||
const inputLocation = '.q-form input[aria-label="Location"]';
|
const inputLocation = '.q-form input[aria-label="Location"]';
|
||||||
|
const createForm = {
|
||||||
|
prefix: '.q-dialog__inner > .column > #formModel > .q-card',
|
||||||
|
sufix: ' .q-field__inner > .q-field__control',
|
||||||
|
};
|
||||||
|
describe('CreateFormDialog ', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
||||||
|
cy.waitForElement('.q-card');
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
|
});
|
||||||
|
it('should filter provinces based on selected country', () => {
|
||||||
|
// Select a country
|
||||||
|
cy.selectOption(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
||||||
|
'Ecuador'
|
||||||
|
);
|
||||||
|
// Verify that provinces are filtered
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||||
|
).should('have.length', 1);
|
||||||
|
|
||||||
|
// Verify that towns are filtered
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||||
|
).should('have.length', 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter towns based on selected province', () => {
|
||||||
|
// Select a country
|
||||||
|
cy.selectOption(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`,
|
||||||
|
'Ecuador'
|
||||||
|
);
|
||||||
|
// Verify that provinces are filtered
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||||
|
).should('have.length', 1);
|
||||||
|
|
||||||
|
// Verify that towns are filtered
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||||
|
).should('have.length', 1);
|
||||||
|
});
|
||||||
|
it('should pass selected country', () => {
|
||||||
|
// Select a country
|
||||||
|
const country = 'Ecuador';
|
||||||
|
const province = 'Province five';
|
||||||
|
cy.selectOption(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
||||||
|
country
|
||||||
|
);
|
||||||
|
cy.selectOption(
|
||||||
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||||
|
province
|
||||||
|
);
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
|
||||||
|
).click();
|
||||||
|
cy.get(
|
||||||
|
`#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
|
||||||
|
).should('have.value', province);
|
||||||
|
});
|
||||||
|
});
|
||||||
describe('Worker Create', () => {
|
describe('Worker Create', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/#/worker/create', { timeout: 5000 });
|
cy.visit('/#/worker/create', { timeout: 5000 });
|
||||||
cy.waitForElement('.q-card');
|
cy.waitForElement('.q-card');
|
||||||
|
cy.get(inputLocation).click();
|
||||||
});
|
});
|
||||||
it('Show all options', function () {
|
it('Show all options', function () {
|
||||||
cy.get(inputLocation).click();
|
|
||||||
cy.get(locationOptions).should('have.length.at.least', 5);
|
cy.get(locationOptions).should('have.length.at.least', 5);
|
||||||
});
|
});
|
||||||
it('input filter location as "al"', function () {
|
it('input filter location as "al"', function () {
|
||||||
cy.get(inputLocation).click();
|
// cy.get(inputLocation).click();
|
||||||
cy.get(inputLocation).clear();
|
cy.get(inputLocation).clear();
|
||||||
cy.get(inputLocation).type('al');
|
cy.get(inputLocation).type('al');
|
||||||
cy.get(locationOptions).should('have.length.at.least', 4);
|
cy.get(locationOptions).should('have.length.at.least', 4);
|
||||||
});
|
});
|
||||||
it('input filter location as "ecuador"', function () {
|
it('input filter location as "ecuador"', function () {
|
||||||
cy.get(inputLocation).click();
|
// cy.get(inputLocation).click();
|
||||||
cy.get(inputLocation).clear();
|
cy.get(inputLocation).clear();
|
||||||
cy.get(inputLocation).type('ecuador');
|
cy.get(inputLocation).type('ecuador');
|
||||||
cy.get(locationOptions).should('have.length.at.least', 1);
|
cy.get(locationOptions).should('have.length.at.least', 1);
|
||||||
|
@ -63,13 +128,11 @@ describe('VnLocation', () => {
|
||||||
cy.get(dialogInputs).eq(0).clear();
|
cy.get(dialogInputs).eq(0).clear();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control ',
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||||
province
|
province
|
||||||
);
|
);
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
|
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||||
'not.exist'
|
|
||||||
);
|
|
||||||
checkVnLocation(postCode, province);
|
checkVnLocation(postCode, province);
|
||||||
});
|
});
|
||||||
it('Create city', () => {
|
it('Create city', () => {
|
||||||
|
@ -79,7 +142,7 @@ describe('VnLocation', () => {
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
// city create button
|
// city create button
|
||||||
cy.get(
|
cy.get(
|
||||||
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon'
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
|
||||||
).click();
|
).click();
|
||||||
cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
|
cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
|
||||||
cy.get('#q-portal--dialog--2 .q-input').type(province);
|
cy.get('#q-portal--dialog--2 .q-input').type(province);
|
||||||
|
@ -89,9 +152,7 @@ describe('VnLocation', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkVnLocation(postCode, province) {
|
function checkVnLocation(postCode, province) {
|
||||||
cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
|
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||||
'not.exist'
|
|
||||||
);
|
|
||||||
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
|
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
|
||||||
.find('input')
|
.find('input')
|
||||||
.invoke('val')
|
.invoke('val')
|
||||||
|
|
|
@ -248,3 +248,9 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||||
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
|
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('openUserPanel', () => {
|
||||||
|
cy.get(
|
||||||
|
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
|
||||||
|
).click();
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
|
import { vi, beforeEach, afterEach, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
import { Notify } from 'quasar';
|
||||||
|
|
||||||
|
describe('VnSmsDialog', () => {
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({
|
||||||
|
data: [],
|
||||||
|
});
|
||||||
|
vm = createWrapper(VnChangePassword, {
|
||||||
|
propsData: {
|
||||||
|
submitFn: vi.fn(),
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
Notify.create = vi.fn();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should notify when new password is empty', async () => {
|
||||||
|
vm.passwords.newPassword = '';
|
||||||
|
vm.passwords.repeatPassword = 'password';
|
||||||
|
|
||||||
|
await vm.validate();
|
||||||
|
expect(Notify.create).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
message: 'You must enter a new password',
|
||||||
|
type: 'negative',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should notify when passwords don't match", async () => {
|
||||||
|
vm.passwords.newPassword = 'password1';
|
||||||
|
vm.passwords.repeatPassword = 'password2';
|
||||||
|
await vm.validate();
|
||||||
|
expect(Notify.create).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
message: `Passwords don't match`,
|
||||||
|
type: 'negative',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('if passwords match', () => {
|
||||||
|
it('should call submitFn and emit password', async () => {
|
||||||
|
vm.passwords.newPassword = 'password';
|
||||||
|
vm.passwords.repeatPassword = 'password';
|
||||||
|
await vm.validate();
|
||||||
|
expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call submitFn and emit password and old password', async () => {
|
||||||
|
vm.passwords.newPassword = 'password';
|
||||||
|
vm.passwords.repeatPassword = 'password';
|
||||||
|
vm.passwords.oldPassword = 'oldPassword';
|
||||||
|
|
||||||
|
await vm.validate();
|
||||||
|
expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue