Merge branch 'dev' into 6629-addressObservation
This commit is contained in:
commit
e024d37f77
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
||||||
// This option interrupts the configuration hierarchy at this file
|
// This option interrupts the configuration hierarchy at this file
|
||||||
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
||||||
|
@ -58,7 +58,7 @@ module.exports = {
|
||||||
rules: {
|
rules: {
|
||||||
'prefer-promise-reject-errors': 'off',
|
'prefer-promise-reject-errors': 'off',
|
||||||
'no-unused-vars': 'warn',
|
'no-unused-vars': 'warn',
|
||||||
"vue/no-multiple-template-root": "off" ,
|
'vue/no-multiple-template-root': 'off',
|
||||||
// allow debugger during development only
|
// allow debugger during development only
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
},
|
},
|
|
@ -1,23 +1,24 @@
|
||||||
const fs = require('fs');
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||||
const path = require('path');
|
import { join, resolve } from 'path';
|
||||||
|
|
||||||
function getCurrentBranchName(p = process.cwd()) {
|
function getCurrentBranchName(p = process.cwd()) {
|
||||||
if (!fs.existsSync(p)) return false;
|
if (!existsSync(p)) return false;
|
||||||
|
|
||||||
const gitHeadPath = path.join(p, '.git', 'HEAD');
|
const gitHeadPath = join(p, '.git', 'HEAD');
|
||||||
|
|
||||||
if (!fs.existsSync(gitHeadPath))
|
if (!existsSync(gitHeadPath)) {
|
||||||
return getCurrentBranchName(path.resolve(p, '..'));
|
return getCurrentBranchName(resolve(p, '..'));
|
||||||
|
}
|
||||||
|
|
||||||
const headContent = fs.readFileSync(gitHeadPath, 'utf-8');
|
const headContent = readFileSync(gitHeadPath, 'utf-8');
|
||||||
return headContent.trim().split('/')[2];
|
return headContent.trim().split('/')[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
const branchName = getCurrentBranchName();
|
const branchName = getCurrentBranchName();
|
||||||
|
|
||||||
if (branchName) {
|
if (branchName) {
|
||||||
const msgPath = `.git/COMMIT_EDITMSG`;
|
const msgPath = '.git/COMMIT_EDITMSG';
|
||||||
const msg = fs.readFileSync(msgPath, 'utf-8');
|
const msg = readFileSync(msgPath, 'utf-8');
|
||||||
const reference = branchName.match(/^\d+/);
|
const reference = branchName.match(/^\d+/);
|
||||||
|
|
||||||
const referenceTag = `refs #${reference}`;
|
const referenceTag = `refs #${reference}`;
|
||||||
|
@ -26,8 +27,7 @@ if (branchName) {
|
||||||
|
|
||||||
if (splitedMsg.length > 1) {
|
if (splitedMsg.length > 1) {
|
||||||
const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':');
|
const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':');
|
||||||
fs.writeFileSync(msgPath, finalMsg);
|
writeFileSync(msgPath, finalMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
printWidth: 90,
|
printWidth: 90,
|
||||||
tabWidth: 4,
|
tabWidth: 4,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
module.exports = { extends: ['@commitlint/config-conventional'] };
|
export default { extends: ['@commitlint/config-conventional'] };
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
const { defineConfig } = require('cypress');
|
import { defineConfig } from 'cypress';
|
||||||
// https://docs.cypress.io/app/tooling/reporters
|
// https://docs.cypress.io/app/tooling/reporters
|
||||||
// https://docs.cypress.io/app/references/configuration
|
// https://docs.cypress.io/app/references/configuration
|
||||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||||
|
|
||||||
module.exports = defineConfig({
|
export default defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
baseUrl: 'http://localhost:9000/',
|
baseUrl: 'http://localhost:9000/',
|
||||||
experimentalStudio: true,
|
experimentalStudio: true,
|
||||||
|
@ -31,8 +31,10 @@ module.exports = defineConfig({
|
||||||
supportFile: 'test/cypress/support/unit.js',
|
supportFile: 'test/cypress/support/unit.js',
|
||||||
},
|
},
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
require('cypress-mochawesome-reporter/plugin')(on);
|
import('cypress-mochawesome-reporter/plugin').then((plugin) => plugin.default(on));
|
||||||
// implement node event listeners here
|
// implement node event listeners here
|
||||||
},
|
},
|
||||||
|
viewportWidth: 1280,
|
||||||
|
viewportHeight: 720,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
38
package.json
38
package.json
|
@ -1,11 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.04.0",
|
"version": "25.06.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@8.15.1",
|
"packageManager": "pnpm@8.15.1",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"resetDatabase": "cd ../salix && gulp docker",
|
"resetDatabase": "cd ../salix && gulp docker",
|
||||||
"lint": "eslint --ext .js,.vue ./",
|
"lint": "eslint --ext .js,.vue ./",
|
||||||
|
@ -20,39 +21,40 @@
|
||||||
"addReferenceTag": "node .husky/addReferenceTag.js"
|
"addReferenceTag": "node .husky/addReferenceTag.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@quasar/cli": "^2.3.0",
|
"@quasar/cli": "^2.4.1",
|
||||||
"@quasar/extras": "^1.16.9",
|
"@quasar/extras": "^1.16.16",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"chromium": "^3.0.3",
|
"chromium": "^3.0.3",
|
||||||
"croppie": "^2.6.5",
|
"croppie": "^2.6.5",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"quasar": "^2.14.5",
|
"quasar": "^2.17.7",
|
||||||
"validator": "^13.9.0",
|
"validator": "^13.9.0",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.3.0",
|
||||||
"vue-router": "^4.2.1"
|
"vue-router": "^4.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.2.1",
|
"@commitlint/cli": "^19.2.1",
|
||||||
"@commitlint/config-conventional": "^19.1.0",
|
"@commitlint/config-conventional": "^19.1.0",
|
||||||
"@intlify/unplugin-vue-i18n": "^0.8.1",
|
"@intlify/unplugin-vue-i18n": "^0.8.2",
|
||||||
"@pinia/testing": "^0.1.2",
|
"@pinia/testing": "^0.1.2",
|
||||||
"@quasar/app-vite": "^1.7.3",
|
"@quasar/app-vite": "^2.0.8",
|
||||||
"@quasar/quasar-app-extension-qcalendar": "4.0.0-beta.15",
|
"@quasar/quasar-app-extension-qcalendar": "^4.0.2",
|
||||||
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
||||||
"@vue/test-utils": "^2.4.4",
|
"@vue/test-utils": "^2.4.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"cypress": "^13.6.6",
|
"cypress": "^13.6.6",
|
||||||
"cypress-mochawesome-reporter": "^3.8.2",
|
"cypress-mochawesome-reporter": "^3.8.2",
|
||||||
"eslint": "^8.41.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^10.0.1",
|
||||||
"eslint-plugin-cypress": "^2.13.3",
|
"eslint-plugin-cypress": "^4.1.0",
|
||||||
"eslint-plugin-vue": "^9.14.1",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"postcss": "^8.4.23",
|
"postcss": "^8.4.23",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.4.2",
|
||||||
"vitest": "^0.31.1"
|
"sass": "^1.83.4",
|
||||||
|
"vitest": "^0.34.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20 || ^18 || ^16",
|
"node": "^20 || ^18 || ^16",
|
||||||
|
@ -61,8 +63,8 @@
|
||||||
"bun": ">= 1.0.25"
|
"bun": ">= 1.0.25"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
"vite": "^5.1.4",
|
"vite": "^6.0.11",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4061
pnpm-lock.yaml
4061
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,14 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||||
|
|
||||||
module.exports = {
|
import autoprefixer from 'autoprefixer';
|
||||||
|
// Uncomment the following line if you want to support RTL CSS
|
||||||
|
// import rtlcss from 'postcss-rtlcss';
|
||||||
|
|
||||||
|
export default {
|
||||||
plugins: [
|
plugins: [
|
||||||
// https://github.com/postcss/autoprefixer
|
// https://github.com/postcss/autoprefixer
|
||||||
require('autoprefixer')({
|
autoprefixer({
|
||||||
overrideBrowserslist: [
|
overrideBrowserslist: [
|
||||||
'last 4 Chrome versions',
|
'last 4 Chrome versions',
|
||||||
'last 4 Firefox versions',
|
'last 4 Firefox versions',
|
||||||
|
@ -18,10 +22,7 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// https://github.com/elchininet/postcss-rtlcss
|
// https://github.com/elchininet/postcss-rtlcss
|
||||||
// If you want to support RTL css, then
|
// If you want to support RTL CSS, uncomment the following line:
|
||||||
// 1. yarn/npm install postcss-rtlcss
|
// rtlcss(),
|
||||||
// 2. optionally set quasar.config.js > framework > lang to an RTL language
|
|
||||||
// 3. uncomment the following line:
|
|
||||||
// require('postcss-rtlcss')
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
// Configuration for your app
|
// Configuration for your app
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
|
||||||
|
|
||||||
const { configure } = require('quasar/wrappers');
|
import { configure } from 'quasar/wrappers';
|
||||||
const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite');
|
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||||
const path = require('path');
|
import path from 'path';
|
||||||
|
|
||||||
module.exports = configure(function (/* ctx */) {
|
export default configure(function (/* ctx */) {
|
||||||
return {
|
return {
|
||||||
eslint: {
|
eslint: {
|
||||||
// fix: true,
|
// fix: true,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
"@quasar/testing-unit-vitest": {
|
"@quasar/testing-unit-vitest": {
|
||||||
"options": ["scripts"]
|
"options": [
|
||||||
|
"scripts"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"@quasar/qcalendar": {}
|
"@quasar/qcalendar": {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('Axios boot', () => {
|
||||||
describe('onRequest()', async () => {
|
describe('onRequest()', async () => {
|
||||||
it('should set the "Authorization" property on the headers', async () => {
|
it('should set the "Authorization" property on the headers', async () => {
|
||||||
const config = { headers: {} };
|
const config = { headers: {} };
|
||||||
|
localStorage.setItem('token', 'DEFAULT_TOKEN');
|
||||||
const resultConfig = onRequest(config);
|
const resultConfig = onRequest(config);
|
||||||
|
|
||||||
expect(resultConfig).toEqual(
|
expect(resultConfig).toEqual(
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { useSession } from 'src/composables/useSession';
|
||||||
import { Router } from 'src/router';
|
import { Router } from 'src/router';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
import { getToken, isLoggedIn } from 'src/utils/session';
|
||||||
import { i18n } from 'src/boot/i18n';
|
import { i18n } from 'src/boot/i18n';
|
||||||
|
|
||||||
const session = useSession();
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const stateQuery = useStateQueryStore();
|
const stateQuery = useStateQueryStore();
|
||||||
const baseUrl = '/api/';
|
const baseUrl = '/api/';
|
||||||
|
@ -13,7 +13,7 @@ axios.defaults.baseURL = baseUrl;
|
||||||
const axiosNoError = axios.create({ baseURL: baseUrl });
|
const axiosNoError = axios.create({ baseURL: baseUrl });
|
||||||
|
|
||||||
const onRequest = (config) => {
|
const onRequest = (config) => {
|
||||||
const token = session.getToken();
|
const token = getToken();
|
||||||
if (token.length && !config.headers.Authorization) {
|
if (token.length && !config.headers.Authorization) {
|
||||||
config.headers.Authorization = token;
|
config.headers.Authorization = token;
|
||||||
config.headers['Accept-Language'] = i18n.global.locale.value;
|
config.headers['Accept-Language'] = i18n.global.locale.value;
|
||||||
|
@ -37,15 +37,15 @@ const onResponse = (response) => {
|
||||||
return response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onResponseError = (error) => {
|
const onResponseError = async (error) => {
|
||||||
stateQuery.remove(error.config);
|
stateQuery.remove(error.config);
|
||||||
|
|
||||||
if (session.isLoggedIn() && error.response?.status === 401) {
|
if (isLoggedIn() && error.response?.status === 401) {
|
||||||
session.destroy(false);
|
await useSession().destroy(false);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
const url = hash.slice(1);
|
const url = hash.slice(1);
|
||||||
Router.push(`/login?redirect=${url}`);
|
Router.push(`/login?redirect=${url}`);
|
||||||
} else if (!session.isLoggedIn()) {
|
} else if (!isLoggedIn()) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ onMounted(() => stateStore.setMounted());
|
||||||
/>
|
/>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div id="searchbar" class="searchbar"></div>
|
<div id="searchbar" class="searchbar"></div>
|
||||||
|
<div id="searchbar-after"></div>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||||
<div id="actions-prepend"></div>
|
<div id="actions-prepend"></div>
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import quasarLang from 'src/utils/quasarLang';
|
||||||
|
|
||||||
import { onMounted, computed, ref } from 'vue';
|
import { onMounted, computed, ref } from 'vue';
|
||||||
import { Dark, Quasar } from 'quasar';
|
|
||||||
|
import { Dark } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -31,14 +34,7 @@ const userLocale = computed({
|
||||||
|
|
||||||
value = localeEquivalence[value] ?? value;
|
value = localeEquivalence[value] ?? value;
|
||||||
|
|
||||||
try {
|
quasarLang(value);
|
||||||
/* @vite-ignore */
|
|
||||||
import(`../../node_modules/quasar/lang/${value}.mjs`).then((lang) => {
|
|
||||||
Quasar.lang.set(lang.default);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
() => $props.columns,
|
() => $props.columns,
|
||||||
(value) => splitColumns(value),
|
(value) => splitColumns(value),
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
||||||
|
@ -212,7 +212,7 @@ function splitColumns(columns) {
|
||||||
// Status column
|
// Status column
|
||||||
if (splittedColumns.value.chips.length) {
|
if (splittedColumns.value.chips.length) {
|
||||||
splittedColumns.value.columnChips = splittedColumns.value.chips.filter(
|
splittedColumns.value.columnChips = splittedColumns.value.chips.filter(
|
||||||
(c) => !c.isId
|
(c) => !c.isId,
|
||||||
);
|
);
|
||||||
if (splittedColumns.value.columnChips.length)
|
if (splittedColumns.value.columnChips.length)
|
||||||
splittedColumns.value.columns.unshift({
|
splittedColumns.value.columns.unshift({
|
||||||
|
@ -314,7 +314,19 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
show-if-above
|
show-if-above
|
||||||
>
|
>
|
||||||
<QScrollArea class="fit">
|
<QScrollArea class="fit">
|
||||||
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" :redirect="redirect" />
|
<VnTableFilter
|
||||||
|
:data-key="$attrs['data-key']"
|
||||||
|
:columns="columns"
|
||||||
|
:redirect="redirect"
|
||||||
|
>
|
||||||
|
<template
|
||||||
|
v-for="(_, slotName) in $slots"
|
||||||
|
#[slotName]="slotData"
|
||||||
|
:key="slotName"
|
||||||
|
>
|
||||||
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
|
</template>
|
||||||
|
</VnTableFilter>
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
|
@ -472,7 +484,9 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
||||||
"
|
"
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
((btn.show && btn.show(row)) ?? true)
|
||||||
|
? 'visible'
|
||||||
|
: 'hidden'
|
||||||
}`"
|
}`"
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -62,5 +62,8 @@ function columnName(col) {
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||||
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
import { describe, expect, it, beforeEach, afterEach, vi } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnVisibleColumn from '../VnVisibleColumn.vue';
|
||||||
|
import { axios } from 'app/test/vitest/helper';
|
||||||
|
|
||||||
|
describe('VnVisibleColumns', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(VnVisibleColumn, {
|
||||||
|
propsData: {
|
||||||
|
tableCode: 'testTable',
|
||||||
|
skip: ['skippedColumn'],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('setUserConfigViewData()', () => {
|
||||||
|
it('should initialize localColumns with visible configuration', () => {
|
||||||
|
vm.columns = [
|
||||||
|
{ name: 'columnMockName', label: undefined },
|
||||||
|
{ name: 'columnMockAddress', label: undefined },
|
||||||
|
{ name: 'columnMockId', label: undefined },
|
||||||
|
];
|
||||||
|
const configuration = {
|
||||||
|
columnMockName: true,
|
||||||
|
columnMockAddress: false,
|
||||||
|
columnMockId: true,
|
||||||
|
};
|
||||||
|
const expectedColumns = [
|
||||||
|
{ name: 'columnMockName', label: undefined, visible: true },
|
||||||
|
{ name: 'columnMockAddress', label: undefined, visible: false },
|
||||||
|
{ name: 'columnMockId', label: undefined, visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.setUserConfigViewData(configuration, false);
|
||||||
|
|
||||||
|
expect(vm.localColumns).toEqual(expectedColumns);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should skip columns based on props', () => {
|
||||||
|
vm.columns = [
|
||||||
|
{ name: 'columnMockName', label: undefined },
|
||||||
|
{ name: 'columnMockId', label: undefined },
|
||||||
|
{ name: 'skippedColumn', label: 'Skipped Column' },
|
||||||
|
];
|
||||||
|
const configuration = {
|
||||||
|
columnMockName: true,
|
||||||
|
skippedColumn: false,
|
||||||
|
columnMockId: true,
|
||||||
|
};
|
||||||
|
const expectedColumns = [
|
||||||
|
{ name: 'columnMockName', label: undefined, visible: true },
|
||||||
|
{ name: 'columnMockId', label: undefined, visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.setUserConfigViewData(configuration, false);
|
||||||
|
|
||||||
|
expect(vm.localColumns).toEqual(expectedColumns);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('toggleMarkAll()', () => {
|
||||||
|
it('should set all localColumns to visible=true', () => {
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: false },
|
||||||
|
{ name: 'columnMockId', visible: false },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.toggleMarkAll(true);
|
||||||
|
|
||||||
|
expect(vm.localColumns.every((col) => col.visible)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set all localColumns to visible=false', () => {
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: true },
|
||||||
|
{ name: 'columnMockId', visible: true },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.toggleMarkAll(false);
|
||||||
|
|
||||||
|
expect(vm.localColumns.every((col) => col.visible)).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('saveConfig()', () => {
|
||||||
|
it('should call setUserConfigViewData and axios.post with correct params', async () => {
|
||||||
|
const mockAxiosPost = vi.spyOn(axios, 'post').mockResolvedValue({
|
||||||
|
data: [{ id: 1 }],
|
||||||
|
});
|
||||||
|
|
||||||
|
vm.localColumns = [
|
||||||
|
{ name: 'columnMockName', visible: true },
|
||||||
|
{ name: 'columnMockId', visible: false },
|
||||||
|
];
|
||||||
|
|
||||||
|
await vm.saveConfig();
|
||||||
|
|
||||||
|
expect(mockAxiosPost).toHaveBeenCalledWith('UserConfigViews/crud', {
|
||||||
|
creates: [
|
||||||
|
{
|
||||||
|
userFk: vm.user.id,
|
||||||
|
tableCode: vm.tableCode,
|
||||||
|
tableConfig: vm.tableCode,
|
||||||
|
configuration: {
|
||||||
|
columnMockName: true,
|
||||||
|
columnMockId: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,53 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const hasContent = useHasContent('#advanced-menu');
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
isMainSection: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => $props.isMainSection,
|
||||||
|
(val) => {
|
||||||
|
if (stateStore) stateStore.rightAdvancedDrawer = val;
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Teleport to="#searchbar-after" v-if="stateStore.isHeaderMounted()">
|
||||||
|
<QBtn
|
||||||
|
v-if="hasContent || $slots['advanced-menu']"
|
||||||
|
flat
|
||||||
|
@click="stateStore.toggleRightAdvancedDrawer()"
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="tune"
|
||||||
|
>
|
||||||
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
{{ t('globals.advancedMenu') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</Teleport>
|
||||||
|
<QDrawer
|
||||||
|
v-model="stateStore.rightAdvancedDrawer"
|
||||||
|
side="right"
|
||||||
|
:width="256"
|
||||||
|
:overlay="!isMainSection"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
|
<QScrollArea class="fit">
|
||||||
|
<div id="advanced-menu"></div>
|
||||||
|
<slot v-if="!hasContent" name="advanced-menu" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
|
</template>
|
|
@ -17,7 +17,7 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#actions-prepend" v-if="stateStore.isHeaderMounted()">
|
||||||
<div class="row q-gutter-x-sm">
|
<div class="row q-gutter-x-sm">
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="hasContent || $slots['right-panel']"
|
v-if="hasContent || $slots['right-panel']"
|
||||||
|
|
|
@ -102,7 +102,7 @@ const columns = computed(() => [
|
||||||
storage: 'dms',
|
storage: 'dms',
|
||||||
collection: null,
|
collection: null,
|
||||||
resolution: null,
|
resolution: null,
|
||||||
id: prop.row.file.split('.')[0],
|
id: Number(prop.row.file.split('.')[0]),
|
||||||
token: token,
|
token: token,
|
||||||
class: 'rounded',
|
class: 'rounded',
|
||||||
ratio: 1,
|
ratio: 1,
|
||||||
|
@ -299,11 +299,12 @@ defineExpose({
|
||||||
:url="$props.model"
|
:url="$props.model"
|
||||||
:user-filter="dmsFilter"
|
:user-filter="dmsFilter"
|
||||||
:order="['dmsFk DESC']"
|
:order="['dmsFk DESC']"
|
||||||
:auto-load="true"
|
auto-load
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
>
|
>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QTable
|
<QTable
|
||||||
|
v-if="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
|
|
|
@ -42,10 +42,13 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
uppercase: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const vnInputRef = ref(null);
|
const vnInputRef = ref(null);
|
||||||
const showPassword = ref(false);
|
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
return $props.modelValue;
|
return $props.modelValue;
|
||||||
|
@ -117,6 +120,10 @@ const handleInsertMode = (e) => {
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleUppercase = () => {
|
||||||
|
value.value = value.value?.toUpperCase() || '';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -159,7 +166,16 @@ const handleInsertMode = (e) => {
|
||||||
emit('remove');
|
emit('remove');
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
></QIcon>
|
||||||
|
|
||||||
|
<QIcon
|
||||||
|
name="match_case"
|
||||||
|
size="xs"
|
||||||
|
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
||||||
|
@click="handleUppercase"
|
||||||
|
class="uppercase-icon"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||||
<QIcon v-if="info" name="info">
|
<QIcon v-if="info" name="info">
|
||||||
<QTooltip max-width="350px">
|
<QTooltip max-width="350px">
|
||||||
|
@ -170,3 +186,14 @@ const handleInsertMode = (e) => {
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
inputMin: Must be more than {value}
|
||||||
|
maxLength: The value exceeds {value} characters
|
||||||
|
inputMax: Must be less than {value}
|
||||||
|
es:
|
||||||
|
inputMin: Debe ser mayor a {value}
|
||||||
|
maxLength: El valor excede los {value} carácteres
|
||||||
|
inputMax: Debe ser menor a {value}
|
||||||
|
</i18n>
|
|
@ -105,6 +105,7 @@ const manageDate = (date) => {
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
|
@ -79,6 +79,7 @@ function dateToTime(newDate) {
|
||||||
style="min-width: 100px"
|
style="min-width: 100px"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
type="time"
|
type="time"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import FetchData from '../FetchData.vue';
|
||||||
import VnSelect from './VnSelect.vue';
|
import VnSelect from './VnSelect.vue';
|
||||||
import VnUserLink from '../ui/VnUserLink.vue';
|
import VnUserLink from '../ui/VnUserLink.vue';
|
||||||
import VnPaginate from '../ui/VnPaginate.vue';
|
import VnPaginate from '../ui/VnPaginate.vue';
|
||||||
|
import RightMenu from './RightMenu.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const validationsStore = useValidator();
|
const validationsStore = useValidator();
|
||||||
|
@ -130,7 +131,7 @@ const actionsIcon = {
|
||||||
};
|
};
|
||||||
const validDate = new RegExp(
|
const validDate = new RegExp(
|
||||||
/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])/.source +
|
/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])/.source +
|
||||||
/T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/.source
|
/T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/.source,
|
||||||
);
|
);
|
||||||
|
|
||||||
function castJsonValue(value) {
|
function castJsonValue(value) {
|
||||||
|
@ -192,7 +193,7 @@ function getLogTree(data) {
|
||||||
user: log.user,
|
user: log.user,
|
||||||
userFk: log.userFk,
|
userFk: log.userFk,
|
||||||
logs: [],
|
logs: [],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Model
|
// Model
|
||||||
|
@ -210,7 +211,7 @@ function getLogTree(data) {
|
||||||
id: log.changedModelId,
|
id: log.changedModelId,
|
||||||
showValue: log.changedModelValue,
|
showValue: log.changedModelValue,
|
||||||
logs: [],
|
logs: [],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
nLogs = 0;
|
nLogs = 0;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,7 @@ function setDate(type) {
|
||||||
to = date.adjustDate(
|
to = date.adjustDate(
|
||||||
to,
|
to,
|
||||||
{ hour: 21, minute: 59, second: 59, millisecond: 999 },
|
{ hour: 21, minute: 59, second: 59, millisecond: 999 },
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -365,7 +366,7 @@ async function clearFilter() {
|
||||||
dateTo.value = undefined;
|
dateTo.value = undefined;
|
||||||
userRadio.value = undefined;
|
userRadio.value = undefined;
|
||||||
Object.keys(checkboxOptions.value).forEach(
|
Object.keys(checkboxOptions.value).forEach(
|
||||||
(opt) => (checkboxOptions.value[opt].selected = false)
|
(opt) => (checkboxOptions.value[opt].selected = false),
|
||||||
);
|
);
|
||||||
await applyFilter();
|
await applyFilter();
|
||||||
}
|
}
|
||||||
|
@ -378,7 +379,7 @@ watch(
|
||||||
() => router.currentRoute.value.params.id,
|
() => router.currentRoute.value.params.id,
|
||||||
() => {
|
() => {
|
||||||
applyFilter();
|
applyFilter();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -391,7 +392,7 @@ watch(
|
||||||
const changedModel = item.changedModel;
|
const changedModel = item.changedModel;
|
||||||
return {
|
return {
|
||||||
locale: useCapitalize(
|
locale: useCapitalize(
|
||||||
validations[changedModel]?.locale?.name ?? changedModel
|
validations[changedModel]?.locale?.name ?? changedModel,
|
||||||
),
|
),
|
||||||
value: changedModel,
|
value: changedModel,
|
||||||
};
|
};
|
||||||
|
@ -507,7 +508,7 @@ watch(
|
||||||
:title="
|
:title="
|
||||||
date.formatDate(
|
date.formatDate(
|
||||||
log.creationDate,
|
log.creationDate,
|
||||||
'DD/MM/YYYY hh:mm:ss'
|
'DD/MM/YYYY hh:mm:ss',
|
||||||
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -577,7 +578,7 @@ watch(
|
||||||
t(
|
t(
|
||||||
`actions.${
|
`actions.${
|
||||||
actionsText[log.action]
|
actionsText[log.action]
|
||||||
}`
|
}`,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -677,139 +678,144 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<QList dense>
|
<template #right-panel>
|
||||||
<QSeparator />
|
<QList dense>
|
||||||
<QItem class="q-mt-sm">
|
<QSeparator />
|
||||||
<QInput
|
<QItem class="q-mt-sm">
|
||||||
:label="t('globals.search')"
|
<QInput
|
||||||
v-model="searchInput"
|
:label="t('globals.search')"
|
||||||
class="full-width"
|
v-model="searchInput"
|
||||||
clearable
|
class="full-width"
|
||||||
clear-icon="close"
|
clearable
|
||||||
@keyup.enter="() => selectFilter('search')"
|
clear-icon="close"
|
||||||
@focusout="() => selectFilter('search')"
|
@keyup.enter="() => selectFilter('search')"
|
||||||
@clear="() => selectFilter('search')"
|
@focusout="() => selectFilter('search')"
|
||||||
>
|
@clear="() => selectFilter('search')"
|
||||||
<template #append>
|
>
|
||||||
<QIcon name="info" class="cursor-pointer">
|
<template #append>
|
||||||
<QTooltip>{{ t('tooltips.search') }}</QTooltip>
|
<QIcon name="info" class="cursor-pointer">
|
||||||
</QIcon>
|
<QTooltip>{{ t('tooltips.search') }}</QTooltip>
|
||||||
</template>
|
</QIcon>
|
||||||
</QInput>
|
</template>
|
||||||
</QItem>
|
</QInput>
|
||||||
<QItem>
|
</QItem>
|
||||||
<VnSelect
|
<QItem>
|
||||||
class="full-width"
|
|
||||||
:label="t('globals.entity')"
|
|
||||||
v-model="selectedFilters.changedModel"
|
|
||||||
option-label="locale"
|
|
||||||
option-value="value"
|
|
||||||
:options="actions"
|
|
||||||
@update:model-value="selectFilter('action')"
|
|
||||||
hide-selected
|
|
||||||
/>
|
|
||||||
</QItem>
|
|
||||||
<QItem class="q-mt-sm">
|
|
||||||
<QOptionGroup
|
|
||||||
size="sm"
|
|
||||||
v-model="userRadio"
|
|
||||||
:options="userTypes"
|
|
||||||
color="primary"
|
|
||||||
@update:model-value="selectFilter('userRadio')"
|
|
||||||
right-label
|
|
||||||
>
|
|
||||||
<template #label="{ label }">
|
|
||||||
{{ t(`Users.${label}`) }}
|
|
||||||
</template>
|
|
||||||
</QOptionGroup>
|
|
||||||
</QItem>
|
|
||||||
<QItem class="q-mt-sm">
|
|
||||||
<QItemSection v-if="userRadio !== null">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:label="t('globals.user')"
|
:label="t('globals.entity')"
|
||||||
v-model="userSelect"
|
v-model="selectedFilters.changedModel"
|
||||||
option-label="name"
|
option-label="locale"
|
||||||
option-value="id"
|
option-value="value"
|
||||||
:url="`${model}Logs/${$route.params.id}/editors`"
|
:options="actions"
|
||||||
:fields="['id', 'nickname', 'name', 'image']"
|
@update:model-value="selectFilter('action')"
|
||||||
sort-by="nickname"
|
|
||||||
@update:model-value="selectFilter('userSelect')"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
|
/>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mt-sm">
|
||||||
|
<QOptionGroup
|
||||||
|
size="sm"
|
||||||
|
v-model="userRadio"
|
||||||
|
:options="userTypes"
|
||||||
|
color="primary"
|
||||||
|
@update:model-value="selectFilter('userRadio')"
|
||||||
|
right-label
|
||||||
>
|
>
|
||||||
<template #option="{ opt, itemProps }">
|
<template #label="{ label }">
|
||||||
<QItem v-bind="itemProps" class="q-pa-xs row items-center">
|
{{ t(`Users.${label}`) }}
|
||||||
<QItemSection class="col-3 items-center">
|
|
||||||
<VnAvatar :worker-id="opt.id" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection class="col-9 justify-center">
|
|
||||||
<span>{{ opt.name }}</span>
|
|
||||||
<span class="text-grey">{{ opt.nickname }}</span>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</QOptionGroup>
|
||||||
</QItemSection>
|
</QItem>
|
||||||
</QItem>
|
<QItem class="q-mt-sm">
|
||||||
<QItem class="q-mt-sm">
|
<QItemSection v-if="userRadio !== null">
|
||||||
<QInput
|
<VnSelect
|
||||||
:label="t('globals.changes')"
|
class="full-width"
|
||||||
v-model="changeInput"
|
:label="t('globals.user')"
|
||||||
class="full-width"
|
v-model="userSelect"
|
||||||
clearable
|
option-label="name"
|
||||||
clear-icon="close"
|
option-value="id"
|
||||||
@keyup.enter="selectFilter('change')"
|
:url="`${model}Logs/${route.params.id}/editors`"
|
||||||
@focusout="selectFilter('change')"
|
:fields="['id', 'nickname', 'name', 'image']"
|
||||||
@clear="selectFilter('change')"
|
sort-by="nickname"
|
||||||
|
@update:model-value="selectFilter('userSelect')"
|
||||||
|
hide-selected
|
||||||
|
>
|
||||||
|
<template #option="{ opt, itemProps }">
|
||||||
|
<QItem
|
||||||
|
v-bind="itemProps"
|
||||||
|
class="q-pa-xs row items-center"
|
||||||
|
>
|
||||||
|
<QItemSection class="col-3 items-center">
|
||||||
|
<VnAvatar :worker-id="opt.id" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection class="col-9 justify-center">
|
||||||
|
<span>{{ opt.name }}</span>
|
||||||
|
<span class="text-grey">{{ opt.nickname }}</span>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mt-sm">
|
||||||
|
<QInput
|
||||||
|
:label="t('globals.changes')"
|
||||||
|
v-model="changeInput"
|
||||||
|
class="full-width"
|
||||||
|
clearable
|
||||||
|
clear-icon="close"
|
||||||
|
@keyup.enter="selectFilter('change')"
|
||||||
|
@focusout="selectFilter('change')"
|
||||||
|
@clear="selectFilter('change')"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QIcon name="info" class="cursor-pointer">
|
||||||
|
<QTooltip max-width="250px">{{
|
||||||
|
t('tooltips.changes')
|
||||||
|
}}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</QInput>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
:class="index == 'create' ? 'q-mt-md' : 'q-mt-xs'"
|
||||||
|
v-for="(checkboxOption, index) in checkboxOptions"
|
||||||
|
:key="index"
|
||||||
>
|
>
|
||||||
<template #append>
|
<QCheckbox
|
||||||
<QIcon name="info" class="cursor-pointer">
|
size="sm"
|
||||||
<QTooltip max-width="250px">{{
|
v-model="checkboxOption.selected"
|
||||||
t('tooltips.changes')
|
:label="t(`actions.${checkboxOption.label}`)"
|
||||||
}}</QTooltip>
|
@update:model-value="selectFilter"
|
||||||
</QIcon>
|
/>
|
||||||
</template>
|
</QItem>
|
||||||
</QInput>
|
<QItem class="q-mt-sm">
|
||||||
</QItem>
|
<QInput
|
||||||
<QItem
|
class="full-width"
|
||||||
:class="index == 'create' ? 'q-mt-md' : 'q-mt-xs'"
|
:label="t('globals.date')"
|
||||||
v-for="(checkboxOption, index) in checkboxOptions"
|
@click="dateFromDialog = true"
|
||||||
:key="index"
|
@focus="(evt) => evt.target.blur()"
|
||||||
>
|
@clear="selectFilter('date', 'to')"
|
||||||
<QCheckbox
|
v-model="dateFrom"
|
||||||
size="sm"
|
clearable
|
||||||
v-model="checkboxOption.selected"
|
clear-icon="close"
|
||||||
:label="t(`actions.${checkboxOption.label}`)"
|
/>
|
||||||
@update:model-value="selectFilter"
|
</QItem>
|
||||||
/>
|
<QItem class="q-mt-sm">
|
||||||
</QItem>
|
<QInput
|
||||||
<QItem class="q-mt-sm">
|
class="full-width"
|
||||||
<QInput
|
:label="t('to')"
|
||||||
class="full-width"
|
@click="dateToDialog = true"
|
||||||
:label="t('globals.date')"
|
@focus="(evt) => evt.target.blur()"
|
||||||
@click="dateFromDialog = true"
|
@clear="selectFilter('date', 'from')"
|
||||||
@focus="(evt) => evt.target.blur()"
|
v-model="dateTo"
|
||||||
@clear="selectFilter('date', 'to')"
|
clearable
|
||||||
v-model="dateFrom"
|
clear-icon="close"
|
||||||
clearable
|
/>
|
||||||
clear-icon="close"
|
</QItem>
|
||||||
/>
|
</QList>
|
||||||
</QItem>
|
</template>
|
||||||
<QItem class="q-mt-sm">
|
</RightMenu>
|
||||||
<QInput
|
|
||||||
class="full-width"
|
|
||||||
:label="t('to')"
|
|
||||||
@click="dateToDialog = true"
|
|
||||||
@focus="(evt) => evt.target.blur()"
|
|
||||||
@clear="selectFilter('date', 'from')"
|
|
||||||
v-model="dateTo"
|
|
||||||
clearable
|
|
||||||
clear-icon="close"
|
|
||||||
/>
|
|
||||||
</QItem>
|
|
||||||
</QList>
|
|
||||||
</Teleport>
|
|
||||||
<QDialog v-model="dateFromDialog">
|
<QDialog v-model="dateFromDialog">
|
||||||
<QDate
|
<QDate
|
||||||
:years-in-month-view="false"
|
:years-in-month-view="false"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import RightMenu from './RightMenu.vue';
|
import RightAdvancedMenu from './RightAdvancedMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||||
import { onBeforeMount, computed, ref } from 'vue';
|
import { onBeforeMount, onMounted, onUnmounted, computed, ref } from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useHasContent } from 'src/composables/useHasContent';
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -47,16 +47,14 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
let arrayData;
|
let arrayData;
|
||||||
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||||
const isMainSection = computed(() => {
|
const isMainSection = ref(false);
|
||||||
const isSame = sectionValue.value == route.name;
|
|
||||||
if (!isSame && arrayData) {
|
|
||||||
arrayData.reset(['userParams', 'userFilter']);
|
|
||||||
}
|
|
||||||
return isSame;
|
|
||||||
});
|
|
||||||
const searchbarId = 'section-searchbar';
|
const searchbarId = 'section-searchbar';
|
||||||
|
const advancedMenuSlot = 'advanced-menu';
|
||||||
const hasContent = useHasContent(`#${searchbarId}`);
|
const hasContent = useHasContent(`#${searchbarId}`);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
@ -67,7 +65,23 @@ onBeforeMount(() => {
|
||||||
...$props.arrayDataProps,
|
...$props.arrayDataProps,
|
||||||
navigate: $props.redirect,
|
navigate: $props.redirect,
|
||||||
});
|
});
|
||||||
|
checkIsMain();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const unsubscribe = router.afterEach(() => {
|
||||||
|
checkIsMain();
|
||||||
|
});
|
||||||
|
onUnmounted(unsubscribe);
|
||||||
|
});
|
||||||
|
|
||||||
|
function checkIsMain() {
|
||||||
|
isMainSection.value = sectionValue.value == route.name;
|
||||||
|
if (!isMainSection.value && arrayData) {
|
||||||
|
arrayData.reset(['userParams', 'filter']);
|
||||||
|
arrayData.setCurrentFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<slot name="searchbar">
|
<slot name="searchbar">
|
||||||
|
@ -80,9 +94,9 @@ onBeforeMount(() => {
|
||||||
/>
|
/>
|
||||||
<div :id="searchbarId"></div>
|
<div :id="searchbarId"></div>
|
||||||
</slot>
|
</slot>
|
||||||
<RightMenu>
|
<RightAdvancedMenu :is-main-section="isMainSection">
|
||||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter">
|
||||||
<slot name="rightMenu">
|
<slot :name="advancedMenuSlot">
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
v-if="rightFilter && columns"
|
v-if="rightFilter && columns"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
|
@ -91,7 +105,7 @@ onBeforeMount(() => {
|
||||||
/>
|
/>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightAdvancedMenu>
|
||||||
<slot name="body" v-if="isMainSection" />
|
<slot name="body" v-if="isMainSection" />
|
||||||
<RouterView v-else />
|
<RouterView v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -27,7 +27,7 @@ const $props = defineProps({
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
optionLabel: {
|
optionLabel: {
|
||||||
type: [String],
|
type: [String, Function],
|
||||||
default: 'name',
|
default: 'name',
|
||||||
},
|
},
|
||||||
optionValue: {
|
optionValue: {
|
||||||
|
@ -232,12 +232,15 @@ async function fetchFilter(val) {
|
||||||
} else defaultWhere = { [key]: getVal(val) };
|
} else defaultWhere = { [key]: getVal(val) };
|
||||||
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
||||||
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
||||||
const fetchOptions = { where, include, limit };
|
const filterOptions = { where, include, limit };
|
||||||
if (fields) fetchOptions.fields = fields;
|
if (fields) filterOptions.fields = fields;
|
||||||
if (sortBy) fetchOptions.order = sortBy;
|
if (sortBy) filterOptions.order = sortBy;
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
|
|
||||||
const { data } = await arrayData.applyFilter({ filter: fetchOptions });
|
const { data } = await arrayData.applyFilter(
|
||||||
|
{ filter: filterOptions },
|
||||||
|
{ updateRouter: false }
|
||||||
|
);
|
||||||
setOptions(data);
|
setOptions(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -294,7 +297,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
defineExpose({ opts: myOptions, vnSelectRef });
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
function handleKeyDown(event) {
|
||||||
if (event.key === 'Tab' && !event.shiftKey) {
|
if (event.key === 'Tab' && !event.shiftKey) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = defineModel({ type: [String, Number, Object] });
|
const value = defineModel({ type: [String, Number, Object] });
|
||||||
|
const select = ref(null);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
rolesAllowedToCreate: {
|
rolesAllowedToCreate: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
|
||||||
if ($props.acls.length) return acl.hasAny($props.acls);
|
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||||
return role.hasAny($props.rolesAllowedToCreate);
|
return role.hasAny($props.rolesAllowedToCreate);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ vnSelectDialogRef: select });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
ref="select"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
||||||
|
|
|
@ -55,7 +55,7 @@ const url = computed(() => {
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$props.hasAvatar">
|
<template #prepend v-if="$props.hasAvatar">
|
||||||
<VnAvatar :worker-id="value" color="primary" :title="title" />
|
<VnAvatar :worker-id="value" color="primary" v-bind="$attrs" />
|
||||||
</template>
|
</template>
|
||||||
<template #append v-if="$props.hasInfo">
|
<template #append v-if="$props.hasInfo">
|
||||||
<QIcon name="info" class="cursor-pointer">
|
<QIcon name="info" class="cursor-pointer">
|
||||||
|
@ -72,7 +72,8 @@ const url = computed(() => {
|
||||||
{{ scope.opt.nickname }}
|
{{ scope.opt.nickname }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-else>
|
<QItemLabel caption v-else>
|
||||||
#{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
|
#{{ scope.opt.id }}, {{ scope.opt.nickname }},
|
||||||
|
{{ scope.opt.code }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import { vi, describe, expect, it } from 'vitest';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
|
||||||
|
describe('VnInput', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let input;
|
||||||
|
|
||||||
|
function generateWrapper(value, isOutlined, emptyToNull, insertable) {
|
||||||
|
wrapper = createWrapper(VnInput, {
|
||||||
|
props: {
|
||||||
|
modelValue: value,
|
||||||
|
isOutlined, emptyToNull, insertable,
|
||||||
|
maxlength: 101
|
||||||
|
},
|
||||||
|
attrs: {
|
||||||
|
label: 'test',
|
||||||
|
required: true,
|
||||||
|
maxlength: 101,
|
||||||
|
maxLength: 10,
|
||||||
|
'max-length':20
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
input = wrapper.find('[data-cy="test_input"]');
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('value', () => {
|
||||||
|
it('should emit update:modelValue when value changes', async () => {
|
||||||
|
generateWrapper('12345', false, false, true)
|
||||||
|
await input.setValue('123');
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual(['123']);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should emit update:modelValue with null when input is empty', async () => {
|
||||||
|
generateWrapper('12345', false, true, true);
|
||||||
|
await input.setValue('');
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual([null]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('styleAttrs', () => {
|
||||||
|
it('should return empty styleAttrs when isOutlined is false', async () => {
|
||||||
|
generateWrapper('123', false, false, false);
|
||||||
|
expect(vm.styleAttrs).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set styleAttrs when isOutlined is true', async () => {
|
||||||
|
generateWrapper('123', true, false, false);
|
||||||
|
expect(vm.styleAttrs.outlined).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('handleKeydown', () => {
|
||||||
|
it('should do nothing when "Backspace" key is pressed', async () => {
|
||||||
|
generateWrapper('12345', false, false, true);
|
||||||
|
await input.trigger('keydown', { key: 'Backspace' });
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
||||||
|
const spyhandler = vi.spyOn(vm, 'handleInsertMode');
|
||||||
|
expect(spyhandler).not.toHaveBeenCalled();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: #8399 REDMINE
|
||||||
|
*/
|
||||||
|
it.skip('handleKeydown respects insertable behavior', async () => {
|
||||||
|
const expectedValue = '12345';
|
||||||
|
generateWrapper('1234', false, false, true);
|
||||||
|
vm.focus()
|
||||||
|
await input.trigger('keydown', { key: '5' });
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
||||||
|
expect(wrapper.emitted('update:modelValue')[0]).toEqual([expectedValue ]);
|
||||||
|
expect(vm.value).toBe( expectedValue);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('focus', () => {
|
||||||
|
it('should call focus method when input is focused', async () => {
|
||||||
|
generateWrapper('123', false, false, true);
|
||||||
|
const focusSpy = vi.spyOn(input.element, 'focus');
|
||||||
|
vm.focus();
|
||||||
|
expect(focusSpy).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -175,7 +175,7 @@ async function fetch() {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.header.link:hover {
|
.header.link:hover {
|
||||||
color: lighten($primary, 20%);
|
color: rgba(var(--q-primary), 0.8);
|
||||||
}
|
}
|
||||||
.q-checkbox {
|
.q-checkbox {
|
||||||
& .q-checkbox__label {
|
& .q-checkbox__label {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.sass';
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
bordered: {
|
bordered: {
|
||||||
|
|
|
@ -113,23 +113,20 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
const staticParams = Object.keys(store.userParams ?? {}).length
|
|
||||||
? store.userParams
|
|
||||||
: store.defaultParams;
|
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
|
|
||||||
const filter = {
|
let filter = { params: { search: searchText.value } };
|
||||||
params: {
|
|
||||||
search: searchText.value,
|
|
||||||
},
|
|
||||||
filter: props.filter,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!props.searchRemoveParams || !searchText.value) {
|
if (!props.searchRemoveParams || !searchText.value) {
|
||||||
filter.params = {
|
filter = {
|
||||||
...staticParams,
|
params: {
|
||||||
search: searchText.value,
|
...store.userParams,
|
||||||
|
search: searchText.value,
|
||||||
|
},
|
||||||
|
filter: store.filter,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
arrayData.reset(['currentFilter', 'userParams']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.whereFilter) {
|
if (props.whereFilter) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
const isEmployeeMock = vi.fn();
|
||||||
|
|
||||||
|
function generateWrapper(storage = 'images') {
|
||||||
|
wrapper = createWrapper(VnImg, {
|
||||||
|
props: {
|
||||||
|
id: 123,
|
||||||
|
zoomResolution: '400x400',
|
||||||
|
storage,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
vm.timeStamp = 'timestamp';
|
||||||
|
};
|
||||||
|
|
||||||
|
vi.mock('src/composables/useSession', () => ({
|
||||||
|
useSession: () => ({
|
||||||
|
getTokenMultimedia: () => 'token',
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock('src/composables/useRole', () => ({
|
||||||
|
useRole: () => ({
|
||||||
|
isEmployee: isEmployeeMock,
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
describe('VnImg', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
isEmployeeMock.mockReset();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getUrl', () => {
|
||||||
|
it('should return /api/{storage}/{id}/downloadFile?access_token={token} when storage is dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(false);
|
||||||
|
generateWrapper('dms');
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/api/dms/123/downloadFile?access_token=token');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /no-user.png when role is not employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(false);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/no-user.png');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is false and role is employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(true);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl();
|
||||||
|
expect(url).toBe('/api/images/catalog/200x200/123/download?access_token=token×tamp');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return /api/{storage}/{collection}/{curResolution}/{id}/download?access_token={token}&{timeStamp} when zoom is true and role is employee and storage is not dms', async () => {
|
||||||
|
isEmployeeMock.mockReturnValue(true);
|
||||||
|
generateWrapper();
|
||||||
|
await vm.$nextTick();
|
||||||
|
const url = vm.getUrl(true);
|
||||||
|
expect(url).toBe('/api/images/catalog/400x400/123/download?access_token=token×tamp');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('reload', () => {
|
||||||
|
it('should update the timestamp', async () => {
|
||||||
|
generateWrapper();
|
||||||
|
const initialTimestamp = wrapper.vm.timeStamp;
|
||||||
|
|
||||||
|
wrapper.vm.reload();
|
||||||
|
const newTimestamp = wrapper.vm.timeStamp;
|
||||||
|
|
||||||
|
expect(initialTimestamp).not.toEqual(newTimestamp);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,71 @@
|
||||||
|
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
|
||||||
|
describe('VnSearchbar', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let applyFilterSpy;
|
||||||
|
const searchText = 'Bolas de madera';
|
||||||
|
const userParams = {staticKey: 'staticValue'};
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
wrapper = createWrapper(VnSearchbar, {
|
||||||
|
propsData: {
|
||||||
|
dataKey: 'testKey',
|
||||||
|
filter: null,
|
||||||
|
whereFilter: null,
|
||||||
|
searchRemoveParams: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
|
||||||
|
vm.searchText = searchText;
|
||||||
|
vm.arrayData.store.userParams = userParams;
|
||||||
|
applyFilterSpy = vi.spyOn(vm.arrayData, 'applyFilter').mockImplementation(() => {});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('search resets pagination and applies filter', async () => {
|
||||||
|
const resetPaginationSpy = vi.spyOn(vm.arrayData, 'resetPagination').mockImplementation(() => {});
|
||||||
|
await vm.search();
|
||||||
|
|
||||||
|
expect(resetPaginationSpy).toHaveBeenCalled();
|
||||||
|
expect(applyFilterSpy).toHaveBeenCalledWith({
|
||||||
|
params: { search: searchText },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('search includes static params if searchRemoveParams is false', async () => {
|
||||||
|
wrapper.setProps({ searchRemoveParams: false });
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.search();
|
||||||
|
|
||||||
|
expect(applyFilterSpy).toHaveBeenCalledWith({
|
||||||
|
params: { staticKey: 'staticValue', search: searchText },
|
||||||
|
filter: {skip: 0},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates store when dataKey changes', async () => {
|
||||||
|
expect(vm.store.userParams).toEqual(userParams);
|
||||||
|
wrapper.setProps({ dataKey: 'newTestKey' });
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.store.userParams).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('computes the "to" property correctly for redirection', () => {
|
||||||
|
vm.arrayData.store.searchUrl = 'searchParam';
|
||||||
|
vm.arrayData.store.currentFilter = { category: 'plants' };
|
||||||
|
const expectedQuery = JSON.stringify({
|
||||||
|
...vm.arrayData.store.currentFilter,
|
||||||
|
search: searchText,
|
||||||
|
});
|
||||||
|
expect(vm.to.query.searchParam).toBe(expectedQuery);
|
||||||
|
});
|
||||||
|
});
|
|
@ -7,7 +7,9 @@ import { isDialogOpened } from 'src/filters';
|
||||||
|
|
||||||
const arrayDataStore = useArrayDataStore();
|
const arrayDataStore = useArrayDataStore();
|
||||||
|
|
||||||
export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
export function useArrayData(key, userOptions) {
|
||||||
|
key ??= useRoute().meta.moduleName;
|
||||||
|
|
||||||
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
||||||
|
|
||||||
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
||||||
|
@ -31,10 +33,11 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
: JSON.parse(params?.filter ?? '{}');
|
: JSON.parse(params?.filter ?? '{}');
|
||||||
delete params.filter;
|
delete params.filter;
|
||||||
|
|
||||||
store.userParams = { ...store.userParams, ...params };
|
store.userParams = params;
|
||||||
store.filter = { ...filter, ...store.userFilter };
|
store.filter = { ...filter, ...store.userFilter };
|
||||||
if (filter?.order) store.order = filter.order;
|
if (filter?.order) store.order = filter.order;
|
||||||
}
|
}
|
||||||
|
setCurrentFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (key && userOptions) setOptions();
|
if (key && userOptions) setOptions();
|
||||||
|
@ -76,11 +79,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
cancelRequest();
|
cancelRequest();
|
||||||
canceller = new AbortController();
|
canceller = new AbortController();
|
||||||
const { params, limit } = getCurrentFilter();
|
const { params, limit } = setCurrentFilter();
|
||||||
|
|
||||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
|
||||||
delete store.currentFilter.filter.include;
|
|
||||||
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
|
||||||
|
|
||||||
let exprFilter;
|
let exprFilter;
|
||||||
if (store?.exprBuilder) {
|
if (store?.exprBuilder) {
|
||||||
|
@ -105,7 +104,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
store.hasMoreData = limit && response.data.length >= limit;
|
store.hasMoreData = limit && response.data.length >= limit;
|
||||||
|
|
||||||
if (!append && !isDialogOpened() && updateRouter) {
|
if (!append && !isDialogOpened() && updateRouter) {
|
||||||
if (updateStateParams(response.data)?.redirect) return;
|
if (updateStateParams(response.data)?.redirect && !store.keepData) return;
|
||||||
}
|
}
|
||||||
store.isLoading = false;
|
store.isLoading = false;
|
||||||
canceller = null;
|
canceller = null;
|
||||||
|
@ -140,12 +139,12 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function applyFilter({ filter, params }) {
|
async function applyFilter({ filter, params }, fetchOptions = {}) {
|
||||||
if (filter) store.userFilter = filter;
|
if (filter) store.userFilter = filter;
|
||||||
store.filter = {};
|
store.filter = {};
|
||||||
if (params) store.userParams = { ...params };
|
if (params) store.userParams = { ...params };
|
||||||
|
|
||||||
const response = await fetch({});
|
const response = await fetch(fetchOptions);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,14 +273,14 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentFilter() {
|
function getCurrentFilter() {
|
||||||
|
if (!Object.keys(store.userParams).length)
|
||||||
|
store.userParams = store.defaultParams ?? {};
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
limit: store.limit,
|
limit: store.limit,
|
||||||
|
...store.userFilter,
|
||||||
};
|
};
|
||||||
|
|
||||||
let userParams = { ...store.userParams };
|
|
||||||
|
|
||||||
Object.assign(filter, store.userFilter);
|
|
||||||
|
|
||||||
let where;
|
let where;
|
||||||
if (filter?.where || store.filter?.where)
|
if (filter?.where || store.filter?.where)
|
||||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||||
|
@ -289,7 +288,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
filter.where = where;
|
filter.where = where;
|
||||||
const params = { filter };
|
const params = { filter };
|
||||||
|
|
||||||
Object.assign(params, userParams);
|
Object.assign(params, store.userParams);
|
||||||
if (params.filter) params.filter.skip = store.skip;
|
if (params.filter) params.filter.skip = store.skip;
|
||||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
||||||
if (store.order?.length) params.filter.order = [...store.order];
|
if (store.order?.length) params.filter.order = [...store.order];
|
||||||
|
@ -298,6 +297,14 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
return { filter, params, limit: filter.limit };
|
return { filter, params, limit: filter.limit };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setCurrentFilter() {
|
||||||
|
const { params, limit } = getCurrentFilter();
|
||||||
|
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||||
|
delete store.currentFilter.filter.include;
|
||||||
|
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
||||||
|
return { params, limit };
|
||||||
|
}
|
||||||
|
|
||||||
function processData(data, { map = true, append = true }) {
|
function processData(data, { map = true, append = true }) {
|
||||||
if (!append) {
|
if (!append) {
|
||||||
store.data = [];
|
store.data = [];
|
||||||
|
@ -331,6 +338,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
applyFilter,
|
applyFilter,
|
||||||
addFilter,
|
addFilter,
|
||||||
getCurrentFilter,
|
getCurrentFilter,
|
||||||
|
setCurrentFilter,
|
||||||
addFilterWhere,
|
addFilterWhere,
|
||||||
addOrder,
|
addOrder,
|
||||||
deleteOrder,
|
deleteOrder,
|
||||||
|
|
|
@ -29,8 +29,12 @@ export function useFilterParams(key) {
|
||||||
orders.value = orderObject;
|
orders.value = orderObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUserParams(watchedParams) {
|
function setUserParams(watchedParams = {}) {
|
||||||
if (!watchedParams || Object.keys(watchedParams).length == 0) return;
|
if (Object.keys(watchedParams).length == 0) {
|
||||||
|
params.value = {};
|
||||||
|
orders.value = {};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
||||||
if (typeof watchedParams?.filter == 'string')
|
if (typeof watchedParams?.filter == 'string')
|
||||||
|
|
|
@ -5,7 +5,7 @@ export function useHasContent(selector) {
|
||||||
const hasContent = ref();
|
const hasContent = ref();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
container.value = document.querySelector(selector);
|
container.value = document?.querySelector(selector);
|
||||||
if (!container.value) return;
|
if (!container.value) return;
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import axios from 'axios';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import useNotify from './useNotify';
|
import useNotify from './useNotify';
|
||||||
import { useTokenConfig } from './useTokenConfig';
|
import { useTokenConfig } from './useTokenConfig';
|
||||||
|
import { getToken, getTokenMultimedia } from 'src/utils/session';
|
||||||
const TOKEN_MULTIMEDIA = 'tokenMultimedia';
|
const TOKEN_MULTIMEDIA = 'tokenMultimedia';
|
||||||
const TOKEN = 'token';
|
const TOKEN = 'token';
|
||||||
|
|
||||||
|
@ -15,19 +16,6 @@ export function useSession() {
|
||||||
let isCheckingToken = false;
|
let isCheckingToken = false;
|
||||||
let intervalId = null;
|
let intervalId = null;
|
||||||
|
|
||||||
function getToken() {
|
|
||||||
const localToken = localStorage.getItem(TOKEN);
|
|
||||||
const sessionToken = sessionStorage.getItem(TOKEN);
|
|
||||||
|
|
||||||
return localToken || sessionToken || '';
|
|
||||||
}
|
|
||||||
function getTokenMultimedia() {
|
|
||||||
const localTokenMultimedia = localStorage.getItem(TOKEN_MULTIMEDIA);
|
|
||||||
const sessionTokenMultimedia = sessionStorage.getItem(TOKEN_MULTIMEDIA);
|
|
||||||
|
|
||||||
return localTokenMultimedia || sessionTokenMultimedia || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSession(data) {
|
function setSession(data) {
|
||||||
let keepLogin = data.keepLogin;
|
let keepLogin = data.keepLogin;
|
||||||
const storage = keepLogin ? localStorage : sessionStorage;
|
const storage = keepLogin ? localStorage : sessionStorage;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// app global css in SCSS form
|
// app global css in SCSS form
|
||||||
@import './icons.scss';
|
@import './icons.scss';
|
||||||
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
|
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.scss';
|
||||||
|
|
||||||
body.body--light {
|
body.body--light {
|
||||||
--vn-header-color: #cecece;
|
--vn-header-color: #cecece;
|
||||||
|
@ -310,6 +310,14 @@ input::-webkit-inner-spin-button {
|
||||||
.no-visible {
|
.no-visible {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-item > .q-item__section:has(.q-checkbox) {
|
||||||
|
max-width: min-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row > .column:has(.q-checkbox) {
|
||||||
|
max-width: min-content;
|
||||||
|
}
|
||||||
.q-field__inner {
|
.q-field__inner {
|
||||||
.q-field__control {
|
.q-field__control {
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import getUpdatedValues from './getUpdatedValues';
|
||||||
import getParamWhere from './getParamWhere';
|
import getParamWhere from './getParamWhere';
|
||||||
import parsePhone from './parsePhone';
|
import parsePhone from './parsePhone';
|
||||||
import isDialogOpened from './isDialogOpened';
|
import isDialogOpened from './isDialogOpened';
|
||||||
|
import toCelsius from './toCelsius';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getUpdatedValues,
|
getUpdatedValues,
|
||||||
|
@ -36,4 +37,5 @@ export {
|
||||||
dashIfEmpty,
|
dashIfEmpty,
|
||||||
dateRange,
|
dateRange,
|
||||||
getParamWhere,
|
getParamWhere,
|
||||||
|
toCelsius,
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function toCelsius(value) {
|
||||||
|
return value ? `${value}°C` : '';
|
||||||
|
}
|
|
@ -7,7 +7,8 @@ globals:
|
||||||
entity: Entity
|
entity: Entity
|
||||||
user: User
|
user: User
|
||||||
details: Details
|
details: Details
|
||||||
collapseMenu: Collapse left menu
|
collapseMenu: Collapse lateral menu
|
||||||
|
advancedMenu: Advanced menu
|
||||||
backToDashboard: Return to dashboard
|
backToDashboard: Return to dashboard
|
||||||
notifications: Notifications
|
notifications: Notifications
|
||||||
userPanel: User panel
|
userPanel: User panel
|
||||||
|
@ -704,6 +705,7 @@ travel:
|
||||||
totalEntries: Total entries
|
totalEntries: Total entries
|
||||||
totalEntriesTooltip: Total entries
|
totalEntriesTooltip: Total entries
|
||||||
daysOnward: Landed days onwards
|
daysOnward: Landed days onwards
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Entry Id
|
entryId: Entry Id
|
||||||
freight: Freight
|
freight: Freight
|
||||||
|
|
|
@ -8,6 +8,7 @@ globals:
|
||||||
user: Usuario
|
user: Usuario
|
||||||
details: Detalles
|
details: Detalles
|
||||||
collapseMenu: Contraer menú lateral
|
collapseMenu: Contraer menú lateral
|
||||||
|
advancedMenu: Menú avanzado
|
||||||
backToDashboard: Volver al tablón
|
backToDashboard: Volver al tablón
|
||||||
notifications: Notificaciones
|
notifications: Notificaciones
|
||||||
userPanel: Panel de usuario
|
userPanel: Panel de usuario
|
||||||
|
@ -700,6 +701,7 @@ travel:
|
||||||
totalEntries: ∑
|
totalEntries: ∑
|
||||||
totalEntriesTooltip: Entradas totales
|
totalEntriesTooltip: Entradas totales
|
||||||
daysOnward: Días de llegada en adelante
|
daysOnward: Días de llegada en adelante
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Id entrada
|
entryId: Id entrada
|
||||||
freight: Porte
|
freight: Porte
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
import { Dark, Quasar } from 'quasar';
|
import { Dark, Quasar } from 'quasar';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { localeEquivalence } from 'src/i18n/index';
|
||||||
|
import quasarLang from 'src/utils/quasarLang';
|
||||||
|
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
|
|
||||||
|
@ -12,18 +14,9 @@ const userLocale = computed({
|
||||||
set(value) {
|
set(value) {
|
||||||
locale.value = value;
|
locale.value = value;
|
||||||
|
|
||||||
if (value === 'en') value = 'en-GB';
|
value = localeEquivalence[value] ?? value;
|
||||||
|
|
||||||
// FIXME: Dynamic imports from absolute paths are not compatible with vite:
|
quasarLang(value);
|
||||||
// https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
|
|
||||||
try {
|
|
||||||
const langList = import.meta.glob('../../node_modules/quasar/lang/*.mjs');
|
|
||||||
langList[`../../node_modules/quasar/lang/${value}.mjs`]().then((lang) => {
|
|
||||||
Quasar.lang.set(lang.default);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
|
||||||
import { toDate, toPercentage, toCurrency } from 'filters/index';
|
import { toDate, toPercentage, toCurrency } from 'filters/index';
|
||||||
import { tMobile } from 'src/composables/tMobile';
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
|
@ -13,11 +12,11 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = computed(() => useStateStore());
|
|
||||||
const claim = ref(null);
|
const claim = ref(null);
|
||||||
const claimRef = ref();
|
const claimRef = ref();
|
||||||
const claimId = route.params.id;
|
const claimId = route.params.id;
|
||||||
|
@ -201,58 +200,62 @@ async function post(query, params) {
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (destinationTypes = data)"
|
@on-fetch="(data) => (destinationTypes = data)"
|
||||||
/>
|
/>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted() && claim">
|
<RightMenu v-if="claim">
|
||||||
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
<template #right-panel>
|
||||||
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
|
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
||||||
</QCard>
|
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
|
||||||
<QCard class="q-mb-md q-pa-sm no-box-shadow">
|
</QCard>
|
||||||
<QItem class="justify-between">
|
<QCard class="q-mb-md q-pa-sm no-box-shadow">
|
||||||
<QItemLabel class="slider-container">
|
<QItem class="justify-between">
|
||||||
<p class="text-primary">
|
<QItemLabel class="slider-container">
|
||||||
{{ t('claim.actions') }}
|
<p class="text-primary">
|
||||||
</p>
|
{{ t('claim.actions') }}
|
||||||
<QSlider
|
</p>
|
||||||
class="responsibility { 'background-color:primary': quasar.platform.is.mobile }"
|
<QSlider
|
||||||
v-model="claim.responsibility"
|
class="responsibility { 'background-color:primary': quasar.platform.is.mobile }"
|
||||||
:label-value="t('claim.responsibility')"
|
v-model="claim.responsibility"
|
||||||
@change="(value) => save({ responsibility: value })"
|
:label-value="t('claim.responsibility')"
|
||||||
label-always
|
@change="(value) => save({ responsibility: value })"
|
||||||
color="primary"
|
label-always
|
||||||
markers
|
color="primary"
|
||||||
:marker-labels="marker_labels"
|
markers
|
||||||
:min="DEFAULT_MIN_RESPONSABILITY"
|
:marker-labels="marker_labels"
|
||||||
:max="DEFAULT_MAX_RESPONSABILITY"
|
:min="DEFAULT_MIN_RESPONSABILITY"
|
||||||
|
:max="DEFAULT_MAX_RESPONSABILITY"
|
||||||
|
/>
|
||||||
|
</QItemLabel>
|
||||||
|
</QItem>
|
||||||
|
</QCard>
|
||||||
|
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="margin-bottom: 1em">
|
||||||
|
<QItemLabel class="mana q-mb-md">
|
||||||
|
<QCheckbox
|
||||||
|
v-model="claim.isChargedToMana"
|
||||||
|
@update:model-value="(value) => save({ isChargedToMana: value })"
|
||||||
/>
|
/>
|
||||||
|
<span>{{ t('mana') }}</span>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItem>
|
</QCard>
|
||||||
</QCard>
|
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="position: static">
|
||||||
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="margin-bottom: 1em">
|
<QInput
|
||||||
<QItemLabel class="mana q-mb-md">
|
:disable="
|
||||||
<QCheckbox
|
!(
|
||||||
v-model="claim.isChargedToMana"
|
claim.responsibility >=
|
||||||
@update:model-value="(value) => save({ isChargedToMana: value })"
|
Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:label="t('confirmGreuges')"
|
||||||
|
class="q-field__native text-grey-2"
|
||||||
|
type="number"
|
||||||
|
placeholder="0"
|
||||||
|
id="multiplicatorValue"
|
||||||
|
name="multiplicatorValue"
|
||||||
|
min="0"
|
||||||
|
max="50"
|
||||||
|
v-model="multiplicatorValue"
|
||||||
/>
|
/>
|
||||||
<span>{{ t('mana') }}</span>
|
</QCard>
|
||||||
</QItemLabel>
|
</template>
|
||||||
</QCard>
|
</RightMenu>
|
||||||
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="position: static">
|
|
||||||
<QInput
|
|
||||||
:disable="
|
|
||||||
!(claim.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2)
|
|
||||||
"
|
|
||||||
:label="t('confirmGreuges')"
|
|
||||||
class="q-field__native text-grey-2"
|
|
||||||
type="number"
|
|
||||||
placeholder="0"
|
|
||||||
id="multiplicatorValue"
|
|
||||||
name="multiplicatorValue"
|
|
||||||
min="0"
|
|
||||||
max="50"
|
|
||||||
v-model="multiplicatorValue"
|
|
||||||
/>
|
|
||||||
</QCard>
|
|
||||||
</Teleport>
|
|
||||||
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport>
|
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-if="claim"
|
v-if="claim"
|
||||||
data-key="ClaimEnds"
|
data-key="ClaimEnds"
|
||||||
|
|
|
@ -134,7 +134,7 @@ const STATE_COLOR = {
|
||||||
order: ['cs.priority ASC', 'created ASC'],
|
order: ['cs.priority ASC', 'created ASC'],
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #rightMenu>
|
<template #advanced-menu>
|
||||||
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
|
|
@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => {
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="data.payMethod"
|
v-model="data.payMethodFk"
|
||||||
/>
|
/>
|
||||||
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
|
@ -1,25 +1,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
|
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
|
||||||
import CustomerDescriptor from './CustomerDescriptor.vue';
|
import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||||
import CustomerFilter from '../CustomerFilter.vue';
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const routeName = computed(() => route.name);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Client"
|
data-key="Client"
|
||||||
base-url="Clients"
|
base-url="Clients"
|
||||||
:descriptor="CustomerDescriptor"
|
:descriptor="CustomerDescriptor"
|
||||||
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
|
|
||||||
search-data-key="CustomerList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Clients/filter',
|
|
||||||
label: 'Search customer',
|
|
||||||
info: 'You can search by customer id or name',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,177 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import { QItem } from 'quasar';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import { QItemSection } from 'quasar';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
|
||||||
import { toDate } from 'src/filters';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
|
||||||
<template #tags="{ tag, formatFn }">
|
|
||||||
<div class="q-gutter-x-xs">
|
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template #body="{ params }">
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
:label="t('params.item')"
|
|
||||||
v-model="params.itemId"
|
|
||||||
is-outlined
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
v-model="params.buyerId"
|
|
||||||
url="TicketRequests/getItemTypeWorker"
|
|
||||||
:fields="['id', 'nickname']"
|
|
||||||
sort-by="nickname ASC"
|
|
||||||
:label="t('params.buyer')"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
v-model="params.typeId"
|
|
||||||
url="ItemTypes"
|
|
||||||
:include="['category']"
|
|
||||||
:fields="['id', 'name', 'categoryFk']"
|
|
||||||
sort-by="name ASC"
|
|
||||||
:label="t('params.typeId')"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>{{
|
|
||||||
scope.opt?.category?.name
|
|
||||||
}}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
v-model="params.categoryId"
|
|
||||||
url="ItemCategories"
|
|
||||||
:fields="['id', 'name']"
|
|
||||||
sort-by="name ASC"
|
|
||||||
:label="t('params.categoryId')"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
v-model="params.campaignId"
|
|
||||||
url="Campaigns/latest"
|
|
||||||
sort-by="dated DESC"
|
|
||||||
:label="t('params.campaignId')"
|
|
||||||
option-label="code"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{
|
|
||||||
t(`params.${scope.opt?.code}`)
|
|
||||||
}}</QItemLabel>
|
|
||||||
<QItemLabel caption>{{
|
|
||||||
toDate(scope.opt.dated)
|
|
||||||
}}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('params.from')"
|
|
||||||
v-model="params.from"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('params.to')"
|
|
||||||
v-model="params.to"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnFilterPanel>
|
|
||||||
</template>
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
params:
|
|
||||||
item: Item id
|
|
||||||
buyer: Buyer
|
|
||||||
type: Type
|
|
||||||
category: Category
|
|
||||||
itemId: Item id
|
|
||||||
buyerId: Buyer
|
|
||||||
typeId: Type
|
|
||||||
categoryId: Category
|
|
||||||
from: From
|
|
||||||
to: To
|
|
||||||
campaignId: Campaña
|
|
||||||
valentinesDay: Valentine's Day
|
|
||||||
mothersDay: Mother's Day
|
|
||||||
allSaints: All Saints' Day
|
|
||||||
es:
|
|
||||||
params:
|
|
||||||
item: Id artículo
|
|
||||||
buyer: Comprador
|
|
||||||
type: Tipo
|
|
||||||
category: Categoría
|
|
||||||
itemId: Id Artículo
|
|
||||||
buyerId: Comprador
|
|
||||||
typeId: Tipo
|
|
||||||
categoryId: Reino
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
campaignId: Campaña
|
|
||||||
valentinesDay: Día de San Valentín
|
|
||||||
mothersDay: Día de la Madre
|
|
||||||
allSaints: Día de Todos los Santos
|
|
||||||
</i18n>
|
|
|
@ -59,6 +59,7 @@ const columns = computed(() => [
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
:user-filter="{ include: filter.include }"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ClientCredit"
|
data-key="ClientCredit"
|
||||||
url="ClientCredits"
|
url="ClientCredits"
|
||||||
|
|
|
@ -44,6 +44,7 @@ function handleLocation(data, location) {
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('client.socialName')"
|
:rules="validate('client.socialName')"
|
||||||
clearable
|
clearable
|
||||||
|
uppercase="true"
|
||||||
v-model="data.socialName"
|
v-model="data.socialName"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
|
@ -84,6 +84,7 @@ const columns = computed(() => [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
required: true,
|
required: true,
|
||||||
|
positive: false,
|
||||||
},
|
},
|
||||||
format: ({ amount }) => toCurrency(amount),
|
format: ({ amount }) => toCurrency(amount),
|
||||||
create: true,
|
create: true,
|
||||||
|
|
|
@ -5,18 +5,19 @@ import { useRouter } from 'vue-router';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import CustomerSummary from './Card/CustomerSummary.vue';
|
import CustomerSummary from './Card/CustomerSummary.vue';
|
||||||
import CustomerFilter from './CustomerFilter.vue';
|
import CustomerFilter from './CustomerFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const dataKey = 'CustomerList';
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -50,6 +51,14 @@ const columns = computed(() => [
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
create: true,
|
create: true,
|
||||||
columnClass: 'expand',
|
columnClass: 'expand',
|
||||||
|
attrs: {
|
||||||
|
uppercase: true,
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
attrs: {
|
||||||
|
uppercase: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -390,82 +399,91 @@ function handleLocation(data, location) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSection
|
||||||
:info="t('You can search by customer id or name')"
|
:data-key="dataKey"
|
||||||
:label="t('Search customer')"
|
:columns="columns"
|
||||||
data-key="CustomerList"
|
prefix="customer"
|
||||||
/>
|
:array-data-props="{
|
||||||
<RightMenu>
|
url: 'Clients/filter',
|
||||||
<template #right-panel>
|
order: ['id DESC'],
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<CustomerFilter data-key="CustomerList" />
|
<CustomerFilter data-key="CustomerList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="CustomerList"
|
:data-key="dataKey"
|
||||||
url="Clients/filter"
|
url="Clients/filter"
|
||||||
order="id DESC"
|
:create="{
|
||||||
:create="{
|
urlCreate: 'Clients/createWithUser',
|
||||||
urlCreate: 'Clients/createWithUser',
|
title: t('globals.pageTitles.customerCreate'),
|
||||||
title: t('globals.pageTitles.customerCreate'),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
formInitialData: {
|
||||||
formInitialData: {
|
active: true,
|
||||||
active: true,
|
isEqualizated: false,
|
||||||
isEqualizated: false,
|
},
|
||||||
},
|
|
||||||
}"
|
|
||||||
:columns="columns"
|
|
||||||
:right-search="false"
|
|
||||||
redirect="customer"
|
|
||||||
>
|
|
||||||
<template #more-create-dialog="{ data }">
|
|
||||||
<VnSelectWorker
|
|
||||||
:label="t('customer.summary.salesPerson')"
|
|
||||||
v-model="data.salesPersonFk"
|
|
||||||
:params="{
|
|
||||||
departmentCodes: ['VT', 'shopping'],
|
|
||||||
}"
|
}"
|
||||||
:has-avatar="true"
|
:columns="columns"
|
||||||
:id-value="data.salesPersonFk"
|
:right-search="false"
|
||||||
emit-value
|
redirect="customer"
|
||||||
auto-load
|
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #more-create-dialog="{ data }">
|
||||||
<VnAvatar
|
<VnSelectWorker
|
||||||
:worker-id="data.salesPersonFk"
|
:label="t('customer.summary.salesPerson')"
|
||||||
color="primary"
|
v-model="data.salesPersonFk"
|
||||||
:title="title"
|
:params="{
|
||||||
|
departmentCodes: ['VT', 'shopping'],
|
||||||
|
}"
|
||||||
|
:has-avatar="true"
|
||||||
|
:id-value="data.salesPersonFk"
|
||||||
|
emit-value
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<VnAvatar
|
||||||
|
:worker-id="data.salesPersonFk"
|
||||||
|
color="primary"
|
||||||
|
:title="title"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption
|
||||||
|
>{{ scope.opt?.nickname }},
|
||||||
|
{{ scope.opt?.code }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectWorker>
|
||||||
|
<VnLocation
|
||||||
|
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||||
|
v-model="data.location"
|
||||||
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
/>
|
/>
|
||||||
|
<QInput v-model="data.userName" :label="t('Web user')" />
|
||||||
|
<QInput
|
||||||
|
:label="t('Email')"
|
||||||
|
clearable
|
||||||
|
type="email"
|
||||||
|
v-model="data.email"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QIcon name="info" class="cursor-info">
|
||||||
|
<QTooltip max-width="400px">{{
|
||||||
|
t('customer.basicData.youCanSaveMultipleEmails')
|
||||||
|
}}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</QInput>
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
</VnTable>
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption
|
|
||||||
>{{ scope.opt?.nickname }},
|
|
||||||
{{ scope.opt?.code }}</QItemLabel
|
|
||||||
>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelectWorker>
|
|
||||||
<VnLocation
|
|
||||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
|
||||||
v-model="data.location"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
|
||||||
/>
|
|
||||||
<QInput v-model="data.userName" :label="t('Web user')" />
|
|
||||||
<QInput :label="t('Email')" clearable type="email" v-model="data.email">
|
|
||||||
<template #append>
|
|
||||||
<QIcon name="info" class="cursor-info">
|
|
||||||
<QTooltip max-width="400px">{{
|
|
||||||
t('customer.basicData.youCanSaveMultipleEmails')
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
</QInput>
|
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
|
|
@ -94,6 +94,8 @@ customer:
|
||||||
hasToInvoiceByAddress: Invoice by address
|
hasToInvoiceByAddress: Invoice by address
|
||||||
isToBeMailed: Mailing
|
isToBeMailed: Mailing
|
||||||
hasSepaVnl: VNL B2B received
|
hasSepaVnl: VNL B2B received
|
||||||
|
search: Search customer
|
||||||
|
searchInfo: You can search by customer ID
|
||||||
params:
|
params:
|
||||||
id: Id
|
id: Id
|
||||||
isWorker: Is Worker
|
isWorker: Is Worker
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Search customer: Buscar cliente
|
|
||||||
You can search by customer id or name: Puedes buscar por id o nombre del cliente
|
|
||||||
customer:
|
customer:
|
||||||
card:
|
card:
|
||||||
debt: Riesgo
|
debt: Riesgo
|
||||||
|
@ -96,6 +94,8 @@ customer:
|
||||||
hasToInvoiceByAddress: Factura por consigna
|
hasToInvoiceByAddress: Factura por consigna
|
||||||
isToBeMailed: Env. emails
|
isToBeMailed: Env. emails
|
||||||
hasSepaVnl: Recibido B2B VNL
|
hasSepaVnl: Recibido B2B VNL
|
||||||
|
search: Buscar cliente
|
||||||
|
searchInfo: Puedes buscar por id o nombre del cliente
|
||||||
params:
|
params:
|
||||||
id: ID
|
id: ID
|
||||||
isWorker: Es trabajador
|
isWorker: Es trabajador
|
||||||
|
|
|
@ -106,7 +106,7 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
:to="{
|
:to="{
|
||||||
name: 'WorkerList',
|
name: 'WorkerList',
|
||||||
query: {
|
query: {
|
||||||
params: JSON.stringify({ departmentFk: entityId }),
|
table: JSON.stringify({ departmentFk: entityId }),
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
@ -11,7 +10,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
||||||
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -26,6 +25,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
formData.travelFk = id;
|
formData.travelFk = id;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="companiesRef"
|
ref="companiesRef"
|
||||||
|
@ -93,14 +93,13 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel
|
<QItemLabel>
|
||||||
>{{ scope.opt?.agencyModeName }} -
|
{{ scope.opt?.agencyModeName }} -
|
||||||
{{ scope.opt?.warehouseInName }} ({{
|
{{ scope.opt?.warehouseInName }}
|
||||||
toDate(scope.opt?.shipped)
|
({{ toDate(scope.opt?.shipped) }}) →
|
||||||
}}) → {{ scope.opt?.warehouseOutName }} ({{
|
{{ scope.opt?.warehouseOutName }}
|
||||||
toDate(scope.opt?.landed)
|
({{ toDate(scope.opt?.landed) }})
|
||||||
}})</QItemLabel
|
</QItemLabel>
|
||||||
>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
@ -126,6 +125,13 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('entry.summary.commission')"
|
||||||
|
v-model="data.commission"
|
||||||
|
step="1"
|
||||||
|
autofocus
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('entry.summary.currency')"
|
:label="t('entry.summary.currency')"
|
||||||
v-model="data.currencyFk"
|
v-model="data.currencyFk"
|
||||||
|
@ -133,12 +139,23 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="code"
|
option-label="code"
|
||||||
/>
|
/>
|
||||||
<QInput
|
</VnRow>
|
||||||
:label="t('entry.summary.commission')"
|
<VnRow>
|
||||||
v-model="data.commission"
|
<VnInputNumber
|
||||||
type="number"
|
v-model="data.initialTemperature"
|
||||||
autofocus
|
name="initialTemperature"
|
||||||
min="0"
|
:label="t('entry.basicData.initialTemperature')"
|
||||||
|
:step="0.5"
|
||||||
|
:decimal-places="2"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
|
<VnInputNumber
|
||||||
|
v-model="data.finalTemperature"
|
||||||
|
name="finalTemperature"
|
||||||
|
:label="t('entry.basicData.finalTemperature')"
|
||||||
|
:step="0.5"
|
||||||
|
:decimal-places="2"
|
||||||
|
:positive="false"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency, toCelsius } from 'src/filters';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
|
@ -193,6 +193,14 @@ const fetchEntryBuys = async () => {
|
||||||
:label="t('entry.summary.invoiceNumber')"
|
:label="t('entry.summary.invoiceNumber')"
|
||||||
:value="entry.invoiceNumber"
|
:value="entry.invoiceNumber"
|
||||||
/>
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('entry.basicData.initialTemperature')"
|
||||||
|
:value="toCelsius(entry.initialTemperature)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('entry.basicData.finalTemperature')"
|
||||||
|
:value="toCelsius(entry.finalTemperature)"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import EntryFilter from './EntryFilter.vue';
|
import EntryFilter from './EntryFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toCelsius, toDate } from 'src/filters';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import EntrySummary from './Card/EntrySummary.vue';
|
import EntrySummary from './Card/EntrySummary.vue';
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
@ -157,6 +157,20 @@ const columns = computed(() => [
|
||||||
name: 'invoiceAmount',
|
name: 'invoiceAmount',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'initialTemperature',
|
||||||
|
label: t('entry.basicData.initialTemperature'),
|
||||||
|
field: 'initialTemperature',
|
||||||
|
format: (row) => toCelsius(row.initialTemperature),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'finalTemperature',
|
||||||
|
label: t('entry.basicData.finalTemperature'),
|
||||||
|
field: 'finalTemperature',
|
||||||
|
format: (row) => toCelsius(row.finalTemperature),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||||
name: 'isExcludedFromAvailable',
|
name: 'isExcludedFromAvailable',
|
||||||
|
@ -188,7 +202,7 @@ const columns = computed(() => [
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Entries/filter',
|
url: 'Entries/filter',
|
||||||
order: 'id DESC',
|
order: 'id DESC',
|
||||||
userFilter: 'entryFilter',
|
userFilter: entryFilter,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #rightMenu>
|
<template #rightMenu>
|
||||||
|
|
|
@ -40,6 +40,8 @@ entry:
|
||||||
observation: Observation
|
observation: Observation
|
||||||
booked: Booked
|
booked: Booked
|
||||||
excludedFromAvailable: Inventory
|
excludedFromAvailable: Inventory
|
||||||
|
initialTemperature: Ini °C
|
||||||
|
finalTemperature: Fin °C
|
||||||
buys:
|
buys:
|
||||||
observations: Observations
|
observations: Observations
|
||||||
packagingFk: Box
|
packagingFk: Box
|
||||||
|
|
|
@ -41,6 +41,8 @@ entry:
|
||||||
commission: Comisión
|
commission: Comisión
|
||||||
booked: Asentado
|
booked: Asentado
|
||||||
excludedFromAvailable: Inventario
|
excludedFromAvailable: Inventario
|
||||||
|
initialTemperature: Ini °C
|
||||||
|
finalTemperature: Fin °C
|
||||||
buys:
|
buys:
|
||||||
observations: Observaciónes
|
observations: Observaciónes
|
||||||
packagingFk: Embalaje
|
packagingFk: Embalaje
|
||||||
|
|
|
@ -6,24 +6,16 @@ import axios from 'axios';
|
||||||
import { toCurrency, toDate } from 'src/filters';
|
import { toCurrency, toDate } from 'src/filters';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue';
|
import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({ id: { type: Number, default: null } });
|
const $props = defineProps({ id: { type: Number, default: null } });
|
||||||
const { push, currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const cardDescriptorRef = ref();
|
const cardDescriptorRef = ref();
|
||||||
const correctionDialogRef = ref();
|
|
||||||
const entityId = computed(() => $props.id || +currentRoute.value.params.id);
|
const entityId = computed(() => $props.id || +currentRoute.value.params.id);
|
||||||
const totalAmount = ref();
|
const totalAmount = ref();
|
||||||
const config = ref();
|
|
||||||
const cplusRectificationTypes = ref([]);
|
|
||||||
const siiTypeInvoiceIns = ref([]);
|
|
||||||
const invoiceCorrectionTypes = ref([]);
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -85,12 +77,6 @@ const routes = reactive({
|
||||||
return { name: 'EntryCard', params: { id } };
|
return { name: 'EntryCard', params: { id } };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const correctionFormData = reactive({
|
|
||||||
invoiceReason: 2,
|
|
||||||
invoiceType: 2,
|
|
||||||
invoiceClass: 6,
|
|
||||||
});
|
|
||||||
const isNotFilled = computed(() => Object.values(correctionFormData).includes(null));
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await setInvoiceCorrection(entityId.value);
|
await setInvoiceCorrection(entityId.value);
|
||||||
|
@ -122,38 +108,8 @@ async function setInvoiceCorrection(id) {
|
||||||
(corrected) => corrected.correctingFk
|
(corrected) => corrected.correctingFk
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const createInvoiceInCorrection = async () => {
|
|
||||||
const { data: correctingId } = await axios.post(
|
|
||||||
'InvoiceIns/corrective',
|
|
||||||
Object.assign(correctionFormData, { id: entityId.value })
|
|
||||||
);
|
|
||||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="InvoiceInConfigs"
|
|
||||||
:where="{ fields: ['sageWithholdingFk'] }"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (config = data)"
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="CplusRectificationTypes"
|
|
||||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="SiiTypeInvoiceIns"
|
|
||||||
:where="{ code: { like: 'R%' } }"
|
|
||||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="InvoiceCorrectionTypes"
|
|
||||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="InvoiceIn"
|
module="InvoiceIn"
|
||||||
|
@ -167,7 +123,10 @@ const createInvoiceInCorrection = async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('invoicein.list.issued')" :value="toDate(entity.issued)" />
|
<VnLv :label="t('invoicein.list.issued')" :value="toDate(entity.issued)" />
|
||||||
<VnLv :label="t('invoicein.summary.bookedDate')" :value="toDate(entity.booked)" />
|
<VnLv
|
||||||
|
:label="t('invoicein.summary.bookedDate')"
|
||||||
|
:value="toDate(entity.booked)"
|
||||||
|
/>
|
||||||
<VnLv :label="t('invoicein.list.amount')" :value="toCurrency(totalAmount)" />
|
<VnLv :label="t('invoicein.list.amount')" :value="toCurrency(totalAmount)" />
|
||||||
<VnLv :label="t('invoicein.list.supplier')">
|
<VnLv :label="t('invoicein.list.supplier')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
@ -227,65 +186,6 @@ const createInvoiceInCorrection = async () => {
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
<QDialog ref="correctionDialogRef">
|
|
||||||
<QCard>
|
|
||||||
<QCardSection>
|
|
||||||
<QItem class="q-px-none">
|
|
||||||
<span class="text-primary text-h6 full-width">
|
|
||||||
{{ t('Create rectificative invoice') }}
|
|
||||||
</span>
|
|
||||||
<QBtn icon="close" flat round dense v-close-popup />
|
|
||||||
</QItem>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<QInput
|
|
||||||
:label="t('Original invoice')"
|
|
||||||
v-model="entityId"
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
:label="`${useCapitalize(t('globals.class'))}`"
|
|
||||||
v-model="correctionFormData.invoiceClass"
|
|
||||||
:options="siiTypeInvoiceIns"
|
|
||||||
option-value="id"
|
|
||||||
option-label="code"
|
|
||||||
:required="true"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="`${useCapitalize(t('globals.type'))}`"
|
|
||||||
v-model="correctionFormData.invoiceType"
|
|
||||||
:options="cplusRectificationTypes"
|
|
||||||
option-value="id"
|
|
||||||
option-label="description"
|
|
||||||
:required="true"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
|
||||||
v-model="correctionFormData.invoiceReason"
|
|
||||||
:options="invoiceCorrectionTypes"
|
|
||||||
option-value="id"
|
|
||||||
option-label="description"
|
|
||||||
:required="true"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardActions class="justify-end q-mr-sm">
|
|
||||||
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
|
||||||
<QBtn
|
|
||||||
:label="t('globals.save')"
|
|
||||||
color="primary"
|
|
||||||
v-close-popup
|
|
||||||
@click="createInvoiceInCorrection"
|
|
||||||
:disable="isNotFilled"
|
|
||||||
/>
|
|
||||||
</QCardActions>
|
|
||||||
</QCard>
|
|
||||||
</QDialog>
|
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.q-dialog {
|
.q-dialog {
|
||||||
|
|
|
@ -8,9 +8,12 @@ import { useAcl } from 'src/composables/useAcl';
|
||||||
import { downloadFile } from 'src/composables/downloadFile';
|
import { downloadFile } from 'src/composables/downloadFile';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import InvoiceInToBook from '../InvoiceInToBook.vue';
|
import InvoiceInToBook from '../InvoiceInToBook.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const { hasAny } = useAcl();
|
const { hasAny } = useAcl();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -31,6 +34,10 @@ const correctionDialogRef = ref();
|
||||||
const invoiceInCorrection = reactive({ correcting: [], corrected: null });
|
const invoiceInCorrection = reactive({ correcting: [], corrected: null });
|
||||||
const entityId = computed(() => $props.invoice.id || +currentRoute.value.params.id);
|
const entityId = computed(() => $props.invoice.id || +currentRoute.value.params.id);
|
||||||
const invoiceIn = computed(() => arrayData.store.data);
|
const invoiceIn = computed(() => arrayData.store.data);
|
||||||
|
const isNotFilled = computed(() => Object.values(correctionFormData).includes(null));
|
||||||
|
const invoiceCorrectionTypes = ref([]);
|
||||||
|
const cplusRectificationTypes = ref([]);
|
||||||
|
const siiTypeInvoiceIns = ref([]);
|
||||||
const actions = {
|
const actions = {
|
||||||
unbook: {
|
unbook: {
|
||||||
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }),
|
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }),
|
||||||
|
@ -48,6 +55,11 @@ const actions = {
|
||||||
sendPdf: { cb: sendPdfInvoiceConfirmation },
|
sendPdf: { cb: sendPdfInvoiceConfirmation },
|
||||||
correct: { cb: () => correctionDialogRef.value.show() },
|
correct: { cb: () => correctionDialogRef.value.show() },
|
||||||
};
|
};
|
||||||
|
const correctionFormData = reactive({
|
||||||
|
invoiceReason: 2,
|
||||||
|
invoiceType: 2,
|
||||||
|
invoiceClass: 8,
|
||||||
|
});
|
||||||
const canEditProp = (props) =>
|
const canEditProp = (props) =>
|
||||||
hasAny([{ model: 'InvoiceIn', props, accessType: 'WRITE' }]);
|
hasAny([{ model: 'InvoiceIn', props, accessType: 'WRITE' }]);
|
||||||
|
|
||||||
|
@ -133,9 +145,39 @@ function sendPdfInvoice({ address }) {
|
||||||
recipient: address,
|
recipient: address,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const createInvoiceInCorrection = async () => {
|
||||||
|
const { data: correctingId } = await axios.post(
|
||||||
|
'InvoiceIns/corrective',
|
||||||
|
Object.assign(correctionFormData, { id: entityId.value })
|
||||||
|
);
|
||||||
|
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="InvoiceCorrectionTypes"
|
||||||
|
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="CplusRectificationTypes"
|
||||||
|
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="SiiTypeInvoiceIns"
|
||||||
|
:where="{ code: { like: 'R%' } }"
|
||||||
|
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="InvoiceInConfigs"
|
||||||
|
:where="{ fields: ['sageWithholdingFk'] }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (config = data)"
|
||||||
|
/>
|
||||||
<InvoiceInToBook>
|
<InvoiceInToBook>
|
||||||
<template #content="{ book }">
|
<template #content="{ book }">
|
||||||
<QItem
|
<QItem
|
||||||
|
@ -162,7 +204,7 @@ function sendPdfInvoice({ address }) {
|
||||||
v-if="canEditProp('deleteById')"
|
v-if="canEditProp('deleteById')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="triggerMenu('invoicein.descriptorMenu.delete')"
|
@click="triggerMenu('delete')"
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection>
|
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -192,6 +234,79 @@ function sendPdfInvoice({ address }) {
|
||||||
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
||||||
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QDialog ref="correctionDialogRef">
|
||||||
|
<QCard>
|
||||||
|
<QCardSection>
|
||||||
|
<QItem class="q-px-none">
|
||||||
|
<span class="text-primary text-h6 full-width">
|
||||||
|
{{ t('Create rectificative invoice') }}
|
||||||
|
</span>
|
||||||
|
<QBtn icon="close" flat round dense v-close-popup />
|
||||||
|
</QItem>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<QInput
|
||||||
|
:label="t('Original invoice')"
|
||||||
|
v-model="entityId"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="`${useCapitalize(t('globals.class'))}`"
|
||||||
|
v-model="correctionFormData.invoiceClass"
|
||||||
|
:options="siiTypeInvoiceIns"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
:label="`${useCapitalize(t('globals.type'))}`"
|
||||||
|
v-model="correctionFormData.invoiceType"
|
||||||
|
:options="cplusRectificationTypes"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
:required="true"
|
||||||
|
>
|
||||||
|
<template #option="{ itemProps, opt }">
|
||||||
|
<QItem v-bind="itemProps">
|
||||||
|
{{ console.log('opt: ', opt) }}
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
>{{ opt.id }} -
|
||||||
|
{{ opt.description }}</QItemLabel
|
||||||
|
>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<div></div>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
|
||||||
|
<VnSelect
|
||||||
|
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||||
|
v-model="correctionFormData.invoiceReason"
|
||||||
|
:options="invoiceCorrectionTypes"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardActions class="justify-end q-mr-sm">
|
||||||
|
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
||||||
|
<QBtn
|
||||||
|
:label="t('globals.save')"
|
||||||
|
color="primary"
|
||||||
|
v-close-popup
|
||||||
|
@click="createInvoiceInCorrection"
|
||||||
|
:disable="isNotFilled"
|
||||||
|
/>
|
||||||
|
</QCardActions>
|
||||||
|
</QCard>
|
||||||
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -25,6 +25,7 @@ const sageTaxTypes = ref([]);
|
||||||
const sageTransactionTypes = ref([]);
|
const sageTransactionTypes = ref([]);
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
const invoiceInFormRef = ref();
|
const invoiceInFormRef = ref();
|
||||||
|
const expenseRef = ref();
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
actionIcon: {
|
actionIcon: {
|
||||||
|
@ -89,6 +90,11 @@ const columns = computed(() => [
|
||||||
field: (row) => row.foreignValue,
|
field: (row) => row.foreignValue,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'total',
|
||||||
|
label: 'Total',
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
|
@ -128,8 +134,26 @@ function autocompleteExpense(evt, row, col) {
|
||||||
({ id }) => id == useAccountShortToStandard(param)
|
({ id }) => id == useAccountShortToStandard(param)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (lookup) row[col.model] = lookup;
|
expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const taxableBaseTotal = computed(() => {
|
||||||
|
return getTotal(invoiceInFormRef.value.formData, 'taxableBase', );
|
||||||
|
});
|
||||||
|
|
||||||
|
const taxRateTotal = computed(() => {
|
||||||
|
return getTotal(invoiceInFormRef.value.formData, null, {
|
||||||
|
cb: taxRate,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const combinedTotal = computed(() => {
|
||||||
|
return +taxableBaseTotal.value + +taxRateTotal.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -167,6 +191,7 @@ function autocompleteExpense(evt, row, col) {
|
||||||
<template #body-cell-expense="{ row, col }">
|
<template #body-cell-expense="{ row, col }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
|
ref="expenseRef"
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
:options="col.options"
|
:options="col.options"
|
||||||
:option-value="col.optionValue"
|
:option-value="col.optionValue"
|
||||||
|
@ -270,26 +295,20 @@ function autocompleteExpense(evt, row, col) {
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd>
|
<QTd>
|
||||||
{{ getTotal(rows, 'taxableBase', { currency: 'default' }) }}
|
{{ toCurrency(taxableBaseTotal) }}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd>
|
<QTd>
|
||||||
{{
|
{{ toCurrency(taxRateTotal) }}
|
||||||
getTotal(rows, null, { cb: taxRate, currency: 'default' })
|
</QTd>
|
||||||
}}</QTd
|
<QTd />
|
||||||
>
|
|
||||||
<QTd>
|
<QTd>
|
||||||
<template v-if="isNotEuro(invoiceIn.currency.code)">
|
{{ toCurrency(combinedTotal) }}
|
||||||
{{
|
|
||||||
getTotal(rows, 'foreignValue', {
|
|
||||||
currency: invoiceIn.currency.code,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</template>
|
|
||||||
</QTd>
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #item="props">
|
<template #item="props">
|
||||||
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
|
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
|
||||||
<QCard bordered flat class="q-my-xs">
|
<QCard bordered flat class="q-my-xs">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, computed, reactive, ref, nextTick, watch } from 'vue';
|
import { onMounted, computed, ref, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||||
|
@ -22,19 +22,16 @@ import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const today = ref(Date.vnNew());
|
const today = Date.vnNew();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const itemBalancesRef = ref(null);
|
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
||||||
const itemsBalanceFilter = reactive({
|
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||||
where: { itemFk: route.params.id, warehouseFk: null, date: null },
|
const showWhatsBeforeInventory = ref(false);
|
||||||
});
|
|
||||||
const itemBalances = ref([]);
|
|
||||||
const warehouseFk = ref(null);
|
|
||||||
const _showWhatsBeforeInventory = ref(false);
|
|
||||||
const inventoriedDate = ref(null);
|
const inventoriedDate = ref(null);
|
||||||
|
let arrayDataItemBalances = useArrayData('ItemBalances');
|
||||||
|
|
||||||
const originTypeMap = {
|
const originTypeMap = {
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -122,36 +119,28 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const showWhatsBeforeInventory = computed({
|
|
||||||
get: () => _showWhatsBeforeInventory.value,
|
|
||||||
set: (val) => {
|
|
||||||
_showWhatsBeforeInventory.value = val;
|
|
||||||
if (!val) itemsBalanceFilter.where.date = null;
|
|
||||||
else itemsBalanceFilter.where.date = inventoriedDate.value ?? new Date();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
today.value.setHours(0, 0, 0, 0);
|
const ref = where.value;
|
||||||
if (route.query.warehouseFk) warehouseFk.value = route.query.warehouseFk;
|
const query = route.query;
|
||||||
else if (user.value) warehouseFk.value = user.value.warehouseFk;
|
inventoriedDate.value =
|
||||||
itemsBalanceFilter.where.warehouseFk = warehouseFk.value;
|
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
||||||
const { data } = await axios.get('Configs/findOne');
|
|
||||||
inventoriedDate.value = data.inventoried;
|
if (query.warehouseFk) ref.warehouseFk = query.warehouseFk;
|
||||||
|
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
|
||||||
|
if (ref.date) showWhatsBeforeInventory.value = true;
|
||||||
|
ref.itemFk = route.params.id;
|
||||||
|
|
||||||
|
arrayDataItemBalances = useArrayData('ItemBalances', {
|
||||||
|
url: 'Items/getBalance',
|
||||||
|
filter: { where: ref },
|
||||||
|
});
|
||||||
|
|
||||||
await fetchItemBalances();
|
await fetchItemBalances();
|
||||||
await scrollToToday();
|
await scrollToToday();
|
||||||
await updateWarehouse(warehouseFk.value);
|
await updateWarehouse(ref.warehouseFk);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
||||||
() => router.currentRoute.value.params.id,
|
|
||||||
(newId) => {
|
|
||||||
itemsBalanceFilter.where.itemFk = newId;
|
|
||||||
itemBalancesRef.value.fetch();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const fetchItemBalances = async () => await itemBalancesRef.value.fetch();
|
|
||||||
|
|
||||||
const getBadgeAttrs = (_date) => {
|
const getBadgeAttrs = (_date) => {
|
||||||
const isSameDate = date.isSameDate(today.value, _date);
|
const isSameDate = date.isSameDate(today.value, _date);
|
||||||
|
@ -178,23 +167,13 @@ const formatDateForAttribute = (dateValue) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function updateWarehouse(warehouseFk) {
|
async function updateWarehouse(warehouseFk) {
|
||||||
const stock = useArrayData('descriptorStock', {
|
const stock = useArrayData('descriptorStock', { userParams: { warehouseFk } });
|
||||||
userParams: {
|
|
||||||
warehouseFk,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
await stock.fetch({});
|
await stock.fetch({});
|
||||||
stock.store.data.itemFk = route.params.id;
|
stock.store.data.itemFk = route.params.id;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
ref="itemBalancesRef"
|
|
||||||
url="Items/getBalance"
|
|
||||||
:filter="itemsBalanceFilter"
|
|
||||||
@on-fetch="(data) => (itemBalances = data)"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
|
@ -207,27 +186,30 @@ async function updateWarehouse(warehouseFk) {
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('itemDiary.warehouse')"
|
:label="t('itemDiary.warehouse')"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
hide-selected
|
v-model="where.warehouseFk"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
|
||||||
v-model="itemsBalanceFilter.where.warehouseFk"
|
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(value) => fetchItemBalances() && updateWarehouse(value)
|
(val) => fetchItemBalances() && updateWarehouse(val)
|
||||||
"
|
"
|
||||||
class="q-mr-lg"
|
class="q-mr-lg"
|
||||||
|
:is-clearable="false"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('itemDiary.showBefore')"
|
:label="t('itemDiary.showBefore')"
|
||||||
v-model="showWhatsBeforeInventory"
|
v-model="showWhatsBeforeInventory"
|
||||||
@update:model-value="fetchItemBalances"
|
@update:model-value="
|
||||||
|
async (val) => {
|
||||||
|
if (!val) where.date = null;
|
||||||
|
else where.date = inventoriedDate;
|
||||||
|
await fetchItemBalances();
|
||||||
|
}
|
||||||
|
"
|
||||||
class="q-mr-lg"
|
class="q-mr-lg"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-if="showWhatsBeforeInventory"
|
v-if="showWhatsBeforeInventory"
|
||||||
:label="t('itemDiary.since')"
|
:label="t('itemDiary.since')"
|
||||||
dense
|
dense
|
||||||
v-model="itemsBalanceFilter.where.date"
|
v-model="where.date"
|
||||||
@update:model-value="fetchItemBalances"
|
@update:model-value="fetchItemBalances"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,18 +36,7 @@ const exprBuilder = (param, value) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const where = {
|
let arrayData = useArrayData('ItemLastEntries');
|
||||||
itemFk: route.params.id,
|
|
||||||
};
|
|
||||||
|
|
||||||
const arrayData = useArrayData('ItemLastEntries', {
|
|
||||||
url: 'Items/lastEntriesFilter',
|
|
||||||
order: ['landed DESC', 'buyFk DESC'],
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
userFilter: {
|
|
||||||
where: where,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const itemLastEntries = ref([]);
|
const itemLastEntries = ref([]);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -161,25 +150,51 @@ const getDate = (date, type) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateFilter = async () => {
|
const updateFilter = async () => {
|
||||||
let filter;
|
let landed;
|
||||||
if (!from.value && to.value) filter = { lte: to.value };
|
if (!from.value && to.value) landed = { lte: to.value };
|
||||||
else if (from.value && !to.value) filter = { gte: from.value };
|
else if (from.value && !to.value) landed = { gte: from.value };
|
||||||
else if (from.value && to.value) filter = { between: [from.value, to.value] };
|
else if (from.value && to.value) landed = { between: [from.value, to.value] };
|
||||||
|
|
||||||
const userFilter = arrayData.store.userFilter.where;
|
|
||||||
|
|
||||||
userFilter.landed = filter;
|
|
||||||
|
|
||||||
|
arrayData.store.filter.where.landed = landed;
|
||||||
await fetchItemLastEntries();
|
await fetchItemLastEntries();
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const _from = Date.vnNew();
|
const landed = arrayData.store.filter.where?.landed;
|
||||||
_from.setDate(_from.getDate() - 75);
|
arrayData = useArrayData('ItemLastEntries', {
|
||||||
from.value = getDate(_from, 'from');
|
url: 'Items/lastEntriesFilter',
|
||||||
const _to = Date.vnNew();
|
order: ['landed DESC', 'buyFk DESC'],
|
||||||
_to.setDate(_to.getDate() + 10);
|
exprBuilder: exprBuilder,
|
||||||
to.value = getDate(_to, 'to');
|
filter: {
|
||||||
|
where: {
|
||||||
|
itemFk: route.params.id,
|
||||||
|
landed,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (landed) {
|
||||||
|
const key = Object.keys(landed)[0];
|
||||||
|
switch (key) {
|
||||||
|
case 'gte':
|
||||||
|
from.value = landed.gte;
|
||||||
|
break;
|
||||||
|
case 'lte':
|
||||||
|
to.value = landed.lte;
|
||||||
|
break;
|
||||||
|
case 'between':
|
||||||
|
from.value = landed.between[0];
|
||||||
|
to.value = landed.between[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const _from = Date.vnNew();
|
||||||
|
_from.setDate(_from.getDate() - 75);
|
||||||
|
from.value = getDate(_from, 'from');
|
||||||
|
const _to = Date.vnNew();
|
||||||
|
_to.setDate(_to.getDate() + 10);
|
||||||
|
to.value = getDate(_to, 'to');
|
||||||
|
}
|
||||||
|
|
||||||
updateFilter();
|
updateFilter();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { onMounted, ref, computed, watch } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||||
|
@ -9,6 +9,7 @@ import CatalogItem from 'src/components/ui/CatalogItem.vue';
|
||||||
import OrderCatalogFilter from 'src/pages/Order/Card/OrderCatalogFilter.vue';
|
import OrderCatalogFilter from 'src/pages/Order/Card/OrderCatalogFilter.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -89,14 +90,16 @@ watch(
|
||||||
:search-remove-params="false"
|
:search-remove-params="false"
|
||||||
/>
|
/>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<OrderCatalogFilter
|
<template #right-panel>
|
||||||
:data-key="dataKey"
|
<OrderCatalogFilter
|
||||||
:tag-value="tagValue"
|
:data-key="dataKey"
|
||||||
:tags="tags"
|
:tag-value="tagValue"
|
||||||
:initial-catalog-params="catalogParams"
|
:tags="tags"
|
||||||
/>
|
:initial-catalog-params="catalogParams"
|
||||||
</Teleport>
|
/>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||||
<div class="full-width">
|
<div class="full-width">
|
||||||
<VnPaginate :data-key="dataKey">
|
<VnPaginate :data-key="dataKey">
|
||||||
|
@ -141,5 +144,5 @@ watch(
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
You can search items by name or id: Puedes buscar items por nombre o id
|
You can search items by name or id: Puedes buscar items por nombre o id
|
||||||
Search items: Buscar items
|
Search items: Buscar artículos
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { ref, computed, watch } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { confirm } from 'src/pages/Order/composables/confirmOrder';
|
import { confirm } from 'src/pages/Order/composables/confirmOrder';
|
||||||
import { toCurrency, toDate } from 'src/filters';
|
import { toCurrency, toDate } from 'src/filters';
|
||||||
|
@ -16,9 +15,9 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -264,23 +263,27 @@ watch(
|
||||||
@on-fetch="(data) => (orderSummary.vat = data)"
|
@on-fetch="(data) => (orderSummary.vat = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<QCard
|
<template #right-panel>
|
||||||
class="order-lines-summary q-pa-lg"
|
<QCard
|
||||||
v-if="orderSummary.vat && orderSummary.total"
|
class="order-lines-summary q-pa-lg"
|
||||||
>
|
v-if="orderSummary.vat && orderSummary.total"
|
||||||
<p class="header text-right block">
|
>
|
||||||
{{ t('summary') }}
|
<p class="header text-right block">
|
||||||
</p>
|
{{ t('summary') }}
|
||||||
<VnLv
|
</p>
|
||||||
:label="t('subtotal') + ': '"
|
<VnLv
|
||||||
:value="toCurrency(orderSummary.total - orderSummary.vat)"
|
:label="t('subtotal') + ': '"
|
||||||
/>
|
:value="toCurrency(orderSummary.total - orderSummary.vat)"
|
||||||
<VnLv :label="t('VAT') + ': '" :value="toCurrency(orderSummary?.vat)" />
|
/>
|
||||||
<VnLv :label="t('total') + ': '" :value="toCurrency(orderSummary?.total)" />
|
<VnLv :label="t('VAT') + ': '" :value="toCurrency(orderSummary?.vat)" />
|
||||||
</QCard>
|
<VnLv
|
||||||
</Teleport>
|
:label="t('total') + ': '"
|
||||||
|
:value="toCurrency(orderSummary?.total)"
|
||||||
|
/>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableLinesRef"
|
ref="tableLinesRef"
|
||||||
data-key="OrderLines"
|
data-key="OrderLines"
|
||||||
|
|
|
@ -190,7 +190,7 @@ const getDateColor = (date) => {
|
||||||
order: ['landed DESC', 'clientFk ASC', 'id DESC'],
|
order: ['landed DESC', 'clientFk ASC', 'id DESC'],
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #rightMenu>
|
<template #advanced-menu>
|
||||||
<OrderFilter data-key="OrderList" />
|
<OrderFilter data-key="OrderList" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
|
|
@ -68,6 +68,8 @@ function handleLocation(data, location) {
|
||||||
'supplierActivityFk',
|
'supplierActivityFk',
|
||||||
'healthRegister',
|
'healthRegister',
|
||||||
'street',
|
'street',
|
||||||
|
'isVies',
|
||||||
|
'isTrucker',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -92,6 +94,7 @@ function handleLocation(data, location) {
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:label="t('supplier.fiscalData.name')"
|
:label="t('supplier.fiscalData.name')"
|
||||||
|
uppercase="true"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -5,6 +5,7 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import SupplierListFilter from './SupplierListFilter.vue';
|
import SupplierListFilter from './SupplierListFilter.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -23,9 +24,14 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.name'),
|
label: t('globals.name'),
|
||||||
name: 'socialName',
|
name: 'socialName',
|
||||||
create: true,
|
attrs: {
|
||||||
|
uppercase: true,
|
||||||
|
},
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
|
attrs: {
|
||||||
|
uppercase: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
},
|
},
|
||||||
|
@ -118,14 +124,18 @@ const columns = computed(() => [
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
mapper: (data) => {
|
mapper: (data) => {
|
||||||
data.name = data.socialName;
|
data.name = data.socialName;
|
||||||
delete data.socialName;
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
order="id ASC"
|
order="id ASC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
>
|
||||||
|
<template #more-create-dialog="{ data }">
|
||||||
|
<VnInput :label="t('globals.name')" v-model="data.socialName" :uppercase="true" />
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { date, useQuasar } from 'quasar';
|
import { date, useQuasar } from 'quasar';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
@ -9,9 +9,7 @@ import { useRouter } from 'vue-router';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
await fetch();
|
await fetch();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -86,69 +84,73 @@ async function getVideoList(expeditionId, timed) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<QList bordered separator style="max-width: 318px">
|
<template #right-panel>
|
||||||
<QItem v-if="lastExpedition && videoList.length">
|
<QList bordered separator style="max-width: 318px">
|
||||||
<QItemSection>
|
<QItem v-if="lastExpedition && videoList.length">
|
||||||
<QItemLabel class="text-h6">
|
<QItemSection>
|
||||||
{{ t('ticket.boxing.selectTime') }} ({{ time.min }}-{{
|
<QItemLabel class="text-h6">
|
||||||
time.max
|
{{ t('ticket.boxing.selectTime') }} ({{ time.min }}-{{
|
||||||
}})
|
time.max
|
||||||
</QItemLabel>
|
}})
|
||||||
<QRange
|
</QItemLabel>
|
||||||
v-model="time"
|
<QRange
|
||||||
@change="getVideoList(lastExpedition, time)"
|
v-model="time"
|
||||||
:min="0"
|
@change="getVideoList(lastExpedition, time)"
|
||||||
:max="24"
|
:min="0"
|
||||||
:step="1"
|
:max="24"
|
||||||
:left-label-value="time.min + ':00'"
|
:step="1"
|
||||||
:right-label-value="time.max + ':00'"
|
:left-label-value="time.min + ':00'"
|
||||||
label
|
:right-label-value="time.max + ':00'"
|
||||||
markers
|
label
|
||||||
snap
|
markers
|
||||||
color="primary"
|
snap
|
||||||
/>
|
color="primary"
|
||||||
</QItemSection>
|
/>
|
||||||
</QItem>
|
</QItemSection>
|
||||||
<QItem v-if="lastExpedition && videoList.length">
|
</QItem>
|
||||||
<QItemSection>
|
<QItem v-if="lastExpedition && videoList.length">
|
||||||
<QSelect
|
<QItemSection>
|
||||||
color="primary"
|
<QSelect
|
||||||
v-model="slide"
|
color="primary"
|
||||||
:options="videoList"
|
v-model="slide"
|
||||||
:label="t('ticket.boxing.selectVideo')"
|
:options="videoList"
|
||||||
emit-value
|
:label="t('ticket.boxing.selectVideo')"
|
||||||
map-options
|
emit-value
|
||||||
>
|
map-options
|
||||||
<template #prepend>
|
>
|
||||||
<QIcon name="schedule" />
|
<template #prepend>
|
||||||
</template>
|
<QIcon name="schedule" />
|
||||||
</QSelect>
|
</template>
|
||||||
</QItemSection>
|
</QSelect>
|
||||||
</QItem>
|
</QItemSection>
|
||||||
<QItem
|
</QItem>
|
||||||
v-for="expedition in expeditions"
|
<QItem
|
||||||
:key="expedition.id"
|
v-for="expedition in expeditions"
|
||||||
@click="getVideoList(expedition.id)"
|
:key="expedition.id"
|
||||||
clickable
|
@click="getVideoList(expedition.id)"
|
||||||
v-ripple
|
clickable
|
||||||
>
|
v-ripple
|
||||||
<QItemSection>
|
>
|
||||||
<QItemLabel class="text-h6">#{{ expedition.id }}</QItemLabel>
|
<QItemSection>
|
||||||
</QItemSection>
|
<QItemLabel class="text-h6">#{{ expedition.id }}</QItemLabel>
|
||||||
<QItemSection>
|
</QItemSection>
|
||||||
<QItemLabel caption>{{ t('globals.created') }}</QItemLabel>
|
<QItemSection>
|
||||||
<QItemLabel>
|
<QItemLabel caption>{{ t('globals.created') }}</QItemLabel>
|
||||||
{{ date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss') }}
|
<QItemLabel>
|
||||||
</QItemLabel>
|
{{
|
||||||
<QItemLabel caption>{{ t('globals.item') }}</QItemLabel>
|
date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss')
|
||||||
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
|
}}
|
||||||
<QItemLabel caption>{{ t('ticket.boxing.worker') }}</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel>{{ expedition.userName }}</QItemLabel>
|
<QItemLabel caption>{{ t('globals.item') }}</QItemLabel>
|
||||||
</QItemSection>
|
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
|
||||||
</QItem>
|
<QItemLabel caption>{{ t('ticket.boxing.worker') }}</QItemLabel>
|
||||||
</QList>
|
<QItemLabel>{{ expedition.userName }}</QItemLabel>
|
||||||
</Teleport>
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</QList>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QCard>
|
<QCard>
|
||||||
<QCarousel animated v-model="slide" height="max-content">
|
<QCarousel animated v-model="slide" height="max-content">
|
||||||
<QCarouselSlide
|
<QCarouselSlide
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted, watch, nextTick } from 'vue';
|
import { ref, computed, watch, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
@ -9,15 +9,14 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { toCurrency } from 'filters/index';
|
import { toCurrency } from 'filters/index';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const salesRef = ref(null);
|
const salesRef = ref(null);
|
||||||
const arrayData = useArrayData('ticketData');
|
const arrayData = useArrayData('ticketData');
|
||||||
|
@ -164,10 +163,6 @@ const getTicketVolume = async () => {
|
||||||
const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
|
const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
|
||||||
ticketVolume.value = data[0].volume;
|
ticketVolume.value = data[0].volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -178,93 +173,121 @@ onMounted(() => {
|
||||||
@on-fetch="(data) => (components = data)"
|
@on-fetch="(data) => (components = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
<template #right-panel>
|
||||||
<QCardSection horizontal>
|
<QCard
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
class="q-pa-sm color-vn-text"
|
||||||
{{ t('basicData.total') }}
|
bordered
|
||||||
</span>
|
flat
|
||||||
</QCardSection>
|
style="border-color: black"
|
||||||
<QCardSection horizontal>
|
|
||||||
<span class="q-mr-xs color-vn-label"
|
|
||||||
>{{ t('ticketComponents.baseToCommission') }}:
|
|
||||||
</span>
|
|
||||||
<span>{{ toCurrency(getBase) }}</span>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection horizontal>
|
|
||||||
<span class="q-mr-xs color-vn-label"
|
|
||||||
>{{ t('ticketComponents.totalWithoutVat') }}:
|
|
||||||
</span>
|
|
||||||
<span>{{ toCurrency(getTotal) }}</span>
|
|
||||||
</QCardSection>
|
|
||||||
</QCard>
|
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
|
||||||
<QCardSection horizontal>
|
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
|
||||||
{{ t('ticketComponents.components') }}
|
|
||||||
</span>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection
|
|
||||||
v-for="(component, index) in componentsList"
|
|
||||||
:key="index"
|
|
||||||
horizontal
|
|
||||||
>
|
>
|
||||||
<span v-if="component.name" class="q-mr-xs color-vn-label">
|
<QCardSection horizontal>
|
||||||
{{ component.name }}:
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
</span>
|
{{ t('basicData.total') }}
|
||||||
<span v-if="component.value">{{
|
</span>
|
||||||
toCurrency(component.value, 'EUR', 3)
|
</QCardSection>
|
||||||
}}</span>
|
<QCardSection horizontal>
|
||||||
</QCardSection>
|
<span class="q-mr-xs color-vn-label"
|
||||||
</QCard>
|
>{{ t('ticketComponents.baseToCommission') }}:
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
</span>
|
||||||
<QCardSection horizontal>
|
<span>{{ toCurrency(getBase) }}</span>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
</QCardSection>
|
||||||
{{ t('ticketComponents.zoneBreakdown') }}
|
<QCardSection horizontal>
|
||||||
</span>
|
<span class="q-mr-xs color-vn-label"
|
||||||
</QCardSection>
|
>{{ t('ticketComponents.totalWithoutVat') }}:
|
||||||
<QCardSection horizontal>
|
</span>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('basicData.price') }}: </span>
|
<span>{{ toCurrency(getTotal) }}</span>
|
||||||
<span>{{ toCurrency(ticketData?.zonePrice, 'EUR', 2) }}</span>
|
</QCardSection>
|
||||||
</QCardSection>
|
</QCard>
|
||||||
<QCardSection horizontal>
|
<QCard
|
||||||
<span class="q-mr-xs color-vn-label">
|
class="q-pa-sm color-vn-text"
|
||||||
{{ t('ticketComponents.bonus') }}:
|
bordered
|
||||||
</span>
|
flat
|
||||||
<span>{{ toCurrency(ticketData?.zoneBonus, 'EUR', 2) }}</span>
|
style="border-color: black"
|
||||||
</QCardSection>
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('ticketList.zone') }}: </span>
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
<span class="link">
|
{{ t('ticketComponents.components') }}
|
||||||
{{ dashIfEmpty(ticketData?.zone?.name) }}
|
</span>
|
||||||
<ZoneDescriptorProxy :id="ticketData?.zone?.id" />
|
</QCardSection>
|
||||||
</span>
|
<QCardSection
|
||||||
</QCardSection>
|
v-for="(component, index) in componentsList"
|
||||||
<QCardSection v-if="ticketData?.zone?.isVolumetric" horizontal>
|
:key="index"
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('volume.volume') }}: </span>
|
horizontal
|
||||||
<span>{{ ticketVolume }}</span>
|
>
|
||||||
</QCardSection>
|
<span v-if="component.name" class="q-mr-xs color-vn-label">
|
||||||
<QCardSection horizontal>
|
{{ component.name }}:
|
||||||
<span class="q-mr-xs color-vn-label">
|
</span>
|
||||||
{{ t('ticketComponents.packages') }}:
|
<span v-if="component.value">{{
|
||||||
</span>
|
toCurrency(component.value, 'EUR', 3)
|
||||||
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
}}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
<QCard
|
||||||
<QCardSection horizontal>
|
class="q-pa-sm color-vn-text"
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
bordered
|
||||||
{{ t('ticketComponents.theoricalCost') }}
|
flat
|
||||||
</span>
|
style="border-color: black"
|
||||||
</QCardSection>
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="q-mr-xs color-vn-label">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.totalPrice') }}:
|
{{ t('ticketComponents.zoneBreakdown') }}
|
||||||
</span>
|
</span>
|
||||||
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
</QCardSection>
|
||||||
</QCardSection>
|
<QCardSection horizontal>
|
||||||
</QCard>
|
<span class="q-mr-xs color-vn-label">
|
||||||
</Teleport>
|
{{ t('basicData.price') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ toCurrency(ticketData?.zonePrice, 'EUR', 2) }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection horizontal>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketComponents.bonus') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ toCurrency(ticketData?.zoneBonus, 'EUR', 2) }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection horizontal>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketList.zone') }}:
|
||||||
|
</span>
|
||||||
|
<span class="link">
|
||||||
|
{{ dashIfEmpty(ticketData?.zone?.name) }}
|
||||||
|
<ZoneDescriptorProxy :id="ticketData?.zone?.id" />
|
||||||
|
</span>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection v-if="ticketData?.zone?.isVolumetric" horizontal>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('volume.volume') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ ticketVolume }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection horizontal>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketComponents.packages') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
</QCard>
|
||||||
|
<QCard
|
||||||
|
class="q-pa-sm color-vn-text"
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
style="border-color: black"
|
||||||
|
>
|
||||||
|
<QCardSection horizontal>
|
||||||
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
|
{{ t('ticketComponents.theoricalCost') }}
|
||||||
|
</span>
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection horizontal>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketComponents.totalPrice') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="TicketComponents"
|
data-key="TicketComponents"
|
||||||
|
|
|
@ -16,7 +16,6 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import TicketSaleMoreActions from './TicketSaleMoreActions.vue';
|
import TicketSaleMoreActions from './TicketSaleMoreActions.vue';
|
||||||
import TicketTransfer from './TicketTransfer.vue';
|
import TicketTransfer from './TicketTransfer.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import { toCurrency, toPercentage } from 'src/filters';
|
import { toCurrency, toPercentage } from 'src/filters';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
@ -25,10 +24,10 @@ import axios from 'axios';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
|
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
@ -54,7 +53,6 @@ const transfer = ref({
|
||||||
});
|
});
|
||||||
const tableRef = ref([]);
|
const tableRef = ref([]);
|
||||||
const canProceed = ref();
|
const canProceed = ref();
|
||||||
const isLoading = ref(false);
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.params.id,
|
() => route.params.id,
|
||||||
|
@ -197,6 +195,7 @@ const changeQuantity = async (sale) => {
|
||||||
try {
|
try {
|
||||||
if (!rowToUpdate.value) return;
|
if (!rowToUpdate.value) return;
|
||||||
rowToUpdate.value = null;
|
rowToUpdate.value = null;
|
||||||
|
sale.isNew = false;
|
||||||
await updateQuantity(sale);
|
await updateQuantity(sale);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||||
|
@ -214,9 +213,6 @@ const updateQuantity = async ({ quantity, id }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const addSale = async (sale) => {
|
const addSale = async (sale) => {
|
||||||
if (isLoading.value) return;
|
|
||||||
|
|
||||||
isLoading.value = true;
|
|
||||||
const params = {
|
const params = {
|
||||||
barcode: sale.itemFk,
|
barcode: sale.itemFk,
|
||||||
quantity: sale.quantity,
|
quantity: sale.quantity,
|
||||||
|
@ -237,6 +233,7 @@ const addSale = async (sale) => {
|
||||||
sale.item = newSale.item;
|
sale.item = newSale.item;
|
||||||
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
|
sale.isNew = false;
|
||||||
arrayData.fetch({});
|
arrayData.fetch({});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -421,7 +418,6 @@ const setTransferParams = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
getConfig();
|
getConfig();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -622,29 +618,38 @@ watch(
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<div
|
<template #right-panel>
|
||||||
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
<div
|
||||||
style="border: 2px solid black"
|
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
||||||
>
|
style="border: 2px solid black"
|
||||||
<QCardSection class="justify-end text-subtitle1" horizontal>
|
>
|
||||||
<span class="q-mr-xs color-vn-label"
|
<QCardSection class="justify-end text-subtitle1" horizontal>
|
||||||
>{{ t('ticketSale.subtotal') }}:
|
<span class="q-mr-xs color-vn-label"
|
||||||
</span>
|
>{{ t('ticketSale.subtotal') }}:
|
||||||
<span>{{ toCurrency(store.data?.totalWithoutVat) }}</span>
|
</span>
|
||||||
</QCardSection>
|
<span>{{ toCurrency(store.data?.totalWithoutVat) }}</span>
|
||||||
<QCardSection class="justify-end text-subtitle1" horizontal>
|
</QCardSection>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('ticketSale.tax') }}: </span>
|
<QCardSection class="justify-end text-subtitle1" horizontal>
|
||||||
<span>{{
|
<span class="q-mr-xs color-vn-label">
|
||||||
toCurrency(store.data?.totalWithVat - store.data?.totalWithoutVat)
|
{{ t('ticketSale.tax') }}:
|
||||||
}}</span>
|
</span>
|
||||||
</QCardSection>
|
<span>{{
|
||||||
<QCardSection class="justify-end text-weight-bold text-subtitle1" horizontal>
|
toCurrency(store.data?.totalWithVat - store.data?.totalWithoutVat)
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('basicData.total') }}: </span>
|
}}</span>
|
||||||
<span>{{ toCurrency(store.data?.totalWithVat) }}</span>
|
</QCardSection>
|
||||||
</QCardSection>
|
<QCardSection
|
||||||
</div>
|
class="justify-end text-weight-bold text-subtitle1"
|
||||||
</Teleport>
|
horizontal
|
||||||
|
>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('basicData.total') }}:
|
||||||
|
</span>
|
||||||
|
<span>{{ toCurrency(store.data?.totalWithVat) }}</span>
|
||||||
|
</QCardSection>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="TicketSales"
|
data-key="TicketSales"
|
||||||
|
@ -754,6 +759,7 @@ watch(
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.itemFk"
|
v-model="row.itemFk"
|
||||||
|
:use-like="false"
|
||||||
@update:model-value="updateItem(row)"
|
@update:model-value="updateItem(row)"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
|
@ -166,8 +166,10 @@ async function handleSave() {
|
||||||
v-model="row.ticketServiceTypeFk"
|
v-model="row.ticketServiceTypeFk"
|
||||||
:options="ticketServiceOptions"
|
:options="ticketServiceOptions"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
:roles-allowed-to-create="['administrative']"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
sort-by="name ASC"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<TicketCreateServiceType
|
<TicketCreateServiceType
|
||||||
|
|
|
@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -81,15 +82,12 @@ const getGroupedStates = (data) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectWorker
|
||||||
:label="t('Salesperson')"
|
:label="t('globals.salesPerson')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
:params="{
|
||||||
:where="{ role: 'salesPerson' }"
|
departmentCodes: ['VT'],
|
||||||
option-value="id"
|
}"
|
||||||
option-label="firstName"
|
|
||||||
:use-like="false"
|
|
||||||
sort-by="firstName ASC"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -465,7 +465,7 @@ function setReference(data) {
|
||||||
exprBuilder,
|
exprBuilder,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #rightMenu>
|
<template #advanced-menu>
|
||||||
<TicketFilter data-key="TicketList" />
|
<TicketFilter data-key="TicketList" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency, toCelsius } from 'src/filters';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
|
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
|
||||||
|
|
||||||
|
@ -97,6 +97,20 @@ const entriesTableColumns = computed(() => {
|
||||||
showValue: true,
|
showValue: true,
|
||||||
},
|
},
|
||||||
{ label: 'm³', field: 'm3', name: 'm3', align: 'left', showValue: true },
|
{ label: 'm³', field: 'm3', name: 'm3', align: 'left', showValue: true },
|
||||||
|
{
|
||||||
|
label: t('entry.basicData.initialTemperature'),
|
||||||
|
field: 'initialTemperature',
|
||||||
|
name: 'initialTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => toCelsius(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('entry.basicData.finalTemperature'),
|
||||||
|
field: 'finalTemperature',
|
||||||
|
name: 'finalTemperature',
|
||||||
|
align: 'left',
|
||||||
|
format: (val) => toCelsius(val),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '',
|
label: '',
|
||||||
field: 'observation',
|
field: 'observation',
|
||||||
|
@ -127,14 +141,14 @@ const thermographsTableColumns = computed(() => {
|
||||||
field: 'maxTemperature',
|
field: 'maxTemperature',
|
||||||
name: 'maxTemperature',
|
name: 'maxTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) => (val ? `${val}°` : ''),
|
format: (val) => toCelsius(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.minTemperature'),
|
label: t('globals.minTemperature'),
|
||||||
field: 'minTemperature',
|
field: 'minTemperature',
|
||||||
name: 'minTemperature',
|
name: 'minTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) => (val ? `${val}°` : ''),
|
format: (val) => toCelsius(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.state'),
|
label: t('globals.state'),
|
||||||
|
|
|
@ -10,7 +10,7 @@ import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate, toCelsius } from 'src/filters';
|
||||||
import { downloadFile } from 'src/composables/downloadFile';
|
import { downloadFile } from 'src/composables/downloadFile';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -52,14 +52,14 @@ const TableColumns = computed(() => {
|
||||||
field: 'maxTemperature',
|
field: 'maxTemperature',
|
||||||
name: 'maxTemperature',
|
name: 'maxTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) => (val ? `${val}°` : ''),
|
format: (val) => toCelsius(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.minTemperature'),
|
label: t('globals.minTemperature'),
|
||||||
field: 'minTemperature',
|
field: 'minTemperature',
|
||||||
name: 'minTemperature',
|
name: 'minTemperature',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
format: (val) => (val ? `${val}°` : ''),
|
format: (val) => toCelsius(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.state'),
|
label: t('globals.state'),
|
||||||
|
|
|
@ -79,6 +79,13 @@ const columns = computed(() => [
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'awb',
|
||||||
|
label: t('travel.travelList.tableVisibleColumns.awb'),
|
||||||
|
columnFilter: false,
|
||||||
|
format: (row) => row.awbCode,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'warehouseInFk',
|
name: 'warehouseInFk',
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref, watch } from 'vue';
|
import { nextTick, ref, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import WorkerCalendarFilter from 'pages/Worker/Card/WorkerCalendarFilter.vue';
|
import WorkerCalendarFilter from 'pages/Worker/Card/WorkerCalendarFilter.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerCalendarItem from 'pages/Worker/Card/WorkerCalendarItem.vue';
|
import WorkerCalendarItem from 'pages/Worker/Card/WorkerCalendarItem.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const workerIsFreelance = ref();
|
const workerIsFreelance = ref();
|
||||||
|
@ -171,16 +169,18 @@ watch([year, businessFk], () => refreshData());
|
||||||
ref="WorkerFreelanceRef"
|
ref="WorkerFreelanceRef"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<WorkerCalendarFilter
|
<template #right-panel>
|
||||||
ref="workerCalendarFilterRef"
|
<WorkerCalendarFilter
|
||||||
v-model:business-fk="businessFk"
|
ref="workerCalendarFilterRef"
|
||||||
v-model:year="year"
|
v-model:business-fk="businessFk"
|
||||||
v-model:absence-type="absenceType"
|
v-model:year="year"
|
||||||
:contract-holidays="contractHolidays"
|
v-model:absence-type="absenceType"
|
||||||
:year-holidays="yearHolidays"
|
:contract-holidays="contractHolidays"
|
||||||
/>
|
:year-holidays="yearHolidays"
|
||||||
</Teleport>
|
/>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QPage class="column items-center">
|
<QPage class="column items-center">
|
||||||
<QCard v-if="workerIsFreelance">
|
<QCard v-if="workerIsFreelance">
|
||||||
<QCardSection class="text-center">
|
<QCardSection class="text-center">
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
||||||
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
||||||
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.sass';
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
|
||||||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
|
@ -27,7 +27,7 @@ const initialData = computed(() => {
|
||||||
return {
|
return {
|
||||||
userFk: routeId.value,
|
userFk: routeId.value,
|
||||||
deviceProductionFk: null,
|
deviceProductionFk: null,
|
||||||
simSerialNumber: null,
|
simFk: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ const deallocatePDA = async (deviceProductionFk) => {
|
||||||
|
|
||||||
function reloadData() {
|
function reloadData() {
|
||||||
initialData.value.deviceProductionFk = null;
|
initialData.value.deviceProductionFk = null;
|
||||||
initialData.value.simSerialNumber = null;
|
initialData.value.simFk = null;
|
||||||
paginate.value.fetch();
|
paginate.value.fetch();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -89,7 +89,7 @@ function reloadData() {
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Current SIM')"
|
:label="t('Current SIM')"
|
||||||
:model-value="row?.simSerialNumber"
|
:model-value="row?.simFk"
|
||||||
disable
|
disable
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -150,7 +150,7 @@ function reloadData() {
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.simSerialNumber"
|
v-model="data.simFk"
|
||||||
:label="t('SIM serial number')"
|
:label="t('SIM serial number')"
|
||||||
id="simSerialNumber"
|
id="simSerialNumber"
|
||||||
use-input
|
use-input
|
||||||
|
|
|
@ -10,6 +10,7 @@ import WorkerTimeForm from 'pages/Worker/Card/WorkerTimeForm.vue';
|
||||||
import WorkerTimeReasonForm from 'pages/Worker/Card/WorkerTimeReasonForm.vue';
|
import WorkerTimeReasonForm from 'pages/Worker/Card/WorkerTimeReasonForm.vue';
|
||||||
import WorkerDateLabel from './WorkerDateLabel.vue';
|
import WorkerDateLabel from './WorkerDateLabel.vue';
|
||||||
import WorkerTimeControlCalendar from 'pages/Worker/Card/WorkerTimeControlCalendar.vue';
|
import WorkerTimeControlCalendar from 'pages/Worker/Card/WorkerTimeControlCalendar.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -283,21 +284,22 @@ const fetchWeekData = async () => {
|
||||||
year: selectedDateYear.value,
|
year: selectedDateYear.value,
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
};
|
};
|
||||||
const mail = (
|
try {
|
||||||
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||||
params: { filter: { where } },
|
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||||
})
|
params: { filter: { where } },
|
||||||
).data[0];
|
}),
|
||||||
|
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||||
|
]);
|
||||||
|
|
||||||
if (!mail) state.value = null;
|
const mail = mailData[0];
|
||||||
else {
|
|
||||||
state.value = mail.state;
|
state.value = mail?.state;
|
||||||
reason.value = mail.reason;
|
reason.value = mail?.reason;
|
||||||
|
canResend.value = !!countData.count;
|
||||||
|
} catch {
|
||||||
|
state.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
canResend.value = !!(
|
|
||||||
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
|
|
||||||
).data.count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setHours = (data) => {
|
const setHours = (data) => {
|
||||||
|
@ -482,33 +484,35 @@ onMounted(async () => {
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
<div class="q-pa-md q-mb-md" style="border: 2px solid #222">
|
<template #right-panel>
|
||||||
<QCardSection horizontal>
|
<div class="q-pa-md q-mb-md" style="border: 2px solid #222">
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<QCardSection horizontal>
|
||||||
{{ t('Hours') }}
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
</span>
|
{{ t('Hours') }}
|
||||||
</QCardSection>
|
</span>
|
||||||
<QCardSection class="column items-center" horizontal>
|
</QCardSection>
|
||||||
<div>
|
<QCardSection class="column items-center" horizontal>
|
||||||
<span class="details-label">{{ t('Total semana') }} </span>
|
<div>
|
||||||
<span>: {{ formattedWeekTotalHours }}</span>
|
<span class="details-label">{{ t('Total semana') }} </span>
|
||||||
</div>
|
<span>: {{ formattedWeekTotalHours }}</span>
|
||||||
<div>
|
</div>
|
||||||
<span class="details-label">{{ t('Termina a las') }}: </span>
|
<div>
|
||||||
<span>{{ dashIfEmpty(getFinishTime()) }}</span>
|
<span class="details-label">{{ t('Termina a las') }}: </span>
|
||||||
</div>
|
<span>{{ dashIfEmpty(getFinishTime()) }}</span>
|
||||||
</QCardSection>
|
</div>
|
||||||
</div>
|
</QCardSection>
|
||||||
<WorkerTimeControlCalendar
|
</div>
|
||||||
v-model:model-value="selectedDateFormatted"
|
<WorkerTimeControlCalendar
|
||||||
:selected-dates="selectedCalendarDates"
|
v-model:model-value="selectedDateFormatted"
|
||||||
:active-date="false"
|
:selected-dates="selectedCalendarDates"
|
||||||
:worker-time-control-mails="workerTimeControlMails"
|
:active-date="false"
|
||||||
@click-date="onInputChange"
|
:worker-time-control-mails="workerTimeControlMails"
|
||||||
@on-moved="getMailStates"
|
@click-date="onInputChange"
|
||||||
/>
|
@on-moved="getMailStates"
|
||||||
</Teleport>
|
/>
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QPage class="column items-center">
|
<QPage class="column items-center">
|
||||||
<QTable :columns="columns" :rows="['']" hide-bottom class="full-width">
|
<QTable :columns="columns" :rows="['']" hide-bottom class="full-width">
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
|
|
|
@ -138,7 +138,11 @@ function uppercaseStreetModel(data) {
|
||||||
return {
|
return {
|
||||||
get: () => (data.street ? data.street.toUpperCase() : ''),
|
get: () => (data.street ? data.street.toUpperCase() : ''),
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
data.street = value.toUpperCase();
|
if (value) {
|
||||||
|
data.street = value.toUpperCase();
|
||||||
|
} else {
|
||||||
|
data.street = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -192,10 +196,10 @@ async function autofillBic(worker) {
|
||||||
prefix="workerSearch"
|
prefix="workerSearch"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Workers/filter',
|
url: 'Workers/filter',
|
||||||
order: ['id DESC'],
|
order: 'id DESC',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #rightMenu>
|
<template #advanced-menu>
|
||||||
<WorkerFilter data-key="WorkerList" />
|
<WorkerFilter data-key="WorkerList" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useRoute } from 'vue-router';
|
||||||
import ZoneClosingTable from './ZoneClosingTable.vue';
|
import ZoneClosingTable from './ZoneClosingTable.vue';
|
||||||
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
|
||||||
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
import { QCalendarMonth } from '@quasar/quasar-ui-qcalendar/src/index.js';
|
||||||
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.sass';
|
import '@quasar/quasar-ui-qcalendar/src/QCalendarVariables.scss';
|
||||||
|
|
||||||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { route } from 'quasar/wrappers';
|
import { route as defineRouter } from 'quasar/wrappers';
|
||||||
import {
|
import {
|
||||||
createRouter,
|
createRouter,
|
||||||
createMemoryHistory,
|
createMemoryHistory,
|
||||||
|
@ -8,14 +8,14 @@ import {
|
||||||
import routes from './routes';
|
import routes from './routes';
|
||||||
import { i18n } from 'src/boot/i18n';
|
import { i18n } from 'src/boot/i18n';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useSession } from 'src/composables/useSession';
|
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import { useUserConfig } from 'src/composables/useUserConfig';
|
import { useUserConfig } from 'src/composables/useUserConfig';
|
||||||
import { useTokenConfig } from 'src/composables/useTokenConfig';
|
import { useTokenConfig } from 'src/composables/useTokenConfig';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
import { isLoggedIn } from 'src/utils/session';
|
||||||
|
import { useSession } from 'src/composables/useSession';
|
||||||
|
|
||||||
const state = useState();
|
let session = null;
|
||||||
const session = useSession();
|
|
||||||
const { t, te } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
|
||||||
const createHistory = process.env.SERVER
|
const createHistory = process.env.SERVER
|
||||||
|
@ -43,11 +43,12 @@ const Router = createRouter({
|
||||||
* with the Router instance.
|
* with the Router instance.
|
||||||
*/
|
*/
|
||||||
export { Router };
|
export { Router };
|
||||||
export default route(function (/* { store, ssrContext } */) {
|
export default defineRouter(function (/* { store, ssrContext } */) {
|
||||||
|
const state = useState();
|
||||||
Router.beforeEach(async (to, from, next) => {
|
Router.beforeEach(async (to, from, next) => {
|
||||||
const { isLoggedIn } = session;
|
if (!session) session = useSession();
|
||||||
const outLayout = Router.options.routes[0].children.map((r) => r.name);
|
const outLayout = Router.options.routes[0].children.map((r) => r.name);
|
||||||
if (!isLoggedIn() && !outLayout.includes(to.name)) {
|
if (!session.isLoggedIn() && !outLayout.includes(to.name)) {
|
||||||
return next({ name: 'Login', query: { redirect: to.fullPath } });
|
return next({ name: 'Login', query: { redirect: to.fullPath } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,12 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
export default {
|
const customerCard = {
|
||||||
path: '/customer',
|
name: 'CustomerCard',
|
||||||
name: 'Customer',
|
path: ':id',
|
||||||
meta: {
|
component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
|
||||||
title: 'customers',
|
redirect: { name: 'CustomerSummary' },
|
||||||
icon: 'vn:client',
|
meta: {
|
||||||
moduleName: 'Customer',
|
menu: [
|
||||||
keyBinding: 'c',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'CustomerMain' },
|
|
||||||
menus: {
|
|
||||||
main: [
|
|
||||||
'CustomerList',
|
|
||||||
'CustomerPayments',
|
|
||||||
'CustomerNotifications',
|
|
||||||
'CustomerDefaulter',
|
|
||||||
],
|
|
||||||
card: [
|
|
||||||
'CustomerBasicData',
|
'CustomerBasicData',
|
||||||
'CustomerFiscalData',
|
'CustomerFiscalData',
|
||||||
'CustomerBillingData',
|
'CustomerBillingData',
|
||||||
|
@ -37,19 +25,449 @@ export default {
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
name: 'CustomerSummary',
|
||||||
name: 'CustomerMain',
|
path: 'summary',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
meta: {
|
||||||
redirect: { name: 'CustomerList' },
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'CustomerBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'fiscal-data',
|
||||||
|
name: 'CustomerFiscalData',
|
||||||
|
meta: {
|
||||||
|
title: 'fiscalData',
|
||||||
|
icon: 'vn:dfiscales',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerFiscalData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'billing-data',
|
||||||
|
name: 'CustomerBillingData',
|
||||||
|
meta: {
|
||||||
|
title: 'billingData',
|
||||||
|
icon: 'vn:payment',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerBillingData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'address',
|
||||||
|
name: 'AddressCard',
|
||||||
|
redirect: { name: 'CustomerAddress' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: '',
|
||||||
name: 'CustomerList',
|
name: 'CustomerAddress',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'list',
|
icon: 'vn:delivery',
|
||||||
icon: 'view_list',
|
title: 'consignees',
|
||||||
},
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerAddress.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'create',
|
||||||
|
name: 'CustomerAddressCreate',
|
||||||
|
meta: {
|
||||||
|
title: 'address-create',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerAddressCreate.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':addressId',
|
||||||
|
name: 'CustomerAddressEditCard',
|
||||||
|
redirect: { name: 'CustomerAddressEdit' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'edit',
|
||||||
|
name: 'CustomerAddressEdit',
|
||||||
|
meta: {
|
||||||
|
title: 'addressEdit',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerAddressEdit.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'notes',
|
||||||
|
name: 'CustomerNotes',
|
||||||
|
meta: {
|
||||||
|
title: 'notes',
|
||||||
|
icon: 'vn:notes',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'credits',
|
||||||
|
name: 'CustomerCredits',
|
||||||
|
meta: {
|
||||||
|
title: 'credits',
|
||||||
|
icon: 'vn:credit',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerCredits.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'greuges',
|
||||||
|
name: 'CustomerGreuges',
|
||||||
|
meta: {
|
||||||
|
title: 'greuges',
|
||||||
|
icon: 'vn:greuge',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerGreuges.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'balance',
|
||||||
|
name: 'CustomerBalance',
|
||||||
|
meta: {
|
||||||
|
title: 'balance',
|
||||||
|
icon: 'balance',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerBalance.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'recoveries',
|
||||||
|
name: 'CustomerRecoveries',
|
||||||
|
meta: {
|
||||||
|
title: 'recoveries',
|
||||||
|
icon: 'vn:recovery',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerRecoveries.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'web-access',
|
||||||
|
name: 'CustomerWebAccess',
|
||||||
|
meta: {
|
||||||
|
title: 'webAccess',
|
||||||
|
icon: 'vn:web',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerWebAccess.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'log',
|
||||||
|
name: 'CustomerLog',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'vn:History',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerLog.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'sms',
|
||||||
|
name: 'CustomerSms',
|
||||||
|
meta: {
|
||||||
|
title: 'sms',
|
||||||
|
icon: 'sms',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerSms.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'credit-management',
|
||||||
|
name: 'CustomerCreditManagement',
|
||||||
|
meta: {
|
||||||
|
title: 'creditManagement',
|
||||||
|
icon: 'paid',
|
||||||
|
menuChildren: [
|
||||||
|
{
|
||||||
|
name: 'CustomerCreditContracts',
|
||||||
|
title: 'creditContracts',
|
||||||
|
icon: 'vn:solunion',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerCreditOpinion',
|
||||||
|
title: 'creditOpinion',
|
||||||
|
icon: 'vn:linesprepaired',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'credit-contracts',
|
||||||
|
name: 'CreditContractsCard',
|
||||||
|
redirect: { name: 'CustomerCreditContracts' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'CustomerCreditContracts',
|
||||||
|
meta: {
|
||||||
|
title: 'creditContracts',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/Card/CustomerCreditContracts.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'create',
|
||||||
|
name: 'CustomerCreditContractsCreate',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerCreditContractsCreate.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'insurance/:creditId',
|
||||||
|
name: 'CustomerCreditContractsInsurance',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerCreditContractsInsurance.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'credit-opinion',
|
||||||
|
name: 'CustomerCreditOpinion',
|
||||||
|
meta: {
|
||||||
|
title: 'creditOpinion',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/Card/CustomerCreditOpinion.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'others',
|
||||||
|
name: 'CustomerOthers',
|
||||||
|
meta: {
|
||||||
|
title: 'others',
|
||||||
|
icon: 'pending',
|
||||||
|
menuChildren: [
|
||||||
|
{
|
||||||
|
name: 'CustomerSamples',
|
||||||
|
title: 'samples',
|
||||||
|
icon: 'vn:notes',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerConsumption',
|
||||||
|
title: 'consumption',
|
||||||
|
icon: 'show_chart',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerMandates',
|
||||||
|
title: 'mandates',
|
||||||
|
icon: 'vn:mandatory',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerContacts',
|
||||||
|
title: 'contacts',
|
||||||
|
icon: 'contact_phone',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerWebPayment',
|
||||||
|
title: 'webPayment',
|
||||||
|
icon: 'vn:onlinepayment',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerFileManagement',
|
||||||
|
title: 'fileManagement',
|
||||||
|
icon: 'Upload',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CustomerUnpaid',
|
||||||
|
title: 'unpaid',
|
||||||
|
icon: 'vn:defaulter',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'samples',
|
||||||
|
name: 'CustomerSamples',
|
||||||
|
meta: {
|
||||||
|
title: 'samples',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerSamples.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'samples',
|
||||||
|
name: 'CustomerSamplesCard',
|
||||||
|
redirect: { name: 'CustomerSamples' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'CustomerSamples',
|
||||||
|
meta: {
|
||||||
|
title: 'samples',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/Card/CustomerSamples.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'create',
|
||||||
|
name: 'CustomerSamplesCreate',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerSamplesCreate.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'consumption',
|
||||||
|
name: 'CustomerConsumption',
|
||||||
|
meta: {
|
||||||
|
title: 'consumption',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerConsumption.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'mandates',
|
||||||
|
name: 'CustomerMandates',
|
||||||
|
meta: {
|
||||||
|
title: 'mandates',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerMandates.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'contacts',
|
||||||
|
name: 'CustomerContacts',
|
||||||
|
meta: {
|
||||||
|
title: 'contacts',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerContacts.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'web-payment',
|
||||||
|
name: 'CustomerWebPayment',
|
||||||
|
meta: {
|
||||||
|
title: 'webPayment',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerWebPayment.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'file-management',
|
||||||
|
name: 'CustomerFileManagement',
|
||||||
|
meta: {
|
||||||
|
title: 'fileManagement',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/Card/CustomerFileManagement.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'file-management',
|
||||||
|
name: 'CustomerFileManagementCard',
|
||||||
|
redirect: { name: 'CustomerFileManagement' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'CustomerFileManagement',
|
||||||
|
meta: {
|
||||||
|
title: 'fileManagement',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/Card/CustomerFileManagement.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'create',
|
||||||
|
name: 'CustomerFileManagementCreate',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerFileManagementCreate.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':dmsId/edit',
|
||||||
|
name: 'CustomerFileManagementEdit',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
'src/pages/Customer/components/CustomerFileManagementEdit.vue'
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'unpaid',
|
||||||
|
name: 'CustomerUnpaid',
|
||||||
|
meta: {
|
||||||
|
title: 'unpaid',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Customer/Card/CustomerUnpaid.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Customer',
|
||||||
|
path: '/customer',
|
||||||
|
meta: {
|
||||||
|
title: 'customers',
|
||||||
|
icon: 'vn:client',
|
||||||
|
moduleName: 'Customer',
|
||||||
|
keyBinding: 'c',
|
||||||
|
menu: [
|
||||||
|
'CustomerList',
|
||||||
|
'CustomerPayments',
|
||||||
|
'CustomerNotifications',
|
||||||
|
'CustomerDefaulter',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'CustomerMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'CustomerMain',
|
||||||
|
path: '',
|
||||||
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
|
redirect: { name: 'CustomerIndexMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'CustomerIndexMain',
|
||||||
|
redirect: { name: 'CustomerList' },
|
||||||
component: () => import('src/pages/Customer/CustomerList.vue'),
|
component: () => import('src/pages/Customer/CustomerList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'CustomerList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
customerCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
|
@ -94,415 +512,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'CustomerCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
|
|
||||||
redirect: { name: 'CustomerSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'CustomerSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'basic-data',
|
|
||||||
name: 'CustomerBasicData',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'fiscal-data',
|
|
||||||
name: 'CustomerFiscalData',
|
|
||||||
meta: {
|
|
||||||
title: 'fiscalData',
|
|
||||||
icon: 'vn:dfiscales',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerFiscalData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'billing-data',
|
|
||||||
name: 'CustomerBillingData',
|
|
||||||
meta: {
|
|
||||||
title: 'billingData',
|
|
||||||
icon: 'vn:payment',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerBillingData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'address',
|
|
||||||
name: 'AddressCard',
|
|
||||||
redirect: { name: 'CustomerAddress' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: 'CustomerAddress',
|
|
||||||
meta: {
|
|
||||||
icon: 'vn:delivery',
|
|
||||||
title: 'consignees',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerAddress.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'CustomerAddressCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'address-create',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerAddressCreate.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':addressId',
|
|
||||||
name: 'CustomerAddressEditCard',
|
|
||||||
redirect: { name: 'CustomerAddressEdit' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'edit',
|
|
||||||
name: 'CustomerAddressEdit',
|
|
||||||
meta: {
|
|
||||||
title: 'addressEdit',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerAddressEdit.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'notes',
|
|
||||||
name: 'CustomerNotes',
|
|
||||||
meta: {
|
|
||||||
title: 'notes',
|
|
||||||
icon: 'vn:notes',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'credits',
|
|
||||||
name: 'CustomerCredits',
|
|
||||||
meta: {
|
|
||||||
title: 'credits',
|
|
||||||
icon: 'vn:credit',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerCredits.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'greuges',
|
|
||||||
name: 'CustomerGreuges',
|
|
||||||
meta: {
|
|
||||||
title: 'greuges',
|
|
||||||
icon: 'vn:greuge',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerGreuges.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'balance',
|
|
||||||
name: 'CustomerBalance',
|
|
||||||
meta: {
|
|
||||||
title: 'balance',
|
|
||||||
icon: 'balance',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerBalance.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'recoveries',
|
|
||||||
name: 'CustomerRecoveries',
|
|
||||||
meta: {
|
|
||||||
title: 'recoveries',
|
|
||||||
icon: 'vn:recovery',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerRecoveries.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'web-access',
|
|
||||||
name: 'CustomerWebAccess',
|
|
||||||
meta: {
|
|
||||||
title: 'webAccess',
|
|
||||||
icon: 'vn:web',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerWebAccess.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'log',
|
|
||||||
name: 'CustomerLog',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'vn:History',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Customer/Card/CustomerLog.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'sms',
|
|
||||||
name: 'CustomerSms',
|
|
||||||
meta: {
|
|
||||||
title: 'sms',
|
|
||||||
icon: 'sms',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Customer/Card/CustomerSms.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'credit-management',
|
|
||||||
name: 'CustomerCreditManagement',
|
|
||||||
meta: {
|
|
||||||
title: 'creditManagement',
|
|
||||||
icon: 'paid',
|
|
||||||
menuChildren: [
|
|
||||||
{
|
|
||||||
name: 'CustomerCreditContracts',
|
|
||||||
title: 'creditContracts',
|
|
||||||
icon: 'vn:solunion',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerCreditOpinion',
|
|
||||||
title: 'creditOpinion',
|
|
||||||
icon: 'vn:linesprepaired',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'credit-contracts',
|
|
||||||
name: 'CreditContractsCard',
|
|
||||||
redirect: { name: 'CustomerCreditContracts' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: 'CustomerCreditContracts',
|
|
||||||
meta: {
|
|
||||||
title: 'creditContracts',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/Card/CustomerCreditContracts.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'CustomerCreditContractsCreate',
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerCreditContractsCreate.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'insurance/:creditId',
|
|
||||||
name: 'CustomerCreditContractsInsurance',
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerCreditContractsInsurance.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'credit-opinion',
|
|
||||||
name: 'CustomerCreditOpinion',
|
|
||||||
meta: {
|
|
||||||
title: 'creditOpinion',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/Card/CustomerCreditOpinion.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'others',
|
|
||||||
name: 'CustomerOthers',
|
|
||||||
meta: {
|
|
||||||
title: 'others',
|
|
||||||
icon: 'pending',
|
|
||||||
menuChildren: [
|
|
||||||
{
|
|
||||||
name: 'CustomerSamples',
|
|
||||||
title: 'samples',
|
|
||||||
icon: 'vn:notes',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerConsumption',
|
|
||||||
title: 'consumption',
|
|
||||||
icon: 'show_chart',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerMandates',
|
|
||||||
title: 'mandates',
|
|
||||||
icon: 'vn:mandatory',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerContacts',
|
|
||||||
title: 'contacts',
|
|
||||||
icon: 'contact_phone',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerWebPayment',
|
|
||||||
title: 'webPayment',
|
|
||||||
icon: 'vn:onlinepayment',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerFileManagement',
|
|
||||||
title: 'fileManagement',
|
|
||||||
icon: 'Upload',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'CustomerUnpaid',
|
|
||||||
title: 'unpaid',
|
|
||||||
icon: 'vn:defaulter',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'samples',
|
|
||||||
name: 'CustomerSamples',
|
|
||||||
meta: {
|
|
||||||
title: 'samples',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerSamples.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'samples',
|
|
||||||
name: 'CustomerSamplesCard',
|
|
||||||
redirect: { name: 'CustomerSamples' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: 'CustomerSamples',
|
|
||||||
meta: {
|
|
||||||
title: 'samples',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/Card/CustomerSamples.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'CustomerSamplesCreate',
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerSamplesCreate.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'consumption',
|
|
||||||
name: 'CustomerConsumption',
|
|
||||||
meta: {
|
|
||||||
title: 'consumption',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerConsumption.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'mandates',
|
|
||||||
name: 'CustomerMandates',
|
|
||||||
meta: {
|
|
||||||
title: 'mandates',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerMandates.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'contacts',
|
|
||||||
name: 'CustomerContacts',
|
|
||||||
meta: {
|
|
||||||
title: 'contacts',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerContacts.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'web-payment',
|
|
||||||
name: 'CustomerWebPayment',
|
|
||||||
meta: {
|
|
||||||
title: 'webPayment',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerWebPayment.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'file-management',
|
|
||||||
name: 'CustomerFileManagement',
|
|
||||||
meta: {
|
|
||||||
title: 'fileManagement',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/Card/CustomerFileManagement.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'file-management',
|
|
||||||
name: 'CustomerFileManagementCard',
|
|
||||||
redirect: { name: 'CustomerFileManagement' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: 'CustomerFileManagement',
|
|
||||||
meta: {
|
|
||||||
title: 'fileManagement',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/Card/CustomerFileManagement.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'CustomerFileManagementCreate',
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerFileManagementCreate.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':dmsId/edit',
|
|
||||||
name: 'CustomerFileManagementEdit',
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'src/pages/Customer/components/CustomerFileManagementEdit.vue'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'unpaid',
|
|
||||||
name: 'CustomerUnpaid',
|
|
||||||
meta: {
|
|
||||||
title: 'unpaid',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Customer/Card/CustomerUnpaid.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -168,7 +168,7 @@ const ticketCard = {
|
||||||
name: 'TicketBoxing',
|
name: 'TicketBoxing',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'boxing',
|
title: 'boxing',
|
||||||
icon: 'science',
|
icon: 'view_in_ar',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
|
component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,6 +5,7 @@ export const useStateStore = defineStore('stateStore', () => {
|
||||||
const isMounted = ref(false);
|
const isMounted = ref(false);
|
||||||
const leftDrawer = ref(false);
|
const leftDrawer = ref(false);
|
||||||
const rightDrawer = ref(false);
|
const rightDrawer = ref(false);
|
||||||
|
const rightAdvancedDrawer = ref(false);
|
||||||
const subToolbar = ref(false);
|
const subToolbar = ref(false);
|
||||||
|
|
||||||
function toggleLeftDrawer() {
|
function toggleLeftDrawer() {
|
||||||
|
@ -15,6 +16,10 @@ export const useStateStore = defineStore('stateStore', () => {
|
||||||
rightDrawer.value = !rightDrawer.value;
|
rightDrawer.value = !rightDrawer.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleRightAdvancedDrawer() {
|
||||||
|
rightAdvancedDrawer.value = !rightAdvancedDrawer.value;
|
||||||
|
}
|
||||||
|
|
||||||
function rightDrawerChangeValue(value) {
|
function rightDrawerChangeValue(value) {
|
||||||
rightDrawer.value = value;
|
rightDrawer.value = value;
|
||||||
}
|
}
|
||||||
|
@ -46,10 +51,12 @@ export const useStateStore = defineStore('stateStore', () => {
|
||||||
return {
|
return {
|
||||||
leftDrawer,
|
leftDrawer,
|
||||||
rightDrawer,
|
rightDrawer,
|
||||||
|
rightAdvancedDrawer,
|
||||||
setMounted,
|
setMounted,
|
||||||
isHeaderMounted,
|
isHeaderMounted,
|
||||||
toggleLeftDrawer,
|
toggleLeftDrawer,
|
||||||
toggleRightDrawer,
|
toggleRightDrawer,
|
||||||
|
toggleRightAdvancedDrawer,
|
||||||
isLeftDrawerShown,
|
isLeftDrawerShown,
|
||||||
isRightDrawerShown,
|
isRightDrawerShown,
|
||||||
isSubToolbarShown,
|
isSubToolbarShown,
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
const langList = import.meta.glob('../../node_modules/quasar/lang/*.js');
|
||||||
|
import { Quasar } from 'quasar';
|
||||||
|
|
||||||
|
export default function (value) {
|
||||||
|
try {
|
||||||
|
langList[`../../node_modules/quasar/lang/${value}.js`]().then((lang) => {
|
||||||
|
Quasar.lang.set(lang.default);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
const TOKEN_MULTIMEDIA = 'tokenMultimedia';
|
||||||
|
const TOKEN = 'token';
|
||||||
|
|
||||||
|
function getToken() {
|
||||||
|
const localToken = localStorage.getItem(TOKEN);
|
||||||
|
const sessionToken = sessionStorage.getItem(TOKEN);
|
||||||
|
|
||||||
|
return localToken || sessionToken || '';
|
||||||
|
}
|
||||||
|
function getTokenMultimedia() {
|
||||||
|
const localTokenMultimedia = localStorage.getItem(TOKEN_MULTIMEDIA);
|
||||||
|
const sessionTokenMultimedia = sessionStorage.getItem(TOKEN_MULTIMEDIA);
|
||||||
|
|
||||||
|
return localTokenMultimedia || sessionTokenMultimedia || '';
|
||||||
|
}
|
||||||
|
function isLoggedIn() {
|
||||||
|
const localToken = localStorage.getItem(TOKEN);
|
||||||
|
const sessionToken = sessionStorage.getItem(TOKEN);
|
||||||
|
|
||||||
|
return !!(localToken || sessionToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { getToken, getTokenMultimedia, isLoggedIn };
|
|
@ -1,5 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('ClaimPhoto', () => {
|
// redmine.verdnatura.es/issues/8417
|
||||||
|
describe.skip('ClaimPhoto', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const claimId = 1;
|
const claimId = 1;
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
|
|
@ -8,8 +8,8 @@ describe('EntryMy when is supplier', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8418
|
||||||
it('should open buyLabel when is supplier', () => {
|
it.skip('should open buyLabel when is supplier', () => {
|
||||||
cy.get(
|
cy.get(
|
||||||
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||||
).click();
|
).click();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
// https://redmine.verdnatura.es/issues/8419
|
||||||
describe('InvoiceInCorrective', () => {
|
describe.skip('InvoiceInCorrective', () => {
|
||||||
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
||||||
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
||||||
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
||||||
|
|
|
@ -21,8 +21,8 @@ describe('InvoiceInList', () => {
|
||||||
cy.url().should('include', `/invoice-in/${id}/summary`);
|
cy.url().should('include', `/invoice-in/${id}/summary`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8420
|
||||||
it('should open the details', () => {
|
it.skip('should open the details', () => {
|
||||||
cy.get(firstDetailBtn).click();
|
cy.get(firstDetailBtn).click();
|
||||||
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
||||||
cy.get(summaryHeaders).eq(4).contains('Vat');
|
cy.get(summaryHeaders).eq(4).contains('Vat');
|
||||||
|
|
|
@ -9,7 +9,6 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/list`);
|
cy.visit(`/#/invoice-out/list`);
|
||||||
cy.typeSearchbar('{enter}');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should generate the invoice PDF', () => {
|
it('should generate the invoice PDF', () => {
|
||||||
|
@ -19,13 +18,12 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.checkNotification('The invoice PDF document has been regenerated');
|
cy.checkNotification('The invoice PDF document has been regenerated');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should refund the invoice ', () => {
|
it('should refund 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('.q-menu > .q-list > :nth-child(7)').click();
|
||||||
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||||
cy.checkNotification('The following refund ticket have been created 1000000');
|
cy.checkNotification('The following refund ticket have been created');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete an invoice ', () => {
|
it('should delete an invoice ', () => {
|
||||||
|
@ -35,7 +33,6 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.checkNotification('InvoiceOut deleted');
|
cy.checkNotification('InvoiceOut deleted');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should transfer the invoice ', () => {
|
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();
|
||||||
|
|
|
@ -15,8 +15,8 @@ describe('Item list', () => {
|
||||||
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||||||
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8421
|
||||||
it('should create an item', () => {
|
it.skip('should create an item', () => {
|
||||||
const data = {
|
const data = {
|
||||||
Description: { val: `Test item` },
|
Description: { val: `Test item` },
|
||||||
Type: { val: `Crisantemo`, type: 'select' },
|
Type: { val: `Crisantemo`, type: 'select' },
|
||||||
|
|
|
@ -18,8 +18,8 @@ describe('Item tag', () => {
|
||||||
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
+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");
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8422
|
||||||
it('should add a new tag', () => {
|
it.skip('should add a new tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.get('.q-page').should('be.visible');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue