Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7322-addSelectAddressOnTicketTransfer
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
ff6e1c178d
|
@ -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>
|
|
@ -1,35 +1,23 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, useSlots } from 'vue';
|
import { onMounted, useSlots } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const hasContent = ref(false);
|
const hasContent = useHasContent('#right-panel');
|
||||||
const rightPanel = ref(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
rightPanel.value = document.querySelector('#right-panel');
|
|
||||||
if (!rightPanel.value) return;
|
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
|
||||||
hasContent.value = rightPanel.value.childNodes.length;
|
|
||||||
});
|
|
||||||
|
|
||||||
observer.observe(rightPanel.value, {
|
|
||||||
subtree: true,
|
|
||||||
childList: true,
|
|
||||||
attributes: true,
|
|
||||||
});
|
|
||||||
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
||||||
stateStore.rightDrawer = false;
|
stateStore.rightDrawer = false;
|
||||||
});
|
});
|
||||||
</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
|
||||||
>
|
>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useAttrs } from 'vue';
|
import { useAttrs } from 'vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -16,6 +16,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.location,
|
||||||
|
(newValue) => {
|
||||||
|
if (!modelValue.value) return;
|
||||||
|
modelValue.value = formatLocation(newValue) ?? null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule];
|
const mixinRules = [requiredFieldRule];
|
||||||
const locationProperties = [
|
const locationProperties = [
|
||||||
'postcode',
|
'postcode',
|
||||||
|
@ -43,9 +51,7 @@ const formatLocation = (obj, properties = locationProperties) => {
|
||||||
return filteredParts.join(', ');
|
return filteredParts.join(', ');
|
||||||
};
|
};
|
||||||
|
|
||||||
const modelValue = computed(() =>
|
const modelValue = ref(props.location ? formatLocation(props.location) : null);
|
||||||
props.location ? formatLocation(props.location, locationProperties) : null
|
|
||||||
);
|
|
||||||
|
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
const dataProperties = [
|
const dataProperties = [
|
||||||
|
|
|
@ -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,7 +678,8 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
<QList dense>
|
<QList dense>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QItem class="q-mt-sm">
|
<QItem class="q-mt-sm">
|
||||||
|
@ -732,14 +734,17 @@ watch(
|
||||||
v-model="userSelect"
|
v-model="userSelect"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:url="`${model}Logs/${$route.params.id}/editors`"
|
:url="`${model}Logs/${route.params.id}/editors`"
|
||||||
:fields="['id', 'nickname', 'name', 'image']"
|
:fields="['id', 'nickname', 'name', 'image']"
|
||||||
sort-by="nickname"
|
sort-by="nickname"
|
||||||
@update:model-value="selectFilter('userSelect')"
|
@update:model-value="selectFilter('userSelect')"
|
||||||
hide-selected
|
hide-selected
|
||||||
>
|
>
|
||||||
<template #option="{ opt, itemProps }">
|
<template #option="{ opt, itemProps }">
|
||||||
<QItem v-bind="itemProps" class="q-pa-xs row items-center">
|
<QItem
|
||||||
|
v-bind="itemProps"
|
||||||
|
class="q-pa-xs row items-center"
|
||||||
|
>
|
||||||
<QItemSection class="col-3 items-center">
|
<QItemSection class="col-3 items-center">
|
||||||
<VnAvatar :worker-id="opt.id" />
|
<VnAvatar :worker-id="opt.id" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -809,7 +814,8 @@ watch(
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</Teleport>
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<QDialog v-model="dateFromDialog">
|
<QDialog v-model="dateFromDialog">
|
||||||
<QDate
|
<QDate
|
||||||
:years-in-month-view="false"
|
:years-in-month-view="false"
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<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 } 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';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
section: {
|
section: {
|
||||||
|
@ -46,15 +47,15 @@ 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) {
|
const searchbarId = 'section-searchbar';
|
||||||
arrayData.reset(['userParams', 'userFilter']);
|
const advancedMenuSlot = 'advanced-menu';
|
||||||
}
|
const hasContent = useHasContent(`#${searchbarId}`);
|
||||||
return isSame;
|
|
||||||
});
|
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
if ($props.dataKey)
|
if ($props.dataKey)
|
||||||
|
@ -64,22 +65,38 @@ 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">
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
v-if="searchBar"
|
v-if="searchBar && !hasContent"
|
||||||
v-bind="arrayDataProps"
|
v-bind="arrayDataProps"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:label="$t(`${prefix}.search`)"
|
:label="$t(`${prefix}.search`)"
|
||||||
:info="$t(`${prefix}.searchInfo`)"
|
:info="$t(`${prefix}.searchInfo`)"
|
||||||
/>
|
/>
|
||||||
|
<div :id="searchbarId"></div>
|
||||||
</slot>
|
</slot>
|
||||||
|
<RightAdvancedMenu :is-main-section="isMainSection">
|
||||||
<RightMenu>
|
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter">
|
||||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
<slot :name="advancedMenuSlot">
|
||||||
<slot name="rightMenu">
|
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
v-if="rightFilter && columns"
|
v-if="rightFilter && columns"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
|
@ -88,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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,63 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
|
|
||||||
|
describe('VnInputTime', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(VnInputTime, {
|
||||||
|
props: {
|
||||||
|
isOutlined: true,
|
||||||
|
timeOnly: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct data if isOutlined is true', () => {
|
||||||
|
expect(vm.isOutlined).toBe(true);
|
||||||
|
expect(vm.styleAttrs).toEqual({ dense: true, outlined: true, rounded: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the formatted data', () => {
|
||||||
|
expect(vm.dateToTime('2022-01-01T03:23:43')).toBe('03:23');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('formattedTime', () => {
|
||||||
|
it('should return the formatted time for a valid ISO date', () => {
|
||||||
|
vm.model = '2025-01-02T15:45:00';
|
||||||
|
expect(vm.formattedTime).toBe('15:45');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle null model value gracefully', () => {
|
||||||
|
vm.model = null;
|
||||||
|
expect(vm.formattedTime).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle time-only input correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe('14:30');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pad short time values correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '9';
|
||||||
|
expect(vm.model).toBe('09:00');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the model if the value is unchanged', () => {
|
||||||
|
vm.model = '14:30';
|
||||||
|
const previousModel = vm.model;
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe(previousModel);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -2,7 +2,6 @@
|
||||||
import { ref, computed, watch, onBeforeMount } from 'vue';
|
import { ref, computed, watch, onBeforeMount } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { isDialogOpened } from 'src/filters';
|
import { isDialogOpened } from 'src/filters';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
@ -176,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 {
|
||||||
|
|
|
@ -18,8 +18,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
default: 3,
|
||||||
default: null,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -1,32 +1,42 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="header bg-primary q-pa-sm q-mb-md">
|
<div class="header bg-primary q-pa-sm q-mb-md">
|
||||||
<QSkeleton type="rect" square />
|
<QSkeleton type="rect" square />
|
||||||
|
<QSkeleton type="rect" square />
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
||||||
|
<div class="col">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
@ -34,6 +44,7 @@
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -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: {
|
||||||
|
...store.userParams,
|
||||||
search: searchText.value,
|
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,78 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import CardSummary from 'src/components/ui/CardSummary.vue';
|
||||||
|
import * as vueRouter from 'vue-router';
|
||||||
|
|
||||||
|
describe('CardSummary', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
||||||
|
query: {},
|
||||||
|
params: {},
|
||||||
|
meta: { moduleName: 'mockName' },
|
||||||
|
path: 'mockName/1/summary',
|
||||||
|
name: 'CardSummary',
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(CardSummary, {
|
||||||
|
propsData: {
|
||||||
|
dataKey: 'cardSummaryKey',
|
||||||
|
url: 'cardSummaryUrl',
|
||||||
|
filter: 'cardFilter',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fetch data correctly', async () => {
|
||||||
|
const fetchSpy = vi
|
||||||
|
.spyOn(vm.arrayData, 'fetch')
|
||||||
|
.mockResolvedValue({ data: [{ id: 1, name: 'Test Entity' }] });
|
||||||
|
await vm.fetch();
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalledWith({ append: false, updateRouter: false });
|
||||||
|
expect(wrapper.emitted('onFetch')).toBeTruthy();
|
||||||
|
expect(vm.isLoading).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set correct props to the store', () => {
|
||||||
|
expect(vm.store.url).toEqual('cardSummaryUrl');
|
||||||
|
expect(vm.store.filter).toEqual('cardFilter');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should compute entity correctly from store data', () => {
|
||||||
|
vm.store.data = [{ id: 1, name: 'Entity 1' }];
|
||||||
|
expect(vm.entity).toEqual({ id: 1, name: 'Entity 1' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty data gracefully', () => {
|
||||||
|
vm.store.data = [];
|
||||||
|
expect(vm.entity).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should respond to prop changes and refetch data', async () => {
|
||||||
|
const newUrl = 'CardSummary/35';
|
||||||
|
const newKey = 'cardSummaryKey/35';
|
||||||
|
const fetchSpy = vi.spyOn(vm.arrayData, 'fetch');
|
||||||
|
await wrapper.setProps({ url: newUrl, filter: { key: newKey } });
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalled();
|
||||||
|
expect(vm.store.url).toBe(newUrl);
|
||||||
|
expect(vm.store.filter).toEqual({ key: newKey });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if route path ends with /summary' , () => {
|
||||||
|
expect(vm.isSummary).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
|
@ -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')
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
|
export function useHasContent(selector) {
|
||||||
|
const container = ref({});
|
||||||
|
const hasContent = ref();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
container.value = document?.querySelector(selector);
|
||||||
|
if (!container.value) return;
|
||||||
|
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
if (document.querySelector(selector))
|
||||||
|
hasContent.value = !!container.value.childNodes.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(container.value, {
|
||||||
|
subtree: true,
|
||||||
|
childList: true,
|
||||||
|
attributes: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return hasContent;
|
||||||
|
}
|
|
@ -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
|
||||||
|
@ -346,6 +347,7 @@ globals:
|
||||||
countryFk: Country
|
countryFk: Country
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
|
setPass: Set password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
|
@ -388,80 +390,6 @@ cau:
|
||||||
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
||||||
inputLabel: Explain why this error should not appear
|
inputLabel: Explain why this error should not appear
|
||||||
askPrivileges: Ask for privileges
|
askPrivileges: Ask for privileges
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: New entry
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creation
|
|
||||||
supplierFk: Supplier
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
|
||||||
companyFk: Company
|
|
||||||
travelFk: Travel
|
|
||||||
isExcludedFromAvailable: Inventory
|
|
||||||
invoiceAmount: Import
|
|
||||||
summary:
|
|
||||||
commission: Commission
|
|
||||||
currency: Currency
|
|
||||||
invoiceNumber: Invoice number
|
|
||||||
ordered: Ordered
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
travelReference: Reference
|
|
||||||
travelAgency: Agency
|
|
||||||
travelShipped: Shipped
|
|
||||||
travelDelivered: Delivered
|
|
||||||
travelLanded: Landed
|
|
||||||
travelReceived: Received
|
|
||||||
buys: Buys
|
|
||||||
stickers: Stickers
|
|
||||||
package: Package
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Buying value
|
|
||||||
import: Import
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Travel
|
|
||||||
currency: Currency
|
|
||||||
commission: Commission
|
|
||||||
observation: Observation
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
buys:
|
|
||||||
observations: Observations
|
|
||||||
packagingFk: Box
|
|
||||||
color: Color
|
|
||||||
printedStickers: Printed stickers
|
|
||||||
notes:
|
|
||||||
observationType: Observation type
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Picture
|
|
||||||
itemFk: Item ID
|
|
||||||
weightByPiece: Weight/Piece
|
|
||||||
isActive: Active
|
|
||||||
family: Family
|
|
||||||
entryFk: Entry
|
|
||||||
freightValue: Freight value
|
|
||||||
comissionValue: Commission value
|
|
||||||
packageValue: Package value
|
|
||||||
isIgnored: Is ignored
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Package out
|
|
||||||
landing: Landing
|
|
||||||
isExcludedFromAvailable: Es inventory
|
|
||||||
params:
|
|
||||||
toShipped: To
|
|
||||||
fromShipped: From
|
|
||||||
warehouseiNFk: Warehouse
|
|
||||||
daysOnward: Days onward
|
|
||||||
daysAgo: Days ago
|
|
||||||
warehouseInFk: Warehouse in
|
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: Ticket ID
|
ticketFk: Ticket ID
|
||||||
|
@ -578,27 +506,6 @@ parking:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: You can search by parking code
|
info: You can search by parking code
|
||||||
label: Search parking...
|
label: Search parking...
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Sales Person
|
|
||||||
form:
|
|
||||||
clientFk: Client
|
|
||||||
addressFk: Address
|
|
||||||
agencyModeFk: Agency
|
|
||||||
list:
|
|
||||||
newOrder: New Order
|
|
||||||
summary:
|
|
||||||
basket: Basket
|
|
||||||
notConfirmed: Not confirmed
|
|
||||||
created: Created
|
|
||||||
createdFrom: Created From
|
|
||||||
address: Address
|
|
||||||
total: Total
|
|
||||||
items: Items
|
|
||||||
orderTicketList: Order Ticket List
|
|
||||||
amount: Amount
|
|
||||||
confirm: Confirm
|
|
||||||
confirmLines: Confirm lines
|
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Boss Department
|
bossDepartment: Boss Department
|
||||||
|
@ -798,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
|
||||||
|
@ -889,7 +797,10 @@ components:
|
||||||
hasMinPrice: Minimum price
|
hasMinPrice: Minimum price
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Buyer
|
salesPersonFk: Buyer
|
||||||
|
supplierFk: Supplier
|
||||||
from: From
|
from: From
|
||||||
|
to: To
|
||||||
|
visible: Is visible
|
||||||
active: Is active
|
active: Is active
|
||||||
floramondo: Is floramondo
|
floramondo: Is floramondo
|
||||||
showBadDates: Show future items
|
showBadDates: Show future items
|
||||||
|
|
|
@ -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
|
||||||
|
@ -348,6 +349,7 @@ globals:
|
||||||
countryFk: País
|
countryFk: País
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
|
setPass: Establecer contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
|
@ -388,80 +390,6 @@ cau:
|
||||||
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
||||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||||
askPrivileges: Solicitar permisos
|
askPrivileges: Solicitar permisos
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: Nueva entrada
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creación
|
|
||||||
supplierFk: Proveedor
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
|
||||||
companyFk: Empresa
|
|
||||||
travelFk: Envio
|
|
||||||
isExcludedFromAvailable: Inventario
|
|
||||||
invoiceAmount: Importe
|
|
||||||
summary:
|
|
||||||
commission: Comisión
|
|
||||||
currency: Moneda
|
|
||||||
invoiceNumber: Núm. factura
|
|
||||||
ordered: Pedida
|
|
||||||
booked: Contabilizada
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
travelReference: Referencia
|
|
||||||
travelAgency: Agencia
|
|
||||||
travelShipped: F. envio
|
|
||||||
travelWarehouseOut: Alm. salida
|
|
||||||
travelDelivered: Enviada
|
|
||||||
travelLanded: F. entrega
|
|
||||||
travelReceived: Recibida
|
|
||||||
buys: Compras
|
|
||||||
stickers: Etiquetas
|
|
||||||
package: Embalaje
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Coste
|
|
||||||
import: Importe
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Envío
|
|
||||||
currency: Moneda
|
|
||||||
observation: Observación
|
|
||||||
commission: Comisión
|
|
||||||
booked: Asentado
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
buys:
|
|
||||||
observations: Observaciónes
|
|
||||||
packagingFk: Embalaje
|
|
||||||
color: Color
|
|
||||||
printedStickers: Etiquetas impresas
|
|
||||||
notes:
|
|
||||||
observationType: Tipo de observación
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Foto
|
|
||||||
itemFk: Id Artículo
|
|
||||||
weightByPiece: Peso (gramos)/tallo
|
|
||||||
isActive: Activo
|
|
||||||
family: Familia
|
|
||||||
entryFk: Entrada
|
|
||||||
freightValue: Porte
|
|
||||||
comissionValue: Comisión
|
|
||||||
packageValue: Embalaje
|
|
||||||
isIgnored: Ignorado
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Embalaje envíos
|
|
||||||
landing: Llegada
|
|
||||||
isExcludedFromAvailable: Es inventario
|
|
||||||
params:
|
|
||||||
toShipped: Hasta
|
|
||||||
fromShipped: Desde
|
|
||||||
warehouseInFk: Alm. entrada
|
|
||||||
daysOnward: Días adelante
|
|
||||||
daysAgo: Días atras
|
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: ID de ticket
|
ticketFk: ID de ticket
|
||||||
|
@ -562,30 +490,6 @@ invoiceOut:
|
||||||
comercial: Comercial
|
comercial: Comercial
|
||||||
errors:
|
errors:
|
||||||
downloadCsvFailed: Error al descargar CSV
|
downloadCsvFailed: Error al descargar CSV
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Comercial
|
|
||||||
form:
|
|
||||||
clientFk: Cliente
|
|
||||||
addressFk: Dirección
|
|
||||||
agencyModeFk: Agencia
|
|
||||||
list:
|
|
||||||
newOrder: Nuevo Pedido
|
|
||||||
summary:
|
|
||||||
basket: Cesta
|
|
||||||
notConfirmed: No confirmada
|
|
||||||
created: Creado
|
|
||||||
createdFrom: Creado desde
|
|
||||||
address: Dirección
|
|
||||||
total: Total
|
|
||||||
vat: IVA
|
|
||||||
state: Estado
|
|
||||||
alias: Alias
|
|
||||||
items: Artículos
|
|
||||||
orderTicketList: Tickets del pedido
|
|
||||||
amount: Monto
|
|
||||||
confirm: Confirmar
|
|
||||||
confirmLines: Confirmar lineas
|
|
||||||
shelving:
|
shelving:
|
||||||
list:
|
list:
|
||||||
parking: Parking
|
parking: Parking
|
||||||
|
@ -797,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
|
||||||
|
@ -889,7 +794,11 @@ components:
|
||||||
wareHouseFk: Almacén
|
wareHouseFk: Almacén
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Comprador
|
salesPersonFk: Comprador
|
||||||
|
supplierFk: Proveedor
|
||||||
|
visible: Visible
|
||||||
active: Activo
|
active: Activo
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
floramondo: Floramondo
|
floramondo: Floramondo
|
||||||
showBadDates: Ver items a futuro
|
showBadDates: Ver items a futuro
|
||||||
userPanel:
|
userPanel:
|
||||||
|
|
|
@ -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) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,48 +1,56 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref, toRefs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
|
||||||
import useHasAccount from 'src/composables/useHasAccount.js';
|
|
||||||
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
entityId: {
|
hasAccount: {
|
||||||
type: Number,
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { hasAccount } = toRefs($props);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const { notify } = useNotify();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
const { notify } = useQuasar();
|
||||||
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
||||||
|
account.value.hasAccount = hasAccount.value;
|
||||||
onMounted(async () => {
|
const entityId = computed(() => +route.params.id);
|
||||||
account.value.hasAccount = await useHasAccount($props.entityId);
|
const hasitManagementAccess = ref();
|
||||||
});
|
const hasSysadminAccess = ref();
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
await axios.post(`Accounts`, { id: $props.entityId });
|
await axios.post(`Accounts`, { id: entityId.value });
|
||||||
} else {
|
} else {
|
||||||
await axios.delete(`Accounts/${$props.entityId}`);
|
await axios.delete(`Accounts/${entityId.value}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
account.value.hasAccount = active;
|
account.value.hasAccount = active;
|
||||||
const status = active ? 'enable' : 'disable';
|
const status = active ? 'enable' : 'disable';
|
||||||
notify({
|
notify({
|
||||||
message: t(`account.card.${status}Account.success`),
|
message: t(`account.card.actions.${status}Account.success`),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function updateStatusUser(active) {
|
async function updateStatusUser(active) {
|
||||||
await axios.patch(`VnUsers/${$props.entityId}`, { active });
|
await axios.patch(`VnUsers/${entityId.value}`, { active });
|
||||||
account.value.active = active;
|
account.value.active = active;
|
||||||
const status = active ? 'activate' : 'deactivate';
|
const status = active ? 'activate' : 'deactivate';
|
||||||
notify({
|
notify({
|
||||||
|
@ -50,6 +58,17 @@ async function updateStatusUser(active) {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteAccount() {
|
||||||
|
const { data } = await axios.delete(`VnUsers/${entityId.value}`);
|
||||||
|
if (data) {
|
||||||
|
notify({
|
||||||
|
message: t('account.card.actions.delete.success'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
router.push({ name: 'AccountList' });
|
||||||
|
}
|
||||||
|
}
|
||||||
const showSyncDialog = ref(false);
|
const showSyncDialog = ref(false);
|
||||||
const syncPassword = ref(null);
|
const syncPassword = ref(null);
|
||||||
const shouldSyncPassword = ref(false);
|
const shouldSyncPassword = ref(false);
|
||||||
|
@ -64,11 +83,27 @@ async function sync() {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const askOldPass = ref(false);
|
||||||
|
const changePassRef = ref();
|
||||||
|
|
||||||
|
const onChangePass = (oldPass) => {
|
||||||
|
askOldPass.value = oldPass;
|
||||||
|
changePassRef.value.show();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
hasitManagementAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'higherPrivileges', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
hasSysadminAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'adminUser', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnChangePassword
|
<VnChangePassword
|
||||||
ref="changePassRef"
|
ref="changePassRef"
|
||||||
:ask-old-pass="true"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
await axios.patch(`Accounts/change-password`, {
|
||||||
|
@ -110,18 +145,46 @@ async function sync() {
|
||||||
</template>
|
</template>
|
||||||
</VnConfirm>
|
</VnConfirm>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="
|
v-if="hasitManagementAccess"
|
||||||
entityId == account.id &&
|
|
||||||
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
|
|
||||||
"
|
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="$refs.changePassRef.show()"
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.disableAccount.title'),
|
||||||
|
t('account.card.actions.disableAccount.subtitle'),
|
||||||
|
() => deleteAccount()
|
||||||
|
)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.changePass') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.hasAccount"
|
v-if="hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
||||||
|
>
|
||||||
|
<QItemSection v-if="user.id === account.id">
|
||||||
|
{{ t('globals.changePass') }}
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.enableAccount.title'),
|
||||||
|
t('account.card.actions.enableAccount.subtitle'),
|
||||||
|
() => updateStatusAccount(true)
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="account.hasAccount && hasSysadminAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -136,7 +199,7 @@ async function sync() {
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.active"
|
v-if="!account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -150,7 +213,7 @@ async function sync() {
|
||||||
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.active"
|
v-if="account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -163,7 +226,12 @@ async function sync() {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="showSyncDialog = true">
|
<QItem
|
||||||
|
v-if="useAcl().hasAny([{ model: 'VnRole', props: '*', accessType: 'WRITE' }])"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showSyncDialog = true"
|
||||||
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
|
|
|
@ -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,7 +200,8 @@ 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">
|
||||||
|
<template #right-panel>
|
||||||
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
||||||
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
|
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
|
||||||
</QCard>
|
</QCard>
|
||||||
|
@ -238,7 +238,10 @@ async function post(query, params) {
|
||||||
<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="position: static">
|
||||||
<QInput
|
<QInput
|
||||||
:disable="
|
:disable="
|
||||||
!(claim.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2)
|
!(
|
||||||
|
claim.responsibility >=
|
||||||
|
Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2
|
||||||
|
)
|
||||||
"
|
"
|
||||||
:label="t('confirmGreuges')"
|
:label="t('confirmGreuges')"
|
||||||
class="q-field__native text-grey-2"
|
class="q-field__native text-grey-2"
|
||||||
|
@ -251,8 +254,8 @@ async function post(query, params) {
|
||||||
v-model="multiplicatorValue"
|
v-model="multiplicatorValue"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
</Teleport>
|
</template>
|
||||||
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport>
|
</RightMenu>
|
||||||
<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,21 +399,23 @@ 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'),
|
||||||
|
@ -455,7 +466,12 @@ function handleLocation(data, location) {
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
/>
|
/>
|
||||||
<QInput v-model="data.userName" :label="t('Web user')" />
|
<QInput v-model="data.userName" :label="t('Web user')" />
|
||||||
<QInput :label="t('Email')" clearable type="email" v-model="data.email">
|
<QInput
|
||||||
|
:label="t('Email')"
|
||||||
|
clearable
|
||||||
|
type="email"
|
||||||
|
v-model="data.email"
|
||||||
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="info" class="cursor-info">
|
<QIcon name="info" class="cursor-info">
|
||||||
<QTooltip max-width="400px">{{
|
<QTooltip max-width="400px">{{
|
||||||
|
@ -466,6 +482,8 @@ function handleLocation(data, location) {
|
||||||
</QInput>
|
</QInput>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
|
|
@ -11,6 +11,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 CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
||||||
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -150,6 +151,22 @@ function onAgentCreated({ id, fiscalName }, data) {
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('Longitude')"
|
||||||
|
clearable
|
||||||
|
v-model="data.longitude"
|
||||||
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('Latitude')"
|
||||||
|
clearable
|
||||||
|
v-model="data.latitude"
|
||||||
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
</template>
|
</template>
|
||||||
|
@ -175,4 +192,6 @@ es:
|
||||||
Mobile: Movíl
|
Mobile: Movíl
|
||||||
Incoterms: Incoterms
|
Incoterms: Incoterms
|
||||||
Customs agent: Agente de aduanas
|
Customs agent: Agente de aduanas
|
||||||
|
Longitude: Longitud
|
||||||
|
Latitude: Latitud
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import EntryDescriptor from './EntryDescriptor.vue';
|
import EntryDescriptor from './EntryDescriptor.vue';
|
||||||
import EntryFilter from '../EntryFilter.vue';
|
import filter from './EntryFilter.js'
|
||||||
import filter from './EntryFilter.js';
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Entry"
|
data-key="Entry"
|
||||||
base-url="Entries"
|
base-url="Entries"
|
||||||
:filter="filter"
|
|
||||||
:descriptor="EntryDescriptor"
|
:descriptor="EntryDescriptor"
|
||||||
:filter-panel="EntryFilter"
|
:user-filter="filter"
|
||||||
search-data-key="EntryList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Entries/filter',
|
|
||||||
label: 'Search entries',
|
|
||||||
info: 'You can search by entry reference',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -40,7 +40,7 @@ const companiesOptions = ref([]);
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`entryFilter.params.${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -49,7 +49,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.search"
|
v-model="params.search"
|
||||||
:label="t('entryFilter.filter.search')"
|
:label="t('entryFilter.params.search')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -58,7 +58,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.reference"
|
v-model="params.reference"
|
||||||
:label="t('entryFilter.filter.reference')"
|
:label="t('entryFilter.params.reference')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -67,7 +67,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.invoiceNumber"
|
v-model="params.invoiceNumber"
|
||||||
:label="t('params.invoiceNumber')"
|
:label="t('entryFilter.params.invoiceNumber')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -76,7 +76,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.travelFk"
|
v-model="params.travelFk"
|
||||||
:label="t('params.travelFk')"
|
:label="t('entryFilter.params.travelFk')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -84,7 +84,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.companyFk')"
|
:label="t('entryFilter.params.companyFk')"
|
||||||
v-model="params.companyFk"
|
v-model="params.companyFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="companiesOptions"
|
:options="companiesOptions"
|
||||||
|
@ -100,7 +100,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.currencyFk')"
|
:label="t('entryFilter.params.currencyFk')"
|
||||||
v-model="params.currencyFk"
|
v-model="params.currencyFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="currenciesOptions"
|
:options="currenciesOptions"
|
||||||
|
@ -116,7 +116,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.supplierFk')"
|
:label="t('entryFilter.params.supplierFk')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
|
@ -148,7 +148,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.created')"
|
:label="t('entryFilter.params.created')"
|
||||||
v-model="params.created"
|
v-model="params.created"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -158,7 +158,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.from')"
|
:label="t('entryFilter.params.from')"
|
||||||
v-model="params.from"
|
v-model="params.from"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -168,7 +168,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.to')"
|
:label="t('entryFilter.params.to')"
|
||||||
v-model="params.to"
|
v-model="params.to"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -178,14 +178,14 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isBooked')"
|
:label="t('entryFilter.params.isBooked')"
|
||||||
v-model="params.isBooked"
|
v-model="params.isBooked"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isConfirmed')"
|
:label="t('entryFilter.params.isConfirmed')"
|
||||||
v-model="params.isConfirmed"
|
v-model="params.isConfirmed"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -194,7 +194,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isOrdered')"
|
:label="t('entryFilter.params.isOrdered')"
|
||||||
v-model="params.isOrdered"
|
v-model="params.isOrdered"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -203,34 +203,3 @@ const companiesOptions = ref([]);
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
params:
|
|
||||||
|
|
||||||
invoiceNumber: Invoice number
|
|
||||||
travelFk: Travel
|
|
||||||
companyFk: Company
|
|
||||||
currencyFk: Currency
|
|
||||||
supplierFk: Supplier
|
|
||||||
from: From
|
|
||||||
to: To
|
|
||||||
created: Created
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
|
||||||
es:
|
|
||||||
params:
|
|
||||||
|
|
||||||
invoiceNumber: Núm. factura
|
|
||||||
travelFk: Envío
|
|
||||||
companyFk: Empresa
|
|
||||||
currencyFk: Moneda
|
|
||||||
supplierFk: Proveedor
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
created: Fecha creación
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.weightByPiece'),
|
label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'),
|
||||||
name: 'weightByPiece',
|
name: 'weightByPiece',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
|
@ -157,7 +157,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.buys.packageValue'),
|
label: t('entry.latestBuys.tableVisibleColumns.packageValue'),
|
||||||
name: 'packageValue',
|
name: 'packageValue',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
|
@ -262,8 +262,3 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Edit buy(s): Editar compra(s)
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
import { ref, computed } from 'vue';
|
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 VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import { toCelsius, toDate } from 'src/filters';
|
||||||
import { 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';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const dataKey = 'EntryList';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const entryFilter = {
|
const entryFilter = {
|
||||||
|
@ -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',
|
||||||
|
@ -178,30 +192,32 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSection
|
||||||
data-key="EntryList"
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
prefix="entry"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:label="t('Search entries')"
|
:array-data-props="{
|
||||||
:info="t('You can search by entry reference')"
|
url: 'Entries/filter',
|
||||||
/>
|
order: 'id DESC',
|
||||||
<RightMenu>
|
userFilter: entryFilter,
|
||||||
<template #right-panel>
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<EntryFilter data-key="EntryList" />
|
<EntryFilter data-key="EntryList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="EntryList"
|
:data-key="dataKey"
|
||||||
url="Entries/filter"
|
|
||||||
:filter="entryFilter"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Entries',
|
urlCreate: 'Entries',
|
||||||
title: t('Create entry'),
|
title: t('entry.list.newEntry'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="entry"
|
redirect="entry"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
@ -214,13 +230,17 @@ const columns = computed(() => [
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
<QTooltip>{{
|
<QTooltip>{{
|
||||||
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
t(
|
||||||
|
'entry.list.tableVisibleColumns.isExcludedFromAvailable'
|
||||||
|
)
|
||||||
}}</QTooltip>
|
}}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{
|
{{
|
||||||
t('globals.raid', { daysInForward: row.daysInForward })
|
t('globals.raid', {
|
||||||
|
daysInForward: row.daysInForward,
|
||||||
|
})
|
||||||
}}</QTooltip
|
}}</QTooltip
|
||||||
>
|
>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
@ -239,12 +259,6 @@ const columns = computed(() => [
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Virtual entry: Es una redada
|
|
||||||
Search entries: Buscar entradas
|
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
Create entry: Crear entrada
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -19,7 +19,7 @@ const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const columns = [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: 'Id',
|
label: 'Id',
|
||||||
|
@ -31,7 +31,7 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerFk',
|
name: 'workerFk',
|
||||||
label: t('Buyer'),
|
label: t('entryStockBought.buyer'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -49,7 +49,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
label: t('Reserve'),
|
label: t('entryStockBought.reserve'),
|
||||||
name: 'reserve',
|
name: 'reserve',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
create: true,
|
create: true,
|
||||||
|
@ -58,7 +58,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
label: t('Bought'),
|
label: t('entryStockBought.bought'),
|
||||||
name: 'bought',
|
name: 'bought',
|
||||||
summation: true,
|
summation: true,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -66,7 +66,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('Date'),
|
label: t('entryStockBought.date'),
|
||||||
name: 'dated',
|
name: 'dated',
|
||||||
component: 'date',
|
component: 'date',
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -77,7 +77,7 @@ const columns = [
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('View more details'),
|
title: t('entryStockBought.viewMoreDetails'),
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => {
|
action: (row) => {
|
||||||
|
@ -92,7 +92,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
|
|
||||||
const fetchDataRef = ref();
|
const fetchDataRef = ref();
|
||||||
const travelDialogRef = ref(false);
|
const travelDialogRef = ref(false);
|
||||||
|
@ -166,7 +166,7 @@ function round(value) {
|
||||||
<VnRow class="travel">
|
<VnRow class="travel">
|
||||||
<div v-if="travel">
|
<div v-if="travel">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ t('Purchase Spaces') }}:
|
{{ t('entryStockBought.purchaseSpaces') }}:
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{{ travel?.m3 }}
|
{{ travel?.m3 }}
|
||||||
|
@ -177,7 +177,7 @@ function round(value) {
|
||||||
flat
|
flat
|
||||||
icon="edit"
|
icon="edit"
|
||||||
@click="openDialog()"
|
@click="openDialog()"
|
||||||
:title="t('Edit travel')"
|
:title="t('entryStockBought.editTravel')"
|
||||||
color="primary"
|
color="primary"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -226,7 +226,7 @@ function round(value) {
|
||||||
@on-fetch="(data) => setFooter(data)"
|
@on-fetch="(data) => setFooter(data)"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'StockBoughts',
|
urlCreate: 'StockBoughts',
|
||||||
title: t('Reserve some space'),
|
title: t('entryStockBought.reserveSomeSpace'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: () => tableRef.reload(),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
workerFk: user.id,
|
workerFk: user.id,
|
||||||
|
@ -288,16 +288,3 @@ function round(value) {
|
||||||
color: $negative !important;
|
color: $negative !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Edit travel: Editar envío
|
|
||||||
Travel: Envíos
|
|
||||||
Purchase Spaces: Espacios de compra
|
|
||||||
Buyer: Comprador
|
|
||||||
Reserve: Reservado
|
|
||||||
Bought: Comprado
|
|
||||||
Date: Fecha
|
|
||||||
View more details: Ver más detalles
|
|
||||||
Reserve some space: Reservar espacio
|
|
||||||
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -123,8 +123,8 @@ const printBuys = (rowId) => {
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:label="t('Search entries')"
|
:label="t('myEntries.search')"
|
||||||
:info="t('You can search by entry reference')"
|
:info="t('myEntries.searchInfo')"
|
||||||
/>
|
/>
|
||||||
<VnTable
|
<VnTable
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
|
@ -137,7 +137,3 @@ const printBuys = (rowId) => {
|
||||||
chip-locale="myEntries"
|
chip-locale="myEntries"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,9 +1,94 @@
|
||||||
entryList:
|
entry:
|
||||||
list:
|
list:
|
||||||
|
newEntry: New entry
|
||||||
|
tableVisibleColumns:
|
||||||
|
created: Creation
|
||||||
|
supplierFk: Supplier
|
||||||
|
isBooked: Booked
|
||||||
|
isConfirmed: Confirmed
|
||||||
|
isOrdered: Ordered
|
||||||
|
companyFk: Company
|
||||||
|
travelFk: Travel
|
||||||
|
isExcludedFromAvailable: Inventory
|
||||||
|
invoiceAmount: Import
|
||||||
inventoryEntry: Inventory entry
|
inventoryEntry: Inventory entry
|
||||||
showEntryReport: Show entry report
|
summary:
|
||||||
|
commission: Commission
|
||||||
|
currency: Currency
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
ordered: Ordered
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
travelReference: Reference
|
||||||
|
travelAgency: Agency
|
||||||
|
travelShipped: Shipped
|
||||||
|
travelDelivered: Delivered
|
||||||
|
travelLanded: Landed
|
||||||
|
travelReceived: Received
|
||||||
|
buys: Buys
|
||||||
|
stickers: Stickers
|
||||||
|
package: Package
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Buying value
|
||||||
|
import: Import
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Travel
|
||||||
|
currency: Currency
|
||||||
|
commission: Commission
|
||||||
|
observation: Observation
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
initialTemperature: Ini °C
|
||||||
|
finalTemperature: Fin °C
|
||||||
|
buys:
|
||||||
|
observations: Observations
|
||||||
|
packagingFk: Box
|
||||||
|
color: Color
|
||||||
|
printedStickers: Printed stickers
|
||||||
|
notes:
|
||||||
|
observationType: Observation type
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Picture
|
||||||
|
itemFk: Item ID
|
||||||
|
weightByPiece: Weight/Piece
|
||||||
|
isActive: Active
|
||||||
|
family: Family
|
||||||
|
entryFk: Entry
|
||||||
|
freightValue: Freight value
|
||||||
|
comissionValue: Commission value
|
||||||
|
packageValue: Package value
|
||||||
|
isIgnored: Is ignored
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Package out
|
||||||
|
landing: Landing
|
||||||
|
isExcludedFromAvailable: Es inventory
|
||||||
|
params:
|
||||||
|
toShipped: To
|
||||||
|
fromShipped: From
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
warehouseInFk: Warehouse in
|
||||||
|
search: Search entries
|
||||||
|
searchInfo: You can search by entry reference
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
params:
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
travelFk: Travel
|
||||||
|
companyFk: Company
|
||||||
|
currencyFk: Currency
|
||||||
|
supplierFk: Supplier
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
|
created: Created
|
||||||
|
isBooked: Booked
|
||||||
|
isConfirmed: Confirmed
|
||||||
|
isOrdered: Ordered
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
myEntries:
|
myEntries:
|
||||||
|
@ -19,5 +104,18 @@ myEntries:
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
daysAgo: Days ago
|
daysAgo: Days ago
|
||||||
downloadCsv: Download CSV
|
downloadCsv: Download CSV
|
||||||
|
search: Search entries
|
||||||
|
searchInfo: You can search by entry reference
|
||||||
|
entryStockBought:
|
||||||
|
travel: Travel
|
||||||
|
editTravel: Edit travel
|
||||||
|
purchaseSpaces: Purchase spaces
|
||||||
|
buyer: Buyer
|
||||||
|
reserve: Reserve
|
||||||
|
bought: Bought
|
||||||
|
date: Date
|
||||||
|
viewMoreDetails: View more details
|
||||||
|
reserveSomeSpace: Reserve some space
|
||||||
|
thisBuyerHasReservationThisDate: This buyer has already made a reservation for this date
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: The wastes were successfully recalculated
|
recalcOk: The wastes were successfully recalculated
|
||||||
|
|
|
@ -1,12 +1,95 @@
|
||||||
Search entries: Buscar entradas
|
entry:
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
|
|
||||||
entryList:
|
|
||||||
list:
|
list:
|
||||||
|
newEntry: Nueva entrada
|
||||||
|
tableVisibleColumns:
|
||||||
|
created: Creación
|
||||||
|
supplierFk: Proveedor
|
||||||
|
isBooked: Asentado
|
||||||
|
isConfirmed: Confirmado
|
||||||
|
isOrdered: Pedida
|
||||||
|
companyFk: Empresa
|
||||||
|
travelFk: Envio
|
||||||
|
isExcludedFromAvailable: Inventario
|
||||||
|
invoiceAmount: Importe
|
||||||
inventoryEntry: Es inventario
|
inventoryEntry: Es inventario
|
||||||
showEntryReport: Ver informe del pedido
|
summary:
|
||||||
|
commission: Comisión
|
||||||
|
currency: Moneda
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
ordered: Pedida
|
||||||
|
booked: Contabilizada
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
travelReference: Referencia
|
||||||
|
travelAgency: Agencia
|
||||||
|
travelShipped: F. envio
|
||||||
|
travelWarehouseOut: Alm. salida
|
||||||
|
travelDelivered: Enviada
|
||||||
|
travelLanded: F. entrega
|
||||||
|
travelReceived: Recibida
|
||||||
|
buys: Compras
|
||||||
|
stickers: Etiquetas
|
||||||
|
package: Embalaje
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Coste
|
||||||
|
import: Importe
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Envío
|
||||||
|
currency: Moneda
|
||||||
|
observation: Observación
|
||||||
|
commission: Comisión
|
||||||
|
booked: Asentado
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
initialTemperature: Ini °C
|
||||||
|
finalTemperature: Fin °C
|
||||||
|
buys:
|
||||||
|
observations: Observaciónes
|
||||||
|
packagingFk: Embalaje
|
||||||
|
color: Color
|
||||||
|
printedStickers: Etiquetas impresas
|
||||||
|
notes:
|
||||||
|
observationType: Tipo de observación
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Foto
|
||||||
|
itemFk: Id Artículo
|
||||||
|
weightByPiece: Peso (gramos)/tallo
|
||||||
|
isActive: Activo
|
||||||
|
family: Familia
|
||||||
|
entryFk: Entrada
|
||||||
|
freightValue: Porte
|
||||||
|
comissionValue: Comisión
|
||||||
|
packageValue: Embalaje
|
||||||
|
isIgnored: Ignorado
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Embalaje envíos
|
||||||
|
landing: Llegada
|
||||||
|
isExcludedFromAvailable: Es inventario
|
||||||
|
params:
|
||||||
|
toShipped: Hasta
|
||||||
|
fromShipped: Desde
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
search: Buscar entradas
|
||||||
|
searchInfo: Puedes buscar por referencia de entrada
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
params:
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
travelFk: Envío
|
||||||
|
companyFk: Empresa
|
||||||
|
currencyFk: Moneda
|
||||||
|
supplierFk: Proveedor
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
created: Fecha creación
|
||||||
|
isBooked: Asentado
|
||||||
|
isConfirmed: Confirmado
|
||||||
|
isOrdered: Pedida
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
myEntries:
|
myEntries:
|
||||||
|
@ -22,5 +105,18 @@ myEntries:
|
||||||
daysOnward: Días adelante
|
daysOnward: Días adelante
|
||||||
daysAgo: Días atras
|
daysAgo: Días atras
|
||||||
downloadCsv: Descargar CSV
|
downloadCsv: Descargar CSV
|
||||||
|
search: Buscar entradas
|
||||||
|
searchInfo: Puedes buscar por referencia de la entrada
|
||||||
|
entryStockBought:
|
||||||
|
travel: Envío
|
||||||
|
editTravel: Editar envío
|
||||||
|
purchaseSpaces: Espacios de compra
|
||||||
|
buyer: Comprador
|
||||||
|
reserve: Reservado
|
||||||
|
bought: Comprado
|
||||||
|
date: Fecha
|
||||||
|
viewMoreDetails: Ver más detalles
|
||||||
|
reserveSomeSpace: Reservar espacio
|
||||||
|
thisBuyerHasReservationThisDate: Este comprador ya ha hecho una reserva para esta fecha
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: Se han recalculado las mermas correctamente
|
recalcOk: Se han recalculado las mermas correctamente
|
||||||
|
|
|
@ -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 landed = arrayData.store.filter.where?.landed;
|
||||||
|
arrayData = useArrayData('ItemLastEntries', {
|
||||||
|
url: 'Items/lastEntriesFilter',
|
||||||
|
order: ['landed DESC', 'buyFk DESC'],
|
||||||
|
exprBuilder: exprBuilder,
|
||||||
|
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();
|
const _from = Date.vnNew();
|
||||||
_from.setDate(_from.getDate() - 75);
|
_from.setDate(_from.getDate() - 75);
|
||||||
from.value = getDate(_from, 'from');
|
from.value = getDate(_from, 'from');
|
||||||
const _to = Date.vnNew();
|
const _to = Date.vnNew();
|
||||||
_to.setDate(_to.getDate() + 10);
|
_to.setDate(_to.getDate() + 10);
|
||||||
to.value = getDate(_to, 'to');
|
to.value = getDate(_to, 'to');
|
||||||
|
}
|
||||||
|
|
||||||
updateFilter();
|
updateFilter();
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ onBeforeMount(async () => {
|
||||||
{{ row?.subName.toUpperCase() }}
|
{{ row?.subName.toUpperCase() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
label: Label
|
label: Label
|
||||||
grouping: Grouping
|
grouping: Grouping
|
||||||
|
packing: Packing
|
||||||
quantity: Quantity
|
quantity: Quantity
|
||||||
cost: Cost
|
cost: Cost
|
||||||
kg: Kg.
|
kg: Kg.
|
||||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
label: Eti.
|
label: Eti.
|
||||||
grouping: Grouping
|
grouping: Grouping
|
||||||
|
packing: Packing
|
||||||
quantity: Cantidad
|
quantity: Cantidad
|
||||||
cost: Coste
|
cost: Coste
|
||||||
kg: Kg.
|
kg: Kg.
|
||||||
|
|
|
@ -1,38 +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 OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
|
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
|
||||||
import OrderFilter from './OrderFilter.vue';
|
|
||||||
import OrderSearchbar from './OrderSearchbar.vue';
|
|
||||||
import OrderCatalogFilter from './OrderCatalogFilter.vue';
|
|
||||||
const config = {
|
|
||||||
OrderCatalog: OrderCatalogFilter,
|
|
||||||
};
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const routeName = computed(() => route.name);
|
|
||||||
const customRouteRedirectName = computed(() => {
|
|
||||||
const route = config[routeName.value];
|
|
||||||
if (route) return null;
|
|
||||||
return 'OrderList';
|
|
||||||
});
|
|
||||||
const customFilterPanel = computed(() => {
|
|
||||||
const filterPanel = config[routeName.value] ?? OrderFilter;
|
|
||||||
return filterPanel;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Order"
|
data-key="Order"
|
||||||
base-url="Orders"
|
base-url="Orders"
|
||||||
:descriptor="OrderDescriptor"
|
:descriptor="OrderDescriptor"
|
||||||
:filter-panel="customFilterPanel"
|
/>
|
||||||
:search-data-key="customRouteRedirectName"
|
|
||||||
>
|
|
||||||
<template #searchbar>
|
|
||||||
<OrderSearchbar />
|
|
||||||
</template>
|
|
||||||
</VnCard>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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,21 +9,25 @@ 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();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dataKey = 'OrderCatalogList';
|
const dataKey = 'OrderCatalogList';
|
||||||
const arrayData = useArrayData(dataKey);
|
const catalogParams = {
|
||||||
const store = arrayData.store;
|
|
||||||
const tags = ref([]);
|
|
||||||
const itemRefs = ref({});
|
|
||||||
|
|
||||||
let catalogParams = {
|
|
||||||
orderFk: route.params.id,
|
orderFk: route.params.id,
|
||||||
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
||||||
};
|
};
|
||||||
|
const arrayData = useArrayData(dataKey, {
|
||||||
|
url: 'Orders/CatalogFilter',
|
||||||
|
limit: 50,
|
||||||
|
userParams: catalogParams,
|
||||||
|
});
|
||||||
|
const store = arrayData.store;
|
||||||
|
const tags = ref([]);
|
||||||
|
const itemRefs = ref({});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
|
@ -66,7 +70,6 @@ function extractValueTags(items) {
|
||||||
);
|
);
|
||||||
tagValue.value = resultValueTags;
|
tagValue.value = resultValueTags;
|
||||||
}
|
}
|
||||||
const autoLoad = computed(() => !!JSON.parse(route?.query.table ?? '{}')?.categoryFk);
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.data,
|
() => store.data,
|
||||||
|
@ -78,33 +81,28 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<Teleport to="#section-searchbar" v-if="stateStore.isHeaderMounted()">
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:user-params="catalogParams"
|
|
||||||
:static-params="['orderFk', 'orderBy']"
|
|
||||||
:redirect="false"
|
:redirect="false"
|
||||||
url="Orders/CatalogFilter"
|
|
||||||
:label="t('Search items')"
|
:label="t('Search items')"
|
||||||
:info="t('You can search items by name or id')"
|
:info="t('You can search items by name or id')"
|
||||||
:search-remove-params="false"
|
:search-remove-params="false"
|
||||||
/>
|
/>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
</Teleport>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
<OrderCatalogFilter
|
<OrderCatalogFilter
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:tag-value="tagValue"
|
:tag-value="tagValue"
|
||||||
:tags="tags"
|
:tags="tags"
|
||||||
:initial-catalog-params="catalogParams"
|
: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
|
<VnPaginate :data-key="dataKey">
|
||||||
:data-key="dataKey"
|
|
||||||
url="Orders/CatalogFilter"
|
|
||||||
:limit="50"
|
|
||||||
:user-params="catalogParams"
|
|
||||||
:auto-load="autoLoad"
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<div class="catalog-list">
|
<div class="catalog-list">
|
||||||
<div v-if="rows && !rows?.length" class="no-result">
|
<div v-if="rows && !rows?.length" class="no-result">
|
||||||
|
@ -146,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();
|
||||||
|
@ -208,15 +207,28 @@ async function remove(item) {
|
||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
const result = await confirm(route.params.id);
|
const result = await confirm(route.params.id);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
const sale = await axios.get(`OrderRows`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
where: { orderFk: route.params.id },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const ticket = await axios.get(`Sales`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
where: { id: sale.data[0].saleFk },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
router.push({
|
router.push({
|
||||||
name: 'TicketSale',
|
name: 'TicketSale',
|
||||||
query: {
|
params: { id: ticket.data[0].ticketFk },
|
||||||
table: JSON.stringify({ id: route.params.id }),
|
query: { table: JSON.stringify({ filter: { limit: 20, skip: 0 } }) },
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +263,8 @@ 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>
|
||||||
|
<template #right-panel>
|
||||||
<QCard
|
<QCard
|
||||||
class="order-lines-summary q-pa-lg"
|
class="order-lines-summary q-pa-lg"
|
||||||
v-if="orderSummary.vat && orderSummary.total"
|
v-if="orderSummary.vat && orderSummary.total"
|
||||||
|
@ -264,10 +277,13 @@ watch(
|
||||||
:value="toCurrency(orderSummary.total - orderSummary.vat)"
|
:value="toCurrency(orderSummary.total - orderSummary.vat)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('VAT') + ': '" :value="toCurrency(orderSummary?.vat)" />
|
<VnLv :label="t('VAT') + ': '" :value="toCurrency(orderSummary?.vat)" />
|
||||||
<VnLv :label="t('total') + ': '" :value="toCurrency(orderSummary?.total)" />
|
<VnLv
|
||||||
|
:label="t('total') + ': '"
|
||||||
|
:value="toCurrency(orderSummary?.total)"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
</Teleport>
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableLinesRef"
|
ref="tableLinesRef"
|
||||||
data-key="OrderLines"
|
data-key="OrderLines"
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<VnSearchbar
|
|
||||||
data-key="OrderList"
|
|
||||||
url="Orders/filter"
|
|
||||||
:label="t('Search order')"
|
|
||||||
:info="t('Search orders by ticket id')"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Search order: Buscar orden
|
|
||||||
Search orders by ticket id: Buscar pedido por id ticket
|
|
||||||
</i18n>
|
|
|
@ -8,15 +8,14 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
||||||
import OrderSearchbar from './Card/OrderSearchbar.vue';
|
|
||||||
import OrderFilter from './Card/OrderFilter.vue';
|
import OrderFilter from './Card/OrderFilter.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -24,6 +23,8 @@ const tableRef = ref();
|
||||||
const agencyList = ref([]);
|
const agencyList = ref([]);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const addressOptions = ref([]);
|
const addressOptions = ref([]);
|
||||||
|
const dataKey = 'OrderList';
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -178,18 +179,24 @@ const getDateColor = (date) => {
|
||||||
if (difference < 0) return 'bg-success';
|
if (difference < 0) return 'bg-success';
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<OrderSearchbar />
|
<VnSection
|
||||||
<RightMenu>
|
:data-key="dataKey"
|
||||||
<template #right-panel>
|
:columns="columns"
|
||||||
|
prefix="order"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Orders/filter',
|
||||||
|
order: ['landed DESC', 'clientFk ASC', 'id DESC'],
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #advanced-menu>
|
||||||
<OrderFilter data-key="OrderList" />
|
<OrderFilter data-key="OrderList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="OrderList"
|
:data-key="dataKey"
|
||||||
url="Orders/filter"
|
|
||||||
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Orders/new',
|
urlCreate: 'Orders/new',
|
||||||
title: t('module.cerateOrder'),
|
title: t('module.cerateOrder'),
|
||||||
|
@ -270,7 +277,8 @@ const getDateColor = (date) => {
|
||||||
: ''
|
: ''
|
||||||
} `
|
} `
|
||||||
}}
|
}}
|
||||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
{{ scope.opt?.nickname }}:
|
||||||
|
{{ scope.opt?.street }},
|
||||||
{{ scope.opt?.city }}
|
{{ scope.opt?.city }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -291,4 +299,6 @@ const getDateColor = (date) => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -21,3 +21,26 @@ lines:
|
||||||
image: Image
|
image: Image
|
||||||
params:
|
params:
|
||||||
tagGroups: Tags
|
tagGroups: Tags
|
||||||
|
order:
|
||||||
|
field:
|
||||||
|
salesPersonFk: Sales Person
|
||||||
|
form:
|
||||||
|
clientFk: Client
|
||||||
|
addressFk: Address
|
||||||
|
agencyModeFk: Agency
|
||||||
|
list:
|
||||||
|
newOrder: New Order
|
||||||
|
summary:
|
||||||
|
basket: Basket
|
||||||
|
notConfirmed: Not confirmed
|
||||||
|
created: Created
|
||||||
|
createdFrom: Created From
|
||||||
|
address: Address
|
||||||
|
total: Total
|
||||||
|
items: Items
|
||||||
|
orderTicketList: Order Ticket List
|
||||||
|
amount: Amount
|
||||||
|
confirm: Confirm
|
||||||
|
confirmLines: Confirm lines
|
||||||
|
search: Search orders
|
||||||
|
searchInfo: You can search orders by ticket id
|
||||||
|
|
|
@ -21,3 +21,29 @@ lines:
|
||||||
image: Imagen
|
image: Imagen
|
||||||
params:
|
params:
|
||||||
tagGroups: Tags
|
tagGroups: Tags
|
||||||
|
order:
|
||||||
|
field:
|
||||||
|
salesPersonFk: Comercial
|
||||||
|
form:
|
||||||
|
clientFk: Cliente
|
||||||
|
addressFk: Dirección
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
list:
|
||||||
|
newOrder: Nuevo Pedido
|
||||||
|
summary:
|
||||||
|
basket: Cesta
|
||||||
|
notConfirmed: No confirmada
|
||||||
|
created: Creado
|
||||||
|
createdFrom: Creado desde
|
||||||
|
address: Dirección
|
||||||
|
total: Total
|
||||||
|
vat: IVA
|
||||||
|
state: Estado
|
||||||
|
alias: Alias
|
||||||
|
items: Artículos
|
||||||
|
orderTicketList: Tickets del pedido
|
||||||
|
amount: Monto
|
||||||
|
confirm: Confirmar
|
||||||
|
confirmLines: Confirmar lineas
|
||||||
|
search: Buscar pedido
|
||||||
|
searchInfo: Buscar pedidos por el número de ticket
|
||||||
|
|
|
@ -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,7 +84,8 @@ async function getVideoList(expeditionId, timed) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
<QList bordered separator style="max-width: 318px">
|
<QList bordered separator style="max-width: 318px">
|
||||||
<QItem v-if="lastExpedition && videoList.length">
|
<QItem v-if="lastExpedition && videoList.length">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
|
@ -139,7 +138,9 @@ async function getVideoList(expeditionId, timed) {
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel caption>{{ t('globals.created') }}</QItemLabel>
|
<QItemLabel caption>{{ t('globals.created') }}</QItemLabel>
|
||||||
<QItemLabel>
|
<QItemLabel>
|
||||||
{{ date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss') }}
|
{{
|
||||||
|
date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
}}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption>{{ t('globals.item') }}</QItemLabel>
|
<QItemLabel caption>{{ t('globals.item') }}</QItemLabel>
|
||||||
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
|
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
|
||||||
|
@ -148,7 +149,8 @@ async function getVideoList(expeditionId, timed) {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
</Teleport>
|
</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,8 +173,14 @@ 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>
|
||||||
|
<QCard
|
||||||
|
class="q-pa-sm color-vn-text"
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
style="border-color: black"
|
||||||
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('basicData.total') }}
|
{{ t('basicData.total') }}
|
||||||
|
@ -198,7 +199,12 @@ onMounted(() => {
|
||||||
<span>{{ toCurrency(getTotal) }}</span>
|
<span>{{ toCurrency(getTotal) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
<QCard
|
||||||
|
class="q-pa-sm color-vn-text"
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
style="border-color: black"
|
||||||
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.components') }}
|
{{ t('ticketComponents.components') }}
|
||||||
|
@ -217,14 +223,21 @@ onMounted(() => {
|
||||||
}}</span>
|
}}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
<QCard
|
||||||
|
class="q-pa-sm color-vn-text"
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
style="border-color: black"
|
||||||
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.zoneBreakdown') }}
|
{{ t('ticketComponents.zoneBreakdown') }}
|
||||||
</span>
|
</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('basicData.price') }}: </span>
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('basicData.price') }}:
|
||||||
|
</span>
|
||||||
<span>{{ toCurrency(ticketData?.zonePrice, 'EUR', 2) }}</span>
|
<span>{{ toCurrency(ticketData?.zonePrice, 'EUR', 2) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
|
@ -234,14 +247,18 @@ onMounted(() => {
|
||||||
<span>{{ toCurrency(ticketData?.zoneBonus, 'EUR', 2) }}</span>
|
<span>{{ toCurrency(ticketData?.zoneBonus, 'EUR', 2) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('ticketList.zone') }}: </span>
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketList.zone') }}:
|
||||||
|
</span>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ dashIfEmpty(ticketData?.zone?.name) }}
|
{{ dashIfEmpty(ticketData?.zone?.name) }}
|
||||||
<ZoneDescriptorProxy :id="ticketData?.zone?.id" />
|
<ZoneDescriptorProxy :id="ticketData?.zone?.id" />
|
||||||
</span>
|
</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection v-if="ticketData?.zone?.isVolumetric" horizontal>
|
<QCardSection v-if="ticketData?.zone?.isVolumetric" horizontal>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('volume.volume') }}: </span>
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('volume.volume') }}:
|
||||||
|
</span>
|
||||||
<span>{{ ticketVolume }}</span>
|
<span>{{ ticketVolume }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
|
@ -251,7 +268,12 @@ onMounted(() => {
|
||||||
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
|
<QCard
|
||||||
|
class="q-pa-sm color-vn-text"
|
||||||
|
bordered
|
||||||
|
flat
|
||||||
|
style="border-color: black"
|
||||||
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
<span class="text-weight-bold text-subtitle1 text-center full-width">
|
||||||
{{ t('ticketComponents.theoricalCost') }}
|
{{ t('ticketComponents.theoricalCost') }}
|
||||||
|
@ -264,7 +286,8 @@ onMounted(() => {
|
||||||
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
</Teleport>
|
</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,7 +618,8 @@ watch(
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
<div
|
<div
|
||||||
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
||||||
style="border: 2px solid black"
|
style="border: 2px solid black"
|
||||||
|
@ -634,17 +631,25 @@ watch(
|
||||||
<span>{{ toCurrency(store.data?.totalWithoutVat) }}</span>
|
<span>{{ toCurrency(store.data?.totalWithoutVat) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="justify-end text-subtitle1" horizontal>
|
<QCardSection class="justify-end text-subtitle1" horizontal>
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('ticketSale.tax') }}: </span>
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('ticketSale.tax') }}:
|
||||||
|
</span>
|
||||||
<span>{{
|
<span>{{
|
||||||
toCurrency(store.data?.totalWithVat - store.data?.totalWithoutVat)
|
toCurrency(store.data?.totalWithVat - store.data?.totalWithoutVat)
|
||||||
}}</span>
|
}}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="justify-end text-weight-bold text-subtitle1" horizontal>
|
<QCardSection
|
||||||
<span class="q-mr-xs color-vn-label"> {{ t('basicData.total') }}: </span>
|
class="justify-end text-weight-bold text-subtitle1"
|
||||||
|
horizontal
|
||||||
|
>
|
||||||
|
<span class="q-mr-xs color-vn-label">
|
||||||
|
{{ t('basicData.total') }}:
|
||||||
|
</span>
|
||||||
<span>{{ toCurrency(store.data?.totalWithVat) }}</span>
|
<span>{{ toCurrency(store.data?.totalWithVat) }}</span>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</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
|
||||||
|
|
|
@ -259,10 +259,9 @@ const moveTicketsAdvance = async () => {
|
||||||
destinationId: ticket.id,
|
destinationId: ticket.id,
|
||||||
originShipped: ticket.futureShipped,
|
originShipped: ticket.futureShipped,
|
||||||
destinationShipped: ticket.shipped,
|
destinationShipped: ticket.shipped,
|
||||||
workerFk: ticket.workerFk,
|
salesPersonFk: ticket.workerFk,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = { tickets: ticketsToMove };
|
const params = { tickets: ticketsToMove };
|
||||||
await axios.post('Tickets/merge', params);
|
await axios.post('Tickets/merge', params);
|
||||||
vnTableRef.value.reload();
|
vnTableRef.value.reload();
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -244,13 +244,15 @@ const totalPriceColor = (totalWithVat) =>
|
||||||
isLessThan50(totalWithVat) ? 'warning' : 'transparent';
|
isLessThan50(totalWithVat) ? 'warning' : 'transparent';
|
||||||
|
|
||||||
const moveTicketsFuture = async () => {
|
const moveTicketsFuture = async () => {
|
||||||
const ticketsToMove = selectedTickets.value.map((ticket) => ({
|
const ticketsToMove = selectedTickets.value.map((ticket) => {
|
||||||
|
return {
|
||||||
originId: ticket.id,
|
originId: ticket.id,
|
||||||
destinationId: ticket.futureId,
|
destinationId: ticket.futureId,
|
||||||
originShipped: ticket.shipped,
|
originShipped: ticket.shipped,
|
||||||
destinationShipped: ticket.futureShipped,
|
destinationShipped: ticket.futureShipped,
|
||||||
workerFk: ticket.workerFk,
|
salesPersonFk: ticket.salesPersonFk,
|
||||||
}));
|
};
|
||||||
|
});
|
||||||
|
|
||||||
let params = { tickets: ticketsToMove };
|
let params = { tickets: ticketsToMove };
|
||||||
await axios.post('Tickets/merge', params);
|
await axios.post('Tickets/merge', params);
|
||||||
|
|
|
@ -439,7 +439,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'),
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue