Merge branch 'dev' into 8074-AddLoaderInPaginate
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
commit
209e6b53e8
38
CHANGELOG.md
38
CHANGELOG.md
|
@ -1,3 +1,41 @@
|
||||||
|
# Version 25.08 - 2025-03-04
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- feat: add order for table (origin/8681_ticketAdvance_updates) by:Javier Segarra
|
||||||
|
- feat: detect when is descriptor proxy by:Javier Segarra
|
||||||
|
- feat: refs #7356 update CrudModel by:Javier Segarra
|
||||||
|
- feat: refs #8242 remove teleport by:Javier Segarra
|
||||||
|
- feat: refs #8242 use stateStore by:Javier Segarra
|
||||||
|
- fix: fixed negative bases style by:Jon
|
||||||
|
- fix: fixed style when clicking on icons by:Jon
|
||||||
|
- refactor: refs #6897 remove debug logs and unused style (origin/6897-fixSomeCaus) by:pablone
|
||||||
|
- style: refs #7356 eslint format by:Javier Segarra
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: refs #7356 minor changes (origin/7356_ticketService) by:Javier Segarra
|
||||||
|
- refactor: refs #6897 remove debug logs and unused style (origin/6897-fixSomeCaus) by:pablone
|
||||||
|
- refactor: refs #6897 update component props and attributes for consistency and improved functionality (origin/6897-fixMinorIssues) by:pablone
|
||||||
|
- refactor: refs #6897 update component props and improve UI handling in Entry pages by:pablone
|
||||||
|
- refactor: refs #6897 update VnTable components for improved value handling and UI adjustments (origin/6897-minorFixes) by:pablone
|
||||||
|
- refactor: refs #8697 simplify date handling in ItemDiary component by:pablone
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- fix: add datakey by:Javier Segarra
|
||||||
|
- fix: fixed account descriptor menu and created e2e by:Jon
|
||||||
|
- fix: fixed negative bases style by:Jon
|
||||||
|
- fix: fixed style when clicking on icons by:Jon
|
||||||
|
- fix: refs #6553 workerBusiness (origin/6553-fixWorkerBusinessV2) by:carlossa
|
||||||
|
- fix: refs #6553 workerBusiness v3 by:carlossa
|
||||||
|
- fix: refs #6897 prevent default event behavior in autocompleteExpense function by:pablone
|
||||||
|
- fix: refs #7356 chaining params by:Javier Segarra
|
||||||
|
- fix: refs #7356 ticketService by:Javier Segarra
|
||||||
|
- fix: refs #8242 workerDepartmentTree bug (origin/8242_leftMenu_responsive) by:Javier Segarra
|
||||||
|
- fix: workerBasicData by:carlossa
|
||||||
|
- Revert "revert 1015acefb7e400be2d8b5958dba69b4d98276b34" (origin/fix_revert_revert, fix_revert_revert) by:alexm
|
||||||
|
|
||||||
# Version 25.06 - 2025-02-18
|
# Version 25.06 - 2025-02-18
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -26,6 +26,7 @@ node {
|
||||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
|
echo "CHANGE_TARGET: ${env.CHANGE_TARGET}"
|
||||||
|
|
||||||
configFileProvider([
|
configFileProvider([
|
||||||
configFile(fileId: 'salix-front.properties',
|
configFile(fileId: 'salix-front.properties',
|
||||||
|
@ -107,7 +108,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('E2E') {
|
stage('E2E') {
|
||||||
environment {
|
environment {
|
||||||
CREDENTIALS = credentials('docker-registry')
|
|
||||||
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
|
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
|
||||||
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
|
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
|
||||||
}
|
}
|
||||||
|
@ -115,8 +115,10 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
sh 'rm junit/e2e-*.xml || true'
|
sh 'rm junit/e2e-*.xml || true'
|
||||||
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
|
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
|
||||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
withDockerRegistry([credentialsId: 'docker-registry', url: "https://${env.REGISTRY}" ]) {
|
||||||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||||
|
}
|
||||||
|
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
|
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
|
||||||
sh 'cypress run --browser chromium || true'
|
sh 'cypress run --browser chromium || true'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.10.0",
|
"version": "25.12.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -124,7 +124,7 @@ const selectTravel = ({ id }) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
|
|
@ -12,20 +12,31 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
>
|
>
|
||||||
<QIcon name="vn:claims" size="xs">
|
<QIcon name="vn:claims" size="xs">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketSale.claim') }}:
|
{{ $t('ticketSale.claim') }}:
|
||||||
{{ row.claim?.claimFk }}
|
{{ row.claim?.claimFk }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</router-link>
|
</router-link>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row?.risk"
|
v-if="row?.reserved"
|
||||||
|
color="primary"
|
||||||
|
name="vn:reserva"
|
||||||
|
size="xs"
|
||||||
|
data-cy="ticketSaleReservedIcon"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketSale.reserved') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row?.hasRisk"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ $t('salesTicketsTable.risk') }}:
|
{{ $t('salesTicketsTable.risk') }}:
|
||||||
{{ toCurrency(row.risk - row.credit) }}
|
{{ toCurrency(row.risk - (row.credit ?? 0)) }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
@ -67,12 +78,7 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
>
|
>
|
||||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon v-if="row?.isTaxDataChecked" name="vn:no036" color="primary" size="xs">
|
||||||
v-if="row?.isTaxDataChecked !== 0"
|
|
||||||
name="vn:no036"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||||
|
|
|
@ -55,6 +55,10 @@ const $props = defineProps({
|
||||||
type: [Function, Boolean],
|
type: [Function, Boolean],
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
rowCtrlClick: {
|
||||||
|
type: [Function, Boolean],
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
redirect: {
|
redirect: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref, watch } from 'vue';
|
import { nextTick, ref } from 'vue';
|
||||||
import { QInput } from 'quasar';
|
import VnInput from './VnInput.vue';
|
||||||
|
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
insertable: {
|
insertable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
@ -14,70 +11,25 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
||||||
|
const model = defineModel({ prop: 'modelValue' });
|
||||||
|
const inputRef = ref(false);
|
||||||
|
|
||||||
let internalValue = ref($props.modelValue);
|
function setCursorPosition(pos) {
|
||||||
|
const input = inputRef.value.vnInputRef.$el.querySelector('input');
|
||||||
watch(
|
input.focus();
|
||||||
() => $props.modelValue,
|
input.setSelectionRange(pos, pos);
|
||||||
(newVal) => {
|
|
||||||
internalValue.value = newVal;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => internalValue.value,
|
|
||||||
(newVal) => {
|
|
||||||
emit('update:modelValue', newVal);
|
|
||||||
accountShortToStandard();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleKeydown = (e) => {
|
|
||||||
if (e.key === 'Backspace') return;
|
|
||||||
if (e.key === '.') {
|
|
||||||
accountShortToStandard();
|
|
||||||
// TODO: Fix this setTimeout, with nextTick doesn't work
|
|
||||||
setTimeout(() => {
|
|
||||||
setCursorPosition(0, e.target);
|
|
||||||
}, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
|
||||||
handleInsertMode(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function setCursorPosition(pos, el = vnInputRef.value) {
|
|
||||||
el.focus();
|
|
||||||
el.setSelectionRange(pos, pos);
|
|
||||||
}
|
}
|
||||||
const vnInputRef = ref(false);
|
|
||||||
const handleInsertMode = (e) => {
|
async function handleUpdateModel(val) {
|
||||||
e.preventDefault();
|
model.value = val?.at(-1) === '.' ? useAccountShortToStandard(val) : val;
|
||||||
const input = e.target;
|
await nextTick(() => setCursorPosition(0));
|
||||||
const cursorPos = input.selectionStart;
|
|
||||||
const { maxlength } = vnInputRef.value;
|
|
||||||
let currentValue = internalValue.value;
|
|
||||||
if (!currentValue) currentValue = e.key;
|
|
||||||
const newValue = e.key;
|
|
||||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
|
||||||
internalValue.value =
|
|
||||||
currentValue.substring(0, cursorPos) +
|
|
||||||
newValue +
|
|
||||||
currentValue.substring(cursorPos + 1);
|
|
||||||
}
|
|
||||||
nextTick(() => {
|
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
function accountShortToStandard() {
|
|
||||||
internalValue.value = internalValue.value?.replace(
|
|
||||||
'.',
|
|
||||||
'0'.repeat(11 - internalValue.value.length)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
|
<VnInput
|
||||||
|
v-model="model"
|
||||||
|
ref="inputRef"
|
||||||
|
:insertable
|
||||||
|
@update:model-value="handleUpdateModel"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -83,7 +83,7 @@ const mixinRules = [
|
||||||
requiredFieldRule,
|
requiredFieldRule,
|
||||||
...($attrs.rules ?? []),
|
...($attrs.rules ?? []),
|
||||||
(val) => {
|
(val) => {
|
||||||
const { maxlength } = vnInputRef.value;
|
const maxlength = $props.maxlength;
|
||||||
if (maxlength && +val.length > maxlength)
|
if (maxlength && +val.length > maxlength)
|
||||||
return t(`maxLength`, { value: maxlength });
|
return t(`maxLength`, { value: maxlength });
|
||||||
const { min, max } = vnInputRef.value.$attrs;
|
const { min, max } = vnInputRef.value.$attrs;
|
||||||
|
@ -108,7 +108,7 @@ const handleInsertMode = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const input = e.target;
|
const input = e.target;
|
||||||
const cursorPos = input.selectionStart;
|
const cursorPos = input.selectionStart;
|
||||||
const { maxlength } = vnInputRef.value;
|
const maxlength = $props.maxlength;
|
||||||
let currentValue = value.value;
|
let currentValue = value.value;
|
||||||
if (!currentValue) currentValue = e.key;
|
if (!currentValue) currentValue = e.key;
|
||||||
const newValue = e.key;
|
const newValue = e.key;
|
||||||
|
@ -143,7 +143,7 @@ const handleUppercase = () => {
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
:data-cy="$attrs['data-cy'] ?? $attrs.label + '_input'"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$slots.prepend">
|
<template #prepend v-if="$slots.prepend">
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
|
|
|
@ -302,6 +302,8 @@ defineExpose({ opts: myOptions, vnSelectRef });
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
function handleKeyDown(event) {
|
||||||
if (event.key === 'Tab' && !event.shiftKey) {
|
if (event.key === 'Tab' && !event.shiftKey) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
const inputValue = vnSelectRef.value?.inputValue;
|
const inputValue = vnSelectRef.value?.inputValue;
|
||||||
|
|
||||||
if (inputValue) {
|
if (inputValue) {
|
||||||
|
|
|
@ -132,7 +132,8 @@ const card = toRef(props, 'item');
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 192px;
|
||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,20 +18,16 @@ import VnInput from 'components/common/VnInput.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const originalAttrs = useAttrs();
|
const $attrs = useAttrs();
|
||||||
|
|
||||||
const $attrs = computed(() => {
|
|
||||||
const { style, ...rest } = originalAttrs;
|
|
||||||
return rest;
|
|
||||||
});
|
|
||||||
|
|
||||||
const isRequired = computed(() => {
|
const isRequired = computed(() => {
|
||||||
return Object.keys($attrs).includes('required')
|
return Object.keys($attrs).includes('required');
|
||||||
});
|
});
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: { type: String, default: null },
|
url: { type: String, default: null },
|
||||||
saveUrl: {type: String, default: null},
|
saveUrl: { type: String, default: null },
|
||||||
|
userFilter: { type: Object, default: () => {} },
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
body: { type: Object, default: () => {} },
|
body: { type: Object, default: () => {} },
|
||||||
addNote: { type: Boolean, default: false },
|
addNote: { type: Boolean, default: false },
|
||||||
|
@ -65,7 +61,7 @@ async function insert() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmAndUpdate() {
|
function confirmAndUpdate() {
|
||||||
if(!newNote.text && originalText)
|
if (!newNote.text && originalText)
|
||||||
quasar
|
quasar
|
||||||
.dialog({
|
.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
|
@ -88,11 +84,17 @@ async function update() {
|
||||||
...body,
|
...body,
|
||||||
...{ notes: newNote.text },
|
...{ notes: newNote.text },
|
||||||
};
|
};
|
||||||
await axios.patch(`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, newBody);
|
await axios.patch(
|
||||||
|
`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`,
|
||||||
|
newBody,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
if ((newNote.text && !$props.justInput) || (newNote.text !== originalText) && $props.justInput)
|
if (
|
||||||
|
(newNote.text && !$props.justInput) ||
|
||||||
|
(newNote.text !== originalText && $props.justInput)
|
||||||
|
)
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
@ -104,12 +106,11 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
else next();
|
else next();
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchData([ data ]) {
|
function fetchData([data]) {
|
||||||
newNote.text = data?.notes;
|
newNote.text = data?.notes;
|
||||||
originalText = data?.notes;
|
originalText = data?.notes;
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -179,7 +180,8 @@ function fetchData([ data ]) {
|
||||||
:url="$props.url"
|
:url="$props.url"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
:user-filter="$props.filter"
|
:user-filter="userFilter"
|
||||||
|
:filter="filter"
|
||||||
auto-load
|
auto-load
|
||||||
ref="vnPaginateRef"
|
ref="vnPaginateRef"
|
||||||
class="show"
|
class="show"
|
||||||
|
@ -218,7 +220,7 @@ function fetchData([ data ]) {
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
observationTypes.find(
|
observationTypes.find(
|
||||||
(ot) => ot.id === note.observationTypeFk
|
(ot) => ot.id === note.observationTypeFk,
|
||||||
)?.description
|
)?.description
|
||||||
}}
|
}}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
|
|
|
@ -369,6 +369,7 @@ globals:
|
||||||
countryFk: Country
|
countryFk: Country
|
||||||
countryCodeFk: Country
|
countryCodeFk: Country
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
|
nickname: Alias
|
||||||
model: Model
|
model: Model
|
||||||
fuel: Fuel
|
fuel: Fuel
|
||||||
active: Active
|
active: Active
|
||||||
|
|
|
@ -370,6 +370,7 @@ globals:
|
||||||
countryFk: País
|
countryFk: País
|
||||||
countryCodeFk: País
|
countryCodeFk: País
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
|
nickname: Alias
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, useAttrs } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
@ -7,7 +7,6 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const $attrs = useAttrs();
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: { type: [Number, String], default: null },
|
id: { type: [Number, String], default: null },
|
||||||
|
@ -15,9 +14,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
const claimId = computed(() => $props.id || route.params.id);
|
const claimId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
const claimFilter = computed(() => {
|
const claimFilter = {
|
||||||
return {
|
|
||||||
where: { claimFk: claimId.value },
|
|
||||||
fields: ['id', 'created', 'workerFk', 'text'],
|
fields: ['id', 'created', 'workerFk', 'text'],
|
||||||
include: {
|
include: {
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
|
@ -31,8 +28,7 @@ const claimFilter = computed(() => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
claimFk: claimId.value,
|
claimFk: claimId.value,
|
||||||
|
@ -43,7 +39,8 @@ const body = {
|
||||||
<VnNotes
|
<VnNotes
|
||||||
url="claimObservations"
|
url="claimObservations"
|
||||||
:add-note="$props.addNote"
|
:add-note="$props.addNote"
|
||||||
:filter="claimFilter"
|
:user-filter="claimFilter"
|
||||||
|
:filter="{ where: { claimFk: claimId } }"
|
||||||
:body="body"
|
:body="body"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
style="overflow-y: auto"
|
style="overflow-y: auto"
|
||||||
|
|
|
@ -210,6 +210,7 @@ function onDrag() {
|
||||||
class="all-pointer-events absolute delete-button zindex"
|
class="all-pointer-events absolute delete-button zindex"
|
||||||
@click.stop="viewDeleteDms(index)"
|
@click.stop="viewDeleteDms(index)"
|
||||||
round
|
round
|
||||||
|
:data-cy="`delete-button-${index+1}`"
|
||||||
/>
|
/>
|
||||||
<QIcon
|
<QIcon
|
||||||
name="play_circle"
|
name="play_circle"
|
||||||
|
@ -227,6 +228,7 @@ function onDrag() {
|
||||||
class="rounded-borders cursor-pointer fit"
|
class="rounded-borders cursor-pointer fit"
|
||||||
@click="openDialog(media.dmsFk)"
|
@click="openDialog(media.dmsFk)"
|
||||||
v-if="!media.isVideo"
|
v-if="!media.isVideo"
|
||||||
|
:data-cy="`file-${index+1}`"
|
||||||
>
|
>
|
||||||
</QImg>
|
</QImg>
|
||||||
<video
|
<video
|
||||||
|
@ -235,6 +237,7 @@ function onDrag() {
|
||||||
muted="muted"
|
muted="muted"
|
||||||
v-if="media.isVideo"
|
v-if="media.isVideo"
|
||||||
@click="openDialog(media.dmsFk)"
|
@click="openDialog(media.dmsFk)"
|
||||||
|
:data-cy="`file-${index+1}`"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -118,14 +118,6 @@ const debtWarning = computed(() => {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
|
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
|
||||||
v-if="customer?.isFreezed"
|
|
||||||
name="vn:frozen"
|
|
||||||
size="xs"
|
|
||||||
color="primary"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!entity.account?.active"
|
v-if="!entity.account?.active"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -150,6 +142,14 @@ const debtWarning = computed(() => {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="entity?.isFreezed"
|
||||||
|
name="vn:frozen"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="entity.unpaid"
|
v-if="entity.unpaid"
|
||||||
flat
|
flat
|
||||||
|
@ -163,13 +163,13 @@ const debtWarning = computed(() => {
|
||||||
<br />
|
<br />
|
||||||
{{
|
{{
|
||||||
t('unpaidDated', {
|
t('unpaidDated', {
|
||||||
dated: toDate(customer.unpaid?.dated),
|
dated: toDate(entity.unpaid?.dated),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
<br />
|
<br />
|
||||||
{{
|
{{
|
||||||
t('unpaidAmount', {
|
t('unpaidAmount', {
|
||||||
amount: toCurrency(customer.unpaid?.amount),
|
amount: toCurrency(entity.unpaid?.amount),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -1,28 +1,15 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const noteFilter = computed(() => {
|
|
||||||
return {
|
|
||||||
order: 'created DESC',
|
|
||||||
where: {
|
|
||||||
clientFk: `${route.params.id}`,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnNotes
|
<VnNotes
|
||||||
url="clientObservations"
|
url="clientObservations"
|
||||||
:add-note="true"
|
:add-note="true"
|
||||||
:filter="noteFilter"
|
:filter="{ where: { clientFk: $route.params.id } }"
|
||||||
:body="{ clientFk: route.params.id }"
|
:body="{ clientFk: $route.params.id }"
|
||||||
style="overflow-y: auto"
|
style="overflow-y: auto"
|
||||||
:select-type="true"
|
:select-type="true"
|
||||||
required
|
required
|
||||||
|
order="created DESC"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -145,6 +145,7 @@ const entryFilterPanel = ref();
|
||||||
v-model="params.agencyModeId"
|
v-model="params.agencyModeId"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
|
sort-by="name ASC"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -17,6 +17,7 @@ import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
||||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
|
import useOpenURL from 'src/composables/useOpenURL';
|
||||||
|
|
||||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000;
|
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000;
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -321,8 +322,7 @@ const totalPriceColor = (ticket) => {
|
||||||
if (total > 0 && total < 50) return 'warning';
|
if (total > 0 && total < 50) return 'warning';
|
||||||
};
|
};
|
||||||
|
|
||||||
const openTab = (id) =>
|
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
||||||
window.open(`#/ticket/${id}/sale`, '_blank', 'noopener, noreferrer');
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -397,6 +397,7 @@ const openTab = (id) =>
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
auto-load
|
auto-load
|
||||||
:row-click="({ id }) => openTab(id)"
|
:row-click="({ id }) => openTab(id)"
|
||||||
|
:row-ctrl-click="(_, { id }) => openTab(id)"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:user-params="{ from, to, scopeDays: 0 }"
|
:user-params="{ from, to, scopeDays: 0 }"
|
||||||
>
|
>
|
||||||
|
|
|
@ -22,7 +22,7 @@ salesTicketsTable:
|
||||||
notVisible: Not visible
|
notVisible: Not visible
|
||||||
purchaseRequest: Purchase request
|
purchaseRequest: Purchase request
|
||||||
clientFrozen: Client frozen
|
clientFrozen: Client frozen
|
||||||
risk: Risk
|
risk: Excess risk
|
||||||
componentLack: Component lack
|
componentLack: Component lack
|
||||||
tooLittle: Ticket too little
|
tooLittle: Ticket too little
|
||||||
identifier: Identifier
|
identifier: Identifier
|
||||||
|
|
|
@ -22,7 +22,7 @@ salesTicketsTable:
|
||||||
notVisible: No visible
|
notVisible: No visible
|
||||||
purchaseRequest: Petición de compra
|
purchaseRequest: Petición de compra
|
||||||
clientFrozen: Cliente congelado
|
clientFrozen: Cliente congelado
|
||||||
risk: Riesgo
|
risk: Exceso de riesgo
|
||||||
componentLack: Faltan componentes
|
componentLack: Faltan componentes
|
||||||
tooLittle: Ticket demasiado pequeño
|
tooLittle: Ticket demasiado pequeño
|
||||||
identifier: Identificador
|
identifier: Identificador
|
||||||
|
|
|
@ -44,8 +44,7 @@ const exprBuilder = (param, value) => {
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
sort-by="name ASC"
|
|
||||||
@on-fetch="(data) => (agencyList = data)"
|
@on-fetch="(data) => (agencyList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import { computed } from 'vue';
|
||||||
import CardList from 'components/ui/CardList.vue';
|
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
|
import { useI18n } from 'vue-i18n';
|
||||||
import ShelvingSummary from 'pages/Shelving/Card/ShelvingSummary.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
|
||||||
|
import ShelvingSummary from './Card/ShelvingSummary.vue';
|
||||||
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import exprBuilder from './ShelvingExprBuilder.js';
|
import exprBuilder from './ShelvingExprBuilder.js';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const dataKey = 'ShelvingList';
|
const dataKey = 'ShelvingList';
|
||||||
|
@ -17,9 +20,56 @@ const filter = {
|
||||||
include: [{ relation: 'parking' }],
|
include: [{ relation: 'parking' }],
|
||||||
};
|
};
|
||||||
|
|
||||||
function navigate(id) {
|
const columns = computed(() => [
|
||||||
router.push({ path: `/shelving/${id}` });
|
{
|
||||||
}
|
align: 'left',
|
||||||
|
name: 'code',
|
||||||
|
label: t('globals.code'),
|
||||||
|
isId: true,
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: false,
|
||||||
|
create: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'parking',
|
||||||
|
label: t('shelving.list.parking'),
|
||||||
|
sortable: true,
|
||||||
|
format: (val) => val?.code ?? '',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'priority',
|
||||||
|
label: t('shelving.list.priority'),
|
||||||
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'isRecyclable',
|
||||||
|
label: t('shelving.summary.recyclable'),
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
label: '',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('components.smartCard.viewSummary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row.id, ShelvingSummary),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const onDataSaved = ({ id }) => {
|
||||||
|
router.push({ name: 'ShelvingBasicData', params: { id } });
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,48 +87,75 @@ function navigate(id) {
|
||||||
<ShelvingFilter data-key="ShelvingList" />
|
<ShelvingFilter data-key="ShelvingList" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QPage class="column items-center q-pa-md">
|
<VnTable
|
||||||
<div class="vn-card-list">
|
:data-key="dataKey"
|
||||||
<VnPaginate :data-key="dataKey">
|
:columns="columns"
|
||||||
<template #body="{ rows }">
|
is-editable="false"
|
||||||
<CardList
|
:right-search="false"
|
||||||
v-for="row of rows"
|
:use-model="true"
|
||||||
:key="row.id"
|
:disable-option="{ table: true }"
|
||||||
:id="row.id"
|
redirect="shelving"
|
||||||
:title="row.code"
|
default-mode="card"
|
||||||
@click="navigate(row.id)"
|
:create="{
|
||||||
|
urlCreate: 'Shelvings',
|
||||||
|
title: t('globals.pageTitles.shelvingCreate'),
|
||||||
|
onDataSaved,
|
||||||
|
formInitialData: {
|
||||||
|
parkingFk: null,
|
||||||
|
priority: null,
|
||||||
|
code: '',
|
||||||
|
isRecyclable: false,
|
||||||
|
},
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<template #list-items>
|
<template #more-create-dialog="{ data }">
|
||||||
<VnLv
|
<VnSelect
|
||||||
:label="$t('shelving.list.parking')"
|
v-model="data.parkingFk"
|
||||||
:title-label="$t('shelving.list.parking')"
|
url="Parkings"
|
||||||
:value="row.parking?.code"
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
:label="t('shelving.list.parking')"
|
||||||
|
:filter-options="['id', 'code']"
|
||||||
|
:fields="['id', 'code']"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnCheckbox
|
||||||
:label="$t('shelving.list.priority')"
|
v-model="data.isRecyclable"
|
||||||
:value="row?.priority"
|
:label="t('shelving.summary.recyclable')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
</VnTable>
|
||||||
<QBtn
|
|
||||||
:label="$t('components.smartCard.openSummary')"
|
|
||||||
@click.stop="viewSummary(row.id, ShelvingSummary)"
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</CardList>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
|
||||||
<QPageSticky :offset="[20, 20]">
|
|
||||||
<RouterLink :to="{ name: 'ShelvingCreate' }">
|
|
||||||
<QBtn fab icon="add" color="primary" v-shortcut="'+'" />
|
|
||||||
<QTooltip>
|
|
||||||
{{ $t('shelving.list.newShelving') }}
|
|
||||||
</QTooltip>
|
|
||||||
</RouterLink>
|
|
||||||
</QPageSticky>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 55%;
|
||||||
|
}
|
||||||
|
.list-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
shelving:
|
||||||
|
list:
|
||||||
|
parking: Estacionamiento
|
||||||
|
priority: Prioridad
|
||||||
|
|
||||||
|
summary:
|
||||||
|
recyclable: Reciclable
|
||||||
|
en:
|
||||||
|
shelving:
|
||||||
|
list:
|
||||||
|
parking: Parking
|
||||||
|
priority: Priority
|
||||||
|
|
||||||
|
summary:
|
||||||
|
recyclable: Recyclable
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -11,6 +11,11 @@ export default {
|
||||||
'isSerious',
|
'isSerious',
|
||||||
'isTrucker',
|
'isTrucker',
|
||||||
'account',
|
'account',
|
||||||
|
'workerFk',
|
||||||
|
'note',
|
||||||
|
'isReal',
|
||||||
|
'isPayMethodChecked',
|
||||||
|
'companySize',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,6 @@ function handleLocation(data, location) {
|
||||||
<VnAccountNumber
|
<VnAccountNumber
|
||||||
v-model="data.account"
|
v-model="data.account"
|
||||||
:label="t('supplier.fiscalData.account')"
|
:label="t('supplier.fiscalData.account')"
|
||||||
clearable
|
|
||||||
data-cy="supplierFiscalDataAccount"
|
data-cy="supplierFiscalDataAccount"
|
||||||
insertable
|
insertable
|
||||||
:maxlength="10"
|
:maxlength="10"
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import SupplierSummary from './Card/SupplierSummary.vue';
|
import SupplierSummary from './Card/SupplierSummary.vue';
|
||||||
|
@ -53,7 +52,7 @@ const columns = computed(() => [
|
||||||
label: t('globals.alias'),
|
label: t('globals.alias'),
|
||||||
name: 'alias',
|
name: 'alias',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'search',
|
name: 'nickname',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
@ -120,6 +119,21 @@ const columns = computed(() => [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const filterColumns = computed(() => {
|
||||||
|
const copy = [...columns.value];
|
||||||
|
copy.splice(copy.length - 1, 0, {
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.params.provinceFk'),
|
||||||
|
name: 'provinceFk',
|
||||||
|
options: provincesOptions.value,
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -130,7 +144,7 @@ const columns = computed(() => [
|
||||||
/>
|
/>
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
:columns="filterColumns"
|
||||||
prefix="supplier"
|
prefix="supplier"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Suppliers/filter',
|
url: 'Suppliers/filter',
|
||||||
|
@ -165,17 +179,6 @@ const columns = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
<template #moreFilterPanel="{ params, searchFn }">
|
|
||||||
<VnSelect
|
|
||||||
:label="t('globals.params.provinceFk')"
|
|
||||||
v-model="params.provinceFk"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
:options="provincesOptions"
|
|
||||||
filled
|
|
||||||
dense
|
|
||||||
class="q-px-sm q-pr-lg"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnSection>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,9 @@ function ticketFilter(ticket) {
|
||||||
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
|
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
|
||||||
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
|
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
|
||||||
</template>
|
</template>
|
||||||
<template #icons>
|
<template #icons="{ entity }">
|
||||||
<QCardActions class="q-gutter-x-xs">
|
<QCardActions class="q-gutter-x-xs">
|
||||||
<TicketProblems :row="problems" />
|
<TicketProblems :row="{ ...entity?.client, ...problems }" />
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
|
|
|
@ -37,7 +37,6 @@ const expeditionStateTypes = ref([]);
|
||||||
|
|
||||||
const expeditionsFilter = computed(() => ({
|
const expeditionsFilter = computed(() => ({
|
||||||
where: { ticketFk: route.params.id },
|
where: { ticketFk: route.params.id },
|
||||||
order: ['created DESC'],
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const ticketArrayData = useArrayData('Ticket');
|
const ticketArrayData = useArrayData('Ticket');
|
||||||
|
@ -325,6 +324,7 @@ onMounted(async () => {
|
||||||
"
|
"
|
||||||
:redirect="false"
|
:redirect="false"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
|
:filter="expeditionsFilter"
|
||||||
>
|
>
|
||||||
<template #column-freightItemName="{ row }">
|
<template #column-freightItemName="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
|
|
@ -681,6 +681,17 @@ watch(
|
||||||
:disabled-attr="isTicketEditable"
|
:disabled-attr="isTicketEditable"
|
||||||
>
|
>
|
||||||
<template #column-statusIcons="{ row }">
|
<template #column-statusIcons="{ row }">
|
||||||
|
<QIcon
|
||||||
|
v-if="row.saleGroupFk"
|
||||||
|
name="inventory_2"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
class="cursor-pointer"
|
||||||
|
>
|
||||||
|
<QTooltip class="no-pointer-events">
|
||||||
|
{{ `saleGroup: ${row.saleGroupFk}` }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
<TicketProblems :row="row" />
|
<TicketProblems :row="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-picture="{ row }">
|
<template #body-cell-picture="{ row }">
|
||||||
|
|
|
@ -48,7 +48,7 @@ const getGroupedStates = (data) => {
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
:sort-by="['name ASC']"
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
@on-fetch="(data) => (agencies = data)"
|
@on-fetch="(data) => (agencies = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -256,8 +256,6 @@ const getGroupedStates = (data) => {
|
||||||
v-model="params.agencyModeFk"
|
v-model="params.agencyModeFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="agencies"
|
:options="agencies"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
|
|
@ -73,6 +73,7 @@ warehouses();
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -39,6 +39,7 @@ const redirectToTravelBasicData = (_, { id }) => {
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -52,9 +52,8 @@ defineExpose({ states });
|
||||||
v-model="params.agencyModeFk"
|
v-model="params.agencyModeFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="agencyModes"
|
url="agencyModes"
|
||||||
|
sort-by="name ASC"
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
option-filter="name"
|
option-filter="name"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
@ -5,9 +5,9 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const filter = {
|
const userFilter = {
|
||||||
order: 'created DESC',
|
order: 'created DESC',
|
||||||
where: { workerFk: route.params.id },
|
|
||||||
include: {
|
include: {
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
scope: {
|
scope: {
|
||||||
|
@ -22,11 +22,15 @@ const filter = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const body = {
|
const body = { workerFk: route.params.id };
|
||||||
workerFk: route.params.id,
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnNotes :add-note="true" url="WorkerObservations" :filter="filter" :body="body" />
|
<VnNotes
|
||||||
|
:add-note="true"
|
||||||
|
url="WorkerObservations"
|
||||||
|
:user-filter="userFilter"
|
||||||
|
:filter="{ where: { workerFk: $route.params.id } }"
|
||||||
|
:body="body"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -343,19 +343,29 @@ const updateData = async () => {
|
||||||
|
|
||||||
const getMailStates = async (date) => {
|
const getMailStates = async (date) => {
|
||||||
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
|
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
|
||||||
|
const year = date.getFullYear();
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const prevMonth = month == 1 ? 12 : month - 1;
|
|
||||||
const params = {
|
const getMonthStates = async (month, year) => {
|
||||||
month,
|
return (await axios.get(url, { params: { month, year } })).data;
|
||||||
year: date.getFullYear(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const curMonthStates = (await axios.get(url, { params })).data;
|
const curMonthStates = await getMonthStates(month, year);
|
||||||
const prevMonthStates = (
|
|
||||||
await axios.get(url, { params: { ...params, month: prevMonth } })
|
|
||||||
).data;
|
|
||||||
|
|
||||||
workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
|
const prevMonthStates = await getMonthStates(
|
||||||
|
month === 1 ? 12 : month - 1,
|
||||||
|
month === 1 ? year - 1 : year,
|
||||||
|
);
|
||||||
|
|
||||||
|
const postMonthStates = await getMonthStates(
|
||||||
|
month === 12 ? 1 : month + 1,
|
||||||
|
month === 12 ? year + 1 : year,
|
||||||
|
);
|
||||||
|
workerTimeControlMails.value = [
|
||||||
|
...curMonthStates,
|
||||||
|
...prevMonthStates,
|
||||||
|
...postMonthStates,
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
const showWorkerTimeForm = (propValue, formType) => {
|
const showWorkerTimeForm = (propValue, formType) => {
|
||||||
|
|
|
@ -9,22 +9,22 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const validAddresses = ref([]);
|
|
||||||
const addresses = ref([]);
|
const addresses = ref([]);
|
||||||
|
|
||||||
const setFilteredAddresses = (data) => {
|
const setFilteredAddresses = (data) => {
|
||||||
const validIds = new Set(validAddresses.value.map((item) => item.addressFk));
|
addresses.value = data.map(({ address }) => address);
|
||||||
addresses.value = data.filter((address) => validIds.has(address.id));
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="RoadmapAddresses"
|
url="RoadmapAddresses"
|
||||||
|
:filter="{
|
||||||
|
include: { relation: 'address' },
|
||||||
|
}"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (validAddresses = data)"
|
@on-fetch="setFilteredAddresses"
|
||||||
/>
|
/>
|
||||||
<FetchData url="Addresses" auto-load @on-fetch="setFilteredAddresses" />
|
|
||||||
<FormModel auto-load model="Zone">
|
<FormModel auto-load model="Zone">
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -125,7 +125,6 @@ const setFilteredAddresses = (data) => {
|
||||||
map-options
|
map-options
|
||||||
:rules="validate('data.addressFk')"
|
:rules="validate('data.addressFk')"
|
||||||
:filter-options="['id']"
|
:filter-options="['id']"
|
||||||
:where="filterWhere"
|
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import VnInput from 'components/common/VnInput.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
import order from 'src/router/modules/order';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -24,7 +25,7 @@ const agencies = ref([]);
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
@on-fetch="(data) => (agencies = data)"
|
@on-fetch="(data) => (agencies = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -199,9 +199,8 @@ function formatRow(row) {
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
|
sort-by="name ASC"
|
||||||
v-model="data.agencyModeFk"
|
v-model="data.agencyModeFk"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:label="t('list.agency')"
|
:label="t('list.agency')"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -111,15 +111,6 @@ export default {
|
||||||
shelvingCard,
|
shelvingCard,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'ShelvingCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'shelvingCreate',
|
|
||||||
icon: 'add',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'parking',
|
path: 'parking',
|
||||||
name: 'ParkingMain',
|
name: 'ParkingMain',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
// redmine.verdnatura.es/issues/8417
|
describe('ClaimPhoto', () => {
|
||||||
describe.skip('ClaimPhoto', () => {
|
const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const claimId = 1;
|
const claimId = 1;
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
@ -16,6 +16,7 @@ describe.skip('ClaimPhoto', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add new file with drag and drop', () => {
|
it('should add new file with drag and drop', () => {
|
||||||
|
cy.get('.container').should('be.visible').and('exist');
|
||||||
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
|
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
|
||||||
action: 'drag-drop',
|
action: 'drag-drop',
|
||||||
});
|
});
|
||||||
|
@ -23,33 +24,23 @@ describe.skip('ClaimPhoto', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open first image dialog change to second and close', () => {
|
it('should open first image dialog change to second and close', () => {
|
||||||
cy.get(':nth-last-child(1) > .q-card').click();
|
cy.dataCy('file-1').click();
|
||||||
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
|
cy.get(carrouselClose).click();
|
||||||
'be.visible',
|
|
||||||
);
|
|
||||||
|
|
||||||
cy.get('.q-carousel__control > button').click();
|
cy.dataCy('file-1').click();
|
||||||
|
cy.get('.q-carousel__control > button').as('nextButton').click();
|
||||||
cy.get(
|
cy.get('.q-carousel__slide > .q-ma-none').should('be.visible');
|
||||||
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon',
|
cy.get(carrouselClose).click();
|
||||||
).click();
|
|
||||||
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
|
|
||||||
'not.be.visible',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove third and fourth file', () => {
|
it('should remove third and fourth file', () => {
|
||||||
cy.get(
|
cy.dataCy('delete-button-4').click();
|
||||||
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
|
|
||||||
).click();
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
||||||
).click();
|
).click();
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data deleted');
|
cy.get('.q-notification__message').should('have.text', 'Data deleted');
|
||||||
|
|
||||||
cy.get(
|
cy.dataCy('delete-button-3').click();
|
||||||
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
|
|
||||||
).click();
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
||||||
).click();
|
).click();
|
||||||
|
|
|
@ -17,7 +17,6 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/1/summary`);
|
cy.visit(`/#/invoice-out/1/summary`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('open the descriptors', () => {
|
it('open the descriptors', () => {
|
||||||
cy.get(firstRowDescriptors(1)).click();
|
cy.get(firstRowDescriptors(1)).click();
|
||||||
cy.get('.descriptor').should('be.visible');
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
@ -35,7 +34,6 @@ describe('InvoiceOut summary', () => {
|
||||||
|
|
||||||
it('should open the ticket list', () => {
|
it('should open the ticket list', () => {
|
||||||
cy.get(toTicketList).click();
|
cy.get(toTicketList).click();
|
||||||
cy.get('.descriptor').should('be.visible');
|
|
||||||
cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
|
cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ShelvingList', () => {
|
||||||
|
const parking =
|
||||||
|
'.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/shelving/1/basic-data`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should give an error if the code aldready exists', () => {
|
||||||
|
cy.dataCy('Code_input').should('exist').clear().type('AA7');
|
||||||
|
cy.saveCard();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'The code already exists');
|
||||||
|
});
|
||||||
|
it('should edit the data and save', () => {
|
||||||
|
cy.selectOption(parking, 'P-01-1');
|
||||||
|
cy.dataCy('Code_input').clear().type('AA1');
|
||||||
|
cy.dataCy('Priority_input').clear().type('10');
|
||||||
|
cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click();
|
||||||
|
cy.saveCard();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,41 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ShelvingList', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/shelving/list`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect on clicking a shelving', () => {
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
cy.dataCy('cardBtn').eq(0).click();
|
||||||
|
cy.get('.summaryHeader > .header > .q-icon').click();
|
||||||
|
cy.url().should('include', '/shelving/1/summary');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect from preview to basic-data', () => {
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
cy.dataCy('cardBtn').eq(0).click();
|
||||||
|
cy.get('.q-card > .header').click();
|
||||||
|
cy.url().should('include', '/shelving/1/basic-data');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter and redirect if only one result', () => {
|
||||||
|
cy.selectOption('[data-cy="Parking_select"]', 'P-02-2');
|
||||||
|
cy.dataCy('Parking_select').type('{enter}');
|
||||||
|
cy.url().should('match', /\/shelving\/\d+\/summary/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new shelving', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.dataCy('code-create-popup').type('Test');
|
||||||
|
cy.dataCy('Priority_input').type('10');
|
||||||
|
cy.selectOption(
|
||||||
|
'.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container',
|
||||||
|
'100-01',
|
||||||
|
);
|
||||||
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.url().should('match', /\/shelving\/\d+\/basic-data/);
|
||||||
|
});
|
||||||
|
});
|
|
@ -8,43 +8,8 @@ describe('TicketFilter', () => {
|
||||||
|
|
||||||
it('use search button', function () {
|
it('use search button', function () {
|
||||||
cy.waitForElement('.q-page');
|
cy.waitForElement('.q-page');
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
cy.get('[data-cy="Customer ID_input"]').type('1105');
|
||||||
cy.searchBtnFilterPanel();
|
cy.searchBtnFilterPanel();
|
||||||
cy.waitRequest('@ticketFilter', ({ request }) => {
|
cy.location('href').should('contain', '#/ticket/15/summary');
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.have.property('from');
|
|
||||||
expect(query).to.have.property('to');
|
|
||||||
});
|
|
||||||
cy.on('uncaught:exception', () => {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
cy.get('.q-field__control-container > [data-cy="From_date"]')
|
|
||||||
.type(`${today()} `)
|
|
||||||
.type('{enter}');
|
|
||||||
cy.get('.q-notification').should(
|
|
||||||
'contain',
|
|
||||||
`The date range must have both 'from' and 'to'`,
|
|
||||||
);
|
|
||||||
|
|
||||||
cy.get('.q-field__control-container > [data-cy="To_date"]').type(
|
|
||||||
`${today()}{enter}`,
|
|
||||||
);
|
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
|
||||||
cy.searchBtnFilterPanel();
|
|
||||||
cy.wait('@ticketFilter').then(({ request }) => {
|
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.have.property('from');
|
|
||||||
expect(query).to.have.property('to');
|
|
||||||
});
|
|
||||||
cy.location('href').should('contain', '#/ticket/999999');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function today(date) {
|
|
||||||
// return new Date().toISOString().split('T')[0];
|
|
||||||
|
|
||||||
return new Intl.DateTimeFormat('es-ES', {
|
|
||||||
day: '2-digit',
|
|
||||||
month: '2-digit',
|
|
||||||
year: 'numeric',
|
|
||||||
}).format(date ?? new Date());
|
|
||||||
}
|
|
||||||
|
|
|
@ -11,12 +11,12 @@ describe('TicketList', () => {
|
||||||
const searchResults = (search) => {
|
const searchResults = (search) => {
|
||||||
if (search) cy.typeSearchbar().type(search);
|
if (search) cy.typeSearchbar().type(search);
|
||||||
cy.dataCy('vn-searchbar').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');
|
||||||
};
|
};
|
||||||
|
|
||||||
it('should search results', () => {
|
it('should search results', () => {
|
||||||
cy.dataCy('ticketListTable').should('not.exist');
|
// cy.dataCy('ticketListTable').should('not.exist');
|
||||||
cy.get('.q-field__control').should('exist');
|
cy.get('.q-field__control').should('exist');
|
||||||
searchResults();
|
searchResults();
|
||||||
});
|
});
|
||||||
|
@ -40,21 +40,11 @@ describe('TicketList', () => {
|
||||||
it('filter client and create ticket', () => {
|
it('filter client and create ticket', () => {
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
|
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
|
||||||
searchResults();
|
searchResults();
|
||||||
cy.wait('@ticketSearchbar').then(({ request }) => {
|
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.have.property('from');
|
|
||||||
expect(query).to.have.property('to');
|
|
||||||
expect(query).to.not.have.property('clientFk');
|
|
||||||
});
|
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
||||||
cy.dataCy('Customer ID_input').clear('1');
|
cy.dataCy('Customer ID_input').clear('1');
|
||||||
cy.dataCy('Customer ID_input').type('1101{enter}');
|
cy.dataCy('Customer ID_input').type('1101{enter}');
|
||||||
cy.wait('@ticketFilter').then(({ request }) => {
|
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.not.have.property('from');
|
|
||||||
expect(query).to.not.have.property('to');
|
|
||||||
expect(query).to.have.property('clientFk');
|
|
||||||
});
|
|
||||||
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
|
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
|
||||||
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
|
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
|
||||||
cy.dataCy('Address_select').click();
|
cy.dataCy('Address_select').click();
|
||||||
|
|
|
@ -112,7 +112,6 @@ describe('TicketSale', () => {
|
||||||
cy.dataCy('ticketSaleTransferBtn').click();
|
cy.dataCy('ticketSaleTransferBtn').click();
|
||||||
cy.dataCy('ticketTransferPopup').should('exist');
|
cy.dataCy('ticketTransferPopup').should('exist');
|
||||||
cy.dataCy('ticketTransferNewTicketBtn').click();
|
cy.dataCy('ticketTransferNewTicketBtn').click();
|
||||||
//check the new ticket has been created succesfully
|
|
||||||
cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
|
cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -138,7 +137,7 @@ describe('TicketSale', () => {
|
||||||
it('update price', () => {
|
it('update price', () => {
|
||||||
const price = Number((Math.random() * 99 + 1).toFixed(2));
|
const price = Number((Math.random() * 99 + 1).toFixed(2));
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.get(':nth-child(10) > .q-btn').click();
|
cy.get('[data-col-field="price"]').find('.q-btn').click();
|
||||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||||
cy.waitForElement('[data-cy="Price_input"]');
|
cy.waitForElement('[data-cy="Price_input"]');
|
||||||
|
@ -147,15 +146,14 @@ describe('TicketSale', () => {
|
||||||
cy.dataCy('saveManaBtn').click();
|
cy.dataCy('saveManaBtn').click();
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(10) > .q-btn > .q-btn__content').should(
|
cy.get('[data-col-field="price"]')
|
||||||
'have.text',
|
.find('.q-btn > .q-btn__content')
|
||||||
`€${price}`,
|
.should('have.text', `€${price}`);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('update dicount', () => {
|
it('update discount', () => {
|
||||||
const discount = Math.floor(Math.random() * 100) + 1;
|
const discount = Math.floor(Math.random() * 100) + 1;
|
||||||
selectFirstRow();
|
selectFirstRow();
|
||||||
cy.get(':nth-child(11) > .q-btn').click();
|
cy.get('[data-col-field="discount"]').find('.q-btn').click();
|
||||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||||
cy.waitForElement('[data-cy="Disc_input"]');
|
cy.waitForElement('[data-cy="Disc_input"]');
|
||||||
|
@ -164,26 +162,24 @@ describe('TicketSale', () => {
|
||||||
cy.dataCy('saveManaBtn').click();
|
cy.dataCy('saveManaBtn').click();
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(11) > .q-btn > .q-btn__content').should(
|
cy.get('[data-col-field="discount"]')
|
||||||
'have.text',
|
.find('.q-btn > .q-btn__content')
|
||||||
`${discount}.00%`,
|
.should('have.text', `${discount}.00%`);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('change concept', () => {
|
it('change concept', () => {
|
||||||
const quantity = Math.floor(Math.random() * 100) + 1;
|
const concept = Math.floor(Math.random() * 100) + 1;
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.get(':nth-child(8) > .row').click();
|
cy.get('[data-col-field="item"]').click();
|
||||||
cy.get(
|
cy.get('.q-menu')
|
||||||
'.q-menu > [data-v-ca3f07a4=""] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="undefined_input"]',
|
.find('[data-cy="undefined_input"]')
|
||||||
)
|
.type(concept)
|
||||||
.type(quantity)
|
|
||||||
.type('{enter}');
|
.type('{enter}');
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(8) >.row').should('contain.text', `${quantity}`);
|
cy.get('[data-col-field="item"]').should('contain.text', `${concept}`);
|
||||||
});
|
});
|
||||||
it('changequantity ', () => {
|
it('change quantity ', () => {
|
||||||
const quantity = Math.floor(Math.random() * 100) + 1;
|
const quantity = Math.floor(Math.random() * 100) + 1;
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.dataCy('ticketSaleQuantityInput').clear();
|
cy.dataCy('ticketSaleQuantityInput').clear();
|
||||||
|
@ -200,7 +196,7 @@ describe('TicketSale', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleVnConfirm() {
|
function handleVnConfirm() {
|
||||||
cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
|
cy.get('[data-cy="VnConfirm_confirm"]').click();
|
||||||
cy.waitForElement('.q-notification__message');
|
cy.waitForElement('.q-notification__message');
|
||||||
|
|
||||||
cy.get('.q-notification__message').should('be.visible');
|
cy.get('.q-notification__message').should('be.visible');
|
||||||
|
|
|
@ -1,35 +1,50 @@
|
||||||
describe('VnInput Component', () => {
|
describe('VnAccountNumber', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.visit('/#/supplier/1/fiscal-data');
|
cy.visit('/#/supplier/1/fiscal-data');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('VnInput handleInsertMode()', () => {
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
it('should replace character at cursor position in insert mode', () => {
|
||||||
// Simula escribir en el input
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type(
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
'{selectall}4100000001',
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
);
|
||||||
// Coloca el cursor en la posición 0
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}');
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999');
|
||||||
// Escribe un número y verifica que se reemplace correctamente
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
'have.value',
|
||||||
cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
|
'9990000001',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
it('should replace character at cursor position in insert mode', () => {
|
||||||
// Simula escribir en el input
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('4100000001');
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}');
|
||||||
// Coloca el cursor en la posición 0
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999');
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||||
// Escribe un número y verifica que se reemplace correctamente en la posicion incial
|
'have.value',
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
'9990000001',
|
||||||
cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should respect maxlength prop', () => {
|
it('should respect maxlength prop', () => {
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('123456789012345');
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123456789012345');
|
||||||
cy.dataCy('supplierFiscalDataAccount').should('have.value', '1234567890'); // asumiendo que maxlength es 10
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||||
|
'have.value',
|
||||||
|
'1234567890',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should convert short account number to standard format', () => {
|
||||||
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').clear();
|
||||||
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123.');
|
||||||
|
cy.get('input[data-cy="supplierFiscalDataAccount"]').should(
|
||||||
|
'have.value',
|
||||||
|
'1230000000',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue