Merge branch 'dev' of https: refs #6553//gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness
This commit is contained in:
commit
3dbace5336
|
@ -11,6 +11,7 @@ module.exports = defineConfig({
|
||||||
screenshotsFolder: 'test/cypress/screenshots',
|
screenshotsFolder: 'test/cypress/screenshots',
|
||||||
supportFile: 'test/cypress/support/index.js',
|
supportFile: 'test/cypress/support/index.js',
|
||||||
videosFolder: 'test/cypress/videos',
|
videosFolder: 'test/cypress/videos',
|
||||||
|
downloadsFolder: 'test/cypress/downloads',
|
||||||
video: false,
|
video: false,
|
||||||
specPattern: 'test/cypress/integration/**/*.spec.js',
|
specPattern: 'test/cypress/integration/**/*.spec.js',
|
||||||
experimentalRunAllSpecs: true,
|
experimentalRunAllSpecs: true,
|
||||||
|
|
|
@ -55,6 +55,7 @@ const onDataSaved = (data) => {
|
||||||
v-model.number="data.quantity"
|
v-model.number="data.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
autofocus
|
autofocus
|
||||||
|
data-cy="regularizeStockInput"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnFilter from 'components/VnTable/VnFilter.vue';
|
import VnFilter from 'components/VnTable/VnFilter.vue';
|
||||||
|
@ -11,16 +10,11 @@ defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
chipLocale: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
searchUrl: {
|
searchUrl: {
|
||||||
type: [String, Boolean],
|
type: [String, Boolean],
|
||||||
default: 'table',
|
default: 'table',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const tableFilterRef = ref([]);
|
const tableFilterRef = ref([]);
|
||||||
|
|
||||||
|
@ -62,9 +56,9 @@ function columnName(col) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #tags="{ tag, formatFn }" v-if="chipLocale">
|
<template #tags="{ tag, formatFn, getLocale }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
|
<strong>{{ getLocale(`${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -141,13 +141,16 @@ const handleInsertMode = (e) => {
|
||||||
<QIcon
|
<QIcon
|
||||||
name="close"
|
name="close"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="
|
:style="{
|
||||||
hover &&
|
visibility:
|
||||||
value &&
|
hover &&
|
||||||
!$attrs.disabled &&
|
value &&
|
||||||
!$attrs.readonly &&
|
!$attrs.disabled &&
|
||||||
$props.clearable
|
!$attrs.readonly &&
|
||||||
"
|
$props.clearable
|
||||||
|
? 'visible'
|
||||||
|
: 'hidden',
|
||||||
|
}"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
value = null;
|
value = null;
|
||||||
|
|
|
@ -113,8 +113,15 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||||
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
const {
|
||||||
toRefs($props);
|
optionLabel,
|
||||||
|
optionValue,
|
||||||
|
optionCaption,
|
||||||
|
optionFilter,
|
||||||
|
optionFilterValue,
|
||||||
|
options,
|
||||||
|
modelValue,
|
||||||
|
} = toRefs($props);
|
||||||
const myOptions = ref([]);
|
const myOptions = ref([]);
|
||||||
const myOptionsOriginal = ref([]);
|
const myOptionsOriginal = ref([]);
|
||||||
const vnSelectRef = ref();
|
const vnSelectRef = ref();
|
||||||
|
@ -198,10 +205,10 @@ function filter(val, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!row) return;
|
if (!row) return;
|
||||||
const id = row[$props.optionValue];
|
const id = String(row[$props.optionValue]);
|
||||||
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
||||||
|
|
||||||
return id == search || optionLabel.includes(search);
|
return id.includes(search) || optionLabel.includes(search);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,6 +328,11 @@ function handleKeyDown(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCaption(opt) {
|
||||||
|
if (optionCaption.value === false) return;
|
||||||
|
return opt[optionCaption.value] || opt[optionValue.value];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -391,8 +403,8 @@ function handleKeyDown(event) {
|
||||||
<QItemLabel>
|
<QItemLabel>
|
||||||
{{ opt[optionLabel] }}
|
{{ opt[optionLabel] }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-if="optionCaption !== false">
|
<QItemLabel caption v-if="getCaption(opt)">
|
||||||
{{ `#${opt[optionCaption] || opt[optionValue]}` }}
|
{{ `#${getCaption(opt)}` }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -51,6 +51,7 @@ const url = computed(() => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
:fields="['id', 'name', 'nickname', 'code']"
|
:fields="['id', 'name', 'nickname', 'code']"
|
||||||
|
:filter-options="['id', 'name', 'nickname', 'code']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$props.hasAvatar">
|
<template #prepend v-if="$props.hasAvatar">
|
||||||
|
@ -71,7 +72,7 @@ const url = computed(() => {
|
||||||
{{ scope.opt.nickname }}
|
{{ scope.opt.nickname }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-else>
|
<QItemLabel caption v-else>
|
||||||
{{ scope.opt.nickname }}, {{ scope.opt.code }}
|
#{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import VnJsonValue from 'src/components/common/VnJsonValue.vue';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
|
||||||
|
const buildComponent = (props) => {
|
||||||
|
return createWrapper(VnJsonValue, {
|
||||||
|
props,
|
||||||
|
}).wrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('VnJsonValue', () => {
|
||||||
|
it('renders null value correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: null });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('∅');
|
||||||
|
expect(span.classes()).toContain('json-null');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders boolean true correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: true });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('✓');
|
||||||
|
expect(span.classes()).toContain('json-true');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders boolean false correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: false });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('✗');
|
||||||
|
expect(span.classes()).toContain('json-false');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a short string correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 'Hello' });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('Hello');
|
||||||
|
expect(span.classes()).toContain('json-string');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a long string correctly with ellipsis', async () => {
|
||||||
|
const longString = 'a'.repeat(600);
|
||||||
|
const wrapper = buildComponent({ value: longString });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toContain('...');
|
||||||
|
expect(span.text().length).toBeLessThanOrEqual(515);
|
||||||
|
expect(span.attributes('title')).toBe(longString);
|
||||||
|
expect(span.classes()).toContain('json-string');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a number correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 123.4567 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('123.457');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an integer correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 42 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('42');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a date correctly', async () => {
|
||||||
|
const date = new Date('2023-01-01');
|
||||||
|
const wrapper = buildComponent({ value: date });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('2023-01-01');
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an object correctly', async () => {
|
||||||
|
const obj = { key: 'value' };
|
||||||
|
const wrapper = buildComponent({ value: obj });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe(obj.toString());
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an array correctly', async () => {
|
||||||
|
const arr = [1, 2, 3];
|
||||||
|
const wrapper = buildComponent({ value: arr });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe(arr.toString());
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates value when prop changes', async () => {
|
||||||
|
const wrapper = buildComponent({ value: true });
|
||||||
|
await wrapper.setProps({ value: 123 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('123');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,107 @@
|
||||||
|
import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
|
||||||
|
describe('VnNotes', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let spyFetch;
|
||||||
|
let postMock;
|
||||||
|
let expectedBody;
|
||||||
|
const mockData= {name: 'Tony', lastName: 'Stark', text: 'Test Note', observationTypeFk: 1};
|
||||||
|
|
||||||
|
function generateExpectedBody() {
|
||||||
|
expectedBody = {...vm.$props.body, ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk }};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setTestParams(text, observationType, type){
|
||||||
|
vm.newNote.text = text;
|
||||||
|
vm.newNote.observationTypeFk = observationType;
|
||||||
|
wrapper.setProps({ selectType: type });
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
vi.spyOn(axios, 'get').mockReturnValue({ data: [] });
|
||||||
|
|
||||||
|
wrapper = createWrapper(VnNotes, {
|
||||||
|
propsData: {
|
||||||
|
url: '/test',
|
||||||
|
body: { name: 'Tony', lastName: 'Stark' },
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
|
||||||
|
spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
expectedBody = {};
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('insert', () => {
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
|
||||||
|
await setTestParams( null, null, true );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
|
||||||
|
await setTestParams( "", null, false );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is true', async () => {
|
||||||
|
await setTestParams( "Test Note", null, true );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is false', async () => {
|
||||||
|
await setTestParams( "Test Note", null, false );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is setted and selectType is false', async () => {
|
||||||
|
await setTestParams( "Test Note", 1, false );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
|
||||||
|
await setTestParams( "Test Note", 1, true );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -190,7 +190,7 @@ const getLocale = (label) => {
|
||||||
const globalLocale = `globals.params.${param}`;
|
const globalLocale = `globals.params.${param}`;
|
||||||
if (te(globalLocale)) return t(globalLocale);
|
if (te(globalLocale)) return t(globalLocale);
|
||||||
else if (te(t(`params.${param}`)));
|
else if (te(t(`params.${param}`)));
|
||||||
else return t(`${route.meta.moduleName}.params.${param}`);
|
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { onMounted, ref, computed, watch } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useStateStore();
|
const state = useStateStore();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
|
@ -83,6 +85,17 @@ if (props.redirect)
|
||||||
};
|
};
|
||||||
let arrayData = useArrayData(props.dataKey, arrayDataProps);
|
let arrayData = useArrayData(props.dataKey, arrayDataProps);
|
||||||
let store = arrayData.store;
|
let store = arrayData.store;
|
||||||
|
const to = computed(() => {
|
||||||
|
const url = { path: route.path, query: { ...(route.query ?? {}) } };
|
||||||
|
const searchUrl = arrayData.store.searchUrl;
|
||||||
|
const currentFilter = {
|
||||||
|
...arrayData.store.currentFilter,
|
||||||
|
search: searchText.value || undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (searchUrl) url.query[searchUrl] = JSON.stringify(currentFilter);
|
||||||
|
return url;
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.dataKey,
|
() => props.dataKey,
|
||||||
|
@ -132,23 +145,32 @@ async function search() {
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#searchbar" v-if="state.isHeaderMounted()">
|
<Teleport to="#searchbar" v-if="state.isHeaderMounted()">
|
||||||
<QForm @submit="search" id="searchbarForm">
|
<QForm @submit="search" id="searchbarForm">
|
||||||
|
<RouterLink
|
||||||
|
:to="to"
|
||||||
|
@click="
|
||||||
|
!$event.shiftKey && !$event.ctrlKey && search();
|
||||||
|
$refs.input.focus();
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QIcon
|
||||||
|
v-if="!quasar.platform.is.mobile"
|
||||||
|
class="cursor-pointer"
|
||||||
|
name="search"
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('link') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</RouterLink>
|
||||||
<VnInput
|
<VnInput
|
||||||
id="searchbar"
|
id="searchbar"
|
||||||
|
ref="input"
|
||||||
v-model.trim="searchText"
|
v-model.trim="searchText"
|
||||||
:placeholder="t(props.label)"
|
:placeholder="t(props.label)"
|
||||||
dense
|
dense
|
||||||
standout
|
|
||||||
autofocus
|
autofocus
|
||||||
data-cy="vnSearchBar"
|
data-cy="vn-searchbar"
|
||||||
|
borderless
|
||||||
>
|
>
|
||||||
<template #prepend>
|
|
||||||
<QIcon
|
|
||||||
v-if="!quasar.platform.is.mobile"
|
|
||||||
class="cursor-pointer"
|
|
||||||
name="search"
|
|
||||||
@click="search"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="props.info && $q.screen.gt.xs"
|
v-if="props.info && $q.screen.gt.xs"
|
||||||
|
@ -173,20 +195,52 @@ async function search() {
|
||||||
.q-field {
|
.q-field {
|
||||||
transition: width 0.36s;
|
transition: width 0.36s;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss">
|
:deep(.q-field__native) {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.q-field--dark .q-field__native:focus) {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.q-field--focused) {
|
||||||
|
.q-icon {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.cursor-info {
|
.cursor-info {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
#searchbar {
|
|
||||||
.q-field--standout.q-field--highlighted .q-field__control {
|
.q-form {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: var(--vn-search-color);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--vn-search-color-hover);
|
||||||
|
}
|
||||||
|
&:focus-within {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
|
||||||
.q-field__native,
|
|
||||||
.q-icon {
|
.q-icon {
|
||||||
color: black !important;
|
color: black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-icon {
|
||||||
|
color: var(--vn-label-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
link: click to search, ctrl + click to open in a new tab, shift + click to open in a new window
|
||||||
|
es:
|
||||||
|
link: clic para buscar, ctrl + clic para abrir en una nueva pestaña, shift + clic para abrir en una nueva ventana
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -76,26 +76,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
cancelRequest();
|
cancelRequest();
|
||||||
canceller = new AbortController();
|
canceller = new AbortController();
|
||||||
|
const { params, limit } = getCurrentFilter();
|
||||||
const filter = {
|
|
||||||
limit: store.limit,
|
|
||||||
};
|
|
||||||
let userParams = { ...store.userParams };
|
|
||||||
|
|
||||||
Object.assign(filter, store.userFilter);
|
|
||||||
|
|
||||||
let where;
|
|
||||||
if (filter?.where || store.filter?.where)
|
|
||||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
|
||||||
Object.assign(filter, store.filter);
|
|
||||||
filter.where = where;
|
|
||||||
const params = { filter };
|
|
||||||
|
|
||||||
Object.assign(params, userParams);
|
|
||||||
if (params.filter) params.filter.skip = store.skip;
|
|
||||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
|
||||||
if (store.order?.length) params.filter.order = [...store.order];
|
|
||||||
else delete params.filter.order;
|
|
||||||
|
|
||||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||||
delete store.currentFilter.filter.include;
|
delete store.currentFilter.filter.include;
|
||||||
|
@ -121,7 +102,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { limit } = filter;
|
|
||||||
store.hasMoreData = limit && response.data.length >= limit;
|
store.hasMoreData = limit && response.data.length >= limit;
|
||||||
|
|
||||||
processData(response.data, { map: !!store.mapKey, append });
|
processData(response.data, { map: !!store.mapKey, append });
|
||||||
|
@ -291,6 +271,31 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
router.replace(newUrl);
|
router.replace(newUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCurrentFilter() {
|
||||||
|
const filter = {
|
||||||
|
limit: store.limit,
|
||||||
|
};
|
||||||
|
|
||||||
|
let userParams = { ...store.userParams };
|
||||||
|
|
||||||
|
Object.assign(filter, store.userFilter);
|
||||||
|
|
||||||
|
let where;
|
||||||
|
if (filter?.where || store.filter?.where)
|
||||||
|
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||||
|
Object.assign(filter, store.filter);
|
||||||
|
filter.where = where;
|
||||||
|
const params = { filter };
|
||||||
|
|
||||||
|
Object.assign(params, userParams);
|
||||||
|
if (params.filter) params.filter.skip = store.skip;
|
||||||
|
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
||||||
|
if (store.order?.length) params.filter.order = [...store.order];
|
||||||
|
else delete params.filter.order;
|
||||||
|
|
||||||
|
return { filter, params, limit: filter.limit };
|
||||||
|
}
|
||||||
|
|
||||||
function processData(data, { map = true, append = true }) {
|
function processData(data, { map = true, append = true }) {
|
||||||
if (!append) {
|
if (!append) {
|
||||||
store.data = [];
|
store.data = [];
|
||||||
|
@ -323,6 +328,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
fetch,
|
fetch,
|
||||||
applyFilter,
|
applyFilter,
|
||||||
addFilter,
|
addFilter,
|
||||||
|
getCurrentFilter,
|
||||||
addFilterWhere,
|
addFilterWhere,
|
||||||
addOrder,
|
addOrder,
|
||||||
deleteOrder,
|
deleteOrder,
|
||||||
|
|
|
@ -10,6 +10,8 @@ body.body--light {
|
||||||
--vn-text-color: black;
|
--vn-text-color: black;
|
||||||
--vn-label-color: #5f5f5f;
|
--vn-label-color: #5f5f5f;
|
||||||
--vn-accent-color: #e7e3e3;
|
--vn-accent-color: #e7e3e3;
|
||||||
|
--vn-search-color: #d4d4d4;
|
||||||
|
--vn-search-color-hover: #cfcfcf;
|
||||||
--vn-empty-tag: #acacac;
|
--vn-empty-tag: #acacac;
|
||||||
--vn-black-text-color: black;
|
--vn-black-text-color: black;
|
||||||
--vn-text-color-contrast: white;
|
--vn-text-color-contrast: white;
|
||||||
|
@ -28,6 +30,8 @@ body.body--dark {
|
||||||
--vn-text-color: white;
|
--vn-text-color: white;
|
||||||
--vn-label-color: #a8a8a8;
|
--vn-label-color: #a8a8a8;
|
||||||
--vn-accent-color: #424242;
|
--vn-accent-color: #424242;
|
||||||
|
--vn-search-color: #4b4b4b;
|
||||||
|
--vn-search-color-hover: #5b5b5b;
|
||||||
--vn-empty-tag: #2d2d2d;
|
--vn-empty-tag: #2d2d2d;
|
||||||
--vn-black-text-color: black;
|
--vn-black-text-color: black;
|
||||||
--vn-text-color-contrast: black;
|
--vn-text-color-contrast: black;
|
||||||
|
|
|
@ -457,6 +457,11 @@ entry:
|
||||||
landing: Landing
|
landing: Landing
|
||||||
isExcludedFromAvailable: Es inventory
|
isExcludedFromAvailable: Es inventory
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: Ticket ID
|
||||||
|
weekDay: Weekday
|
||||||
|
agencyModeFk: Agency
|
||||||
|
id: Worker
|
||||||
card:
|
card:
|
||||||
customerId: Customer ID
|
customerId: Customer ID
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
@ -507,6 +512,7 @@ invoiceOut:
|
||||||
card:
|
card:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
ticketList: Ticket List
|
||||||
summary:
|
summary:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
dued: Due
|
dued: Due
|
||||||
|
@ -740,6 +746,11 @@ 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
|
||||||
|
params:
|
||||||
|
label: Label
|
||||||
|
plate: Plate
|
||||||
|
volume: Volume
|
||||||
|
name: Name
|
||||||
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
|
|
|
@ -458,6 +458,11 @@ entry:
|
||||||
landing: Llegada
|
landing: Llegada
|
||||||
isExcludedFromAvailable: Es inventario
|
isExcludedFromAvailable: Es inventario
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: ID de ticket
|
||||||
|
weekDay: Salida
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
id: Comercial
|
||||||
card:
|
card:
|
||||||
customerId: ID cliente
|
customerId: ID cliente
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
|
@ -744,6 +749,11 @@ 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
|
||||||
|
params:
|
||||||
|
label: Etiqueta
|
||||||
|
plate: Matrícula
|
||||||
|
volume: Volumen
|
||||||
|
name: Nombre
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Name
|
||||||
|
roleFk: Role
|
||||||
|
nickname: Nickname
|
||||||
|
password: Password
|
||||||
|
active: Active
|
||||||
|
search: Id
|
||||||
|
description: Description
|
||||||
|
alias: Alias
|
||||||
|
model: Model
|
||||||
|
principalId: Role
|
||||||
|
property: Property
|
||||||
|
accessType: Access
|
||||||
card:
|
card:
|
||||||
nickname: User
|
nickname: User
|
||||||
role: Role
|
role: Role
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
|
accessType: Acceso
|
||||||
|
property: Propiedad
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Nombre
|
||||||
|
roleFk: Rol
|
||||||
|
nickname: Nickname
|
||||||
|
password: Contraseña
|
||||||
|
active: Activo
|
||||||
|
search: Id
|
||||||
|
description: Descripción
|
||||||
|
alias: Alias
|
||||||
|
model: Modelo
|
||||||
|
principalId: Rol
|
||||||
|
property: Propiedad
|
||||||
|
accessType: Acceso
|
||||||
card:
|
card:
|
||||||
nickname: Usuario
|
nickname: Usuario
|
||||||
role: Rol
|
role: Rol
|
||||||
|
|
|
@ -93,16 +93,7 @@ defineExpose({ states });
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
dense
|
dense
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
|
||||||
<QItemLabel caption>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('claim.responsible')"
|
:label="t('claim.responsible')"
|
||||||
v-model="params.claimResponsibleFk"
|
v-model="params.claimResponsibleFk"
|
||||||
|
|
|
@ -94,3 +94,12 @@ customer:
|
||||||
hasToInvoiceByAddress: Invoice by address
|
hasToInvoiceByAddress: Invoice by address
|
||||||
isToBeMailed: Mailing
|
isToBeMailed: Mailing
|
||||||
hasSepaVnl: VNL B2B received
|
hasSepaVnl: VNL B2B received
|
||||||
|
params:
|
||||||
|
isWorker: Is Worker
|
||||||
|
payMethod: Payment Method
|
||||||
|
workerFk: Author
|
||||||
|
observation: Last Observation
|
||||||
|
created: Last Update Date
|
||||||
|
creditInsurance: Credit Insurance
|
||||||
|
defaulterSinced: Defaulted Since
|
||||||
|
hasRecovery: Has Recovery
|
|
@ -96,3 +96,12 @@ customer:
|
||||||
hasToInvoiceByAddress: Factura por consigna
|
hasToInvoiceByAddress: Factura por consigna
|
||||||
isToBeMailed: Env. emails
|
isToBeMailed: Env. emails
|
||||||
hasSepaVnl: Recibido B2B VNL
|
hasSepaVnl: Recibido B2B VNL
|
||||||
|
params:
|
||||||
|
isWorker: Es trabajador
|
||||||
|
payMethod: F. Pago
|
||||||
|
workerFk: Autor
|
||||||
|
observation: Última observación
|
||||||
|
created: Fecha Ú. O.
|
||||||
|
creditInsurance: Crédito A.
|
||||||
|
defaulterSinced: Desde
|
||||||
|
hasRecovery: Tiene recobro
|
|
@ -1,13 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue';
|
import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
class="q-pa-md column items-center"
|
class="q-pa-md column items-center"
|
||||||
v-bind="{ ...$attrs }"
|
v-bind="{ ...$attrs }"
|
||||||
data-key="Department"
|
data-key="Department"
|
||||||
base-url="Departments"
|
base-url="Departments"
|
||||||
:descriptor="DepartmentDescriptor"
|
:descriptor="DepartmentDescriptor"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
|
@ -83,7 +83,11 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('department.chat')" :value="entity.chatName" />
|
<VnLv :label="t('department.chat')" :value="entity.chatName" />
|
||||||
<VnLv :label="t('globals.email')" :value="entity.notificationEmail" copy />
|
<VnLv
|
||||||
|
:label="t('globals.params.email')"
|
||||||
|
:value="entity.notificationEmail"
|
||||||
|
copy
|
||||||
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('department.selfConsumptionCustomer')"
|
:label="t('department.selfConsumptionCustomer')"
|
||||||
:value="entity.client?.name"
|
:value="entity.client?.name"
|
||||||
|
|
|
@ -40,7 +40,7 @@ onMounted(async () => {
|
||||||
<template #body="{ entity: department }">
|
<template #body="{ entity: department }">
|
||||||
<QCard class="column">
|
<QCard class="column">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/department/department/${entityId}/basic-data`"
|
:url="`#/worker/department/${entityId}/basic-data`"
|
||||||
:text="t('Basic data')"
|
:text="t('Basic data')"
|
||||||
/>
|
/>
|
||||||
<div class="full-width row wrap justify-between content-between">
|
<div class="full-width row wrap justify-between content-between">
|
||||||
|
@ -58,7 +58,7 @@ onMounted(async () => {
|
||||||
dash
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('globals.email')"
|
:label="t('globals.params.email')"
|
||||||
:value="department.notificationEmail"
|
:value="department.notificationEmail"
|
||||||
dash
|
dash
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -123,6 +123,7 @@ const companiesOptions = ref([]);
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:fields="['id', 'name', 'nickname']"
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
:filter-options="['id', 'name', 'nickname']"
|
||||||
sort-by="nickname"
|
sort-by="nickname"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
|
@ -132,9 +133,12 @@ const companiesOptions = ref([]);
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{
|
<QItemLabel>
|
||||||
scope.opt?.name + ': ' + scope.opt?.nickname
|
{{ scope.opt?.name}}
|
||||||
}}</QItemLabel>
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
||||||
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -69,12 +69,14 @@ const tagValues = ref([]);
|
||||||
use-input
|
use-input
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
>
|
>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="scope">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name}}
|
||||||
|
</QItemLabel>
|
||||||
<QItemLabel caption>
|
<QItemLabel caption>
|
||||||
{{ opt.nickname }}
|
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -19,3 +19,11 @@ myEntries:
|
||||||
daysAgo: Days ago
|
daysAgo: Days ago
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: The wastes were successfully recalculated
|
recalcOk: The wastes were successfully recalculated
|
||||||
|
entry:
|
||||||
|
params:
|
||||||
|
toShipped: To
|
||||||
|
fromShipped: From
|
||||||
|
warehouseiNFk: Warehouse
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
|
|
@ -22,3 +22,11 @@ myEntries:
|
||||||
daysAgo: Días atras
|
daysAgo: Días atras
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: Se han recalculado las mermas correctamente
|
recalcOk: Se han recalculado las mermas correctamente
|
||||||
|
entry:
|
||||||
|
params:
|
||||||
|
toShipped: Hasta
|
||||||
|
fromShipped: Desde
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
|
|
@ -68,13 +68,26 @@ function handleDaysAgo(params, daysAgo) {
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname', 'name']"
|
||||||
:label="getLocale('supplierFk')"
|
:label="getLocale('supplierFk')"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
/>
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name}}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
|
@ -165,18 +165,18 @@ const cols = computed(() => [
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname', 'name']"
|
||||||
:label="t('globals.supplier')"
|
:label="t('globals.supplier')"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
:filter-options="['id', 'name']"
|
:filter-options="['id', 'name', 'nickname']"
|
||||||
:required="true"
|
:required="true"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
|
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -47,6 +47,7 @@ const states = ref();
|
||||||
:label="t('Amount')"
|
:label="t('Amount')"
|
||||||
v-model="params.amount"
|
v-model="params.amount"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
data-cy="InvoiceOutFilterAmountBtn"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -101,6 +101,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
data-cy="InvoiceOutGlobalClientSelect"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -125,6 +126,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
data-cy="InvoiceOutGlobalSerialSelect"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-model="formData.invoiceDate"
|
v-model="formData.invoiceDate"
|
||||||
|
@ -135,6 +137,7 @@ onMounted(async () => {
|
||||||
v-model="formData.maxShipped"
|
v-model="formData.maxShipped"
|
||||||
:label="t('maxShipped')"
|
:label="t('maxShipped')"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
data-cy="InvoiceOutGlobalMaxShippedDate"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('company')"
|
:label="t('company')"
|
||||||
|
@ -144,6 +147,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
data-cy="InvoiceOutGlobalCompanySelect"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('printer')"
|
:label="t('printer')"
|
||||||
|
@ -152,6 +156,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
data-cy="InvoiceOutGlobalPrinterSelect"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
|
|
@ -197,6 +197,7 @@ watchEffect(selectedRows);
|
||||||
icon-right="cloud_download"
|
icon-right="cloud_download"
|
||||||
@click="downloadPdf()"
|
@click="downloadPdf()"
|
||||||
:disable="!hasSelectedCards"
|
:disable="!hasSelectedCards"
|
||||||
|
data-cy="InvoiceOutDownloadPdfBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
|
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -245,6 +246,7 @@ watchEffect(selectedRows);
|
||||||
v-model="data.ticketFk"
|
v-model="data.ticketFk"
|
||||||
:label="t('globals.ticket')"
|
:label="t('globals.ticket')"
|
||||||
style="flex: 1"
|
style="flex: 1"
|
||||||
|
data-cy="InvoiceOutCreateTicketinput"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -359,6 +361,7 @@ watchEffect(selectedRows);
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-filter
|
option-filter
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
|
data-cy="InvoiceOutCreateSerialSelect"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
|
@ -25,3 +25,15 @@ negativeBases:
|
||||||
hasToInvoice: Has to invoice
|
hasToInvoice: Has to invoice
|
||||||
verifiedData: Verified data
|
verifiedData: Verified data
|
||||||
commercial: Commercial
|
commercial: Commercial
|
||||||
|
invoiceout:
|
||||||
|
params:
|
||||||
|
company: Company
|
||||||
|
country: Country
|
||||||
|
clientId: Client ID
|
||||||
|
clientSocialName: Client
|
||||||
|
taxableBase: Base
|
||||||
|
ticketFk: Ticket
|
||||||
|
isActive: Active
|
||||||
|
hasToInvoice: Has to invoice
|
||||||
|
hasVerifiedData: Verified data
|
||||||
|
workerName: Worker
|
|
@ -28,3 +28,15 @@ negativeBases:
|
||||||
hasToInvoice: Debe facturar
|
hasToInvoice: Debe facturar
|
||||||
verifiedData: Datos verificados
|
verifiedData: Datos verificados
|
||||||
commercial: Comercial
|
commercial: Comercial
|
||||||
|
invoiceout:
|
||||||
|
params:
|
||||||
|
company: Empresa
|
||||||
|
country: País
|
||||||
|
clientId: ID del cliente
|
||||||
|
clientSocialName: Cliente
|
||||||
|
taxableBase: Base
|
||||||
|
ticketFk: Ticket
|
||||||
|
isActive: Activo
|
||||||
|
hasToInvoice: Debe facturar
|
||||||
|
hasVerifiedData: Datos verificados
|
||||||
|
workerName: Comercial
|
|
@ -52,6 +52,7 @@ const entityId = computed(() => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
data-cy="AddGenusSelectDialog"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateGenusForm
|
<CreateGenusForm
|
||||||
|
@ -68,6 +69,7 @@ const entityId = computed(() => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
data-cy="AddSpeciesSelectDialog"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateSpecieForm
|
<CreateSpecieForm
|
||||||
|
|
|
@ -107,7 +107,7 @@ const submitTags = async (data) => {
|
||||||
@on-fetch="onItemTagsFetched"
|
@on-fetch="onItemTagsFetched"
|
||||||
>
|
>
|
||||||
<template #body="{ rows, validate }">
|
<template #body="{ rows, validate }">
|
||||||
<QCard class="q-px-lg q-pt-md q-pb-sm">
|
<QCard class="q-px-lg q-pt-md q-pb-sm" data-cy="itemTags">
|
||||||
<VnRow
|
<VnRow
|
||||||
v-for="(row, index) in rows"
|
v-for="(row, index) in rows"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
|
@ -35,6 +35,7 @@ const editTableCellDialogRef = ref(null);
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const fixedPrices = ref([]);
|
const fixedPrices = ref([]);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
|
const hasSelectedRows = computed(() => rowsSelected.value.length > 0);
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
const itemFixedPriceFilterRef = ref();
|
const itemFixedPriceFilterRef = ref();
|
||||||
|
|
||||||
|
@ -368,9 +369,9 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
<template #st-actions>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="rowsSelected.length"
|
:disable="!hasSelectedRows"
|
||||||
@click="openEditTableCellDialog()"
|
@click="openEditTableCellDialog()"
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="edit"
|
icon="edit"
|
||||||
|
@ -380,13 +381,13 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
:disable="!hasSelectedRows"
|
||||||
:label="tMobile('globals.remove')"
|
:label="tMobile('globals.remove')"
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
flat
|
flat
|
||||||
@click="(row) => confirmRemove(row, true)"
|
@click="(row) => confirmRemove(row, true)"
|
||||||
:title="t('globals.remove')"
|
:title="t('globals.remove')"
|
||||||
v-if="rowsSelected.length"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onBeforeMount } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
@ -15,6 +15,9 @@ import ItemTypeDescriptorProxy from './ItemType/Card/ItemTypeDescriptorProxy.vue
|
||||||
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import ItemListFilter from './ItemListFilter.vue';
|
import ItemListFilter from './ItemListFilter.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
const entityId = computed(() => route.params.id);
|
const entityId = computed(() => route.params.id);
|
||||||
const { openCloneDialog } = cloneItem();
|
const { openCloneDialog } = cloneItem();
|
||||||
|
@ -22,7 +25,9 @@ const { viewSummary } = useSummaryDialog();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const validPriorities = ref([]);
|
||||||
|
const defaultTag = ref();
|
||||||
|
const defaultPriority = ref();
|
||||||
const itemFilter = {
|
const itemFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -90,7 +95,6 @@ const columns = computed(() => [
|
||||||
label: t('globals.description'),
|
label: t('globals.description'),
|
||||||
name: 'description',
|
name: 'description',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
create: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
},
|
},
|
||||||
|
@ -132,13 +136,23 @@ const columns = computed(() => [
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
visible: false,
|
visible: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('item.list.typeName'),
|
label: t('item.list.typeName'),
|
||||||
name: 'typeName',
|
name: 'typeName',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
component: 'select',
|
||||||
|
columnFilter: {
|
||||||
|
name: 'typeFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'ItemTypes',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('item.list.category'),
|
label: t('item.list.category'),
|
||||||
|
@ -161,6 +175,11 @@ const columns = computed(() => [
|
||||||
name: 'intrastat',
|
name: 'intrastat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Intrastats',
|
||||||
|
optionValue: 'description',
|
||||||
|
optionLabel: 'description',
|
||||||
|
},
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'intrastat',
|
name: 'intrastat',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -172,7 +191,6 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -198,7 +216,6 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
create: true,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -297,12 +314,21 @@ const columns = computed(() => [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
const { data } = await axios.get('ItemConfigs');
|
||||||
|
defaultTag.value = data[0].defaultTag;
|
||||||
|
defaultPriority.value = data[0].defaultPriority;
|
||||||
|
data.forEach((priority) => {
|
||||||
|
validPriorities.value = priority.validPriorities;
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="ItemList"
|
data-key="ItemList"
|
||||||
:label="t('item.searchbar.label')"
|
:label="t('item.searchbar.label')"
|
||||||
:info="t('You can search by id')"
|
:info="t('item.searchbar.info')"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -310,15 +336,18 @@ const columns = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
v-if="defaultTag"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ItemList"
|
data-key="ItemList"
|
||||||
url="Items/filter"
|
url="Items/filter"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Items',
|
urlCreate: 'Items/new',
|
||||||
title: t('Create Item'),
|
title: t('item.list.newItem'),
|
||||||
onDataSaved: () => tableRef.redirect(),
|
onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
editorFk: entityId,
|
editorFk: entityId,
|
||||||
|
tag: defaultTag,
|
||||||
|
priority: defaultPriority,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:order="['isActive DESC', 'name', 'id']"
|
:order="['isActive DESC', 'name', 'id']"
|
||||||
|
@ -364,6 +393,96 @@ const columns = computed(() => [
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" :columns="3" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #more-create-dialog="{ data }">
|
||||||
|
<VnInput
|
||||||
|
v-model="data.provisionalName"
|
||||||
|
:label="t('globals.description')"
|
||||||
|
:is-required="true"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="Tags"
|
||||||
|
v-model="data.tag"
|
||||||
|
:label="t('globals.tag')"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
:options="validPriorities"
|
||||||
|
v-model="data.priority"
|
||||||
|
:label="t('item.create.priority')"
|
||||||
|
:is-required="true"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="ItemTypes"
|
||||||
|
v-model="data.typeFk"
|
||||||
|
:label="t('item.list.typeName')"
|
||||||
|
:fields="['id', 'code', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.code }} #{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
url="Intrastats"
|
||||||
|
v-model="data.intrastatFk"
|
||||||
|
:label="t('globals.intrastat')"
|
||||||
|
:fields="['id', 'description']"
|
||||||
|
option-label="description"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.description }}</QItemLabel>
|
||||||
|
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
url="Origins"
|
||||||
|
v-model="data.originFk"
|
||||||
|
:label="t('globals.origin')"
|
||||||
|
:fields="['id', 'code', 'name']"
|
||||||
|
option-label="code"
|
||||||
|
option-value="id"
|
||||||
|
:is-required="true"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.code }} #{{ scope.opt?.id }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -199,17 +199,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{
|
|
||||||
t(`params.${scope.opt?.name}`)
|
|
||||||
}}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -265,6 +255,7 @@ onMounted(async () => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:fields="['id', 'name', 'nickname']"
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
:filter-options="['id', 'name', 'nickname']"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
|
@ -274,9 +265,12 @@ onMounted(async () => {
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{
|
<QItemLabel>
|
||||||
scope.opt?.name + ': ' + scope.opt?.nickname
|
{{ scope.opt?.name}}
|
||||||
}}</QItemLabel>
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
||||||
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
@ -375,6 +369,7 @@ onMounted(async () => {
|
||||||
:model-value="fieldFilter.selectedField"
|
:model-value="fieldFilter.selectedField"
|
||||||
:options="moreFields"
|
:options="moreFields"
|
||||||
option-label="label"
|
option-label="label"
|
||||||
|
option-value="label"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -149,7 +149,6 @@ onMounted(async () => {
|
||||||
:label="t('params.requesterFk')"
|
:label="t('params.requesterFk')"
|
||||||
v-model="params.requesterFk"
|
v-model="params.requesterFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:fields="['id', 'name']"
|
|
||||||
:params="{ departmentCodes: ['VT'] }"
|
:params="{ departmentCodes: ['VT'] }"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -107,6 +107,7 @@ item:
|
||||||
scopeDays: Scope days
|
scopeDays: Scope days
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Search item
|
label: Search item
|
||||||
|
info: You can search by id
|
||||||
descriptor:
|
descriptor:
|
||||||
item: Item
|
item: Item
|
||||||
buyer: Buyer
|
buyer: Buyer
|
||||||
|
@ -139,6 +140,7 @@ item:
|
||||||
stemMultiplier: Multiplier
|
stemMultiplier: Multiplier
|
||||||
producer: Producer
|
producer: Producer
|
||||||
landed: Landed
|
landed: Landed
|
||||||
|
newItem: New item
|
||||||
basicData:
|
basicData:
|
||||||
type: Type
|
type: Type
|
||||||
reference: Reference
|
reference: Reference
|
||||||
|
|
|
@ -109,6 +109,7 @@ item:
|
||||||
scopeDays: Días en adelante
|
scopeDays: Días en adelante
|
||||||
searchbar:
|
searchbar:
|
||||||
label: Buscar artículo
|
label: Buscar artículo
|
||||||
|
info: Puedes buscar por id
|
||||||
descriptor:
|
descriptor:
|
||||||
item: Artículo
|
item: Artículo
|
||||||
buyer: Comprador
|
buyer: Comprador
|
||||||
|
@ -141,6 +142,7 @@ item:
|
||||||
stemMultiplier: Multiplicador
|
stemMultiplier: Multiplicador
|
||||||
producer: Productor
|
producer: Productor
|
||||||
landed: F. entrega
|
landed: F. entrega
|
||||||
|
newItem: Nuevo artículo
|
||||||
basicData:
|
basicData:
|
||||||
type: Tipo
|
type: Tipo
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
|
|
|
@ -110,15 +110,13 @@ const columns = computed(() => [
|
||||||
name: 'salesPersonFk',
|
name: 'salesPersonFk',
|
||||||
field: 'userName',
|
field: 'userName',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
optionFilter: 'firstName',
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/search?departmentCodes=["VT"]',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'nickname', 'code'],
|
||||||
sortBy: 'nickname ASC',
|
sortBy: 'nickname ASC',
|
||||||
where: { role: 'salesPerson' },
|
optionLabel: 'nickname',
|
||||||
useLike: false,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -97,6 +97,7 @@ const sourceList = ref([]);
|
||||||
v-model="params.sourceApp"
|
v-model="params.sourceApp"
|
||||||
:options="sourceList"
|
:options="sourceList"
|
||||||
option-label="value"
|
option-label="value"
|
||||||
|
option-value="value"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -10,3 +10,4 @@ agency:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: Puedes buscar por nombre o id
|
info: Puedes buscar por nombre o id
|
||||||
label: Buscar agencia...
|
label: Buscar agencia...
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
route:
|
route:
|
||||||
|
params:
|
||||||
|
agencyModeName: Agencia Ruta
|
||||||
|
agencyAgreement: Agencia Acuerdo
|
||||||
|
id: Id
|
||||||
|
name: Troncal
|
||||||
|
etd: ETD
|
||||||
|
tractorPlate: Matrícula
|
||||||
|
price: Precio
|
||||||
|
observations: Observaciones
|
||||||
|
cmrFk: Id CMR
|
||||||
|
hasCmrDms: Gestdoc
|
||||||
|
ticketFk: Id ticket
|
||||||
|
routeFK: Id ruta
|
||||||
|
shipped: Fecha preparación
|
||||||
Worker: Trabajador
|
Worker: Trabajador
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Vehicle: Vehículo
|
Vehicle: Vehículo
|
||||||
|
|
|
@ -101,7 +101,7 @@ const getGroupedStates = (data) => {
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="states">
|
<QItemSection v-if="states">
|
||||||
<QSelect
|
<VnSelect
|
||||||
:label="t('State')"
|
:label="t('State')"
|
||||||
v-model="params.stateFk"
|
v-model="params.stateFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
@ -122,7 +122,7 @@ const getGroupedStates = (data) => {
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="groupedStates">
|
<QItemSection v-if="groupedStates">
|
||||||
<QSelect
|
<VnSelect
|
||||||
:label="t('Grouped state')"
|
:label="t('Grouped state')"
|
||||||
v-model="params.groupedStates"
|
v-model="params.groupedStates"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
@ -217,7 +217,7 @@ const getGroupedStates = (data) => {
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="provinces">
|
<QItemSection v-if="provinces">
|
||||||
<QSelect
|
<VnSelect
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
v-model="params.provinceFk"
|
v-model="params.provinceFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
@ -238,7 +238,7 @@ const getGroupedStates = (data) => {
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="agencies">
|
<QItemSection v-if="agencies">
|
||||||
<QSelect
|
<VnSelect
|
||||||
:label="t('Agency')"
|
:label="t('Agency')"
|
||||||
v-model="params.agencyModeFk"
|
v-model="params.agencyModeFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
@ -259,7 +259,7 @@ const getGroupedStates = (data) => {
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="warehouses">
|
<QItemSection v-if="warehouses">
|
||||||
<QSelect
|
<VnSelect
|
||||||
:label="t('Warehouse')"
|
:label="t('Warehouse')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
|
|
@ -684,6 +684,7 @@ function setReference(data) {
|
||||||
color="primary"
|
color="primary"
|
||||||
fab
|
fab
|
||||||
icon="vn:invoice-in"
|
icon="vn:invoice-in"
|
||||||
|
data-cy="ticketListMakeInvoiceBtn"
|
||||||
/>
|
/>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketList.createInvoice') }}
|
{{ t('ticketList.createInvoice') }}
|
||||||
|
|
|
@ -221,7 +221,20 @@ warehouses();
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
/>
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name}}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -232,6 +245,7 @@ warehouses();
|
||||||
:options="continentsOptions"
|
:options="continentsOptions"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
:filter-options="['code', 'name']"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
@ -140,10 +140,10 @@ en:
|
||||||
Id: Contains
|
Id: Contains
|
||||||
ref: Reference
|
ref: Reference
|
||||||
agency: Agency
|
agency: Agency
|
||||||
warehouseInFk: W. In
|
warehouseInFk: Warehouse In
|
||||||
shipped: Shipped
|
shipped: Shipped
|
||||||
shipmentHour: Shipment Hour
|
shipmentHour: Shipment Hour
|
||||||
warehouseOut: W. Out
|
warehouseOut: Warehouse Out
|
||||||
landed: Landed
|
landed: Landed
|
||||||
landingHour: Landing Hour
|
landingHour: Landing Hour
|
||||||
totalEntries: Σ
|
totalEntries: Σ
|
||||||
|
@ -156,7 +156,7 @@ es:
|
||||||
warehouseInFk: Alm.Entrada
|
warehouseInFk: Alm.Entrada
|
||||||
shipped: F.Envío
|
shipped: F.Envío
|
||||||
shipmentHour: Hora de envío
|
shipmentHour: Hora de envío
|
||||||
warehouseOut: Alm.Entrada
|
warehouseOut: Alm.Salida
|
||||||
landed: F.Entrega
|
landed: F.Entrega
|
||||||
landingHour: Hora de entrega
|
landingHour: Hora de entrega
|
||||||
totalEntries: Σ
|
totalEntries: Σ
|
||||||
|
|
|
@ -205,35 +205,48 @@ const columns = computed(() => [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<div class="list-container">
|
||||||
ref="tableRef"
|
<VnTable
|
||||||
data-key="WorkerBusiness"
|
class="list"
|
||||||
:url="`Workers/${entityId}/Business`"
|
ref="tableRef"
|
||||||
save-url="/Businesses/crud"
|
data-key="WorkerBusiness"
|
||||||
:create="{
|
:url="`Workers/${entityId}/Business`"
|
||||||
urlCreate: `Workers/${entityId}/Business`,
|
save-url="/Businesses/crud"
|
||||||
title: 'Create business',
|
:create="{
|
||||||
onDataSaved: () => tableRef.reload(),
|
urlCreate: `Workers/${entityId}/Business`,
|
||||||
formInitialData: {},
|
title: 'Create business',
|
||||||
}"
|
onDataSaved: () => tableRef.reload(),
|
||||||
order="id DESC"
|
formInitialData: {},
|
||||||
:columns="columns"
|
}"
|
||||||
default-mode="card"
|
order="id DESC"
|
||||||
auto-load
|
:columns="columns"
|
||||||
:disable-option="{ table: true }"
|
default-mode="card"
|
||||||
:right-search="false"
|
auto-load
|
||||||
card-class="grid-two q-gutter-x-md"
|
:disable-option="{ table: true }"
|
||||||
:is-editable="true"
|
:right-search="false"
|
||||||
:use-model="true"
|
card-class="grid-two q-gutter-x-xl q-gutter-y-md"
|
||||||
@save-changes="(data) => reactivateWorker(data)"
|
:is-editable="true"
|
||||||
>
|
:use-model="true"
|
||||||
<!-- <template #column-ended="{ row }">
|
@save-changes="(data) => reactivateWorker(data)"
|
||||||
<VnInputDate v-model="row.ended" />
|
/>
|
||||||
<QForm v-if="!row.ended"></QForm>
|
</div>
|
||||||
</template> -->
|
|
||||||
</VnTable>
|
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
width: 1000px;
|
||||||
|
margin: 4em auto;
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
.q-card__section {
|
||||||
|
background-color: blue;
|
||||||
|
}
|
||||||
|
.list-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Do you want to reactivate the user?: desea reactivar el usuario?
|
Do you want to reactivate the user?: desea reactivar el usuario?
|
||||||
|
|
|
@ -1,21 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
|
||||||
import WorkerDescriptor from './WorkerDescriptor.vue';
|
import WorkerDescriptor from './WorkerDescriptor.vue';
|
||||||
import WorkerFilter from '../WorkerFilter.vue';
|
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta data-key="Worker" custom-url="Workers/summary" :descriptor="WorkerDescriptor" />
|
||||||
data-key="Worker"
|
|
||||||
custom-url="Workers/summary"
|
|
||||||
:descriptor="WorkerDescriptor"
|
|
||||||
:filter-panel="WorkerFilter"
|
|
||||||
search-data-key="WorkerList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Workers/filter',
|
|
||||||
label: 'Search worker',
|
|
||||||
info: 'You can search by worker id or name',
|
|
||||||
order: 'id DESC',
|
|
||||||
}"
|
|
||||||
:redirect-on-error="true"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -208,13 +208,30 @@ const getWorkedHours = async (from, to) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAbsences = async () => {
|
const getAbsences = async () => {
|
||||||
const params = {
|
const startYear = startOfWeek.value.getFullYear();
|
||||||
workerFk: route.params.id,
|
const endYear = endOfWeek.value.getFullYear();
|
||||||
businessFk: null,
|
const defaultParams = { workerFk: route.params.id, businessFk: null };
|
||||||
year: startOfWeek.value.getFullYear(),
|
|
||||||
|
const startData = (
|
||||||
|
await axios.get('Calendars/absences', {
|
||||||
|
params: { ...defaultParams, year: startYear },
|
||||||
|
})
|
||||||
|
).data;
|
||||||
|
|
||||||
|
let endData;
|
||||||
|
if (startYear !== endYear) {
|
||||||
|
endData = (
|
||||||
|
await axios.get('Calendars/absences', {
|
||||||
|
params: { ...defaultParams, year: endYear },
|
||||||
|
})
|
||||||
|
).data;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
holidays: [...(startData?.holidays || []), ...(endData?.holidays || [])],
|
||||||
|
absences: [...(startData?.absences || []), ...(endData?.absences || [])],
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await axios.get('Calendars/absences', { params });
|
|
||||||
if (data) addEvents(data);
|
if (data) addEvents(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,254 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { onBeforeMount, ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import axios from 'axios';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
|
||||||
import VnRadio from 'src/components/common/VnRadio.vue';
|
|
||||||
import { useState } from 'src/composables/useState';
|
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const user = useState().getUser();
|
|
||||||
|
|
||||||
const companiesOptions = ref([]);
|
|
||||||
const payMethodsOptions = ref([]);
|
|
||||||
const bankEntitiesOptions = ref([]);
|
|
||||||
const formData = ref({ companyFk: user.value.companyFk, isFreelance: false });
|
|
||||||
const defaultPayMethod = ref();
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
defaultPayMethod.value = (
|
|
||||||
await axios.get('WorkerConfigs/findOne', {
|
|
||||||
params: { field: ['payMethodFk'] },
|
|
||||||
})
|
|
||||||
).data.payMethodFk;
|
|
||||||
formData.value.payMethodFk = defaultPayMethod.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleLocation(data, location) {
|
|
||||||
const { town, code, provinceFk, countryFk } = location ?? {};
|
|
||||||
data.postcode = code;
|
|
||||||
data.city = town;
|
|
||||||
data.provinceFk = provinceFk;
|
|
||||||
data.countryFk = countryFk;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateCodeUser(worker) {
|
|
||||||
if (!worker.firstName || !worker.lastNames) return;
|
|
||||||
|
|
||||||
const totalName = worker.firstName.concat(' ' + worker.lastNames).toLowerCase();
|
|
||||||
const totalNameArray = totalName.split(' ');
|
|
||||||
let newCode = '';
|
|
||||||
|
|
||||||
for (let part of totalNameArray) newCode += part.charAt(0);
|
|
||||||
|
|
||||||
worker.code = newCode.toUpperCase().slice(0, 3);
|
|
||||||
worker.name = totalNameArray[0] + newCode.slice(1);
|
|
||||||
|
|
||||||
if (!worker.companyFk) worker.companyFk = user.companyFk;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function autofillBic(worker) {
|
|
||||||
if (!worker || !worker.iban) return;
|
|
||||||
|
|
||||||
let bankEntityId = parseInt(worker.iban.substr(4, 4));
|
|
||||||
let filter = { where: { id: bankEntityId } };
|
|
||||||
|
|
||||||
const { data } = await axios.get(`BankEntities`, { params: { filter } });
|
|
||||||
const hasData = data && data[0];
|
|
||||||
if (hasData) worker.bankEntityFk = data[0].id;
|
|
||||||
else if (!hasData) worker.bankEntityFk = undefined;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<FetchData
|
|
||||||
url="Companies"
|
|
||||||
@on-fetch="(data) => (companiesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="Paymethods"
|
|
||||||
@on-fetch="(data) => (payMethodsOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="BankEntities"
|
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<QPage>
|
|
||||||
<VnSubToolbar>
|
|
||||||
<template #st-data>
|
|
||||||
<VnRadio
|
|
||||||
v-model="formData.isFreelance"
|
|
||||||
:val="false"
|
|
||||||
:label="`${t('Internal')}`"
|
|
||||||
@update:model-value="formData.payMethodFk = defaultPayMethod"
|
|
||||||
/>
|
|
||||||
<VnRadio
|
|
||||||
v-model="formData.isFreelance"
|
|
||||||
:val="true"
|
|
||||||
:label="`${t('External')}`"
|
|
||||||
@update:model-value="delete formData.payMethodFk"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnSubToolbar>
|
|
||||||
<FormModel
|
|
||||||
url-create="Workers/new"
|
|
||||||
model="worker"
|
|
||||||
:form-initial-data="formData"
|
|
||||||
@on-data-saved="(__, { id }) => $router.push({ path: `/worker/${id}` })"
|
|
||||||
>
|
|
||||||
<template #form="{ data, validate }">
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.firstName"
|
|
||||||
:label="t('globals.name')"
|
|
||||||
:rules="validate('Worker.firstName')"
|
|
||||||
@update:model-value="generateCodeUser(data)"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.lastNames"
|
|
||||||
:label="t('worker.create.lastName')"
|
|
||||||
:rules="validate('Worker.lastNames')"
|
|
||||||
@update:model-value="generateCodeUser(data)"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.code"
|
|
||||||
:label="t('worker.create.code')"
|
|
||||||
:rules="validate('Worker.code')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.name"
|
|
||||||
:label="t('worker.create.webUser')"
|
|
||||||
:rules="validate('Worker.name')"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.email"
|
|
||||||
:label="t('worker.create.personalEmail')"
|
|
||||||
:rules="validate('Worker.email')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('globals.company')"
|
|
||||||
v-model="data.companyFk"
|
|
||||||
:options="companiesOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="code"
|
|
||||||
hide-selected
|
|
||||||
:rules="validate('Worker.company')"
|
|
||||||
/>
|
|
||||||
<VnSelectWorker
|
|
||||||
:label="t('worker.summary.boss')"
|
|
||||||
v-model="data.bossFk"
|
|
||||||
:rules="validate('Worker.boss')"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.fi"
|
|
||||||
:label="t('worker.create.fi')"
|
|
||||||
:rules="validate('Worker.fi')"
|
|
||||||
/>
|
|
||||||
<VnInputDate
|
|
||||||
v-model="data.birth"
|
|
||||||
:label="t('worker.create.birth')"
|
|
||||||
:rules="validate('Worker.birth')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.phone"
|
|
||||||
:label="t('globals.phone')"
|
|
||||||
:rules="validate('Worker.phone')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnLocation
|
|
||||||
:rules="validate('Worker.postcode')"
|
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
>
|
|
||||||
</VnLocation>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('globals.street')"
|
|
||||||
v-model="data.street"
|
|
||||||
:rules="validate('Worker.street')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('worker.create.payMethods')"
|
|
||||||
v-model="data.payMethodFk"
|
|
||||||
:options="payMethodsOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
map-options
|
|
||||||
hide-selected
|
|
||||||
:rules="validate('Worker.payMethodFk')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="(val) => !val && delete formData.payMethodFk"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
v-model="data.iban"
|
|
||||||
:label="t('worker.create.iban')"
|
|
||||||
:rules="validate('Worker.iban')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="autofillBic(data)"
|
|
||||||
>
|
|
||||||
<template #append>
|
|
||||||
<QIcon name="info" class="cursor-info">
|
|
||||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
<VnSelectDialog
|
|
||||||
:label="t('worker.create.bankEntity')"
|
|
||||||
v-model="data.bankEntityFk"
|
|
||||||
:options="bankEntitiesOptions"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
hide-selected
|
|
||||||
:roles-allowed-to-create="['salesAssistant', 'hr']"
|
|
||||||
:rules="validate('Worker.bankEntity')"
|
|
||||||
:disable="formData.isFreelance"
|
|
||||||
@update:model-value="autofillBic(data)"
|
|
||||||
:filter-options="['bic', 'name']"
|
|
||||||
>
|
|
||||||
<template #form>
|
|
||||||
<CreateBankEntityForm
|
|
||||||
@on-data-saved="(data) => bankEntitiesOptions.push(data)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection v-if="scope.opt">
|
|
||||||
<QItemLabel
|
|
||||||
>{{ scope.opt.bic }}
|
|
||||||
{{ scope.opt.name }}</QItemLabel
|
|
||||||
>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelectDialog>
|
|
||||||
</VnRow>
|
|
||||||
</template>
|
|
||||||
</FormModel>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
|
|
@ -1,11 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<VnSection data-key="WorkerDepartment">
|
||||||
<WorkerDepartmentTree />
|
<template #body>
|
||||||
</QPage>
|
<div class="flex flex-center q-pa-md">
|
||||||
|
<WorkerDepartmentTree />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -111,18 +111,16 @@ function handleEvent(type, event, node) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'path':
|
case 'path':
|
||||||
state.set('TreeState', lastId);
|
state.set('TreeState', lastId);
|
||||||
node.id && router.push({ path: `/department/department/${node.id}/summary` });
|
node.id && router.push({ path: `/worker/department/${node.id}/summary` });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tab':
|
case 'tab':
|
||||||
state.set('TreeState', lastId);
|
state.set('TreeState', lastId);
|
||||||
node.id &&
|
node.id && window.open(`#/worker/department/${node.id}/summary`, '_blank');
|
||||||
window.open(`#/department/department/${node.id}/summary`, '_blank');
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
node.id &&
|
node.id && router.push({ path: `#/worker/department/${node.id}/summary` });
|
||||||
router.push({ path: `#/department/department/${node.id}/summary` });
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { onBeforeMount, computed, ref } from 'vue';
|
import { onBeforeMount, computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import WorkerSummary from './Card/WorkerSummary.vue';
|
import WorkerSummary from './Card/WorkerSummary.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
@ -14,12 +13,11 @@ import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import WorkerFilter from './WorkerFilter.vue';
|
import WorkerFilter from './WorkerFilter.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -31,6 +29,7 @@ const postcodesOptions = ref([]);
|
||||||
const user = useState().getUser();
|
const user = useState().getUser();
|
||||||
const defaultPayMethod = ref();
|
const defaultPayMethod = ref();
|
||||||
const bankEntitiesRef = ref();
|
const bankEntitiesRef = ref();
|
||||||
|
const dataKey = 'WorkerList';
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -170,11 +169,6 @@ async function autofillBic(worker) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
|
||||||
data-key="WorkerList"
|
|
||||||
:label="t('Search worker')"
|
|
||||||
:info="t('You can search by worker id or name')"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Companies"
|
url="Companies"
|
||||||
@on-fetch="(data) => (companiesOptions = data)"
|
@on-fetch="(data) => (companiesOptions = data)"
|
||||||
|
@ -191,173 +185,202 @@ async function autofillBic(worker) {
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
|
||||||
<template #right-panel>
|
<VnSection
|
||||||
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
prefix="workerSearch"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Workers/filter',
|
||||||
|
order: ['id DESC'],
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<WorkerFilter data-key="WorkerList" />
|
<WorkerFilter data-key="WorkerList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
v-if="defaultPayMethod"
|
v-if="defaultPayMethod"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerList"
|
:data-key="dataKey"
|
||||||
url="Workers/filter"
|
:create="{
|
||||||
:create="{
|
urlCreate: 'Workers/new',
|
||||||
urlCreate: 'Workers/new',
|
title: t('Create worker'),
|
||||||
title: t('Create worker'),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
formInitialData: {
|
||||||
formInitialData: {
|
payMethodFk: defaultPayMethod,
|
||||||
payMethodFk: defaultPayMethod,
|
companyFk: user.companyFk,
|
||||||
companyFk: user.companyFk,
|
isFreelance: false,
|
||||||
isFreelance: false,
|
},
|
||||||
},
|
}"
|
||||||
}"
|
default-mode="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="table"
|
redirect="worker"
|
||||||
redirect="worker"
|
:right-search="false"
|
||||||
:right-search="false"
|
>
|
||||||
:order="['id DESC']"
|
<template #more-create-dialog="{ data }">
|
||||||
>
|
<div class="q-pa-lg full-width">
|
||||||
<template #more-create-dialog="{ data }">
|
<VnRadio
|
||||||
<div class="q-pa-lg full-width">
|
v-model="data.isFreelance"
|
||||||
<VnRadio
|
:val="false"
|
||||||
v-model="data.isFreelance"
|
:label="`${t('Internal')}`"
|
||||||
:val="false"
|
@update:model-value="data.payMethodFk = defaultPayMethod"
|
||||||
:label="`${t('Internal')}`"
|
/>
|
||||||
@update:model-value="data.payMethodFk = defaultPayMethod"
|
<VnRadio
|
||||||
/>
|
v-model="data.isFreelance"
|
||||||
<VnRadio
|
:val="true"
|
||||||
v-model="data.isFreelance"
|
:label="`${t('External')}`"
|
||||||
:val="true"
|
@update:model-value="delete data.payMethodFk"
|
||||||
:label="`${t('External')}`"
|
/>
|
||||||
@update:model-value="delete data.payMethodFk"
|
<VnRow>
|
||||||
/>
|
<VnInput
|
||||||
<VnRow>
|
next
|
||||||
<VnInput
|
v-model="data.firstName"
|
||||||
next
|
:label="t('globals.name')"
|
||||||
v-model="data.firstName"
|
@update:model-value="generateCodeUser(data)"
|
||||||
:label="t('globals.name')"
|
/>
|
||||||
@update:model-value="generateCodeUser(data)"
|
<VnInput
|
||||||
/>
|
v-model="data.lastNames"
|
||||||
<VnInput
|
:label="t('worker.create.lastName')"
|
||||||
v-model="data.lastNames"
|
@update:model-value="generateCodeUser(data)"
|
||||||
:label="t('worker.create.lastName')"
|
/>
|
||||||
@update:model-value="generateCodeUser(data)"
|
<VnInput
|
||||||
/>
|
v-model="data.code"
|
||||||
<VnInput v-model="data.code" :label="t('worker.create.code')" />
|
:label="t('worker.create.code')"
|
||||||
</VnRow>
|
/>
|
||||||
<VnRow>
|
</VnRow>
|
||||||
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.email"
|
v-model="data.name"
|
||||||
type="email"
|
:label="t('worker.create.webUser')"
|
||||||
:label="t('worker.create.personalEmail')"
|
/>
|
||||||
/>
|
<VnInput
|
||||||
</VnRow>
|
v-model="data.email"
|
||||||
<VnRow>
|
type="email"
|
||||||
<VnSelect
|
:label="t('worker.create.personalEmail')"
|
||||||
:label="t('globals.company')"
|
/>
|
||||||
v-model="data.companyFk"
|
</VnRow>
|
||||||
:options="companiesOptions"
|
<VnRow>
|
||||||
option-value="id"
|
<VnSelect
|
||||||
option-label="code"
|
:label="t('globals.company')"
|
||||||
hide-selected
|
v-model="data.companyFk"
|
||||||
/>
|
:options="companiesOptions"
|
||||||
<VnSelectWorker
|
option-value="id"
|
||||||
:label="t('worker.summary.boss')"
|
option-label="code"
|
||||||
v-model="data.bossFk"
|
hide-selected
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
<VnSelectWorker
|
||||||
<VnRow>
|
:label="t('worker.summary.boss')"
|
||||||
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
v-model="data.bossFk"
|
||||||
<VnInputDate
|
/>
|
||||||
v-model="data.birth"
|
</VnRow>
|
||||||
:label="t('worker.create.birth')"
|
<VnRow>
|
||||||
:disable="data.isFreelance"
|
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
||||||
/>
|
<VnInputDate
|
||||||
<VnInput
|
v-model="data.birth"
|
||||||
v-model="data.phone"
|
:label="t('worker.create.birth')"
|
||||||
:label="t('globals.phone')"
|
:disable="data.isFreelance"
|
||||||
:disable="data.isFreelance"
|
/>
|
||||||
/>
|
<VnInput
|
||||||
</VnRow>
|
v-model="data.phone"
|
||||||
<VnRow>
|
:label="t('globals.phone')"
|
||||||
<VnLocation
|
:disable="data.isFreelance"
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
/>
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
</VnRow>
|
||||||
:options="postcodesOptions"
|
<VnRow>
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
<VnLocation
|
||||||
:disable="data.isFreelance"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
>
|
:acls="[
|
||||||
</VnLocation>
|
{ model: 'Town', props: '*', accessType: 'WRITE' },
|
||||||
</VnRow>
|
]"
|
||||||
<VnRow>
|
:options="postcodesOptions"
|
||||||
<VnInput
|
@update:model-value="
|
||||||
:label="t('globals.street')"
|
(location) => handleLocation(data, location)
|
||||||
:model-value="uppercaseStreetModel(data).get()"
|
"
|
||||||
@update:model-value="uppercaseStreetModel(data).set"
|
:disable="data.isFreelance"
|
||||||
:disable="data.isFreelance"
|
>
|
||||||
/>
|
</VnLocation>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnInput
|
||||||
:label="t('worker.create.payMethods')"
|
:label="t('globals.street')"
|
||||||
v-model="data.payMethodFk"
|
:model-value="uppercaseStreetModel(data).get()"
|
||||||
:options="payMethodsOptions"
|
@update:model-value="uppercaseStreetModel(data).set"
|
||||||
option-value="id"
|
:disable="data.isFreelance"
|
||||||
option-label="name"
|
/>
|
||||||
map-options
|
</VnRow>
|
||||||
hide-selected
|
<VnRow>
|
||||||
:disable="data.isFreelance"
|
<VnSelect
|
||||||
@update:model-value="(val) => !val && delete data.payMethodFk"
|
:label="t('worker.create.payMethods')"
|
||||||
/>
|
v-model="data.payMethodFk"
|
||||||
<VnInput
|
:options="payMethodsOptions"
|
||||||
v-model="data.iban"
|
option-value="id"
|
||||||
:label="t('worker.create.iban')"
|
option-label="name"
|
||||||
:disable="data.isFreelance"
|
map-options
|
||||||
@update:model-value="autofillBic(data)"
|
hide-selected
|
||||||
>
|
:disable="data.isFreelance"
|
||||||
<template #append>
|
@update:model-value="
|
||||||
<QIcon name="info" class="cursor-info">
|
(val) => !val && delete data.payMethodFk
|
||||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelectDialog
|
|
||||||
:label="t('worker.create.bankEntity')"
|
|
||||||
v-model="data.bankEntityFk"
|
|
||||||
:options="bankEntitiesOptions"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
hide-selected
|
|
||||||
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
|
|
||||||
:disable="data.isFreelance"
|
|
||||||
@update:model-value="autofillBic(data)"
|
|
||||||
:filter-options="['bic', 'name']"
|
|
||||||
>
|
|
||||||
<template #form>
|
|
||||||
<CreateBankEntityForm
|
|
||||||
@on-data-saved="
|
|
||||||
(_, resp) => handleNewBankEntity(data, resp)
|
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</template>
|
<VnInput
|
||||||
<template #option="scope">
|
v-model="data.iban"
|
||||||
<QItem v-bind="scope.itemProps">
|
:label="t('worker.create.iban')"
|
||||||
<QItemSection v-if="scope.opt">
|
:disable="data.isFreelance"
|
||||||
<QItemLabel
|
@update:model-value="autofillBic(data)"
|
||||||
>{{ scope.opt.bic }}
|
>
|
||||||
{{ scope.opt.name }}</QItemLabel
|
<template #append>
|
||||||
>
|
<QIcon name="info" class="cursor-info">
|
||||||
</QItemSection>
|
<QTooltip>{{
|
||||||
</QItem>
|
t('components.iban_tooltip')
|
||||||
</template>
|
}}</QTooltip>
|
||||||
</VnSelectDialog>
|
</QIcon>
|
||||||
</VnRow>
|
</template>
|
||||||
</div>
|
</VnInput>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelectDialog
|
||||||
|
:label="t('worker.create.bankEntity')"
|
||||||
|
v-model="data.bankEntityFk"
|
||||||
|
:options="bankEntitiesOptions"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
hide-selected
|
||||||
|
:acls="[
|
||||||
|
{
|
||||||
|
model: 'BankEntity',
|
||||||
|
props: '*',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
:disable="data.isFreelance"
|
||||||
|
@update:model-value="autofillBic(data)"
|
||||||
|
:filter-options="['bic', 'name']"
|
||||||
|
>
|
||||||
|
<template #form>
|
||||||
|
<CreateBankEntityForm
|
||||||
|
@on-data-saved="
|
||||||
|
(_, resp) => handleNewBankEntity(data, resp)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection v-if="scope.opt">
|
||||||
|
<QItemLabel
|
||||||
|
>{{ scope.opt.bic }}
|
||||||
|
{{ scope.opt.name }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectDialog>
|
||||||
|
</VnRow>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
workerSearch:
|
||||||
|
search: Search worker
|
||||||
|
searchInfo: Search worker by id or name
|
||||||
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
|
||||||
tableColumns:
|
tableColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Search worker: Buscar trabajador
|
workerSearch:
|
||||||
You can search by worker id or name: Puedes buscar por id o nombre del trabajador
|
search: Buscar trabajador
|
||||||
|
searchInfo: Buscar trabajador por id o nombre
|
||||||
Locker: Taquilla
|
Locker: Taquilla
|
||||||
Internal: Interno
|
Internal: Interno
|
||||||
External: Externo
|
External: Externo
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import { RouterView } from 'vue-router';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
path: '/department',
|
|
||||||
name: 'Department',
|
|
||||||
meta: {
|
|
||||||
title: 'department',
|
|
||||||
icon: 'vn:greuge',
|
|
||||||
moduleName: 'Department',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'WorkerDepartment' },
|
|
||||||
menus: {
|
|
||||||
main: [],
|
|
||||||
card: ['DepartmentBasicData'],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'DepartmentCard',
|
|
||||||
path: 'department/:id',
|
|
||||||
component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
|
|
||||||
redirect: { name: 'DepartmentSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'DepartmentSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Department/Card/DepartmentSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'DepartmentBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Department/Card/DepartmentBasicData.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -11,7 +11,6 @@ import Route from './route';
|
||||||
import Supplier from './supplier';
|
import Supplier from './supplier';
|
||||||
import Travel from './travel';
|
import Travel from './travel';
|
||||||
import Order from './order';
|
import Order from './order';
|
||||||
import Department from './department';
|
|
||||||
import Entry from './entry';
|
import Entry from './entry';
|
||||||
import roadmap from './roadmap';
|
import roadmap from './roadmap';
|
||||||
import Parking from './parking';
|
import Parking from './parking';
|
||||||
|
@ -35,7 +34,6 @@ export default [
|
||||||
Travel,
|
Travel,
|
||||||
Order,
|
Order,
|
||||||
invoiceIn,
|
invoiceIn,
|
||||||
Department,
|
|
||||||
Entry,
|
Entry,
|
||||||
roadmap,
|
roadmap,
|
||||||
Parking,
|
Parking,
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
export default {
|
const workerCard = {
|
||||||
path: '/worker',
|
name: 'WorkerCard',
|
||||||
name: 'Worker',
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
|
||||||
|
redirect: { name: 'WorkerSummary' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'workers',
|
menu: [
|
||||||
icon: 'vn:worker',
|
|
||||||
moduleName: 'Worker',
|
|
||||||
keyBinding: 'w',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'WorkerMain' },
|
|
||||||
menus: {
|
|
||||||
main: ['WorkerList', 'WorkerDepartment'],
|
|
||||||
card: [
|
|
||||||
'WorkerBasicData',
|
'WorkerBasicData',
|
||||||
'WorkerBusiness',
|
'WorkerBusiness',
|
||||||
'WorkerNotes',
|
'WorkerNotes',
|
||||||
|
@ -34,216 +27,256 @@ export default {
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
name: 'WorkerSummary',
|
||||||
name: 'WorkerMain',
|
path: 'summary',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
meta: {
|
||||||
redirect: { name: 'WorkerList' },
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'WorkerBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
acls: [
|
||||||
|
{
|
||||||
|
model: 'Worker',
|
||||||
|
props: 'updateAttributes',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'business',
|
||||||
|
name: 'WorkerBusiness',
|
||||||
|
meta: {
|
||||||
|
title: 'business',
|
||||||
|
icon: 'handshake',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerBusiness.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'notes',
|
||||||
|
name: 'NotesCard',
|
||||||
|
redirect: { name: 'WorkerNotes' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: '',
|
||||||
name: 'WorkerList',
|
name: 'WorkerNotes',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'list',
|
title: 'notes',
|
||||||
icon: 'view_list',
|
icon: 'vn:notes',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Worker/WorkerList.vue'),
|
component: () => import('src/pages/Worker/Card/WorkerNotes.vue'),
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'department',
|
|
||||||
name: 'WorkerDepartment',
|
|
||||||
meta: {
|
|
||||||
title: 'department',
|
|
||||||
icon: 'vn:greuge',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/WorkerDepartment.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'WorkerCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'workerCreate',
|
|
||||||
icon: 'add',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/WorkerCreate.vue'),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'WorkerCard',
|
name: 'WorkerTimeControl',
|
||||||
path: ':id',
|
path: 'time-control',
|
||||||
component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
|
meta: {
|
||||||
redirect: { name: 'WorkerSummary' },
|
title: 'timeControl',
|
||||||
|
icon: 'access_time',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerCalendar',
|
||||||
|
path: 'calendar',
|
||||||
|
meta: {
|
||||||
|
title: 'calendar',
|
||||||
|
icon: 'calendar_today',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerPda',
|
||||||
|
path: 'pda',
|
||||||
|
meta: {
|
||||||
|
title: 'pda',
|
||||||
|
icon: 'phone_android',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerNotificationsManager',
|
||||||
|
path: 'notifications',
|
||||||
|
meta: {
|
||||||
|
title: 'notifications',
|
||||||
|
icon: 'notifications',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'pbx',
|
||||||
|
name: 'WorkerPBX',
|
||||||
|
meta: {
|
||||||
|
title: 'pbx',
|
||||||
|
icon: 'vn:pbx',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerDms',
|
||||||
|
path: 'dms',
|
||||||
|
meta: {
|
||||||
|
title: 'dms',
|
||||||
|
icon: 'cloud_upload',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerLog',
|
||||||
|
path: 'log',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'vn:History',
|
||||||
|
acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerLocker',
|
||||||
|
path: 'locker',
|
||||||
|
meta: {
|
||||||
|
title: 'locker',
|
||||||
|
icon: 'lock',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerBalance',
|
||||||
|
path: 'balance',
|
||||||
|
meta: {
|
||||||
|
title: 'balance',
|
||||||
|
icon: 'balance',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerFormation',
|
||||||
|
path: 'formation',
|
||||||
|
meta: {
|
||||||
|
title: 'formation',
|
||||||
|
icon: 'clinical_notes',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerFormation.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerMedical',
|
||||||
|
path: 'medical',
|
||||||
|
meta: {
|
||||||
|
title: 'medical',
|
||||||
|
icon: 'medical_information',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerPit',
|
||||||
|
path: 'pit',
|
||||||
|
meta: {
|
||||||
|
title: 'pit',
|
||||||
|
icon: 'lock',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WorkerOperator',
|
||||||
|
path: 'operator',
|
||||||
|
meta: {
|
||||||
|
title: 'operator',
|
||||||
|
icon: 'person',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const departmentCard = {
|
||||||
|
name: 'DepartmentCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
|
||||||
|
redirect: { name: 'DepartmentSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: ['DepartmentBasicData'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'summary',
|
||||||
|
name: 'DepartmentSummary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'DepartmentBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Department/Card/DepartmentBasicData.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Worker',
|
||||||
|
path: '/worker',
|
||||||
|
meta: {
|
||||||
|
title: 'workers',
|
||||||
|
icon: 'vn:worker',
|
||||||
|
moduleName: 'Worker',
|
||||||
|
keyBinding: 'w',
|
||||||
|
menu: ['WorkerList', 'WorkerDepartment'],
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'WorkerMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'WorkerMain',
|
||||||
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
|
redirect: { name: 'WorkerIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'WorkerSummary',
|
path: '',
|
||||||
path: 'summary',
|
name: 'WorkerIndexMain',
|
||||||
meta: {
|
redirect: { name: 'WorkerList' },
|
||||||
title: 'summary',
|
component: () => import('src/pages/Worker/WorkerList.vue'),
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'basic-data',
|
|
||||||
name: 'WorkerBasicData',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
acls: [
|
|
||||||
{
|
|
||||||
model: 'Worker',
|
|
||||||
props: 'updateAttributes',
|
|
||||||
accessType: 'WRITE',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'business',
|
|
||||||
name: 'WorkerBusiness',
|
|
||||||
meta: {
|
|
||||||
title: 'business',
|
|
||||||
icon: 'handshake',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerBusiness.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'notes',
|
|
||||||
name: 'NotesCard',
|
|
||||||
redirect: { name: 'WorkerNotes' },
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
name: 'WorkerList',
|
||||||
name: 'WorkerNotes',
|
path: 'list',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'notes',
|
title: 'list',
|
||||||
icon: 'vn:notes',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () =>
|
|
||||||
import('src/pages/Worker/Card/WorkerNotes.vue'),
|
|
||||||
},
|
},
|
||||||
|
workerCard,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'WorkerTimeControl',
|
path: 'department',
|
||||||
path: 'time-control',
|
name: 'Department',
|
||||||
meta: {
|
redirect: { name: 'WorkerDepartment' },
|
||||||
title: 'timeControl',
|
component: () => import('src/pages/Worker/WorkerDepartment.vue'),
|
||||||
icon: 'access_time',
|
children: [
|
||||||
},
|
{
|
||||||
component: () =>
|
name: 'WorkerDepartment',
|
||||||
import('src/pages/Worker/Card/WorkerTimeControl.vue'),
|
path: 'list',
|
||||||
},
|
meta: { title: 'department', icon: 'vn:greuge' },
|
||||||
{
|
},
|
||||||
name: 'WorkerCalendar',
|
departmentCard,
|
||||||
path: 'calendar',
|
],
|
||||||
meta: {
|
|
||||||
title: 'calendar',
|
|
||||||
icon: 'calendar_today',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerPda',
|
|
||||||
path: 'pda',
|
|
||||||
meta: {
|
|
||||||
title: 'pda',
|
|
||||||
icon: 'phone_android',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerNotificationsManager',
|
|
||||||
path: 'notifications',
|
|
||||||
meta: {
|
|
||||||
title: 'notifications',
|
|
||||||
icon: 'notifications',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'pbx',
|
|
||||||
name: 'WorkerPBX',
|
|
||||||
meta: {
|
|
||||||
title: 'pbx',
|
|
||||||
icon: 'vn:pbx',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerDms',
|
|
||||||
path: 'dms',
|
|
||||||
meta: {
|
|
||||||
title: 'dms',
|
|
||||||
icon: 'cloud_upload',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerLog',
|
|
||||||
path: 'log',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'vn:History',
|
|
||||||
acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerLocker',
|
|
||||||
path: 'locker',
|
|
||||||
meta: {
|
|
||||||
title: 'locker',
|
|
||||||
icon: 'lock',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerBalance',
|
|
||||||
path: 'balance',
|
|
||||||
meta: {
|
|
||||||
title: 'balance',
|
|
||||||
icon: 'balance',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerFormation',
|
|
||||||
path: 'formation',
|
|
||||||
meta: {
|
|
||||||
title: 'formation',
|
|
||||||
icon: 'clinical_notes',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerFormation.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerMedical',
|
|
||||||
path: 'medical',
|
|
||||||
meta: {
|
|
||||||
title: 'medical',
|
|
||||||
icon: 'medical_information',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerPit',
|
|
||||||
path: 'pit',
|
|
||||||
meta: {
|
|
||||||
title: 'pit',
|
|
||||||
icon: 'lock',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WorkerOperator',
|
|
||||||
path: 'operator',
|
|
||||||
meta: {
|
|
||||||
title: 'operator',
|
|
||||||
icon: 'person',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,6 @@ import invoiceIn from './modules/invoiceIn';
|
||||||
import wagon from './modules/wagon';
|
import wagon from './modules/wagon';
|
||||||
import supplier from './modules/supplier';
|
import supplier from './modules/supplier';
|
||||||
import travel from './modules/travel';
|
import travel from './modules/travel';
|
||||||
import department from './modules/department';
|
|
||||||
import ItemType from './modules/itemType';
|
import ItemType from './modules/itemType';
|
||||||
import shelving from 'src/router/modules/shelving';
|
import shelving from 'src/router/modules/shelving';
|
||||||
import order from 'src/router/modules/order';
|
import order from 'src/router/modules/order';
|
||||||
|
@ -85,7 +84,6 @@ const routes = [
|
||||||
route,
|
route,
|
||||||
supplier,
|
supplier,
|
||||||
travel,
|
travel,
|
||||||
department,
|
|
||||||
roadmap,
|
roadmap,
|
||||||
entry,
|
entry,
|
||||||
parking,
|
parking,
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
reports/*
|
reports/*
|
||||||
screenshots/*
|
screenshots/*
|
||||||
|
downloads/*
|
|
@ -41,7 +41,7 @@ describe('OrderCatalog', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="vnSearchBar"] > .q-field > .q-field__inner > .q-field__control'
|
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
|
||||||
).type('{enter}');
|
).type('{enter}');
|
||||||
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
|
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
|
||||||
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('InvoiceOut list', () => {
|
||||||
|
const invoice = {
|
||||||
|
Ticket: { val: '8' },
|
||||||
|
Serial: { val: 'Española rapida', type: 'select' },
|
||||||
|
};
|
||||||
|
const invoiceError = {
|
||||||
|
Ticket: { val: '1' },
|
||||||
|
Serial: { val: 'Española rapida', type: 'select' },
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/invoice-out/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should search and filter an invoice and enter to the summary', () => {
|
||||||
|
cy.typeSearchbar('1{enter}');
|
||||||
|
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
|
||||||
|
cy.get('.header > a.q-btn > .q-btn__content').click();
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should download all pdfs', () => {
|
||||||
|
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
||||||
|
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||||
|
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.fillInForm(invoiceError);
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('This ticket is already invoiced');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a manual invoice and enter to its summary', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.fillInForm(invoice);
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,21 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('InvoiceOut manual invoice', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/ticket/list`);
|
||||||
|
cy.get('#searchbar input').type('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create an invoice from a ticket and go to that invoice', () => {
|
||||||
|
cy.searchByLabel('Customer ID', '1101');
|
||||||
|
cy.get(
|
||||||
|
'[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
|
||||||
|
).click();
|
||||||
|
cy.dataCy('ticketListMakeInvoiceBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
cy.get('.q-virtual-scroll__content > :nth-child(1) > :nth-child(3)').click();
|
||||||
|
cy.get(':nth-child(8) > .value > .link').click();
|
||||||
|
cy.get('.header > :nth-child(3) > .q-btn__content').click();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,16 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('InvoiceOut negative bases', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/invoice-out/negative-bases`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter and download as CSV', () => {
|
||||||
|
cy.get(
|
||||||
|
':nth-child(7) > .full-width > :nth-child(1) > .column > div.q-px-xs > .q-field > .q-field__inner > .q-field__control'
|
||||||
|
).type('23{enter}');
|
||||||
|
cy.get('#subToolbar > .q-btn').click();
|
||||||
|
cy.checkNotification('CSV downloaded successfully');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,47 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('InvoiceOut summary', () => {
|
||||||
|
const transferInvoice = {
|
||||||
|
Client: { val: 'employee', type: 'select' },
|
||||||
|
Type: { val: 'Error in customer data', type: 'select' },
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/invoice-out/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should generate the invoice PDF', () => {
|
||||||
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(6)').click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.checkNotification('The invoice PDF document has been regenerated');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should refund the invoice ', () => {
|
||||||
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
||||||
|
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||||
|
cy.checkNotification('The following refund ticket have been created 1000000');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should delete an invoice ', () => {
|
||||||
|
cy.typeSearchbar('T2222222{enter}');
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.checkNotification('InvoiceOut deleted');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should transfer the invoice ', () => {
|
||||||
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
||||||
|
cy.fillInForm(transferInvoice);
|
||||||
|
cy.get('.q-mt-lg > .q-btn').click();
|
||||||
|
cy.checkNotification('Transferred invoice');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,28 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('InvoiceOut global invoicing', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('administrative');
|
||||||
|
cy.visit(`/#/invoice-out/global-invoicing`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should invoice the client tickets', () => {
|
||||||
|
cy.get('.q-mb-sm > .q-radio__inner').click();
|
||||||
|
cy.dataCy('InvoiceOutGlobalClientSelect').type('1102');
|
||||||
|
cy.get('.q-menu .q-item').contains('1102').click();
|
||||||
|
cy.dataCy('InvoiceOutGlobalSerialSelect').click();
|
||||||
|
cy.get('.q-menu .q-item').contains('global').click();
|
||||||
|
cy.dataCy('InvoiceOutGlobalCompanySelect').type('VNL');
|
||||||
|
cy.get('.q-menu .q-item').contains('VNL').click();
|
||||||
|
cy.dataCy('InvoiceOutGlobalPrinterSelect').type('printer1');
|
||||||
|
cy.get('.q-menu .q-item').contains('printer1').click();
|
||||||
|
cy.get(
|
||||||
|
'[label="Invoice date"] > .q-field > .q-field__inner > .q-field__control'
|
||||||
|
).click();
|
||||||
|
cy.get(':nth-child(5) > div > .q-btn > .q-btn__content > .block').click();
|
||||||
|
cy.get('.q-date__years-content > :nth-child(2) > .q-btn').click();
|
||||||
|
cy.get('.q-date__calendar-days > :nth-child(6) > .q-btn').click();
|
||||||
|
cy.get('[label="Max date ticket"]').type('01-01-2001{enter}');
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,25 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item shelving', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/list`);
|
||||||
|
cy.typeSearchbar('1{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if the barcode exists', () => {
|
||||||
|
cy.get('[href="#/item/1/barcode"]').click();
|
||||||
|
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.dataCy('Code_input').eq(3).type('1111111111');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Codes can not be repeated');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new barcode', () => {
|
||||||
|
cy.get('[href="#/item/1/barcode"]').click();
|
||||||
|
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
cy.dataCy('Code_input').eq(3).type('1231231231');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item botanical', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/botanical`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should modify the botanical', () => {
|
||||||
|
cy.dataCy('AddGenusSelectDialog').type('Abies');
|
||||||
|
cy.get('.q-menu .q-item').contains('Abies').click();
|
||||||
|
cy.dataCy('AddSpeciesSelectDialog').type('dealbata');
|
||||||
|
cy.get('.q-menu .q-item').contains('dealbata').click();
|
||||||
|
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new Genus', () => {
|
||||||
|
cy.dataCy('Genus_icon').click();
|
||||||
|
cy.dataCy('Latin genus name_input').type('Test');
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new specie', () => {
|
||||||
|
cy.dataCy('Species_icon').click();
|
||||||
|
cy.dataCy('Latin species name_input').type('Test specie');
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,34 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
describe('Item list', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter the items and redirect to the summary', () => {
|
||||||
|
cy.dataCy('Category_select').type('Plant');
|
||||||
|
cy.get('.q-menu .q-item').contains('Plant').click();
|
||||||
|
cy.dataCy('Type_select').type('Anthurium');
|
||||||
|
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||||||
|
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create an item', () => {
|
||||||
|
const data = {
|
||||||
|
Description: { val: `Test item` },
|
||||||
|
Type: { val: `Crisantemo`, type: 'select' },
|
||||||
|
Intrastat: { val: `Coral y materiales similares`, type: 'select' },
|
||||||
|
Origin: { val: `SPA`, type: 'select' },
|
||||||
|
};
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.get(
|
||||||
|
':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
|
||||||
|
).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,24 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item summary', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/summary`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should clone the item', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(2) > .q-item__section').click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.waitForElement('[data-cy="itemTags"]');
|
||||||
|
cy.dataCy('itemTags').should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should regularize stock', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(1) > .q-item__section').click();
|
||||||
|
cy.dataCy('regularizeStockInput').type('10');
|
||||||
|
cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,39 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item tag', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/tags`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error adding an existent tag', () => {
|
||||||
|
cy.get('.q-page').should('be.visible');
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
||||||
|
cy.get('.q-menu .q-item').contains('Tallos').click();
|
||||||
|
cy.get(
|
||||||
|
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
|
||||||
|
).type('1');
|
||||||
|
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add a new tag', () => {
|
||||||
|
cy.get('.q-page').should('be.visible');
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
cy.dataCy('Tag_select').eq(7).click();
|
||||||
|
cy.get('.q-menu .q-item').contains('Ancho de la base').click();
|
||||||
|
cy.get(
|
||||||
|
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
|
||||||
|
).type('50');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="itemTags"] > :nth-child(7) > .justify-center > .q-icon'
|
||||||
|
).click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,14 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item tax', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/1/tax`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should modify the tax for Spain', () => {
|
||||||
|
cy.dataCy('Class_select').eq(1).type('General VAT{enter}');
|
||||||
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,40 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Item type', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/item/item-type`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error if the code already exists', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
|
||||||
|
).type('ALS');
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
|
||||||
|
).type('Alstroemeria');
|
||||||
|
cy.dataCy('Worker_select').type('employeeNick');
|
||||||
|
cy.get('.q-menu .q-item').contains('employeeNick').click();
|
||||||
|
cy.dataCy('ItemCategory_select').type('Artificial');
|
||||||
|
cy.get('.q-menu .q-item').contains('Artificial').click();
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('An item type with the same code already exists');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new type', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
|
||||||
|
).type('LIL');
|
||||||
|
cy.get(
|
||||||
|
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
|
||||||
|
).type('Lilium');
|
||||||
|
cy.dataCy('Worker_select').type('buyerNick');
|
||||||
|
cy.get('.q-menu .q-item').contains('buyerNick').click();
|
||||||
|
cy.dataCy('ItemCategory_select').type('Flower');
|
||||||
|
cy.get('.q-menu .q-item').contains('Flower').click();
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
});
|
||||||
|
});
|
|
@ -9,9 +9,9 @@ describe('TicketList', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchResults = (search) => {
|
const searchResults = (search) => {
|
||||||
cy.dataCy('vnSearchBar').find('input').focus();
|
cy.dataCy('vn-searchbar').find('input').focus();
|
||||||
if (search) cy.dataCy('vnSearchBar').find('input').type(search);
|
if (search) cy.dataCy('vn-searchbar').find('input').type(search);
|
||||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
cy.dataCy('vn-searchbar').find('input').type('{enter}');
|
||||||
cy.dataCy('ticketListTable').should('exist');
|
cy.dataCy('ticketListTable').should('exist');
|
||||||
cy.get(firstRow).should('exist');
|
cy.get(firstRow).should('exist');
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,17 +16,20 @@ describe('VnSearchBar', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stay on the list page if there are several results or none', () => {
|
it('should stay on the list page if there are several results or none', () => {
|
||||||
cy.writeSearchbar('salesA{enter}');
|
cy.typeSearchbar('salesA{enter}');
|
||||||
|
cy.typeSearchbar('salesA{enter}');
|
||||||
checkTableLength(2);
|
checkTableLength(2);
|
||||||
|
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
cy.writeSearchbar('0{enter}');
|
|
||||||
|
cy.typeSearchbar('0{enter}');
|
||||||
checkTableLength(0);
|
checkTableLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchAndCheck = (searchTerm, expectedText) => {
|
const searchAndCheck = (searchTerm, expectedText) => {
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
cy.writeSearchbar(`${searchTerm}{enter}`);
|
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||||
|
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||||
cy.get(idGap).should('have.text', expectedText);
|
cy.get(idGap).should('have.text', expectedText);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
describe('WorkerCreate', () => {
|
describe('WorkerCreate', () => {
|
||||||
const externalRadio = '.q-radio:nth-child(2)';
|
const externalRadio = '.q-radio:nth-child(2)';
|
||||||
const notification = '.q-notification__message';
|
|
||||||
const developerBossId = 120;
|
const developerBossId = 120;
|
||||||
const payMethodCross =
|
const payMethodCross =
|
||||||
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
|
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
|
||||||
|
@ -41,7 +40,7 @@ describe('WorkerCreate', () => {
|
||||||
cy.fillInForm(internal);
|
cy.fillInForm(internal);
|
||||||
cy.get(payMethodCross).click();
|
cy.get(payMethodCross).click();
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.get(notification).should('contains.text', 'Payment method is required');
|
cy.checkNotification('Payment method is required');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an internal', () => {
|
it('should create an internal', () => {
|
||||||
|
@ -50,13 +49,13 @@ describe('WorkerCreate', () => {
|
||||||
'Pay method': { val: 'PayMethod one', type: 'select' },
|
'Pay method': { val: 'PayMethod one', type: 'select' },
|
||||||
});
|
});
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.get(notification).should('contains.text', 'Data created');
|
cy.checkNotification('Data created');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an external', () => {
|
it('should create an external', () => {
|
||||||
cy.get(externalRadio).click();
|
cy.get(externalRadio).click();
|
||||||
cy.fillInForm(external);
|
cy.fillInForm(external);
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.get(notification).should('contains.text', 'Data created');
|
cy.checkNotification('Data created');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
describe('ZoneBasicData', () => {
|
describe('ZoneBasicData', () => {
|
||||||
const notification = '.q-notification__message';
|
|
||||||
const priceBasicData = '[data-cy="Price_input"]';
|
const priceBasicData = '[data-cy="Price_input"]';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -11,13 +10,13 @@ describe('ZoneBasicData', () => {
|
||||||
it('should throw an error if the name is empty', () => {
|
it('should throw an error if the name is empty', () => {
|
||||||
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
|
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
|
||||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', "can't be blank");
|
cy.checkNotification("can't be blank");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if the price is empty', () => {
|
it('should throw an error if the price is empty', () => {
|
||||||
cy.get(priceBasicData).clear();
|
cy.get(priceBasicData).clear();
|
||||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', 'cannot be blank');
|
cy.checkNotification('cannot be blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should edit the basicData's zone", () => {
|
it("should edit the basicData's zone", () => {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
describe('ZoneCreate', () => {
|
describe('ZoneCreate', () => {
|
||||||
const notification = '.q-notification__message';
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
Name: { val: 'Zone pickup D' },
|
Name: { val: 'Zone pickup D' },
|
||||||
Price: { val: '3' },
|
Price: { val: '3' },
|
||||||
|
@ -24,7 +22,7 @@ describe('ZoneCreate', () => {
|
||||||
cy.get('input[aria-label="Close"]').type('10:00');
|
cy.get('input[aria-label="Close"]').type('10:00');
|
||||||
cy.get('body').click();
|
cy.get('body').click();
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', 'Agency cannot be blank');
|
cy.checkNotification('Agency cannot be blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a zone', () => {
|
it('should create a zone', () => {
|
||||||
|
@ -35,6 +33,6 @@ describe('ZoneCreate', () => {
|
||||||
cy.get('input[aria-label="Close"]').type('10:00');
|
cy.get('input[aria-label="Close"]').type('10:00');
|
||||||
cy.get('body').click();
|
cy.get('body').click();
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(notification).should('contains.text', 'Data created');
|
cy.checkNotification('Data created');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -124,7 +124,7 @@ Cypress.Commands.add('countSelectOptions', (selector, option) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
||||||
cy.waitForElement('.q-form > .q-card');
|
cy.waitForElement(form);
|
||||||
cy.get(`${form} input`).each(([el]) => {
|
cy.get(`${form} input`).each(([el]) => {
|
||||||
cy.wrap(el)
|
cy.wrap(el)
|
||||||
.invoke('attr', 'aria-label')
|
.invoke('attr', 'aria-label')
|
||||||
|
@ -274,15 +274,11 @@ Cypress.Commands.add('openLeftMenu', (element) => {
|
||||||
|
|
||||||
Cypress.Commands.add('clearSearchbar', (element) => {
|
Cypress.Commands.add('clearSearchbar', (element) => {
|
||||||
if (element) cy.waitForElement(element);
|
if (element) cy.waitForElement(element);
|
||||||
cy.get(
|
cy.get('[data-cy="vn-searchbar"]').clear();
|
||||||
'#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input'
|
|
||||||
).clear();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('writeSearchbar', (value) => {
|
Cypress.Commands.add('typeSearchbar', (value) => {
|
||||||
cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(
|
cy.get('[data-cy="vn-searchbar"]').type(value);
|
||||||
value
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||||
|
|
Loading…
Reference in New Issue