Merge branch 'dev' into 8594---createTestE2eVehicleList
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
8d28253548
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
def PROTECTED_BRANCH
|
def PROTECTED_BRANCH
|
||||||
|
def IS_LATEST
|
||||||
|
|
||||||
def BRANCH_ENV = [
|
def BRANCH_ENV = [
|
||||||
test: 'test',
|
test: 'test',
|
||||||
|
@ -10,16 +11,18 @@ def BRANCH_ENV = [
|
||||||
|
|
||||||
node {
|
node {
|
||||||
stage('Setup') {
|
stage('Setup') {
|
||||||
env.FRONT_REPLICAS = 1
|
|
||||||
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||||
|
|
||||||
PROTECTED_BRANCH = [
|
PROTECTED_BRANCH = [
|
||||||
'dev',
|
'dev',
|
||||||
'test',
|
'test',
|
||||||
'master',
|
'master',
|
||||||
|
'main',
|
||||||
'beta'
|
'beta'
|
||||||
].contains(env.BRANCH_NAME)
|
].contains(env.BRANCH_NAME)
|
||||||
|
|
||||||
|
IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME)
|
||||||
|
|
||||||
// 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}"
|
||||||
|
@ -58,6 +61,19 @@ pipeline {
|
||||||
PROJECT_NAME = 'lilium'
|
PROJECT_NAME = 'lilium'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
stage('Version') {
|
||||||
|
when {
|
||||||
|
expression { PROTECTED_BRANCH }
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def packageJson = readJSON file: 'package.json'
|
||||||
|
def version = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
|
writeFile(file: 'VERSION.txt', text: version)
|
||||||
|
echo "VERSION: ${version}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Install') {
|
stage('Install') {
|
||||||
environment {
|
environment {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ""
|
||||||
|
@ -71,17 +87,48 @@ pipeline {
|
||||||
expression { !PROTECTED_BRANCH }
|
expression { !PROTECTED_BRANCH }
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ''
|
||||||
|
CI = 'true'
|
||||||
|
TZ = 'Europe/Madrid'
|
||||||
}
|
}
|
||||||
steps {
|
parallel {
|
||||||
sh 'pnpm run test:unit:ci'
|
stage('Unit') {
|
||||||
}
|
steps {
|
||||||
post {
|
sh 'pnpm run test:unit:ci'
|
||||||
always {
|
}
|
||||||
junit(
|
post {
|
||||||
testResults: 'junitresults.xml',
|
always {
|
||||||
allowEmptyResults: true
|
junit(
|
||||||
)
|
testResults: 'junit/vitest.xml',
|
||||||
|
allowEmptyResults: true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('E2E') {
|
||||||
|
environment {
|
||||||
|
CREDENTIALS = credentials('docker-registry')
|
||||||
|
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
|
||||||
|
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||||
|
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||||
|
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
|
||||||
|
sh 'cypress run --browser chromium'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
|
||||||
|
junit(
|
||||||
|
testResults: 'junit/e2e.xml',
|
||||||
|
allowEmptyResults: true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,25 +138,30 @@ pipeline {
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
CREDENTIALS = credentials('docker-registry')
|
CREDENTIALS = credentials('docker-registry')
|
||||||
|
VERSION = readFile 'VERSION.txt'
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'quasar build'
|
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
sh 'quasar build'
|
||||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
|
||||||
|
def baseImage = "salix-frontend:${env.VERSION}"
|
||||||
|
def image = docker.build(baseImage, ".")
|
||||||
|
docker.withRegistry("https://${env.REGISTRY}", 'docker-registry') {
|
||||||
|
image.push()
|
||||||
|
image.push(env.BRANCH_NAME)
|
||||||
|
if (IS_LATEST) image.push('latest')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dockerBuild()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when {
|
when {
|
||||||
expression { PROTECTED_BRANCH }
|
expression { PROTECTED_BRANCH }
|
||||||
}
|
}
|
||||||
|
environment {
|
||||||
|
VERSION = readFile 'VERSION.txt'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
|
||||||
def packageJson = readJSON file: 'package.json'
|
|
||||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
|
||||||
}
|
|
||||||
withKubeConfig([
|
withKubeConfig([
|
||||||
serverUrl: "$KUBERNETES_API",
|
serverUrl: "$KUBERNETES_API",
|
||||||
credentialsId: 'kubernetes',
|
credentialsId: 'kubernetes',
|
||||||
|
|
|
@ -1,12 +1,37 @@
|
||||||
import { defineConfig } from 'cypress';
|
import { defineConfig } from 'cypress';
|
||||||
// https://docs.cypress.io/app/tooling/reporters
|
|
||||||
// https://docs.cypress.io/app/references/configuration
|
let urlHost, reporter, reporterOptions;
|
||||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
|
||||||
|
if (process.env.CI) {
|
||||||
|
urlHost = 'front';
|
||||||
|
reporter = 'junit';
|
||||||
|
reporterOptions = {
|
||||||
|
mochaFile: 'junit/e2e.xml',
|
||||||
|
toConsole: false,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
urlHost = 'localhost';
|
||||||
|
reporter = 'cypress-mochawesome-reporter';
|
||||||
|
reporterOptions = {
|
||||||
|
charts: true,
|
||||||
|
reportPageTitle: 'Cypress Inline Reporter',
|
||||||
|
reportFilename: '[status]_[datetime]-report',
|
||||||
|
embeddedScreenshots: true,
|
||||||
|
reportDir: 'test/cypress/reports',
|
||||||
|
inlineAssets: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
baseUrl: 'http://localhost:9000/',
|
baseUrl: `http://${urlHost}:9000`,
|
||||||
experimentalStudio: true,
|
experimentalStudio: false,
|
||||||
|
defaultCommandTimeout: 10000,
|
||||||
|
trashAssetsBeforeRuns: false,
|
||||||
|
requestTimeout: 10000,
|
||||||
|
responseTimeout: 30000,
|
||||||
|
pageLoadTimeout: 60000,
|
||||||
|
defaultBrowser: 'chromium',
|
||||||
fixturesFolder: 'test/cypress/fixtures',
|
fixturesFolder: 'test/cypress/fixtures',
|
||||||
screenshotsFolder: 'test/cypress/screenshots',
|
screenshotsFolder: 'test/cypress/screenshots',
|
||||||
supportFile: 'test/cypress/support/index.js',
|
supportFile: 'test/cypress/support/index.js',
|
||||||
|
@ -14,40 +39,19 @@ export default defineConfig({
|
||||||
downloadsFolder: 'test/cypress/downloads',
|
downloadsFolder: 'test/cypress/downloads',
|
||||||
video: false,
|
video: false,
|
||||||
specPattern: 'test/cypress/integration/**/*.spec.js',
|
specPattern: 'test/cypress/integration/**/*.spec.js',
|
||||||
experimentalRunAllSpecs: false,
|
experimentalRunAllSpecs: true,
|
||||||
watchForFileChanges: false,
|
watchForFileChanges: true,
|
||||||
reporter: 'cypress-mochawesome-reporter',
|
reporter,
|
||||||
reporterOptions: {
|
reporterOptions,
|
||||||
charts: true,
|
|
||||||
reportPageTitle: 'Cypress Inline Reporter',
|
|
||||||
reportFilename: '[status]_[datetime]-report',
|
|
||||||
embeddedScreenshots: true,
|
|
||||||
reportDir: 'test/cypress/reports',
|
|
||||||
inlineAssets: true,
|
|
||||||
},
|
|
||||||
component: {
|
component: {
|
||||||
componentFolder: 'src',
|
componentFolder: 'src',
|
||||||
testFiles: '**/*.spec.js',
|
testFiles: '**/*.spec.js',
|
||||||
supportFile: 'test/cypress/support/unit.js',
|
supportFile: 'test/cypress/support/unit.js',
|
||||||
},
|
},
|
||||||
setupNodeEvents: async (on, config) => {
|
|
||||||
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
|
||||||
plugin.default(on);
|
|
||||||
|
|
||||||
const fs = await import('fs');
|
|
||||||
on('task', {
|
|
||||||
deleteFile(filePath) {
|
|
||||||
if (fs.existsSync(filePath)) {
|
|
||||||
fs.unlinkSync(filePath);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
viewportWidth: 1280,
|
viewportWidth: 1280,
|
||||||
viewportHeight: 720,
|
viewportHeight: 720,
|
||||||
},
|
},
|
||||||
|
experimentalMemoryManagement: true,
|
||||||
|
defaultCommandTimeout: 10000,
|
||||||
|
numTestsKeptInMemory: 2,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
version: '3.7'
|
|
||||||
services:
|
|
||||||
main:
|
|
||||||
image: registry.verdnatura.es/salix-frontend:${VERSION:?}
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: ./Dockerfile
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
FROM debian:12.9-slim
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
gnupg2 \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
&& apt-get install -y --no-install-recommends nodejs \
|
||||||
|
&& npm install -g corepack@0.31.0 \
|
||||||
|
&& corepack enable pnpm \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y --no-install-recommends install \
|
||||||
|
apt-utils \
|
||||||
|
chromium \
|
||||||
|
libasound2 \
|
||||||
|
libgbm-dev \
|
||||||
|
libgtk-3-0 \
|
||||||
|
libgtk2.0-0 \
|
||||||
|
libnotify-dev \
|
||||||
|
libnss3 \
|
||||||
|
libxss1 \
|
||||||
|
libxtst6 \
|
||||||
|
xauth \
|
||||||
|
xvfb \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN groupadd -r -g 1000 app \
|
||||||
|
&& useradd -r -u 1000 -g app -m -d /home/app app
|
||||||
|
USER app
|
||||||
|
|
||||||
|
ENV SHELL=bash
|
||||||
|
ENV PNPM_HOME="/home/app/.local/share/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
RUN pnpm setup \
|
||||||
|
&& pnpm install --global cypress@13.6.6 \
|
||||||
|
&& cypress install
|
||||||
|
|
||||||
|
WORKDIR /app
|
|
@ -1,6 +1,6 @@
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
path: '/api',
|
path: '/api',
|
||||||
rule: { target: 'http://0.0.0.0:3000' },
|
rule: { target: 'http://127.0.0.1:3000' },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
import { configure } from 'quasar/wrappers';
|
import { configure } from 'quasar/wrappers';
|
||||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`;
|
||||||
|
|
||||||
export default configure(function (/* ctx */) {
|
export default configure(function (/* ctx */) {
|
||||||
return {
|
return {
|
||||||
|
@ -108,13 +109,17 @@ export default configure(function (/* ctx */) {
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://0.0.0.0:3000',
|
target: target,
|
||||||
logLevel: 'debug',
|
logLevel: 'debug',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
open: false,
|
open: false,
|
||||||
|
allowedHosts: [
|
||||||
|
'front', // Agrega este nombre de host
|
||||||
|
'localhost', // Opcional, para pruebas locales
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||||
|
|
|
@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
||||||
import VnConfirm from './ui/VnConfirm.vue';
|
import VnConfirm from './ui/VnConfirm.vue';
|
||||||
import { tMobile } from 'src/composables/tMobile';
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||||
|
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -284,7 +285,12 @@ function trimData(data) {
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
function onBeforeSave(formData, originalData) {
|
||||||
|
return getUpdatedValues(
|
||||||
|
Object.keys(getDifferences(formData, originalData)),
|
||||||
|
formData,
|
||||||
|
);
|
||||||
|
}
|
||||||
async function onKeyup(evt) {
|
async function onKeyup(evt) {
|
||||||
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
||||||
const input = evt.target;
|
const input = evt.target;
|
||||||
|
@ -321,6 +327,7 @@ defineExpose({
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
id="formModel"
|
id="formModel"
|
||||||
|
:mapper="onBeforeSave"
|
||||||
>
|
>
|
||||||
<QCard>
|
<QCard>
|
||||||
<slot
|
<slot
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, useAttrs, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved', 'onDataCanceled']);
|
const emit = defineEmits(['onDataSaved', 'onDataCanceled']);
|
||||||
|
|
||||||
defineProps({
|
const props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -22,12 +23,21 @@ defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const state = useState();
|
||||||
const formModelRef = ref(null);
|
const formModelRef = ref(null);
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isSaveAndContinue = ref(false);
|
const isSaveAndContinue = ref(props.showSaveAndContinueBtn);
|
||||||
const onDataSaved = (formData, requestResponse) => {
|
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||||
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click();
|
const reset = computed(() => formModelRef.value?.reset);
|
||||||
|
|
||||||
|
const onDataSaved = async (formData, requestResponse) => {
|
||||||
|
if (!isSaveAndContinue.value) closeButton.value?.click();
|
||||||
|
if (isSaveAndContinue.value) {
|
||||||
|
await nextTick();
|
||||||
|
state.set(attrs.model, attrs.formInitialData);
|
||||||
|
}
|
||||||
|
isSaveAndContinue.value = props.showSaveAndContinueBtn;
|
||||||
emit('onDataSaved', formData, requestResponse);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,9 +46,6 @@ const onClick = async (saveAndContinue) => {
|
||||||
await formModelRef.value.save();
|
await formModelRef.value.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
|
||||||
const reset = computed(() => formModelRef.value?.reset);
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
isLoading,
|
isLoading,
|
||||||
onDataSaved,
|
onDataSaved,
|
||||||
|
@ -74,10 +81,7 @@ defineExpose({
|
||||||
data-cy="FormModelPopup_cancel"
|
data-cy="FormModelPopup_cancel"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
z-max
|
z-max
|
||||||
@click="
|
@click="emit('onDataCanceled')"
|
||||||
isSaveAndContinue = false;
|
|
||||||
emit('onDataCanceled');
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:flat="showSaveAndContinueBtn"
|
:flat="showSaveAndContinueBtn"
|
||||||
|
|
|
@ -85,7 +85,15 @@ const refresh = () => window.location.reload();
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
<PinnedModules ref="pinnedModulesRef" />
|
<PinnedModules ref="pinnedModulesRef" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn class="q-pa-none" rounded dense flat no-wrap id="user">
|
<QBtn
|
||||||
|
class="q-pa-none"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
no-wrap
|
||||||
|
id="user"
|
||||||
|
data-cy="userPanel_btn"
|
||||||
|
>
|
||||||
<VnAvatar
|
<VnAvatar
|
||||||
:worker-id="user.id"
|
:worker-id="user.id"
|
||||||
:title="user.name"
|
:title="user.name"
|
||||||
|
|
|
@ -91,7 +91,6 @@ const components = {
|
||||||
event: updateEvent,
|
event: updateEvent,
|
||||||
attrs: {
|
attrs: {
|
||||||
...defaultAttrs,
|
...defaultAttrs,
|
||||||
style: 'min-width: 150px',
|
|
||||||
},
|
},
|
||||||
forceAttrs,
|
forceAttrs,
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,6 +31,7 @@ import VnLv from 'components/ui/VnLv.vue';
|
||||||
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
||||||
import VnTableFilter from './VnTableFilter.vue';
|
import VnTableFilter from './VnTableFilter.vue';
|
||||||
import { getColAlign } from 'src/composables/getColAlign';
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -50,10 +51,6 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
rightSearchIcon: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
rowClick: {
|
rowClick: {
|
||||||
type: [Function, Boolean],
|
type: [Function, Boolean],
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -413,20 +410,13 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect && value) {
|
if (isSelect && value) {
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
await updateSelectValue(value, column, row, oldValue);
|
||||||
row[column?.name + 'TextValue'] =
|
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
|
||||||
await column?.cellEvent?.['update:modelValue']?.(
|
|
||||||
value,
|
|
||||||
oldValue,
|
|
||||||
row,
|
|
||||||
);
|
|
||||||
} else row[column.name] = value;
|
} else row[column.name] = value;
|
||||||
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
},
|
},
|
||||||
keyup: async (event) => {
|
keyup: async (event) => {
|
||||||
if (event.key === 'Enter')
|
if (event.key === 'Enter')
|
||||||
await destroyInput(rowIndex, field, clickedElement);
|
await destroyInput(rowId, field, clickedElement);
|
||||||
},
|
},
|
||||||
keydown: async (event) => {
|
keydown: async (event) => {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -457,6 +447,17 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
node.el?.querySelector('span > div > div').focus();
|
node.el?.querySelector('span > div > div').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function updateSelectValue(value, column, row, oldValue) {
|
||||||
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
|
|
||||||
|
row[column?.name + 'VnTableTextValue'] = value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
|
||||||
|
if (column?.attrs?.find?.label)
|
||||||
|
row[column?.attrs?.find?.label] = value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
|
||||||
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
|
}
|
||||||
|
|
||||||
async function destroyInput(rowIndex, field, clickedElement) {
|
async function destroyInput(rowIndex, field, clickedElement) {
|
||||||
if (!clickedElement)
|
if (!clickedElement)
|
||||||
clickedElement = document.querySelector(
|
clickedElement = document.querySelector(
|
||||||
|
@ -519,9 +520,9 @@ function getToggleIcon(value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatColumnValue(col, row, dashIfEmpty) {
|
function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
if (col?.format) {
|
if (col?.format || row[col?.name + 'VnTableTextValue']) {
|
||||||
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
if (selectRegex.test(col?.component) && row[col?.name + 'VnTableTextValue']) {
|
||||||
return dashIfEmpty(row[col?.name + 'TextValue']);
|
return dashIfEmpty(row[col?.name + 'VnTableTextValue']);
|
||||||
} else {
|
} else {
|
||||||
return col.format(row, dashIfEmpty);
|
return col.format(row, dashIfEmpty);
|
||||||
}
|
}
|
||||||
|
@ -554,19 +555,33 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
}
|
}
|
||||||
return dashIfEmpty(row[col?.name]);
|
return dashIfEmpty(row[col?.name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cardClick(_, row) {
|
function cardClick(_, row) {
|
||||||
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeTextValue(data, getChanges) {
|
||||||
|
let changes = data.updates;
|
||||||
|
if (!changes) return data;
|
||||||
|
|
||||||
|
for (const change of changes) {
|
||||||
|
for (const key in change.data) {
|
||||||
|
if (key.endsWith('VnTableTextValue')) {
|
||||||
|
delete change.data[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
|
||||||
|
|
||||||
|
if ($attrs?.beforeSaveFn) data = $attrs.beforeSaveFn(data, getChanges);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<RightMenu v-if="$props.rightSearch">
|
||||||
v-if="$props.rightSearch"
|
<template #right-panel>
|
||||||
v-model="stateStore.rightDrawer"
|
|
||||||
side="right"
|
|
||||||
:width="256"
|
|
||||||
:overlay="$props.overlay"
|
|
||||||
>
|
|
||||||
<QScrollArea class="fit">
|
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -580,8 +595,8 @@ function cardClick(_, row) {
|
||||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
</template>
|
</template>
|
||||||
</VnTableFilter>
|
</VnTableFilter>
|
||||||
</QScrollArea>
|
</template>
|
||||||
</QDrawer>
|
</RightMenu>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:class="$attrs['class'] ?? 'q-px-md'"
|
:class="$attrs['class'] ?? 'q-px-md'"
|
||||||
|
@ -590,6 +605,7 @@ function cardClick(_, row) {
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:disable-infinite-scroll="isTableMode"
|
:disable-infinite-scroll="isTableMode"
|
||||||
|
:before-save-fn="removeTextValue"
|
||||||
@save-changes="reload"
|
@save-changes="reload"
|
||||||
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
||||||
:auto-load="hasParams || $attrs['auto-load']"
|
:auto-load="hasParams || $attrs['auto-load']"
|
||||||
|
@ -634,6 +650,7 @@ function cardClick(_, row) {
|
||||||
:skip="columnsVisibilitySkipped"
|
:skip="columnsVisibilitySkipped"
|
||||||
/>
|
/>
|
||||||
<QBtnToggle
|
<QBtnToggle
|
||||||
|
v-if="!tableModes.some((mode) => mode.disable)"
|
||||||
v-model="mode"
|
v-model="mode"
|
||||||
toggle-color="primary"
|
toggle-color="primary"
|
||||||
class="bg-vn-section-color"
|
class="bg-vn-section-color"
|
||||||
|
@ -953,14 +970,6 @@ function cardClick(_, row) {
|
||||||
transition-show="scale"
|
transition-show="scale"
|
||||||
transition-hide="scale"
|
transition-hide="scale"
|
||||||
:full-width="createComplement?.isFullWidth ?? false"
|
:full-width="createComplement?.isFullWidth ?? false"
|
||||||
@before-hide="
|
|
||||||
() => {
|
|
||||||
if (createRef.isSaveAndContinue) {
|
|
||||||
showForm = true;
|
|
||||||
createForm.formInitialData = { ...create.formInitialData };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
data-cy="vn-table-create-dialog"
|
data-cy="vn-table-create-dialog"
|
||||||
>
|
>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
|
|
|
@ -76,6 +76,15 @@ onBeforeMount(async () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const routeName = computed(() => {
|
||||||
|
const DESCRIPTOR_PROXY = 'DescriptorProxy';
|
||||||
|
|
||||||
|
let name = $props.dataKey;
|
||||||
|
if ($props.dataKey.includes(DESCRIPTOR_PROXY)) {
|
||||||
|
name = name.split(DESCRIPTOR_PROXY)[0];
|
||||||
|
}
|
||||||
|
return `${name}Summary`;
|
||||||
|
});
|
||||||
async function getData() {
|
async function getData() {
|
||||||
store.url = $props.url;
|
store.url = $props.url;
|
||||||
store.filter = $props.filter ?? {};
|
store.filter = $props.filter ?? {};
|
||||||
|
@ -154,9 +163,7 @@ const toModule = computed(() =>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<RouterLink
|
<RouterLink :to="{ name: routeName, params: { id: entity.id } }">
|
||||||
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
|
|
||||||
>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
class="link"
|
class="link"
|
||||||
color="white"
|
color="white"
|
||||||
|
@ -196,7 +203,6 @@ const toModule = computed(() =>
|
||||||
<QItemLabel class="subtitle">
|
<QItemLabel class="subtitle">
|
||||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
|
|
||||||
<QBtn
|
<QBtn
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
|
@ -210,7 +216,6 @@ const toModule = computed(() =>
|
||||||
{{ t('globals.copyId') }}
|
{{ t('globals.copyId') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<!-- </QItemLabel> -->
|
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
<div class="list-box q-mt-xs">
|
<div class="list-box q-mt-xs">
|
||||||
|
@ -220,7 +225,7 @@ const toModule = computed(() =>
|
||||||
<div class="icons">
|
<div class="icons">
|
||||||
<slot name="icons" :entity="entity" />
|
<slot name="icons" :entity="entity" />
|
||||||
</div>
|
</div>
|
||||||
<div class="actions justify-center">
|
<div class="actions justify-center" data-cy="descriptor_actions">
|
||||||
<slot name="actions" :entity="entity" />
|
<slot name="actions" :entity="entity" />
|
||||||
</div>
|
</div>
|
||||||
<slot name="after" />
|
<slot name="after" />
|
||||||
|
|
|
@ -153,6 +153,7 @@ globals:
|
||||||
maxTemperature: Max
|
maxTemperature: Max
|
||||||
minTemperature: Min
|
minTemperature: Min
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
|
setPass: Set password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
|
|
|
@ -157,6 +157,7 @@ globals:
|
||||||
maxTemperature: Máx
|
maxTemperature: Máx
|
||||||
minTemperature: Mín
|
minTemperature: Mín
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
|
setPass: Establecer contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
|
@ -786,7 +787,7 @@ worker:
|
||||||
notes: Notas
|
notes: Notas
|
||||||
operator:
|
operator:
|
||||||
numberOfWagons: Número de vagones
|
numberOfWagons: Número de vagones
|
||||||
train: tren
|
train: Tren
|
||||||
itemPackingType: Tipo de embalaje
|
itemPackingType: Tipo de embalaje
|
||||||
warehouse: Almacén
|
warehouse: Almacén
|
||||||
sector: Sector
|
sector: Sector
|
||||||
|
|
|
@ -25,12 +25,13 @@ const $props = defineProps({
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { hasAccount } = toRefs($props);
|
const { hasAccount } = toRefs($props);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
const arrayData = useArrayData('Account');
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const { notify } = useQuasar();
|
const { notify } = useQuasar();
|
||||||
const account = computed(() => useArrayData('Account').store.data[0]);
|
const account = computed(() => arrayData.store.data);
|
||||||
account.value.hasAccount = hasAccount.value;
|
account.value.hasAccount = hasAccount.value;
|
||||||
const entityId = computed(() => +route.params.id);
|
const entityId = computed(() => +route.params.id);
|
||||||
const hasitManagementAccess = ref();
|
const hasitManagementAccess = ref();
|
||||||
|
@ -39,7 +40,7 @@ const isHimself = computed(() => user.value.id === account.value.id);
|
||||||
const url = computed(() =>
|
const url = computed(() =>
|
||||||
isHimself.value
|
isHimself.value
|
||||||
? 'Accounts/change-password'
|
? 'Accounts/change-password'
|
||||||
: `Accounts/${entityId.value}/setPassword`
|
: `Accounts/${entityId.value}/setPassword`,
|
||||||
);
|
);
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
|
@ -153,6 +154,7 @@ onMounted(() => {
|
||||||
t('account.card.actions.disableAccount.title'),
|
t('account.card.actions.disableAccount.title'),
|
||||||
t('account.card.actions.disableAccount.subtitle'),
|
t('account.card.actions.disableAccount.subtitle'),
|
||||||
() => deleteAccount(),
|
() => deleteAccount(),
|
||||||
|
() => deleteAccount(),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -172,6 +174,7 @@ onMounted(() => {
|
||||||
t('account.card.actions.enableAccount.title'),
|
t('account.card.actions.enableAccount.title'),
|
||||||
t('account.card.actions.enableAccount.subtitle'),
|
t('account.card.actions.enableAccount.subtitle'),
|
||||||
() => updateStatusAccount(true),
|
() => updateStatusAccount(true),
|
||||||
|
() => updateStatusAccount(true),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -186,6 +189,7 @@ onMounted(() => {
|
||||||
t('account.card.actions.disableAccount.title'),
|
t('account.card.actions.disableAccount.title'),
|
||||||
t('account.card.actions.disableAccount.subtitle'),
|
t('account.card.actions.disableAccount.subtitle'),
|
||||||
() => updateStatusAccount(false),
|
() => updateStatusAccount(false),
|
||||||
|
() => updateStatusAccount(false),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -201,6 +205,7 @@ onMounted(() => {
|
||||||
t('account.card.actions.activateUser.title'),
|
t('account.card.actions.activateUser.title'),
|
||||||
t('account.card.actions.activateUser.title'),
|
t('account.card.actions.activateUser.title'),
|
||||||
() => updateStatusUser(true),
|
() => updateStatusUser(true),
|
||||||
|
() => updateStatusUser(true),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -215,6 +220,7 @@ onMounted(() => {
|
||||||
t('account.card.actions.deactivateUser.title'),
|
t('account.card.actions.deactivateUser.title'),
|
||||||
t('account.card.actions.deactivateUser.title'),
|
t('account.card.actions.deactivateUser.title'),
|
||||||
() => updateStatusUser(false),
|
() => updateStatusUser(false),
|
||||||
|
() => updateStatusUser(false),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
@ -27,6 +27,7 @@ const claimActionsForm = ref();
|
||||||
const rows = ref([]);
|
const rows = ref([]);
|
||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const destinationTypes = ref([]);
|
const destinationTypes = ref([]);
|
||||||
|
const shelvings = ref([]);
|
||||||
const totalClaimed = ref(null);
|
const totalClaimed = ref(null);
|
||||||
const DEFAULT_MAX_RESPONSABILITY = 5;
|
const DEFAULT_MAX_RESPONSABILITY = 5;
|
||||||
const DEFAULT_MIN_RESPONSABILITY = 1;
|
const DEFAULT_MIN_RESPONSABILITY = 1;
|
||||||
|
@ -56,6 +57,12 @@ const columns = computed(() => [
|
||||||
field: (row) => row.claimDestinationFk,
|
field: (row) => row.claimDestinationFk,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'shelving',
|
||||||
|
label: t('shelvings.shelving'),
|
||||||
|
field: (row) => row.shelvingFk,
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Landed',
|
name: 'Landed',
|
||||||
label: t('Landed'),
|
label: t('Landed'),
|
||||||
|
@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) {
|
||||||
options.reload && claimActionsForm.value.reload();
|
options.reload && claimActionsForm.value.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async function updateShelving(shelvingFk, row) {
|
||||||
|
await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk });
|
||||||
|
claimActionsForm.value.reload();
|
||||||
|
}
|
||||||
|
|
||||||
async function regularizeClaim() {
|
async function regularizeClaim() {
|
||||||
await post(`Claims/${claimId}/regularizeClaim`);
|
await post(`Claims/${claimId}/regularizeClaim`);
|
||||||
|
@ -200,6 +211,7 @@ async function post(query, params) {
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (destinationTypes = data)"
|
@on-fetch="(data) => (destinationTypes = data)"
|
||||||
/>
|
/>
|
||||||
|
<FetchData url="Shelvings" auto-load @on-fetch="(data) => (shelvings = data)" />
|
||||||
<RightMenu v-if="claim">
|
<RightMenu v-if="claim">
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
||||||
|
@ -312,6 +324,20 @@ async function post(query, params) {
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
<template #body-cell-shelving="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<VnSelect
|
||||||
|
v-model="row.shelvingFk"
|
||||||
|
:options="shelvings"
|
||||||
|
option-label="code"
|
||||||
|
option-value="id"
|
||||||
|
style="width: 100px"
|
||||||
|
hide-selected
|
||||||
|
@update:model-value="(value) => updateShelving(value, row)"
|
||||||
|
/>
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #body-cell-price="{ value }">
|
<template #body-cell-price="{ value }">
|
||||||
<QTd align="center">
|
<QTd align="center">
|
||||||
{{ toCurrency(value) }}
|
{{ toCurrency(value) }}
|
||||||
|
@ -354,7 +380,7 @@ async function post(query, params) {
|
||||||
(value) =>
|
(value) =>
|
||||||
updateDestination(
|
updateDestination(
|
||||||
value,
|
value,
|
||||||
props.row
|
props.row,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -371,6 +397,17 @@ async function post(query, params) {
|
||||||
</QTable>
|
</QTable>
|
||||||
</template>
|
</template>
|
||||||
<template #moreBeforeActions>
|
<template #moreBeforeActions>
|
||||||
|
<QBtn
|
||||||
|
color="primary"
|
||||||
|
text-color="white"
|
||||||
|
:unelevated="true"
|
||||||
|
:label="tMobile('Import claim')"
|
||||||
|
:title="t('Import claim')"
|
||||||
|
icon="Download"
|
||||||
|
@click="importToNewRefundTicket"
|
||||||
|
:disable="claim.claimStateFk == resolvedStateId"
|
||||||
|
:loading="loading"
|
||||||
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
|
@ -394,17 +431,6 @@ async function post(query, params) {
|
||||||
@click="dialogDestination = !dialogDestination"
|
@click="dialogDestination = !dialogDestination"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
|
||||||
color="primary"
|
|
||||||
text-color="white"
|
|
||||||
:unelevated="true"
|
|
||||||
:label="tMobile('Import claim')"
|
|
||||||
:title="t('Import claim')"
|
|
||||||
icon="Upload"
|
|
||||||
@click="importToNewRefundTicket"
|
|
||||||
:disable="claim.claimStateFk == resolvedStateId"
|
|
||||||
:loading="loading"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
<QDialog v-model="dialogDestination">
|
<QDialog v-model="dialogDestination">
|
||||||
|
|
|
@ -40,7 +40,7 @@ const workersOptions = ref([]);
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('claim.assignedTo')"
|
:label="t('claim.attendedBy')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
:options="workersOptions"
|
:options="workersOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
|
@ -233,20 +233,27 @@ function claimUrl(section) {
|
||||||
<ClaimDescriptorMenu :claim="entity.claim" />
|
<ClaimDescriptorMenu :claim="entity.claim" />
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="claimUrl('basic-data')"
|
:url="claimUrl('basic-data')"
|
||||||
:text="t('globals.pageTitles.basicData')"
|
:text="t('globals.pageTitles.basicData')"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
|
<VnLv
|
||||||
<VnLv :label="t('claim.state')">
|
v-if="$route.name != 'ClaimSummary'"
|
||||||
|
:label="t('claim.created')"
|
||||||
|
:value="toDate(claim.created)"
|
||||||
|
/>
|
||||||
|
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.state')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<QChip :color="stateColor(claim.claimState.code)" dense>
|
<QChip :color="stateColor(claim.claimState.code)" dense>
|
||||||
{{ claim.claimState.description }}
|
{{ claim.claimState.description }}
|
||||||
</QChip>
|
</QChip>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('globals.salesPerson')">
|
<VnLv
|
||||||
|
v-if="$route.name != 'ClaimSummary'"
|
||||||
|
:label="t('globals.salesPerson')"
|
||||||
|
>
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="claim.client?.salesPersonUser?.name"
|
:name="claim.client?.salesPersonUser?.name"
|
||||||
|
@ -254,7 +261,7 @@ function claimUrl(section) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.attendedBy')">
|
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.attendedBy')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="claim.worker?.user?.nickname"
|
:name="claim.worker?.user?.nickname"
|
||||||
|
@ -262,7 +269,7 @@ function claimUrl(section) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.customer')">
|
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link cursor-pointer">
|
<span class="link cursor-pointer">
|
||||||
{{ claim.client?.name }}
|
{{ claim.client?.name }}
|
||||||
|
@ -274,6 +281,11 @@ function claimUrl(section) {
|
||||||
:label="t('claim.pickup')"
|
:label="t('claim.pickup')"
|
||||||
:value="`${dashIfEmpty(claim.pickup)}`"
|
:value="`${dashIfEmpty(claim.pickup)}`"
|
||||||
/>
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('globals.packages')"
|
||||||
|
:value="`${dashIfEmpty(claim.packages)}`"
|
||||||
|
:translation="(value) => t(`claim.packages`)"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-two">
|
<QCard class="vn-two">
|
||||||
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />
|
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />
|
||||||
|
|
|
@ -19,30 +19,36 @@ const columns = [
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
label: t('Id item'),
|
label: t('Id item'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ticketFk',
|
name: 'ticketFk',
|
||||||
label: t('Ticket'),
|
label: t('Ticket'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'claimDestinationFk',
|
name: 'claimDestinationFk',
|
||||||
label: t('Destination'),
|
label: t('Destination'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
align: 'left',
|
align: 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'shelvingCode',
|
||||||
|
label: t('Shelving'),
|
||||||
|
columnFilter: false,
|
||||||
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'landed',
|
name: 'landed',
|
||||||
label: t('Landed'),
|
label: t('Landed'),
|
||||||
format: (row) => toDate(row.landed),
|
format: (row) => toDate(row.landed),
|
||||||
align: 'left',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'quantity',
|
name: 'quantity',
|
||||||
label: t('Quantity'),
|
label: t('Quantity'),
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'concept',
|
name: 'concept',
|
||||||
|
@ -52,18 +58,18 @@ const columns = [
|
||||||
{
|
{
|
||||||
name: 'price',
|
name: 'price',
|
||||||
label: t('Price'),
|
label: t('Price'),
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'discount',
|
name: 'discount',
|
||||||
label: t('Discount'),
|
label: t('Discount'),
|
||||||
format: ({ discount }) => toPercentage(discount / 100),
|
format: ({ discount }) => toPercentage(discount / 100),
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'total',
|
name: 'total',
|
||||||
label: t('Total'),
|
label: t('Total'),
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -106,7 +106,6 @@ const props = defineProps({
|
||||||
:label="t('claim.zone')"
|
:label="t('claim.zone')"
|
||||||
v-model="params.zoneFk"
|
v-model="params.zoneFk"
|
||||||
url="Zones"
|
url="Zones"
|
||||||
:use-like="false"
|
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -13,7 +13,6 @@ claim:
|
||||||
province: Province
|
province: Province
|
||||||
zone: Zone
|
zone: Zone
|
||||||
customerId: client ID
|
customerId: client ID
|
||||||
assignedTo: Assigned
|
|
||||||
created: Created
|
created: Created
|
||||||
details: Details
|
details: Details
|
||||||
item: Item
|
item: Item
|
||||||
|
|
|
@ -13,7 +13,6 @@ claim:
|
||||||
province: Provincia
|
province: Provincia
|
||||||
zone: Zona
|
zone: Zona
|
||||||
customerId: ID de cliente
|
customerId: ID de cliente
|
||||||
assignedTo: Asignado a
|
|
||||||
created: Creado
|
created: Creado
|
||||||
details: Detalles
|
details: Detalles
|
||||||
item: Artículo
|
item: Artículo
|
||||||
|
|
|
@ -143,6 +143,7 @@ const exprBuilder = (param, value) => {
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
auto-load
|
auto-load
|
||||||
|
sortBy="name ASC"
|
||||||
/></QItemSection>
|
/></QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
|
|
|
@ -78,10 +78,20 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'firstName'],
|
||||||
where: { role: 'salesPerson' },
|
where: { role: 'salesPerson' },
|
||||||
optionFilter: 'firstName',
|
optionFilter: 'firstName',
|
||||||
},
|
},
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name', 'firstName'],
|
||||||
|
where: { role: 'salesPerson' },
|
||||||
|
optionLabel: 'firstName',
|
||||||
|
optionValue: 'id',
|
||||||
|
},
|
||||||
|
},
|
||||||
create: false,
|
create: false,
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
|
|
|
@ -77,7 +77,6 @@ onBeforeMount(() => {
|
||||||
function setPaymentType(accounting) {
|
function setPaymentType(accounting) {
|
||||||
if (!accounting) return;
|
if (!accounting) return;
|
||||||
accountingType.value = accounting.accountingType;
|
accountingType.value = accounting.accountingType;
|
||||||
|
|
||||||
initialData.description = [];
|
initialData.description = [];
|
||||||
initialData.payed = Date.vnNew();
|
initialData.payed = Date.vnNew();
|
||||||
isCash.value = accountingType.value.code == 'cash';
|
isCash.value = accountingType.value.code == 'cash';
|
||||||
|
@ -87,14 +86,14 @@ function setPaymentType(accounting) {
|
||||||
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
||||||
);
|
);
|
||||||
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
||||||
|
|
||||||
if (accountingType.value.code == 'compensation')
|
if (accountingType.value.code == 'compensation')
|
||||||
return (initialData.description = '');
|
return (initialData.description = '');
|
||||||
if (accountingType.value.receiptDescription)
|
|
||||||
initialData.description.push(accountingType.value.receiptDescription);
|
|
||||||
if (initialData.description) initialData.description.push(initialData.description);
|
|
||||||
|
|
||||||
initialData.description = initialData.description.join(', ');
|
let descriptions = [];
|
||||||
|
if (accountingType.value.receiptDescription)
|
||||||
|
descriptions.push(accountingType.value.receiptDescription);
|
||||||
|
if (initialData.description) descriptions.push(initialData.description);
|
||||||
|
initialData.description = descriptions.join(', ');
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateFromAmount = (event) => {
|
const calculateFromAmount = (event) => {
|
||||||
|
|
|
@ -18,6 +18,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
|
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
|
||||||
import FormPopup from 'src/components/FormPopup.vue';
|
import FormPopup from 'src/components/FormPopup.vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ const optionsSamplesVisible = ref([]);
|
||||||
const sampleType = ref({ hasPreview: false });
|
const sampleType = ref({ hasPreview: false });
|
||||||
const initialData = reactive({});
|
const initialData = reactive({});
|
||||||
const entityId = computed(() => route.params.id);
|
const entityId = computed(() => route.params.id);
|
||||||
const customer = computed(() => state.get('Customer'));
|
const customer = computed(() => useArrayData('Customer').store?.data);
|
||||||
const filterEmailUsers = { where: { userFk: user.value.id } };
|
const filterEmailUsers = { where: { userFk: user.value.id } };
|
||||||
const filterClientsAddresses = {
|
const filterClientsAddresses = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -65,9 +66,9 @@ const filterSamplesVisible = {
|
||||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
initialData.clientFk = customer.value.id;
|
initialData.clientFk = customer.value?.id;
|
||||||
initialData.recipient = customer.value.email;
|
initialData.recipient = customer.value?.email;
|
||||||
initialData.recipientId = customer.value.id;
|
initialData.recipientId = customer.value?.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const setEmailUser = (data) => {
|
const setEmailUser = (data) => {
|
||||||
|
|
|
@ -639,7 +639,7 @@ onMounted(() => {
|
||||||
'flex-wrap': 'wrap',
|
'flex-wrap': 'wrap',
|
||||||
gap: '16px',
|
gap: '16px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
height: '450px',
|
height: '500px',
|
||||||
},
|
},
|
||||||
columnGridStyle: {
|
columnGridStyle: {
|
||||||
'max-width': '50%',
|
'max-width': '50%',
|
||||||
|
@ -650,7 +650,7 @@ onMounted(() => {
|
||||||
:is-editable="editableMode"
|
:is-editable="editableMode"
|
||||||
:without-header="!editableMode"
|
:without-header="!editableMode"
|
||||||
:with-filters="editableMode"
|
:with-filters="editableMode"
|
||||||
:right-search="true"
|
:right-search="editableMode"
|
||||||
:right-search-icon="true"
|
:right-search-icon="true"
|
||||||
:row-click="false"
|
:row-click="false"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
|
|
@ -274,7 +274,7 @@ onBeforeMount(async () => {
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Entries/filter',
|
url: 'Entries/filter',
|
||||||
order: 'landed DESC',
|
order: 'landed DESC',
|
||||||
userFilter: EntryFilter,
|
userFilter: entryQueryFilter,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
|
|
|
@ -163,10 +163,14 @@ const showExportationLetter = () => {
|
||||||
<QMenu anchor="top end" self="top start">
|
<QMenu anchor="top end" self="top start">
|
||||||
<QList>
|
<QList>
|
||||||
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
|
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
|
||||||
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
<QItemSection data-cy="InvoiceOutDescriptorMenuSendPdfOption">
|
||||||
|
{{ t('Send PDF') }}
|
||||||
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
|
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
|
||||||
<QItemSection>{{ t('Send CSV') }}</QItemSection>
|
<QItemSection data-cy="InvoiceOutDescriptorMenuSendCsvOption">
|
||||||
|
{{ t('Send CSV') }}
|
||||||
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</QMenu>
|
</QMenu>
|
||||||
|
|
|
@ -21,7 +21,6 @@ import VnSection from 'src/components/common/VnSection.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const invoiceOutSerialsOptions = ref([]);
|
|
||||||
const customerOptions = ref([]);
|
const customerOptions = ref([]);
|
||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||||
|
@ -368,7 +367,6 @@ watchEffect(selectedRows);
|
||||||
url="InvoiceOutSerials"
|
url="InvoiceOutSerials"
|
||||||
v-model="data.serial"
|
v-model="data.serial"
|
||||||
:label="t('invoiceOutModule.serial')"
|
:label="t('invoiceOutModule.serial')"
|
||||||
:options="invoiceOutSerialsOptions"
|
|
||||||
option-label="description"
|
option-label="description"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-filter
|
option-filter
|
||||||
|
|
|
@ -24,6 +24,7 @@ invoiceOut:
|
||||||
min: Min
|
min: Min
|
||||||
max: Max
|
max: Max
|
||||||
hasPdf: Has PDF
|
hasPdf: Has PDF
|
||||||
|
search: Contains
|
||||||
card:
|
card:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
|
|
@ -24,6 +24,7 @@ invoiceOut:
|
||||||
min: Min
|
min: Min
|
||||||
max: Max
|
max: Max
|
||||||
hasPdf: Tiene PDF
|
hasPdf: Tiene PDF
|
||||||
|
search: Contiene
|
||||||
card:
|
card:
|
||||||
issued: Fecha emisión
|
issued: Fecha emisión
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
|
|
|
@ -27,7 +27,7 @@ const user = state.getUser();
|
||||||
const today = Date.vnNew();
|
const today = Date.vnNew();
|
||||||
today.setHours(0, 0, 0, 0);
|
today.setHours(0, 0, 0, 0);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
const itemBalances = computed(() => arrayDataItemBalances.store.data || []);
|
||||||
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||||
const showWhatsBeforeInventory = ref(false);
|
const showWhatsBeforeInventory = ref(false);
|
||||||
const inventoriedDate = ref(null);
|
const inventoriedDate = ref(null);
|
||||||
|
@ -313,8 +313,8 @@ async function updateWarehouse(warehouseFk) {
|
||||||
row.lineFk == row.lastPreparedLineFk
|
row.lineFk == row.lastPreparedLineFk
|
||||||
? 'black'
|
? 'black'
|
||||||
: row.balance < 0
|
: row.balance < 0
|
||||||
? 'negative'
|
? 'negative'
|
||||||
: ''
|
: ''
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
|
|
|
@ -87,7 +87,7 @@ const insertTag = (rows) => {
|
||||||
tagFk: undefined,
|
tagFk: undefined,
|
||||||
}"
|
}"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:filter="{
|
:user-filter="{
|
||||||
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
||||||
where: { itemFk: route.params.id },
|
where: { itemFk: route.params.id },
|
||||||
include: {
|
include: {
|
||||||
|
@ -119,6 +119,7 @@ const insertTag = (rows) => {
|
||||||
"
|
"
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('itemTag.tagFk')"
|
:rules="validate('itemTag.tagFk')"
|
||||||
|
:data-cy="`tag${row?.tag?.name}`"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-if="row.tag?.isFree === false"
|
v-if="row.tag?.isFree === false"
|
||||||
|
@ -145,6 +146,7 @@ const insertTag = (rows) => {
|
||||||
:label="t('itemTags.value')"
|
:label="t('itemTags.value')"
|
||||||
:is-clearable="false"
|
:is-clearable="false"
|
||||||
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
|
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
|
||||||
|
:data-cy="`tag${row?.tag?.name}Value`"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('itemBasicData.relevancy')"
|
:label="t('itemBasicData.relevancy')"
|
||||||
|
@ -162,6 +164,7 @@ const insertTag = (rows) => {
|
||||||
name="delete"
|
name="delete"
|
||||||
size="sm"
|
size="sm"
|
||||||
dense
|
dense
|
||||||
|
:data-cy="`deleteTag${row?.tag?.name}`"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('itemTags.removeTag') }}
|
{{ t('itemTags.removeTag') }}
|
||||||
|
@ -177,6 +180,7 @@ const insertTag = (rows) => {
|
||||||
icon="add"
|
icon="add"
|
||||||
v-shortcut="'+'"
|
v-shortcut="'+'"
|
||||||
fab
|
fab
|
||||||
|
data-cy="createNewTag"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('itemTags.addTag') }}
|
{{ t('itemTags.addTag') }}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { dashIfEmpty, toDate, toHour } from 'src/filters';
|
import { toDate, toHour } from 'src/filters';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { usePrintService } from 'src/composables/usePrintService';
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
|
|
||||||
|
@ -335,7 +335,6 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="vn:clone"
|
icon="vn:clone"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="confirmationDialog = true"
|
@click="confirmationDialog = true"
|
||||||
|
@ -345,7 +344,6 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="cloud_download"
|
icon="cloud_download"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="showRouteReport"
|
@click="showRouteReport"
|
||||||
|
@ -355,7 +353,6 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="check"
|
icon="check"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="markAsServed()"
|
@click="markAsServed()"
|
||||||
|
|
|
@ -45,8 +45,6 @@ const filter = {
|
||||||
:label="t('parking.sector')"
|
:label="t('parking.sector')"
|
||||||
:value="entity.sector?.description"
|
:value="entity.sector?.description"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('parking.row')" :value="entity.row" />
|
|
||||||
<VnLv :label="t('parking.column')" :value="entity.column" />
|
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, onUnmounted } from 'vue';
|
import { computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import CardList from 'components/ui/CardList.vue';
|
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
|
||||||
import ParkingFilter from './ParkingFilter.vue';
|
|
||||||
import ParkingSummary from './Card/ParkingSummary.vue';
|
|
||||||
import exprBuilder from './ParkingExprBuilder.js';
|
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import ParkingFilter from './ParkingFilter.vue';
|
||||||
|
import exprBuilder from './ParkingExprBuilder.js';
|
||||||
|
import ParkingSummary from './Card/ParkingSummary.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { push } = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const dataKey = 'ParkingList';
|
const dataKey = 'ParkingList';
|
||||||
|
@ -24,7 +20,48 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'code',
|
||||||
|
label: t('globals.code'),
|
||||||
|
isId: true,
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'sector',
|
||||||
|
label: t('parking.sector'),
|
||||||
|
format: (val) => val.sector.description ?? '',
|
||||||
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'pickingOrder',
|
||||||
|
label: t('parking.pickingOrder'),
|
||||||
|
sortable: true,
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
label: '',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('components.smartCard.viewSummary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row.id, ParkingSummary),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
|
@ -40,41 +77,24 @@ const filter = {
|
||||||
<ParkingFilter data-key="ParkingList" />
|
<ParkingFilter data-key="ParkingList" />
|
||||||
</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/parking"
|
||||||
:title="row.code"
|
default-mode="card"
|
||||||
@click="
|
>
|
||||||
push({ path: `/shelving/parking/${row.id}/summary` })
|
<template #actions="{ row }">
|
||||||
"
|
<QBtn
|
||||||
>
|
:label="t('components.smartCard.openSummary')"
|
||||||
<template #list-items>
|
@click.stop="viewSummary(row.id, ParkingSummary)"
|
||||||
<VnLv
|
color="primary"
|
||||||
label="Sector"
|
/>
|
||||||
:value="row.sector?.description"
|
</template>
|
||||||
/>
|
</VnTable>
|
||||||
<VnLv
|
|
||||||
:label="t('parking.pickingOrder')"
|
|
||||||
:value="row.pickingOrder"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #actions>
|
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openSummary')"
|
|
||||||
@click.stop="viewSummary(row.id, ParkingSummary)"
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</CardList>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,32 +1,26 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import axios from 'axios';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
mana: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
newPrice: {
|
newPrice: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
usesMana: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
manaCode: {
|
|
||||||
type: String,
|
|
||||||
default: 'mana',
|
|
||||||
},
|
|
||||||
sale: {
|
sale: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const mana = ref(null);
|
||||||
|
const usesMana = ref(false);
|
||||||
|
|
||||||
const emit = defineEmits(['save', 'cancel']);
|
const emit = defineEmits(['save', 'cancel']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -38,32 +32,47 @@ const save = (sale = $props.sale) => {
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getMana = async () => {
|
||||||
|
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
|
||||||
|
mana.value = data;
|
||||||
|
await getUsesMana();
|
||||||
|
};
|
||||||
|
|
||||||
|
const getUsesMana = async () => {
|
||||||
|
const { data } = await axios.get('Sales/usesMana');
|
||||||
|
usesMana.value = data;
|
||||||
|
};
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
emit('cancel');
|
emit('cancel');
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
const hasMana = computed(() => typeof mana.value === 'number');
|
||||||
defineExpose({ save });
|
defineExpose({ save });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketEditManaProxy">
|
<QPopupProxy
|
||||||
|
ref="QPopupProxyRef"
|
||||||
|
@before-show="getMana"
|
||||||
|
data-cy="ticketEditManaProxy"
|
||||||
|
>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<QSpinner v-if="!mana" color="primary" size="md" />
|
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
||||||
<div v-else>
|
<QSpinner v-if="!hasMana" color="primary" size="md" />
|
||||||
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
<div class="q-pa-md" v-else>
|
||||||
<div class="q-pa-md">
|
<slot :popup="QPopupProxyRef" />
|
||||||
<slot :popup="QPopupProxyRef" />
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
<VnUsesMana :mana-code="manaCode" />
|
||||||
<VnUsesMana :mana-code="manaCode" />
|
</div>
|
||||||
</div>
|
<div v-if="newPrice" class="column items-center q-mt-lg">
|
||||||
<div v-if="newPrice" class="column items-center q-mt-lg">
|
<span class="text-primary">{{ t('New price') }}</span>
|
||||||
<span class="text-primary">{{ t('New price') }}</span>
|
<span class="text-subtitle1">
|
||||||
<span class="text-subtitle1">
|
{{ toCurrency($props.newPrice) }}
|
||||||
{{ toCurrency($props.newPrice) }}
|
</span>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -45,7 +45,6 @@ const isTicketEditable = ref(false);
|
||||||
const sales = ref([]);
|
const sales = ref([]);
|
||||||
const editableStatesOptions = ref([]);
|
const editableStatesOptions = ref([]);
|
||||||
const selectedSales = ref([]);
|
const selectedSales = ref([]);
|
||||||
const mana = ref(null);
|
|
||||||
const manaCode = ref('mana');
|
const manaCode = ref('mana');
|
||||||
const ticketState = computed(() => store.data?.ticketState?.state?.code);
|
const ticketState = computed(() => store.data?.ticketState?.state?.code);
|
||||||
const transfer = ref({
|
const transfer = ref({
|
||||||
|
@ -175,17 +174,21 @@ const getSaleTotal = (sale) => {
|
||||||
return price - discount;
|
return price - discount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getRowUpdateInputEvents = (sale) => ({
|
||||||
|
'keyup.enter': () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
blur: () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
const rowToUpdate = ref(null);
|
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
if (
|
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
|
||||||
!sale.itemFk ||
|
|
||||||
sale.quantity == null ||
|
|
||||||
edit.value?.oldQuantity === sale.quantity
|
|
||||||
)
|
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
|
|
||||||
|
@ -197,11 +200,8 @@ const changeQuantity = async (sale) => {
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
try {
|
try {
|
||||||
let { quantity, id } = sale;
|
let { quantity, id } = sale;
|
||||||
if (!rowToUpdate.value) return;
|
|
||||||
rowToUpdate.value = null;
|
|
||||||
sale.isNew = false;
|
sale.isNew = false;
|
||||||
const params = { quantity: quantity };
|
await axios.post(`Sales/${id}/updateQuantity`, { quantity });
|
||||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -258,18 +258,6 @@ const DEFAULT_EDIT = {
|
||||||
oldQuantity: null,
|
oldQuantity: null,
|
||||||
};
|
};
|
||||||
const edit = ref({ ...DEFAULT_EDIT });
|
const edit = ref({ ...DEFAULT_EDIT });
|
||||||
const usesMana = ref(null);
|
|
||||||
|
|
||||||
const getUsesMana = async () => {
|
|
||||||
const { data } = await axios.get('Sales/usesMana');
|
|
||||||
usesMana.value = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getMana = async () => {
|
|
||||||
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
|
|
||||||
mana.value = data;
|
|
||||||
await getUsesMana();
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectedValidSales = computed(() => {
|
const selectedValidSales = computed(() => {
|
||||||
if (!sales.value) return;
|
if (!sales.value) return;
|
||||||
|
@ -277,7 +265,6 @@ const selectedValidSales = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const onOpenEditPricePopover = async (sale) => {
|
const onOpenEditPricePopover = async (sale) => {
|
||||||
await getMana();
|
|
||||||
edit.value = {
|
edit.value = {
|
||||||
sale: JSON.parse(JSON.stringify(sale)),
|
sale: JSON.parse(JSON.stringify(sale)),
|
||||||
price: sale.price,
|
price: sale.price,
|
||||||
|
@ -285,7 +272,6 @@ const onOpenEditPricePopover = async (sale) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOpenEditDiscountPopover = async (sale) => {
|
const onOpenEditDiscountPopover = async (sale) => {
|
||||||
await getMana();
|
|
||||||
if (isLocked.value) return;
|
if (isLocked.value) return;
|
||||||
if (sale) {
|
if (sale) {
|
||||||
edit.value = {
|
edit.value = {
|
||||||
|
@ -306,7 +292,6 @@ const changePrice = async (sale) => {
|
||||||
await confirmUpdate(() => updatePrice(sale, newPrice));
|
await confirmUpdate(() => updatePrice(sale, newPrice));
|
||||||
} else updatePrice(sale, newPrice);
|
} else updatePrice(sale, newPrice);
|
||||||
}
|
}
|
||||||
await getMana();
|
|
||||||
};
|
};
|
||||||
const updatePrice = async (sale, newPrice) => {
|
const updatePrice = async (sale, newPrice) => {
|
||||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||||
|
@ -599,9 +584,7 @@ watch(
|
||||||
:is-ticket-editable="isTicketEditable"
|
:is-ticket-editable="isTicketEditable"
|
||||||
:sales="selectedValidSales"
|
:sales="selectedValidSales"
|
||||||
:disable="!hasSelectedRows"
|
:disable="!hasSelectedRows"
|
||||||
:mana="mana"
|
|
||||||
:ticket-config="ticketConfig"
|
:ticket-config="ticketConfig"
|
||||||
@get-mana="getMana()"
|
|
||||||
@update-discounts="updateDiscounts"
|
@update-discounts="updateDiscounts"
|
||||||
@refresh-table="resetChanges"
|
@refresh-table="resetChanges"
|
||||||
/>
|
/>
|
||||||
|
@ -772,9 +755,7 @@ watch(
|
||||||
v-if="row.isNew || isTicketEditable"
|
v-if="row.isNew || isTicketEditable"
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="row.quantity"
|
v-model.number="row.quantity"
|
||||||
@blur="changeQuantity(row)"
|
v-on="getRowUpdateInputEvents(row)"
|
||||||
@keyup.enter.stop="changeQuantity(row)"
|
|
||||||
@update:model-value="() => (rowToUpdate = row)"
|
|
||||||
@focus="edit.oldQuantity = row.quantity"
|
@focus="edit.oldQuantity = row.quantity"
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ row.quantity }}</span>
|
<span v-else>{{ row.quantity }}</span>
|
||||||
|
@ -786,7 +767,6 @@ watch(
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editPriceProxyRef"
|
ref="editPriceProxyRef"
|
||||||
:mana="mana"
|
|
||||||
:sale="row"
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
@save="changePrice"
|
@save="changePrice"
|
||||||
|
@ -809,10 +789,8 @@ watch(
|
||||||
|
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editManaProxyRef"
|
ref="editManaProxyRef"
|
||||||
:mana="mana"
|
|
||||||
:sale="row"
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
:uses-mana="usesMana"
|
|
||||||
:mana-code="manaCode"
|
:mana-code="manaCode"
|
||||||
@save="changeDiscount"
|
@save="changeDiscount"
|
||||||
>
|
>
|
||||||
|
|
|
@ -34,10 +34,6 @@ const props = defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
mana: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
ticketConfig: {
|
ticketConfig: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
|
@ -50,6 +46,7 @@ const { dialog } = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const acl = useAcl();
|
const acl = useAcl();
|
||||||
const btnDropdownRef = ref(null);
|
const btnDropdownRef = ref(null);
|
||||||
|
const editManaProxyRef = ref(null);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const newDiscount = ref(null);
|
const newDiscount = ref(null);
|
||||||
|
@ -131,13 +128,13 @@ const createClaim = () => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Claim out of time'),
|
t('Claim out of time'),
|
||||||
t('Do you want to continue?'),
|
t('Do you want to continue?'),
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Do you want to create a claim?'),
|
t('Do you want to create a claim?'),
|
||||||
false,
|
false,
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,8 +213,14 @@ const createRefund = async (withWarehouse) => {
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<TicketEditManaProxy :mana="props.mana" @save="changeMultipleDiscount()">
|
<TicketEditManaProxy
|
||||||
|
ref="editManaProxyRef"
|
||||||
|
:sale="row"
|
||||||
|
@save="changeMultipleDiscount"
|
||||||
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
autofocus
|
||||||
|
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||||
v-model.number="newDiscount"
|
v-model.number="newDiscount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
|
|
|
@ -31,7 +31,7 @@ const oldQuantity = ref(null);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.params.id,
|
() => route.params.id,
|
||||||
async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch())
|
async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch()),
|
||||||
);
|
);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -212,7 +212,7 @@ const updateShelving = async (sale) => {
|
||||||
|
|
||||||
const { data: patchResponseData } = await axios.patch(
|
const { data: patchResponseData } = await axios.patch(
|
||||||
`ItemShelvings/${sale.itemShelvingFk}`,
|
`ItemShelvings/${sale.itemShelvingFk}`,
|
||||||
params
|
params,
|
||||||
);
|
);
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['parkingFk'],
|
fields: ['parkingFk'],
|
||||||
|
@ -385,7 +385,7 @@ const qCheckBoxController = (sale, action) => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-parking="{ row }">
|
<template #body-cell-parking="{ row }">
|
||||||
<QTd style="width: 10%">
|
<QTd style="width: 10%">
|
||||||
{{ dashIfEmpty(row.parkingFk) }}
|
{{ dashIfEmpty(row.parkingCode) }}
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-actions="{ row }">
|
<template #body-cell-actions="{ row }">
|
||||||
|
|
|
@ -46,6 +46,15 @@ const descriptorData = useArrayData('Ticket');
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
||||||
});
|
});
|
||||||
|
const formattedAddress = computed(() => {
|
||||||
|
if (!ticket.value) return '';
|
||||||
|
|
||||||
|
const address = ticket.value.address;
|
||||||
|
const postcode = address.postalCode;
|
||||||
|
const province = address.province ? `(${address.province.name})` : '';
|
||||||
|
|
||||||
|
return `${address.street} - ${postcode} - ${address.city} ${province}`;
|
||||||
|
});
|
||||||
|
|
||||||
function isEditable() {
|
function isEditable() {
|
||||||
try {
|
try {
|
||||||
|
@ -238,7 +247,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.consigneeStreet')"
|
:label="t('ticket.summary.consigneeStreet')"
|
||||||
:value="entity.address?.street"
|
:value="formattedAddress"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.notes.length">
|
<QCard class="vn-one" v-if="entity.notes.length">
|
||||||
|
|
|
@ -293,6 +293,7 @@ en:
|
||||||
clientFk: Customer
|
clientFk: Customer
|
||||||
orderFk: Order
|
orderFk: Order
|
||||||
from: From
|
from: From
|
||||||
|
shipped: Shipped
|
||||||
to: To
|
to: To
|
||||||
salesPersonFk: Salesperson
|
salesPersonFk: Salesperson
|
||||||
stateFk: State
|
stateFk: State
|
||||||
|
@ -320,6 +321,7 @@ es:
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
orderFk: Pedido
|
orderFk: Pedido
|
||||||
from: Desde
|
from: Desde
|
||||||
|
shipped: F. envío
|
||||||
to: Hasta
|
to: Hasta
|
||||||
salesPersonFk: Comercial
|
salesPersonFk: Comercial
|
||||||
stateFk: Estado
|
stateFk: Estado
|
||||||
|
|
|
@ -108,13 +108,11 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'shippedDate',
|
name: 'shipped',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
label: t('ticketList.shipped'),
|
label: t('ticketList.shipped'),
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'date',
|
component: 'date',
|
||||||
alias: 't',
|
|
||||||
inWhere: true,
|
|
||||||
},
|
},
|
||||||
format: ({ shippedDate }) => toDate(shippedDate),
|
format: ({ shippedDate }) => toDate(shippedDate),
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,6 +17,12 @@ const maritalStatus = [
|
||||||
{ code: 'M', name: t('Married') },
|
{ code: 'M', name: t('Married') },
|
||||||
{ code: 'S', name: t('Single') },
|
{ code: 'S', name: t('Single') },
|
||||||
];
|
];
|
||||||
|
async function setAdvancedSummary(data) {
|
||||||
|
const advanced = (await useAdvancedSummary('Workers', data.id)) ?? {};
|
||||||
|
Object.assign(form.value.formData, advanced);
|
||||||
|
await nextTick();
|
||||||
|
if (form.value) form.value.hasChanges = false;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -36,18 +42,22 @@ const maritalStatus = [
|
||||||
:url-update="`Workers/${$route.params.id}`"
|
:url-update="`Workers/${$route.params.id}`"
|
||||||
auto-load
|
auto-load
|
||||||
model="Worker"
|
model="Worker"
|
||||||
@on-fetch="
|
@on-fetch="setAdvancedSummary"
|
||||||
async (data) => {
|
|
||||||
Object.assign(data, (await useAdvancedSummary('Workers', data.id)) ?? {});
|
|
||||||
await $nextTick();
|
|
||||||
if (form) form.hasChanges = false;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput :label="t('Name')" clearable v-model="data.firstName" />
|
<VnInput
|
||||||
<VnInput :label="t('Last name')" clearable v-model="data.lastName" />
|
:label="t('Name')"
|
||||||
|
clearable
|
||||||
|
v-model="data.firstName"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('Last name')"
|
||||||
|
clearable
|
||||||
|
v-model="data.lastName"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.phone" :label="t('Business phone')" clearable />
|
<VnInput v-model="data.phone" :label="t('Business phone')" clearable />
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const quasar = useQuasar();
|
||||||
|
|
||||||
async function reactivateWorker() {
|
async function reactivateWorker() {
|
||||||
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
||||||
(data) => !data.ended
|
(data) => !data.ended,
|
||||||
);
|
);
|
||||||
if (hasToReactive) {
|
if (hasToReactive) {
|
||||||
quasar
|
quasar
|
||||||
|
@ -38,25 +38,25 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'started',
|
name: 'started',
|
||||||
label: t('worker.business.tableVisibleColumns.started'),
|
label: t('worker.business.tableVisibleColumns.started'),
|
||||||
align: 'left',
|
|
||||||
format: ({ started }) => toDate(started),
|
format: ({ started }) => toDate(started),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'ended',
|
name: 'ended',
|
||||||
label: t('worker.business.tableVisibleColumns.ended'),
|
label: t('worker.business.tableVisibleColumns.ended'),
|
||||||
align: 'left',
|
|
||||||
format: ({ ended }) => toDate(ended),
|
format: ({ ended }) => toDate(ended),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('worker.business.tableVisibleColumns.company'),
|
label: t('worker.business.tableVisibleColumns.company'),
|
||||||
align: 'left',
|
toolTip: t('worker.business.tableVisibleColumns.company'),
|
||||||
name: 'companyCodeFk',
|
name: 'companyCodeFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -65,23 +65,23 @@ const columns = computed(() => [
|
||||||
optionLabel: 'code',
|
optionLabel: 'code',
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '60px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'reasonEndFk',
|
name: 'reasonEndFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'BusinessReasonEnds',
|
url: 'BusinessReasonEnds',
|
||||||
fields: ['id', 'reason'],
|
fields: ['id', 'reason'],
|
||||||
optionLabel: 'reason',
|
optionLabel: 'reason',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'departmentFk',
|
name: 'departmentFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.department'),
|
label: t('worker.business.tableVisibleColumns.department'),
|
||||||
|
@ -89,15 +89,19 @@ const columns = computed(() => [
|
||||||
url: 'Departments',
|
url: 'Departments',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '80px',
|
||||||
|
format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerBusinessProfessionalCategoryFk',
|
name: 'workerBusinessProfessionalCategoryFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'WorkerBusinessProfessionalCategories',
|
url: 'WorkerBusinessProfessionalCategories',
|
||||||
fields: ['id', 'description', 'code'],
|
fields: ['id', 'description', 'code'],
|
||||||
|
@ -105,6 +109,9 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ professionalDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(professionalDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -118,6 +125,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ calendarTypeDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(calendarTypeDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -131,6 +140,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -144,6 +155,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -157,6 +169,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -165,6 +178,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -177,6 +191,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ workerBusinessTypeName }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(workerBusinessTypeName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -185,6 +201,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -193,6 +210,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'notes',
|
name: 'notes',
|
||||||
|
@ -208,7 +226,7 @@ const columns = computed(() => [
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerBusiness"
|
data-key="WorkerBusiness"
|
||||||
:url="`Workers/${entityId}/Business`"
|
:url="`Workers/${entityId}/getWorkerBusiness`"
|
||||||
save-url="/Businesses/crud"
|
save-url="/Businesses/crud"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: `Workers/${entityId}/Business`,
|
urlCreate: `Workers/${entityId}/Business`,
|
||||||
|
@ -218,13 +236,12 @@ const columns = computed(() => [
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="card"
|
|
||||||
auto-load
|
auto-load
|
||||||
:disable-option="{ table: true }"
|
:disable-option="{ card: true }"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
card-class="grid-two q-gutter-x-xl q-gutter-y-md q-pr-lg q-py-lg"
|
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search-icon="false"
|
||||||
@save-changes="(data) => reactivateWorker(data)"
|
@save-changes="(data) => reactivateWorker(data)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
class="ellipsis-text"
|
||||||
:label="t('globals.params.email')"
|
:label="t('globals.params.email')"
|
||||||
:value="entity.user?.emailUser?.email"
|
:value="entity.user?.emailUser?.email"
|
||||||
copy
|
copy
|
||||||
|
@ -177,6 +178,12 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
.photo {
|
.photo {
|
||||||
height: 256px;
|
height: 256px;
|
||||||
}
|
}
|
||||||
|
.ellipsis-text {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -12,6 +12,11 @@ const $props = defineProps({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" />
|
<WorkerDescriptor
|
||||||
|
v-if="$props.id"
|
||||||
|
:id="$props.id"
|
||||||
|
:summary="WorkerSummary"
|
||||||
|
data-key="WorkerDescriptorProxy"
|
||||||
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -54,9 +54,8 @@ watch(
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true }
|
{ immediate: true, deep: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -105,6 +104,7 @@ watch(
|
||||||
:options="trainsData"
|
:options="trainsData"
|
||||||
hide-selected
|
hide-selected
|
||||||
v-model="row.trainFk"
|
v-model="row.trainFk"
|
||||||
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -115,12 +115,14 @@ watch(
|
||||||
option-label="code"
|
option-label="code"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
v-model="row.itemPackingTypeFk"
|
v-model="row.itemPackingTypeFk"
|
||||||
|
:required="true"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('worker.operator.warehouse')"
|
:label="t('worker.operator.warehouse')"
|
||||||
:options="warehousesData"
|
:options="warehousesData"
|
||||||
hide-selected
|
hide-selected
|
||||||
v-model="row.warehouseFk"
|
v-model="row.warehouseFk"
|
||||||
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -175,6 +177,7 @@ watch(
|
||||||
:label="t('worker.operator.isOnReservationMode')"
|
:label="t('worker.operator.isOnReservationMode')"
|
||||||
v-model="row.isOnReservationMode"
|
v-model="row.isOnReservationMode"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
src/pages/Worker/Card/WorkerPBX.vue
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
import FormModel from 'src/components/FormModel.vue';
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -26,3 +26,8 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
It must be a 4-digit number and must not end in 00: Debe ser un número de 4 cifras y no terminar en 00
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -140,6 +140,7 @@ function reloadData() {
|
||||||
id="deviceProductionFk"
|
id="deviceProductionFk"
|
||||||
hide-selected
|
hide-selected
|
||||||
data-cy="pda-dialog-select"
|
data-cy="pda-dialog-select"
|
||||||
|
:required="true"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
|
||||||
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSection data-key="WorkerDepartment" :search-bar="false">
|
<QPage class="q-pa-md flex justify-center"> <WorkerDepartmentTree /> </QPage>
|
||||||
<template #body>
|
|
||||||
<div class="flex flex-center q-pa-md">
|
|
||||||
<WorkerDepartmentTree />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</VnSection>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -65,6 +65,7 @@ const tableFilter = {
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('list.id'),
|
label: t('list.id'),
|
||||||
chip: {
|
chip: {
|
||||||
|
@ -74,8 +75,6 @@ const columns = computed(() => [
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
columnClass: 'shrink-column',
|
|
||||||
component: 'number',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -107,6 +106,7 @@ const columns = computed(() => [
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
|
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
name: 'price',
|
name: 'price',
|
||||||
label: t('list.price'),
|
label: t('list.price'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -114,11 +114,9 @@ const columns = computed(() => [
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
columnClass: 'shrink-column',
|
|
||||||
component: 'number',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'left',
|
||||||
name: 'hour',
|
name: 'hour',
|
||||||
label: t('list.close'),
|
label: t('list.close'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -180,73 +178,67 @@ function formatRow(row) {
|
||||||
<ZoneFilterPanel data-key="ZonesList" />
|
<ZoneFilterPanel data-key="ZonesList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<div class="table-container">
|
<VnTable
|
||||||
<div class="column items-center">
|
ref="tableRef"
|
||||||
<VnTable
|
data-key="ZonesList"
|
||||||
ref="tableRef"
|
url="Zones"
|
||||||
data-key="ZonesList"
|
:create="{
|
||||||
url="Zones"
|
urlCreate: 'Zones',
|
||||||
:create="{
|
title: t('list.createZone'),
|
||||||
urlCreate: 'Zones',
|
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
||||||
title: t('list.createZone'),
|
formInitialData: {},
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
}"
|
||||||
formInitialData: {},
|
:user-filter="tableFilter"
|
||||||
}"
|
:columns="columns"
|
||||||
:user-filter="tableFilter"
|
redirect="zone"
|
||||||
:columns="columns"
|
:right-search="false"
|
||||||
redirect="zone"
|
>
|
||||||
:right-search="false"
|
<template #column-addressFk="{ row }">
|
||||||
table-height="85vh"
|
{{ dashIfEmpty(formatRow(row)) }}
|
||||||
order="id ASC"
|
</template>
|
||||||
>
|
<template #more-create-dialog="{ data }">
|
||||||
<template #column-addressFk="{ row }">
|
<VnSelect
|
||||||
{{ dashIfEmpty(formatRow(row)) }}
|
url="AgencyModes"
|
||||||
</template>
|
v-model="data.agencyModeFk"
|
||||||
<template #more-create-dialog="{ data }">
|
option-value="id"
|
||||||
<VnSelect
|
option-label="name"
|
||||||
url="AgencyModes"
|
:label="t('list.agency')"
|
||||||
v-model="data.agencyModeFk"
|
/>
|
||||||
option-value="id"
|
<VnInput
|
||||||
option-label="name"
|
v-model="data.price"
|
||||||
:label="t('list.agency')"
|
:label="t('list.price')"
|
||||||
/>
|
min="0"
|
||||||
<VnInput
|
type="number"
|
||||||
v-model="data.price"
|
required="true"
|
||||||
:label="t('list.price')"
|
/>
|
||||||
min="0"
|
<VnInput
|
||||||
type="number"
|
v-model="data.bonus"
|
||||||
required="true"
|
:label="t('zone.bonus')"
|
||||||
/>
|
min="0"
|
||||||
<VnInput
|
type="number"
|
||||||
v-model="data.bonus"
|
/>
|
||||||
:label="t('zone.bonus')"
|
<VnInput
|
||||||
min="0"
|
v-model="data.travelingDays"
|
||||||
type="number"
|
:label="t('zone.travelingDays')"
|
||||||
/>
|
type="number"
|
||||||
<VnInput
|
min="0"
|
||||||
v-model="data.travelingDays"
|
/>
|
||||||
:label="t('zone.travelingDays')"
|
<VnInputTime v-model="data.hour" :label="t('list.close')" />
|
||||||
type="number"
|
<VnSelect
|
||||||
min="0"
|
url="Warehouses"
|
||||||
/>
|
v-model="data.warehouseFK"
|
||||||
<VnInputTime v-model="data.hour" :label="t('list.close')" />
|
option-value="id"
|
||||||
<VnSelect
|
option-label="name"
|
||||||
url="Warehouses"
|
:label="t('list.warehouse')"
|
||||||
v-model="data.warehouseFK"
|
:options="warehouseOptions"
|
||||||
option-value="id"
|
/>
|
||||||
option-label="name"
|
<QCheckbox
|
||||||
:label="t('list.warehouse')"
|
v-model="data.isVolumetric"
|
||||||
:options="warehouseOptions"
|
:label="t('list.isVolumetric')"
|
||||||
/>
|
:toggle-indeterminate="false"
|
||||||
<QCheckbox
|
/>
|
||||||
v-model="data.isVolumetric"
|
</template>
|
||||||
:label="t('list.isVolumetric')"
|
</VnTable>
|
||||||
:toggle-indeterminate="false"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -254,20 +246,3 @@ es:
|
||||||
Search zone: Buscar zona
|
Search zone: Buscar zona
|
||||||
You can search zones by id or name: Puedes buscar zonas por id o nombre
|
You can search zones by id or name: Puedes buscar zonas por id o nombre
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.table-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.column {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
min-width: 70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.shrink-column) {
|
|
||||||
width: 8%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
reports/*
|
reports/*
|
||||||
|
videos/*
|
||||||
screenshots/*
|
screenshots/*
|
||||||
downloads/*
|
downloads/*
|
||||||
|
storage/*
|
||||||
|
reports/*
|
||||||
|
docker/logs/*
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
{
|
||||||
|
"db": {
|
||||||
|
"connector": "memory",
|
||||||
|
"timezone": "local"
|
||||||
|
},
|
||||||
|
"vn": {
|
||||||
|
"connector": "vn-mysql",
|
||||||
|
"database": "vn",
|
||||||
|
"debug": false,
|
||||||
|
"host": "db",
|
||||||
|
"port": "3306",
|
||||||
|
"username": "root",
|
||||||
|
"password": "root",
|
||||||
|
"connectionLimit": 100,
|
||||||
|
"queueLimit": 100,
|
||||||
|
"multipleStatements": true,
|
||||||
|
"legacyUtcDateProcessing": false,
|
||||||
|
"timezone": "local",
|
||||||
|
"connectTimeout": 40000,
|
||||||
|
"acquireTimeout": 90000,
|
||||||
|
"waitForConnections": true,
|
||||||
|
"maxIdleTime": 60000,
|
||||||
|
"idleTimeout": 60000
|
||||||
|
},
|
||||||
|
"osticket": {
|
||||||
|
"connector": "memory",
|
||||||
|
"timezone": "local"
|
||||||
|
},
|
||||||
|
"tempStorage": {
|
||||||
|
"name": "tempStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/tmp",
|
||||||
|
"maxFileSize": "262144000",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"application/x-7z-compressed",
|
||||||
|
"application/x-zip-compressed",
|
||||||
|
"application/x-rar-compressed",
|
||||||
|
"application/octet-stream",
|
||||||
|
"application/pdf",
|
||||||
|
"application/zip",
|
||||||
|
"application/rar",
|
||||||
|
"multipart/x-zip",
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp",
|
||||||
|
"video/mp4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dmsStorage": {
|
||||||
|
"name": "dmsStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/dms",
|
||||||
|
"maxFileSize": "262144000",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"application/x-7z-compressed",
|
||||||
|
"application/x-zip-compressed",
|
||||||
|
"application/x-rar-compressed",
|
||||||
|
"application/octet-stream",
|
||||||
|
"application/pdf",
|
||||||
|
"application/zip",
|
||||||
|
"application/rar",
|
||||||
|
"multipart/x-zip",
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"imageStorage": {
|
||||||
|
"name": "imageStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/image",
|
||||||
|
"maxFileSize": "52428800",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"invoiceStorage": {
|
||||||
|
"name": "invoiceStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/pdfs/invoice",
|
||||||
|
"maxFileSize": "52428800",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"application/octet-stream",
|
||||||
|
"application/pdf"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"claimStorage": {
|
||||||
|
"name": "claimStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/dms",
|
||||||
|
"maxFileSize": "31457280",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp",
|
||||||
|
"video/mp4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"entryStorage": {
|
||||||
|
"name": "entryStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/dms",
|
||||||
|
"maxFileSize": "31457280",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp",
|
||||||
|
"video/mp4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"supplierStorage": {
|
||||||
|
"name": "supplierStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/dms",
|
||||||
|
"maxFileSize": "31457280",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"image/png",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/jpg",
|
||||||
|
"image/webp",
|
||||||
|
"video/mp4",
|
||||||
|
"application/pdf"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"accessStorage": {
|
||||||
|
"name": "accessStorage",
|
||||||
|
"connector": "loopback-component-storage",
|
||||||
|
"provider": "filesystem",
|
||||||
|
"root": "./storage/access",
|
||||||
|
"maxFileSize": "524288000",
|
||||||
|
"allowedContentTypes": [
|
||||||
|
"application/x-7z-compressed"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
version: '3.7'
|
||||||
|
services:
|
||||||
|
back:
|
||||||
|
image: registry.verdnatura.es/salix-back:dev
|
||||||
|
volumes:
|
||||||
|
- ./test/cypress/storage:/salix/storage
|
||||||
|
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
dns_search: .
|
||||||
|
front:
|
||||||
|
image: lilium-dev:latest
|
||||||
|
command: pnpm exec quasar dev
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
environment:
|
||||||
|
- CI
|
||||||
|
- TZ
|
||||||
|
dns_search: .
|
||||||
|
db:
|
||||||
|
image: registry.verdnatura.es/salix-db:dev
|
|
@ -41,7 +41,7 @@ describe('OrderCatalog', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
|
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control',
|
||||||
).type('{enter}');
|
).type('{enter}');
|
||||||
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
|
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
|
||||||
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
describe('ClaimNotes', () => {
|
||||||
|
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
||||||
|
const url = '/#/account/1/summary';
|
||||||
|
|
||||||
|
it('should see all the account options', () => {
|
||||||
|
cy.login('itManagement');
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(descriptorOptions)
|
||||||
|
.find('.q-item')
|
||||||
|
.its('length')
|
||||||
|
.then((count) => {
|
||||||
|
cy.log('Número de opciones:', count);
|
||||||
|
expect(count).to.equal(5);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not see any option', () => {
|
||||||
|
cy.login('salesPerson');
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(descriptorOptions).should('not.be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('ClaimAction', () => {
|
describe('ClaimAction', () => {
|
||||||
const claimId = 2;
|
const claimId = 1;
|
||||||
|
|
||||||
const firstRow = 'tbody > :nth-child(1)';
|
const firstRow = 'tbody > :nth-child(1)';
|
||||||
const destinationRow = '.q-item__section > .q-field';
|
const destinationRow = '.q-item__section > .q-field';
|
||||||
|
@ -24,9 +24,9 @@ describe('ClaimAction', () => {
|
||||||
const rowData = [true];
|
const rowData = [true];
|
||||||
|
|
||||||
cy.fillRow(firstRow, rowData);
|
cy.fillRow(firstRow, rowData);
|
||||||
cy.get('[title="Change destination"]').click();
|
cy.get('[title="Change destination"]').click({ force: true });
|
||||||
cy.selectOption(destinationRow, 'Confeccion');
|
cy.selectOption(destinationRow, 'Confeccion');
|
||||||
cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
|
cy.get('.q-card > .q-card__actions > .q-btn--standard').click({ force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should regularize', () => {
|
it('should regularize', () => {
|
||||||
|
|
|
@ -8,7 +8,11 @@ describe('ClaimNotes', () => {
|
||||||
|
|
||||||
it('should add a new note', () => {
|
it('should add a new note', () => {
|
||||||
const message = 'This is a new message.';
|
const message = 'This is a new message.';
|
||||||
cy.get('.q-textarea').type(message);
|
cy.get('.q-textarea')
|
||||||
|
.should('be.visible')
|
||||||
|
.should('not.be.disabled')
|
||||||
|
.type(message);
|
||||||
|
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.get(firstNote).should('have.text', message);
|
cy.get(firstNote).should('have.text', message);
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,14 +23,12 @@ 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(
|
cy.get(':nth-last-child(1) > .q-card').click();
|
||||||
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
|
|
||||||
).click();
|
|
||||||
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
|
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
|
||||||
'be.visible'
|
'be.visible'
|
||||||
);
|
);
|
||||||
|
|
||||||
cy.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click();
|
cy.get('.q-carousel__control > button').click();
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
|
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
|
||||||
|
@ -42,7 +40,7 @@ describe.skip('ClaimPhoto', () => {
|
||||||
|
|
||||||
it('should remove third and fourth file', () => {
|
it('should remove third and fourth file', () => {
|
||||||
cy.get(
|
cy.get(
|
||||||
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
|
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon'
|
||||||
).click();
|
).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'
|
||||||
|
@ -50,7 +48,7 @@ describe.skip('ClaimPhoto', () => {
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data deleted');
|
cy.get('.q-notification__message').should('have.text', 'Data deleted');
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
|
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon'
|
||||||
).click();
|
).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'
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe('Client basic data', () => {
|
||||||
it('Should load layout', () => {
|
it('Should load layout', () => {
|
||||||
cy.get('.q-card').should('be.visible');
|
cy.get('.q-card').should('be.visible');
|
||||||
cy.dataCy('customerPhone').find('input').should('be.visible');
|
cy.dataCy('customerPhone').find('input').should('be.visible');
|
||||||
cy.dataCy('customerPhone').find('input').type('123456789');
|
cy.dataCy('customerPhone').find('input').clear().type('123456789');
|
||||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||||
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
|
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
|
||||||
const { body } = req;
|
const { body } = req;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('Client list', () => {
|
describe('Client list', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/#/customer/list', {
|
cy.visit('/#/customer/list', {
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
|
@ -28,7 +27,7 @@ describe('Client list', () => {
|
||||||
Email: { val: `user.test${randomInt}@cypress.com` },
|
Email: { val: `user.test${randomInt}@cypress.com` },
|
||||||
'Sales person': { val: 'salesPerson', type: 'select' },
|
'Sales person': { val: 'salesPerson', type: 'select' },
|
||||||
Location: { val: '46000', type: 'select' },
|
Location: { val: '46000', type: 'select' },
|
||||||
'Business type': { val: 'Otros', type: 'select' },
|
'Business type': { val: 'others', type: 'select' },
|
||||||
};
|
};
|
||||||
cy.fillInForm(data);
|
cy.fillInForm(data);
|
||||||
|
|
||||||
|
@ -37,6 +36,7 @@ describe('Client list', () => {
|
||||||
cy.checkNotification('Data created');
|
cy.checkNotification('Data created');
|
||||||
cy.url().should('include', '/summary');
|
cy.url().should('include', '/summary');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Client list search client', () => {
|
it('Client list search client', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
|
@ -59,6 +59,7 @@ describe('Client list', () => {
|
||||||
cy.checkValueForm(1, search);
|
cy.checkValueForm(1, search);
|
||||||
cy.checkValueForm(2, search);
|
cy.checkValueForm(2, search);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Client founded create order', () => {
|
it('Client founded create order', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
|
|
|
@ -184,9 +184,8 @@ describe('Entry', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteEntry() {
|
function deleteEntry() {
|
||||||
cy.get('[data-cy="descriptor-more-opts"]').click();
|
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
|
||||||
cy.waitForElement('div[data-cy="delete-entry"]');
|
cy.waitForElement('div[data-cy="delete-entry"]').click();
|
||||||
cy.get('div[data-cy="delete-entry"]').should('be.visible').click();
|
|
||||||
cy.url().should('include', 'list');
|
cy.url().should('include', 'list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe('EntryStockBought', () => {
|
||||||
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
|
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
|
||||||
cy.get('input[name="reserve"]').type('10{enter}');
|
cy.get('input[name="reserve"]').type('10{enter}');
|
||||||
cy.get('button[title="Save"]').click();
|
cy.get('button[title="Save"]').click();
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
cy.checkNotification('Data saved');
|
||||||
});
|
});
|
||||||
it('Should add a new reserved space for buyerBoss', () => {
|
it('Should add a new reserved space for buyerBoss', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceOut list', () => {
|
describe('InvoiceOut list', () => {
|
||||||
const serial = 'Española rapida';
|
const serial = 'Española rapida';
|
||||||
|
const columnCheckbox =
|
||||||
|
'.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner';
|
||||||
|
const firstRowDescriptor =
|
||||||
|
'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link';
|
||||||
|
const firstRowCheckbox =
|
||||||
|
'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner ';
|
||||||
|
const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon';
|
||||||
|
const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
|
||||||
|
const firstSummaryIcon =
|
||||||
|
':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
@ -9,18 +19,32 @@ describe('InvoiceOut list', () => {
|
||||||
cy.typeSearchbar('{enter}');
|
cy.typeSearchbar('{enter}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search and filter an invoice and enter to the summary', () => {
|
it('should download one pdf from the subtoolbar button', () => {
|
||||||
cy.typeSearchbar('1{enter}');
|
cy.get(firstRowCheckbox).click();
|
||||||
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
|
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||||
cy.get('.header > a.q-btn > .q-btn__content').click();
|
|
||||||
cy.typeSearchbar('{enter}');
|
|
||||||
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should download all pdfs', () => {
|
it('should download all pdfs', () => {
|
||||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
cy.get(columnCheckbox).click();
|
||||||
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
});
|
||||||
|
|
||||||
|
it('should open the invoice descriptor from table icon', () => {
|
||||||
|
cy.get(firstSummaryIcon).click();
|
||||||
|
cy.get('.cardSummary').should('be.visible');
|
||||||
|
cy.get('.summaryHeader > div').should('include.text', 'A1111111');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open the client descriptor', () => {
|
||||||
|
cy.get(firstRowDescriptor).click();
|
||||||
|
cy.get(summaryPopupIcon).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter the results by client ID, then check the first result is correct', () => {
|
||||||
|
cy.dataCy('Customer ID_input').type('1103');
|
||||||
|
cy.get(filterBtn).click();
|
||||||
|
cy.get(firstRowDescriptor).click();
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '1103');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
|
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
|
||||||
|
@ -31,11 +55,14 @@ describe('InvoiceOut list', () => {
|
||||||
cy.checkNotification('This ticket is already invoiced');
|
cy.checkNotification('This ticket is already invoiced');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a manual invoice and enter to its summary', () => {
|
it('should create a manual invoice and enter to its summary, then delete that invoice', () => {
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
cy.dataCy('InvoiceOutCreateTicketinput').type(8);
|
cy.dataCy('InvoiceOutCreateTicketinput').type(9);
|
||||||
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
|
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
|
||||||
cy.dataCy('FormModelPopup_save').click();
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
cy.checkNotification('Data created');
|
cy.checkNotification('Data created');
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceOut negative bases', () => {
|
describe('InvoiceOut negative bases', () => {
|
||||||
|
const getDescriptors = (opt) =>
|
||||||
|
`:nth-child(1) > [data-col-field="${opt}"] > .no-padding > .link`;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/negative-bases`);
|
cy.visit(`/#/invoice-out/negative-bases`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should open the posible descriptors', () => {
|
||||||
|
cy.get(getDescriptors('clientId')).click();
|
||||||
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '1101');
|
||||||
|
cy.get(getDescriptors('ticketFk')).click();
|
||||||
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '23');
|
||||||
|
cy.get(getDescriptors('workerName')).click();
|
||||||
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '18');
|
||||||
|
});
|
||||||
|
|
||||||
it('should filter and download as CSV', () => {
|
it('should filter and download as CSV', () => {
|
||||||
cy.get('input[name="ticketFk"]').type('23{enter}');
|
cy.get('input[name="ticketFk"]').type('23{enter}');
|
||||||
cy.get('#subToolbar > .q-btn').click();
|
cy.get('#subToolbar > .q-btn').click();
|
||||||
|
|
|
@ -1,44 +1,95 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceOut summary', () => {
|
describe.skip('InvoiceOut summary', () => {
|
||||||
const transferInvoice = {
|
const transferInvoice = {
|
||||||
Client: { val: 'employee', type: 'select' },
|
Client: { val: 'employee', type: 'select' },
|
||||||
Type: { val: 'Error in customer data', type: 'select' },
|
Type: { val: 'Error in customer data', type: 'select' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const firstRowDescriptors = (opt) =>
|
||||||
|
`tbody > :nth-child(1) > :nth-child(${opt}) > .q-btn`;
|
||||||
|
const toCustomerSummary = '[href="#/customer/1101"]';
|
||||||
|
const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]';
|
||||||
|
const selectMenuOption = (opt) => `.q-menu > .q-list > :nth-child(${opt})`;
|
||||||
|
const confirmSend = '.q-btn--unelevated';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/list`);
|
cy.visit(`/#/invoice-out/1/summary`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should generate the invoice PDF', () => {
|
it('open the descriptors', () => {
|
||||||
cy.typeSearchbar('T1111111{enter}');
|
cy.get(firstRowDescriptors(1)).click();
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.get('.descriptor').should('be.visible');
|
||||||
cy.get('.q-menu > .q-list > :nth-child(6)').click();
|
cy.get('.q-item > .q-item__label').should('include.text', '1');
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.get(firstRowDescriptors(2)).click();
|
||||||
cy.checkNotification('The invoice PDF document has been regenerated');
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '1101');
|
||||||
});
|
});
|
||||||
it('should refund the invoice ', () => {
|
|
||||||
|
it('should open the client summary and the ticket list', () => {
|
||||||
|
cy.get(toCustomerSummary).click();
|
||||||
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.get('.q-item > .q-item__label').should('include.text', '1101');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open the ticket list', () => {
|
||||||
|
cy.get(toTicketList).click();
|
||||||
|
cy.get('.descriptor').should('be.visible');
|
||||||
|
cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should transfer the invoice ', () => {
|
||||||
cy.typeSearchbar('T1111111{enter}');
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
cy.get(selectMenuOption(1)).click();
|
||||||
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
cy.fillInForm(transferInvoice);
|
||||||
cy.checkNotification('The following refund ticket have been created');
|
cy.get('.q-mt-lg > .q-btn').click();
|
||||||
|
cy.checkNotification('Transferred invoice');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should send the invoice as PDF', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(selectMenuOption(3)).click();
|
||||||
|
cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
|
||||||
|
cy.get(confirmSend).click();
|
||||||
|
cy.checkNotification('Notification sent');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should send the invoice as CSV', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(selectMenuOption(3)).click();
|
||||||
|
cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
|
||||||
|
cy.get(confirmSend).click();
|
||||||
|
cy.checkNotification('Notification sent');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete an invoice ', () => {
|
it('should delete an invoice ', () => {
|
||||||
cy.typeSearchbar('T2222222{enter}');
|
cy.typeSearchbar('T2222222{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
cy.get(selectMenuOption(4)).click();
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.checkNotification('InvoiceOut deleted');
|
cy.checkNotification('InvoiceOut deleted');
|
||||||
});
|
});
|
||||||
it('should transfer the invoice ', () => {
|
|
||||||
cy.typeSearchbar('T1111111{enter}');
|
it('should book the invoice', () => {
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
cy.get(selectMenuOption(5)).click();
|
||||||
cy.fillInForm(transferInvoice);
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.get('.q-mt-lg > .q-btn').click();
|
cy.checkNotification('InvoiceOut booked');
|
||||||
cy.checkNotification('Transferred invoice');
|
});
|
||||||
|
|
||||||
|
it('should generate the invoice PDF', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(selectMenuOption(6)).click();
|
||||||
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
|
cy.checkNotification('The invoice PDF document has been regenerated');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should refund the invoice ', () => {
|
||||||
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
|
cy.get(selectMenuOption(7)).click();
|
||||||
|
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||||
|
cy.checkNotification('The following refund ticket have been created');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,36 +1,33 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('Item tag', () => {
|
describe('Item tag', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/item/1/tags`);
|
cy.visit(`/#/item/1/tags`);
|
||||||
|
cy.get('.q-page').should('be.visible');
|
||||||
|
cy.waitForElement('[data-cy="itemTags"]');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const createNewTag = 'createNewTag';
|
||||||
|
const saveBtn = 'crudModelDefaultSaveBtn';
|
||||||
|
const newTag = 'tagundefined';
|
||||||
|
|
||||||
it('should throw an error adding an existent tag', () => {
|
it('should throw an error adding an existent tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.dataCy(createNewTag).click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy(newTag).should('be.visible').click().type('Genero{enter}');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy('tagGeneroValue').eq(1).should('be.visible');
|
||||||
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
cy.dataCy(saveBtn).click();
|
||||||
cy.get('.q-menu .q-item').contains('Tallos').click();
|
|
||||||
cy.get(':nth-child(8) > [label="Value"]').type('1');
|
|
||||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
|
||||||
cy.checkNotification("The tag or priority can't be repeated for an item");
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a new tag', () => {
|
it('should add a new tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.dataCy(createNewTag).click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy(newTag).should('be.visible').click().type('Forma{enter}');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy('tagFormaValue').should('be.visible').type('50');
|
||||||
cy.dataCy('Tag_select').eq(7).click();
|
cy.dataCy(saveBtn).click();
|
||||||
cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
|
|
||||||
cy.get(':nth-child(8) > [label="Value"]').type('50');
|
|
||||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
cy.dataCy('itemTags')
|
cy.dataCy('deleteTagForma').should('be.visible').click();
|
||||||
.children(':nth-child(8)')
|
cy.dataCy('VnConfirm_confirm').should('be.visible').click();
|
||||||
.find('.justify-center > .q-icon')
|
|
||||||
.click();
|
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe('Recover Password', () => {
|
||||||
it('should change password to user', () => {
|
it('should change password to user', () => {
|
||||||
// Get token from mail
|
// Get token from mail
|
||||||
cy.request(
|
cy.request(
|
||||||
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||||
).then((response) => {
|
).then((response) => {
|
||||||
const regex = /access_token=([a-zA-Z0-9]+)/;
|
const regex = /access_token=([a-zA-Z0-9]+)/;
|
||||||
const [match] = response.body[0].body.match(regex);
|
const [match] = response.body[0].body.match(regex);
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe('Two Factor', () => {
|
||||||
it('should enable two factor to sysadmin', () => {
|
it('should enable two factor to sysadmin', () => {
|
||||||
cy.request(
|
cy.request(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
`http://localhost:3000/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
|
`/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
|
||||||
{ twoFactor: 'email' }
|
{ twoFactor: 'email' }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -41,7 +41,7 @@ describe('Two Factor', () => {
|
||||||
|
|
||||||
// Get code from mail
|
// Get code from mail
|
||||||
cy.request(
|
cy.request(
|
||||||
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||||
).then((response) => {
|
).then((response) => {
|
||||||
const tempDiv = document.createElement('div');
|
const tempDiv = document.createElement('div');
|
||||||
tempDiv.innerHTML = response.body[0].body;
|
tempDiv.innerHTML = response.body[0].body;
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('ParkingBasicData', () => {
|
|
||||||
const codeInput = 'form .q-card .q-input input';
|
|
||||||
const sectorSelect = 'form .q-card .q-select input';
|
|
||||||
const sectorOpt = '.q-menu .q-item';
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.visit(`/#/shelving/parking/1/basic-data`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should edit the code and sector', () => {
|
|
||||||
cy.get(sectorSelect).type('Second');
|
|
||||||
cy.get(sectorOpt).click();
|
|
||||||
|
|
||||||
cy.get(codeInput).eq(0).clear();
|
|
||||||
cy.get(codeInput).eq(0).type('900-001');
|
|
||||||
|
|
||||||
cy.saveCard();
|
|
||||||
|
|
||||||
cy.get(sectorSelect).should('have.value', 'Second sector');
|
|
||||||
cy.get(codeInput).should('have.value', '900-001');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,33 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('ParkingList', () => {
|
|
||||||
const searchbar = '#searchbar input';
|
|
||||||
const firstCard = '.q-card:nth-child(1)';
|
|
||||||
const firstChipId =
|
|
||||||
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
|
||||||
const firstDetailBtn =
|
|
||||||
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
|
|
||||||
const summaryHeader = '.summaryBody .header';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.login('developer');
|
|
||||||
cy.visit(`/#/shelving/parking/list`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should redirect on clicking a parking', () => {
|
|
||||||
cy.get(searchbar).type('{enter}');
|
|
||||||
cy.get(firstChipId)
|
|
||||||
.invoke('text')
|
|
||||||
.then((content) => {
|
|
||||||
const id = content.substring(4);
|
|
||||||
cy.get(firstCard).click();
|
|
||||||
cy.url().should('include', `/parking/${id}/summary`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should open the details', () => {
|
|
||||||
cy.get(searchbar).type('{enter}');
|
|
||||||
cy.get(firstDetailBtn).click();
|
|
||||||
cy.get(summaryHeader).contains('Basic data');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('AgencyWorkCenter', () => {
|
describe.skip('AgencyWorkCenter', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('Route extended list', () => {
|
describe.skip('Route extended list', () => {
|
||||||
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
|
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe('Route', () => {
|
||||||
|
|
||||||
it('Route list create route', () => {
|
it('Route list create route', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
cy.get('input[name="description"]').type('routeTestOne{enter}');
|
cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||||
cy.url().should('include', '/summary');
|
cy.url().should('include', '/summary');
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ParkingBasicData', () => {
|
||||||
|
const codeInput = 'form .q-card .q-input input';
|
||||||
|
const sectorSelect = 'form .q-card .q-select input';
|
||||||
|
const sectorOpt = '.q-menu .q-item';
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/shelving/parking/1/basic-data`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should give an error if the code aldready exists', () => {
|
||||||
|
cy.get(codeInput).eq(0).should('have.value', '700-01').clear();
|
||||||
|
cy.get(codeInput).eq(0).type('700-02');
|
||||||
|
cy.saveCard();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'The code already exists');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should edit the code and sector', () => {
|
||||||
|
cy.get(sectorSelect).type('First');
|
||||||
|
cy.get(sectorOpt).click();
|
||||||
|
|
||||||
|
cy.get(codeInput).eq(0).clear();
|
||||||
|
cy.get(codeInput).eq(0).type('700-01');
|
||||||
|
cy.dataCy('Picking order_input').clear().type(80230);
|
||||||
|
|
||||||
|
cy.saveCard();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||||
|
cy.get(sectorSelect).should('have.value', 'First sector');
|
||||||
|
cy.get(codeInput).should('have.value', '700-01');
|
||||||
|
cy.dataCy('Picking order_input').should('have.value', 80230);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,30 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ParkingList', () => {
|
||||||
|
const searchbar = '#searchbar input';
|
||||||
|
const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
|
||||||
|
const summaryHeader = '.summaryBody .header';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/shelving/parking/list`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect on clicking a parking', () => {
|
||||||
|
cy.get(searchbar).type('{enter}');
|
||||||
|
cy.get(firstCard).click();
|
||||||
|
cy.get(summaryHeader).contains('Basic data');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter and redirect if there is only one result', () => {
|
||||||
|
cy.dataCy('Code_input').type('1{enter}');
|
||||||
|
cy.dataCy('Sector_select').type('Normal{enter}');
|
||||||
|
cy.get(summaryHeader).contains('Basic data');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter and redirect to summary if only one result', () => {
|
||||||
|
cy.dataCy('Code_input').type('A{enter}');
|
||||||
|
cy.dataCy('Sector_select').type('First Sector{enter}');
|
||||||
|
cy.url().should('match', /\/shelving\/parking\/\d+\/summary/);
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,7 +1,7 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
describe('TicketSale', () => {
|
describe('TicketSale', () => {
|
||||||
describe('Free ticket #31', () => {
|
describe.skip('Free ticket #31', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
@ -121,7 +121,7 @@ describe('TicketSale', () => {
|
||||||
cy.url().should('match', /\/ticket\/31\/log/);
|
cy.url().should('match', /\/ticket\/31\/log/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('Ticket prepared #23', () => {
|
describe.skip('Ticket prepared #23', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
|
|
@ -40,7 +40,7 @@ describe('VnLocation', () => {
|
||||||
cy.selectOption(countrySelector, country);
|
cy.selectOption(countrySelector, country);
|
||||||
cy.dataCy('locationProvince').type(`${province}{enter}`);
|
cy.dataCy('locationProvince').type(`${province}{enter}`);
|
||||||
cy.get(
|
cy.get(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `,
|
||||||
).click();
|
).click();
|
||||||
cy.dataCy('locationProvince').should('have.value', province);
|
cy.dataCy('locationProvince').should('have.value', province);
|
||||||
});
|
});
|
||||||
|
@ -87,7 +87,7 @@ describe('VnLocation', () => {
|
||||||
.get(':nth-child(1)')
|
.get(':nth-child(1)')
|
||||||
.should('have.length.at.least', 2);
|
.should('have.length.at.least', 2);
|
||||||
cy.get(
|
cy.get(
|
||||||
firstOption.concat(' > .q-item__section > .q-item__label--caption')
|
firstOption.concat(' > .q-item__section > .q-item__label--caption'),
|
||||||
).should('have.text', postCodeLabel);
|
).should('have.text', postCodeLabel);
|
||||||
cy.get(firstOption).click();
|
cy.get(firstOption).click();
|
||||||
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
|
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
|
||||||
|
@ -103,7 +103,7 @@ describe('VnLocation', () => {
|
||||||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||||
province
|
province,
|
||||||
);
|
);
|
||||||
cy.get(dialogInputs).eq(0).clear();
|
cy.get(dialogInputs).eq(0).clear();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
|
@ -156,7 +156,7 @@ describe('VnLocation', () => {
|
||||||
cy.get(createLocationButton).click();
|
cy.get(createLocationButton).click();
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
||||||
'España'
|
'España',
|
||||||
);
|
);
|
||||||
cy.dataCy('Province_icon').click();
|
cy.dataCy('Province_icon').click();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('WorkerCreate', () => {
|
describe.skip('WorkerCreate', () => {
|
||||||
const externalRadio = '.q-radio:nth-child(2)';
|
const externalRadio = '.q-radio:nth-child(2)';
|
||||||
const developerBossId = 120;
|
const developerBossId = 120;
|
||||||
const payMethodCross =
|
const payMethodCross =
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe('WorkerNotificationsManager', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should active a notification that is yours', () => {
|
it.skip('should active a notification that is yours', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/worker/${developerId}/notifications`);
|
cy.visit(`/#/worker/${developerId}/notifications`);
|
||||||
cy.waitForElement(activeList);
|
cy.waitForElement(activeList);
|
||||||
|
|
|
@ -3,7 +3,7 @@ describe('ZoneWarehouse', () => {
|
||||||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||||
};
|
};
|
||||||
|
|
||||||
const dataError = 'ER_DUP_ENTRY: Duplicate entry';
|
const dataError = 'The introduced warehouse already exists';
|
||||||
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
// DO NOT REMOVE
|
// DO NOT REMOVE
|
||||||
// Imports Quasar Cypress AE predefined commands
|
// Imports Quasar Cypress AE predefined commands
|
||||||
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
|
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
|
||||||
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, require('./waitUntil'));
|
import waitUntil from './waitUntil';
|
||||||
|
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, waitUntil);
|
||||||
|
|
||||||
Cypress.Commands.add('resetDB', () => {
|
Cypress.Commands.add('resetDB', () => {
|
||||||
cy.exec('pnpm run resetDatabase');
|
cy.exec('pnpm run resetDatabase');
|
||||||
});
|
});
|
||||||
|
@ -57,7 +59,7 @@ Cypress.Commands.add('login', (user) => {
|
||||||
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
||||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
|
Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
|
||||||
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -110,7 +112,7 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
|
||||||
.find((item) => item.innerText.includes(option));
|
.find((item) => item.innerText.includes(option));
|
||||||
if (matchingItem) return cy.wrap(matchingItem).click();
|
if (matchingItem) return cy.wrap(matchingItem).click();
|
||||||
|
|
||||||
if (hasWrite) cy.get(selector).clear().type(option, { delay: 0 });
|
if (hasWrite) cy.get(selector).clear().type(option);
|
||||||
return selectItem(selector, option, ariaControl, false);
|
return selectItem(selector, option, ariaControl, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -321,18 +323,18 @@ Cypress.Commands.add('clickButtonDescriptor', (id) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('openUserPanel', () => {
|
Cypress.Commands.add('openUserPanel', () => {
|
||||||
cy.get(
|
cy.dataCy('userPanel_btn').click();
|
||||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',
|
|
||||||
).click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('checkNotification', (text) => {
|
Cypress.Commands.add('checkNotification', (text) => {
|
||||||
cy.get('.q-notification')
|
cy.get('.q-notification', { timeout: 10000 })
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.last()
|
.should('have.length.greaterThan', 0)
|
||||||
.then(($lastNotification) => {
|
.should(($elements) => {
|
||||||
if (!Cypress.$($lastNotification).text().includes(text))
|
const found = $elements
|
||||||
throw new Error(`Notification not found: "${text}"`);
|
.toArray()
|
||||||
|
.some((el) => Cypress.$(el).text().includes(text));
|
||||||
|
expect(found).to.be.true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -379,7 +381,13 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
||||||
cy.get(`.q-icon.${iconClass}`).parent().click();
|
cy.waitForElement('[data-cy="descriptor_actions"]');
|
||||||
|
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
|
||||||
|
cy.get('.q-btn')
|
||||||
|
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
|
||||||
|
.then(($btn) => {
|
||||||
|
cy.wrap($btn).click();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
|
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
|
||||||
cy.get('.q-btn').contains(buttonText).click();
|
cy.get('.q-btn').contains(buttonText).click();
|
||||||
|
|
|
@ -27,7 +27,17 @@ function randomNumber(options = { length: 10 }) {
|
||||||
|
|
||||||
function randomizeValue(characterSet, options) {
|
function randomizeValue(characterSet, options) {
|
||||||
return Array.from({ length: options.length }, () =>
|
return Array.from({ length: options.length }, () =>
|
||||||
characterSet.charAt(Math.floor(Math.random() * characterSet.length))
|
characterSet.charAt(Math.floor(Math.random() * characterSet.length)),
|
||||||
).join('');
|
).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.innerHTML = `
|
||||||
|
* {
|
||||||
|
transition: none !important;
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
|
||||||
export { randomString, randomNumber, randomizeValue };
|
export { randomString, randomNumber, randomizeValue };
|
||||||
|
|
|
@ -5,9 +5,21 @@ import jsconfigPaths from 'vite-jsconfig-paths';
|
||||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
let reporters,
|
||||||
|
outputFile;
|
||||||
|
|
||||||
|
if (process.env.CI) {
|
||||||
|
reporters = ['junit', 'default'];
|
||||||
|
outputFile = {junit: './junit/vitest.xml'};
|
||||||
|
} else {
|
||||||
|
reporters = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
reporters,
|
||||||
|
outputFile,
|
||||||
environment: 'happy-dom',
|
environment: 'happy-dom',
|
||||||
setupFiles: 'test/vitest/setup-file.js',
|
setupFiles: 'test/vitest/setup-file.js',
|
||||||
include: [
|
include: [
|
||||||
|
|
Loading…
Reference in New Issue