Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into Warmfix-DepartmentIcon
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
This commit is contained in:
commit
fb912725b3
|
@ -31,6 +31,7 @@ yarn-error.log*
|
|||
# Cypress directories and files
|
||||
/test/cypress/videos
|
||||
/test/cypress/screenshots
|
||||
/junit
|
||||
|
||||
# VitePress directories and files
|
||||
/docs/.vitepress/cache
|
||||
|
|
|
@ -114,15 +114,18 @@ pipeline {
|
|||
}
|
||||
steps {
|
||||
script {
|
||||
sh 'rm junit/e2e-*.xml || true'
|
||||
sh 'rm -f junit/e2e-*.xml'
|
||||
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
|
||||
|
||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||
|
||||
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} pull back"
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} pull db"
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||
|
||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
|
||||
sh 'cypress run --browser chromium || true'
|
||||
sh 'sh test/cypress/cypressParallel.sh 2'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
12
README.md
12
README.md
|
@ -32,6 +32,18 @@ pnpm run test:front
|
|||
pnpm run test:e2e
|
||||
```
|
||||
|
||||
### Run e2e parallel
|
||||
|
||||
```bash
|
||||
pnpm run test:e2e:parallel
|
||||
```
|
||||
|
||||
### View e2e parallel report
|
||||
|
||||
```bash
|
||||
pnpm run test:e2e:summary
|
||||
```
|
||||
|
||||
### Build the app for production
|
||||
|
||||
```bash
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
import { defineConfig } from 'cypress';
|
||||
|
||||
let urlHost, reporter, reporterOptions;
|
||||
let urlHost, reporter, reporterOptions, timeouts;
|
||||
|
||||
if (process.env.CI) {
|
||||
urlHost = 'front';
|
||||
reporter = 'junit';
|
||||
reporterOptions = {
|
||||
mochaFile: 'junit/e2e-[hash].xml',
|
||||
toConsole: false,
|
||||
};
|
||||
timeouts = {
|
||||
defaultCommandTimeout: 30000,
|
||||
requestTimeout: 30000,
|
||||
responseTimeout: 60000,
|
||||
pageLoadTimeout: 60000,
|
||||
};
|
||||
} else {
|
||||
urlHost = 'localhost';
|
||||
|
@ -20,17 +25,19 @@ if (process.env.CI) {
|
|||
reportDir: 'test/cypress/reports',
|
||||
inlineAssets: true,
|
||||
};
|
||||
timeouts = {
|
||||
defaultCommandTimeout: 10000,
|
||||
requestTimeout: 10000,
|
||||
responseTimeout: 30000,
|
||||
pageLoadTimeout: 60000,
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
baseUrl: `http://${urlHost}:9000`,
|
||||
experimentalStudio: false,
|
||||
defaultCommandTimeout: 10000,
|
||||
trashAssetsBeforeRuns: false,
|
||||
requestTimeout: 10000,
|
||||
responseTimeout: 30000,
|
||||
pageLoadTimeout: 60000,
|
||||
defaultBrowser: 'chromium',
|
||||
fixturesFolder: 'test/cypress/fixtures',
|
||||
screenshotsFolder: 'test/cypress/screenshots',
|
||||
|
@ -50,8 +57,8 @@ export default defineConfig({
|
|||
},
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
...timeouts,
|
||||
includeShadowDom: true,
|
||||
waitForAnimations: true,
|
||||
},
|
||||
experimentalMemoryManagement: true,
|
||||
defaultCommandTimeout: 10000,
|
||||
numTestsKeptInMemory: 2,
|
||||
});
|
||||
|
|
11
package.json
11
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-front",
|
||||
"version": "25.10.0",
|
||||
"version": "25.12.0",
|
||||
"description": "Salix frontend",
|
||||
"productName": "Salix",
|
||||
"author": "Verdnatura",
|
||||
|
@ -13,6 +13,8 @@
|
|||
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
||||
"test:e2e": "cypress open",
|
||||
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
|
||||
"test:e2e:parallel": "bash ./test/cypress/run.sh",
|
||||
"test:e2e:summary": "bash ./test/cypress/summary.sh",
|
||||
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
|
||||
"test:front": "vitest",
|
||||
"test:front:ci": "vitest run",
|
||||
|
@ -54,11 +56,14 @@
|
|||
"eslint-plugin-cypress": "^4.1.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"husky": "^8.0.0",
|
||||
"junit-merge": "^2.0.0",
|
||||
"mocha": "^11.1.0",
|
||||
"postcss": "^8.4.23",
|
||||
"prettier": "^3.4.2",
|
||||
"sass": "^1.83.4",
|
||||
"vitepress": "^1.6.3",
|
||||
"vitest": "^0.34.0"
|
||||
"vitest": "^0.34.0",
|
||||
"xunit-viewer": "^10.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20 || ^18 || ^16",
|
||||
|
@ -71,4 +76,4 @@
|
|||
"vite": "^6.0.11",
|
||||
"vitest": "^0.31.1"
|
||||
}
|
||||
}
|
||||
}
|
2070
pnpm-lock.yaml
2070
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -181,9 +181,8 @@ async function saveChanges(data) {
|
|||
return;
|
||||
}
|
||||
let changes = data || getChanges();
|
||||
if ($props.beforeSaveFn) {
|
||||
changes = await $props.beforeSaveFn(changes, getChanges);
|
||||
}
|
||||
if ($props.beforeSaveFn) changes = await $props.beforeSaveFn(changes, getChanges);
|
||||
|
||||
try {
|
||||
if (changes?.creates?.length === 0 && changes?.updates?.length === 0) {
|
||||
return;
|
||||
|
@ -194,7 +193,7 @@ async function saveChanges(data) {
|
|||
isLoading.value = false;
|
||||
}
|
||||
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
||||
if (changes.creates?.length) await vnPaginateRef.value.fetch();
|
||||
if (changes?.creates?.length) await vnPaginateRef.value.fetch();
|
||||
|
||||
hasChanges.value = false;
|
||||
emit('saveChanges', data);
|
||||
|
|
|
@ -188,7 +188,7 @@ const selectItem = ({ id }) => {
|
|||
>
|
||||
<template #body-cell-id="{ row }">
|
||||
<QTd auto-width @click.stop>
|
||||
<QBtn flat color="blue">{{ row.id }}</QBtn>
|
||||
<QBtn flat class="link">{{ row.id }}</QBtn>
|
||||
<ItemDescriptorProxy :id="row.id" />
|
||||
</QTd>
|
||||
</template>
|
||||
|
|
|
@ -196,7 +196,7 @@ const selectTravel = ({ id }) => {
|
|||
>
|
||||
<template #body-cell-id="{ row }">
|
||||
<QTd auto-width @click.stop data-cy="travelFk-travel-form">
|
||||
<QBtn flat color="blue">{{ row.id }}</QBtn>
|
||||
<QBtn flat class="link">{{ row.id }}</QBtn>
|
||||
<TravelDescriptorProxy :id="row.id" />
|
||||
</QTd>
|
||||
</template>
|
||||
|
|
|
@ -77,6 +77,7 @@ watch(
|
|||
function findMatches(search, item) {
|
||||
const matches = [];
|
||||
function findRoute(search, item) {
|
||||
if (!item?.children) return;
|
||||
for (const child of item.children) {
|
||||
if (search?.indexOf(child.name) > -1) {
|
||||
matches.push(child);
|
||||
|
@ -92,7 +93,7 @@ function findMatches(search, item) {
|
|||
}
|
||||
|
||||
function addChildren(module, route, parent) {
|
||||
const menus = route?.meta?.menu ?? route?.menus?.[props.source]; //backwards compatible
|
||||
const menus = route?.meta?.menu;
|
||||
if (!menus) return;
|
||||
|
||||
const matches = findMatches(menus, route);
|
||||
|
@ -107,11 +108,7 @@ function getRoutes() {
|
|||
main: getMainRoutes,
|
||||
card: getCardRoutes,
|
||||
};
|
||||
try {
|
||||
handleRoutes[props.source]();
|
||||
} catch (error) {
|
||||
throw new Error(`Method is not defined`);
|
||||
}
|
||||
handleRoutes[props.source]();
|
||||
}
|
||||
function getMainRoutes() {
|
||||
const modules = Object.assign([], navigation.getModules().value);
|
||||
|
@ -122,7 +119,6 @@ function getMainRoutes() {
|
|||
);
|
||||
if (!moduleDef) continue;
|
||||
item.children = [];
|
||||
|
||||
addChildren(item.module, moduleDef, item.children);
|
||||
}
|
||||
|
||||
|
@ -132,21 +128,16 @@ function getMainRoutes() {
|
|||
function getCardRoutes() {
|
||||
const currentRoute = route.matched[1];
|
||||
const currentModule = toLowerCamel(currentRoute.name);
|
||||
let moduleDef = routes.find((route) => toLowerCamel(route.name) === currentModule);
|
||||
let moduleDef;
|
||||
|
||||
if (!moduleDef) return;
|
||||
if (!moduleDef?.menus) moduleDef = betaGetRoutes();
|
||||
addChildren(currentModule, moduleDef, items.value);
|
||||
}
|
||||
|
||||
function betaGetRoutes() {
|
||||
let menuRoute;
|
||||
let index = route.matched.length - 1;
|
||||
while (!menuRoute && index > 0) {
|
||||
if (route.matched[index]?.meta?.menu) menuRoute = route.matched[index];
|
||||
while (!moduleDef && index > 0) {
|
||||
if (route.matched[index]?.meta?.menu) moduleDef = route.matched[index];
|
||||
index--;
|
||||
}
|
||||
return menuRoute;
|
||||
|
||||
if (!moduleDef) return;
|
||||
addChildren(currentModule, moduleDef, items.value);
|
||||
}
|
||||
|
||||
async function togglePinned(item, event) {
|
||||
|
|
|
@ -57,7 +57,7 @@ const refresh = () => window.location.reload();
|
|||
:class="{
|
||||
'no-visible': !stateQuery.isLoading().value,
|
||||
}"
|
||||
size="xs"
|
||||
size="sm"
|
||||
data-cy="loading-spinner"
|
||||
/>
|
||||
<QSpace />
|
||||
|
|
|
@ -12,7 +12,7 @@ defineProps({ row: { type: Object, required: true } });
|
|||
>
|
||||
<QIcon name="vn:claims" size="xs">
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.claim') }}:
|
||||
{{ $t('ticketSale.claim') }}:
|
||||
{{ row.claim?.claimFk }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
|
|
|
@ -87,7 +87,7 @@ const makeInvoice = async () => {
|
|||
(data) => (
|
||||
(rectificativeTypeOptions = data),
|
||||
(transferInvoiceParams.cplusRectificationTypeFk = data.filter(
|
||||
(type) => type.description == 'I – Por diferencias'
|
||||
(type) => type.description == 'I – Por diferencias',
|
||||
)[0].id)
|
||||
)
|
||||
"
|
||||
|
@ -100,7 +100,7 @@ const makeInvoice = async () => {
|
|||
(data) => (
|
||||
(siiTypeInvoiceOutsOptions = data),
|
||||
(transferInvoiceParams.siiTypeInvoiceOutFk = data.filter(
|
||||
(type) => type.code == 'R4'
|
||||
(type) => type.code == 'R4',
|
||||
)[0].id)
|
||||
)
|
||||
"
|
||||
|
@ -122,7 +122,6 @@ const makeInvoice = async () => {
|
|||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Client')"
|
||||
:options="clientsOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
|
|
|
@ -595,18 +595,17 @@ function cardClick(_, row) {
|
|||
|
||||
function removeTextValue(data, getChanges) {
|
||||
let changes = data.updates;
|
||||
if (!changes) return data;
|
||||
|
||||
for (const change of changes) {
|
||||
for (const key in change.data) {
|
||||
if (key.endsWith('VnTableTextValue')) {
|
||||
delete change.data[key];
|
||||
if (changes) {
|
||||
for (const change of changes) {
|
||||
for (const key in change.data) {
|
||||
if (key.endsWith('VnTableTextValue')) {
|
||||
delete change.data[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
|
||||
}
|
||||
|
||||
data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
|
||||
|
||||
if ($attrs?.beforeSaveFn) data = $attrs.beforeSaveFn(data, getChanges);
|
||||
|
||||
return data;
|
||||
|
@ -776,7 +775,7 @@ const rowCtrlClickFunction = computed(() => {
|
|||
:data-col-field="col?.name"
|
||||
>
|
||||
<div
|
||||
class="no-padding no-margin peter"
|
||||
class="no-padding no-margin"
|
||||
style="
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
@ -978,6 +977,8 @@ const rowCtrlClickFunction = computed(() => {
|
|||
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
||||
:key="col?.id"
|
||||
:class="getColAlign(col)"
|
||||
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
||||
style="font-size: small"
|
||||
>
|
||||
<slot
|
||||
:name="`column-footer-${col.name}`"
|
||||
|
@ -1040,38 +1041,43 @@ const rowCtrlClickFunction = computed(() => {
|
|||
@on-data-saved="(_, res) => createForm.onDataSaved(res)"
|
||||
>
|
||||
<template #form-inputs="{ data }">
|
||||
<div :style="createComplement?.containerStyle">
|
||||
<div
|
||||
:style="createComplement?.previousStyle"
|
||||
v-if="!quasar.screen.xs"
|
||||
>
|
||||
<slot name="previous-create-dialog" :data="data" />
|
||||
</div>
|
||||
<div class="grid-create" :style="createComplement?.columnGridStyle">
|
||||
<slot
|
||||
v-for="column of splittedColumns.create"
|
||||
:key="column.name"
|
||||
:name="`column-create-${column.name}`"
|
||||
:data="data"
|
||||
:column-name="column.name"
|
||||
:label="column.label"
|
||||
<slot name="alter-create" :data="data">
|
||||
<div :style="createComplement?.containerStyle">
|
||||
<div
|
||||
:style="createComplement?.previousStyle"
|
||||
v-if="!quasar.screen.xs"
|
||||
>
|
||||
<VnColumn
|
||||
:column="{
|
||||
...column,
|
||||
...{ disable: column?.createDisable ?? false },
|
||||
}"
|
||||
:row="{}"
|
||||
default="input"
|
||||
v-model="data[column.name]"
|
||||
:show-label="true"
|
||||
component-prop="columnCreate"
|
||||
:data-cy="`${column.name}-create-popup`"
|
||||
/>
|
||||
</slot>
|
||||
<slot name="more-create-dialog" :data="data" />
|
||||
<slot name="previous-create-dialog" :data="data" />
|
||||
</div>
|
||||
<div
|
||||
class="grid-create"
|
||||
:style="createComplement?.columnGridStyle"
|
||||
>
|
||||
<slot
|
||||
v-for="column of splittedColumns.create"
|
||||
:key="column.name"
|
||||
:name="`column-create-${column.name}`"
|
||||
:data="data"
|
||||
:column-name="column.name"
|
||||
:label="column.label"
|
||||
>
|
||||
<VnColumn
|
||||
:column="{
|
||||
...column,
|
||||
...column?.createAttrs,
|
||||
}"
|
||||
:row="{}"
|
||||
default="input"
|
||||
v-model="data[column.name]"
|
||||
:show-label="true"
|
||||
component-prop="columnCreate"
|
||||
:data-cy="`${column.name}-create-popup`"
|
||||
/>
|
||||
</slot>
|
||||
<slot name="more-create-dialog" :data="data" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
</QDialog>
|
||||
|
@ -1148,9 +1154,13 @@ es:
|
|||
|
||||
.grid-create {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
||||
grid-template-columns: 1fr 1fr;
|
||||
max-width: 100%;
|
||||
grid-gap: 20px;
|
||||
margin: 0 auto;
|
||||
.col-span-2 {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-one {
|
||||
|
|
|
@ -15,10 +15,7 @@ vi.mock('src/router/modules', () => ({
|
|||
meta: {
|
||||
title: 'customers',
|
||||
icon: 'vn:client',
|
||||
},
|
||||
menus: {
|
||||
main: ['CustomerList', 'CustomerCreate'],
|
||||
card: ['CustomerBasicData'],
|
||||
menu: ['CustomerList', 'CustomerCreate'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -50,14 +47,6 @@ vi.mock('src/router/modules', () => ({
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'CustomerCreate',
|
||||
meta: {
|
||||
title: 'createCustomer',
|
||||
icon: 'vn:addperson',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -98,7 +87,7 @@ vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
|||
icon: 'vn:client',
|
||||
moduleName: 'Customer',
|
||||
keyBinding: 'c',
|
||||
menu: 'customer',
|
||||
menu: ['customer'],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -260,15 +249,6 @@ describe('Leftmenu as main', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should handle a single matched route with a menu', () => {
|
||||
const route = {
|
||||
matched: [{ meta: { menu: 'customer' } }],
|
||||
};
|
||||
|
||||
const result = vm.betaGetRoutes();
|
||||
|
||||
expect(result.meta.menu).toEqual(route.matched[0].meta.menu);
|
||||
});
|
||||
it('should get routes for main source', () => {
|
||||
vm.props.source = 'main';
|
||||
vm.getRoutes();
|
||||
|
@ -351,8 +331,9 @@ describe('addChildren', () => {
|
|||
|
||||
it('should handle routes with no meta menu', () => {
|
||||
const route = {
|
||||
meta: {},
|
||||
menus: {},
|
||||
meta: {
|
||||
menu: [],
|
||||
},
|
||||
};
|
||||
|
||||
const parent = [];
|
||||
|
|
|
@ -56,7 +56,12 @@ async function confirm() {
|
|||
{{ t('The notification will be sent to the following address') }}
|
||||
</QCardSection>
|
||||
<QCardSection class="q-pt-none">
|
||||
<VnInput v-model="address" is-outlined autofocus />
|
||||
<VnInput
|
||||
v-model="address"
|
||||
is-outlined
|
||||
autofocus
|
||||
data-cy="SendEmailNotifiactionDialogInput"
|
||||
/>
|
||||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
|
||||
|
|
|
@ -1,50 +1,56 @@
|
|||
<script setup>
|
||||
import { onBeforeMount, computed } from 'vue';
|
||||
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||
import { onBeforeMount } from 'vue';
|
||||
import { useRouter, onBeforeRouteUpdate, onBeforeRouteLeave } from 'vue-router';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import useCardSize from 'src/composables/useCardSize';
|
||||
import VnSubToolbar from '../ui/VnSubToolbar.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import LeftMenu from 'components/LeftMenu.vue';
|
||||
import RightMenu from 'components/common/RightMenu.vue';
|
||||
|
||||
const props = defineProps({
|
||||
dataKey: { type: String, required: true },
|
||||
url: { type: String, default: undefined },
|
||||
idInWhere: { type: Boolean, default: false },
|
||||
filter: { type: Object, default: () => {} },
|
||||
descriptor: { type: Object, required: true },
|
||||
filterPanel: { type: Object, default: undefined },
|
||||
idInWhere: { type: Boolean, default: false },
|
||||
searchDataKey: { type: String, default: undefined },
|
||||
searchbarProps: { type: Object, default: undefined },
|
||||
redirectOnError: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const searchRightDataKey = computed(() => {
|
||||
if (!props.searchDataKey) return route.name;
|
||||
return props.searchDataKey;
|
||||
});
|
||||
|
||||
const arrayData = useArrayData(props.dataKey, {
|
||||
url: props.url,
|
||||
userFilter: props.filter,
|
||||
oneRecord: true,
|
||||
});
|
||||
|
||||
onBeforeRouteLeave(() => {
|
||||
stateStore.cardDescriptorChangeValue(null);
|
||||
});
|
||||
|
||||
onBeforeMount(async () => {
|
||||
stateStore.cardDescriptorChangeValue(props.descriptor);
|
||||
|
||||
const route = router.currentRoute.value;
|
||||
try {
|
||||
await fetch(route.params.id);
|
||||
} catch {
|
||||
const { matched: matches } = router.currentRoute.value;
|
||||
const { matched: matches } = route;
|
||||
const { path } = matches.at(-1);
|
||||
router.push({ path: path.replace(/:id.*/, '') });
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeRouteUpdate(async (to, from) => {
|
||||
if (hasRouteParam(to.params)) {
|
||||
const { matched } = router.currentRoute.value;
|
||||
const { name } = matched.at(-3);
|
||||
if (name) {
|
||||
router.push({ name, params: to.params });
|
||||
}
|
||||
}
|
||||
const id = to.params.id;
|
||||
if (id !== from.params.id) await fetch(id, true);
|
||||
});
|
||||
|
@ -56,34 +62,13 @@ async function fetch(id, append = false) {
|
|||
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||
await arrayData.fetch({ append, updateRouter: false });
|
||||
}
|
||||
function hasRouteParam(params, valueToCheck = ':addressId') {
|
||||
return Object.values(params).includes(valueToCheck);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QDrawer
|
||||
v-model="stateStore.leftDrawer"
|
||||
show-if-above
|
||||
:width="256"
|
||||
v-if="stateStore.isHeaderMounted()"
|
||||
>
|
||||
<QScrollArea class="fit">
|
||||
<component :is="descriptor" />
|
||||
<QSeparator />
|
||||
<LeftMenu source="card" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<slot name="searchbar" v-if="props.searchDataKey">
|
||||
<VnSearchbar :data-key="props.searchDataKey" v-bind="props.searchbarProps" />
|
||||
</slot>
|
||||
<RightMenu>
|
||||
<template #right-panel v-if="props.filterPanel">
|
||||
<component :is="props.filterPanel" :data-key="searchRightDataKey" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<QPageContainer>
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<div :class="[useCardSize(), $attrs.class]">
|
||||
<RouterView :key="$route.path" />
|
||||
</div>
|
||||
</QPage>
|
||||
</QPageContainer>
|
||||
<VnSubToolbar />
|
||||
<div :class="[useCardSize(), $attrs.class]">
|
||||
<RouterView :key="$route.path" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
<script setup>
|
||||
import { onBeforeMount } from 'vue';
|
||||
import { useRouter, onBeforeRouteUpdate, onBeforeRouteLeave } from 'vue-router';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import useCardSize from 'src/composables/useCardSize';
|
||||
import VnSubToolbar from '../ui/VnSubToolbar.vue';
|
||||
|
||||
const props = defineProps({
|
||||
dataKey: { type: String, required: true },
|
||||
url: { type: String, default: undefined },
|
||||
idInWhere: { type: Boolean, default: false },
|
||||
filter: { type: Object, default: () => {} },
|
||||
descriptor: { type: Object, required: true },
|
||||
filterPanel: { type: Object, default: undefined },
|
||||
searchDataKey: { type: String, default: undefined },
|
||||
searchbarProps: { type: Object, default: undefined },
|
||||
redirectOnError: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const router = useRouter();
|
||||
const arrayData = useArrayData(props.dataKey, {
|
||||
url: props.url,
|
||||
userFilter: props.filter,
|
||||
oneRecord: true,
|
||||
});
|
||||
|
||||
onBeforeRouteLeave(() => {
|
||||
stateStore.cardDescriptorChangeValue(null);
|
||||
});
|
||||
|
||||
onBeforeMount(async () => {
|
||||
stateStore.cardDescriptorChangeValue(props.descriptor);
|
||||
|
||||
const route = router.currentRoute.value;
|
||||
try {
|
||||
await fetch(route.params.id);
|
||||
} catch {
|
||||
const { matched: matches } = route;
|
||||
const { path } = matches.at(-1);
|
||||
router.push({ path: path.replace(/:id.*/, '') });
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeRouteUpdate(async (to, from) => {
|
||||
if (hasRouteParam(to.params)) {
|
||||
const { matched } = router.currentRoute.value;
|
||||
const { name } = matched.at(-3);
|
||||
if (name) {
|
||||
router.push({ name, params: to.params });
|
||||
}
|
||||
}
|
||||
const id = to.params.id;
|
||||
if (id !== from.params.id) await fetch(id, true);
|
||||
});
|
||||
|
||||
async function fetch(id, append = false) {
|
||||
const regex = /\/(\d+)/;
|
||||
if (props.idInWhere) arrayData.store.filter.where = { id };
|
||||
else if (!regex.test(props.url)) arrayData.store.url = `${props.url}/${id}`;
|
||||
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||
await arrayData.fetch({ append, updateRouter: false });
|
||||
}
|
||||
function hasRouteParam(params, valueToCheck = ':addressId') {
|
||||
return Object.values(params).includes(valueToCheck);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<VnSubToolbar />
|
||||
<div :class="[useCardSize(), $attrs.class]">
|
||||
<RouterView :key="$route.path" />
|
||||
</div>
|
||||
</template>
|
|
@ -177,6 +177,7 @@ function addDefaultData(data) {
|
|||
name="vn:attach"
|
||||
class="cursor-pointer"
|
||||
@click="inputFileRef.pickFiles()"
|
||||
data-cy="attachFile"
|
||||
>
|
||||
<QTooltip>{{ t('globals.selectFile') }}</QTooltip>
|
||||
</QIcon>
|
||||
|
|
|
@ -389,10 +389,7 @@ defineExpose({
|
|||
</div>
|
||||
</template>
|
||||
</QTable>
|
||||
<div
|
||||
v-else
|
||||
class="info-row q-pa-md text-center"
|
||||
>
|
||||
<div v-else class="info-row q-pa-md text-center">
|
||||
<h5>
|
||||
{{ t('No data to display') }}
|
||||
</h5>
|
||||
|
@ -416,6 +413,7 @@ defineExpose({
|
|||
v-shortcut
|
||||
@click="showFormDialog()"
|
||||
class="fill-icon"
|
||||
data-cy="addButton"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Upload file') }}
|
||||
|
|
|
@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
|
|||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useClipboard } from 'src/composables/useClipboard';
|
||||
import VnMoreOptions from './VnMoreOptions.vue';
|
||||
|
||||
|
@ -47,6 +48,7 @@ const $props = defineProps({
|
|||
const state = useState();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { copyText } = useClipboard();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -58,6 +60,9 @@ const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
|||
const DESCRIPTOR_PROXY = 'DescriptorProxy';
|
||||
const moduleName = ref();
|
||||
const isSameModuleName = route.matched[1].meta.moduleName !== moduleName.value;
|
||||
const DESCRIPTOR_PROXY = 'DescriptorProxy';
|
||||
const moduleName = ref();
|
||||
const isSameModuleName = route.matched[1].meta.moduleName !== moduleName.value;
|
||||
defineExpose({ getData });
|
||||
|
||||
onBeforeMount(async () => {
|
||||
|
@ -84,6 +89,7 @@ onBeforeMount(async () => {
|
|||
);
|
||||
});
|
||||
|
||||
function getName() {
|
||||
function getName() {
|
||||
let name = $props.dataKey;
|
||||
if ($props.dataKey.includes(DESCRIPTOR_PROXY)) {
|
||||
|
@ -91,11 +97,17 @@ function getName() {
|
|||
}
|
||||
return name;
|
||||
}
|
||||
const routeName = computed(() => {
|
||||
let routeName = getName();
|
||||
return `${routeName}Summary`;
|
||||
return name;
|
||||
}
|
||||
const routeName = computed(() => {
|
||||
let routeName = getName();
|
||||
return `${routeName}Summary`;
|
||||
});
|
||||
|
||||
|
||||
async function getData() {
|
||||
store.url = $props.url;
|
||||
store.filter = $props.filter ?? {};
|
||||
|
@ -164,6 +176,8 @@ const toModule = computed(() => {
|
|||
<div class="descriptor">
|
||||
<template v-if="entity && !isLoading">
|
||||
<div class="header bg-primary q-pa-sm justify-between">
|
||||
<slot name="header-extra-action">
|
||||
<QBtn
|
||||
<slot name="header-extra-action">
|
||||
<QBtn
|
||||
round
|
||||
|
@ -174,11 +188,14 @@ const toModule = computed(() => {
|
|||
color="white"
|
||||
class="link"
|
||||
:to="toModule"
|
||||
:to="toModule"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('globals.goToModuleIndex') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</slot>
|
||||
</QBtn>
|
||||
</slot>
|
||||
<QBtn
|
||||
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
|
||||
|
@ -191,6 +208,7 @@ const toModule = computed(() => {
|
|||
class="link"
|
||||
v-if="summary"
|
||||
data-cy="openSummaryBtn"
|
||||
data-cy="openSummaryBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('components.smartCard.openSummary') }}
|
||||
|
@ -206,6 +224,7 @@ const toModule = computed(() => {
|
|||
round
|
||||
size="md"
|
||||
data-cy="goToSummaryBtn"
|
||||
data-cy="goToSummaryBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('components.cardDescriptor.summary') }}
|
||||
|
|
|
@ -81,6 +81,7 @@ async function fetch() {
|
|||
name: `${moduleName ?? route.meta.moduleName}Summary`,
|
||||
params: { id: entityId || entity.id },
|
||||
}"
|
||||
data-cy="goToSummaryBtn"
|
||||
>
|
||||
<QIcon name="open_in_new" color="white" size="sm" />
|
||||
</router-link>
|
||||
|
|
|
@ -54,7 +54,7 @@ const $props = defineProps({
|
|||
default: 'table',
|
||||
},
|
||||
redirect: {
|
||||
type: Boolean,
|
||||
type: [String, Boolean],
|
||||
default: true,
|
||||
},
|
||||
arrayData: {
|
||||
|
|
|
@ -186,7 +186,7 @@ function fetchData([data]) {
|
|||
ref="vnPaginateRef"
|
||||
class="show"
|
||||
v-bind="$attrs"
|
||||
search-url="notes"
|
||||
:search-url="false"
|
||||
@on-fetch="
|
||||
newNote.text = '';
|
||||
newNote.observationTypeFk = null;
|
||||
|
|
|
@ -33,6 +33,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: '',
|
||||
},
|
||||
userFilter: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
filter: {
|
||||
type: Object,
|
||||
default: null,
|
||||
|
|
|
@ -9,6 +9,8 @@ export function getColAlign(col) {
|
|||
case 'number':
|
||||
align = 'right';
|
||||
break;
|
||||
case 'time':
|
||||
case 'date':
|
||||
case 'checkbox':
|
||||
align = 'center';
|
||||
break;
|
||||
|
|
|
@ -148,8 +148,7 @@ export function useArrayData(key, userOptions) {
|
|||
}
|
||||
|
||||
async function applyFilter({ filter, params }, fetchOptions = {}) {
|
||||
if (filter) store.userFilter = filter;
|
||||
store.filter = {};
|
||||
if (filter) store.filter = filter;
|
||||
if (params) store.userParams = { ...params };
|
||||
|
||||
const response = await fetch(fetchOptions);
|
||||
|
|
|
@ -15,6 +15,7 @@ body.body--light {
|
|||
--vn-empty-tag: #acacac;
|
||||
--vn-black-text-color: black;
|
||||
--vn-text-color-contrast: white;
|
||||
--vn-link-color: #1e90ff;
|
||||
|
||||
background-color: var(--vn-page-color);
|
||||
|
||||
|
@ -38,6 +39,7 @@ body.body--dark {
|
|||
--vn-empty-tag: #2d2d2d;
|
||||
--vn-black-text-color: black;
|
||||
--vn-text-color-contrast: black;
|
||||
--vn-link-color: #66bfff;
|
||||
|
||||
background-color: var(--vn-page-color);
|
||||
|
||||
|
@ -49,7 +51,7 @@ a {
|
|||
}
|
||||
|
||||
.link {
|
||||
color: $color-link;
|
||||
color: var(--vn-link-color);
|
||||
cursor: pointer;
|
||||
|
||||
&--white {
|
||||
|
@ -58,14 +60,14 @@ a {
|
|||
}
|
||||
|
||||
.tx-color-link {
|
||||
color: $color-link !important;
|
||||
color: var(--vn-link-color) !important;
|
||||
}
|
||||
.tx-color-font {
|
||||
color: $color-link !important;
|
||||
color: var(--vn-link-color) !important;
|
||||
}
|
||||
|
||||
.header-link {
|
||||
color: $color-link !important;
|
||||
color: var(--vn-link-color) !important;
|
||||
cursor: pointer;
|
||||
border-bottom: solid $primary;
|
||||
border-width: 2px;
|
||||
|
@ -337,5 +339,5 @@ input::-webkit-inner-spin-button {
|
|||
}
|
||||
|
||||
.containerShrinked {
|
||||
width: 80%;
|
||||
width: 70%;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ $alert: $negative;
|
|||
$white: #fff;
|
||||
$dark: #3d3d3d;
|
||||
// custom
|
||||
$color-link: #66bfff;
|
||||
$color-spacer-light: #a3a3a31f;
|
||||
$color-spacer: #7979794d;
|
||||
$border-thin-light: 1px solid $color-spacer-light;
|
||||
|
|
|
@ -99,7 +99,6 @@ globals:
|
|||
file: File
|
||||
selectFile: Select a file
|
||||
copyClipboard: Copy on clipboard
|
||||
salesPerson: SalesPerson
|
||||
send: Send
|
||||
code: Code
|
||||
since: Since
|
||||
|
@ -158,7 +157,9 @@ globals:
|
|||
changeState: Change state
|
||||
raid: 'Raid {daysInForward} days'
|
||||
isVies: Vies
|
||||
department: Department
|
||||
noData: No data available
|
||||
vehicle: Vehicle
|
||||
pageTitles:
|
||||
logIn: Login
|
||||
addressEdit: Update address
|
||||
|
@ -346,7 +347,6 @@ globals:
|
|||
params:
|
||||
description: Description
|
||||
clientFk: Client id
|
||||
salesPersonFk: Sales person
|
||||
warehouseFk: Warehouse
|
||||
provinceFk: Province
|
||||
stateFk: State
|
||||
|
@ -531,6 +531,7 @@ ticket:
|
|||
customerCard: Customer card
|
||||
ticketList: Ticket List
|
||||
newOrder: New Order
|
||||
ticketClaimed: Claimed ticket
|
||||
boxing:
|
||||
expedition: Expedition
|
||||
created: Created
|
||||
|
@ -603,7 +604,6 @@ worker:
|
|||
balance: Balance
|
||||
medical: Medical
|
||||
list:
|
||||
department: Department
|
||||
schedule: Schedule
|
||||
newWorker: New worker
|
||||
summary:
|
||||
|
@ -862,7 +862,6 @@ components:
|
|||
mine: For me
|
||||
hasMinPrice: Minimum price
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Buyer
|
||||
supplierFk: Supplier
|
||||
from: From
|
||||
to: To
|
||||
|
|
|
@ -103,7 +103,6 @@ globals:
|
|||
file: Fichero
|
||||
selectFile: Seleccione un fichero
|
||||
copyClipboard: Copiar en portapapeles
|
||||
salesPerson: Comercial
|
||||
send: Enviar
|
||||
code: Código
|
||||
since: Desde
|
||||
|
@ -163,6 +162,8 @@ globals:
|
|||
raid: 'Redada {daysInForward} días'
|
||||
isVies: Vies
|
||||
noData: Datos no disponibles
|
||||
department: Departamento
|
||||
vehicle: Vehículo
|
||||
pageTitles:
|
||||
logIn: Inicio de sesión
|
||||
addressEdit: Modificar consignatario
|
||||
|
@ -349,7 +350,6 @@ globals:
|
|||
params:
|
||||
description: Descripción
|
||||
clientFk: Id cliente
|
||||
salesPersonFk: Comercial
|
||||
warehouseFk: Almacén
|
||||
provinceFk: Provincia
|
||||
stateFk: Estado
|
||||
|
@ -531,13 +531,13 @@ ticket:
|
|||
state: Estado
|
||||
shipped: Enviado
|
||||
landed: Entregado
|
||||
salesPerson: Comercial
|
||||
total: Total
|
||||
card:
|
||||
customerId: ID cliente
|
||||
customerCard: Ficha del cliente
|
||||
ticketList: Listado de tickets
|
||||
newOrder: Nuevo pedido
|
||||
ticketClaimed: Ticket reclamado
|
||||
boxing:
|
||||
expedition: Expedición
|
||||
created: Creado
|
||||
|
@ -622,8 +622,6 @@ invoiceOut:
|
|||
errors:
|
||||
downloadCsvFailed: Error al descargar CSV
|
||||
order:
|
||||
field:
|
||||
salesPersonFk: Comercial
|
||||
form:
|
||||
clientFk: Cliente
|
||||
addressFk: Dirección
|
||||
|
@ -691,7 +689,6 @@ worker:
|
|||
formation: Formación
|
||||
medical: Mutua
|
||||
list:
|
||||
department: Departamento
|
||||
schedule: Horario
|
||||
newWorker: Nuevo trabajador
|
||||
summary:
|
||||
|
@ -949,7 +946,6 @@ components:
|
|||
hasMinPrice: Precio mínimo
|
||||
wareHouseFk: Almacén
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Comprador
|
||||
supplierFk: Proveedor
|
||||
visible: Visible
|
||||
active: Activo
|
||||
|
|
|
@ -149,14 +149,12 @@ const columns = computed(() => [
|
|||
:right-search="false"
|
||||
>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<QCardSection>
|
||||
<VnInputPassword
|
||||
:label="t('Password')"
|
||||
v-model="data.password"
|
||||
:required="true"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
</QCardSection>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import AliasDescriptor from './AliasDescriptor.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Alias"
|
||||
url="MailAliases"
|
||||
:descriptor="AliasDescriptor"
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
|
|||
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -27,13 +28,10 @@ const entityId = computed(() => $props.id || route.params.id);
|
|||
<template #body="{ entity: alias }">
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
<router-link
|
||||
:to="{ name: 'AliasBasicData', params: { id: entityId } }"
|
||||
class="header header-link"
|
||||
>
|
||||
{{ t('globals.summary.basicData') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</router-link>
|
||||
<VnTitle
|
||||
:url="`#/account/alias/${entityId}/basic-data`"
|
||||
:text="t('globals.summary.basicData')"
|
||||
/>
|
||||
</QCardSection>
|
||||
<VnLv :label="t('role.id')" :value="alias.id" />
|
||||
<VnLv :label="t('role.description')" :value="alias.description" />
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import AccountDescriptor from './AccountDescriptor.vue';
|
||||
import filter from './AccountFilter.js';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
url="VnUsers/preview"
|
||||
:id-in-where="true"
|
||||
data-key="Account"
|
||||
|
|
|
@ -5,6 +5,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
|
|||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import filter from './AccountFilter.js';
|
||||
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
|
||||
const $props = defineProps({ id: { type: Number, default: 0 } });
|
||||
|
||||
|
@ -26,13 +27,10 @@ const entityId = computed(() => $props.id || route.params.id);
|
|||
<template #body="{ entity }">
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
<router-link
|
||||
:to="{ name: 'AccountBasicData', params: { id: entityId } }"
|
||||
class="header header-link"
|
||||
>
|
||||
{{ $t('globals.pageTitles.basicData') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</router-link>
|
||||
<VnTitle
|
||||
:url="`#/account/${entityId}/basic-data`"
|
||||
:text="$t('globals.pageTitles.basicData')"
|
||||
/>
|
||||
</QCardSection>
|
||||
<VnLv :label="$t('account.card.nickname')" :value="entity.name" />
|
||||
<VnLv :label="$t('account.card.role')" :value="entity.role?.name" />
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import RoleDescriptor from './RoleDescriptor.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
url="VnRoles"
|
||||
data-key="Role"
|
||||
:id-in-where="true"
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -29,13 +30,10 @@ const entityId = computed(() => $props.id || route.params.id);
|
|||
<template #body="{ entity }">
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
<a
|
||||
class="header header-link"
|
||||
:href="`#/VnUser/${entityId}/basic-data`"
|
||||
>
|
||||
{{ t('globals.pageTitles.basicData') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</a>
|
||||
<VnTitle
|
||||
:url="`#/account/role/${entityId}/basic-data`"
|
||||
:text="$t('globals.pageTitles.basicData')"
|
||||
/>
|
||||
</QCardSection>
|
||||
<VnLv :label="t('role.id')" :value="entity.id" />
|
||||
<VnLv :label="t('globals.name')" :value="entity.name" />
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import ClaimDescriptor from './ClaimDescriptor.vue';
|
||||
import filter from './ClaimFilter.js';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Claim"
|
||||
url="Claims"
|
||||
:descriptor="ClaimDescriptor"
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { toDateHourMinSec, toPercentage } from 'src/filters';
|
||||
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
|
@ -65,12 +66,12 @@ onMounted(async () => {
|
|||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.created')" :value="toDateHourMinSec(entity.created)" />
|
||||
<VnLv :label="t('claim.commercial')">
|
||||
<VnLv :label="t('globals.department')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="entity.client?.salesPersonUser?.name"
|
||||
:worker-id="entity.client?.salesPersonFk"
|
||||
/>
|
||||
<span class="link">
|
||||
{{ entity?.client?.department?.name || '-' }}
|
||||
<DepartmentDescriptorProxy :id="entity?.client?.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
|
|
|
@ -14,7 +14,7 @@ export default {
|
|||
relation: 'client',
|
||||
scope: {
|
||||
include: [
|
||||
{ relation: 'salesPersonUser' },
|
||||
{ relation: 'department' },
|
||||
{
|
||||
relation: 'claimsRatio',
|
||||
scope: {
|
||||
|
|
|
@ -117,7 +117,7 @@ const selected = ref([]);
|
|||
const mana = ref(0);
|
||||
async function fetchMana() {
|
||||
const ticketId = claim.value.ticketFk;
|
||||
const response = await axios.get(`Tickets/${ticketId}/getSalesPersonMana`);
|
||||
const response = await axios.get(`Tickets/${ticketId}/getDepartmentMana`);
|
||||
mana.value = response.data;
|
||||
}
|
||||
|
||||
|
|
|
@ -210,6 +210,7 @@ function onDrag() {
|
|||
class="all-pointer-events absolute delete-button zindex"
|
||||
@click.stop="viewDeleteDms(index)"
|
||||
round
|
||||
:data-cy="`delete-button-${index+1}`"
|
||||
/>
|
||||
<QIcon
|
||||
name="play_circle"
|
||||
|
@ -227,6 +228,7 @@ function onDrag() {
|
|||
class="rounded-borders cursor-pointer fit"
|
||||
@click="openDialog(media.dmsFk)"
|
||||
v-if="!media.isVideo"
|
||||
:data-cy="`file-${index+1}`"
|
||||
>
|
||||
</QImg>
|
||||
<video
|
||||
|
@ -235,6 +237,7 @@ function onDrag() {
|
|||
muted="muted"
|
||||
v-if="media.isVideo"
|
||||
@click="openDialog(media.dmsFk)"
|
||||
:data-cy="`file-${index+1}`"
|
||||
/>
|
||||
</QCard>
|
||||
</div>
|
||||
|
|
|
@ -19,6 +19,7 @@ import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
|||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import ClaimDescriptorMenu from './ClaimDescriptorMenu.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -252,13 +253,15 @@ function claimUrl(section) {
|
|||
</VnLv>
|
||||
<VnLv
|
||||
v-if="$route.name != 'ClaimSummary'"
|
||||
:label="t('globals.salesPerson')"
|
||||
:label="t('customer.summary.team')"
|
||||
>
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="claim.client?.salesPersonUser?.name"
|
||||
:worker-id="claim.client?.salesPersonFk"
|
||||
/>
|
||||
<span class="link">
|
||||
{{ claim?.client?.department?.name || '-' }}
|
||||
<DepartmentDescriptorProxy
|
||||
:id="claim?.client?.departmentFk"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.attendedBy')">
|
||||
|
@ -271,7 +274,7 @@ function claimUrl(section) {
|
|||
</VnLv>
|
||||
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
|
||||
<template #value>
|
||||
<span class="link cursor-pointer">
|
||||
<span class="link">
|
||||
{{ claim.client?.name }}
|
||||
<CustomerDescriptorProxy :id="claim.clientFk" />
|
||||
</span>
|
||||
|
|
|
@ -80,7 +80,7 @@ const columns = [
|
|||
:right-search="false"
|
||||
:column-search="false"
|
||||
:disable-option="{ card: true, table: true }"
|
||||
search-url="actions"
|
||||
:search-url="false"
|
||||
:filter="{ where: { claimFk: $props.id } }"
|
||||
:columns="columns"
|
||||
:limit="0"
|
||||
|
|
|
@ -44,15 +44,14 @@ const props = defineProps({
|
|||
is-outlined
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Salesperson')"
|
||||
v-model="params.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
:use-like="false"
|
||||
option-filter="firstName"
|
||||
dense
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('claim.attendedBy')"
|
||||
|
@ -126,7 +125,6 @@ en:
|
|||
search: Contains
|
||||
clientFk: Customer
|
||||
clientName: Customer
|
||||
salesPersonFk: Salesperson
|
||||
attenderFk: Attender
|
||||
claimResponsibleFk: Responsible
|
||||
claimStateFk: State
|
||||
|
@ -139,7 +137,6 @@ es:
|
|||
search: Contiene
|
||||
clientFk: Cliente
|
||||
clientName: Cliente
|
||||
salesPersonFk: Comercial
|
||||
attenderFk: Asistente
|
||||
claimResponsibleFk: Responsable
|
||||
claimStateFk: Estado
|
||||
|
@ -148,6 +145,5 @@ es:
|
|||
itemFk: Artículo
|
||||
zoneFk: Zona
|
||||
Client Name: Nombre del cliente
|
||||
Salesperson: Comercial
|
||||
Item: Artículo
|
||||
</i18n>
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { toDate } from 'filters/index';
|
||||
import ClaimFilter from './ClaimFilter.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import ClaimSummary from './Card/ClaimSummary.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
|
@ -48,6 +49,20 @@ const columns = computed(() => [
|
|||
},
|
||||
columnClass: 'expand',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('claim.attendedBy'),
|
||||
|
@ -152,6 +167,12 @@ const STATE_COLOR = {
|
|||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.departmentName || '-' }}
|
||||
<DepartmentDescriptorProxy :id="row?.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-attendedBy="{ row }">
|
||||
<span @click.stop>
|
||||
<VnUserLink :name="row.workerName" :worker-id="row.workerFk" />
|
||||
|
|
|
@ -8,7 +8,6 @@ import FormModel from 'components/FormModel.vue';
|
|||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -37,7 +36,7 @@ const exprBuilder = (param, value) => {
|
|||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData
|
||||
formData,
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
@ -119,16 +118,11 @@ function onBeforeSave(formData, originalData) {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelectWorker
|
||||
:label="t('customer.summary.salesPerson')"
|
||||
v-model="data.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
}"
|
||||
:has-avatar="true"
|
||||
:rules="validate('client.salesPersonFk')"
|
||||
:expr-builder="exprBuilder"
|
||||
emit-value
|
||||
<VnSelect
|
||||
:label="t('globals.department')"
|
||||
v-model="data.departmentFk"
|
||||
url="Departments"
|
||||
:fields="['id', 'name']"
|
||||
/>
|
||||
<VnSelect
|
||||
v-model="data.contactChannelFk"
|
||||
|
@ -160,7 +154,7 @@ function onBeforeSave(formData, originalData) {
|
|||
<QIcon name="info" class="cursor-pointer">
|
||||
<QTooltip>{{
|
||||
t(
|
||||
'In case of a company succession, specify the grantor company'
|
||||
'In case of a company succession, specify the grantor company',
|
||||
)
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Customer"
|
||||
:url="`Clients/${$route.params.id}/getCard`"
|
||||
:descriptor="CustomerDescriptor"
|
||||
|
|
|
@ -3,14 +3,14 @@ import { onMounted, ref, computed } from 'vue';
|
|||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
|
||||
import { toCurrency, toDate } from 'src/filters';
|
||||
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
|
||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import { useState } from 'src/composables/useState';
|
||||
const state = useState();
|
||||
|
||||
|
@ -84,14 +84,10 @@ const debtWarning = computed(() => {
|
|||
:value="toCurrency(entity.debt)"
|
||||
:info="t('customer.summary.riskInfo')"
|
||||
/>
|
||||
<VnLv :label="t('customer.summary.salesPerson')">
|
||||
<VnLv :label="t('globals.department')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
v-if="entity.salesPersonUser"
|
||||
:name="entity.salesPersonUser.name"
|
||||
:worker-id="entity.salesPersonFk"
|
||||
/>
|
||||
<span v-else>{{ dashIfEmpty(entity.salesPersonUser) }}</span>
|
||||
<span class="link" v-text="entity.department?.name" />
|
||||
<DepartmentDescriptorProxy :id="entity.department?.id" />
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
|
|
|
@ -86,12 +86,12 @@ const tableColumnComponents = {
|
|||
},
|
||||
file: {
|
||||
component: QBtn,
|
||||
props: () => ({ flat: true, color: 'blue' }),
|
||||
props: () => ({ flat: true }),
|
||||
event: ({ row }) => downloadFile(row.dmsFk),
|
||||
},
|
||||
employee: {
|
||||
component: QBtn,
|
||||
props: () => ({ flat: true, color: 'blue' }),
|
||||
props: () => ({ flat: true }),
|
||||
event: () => {},
|
||||
},
|
||||
created: {
|
||||
|
@ -214,8 +214,17 @@ const toCustomerFileManagementCreate = () => {
|
|||
v-bind="tableColumnComponents[props.col.name].props(props)"
|
||||
>
|
||||
<template v-if="props.col.name !== 'original'">
|
||||
{{ props.value }}
|
||||
<span
|
||||
:class="{
|
||||
link:
|
||||
props.col.name === 'employee' ||
|
||||
props.col.name === 'file',
|
||||
}"
|
||||
>
|
||||
{{ props.value }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<WorkerDescriptorProxy
|
||||
:id="props.row.dms.workerFk"
|
||||
v-if="props.col.name === 'employee'"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { computed, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
|
||||
import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters';
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
|
@ -13,6 +12,8 @@ import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryT
|
|||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import VnRow from 'src/components/ui/VnRow.vue';
|
||||
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||
|
@ -106,16 +107,12 @@ const sumRisk = ({ clientRisks }) => {
|
|||
{{ t('globals.params.email') }}
|
||||
<VnLinkMail email="entity.email"></VnLinkMail> </template
|
||||
></VnLv>
|
||||
<VnLv
|
||||
:label="t('customer.summary.salesPerson')"
|
||||
:value="entity?.salesPersonUser?.name"
|
||||
>
|
||||
<VnLv :label="t('globals.department')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="entity.salesPersonUser?.name"
|
||||
:worker-id="entity.salesPersonFk"
|
||||
/> </template
|
||||
></VnLv>
|
||||
<span class="link" v-text="entity.department?.name" />
|
||||
<DepartmentDescriptorProxy :id="entity?.department?.id" />
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('customer.summary.contactChannel')"
|
||||
:value="entity?.contactChannel?.name"
|
||||
|
|
|
@ -1,146 +0,0 @@
|
|||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const initialData = reactive({
|
||||
active: true,
|
||||
isEqualizated: false,
|
||||
});
|
||||
|
||||
const workersOptions = ref([]);
|
||||
const businessTypesOptions = ref([]);
|
||||
|
||||
function handleLocation(data, location) {
|
||||
const { town, code, provinceFk, countryFk } = location ?? {};
|
||||
data.postcode = code;
|
||||
data.city = town;
|
||||
data.provinceFk = provinceFk;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (workersOptions = data)"
|
||||
auto-load
|
||||
url="Workers/search?departmentCodes"
|
||||
/>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (businessTypesOptions = data)"
|
||||
auto-load
|
||||
url="BusinessTypes"
|
||||
/>
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<FormModel
|
||||
:form-initial-data="initialData"
|
||||
model="client"
|
||||
url-create="Clients/createWithUser"
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<QInput :label="t('Comercial name')" v-model="data.name" />
|
||||
<VnSelect
|
||||
:label="t('Salesperson')"
|
||||
:options="workersOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.salesPersonFk"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Business type')"
|
||||
:options="businessTypesOptions"
|
||||
hide-selected
|
||||
option-label="description"
|
||||
option-value="code"
|
||||
v-model="data.businessTypeFk"
|
||||
/>
|
||||
<QInput v-model="data.fi" :label="t('Tax number')" />
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QInput
|
||||
:label="t('Business name')"
|
||||
:rules="validate('client.socialName')"
|
||||
v-model="data.socialName"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QInput
|
||||
:label="t('Street')"
|
||||
:rules="validate('client.street')"
|
||||
v-model="data.street"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnLocation
|
||||
:rules="validate('Worker.postcode')"
|
||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||
v-model="data.location"
|
||||
@update:model-value="(location) => handleLocation(data, location)"
|
||||
>
|
||||
</VnLocation>
|
||||
</VnRow>
|
||||
|
||||
<VnRow>
|
||||
<QInput v-model="data.userName" :label="t('Web user')" />
|
||||
<QInput
|
||||
:label="t('Email')"
|
||||
:rules="validate('client.email')"
|
||||
clearable
|
||||
type="email"
|
||||
v-model="data.email"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon name="info" class="cursor-info">
|
||||
<QTooltip max-width="400px">{{
|
||||
t('customer.basicData.youCanSaveMultipleEmails')
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
</QInput>
|
||||
</VnRow>
|
||||
<QCheckbox
|
||||
:label="t('Is equalizated')"
|
||||
v-model="initialData.isEqualizated"
|
||||
/>
|
||||
</template>
|
||||
</FormModel>
|
||||
</QPage>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
grid-gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Comercial name: Nombre comercial
|
||||
Salesperson: Comercial
|
||||
Business type: Tipo de negocio
|
||||
Tax number: NIF / CIF
|
||||
Business name: Razón social
|
||||
Street: Dirección fiscal
|
||||
Postcode: Código postal
|
||||
City: Población
|
||||
Province: Provincia
|
||||
Country: País
|
||||
Web user: Usuario web
|
||||
Email: Email
|
||||
Is equalizated: Recargo de equivalencia
|
||||
</i18n>
|
|
@ -3,7 +3,6 @@ import { useI18n } from 'vue-i18n';
|
|||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
defineProps({
|
||||
|
@ -65,22 +64,15 @@ const exprBuilder = (param, value) => {
|
|||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnSelectWorker
|
||||
:label="t('Salesperson')"
|
||||
v-model="params.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
:expr-builder="exprBuilder"
|
||||
@update:model-value="searchFn()"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
dense
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -164,7 +156,6 @@ en:
|
|||
params:
|
||||
search: Contains
|
||||
fi: FI
|
||||
salesPersonFk: Salesperson
|
||||
provinceFk: Province
|
||||
isActive: Is active
|
||||
city: City
|
||||
|
@ -191,7 +182,6 @@ es:
|
|||
sageTaxTypeFk: Tipo de impuesto Sage
|
||||
sageTransactionTypeFk: Tipo de impuesto Sage
|
||||
payMethodFk: Forma de pago
|
||||
salesPersonFk: Comercial
|
||||
provinceFk: Provincia
|
||||
city: Ciudad
|
||||
phone: Teléfono
|
||||
|
@ -201,7 +191,6 @@ es:
|
|||
name: Nombre
|
||||
postcode: CP
|
||||
FI: NIF
|
||||
Salesperson: Comercial
|
||||
Province: Provincia
|
||||
City: Ciudad
|
||||
Phone: Teléfono
|
||||
|
|
|
@ -10,7 +10,6 @@ import CustomerFilter from './CustomerFilter.vue';
|
|||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -73,30 +72,17 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'salesPersonFk',
|
||||
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name', 'firstName'],
|
||||
where: { role: 'salesPerson' },
|
||||
optionFilter: 'firstName',
|
||||
url: 'Departments',
|
||||
},
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name', 'firstName'],
|
||||
where: { role: 'salesPerson' },
|
||||
optionLabel: 'firstName',
|
||||
optionValue: 'id',
|
||||
},
|
||||
},
|
||||
create: false,
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -155,6 +141,9 @@ const columns = computed(() => [
|
|||
inWhere: true,
|
||||
},
|
||||
columnClass: 'expand',
|
||||
attrs: {
|
||||
uppercase: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -446,36 +435,6 @@ function handleLocation(data, location) {
|
|||
redirect="customer"
|
||||
>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnSelectWorker
|
||||
:label="t('customer.summary.salesPerson')"
|
||||
v-model="data.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
}"
|
||||
:has-avatar="true"
|
||||
:id-value="data.salesPersonFk"
|
||||
emit-value
|
||||
auto-load
|
||||
>
|
||||
<template #prepend>
|
||||
<VnAvatar
|
||||
:worker-id="data.salesPersonFk"
|
||||
color="primary"
|
||||
:title="title"
|
||||
/>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption
|
||||
>{{ scope.opt?.nickname }},
|
||||
{{ scope.opt?.code }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelectWorker>
|
||||
<VnLocation
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
v-model="data.location"
|
||||
|
|
|
@ -32,28 +32,6 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'isWorker',
|
||||
label: t('Is worker'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'salesPersonFk',
|
||||
label: t('Salesperson'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
where: { role: 'salesPerson' },
|
||||
useLike: false,
|
||||
optionValue: 'id',
|
||||
optionLabel: 'name',
|
||||
optionFilter: 'firstName',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
|
@ -153,6 +131,11 @@ const columns = computed(() => [
|
|||
label: t('Has recovery'),
|
||||
name: 'hasRecovery',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'isWorker',
|
||||
label: t('customer.params.isWorker'),
|
||||
},
|
||||
]);
|
||||
|
||||
const viewAddObservation = (rowsSelected) => {
|
||||
|
@ -167,7 +150,6 @@ const viewAddObservation = (rowsSelected) => {
|
|||
|
||||
function exprBuilder(param, value) {
|
||||
switch (param) {
|
||||
case 'salesPersonFk':
|
||||
case 'creditInsurance':
|
||||
case 'countryFk':
|
||||
return { [`c.${param}`]: value };
|
||||
|
@ -176,7 +158,7 @@ function exprBuilder(param, value) {
|
|||
case 'workerFk':
|
||||
return { [`co.${param}`]: value };
|
||||
case 'departmentFk':
|
||||
return { [`wd.${param}`]: value };
|
||||
return { [`c.${param}`]: value };
|
||||
case 'amount':
|
||||
case 'clientFk':
|
||||
return { [`d.${param}`]: value };
|
||||
|
@ -241,12 +223,6 @@ function exprBuilder(param, value) {
|
|||
<template #column-observation="{ row }">
|
||||
<VnInput type="textarea" v-model="row.observation" readonly dense rows="2" />
|
||||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.salesPersonName }}
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.departmentName }}
|
||||
|
@ -265,8 +241,6 @@ function exprBuilder(param, value) {
|
|||
es:
|
||||
Add observation: Añadir observación
|
||||
Client: Cliente
|
||||
Is worker: Es trabajador
|
||||
Salesperson: Comercial
|
||||
Department: Departamento
|
||||
Country: País
|
||||
P. Method: F. Pago
|
||||
|
@ -281,5 +255,5 @@ es:
|
|||
Credit I.: Crédito A.
|
||||
Credit insurance: Crédito asegurado
|
||||
From: Desde
|
||||
Has recovery: Tiene recobro
|
||||
Has recovery: Recobro
|
||||
</i18n>
|
||||
|
|
|
@ -15,19 +15,12 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const salespersons = ref();
|
||||
const countries = ref();
|
||||
const authors = ref();
|
||||
const departments = ref();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
@on-fetch="(data) => (salespersons = data)"
|
||||
auto-load
|
||||
url="Workers/activeWithInheritedRole"
|
||||
/>
|
||||
<FetchData @on-fetch="(data) => (countries = data)" auto-load url="Countries" />
|
||||
<FetchData
|
||||
@on-fetch="(data) => (authors = data)"
|
||||
|
@ -62,29 +55,6 @@ const departments = ref();
|
|||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="salespersons">
|
||||
<VnSelect
|
||||
:input-debounce="0"
|
||||
:label="t('Salesperson')"
|
||||
:options="salespersons"
|
||||
dense
|
||||
emit-value
|
||||
hide-selected
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
outlined
|
||||
rounded
|
||||
use-input
|
||||
v-model="params.salesPersonFk"
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection v-else>
|
||||
<QSkeleton class="full-width" type="QInput" />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="departments">
|
||||
<VnSelect
|
||||
|
@ -219,7 +189,6 @@ const departments = ref();
|
|||
en:
|
||||
params:
|
||||
clientFk: Client
|
||||
salesPersonFk: Salesperson
|
||||
countryFk: Country
|
||||
paymentMethod: P. Method
|
||||
balance: Balance D.
|
||||
|
@ -230,7 +199,6 @@ en:
|
|||
es:
|
||||
params:
|
||||
clientFk: Cliente
|
||||
salesPersonFk: Comercial
|
||||
countryFk: País
|
||||
paymentMethod: F. Pago
|
||||
balance: Saldo V.
|
||||
|
@ -239,7 +207,6 @@ es:
|
|||
credit: Crédito A.
|
||||
defaulterSinced: Desde
|
||||
Client: Cliente
|
||||
Salesperson: Comercial
|
||||
Departments: Departamentos
|
||||
Country: País
|
||||
P. Method: F. Pago
|
||||
|
|
|
@ -69,17 +69,16 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
|
||||
name: 'salesPersonFk',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
where: { role: 'salesPerson' },
|
||||
optionFilter: 'firstName',
|
||||
useLike: false,
|
||||
url: 'Departments',
|
||||
},
|
||||
visible: false,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
|
@ -96,7 +95,7 @@ const columns = computed(() => [
|
|||
</VnSubToolbar>
|
||||
<VnTable
|
||||
:data-key="dataKey"
|
||||
url="Clients"
|
||||
url="Clients/filter"
|
||||
:table="{
|
||||
'row-key': 'id',
|
||||
selection: 'multiple',
|
||||
|
@ -127,7 +126,6 @@ const columns = computed(() => [
|
|||
es:
|
||||
Identifier: Identificador
|
||||
Social name: Razón social
|
||||
Salesperson: Comercial
|
||||
Phone: Teléfono
|
||||
City: Población
|
||||
Email: Email
|
||||
|
|
|
@ -20,7 +20,7 @@ customer:
|
|||
name: Name
|
||||
contact: Contact
|
||||
mobile: Mobile
|
||||
salesPerson: Sales person
|
||||
team: Team
|
||||
contactChannel: Contact channel
|
||||
socialName: Social name
|
||||
fiscalId: Fiscal ID
|
||||
|
@ -78,7 +78,6 @@ customer:
|
|||
id: Identifier
|
||||
socialName: Social name
|
||||
fi: Tax number
|
||||
salesPersonFk: Salesperson
|
||||
creditInsurance: Credit insurance
|
||||
phone: Phone
|
||||
street: Street
|
||||
|
|
|
@ -20,7 +20,7 @@ customer:
|
|||
name: Nombre
|
||||
contact: Contacto
|
||||
mobile: Móvil
|
||||
salesPerson: Comercial
|
||||
team: Equipo
|
||||
contactChannel: Canal de contacto
|
||||
socialName: Razón social
|
||||
fiscalId: NIF/CIF
|
||||
|
@ -78,7 +78,6 @@ customer:
|
|||
id: Identificador
|
||||
socialName: Razón social
|
||||
fi: NIF / CIF
|
||||
salesPersonFk: Comercial
|
||||
creditInsurance: Crédito asegurado
|
||||
phone: Teléfono
|
||||
street: Dirección fiscal
|
||||
|
|
|
@ -13,6 +13,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue';
|
||||
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -53,7 +54,7 @@ onMounted(() => {
|
|||
:clear-store-on-unmount="false"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<VnSelectTravelExtended
|
||||
:data="data"
|
||||
v-model="data.travelFk"
|
||||
|
@ -65,7 +66,7 @@ onMounted(() => {
|
|||
:required="true"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<VnInput v-model="data.reference" :label="t('globals.reference')" />
|
||||
<VnInputNumber
|
||||
v-model="data.invoiceAmount"
|
||||
|
@ -73,7 +74,7 @@ onMounted(() => {
|
|||
:positive="false"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<VnInput
|
||||
v-model="data.invoiceNumber"
|
||||
:label="t('entry.summary.invoiceNumber')"
|
||||
|
@ -84,12 +85,13 @@ onMounted(() => {
|
|||
:options="companiesOptions"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
sort-by="code"
|
||||
map-options
|
||||
hide-selected
|
||||
:required="true"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<VnInputNumber
|
||||
:label="t('entry.summary.commission')"
|
||||
v-model="data.commission"
|
||||
|
@ -102,9 +104,10 @@ onMounted(() => {
|
|||
:options="currenciesOptions"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
sort-by="code"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<VnInputNumber
|
||||
v-model="data.initialTemperature"
|
||||
name="initialTemperature"
|
||||
|
@ -121,8 +124,16 @@ onMounted(() => {
|
|||
:decimal-places="2"
|
||||
:positive="false"
|
||||
/>
|
||||
<VnSelect
|
||||
v-model="data.typeFk"
|
||||
url="entryTypes"
|
||||
:fields="['code', 'description']"
|
||||
option-value="code"
|
||||
optionLabel="description"
|
||||
sortBy="description"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnRow class="q-py-sm">
|
||||
<QInput
|
||||
:label="t('entry.basicData.observation')"
|
||||
type="textarea"
|
||||
|
@ -132,14 +143,20 @@ onMounted(() => {
|
|||
fill-input
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QCheckbox v-model="data.isOrdered" :label="t('entry.summary.ordered')" />
|
||||
<QCheckbox v-model="data.isConfirmed" :label="t('globals.confirmed')" />
|
||||
<QCheckbox
|
||||
v-model="data.isExcludedFromAvailable"
|
||||
:label="t('entry.summary.excludedFromAvailable')"
|
||||
<VnRow class="q-py-sm">
|
||||
<VnCheckbox
|
||||
v-model="data.isOrdered"
|
||||
:label="t('entry.list.tableVisibleColumns.isOrdered')"
|
||||
/>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
v-model="data.isConfirmed"
|
||||
:label="t('entry.list.tableVisibleColumns.isConfirmed')"
|
||||
/>
|
||||
<VnCheckbox
|
||||
v-model="data.isExcludedFromAvailable"
|
||||
:label="t('entry.list.tableVisibleColumns.isExcludedFromAvailable')"
|
||||
/>
|
||||
<VnCheckbox
|
||||
:disable="!isAdministrative()"
|
||||
v-model="data.isBooked"
|
||||
:label="t('entry.basicData.booked')"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
|
@ -16,6 +16,8 @@ import ItemDescriptor from 'src/pages/Item/Card/ItemDescriptor.vue';
|
|||
import axios from 'axios';
|
||||
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
||||
import { checkEntryLock } from 'src/composables/checkEntryLock';
|
||||
import VnRow from 'src/components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -57,31 +59,6 @@ const columns = [
|
|||
createOrder: 12,
|
||||
width: '25px',
|
||||
},
|
||||
{
|
||||
label: t('Buyer'),
|
||||
name: 'workerFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'TicketRequests/getItemTypeWorker',
|
||||
fields: ['id', 'nickname'],
|
||||
optionLabel: 'nickname',
|
||||
sortBy: 'nickname ASC',
|
||||
optionValue: 'id',
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
label: t('Family'),
|
||||
name: 'itemTypeFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'itemTypes',
|
||||
fields: ['id', 'name'],
|
||||
optionLabel: 'name',
|
||||
optionValue: 'id',
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
name: 'id',
|
||||
isId: true,
|
||||
|
@ -111,16 +88,10 @@ const columns = [
|
|||
},
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
label: t('Article'),
|
||||
component: 'input',
|
||||
name: 'name',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Items',
|
||||
fields: ['id', 'name'],
|
||||
optionLabel: 'name',
|
||||
optionValue: 'id',
|
||||
},
|
||||
width: '85px',
|
||||
isEditable: false,
|
||||
},
|
||||
|
@ -212,7 +183,6 @@ const columns = [
|
|||
},
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
labelAbbreviation: 'GM',
|
||||
label: t('Grouping selector'),
|
||||
toolTip: t('Grouping selector'),
|
||||
|
@ -240,7 +210,6 @@ const columns = [
|
|||
},
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
labelAbbreviation: 'G',
|
||||
label: 'Grouping',
|
||||
toolTip: 'Grouping',
|
||||
|
@ -294,7 +263,7 @@ const columns = [
|
|||
align: 'center',
|
||||
label: t('Amount'),
|
||||
name: 'amount',
|
||||
width: '45px',
|
||||
width: '75px',
|
||||
component: 'number',
|
||||
attrs: {
|
||||
positive: false,
|
||||
|
@ -310,7 +279,9 @@ const columns = [
|
|||
toolTip: t('Package'),
|
||||
name: 'price2',
|
||||
component: 'number',
|
||||
createDisable: true,
|
||||
createAttrs: {
|
||||
disable: true,
|
||||
},
|
||||
width: '35px',
|
||||
create: true,
|
||||
format: (row) => parseFloat(row['price2']).toFixed(2),
|
||||
|
@ -320,7 +291,9 @@ const columns = [
|
|||
label: t('Box'),
|
||||
name: 'price3',
|
||||
component: 'number',
|
||||
createDisable: true,
|
||||
createAttrs: {
|
||||
disable: true,
|
||||
},
|
||||
cellEvent: {
|
||||
'update:modelValue': async (value, oldValue, row) => {
|
||||
row['price2'] = row['price2'] * (value / oldValue);
|
||||
|
@ -340,13 +313,6 @@ const columns = [
|
|||
toggleIndeterminate: false,
|
||||
},
|
||||
component: 'checkbox',
|
||||
cellEvent: {
|
||||
'update:modelValue': async (value, oldValue, row) => {
|
||||
await axios.patch(`Items/${row['itemFk']}`, {
|
||||
hasMinPrice: value,
|
||||
});
|
||||
},
|
||||
},
|
||||
width: '25px',
|
||||
},
|
||||
{
|
||||
|
@ -356,13 +322,6 @@ const columns = [
|
|||
toolTip: t('Minimum price'),
|
||||
name: 'minPrice',
|
||||
component: 'number',
|
||||
cellEvent: {
|
||||
'update:modelValue': async (value, oldValue, row) => {
|
||||
await axios.patch(`Items/${row['itemFk']}`, {
|
||||
minPrice: value,
|
||||
});
|
||||
},
|
||||
},
|
||||
width: '35px',
|
||||
style: (row) => {
|
||||
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
||||
|
@ -425,6 +384,23 @@ const columns = [
|
|||
},
|
||||
},
|
||||
];
|
||||
const buyerFk = ref(null);
|
||||
const itemTypeFk = ref(null);
|
||||
const inkFk = ref(null);
|
||||
const tag1 = ref(null);
|
||||
const tag2 = ref(null);
|
||||
const tag1Filter = ref(null);
|
||||
const tag2Filter = ref(null);
|
||||
const filter = computed(() => {
|
||||
const where = {};
|
||||
where.workerFk = buyerFk.value;
|
||||
where.itemTypeFk = itemTypeFk.value;
|
||||
where.inkFk = inkFk.value;
|
||||
where.tag1 = tag1.value;
|
||||
where.tag2 = tag2.value;
|
||||
|
||||
return { where };
|
||||
});
|
||||
|
||||
function getQuantityStyle(row) {
|
||||
if (row?.quantity !== row?.stickers * row?.packing)
|
||||
|
@ -610,6 +586,7 @@ onMounted(() => {
|
|||
:url="`Entries/${entityId}/getBuyList`"
|
||||
search-url="EntryBuys"
|
||||
save-url="Buys/crud"
|
||||
:filter="filter"
|
||||
:disable-option="{ card: true }"
|
||||
v-model:selected="selectedRows"
|
||||
@on-fetch="() => footerFetchDataRef.fetch()"
|
||||
|
@ -655,7 +632,7 @@ onMounted(() => {
|
|||
:is-editable="editableMode"
|
||||
:without-header="!editableMode"
|
||||
:with-filters="editableMode"
|
||||
:right-search="editableMode"
|
||||
:right-search="false"
|
||||
:row-click="false"
|
||||
:columns="columns"
|
||||
:beforeSaveFn="beforeSave"
|
||||
|
@ -666,6 +643,46 @@ onMounted(() => {
|
|||
data-cy="entry-buys"
|
||||
overlay
|
||||
>
|
||||
<template #top-left>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Buyer')"
|
||||
v-model="buyerFk"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
:fields="['id', 'nickname']"
|
||||
option-label="nickname"
|
||||
sort-by="nickname ASC"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Family')"
|
||||
v-model="itemTypeFk"
|
||||
url="ItemTypes"
|
||||
:fields="['id', 'name']"
|
||||
option-label="name"
|
||||
sort-by="name ASC"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Color')"
|
||||
v-model="inkFk"
|
||||
url="Inks"
|
||||
:fields="['id', 'name']"
|
||||
option-label="name"
|
||||
sort-by="name ASC"
|
||||
/>
|
||||
<VnInput
|
||||
v-model="tag1Filter"
|
||||
:label="t('Tag')"
|
||||
@keyup.enter="tag1 = tag1Filter"
|
||||
@remove="tag1 = null"
|
||||
/>
|
||||
<VnInput
|
||||
v-model="tag2Filter"
|
||||
:label="t('Tag')"
|
||||
@keyup.enter="tag2 = tag2Filter"
|
||||
@remove="tag2 = null"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
<template #column-hex="{ row }">
|
||||
<VnColor :colors="row?.hexJson" style="height: 100%; min-width: 2000px" />
|
||||
</template>
|
||||
|
@ -696,7 +713,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</template>
|
||||
<template #column-footer-weight>
|
||||
{{ footer?.weight }}
|
||||
<span class="q-pr-xs">{{ footer?.weight }}</span>
|
||||
</template>
|
||||
<template #column-footer-quantity>
|
||||
<span :style="getQuantityStyle(footer)" data-cy="footer-quantity">
|
||||
|
@ -704,9 +721,8 @@ onMounted(() => {
|
|||
</span>
|
||||
</template>
|
||||
<template #column-footer-amount>
|
||||
<span :style="getAmountStyle(footer)" data-cy="footer-amount">
|
||||
{{ footer?.amount }}
|
||||
</span>
|
||||
<span data-cy="footer-amount">{{ footer?.amount }} / </span>
|
||||
<span style="color: var(--q-positive)">{{ footer?.checkedAmount }}</span>
|
||||
</template>
|
||||
<template #column-create-itemFk="{ data }">
|
||||
<VnSelect
|
||||
|
@ -767,6 +783,8 @@ onMounted(() => {
|
|||
</template>
|
||||
<i18n>
|
||||
es:
|
||||
Buyer: Comprador
|
||||
Family: Familia
|
||||
Article: Artículo
|
||||
Siz.: Med.
|
||||
Size: Medida
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import EntryDescriptor from './EntryDescriptor.vue';
|
||||
import filter from './EntryFilter.js';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Entry"
|
||||
url="Entries"
|
||||
:descriptor="EntryDescriptor"
|
||||
|
|
|
@ -2,153 +2,82 @@
|
|||
import { ref, computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import CrudModel from 'components/CrudModel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
|
||||
const { params } = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const selectedRows = ref([]);
|
||||
const entryObservationsRef = ref(null);
|
||||
const entryObservationsOptions = ref([]);
|
||||
const selected = ref([]);
|
||||
|
||||
const sortEntryObservationOptions = (data) => {
|
||||
entryObservationsOptions.value = [...data].sort((a, b) =>
|
||||
a.description.localeCompare(b.description),
|
||||
);
|
||||
};
|
||||
|
||||
const entityId = ref(params.id);
|
||||
const columns = computed(() => [
|
||||
{
|
||||
name: 'observationType',
|
||||
label: t('entry.notes.observationType'),
|
||||
field: (row) => row.observationTypeFk,
|
||||
sortable: true,
|
||||
options: entryObservationsOptions.value,
|
||||
required: true,
|
||||
model: 'observationTypeFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'description',
|
||||
tabIndex: 1,
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
isId: true,
|
||||
visible: false,
|
||||
isEditable: false,
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
name: 'observationTypeFk',
|
||||
label: t('entry.notes.observationType'),
|
||||
component: 'select',
|
||||
columnFilter: { inWhere: true },
|
||||
attrs: {
|
||||
inWhere: true,
|
||||
url: 'ObservationTypes',
|
||||
fields: ['id', 'description'],
|
||||
optionValue: 'id',
|
||||
optionLabel: 'description',
|
||||
sortBy: 'description',
|
||||
},
|
||||
width: '30px',
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'description',
|
||||
label: t('globals.description'),
|
||||
field: (row) => row.description,
|
||||
tabIndex: 2,
|
||||
align: 'left',
|
||||
component: 'input',
|
||||
columnFilter: false,
|
||||
attrs: { autogrow: true },
|
||||
create: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const filter = computed(() => ({
|
||||
fields: ['id', 'entryFk', 'observationTypeFk', 'description'],
|
||||
include: ['observationType'],
|
||||
where: { entryFk: entityId },
|
||||
}));
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
url="ObservationTypes"
|
||||
@on-fetch="(data) => sortEntryObservationOptions(data)"
|
||||
<VnTable
|
||||
ref="entryObservationsRef"
|
||||
data-key="EntryObservations"
|
||||
:columns="columns"
|
||||
url="EntryObservations"
|
||||
:user-filter="filter"
|
||||
order="id ASC"
|
||||
:disable-option="{ card: true }"
|
||||
:is-editable="true"
|
||||
:right-search="true"
|
||||
v-model:selected="selectedRows"
|
||||
:create="{
|
||||
urlCreate: 'EntryObservations',
|
||||
title: t('Create note'),
|
||||
onDataSaved: () => {
|
||||
entryObservationsRef.reload();
|
||||
},
|
||||
formInitialData: { entryFk: entityId },
|
||||
}"
|
||||
:table="{
|
||||
'row-key': 'id',
|
||||
selection: 'multiple',
|
||||
}"
|
||||
auto-load
|
||||
/>
|
||||
<CrudModel
|
||||
data-key="EntryAccount"
|
||||
url="EntryObservations"
|
||||
model="EntryAccount"
|
||||
:filter="{
|
||||
fields: ['id', 'entryFk', 'observationTypeFk', 'description'],
|
||||
where: { entryFk: params.id },
|
||||
}"
|
||||
ref="entryObservationsRef"
|
||||
:data-required="{ entryFk: params.id }"
|
||||
v-model:selected="selected"
|
||||
auto-load
|
||||
>
|
||||
<template #body="{ rows, validate }">
|
||||
<QTable
|
||||
v-model:selected="selected"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
row-key="$index"
|
||||
selection="multiple"
|
||||
hide-pagination
|
||||
:grid="$q.screen.lt.md"
|
||||
table-header-class="text-left"
|
||||
>
|
||||
<template #body-cell-observationType="{ row, col }">
|
||||
<QTd>
|
||||
<VnSelect
|
||||
v-model="row[col.model]"
|
||||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:autofocus="col.tabIndex == 1"
|
||||
input-debounce="0"
|
||||
hide-selected
|
||||
:required="true"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-description="{ row, col }">
|
||||
<QTd>
|
||||
<VnInput
|
||||
:label="t('globals.description')"
|
||||
v-model="row[col.name]"
|
||||
:rules="validate('EntryObservation.description')"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #item="props">
|
||||
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
|
||||
<QCard bordered flat>
|
||||
<QCardSection>
|
||||
<QCheckbox v-model="props.selected" dense />
|
||||
</QCardSection>
|
||||
<QSeparator />
|
||||
<QList dense>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
v-model="props.row.observationTypeFk"
|
||||
:options="entryObservationsOptions"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
input-debounce="0"
|
||||
hide-selected
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('globals.description')"
|
||||
v-model="props.row.description"
|
||||
:rules="
|
||||
validate('EntryObservation.description')
|
||||
"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QList>
|
||||
</QCard>
|
||||
</div>
|
||||
</template>
|
||||
</QTable>
|
||||
</template>
|
||||
</CrudModel>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn
|
||||
fab
|
||||
color="primary"
|
||||
icon="add"
|
||||
v-shortcut="'+'"
|
||||
@click="entryObservationsRef.insert()"
|
||||
/>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
<i18n>
|
||||
es:
|
||||
Add note: Añadir nota
|
||||
Remove note: Quitar nota
|
||||
Create note: Crear nota
|
||||
</i18n>
|
||||
|
|
|
@ -92,13 +92,13 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="card-content">
|
||||
<VnCheckbox
|
||||
:label="t('entry.summary.ordered')"
|
||||
:label="t('entry.list.tableVisibleColumns.isOrdered')"
|
||||
v-model="entry.isOrdered"
|
||||
:disable="true"
|
||||
size="xs"
|
||||
/>
|
||||
<VnCheckbox
|
||||
:label="t('globals.confirmed')"
|
||||
:label="t('entry.list.tableVisibleColumns.isConfirmed')"
|
||||
v-model="entry.isConfirmed"
|
||||
:disable="true"
|
||||
size="xs"
|
||||
|
@ -110,7 +110,11 @@ onMounted(async () => {
|
|||
size="xs"
|
||||
/>
|
||||
<VnCheckbox
|
||||
:label="t('entry.summary.excludedFromAvailable')"
|
||||
:label="
|
||||
t(
|
||||
'entry.list.tableVisibleColumns.isExcludedFromAvailable',
|
||||
)
|
||||
"
|
||||
v-model="entry.isExcludedFromAvailable"
|
||||
:disable="true"
|
||||
size="xs"
|
||||
|
|
|
@ -85,7 +85,7 @@ const entryFilterPanel = ref();
|
|||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('entry.list.tableVisibleColumns.isConfirmed')"
|
||||
label="LE"
|
||||
v-model="params.isConfirmed"
|
||||
toggle-indeterminate
|
||||
>
|
||||
|
@ -102,6 +102,7 @@ const entryFilterPanel = ref();
|
|||
v-model="params.landed"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
data-cy="landed"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -121,13 +122,6 @@ const entryFilterPanel = ref();
|
|||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.invoiceNumber"
|
||||
:label="t('params.invoiceNumber')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
|
@ -171,6 +165,7 @@ const entryFilterPanel = ref();
|
|||
@update:model-value="searchFn()"
|
||||
url="Warehouses"
|
||||
:fields="['id', 'name']"
|
||||
sort-by="name ASC"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
|
@ -186,6 +181,7 @@ const entryFilterPanel = ref();
|
|||
@update:model-value="searchFn()"
|
||||
url="Warehouses"
|
||||
:fields="['id', 'name']"
|
||||
sort-by="name ASC"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
|
@ -233,15 +229,6 @@ const entryFilterPanel = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.evaNotes"
|
||||
:label="t('params.evaNotes')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -267,7 +254,7 @@ en:
|
|||
hasToShowDeletedEntries: Show deleted entries
|
||||
es:
|
||||
params:
|
||||
isExcludedFromAvailable: Inventario
|
||||
isExcludedFromAvailable: Excluida
|
||||
isOrdered: Pedida
|
||||
isConfirmed: Confirmado
|
||||
isReceived: Recibida
|
||||
|
|
|
@ -1,264 +0,0 @@
|
|||
<script setup>
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { toDate } from 'src/filters';
|
||||
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnImg from 'src/components/ui/VnImg.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const columns = [
|
||||
{
|
||||
align: 'center',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.image'),
|
||||
name: 'itemFk',
|
||||
columnField: {
|
||||
component: VnImg,
|
||||
attrs: ({ row }) => {
|
||||
return {
|
||||
id: row.id,
|
||||
size: '50x50',
|
||||
};
|
||||
},
|
||||
},
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.itemFk'),
|
||||
name: 'itemFk',
|
||||
isTitle: true,
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.summary.packing'),
|
||||
name: 'packing',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.summary.grouping'),
|
||||
name: 'grouping',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.quantity'),
|
||||
name: 'quantity',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.description'),
|
||||
name: 'description',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.size'),
|
||||
name: 'size',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.tags'),
|
||||
name: 'tags',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.type'),
|
||||
name: 'type',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.intrastat'),
|
||||
name: 'intrastat',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.origin'),
|
||||
name: 'origin',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'),
|
||||
name: 'weightByPiece',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.isActive'),
|
||||
name: 'isActive',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.family'),
|
||||
name: 'family',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.entryFk'),
|
||||
name: 'entryFk',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.summary.buyingValue'),
|
||||
name: 'buyingValue',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.freightValue'),
|
||||
name: 'freightValue',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.comissionValue'),
|
||||
name: 'comissionValue',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.packageValue'),
|
||||
name: 'packageValue',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.isIgnored'),
|
||||
name: 'isIgnored',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.price2'),
|
||||
name: 'price2',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.price3'),
|
||||
name: 'price3',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.minPrice'),
|
||||
name: 'minPrice',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.ektFk'),
|
||||
name: 'ektFk',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('globals.weight'),
|
||||
name: 'weight',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.buys.packagingFk'),
|
||||
name: 'packagingFk',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.packingOut'),
|
||||
name: 'packingOut',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.landing'),
|
||||
name: 'landing',
|
||||
component: 'date',
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
||||
},
|
||||
];
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<EntryLatestBuysFilter data-key="LatestBuys" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<VnSubToolbar />
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="LatestBuys"
|
||||
url="Buys/latestBuysFilter"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
redirect="entry"
|
||||
:row-click="({ entryFk }) => tableRef.redirect(entryFk)"
|
||||
auto-load
|
||||
:right-search="false"
|
||||
/>
|
||||
</template>
|
|
@ -1,161 +0,0 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import VnInput from 'components/common/VnInput.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
||||
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineProps({
|
||||
dataKey: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const tagValues = ref([]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem class="q-my-md">
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('components.itemsFilterPanel.salesPersonFk')"
|
||||
v-model="params.salesPersonFk"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
option-label="nickname"
|
||||
:fields="['id', 'nickname']"
|
||||
sort-by="nickname ASC"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
use-input
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-md">
|
||||
<QItemSection>
|
||||
<VnSelectSupplier
|
||||
v-model="params.supplierFk"
|
||||
url="Suppliers"
|
||||
:fields="['id', 'name', 'nickname']"
|
||||
sort-by="name ASC"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-md">
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('components.itemsFilterPanel.started')"
|
||||
v-model="params.from"
|
||||
is-outlined
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-md">
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('components.itemsFilterPanel.ended')"
|
||||
v-model="params.to"
|
||||
is-outlined
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('components.itemsFilterPanel.active')"
|
||||
v-model="params.active"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('globals.visible')"
|
||||
v-model="params.visible"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('components.itemsFilterPanel.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">
|
||||
<VnSelect
|
||||
: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">
|
||||
<VnSelect
|
||||
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>
|
||||
</template>
|
||||
</ItemsFilterPanel>
|
||||
</template>
|
|
@ -107,9 +107,8 @@ const columns = computed(() => [
|
|||
attrs: {
|
||||
url: 'suppliers',
|
||||
fields: ['id', 'name'],
|
||||
where: { order: 'name DESC' },
|
||||
sortBy: 'name ASC',
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.supplierName),
|
||||
width: '110px',
|
||||
},
|
||||
{
|
||||
|
@ -145,6 +144,7 @@ const columns = computed(() => [
|
|||
attrs: {
|
||||
url: 'agencyModes',
|
||||
fields: ['id', 'name'],
|
||||
sortBy: 'name ASC',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
|
@ -158,7 +158,6 @@ const columns = computed(() => [
|
|||
component: 'input',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.list.tableVisibleColumns.warehouseOutFk'),
|
||||
name: 'warehouseOutFk',
|
||||
cardVisible: true,
|
||||
|
@ -166,6 +165,7 @@ const columns = computed(() => [
|
|||
attrs: {
|
||||
url: 'warehouses',
|
||||
fields: ['id', 'name'],
|
||||
sortBy: 'name ASC',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
|
@ -174,7 +174,6 @@ const columns = computed(() => [
|
|||
width: '65px',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.list.tableVisibleColumns.warehouseInFk'),
|
||||
name: 'warehouseInFk',
|
||||
cardVisible: true,
|
||||
|
@ -182,6 +181,7 @@ const columns = computed(() => [
|
|||
attrs: {
|
||||
url: 'warehouses',
|
||||
fields: ['id', 'name'],
|
||||
sortBy: 'name ASC',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
|
@ -190,7 +190,6 @@ const columns = computed(() => [
|
|||
width: '65px',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
labelAbbreviation: t('Type'),
|
||||
label: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||
toolTip: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||
|
@ -201,6 +200,7 @@ const columns = computed(() => [
|
|||
fields: ['code', 'description'],
|
||||
optionValue: 'code',
|
||||
optionLabel: 'description',
|
||||
sortBy: 'description',
|
||||
},
|
||||
width: '65px',
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.entryTypeDescription),
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useQuasar, date } from 'quasar';
|
||||
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import EntryStockBoughtFilter from './EntryStockBoughtFilter.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import EntryStockBoughtDetail from 'src/pages/Entry/EntryStockBoughtDetail.vue';
|
||||
import TravelDescriptorProxy from '../Travel/Card/TravelDescriptorProxy.vue';
|
||||
import { useFilterParams } from 'src/composables/useFilterParams';
|
||||
import axios from 'axios';
|
||||
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
const state = useState();
|
||||
const user = state.getUser();
|
||||
const filterDate = ref(useFilterParams('StockBoughts').params);
|
||||
const footer = ref({ bought: 0, reserve: 0 });
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -46,7 +45,7 @@ const columns = computed(() => [
|
|||
optionValue: 'id',
|
||||
},
|
||||
columnFilter: false,
|
||||
width: '50px',
|
||||
width: '60%',
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -56,20 +55,20 @@ const columns = computed(() => [
|
|||
create: true,
|
||||
component: 'number',
|
||||
summation: true,
|
||||
width: '50px',
|
||||
format: ({ reserve }, dashIfEmpty) => dashIfEmpty(round(reserve)),
|
||||
width: '20%',
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
align: 'right',
|
||||
label: t('entryStockBought.bought'),
|
||||
name: 'bought',
|
||||
summation: true,
|
||||
cardVisible: true,
|
||||
style: ({ reserve, bought }) => boughtStyle(bought, reserve),
|
||||
columnFilter: false,
|
||||
width: '20%',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entryStockBought.date'),
|
||||
name: 'dated',
|
||||
component: 'date',
|
||||
|
@ -77,7 +76,7 @@ const columns = computed(() => [
|
|||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
|
@ -90,7 +89,7 @@ const columns = computed(() => [
|
|||
component: EntryStockBoughtDetail,
|
||||
componentProps: {
|
||||
workerFk: row.workerFk,
|
||||
dated: userParams.value.dated,
|
||||
dated: filterDate.value.dated,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
@ -98,39 +97,29 @@ const columns = computed(() => [
|
|||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const fetchDataRef = ref();
|
||||
const travelDialogRef = ref(false);
|
||||
const tableRef = ref();
|
||||
const travel = ref(null);
|
||||
const userParams = ref({
|
||||
dated: Date.vnNew().toJSON(),
|
||||
});
|
||||
|
||||
const filter = ref({
|
||||
fields: ['id', 'm3', 'warehouseInFk'],
|
||||
const filter = computed(() => ({
|
||||
fields: ['id', 'm3', 'ref', 'warehouseInFk'],
|
||||
include: [
|
||||
{
|
||||
relation: 'warehouseIn',
|
||||
scope: {
|
||||
fields: ['code'],
|
||||
fields: ['code', 'name'],
|
||||
},
|
||||
},
|
||||
],
|
||||
where: {
|
||||
shipped: (userParams.value.dated
|
||||
? new Date(userParams.value.dated)
|
||||
: Date.vnNew()
|
||||
).setHours(0, 0, 0, 0),
|
||||
shipped: date.adjustDate(filterDate.value.dated, {
|
||||
hour: 0,
|
||||
minute: 0,
|
||||
second: 0,
|
||||
}),
|
||||
m3: { neq: null },
|
||||
},
|
||||
});
|
||||
|
||||
const setUserParams = async ({ dated }) => {
|
||||
const shipped = (dated ? new Date(dated) : Date.vnNew()).setHours(0, 0, 0, 0);
|
||||
filter.value.where.shipped = shipped;
|
||||
fetchDataRef.value?.fetch();
|
||||
};
|
||||
}));
|
||||
|
||||
function openDialog() {
|
||||
travelDialogRef.value = true;
|
||||
|
@ -151,6 +140,31 @@ function round(value) {
|
|||
function boughtStyle(bought, reserve) {
|
||||
return reserve < bought ? { color: 'var(--q-negative)' } : '';
|
||||
}
|
||||
|
||||
async function beforeSave(data, getChanges) {
|
||||
const changes = data.creates;
|
||||
if (!changes) return data;
|
||||
const patchPromises = [];
|
||||
|
||||
for (const change of changes) {
|
||||
if (change?.isReal === false && change?.reserve > 0) {
|
||||
const postData = {
|
||||
workerFk: change.workerFk,
|
||||
reserve: change.reserve,
|
||||
dated: filterDate.value.dated,
|
||||
};
|
||||
const promise = axios.post('StockBoughts', postData).catch((error) => {
|
||||
console.error('Error processing change: ', change, error);
|
||||
});
|
||||
|
||||
patchPromises.push(promise);
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(patchPromises);
|
||||
const filteredChanges = changes.filter((change) => change?.isReal !== false);
|
||||
data.creates = filteredChanges;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<VnSubToolbar>
|
||||
|
@ -158,18 +172,17 @@ function boughtStyle(bought, reserve) {
|
|||
<FetchData
|
||||
ref="fetchDataRef"
|
||||
url="Travels"
|
||||
auto-load
|
||||
:filter="filter"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
travel = data.find(
|
||||
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh',
|
||||
(data) => data.warehouseIn?.code?.toLowerCase() === 'vnh',
|
||||
);
|
||||
}
|
||||
"
|
||||
/>
|
||||
<VnRow class="travel">
|
||||
<div v-if="travel">
|
||||
<div v-show="travel">
|
||||
<span style="color: var(--vn-label-color)">
|
||||
{{ t('entryStockBought.purchaseSpaces') }}:
|
||||
</span>
|
||||
|
@ -180,7 +193,7 @@ function boughtStyle(bought, reserve) {
|
|||
v-if="travel?.m3"
|
||||
style="max-width: 20%"
|
||||
flat
|
||||
icon="edit"
|
||||
icon="search"
|
||||
@click="openDialog()"
|
||||
:title="t('entryStockBought.editTravel')"
|
||||
color="primary"
|
||||
|
@ -195,57 +208,42 @@ function boughtStyle(bought, reserve) {
|
|||
:url-update="`Travels/${travel?.id}`"
|
||||
model="travel"
|
||||
:title="t('Travel m3')"
|
||||
:form-initial-data="{ id: travel?.id, m3: travel?.m3 }"
|
||||
:form-initial-data="travel"
|
||||
@on-data-saved="fetchDataRef.fetch()"
|
||||
>
|
||||
<template #form-inputs="{ data }">
|
||||
<VnInput
|
||||
v-model="data.id"
|
||||
:label="t('id')"
|
||||
type="number"
|
||||
disable
|
||||
readonly
|
||||
/>
|
||||
<span class="link">
|
||||
{{ data.ref }}
|
||||
<TravelDescriptorProxy :id="data.id" />
|
||||
</span>
|
||||
<VnInput v-model="data.m3" :label="t('m3')" type="number" />
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
</QDialog>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<EntryStockBoughtFilter
|
||||
data-key="StockBoughts"
|
||||
@set-user-params="setUserParams"
|
||||
/>
|
||||
</template>
|
||||
</RightMenu>
|
||||
<div class="table-container">
|
||||
<div class="column items-center">
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="StockBoughts"
|
||||
url="StockBoughts/getStockBought"
|
||||
:beforeSaveFn="beforeSave"
|
||||
save-url="StockBoughts/crud"
|
||||
search-url="StockBoughts"
|
||||
order="reserve DESC"
|
||||
:right-search="false"
|
||||
order="bought DESC"
|
||||
:is-editable="true"
|
||||
@on-fetch="(data) => setFooter(data)"
|
||||
:create="{
|
||||
urlCreate: 'StockBoughts',
|
||||
title: t('entryStockBought.reserveSomeSpace'),
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: {
|
||||
workerFk: user.id,
|
||||
dated: Date.vnNow(),
|
||||
},
|
||||
}"
|
||||
@on-fetch="
|
||||
async (data) => {
|
||||
setFooter(data);
|
||||
await fetchDataRef.fetch();
|
||||
}
|
||||
"
|
||||
:columns="columns"
|
||||
:user-params="userParams"
|
||||
:footer="true"
|
||||
table-height="80vh"
|
||||
auto-load
|
||||
:column-search="false"
|
||||
:without-header="true"
|
||||
:user-params="{ dated: Date.vnNew() }"
|
||||
auto-load
|
||||
>
|
||||
<template #column-workerFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
|
@ -278,9 +276,6 @@ function boughtStyle(bought, reserve) {
|
|||
.column {
|
||||
min-width: 35%;
|
||||
margin-top: 5%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.text-negative {
|
||||
color: $negative !important;
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onMounted } from 'vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
dataKey: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const stateStore = useStateStore();
|
||||
const emit = defineEmits(['set-user-params']);
|
||||
const setUserParams = (params) => {
|
||||
emit('set-user-params', params);
|
||||
};
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
search-url="StockBoughts"
|
||||
@set-user-params="setUserParams"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
id="date"
|
||||
v-model="params.dated"
|
||||
@update:model-value="
|
||||
(value) => {
|
||||
params.dated = value;
|
||||
setUserParams(params);
|
||||
searchFn();
|
||||
}
|
||||
"
|
||||
:label="t('Date')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
<i18n>
|
||||
en:
|
||||
params:
|
||||
dated: Date
|
||||
workerFk: Worker
|
||||
es:
|
||||
Date: Fecha
|
||||
params:
|
||||
dated: Fecha
|
||||
workerFk: Trabajador
|
||||
</i18n>
|
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import { toDate } from 'src/filters/index';
|
||||
import { useQuasar } from 'quasar';
|
||||
import EntryBuysTableDialog from './EntryBuysTableDialog.vue';
|
||||
import EntrySupplierlDetail from './EntrySupplierlDetail.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -18,18 +18,28 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('myEntries.id'),
|
||||
label: t('entrySupplier.id'),
|
||||
columnFilter: false,
|
||||
isId: true,
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'supplierName',
|
||||
label: t('entrySupplier.supplierName'),
|
||||
cardVisible: true,
|
||||
isTitle: true,
|
||||
},
|
||||
{
|
||||
visible: false,
|
||||
align: 'right',
|
||||
label: t('myEntries.shipped'),
|
||||
label: t('entrySupplier.shipped'),
|
||||
name: 'shipped',
|
||||
columnFilter: {
|
||||
name: 'fromShipped',
|
||||
label: t('myEntries.fromShipped'),
|
||||
label: t('entrySupplier.fromShipped'),
|
||||
component: 'date',
|
||||
},
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
|
@ -37,26 +47,26 @@ const columns = computed(() => [
|
|||
{
|
||||
visible: false,
|
||||
align: 'left',
|
||||
label: t('myEntries.shipped'),
|
||||
label: t('entrySupplier.shipped'),
|
||||
name: 'shipped',
|
||||
columnFilter: {
|
||||
name: 'toShipped',
|
||||
label: t('myEntries.toShipped'),
|
||||
label: t('entrySupplier.toShipped'),
|
||||
component: 'date',
|
||||
},
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: t('myEntries.shipped'),
|
||||
align: 'left',
|
||||
label: t('entrySupplier.shipped'),
|
||||
name: 'shipped',
|
||||
columnFilter: false,
|
||||
format: ({ shipped }) => toDate(shipped),
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: t('myEntries.landed'),
|
||||
align: 'left',
|
||||
label: t('entrySupplier.landed'),
|
||||
name: 'landed',
|
||||
columnFilter: false,
|
||||
format: ({ landed }) => toDate(landed),
|
||||
|
@ -64,15 +74,13 @@ const columns = computed(() => [
|
|||
|
||||
{
|
||||
align: 'right',
|
||||
label: t('myEntries.wareHouseIn'),
|
||||
label: t('entrySupplier.wareHouseIn'),
|
||||
name: 'warehouseInFk',
|
||||
format: (row) => {
|
||||
row.warehouseInName;
|
||||
},
|
||||
format: ({ warehouseInName }) => warehouseInName,
|
||||
cardVisible: true,
|
||||
columnFilter: {
|
||||
name: 'warehouseInFk',
|
||||
label: t('myEntries.warehouseInFk'),
|
||||
label: t('entrySupplier.warehouseInFk'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'warehouses',
|
||||
|
@ -86,13 +94,13 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('myEntries.daysOnward'),
|
||||
label: t('entrySupplier.daysOnward'),
|
||||
name: 'daysOnward',
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('myEntries.daysAgo'),
|
||||
label: t('entrySupplier.daysAgo'),
|
||||
name: 'daysAgo',
|
||||
visible: false,
|
||||
},
|
||||
|
@ -101,8 +109,8 @@ const columns = computed(() => [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('myEntries.printLabels'),
|
||||
icon: 'move_item',
|
||||
title: t('entrySupplier.printLabels'),
|
||||
icon: 'search',
|
||||
isPrimary: true,
|
||||
action: (row) => printBuys(row.id),
|
||||
},
|
||||
|
@ -112,7 +120,7 @@ const columns = computed(() => [
|
|||
|
||||
const printBuys = (rowId) => {
|
||||
quasar.dialog({
|
||||
component: EntryBuysTableDialog,
|
||||
component: EntrySupplierlDetail,
|
||||
componentProps: {
|
||||
id: rowId,
|
||||
},
|
||||
|
@ -121,19 +129,18 @@ const printBuys = (rowId) => {
|
|||
</script>
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="myEntriesList"
|
||||
data-key="entrySupplierList"
|
||||
url="Entries/filter"
|
||||
:label="t('myEntries.search')"
|
||||
:info="t('myEntries.searchInfo')"
|
||||
:label="t('entrySupplier.search')"
|
||||
:info="t('entrySupplier.searchInfo')"
|
||||
/>
|
||||
<VnTable
|
||||
data-key="myEntriesList"
|
||||
data-key="entrySupplierList"
|
||||
url="Entries/filter"
|
||||
:columns="columns"
|
||||
:user-params="params"
|
||||
default-mode="card"
|
||||
order="shipped DESC"
|
||||
auto-load
|
||||
chip-locale="myEntries"
|
||||
/>
|
||||
</template>
|
|
@ -30,7 +30,7 @@ const entriesTableColumns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'itemFk',
|
||||
field: 'itemFk',
|
||||
label: t('entry.latestBuys.tableVisibleColumns.itemFk'),
|
||||
label: t('entrySupplier.itemId'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -65,7 +65,15 @@ const entriesTableColumns = computed(() => [
|
|||
]);
|
||||
|
||||
function downloadCSV(rows) {
|
||||
const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'grouping', 'comment'];
|
||||
const headers = [
|
||||
'id',
|
||||
'itemFk',
|
||||
'name',
|
||||
'stickers',
|
||||
'packing',
|
||||
'grouping',
|
||||
'comment',
|
||||
];
|
||||
|
||||
const csvRows = rows.map((row) => {
|
||||
const buy = row;
|
||||
|
@ -119,17 +127,18 @@ function downloadCSV(rows) {
|
|||
>
|
||||
<template #top-left>
|
||||
<QBtn
|
||||
:label="t('myEntries.downloadCsv')"
|
||||
:label="t('entrySupplier.downloadCsv')"
|
||||
color="primary"
|
||||
icon="csv"
|
||||
@click="downloadCSV(rows)"
|
||||
unelevated
|
||||
data-cy="downloadCsvBtn"
|
||||
/>
|
||||
</template>
|
||||
<template #top-right>
|
||||
<QBtn
|
||||
class="q-mr-lg"
|
||||
:label="t('myEntries.printLabels')"
|
||||
:label="t('entrySupplier.printLabels')"
|
||||
color="primary"
|
||||
icon="print"
|
||||
@click="
|
||||
|
@ -148,13 +157,18 @@ function downloadCSV(rows) {
|
|||
v-if="props.row.stickers > 0"
|
||||
@click="
|
||||
openReport(
|
||||
`Entries/${props.row.id}/buy-label-supplier`
|
||||
`Entries/${props.row.id}/buy-label-supplier`,
|
||||
{},
|
||||
true,
|
||||
)
|
||||
"
|
||||
unelevated
|
||||
color="primary"
|
||||
flat
|
||||
data-cy="seeLabelBtn"
|
||||
>
|
||||
<QTooltip>{{
|
||||
t('myEntries.viewLabel')
|
||||
t('entrySupplier.viewLabel')
|
||||
}}</QTooltip>
|
||||
</QBtn>
|
||||
</QTr>
|
|
@ -38,7 +38,7 @@ const recalc = async () => {
|
|||
|
||||
<template>
|
||||
<div class="q-pa-lg row justify-center">
|
||||
<QCard class="bg-light" style="width: 300px">
|
||||
<QCard class="bg-light" style="width: 300px" data-cy="wasteRecalc">
|
||||
<QCardSection>
|
||||
<VnInputDate
|
||||
class="q-mb-lg"
|
||||
|
@ -46,6 +46,7 @@ const recalc = async () => {
|
|||
:label="$t('globals.from')"
|
||||
rounded
|
||||
dense
|
||||
data-cy="dateFrom"
|
||||
/>
|
||||
<VnInputDate
|
||||
class="q-mb-lg"
|
||||
|
@ -55,6 +56,7 @@ const recalc = async () => {
|
|||
:disable="!dateFrom"
|
||||
rounded
|
||||
dense
|
||||
data-cy="dateTo"
|
||||
/>
|
||||
<QBtn
|
||||
color="primary"
|
||||
|
@ -63,6 +65,7 @@ const recalc = async () => {
|
|||
:loading="isLoading"
|
||||
:disable="isLoading || !(dateFrom && dateTo)"
|
||||
@click="recalc()"
|
||||
data-cy="recalc"
|
||||
/>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
|
|
|
@ -6,7 +6,7 @@ entry:
|
|||
list:
|
||||
newEntry: New entry
|
||||
tableVisibleColumns:
|
||||
isExcludedFromAvailable: Exclude from inventory
|
||||
isExcludedFromAvailable: Excluded from available
|
||||
isOrdered: Ordered
|
||||
isConfirmed: Ready to label
|
||||
isReceived: Received
|
||||
|
@ -33,7 +33,7 @@ entry:
|
|||
invoiceAmount: Invoice amount
|
||||
ordered: Ordered
|
||||
booked: Booked
|
||||
excludedFromAvailable: Inventory
|
||||
excludedFromAvailable: Excluded
|
||||
travelReference: Reference
|
||||
travelAgency: Agency
|
||||
travelShipped: Shipped
|
||||
|
@ -55,7 +55,7 @@ entry:
|
|||
commission: Commission
|
||||
observation: Observation
|
||||
booked: Booked
|
||||
excludedFromAvailable: Inventory
|
||||
excludedFromAvailable: Excluded
|
||||
initialTemperature: Ini °C
|
||||
finalTemperature: Fin °C
|
||||
buys:
|
||||
|
@ -65,27 +65,10 @@ entry:
|
|||
printedStickers: Printed stickers
|
||||
notes:
|
||||
observationType: Observation type
|
||||
latestBuys:
|
||||
tableVisibleColumns:
|
||||
image: Picture
|
||||
itemFk: Item ID
|
||||
weightByPiece: Weight/Piece
|
||||
isActive: Active
|
||||
family: Family
|
||||
entryFk: Entry
|
||||
freightValue: Freight value
|
||||
comissionValue: Commission value
|
||||
packageValue: Package value
|
||||
isIgnored: Is ignored
|
||||
price2: Grouping
|
||||
price3: Packing
|
||||
minPrice: Min
|
||||
ektFk: Ekt
|
||||
packingOut: Package out
|
||||
landing: Landing
|
||||
isExcludedFromAvailable: Es inventory
|
||||
params:
|
||||
isExcludedFromAvailable: Exclude from inventory
|
||||
entryFk: Entry
|
||||
observationTypeFk: Observation type
|
||||
isExcludedFromAvailable: Excluded from available
|
||||
isOrdered: Ordered
|
||||
isConfirmed: Ready to label
|
||||
isReceived: Received
|
||||
|
@ -127,13 +110,17 @@ entry:
|
|||
company_name: Company name
|
||||
itemTypeFk: Item type
|
||||
workerFk: Worker id
|
||||
daysAgo: Days ago
|
||||
toShipped: T. shipped
|
||||
fromShipped: F. shipped
|
||||
supplierName: Supplier
|
||||
search: Search entries
|
||||
searchInfo: You can search by entry reference
|
||||
descriptorMenu:
|
||||
showEntryReport: Show entry report
|
||||
entryFilter:
|
||||
params:
|
||||
isExcludedFromAvailable: Exclude from inventory
|
||||
isExcludedFromAvailable: Excluded from available
|
||||
invoiceNumber: Invoice number
|
||||
travelFk: Travel
|
||||
companyFk: Company
|
||||
|
@ -155,7 +142,7 @@ entryFilter:
|
|||
warehouseOutFk: Origin
|
||||
warehouseInFk: Destiny
|
||||
entryTypeCode: Entry type
|
||||
myEntries:
|
||||
entrySupplier:
|
||||
id: ID
|
||||
landed: Landed
|
||||
shipped: Shipped
|
||||
|
@ -170,6 +157,8 @@ myEntries:
|
|||
downloadCsv: Download CSV
|
||||
search: Search entries
|
||||
searchInfo: You can search by entry reference
|
||||
supplierName: Supplier
|
||||
itemId: Item id
|
||||
entryStockBought:
|
||||
travel: Travel
|
||||
editTravel: Edit travel
|
||||
|
|
|
@ -6,7 +6,7 @@ entry:
|
|||
list:
|
||||
newEntry: Nueva entrada
|
||||
tableVisibleColumns:
|
||||
isExcludedFromAvailable: Excluir del inventario
|
||||
isExcludedFromAvailable: Excluir del disponible
|
||||
isOrdered: Pedida
|
||||
isConfirmed: Lista para etiquetar
|
||||
isReceived: Recibida
|
||||
|
@ -33,7 +33,7 @@ entry:
|
|||
invoiceAmount: Importe
|
||||
ordered: Pedida
|
||||
booked: Contabilizada
|
||||
excludedFromAvailable: Inventario
|
||||
excludedFromAvailable: Excluido
|
||||
travelReference: Referencia
|
||||
travelAgency: Agencia
|
||||
travelShipped: F. envio
|
||||
|
@ -56,7 +56,7 @@ entry:
|
|||
observation: Observación
|
||||
commission: Comisión
|
||||
booked: Contabilizada
|
||||
excludedFromAvailable: Inventario
|
||||
excludedFromAvailable: Excluido
|
||||
initialTemperature: Ini °C
|
||||
finalTemperature: Fin °C
|
||||
buys:
|
||||
|
@ -66,30 +66,12 @@ entry:
|
|||
printedStickers: Etiquetas impresas
|
||||
notes:
|
||||
observationType: Tipo de observación
|
||||
latestBuys:
|
||||
tableVisibleColumns:
|
||||
image: Foto
|
||||
itemFk: Id Artículo
|
||||
weightByPiece: Peso (gramos)/tallo
|
||||
isActive: Activo
|
||||
family: Familia
|
||||
entryFk: Entrada
|
||||
freightValue: Porte
|
||||
comissionValue: Comisión
|
||||
packageValue: Embalaje
|
||||
isIgnored: Ignorado
|
||||
price2: Grouping
|
||||
price3: Packing
|
||||
minPrice: Min
|
||||
ektFk: Ekt
|
||||
packingOut: Embalaje envíos
|
||||
landing: Llegada
|
||||
isExcludedFromAvailable: Es inventario
|
||||
|
||||
search: Buscar entradas
|
||||
searchInfo: Puedes buscar por referencia de entrada
|
||||
params:
|
||||
isExcludedFromAvailable: Excluir del inventario
|
||||
entryFk: Entrada
|
||||
observationTypeFk: Tipo de observación
|
||||
isExcludedFromAvailable: Excluir del disponible
|
||||
isOrdered: Pedida
|
||||
isConfirmed: Lista para etiquetar
|
||||
isReceived: Recibida
|
||||
|
@ -131,9 +113,13 @@ entry:
|
|||
company_name: Nombre empresa
|
||||
itemTypeFk: Familia
|
||||
workerFk: Comprador
|
||||
daysAgo: Días atras
|
||||
toShipped: F. salida(hasta)
|
||||
fromShipped: F. salida(desde)
|
||||
supplierName: Proveedor
|
||||
entryFilter:
|
||||
params:
|
||||
isExcludedFromAvailable: Inventario
|
||||
isExcludedFromAvailable: Excluido
|
||||
isOrdered: Pedida
|
||||
isConfirmed: Confirmado
|
||||
isReceived: Recibida
|
||||
|
@ -149,7 +135,7 @@ entryFilter:
|
|||
warehouseInFk: Destino
|
||||
entryTypeCode: Tipo de entrada
|
||||
hasToShowDeletedEntries: Mostrar entradas eliminadas
|
||||
myEntries:
|
||||
entrySupplier:
|
||||
id: ID
|
||||
landed: F. llegada
|
||||
shipped: F. salida
|
||||
|
@ -164,10 +150,12 @@ myEntries:
|
|||
downloadCsv: Descargar CSV
|
||||
search: Buscar entradas
|
||||
searchInfo: Puedes buscar por referencia de la entrada
|
||||
supplierName: Proveedor
|
||||
itemId: Id artículo
|
||||
entryStockBought:
|
||||
travel: Envío
|
||||
editTravel: Editar envío
|
||||
purchaseSpaces: Espacios de compra
|
||||
purchaseSpaces: Camiones reservados
|
||||
buyer: Comprador
|
||||
reserve: Reservado
|
||||
bought: Comprado
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
|
||||
import { onBeforeRouteUpdate } from 'vue-router';
|
||||
import { setRectificative } from '../composables/setRectificative';
|
||||
|
@ -9,7 +9,7 @@ onBeforeRouteUpdate(async (to) => await setRectificative(to));
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="InvoiceIn"
|
||||
url="InvoiceIns"
|
||||
:descriptor="InvoiceInDescriptor"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup>
|
||||
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import filter from './InvoiceOutFilter.js';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="InvoiceOut"
|
||||
url="InvoiceOuts"
|
||||
:filter="filter"
|
||||
|
|
|
@ -75,6 +75,7 @@ function ticketFilter(invoice) {
|
|||
icon="vn:client"
|
||||
color="primary"
|
||||
:to="{ name: 'CustomerCard', params: { id: entity.client.id } }"
|
||||
data-cy="invoiceOutDescriptorCustomerCard"
|
||||
>
|
||||
<QTooltip>{{ t('invoiceOut.card.customerCard') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -86,6 +87,7 @@ function ticketFilter(invoice) {
|
|||
name: 'TicketList',
|
||||
query: { table: ticketFilter(entity) },
|
||||
}"
|
||||
data-cy="invoiceOutDescriptorTicketList"
|
||||
>
|
||||
<QTooltip>{{ t('invoiceOut.card.ticketList') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
|
|
@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -30,7 +31,7 @@ const states = ref();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Customer ID')"
|
||||
:label="t('globals.params.clientFk')"
|
||||
v-model="params.clientFk"
|
||||
is-outlined
|
||||
/>
|
||||
|
@ -38,13 +39,17 @@ const states = ref();
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput v-model="params.fi" :label="t('FI')" is-outlined />
|
||||
<VnInput
|
||||
v-model="params.fi"
|
||||
:label="t('globals.params.fi')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputNumber
|
||||
:label="t('Amount')"
|
||||
:label="t('globals.amount')"
|
||||
v-model="params.amount"
|
||||
is-outlined
|
||||
data-cy="InvoiceOutFilterAmountBtn"
|
||||
|
@ -54,7 +59,7 @@ const states = ref();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Min')"
|
||||
:label="t('invoiceOut.params.min')"
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
|
@ -65,7 +70,7 @@ const states = ref();
|
|||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Max')"
|
||||
:label="t('invoiceOut.params.max')"
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
|
@ -78,7 +83,7 @@ const states = ref();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('Has PDF')"
|
||||
:label="t('invoiceOut.params.hasPdf')"
|
||||
toggle-indeterminate
|
||||
v-model="params.hasPdf"
|
||||
/>
|
||||
|
@ -88,14 +93,31 @@ const states = ref();
|
|||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.created"
|
||||
:label="t('Created')"
|
||||
:label="t('invoiceOut.params.created')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate v-model="params.dued" :label="t('Dued')" is-outlined />
|
||||
<VnInputDate
|
||||
v-model="params.dued"
|
||||
:label="t('invoiceOut.params.dued')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
outlined
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
|
@ -8,7 +8,7 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|||
import { usePrintService } from 'src/composables/usePrintService';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
||||
import { toCurrency, toDate } from 'src/filters/index';
|
||||
import { toCurrency, toDate, dashIfEmpty } from 'src/filters/index';
|
||||
import { QBtn } from 'quasar';
|
||||
import axios from 'axios';
|
||||
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
||||
|
@ -16,6 +16,7 @@ import VnRow from 'src/components/ui/VnRow.vue';
|
|||
import VnRadio from 'src/components/common/VnRadio.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -94,6 +95,20 @@ const columns = computed(() => [
|
|||
component: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'companyFk',
|
||||
|
@ -193,7 +208,7 @@ watchEffect(selectedRows);
|
|||
prefix="invoiceOut"
|
||||
:array-data-props="{
|
||||
url: 'InvoiceOuts/filter',
|
||||
order: ['id DESC'],
|
||||
order: 'id DESC',
|
||||
}"
|
||||
>
|
||||
<template #advanced-menu>
|
||||
|
@ -237,8 +252,14 @@ watchEffect(selectedRows);
|
|||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ dashIfEmpty(row.departmentName) }}
|
||||
<DepartmentDescriptorProxy :id="row?.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<div class="row q-col-gutter-xs">
|
||||
<div class="row q-col-gutter-xs col-span-2">
|
||||
<div class="col-12">
|
||||
<div class="q-col-gutter-xs">
|
||||
<VnRow fixed>
|
||||
|
@ -404,7 +425,6 @@ watchEffect(selectedRows);
|
|||
:label="
|
||||
t('invoiceOutList.tableVisibleColumns.taxArea')
|
||||
"
|
||||
:options="taxAreasOptions"
|
||||
option-label="code"
|
||||
option-value="code"
|
||||
/>
|
||||
|
|
|
@ -8,7 +8,7 @@ import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js';
|
|||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import InvoiceOutNegativeBasesFilter from './InvoiceOutNegativeBasesFilter.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
|
@ -115,18 +115,16 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
|
||||
name: 'workerName',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
where: { role: 'salesPerson' },
|
||||
url: 'Departments',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.workerName),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -198,10 +196,10 @@ const downloadCSV = async () => {
|
|||
<TicketDescriptorProxy :id="row.ticketFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-workerName="{ row }">
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.workerName }}
|
||||
<WorkerDescriptorProxy :id="row.comercialId" />
|
||||
{{ row.departmentName }}
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #moreFilterPanel="{ params }">
|
||||
|
|
|
@ -20,7 +20,7 @@ const props = defineProps({
|
|||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:un-removable-params="['from', 'to']"
|
||||
:unremovable-params="['from', 'to']"
|
||||
:hidden-tags="['from', 'to']"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
|
@ -129,12 +129,15 @@ const props = defineProps({
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelectWorker
|
||||
:label="t('invoiceOut.negativeBases.comercial')"
|
||||
v-model="params.workerName"
|
||||
option-value="name"
|
||||
is-outlined
|
||||
@update:model-value="searchFn()"
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -13,7 +13,6 @@ invoiceOut:
|
|||
isActive: Active
|
||||
hasToInvoice: Has to invoice
|
||||
hasVerifiedData: Verified data
|
||||
workerName: Worker
|
||||
isTaxDataChecked: Verified data
|
||||
amount: Amount
|
||||
clientFk: Client
|
||||
|
@ -27,6 +26,7 @@ invoiceOut:
|
|||
max: Max
|
||||
hasPdf: Has PDF
|
||||
search: Contains
|
||||
departmentFk: Department
|
||||
card:
|
||||
issued: Issued
|
||||
customerCard: Customer card
|
||||
|
|
|
@ -13,7 +13,6 @@ invoiceOut:
|
|||
isActive: Activo
|
||||
hasToInvoice: Debe facturar
|
||||
hasVerifiedData: Datos verificados
|
||||
workerName: Comercial
|
||||
isTaxDataChecked: Datos comprobados
|
||||
amount: Importe
|
||||
clientFk: Cliente
|
||||
|
@ -27,6 +26,7 @@ invoiceOut:
|
|||
max: Max
|
||||
hasPdf: Tiene PDF
|
||||
search: Contiene
|
||||
departmentFk: Departamento
|
||||
card:
|
||||
issued: Fecha emisión
|
||||
customerCard: Ficha del cliente
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import ItemDescriptor from './ItemDescriptor.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Item"
|
||||
:url="`Items/${$route.params.id}/getCard`"
|
||||
:descriptor="ItemDescriptor"
|
||||
|
|
|
@ -3,6 +3,7 @@ import { ref, computed, onMounted } from 'vue';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { toCurrency } from 'filters/index';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
|
@ -61,6 +62,7 @@ const columns = computed(() => [
|
|||
columnClass: 'expand',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('item.buyRequest.requester'),
|
||||
name: 'requesterName',
|
||||
component: 'select',
|
||||
|
@ -77,6 +79,19 @@ const columns = computed(() => [
|
|||
},
|
||||
columnClass: 'shrink',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
label: t('item.buyRequest.requested'),
|
||||
name: 'quantity',
|
||||
|
@ -107,6 +122,7 @@ const columns = computed(() => [
|
|||
},
|
||||
columnClass: 'shrink',
|
||||
},
|
||||
|
||||
{
|
||||
label: t('globals.item'),
|
||||
name: 'item',
|
||||
|
@ -262,6 +278,12 @@ const onDenyAccept = (_, responseData) => {
|
|||
<WorkerDescriptorProxy :id="row.requesterFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.departmentName }}
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #column-item="{ row }">
|
||||
<span>
|
||||
|
|
|
@ -221,7 +221,7 @@ en:
|
|||
attenderFk: Atender
|
||||
clientFk: Client id
|
||||
warehouseFk: Warehouse
|
||||
requesterFk: Salesperson
|
||||
requesterFk: Requester
|
||||
from: From
|
||||
to: To
|
||||
mine: For me
|
||||
|
@ -239,7 +239,7 @@ es:
|
|||
attenderFk: Comprador
|
||||
clientFk: Id cliente
|
||||
warehouseFk: Almacén
|
||||
requesterFk: Comercial
|
||||
requesterFk: Solicitante
|
||||
from: Desde
|
||||
to: Hasta
|
||||
mine: Para mi
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import ItemTypeDescriptor from 'src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue';
|
||||
import filter from './ItemTypeFilter.js';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="ItemType"
|
||||
url="ItemTypes"
|
||||
:filter="filter"
|
||||
|
|
|
@ -7,6 +7,7 @@ import filter from './ItemTypeFilter.js';
|
|||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
|
||||
onUpdated(() => summaryRef.value.fetch());
|
||||
|
||||
|
@ -62,13 +63,10 @@ async function setItemTypeData(data) {
|
|||
</template>
|
||||
<template #body>
|
||||
<QCard class="vn-one">
|
||||
<router-link
|
||||
:to="{ name: 'ItemTypeBasicData', params: { id: entityId } }"
|
||||
class="header header-link"
|
||||
>
|
||||
{{ t('globals.summary.basicData') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</router-link>
|
||||
<VnTitle
|
||||
:url="`#/item/item-type/${entityId}/basic-data`"
|
||||
:text="$t('globals.summary.basicData')"
|
||||
/>
|
||||
<VnLv :label="t('itemType.summary.id')" :value="itemType.id" />
|
||||
<VnLv :label="t('itemType.shared.code')" :value="itemType.code" />
|
||||
<VnLv :label="t('itemType.shared.name')" :value="itemType.name" />
|
||||
|
|
|
@ -84,7 +84,7 @@ item:
|
|||
attenderFk: Atender
|
||||
clientFk: Client id
|
||||
warehouseFk: Warehouse
|
||||
requesterFk: Salesperson
|
||||
requesterFk: Requester
|
||||
from: From
|
||||
to: To
|
||||
mine: For me
|
||||
|
|
|
@ -93,7 +93,7 @@ item:
|
|||
attenderFk: Comprador
|
||||
clientFk: Id cliente
|
||||
warehouseFk: Almacén
|
||||
requesterFk: Comercial
|
||||
requesterFk: Solicitante
|
||||
from: Desde
|
||||
to: Hasta
|
||||
mine: Para mi
|
||||
|
|
|
@ -31,7 +31,7 @@ function exprBuilder(param, value) {
|
|||
switch (param) {
|
||||
case 'clientFk':
|
||||
return { [`c.id`]: value };
|
||||
case 'salesPersonFk':
|
||||
case 'departmentFk':
|
||||
return { [`c.${param}`]: value };
|
||||
}
|
||||
}
|
||||
|
@ -62,25 +62,17 @@ const columns = computed(() => [
|
|||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('salesClientsTable.salesPerson'),
|
||||
name: 'salesPersonFk',
|
||||
field: 'salesPerson',
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
optionFilter: 'firstName',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
sortBy: 'nickname ASC',
|
||||
where: { role: 'salesPerson' },
|
||||
useLike: false,
|
||||
},
|
||||
},
|
||||
columnClass: 'no-padding',
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
label: t('salesClientsTable.client'),
|
||||
|
@ -128,9 +120,9 @@ const columns = computed(() => [
|
|||
<VnInputDate v-model="to" :label="$t('globals.to')" dense />
|
||||
</VnRow>
|
||||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<span class="link" :title="row.salesPerson" v-text="row.salesPerson" />
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" :title="row.department" v-text="row.department" />
|
||||
<WorkerDescriptorProxy :id="row.departmentFk" dense />
|
||||
</template>
|
||||
<template #column-clientFk="{ row }">
|
||||
<span class="link" :title="row.clientName" v-text="row.clientName" />
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
|
||||
import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
|
||||
import { toCurrency } from 'src/filters';
|
||||
|
@ -20,8 +20,8 @@ function exprBuilder(param, value) {
|
|||
switch (param) {
|
||||
case 'clientFk':
|
||||
return { [`c.id`]: value };
|
||||
case 'salesPersonFk':
|
||||
return { [`c.salesPersonFk`]: value };
|
||||
case 'departmentFk':
|
||||
return { [`c.departmentFk`]: value };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,20 +63,18 @@ const columns = computed(() => [
|
|||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('salesClientsTable.salesPerson'),
|
||||
name: 'salesPersonFk',
|
||||
align: 'left',
|
||||
optionFilter: 'firstName',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
sortBy: 'nickname ASC',
|
||||
where: { role: 'salesPerson' },
|
||||
useLike: false,
|
||||
},
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
label: t('salesOrdersTable.import'),
|
||||
|
@ -184,11 +182,10 @@ const openTab = (id) =>
|
|||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<template #column-departmentFk="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link" v-text="row.salesPerson" />
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
||||
<span class="link" v-text="row.departmentName" />
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" dense />
|
||||
</QTd>
|
||||
</template>
|
||||
</VnTable>
|
||||
|
|
|
@ -9,7 +9,6 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import { dateRange } from 'src/filters';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
const { t, te } = useI18n();
|
||||
|
@ -113,16 +112,16 @@ const getLocale = (label) => {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelectWorker
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.salesPersonFk')"
|
||||
v-model="params.salesPersonFk"
|
||||
:params="{ departmentCodes: ['VT'] }"
|
||||
:no-one="true"
|
||||
>
|
||||
</VnSelectWorker>
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||
|
@ -49,8 +49,8 @@ function exprBuilder(param, value) {
|
|||
switch (param) {
|
||||
case 'stateFk':
|
||||
return { 'ts.stateFk': value };
|
||||
case 'salesPersonFk':
|
||||
return { 'c.salesPersonFk': !value ? null : value };
|
||||
case 'departmentFk':
|
||||
return { 'c.departmentFk': !value ? null : value };
|
||||
case 'provinceFk':
|
||||
return { 'a.provinceFk': value };
|
||||
case 'theoreticalHour':
|
||||
|
@ -108,19 +108,18 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: t('salesClientsTable.salesPerson'),
|
||||
name: 'salesPersonFk',
|
||||
field: 'userName',
|
||||
align: 'left',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/search?departmentCodes=["VT"]',
|
||||
fields: ['id', 'name', 'nickname', 'code'],
|
||||
sortBy: 'nickname ASC',
|
||||
optionLabel: 'nickname',
|
||||
},
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
label: t('salesClientsTable.date'),
|
||||
|
@ -437,10 +436,10 @@ const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
|||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</div>
|
||||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<div @click.stop :title="row.userName">
|
||||
<span class="link" v-text="dashIfEmpty(row.userName)" />
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
||||
<template #column-departmentFk="{ row }">
|
||||
<div @click.stop :title="row.departmentName">
|
||||
<span class="link" v-text="dashIfEmpty(row.departmentName)" />
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" />
|
||||
</div>
|
||||
</template>
|
||||
<template #column-shippedDate="{ row }">
|
||||
|
|
|
@ -7,7 +7,6 @@ salesClientsTable:
|
|||
to: To
|
||||
date: Date
|
||||
hour: Hour
|
||||
salesPerson: Salesperson
|
||||
client: Client
|
||||
salesOrdersTable:
|
||||
delete: Delete
|
||||
|
|
|
@ -7,7 +7,6 @@ salesClientsTable:
|
|||
to: Hasta
|
||||
date: Fecha
|
||||
hour: Hora
|
||||
salesPerson: Comercial
|
||||
client: Cliente
|
||||
salesOrdersTable:
|
||||
delete: Eliminar
|
||||
|
|
|
@ -64,17 +64,7 @@ const orderFilter = {
|
|||
{
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: [
|
||||
'salesPersonFk',
|
||||
'name',
|
||||
'isActive',
|
||||
'isFreezed',
|
||||
'isTaxDataChecked',
|
||||
],
|
||||
include: {
|
||||
relation: 'salesPersonUser',
|
||||
scope: { fields: ['id', 'name'] },
|
||||
},
|
||||
fields: ['name', 'isActive', 'isFreezed', 'isTaxDataChecked'],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -167,7 +157,7 @@ const onClientChange = async (clientId) => {
|
|||
!data.isConfirmed &&
|
||||
agencyList?.length &&
|
||||
agencyList.some(
|
||||
(agency) => agency.agencyModeFk === data.agency_id
|
||||
(agency) => agency.agencyModeFk === data.agency_id,
|
||||
)
|
||||
? data.agencyModeFk
|
||||
: null
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script setup>
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
|
||||
import filter from './OrderFilter.js';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCardBeta
|
||||
<VnCard
|
||||
data-key="Order"
|
||||
url="Orders"
|
||||
:filter="filter"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue