6321_negative_tickets #1371
|
@ -2,26 +2,9 @@
|
|||
defineProps({ row: { type: Object, required: true } });
|
||||
</script>
|
||||
<template>
|
||||
<span>
|
||||
<span class="q-gutter-x-xs">
|
||||
<QIcon
|
||||
v-if="row.isTaxDataChecked === 0"
|
||||
name="vn:no036"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.hasTicketRequest" name="vn:buyrequest" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.itemShortage" name="vn:unavailable" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.risk"
|
||||
v-if="row?.risk"
|
||||
name="vn:risk"
|
||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||
size="xs"
|
||||
|
@ -30,10 +13,57 @@ defineProps({ row: { type: Object, required: true } });
|
|||
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.hasComponentLack" name="vn:components" color="primary" size="xs">
|
||||
<QIcon
|
||||
v-if="row?.hasComponentLack"
|
||||
name="vn:components"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
||||
<QIcon v-if="row?.hasItemDelay" color="primary" size="xs" name="vn:hasItemDelay">
|
||||
<QTooltip>
|
||||
{{ $t('ticket.summary.hasItemDelay') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.hasItemLost" color="primary" size="xs" name="vn:hasItemLost">
|
||||
<QTooltip>
|
||||
{{ $t('salesTicketsTable.hasItemLost') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasItemShortage"
|
||||
name="vn:unavailable"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.hasRounding" color="primary" name="sync_problem" size="xs">
|
||||
<QTooltip>
|
||||
{{ $t('ticketList.rounding') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasTicketRequest"
|
||||
name="vn:buyrequest"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!row?.isTaxDataChecked === 0"
|
||||
name="vn:no036"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||
</QIcon>
|
||||
</span>
|
||||
|
|
|
@ -17,7 +17,7 @@ import { useSession } from 'src/composables/useSession';
|
|||
const route = useRoute();
|
||||
const quasar = useQuasar();
|
||||
const { t } = useI18n();
|
||||
const rows = ref();
|
||||
const rows = ref([]);
|
||||
const dmsRef = ref();
|
||||
const formDialog = ref({});
|
||||
const token = useSession().getTokenMultimedia();
|
||||
|
@ -389,6 +389,14 @@ defineExpose({
|
|||
</div>
|
||||
</template>
|
||||
</QTable>
|
||||
<div
|
||||
v-else
|
||||
class="info-row q-pa-md text-center"
|
||||
>
|
||||
<h5>
|
||||
{{ t('No data to display') }}
|
||||
</h5>
|
||||
</div>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
<QDialog v-model="formDialog.show">
|
||||
|
|
|
@ -1,51 +1,78 @@
|
|||
import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
vi,
|
||||
beforeAll,
|
||||
afterEach,
|
||||
beforeEach,
|
||||
afterAll,
|
||||
} from 'vitest';
|
||||
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||
import vnDate from 'src/boot/vnDate';
|
||||
|
||||
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: [] });
|
||||
|
||||
let patchMock;
|
||||
let expectedInsertBody;
|
||||
let expectedUpdateBody;
|
||||
const defaultOptions = {
|
||||
url: '/test',
|
||||
body: { name: 'Tony', lastName: 'Stark' },
|
||||
selectType: false,
|
||||
saveUrl: null,
|
||||
justInput: false,
|
||||
};
|
||||
function generateWrapper(
|
||||
options = defaultOptions,
|
||||
text = null,
|
||||
observationType = null,
|
||||
) {
|
||||
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||
wrapper = createWrapper(VnNotes, {
|
||||
propsData: {
|
||||
url: '/test',
|
||||
body: { name: 'Tony', lastName: 'Stark' },
|
||||
}
|
||||
propsData: options,
|
||||
});
|
||||
wrapper = wrapper.wrapper;
|
||||
vm = wrapper.vm;
|
||||
});
|
||||
vm.newNote.text = text;
|
||||
vm.newNote.observationTypeFk = observationType;
|
||||
}
|
||||
|
||||
function createSpyFetch() {
|
||||
spyFetch = vi.spyOn(vm.$refs.vnPaginateRef, 'fetch');
|
||||
}
|
||||
|
||||
function generateExpectedBody() {
|
||||
expectedInsertBody = {
|
||||
...vm.$props.body,
|
||||
...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk },
|
||||
};
|
||||
expectedUpdateBody = { ...vm.$props.body, ...{ notes: vm.newNote.text } };
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
|
||||
spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
|
||||
postMock = vi.spyOn(axios, 'post');
|
||||
patchMock = vi.spyOn(axios, 'patch');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
expectedBody = {};
|
||||
expectedInsertBody = {};
|
||||
expectedUpdateBody = {};
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('insert', () => {
|
||||
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
|
||||
await setTestParams( null, null, true );
|
||||
it('should not call axios.post and vnPaginateRef.fetch when newNote.text is null', async () => {
|
||||
generateWrapper({ selectType: true });
|
||||
createSpyFetch();
|
||||
|
||||
await vm.insert();
|
||||
|
||||
|
@ -53,8 +80,9 @@ describe('VnNotes', () => {
|
|||
expect(spyFetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
|
||||
await setTestParams( "", null, false );
|
||||
it('should not call axios.post and vnPaginateRef.fetch when newNote.text is empty', async () => {
|
||||
generateWrapper(null, '');
|
||||
createSpyFetch();
|
||||
|
||||
await vm.insert();
|
||||
|
||||
|
@ -62,8 +90,9 @@ describe('VnNotes', () => {
|
|||
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 );
|
||||
it('should not call axios.post and vnPaginateRef.fetch when observationTypeFk is null and selectType is true', async () => {
|
||||
generateWrapper({ selectType: true }, 'Test Note');
|
||||
createSpyFetch();
|
||||
|
||||
await vm.insert();
|
||||
|
||||
|
@ -71,37 +100,57 @@ describe('VnNotes', () => {
|
|||
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 );
|
||||
|
||||
it('should call axios.post and vnPaginateRef.fetch when observationTypeFk is missing and selectType is false', async () => {
|
||||
generateWrapper(null, 'Test Note');
|
||||
createSpyFetch();
|
||||
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(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
|
||||
expect(spyFetch).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
|
||||
await setTestParams( "Test Note", 1, true );
|
||||
|
||||
generateWrapper({ selectType: true }, 'Test Note', 1);
|
||||
createSpyFetch();
|
||||
generateExpectedBody();
|
||||
|
||||
|
||||
await vm.insert();
|
||||
|
||||
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
|
||||
expect(spyFetch).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('update', () => {
|
||||
it('should call axios.patch with saveUrl when saveUrl is set and justInput is true', async () => {
|
||||
generateWrapper({
|
||||
url: '/business',
|
||||
justInput: true,
|
||||
saveUrl: '/saveUrlTest',
|
||||
});
|
||||
generateExpectedBody();
|
||||
|
||||
await vm.update();
|
||||
|
||||
expect(patchMock).toHaveBeenCalledWith(vm.$props.saveUrl, expectedUpdateBody);
|
||||
});
|
||||
|
||||
it('should call axios.patch with url when saveUrl is not set and justInput is true', async () => {
|
||||
generateWrapper({
|
||||
url: '/business',
|
||||
body: { workerFk: 1110 },
|
||||
justInput: true,
|
||||
});
|
||||
generateExpectedBody();
|
||||
|
||||
await vm.update();
|
||||
|
||||
expect(patchMock).toHaveBeenCalledWith(
|
||||
`${vm.$props.url}/${vm.$props.body.workerFk}`,
|
||||
expectedUpdateBody,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,6 +15,10 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
userFilter: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
entityId: {
|
||||
type: [Number, String],
|
||||
default: null,
|
||||
|
@ -34,6 +38,7 @@ const isSummary = ref();
|
|||
const arrayData = useArrayData(props.dataKey, {
|
||||
url: props.url,
|
||||
filter: props.filter,
|
||||
userFilter: props.userFilter,
|
||||
skip: 0,
|
||||
});
|
||||
const { store } = arrayData;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, useAttrs, computed } from 'vue';
|
||||
import { onBeforeRouteLeave } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -16,12 +16,22 @@ import VnSelect from 'components/common/VnSelect.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import VnInput from 'components/common/VnInput.vue';
|
||||
|
||||
const emit = defineEmits(['onFetch']);
|
||||
|
||||
const $attrs = useAttrs();
|
||||
|
||||
const isRequired = computed(() => {
|
||||
return Object.keys($attrs).includes('required')
|
||||
});
|
||||
|
||||
const $props = defineProps({
|
||||
url: { type: String, default: null },
|
||||
saveUrl: {type: String, default: null},
|
||||
filter: { type: Object, default: () => {} },
|
||||
body: { type: Object, default: () => {} },
|
||||
addNote: { type: Boolean, default: false },
|
||||
selectType: { type: Boolean, default: false },
|
||||
justInput: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -29,6 +39,13 @@ const quasar = useQuasar();
|
|||
const newNote = reactive({ text: null, observationTypeFk: null });
|
||||
const observationTypes = ref([]);
|
||||
const vnPaginateRef = ref();
|
||||
let originalText;
|
||||
|
||||
function handleClick(e) {
|
||||
if (e.shiftKey && e.key === 'Enter') return;
|
||||
if ($props.justInput) confirmAndUpdate();
|
||||
else insert();
|
||||
}
|
||||
|
||||
async function insert() {
|
||||
if (!newNote.text || ($props.selectType && !newNote.observationTypeFk)) return;
|
||||
|
@ -41,8 +58,36 @@ async function insert() {
|
|||
await axios.post($props.url, newBody);
|
||||
await vnPaginateRef.value.fetch();
|
||||
}
|
||||
|
||||
function confirmAndUpdate() {
|
||||
if(!newNote.text && originalText)
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('New note is empty'),
|
||||
message: t('Are you sure remove this note?'),
|
||||
},
|
||||
})
|
||||
.onOk(update)
|
||||
.onCancel(() => {
|
||||
newNote.text = originalText;
|
||||
});
|
||||
else update();
|
||||
}
|
||||
|
||||
async function update() {
|
||||
originalText = newNote.text;
|
||||
const body = $props.body;
|
||||
const newBody = {
|
||||
...body,
|
||||
...{ notes: newNote.text },
|
||||
};
|
||||
await axios.patch(`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, newBody);
|
||||
}
|
||||
|
||||
onBeforeRouteLeave((to, from, next) => {
|
||||
if (newNote.text)
|
||||
if ((newNote.text && !$props.justInput) || (newNote.text !== originalText) && $props.justInput)
|
||||
quasar.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
|
@ -53,6 +98,13 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
});
|
||||
else next();
|
||||
});
|
||||
|
||||
function fetchData([ data ]) {
|
||||
newNote.text = data?.notes;
|
||||
originalText = data?.notes;
|
||||
emit('onFetch', data);
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -62,8 +114,19 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
auto-load
|
||||
@on-fetch="(data) => (observationTypes = data)"
|
||||
/>
|
||||
<QCard class="q-pa-xs q-mb-lg full-width" v-if="$props.addNote">
|
||||
<QCardSection horizontal>
|
||||
<FetchData
|
||||
v-if="justInput"
|
||||
:url="url"
|
||||
:filter="filter"
|
||||
@on-fetch="fetchData"
|
||||
auto-load
|
||||
/>
|
||||
<QCard
|
||||
class="q-pa-xs q-mb-lg full-width"
|
||||
:class="{ 'just-input': $props.justInput }"
|
||||
v-if="$props.addNote || $props.justInput"
|
||||
>
|
||||
<QCardSection horizontal v-if="!$props.justInput">
|
||||
{{ t('New note') }}
|
||||
</QCardSection>
|
||||
<QCardSection class="q-px-xs q-my-none q-py-none">
|
||||
|
@ -75,19 +138,19 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
v-model="newNote.observationTypeFk"
|
||||
option-label="description"
|
||||
style="flex: 0.15"
|
||||
:required="true"
|
||||
:required="isRequired"
|
||||
@keyup.enter.stop="insert"
|
||||
/>
|
||||
<VnInput
|
||||
v-model.trim="newNote.text"
|
||||
type="textarea"
|
||||
:label="t('Add note here...')"
|
||||
:label="$props.justInput && newNote.text ? '' : t('Add note here...')"
|
||||
filled
|
||||
size="lg"
|
||||
autogrow
|
||||
@keyup.enter.stop="insert"
|
||||
@keyup.enter.stop="handleClick"
|
||||
:required="isRequired"
|
||||
clearable
|
||||
:required="true"
|
||||
>
|
||||
<template #append>
|
||||
<QBtn
|
||||
|
@ -95,7 +158,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
icon="save"
|
||||
color="primary"
|
||||
flat
|
||||
@click="insert"
|
||||
@click="handleClick"
|
||||
class="q-mb-xs"
|
||||
dense
|
||||
data-cy="saveNote"
|
||||
|
@ -106,6 +169,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
</QCardSection>
|
||||
</QCard>
|
||||
<VnPaginate
|
||||
v-if="!$props.justInput"
|
||||
:data-key="$props.url"
|
||||
:url="$props.url"
|
||||
order="created DESC"
|
||||
|
@ -198,6 +262,11 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.just-input {
|
||||
padding-right: 18px;
|
||||
margin-bottom: 2px;
|
||||
box-shadow: none;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
es:
|
||||
|
@ -205,4 +274,6 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
New note: Nueva nota
|
||||
Save (Enter): Guardar (Intro)
|
||||
Observation type: Tipo de observación
|
||||
New note is empty: La nueva nota esta vacia
|
||||
Are you sure remove this note?: Estas seguro de quitar esta nota?
|
||||
</i18n>
|
||||
|
|
|
@ -19,23 +19,26 @@ onMounted(() => {
|
|||
const observer = new MutationObserver(
|
||||
() =>
|
||||
(hasContent.value =
|
||||
actions.value?.childNodes?.length + data.value?.childNodes?.length)
|
||||
actions.value?.childNodes?.length + data.value?.childNodes?.length),
|
||||
);
|
||||
if (actions.value) observer.observe(actions.value, opts);
|
||||
if (data.value) observer.observe(data.value, opts);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => stateStore.toggleSubToolbar());
|
||||
const actionsChildCount = () => !!actions.value?.childNodes?.length;
|
||||
|
||||
onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<QToolbar
|
||||
id="subToolbar"
|
||||
class="justify-end sticky"
|
||||
v-show="hasContent || $slots['st-actions'] || $slots['st-data']"
|
||||
class="justify-end sticky"
|
||||
>
|
||||
<slot name="st-data">
|
||||
<div id="st-data"></div>
|
||||
<div id="st-data" :class="{ 'full-width': !actionsChildCount() }">
|
||||
</div>
|
||||
</slot>
|
||||
<QSpace />
|
||||
<slot name="st-actions">
|
||||
|
|
|
@ -93,6 +93,9 @@ export function useArrayData(key, userOptions) {
|
|||
|
||||
if (params.filter.where || exprFilter)
|
||||
params.filter.where = { ...params.filter.where, ...exprFilter };
|
||||
|
||||
if (!params?.filter?.order?.length) delete params?.filter?.order;
|
||||
|
||||
params.filter = JSON.stringify(params.filter);
|
||||
|
||||
store.isLoading = true;
|
||||
|
|
|
@ -23,5 +23,6 @@ const noteFilter = computed(() => {
|
|||
:body="{ clientFk: route.params.id }"
|
||||
style="overflow-y: auto"
|
||||
:select-type="true"
|
||||
required
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -293,7 +293,7 @@ const columns = computed(() => [
|
|||
title: t('globals.preview'),
|
||||
icon: 'preview',
|
||||
color: 'primary',
|
||||
action: (row) => viewSummary(row.id, TicketSummary),
|
||||
action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'),
|
||||
isPrimary: true,
|
||||
attrs: {
|
||||
flat: true,
|
||||
|
|
|
@ -38,6 +38,7 @@ salesTicketsTable:
|
|||
payMethod: Pay method
|
||||
department: Department
|
||||
packing: ITP
|
||||
hasItemLost: Item lost
|
||||
searchBar:
|
||||
label: Search tickets
|
||||
info: Search tickets by id or alias
|
||||
|
|
|
@ -39,6 +39,7 @@ salesTicketsTable:
|
|||
payMethod: Método de pago
|
||||
department: Departamento
|
||||
packing: ITP
|
||||
hasItemLost: Artículo perdido
|
||||
searchBar:
|
||||
label: Buscar tickets
|
||||
info: Buscar tickets por identificador o alias
|
||||
|
|
|
@ -9,6 +9,8 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
|||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import { toDateTimeFormat } from 'src/filters/date';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -28,6 +30,7 @@ const { t } = useI18n();
|
|||
const entityId = computed(() => {
|
||||
return $props.id || route.params.id;
|
||||
});
|
||||
const problems = ref({});
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
|
@ -113,6 +116,11 @@ const setData = (entity) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
:url="`Tickets/${entityId}/getTicketProblems`"
|
||||
auto-load
|
||||
@on-fetch="(data) => ([problems] = data)"
|
||||
/>
|
||||
<CardDescriptor
|
||||
module="Ticket"
|
||||
:url="`Tickets/${entityId}`"
|
||||
|
@ -167,48 +175,9 @@ const setData = (entity) => {
|
|||
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
|
||||
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
|
||||
</template>
|
||||
<template #icons="{ entity }">
|
||||
<QCardActions class="q-gutter-x-md">
|
||||
<QIcon
|
||||
v-if="entity.client.isActive == false"
|
||||
name="vn:disabled"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Client inactive') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.client.isFreezed == true"
|
||||
name="vn:frozen"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity?.problem?.includes('hasRisk')"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Client has debt') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.client.isTaxDataChecked == false"
|
||||
name="vn:no036"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Client not checked') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.isDeleted == true"
|
||||
name="vn:deletedTicket"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('This ticket is deleted') }}</QTooltip>
|
||||
</QIcon>
|
||||
<template #icons>
|
||||
<QCardActions class="q-gutter-x-xs">
|
||||
<TicketProblems :row="problems" />
|
||||
</QCardActions>
|
||||
</template>
|
||||
<template #actions="{ entity }">
|
||||
|
|
|
@ -24,6 +24,7 @@ import axios from 'axios';
|
|||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -680,53 +681,7 @@ watch(
|
|||
:disabled-attr="isTicketEditable"
|
||||
>
|
||||
<template #column-statusIcons="{ row }">
|
||||
<router-link
|
||||
v-if="row.claim?.claimFk"
|
||||
:to="{ name: 'ClaimBasicData', params: { id: row.claim?.claimFk } }"
|
||||
>
|
||||
<QIcon color="primary" name="vn:claims" size="xs">
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.claim') }}:
|
||||
{{ row.claim?.claimFk }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</router-link>
|
||||
<QIcon v-if="row.visible < 0" color="primary" name="warning" size="xs">
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.reserved"
|
||||
color="primary"
|
||||
name="vn:reserva"
|
||||
size="xs"
|
||||
data-cy="ticketSaleReservedIcon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.reserved') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.itemShortage"
|
||||
color="primary"
|
||||
name="vn:unavailable"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.noVisible') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.hasComponentLack"
|
||||
color="primary"
|
||||
name="vn:components"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.hasComponentLack') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<TicketProblems :row="row" />
|
||||
</template>
|
||||
<template #body-cell-picture="{ row }">
|
||||
<QTd>
|
||||
|
|
|
@ -20,6 +20,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { notify } = useNotify();
|
||||
|
@ -243,7 +244,7 @@ onMounted(async () => {
|
|||
<QCard class="vn-one" v-if="entity.notes.length">
|
||||
<VnTitle
|
||||
:url="toTicketUrl('observation')"
|
||||
:text="t('ticket.pageTitles.notes')"
|
||||
:text="t('globals.pageTitles.notes')"
|
||||
/>
|
||||
<QVirtualScroll
|
||||
:items="entity.notes"
|
||||
|
@ -311,83 +312,7 @@ onMounted(async () => {
|
|||
<template #body="props">
|
||||
<QTr :props="props">
|
||||
<QTd class="q-gutter-x-xs">
|
||||
<QBtn
|
||||
flat
|
||||
round
|
||||
icon="vn:claims"
|
||||
v-if="props.row.claim"
|
||||
color="primary"
|
||||
:to="{
|
||||
name: 'ClaimCard',
|
||||
params: {
|
||||
id: props.row.claim.claimFk,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticket.summary.claim') }}:
|
||||
{{ props.row.claim.claimFk }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
flat
|
||||
round
|
||||
icon="vn:claims"
|
||||
v-if="props.row.claimBeginning"
|
||||
color="primary"
|
||||
:to="{
|
||||
name: 'ClaimCard',
|
||||
params: {
|
||||
id: props.row.claimBeginning.claimFk,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticket.summary.claim') }}:
|
||||
{{ props.row.claimBeginning.claimFk }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
<QIcon
|
||||
name="warning"
|
||||
v-show="props.row.visible < 0"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('globals.visible') }}:
|
||||
{{ props.row.visible }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
name="vn:reserved"
|
||||
v-show="props.row.reserved"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticket.summary.reserved') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
name="vn:unavailable"
|
||||
v-show="props.row.itemShortage"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticket.summary.itemShortage') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
name="vn:components"
|
||||
v-show="props.row.hasComponentLack"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticket.summary.hasComponentLack') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<TicketProblems :row="props.row" />
|
||||
</QTd>
|
||||
<QTd>
|
||||
<QBtn class="link" flat>
|
||||
|
|
|
@ -283,3 +283,9 @@ negative:
|
|||
toLines: Go to lines
|
||||
addressNickname: Address nickname
|
||||
ref: Reference
|
||||
rounding: Rounding
|
||||
noVerifiedData: No verified data
|
||||
purchaseRequest: Purchase request
|
||||
notVisible: Not visible
|
||||
clientFrozen: Client frozen
|
||||
componentLack: Component lack
|
||||
|
|
|
@ -215,6 +215,7 @@ ticketList:
|
|||
toLines: Ir a lineas
|
||||
addressNickname: Alias consignatario
|
||||
ref: Referencia
|
||||
<<<<<<< HEAD
|
||||
negative:
|
||||
hour: 'Hora'
|
||||
id: 'Id Articulo'
|
||||
|
@ -290,3 +291,11 @@ negative:
|
|||
newTicket: Ticket nuevo
|
||||
status: Estado
|
||||
message: Mensaje
|
||||
=======
|
||||
rounding: Redondeo
|
||||
noVerifiedData: Sin datos comprobados
|
||||
purchaseRequest: Petición de compra
|
||||
notVisible: No visible
|
||||
clientFrozen: Cliente congelado
|
||||
componentLack: Faltan componentes
|
||||
>>>>>>> a338dbed70ac0386f410ac76c5a8ff64228f3251
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<script setup>
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { nextTick, ref, watch, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useAcl } from 'src/composables/useAcl';
|
||||
|
||||
import WorkerCalendarFilter from 'pages/Worker/Card/WorkerCalendarFilter.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
@ -9,10 +10,17 @@ import WorkerCalendarItem from 'pages/Worker/Card/WorkerCalendarItem.vue';
|
|||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||
import { useStateStore } from 'src/stores/useStateStore';
|
||||
const stateStore = useStateStore();
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const acl = useAcl();
|
||||
const canSeeNotes = computed(() =>
|
||||
acl.hasAny([{ model: 'Worker', props: '__get__business', accessType: 'READ' }]),
|
||||
);
|
||||
const workerIsFreelance = ref();
|
||||
const WorkerFreelanceRef = ref();
|
||||
const workerCalendarFilterRef = ref(null);
|
||||
|
@ -26,6 +34,10 @@ const contractHolidays = ref(null);
|
|||
const yearHolidays = ref(null);
|
||||
const eventsMap = ref({});
|
||||
const festiveEventsMap = ref({});
|
||||
const saveUrl = ref();
|
||||
const body = {
|
||||
workerFk: route.params.id,
|
||||
};
|
||||
|
||||
const onFetchActiveContract = (data) => {
|
||||
if (!data) return;
|
||||
|
@ -67,7 +79,7 @@ const onFetchAbsences = (data) => {
|
|||
name: holidayName,
|
||||
isFestive: true,
|
||||
},
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -146,7 +158,7 @@ watch(
|
|||
async () => {
|
||||
await nextTick();
|
||||
await activeContractRef.value.fetch();
|
||||
}
|
||||
},
|
||||
);
|
||||
watch([year, businessFk], () => refreshData());
|
||||
</script>
|
||||
|
@ -181,6 +193,20 @@ watch([year, businessFk], () => refreshData());
|
|||
/>
|
||||
</template>
|
||||
</RightMenu>
|
||||
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown() && canSeeNotes">
|
||||
<VnNotes
|
||||
:just-input="true"
|
||||
:url="`Workers/${route.params.id}/business`"
|
||||
:filter="{ fields: ['id', 'notes', 'workerFk'] }"
|
||||
:save-url="saveUrl"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
saveUrl = `Businesses/${data.id}`;
|
||||
}
|
||||
"
|
||||
:body="body"
|
||||
/>
|
||||
</Teleport>
|
||||
<QPage class="column items-center">
|
||||
<QCard v-if="workerIsFreelance">
|
||||
<QCardSection class="text-center">
|
||||
|
|
|
@ -180,8 +180,6 @@ const yearList = ref(generateYears());
|
|||
:is-clearable="false"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('Contract')"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
@ -19,6 +19,7 @@ const trainsData = ref([]);
|
|||
const machinesData = ref([]);
|
||||
const route = useRoute();
|
||||
const routeId = computed(() => route.params.id);
|
||||
const selected = ref([]);
|
||||
|
||||
const initialData = computed(() => {
|
||||
return {
|
||||
|
@ -41,6 +42,21 @@ async function insert() {
|
|||
await axios.post('Operators', initialData.value);
|
||||
crudModelRef.value.reload();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => crudModelRef.value?.formData,
|
||||
(formData) => {
|
||||
if (formData && formData.length) {
|
||||
if (JSON.stringify(selected.value) !== JSON.stringify(formData)) {
|
||||
selected.value = formData;
|
||||
}
|
||||
} else if (selected.value.length > 0) {
|
||||
selected.value = [];
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -67,6 +83,7 @@ async function insert() {
|
|||
:data-required="{ workerFk: route.params.id }"
|
||||
ref="crudModelRef"
|
||||
search-url="operator"
|
||||
:selected="selected"
|
||||
auto-load
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
|
|
|
@ -12,7 +12,6 @@ import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy
|
|||
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
|
||||
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
|
||||
import axios from 'axios';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -28,76 +27,6 @@ const entityId = computed(() => $props.id || route.params.id);
|
|||
const basicDataUrl = ref(null);
|
||||
const advancedSummary = ref();
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'nickname', 'roleFk'],
|
||||
|
||||
include: [
|
||||
{
|
||||
relation: 'role',
|
||||
scope: {
|
||||
fields: ['name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'emailUser',
|
||||
scope: {
|
||||
fields: ['email'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'department',
|
||||
scope: {
|
||||
include: {
|
||||
relation: 'department',
|
||||
scope: {
|
||||
fields: ['name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'boss',
|
||||
},
|
||||
{
|
||||
relation: 'client',
|
||||
},
|
||||
{
|
||||
relation: 'sip',
|
||||
},
|
||||
{
|
||||
relation: 'business',
|
||||
scope: {
|
||||
include: [
|
||||
{
|
||||
relation: 'department',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'reasonEnd',
|
||||
scope: {
|
||||
fields: ['id', 'reason'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'workerBusinessProfessionalCategory',
|
||||
scope: {
|
||||
fields: ['id', 'description'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
onBeforeMount(async () => {
|
||||
advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
|
||||
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
|
||||
|
@ -107,8 +36,8 @@ onBeforeMount(async () => {
|
|||
<template>
|
||||
<CardSummary
|
||||
ref="summary"
|
||||
:url="`Workers/summary`"
|
||||
:user-filter="{ where: { id: entityId }, filter }"
|
||||
url="Workers/summary"
|
||||
:user-filter="{ where: { id: entityId } }"
|
||||
data-key="Worker"
|
||||
>
|
||||
<template #header="{ entity }">
|
||||
|
|
|
@ -11,7 +11,7 @@ describe('EntryMy when is supplier', () => {
|
|||
|
||||
it('should open buyLabel when is supplier', () => {
|
||||
cy.get(
|
||||
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||
'[to="/null/3"] > .q-card > :nth-child(2) > .q-btn > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
cy.dataCy('printLabelsBtn').click();
|
||||
cy.window().its('open').should('be.called');
|
||||
|
|
|
@ -53,4 +53,29 @@ describe('TicketList', () => {
|
|||
cy.checkNotification('Data created');
|
||||
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
||||
});
|
||||
|
||||
it('should show the corerct problems', () => {
|
||||
cy.intercept('GET', '**/api/Tickets/filter*', (req) => {
|
||||
req.headers['cache-control'] = 'no-cache';
|
||||
req.headers['pragma'] = 'no-cache';
|
||||
req.headers['expires'] = '0';
|
||||
|
||||
req.on('response', (res) => {
|
||||
delete res.headers['if-none-match'];
|
||||
delete res.headers['if-modified-since'];
|
||||
});
|
||||
}).as('ticket');
|
||||
|
||||
cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
|
||||
cy.get('.q-menu .q-item').contains('Warehouse Five').click();
|
||||
cy.wait('@ticket').then((interception) => {
|
||||
const data = interception.response.body[1];
|
||||
expect(data.hasComponentLack).to.equal(1);
|
||||
expect(data.isTooLittle).to.equal(1);
|
||||
expect(data.hasItemShortage).to.equal(1);
|
||||
});
|
||||
cy.get('.icon-components').should('exist');
|
||||
cy.get('.icon-unavailable').should('exist');
|
||||
cy.get('.icon-isTooLittle').should('exist');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('VnSearchBar', () => {
|
||||
const employeeId = ' #1';
|
||||
const salesPersonId = ' #18';
|
||||
const idGap = '.q-item > .q-item__label';
|
||||
const vnTableRow = '.q-virtual-scroll__content';
|
||||
beforeEach(() => {
|
||||
|
@ -12,11 +11,10 @@ describe('VnSearchBar', () => {
|
|||
|
||||
it('should redirect to account summary page', () => {
|
||||
searchAndCheck('1', employeeId);
|
||||
searchAndCheck('salesPerson', salesPersonId);
|
||||
searchAndCheck('employee', employeeId);
|
||||
});
|
||||
|
||||
it('should stay on the list page if there are several results or none', () => {
|
||||
cy.typeSearchbar('salesA{enter}');
|
||||
cy.typeSearchbar('salesA{enter}');
|
||||
checkTableLength(2);
|
||||
|
||||
|
@ -29,7 +27,6 @@ describe('VnSearchBar', () => {
|
|||
const searchAndCheck = (searchTerm, expectedText) => {
|
||||
cy.clearSearchbar();
|
||||
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||
cy.get(idGap).should('have.text', expectedText);
|
||||
};
|
||||
|
||||
|
|
|
@ -8,16 +8,16 @@ describe('WagonCreate', () => {
|
|||
it('should create and delete a new wagon', () => {
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
cy.get(
|
||||
'.grid-create > [label="Label"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Label_input"]'
|
||||
'.grid-create > [label="Label"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Label_input"]',
|
||||
).type('1234');
|
||||
cy.get(
|
||||
'.grid-create > [label="Plate"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Plate_input"]'
|
||||
'.grid-create > [label="Plate"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Plate_input"]',
|
||||
).type('1234ABCD');
|
||||
cy.get(
|
||||
'.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]'
|
||||
'.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]',
|
||||
).type('100');
|
||||
cy.dataCy('Type_select').type('{downarrow}{enter}');
|
||||
// // Delete wagon type created
|
||||
cy.get('[to="/null/1"] > .q-card > .column > [title="Remove"]').click();
|
||||
|
||||
cy.get('[title="Remove"] > .q-btn__content > .q-icon').click();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -6,14 +6,10 @@ describe('WagonTypeCreate', () => {
|
|||
cy.waitForElement('.q-page', 6000);
|
||||
});
|
||||
|
||||
it('should create a new wagon type', () => {
|
||||
it('should create a new wagon type and then delete it', () => {
|
||||
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||
cy.get('input').first().type('Example for testing');
|
||||
cy.get('button[type="submit"]').click();
|
||||
});
|
||||
it('delete a wagon type', () => {
|
||||
cy.get(
|
||||
'[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue