7118_testToMaster_2412 #249
|
@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2414.01] - 2024-04-04
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
## [2400.01] - 2024-01-04
|
## [2400.01] - 2024-01-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
FROM node:stretch-slim
|
FROM node:stretch-slim
|
||||||
RUN npm install -g @quasar/cli
|
RUN corepack enable pnpm
|
||||||
|
RUN pnpm install -g @quasar/cli
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY dist/spa ./
|
COPY dist/spa ./
|
||||||
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]
|
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]
|
||||||
|
|
|
@ -62,7 +62,7 @@ pipeline {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ""
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'npm install --prefer-offline'
|
sh 'pnpm install --prefer-offline'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
|
@ -73,7 +73,7 @@ pipeline {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ""
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'npm run test:unit:ci'
|
sh 'pnpm run test:unit:ci'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|
19
package.json
19
package.json
|
@ -1,10 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.10.0",
|
"version": "24.14.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"packageManager": "pnpm@8.15.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint --ext .js,.vue ./",
|
"lint": "eslint --ext .js,.vue ./",
|
||||||
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
||||||
|
@ -16,12 +17,12 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@quasar/cli": "^2.3.0",
|
"@quasar/cli": "^2.3.0",
|
||||||
"@quasar/extras": "^1.16.4",
|
"@quasar/extras": "^1.16.9",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"chromium": "^3.0.3",
|
"chromium": "^3.0.3",
|
||||||
"croppie": "^2.6.5",
|
"croppie": "^2.6.5",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"quasar": "^2.12.0",
|
"quasar": "^2.14.5",
|
||||||
"validator": "^13.9.0",
|
"validator": "^13.9.0",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.2.2",
|
||||||
|
@ -30,11 +31,11 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@intlify/unplugin-vue-i18n": "^0.8.1",
|
"@intlify/unplugin-vue-i18n": "^0.8.1",
|
||||||
"@pinia/testing": "^0.1.2",
|
"@pinia/testing": "^0.1.2",
|
||||||
"@quasar/app-vite": "^1.4.3",
|
"@quasar/app-vite": "^1.7.3",
|
||||||
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.3.0",
|
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
||||||
"@vue/test-utils": "^2.3.2",
|
"@vue/test-utils": "^2.4.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"cypress": "^12.13.0",
|
"cypress": "^13.6.6",
|
||||||
"eslint": "^8.41.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-cypress": "^2.13.3",
|
"eslint-plugin-cypress": "^2.13.3",
|
||||||
|
@ -50,8 +51,8 @@
|
||||||
"bun": ">= 1.0.25"
|
"bun": ">= 1.0.25"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"vite": "^4.3.5",
|
"vite": "^5.1.4",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
758
pnpm-lock.yaml
758
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -67,7 +67,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
// analyze: true,
|
// analyze: true,
|
||||||
// env: {},
|
// env: {},
|
||||||
rawDefine: {
|
rawDefine: {
|
||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||||
},
|
},
|
||||||
// ignorePublicFolder: true,
|
// ignorePublicFolder: true,
|
||||||
// minify: false,
|
// minify: false,
|
||||||
|
@ -92,7 +92,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
vitePlugins: [
|
vitePlugins: [
|
||||||
[
|
[
|
||||||
VueI18nPlugin({
|
VueI18nPlugin({
|
||||||
runtimeOnly: false
|
runtimeOnly: false,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
||||||
|
@ -123,9 +123,6 @@ module.exports = configure(function (/* ctx */) {
|
||||||
framework: {
|
framework: {
|
||||||
config: {
|
config: {
|
||||||
config: {
|
config: {
|
||||||
brand: {
|
|
||||||
primary: 'orange',
|
|
||||||
},
|
|
||||||
dark: 'auto',
|
dark: 'auto',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
@ -16,9 +16,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved']);
|
const emit = defineEmits(['onDataSaved']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const bicInputRef = ref(null);
|
||||||
const bankEntityFormData = reactive({
|
const bankEntityFormData = reactive({
|
||||||
name: null,
|
name: null,
|
||||||
bic: null,
|
bic: null,
|
||||||
|
@ -32,9 +31,14 @@ const countriesFilter = {
|
||||||
|
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
|
|
||||||
const onDataSaved = (data) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
emit('onDataSaved', data);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await nextTick();
|
||||||
|
bicInputRef.value.focus();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -50,7 +54,7 @@ const onDataSaved = (data) => {
|
||||||
:title="t('title')"
|
:title="t('title')"
|
||||||
:subtitle="t('subtitle')"
|
:subtitle="t('subtitle')"
|
||||||
:form-initial-data="bankEntityFormData"
|
:form-initial-data="bankEntityFormData"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
@ -64,6 +68,7 @@ const onDataSaved = (data) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
ref="bicInputRef"
|
||||||
:label="t('swift')"
|
:label="t('swift')"
|
||||||
v-model="data.bic"
|
v-model="data.bic"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
|
|
@ -71,13 +71,9 @@ const closeForm = () => {
|
||||||
<span ref="closeButton" class="close-icon" v-close-popup>
|
<span ref="closeButton" class="close-icon" v-close-popup>
|
||||||
<QIcon name="close" size="sm" />
|
<QIcon name="close" size="sm" />
|
||||||
</span>
|
</span>
|
||||||
<h1 class="title">
|
<span class="title">{{ t('Edit') }}</span>
|
||||||
{{
|
<span class="countLines">{{ ` ${rows.length} ` }}</span>
|
||||||
t('editBuyTitle', {
|
<span class="title">{{ t('buy(s)') }}</span>
|
||||||
buysAmount: rows.length,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</h1>
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
|
@ -94,23 +90,23 @@ const closeForm = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<div class="q-mt-lg row justify-end">
|
<div class="q-mt-lg row justify-end">
|
||||||
<QBtn
|
|
||||||
:label="t('globals.save')"
|
|
||||||
type="submit"
|
|
||||||
color="primary"
|
|
||||||
:disabled="isLoading"
|
|
||||||
:loading="isLoading"
|
|
||||||
/>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.cancel')"
|
:label="t('globals.cancel')"
|
||||||
type="reset"
|
type="reset"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
class="q-ml-sm"
|
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
/>
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="t('globals.save')"
|
||||||
|
type="submit"
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-sm"
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
</QForm>
|
</QForm>
|
||||||
|
@ -129,13 +125,18 @@ const closeForm = () => {
|
||||||
right: 20px;
|
right: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.countLines {
|
||||||
|
font-size: 24px;
|
||||||
|
color: $primary;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
|
||||||
editBuyTitle: Edit {buysAmount} buy(s)
|
|
||||||
es:
|
es:
|
||||||
editBuyTitle: Editar {buysAmount} compra(s)
|
Edit: Editar
|
||||||
|
buy(s): compra(s)
|
||||||
Field to edit: Campo a editar
|
Field to edit: Campo a editar
|
||||||
Value: Valor
|
Value: Valor
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { useValidator } from 'src/composables/useValidator';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
||||||
import VnConfirm from './ui/VnConfirm.vue';
|
import VnConfirm from './ui/VnConfirm.vue';
|
||||||
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -43,6 +44,10 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
defaultButtons: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
autoLoad: {
|
autoLoad: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
@ -61,6 +66,10 @@ const $props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
clearStoreOnUnmount: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
saveFn: {
|
saveFn: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -109,7 +118,12 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
state.unset($props.model);
|
// Restauramos los datos originales en el store si se realizaron cambios en el formulario pero no se guardaron, evitando modificaciones erróneas.
|
||||||
|
if (hasChanges.value) {
|
||||||
|
state.set($props.model, originalData.value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($props.clearStoreOnUnmount) state.unset($props.model);
|
||||||
});
|
});
|
||||||
|
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
@ -119,7 +133,19 @@ const hasChanges = ref(!$props.observeFormChanges);
|
||||||
const originalData = ref({ ...$props.formInitialData });
|
const originalData = ref({ ...$props.formInitialData });
|
||||||
const formData = computed(() => state.get($props.model));
|
const formData = computed(() => state.get($props.model));
|
||||||
const formUrl = computed(() => $props.url);
|
const formUrl = computed(() => $props.url);
|
||||||
|
const defaultButtons = computed(() => ({
|
||||||
|
save: {
|
||||||
|
color: 'primary',
|
||||||
|
icon: 'restart_alt',
|
||||||
|
label: 'globals.save',
|
||||||
|
},
|
||||||
|
reset: {
|
||||||
|
color: 'primary',
|
||||||
|
icon: 'save',
|
||||||
|
label: 'globals.reset',
|
||||||
|
},
|
||||||
|
...$props.defaultButtons,
|
||||||
|
}));
|
||||||
const startFormWatcher = () => {
|
const startFormWatcher = () => {
|
||||||
watch(
|
watch(
|
||||||
() => formData.value,
|
() => formData.value,
|
||||||
|
@ -131,10 +157,6 @@ const startFormWatcher = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function tMobile(...args) {
|
|
||||||
if (!quasar.platform.is.mobile) return t(...args);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
const { data } = await axios.get($props.url, {
|
const { data } = await axios.get($props.url, {
|
||||||
params: { filter: JSON.stringify($props.filter) },
|
params: { filter: JSON.stringify($props.filter) },
|
||||||
|
@ -233,21 +255,21 @@ watch(formUrl, async () => {
|
||||||
<QBtnGroup push class="q-gutter-x-sm">
|
<QBtnGroup push class="q-gutter-x-sm">
|
||||||
<slot name="moreActions" />
|
<slot name="moreActions" />
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="tMobile('globals.reset')"
|
:label="tMobile(defaultButtons.reset.label)"
|
||||||
color="primary"
|
:color="defaultButtons.reset.color"
|
||||||
icon="restart_alt"
|
:icon="defaultButtons.reset.icon"
|
||||||
flat
|
flat
|
||||||
@click="reset"
|
@click="reset"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
:title="t('globals.reset')"
|
:title="t(defaultButtons.reset.label)"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="tMobile('globals.save')"
|
:label="tMobile(defaultButtons.save.label)"
|
||||||
color="primary"
|
:color="defaultButtons.save.color"
|
||||||
icon="save"
|
:icon="defaultButtons.save.icon"
|
||||||
@click="save"
|
@click="save"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
:title="t('globals.save')"
|
:title="t(defaultButtons.save.label)"
|
||||||
/>
|
/>
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -42,8 +42,8 @@ const { t } = useI18n();
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
const onDataSaved = (dataSaved) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
emit('onDataSaved', dataSaved);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
closeForm();
|
closeForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ const closeForm = () => {
|
||||||
:default-actions="false"
|
:default-actions="false"
|
||||||
:url-create="urlCreate"
|
:url-create="urlCreate"
|
||||||
:model="model"
|
:model="model"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<span ref="closeButton" class="close-icon" v-close-popup>
|
<span ref="closeButton" class="close-icon" v-close-popup>
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: { type: String, default: '' },
|
||||||
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
const amount = computed({
|
||||||
|
get() {
|
||||||
|
return props.modelValue;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
emit('update:modelValue', val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnInput
|
||||||
|
v-model="amount"
|
||||||
|
type="number"
|
||||||
|
step="any"
|
||||||
|
:label="useCapitalize(t('amount'))"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
amount: importe
|
||||||
|
</i18n>
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
|
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
|
||||||
|
@ -17,7 +17,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||||
|
const vnInputRef = ref(null);
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
return $props.modelValue;
|
return $props.modelValue;
|
||||||
|
@ -40,6 +40,14 @@ const styleAttrs = computed(() => {
|
||||||
const onEnterPress = () => {
|
const onEnterPress = () => {
|
||||||
emit('keyup.enter');
|
emit('keyup.enter');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const focus = () => {
|
||||||
|
vnInputRef.value.focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
focus,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { toDate } from 'src/filters';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import isValidDate from "filters/isValidDate";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -17,12 +18,25 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
const joinDateAndTime = (date, time) => {
|
||||||
|
if (!date) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!time) {
|
||||||
|
return new Date(date).toISOString();
|
||||||
|
}
|
||||||
|
const [year, month, day] = date.split('/');
|
||||||
|
return new Date(`${year}-${month}-${day}T${time}`).toISOString();
|
||||||
|
};
|
||||||
|
|
||||||
|
const time = computed(() => (props.modelValue ? props.modelValue.split('T')?.[1] : null));
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue;
|
return props.modelValue;
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
emit('update:modelValue', value ? new Date(value).toISOString() : null);
|
emit('update:modelValue', joinDateAndTime(value, time.value));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -40,6 +54,16 @@ const formatDate = (dateString) => {
|
||||||
date.getDate()
|
date.getDate()
|
||||||
)}`;
|
)}`;
|
||||||
};
|
};
|
||||||
|
const displayDate = (dateString) => {
|
||||||
|
if (!dateString || !isValidDate(dateString)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return new Date(dateString).toLocaleDateString([], {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const styleAttrs = computed(() => {
|
const styleAttrs = computed(() => {
|
||||||
return props.isOutlined
|
return props.isOutlined
|
||||||
|
@ -53,12 +77,12 @@ const styleAttrs = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QInput
|
<VnInput
|
||||||
class="vn-input-date"
|
class="vn-input-date"
|
||||||
rounded
|
:model-value="displayDate(value)"
|
||||||
readonly
|
|
||||||
:model-value="toDate(value)"
|
|
||||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||||
|
readonly
|
||||||
|
@click="isPopupOpen = true"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="event" class="cursor-pointer">
|
<QIcon name="event" class="cursor-pointer">
|
||||||
|
@ -76,7 +100,7 @@ const styleAttrs = computed(() => {
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
</QInput>
|
</VnInput>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { toHour } from 'src/filters';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import isValidDate from 'filters/isValidDate';
|
import isValidDate from 'filters/isValidDate';
|
||||||
|
import VnInput from "components/common/VnInput.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -26,8 +26,8 @@ const value = computed({
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
const [hours, minutes] = value.split(':');
|
const [hours, minutes] = value.split(':');
|
||||||
const date = new Date();
|
const date = new Date(props.modelValue);
|
||||||
date.setUTCHours(
|
date.setHours(
|
||||||
Number.parseInt(hours) || 0,
|
Number.parseInt(hours) || 0,
|
||||||
Number.parseInt(minutes) || 0,
|
Number.parseInt(minutes) || 0,
|
||||||
0,
|
0,
|
||||||
|
@ -37,6 +37,7 @@ const value = computed({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isPopupOpen = ref(false);
|
||||||
const onDateUpdate = (date) => {
|
const onDateUpdate = (date) => {
|
||||||
internalValue.value = date;
|
internalValue.value = date;
|
||||||
};
|
};
|
||||||
|
@ -45,7 +46,7 @@ const save = () => {
|
||||||
value.value = internalValue.value;
|
value.value = internalValue.value;
|
||||||
};
|
};
|
||||||
const formatTime = (dateString) => {
|
const formatTime = (dateString) => {
|
||||||
if (!isValidDate(dateString)) {
|
if (!dateString || !isValidDate(dateString)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,16 +71,17 @@ const styleAttrs = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QInput
|
<VnInput
|
||||||
class="vn-input-time"
|
class="vn-input-time"
|
||||||
rounded
|
|
||||||
readonly
|
readonly
|
||||||
:model-value="toHour(value)"
|
:model-value="formatTime(value)"
|
||||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||||
|
@click="isPopupOpen = true"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="event" class="cursor-pointer">
|
<QIcon name="event" class="cursor-pointer">
|
||||||
<QPopupProxy
|
<QPopupProxy
|
||||||
|
v-model="isPopupOpen"
|
||||||
cover
|
cover
|
||||||
transition-show="scale"
|
transition-show="scale"
|
||||||
transition-hide="scale"
|
transition-hide="scale"
|
||||||
|
@ -109,7 +111,7 @@ const styleAttrs = computed(() => {
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
</QInput>
|
</VnInput>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -1036,7 +1036,6 @@ en:
|
||||||
claimStateFk: Claim State
|
claimStateFk: Claim State
|
||||||
workerFk: Worker
|
workerFk: Worker
|
||||||
clientFk: Customer
|
clientFk: Customer
|
||||||
rma: RMA
|
|
||||||
responsibility: Responsibility
|
responsibility: Responsibility
|
||||||
packages: Packages
|
packages: Packages
|
||||||
es:
|
es:
|
||||||
|
@ -1046,7 +1045,7 @@ es:
|
||||||
tooltips:
|
tooltips:
|
||||||
search: Buscar por identificador o concepto
|
search: Buscar por identificador o concepto
|
||||||
changes: Buscar por cambios. Los atributos deben buscarse por su nombre interno, para obtenerlo situar el cursor sobre el atributo.
|
changes: Buscar por cambios. Los atributos deben buscarse por su nombre interno, para obtenerlo situar el cursor sobre el atributo.
|
||||||
Audit logs: Registros de auditoría
|
Audit logs: Historial
|
||||||
Property: Propiedad
|
Property: Propiedad
|
||||||
Before: Antes
|
Before: Antes
|
||||||
After: Después
|
After: Después
|
||||||
|
@ -1076,7 +1075,6 @@ es:
|
||||||
claimStateFk: Estado de la reclamación
|
claimStateFk: Estado de la reclamación
|
||||||
workerFk: Trabajador
|
workerFk: Trabajador
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
rma: RMA
|
|
||||||
responsibility: Responsabilidad
|
responsibility: Responsabilidad
|
||||||
packages: Bultos
|
packages: Bultos
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -59,6 +59,9 @@ const toggleForm = () => {
|
||||||
:name="actionIcon"
|
:name="actionIcon"
|
||||||
:size="actionIcon === 'add' ? 'xs' : 'sm'"
|
:size="actionIcon === 'add' ? 'xs' : 'sm'"
|
||||||
:class="['default-icon', { '--add-icon': actionIcon === 'add' }]"
|
:class="['default-icon', { '--add-icon': actionIcon === 'add' }]"
|
||||||
|
:style="{
|
||||||
|
'font-variation-settings': `'FILL' ${1}`,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
|
<QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -35,6 +36,8 @@ const $props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const state = useState();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -64,6 +67,7 @@ async function getData() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
state.set($props.dataKey, data);
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
|
@ -171,6 +175,7 @@ const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.body {
|
.body {
|
||||||
|
background-color: var(--vn-gray);
|
||||||
.text-h5 {
|
.text-h5 {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
|
@ -188,7 +193,8 @@ const emit = defineEmits(['onFetch']);
|
||||||
.label {
|
.label {
|
||||||
color: var(--vn-label);
|
color: var(--vn-label);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
::after {
|
|
||||||
|
&:not(:has(a))::after {
|
||||||
content: ':';
|
content: ':';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,8 +229,6 @@ const emit = defineEmits(['onFetch']);
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
.list-box {
|
.list-box {
|
||||||
background-color: var(--vn-gray);
|
|
||||||
|
|
||||||
.q-item__label {
|
.q-item__label {
|
||||||
color: var(--vn-label);
|
color: var(--vn-label);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
onMounted(() => fetch());
|
|
||||||
|
|
||||||
const entity = ref();
|
const entity = ref();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -16,14 +15,25 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
entityId: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
const route = useRoute();
|
||||||
|
const isSummary = ref();
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
entity,
|
entity,
|
||||||
fetch,
|
fetch,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
isSummary.value = String(route.path).endsWith('/summary');
|
||||||
|
fetch();
|
||||||
|
});
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
const params = {};
|
const params = {};
|
||||||
|
|
||||||
|
@ -46,9 +56,19 @@ watch(props, async () => {
|
||||||
<QCard class="cardSummary">
|
<QCard class="cardSummary">
|
||||||
<SkeletonSummary v-if="!entity" />
|
<SkeletonSummary v-if="!entity" />
|
||||||
<template v-if="entity">
|
<template v-if="entity">
|
||||||
<div class="summaryHeader bg-primary q-pa-md text-weight-bolder">
|
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
|
||||||
<slot name="header-left">
|
<slot name="header-left">
|
||||||
<span></span>
|
<router-link
|
||||||
|
v-if="!isSummary && route.meta.moduleName"
|
||||||
|
class="header link"
|
||||||
|
:to="{
|
||||||
|
name: `${route.meta.moduleName}Summary`,
|
||||||
|
params: { id: entityId || entity.id },
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
|
</router-link>
|
||||||
|
<span v-else></span>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="header" :entity="entity">
|
<slot name="header" :entity="entity">
|
||||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
||||||
|
@ -85,8 +105,8 @@ watch(props, async () => {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
padding: 15px;
|
padding: 10px;
|
||||||
background-color: var(--vn-gray);
|
background-color: var(--vn-gray);
|
||||||
|
|
||||||
> .q-card.vn-one {
|
> .q-card.vn-one {
|
||||||
|
@ -105,14 +125,14 @@ watch(props, async () => {
|
||||||
> .q-card {
|
> .q-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: var(--vn-gray);
|
background-color: var(--vn-gray);
|
||||||
padding: 15px;
|
padding: 7px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
min-width: 275px;
|
min-width: 275px;
|
||||||
|
|
||||||
.vn-label-value {
|
.vn-label-value {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
margin-top: 5px;
|
margin-top: 2px;
|
||||||
.label {
|
.label {
|
||||||
color: var(--vn-label);
|
color: var(--vn-label);
|
||||||
width: 8em;
|
width: 8em;
|
||||||
|
@ -131,13 +151,26 @@ watch(props, async () => {
|
||||||
.header {
|
.header {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 25px;
|
margin-bottom: 10px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.header.link:hover {
|
.header.link:hover {
|
||||||
color: lighten($primary, 20%);
|
color: lighten($primary, 20%);
|
||||||
}
|
}
|
||||||
|
.q-checkbox {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 9px;
|
||||||
|
& .q-checkbox__label {
|
||||||
|
margin-left: 31px;
|
||||||
|
color: var(--vn-text);
|
||||||
|
}
|
||||||
|
& .q-checkbox__inner {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
color: var(--vn-label);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,49 @@ defineProps({
|
||||||
<template>
|
<template>
|
||||||
<div class="fetchedTags">
|
<div class="fetchedTags">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value5 }">{{ $props.item.value5 }}</div>
|
<div
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value6 }">{{ $props.item.value6 }}</div>
|
class="inline-tag"
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value7 }">{{ $props.item.value7 }}</div>
|
:class="{ empty: !$props.item.value5 }"
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value8 }">{{ $props.item.value8 }}</div>
|
:title="$props.item.tag5 + ': ' + $props.item.value5"
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value9 }">{{ $props.item.value9 }}</div>
|
>
|
||||||
<div class="inline-tag" :class="{ empty: !$props.item.value10 }">{{ $props.item.value10 }}</div>
|
{{ $props.item.value5 }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="inline-tag"
|
||||||
|
:class="{ empty: !$props.item.tag6 }"
|
||||||
|
:title="$props.item.tag6 + ': ' + $props.item.value6"
|
||||||
|
>
|
||||||
|
{{ $props.item.value6 }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="inline-tag"
|
||||||
|
:class="{ empty: !$props.item.value7 }"
|
||||||
|
:title="$props.item.tag7 + ': ' + $props.item.value7"
|
||||||
|
>
|
||||||
|
{{ $props.item.value7 }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="inline-tag"
|
||||||
|
:class="{ empty: !$props.item.value8 }"
|
||||||
|
:title="$props.item.tag8 + ': ' + $props.item.value8"
|
||||||
|
>
|
||||||
|
{{ $props.item.value8 }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="inline-tag"
|
||||||
|
:class="{ empty: !$props.item.value9 }"
|
||||||
|
:title="$props.item.tag9 + ': ' + $props.item.value9"
|
||||||
|
>
|
||||||
|
{{ $props.item.value9 }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="inline-tag"
|
||||||
|
:class="{ empty: !$props.item.value10 }"
|
||||||
|
:title="$props.item.tag10 + ': ' + $props.item.value10"
|
||||||
|
>
|
||||||
|
{{ $props.item.value10 }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useClipboard } from 'src/composables/useClipboard';
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
|
@ -16,7 +15,6 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const isBooleanValue = computed(() => typeof $props.value === 'boolean');
|
|
||||||
const { copyText } = useClipboard();
|
const { copyText } = useClipboard();
|
||||||
|
|
||||||
function copyValueText() {
|
function copyValueText() {
|
||||||
|
@ -42,14 +40,7 @@ function copyValueText() {
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<span v-if="isBooleanValue">
|
<slot name="value">
|
||||||
<QIcon
|
|
||||||
:name="$props.value ? `check` : `close`"
|
|
||||||
:color="$props.value ? `positive` : `negative`"
|
|
||||||
size="sm"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<slot v-else name="value">
|
|
||||||
<span :title="$props.value">
|
<span :title="$props.value">
|
||||||
{{ $props.dash ? dashIfEmpty($props.value) : $props.value }}
|
{{ $props.dash ? dashIfEmpty($props.value) : $props.value }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -8,7 +8,6 @@ import VnPaginate from './VnPaginate.vue';
|
||||||
import VnUserLink from '../ui/VnUserLink.vue';
|
import VnUserLink from '../ui/VnUserLink.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: { type: String, required: true },
|
|
||||||
url: { type: String, default: null },
|
url: { type: String, default: null },
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
body: { type: Object, default: () => {} },
|
body: { type: Object, default: () => {} },
|
||||||
|
@ -28,7 +27,7 @@ async function insert() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="column items-center full-height">
|
<div class="column items-center full-height full-width">
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
:data-key="$props.url"
|
:data-key="$props.url"
|
||||||
:url="$props.url"
|
:url="$props.url"
|
||||||
|
@ -39,12 +38,21 @@ async function insert() {
|
||||||
ref="vnPaginateRef"
|
ref="vnPaginateRef"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pa-xs q-mb-md" v-for="(note, index) in rows" :key="index">
|
<div class="column items-center full-width">
|
||||||
|
<QCard
|
||||||
|
class="q-pa-xs q-mb-sm full-width"
|
||||||
|
v-for="(note, index) in rows"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<QCardSection horizontal>
|
<QCardSection horizontal>
|
||||||
<slot name="picture">
|
<slot name="picture">
|
||||||
<VnAvatar :descriptor="false" :worker-id="note.workerFk" />
|
<VnAvatar
|
||||||
|
:descriptor="false"
|
||||||
|
:worker-id="note.workerFk"
|
||||||
|
size="md"
|
||||||
|
/>
|
||||||
</slot>
|
</slot>
|
||||||
<QItem class="full-width justify-between items-start">
|
<div class="full-width row justify-between q-pa-xs">
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="`${note.worker.user.nickname}`"
|
:name="`${note.worker.user.nickname}`"
|
||||||
:worker-id="note.worker.id"
|
:worker-id="note.worker.id"
|
||||||
|
@ -53,14 +61,15 @@ async function insert() {
|
||||||
<slot name="actions">
|
<slot name="actions">
|
||||||
{{ toDateHour(note.created) }}
|
{{ toDateHour(note.created) }}
|
||||||
</slot>
|
</slot>
|
||||||
</QItem>
|
</div>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-pa-sm">
|
<QCardSection class="q-pa-xs q-my-none q-py-none">
|
||||||
<slot name="text">
|
<slot name="text">
|
||||||
{{ note.text }}
|
{{ note.text }}
|
||||||
</slot>
|
</slot>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]" v-if="addNote">
|
<QPageSticky position="bottom-right" :offset="[25, 25]" v-if="addNote">
|
||||||
|
@ -108,8 +117,10 @@ async function insert() {
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.q-card {
|
.q-card {
|
||||||
max-width: 80em;
|
width: 90%;
|
||||||
|
@media (max-width: $breakpoint-sm) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
&__section {
|
&__section {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ async function onLoad(...params) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="full-width">
|
||||||
<div
|
<div
|
||||||
v-if="!props.autoLoad && !store.data && !isLoading"
|
v-if="!props.autoLoad && !store.data && !isLoading"
|
||||||
class="info-row q-pa-md text-center"
|
class="info-row q-pa-md text-center"
|
||||||
|
@ -175,6 +175,7 @@ async function onLoad(...params) {
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
class="full-width full-height"
|
class="full-width full-height"
|
||||||
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<slot name="body" :rows="store.data"></slot>
|
<slot name="body" :rows="store.data"></slot>
|
||||||
<div v-if="isLoading" class="info-row q-pa-md text-center">
|
<div v-if="isLoading" class="info-row q-pa-md text-center">
|
||||||
|
|
|
@ -81,8 +81,9 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
const staticParams = Object.entries(store.userParams)
|
const staticParams = Object.entries(store.userParams).filter(
|
||||||
.filter(([key, value]) => value && (props.staticParams || []).includes(key));
|
([key, value]) => value && (props.staticParams || []).includes(key)
|
||||||
|
);
|
||||||
await arrayData.applyFilter({
|
await arrayData.applyFilter({
|
||||||
params: {
|
params: {
|
||||||
...Object.fromEntries(staticParams),
|
...Object.fromEntries(staticParams),
|
||||||
|
@ -117,7 +118,12 @@ async function search() {
|
||||||
autofocus
|
autofocus
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon name="search" v-if="!quasar.platform.is.mobile" />
|
<QIcon
|
||||||
|
v-if="!quasar.platform.is.mobile"
|
||||||
|
class="cursor-pointer"
|
||||||
|
name="search"
|
||||||
|
@click="search"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
@ -155,11 +161,9 @@ async function search() {
|
||||||
.cursor-info {
|
.cursor-info {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
#searchbar {
|
||||||
.body--light #searchbar {
|
|
||||||
.q-field--standout.q-field--highlighted .q-field__control {
|
.q-field--standout.q-field--highlighted .q-field__control {
|
||||||
background-color: $grey-7;
|
background-color: var(--vn-text);
|
||||||
color: #333;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
|
export default function() {
|
||||||
|
const quasar = useQuasar();
|
||||||
|
return quasar.screen.gt.xs ? 'q-pa-md': 'q-pa-xs';
|
||||||
|
|
||||||
|
}
|
|
@ -1,17 +1,59 @@
|
||||||
// app global css in SCSS form
|
// app global css in SCSS form
|
||||||
@import './icons.scss';
|
@import './icons.scss';
|
||||||
|
|
||||||
|
body.body--light {
|
||||||
|
--fount-color: black;
|
||||||
|
--vn-sectionColor: #ffffff;
|
||||||
|
--vn-pageColor: #e0e0e0;
|
||||||
|
background-color: var(--vn-pageColor);
|
||||||
|
.q-header .q-toolbar {
|
||||||
|
color: var(--fount-color);
|
||||||
|
}
|
||||||
|
--vn-text: var(--fount-color);
|
||||||
|
--vn-gray: var(--vn-sectionColor);
|
||||||
|
--vn-label: #5f5f5f;
|
||||||
|
--vn-dark: var(--vn-sectionColor);
|
||||||
|
--vn-light-gray: #e7e3e3;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.body--dark {
|
||||||
|
--vn-pageColor: #222;
|
||||||
|
--vn-SectionColor: #3c3b3b;
|
||||||
|
background-color: var(--vn-pageColor);
|
||||||
|
--vn-text: white;
|
||||||
|
--vn-gray: var(--vn-SectionColor);
|
||||||
|
--vn-label: #a8a8a8;
|
||||||
|
--vn-dark: var(--vn-SectionColor);
|
||||||
|
--vn-light-gray: #424242;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: $primary;
|
color: $color-link;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tx-color-link {
|
||||||
|
color: $color-link !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-link {
|
||||||
|
color: $color-link !important;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: solid $primary;
|
||||||
|
border-width: 2px;
|
||||||
|
width: 100%;
|
||||||
|
.q-icon {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
.link:hover {
|
.link:hover {
|
||||||
color: $orange-4;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes chrome autofill background
|
// Removes chrome autofill background
|
||||||
|
@ -24,26 +66,6 @@ select:-webkit-autofill {
|
||||||
background-clip: text !important;
|
background-clip: text !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.body--light {
|
|
||||||
.q-header .q-toolbar {
|
|
||||||
background-color: $white;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
--vn-text: #000000;
|
|
||||||
--vn-gray: #f5f5f5;
|
|
||||||
--vn-label: #5f5f5f;
|
|
||||||
--vn-dark: white;
|
|
||||||
--vn-light-gray: #e7e3e3;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.body--dark {
|
|
||||||
--vn-text: #ffffff;
|
|
||||||
--vn-gray: #313131;
|
|
||||||
--vn-label: #a8a8a8;
|
|
||||||
--vn-dark: #292929;
|
|
||||||
--vn-light-gray: #424242;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-vn-dark {
|
.bg-vn-dark {
|
||||||
background-color: var(--vn-dark);
|
background-color: var(--vn-dark);
|
||||||
}
|
}
|
||||||
|
@ -75,6 +97,11 @@ body.body--dark {
|
||||||
background-color: var(--vn-light-gray);
|
background-color: var(--vn-light-gray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vn-table-separation-row {
|
||||||
|
height: 16px !important;
|
||||||
|
background-color: var(--vn-gray) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Estilo para el asterisco en campos requeridos */
|
/* Estilo para el asterisco en campos requeridos */
|
||||||
.q-field.required .q-field__label:after {
|
.q-field.required .q-field__label:after {
|
||||||
content: ' *';
|
content: ' *';
|
||||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 173 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,10 +1,10 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'icon';
|
font-family: 'icon';
|
||||||
src: url('fonts/icon.eot?7zbcv0');
|
src: url('fonts/icon.eot?2omjsr');
|
||||||
src: url('fonts/icon.eot?7zbcv0#iefix') format('embedded-opentype'),
|
src: url('fonts/icon.eot?2omjsr#iefix') format('embedded-opentype'),
|
||||||
url('fonts/icon.ttf?7zbcv0') format('truetype'),
|
url('fonts/icon.ttf?2omjsr') format('truetype'),
|
||||||
url('fonts/icon.woff?7zbcv0') format('woff'),
|
url('fonts/icon.woff?2omjsr') format('woff'),
|
||||||
url('fonts/icon.svg?7zbcv0#icon') format('svg');
|
url('fonts/icon.svg?2omjsr#icon') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: block;
|
font-display: block;
|
||||||
|
@ -28,6 +28,9 @@
|
||||||
.icon-100:before {
|
.icon-100:before {
|
||||||
content: "\e926";
|
content: "\e926";
|
||||||
}
|
}
|
||||||
|
.icon-Client_unpaid:before {
|
||||||
|
content: "\e925";
|
||||||
|
}
|
||||||
.icon-History:before {
|
.icon-History:before {
|
||||||
content: "\e964";
|
content: "\e964";
|
||||||
}
|
}
|
||||||
|
@ -46,9 +49,15 @@
|
||||||
.icon-addperson:before {
|
.icon-addperson:before {
|
||||||
content: "\e929";
|
content: "\e929";
|
||||||
}
|
}
|
||||||
|
.icon-agency:before {
|
||||||
|
content: "\e92a";
|
||||||
|
}
|
||||||
.icon-agency-term:before {
|
.icon-agency-term:before {
|
||||||
content: "\e92b";
|
content: "\e92b";
|
||||||
}
|
}
|
||||||
|
.icon-albaran:before {
|
||||||
|
content: "\e92c";
|
||||||
|
}
|
||||||
.icon-anonymous:before {
|
.icon-anonymous:before {
|
||||||
content: "\e92d";
|
content: "\e92d";
|
||||||
}
|
}
|
||||||
|
@ -172,6 +181,9 @@
|
||||||
.icon-funeral:before {
|
.icon-funeral:before {
|
||||||
content: "\e95f";
|
content: "\e95f";
|
||||||
}
|
}
|
||||||
|
.icon-grafana:before {
|
||||||
|
content: "\e931";
|
||||||
|
}
|
||||||
.icon-greenery:before {
|
.icon-greenery:before {
|
||||||
content: "\e91e";
|
content: "\e91e";
|
||||||
}
|
}
|
||||||
|
@ -355,6 +367,9 @@
|
||||||
.icon-traceability:before {
|
.icon-traceability:before {
|
||||||
content: "\e919";
|
content: "\e919";
|
||||||
}
|
}
|
||||||
|
.icon-transaction:before {
|
||||||
|
content: "\e93b";
|
||||||
|
}
|
||||||
.icon-treatments:before {
|
.icon-treatments:before {
|
||||||
content: "\e91c";
|
content: "\e91c";
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,26 +11,32 @@
|
||||||
// It's highly recommended to change the default colors
|
// It's highly recommended to change the default colors
|
||||||
// to match your app's branding.
|
// to match your app's branding.
|
||||||
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
||||||
|
// Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors
|
||||||
$primary: #ec8916;
|
$primary: #ec8916;
|
||||||
$primary-light: lighten($primary, 35%);
|
$secondary: $primary;
|
||||||
$secondary: #26a69a;
|
|
||||||
$accent: #9c27b0;
|
|
||||||
$white: #fff;
|
|
||||||
|
|
||||||
$positive: #21ba45;
|
$positive: #21ba45;
|
||||||
$negative: #c10015;
|
$negative: #c10015;
|
||||||
$info: #31ccec;
|
$info: #31ccec;
|
||||||
$warning: #f2c037;
|
$warning: #f2c037;
|
||||||
$vnColor: #8ebb27;
|
|
||||||
|
|
||||||
// Pendiente de cuadrar con la base de datos
|
// Pendiente de cuadrar con la base de datos
|
||||||
$success: $positive;
|
$success: $positive;
|
||||||
$alert: $negative;
|
$alert: $negative;
|
||||||
|
$white: #fff;
|
||||||
|
$dark: #3c3b3b;
|
||||||
|
// custom
|
||||||
|
$color-link: #66bfff;
|
||||||
|
$color-spacer-light: #a3a3a31f;
|
||||||
|
$color-spacer: #7979794d;
|
||||||
|
$border-thin-light: 1px solid $color-spacer-light;
|
||||||
|
$primary-light: lighten($primary, 35%);
|
||||||
|
$dark-shadow-color: black;
|
||||||
|
$layout-shadow-dark: 0 0 10px 2px #00000033, 0 0px 10px #0000003d;
|
||||||
|
$spacing-md: 16px;
|
||||||
|
|
||||||
.bg-success {
|
.bg-success {
|
||||||
background-color: $positive;
|
background-color: $positive;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-notice {
|
.bg-notice {
|
||||||
background-color: $info;
|
background-color: $info;
|
||||||
}
|
}
|
||||||
|
@ -40,12 +46,3 @@ $alert: $negative;
|
||||||
.bg-alert {
|
.bg-alert {
|
||||||
background-color: $negative;
|
background-color: $negative;
|
||||||
}
|
}
|
||||||
|
|
||||||
$color-spacer-light: rgba(255, 255, 255, 0.12);
|
|
||||||
$color-spacer: rgba(255, 255, 255, 0.3);
|
|
||||||
$border-thin-light: 1px solid $color-spacer-light;
|
|
||||||
|
|
||||||
$dark-shadow-color: #000;
|
|
||||||
$dark: #292929;
|
|
||||||
$layout-shadow-dark: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0px 10px rgba(0, 0, 0, 0.24);
|
|
||||||
$spacing-md: 16px;
|
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
/**
|
||||||
|
* Checks if a given date is valid.
|
||||||
|
*
|
||||||
|
* @param {number|string|Date} date - The date to be checked.
|
||||||
|
* @returns {boolean} True if the date is valid, false otherwise.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns true
|
||||||
|
* isValidDate(new Date());
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns false
|
||||||
|
* isValidDate('invalid date');
|
||||||
|
*/
|
||||||
|
export function isValidDate(date) {
|
||||||
|
return date && !isNaN(new Date(date).getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a given date to a specific format.
|
||||||
|
*
|
||||||
|
* @param {number|string|Date} date - The date to be formatted.
|
||||||
|
* @returns {string} The formatted date as a string in 'dd/mm/yyyy' format. If the provided date is not valid, an empty string is returned.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns "02/12/2022"
|
||||||
|
* toDateFormat(new Date(2022, 11, 2));
|
||||||
|
*/
|
||||||
|
export function toDateFormat(date) {
|
||||||
|
if (!isValidDate(date)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return new Date(date).toLocaleDateString('es-ES', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a given date to a specific time format.
|
||||||
|
*
|
||||||
|
* @param {number|string|Date} date - The date to be formatted.
|
||||||
|
* @param {boolean} [showSeconds=false] - Whether to include seconds in the output format.
|
||||||
|
* @returns {string} The formatted time as a string in 'hh:mm:ss' format. If the provided date is not valid, an empty string is returned. If showSeconds is false, seconds are not included in the output format.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns "00:00"
|
||||||
|
* toTimeFormat(new Date(2022, 11, 2));
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns "00:00:00"
|
||||||
|
* toTimeFormat(new Date(2022, 11, 2), true);
|
||||||
|
*/
|
||||||
|
export function toTimeFormat(date, showSeconds = false) {
|
||||||
|
if (!isValidDate(date)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return new Date(date).toLocaleDateString('es-ES', {
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
second: showSeconds ? '2-digit' : undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a given date to a specific date and time format.
|
||||||
|
*
|
||||||
|
* @param {number|string|Date} date - The date to be formatted.
|
||||||
|
* @param {boolean} [showSeconds=false] - Whether to include seconds in the output format.
|
||||||
|
* @returns {string} The formatted date as a string in 'dd/mm/yyyy, hh:mm:ss' format. If the provided date is not valid, an empty string is returned. If showSeconds is false, seconds are not included in the output format.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns "02/12/2022, 00:00"
|
||||||
|
* toDateTimeFormat(new Date(2022, 11, 2));
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // returns "02/12/2022, 00:00:00"
|
||||||
|
* toDateTimeFormat(new Date(2022, 11, 2), true);
|
||||||
|
*/
|
||||||
|
export function toDateTimeFormat(date, showSeconds = false) {
|
||||||
|
if (!isValidDate(date)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return new Date(date).toLocaleDateString('es-ES', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
second: showSeconds ? '2-digit' : undefined,
|
||||||
|
});
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ export default {
|
||||||
close: 'Close',
|
close: 'Close',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
|
assign: 'Assign',
|
||||||
back: 'Back',
|
back: 'Back',
|
||||||
yes: 'Yes',
|
yes: 'Yes',
|
||||||
no: 'No',
|
no: 'No',
|
||||||
|
@ -82,6 +83,7 @@ export default {
|
||||||
file: 'File',
|
file: 'File',
|
||||||
selectFile: 'Select a file',
|
selectFile: 'Select a file',
|
||||||
copyClipboard: 'Copy on clipboard',
|
copyClipboard: 'Copy on clipboard',
|
||||||
|
salesPerson: 'SalesPerson',
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
statusUnauthorized: 'Access denied',
|
statusUnauthorized: 'Access denied',
|
||||||
|
@ -172,6 +174,7 @@ export default {
|
||||||
hasDebt: 'Customer has debt',
|
hasDebt: 'Customer has debt',
|
||||||
notChecked: 'Customer not checked',
|
notChecked: 'Customer not checked',
|
||||||
noWebAccess: 'Web access is disabled',
|
noWebAccess: 'Web access is disabled',
|
||||||
|
businessTypeFk: 'Business type',
|
||||||
},
|
},
|
||||||
summary: {
|
summary: {
|
||||||
basicData: 'Basic data',
|
basicData: 'Basic data',
|
||||||
|
@ -437,6 +440,7 @@ export default {
|
||||||
shipped: 'Shipped',
|
shipped: 'Shipped',
|
||||||
warehouse: 'Warehouse',
|
warehouse: 'Warehouse',
|
||||||
customerCard: 'Customer card',
|
customerCard: 'Customer card',
|
||||||
|
alias: 'Alias',
|
||||||
},
|
},
|
||||||
boxing: {
|
boxing: {
|
||||||
expedition: 'Expedition',
|
expedition: 'Expedition',
|
||||||
|
@ -494,11 +498,9 @@ export default {
|
||||||
claims: 'Claims',
|
claims: 'Claims',
|
||||||
list: 'List',
|
list: 'List',
|
||||||
createClaim: 'Create claim',
|
createClaim: 'Create claim',
|
||||||
rmaList: 'RMA',
|
|
||||||
summary: 'Summary',
|
summary: 'Summary',
|
||||||
basicData: 'Basic Data',
|
basicData: 'Basic Data',
|
||||||
lines: 'Lines',
|
lines: 'Lines',
|
||||||
rma: 'RMA',
|
|
||||||
photos: 'Photos',
|
photos: 'Photos',
|
||||||
development: 'Development',
|
development: 'Development',
|
||||||
log: 'Audit logs',
|
log: 'Audit logs',
|
||||||
|
@ -515,10 +517,6 @@ export default {
|
||||||
code: 'Code',
|
code: 'Code',
|
||||||
records: 'records',
|
records: 'records',
|
||||||
},
|
},
|
||||||
rma: {
|
|
||||||
user: 'User',
|
|
||||||
created: 'Created',
|
|
||||||
},
|
|
||||||
card: {
|
card: {
|
||||||
claimId: 'Claim ID',
|
claimId: 'Claim ID',
|
||||||
assignedTo: 'Assigned',
|
assignedTo: 'Assigned',
|
||||||
|
@ -527,6 +525,8 @@ export default {
|
||||||
ticketId: 'Ticket ID',
|
ticketId: 'Ticket ID',
|
||||||
customerSummary: 'Customer summary',
|
customerSummary: 'Customer summary',
|
||||||
claimedTicket: 'Claimed ticket',
|
claimedTicket: 'Claimed ticket',
|
||||||
|
saleTracking: 'Sale tracking',
|
||||||
|
ticketTracking: 'Ticket tracking',
|
||||||
commercial: 'Commercial',
|
commercial: 'Commercial',
|
||||||
province: 'Province',
|
province: 'Province',
|
||||||
zone: 'Zone',
|
zone: 'Zone',
|
||||||
|
@ -557,7 +557,6 @@ export default {
|
||||||
responsible: 'Responsible',
|
responsible: 'Responsible',
|
||||||
worker: 'Worker',
|
worker: 'Worker',
|
||||||
redelivery: 'Redelivery',
|
redelivery: 'Redelivery',
|
||||||
returnOfMaterial: 'RMA',
|
|
||||||
},
|
},
|
||||||
basicData: {
|
basicData: {
|
||||||
customer: 'Customer',
|
customer: 'Customer',
|
||||||
|
@ -565,7 +564,6 @@ export default {
|
||||||
created: 'Created',
|
created: 'Created',
|
||||||
state: 'State',
|
state: 'State',
|
||||||
picked: 'Picked',
|
picked: 'Picked',
|
||||||
returnOfMaterial: 'Return of material authorization (RMA)',
|
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
|
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
|
||||||
|
@ -836,6 +834,7 @@ export default {
|
||||||
notifications: 'Notifications',
|
notifications: 'Notifications',
|
||||||
workerCreate: 'New worker',
|
workerCreate: 'New worker',
|
||||||
department: 'Department',
|
department: 'Department',
|
||||||
|
pda: 'PDA',
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
|
@ -877,6 +876,13 @@ export default {
|
||||||
subscribed: 'Subscribed to the notification',
|
subscribed: 'Subscribed to the notification',
|
||||||
unsubscribed: 'Unsubscribed from the notification',
|
unsubscribed: 'Unsubscribed from the notification',
|
||||||
},
|
},
|
||||||
|
pda: {
|
||||||
|
newPDA: 'New PDA',
|
||||||
|
currentPDA: 'Current PDA',
|
||||||
|
model: 'Model',
|
||||||
|
serialNumber: 'Serial number',
|
||||||
|
removePDA: 'Deallocate PDA',
|
||||||
|
},
|
||||||
create: {
|
create: {
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
lastName: 'Last name',
|
lastName: 'Last name',
|
||||||
|
|
|
@ -31,6 +31,7 @@ export default {
|
||||||
close: 'Cerrar',
|
close: 'Cerrar',
|
||||||
cancel: 'Cancelar',
|
cancel: 'Cancelar',
|
||||||
confirm: 'Confirmar',
|
confirm: 'Confirmar',
|
||||||
|
assign: 'Asignar',
|
||||||
back: 'Volver',
|
back: 'Volver',
|
||||||
yes: 'Si',
|
yes: 'Si',
|
||||||
no: 'No',
|
no: 'No',
|
||||||
|
@ -82,6 +83,7 @@ export default {
|
||||||
file: 'Fichero',
|
file: 'Fichero',
|
||||||
selectFile: 'Seleccione un fichero',
|
selectFile: 'Seleccione un fichero',
|
||||||
copyClipboard: 'Copiar en portapapeles',
|
copyClipboard: 'Copiar en portapapeles',
|
||||||
|
salesPerson: 'Comercial',
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
statusUnauthorized: 'Acceso denegado',
|
statusUnauthorized: 'Acceso denegado',
|
||||||
|
@ -171,6 +173,7 @@ export default {
|
||||||
hasDebt: 'El cliente tiene riesgo',
|
hasDebt: 'El cliente tiene riesgo',
|
||||||
notChecked: 'El cliente no está comprobado',
|
notChecked: 'El cliente no está comprobado',
|
||||||
noWebAccess: 'El acceso web está desactivado',
|
noWebAccess: 'El acceso web está desactivado',
|
||||||
|
businessTypeFk: 'Tipo de negocio',
|
||||||
},
|
},
|
||||||
summary: {
|
summary: {
|
||||||
basicData: 'Datos básicos',
|
basicData: 'Datos básicos',
|
||||||
|
@ -307,8 +310,8 @@ export default {
|
||||||
reference: 'Referencia',
|
reference: 'Referencia',
|
||||||
invoiceNumber: 'Núm. factura',
|
invoiceNumber: 'Núm. factura',
|
||||||
ordered: 'Pedida',
|
ordered: 'Pedida',
|
||||||
confirmed: 'Confirmado',
|
confirmed: 'Confirmada',
|
||||||
booked: 'Asentado',
|
booked: 'Contabilizada',
|
||||||
raid: 'Redada',
|
raid: 'Redada',
|
||||||
excludedFromAvailable: 'Inventario',
|
excludedFromAvailable: 'Inventario',
|
||||||
travelReference: 'Referencia',
|
travelReference: 'Referencia',
|
||||||
|
@ -436,6 +439,7 @@ export default {
|
||||||
shipped: 'Enviado',
|
shipped: 'Enviado',
|
||||||
warehouse: 'Almacén',
|
warehouse: 'Almacén',
|
||||||
customerCard: 'Ficha del cliente',
|
customerCard: 'Ficha del cliente',
|
||||||
|
alias: 'Alias',
|
||||||
},
|
},
|
||||||
boxing: {
|
boxing: {
|
||||||
expedition: 'Expedición',
|
expedition: 'Expedición',
|
||||||
|
@ -493,14 +497,12 @@ export default {
|
||||||
claims: 'Reclamaciones',
|
claims: 'Reclamaciones',
|
||||||
list: 'Listado',
|
list: 'Listado',
|
||||||
createClaim: 'Crear reclamación',
|
createClaim: 'Crear reclamación',
|
||||||
rmaList: 'RMA',
|
|
||||||
summary: 'Resumen',
|
summary: 'Resumen',
|
||||||
basicData: 'Datos básicos',
|
basicData: 'Datos básicos',
|
||||||
lines: 'Líneas',
|
lines: 'Líneas',
|
||||||
rma: 'RMA',
|
|
||||||
development: 'Trazabilidad',
|
development: 'Trazabilidad',
|
||||||
photos: 'Fotos',
|
photos: 'Fotos',
|
||||||
log: 'Registros de auditoría',
|
log: 'Historial',
|
||||||
notes: 'Notas',
|
notes: 'Notas',
|
||||||
action: 'Acción',
|
action: 'Acción',
|
||||||
},
|
},
|
||||||
|
@ -514,10 +516,6 @@ export default {
|
||||||
code: 'Código',
|
code: 'Código',
|
||||||
records: 'registros',
|
records: 'registros',
|
||||||
},
|
},
|
||||||
rma: {
|
|
||||||
user: 'Usuario',
|
|
||||||
created: 'Creado',
|
|
||||||
},
|
|
||||||
card: {
|
card: {
|
||||||
claimId: 'ID reclamación',
|
claimId: 'ID reclamación',
|
||||||
assignedTo: 'Asignada a',
|
assignedTo: 'Asignada a',
|
||||||
|
@ -526,6 +524,8 @@ export default {
|
||||||
ticketId: 'ID ticket',
|
ticketId: 'ID ticket',
|
||||||
customerSummary: 'Resumen del cliente',
|
customerSummary: 'Resumen del cliente',
|
||||||
claimedTicket: 'Ticket reclamado',
|
claimedTicket: 'Ticket reclamado',
|
||||||
|
saleTracking: 'Líneas preparadas',
|
||||||
|
ticketTracking: 'Estados del ticket',
|
||||||
commercial: 'Comercial',
|
commercial: 'Comercial',
|
||||||
province: 'Provincia',
|
province: 'Provincia',
|
||||||
zone: 'Zona',
|
zone: 'Zona',
|
||||||
|
@ -556,7 +556,6 @@ export default {
|
||||||
responsible: 'Responsable',
|
responsible: 'Responsable',
|
||||||
worker: 'Trabajador',
|
worker: 'Trabajador',
|
||||||
redelivery: 'Devolución',
|
redelivery: 'Devolución',
|
||||||
returnOfMaterial: 'RMA',
|
|
||||||
},
|
},
|
||||||
basicData: {
|
basicData: {
|
||||||
customer: 'Cliente',
|
customer: 'Cliente',
|
||||||
|
@ -564,7 +563,6 @@ export default {
|
||||||
created: 'Creada',
|
created: 'Creada',
|
||||||
state: 'Estado',
|
state: 'Estado',
|
||||||
picked: 'Recogida',
|
picked: 'Recogida',
|
||||||
returnOfMaterial: 'Autorización de retorno de materiales (RMA)',
|
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
fileDescription:
|
fileDescription:
|
||||||
|
@ -723,7 +721,7 @@ export default {
|
||||||
create: 'Crear',
|
create: 'Crear',
|
||||||
summary: 'Resumen',
|
summary: 'Resumen',
|
||||||
basicData: 'Datos básicos',
|
basicData: 'Datos básicos',
|
||||||
log: 'Registros de auditoría',
|
log: 'Historial',
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
parking: 'Parking',
|
parking: 'Parking',
|
||||||
|
@ -755,7 +753,7 @@ export default {
|
||||||
dueDay: 'Vencimiento',
|
dueDay: 'Vencimiento',
|
||||||
intrastat: 'Intrastat',
|
intrastat: 'Intrastat',
|
||||||
corrective: 'Rectificativa',
|
corrective: 'Rectificativa',
|
||||||
log: 'Registros de auditoría',
|
log: 'Historial',
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
ref: 'Referencia',
|
ref: 'Referencia',
|
||||||
|
@ -836,6 +834,7 @@ export default {
|
||||||
notifications: 'Notificaciones',
|
notifications: 'Notificaciones',
|
||||||
workerCreate: 'Nuevo trabajador',
|
workerCreate: 'Nuevo trabajador',
|
||||||
department: 'Departamentos',
|
department: 'Departamentos',
|
||||||
|
pda: 'PDA',
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
name: 'Nombre',
|
name: 'Nombre',
|
||||||
|
@ -877,6 +876,13 @@ export default {
|
||||||
subscribed: 'Se ha suscrito a la notificación',
|
subscribed: 'Se ha suscrito a la notificación',
|
||||||
unsubscribed: 'Se ha dado de baja de la notificación',
|
unsubscribed: 'Se ha dado de baja de la notificación',
|
||||||
},
|
},
|
||||||
|
pda: {
|
||||||
|
newPDA: 'Nueva PDA',
|
||||||
|
currentPDA: 'PDA Actual',
|
||||||
|
model: 'Modelo',
|
||||||
|
serialNumber: 'Número de serie',
|
||||||
|
removePDA: 'Desasignar PDA',
|
||||||
|
},
|
||||||
create: {
|
create: {
|
||||||
name: 'Nombre',
|
name: 'Nombre',
|
||||||
lastName: 'Apellido',
|
lastName: 'Apellido',
|
||||||
|
|
|
@ -40,7 +40,7 @@ const langs = ['en', 'es'];
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QLayout view="hHh LpR fFf">
|
<QLayout view="hHh LpR fFf">
|
||||||
<QHeader reveal class="bg-dark">
|
<QHeader reveal class="bg-vn-dark">
|
||||||
<QToolbar class="justify-end">
|
<QToolbar class="justify-end">
|
||||||
<QBtn
|
<QBtn
|
||||||
id="switchLanguage"
|
id="switchLanguage"
|
||||||
|
|
|
@ -24,7 +24,6 @@ const claimFilter = {
|
||||||
'workerFk',
|
'workerFk',
|
||||||
'claimStateFk',
|
'claimStateFk',
|
||||||
'packages',
|
'packages',
|
||||||
'rma',
|
|
||||||
'hasToPickUp',
|
'hasToPickUp',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
|
@ -169,13 +168,6 @@ const statesFilter = {
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
|
||||||
<VnInput
|
|
||||||
v-model="data.rma"
|
|
||||||
:label="t('claim.basicData.returnOfMaterial')"
|
|
||||||
:rules="validate('claim.rma')"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import ClaimDescriptor from './ClaimDescriptor.vue';
|
import ClaimDescriptor from './ClaimDescriptor.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -28,7 +29,9 @@ const { t } = useI18n();
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -105,7 +105,6 @@ onMounted(async () => {
|
||||||
<ClaimDescriptorMenu :claim="entity" />
|
<ClaimDescriptorMenu :claim="entity" />
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('claim.card.created')" :value="toDate(entity.created)" />
|
|
||||||
<VnLv v-if="entity.claimState" :label="t('claim.card.state')">
|
<VnLv v-if="entity.claimState" :label="t('claim.card.state')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<QBadge :color="stateColor(entity.claimState.code)" dense>
|
<QBadge :color="stateColor(entity.claimState.code)" dense>
|
||||||
|
@ -113,13 +112,13 @@ onMounted(async () => {
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.card.ticketId')">
|
<VnLv :label="t('claim.card.created')" :value="toDate(entity.created)" />
|
||||||
|
<VnLv :label="t('claim.card.commercial')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<VnUserLink
|
||||||
{{ entity.ticketFk }}
|
:name="entity.client?.salesPersonUser?.name"
|
||||||
|
:worker-id="entity.client?.salesPersonFk"
|
||||||
<TicketDescriptorProxy :id="entity.ticketFk" />
|
/>
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -134,19 +133,20 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.card.commercial')">
|
<VnLv :label="t('claim.card.zone')" :value="entity.ticket?.zone?.name" />
|
||||||
<template #value>
|
|
||||||
<VnUserLink
|
|
||||||
:name="entity.client?.salesPersonUser?.name"
|
|
||||||
:worker-id="entity.client?.salesPersonFk"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claim.card.province')"
|
:label="t('claim.card.province')"
|
||||||
:value="entity.ticket?.address?.province?.name"
|
:value="entity.ticket?.address?.province?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('claim.card.zone')" :value="entity.ticket?.zone?.name" />
|
<VnLv :label="t('claim.card.ticketId')">
|
||||||
|
<template #value>
|
||||||
|
<span class="link">
|
||||||
|
{{ entity.ticketFk }}
|
||||||
|
|
||||||
|
<TicketDescriptorProxy :id="entity.ticketFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claimRate')"
|
:label="t('claimRate')"
|
||||||
:value="toPercentage(entity.client?.claimsRatio?.claimingRate)"
|
:value="toPercentage(entity.client?.claimsRatio?.claimingRate)"
|
||||||
|
@ -176,6 +176,7 @@ onMounted(async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/sale-tracking'"
|
:href="salixUrl + 'ticket/' + entity.ticketFk + '/sale-tracking'"
|
||||||
>
|
>
|
||||||
|
<QTooltip>{{ t('claim.card.saleTracking') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
size="md"
|
size="md"
|
||||||
|
@ -183,6 +184,7 @@ onMounted(async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/tracking/index'"
|
:href="salixUrl + 'ticket/' + entity.ticketFk + '/tracking/index'"
|
||||||
>
|
>
|
||||||
|
<QTooltip>{{ t('claim.card.ticketTracking') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
@ -6,14 +7,15 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const id = route.params.id;
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
id: { type: Number, default: null },
|
||||||
addNote: { type: Boolean, default: true },
|
addNote: { type: Boolean, default: true },
|
||||||
});
|
});
|
||||||
|
const claimId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
const claimFilter = {
|
const claimFilter = {
|
||||||
where: { claimFk: id },
|
where: { claimFk: claimId.value },
|
||||||
fields: ['created', 'workerFk', 'text'],
|
fields: ['created', 'workerFk', 'text'],
|
||||||
include: {
|
include: {
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
|
@ -30,19 +32,16 @@ const claimFilter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
claimFk: id,
|
claimFk: claimId.value,
|
||||||
workerFk: user.value.id,
|
workerFk: user.value.id,
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="column items-center">
|
|
||||||
<VnNotes
|
<VnNotes
|
||||||
style="overflow-y: scroll"
|
style="overflow-y: auto"
|
||||||
:add-note="$props.addNote"
|
:add-note="$props.addNote"
|
||||||
:id="id"
|
|
||||||
url="claimObservations"
|
url="claimObservations"
|
||||||
:filter="claimFilter"
|
:filter="claimFilter"
|
||||||
:body="body"
|
:body="body"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,145 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import axios from 'axios';
|
|
||||||
import { watch, ref, computed, onUnmounted, onMounted } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
import CrudModel from 'components/CrudModel.vue';
|
|
||||||
import { useState } from 'src/composables/useState';
|
|
||||||
|
|
||||||
import { toDate } from 'src/filters';
|
|
||||||
|
|
||||||
const quasar = useQuasar();
|
|
||||||
const state = useState();
|
|
||||||
const { t } = useI18n();
|
|
||||||
const selected = ref([]);
|
|
||||||
const claimRmaRef = ref();
|
|
||||||
const claim = computed(() => state.get('ClaimDescriptor'));
|
|
||||||
|
|
||||||
const claimRmaFilter = {
|
|
||||||
include: {
|
|
||||||
relation: 'worker',
|
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'user',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
order: 'created DESC',
|
|
||||||
where: {
|
|
||||||
code: claim.value?.rma,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
async function addRow() {
|
|
||||||
if (!claim.value.rma) {
|
|
||||||
return quasar.notify({
|
|
||||||
message: `This claim is not associated to any RMA`,
|
|
||||||
type: 'negative',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const formData = {
|
|
||||||
code: claim.value.rma,
|
|
||||||
};
|
|
||||||
|
|
||||||
await axios.post(`ClaimRmas`, formData);
|
|
||||||
await claimRmaRef.value.reload();
|
|
||||||
|
|
||||||
quasar.notify({
|
|
||||||
type: 'positive',
|
|
||||||
message: t('globals.rowAdded'),
|
|
||||||
icon: 'check',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (claim.value) claimRmaRef.value.reload();
|
|
||||||
});
|
|
||||||
watch(
|
|
||||||
claim,
|
|
||||||
() => {
|
|
||||||
claimRmaRef.value.reload();
|
|
||||||
},
|
|
||||||
{ deep: true }
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<div class="column items-center">
|
|
||||||
<div class="list">
|
|
||||||
<CrudModel
|
|
||||||
data-key="ClaimRma"
|
|
||||||
url="ClaimRmas"
|
|
||||||
model="ClaimRma"
|
|
||||||
:filter="claimRmaFilter"
|
|
||||||
v-model:selected="selected"
|
|
||||||
ref="claimRmaRef"
|
|
||||||
:default-save="false"
|
|
||||||
:default-reset="false"
|
|
||||||
:default-remove="false"
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QCard>
|
|
||||||
<template v-for="(row, index) of rows" :key="row.id">
|
|
||||||
<QItem class="q-pa-none items-start">
|
|
||||||
<QItemSection class="q-pa-md">
|
|
||||||
<QList>
|
|
||||||
<QItem class="q-pa-none">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ t('claim.rma.user') }}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ row?.worker?.user?.name }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem class="q-pa-none">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ t('claim.rma.created') }}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel>
|
|
||||||
{{
|
|
||||||
toDate(row.created, {
|
|
||||||
timeStyle: 'medium',
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</QList>
|
|
||||||
</QItemSection>
|
|
||||||
<QCardActions vertical class="justify-between">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="orange"
|
|
||||||
icon="vn:bin"
|
|
||||||
@click="claimRmaRef.remove([row])"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('globals.remove') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QCardActions>
|
|
||||||
</QItem>
|
|
||||||
<QSeparator v-if="index !== rows.length - 1" />
|
|
||||||
</template>
|
|
||||||
</QCard>
|
|
||||||
</template>
|
|
||||||
</CrudModel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
|
||||||
<QBtn fab color="primary" icon="add" @click="addRow()" />
|
|
||||||
</QPageSticky>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 60em;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
This claim is not associated to any RMA: Esta reclamación no está asociada a ninguna ARM
|
|
||||||
</i18n>
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, watch } from 'vue';
|
import { onMounted, ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency } from 'src/filters';
|
||||||
|
@ -70,7 +70,7 @@ const detailsColumns = ref([
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'description',
|
name: 'description',
|
||||||
label: 'claim.summary.description',
|
label: 'globals.description',
|
||||||
field: (row) => row.sale.concept,
|
field: (row) => row.sale.concept,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -172,6 +172,7 @@ function openDialog(dmsId) {
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summary"
|
ref="summary"
|
||||||
:url="`Claims/${entityId}/getSummary`"
|
:url="`Claims/${entityId}/getSummary`"
|
||||||
|
:entity-id="entityId"
|
||||||
@on-fetch="getClaimDms"
|
@on-fetch="getClaimDms"
|
||||||
>
|
>
|
||||||
<template #header="{ entity: { claim } }">
|
<template #header="{ entity: { claim } }">
|
||||||
|
@ -179,9 +180,9 @@ function openDialog(dmsId) {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header" :href="`#/claim/${entityId}/basic-data`">
|
<a class="header header-link" :href="`#/claim/${entityId}/basic-data`">
|
||||||
{{ t('claim.pageTitles.basicData') }}
|
{{ t('claim.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('claim.summary.created')"
|
:label="t('claim.summary.created')"
|
||||||
|
@ -194,19 +195,19 @@ function openDialog(dmsId) {
|
||||||
</QChip>
|
</QChip>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.summary.assignedTo')">
|
<VnLv :label="t('globals.salesPerson')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="claim.worker?.user?.nickname"
|
:name="claim.client?.salesPersonUser?.name"
|
||||||
:worker-id="claim.workerFk"
|
:worker-id="claim.client?.salesPersonFk"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.summary.attendedBy')">
|
<VnLv :label="t('claim.summary.attendedBy')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="claim.client?.salesPersonUser?.name"
|
:name="claim.worker?.user?.nickname"
|
||||||
:worker-id="claim.client?.salesPersonFk"
|
:worker-id="claim.workerFk"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
@ -218,26 +219,37 @@ function openDialog(dmsId) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('claim.summary.returnOfMaterial')" :value="claim.rma" />
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:align-items="right"
|
|
||||||
:label="t('claim.basicData.picked')"
|
:label="t('claim.basicData.picked')"
|
||||||
v-model="claim.hasToPickUp"
|
v-model="claim.hasToPickUp"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-three claimVnNotes full-height">
|
<QCard class="vn-three">
|
||||||
<a class="header" :href="`#/claim/${entityId}/notes`">
|
<a class="header header-link" :href="`#/claim/${entityId}/notes`">
|
||||||
{{ t('claim.summary.notes') }}
|
{{ t('claim.summary.notes') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<ClaimNotes :add-note="false" style="height: 350px" order="created ASC" />
|
<ClaimNotes
|
||||||
|
:id="entityId"
|
||||||
|
:add-note="false"
|
||||||
|
style="max-height: 300px"
|
||||||
|
order="created ASC"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-two" v-if="salesClaimed.length > 0">
|
<QCard class="vn-two" v-if="salesClaimed.length > 0">
|
||||||
<a class="header" :href="`#/claim/${entityId}/lines`">
|
<a class="header header-link" :href="`#/claim/${entityId}/lines`">
|
||||||
{{ t('claim.summary.details') }}
|
{{ t('claim.summary.details') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :columns="detailsColumns" :rows="salesClaimed" flat>
|
<QTable
|
||||||
|
:columns="detailsColumns"
|
||||||
|
:rows="salesClaimed"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
:rows-per-page-options="[0]"
|
||||||
|
hide-bottom
|
||||||
|
>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
@ -268,11 +280,19 @@ function openDialog(dmsId) {
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-two" v-if="developments.length > 0">
|
<QCard class="vn-two" v-if="developments.length > 0">
|
||||||
<a class="header" :href="claimUrl + 'development'">
|
<a class="header header-link" :href="claimUrl + 'development'">
|
||||||
{{ t('claim.summary.development') }}
|
{{ t('claim.summary.development') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :columns="developmentColumns" :rows="developments" flat>
|
|
||||||
|
<QTable
|
||||||
|
:columns="developmentColumns"
|
||||||
|
:rows="developments"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
:rows-per-page-options="[0]"
|
||||||
|
hide-bottom
|
||||||
|
>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
@ -283,9 +303,9 @@ function openDialog(dmsId) {
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-max" v-if="claimDms.length > 0">
|
<QCard class="vn-max" v-if="claimDms.length > 0">
|
||||||
<a class="header" :href="`#/claim/${entityId}/photos`">
|
<a class="header header-link" :href="`#/claim/${entityId}/photos`">
|
||||||
{{ t('claim.summary.photos') }}
|
{{ t('claim.summary.photos') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div
|
<div
|
||||||
|
@ -302,7 +322,7 @@ function openDialog(dmsId) {
|
||||||
v-if="media.isVideo"
|
v-if="media.isVideo"
|
||||||
@click.stop="openDialog(media.dmsFk)"
|
@click.stop="openDialog(media.dmsFk)"
|
||||||
>
|
>
|
||||||
<QTooltip>Video</QTooltip>
|
<QTooltip>Video</QTooltip>header
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QCard class="multimedia relative-position">
|
<QCard class="multimedia relative-position">
|
||||||
<QImg
|
<QImg
|
||||||
|
@ -326,9 +346,9 @@ function openDialog(dmsId) {
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
||||||
<QCard class="vn-max">
|
<QCard class="vn-max">
|
||||||
<a class="header" :href="claimUrl + 'action'">
|
<a class="header header-link" :href="claimUrl + 'action'">
|
||||||
{{ t('claim.summary.actions') }}
|
{{ t('claim.summary.actions') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" class="link" />
|
||||||
</a>
|
</a>
|
||||||
<div id="slider-container" class="q-px-xl q-py-md">
|
<div id="slider-container" class="q-px-xl q-py-md">
|
||||||
<QSlider
|
<QSlider
|
||||||
|
@ -336,7 +356,7 @@ function openDialog(dmsId) {
|
||||||
label
|
label
|
||||||
:label-value="t('claim.summary.responsibility')"
|
:label-value="t('claim.summary.responsibility')"
|
||||||
label-always
|
label-always
|
||||||
color="primary"
|
color="var()"
|
||||||
markers
|
markers
|
||||||
:marker-labels="[
|
:marker-labels="[
|
||||||
{ value: 1, label: t('claim.summary.company') },
|
{ value: 1, label: t('claim.summary.company') },
|
||||||
|
@ -390,13 +410,7 @@ function openDialog(dmsId) {
|
||||||
</template>
|
</template>
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
|
||||||
.claimVnNotes {
|
|
||||||
.q-card {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.q-dialog__inner--minimized > div {
|
.q-dialog__inner--minimized > div {
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
|
@ -406,7 +420,6 @@ function openDialog(dmsId) {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
flex-basis: 30%;
|
|
||||||
}
|
}
|
||||||
.multimedia-container {
|
.multimedia-container {
|
||||||
flex: 1 0 21%;
|
flex: 1 0 21%;
|
||||||
|
|
|
@ -115,12 +115,6 @@ function navigate(event, id) {
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openCard')"
|
|
||||||
@click.stop="navigate(row.id)"
|
|
||||||
class="bg-vn-dark"
|
|
||||||
outline
|
|
||||||
/>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.description')"
|
:label="t('globals.description')"
|
||||||
@click.stop
|
@click.stop
|
||||||
|
|
|
@ -1,171 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
|
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
|
||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
const quasar = useQuasar();
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const arrayData = useArrayData('ClaimRmaList');
|
|
||||||
const isLoading = ref(false);
|
|
||||||
const input = ref();
|
|
||||||
|
|
||||||
const newRma = ref({
|
|
||||||
code: '',
|
|
||||||
crated: Date.vnNew(),
|
|
||||||
});
|
|
||||||
|
|
||||||
function onInputUpdate(value) {
|
|
||||||
newRma.value.code = value.toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submit() {
|
|
||||||
const formData = newRma.value;
|
|
||||||
if (formData.code === '') return;
|
|
||||||
|
|
||||||
isLoading.value = true;
|
|
||||||
await axios.post('ClaimRmas', formData);
|
|
||||||
await arrayData.refresh();
|
|
||||||
isLoading.value = false;
|
|
||||||
input.value.$el.focus();
|
|
||||||
|
|
||||||
newRma.value = {
|
|
||||||
code: '',
|
|
||||||
created: Date.vnNew(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function confirm(id) {
|
|
||||||
quasar
|
|
||||||
.dialog({
|
|
||||||
component: VnConfirm,
|
|
||||||
componentProps: {
|
|
||||||
data: { id },
|
|
||||||
promise: remove,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.onOk(async () => await arrayData.refresh());
|
|
||||||
}
|
|
||||||
|
|
||||||
async function remove({ id }) {
|
|
||||||
await axios.delete(`ClaimRmas/${id}`);
|
|
||||||
quasar.notify({
|
|
||||||
type: 'positive',
|
|
||||||
message: t('globals.rowRemoved'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QPage class="column items-center q-pa-md sticky">
|
|
||||||
<QPageSticky expand position="top" :offset="[16, 16]">
|
|
||||||
<QCard class="card q-pa-md">
|
|
||||||
<QForm @submit="submit">
|
|
||||||
<VnInput
|
|
||||||
ref="input"
|
|
||||||
v-model="newRma.code"
|
|
||||||
:label="t('claim.rmaList.code')"
|
|
||||||
@update:model-value="onInputUpdate"
|
|
||||||
class="q-mb-md"
|
|
||||||
:readonly="isLoading"
|
|
||||||
:loading="isLoading"
|
|
||||||
autofocus
|
|
||||||
/>
|
|
||||||
<div class="text-caption">
|
|
||||||
{{ arrayData.totalRows }} {{ t('claim.rmaList.records') }}
|
|
||||||
</div>
|
|
||||||
</QForm>
|
|
||||||
</QCard>
|
|
||||||
</QPageSticky>
|
|
||||||
<div class="vn-card-list">
|
|
||||||
<VnPaginate
|
|
||||||
data-key="ClaimRmaList"
|
|
||||||
url="ClaimRmas"
|
|
||||||
order="id DESC"
|
|
||||||
:offset="50"
|
|
||||||
auto-load
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QCard class="card">
|
|
||||||
<template v-if="isLoading">
|
|
||||||
<QItem class="q-pa-none items-start">
|
|
||||||
<QItemSection class="q-pa-md">
|
|
||||||
<QList>
|
|
||||||
<QItem class="q-pa-none">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel caption>
|
|
||||||
<QSkeleton />
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel>
|
|
||||||
<QSkeleton type="text" />
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</QList>
|
|
||||||
</QItemSection>
|
|
||||||
<QCardActions vertical class="justify-between">
|
|
||||||
<QSkeleton
|
|
||||||
type="circle"
|
|
||||||
class="q-mb-md"
|
|
||||||
size="40px"
|
|
||||||
/>
|
|
||||||
</QCardActions>
|
|
||||||
</QItem>
|
|
||||||
<QSeparator />
|
|
||||||
</template>
|
|
||||||
<template v-for="row of rows" :key="row.id">
|
|
||||||
<QItem class="q-pa-none items-start">
|
|
||||||
<QItemSection class="q-pa-md">
|
|
||||||
<QList>
|
|
||||||
<QItem class="q-pa-none">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel caption>{{
|
|
||||||
t('claim.rmaList.code')
|
|
||||||
}}</QItemLabel>
|
|
||||||
<QItemLabel>{{ row.code }}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</QList>
|
|
||||||
</QItemSection>
|
|
||||||
<QCardActions vertical class="justify-between">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="primary"
|
|
||||||
icon="vn:bin"
|
|
||||||
@click="confirm(row.id)"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('globals.remove') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QCardActions>
|
|
||||||
</QItem>
|
|
||||||
<QSeparator />
|
|
||||||
</template>
|
|
||||||
</QCard>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.sticky {
|
|
||||||
padding-top: 156px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 60em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-page-sticky {
|
|
||||||
z-index: 2998;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -6,6 +6,7 @@ import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -30,7 +31,9 @@ const { t } = useI18n();
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -40,6 +40,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
|
||||||
data-key="customerData"
|
data-key="customerData"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
|
<VnLv :label="t('customer.card.payMethod')" :value="entity.payMethod.name" />
|
||||||
|
|
||||||
|
<VnLv :label="t('customer.card.credit')" :value="toCurrency(entity.credit)" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('customer.card.securedCredit')"
|
||||||
|
:value="toCurrency(entity.creditInsurance)"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" />
|
||||||
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
|
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
|
@ -48,13 +57,10 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('customer.card.credit')" :value="toCurrency(entity.credit)" />
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.card.securedCredit')"
|
:label="t('customer.card.businessTypeFk')"
|
||||||
:value="toCurrency(entity.creditInsurance)"
|
:value="entity.businessTypeFk"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('customer.card.payMethod')" :value="entity.payMethod.name" />
|
|
||||||
<VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" />
|
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions>
|
||||||
|
|
|
@ -62,9 +62,9 @@ const creditWarning = computed(() => {
|
||||||
<CardSummary ref="summary" :url="`Clients/${entityId}/summary`">
|
<CardSummary ref="summary" :url="`Clients/${entityId}/summary`">
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header" :href="clientUrl + `basic-data`">
|
<a class="header header-link" :href="`#/customer/${entityId}/basic-data`">
|
||||||
{{ t('customer.summary.basicData') }}
|
{{ t('customer.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
|
<VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
|
||||||
<VnLv :label="t('customer.summary.name')" :value="entity.name" />
|
<VnLv :label="t('customer.summary.name')" :value="entity.name" />
|
||||||
|
@ -96,9 +96,12 @@ const creditWarning = computed(() => {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header" :href="clientUrl + `fiscal-data`">
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/customer/${entityId}/fiscal-data`"
|
||||||
|
>
|
||||||
{{ t('customer.summary.fiscalAddress') }}
|
{{ t('customer.summary.fiscalAddress') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.socialName')"
|
:label="t('customer.summary.socialName')"
|
||||||
|
@ -121,37 +124,58 @@ const creditWarning = computed(() => {
|
||||||
<VnLv :label="t('customer.summary.street')" :value="entity.street" />
|
<VnLv :label="t('customer.summary.street')" :value="entity.street" />
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="clientUrl + `fiscal-data`" link>
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/customer/${entityId}/fiscal-data`"
|
||||||
|
link
|
||||||
|
>
|
||||||
{{ t('customer.summary.fiscalData') }}
|
{{ t('customer.summary.fiscalData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('customer.summary.isEqualizated')"
|
:label="t('customer.summary.isEqualizated')"
|
||||||
:value="entity.isEqualizated"
|
v-model="entity.isEqualizated"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('customer.summary.isActive')" :value="entity.isActive" />
|
<QCheckbox
|
||||||
<VnLv
|
:label="t('customer.summary.isActive')"
|
||||||
|
v-model="entity.isActive"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
:label="t('customer.summary.invoiceByAddress')"
|
:label="t('customer.summary.invoiceByAddress')"
|
||||||
:value="entity.hasToInvoiceByAddress"
|
v-model="entity.hasToInvoiceByAddress"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('customer.summary.verifiedData')"
|
:label="t('customer.summary.verifiedData')"
|
||||||
:value="entity.isTaxDataChecked"
|
v-model="entity.isTaxDataChecked"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('customer.summary.hasToInvoice')"
|
:label="t('customer.summary.hasToInvoice')"
|
||||||
:value="entity.hasToInvoice"
|
v-model="entity.hasToInvoice"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('customer.summary.notifyByEmail')"
|
:label="t('customer.summary.notifyByEmail')"
|
||||||
:value="entity.isToBeMailed"
|
v-model="entity.isToBeMailed"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('customer.summary.vies')"
|
||||||
|
v-model="entity.isVies"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('customer.summary.vies')" :value="entity.isVies" />
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="clientUrl + `billing-data`" link>
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/customer/${entityId}/billing-data`"
|
||||||
|
link
|
||||||
|
>
|
||||||
{{ t('customer.summary.billingData') }}
|
{{ t('customer.summary.billingData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.payMethod')"
|
:label="t('customer.summary.payMethod')"
|
||||||
|
@ -159,20 +183,32 @@ const creditWarning = computed(() => {
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
|
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
|
||||||
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
|
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
|
||||||
<VnLv :label="t('customer.summary.hasLcr')" :value="entity.hasLcr" />
|
<QCheckbox
|
||||||
<VnLv
|
style="padding: 0"
|
||||||
:label="t('customer.summary.hasCoreVnl')"
|
:label="t('customer.summary.hasLcr')"
|
||||||
:value="entity.hasCoreVnl"
|
v-model="entity.hasLcr"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
|
:label="t('customer.summary.hasCoreVnl')"
|
||||||
|
v-model="entity.hasCoreVnl"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<QCheckbox
|
||||||
:label="t('customer.summary.hasB2BVnl')"
|
:label="t('customer.summary.hasB2BVnl')"
|
||||||
:value="entity.hasSepaVnl"
|
v-model="entity.hasSepaVnl"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.defaultAddress">
|
<QCard class="vn-one" v-if="entity.defaultAddress">
|
||||||
<a class="header link" :href="clientUrl + `address/index`" link>
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/customer/${entityId}/consignees`"
|
||||||
|
link
|
||||||
|
>
|
||||||
{{ t('customer.summary.consignee') }}
|
{{ t('customer.summary.consignee') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.addressName')"
|
:label="t('customer.summary.addressName')"
|
||||||
|
@ -188,21 +224,22 @@ const creditWarning = computed(() => {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.account">
|
<QCard class="vn-one" v-if="entity.account">
|
||||||
<a class="header link" :href="clientUrl + `web-access`">
|
<a class="header header-link" :href="`#/customer/${entityId}/web-access`">
|
||||||
{{ t('customer.summary.webAccess') }}
|
{{ t('customer.summary.webAccess') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.username')"
|
:label="t('customer.summary.username')"
|
||||||
:value="entity.account.name"
|
:value="entity.account.name"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('customer.summary.webAccess')"
|
:label="t('customer.summary.webAccess')"
|
||||||
:value="entity.account.active"
|
v-model="entity.account.active"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.account">
|
<QCard class="vn-one" v-if="entity.account">
|
||||||
<div class="header">
|
<div class="header header-link">
|
||||||
{{ t('customer.summary.businessData') }}
|
{{ t('customer.summary.businessData') }}
|
||||||
</div>
|
</div>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -230,13 +267,12 @@ const creditWarning = computed(() => {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.account">
|
<QCard class="vn-one" v-if="entity.account">
|
||||||
<a
|
<a
|
||||||
class="header link"
|
class="header header-link"
|
||||||
:href="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
:href="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
||||||
link
|
link
|
||||||
>
|
>
|
||||||
{{ t('customer.summary.financialData') }}
|
{{ t('customer.summary.financialData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="vn:grafana" />
|
||||||
<!-- Pendiente de añadir el icono <QIcon name="vn:grafana" color="primary" /> -->
|
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.risk')"
|
:label="t('customer.summary.risk')"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
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 VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -12,10 +12,6 @@ const props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function isValidNumber(value) {
|
|
||||||
return /^(\d|\d+(\.|,)?\d+)$/.test(value);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -51,28 +47,9 @@ function isValidNumber(value) {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnCurrency v-model="params.amount" is-outlined />
|
||||||
:label="t('Amount')"
|
|
||||||
v-model="params.amount"
|
|
||||||
is-outlined
|
|
||||||
@update:model-value="
|
|
||||||
(value) => {
|
|
||||||
if (value.includes(','))
|
|
||||||
params.amount = params.amount.replace(',', '.');
|
|
||||||
}
|
|
||||||
"
|
|
||||||
:rules="[
|
|
||||||
(val) => isValidNumber(val) || !val || 'Please type a number',
|
|
||||||
]"
|
|
||||||
lazy-rules
|
|
||||||
>
|
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="euro" size="sm" />
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate v-model="params.from" :label="t('From')" is-outlined />
|
<VnInputDate v-model="params.from" :label="t('From')" is-outlined />
|
||||||
|
|
|
@ -112,7 +112,7 @@ const onDataSaved = async () => {
|
||||||
:filter="filterBanks"
|
:filter="filterBanks"
|
||||||
@on-fetch="(data) => (bankOptions = data)"
|
@on-fetch="(data) => (bankOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
url="Banks"
|
url="Accountings"
|
||||||
/>
|
/>
|
||||||
<fetch-data
|
<fetch-data
|
||||||
:filter="filterClientFindOne"
|
:filter="filterClientFindOne"
|
||||||
|
|
|
@ -36,9 +36,12 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: department }">
|
<template #body="{ entity: department }">
|
||||||
<QCard class="column">
|
<QCard class="column">
|
||||||
<a class="header" :href="department + `basic-data`">
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/department/department/${entityId}/basic-data`"
|
||||||
|
>
|
||||||
{{ t('Basic data') }}
|
{{ t('Basic data') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<div class="full-width row wrap justify-between content-between">
|
<div class="full-width row wrap justify-between content-between">
|
||||||
<div class="column" style="min-width: 50%">
|
<div class="column" style="min-width: 50%">
|
||||||
|
|
|
@ -61,6 +61,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
:url-update="`Entries/${route.params.id}`"
|
:url-update="`Entries/${route.params.id}`"
|
||||||
model="entry"
|
model="entry"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -43,7 +43,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
item: {
|
item: {
|
||||||
component: QBtn,
|
component: QBtn,
|
||||||
props: {
|
props: {
|
||||||
color: 'blue',
|
color: 'primary',
|
||||||
flat: true,
|
flat: true,
|
||||||
},
|
},
|
||||||
event: () => ({}),
|
event: () => ({}),
|
||||||
|
@ -54,6 +54,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
class: 'input-number',
|
class: 'input-number',
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -67,6 +68,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
'use-input': true,
|
'use-input': true,
|
||||||
'hide-selected': true,
|
'hide-selected': true,
|
||||||
options: packagingsOptions.value,
|
options: packagingsOptions.value,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -76,6 +78,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
class: 'input-number',
|
class: 'input-number',
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -84,6 +87,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -92,6 +96,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -100,6 +105,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -108,6 +114,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -116,6 +123,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -124,6 +132,7 @@ const tableColumnComponents = computed(() => ({
|
||||||
props: {
|
props: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
dense: true,
|
||||||
},
|
},
|
||||||
event: getInputEvents,
|
event: getInputEvents,
|
||||||
},
|
},
|
||||||
|
@ -276,7 +285,7 @@ const toggleGroupingMode = async (buy, mode) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showLockIcon = (groupingMode, mode) => {
|
const lockIconType = (groupingMode, mode) => {
|
||||||
if (mode === 'packing') {
|
if (mode === 'packing') {
|
||||||
return groupingMode === 2 ? 'lock' : 'lock_open';
|
return groupingMode === 2 ? 'lock' : 'lock_open';
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,17 +329,21 @@ const showLockIcon = (groupingMode, mode) => {
|
||||||
:columns="entriesTableColumns"
|
:columns="entriesTableColumns"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
hide-bottom
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
:grid="$q.screen.lt.md"
|
:grid="$q.screen.lt.md"
|
||||||
v-model:selected="rowsSelected"
|
v-model:selected="rowsSelected"
|
||||||
|
:no-data-label="t('globals.noResults')"
|
||||||
>
|
>
|
||||||
<template #body="props">
|
<template #body="props">
|
||||||
<QTr>
|
<QTr>
|
||||||
<QTd>
|
<QTd>
|
||||||
<QCheckbox v-model="props.selected" />
|
<QCheckbox v-model="props.selected" />
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd v-for="col in props.cols" :key="col.name">
|
<QTd
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
style="max-width: 100px"
|
||||||
|
>
|
||||||
<component
|
<component
|
||||||
:is="tableColumnComponents[col.name].component"
|
:is="tableColumnComponents[col.name].component"
|
||||||
v-bind="tableColumnComponents[col.name].props"
|
v-bind="tableColumnComponents[col.name].props"
|
||||||
|
@ -350,7 +363,7 @@ const showLockIcon = (groupingMode, mode) => {
|
||||||
>
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
:icon="
|
:icon="
|
||||||
showLockIcon(props.row.groupingMode, col.name)
|
lockIconType(props.row.groupingMode, col.name)
|
||||||
"
|
"
|
||||||
@click="toggleGroupingMode(props.row, col.name)"
|
@click="toggleGroupingMode(props.row, col.name)"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@ -359,6 +372,16 @@ const showLockIcon = (groupingMode, mode) => {
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
push
|
push
|
||||||
|
:style="{
|
||||||
|
'font-variation-settings': `'FILL' ${
|
||||||
|
lockIconType(
|
||||||
|
props.row.groupingMode,
|
||||||
|
col.name
|
||||||
|
) === 'lock'
|
||||||
|
? 1
|
||||||
|
: 0
|
||||||
|
}`,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template
|
<template
|
||||||
|
@ -397,7 +420,7 @@ const showLockIcon = (groupingMode, mode) => {
|
||||||
</QTr>
|
</QTr>
|
||||||
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
|
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
|
||||||
<QTr v-if="props.rowIndex !== rows.length - 1" class="separation-row">
|
<QTr v-if="props.rowIndex !== rows.length - 1" class="separation-row">
|
||||||
<QTd colspan="12" style="height: 24px" />
|
<QTd colspan="12" class="vn-table-separation-row" />
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
<template #item="props">
|
<template #item="props">
|
||||||
|
@ -448,9 +471,6 @@ const showLockIcon = (groupingMode, mode) => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.separation-row {
|
|
||||||
background-color: var(--vn-gray) !important;
|
|
||||||
}
|
|
||||||
.grid-style-transition {
|
.grid-style-transition {
|
||||||
transition: transform 0.28s, background-color 0.28s;
|
transition: transform 0.28s, background-color 0.28s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import EntryDescriptor from './EntryDescriptor.vue';
|
import EntryDescriptor from './EntryDescriptor.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -33,7 +34,9 @@ const stateStore = useStateStore();
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
|
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
|
|
||||||
|
@ -25,6 +26,8 @@ const $props = defineProps({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openReport } = usePrintService();
|
const { openReport } = usePrintService();
|
||||||
|
const state = useState();
|
||||||
|
const entryDescriptorRef = ref(null);
|
||||||
|
|
||||||
const entryFilter = {
|
const entryFilter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -71,6 +74,8 @@ const data = ref(useCardDescription());
|
||||||
const setData = (entity) =>
|
const setData = (entity) =>
|
||||||
(data.value = useCardDescription(entity.supplier.nickname, entity.id));
|
(data.value = useCardDescription(entity.supplier.nickname, entity.id));
|
||||||
|
|
||||||
|
const currentEntry = computed(() => state.get('entry'));
|
||||||
|
|
||||||
const getEntryRedirectionFilter = (entry) => {
|
const getEntryRedirectionFilter = (entry) => {
|
||||||
let entryTravel = entry && entry.travel;
|
let entryTravel = entry && entry.travel;
|
||||||
|
|
||||||
|
@ -95,17 +100,20 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
const showEntryReport = () => {
|
const showEntryReport = () => {
|
||||||
openReport(`Entries/${route.params.id}/entry-order-pdf`);
|
openReport(`Entries/${route.params.id}/entry-order-pdf`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
|
ref="entryDescriptorRef"
|
||||||
module="Entry"
|
module="Entry"
|
||||||
:url="`Entries/${entityId}`"
|
:url="`Entries/${entityId}`"
|
||||||
:filter="entryFilter"
|
:filter="entryFilter"
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="entryData"
|
data-key="entry"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
||||||
|
@ -126,17 +134,17 @@ const showEntryReport = () => {
|
||||||
:value="entity.travel?.warehouseOut?.name"
|
:value="entity.travel?.warehouseOut?.name"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons>
|
||||||
<QCardActions class="q-gutter-x-md">
|
<QCardActions class="q-gutter-x-md">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="entity.isExcludedFromAvailable"
|
v-if="currentEntry.isExcludedFromAvailable"
|
||||||
name="vn:inventory"
|
name="vn:inventory"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Inventory entry') }}</QTooltip>
|
<QTooltip>{{ t('Inventory entry') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="entity.isRaid" name="vn:web" color="primary" size="xs">
|
<QIcon v-if="currentEntry.isRaid" name="vn:net" color="primary" size="xs">
|
||||||
<QTooltip>{{ t('Virtual entry') }}</QTooltip>
|
<QTooltip>{{ t('Virtual entry') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
|
|
|
@ -165,20 +165,27 @@ const fetchEntryBuys = async () => {
|
||||||
@on-fetch="(data) => setEntryData(data)"
|
@on-fetch="(data) => setEntryData(data)"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<a class="header link" :href="entryUrl">
|
<router-link
|
||||||
|
v-if="route.name !== 'EntrySummary'"
|
||||||
|
:to="{ name: 'EntrySummary', params: { id: entityId } }"
|
||||||
|
class="header link"
|
||||||
|
:href="entryUrl"
|
||||||
|
>
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
</a>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="entryUrl">
|
<router-link
|
||||||
|
:to="{ name: 'EntryBasicData', params: { id: entityId } }"
|
||||||
|
class="header header-link"
|
||||||
|
>
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
||||||
|
|
||||||
|
@ -192,25 +199,15 @@ const fetchEntryBuys = async () => {
|
||||||
:label="t('entry.summary.invoiceNumber')"
|
:label="t('entry.summary.invoiceNumber')"
|
||||||
:value="entry.invoiceNumber"
|
:value="entry.invoiceNumber"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.ordered')" :value="entry.isOrdered" />
|
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.confirmed')" :value="entry.isConfirmed" />
|
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.booked')" :value="entry.isBooked" />
|
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.raid')" :value="entry.isRaid" />
|
|
||||||
|
|
||||||
<VnLv
|
|
||||||
:label="t('entry.summary.excludedFromAvailable')"
|
|
||||||
:value="entry.isExcludedFromAvailable"
|
|
||||||
/>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="entryUrl">
|
<router-link
|
||||||
{{ t('Travel data') }}
|
:to="{ name: 'EntryBasicData', params: { id: entityId } }"
|
||||||
<QIcon name="open_in_new" color="primary" />
|
class="header header-link"
|
||||||
</a>
|
>
|
||||||
|
{{ t('globals.summary.basicData') }}
|
||||||
|
<QIcon name="open_in_new" />
|
||||||
|
</router-link>
|
||||||
|
|
||||||
<VnLv :label="t('entry.summary.travelReference')">
|
<VnLv :label="t('entry.summary.travelReference')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
@ -236,11 +233,11 @@ const fetchEntryBuys = async () => {
|
||||||
:value="entry.travel.warehouseOut.name"
|
:value="entry.travel.warehouseOut.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelDelivered')"
|
:label="t('entry.summary.travelDelivered')"
|
||||||
:value="entry.travel.isDelivered"
|
v-model="entry.travel.isDelivered"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.summary.travelLanded')"
|
:label="t('entry.summary.travelLanded')"
|
||||||
:value="toDate(entry.travel.landed)"
|
:value="toDate(entry.travel.landed)"
|
||||||
|
@ -251,21 +248,57 @@ const fetchEntryBuys = async () => {
|
||||||
:value="entry.travel.warehouseIn.name"
|
:value="entry.travel.warehouseIn.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('entry.summary.travelReceived')"
|
:label="t('entry.summary.travelReceived')"
|
||||||
:value="entry.travel.isReceived"
|
v-model="entry.travel.isReceived"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
</QCard>
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'TravelSummary', params: { id: entry.travel.id } }"
|
||||||
|
class="header header-link"
|
||||||
|
>
|
||||||
|
{{ t('Travel data') }}
|
||||||
|
<QIcon name="open_in_new" />
|
||||||
|
</router-link>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.summary.ordered')"
|
||||||
|
v-model="entry.isOrdered"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.summary.confirmed')"
|
||||||
|
v-model="entry.isConfirmed"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.summary.booked')"
|
||||||
|
v-model="entry.isBooked"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.summary.raid')"
|
||||||
|
v-model="entry.isRaid"
|
||||||
|
:disable="true"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.summary.excludedFromAvailable')"
|
||||||
|
v-model="entry.isExcludedFromAvailable"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-two" style="min-width: 100%">
|
<QCard class="vn-two" style="min-width: 100%">
|
||||||
<a class="header">
|
<a class="header header-link">
|
||||||
{{ t('entry.summary.buys') }}
|
{{ t('entry.summary.buys') }}
|
||||||
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable
|
<QTable
|
||||||
:rows="entryBuys"
|
:rows="entryBuys"
|
||||||
:columns="entriesTableColumns"
|
:columns="entriesTableColumns"
|
||||||
hide-bottom
|
|
||||||
row-key="index"
|
row-key="index"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
|
:no-data-label="t('globals.noResults')"
|
||||||
>
|
>
|
||||||
<template #body="{ cols, row, rowIndex }">
|
<template #body="{ cols, row, rowIndex }">
|
||||||
<QTr no-hover>
|
<QTr no-hover>
|
||||||
|
@ -311,11 +344,8 @@ const fetchEntryBuys = async () => {
|
||||||
</QTd>
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
|
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
|
||||||
<QTr
|
<QTr v-if="rowIndex !== entryBuys.length - 1">
|
||||||
v-if="rowIndex !== entryBuys.length - 1"
|
<QTd colspan="10" class="vn-table-separation-row" />
|
||||||
class="separation-row"
|
|
||||||
>
|
|
||||||
<QTd colspan="10" style="height: 24px" />
|
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
@ -324,13 +354,7 @@ const fetchEntryBuys = async () => {
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.separation-row {
|
|
||||||
background-color: var(--vn-gray) !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Travel data: 'Datos envío'
|
Travel data: Datos envío
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed } from 'vue';
|
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
@ -8,11 +8,16 @@ import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
import EntryDescriptorProxy from './Card/EntryDescriptorProxy.vue';
|
import EntryDescriptorProxy from './Card/EntryDescriptorProxy.vue';
|
||||||
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
|
||||||
import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue';
|
import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
||||||
|
import ItemDescriptorProxy from '../Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toDate, toCurrency } from 'src/filters';
|
import { toDate, toCurrency } from 'src/filters';
|
||||||
import { useSession } from 'composables/useSession';
|
import { useSession } from 'composables/useSession';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
|
@ -21,11 +26,72 @@ const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const rowsFetchDataRef = ref(null);
|
const rowsFetchDataRef = ref(null);
|
||||||
|
const itemTypesOptions = ref([]);
|
||||||
|
const originsOptions = ref([]);
|
||||||
|
const itemFamiliesOptions = ref([]);
|
||||||
|
const intrastatOptions = ref([]);
|
||||||
|
const packagingsOptions = ref([]);
|
||||||
const editTableCellDialogRef = ref(null);
|
const editTableCellDialogRef = ref(null);
|
||||||
const visibleColumns = ref([]);
|
const visibleColumns = ref([]);
|
||||||
const allColumnNames = ref([]);
|
const allColumnNames = ref([]);
|
||||||
const rows = ref([]);
|
|
||||||
|
const exprBuilder = (param, value) => {
|
||||||
|
switch (param) {
|
||||||
|
case 'id':
|
||||||
|
case 'size':
|
||||||
|
case 'weightByPiece':
|
||||||
|
case 'isActive':
|
||||||
|
case 'family':
|
||||||
|
case 'minPrice':
|
||||||
|
case 'packingOut':
|
||||||
|
return { [`i.${param}`]: value };
|
||||||
|
case 'name':
|
||||||
|
case 'description':
|
||||||
|
return { [`i.${param}`]: { like: `%${value}%` } };
|
||||||
|
case 'code':
|
||||||
|
return { 'it.code': value };
|
||||||
|
case 'intrastat':
|
||||||
|
return { 'intr.description': value };
|
||||||
|
case 'origin':
|
||||||
|
return { 'ori.code': value };
|
||||||
|
case 'landing':
|
||||||
|
return { [`lb.${param}`]: value };
|
||||||
|
case 'packing':
|
||||||
|
case 'grouping':
|
||||||
|
case 'quantity':
|
||||||
|
case 'entryFk':
|
||||||
|
case 'buyingValue':
|
||||||
|
case 'freightValue':
|
||||||
|
case 'comissionValue':
|
||||||
|
case 'packageValue':
|
||||||
|
case 'isIgnored':
|
||||||
|
case 'price2':
|
||||||
|
case 'price3':
|
||||||
|
case 'ektFk':
|
||||||
|
case 'weight':
|
||||||
|
case 'packagingFk':
|
||||||
|
return { [`b.${param}`]: value };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const params = reactive({});
|
||||||
|
const arrayData = useArrayData('EntryLatestBuys', {
|
||||||
|
url: 'Buys/latestBuysFilter',
|
||||||
|
order: ['itemFk DESC'],
|
||||||
|
exprBuilder: exprBuilder,
|
||||||
|
});
|
||||||
|
const store = arrayData.store;
|
||||||
|
const rows = computed(() => store.data);
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
|
|
||||||
|
const getInputEvents = (col) => {
|
||||||
|
return col.columnFilter.type === 'select'
|
||||||
|
? { 'update:modelValue': () => applyColumnFilter(col) }
|
||||||
|
: {
|
||||||
|
'keyup.enter': () => applyColumnFilter(col),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.picture'),
|
label: t('entry.latestBuys.picture'),
|
||||||
|
@ -37,12 +103,32 @@ const columns = computed(() => [
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
field: 'itemFk',
|
field: 'itemFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.packing'),
|
label: t('entry.latestBuys.packing'),
|
||||||
field: 'packing',
|
field: 'packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -50,6 +136,16 @@ const columns = computed(() => [
|
||||||
field: 'grouping',
|
field: 'grouping',
|
||||||
name: 'grouping',
|
name: 'grouping',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -57,12 +153,32 @@ const columns = computed(() => [
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
name: 'quantity',
|
name: 'quantity',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('globals.description'),
|
label: t('globals.description'),
|
||||||
field: 'description',
|
field: 'description',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -70,35 +186,104 @@ const columns = computed(() => [
|
||||||
field: 'size',
|
field: 'size',
|
||||||
name: 'size',
|
name: 'size',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.tags'),
|
label: t('entry.latestBuys.tags'),
|
||||||
name: 'tags',
|
name: 'tags',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.type'),
|
label: t('entry.latestBuys.type'),
|
||||||
field: 'code',
|
field: 'code',
|
||||||
name: 'type',
|
name: 'type',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnSelectFilter,
|
||||||
|
type: 'select',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
options: itemTypesOptions.value,
|
||||||
|
'option-value': 'code',
|
||||||
|
'option-label': 'code',
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.intrastat'),
|
label: t('entry.latestBuys.intrastat'),
|
||||||
field: 'intrastat',
|
field: 'intrastat',
|
||||||
name: 'intrastat',
|
name: 'intrastat',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnSelectFilter,
|
||||||
|
type: 'select',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
options: intrastatOptions.value,
|
||||||
|
'option-value': 'description',
|
||||||
|
'option-label': 'description',
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.origin'),
|
label: t('entry.latestBuys.origin'),
|
||||||
field: 'origin',
|
field: 'origin',
|
||||||
name: 'origin',
|
name: 'origin',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnSelectFilter,
|
||||||
|
type: 'select',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
options: originsOptions.value,
|
||||||
|
'option-value': 'code',
|
||||||
|
'option-label': 'code',
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.weightByPiece'),
|
label: t('entry.latestBuys.weightByPiece'),
|
||||||
field: 'weightByPiece',
|
field: 'weightByPiece',
|
||||||
name: 'weightByPiece',
|
name: 'weightByPiece',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -106,24 +291,67 @@ const columns = computed(() => [
|
||||||
field: 'isActive',
|
field: 'isActive',
|
||||||
name: 'isActive',
|
name: 'isActive',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.family'),
|
label: t('entry.latestBuys.family'),
|
||||||
field: 'family',
|
field: 'family',
|
||||||
name: 'family',
|
name: 'family',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnSelectFilter,
|
||||||
|
type: 'select',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
options: itemFamiliesOptions.value,
|
||||||
|
'option-value': 'code',
|
||||||
|
'option-label': 'code',
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.entryFk'),
|
label: t('entry.latestBuys.entryFk'),
|
||||||
field: 'entryFk',
|
field: 'entryFk',
|
||||||
name: 'entryFk',
|
name: 'entryFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.buyingValue'),
|
label: t('entry.latestBuys.buyingValue'),
|
||||||
field: 'buyingValue',
|
field: 'buyingValue',
|
||||||
name: 'buyingValue',
|
name: 'buyingValue',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -131,6 +359,16 @@ const columns = computed(() => [
|
||||||
field: 'freightValue',
|
field: 'freightValue',
|
||||||
name: 'freightValue',
|
name: 'freightValue',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -138,6 +376,16 @@ const columns = computed(() => [
|
||||||
field: 'comissionValue',
|
field: 'comissionValue',
|
||||||
name: 'comissionValue',
|
name: 'comissionValue',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -145,6 +393,16 @@ const columns = computed(() => [
|
||||||
field: 'packageValue',
|
field: 'packageValue',
|
||||||
name: 'packageValue',
|
name: 'packageValue',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -152,12 +410,33 @@ const columns = computed(() => [
|
||||||
field: 'isIgnored',
|
field: 'isIgnored',
|
||||||
name: 'isIgnored',
|
name: 'isIgnored',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.price2'),
|
label: t('entry.latestBuys.price2'),
|
||||||
field: 'price2',
|
field: 'price2',
|
||||||
name: 'price2',
|
name: 'price2',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -165,6 +444,16 @@ const columns = computed(() => [
|
||||||
field: 'price3',
|
field: 'price3',
|
||||||
name: 'price3',
|
name: 'price3',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -172,6 +461,16 @@ const columns = computed(() => [
|
||||||
field: 'minPrice',
|
field: 'minPrice',
|
||||||
name: 'minPrice',
|
name: 'minPrice',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toCurrency(val),
|
format: (val) => toCurrency(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -179,6 +478,16 @@ const columns = computed(() => [
|
||||||
field: 'ektFk',
|
field: 'ektFk',
|
||||||
name: 'ektFk',
|
name: 'ektFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -186,18 +495,51 @@ const columns = computed(() => [
|
||||||
field: 'weight',
|
field: 'weight',
|
||||||
name: 'weight',
|
name: 'weight',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.packagingFk'),
|
label: t('entry.latestBuys.packagingFk'),
|
||||||
field: 'packagingFk',
|
field: 'packagingFk',
|
||||||
name: 'packagingFk',
|
name: 'packagingFk',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnSelectFilter,
|
||||||
|
type: 'select',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
options: packagingsOptions.value,
|
||||||
|
'option-value': 'id',
|
||||||
|
'option-label': 'id',
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.latestBuys.packingOut'),
|
label: t('entry.latestBuys.packingOut'),
|
||||||
field: 'packingOut',
|
field: 'packingOut',
|
||||||
name: 'packingOut',
|
name: 'packingOut',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -205,6 +547,16 @@ const columns = computed(() => [
|
||||||
field: 'landing',
|
field: 'landing',
|
||||||
name: 'landing',
|
name: 'landing',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: {
|
||||||
|
component: VnInput,
|
||||||
|
type: 'text',
|
||||||
|
filterValue: null,
|
||||||
|
event: getInputEvents,
|
||||||
|
attrs: {
|
||||||
|
dense: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
format: (val) => toDate(val),
|
format: (val) => toDate(val),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
@ -234,20 +586,55 @@ const redirectToEntryBuys = (entryFk) => {
|
||||||
router.push({ name: 'EntryBuys', params: { id: entryFk } });
|
router.push({ name: 'EntryBuys', params: { id: entryFk } });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const applyColumnFilter = async (col) => {
|
||||||
|
try {
|
||||||
|
params[col.field] = col.columnFilter.filterValue;
|
||||||
|
await arrayData.addFilter({ params });
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error applying column filter', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
|
const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
|
||||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||||
|
await arrayData.fetch({ append: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="rowsFetchDataRef"
|
url="ItemTypes"
|
||||||
url="Buys/latestBuysFilter"
|
:filter="{ fields: ['code'], order: 'code ASC', limit: 30 }"
|
||||||
:filter="{ order: 'itemFk DESC', limit: 20 }"
|
|
||||||
@on-fetch="(data) => (rows = data)"
|
|
||||||
auto-load
|
auto-load
|
||||||
|
@on-fetch="(data) => (itemTypesOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Origins"
|
||||||
|
:filter="{ fields: ['code'], order: 'code ASC', limit: 30 }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (originsOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="ItemFamilies"
|
||||||
|
:filter="{ fields: ['code'], order: 'code ASC', limit: 30 }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (itemFamiliesOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Packagings"
|
||||||
|
:filter="{ fields: ['id'], order: 'id ASC', limit: 30 }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (packagingsOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Intrastats"
|
||||||
|
:filter="{ fields: ['description'], order: 'description ASC', limit: 30 }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (intrastatOptions = data)"
|
||||||
/>
|
/>
|
||||||
<QToolbar class="bg-vn-dark justify-end">
|
<QToolbar class="bg-vn-dark justify-end">
|
||||||
<div id="st-data">
|
<div id="st-data">
|
||||||
|
@ -261,19 +648,43 @@ onMounted(async () => {
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div id="st-actions"></div>
|
<div id="st-actions"></div>
|
||||||
</QToolbar>
|
</QToolbar>
|
||||||
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
|
<QScrollArea class="fit text-grey-8">
|
||||||
|
<EntryLatestBuysFilter data-key="EntryLatestBuys" :tags="tags" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
hide-bottom
|
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
:pagination="{ rowsPerPage: 0 }"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:selected="rowsSelected"
|
v-model:selected="rowsSelected"
|
||||||
|
:no-data-label="t('globals.noResults')"
|
||||||
@row-click="(_, row) => redirectToEntryBuys(row.entryFk)"
|
@row-click="(_, row) => redirectToEntryBuys(row.entryFk)"
|
||||||
>
|
>
|
||||||
|
<template #top-row="{ cols }">
|
||||||
|
<QTr>
|
||||||
|
<QTd />
|
||||||
|
<QTd
|
||||||
|
v-for="(col, index) in cols"
|
||||||
|
:key="index"
|
||||||
|
style="max-width: 100px"
|
||||||
|
>
|
||||||
|
<component
|
||||||
|
:is="col.columnFilter.component"
|
||||||
|
v-if="col.name !== 'picture'"
|
||||||
|
v-model="col.columnFilter.filterValue"
|
||||||
|
v-bind="col.columnFilter.attrs"
|
||||||
|
v-on="col.columnFilter.event(col)"
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
</QTd>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
<template #body-cell-picture="{ row }">
|
<template #body-cell-picture="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QImg
|
<QImg
|
||||||
|
@ -288,9 +699,10 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-itemFk="{ row }">
|
<template #body-cell-itemFk="{ row }">
|
||||||
<QTd @click.stop>
|
<QTd @click.stop>
|
||||||
<QBtn flat color="blue">
|
<QBtn flat color="primary">
|
||||||
{{ row.itemFk }}
|
{{ row.itemFk }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-tags="{ row }">
|
<template #body-cell-tags="{ row }">
|
||||||
|
@ -300,7 +712,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-entryFk="{ row }">
|
<template #body-cell-entryFk="{ row }">
|
||||||
<QTd @click.stop>
|
<QTd @click.stop>
|
||||||
<QBtn flat color="blue">
|
<QBtn flat color="primary">
|
||||||
<EntryDescriptorProxy :id="row.entryFk" />
|
<EntryDescriptorProxy :id="row.entryFk" />
|
||||||
{{ row.entryFk }}
|
{{ row.entryFk }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -0,0 +1,474 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
|
||||||
|
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const itemCategories = ref([]);
|
||||||
|
const selectedCategoryFk = ref(null);
|
||||||
|
const selectedTypeFk = ref(null);
|
||||||
|
const itemTypesOptions = ref([]);
|
||||||
|
const itemTypeWorkersOptions = ref([]);
|
||||||
|
const suppliersOptions = ref([]);
|
||||||
|
const tagOptions = ref([]);
|
||||||
|
const tagValues = ref([]);
|
||||||
|
|
||||||
|
const categoryList = computed(() => {
|
||||||
|
return (itemCategories.value || [])
|
||||||
|
.filter((category) => category.display)
|
||||||
|
.map((category) => ({
|
||||||
|
...category,
|
||||||
|
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectedCategory = computed(() =>
|
||||||
|
(itemCategories.value || []).find(
|
||||||
|
(category) => category?.id === selectedCategoryFk.value
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const selectedType = computed(() => {
|
||||||
|
return (itemTypesOptions.value || []).find(
|
||||||
|
(type) => type?.id === selectedTypeFk.value
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectCategory = async (params, categoryId, search) => {
|
||||||
|
if (params.categoryFk === categoryId) {
|
||||||
|
resetCategory(params);
|
||||||
|
search();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selectedCategoryFk.value = categoryId;
|
||||||
|
params.categoryFk = categoryId;
|
||||||
|
await fetchItemTypes(categoryId);
|
||||||
|
search();
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetCategory = (params) => {
|
||||||
|
selectedCategoryFk.value = null;
|
||||||
|
itemTypesOptions.value = null;
|
||||||
|
if (params) {
|
||||||
|
params.categoryFk = null;
|
||||||
|
params.typeFk = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const applyTags = (params, search) => {
|
||||||
|
params.tags = tagValues.value
|
||||||
|
.filter((tag) => tag.selectedTag && tag.value)
|
||||||
|
.map((tag) => ({
|
||||||
|
tagFk: tag.selectedTag.id,
|
||||||
|
tagName: tag.selectedTag.name,
|
||||||
|
value: tag.value,
|
||||||
|
}));
|
||||||
|
search();
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchItemTypes = async (id) => {
|
||||||
|
try {
|
||||||
|
const filter = {
|
||||||
|
fields: ['id', 'name', 'categoryFk'],
|
||||||
|
where: { categoryFk: id },
|
||||||
|
include: 'category',
|
||||||
|
order: 'name ASC',
|
||||||
|
};
|
||||||
|
const { data } = await axios.get('ItemTypes', {
|
||||||
|
params: { filter: JSON.stringify(filter) },
|
||||||
|
});
|
||||||
|
itemTypesOptions.value = data;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error fetching item types', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getCategoryClass = (category, params) => {
|
||||||
|
if (category.id === params?.categoryFk) {
|
||||||
|
return 'active';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSelectedTagValues = async (tag) => {
|
||||||
|
try {
|
||||||
|
tag.value = null;
|
||||||
|
const filter = {
|
||||||
|
fields: ['value'],
|
||||||
|
order: 'value ASC',
|
||||||
|
limit: 30,
|
||||||
|
};
|
||||||
|
|
||||||
|
const params = { filter: JSON.stringify(filter) };
|
||||||
|
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
tag.valueOptions = data;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error getting selected tag values');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeTag = (index, params, search) => {
|
||||||
|
(tagValues.value || []).splice(index, 1);
|
||||||
|
applyTags(params, search);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="ItemCategories"
|
||||||
|
limit="30"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (itemCategories = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="TicketRequests/getItemTypeWorker"
|
||||||
|
limit="30"
|
||||||
|
auto-load
|
||||||
|
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
||||||
|
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Suppliers"
|
||||||
|
limit="30"
|
||||||
|
auto-load
|
||||||
|
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC', limit: 30 }"
|
||||||
|
@on-fetch="(data) => (suppliersOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Tags"
|
||||||
|
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||||
|
auto-load
|
||||||
|
limit="30"
|
||||||
|
@on-fetch="(data) => (tagOptions = data)"
|
||||||
|
/>
|
||||||
|
<VnFilterPanel
|
||||||
|
:data-key="props.dataKey"
|
||||||
|
:expr-builder="exprBuilder"
|
||||||
|
:custom-tags="['tags']"
|
||||||
|
@init="onFilterInit"
|
||||||
|
@remove="clearFilter"
|
||||||
|
>
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<strong v-if="tag.label === 'categoryFk'">
|
||||||
|
{{ t(selectedCategory?.name || '') }}
|
||||||
|
</strong>
|
||||||
|
<strong v-else-if="tag.label === 'typeFk'">
|
||||||
|
{{ t(selectedType?.name || '') }}
|
||||||
|
</strong>
|
||||||
|
<div v-else class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #customTags="{ tags: customTags, params }">
|
||||||
|
<template v-for="tag in customTags" :key="tag.label">
|
||||||
|
<VnFilterPanelChip
|
||||||
|
v-for="chip in tag.value"
|
||||||
|
:key="chip"
|
||||||
|
removable
|
||||||
|
@remove="removeTagChip(chip, params, searchFn)"
|
||||||
|
>
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ chip.tagName }}: </strong>
|
||||||
|
<span>"{{ chip.value }}"</span>
|
||||||
|
</div>
|
||||||
|
</VnFilterPanelChip>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params, searchFn }">
|
||||||
|
<QItem class="category-filter q-mt-md">
|
||||||
|
<QBtn
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
v-for="category in categoryList"
|
||||||
|
:key="category.name"
|
||||||
|
:class="['category', getCategoryClass(category, params)]"
|
||||||
|
:icon="category.icon"
|
||||||
|
@click="selectCategory(params, category.id, searchFn)"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t(category.name) }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-my-md">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.typeFk')"
|
||||||
|
v-model="params.typeFk"
|
||||||
|
:options="itemTypesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
use-input
|
||||||
|
:disable="!selectedCategoryFk"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
selectedTypeFk = value;
|
||||||
|
searchFn();
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #option="{ itemProps, opt }">
|
||||||
|
<QItem v-bind="itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ opt.categoryName }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectFilter>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QSeparator />
|
||||||
|
<QItem class="q-my-md">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.salesPersonFk')"
|
||||||
|
v-model="params.salesPersonFk"
|
||||||
|
:options="itemTypeWorkersOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
use-input
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-my-md">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.supplier')"
|
||||||
|
v-model="params.supplierFk"
|
||||||
|
:options="suppliersOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
use-input
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
>
|
||||||
|
<template #option="{ itemProps, opt }">
|
||||||
|
<QItem v-bind="itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ opt.nickname }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectFilter>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-my-md">
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.from')"
|
||||||
|
v-model="params.from"
|
||||||
|
is-outlined
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-my-md">
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('params.to')"
|
||||||
|
v-model="params.to"
|
||||||
|
is-outlined
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('params.active')"
|
||||||
|
v-model="params.active"
|
||||||
|
toggle-indeterminate
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('params.visible')"
|
||||||
|
v-model="params.visible"
|
||||||
|
toggle-indeterminate
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('params.floramondo')"
|
||||||
|
v-model="params.floramondo"
|
||||||
|
toggle-indeterminate
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
|
||||||
|
<QItem
|
||||||
|
v-for="(value, index) in tagValues"
|
||||||
|
:key="value"
|
||||||
|
class="q-mt-md filter-value"
|
||||||
|
>
|
||||||
|
<QItemSection class="col">
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.tag')"
|
||||||
|
v-model="value.selectedTag"
|
||||||
|
:options="tagOptions"
|
||||||
|
option-label="name"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
:emit-value="false"
|
||||||
|
use-input
|
||||||
|
:is-clearable="false"
|
||||||
|
@update:model-value="getSelectedTagValues(value)"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection class="col">
|
||||||
|
<VnSelectFilter
|
||||||
|
v-if="!value?.selectedTag?.isFree && value.valueOptions"
|
||||||
|
:label="t('params.value')"
|
||||||
|
v-model="value.value"
|
||||||
|
:options="value.valueOptions || []"
|
||||||
|
option-value="value"
|
||||||
|
option-label="value"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
emit-value
|
||||||
|
use-input
|
||||||
|
:disable="!value"
|
||||||
|
:is-clearable="false"
|
||||||
|
class="filter-input"
|
||||||
|
@update:model-value="applyTags(params, searchFn)"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-else
|
||||||
|
v-model="value.value"
|
||||||
|
:label="t('params.value')"
|
||||||
|
:disable="!value"
|
||||||
|
is-outlined
|
||||||
|
class="filter-input"
|
||||||
|
:is-clearable="false"
|
||||||
|
@keyup.enter="applyTags(params, searchFn)"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
<QIcon
|
||||||
|
name="delete"
|
||||||
|
class="filter-icon"
|
||||||
|
@click="removeTag(index, params, searchFn)"
|
||||||
|
/>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mt-lg">
|
||||||
|
<QIcon
|
||||||
|
name="add_circle"
|
||||||
|
class="filter-icon"
|
||||||
|
@click="tagValues.push({})"
|
||||||
|
/>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.category-filter {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
|
.category {
|
||||||
|
padding: 8px;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
background-color: var(--vn-light-gray);
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: $primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-icon {
|
||||||
|
font-size: 24px;
|
||||||
|
color: $primary;
|
||||||
|
padding: 0 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-input {
|
||||||
|
flex-shrink: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-value {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
supplier: Supplier
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
|
active: Is active
|
||||||
|
visible: Is visible
|
||||||
|
floramondo: Is floramondo
|
||||||
|
salesPersonFk: Buyer
|
||||||
|
categoryFk: Category
|
||||||
|
typeFk: Type
|
||||||
|
tag: Tag
|
||||||
|
value: Value
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
supplier: Proveedor
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
active: Activo
|
||||||
|
visible: Visible
|
||||||
|
floramondo: Floramondo
|
||||||
|
salesPersonFk: Comprador
|
||||||
|
categoryFk: Categoría
|
||||||
|
typeFk: Tipo
|
||||||
|
tag: Etiqueta
|
||||||
|
value: Valor
|
||||||
|
Plant: Planta
|
||||||
|
Flower: Flor
|
||||||
|
Handmade: Confección
|
||||||
|
Green: Verde
|
||||||
|
Accessories: Complemento
|
||||||
|
Fruit: Fruta
|
||||||
|
</i18n>
|
|
@ -74,7 +74,7 @@ onMounted(async () => {
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isRaid"
|
v-if="row.isRaid"
|
||||||
name="vn:web"
|
name="vn:net"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { onMounted, watch } from 'vue';
|
import { onMounted, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -74,7 +75,9 @@ watch(
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -74,7 +75,12 @@ async function insert() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Banks" auto-load limit="30" @on-fetch="(data) => (banks = data)" />
|
<FetchData
|
||||||
|
url="Accountings"
|
||||||
|
auto-load
|
||||||
|
limit="30"
|
||||||
|
@on-fetch="(data) => (banks = data)"
|
||||||
|
/>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-if="invoiceIn"
|
v-if="invoiceIn"
|
||||||
ref="invoiceInFormRef"
|
ref="invoiceInFormRef"
|
||||||
|
@ -158,7 +164,12 @@ async function insert() {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-amount="{ row }">
|
<template #body-cell-amount="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QInput v-model="row.amount" clearable clear-icon="close" />
|
<VnCurrency
|
||||||
|
v-model="row.amount"
|
||||||
|
:is-outlined="false"
|
||||||
|
clearable
|
||||||
|
clear-icon="close"
|
||||||
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-foreignvalue="{ row }">
|
<template #body-cell-foreignvalue="{ row }">
|
||||||
|
|
|
@ -209,9 +209,9 @@ function getLink(param) {
|
||||||
<!--Basic Data-->
|
<!--Basic Data-->
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<a class="header" :href="getLink('basic-data')">
|
<a class="header header-link" :href="getLink('basic-data')">
|
||||||
{{ t('invoiceIn.pageTitles.basicData') }}
|
{{ t('invoiceIn.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -233,9 +233,9 @@ function getLink(param) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<a class="header" :href="getLink('basic-data')">
|
<a class="header header-link" :href="getLink('basic-data')">
|
||||||
{{ t('invoiceIn.pageTitles.basicData') }}
|
{{ t('invoiceIn.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -258,9 +258,9 @@ function getLink(param) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<a class="header" :href="getLink('basic-data')">
|
<a class="header header-link" :href="getLink('basic-data')">
|
||||||
{{ t('invoiceIn.pageTitles.basicData') }}
|
{{ t('invoiceIn.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -275,16 +275,17 @@ function getLink(param) {
|
||||||
:label="t('invoiceIn.summary.company')"
|
:label="t('invoiceIn.summary.company')"
|
||||||
:value="invoiceIn.company?.code"
|
:value="invoiceIn.company?.code"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<QCheckbox
|
||||||
:label="t('invoiceIn.summary.booked')"
|
:label="t('invoiceIn.summary.booked')"
|
||||||
:value="invoiceIn.isBooked"
|
v-model="invoiceIn.isBooked"
|
||||||
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<a class="header" :href="getLink('basic-data')">
|
<a class="header header-link" :href="getLink('basic-data')">
|
||||||
{{ t('invoiceIn.pageTitles.basicData') }}
|
{{ t('invoiceIn.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
|
@ -318,9 +319,9 @@ function getLink(param) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<!--Vat-->
|
<!--Vat-->
|
||||||
<QCard v-if="invoiceIn.invoiceInTax.length">
|
<QCard v-if="invoiceIn.invoiceInTax.length">
|
||||||
<a class="header" :href="getLink('vat')">
|
<a class="header header-link" :href="getLink('vat')">
|
||||||
{{ t('invoiceIn.card.vat') }}
|
{{ t('invoiceIn.card.vat') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable
|
<QTable
|
||||||
:columns="vatColumns"
|
:columns="vatColumns"
|
||||||
|
@ -351,9 +352,9 @@ function getLink(param) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<!--Due Day-->
|
<!--Due Day-->
|
||||||
<QCard v-if="invoiceIn.invoiceInDueDay.length">
|
<QCard v-if="invoiceIn.invoiceInDueDay.length">
|
||||||
<a class="header" :href="getLink('due-day')">
|
<a class="header header-link" :href="getLink('due-day')">
|
||||||
{{ t('invoiceIn.card.dueDay') }}
|
{{ t('invoiceIn.card.dueDay') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable
|
<QTable
|
||||||
class="full-width"
|
class="full-width"
|
||||||
|
@ -381,9 +382,9 @@ function getLink(param) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<!--Intrastat-->
|
<!--Intrastat-->
|
||||||
<QCard v-if="invoiceIn.invoiceInIntrastat.length">
|
<QCard v-if="invoiceIn.invoiceInIntrastat.length">
|
||||||
<a class="header" :href="getUrl('intrastat')">
|
<a class="header header-link" :href="getLink('intrastat')">
|
||||||
{{ t('invoiceIn.card.intrastat') }}
|
{{ t('invoiceIn.card.intrastat') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable
|
<QTable
|
||||||
:columns="intrastatColumns"
|
:columns="intrastatColumns"
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { toCurrency } from 'src/filters';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -225,7 +226,7 @@ async function addExpense() {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-taxablebase="{ row }">
|
<template #body-cell-taxablebase="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QInput
|
<VnCurrency
|
||||||
:class="{
|
:class="{
|
||||||
'no-pointer-events': isNotEuro(invoiceIn.currency.code),
|
'no-pointer-events': isNotEuro(invoiceIn.currency.code),
|
||||||
}"
|
}"
|
||||||
|
@ -234,11 +235,7 @@ async function addExpense() {
|
||||||
clear-icon="close"
|
clear-icon="close"
|
||||||
v-model="row.taxableBase"
|
v-model="row.taxableBase"
|
||||||
clearable
|
clearable
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="euro" size="xs" flat />
|
|
||||||
</template>
|
|
||||||
</QInput>
|
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-sageiva="{ row, col }">
|
<template #body-cell-sageiva="{ row, col }">
|
||||||
|
@ -328,7 +325,7 @@ async function addExpense() {
|
||||||
</VnSelectFilter>
|
</VnSelectFilter>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnCurrency
|
||||||
:label="t('Taxable base')"
|
:label="t('Taxable base')"
|
||||||
:class="{
|
:class="{
|
||||||
'no-pointer-events': isNotEuro(
|
'no-pointer-events': isNotEuro(
|
||||||
|
@ -340,11 +337,7 @@ async function addExpense() {
|
||||||
clear-icon="close"
|
clear-icon="close"
|
||||||
v-model="props.row.taxableBase"
|
v-model="props.row.taxableBase"
|
||||||
clearable
|
clearable
|
||||||
>
|
/>
|
||||||
<template #append>
|
|
||||||
<QIcon name="euro" size="xs" flat />
|
|
||||||
</template>
|
|
||||||
</QInput>
|
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
|
|
|
@ -8,6 +8,7 @@ import FetchData from 'components/FetchData.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 { useCapitalize } from 'src/composables/useCapitalize';
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -137,16 +138,7 @@ const suppliersRef = ref();
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnCurrency v-model="params.amount" is-outlined />
|
||||||
:label="t('Amount')"
|
|
||||||
v-model="params.amount"
|
|
||||||
is-outlined
|
|
||||||
lazy-rules
|
|
||||||
>
|
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="euro" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-md">
|
<QItem class="q-mb-md">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -28,7 +29,9 @@ const { t } = useI18n();
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -95,15 +95,20 @@ const ticketsColumns = ref([
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary ref="summary" :url="`InvoiceOuts/${entityId}/summary`">
|
<CardSummary
|
||||||
|
ref="summary"
|
||||||
|
:url="`InvoiceOuts/${entityId}/summary`"
|
||||||
|
:entity-id="entityId"
|
||||||
|
>
|
||||||
<template #header="{ entity: { invoiceOut } }">
|
<template #header="{ entity: { invoiceOut } }">
|
||||||
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: { invoiceOut } }">
|
<template #body="{ entity: { invoiceOut } }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<div class="header">
|
<a class="header header-link">
|
||||||
{{ t('invoiceOut.pageTitles.basicData') }}
|
{{ t('invoiceOut.pageTitles.basicData') }}
|
||||||
</div>
|
<QIcon name="open_in_new" />
|
||||||
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('invoiceOut.summary.issued')"
|
:label="t('invoiceOut.summary.issued')"
|
||||||
:value="toDate(invoiceOut.issued)"
|
:value="toDate(invoiceOut.issued)"
|
||||||
|
@ -126,9 +131,10 @@ const ticketsColumns = ref([
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-three">
|
<QCard class="vn-three">
|
||||||
<div class="header">
|
<a class="header header-link">
|
||||||
{{ t('invoiceOut.summary.taxBreakdown') }}
|
{{ t('invoiceOut.summary.taxBreakdown') }}
|
||||||
</div>
|
<QIcon name="open_in_new" />
|
||||||
|
</a>
|
||||||
<QTable :columns="taxColumns" :rows="invoiceOut.taxesBreakdown" flat>
|
<QTable :columns="taxColumns" :rows="invoiceOut.taxesBreakdown" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
|
@ -140,9 +146,10 @@ const ticketsColumns = ref([
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-three">
|
<QCard class="vn-three">
|
||||||
<div class="header">
|
<a class="header header-link">
|
||||||
{{ t('invoiceOut.summary.tickets') }}
|
{{ t('invoiceOut.summary.tickets') }}
|
||||||
</div>
|
<QIcon name="open_in_new" />
|
||||||
|
</a>
|
||||||
<QTable v-if="tickets" :columns="ticketsColumns" :rows="tickets" flat>
|
<QTable v-if="tickets" :columns="ticketsColumns" :rows="tickets" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
|
|
|
@ -6,6 +6,7 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
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 VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -57,7 +58,11 @@ function setWorkers(data) {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput :label="t('Amount')" v-model="params.amount" is-outlined />
|
<VnCurrency
|
||||||
|
:label="t('Amount')"
|
||||||
|
v-model="params.amount"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
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 VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -84,7 +85,7 @@ const props = defineProps({
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnCurrency
|
||||||
v-model="params.amount"
|
v-model="params.amount"
|
||||||
:label="t('invoiceOut.negativeBases.amount')"
|
:label="t('invoiceOut.negativeBases.amount')"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
|
|
@ -4,6 +4,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import ItemDescriptor from './ItemDescriptor.vue';
|
import ItemDescriptor from './ItemDescriptor.vue';
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
</script>
|
</script>
|
||||||
|
@ -19,7 +20,9 @@ const stateStore = useStateStore();
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
|
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -69,12 +69,12 @@ async function onSubmit() {
|
||||||
<template>
|
<template>
|
||||||
<QForm @submit="onSubmit" class="q-gutter-y-md q-pa-lg formCard">
|
<QForm @submit="onSubmit" class="q-gutter-y-md q-pa-lg formCard">
|
||||||
<VnLogo alt="Logo" fit="contain" :ratio="16 / 9" class="q-mb-md" />
|
<VnLogo alt="Logo" fit="contain" :ratio="16 / 9" class="q-mb-md" />
|
||||||
|
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="username"
|
v-model="username"
|
||||||
:label="t('login.username')"
|
:label="t('login.username')"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
|
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
|
||||||
|
color="primary"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
type="password"
|
type="password"
|
||||||
|
@ -82,9 +82,8 @@ async function onSubmit() {
|
||||||
:label="t('login.password')"
|
:label="t('login.password')"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
|
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
|
||||||
|
class="red"
|
||||||
/>
|
/>
|
||||||
<QToggle v-model="keepLogin" :label="t('login.keepLogin')" />
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('login.submit')"
|
:label="t('login.submit')"
|
||||||
|
@ -95,6 +94,7 @@ async function onSubmit() {
|
||||||
unelevated
|
unelevated
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<QToggle v-model="keepLogin" :label="t('login.keepLogin')" />
|
||||||
</QForm>
|
</QForm>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -104,6 +104,9 @@ async function onSubmit() {
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-input {
|
||||||
|
color: $primary;
|
||||||
|
}
|
||||||
@media (max-width: $breakpoint-xs-max) {
|
@media (max-width: $breakpoint-xs-max) {
|
||||||
.formCard {
|
.formCard {
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
|
|
|
@ -99,6 +99,8 @@ onMounted(async () => {
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
$vnColor: #8ebb27;
|
||||||
|
|
||||||
.formCard {
|
.formCard {
|
||||||
max-width: 1500px;
|
max-width: 1500px;
|
||||||
min-width: 700px;
|
min-width: 700px;
|
||||||
|
|
|
@ -132,12 +132,11 @@ const openBuscaman = async (route, ticket) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<CardSummary ref="summary" :url="`Routes/${entityId}/summary`">
|
<CardSummary
|
||||||
<template #header-left>
|
ref="summary"
|
||||||
<RouterLink :to="{ name: `RouteSummary`, params: { id: entityId } }">
|
:url="`Routes/${entityId}/summary`"
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
:entity-id="entityId"
|
||||||
</RouterLink>
|
>
|
||||||
</template>
|
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -91,6 +91,24 @@ function downloadPdfs() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<template v-if="stateStore.isHeaderMounted()">
|
||||||
|
|
||||||
|
<Teleport to="#actions-append">
|
||||||
|
<div class="row q-gutter-x-sm">
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
@click="stateStore.toggleRightDrawer()"
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="menu"
|
||||||
|
>
|
||||||
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
{{ t('globals.collapseMenu') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
|
</Teleport>
|
||||||
|
</template>
|
||||||
<div class="column items-center">
|
<div class="column items-center">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
|
|
|
@ -71,11 +71,11 @@ const filter = {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<RouterLink
|
<RouterLink
|
||||||
class="header"
|
class="header header-link"
|
||||||
:to="{ name: 'ShelvingBasicData', params: { id: entityId } }"
|
:to="{ name: 'ShelvingBasicData', params: { id: entityId } }"
|
||||||
>
|
>
|
||||||
{{ t('shelving.pageTitles.basicData') }}
|
{{ t('shelving.pageTitles.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<VnLv :label="t('shelving.summary.code')" :value="entity.code" />
|
<VnLv :label="t('shelving.summary.code')" :value="entity.code" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -18,13 +18,16 @@ const quasar = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const bankEntitiesRef = ref(null);
|
||||||
const supplier = ref(null);
|
const supplier = ref(null);
|
||||||
const supplierAccountRef = ref(null);
|
const supplierAccountRef = ref(null);
|
||||||
const wireTransferFk = ref(null);
|
const wireTransferFk = ref(null);
|
||||||
const bankEntitiesOptions = ref([]);
|
const bankEntitiesOptions = ref([]);
|
||||||
|
|
||||||
const onBankEntityCreated = (data) => {
|
const onBankEntityCreated = async (dataSaved, rowData) => {
|
||||||
bankEntitiesOptions.value.push(data);
|
await bankEntitiesRef.value.fetch();
|
||||||
|
rowData.bankEntityFk = dataSaved.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangesSaved = () => {
|
const onChangesSaved = () => {
|
||||||
|
@ -63,6 +66,7 @@ onMounted(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
ref="bankEntitiesRef"
|
||||||
url="BankEntities"
|
url="BankEntities"
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
|
@ -114,13 +118,16 @@ onMounted(() => {
|
||||||
:label="t('worker.create.bankEntity')"
|
:label="t('worker.create.bankEntity')"
|
||||||
v-model="row.bankEntityFk"
|
v-model="row.bankEntityFk"
|
||||||
:options="bankEntitiesOptions"
|
:options="bankEntitiesOptions"
|
||||||
option-label="name"
|
option-label="bic"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
hide-selected
|
hide-selected
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateBankEntityForm
|
<CreateBankEntityForm
|
||||||
@on-data-saved="onBankEntityCreated($event)"
|
@on-data-saved="
|
||||||
|
(_, requestResponse) =>
|
||||||
|
onBankEntityCreated(requestResponse, row)
|
||||||
|
"
|
||||||
:show-entity-field="false"
|
:show-entity-field="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -83,8 +83,13 @@ const redirectToUpdateView = (addressData) => {
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]">
|
||||||
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
|
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('supplier.list.newSupplier') }}
|
{{ t('New address') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
New address: Nueva dirección
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -26,6 +26,7 @@ const workersOptions = ref([]);
|
||||||
:url-update="`Suppliers/${route.params.id}`"
|
:url-update="`Suppliers/${route.params.id}`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -33,6 +33,7 @@ const formatPayDems = (data) => {
|
||||||
:url-update="`Suppliers/${route.params.id}`"
|
:url-update="`Suppliers/${route.params.id}`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import SupplierDescriptor from './SupplierDescriptor.vue';
|
import SupplierDescriptor from './SupplierDescriptor.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -30,7 +31,9 @@ const { t } = useI18n();
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, nextTick } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -11,6 +11,15 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const supplierContactRef = ref(null);
|
const supplierContactRef = ref(null);
|
||||||
|
|
||||||
|
const insertRow = () => {
|
||||||
|
supplierContactRef.value.insert();
|
||||||
|
nextTick(() => {
|
||||||
|
const inputs = document.querySelectorAll('[input-name-focusable]');
|
||||||
|
const lastInput = inputs[inputs.length - 1];
|
||||||
|
if (lastInput) lastInput.focus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (supplierContactRef.value) supplierContactRef.value.reload();
|
if (supplierContactRef.value) supplierContactRef.value.reload();
|
||||||
});
|
});
|
||||||
|
@ -38,6 +47,7 @@ onMounted(() => {
|
||||||
<VnRow class="row q-gutter-md">
|
<VnRow class="row q-gutter-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
input-name-focusable
|
||||||
:label="t('supplier.contacts.name')"
|
:label="t('supplier.contacts.name')"
|
||||||
v-model="row.name"
|
v-model="row.name"
|
||||||
/>
|
/>
|
||||||
|
@ -92,7 +102,7 @@ onMounted(() => {
|
||||||
size="sm"
|
size="sm"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="supplierContactRef.insert()"
|
@click="insertRow()"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add contact') }}
|
{{ t('Add contact') }}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import { toDateString } from 'src/filters';
|
import { toDateString } from 'src/filters';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -21,6 +22,7 @@ const $props = defineProps({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const url = ref();
|
const url = ref();
|
||||||
|
const state = useState();
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: [
|
fields: [
|
||||||
|
@ -71,6 +73,8 @@ const setData = (entity) => {
|
||||||
data.value = useCardDescription(entity.ref, entity.id);
|
data.value = useCardDescription(entity.ref, entity.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const supplier = computed(() => state.get('supplier'));
|
||||||
|
|
||||||
const getEntryQueryParams = (supplier) => {
|
const getEntryQueryParams = (supplier) => {
|
||||||
if (!supplier) return null;
|
if (!supplier) return null;
|
||||||
|
|
||||||
|
@ -101,7 +105,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="Supplier"
|
data-key="supplier"
|
||||||
>
|
>
|
||||||
<template #header-extra-action>
|
<template #header-extra-action>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -133,10 +137,10 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
|
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
|
||||||
<VnLv :label="t('supplier.summary.account')" :value="entity.account" />
|
<VnLv :label="t('supplier.summary.account')" :value="entity.account" />
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons>
|
||||||
<QCardActions class="q-gutter-x-md">
|
<QCardActions v-if="supplier" class="q-gutter-x-md">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!entity.isActive"
|
v-if="!supplier.isActive"
|
||||||
name="vn:disabled"
|
name="vn:disabled"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -144,7 +148,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!entity.isSerious"
|
v-if="!supplier.isSerious"
|
||||||
name="vn:supplierfalse"
|
name="vn:supplierfalse"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -167,6 +171,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<QTooltip>{{ t('All entries with current supplier') }}</QTooltip>
|
<QTooltip>{{ t('All entries with current supplier') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
v-if="entity.client?.fi"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'CustomerCard',
|
name: 'CustomerCard',
|
||||||
params: { id: entity.client?.id },
|
params: { id: entity.client?.id },
|
||||||
|
|
|
@ -53,6 +53,7 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -51,21 +51,20 @@ const isAdministrative = computed(() => {
|
||||||
:url="`Suppliers/${entityId}/getSummary`"
|
:url="`Suppliers/${entityId}/getSummary`"
|
||||||
@on-fetch="(data) => setData(data)"
|
@on-fetch="(data) => setData(data)"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
|
||||||
<a v-if="isAdministrative" class="header link" :href="supplierUrl">
|
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ supplier.name }} - {{ supplier.id }}</span>
|
<span>{{ supplier.name }} - {{ supplier.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a v-if="isAdministrative" class="header link" :href="supplierUrl">
|
<router-link
|
||||||
|
v-if="isAdministrative"
|
||||||
|
class="header link"
|
||||||
|
:to="{ name: 'SupplierBasicData', params: { id: entityId } }"
|
||||||
|
>
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('globals.summary.basicData') }}</span>
|
<span v-else> {{ t('globals.summary.basicData') }}</span>
|
||||||
<VnLv label="Id" :value="supplier.id" />
|
<VnLv label="Id" :value="supplier.id" />
|
||||||
<VnLv label="Alias" :value="supplier.nickname" />
|
<VnLv label="Alias" :value="supplier.nickname" />
|
||||||
|
@ -82,33 +81,26 @@ const isAdministrative = computed(() => {
|
||||||
<span> {{ dashIfEmpty(supplier.note) }} </span>
|
<span> {{ dashIfEmpty(supplier.note) }} </span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
||||||
<VnLv :label="t('supplier.summary.verified')" class="q-mb-xs">
|
|
||||||
<template #value>
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
:label="t('supplier.summary.verified')"
|
||||||
v-model="supplier.isSerious"
|
v-model="supplier.isSerious"
|
||||||
dense
|
:disable="true"
|
||||||
disable
|
|
||||||
class="full-width q-mb-xs"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
<VnLv :label="t('supplier.summary.isActive')" class="q-mb-xs">
|
|
||||||
<template #value>
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
:label="t('supplier.summary.isActive')"
|
||||||
v-model="supplier.isActive"
|
v-model="supplier.isActive"
|
||||||
dense
|
:disable="true"
|
||||||
disable
|
|
||||||
class="full-width q-mb-xs"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a v-if="isAdministrative" class="header link" :href="supplierUrl">
|
<router-link
|
||||||
|
v-if="isAdministrative"
|
||||||
|
class="header link"
|
||||||
|
:to="{ name: 'SupplierBillingData', params: { id: entityId } }"
|
||||||
|
>
|
||||||
{{ t('supplier.summary.billingData') }}
|
{{ t('supplier.summary.billingData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.payMethod')"
|
:label="t('supplier.summary.payMethod')"
|
||||||
|
@ -124,10 +116,14 @@ const isAdministrative = computed(() => {
|
||||||
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a v-if="isAdministrative" class="header link" :href="supplierUrl">
|
<router-link
|
||||||
|
v-if="isAdministrative"
|
||||||
|
class="header link"
|
||||||
|
:to="{ name: 'SupplierFiscalData', params: { id: entityId } }"
|
||||||
|
>
|
||||||
{{ t('supplier.summary.fiscalData') }}
|
{{ t('supplier.summary.fiscalData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.sageTaxType')"
|
:label="t('supplier.summary.sageTaxType')"
|
||||||
|
@ -155,10 +151,14 @@ const isAdministrative = computed(() => {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a v-if="isAdministrative" class="header link" :href="supplierUrl">
|
<router-link
|
||||||
|
v-if="isAdministrative"
|
||||||
|
class="header link"
|
||||||
|
:to="{ name: 'SupplierFiscalData', params: { id: entityId } }"
|
||||||
|
>
|
||||||
{{ t('supplier.summary.fiscalAddress') }}
|
{{ t('supplier.summary.fiscalAddress') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.fiscalAddress') }}</span>
|
<span v-else> {{ t('supplier.summary.fiscalAddress') }}</span>
|
||||||
<VnLv :label="t('supplier.summary.socialName')" :value="supplier.name" />
|
<VnLv :label="t('supplier.summary.socialName')" :value="supplier.name" />
|
||||||
<VnLv :label="t('supplier.summary.taxNumber')" :value="supplier.nif" />
|
<VnLv :label="t('supplier.summary.taxNumber')" :value="supplier.nif" />
|
||||||
|
|
|
@ -42,7 +42,7 @@ const redirectToCreateView = () => {
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<div class="vn-card-list">
|
<div class="vn-card-list">
|
||||||
<VnPaginate data-key="SuppliersList" url="Suppliers/filter" auto-load>
|
<VnPaginate data-key="SuppliersList" url="Suppliers/filter">
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<CardList
|
<CardList
|
||||||
v-for="row of rows"
|
v-for="row of rows"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import TicketDescriptor from './TicketDescriptor.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -29,7 +30,9 @@ const { t } = useI18n();
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
|
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -88,14 +88,6 @@ const setData = (entity) =>
|
||||||
<TicketDescriptorMenu :ticket="entity" />
|
<TicketDescriptorMenu :ticket="entity" />
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
|
|
||||||
<template #value>
|
|
||||||
<QBadge :color="entity.ticketState.state.classColor">
|
|
||||||
{{ entity.ticketState.state.name }}
|
|
||||||
</QBadge>
|
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
|
|
||||||
<VnLv :label="t('ticket.card.customerId')">
|
<VnLv :label="t('ticket.card.customerId')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
|
@ -104,6 +96,13 @@ const setData = (entity) =>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
|
||||||
|
<template #value>
|
||||||
|
<QBadge :color="entity.ticketState.state.classColor">
|
||||||
|
{{ entity.ticketState.state.name }}
|
||||||
|
</QBadge>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.salesPerson')">
|
<VnLv :label="t('ticket.summary.salesPerson')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
|
@ -112,12 +111,14 @@ const setData = (entity) =>
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.card.warehouse')" :value="entity.warehouse?.name" />
|
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
|
||||||
<VnLv
|
<VnLv
|
||||||
v-if="entity.agencyMode"
|
v-if="entity.agencyMode"
|
||||||
:label="t('ticket.card.agency')"
|
:label="t('ticket.card.agency')"
|
||||||
:value="entity.agencyMode.name"
|
:value="entity.agencyMode.name"
|
||||||
/>
|
/>
|
||||||
|
<VnLv :label="t('ticket.card.warehouse')" :value="entity.warehouse?.name" />
|
||||||
|
<VnLv :label="t('ticket.card.alias')" :value="entity.nickname" />
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions>
|
||||||
|
|
|
@ -147,9 +147,9 @@ async function changeState(value) {
|
||||||
</div>
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="ticketUrl + 'basic-data/step-one'">
|
<a class="header header-link" :href="ticketUrl + 'basic-data/step-one'">
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv :label="t('ticket.summary.state')">
|
<VnLv :label="t('ticket.summary.state')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
@ -193,9 +193,9 @@ async function changeState(value) {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="ticketUrl + 'basic-data/step-one'">
|
<a class="header header-link" :href="ticketUrl + 'basic-data/step-one'">
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.shipped')"
|
:label="t('ticket.summary.shipped')"
|
||||||
|
@ -236,9 +236,9 @@ async function changeState(value) {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header link" :href="ticketUrl + 'observation'">
|
<a class="header header-link" :href="ticketUrl + 'observation'">
|
||||||
{{ t('ticket.pageTitles.notes') }}
|
{{ t('ticket.pageTitles.notes') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv
|
<VnLv
|
||||||
v-for="note in ticket.notes"
|
v-for="note in ticket.notes"
|
||||||
|
@ -258,9 +258,9 @@ async function changeState(value) {
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-max">
|
<QCard class="vn-max">
|
||||||
<a class="header link" :href="ticketUrl + 'sale'">
|
<a class="header header-link" :href="ticketUrl + 'sale'">
|
||||||
{{ t('ticket.summary.saleLines') }}
|
{{ t('ticket.summary.saleLines') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :rows="ticket.sales">
|
<QTable :rows="ticket.sales">
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
|
@ -396,9 +396,9 @@ async function changeState(value) {
|
||||||
class="vn-max"
|
class="vn-max"
|
||||||
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
|
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
|
||||||
>
|
>
|
||||||
<a class="header link" :href="ticketUrl + 'package'">
|
<a class="header header-link" :href="ticketUrl + 'package'">
|
||||||
{{ t('globals.packages') }}
|
{{ t('globals.packages') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :rows="ticket.packagings" flat>
|
<QTable :rows="ticket.packagings" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
|
@ -417,9 +417,9 @@ async function changeState(value) {
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
||||||
<a class="header link q-mt-xl" :href="ticketUrl + 'service'">
|
<a class="header header-link q-mt-xl" :href="ticketUrl + 'service'">
|
||||||
{{ t('ticket.summary.service') }}
|
{{ t('ticket.summary.service') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :rows="ticket.services" flat>
|
<QTable :rows="ticket.services" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useStateStore } from 'stores/useStateStore';
|
||||||
import TravelDescriptor from './TravelDescriptor.vue';
|
import TravelDescriptor from './TravelDescriptor.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
</script>
|
</script>
|
||||||
|
@ -17,7 +18,9 @@ const stateStore = useStateStore();
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -236,19 +236,9 @@ async function setTravelData(travelData) {
|
||||||
:url="`Travels/${entityId}/getTravel`"
|
:url="`Travels/${entityId}/getTravel`"
|
||||||
@on-fetch="(data) => setTravelData(data)"
|
@on-fetch="(data) => setTravelData(data)"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
|
||||||
<router-link
|
|
||||||
class="header link"
|
|
||||||
:to="{ name: 'TravelSummary', params: { id: entityId } }"
|
|
||||||
>
|
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
|
||||||
<QTooltip>{{ t('travel.pageTitles.summary') }}</QTooltip>
|
|
||||||
</router-link>
|
|
||||||
</template>
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ travel.ref }} - {{ travel.id }}</span>
|
<span>{{ travel.ref }} - {{ travel.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #header-right>
|
<template #header-right>
|
||||||
<QBtn color="white" dense flat icon="more_vert" round size="md">
|
<QBtn color="white" dense flat icon="more_vert" round size="md">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
|
@ -269,15 +259,11 @@ async function setTravelData(travelData) {
|
||||||
:label="t('globals.wareHouseOut')"
|
:label="t('globals.wareHouseOut')"
|
||||||
:value="travel.warehouseOut?.name"
|
:value="travel.warehouseOut?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('travel.summary.delivered')" class="q-mb-xs">
|
<QCheckbox
|
||||||
<template #value>
|
:label="t('travel.summary.delivered')"
|
||||||
<QIcon
|
v-model="travel.isDelivered"
|
||||||
:name="travel.isDelivered ? 'check' : 'close'"
|
:disable="true"
|
||||||
:color="travel.isDelivered ? 'positive' : 'negative'"
|
|
||||||
size="sm"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnLv :label="t('globals.landed')" :value="toDate(travel.landed)" />
|
<VnLv :label="t('globals.landed')" :value="toDate(travel.landed)" />
|
||||||
|
@ -285,15 +271,11 @@ async function setTravelData(travelData) {
|
||||||
:label="t('globals.wareHouseIn')"
|
:label="t('globals.wareHouseIn')"
|
||||||
:value="travel.warehouseIn?.name"
|
:value="travel.warehouseIn?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('travel.summary.received')" class="q-mb-xs">
|
<QCheckbox
|
||||||
<template #value>
|
:label="t('travel.summary.received')"
|
||||||
<QIcon
|
v-model="travel.isReceived"
|
||||||
:name="travel.isReceived ? 'check' : 'close'"
|
:disable="true"
|
||||||
:color="travel.isReceived ? 'positive' : 'negative'"
|
|
||||||
size="sm"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
|
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
|
||||||
|
@ -302,7 +284,7 @@ async function setTravelData(travelData) {
|
||||||
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
|
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="full-width" v-if="entriesTableRows.length > 0">
|
<QCard class="full-width" v-if="entriesTableRows.length > 0">
|
||||||
<span class="header">
|
<span class="header header-link">
|
||||||
{{ t('travel.summary.entries') }}
|
{{ t('travel.summary.entries') }}
|
||||||
</span>
|
</span>
|
||||||
<QTable
|
<QTable
|
||||||
|
@ -361,14 +343,14 @@ async function setTravelData(travelData) {
|
||||||
|
|
||||||
<QCard class="full-width" v-if="thermographs.length > 0">
|
<QCard class="full-width" v-if="thermographs.length > 0">
|
||||||
<RouterLink
|
<RouterLink
|
||||||
class="header"
|
class="header header-link"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'TravelThermographsIndex',
|
name: 'TravelThermographsIndex',
|
||||||
params: { id: travel.id },
|
params: { id: travel.id },
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ t('travel.summary.thermographs') }}
|
{{ t('travel.summary.thermographs') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<QTable
|
<QTable
|
||||||
:rows="thermographs"
|
:rows="thermographs"
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -17,7 +18,9 @@ const { t } = useI18n();
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import WorkerDescriptor from './WorkerDescriptor.vue';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -29,7 +30,9 @@ const { t } = useI18n();
|
||||||
<QPage>
|
<QPage>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
|
|
||||||
<div class="q-pa-md"><RouterView></RouterView></div>
|
<div :class="useCardSize()">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</div>
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { onMounted, ref, computed } from 'vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { useRole } from 'src/composables/useRole';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const { hasAny } = useRole();
|
||||||
|
|
||||||
|
const fetchCurrentDeviceRef = ref(null);
|
||||||
|
const deviceProductionsFilter = {
|
||||||
|
fields: ['id', 'serialNumber', 'modelFk'],
|
||||||
|
where: { stateFk: 'idle' },
|
||||||
|
order: 'id',
|
||||||
|
};
|
||||||
|
const deviceProductionsOptions = ref([]);
|
||||||
|
const newPDA = ref({});
|
||||||
|
const currentPDA = ref(null);
|
||||||
|
|
||||||
|
const isAllowedToEdit = computed(() => hasAny(['hr', 'productionAssi']));
|
||||||
|
|
||||||
|
const setCurrentPDA = (data) => {
|
||||||
|
currentPDA.value = data;
|
||||||
|
currentPDA.value.description = `ID: ${currentPDA.value.deviceProductionFk} ${t(
|
||||||
|
'worker.pda.model'
|
||||||
|
)}: ${currentPDA.value.deviceProduction.modelFk} ${t('worker.pda.serialNumber')}: ${
|
||||||
|
currentPDA.value.deviceProduction.serialNumber
|
||||||
|
}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const deallocatePDA = async (data) => {
|
||||||
|
try {
|
||||||
|
await axios.post(`Workers/${route.params.id}/deallocatePDA`, {
|
||||||
|
pda: currentPDA.value.deviceProductionFk,
|
||||||
|
});
|
||||||
|
data.pda = null;
|
||||||
|
currentPDA.value = null;
|
||||||
|
await fetchCurrentDeviceRef.value.fetch();
|
||||||
|
notify(t('PDA deallocated'), 'positive');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error deallocating PDA');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => await fetchCurrentDeviceRef.value.fetch());
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="DeviceProductions"
|
||||||
|
:filter="deviceProductionsFilter"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (deviceProductionsOptions = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
ref="fetchCurrentDeviceRef"
|
||||||
|
url="DeviceProductionUsers"
|
||||||
|
:filter="{
|
||||||
|
where: { userFk: route.params.id },
|
||||||
|
include: { relation: 'deviceProduction' },
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => setCurrentPDA(data[0])"
|
||||||
|
/>
|
||||||
|
<QPage class="column items-center q-pa-md">
|
||||||
|
<FormModel
|
||||||
|
url="DeviceProductionUsers"
|
||||||
|
:url-create="`Workers/${route.params.id}/allocatePDA`"
|
||||||
|
model="DeviceProductionUser"
|
||||||
|
:form-initial-data="newPDA"
|
||||||
|
auto-load
|
||||||
|
:default-buttons="{ save: { label: 'globals.assign', color: 'primary' } }"
|
||||||
|
@on-data-saved="(_, data) => setCurrentPDA(data)"
|
||||||
|
>
|
||||||
|
<template #form="{ data }">
|
||||||
|
<QField
|
||||||
|
v-if="currentPDA && currentPDA.description"
|
||||||
|
:label="t('worker.pda.currentPDA')"
|
||||||
|
:model-value="currentPDA.description"
|
||||||
|
:editable="false"
|
||||||
|
class="full-width"
|
||||||
|
>
|
||||||
|
<template #control>
|
||||||
|
<div tabindex="0">
|
||||||
|
{{ currentPDA.description }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="isAllowedToEdit" #append>
|
||||||
|
<QIcon
|
||||||
|
name="delete"
|
||||||
|
size="sm"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
@click="deallocatePDA(data)"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('worker.pda.removePDA') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</QField>
|
||||||
|
|
||||||
|
<VnSelectFilter
|
||||||
|
v-else
|
||||||
|
:label="t('worker.pda.newPDA')"
|
||||||
|
v-model="data.pda"
|
||||||
|
:options="deviceProductionsOptions"
|
||||||
|
option-label="serialNumber"
|
||||||
|
option-value="id"
|
||||||
|
hide-selected
|
||||||
|
:disable="!isAllowedToEdit"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>ID: {{ scope.opt?.id }}</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ scope.opt?.modelFk }},
|
||||||
|
{{ scope.opt?.serialNumber }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectFilter>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
PDA deallocated: PDA desasignada
|
||||||
|
</i18n>
|
|
@ -71,9 +71,9 @@ const filter = {
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity: worker }">
|
<template #body="{ entity: worker }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header" :href="workerUrl + `basic-data`">
|
<a class="header header-link" :href="workerUrl + `basic-data`">
|
||||||
{{ t('worker.summary.basicData') }}
|
{{ t('worker.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</a>
|
||||||
<VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
|
<VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -111,7 +111,7 @@ const filter = {
|
||||||
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
|
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<div class="header">
|
<div class="header header-link">
|
||||||
{{ t('worker.summary.userData') }}
|
{{ t('worker.summary.userData') }}
|
||||||
</div>
|
</div>
|
||||||
<VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />
|
<VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'suppliers',
|
title: 'suppliers',
|
||||||
icon: 'vn:supplier',
|
icon: 'vn:supplier',
|
||||||
|
moduleName: 'Supplier',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'SupplierMain' },
|
redirect: { name: 'SupplierMain' },
|
||||||
|
|
|
@ -6,20 +6,20 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'claims',
|
title: 'claims',
|
||||||
icon: 'vn:claims',
|
icon: 'vn:claims',
|
||||||
|
moduleName: 'Claim',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'ClaimMain' },
|
redirect: { name: 'ClaimMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['ClaimList', 'ClaimRmaList'],
|
main: ['ClaimList'],
|
||||||
card: [
|
card: [
|
||||||
'ClaimBasicData',
|
'ClaimBasicData',
|
||||||
'ClaimLines',
|
'ClaimLines',
|
||||||
'ClaimRma',
|
|
||||||
'ClaimPhotos',
|
'ClaimPhotos',
|
||||||
'ClaimLog',
|
|
||||||
'ClaimNotes',
|
'ClaimNotes',
|
||||||
'ClaimDevelopment',
|
'ClaimDevelopment',
|
||||||
'ClaimAction',
|
'ClaimAction',
|
||||||
|
'ClaimLog',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -38,16 +38,6 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Claim/ClaimList.vue'),
|
component: () => import('src/pages/Claim/ClaimList.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'ClaimRmaList',
|
|
||||||
path: 'rma',
|
|
||||||
meta: {
|
|
||||||
title: 'rmaList',
|
|
||||||
icon: 'vn:barcode',
|
|
||||||
roles: ['claimManager'],
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Claim/ClaimRmaList.vue'),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -84,16 +74,6 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Claim/Card/ClaimLines.vue'),
|
component: () => import('src/pages/Claim/Card/ClaimLines.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'ClaimRma',
|
|
||||||
path: 'rma',
|
|
||||||
meta: {
|
|
||||||
title: 'rma',
|
|
||||||
icon: 'vn:barcode',
|
|
||||||
roles: ['claimManager'],
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Claim/Card/ClaimRma.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'ClaimPhotos',
|
name: 'ClaimPhotos',
|
||||||
path: 'photos',
|
path: 'photos',
|
||||||
|
@ -103,6 +83,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'),
|
component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'ClaimNotes',
|
||||||
|
path: 'notes',
|
||||||
|
meta: {
|
||||||
|
title: 'notes',
|
||||||
|
icon: 'draft',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Claim/Card/ClaimNotes.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'ClaimDevelopment',
|
name: 'ClaimDevelopment',
|
||||||
path: 'development',
|
path: 'development',
|
||||||
|
@ -113,24 +102,6 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'),
|
component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'ClaimLog',
|
|
||||||
path: 'log',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'history',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Claim/Card/ClaimLog.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ClaimNotes',
|
|
||||||
path: 'notes',
|
|
||||||
meta: {
|
|
||||||
title: 'notes',
|
|
||||||
icon: 'draft',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Claim/Card/ClaimNotes.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'ClaimAction',
|
name: 'ClaimAction',
|
||||||
path: 'action',
|
path: 'action',
|
||||||
|
@ -140,6 +111,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Claim/Card/ClaimAction.vue'),
|
component: () => import('src/pages/Claim/Card/ClaimAction.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'ClaimLog',
|
||||||
|
path: 'log',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'history',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Claim/Card/ClaimLog.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'customers',
|
title: 'customers',
|
||||||
icon: 'vn:client',
|
icon: 'vn:client',
|
||||||
|
moduleName: 'Customer',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'CustomerMain' },
|
redirect: { name: 'CustomerMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'entries',
|
title: 'entries',
|
||||||
icon: 'vn:entry',
|
icon: 'vn:entry',
|
||||||
|
moduleName: 'Entry',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'EntryMain' },
|
redirect: { name: 'EntryMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceIns',
|
title: 'invoiceIns',
|
||||||
icon: 'vn:invoice-in',
|
icon: 'vn:invoice-in',
|
||||||
|
moduleName: 'InvoiceIn',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'InvoiceInMain' },
|
redirect: { name: 'InvoiceInMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceOuts',
|
title: 'invoiceOuts',
|
||||||
icon: 'vn:invoice-out',
|
icon: 'vn:invoice-out',
|
||||||
|
moduleName: 'InvoiceOut',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'InvoiceOutMain' },
|
redirect: { name: 'InvoiceOutMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'order',
|
title: 'order',
|
||||||
icon: 'vn:basket',
|
icon: 'vn:basket',
|
||||||
|
moduleName: 'Order',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'OrderMain' },
|
redirect: { name: 'OrderMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'routes',
|
title: 'routes',
|
||||||
icon: 'vn:delivery',
|
icon: 'vn:delivery',
|
||||||
|
moduleName: 'Route',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'RouteMain' },
|
redirect: { name: 'RouteMain' },
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue