Merge branch '7553_FixTicketExpedition' of https://gitea.verdnatura.es/verdnatura/salix-front into 7553_FixTicketExpedition
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
94ae74ca7f
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, computed } from 'vue';
|
import { onBeforeMount, computed } from 'vue';
|
||||||
import { useRoute, onBeforeRouteUpdate } from 'vue-router';
|
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import useCardSize from 'src/composables/useCardSize';
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
@ -17,10 +17,12 @@ const props = defineProps({
|
||||||
filterPanel: { type: Object, default: undefined },
|
filterPanel: { type: Object, default: undefined },
|
||||||
searchDataKey: { type: String, default: undefined },
|
searchDataKey: { type: String, default: undefined },
|
||||||
searchbarProps: { type: Object, default: undefined },
|
searchbarProps: { type: Object, default: undefined },
|
||||||
|
redirectOnError: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const url = computed(() => {
|
const url = computed(() => {
|
||||||
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
|
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
|
||||||
return props.customUrl;
|
return props.customUrl;
|
||||||
|
@ -35,8 +37,12 @@ const arrayData = useArrayData(props.dataKey, {
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
try {
|
||||||
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
} catch (e) {
|
||||||
|
router.push({ name: 'WorkerList' });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (props.baseUrl) {
|
if (props.baseUrl) {
|
||||||
|
|
|
@ -132,17 +132,6 @@ async function search(evt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reload() {
|
|
||||||
isLoading.value = true;
|
|
||||||
const params = Object.values(userParams.value).filter((param) => param);
|
|
||||||
store.skip = 0;
|
|
||||||
store.page = 1;
|
|
||||||
await arrayData.fetch({ append: false });
|
|
||||||
if (!$props.showAll && !params.length) store.data = [];
|
|
||||||
isLoading.value = false;
|
|
||||||
emit('refresh');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function clearFilters() {
|
async function clearFilters() {
|
||||||
try {
|
try {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
@ -231,7 +220,6 @@ function sanitizer(params) {
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection top side>
|
<QItemSection top side>
|
||||||
<div class="q-gutter-xs">
|
|
||||||
<QBtn
|
<QBtn
|
||||||
@click="clearFilters"
|
@click="clearFilters"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -244,19 +232,6 @@ function sanitizer(params) {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Remove filters') }}</QTooltip>
|
<QTooltip>{{ t('Remove filters') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
|
||||||
@click="reload"
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
icon="refresh"
|
|
||||||
padding="none"
|
|
||||||
round
|
|
||||||
size="sm"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('Refresh') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</div>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
|
|
|
@ -15,5 +15,6 @@ import WorkerFilter from '../WorkerFilter.vue';
|
||||||
label: 'Search worker',
|
label: 'Search worker',
|
||||||
info: 'You can search by worker id or name',
|
info: 'You can search by worker id or name',
|
||||||
}"
|
}"
|
||||||
|
:redirect-on-error="true"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -38,29 +38,6 @@ const entityId = computed(() => {
|
||||||
|
|
||||||
const worker = ref();
|
const worker = ref();
|
||||||
const workerExcluded = ref(false);
|
const workerExcluded = ref(false);
|
||||||
const filter = {
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'user',
|
|
||||||
scope: {
|
|
||||||
fields: ['email', 'name', 'nickname'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'department',
|
|
||||||
scope: {
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'department',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'sip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const sip = ref(null);
|
const sip = ref(null);
|
||||||
watch(
|
watch(
|
||||||
|
@ -74,14 +51,6 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => {
|
|
||||||
if (!entity) return;
|
|
||||||
data.value = useCardDescription(entity.user?.nickname, entity.id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const openChangePasswordForm = () => changePasswordFormDialog.value.show();
|
|
||||||
|
|
||||||
const getIsExcluded = async () => {
|
const getIsExcluded = async () => {
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
|
@ -115,14 +84,12 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="Worker"
|
module="Worker"
|
||||||
data-key="workerData"
|
data-key="workerData"
|
||||||
:url="`Workers/${entityId}`"
|
url="Workers/descriptor"
|
||||||
:filter="filter"
|
:filter="{ where: { id: entityId } }"
|
||||||
:title="data.title"
|
title="user.nickname"
|
||||||
:subtitle="data.subtitle"
|
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
worker = data;
|
worker = data;
|
||||||
setData(data);
|
|
||||||
getIsExcluded();
|
getIsExcluded();
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@ -141,7 +108,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
||||||
v-if="!worker.user.emailVerified && user.id != worker.id"
|
v-if="!worker.user.emailVerified && user.id != worker.id"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="openChangePasswordForm()"
|
@click="$refs.changePasswordFormDialog.show()"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('Change password') }}
|
{{ t('Change password') }}
|
||||||
|
|
|
@ -34,13 +34,22 @@ const filter = {
|
||||||
{
|
{
|
||||||
relation: 'user',
|
relation: 'user',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['email', 'name', 'nickname', 'roleFk'],
|
fields: ['name', 'nickname', 'roleFk'],
|
||||||
include: {
|
|
||||||
|
include: [
|
||||||
|
{
|
||||||
relation: 'role',
|
relation: 'role',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['name'],
|
fields: ['name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
relation: 'emailUser',
|
||||||
|
scope: {
|
||||||
|
fields: ['email'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -153,14 +162,18 @@ const filter = {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle :text="t('worker.summary.userData')" />
|
<VnTitle :text="t('worker.summary.userData')" />
|
||||||
<VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />
|
<VnLv :label="t('worker.summary.userId')" :value="worker?.user?.id" />
|
||||||
<VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
|
<VnLv :label="t('worker.card.name')" :value="worker?.user?.nickname" />
|
||||||
<VnLv :label="t('worker.list.email')" :value="worker.user.email" copy />
|
<VnLv
|
||||||
|
:label="t('worker.list.email')"
|
||||||
|
:value="worker.user?.emailUser?.email"
|
||||||
|
copy
|
||||||
|
/>
|
||||||
<VnLv :label="t('worker.summary.role')">
|
<VnLv :label="t('worker.summary.role')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ worker.user.role.name }}
|
{{ worker?.user?.role?.name }}
|
||||||
<RoleDescriptorProxy :id="worker.user.role.id" />
|
<RoleDescriptorProxy :id="worker?.user?.role?.id" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
|
@ -629,6 +629,9 @@ onMounted(async () => {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
:deep(.q-td) {
|
||||||
|
min-width: 170px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
describe('WorkerLocker', () => {
|
describe('WorkerLocker', () => {
|
||||||
const workerId = 1109;
|
const productionId = 49;
|
||||||
const lockerCode = '2F';
|
const lockerCode = '2F';
|
||||||
const input = '.q-card input';
|
const input = '.q-card input';
|
||||||
const thirdOpt = '[role="listbox"] .q-item:nth-child(1)';
|
const thirdOpt = '[role="listbox"] .q-item:nth-child(1)';
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.login('productionBoss');
|
cy.login('productionBoss');
|
||||||
cy.visit(`/#/worker/${workerId}/locker`);
|
cy.visit(`/#/worker/${productionId}/locker`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allocates a locker', () => {
|
it('should allocates a locker', () => {
|
||||||
|
|
Loading…
Reference in New Issue