Compare commits
416 Commits
7984-addCu
...
dev
Author | SHA1 | Date |
---|---|---|
|
5d6784588f | |
|
6c84c4ae77 | |
|
26ac4cf7cc | |
|
b2eaf7543c | |
|
0d63c4ec2c | |
|
25fce95265 | |
|
9ae89eaf93 | |
|
af3b64b86f | |
|
5c0f519073 | |
|
f9bb8d2a93 | |
|
5ec0da63f2 | |
|
edb3c0cbce | |
|
9f3c068245 | |
|
872d89339a | |
|
72d1281bde | |
|
ccbd624389 | |
|
30d287bbf6 | |
|
f107684473 | |
|
0160897030 | |
|
42022889b2 | |
|
092a338e72 | |
|
fb912725b3 | |
|
1caa3055f3 | |
|
4a1b6136d8 | |
|
c55304e1d2 | |
|
8ae196ac3d | |
|
dfdb9685d2 | |
|
6e801e8f64 | |
|
d698275ba2 | |
|
6d1f1770dd | |
|
ce5be197ce | |
|
7ed7a38df2 | |
|
bfd62eaa54 | |
|
c2c21098bb | |
|
acbe0730bb | |
|
80cb7e9075 | |
|
25799cd1da | |
|
6f87af39e4 | |
|
ce430c6a8f | |
|
be7350cd34 | |
|
551967410f | |
|
300d0aad22 | |
|
935ac752f5 | |
|
90c07d36cd | |
|
9014c148c5 | |
|
96b4d9c51f | |
|
99a40dba14 | |
|
fdf3af0550 | |
|
1961750c86 | |
|
ff39addd67 | |
|
22bdd0ef08 | |
|
c8dafb65e4 | |
|
43c15f141c | |
|
d744b22119 | |
|
e0e15b3b3f | |
|
2b4a24a6af | |
|
0b3130b4de | |
|
0ae4a98ea2 | |
|
53f7492d68 | |
|
e4b509c94d | |
|
1c4421aaa2 | |
|
260d3dd133 | |
|
02f3cbbf02 | |
|
64cee8b915 | |
|
2813322003 | |
|
4fc1427070 | |
|
137c165b4d | |
|
a5716bea51 | |
|
abc64c3893 | |
|
861b535564 | |
|
46a0fb7a96 | |
|
68b42c4c4e | |
|
d18fbae3ef | |
|
f5f32356e9 | |
|
0127df6738 | |
|
70a1eff75f | |
|
8b73227b80 | |
|
cc8aa4def0 | |
|
f7af6d706c | |
|
8e5cfe9fd8 | |
|
1a6fc1c327 | |
|
69318a9917 | |
|
89d9d75976 | |
|
8f775869ae | |
|
c2ade217e4 | |
|
300048c1e1 | |
|
f232334367 | |
|
203426a236 | |
|
3a590d5639 | |
|
1f8c881af2 | |
|
e82d69f0ca | |
|
c729c6a241 | |
|
9cfd70f252 | |
|
6240e32c40 | |
|
7bd6c92aed | |
|
a6713e97b1 | |
|
749b157fcf | |
|
7899f7903f | |
|
a0a1b03b53 | |
|
c4badef5c1 | |
|
0c2127f63f | |
|
7521d506b5 | |
|
37e1b0a04b | |
|
8bde3e4425 | |
|
1e84695a51 | |
|
594c4e22ba | |
|
94eebce445 | |
|
ee0b2e863f | |
|
bf36bc5906 | |
|
51223e6cb4 | |
|
fa8a3d219c | |
|
58c3d47a2f | |
|
2c4ee50f46 | |
|
a6b356a489 | |
|
d21e0d6753 | |
|
25e60e549a | |
|
6dc23f4a26 | |
|
4ec7212d30 | |
|
d31ea18c0d | |
|
7bd4f088eb | |
|
da9d96277a | |
|
368e289c36 | |
|
a83fecc706 | |
|
618926430c | |
|
a5429799ec | |
|
23f04dae1a | |
|
c1f5a9ab4d | |
|
7129c236dd | |
|
11b5a63fa1 | |
|
af70429b52 | |
|
2755a0b7d9 | |
|
561f761b65 | |
|
7213e2d1fc | |
|
9d3c2323fd | |
|
422c8483b7 | |
|
18fe420021 | |
|
6e240cd0ff | |
|
78b2a9ead6 | |
|
f151bbec59 | |
|
8280efc32b | |
|
5ff5926c23 | |
|
4730485324 | |
|
74aa45d4d2 | |
|
f2c4e2c0c1 | |
|
595f975b4f | |
|
1658168ea7 | |
|
17a18e8b49 | |
|
eac4315a05 | |
|
7a8dfab682 | |
|
79873aeb1a | |
|
7c29e19939 | |
|
24b63c4da0 | |
|
b46e1b3fec | |
|
66e4c3b86e | |
|
2883779f3c | |
|
df62b71abc | |
|
e7d717f880 | |
|
d5d4f63717 | |
|
1261c053ad | |
|
12f59cbe04 | |
|
10dbd0324c | |
|
7027715c3c | |
|
b5b863bc4f | |
|
8bbd3a63ab | |
|
142c39c8f4 | |
|
e4265765f3 | |
|
5ec4a9bc5b | |
|
e3252f4079 | |
|
9d695e1335 | |
|
a8bcefd0c5 | |
|
5fbd57a177 | |
|
518cac6885 | |
|
d51afa01c9 | |
|
467586257f | |
|
5786ba5253 | |
|
345e9532e6 | |
|
b74e3229d8 | |
|
656f279301 | |
|
6106ca67d0 | |
|
6ddc1c77f8 | |
|
fc549cae97 | |
|
4ae7d9f6ab | |
|
0a9560f286 | |
|
6d0b4b7607 | |
|
1765688ee4 | |
|
4ed2e6235e | |
|
807d5f12fa | |
|
d8e3494251 | |
|
22952befa9 | |
|
32fde59fba | |
|
2d7e16764e | |
|
428a3bfb5c | |
|
cee2bb5111 | |
|
9db10b7b5a | |
|
b9d240e254 | |
|
6605c8deca | |
|
fc0d409ab6 | |
|
c89081fbb5 | |
|
afb0e912d6 | |
|
9306f88b99 | |
|
b86ba0c67b | |
|
44198ae7a7 | |
|
bf41ab168d | |
|
01e8fe9eee | |
|
934a1ea671 | |
|
b72642f517 | |
|
af64ac2973 | |
|
0a41e0a93e | |
|
291946e78c | |
|
8890006c43 | |
|
f5a1172d32 | |
|
9d49b5af2a | |
|
6b8bba77af | |
|
319c23dd98 | |
|
06a0ac931a | |
|
77b9dc0fd9 | |
|
2c134f9935 | |
|
aeab837348 | |
|
d42b6a643d | |
|
f8358fc361 | |
|
418d01b8f6 | |
|
5f20ff4df0 | |
|
ab1800d8ca | |
|
f783aa43de | |
|
4ce9254af0 | |
|
718d08ab92 | |
|
b5f2abcfac | |
|
3353c82f33 | |
|
639a7bc072 | |
|
3210034d65 | |
|
d52f60666a | |
|
16efb2cc1b | |
|
8c1aa725a1 | |
|
0a1f6959d3 | |
|
9f98e8e3cd | |
|
92621f7ccc | |
|
7853d510f1 | |
|
d528b48735 | |
|
1cf7c68a56 | |
|
4bd5c70b44 | |
|
5c229dd318 | |
|
1b0f9daac4 | |
|
120107cc7a | |
|
742a1da581 | |
|
d23bc5f67d | |
|
b63eea0766 | |
|
913049ac3d | |
|
5ae91430a9 | |
|
c64986ba23 | |
|
2b2f4bb8ab | |
|
a239f84498 | |
|
9f498c83df | |
|
baf1c56b56 | |
|
72d4172eaa | |
|
fb64c24db5 | |
|
735463acf8 | |
|
574b143626 | |
|
3d02b75365 | |
|
c3a4052edc | |
|
b37fe3a6f3 | |
|
bb6082026b | |
|
a5777211b7 | |
|
f402dd2051 | |
|
564877a73c | |
|
a4dfb549be | |
|
80eebef931 | |
|
fad667444c | |
|
27957c5775 | |
|
f2f0256034 | |
|
d6f53ad63c | |
|
dd5356f45c | |
|
a9f8bf3f9c | |
|
9ce9a1fb2c | |
|
268d723eb1 | |
|
74692a6107 | |
|
76e69ca7c2 | |
|
8accf13c04 | |
|
74a9adec5e | |
|
98541ef7dc | |
|
60aa099536 | |
|
9c99c337e3 | |
|
bd53d2014f | |
|
c5f4f8d5c7 | |
|
ccba0d038e | |
|
f22caaa678 | |
|
0f64efd20b | |
|
16521d7848 | |
|
590e764cc2 | |
|
e49ab4dfa4 | |
|
65a7ca1848 | |
|
5b81836ab2 | |
|
96dc556985 | |
|
1233f0724c | |
|
8470066124 | |
|
87a429a0fa | |
|
dfc95d94cb | |
|
664b167b2e | |
|
34ffb419ad | |
|
129eb507c6 | |
|
1004f1adc8 | |
|
7be2381299 | |
|
c6dcbcdae2 | |
|
389728f41e | |
|
f2a36310b2 | |
|
a62d7b165f | |
|
bfd0b23719 | |
|
3fdd698109 | |
|
99557f9d53 | |
|
d1d4da1183 | |
|
efd364e3b2 | |
|
9b04fc3bc8 | |
|
7b4b5c892a | |
|
02d8254c0f | |
|
fd810db535 | |
|
527c17a0e3 | |
|
f3026141a8 | |
|
bccda8fba6 | |
|
f932554af7 | |
|
d2a380e3bc | |
|
1cdf0df22a | |
|
bb20b7b7f7 | |
|
41e7bdb917 | |
|
a460b9e417 | |
|
05ff68624f | |
|
89032d4163 | |
|
96ef19401f | |
|
7c560b289a | |
|
415c6f2177 | |
|
647325bc75 | |
|
1931cb8906 | |
|
4e87c596d1 | |
|
85a9260382 | |
|
1ab89fd9f0 | |
|
fbe5fdc7a9 | |
|
4e8c08f972 | |
|
a63cc17142 | |
|
6ff5e30ade | |
|
aaa6a44f88 | |
|
15ac8c36c7 | |
|
24cd4caa96 | |
|
6271dea2c7 | |
|
ad10e62217 | |
|
271f7d70af | |
|
d43af3464a | |
|
1ddc4793cc | |
|
5506532095 | |
|
524a9e4d7c | |
|
c26f1f1707 | |
|
99861cbd42 | |
|
2ca60b6a0f | |
|
3993e37f39 | |
|
43e0134d41 | |
|
dfb5cfb513 | |
|
9a5c1240c9 | |
|
01403240c7 | |
|
8c2cc42de2 | |
|
5690fb1003 | |
|
7422d28d88 | |
|
8a6cd267f9 | |
|
bb2676952c | |
|
02fe39668d | |
|
e29f82ba8c | |
|
7326d08051 | |
|
702f295403 | |
|
0e7a8e61d3 | |
|
1bf34ff443 | |
|
d52635b764 | |
|
502ee6dc7c | |
|
a01bc279bc | |
|
723dbb0af4 | |
|
76fe92450a | |
|
ed097d7091 | |
|
fcea5b7bbe | |
|
bb2997fc65 | |
|
44532c4265 | |
|
e1c4a0bdb9 | |
|
039d4c22fb | |
|
140abcbbc4 | |
|
a8fa03a5d0 | |
|
9b0365aac4 | |
|
bcb47f6fde | |
|
6d12fc2c1a | |
|
da86116726 | |
|
7c588f4bbe | |
|
c041877f65 | |
|
c3b6f79965 | |
|
f86691cdfd | |
|
6e8f54ec1f | |
|
813e677a12 | |
|
73f3a2c98d | |
|
c284356f61 | |
|
94cc4f2950 | |
|
ef2f34c431 | |
|
e0459f2016 | |
|
277c78c8df | |
|
073dadd7a2 | |
|
4a8bc0c478 | |
|
8b9408d0fb | |
|
2ff59b2ab2 | |
|
cb408636ff | |
|
fba3a66c83 | |
|
520db66ac6 | |
|
94fa7431a1 | |
|
d296db7679 | |
|
adcbd5dca1 | |
|
afad942944 | |
|
5a75a1551e | |
|
80f6ab6caa | |
|
c537e34ceb | |
|
71a8e72f20 | |
|
6e0e5e0ada | |
|
d8408d1bf8 | |
|
3d03cf723c | |
|
5f40d0a3aa | |
|
9ca4db0f18 | |
|
48f1070740 |
|
@ -115,11 +115,14 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
sh 'rm -f junit/e2e-*.xml'
|
||||
sh 'rm -rf test/cypress/screenshots'
|
||||
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"
|
||||
|
||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
|
||||
|
@ -130,6 +133,7 @@ pipeline {
|
|||
post {
|
||||
always {
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
|
||||
archiveArtifacts artifacts: 'test/cypress/screenshots/**/*', allowEmptyArchive: true
|
||||
junit(
|
||||
testResults: 'junit/e2e-*.xml',
|
||||
allowEmptyResults: true
|
||||
|
|
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,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-front",
|
||||
"version": "25.12.0",
|
||||
"version": "25.14.0",
|
||||
"description": "Salix frontend",
|
||||
"productName": "Salix",
|
||||
"author": "Verdnatura",
|
||||
|
@ -13,7 +13,7 @@
|
|||
"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/cypressParallel.sh",
|
||||
"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",
|
||||
|
@ -56,6 +56,7 @@
|
|||
"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",
|
||||
|
|
21173
pnpm-lock.yaml
21173
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);
|
||||
|
|
|
@ -28,6 +28,17 @@ defineProps({ row: { type: Object, required: true } });
|
|||
{{ t('ticketSale.reserved') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.isDeleted"
|
||||
color="primary"
|
||||
name="vn:deletedTicket"
|
||||
size="xs"
|
||||
data-cy="ticketDeletedIcon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Ticket deleted') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasRisk"
|
||||
name="vn:risk"
|
||||
|
|
|
@ -140,7 +140,7 @@ const $props = defineProps({
|
|||
},
|
||||
dataCy: {
|
||||
type: String,
|
||||
default: 'vn-table',
|
||||
default: 'vnTable',
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
|
@ -685,7 +684,7 @@ const rowCtrlClickFunction = computed(() => {
|
|||
@update:selected="emit('update:selected', $event)"
|
||||
@selection="(details) => handleSelection(details, rows)"
|
||||
:hide-selected-banner="true"
|
||||
:data-cy="$props.dataCy ?? 'vnTable'"
|
||||
:data-cy
|
||||
>
|
||||
<template #top-left v-if="!$props.withoutHeader">
|
||||
<slot name="top-left"> </slot>
|
||||
|
@ -776,12 +775,13 @@ 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;
|
||||
white-space: nowrap;
|
||||
"
|
||||
:data-cy="`vnTableCell_${col.name}`"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
|
@ -920,12 +920,24 @@ const rowCtrlClickFunction = computed(() => {
|
|||
:row-index="index"
|
||||
>
|
||||
<VnColumn
|
||||
:column="col"
|
||||
:column="{
|
||||
...col,
|
||||
disable:
|
||||
col?.component ===
|
||||
'checkbox'
|
||||
? true
|
||||
: false,
|
||||
}"
|
||||
:row="row"
|
||||
:is-editable="false"
|
||||
v-model="row[col.name]"
|
||||
component-prop="columnField"
|
||||
:show-label="true"
|
||||
:show-label="
|
||||
col?.component ===
|
||||
'checkbox'
|
||||
? false
|
||||
: true
|
||||
"
|
||||
/>
|
||||
</slot>
|
||||
</span>
|
||||
|
@ -966,6 +978,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}`"
|
||||
|
@ -1028,38 +1042,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>
|
||||
|
|
|
@ -47,14 +47,6 @@ vi.mock('src/router/modules', () => ({
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'CustomerCreate',
|
||||
meta: {
|
||||
title: 'createCustomer',
|
||||
icon: 'vn:addperson',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -27,7 +27,11 @@ const checkboxModel = computed({
|
|||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<QCheckbox v-bind="$attrs" v-model="checkboxModel" />
|
||||
<QCheckbox
|
||||
v-bind="$attrs"
|
||||
v-model="checkboxModel"
|
||||
:data-cy="$attrs['data-cy'] ?? `vnCheckbox${$attrs['label'] ?? ''}`"
|
||||
/>
|
||||
<QIcon
|
||||
v-if="info"
|
||||
v-bind="$attrs"
|
||||
|
|
|
@ -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') }}
|
||||
|
|
|
@ -107,7 +107,7 @@ const manageDate = (date) => {
|
|||
@click="isPopupOpen = !isPopupOpen"
|
||||
@keydown="isPopupOpen = false"
|
||||
hide-bottom-space
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_inputDate'"
|
||||
:data-cy="($attrs['data-cy'] ?? $attrs.label) + '_inputDate'"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useColor } from 'src/composables/useColor';
|
|||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
import VnAvatar from '../ui/VnAvatar.vue';
|
||||
import VnJsonValue from '../common/VnJsonValue.vue';
|
||||
import VnLogValue from './VnLogValue.vue';
|
||||
import FetchData from '../FetchData.vue';
|
||||
import VnSelect from './VnSelect.vue';
|
||||
import VnUserLink from '../ui/VnUserLink.vue';
|
||||
|
@ -560,10 +560,11 @@ watch(
|
|||
value.nameI18n
|
||||
}}:
|
||||
</span>
|
||||
<VnJsonValue
|
||||
<VnLogValue
|
||||
:value="
|
||||
value.val.val
|
||||
"
|
||||
:name="value.name"
|
||||
/>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
|
@ -614,7 +615,11 @@ watch(
|
|||
>
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue :value="prop.val.val" />
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<VnIconLink />
|
||||
<span
|
||||
v-if="
|
||||
propIndex <
|
||||
|
@ -642,8 +647,9 @@ watch(
|
|||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<span v-if="log.action == 'update'">
|
||||
<VnJsonValue
|
||||
<VnLogValue
|
||||
:value="prop.old.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
v-if="prop.old.id"
|
||||
|
@ -652,8 +658,9 @@ watch(
|
|||
#{{ prop.old.id }}
|
||||
</span>
|
||||
→
|
||||
<VnJsonValue
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
v-if="prop.val.id"
|
||||
|
@ -663,8 +670,9 @@ watch(
|
|||
</span>
|
||||
</span>
|
||||
<span v-else="prop.old.val">
|
||||
<VnJsonValue
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
v-if="prop.old.id"
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<script setup>
|
||||
import { useDescriptorStore } from 'src/stores/useDescriptorStore';
|
||||
import VnJsonValue from './VnJsonValue.vue';
|
||||
import { computed } from 'vue';
|
||||
const descriptorStore = useDescriptorStore();
|
||||
|
||||
const $props = defineProps({
|
||||
name: { type: [String], default: undefined },
|
||||
});
|
||||
|
||||
const descriptor = computed(() => descriptorStore.has($props.name));
|
||||
</script>
|
||||
<template>
|
||||
<VnJsonValue v-bind="$attrs" />
|
||||
<QIcon
|
||||
name="launch"
|
||||
class="link"
|
||||
v-if="$attrs.value && descriptor"
|
||||
:data-cy="'iconLaunch-' + $props.name"
|
||||
/>
|
||||
<component :is="descriptor" :id="$attrs.value" v-if="$attrs.value && descriptor" />
|
||||
</template>
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, toRefs, computed, watch, onMounted, useAttrs } from 'vue';
|
||||
import { ref, toRefs, computed, watch, onMounted, useAttrs, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useRequired } from 'src/composables/useRequired';
|
||||
|
@ -247,6 +247,7 @@ async function fetchFilter(val) {
|
|||
}
|
||||
|
||||
async function filterHandler(val, update) {
|
||||
if (isLoading.value) return update();
|
||||
if (!val && lastVal.value === val) {
|
||||
lastVal.value = val;
|
||||
return update();
|
||||
|
@ -294,6 +295,7 @@ async function onScroll({ to, direction, from, index }) {
|
|||
await arrayData.loadMore();
|
||||
setOptions(arrayData.store.data);
|
||||
vnSelectRef.value.scrollTo(lastIndex);
|
||||
await nextTick();
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import VnLogValue from 'src/components/common/VnLogValue.vue';
|
||||
import { createWrapper } from 'app/test/vitest/helper';
|
||||
|
||||
const buildComponent = (props) => {
|
||||
return createWrapper(VnLogValue, {
|
||||
props,
|
||||
global: {},
|
||||
}).wrapper;
|
||||
};
|
||||
|
||||
describe('VnLogValue', () => {
|
||||
const id = 1;
|
||||
it('renders without descriptor', async () => {
|
||||
expect(getIcon('inventFk').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders with descriptor', async () => {
|
||||
expect(getIcon('claimFk').text()).toBe('launch');
|
||||
});
|
||||
|
||||
function getIcon(name) {
|
||||
const wrapper = buildComponent({ value: { val: id }, name });
|
||||
return wrapper.find('.q-icon');
|
||||
}
|
||||
});
|
|
@ -38,6 +38,10 @@ const $props = defineProps({
|
|||
type: String,
|
||||
default: 'md-width',
|
||||
},
|
||||
toModule: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const state = useState();
|
||||
|
@ -129,6 +133,11 @@ const emit = defineEmits(['onFetch']);
|
|||
|
||||
const iconModule = computed(() => {
|
||||
moduleName.value = getName();
|
||||
if ($props.toModule) {
|
||||
return router
|
||||
.getRoutes()
|
||||
.find((r) => r.name && r.name.includes($props.toModule.name)).meta.icon;
|
||||
}
|
||||
if (isSameModuleName) {
|
||||
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
||||
?.meta?.icon;
|
||||
|
@ -139,9 +148,10 @@ const iconModule = computed(() => {
|
|||
|
||||
const toModule = computed(() => {
|
||||
moduleName.value = getName();
|
||||
if ($props.toModule) return $props.toModule;
|
||||
if (isSameModuleName) {
|
||||
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
||||
?.children[0]?.redirect;
|
||||
?.redirect;
|
||||
} else {
|
||||
return route.matched[1].path.split('/').length > 2
|
||||
? route.matched[1].redirect
|
||||
|
@ -151,7 +161,7 @@ const toModule = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="descriptor">
|
||||
<div class="descriptor" data-cy="cardDescriptor">
|
||||
<template v-if="entity && !isLoading">
|
||||
<div class="header bg-primary q-pa-sm justify-between">
|
||||
<slot name="header-extra-action">
|
||||
|
@ -180,6 +190,7 @@ const toModule = computed(() => {
|
|||
color="white"
|
||||
class="link"
|
||||
v-if="summary"
|
||||
data-cy="openSummaryBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('components.smartCard.openSummary') }}
|
||||
|
@ -194,6 +205,7 @@ const toModule = computed(() => {
|
|||
icon="launch"
|
||||
round
|
||||
size="md"
|
||||
data-cy="goToSummaryBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('components.cardDescriptor.summary') }}
|
||||
|
@ -211,18 +223,27 @@ const toModule = computed(() => {
|
|||
<QList dense>
|
||||
<QItemLabel header class="ellipsis text-h5" :lines="1">
|
||||
<div class="title">
|
||||
<span v-if="$props.title" :title="getValueFromPath(title)">
|
||||
<span
|
||||
v-if="$props.title"
|
||||
:title="getValueFromPath(title)"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'cardDescriptor'}_title`"
|
||||
>
|
||||
{{ getValueFromPath(title) ?? $props.title }}
|
||||
</span>
|
||||
<slot v-else name="description" :entity="entity">
|
||||
<span :title="entity.name">
|
||||
{{ entity.name }}
|
||||
</span>
|
||||
<span
|
||||
:title="entity.name"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'cardDescriptor'}_description`"
|
||||
v-text="entity.name"
|
||||
/>
|
||||
</slot>
|
||||
</div>
|
||||
</QItemLabel>
|
||||
<QItem>
|
||||
<QItemLabel class="subtitle">
|
||||
<QItemLabel
|
||||
class="subtitle"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'cardDescriptor'}_subtitle`"
|
||||
>
|
||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||
</QItemLabel>
|
||||
<QBtn
|
||||
|
@ -240,7 +261,10 @@ const toModule = computed(() => {
|
|||
</QBtn>
|
||||
</QItem>
|
||||
</QList>
|
||||
<div class="list-box q-mt-xs">
|
||||
<div
|
||||
class="list-box q-mt-xs"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'cardDescriptor'}_listbox`"
|
||||
>
|
||||
<slot name="body" :entity="entity" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -249,7 +249,7 @@ const getLocale = (label) => {
|
|||
:key="chip.label"
|
||||
:removable="!unremovableParams?.includes(chip.label)"
|
||||
@remove="remove(chip.label)"
|
||||
data-cy="vnFilterPanelChip"
|
||||
:data-cy="`vnFilterPanelChip_${chip.label}`"
|
||||
>
|
||||
<slot
|
||||
name="tags"
|
||||
|
|
|
@ -28,7 +28,7 @@ function copyValueText() {
|
|||
const val = computed(() => $props.value);
|
||||
</script>
|
||||
<template>
|
||||
<div class="vn-label-value">
|
||||
<div class="vn-label-value" :data-cy="`${$attrs['data-cy'] ?? 'vnLv'}${label ?? ''}`">
|
||||
<QCheckbox
|
||||
v-if="typeof value === 'boolean'"
|
||||
v-model="val"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{ $t('components.cardDescriptor.moreOptions') }}
|
||||
</QTooltip>
|
||||
<QMenu ref="menuRef" data-cy="descriptor-more-opts-menu">
|
||||
<QList>
|
||||
<QList data-cy="descriptor-more-opts_list">
|
||||
<slot name="menu" :menu-ref="$refs.menuRef" />
|
||||
</QList>
|
||||
</QMenu>
|
||||
|
|
|
@ -99,7 +99,6 @@ globals:
|
|||
file: File
|
||||
selectFile: Select a file
|
||||
copyClipboard: Copy on clipboard
|
||||
salesPerson: SalesPerson
|
||||
send: Send
|
||||
code: Code
|
||||
since: Since
|
||||
|
@ -158,6 +157,7 @@ globals:
|
|||
changeState: Change state
|
||||
raid: 'Raid {daysInForward} days'
|
||||
isVies: Vies
|
||||
department: Department
|
||||
noData: No data available
|
||||
vehicle: Vehicle
|
||||
pageTitles:
|
||||
|
@ -347,7 +347,6 @@ globals:
|
|||
params:
|
||||
description: Description
|
||||
clientFk: Client id
|
||||
salesPersonFk: Sales person
|
||||
warehouseFk: Warehouse
|
||||
provinceFk: Province
|
||||
stateFk: State
|
||||
|
@ -605,7 +604,6 @@ worker:
|
|||
balance: Balance
|
||||
medical: Medical
|
||||
list:
|
||||
department: Department
|
||||
schedule: Schedule
|
||||
newWorker: New worker
|
||||
summary:
|
||||
|
@ -864,7 +862,6 @@ components:
|
|||
mine: For me
|
||||
hasMinPrice: Minimum price
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Buyer
|
||||
supplierFk: Supplier
|
||||
from: From
|
||||
to: To
|
||||
|
@ -895,6 +892,8 @@ components:
|
|||
VnLv:
|
||||
copyText: '{copyValue} has been copied to the clipboard'
|
||||
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
|
||||
VnNotes:
|
||||
clientWithoutPhone: 'The following clients do not have a phone number and the message will not be sent to them: {clientWithoutPhone}'
|
||||
weekdays:
|
||||
sun: Sunday
|
||||
mon: Monday
|
||||
|
|
|
@ -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,7 @@ globals:
|
|||
raid: 'Redada {daysInForward} días'
|
||||
isVies: Vies
|
||||
noData: Datos no disponibles
|
||||
department: Departamento
|
||||
vehicle: Vehículo
|
||||
pageTitles:
|
||||
logIn: Inicio de sesión
|
||||
|
@ -350,7 +350,6 @@ globals:
|
|||
params:
|
||||
description: Descripción
|
||||
clientFk: Id cliente
|
||||
salesPersonFk: Comercial
|
||||
warehouseFk: Almacén
|
||||
provinceFk: Provincia
|
||||
stateFk: Estado
|
||||
|
@ -532,7 +531,6 @@ ticket:
|
|||
state: Estado
|
||||
shipped: Enviado
|
||||
landed: Entregado
|
||||
salesPerson: Comercial
|
||||
total: Total
|
||||
card:
|
||||
customerId: ID cliente
|
||||
|
@ -624,8 +622,6 @@ invoiceOut:
|
|||
errors:
|
||||
downloadCsvFailed: Error al descargar CSV
|
||||
order:
|
||||
field:
|
||||
salesPersonFk: Comercial
|
||||
form:
|
||||
clientFk: Cliente
|
||||
addressFk: Dirección
|
||||
|
@ -693,7 +689,6 @@ worker:
|
|||
formation: Formación
|
||||
medical: Mutua
|
||||
list:
|
||||
department: Departamento
|
||||
schedule: Horario
|
||||
newWorker: Nuevo trabajador
|
||||
summary:
|
||||
|
@ -951,7 +946,6 @@ components:
|
|||
hasMinPrice: Precio mínimo
|
||||
wareHouseFk: Almacén
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Comprador
|
||||
supplierFk: Proveedor
|
||||
visible: Visible
|
||||
active: Activo
|
||||
|
@ -982,6 +976,8 @@ components:
|
|||
VnLv:
|
||||
copyText: '{copyValue} se ha copiado al portapepeles'
|
||||
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
|
||||
VnNotes:
|
||||
clientWithoutPhone: 'Estos clientes no tienen asociado número de télefono y el sms no les será enviado: {clientWithoutPhone}'
|
||||
weekdays:
|
||||
sun: Domingo
|
||||
mon: Lunes
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<script setup>
|
||||
import AccountDescriptor from './AccountDescriptor.vue';
|
||||
import AccountSummary from './AccountSummary.vue';
|
||||
</script>
|
||||
<template>
|
||||
<QPopupProxy style="max-width: 10px">
|
||||
<AccountDescriptor
|
||||
v-if="$attrs.id"
|
||||
v-bind="$attrs.id"
|
||||
:summary="AccountSummary"
|
||||
:proxy-render="true"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
|
@ -37,6 +37,7 @@ const removeRole = async () => {
|
|||
:filter="{ where: { id: entityId } }"
|
||||
data-key="Role"
|
||||
:summary="$props.summary"
|
||||
:to-module="{ name: 'AccountRoles' }"
|
||||
>
|
||||
<template #menu>
|
||||
<QItem v-ripple clickable @click="removeRole()">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<script setup>
|
||||
import ClaimDescriptor from './ClaimDescriptor.vue';
|
||||
import ClaimSummary from './ClaimSummary.vue';
|
||||
</script>
|
||||
<template>
|
||||
<QPopupProxy style="max-width: 10px">
|
||||
<ClaimDescriptor
|
||||
v-if="$attrs.id"
|
||||
v-bind="$attrs.id"
|
||||
:summary="ClaimSummary"
|
||||
:proxy-render="true"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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')">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -121,25 +121,40 @@ function deleteFile(dmsFk) {
|
|||
hide-selected
|
||||
:is-clearable="false"
|
||||
:required="true"
|
||||
data-cy="invoiceInBasicDataSupplier"
|
||||
/>
|
||||
<VnInput
|
||||
clearable
|
||||
clear-icon="close"
|
||||
:label="t('invoiceIn.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
data-cy="invoiceInBasicDataSupplierRef"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputDate :label="t('Expedition date')" v-model="data.issued" />
|
||||
<VnInputDate
|
||||
:label="t('Expedition date')"
|
||||
v-model="data.issued"
|
||||
data-cy="invoiceInBasicDataIssued"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('Operation date')"
|
||||
v-model="data.operated"
|
||||
autofocus
|
||||
data-cy="invoiceInBasicDataOperated"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputDate :label="t('Entry date')" v-model="data.bookEntried" />
|
||||
<VnInputDate :label="t('Accounted date')" v-model="data.booked" />
|
||||
<VnInputDate
|
||||
:label="t('Entry date')"
|
||||
v-model="data.bookEntried"
|
||||
data-cy="invoiceInBasicDatabookEntried"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('Accounted date')"
|
||||
v-model="data.booked"
|
||||
data-cy="invoiceInBasicDataBooked"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
|
@ -149,7 +164,7 @@ function deleteFile(dmsFk) {
|
|||
option-value="id"
|
||||
option-label="id"
|
||||
:filter-options="['id', 'name']"
|
||||
data-cy="UnDeductibleVatSelect"
|
||||
data-cy="invoiceInBasicDataDeductibleExpenseFk"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -182,6 +197,7 @@ function deleteFile(dmsFk) {
|
|||
padding="xs"
|
||||
round
|
||||
@click="downloadFile(data.dmsFk)"
|
||||
data-cy="invoiceInBasicDataDmsDownload"
|
||||
/>
|
||||
<QBtn
|
||||
:class="{
|
||||
|
@ -197,6 +213,7 @@ function deleteFile(dmsFk) {
|
|||
documentDialogRef.dms = data.dms;
|
||||
}
|
||||
"
|
||||
data-cy="invoiceInBasicDataDmsEdit"
|
||||
>
|
||||
<QTooltip>{{ t('Edit document') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -210,6 +227,7 @@ function deleteFile(dmsFk) {
|
|||
padding="xs"
|
||||
round
|
||||
@click="deleteFile(data.dmsFk)"
|
||||
data-cy="invoiceInBasicDataDmsDelete"
|
||||
/>
|
||||
</div>
|
||||
<QBtn
|
||||
|
@ -224,7 +242,7 @@ function deleteFile(dmsFk) {
|
|||
delete documentDialogRef.dms;
|
||||
}
|
||||
"
|
||||
data-cy="dms-create"
|
||||
data-cy="invoiceInBasicDataDmsAdd"
|
||||
>
|
||||
<QTooltip>{{ t('Create document') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -237,9 +255,9 @@ function deleteFile(dmsFk) {
|
|||
:label="t('Currency')"
|
||||
v-model="data.currencyFk"
|
||||
:options="currencies"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
sort-by="id"
|
||||
data-cy="invoiceInBasicDataCurrencyFk"
|
||||
/>
|
||||
|
||||
<VnSelect
|
||||
|
@ -249,8 +267,8 @@ function deleteFile(dmsFk) {
|
|||
:label="t('Company')"
|
||||
v-model="data.companyFk"
|
||||
:options="companies"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
data-cy="invoiceInBasicDataCompanyFk"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
|
@ -260,6 +278,7 @@ function deleteFile(dmsFk) {
|
|||
:options="sageWithholdings"
|
||||
option-value="id"
|
||||
option-label="withholding"
|
||||
data-cy="invoiceInBasicDataWithholdingSageFk"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
<script setup>
|
||||
import { ref, computed, capitalize } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import CrudModel from 'src/components/CrudModel.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const arrayData = useArrayData();
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const invoiceInCorrectionRef = ref();
|
||||
const filter = {
|
||||
include: { relation: 'invoiceIn' },
|
||||
where: { correctingFk: route.params.id },
|
||||
};
|
||||
const columns = computed(() => [
|
||||
{
|
||||
name: 'origin',
|
||||
|
@ -92,7 +86,8 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
|
|||
v-if="invoiceIn"
|
||||
data-key="InvoiceInCorrection"
|
||||
url="InvoiceInCorrections"
|
||||
:filter="filter"
|
||||
:user-filter="{ include: { relation: 'invoiceIn' } }"
|
||||
:filter="{ where: { correctingFk: $route.params.id } }"
|
||||
auto-load
|
||||
primary-key="correctingFk"
|
||||
:default-remove="false"
|
||||
|
@ -115,6 +110,7 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
|
|||
:option-label="col.optionLabel"
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
:filter-options="['description']"
|
||||
data-cy="invoiceInCorrective_type"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -137,6 +133,7 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
|
|||
:rules="[requiredFieldRule]"
|
||||
:filter-options="['code', 'description']"
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
data-cy="invoiceInCorrective_class"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -161,6 +158,7 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
|
|||
:option-label="col.optionLabel"
|
||||
:rules="[requiredFieldRule]"
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
data-cy="invoiceInCorrective_reason"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
|
|
@ -17,10 +17,6 @@ const { t } = useI18n();
|
|||
const cardDescriptorRef = ref();
|
||||
const entityId = computed(() => $props.id || +currentRoute.value.params.id);
|
||||
const totalAmount = ref();
|
||||
const config = ref();
|
||||
const cplusRectificationTypes = ref([]);
|
||||
const siiTypeInvoiceIns = ref([]);
|
||||
const invoiceCorrectionTypes = ref([]);
|
||||
const invoiceInCorrection = reactive({ correcting: [], corrected: null });
|
||||
const routes = reactive({
|
||||
getSupplier: (id) => {
|
||||
|
@ -30,7 +26,7 @@ const routes = reactive({
|
|||
return {
|
||||
name: 'InvoiceInList',
|
||||
query: {
|
||||
params: JSON.stringify({ supplierFk: id }),
|
||||
table: JSON.stringify({ supplierFk: id }),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -39,7 +35,7 @@ const routes = reactive({
|
|||
return {
|
||||
name: 'InvoiceInList',
|
||||
query: {
|
||||
params: JSON.stringify({ correctedFk: entityId.value }),
|
||||
table: JSON.stringify({ correctedFk: entityId.value }),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -108,7 +104,7 @@ async function setInvoiceCorrection(id) {
|
|||
<VnLv :label="t('invoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
|
||||
<VnLv :label="t('invoiceIn.list.supplier')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
<span class="link" data-cy="invoiceInDescriptor_supplier">
|
||||
{{ entity?.supplier?.nickname }}
|
||||
<SupplierDescriptorProxy :id="entity?.supplierFk" />
|
||||
</span>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, toRefs, reactive } from 'vue';
|
||||
import { ref, computed, toRefs, reactive, onBeforeMount } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -111,10 +111,9 @@ async function cloneInvoice() {
|
|||
}
|
||||
|
||||
const isAgricultural = () => {
|
||||
if (!config.value) return false;
|
||||
return (
|
||||
invoiceIn.value?.supplier?.sageFarmerWithholdingFk ===
|
||||
config?.value[0]?.sageWithholdingFk
|
||||
invoiceIn.value?.supplier?.sageWithholdingFk ==
|
||||
config.value?.sageFarmerWithholdingFk
|
||||
);
|
||||
};
|
||||
function showPdfInvoice() {
|
||||
|
@ -153,162 +152,183 @@ const createInvoiceInCorrection = async () => {
|
|||
);
|
||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||
};
|
||||
|
||||
onBeforeMount(async () => {
|
||||
config.value = (
|
||||
await axios.get('invoiceinConfigs/findOne', {
|
||||
params: { fields: ['sageFarmerWithholdingFk'] },
|
||||
})
|
||||
).data;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="InvoiceCorrectionTypes"
|
||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="CplusRectificationTypes"
|
||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="InvoiceInConfigs"
|
||||
:where="{ fields: ['sageWithholdingFk'] }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (config = data)"
|
||||
/>
|
||||
<InvoiceInToBook>
|
||||
<template #content="{ book }">
|
||||
<QItem
|
||||
v-if="!invoice?.isBooked && canEditProp('toBook')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="book(entityId)"
|
||||
<template v-if="config">
|
||||
<FetchData
|
||||
url="InvoiceCorrectionTypes"
|
||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="CplusRectificationTypes"
|
||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<InvoiceInToBook>
|
||||
<template #content="{ book }">
|
||||
<QItem
|
||||
v-if="!invoice?.isBooked && canEditProp('toBook')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="book(entityId)"
|
||||
>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.book') }}</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</InvoiceInToBook>
|
||||
<QItem
|
||||
v-if="invoice?.isBooked && canEditProp('toUnbook')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('unbook')"
|
||||
>
|
||||
<QItemSection>
|
||||
{{ t('invoiceIn.descriptorMenu.unbook') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="canEditProp('deleteById')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('delete')"
|
||||
>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="canEditProp('clone')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('clone')"
|
||||
>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
|
||||
<QItemSection>{{
|
||||
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
|
||||
}}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
|
||||
<QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
||||
>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.book') }}</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</InvoiceInToBook>
|
||||
<QItem
|
||||
v-if="invoice?.isBooked && canEditProp('toUnbook')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('unbook')"
|
||||
>
|
||||
<QItemSection>
|
||||
{{ t('invoiceIn.descriptorMenu.unbook') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="canEditProp('deleteById')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('delete')"
|
||||
>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="canEditProp('clone')" v-ripple clickable @click="triggerMenu('clone')">
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
|
||||
<QItemSection>{{
|
||||
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
|
||||
}}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
|
||||
<QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="!invoiceInCorrection.corrected"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('correct')"
|
||||
data-cy="createCorrectiveItem"
|
||||
>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="!invoiceInCorrection.corrected"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('correct')"
|
||||
data-cy="createCorrectiveItem"
|
||||
>
|
||||
<QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
|
||||
<QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
|
||||
>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="invoice.dmsFk"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="downloadFile(invoice.dmsFk)"
|
||||
>
|
||||
</QItem>
|
||||
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
||||
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
||||
</QItem>
|
||||
<QDialog ref="correctionDialogRef">
|
||||
<QCard>
|
||||
<QCardSection>
|
||||
<QItem class="q-px-none">
|
||||
<span class="text-primary text-h6 full-width">
|
||||
{{ t('Create rectificative invoice') }}
|
||||
</span>
|
||||
<QBtn icon="close" flat round dense v-close-popup />
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Original invoice')"
|
||||
v-model="entityId"
|
||||
readonly
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.class'))}`"
|
||||
v-model="correctionFormData.invoiceClass"
|
||||
:options="siiTypeInvoiceIns"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.type'))}`"
|
||||
v-model="correctionFormData.invoiceType"
|
||||
:options="cplusRectificationTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.id }} -
|
||||
{{ opt.description }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<div></div>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
||||
</QItem>
|
||||
<QDialog ref="correctionDialogRef">
|
||||
<QCard data-cy="correctiveInvoiceDialog">
|
||||
<QCardSection>
|
||||
<QItem class="q-px-none">
|
||||
<span class="text-primary text-h6 full-width">
|
||||
{{ t('Create rectificative invoice') }}
|
||||
</span>
|
||||
<QBtn icon="close" flat round dense v-close-popup />
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Original invoice')"
|
||||
v-model="entityId"
|
||||
readonly
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.class'))}`"
|
||||
v-model="correctionFormData.invoiceClass"
|
||||
:options="siiTypeInvoiceIns"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
data-cy="invoiceInDescriptorMenu_class"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.type'))}`"
|
||||
v-model="correctionFormData.invoiceType"
|
||||
:options="cplusRectificationTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
data-cy="invoiceInDescriptorMenu_type"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.id }} -
|
||||
{{ opt.description }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<div></div>
|
||||
</template>
|
||||
</VnSelect>
|
||||
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||
v-model="correctionFormData.invoiceReason"
|
||||
:options="invoiceCorrectionTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardActions class="justify-end q-mr-sm">
|
||||
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
||||
<QBtn
|
||||
:label="t('globals.save')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
@click="createInvoiceInCorrection"
|
||||
:disable="isNotFilled"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
</QDialog>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||
v-model="correctionFormData.invoiceReason"
|
||||
:options="invoiceCorrectionTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
data-cy="invoiceInDescriptorMenu_reason"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardActions class="justify-end q-mr-sm">
|
||||
<QBtn
|
||||
flat
|
||||
:label="t('globals.close')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
/>
|
||||
<QBtn
|
||||
:label="t('globals.save')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
@click="createInvoiceInCorrection"
|
||||
:disable="isNotFilled"
|
||||
data-cy="saveCorrectiveInvoice"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
</QDialog>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
|
||||
|
|
|
@ -198,6 +198,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
color="orange-11"
|
||||
text-color="black"
|
||||
@click="book(entityId)"
|
||||
data-cy="invoiceInSummary_book"
|
||||
/>
|
||||
</template>
|
||||
</InvoiceIntoBook>
|
||||
|
@ -219,7 +220,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
:value="entity.supplier?.name"
|
||||
>
|
||||
<template #value>
|
||||
<span class="link">
|
||||
<span class="link" data-cy="invoiceInSummary_supplier">
|
||||
{{ entity.supplier?.name }}
|
||||
<SupplierDescriptorProxy :id="entity.supplierFk" />
|
||||
</span>
|
||||
|
|
|
@ -202,6 +202,9 @@ function setCursor(ref) {
|
|||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'name']"
|
||||
:tooltip="t('Create a new expense')"
|
||||
:acls="[
|
||||
{ model: 'Expense', props: '*', accessType: 'WRITE' },
|
||||
]"
|
||||
@keydown.tab.prevent="
|
||||
autocompleteExpense(
|
||||
$event,
|
||||
|
|
|
@ -7,6 +7,7 @@ import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
|||
import { dateRange } from 'src/filters';
|
||||
import { date } from 'quasar';
|
||||
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
|
||||
|
@ -147,13 +148,13 @@ function handleDaysAgo(params, daysAgo) {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
:label="$t('invoiceIn.isBooked')"
|
||||
v-model="params.isBooked"
|
||||
@update:model-value="searchFn()"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
:label="getLocale('params.correctingFk')"
|
||||
v-model="params.correctingFk"
|
||||
@update:model-value="searchFn()"
|
||||
|
|
|
@ -4,7 +4,7 @@ import { useQuasar } from 'quasar';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import qs from 'qs';
|
||||
|
||||
const { notify, dialog } = useQuasar();
|
||||
const { t } = useI18n();
|
||||
|
||||
|
@ -61,17 +61,15 @@ async function checkToBook(id) {
|
|||
}
|
||||
|
||||
async function toBook(id) {
|
||||
let type = 'positive';
|
||||
let message = t('globals.dataSaved');
|
||||
|
||||
let err = false;
|
||||
try {
|
||||
await axios.post(`InvoiceIns/${id}/toBook`);
|
||||
store.data.isBooked = true;
|
||||
} catch (e) {
|
||||
type = 'negative';
|
||||
message = t('It was not able to book the invoice');
|
||||
err = true;
|
||||
throw e;
|
||||
} finally {
|
||||
notify({ type, message });
|
||||
if (!err) notify({ type: 'positive', message: t('globals.dataSaved') });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -46,6 +46,11 @@ function ticketFilter(invoice) {
|
|||
<InvoiceOutDescriptorMenu :invoice-out-data="entity" :menu-ref="menuRef" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv
|
||||
v-if="entity.externalRef"
|
||||
:label="t('invoiceOut.externalRef')"
|
||||
:value="entity.externalRef"
|
||||
/>
|
||||
<VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv :label="t('globals.amount')" :value="toCurrency(entity.amount)" />
|
||||
<VnLv v-if="entity.client" :label="t('globals.client')">
|
||||
|
|
|
@ -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();
|
||||
|
@ -54,6 +55,14 @@ const columns = computed(() => [
|
|||
name: 'id',
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'issued',
|
||||
label: t('invoiceOut.summary.issued'),
|
||||
component: 'date',
|
||||
format: (row) => toDate(row.issued),
|
||||
columnField: { component: null },
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'ref',
|
||||
|
@ -86,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',
|
||||
|
@ -229,6 +252,12 @@ 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 col-span-2">
|
||||
<div class="col-12">
|
||||
|
|
|
@ -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 }">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
invoiceOut:
|
||||
search: Search invoice
|
||||
searchInfo: You can search by invoice reference
|
||||
externalRef: External Ref.
|
||||
params:
|
||||
id: ID
|
||||
company: Company
|
||||
|
@ -12,7 +13,6 @@ invoiceOut:
|
|||
isActive: Active
|
||||
hasToInvoice: Has to invoice
|
||||
hasVerifiedData: Verified data
|
||||
workerName: Worker
|
||||
isTaxDataChecked: Verified data
|
||||
amount: Amount
|
||||
clientFk: Client
|
||||
|
@ -26,6 +26,7 @@ invoiceOut:
|
|||
max: Max
|
||||
hasPdf: Has PDF
|
||||
search: Contains
|
||||
departmentFk: Department
|
||||
card:
|
||||
issued: Issued
|
||||
customerCard: Customer card
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
invoiceOut:
|
||||
search: Buscar factura emitida
|
||||
searchInfo: Puedes buscar por referencia de la factura
|
||||
externalRef: Ref. externa
|
||||
params:
|
||||
id: ID
|
||||
company: Empresa
|
||||
|
@ -12,7 +13,6 @@ invoiceOut:
|
|||
isActive: Activo
|
||||
hasToInvoice: Debe facturar
|
||||
hasVerifiedData: Datos verificados
|
||||
workerName: Comercial
|
||||
isTaxDataChecked: Datos comprobados
|
||||
amount: Importe
|
||||
clientFk: Cliente
|
||||
|
@ -26,6 +26,7 @@ invoiceOut:
|
|||
max: Max
|
||||
hasPdf: Tiene PDF
|
||||
search: Contiene
|
||||
departmentFk: Departamento
|
||||
card:
|
||||
issued: Fecha emisión
|
||||
customerCard: Ficha del cliente
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,7 +8,7 @@ import filter from './OrderFilter.js';
|
|||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
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';
|
||||
|
||||
const DEFAULT_ITEMS = 0;
|
||||
|
||||
|
@ -66,11 +66,11 @@ const total = ref(0);
|
|||
:label="t('globals.state')"
|
||||
:value="getConfirmationValue(entity.isConfirmed)"
|
||||
/>
|
||||
<VnLv :label="t('order.field.salesPersonFk')">
|
||||
<VnLv :label="t('customer.summary.team')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ entity?.client?.salesPersonUser?.name || '-' }}
|
||||
<WorkerDescriptorProxy :id="entity?.client?.salesPersonFk" />
|
||||
{{ entity?.client?.department?.name || '-' }}
|
||||
<DepartmentDescriptorProxy :id="entity?.client?.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
|
|
|
@ -10,14 +10,14 @@ export default {
|
|||
relation: 'client',
|
||||
scope: {
|
||||
fields: [
|
||||
'salesPersonFk',
|
||||
'departmentFk',
|
||||
'name',
|
||||
'isActive',
|
||||
'isFreezed',
|
||||
'isTaxDataChecked',
|
||||
],
|
||||
include: {
|
||||
relation: 'salesPersonUser',
|
||||
relation: 'department',
|
||||
scope: { fields: ['id', 'name'] },
|
||||
},
|
||||
},
|
||||
|
|
|
@ -6,7 +6,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInput from 'components/common/VnInput.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -62,15 +61,15 @@ const sourceList = ref([]);
|
|||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnSelectWorker
|
||||
:label="t('globals.salesPerson')"
|
||||
v-model="params.workerFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
dense
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.departmentFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="params.from"
|
||||
|
@ -125,7 +124,6 @@ en:
|
|||
search: Includes
|
||||
clientFk: Client
|
||||
agencyModeFk: Agency
|
||||
salesPersonFk: Sales Person
|
||||
from: From
|
||||
to: To
|
||||
orderFk: Order
|
||||
|
@ -136,7 +134,6 @@ en:
|
|||
showEmpty: Show Empty
|
||||
customerId: Customer ID
|
||||
agency: Agency
|
||||
salesPerson: Sales Person
|
||||
fromLanded: From Landed
|
||||
toLanded: To Landed
|
||||
orderId: Order ID
|
||||
|
@ -149,7 +146,6 @@ es:
|
|||
search: Búsqueda
|
||||
clientFk: Cliente
|
||||
agencyModeFk: Agencia
|
||||
salesPersonFk: Comercial
|
||||
from: Desde
|
||||
to: Hasta
|
||||
orderFk: Cesta
|
||||
|
@ -160,7 +156,6 @@ es:
|
|||
showEmpty: Mostrar vacías
|
||||
customerId: ID Cliente
|
||||
agency: Agencia
|
||||
salesPerson: Comercial
|
||||
fromLanded: Desde F. entrega
|
||||
toLanded: Hasta F. entrega
|
||||
orderId: ID Cesta
|
||||
|
|
|
@ -10,12 +10,12 @@ import axios from 'axios';
|
|||
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
||||
import OrderFilter from './Card/OrderFilter.vue';
|
||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import { getAddresses } from '../Customer/composables/getAddresses';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -59,22 +59,17 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'salesPersonFk',
|
||||
label: t('module.salesPerson'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
inWhere: true,
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
where: { role: 'salesPerson' },
|
||||
useLike: false,
|
||||
optionValue: 'id',
|
||||
optionLabel: 'name',
|
||||
optionFilter: 'firstName',
|
||||
},
|
||||
name: 'departmentFk',
|
||||
label: t('customer.summary.team'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
format: (row) => row?.name,
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -264,10 +259,10 @@ const isDefaultAddress = (opt, data) => {
|
|||
<CustomerDescriptorProxy :id="row?.clientFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row?.name }}
|
||||
<WorkerDescriptorProxy :id="row?.salesPersonFk" />
|
||||
{{ row?.departmentName }}
|
||||
<DepartmentDescriptorProxy :id="row?.departmentFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-landed="{ row }">
|
||||
|
|
|
@ -8,7 +8,6 @@ module:
|
|||
hour: Hour
|
||||
agency: Agency
|
||||
total: Total
|
||||
salesPerson: Sales Person
|
||||
address: Address
|
||||
cerateOrder: Create order
|
||||
lines:
|
||||
|
@ -22,8 +21,6 @@ lines:
|
|||
params:
|
||||
tagGroups: Tags
|
||||
order:
|
||||
field:
|
||||
salesPersonFk: Sales Person
|
||||
form:
|
||||
clientFk: Client
|
||||
addressFk: Address
|
||||
|
|
|
@ -8,7 +8,6 @@ module:
|
|||
hour: Hora
|
||||
agency: Agencia
|
||||
total: Total
|
||||
salesPerson: Comercial
|
||||
address: Dirección
|
||||
cerateOrder: Crear cesta
|
||||
lines:
|
||||
|
@ -22,8 +21,6 @@ lines:
|
|||
params:
|
||||
tagGroups: Tags
|
||||
order:
|
||||
field:
|
||||
salesPersonFk: Comercial
|
||||
form:
|
||||
clientFk: Cliente
|
||||
addressFk: Dirección
|
||||
|
|
|
@ -43,16 +43,22 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('isOwn'),
|
||||
label: t('agency.isOwn'),
|
||||
name: 'isOwn',
|
||||
component: 'checkbox',
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
},
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('isAnyVolumeAllowed'),
|
||||
label: t('agency.isAnyVolumeAllowed'),
|
||||
name: 'isAnyVolumeAllowed',
|
||||
component: 'checkbox',
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
},
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
|
@ -61,7 +67,7 @@ const columns = computed(() => [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('Client ticket list'),
|
||||
title: t('globals.pageTitles.summary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row?.id, AgencySummary),
|
||||
isPrimary: true,
|
||||
|
@ -107,11 +113,3 @@ const columns = computed(() => [
|
|||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
es:
|
||||
isOwn: Tiene propietario
|
||||
isAnyVolumeAllowed: Permite cualquier volumen
|
||||
en:
|
||||
isOwn: Has owner
|
||||
isAnyVolumeAllowed: Allows any volume
|
||||
</i18n>
|
||||
|
|
|
@ -17,7 +17,7 @@ const props = defineProps({
|
|||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const entityId = computed(() => props.id || route.params.id);
|
||||
const { store } = useArrayData('Parking');
|
||||
const { store } = useArrayData();
|
||||
const card = computed(() => store.data);
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import VnLv from 'components/ui/VnLv.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import VnCheckbox from 'components/common/VnCheckbox.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const $props = defineProps({ id: { type: Number, default: 0 } });
|
||||
|
@ -24,12 +25,12 @@ const entityId = computed(() => $props.id || route.params.id);
|
|||
:text="t('globals.pageTitles.basicData')"
|
||||
/>
|
||||
<VnLv :label="t('globals.name')" :value="agency.name" />
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
:label="t('agency.isOwn')"
|
||||
v-model="agency.isOwn"
|
||||
:disable="true"
|
||||
/>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
:label="t('agency.isAnyVolumeAllowed')"
|
||||
v-model="agency.isAnyVolumeAllowed"
|
||||
:disable="true"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
agency:
|
||||
search: Search agency
|
||||
searchInfo: You can search by name
|
||||
searchInfo: You can search by name and by id
|
||||
isOwn: Own
|
||||
isAnyVolumeAllowed: Any volume allowed
|
||||
removeItem: Agency removed successfully
|
||||
notification:
|
||||
removeItemError: Error removing agency
|
||||
removeItem: WorkCenter removed successfully
|
||||
removeItemError: Error removing work center
|
||||
removeItem: Work center removed successfully
|
||||
pageTitles:
|
||||
agency: Agency
|
||||
searchBar:
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
agency:
|
||||
search: Buscar agencia
|
||||
searchInfo: Puedes buscar por nombre
|
||||
searchInfo: Puedes buscar por nombre y por id
|
||||
isOwn: Propio
|
||||
isAnyVolumeAllowed: Cualquier volumen
|
||||
removeItem: Agencia eliminada correctamente
|
||||
notification:
|
||||
removeItemError: Error al eliminar la agencia
|
||||
removeItemError: Error al eliminar la el centro de trabajo
|
||||
removeItem: Centro de trabajo eliminado correctamente
|
||||
pageTitles:
|
||||
agency: Agencia
|
||||
searchBar:
|
||||
info: Puedes buscar por nombre o id
|
||||
label: Buscar agencia...
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import useCardDescription from 'composables/useCardDescription';
|
||||
import VnLv from 'components/ui/VnLv.vue';
|
||||
import { dashIfEmpty, toDate } from 'src/filters';
|
||||
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
|
||||
import filter from './RouteFilter.js';
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
import axios from 'axios';
|
||||
|
||||
const $props = defineProps({
|
||||
|
|
|
@ -332,6 +332,7 @@ const openTicketsDialog = (id) => {
|
|||
<QBtn
|
||||
icon="vn:clone"
|
||||
color="primary"
|
||||
flat
|
||||
class="q-mr-sm"
|
||||
:disable="!selectedRows?.length"
|
||||
@click="confirmationDialog = true"
|
||||
|
@ -341,6 +342,7 @@ const openTicketsDialog = (id) => {
|
|||
<QBtn
|
||||
icon="cloud_download"
|
||||
color="primary"
|
||||
flat
|
||||
class="q-mr-sm"
|
||||
:disable="!selectedRows?.length"
|
||||
@click="showRouteReport"
|
||||
|
@ -352,6 +354,7 @@ const openTicketsDialog = (id) => {
|
|||
<QBtn
|
||||
icon="check"
|
||||
color="primary"
|
||||
flat
|
||||
class="q-mr-sm"
|
||||
:disable="!selectedRows?.length"
|
||||
@click="markAsServed()"
|
||||
|
|
|
@ -3,6 +3,7 @@ import { computed, ref, markRaw } from 'vue';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { toHour } from 'src/filters';
|
||||
import { useRouter } from 'vue-router';
|
||||
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
|
@ -11,9 +12,9 @@ import AgencyDescriptorProxy from 'src/pages/Route/Agency/Card/AgencyDescriptorP
|
|||
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
import RouteTickets from './RouteTickets.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref([]);
|
||||
const dataKey = 'RouteList';
|
||||
|
@ -29,8 +30,10 @@ const routeFilter = {
|
|||
};
|
||||
|
||||
function redirectToTickets(id) {
|
||||
const url = `#/route/${id}/tickets`;
|
||||
window.open(url, '_blank');
|
||||
router.push({
|
||||
name: 'RouteTickets',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
const columns = computed(() => [
|
||||
|
@ -46,26 +49,18 @@ const columns = computed(() => [
|
|||
width: '25px',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'workerFk',
|
||||
label: t('gloabls.worker'),
|
||||
label: t('globals.worker'),
|
||||
component: markRaw(VnSelectWorker),
|
||||
create: true,
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||
columnFilter: false,
|
||||
cardVisible: true,
|
||||
width: '100px',
|
||||
},
|
||||
{
|
||||
name: 'workerFk',
|
||||
label: t('globals.worker'),
|
||||
visible: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
name: 'agencyName',
|
||||
label: t('globals.agency'),
|
||||
},
|
||||
{
|
||||
label: t('globals.Agency'),
|
||||
name: 'agencyModeFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -77,23 +72,13 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
create: true,
|
||||
columnFilter: false,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
name: 'agencyName',
|
||||
label: t('globals.agency'),
|
||||
visible: false,
|
||||
columnFilter: true,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
name: 'vehiclePlateNumber',
|
||||
label: t('globals.vehicle'),
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
name: 'vehicleFk',
|
||||
label: t('globals.Vehicle'),
|
||||
cardVisible: true,
|
||||
label: t('globals.vehicle'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'vehicles',
|
||||
|
@ -106,8 +91,9 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
create: true,
|
||||
columnFilter: false,
|
||||
visible: false,
|
||||
columnFilter: true,
|
||||
cardVisible: true,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -181,8 +167,8 @@ const columns = computed(() => [
|
|||
<VnTable
|
||||
:with-filters="false"
|
||||
:data-key
|
||||
:columns="columns"
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
redirect="route"
|
||||
:create="{
|
||||
|
@ -199,7 +185,7 @@ const columns = computed(() => [
|
|||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-agencyName="{ row }">
|
||||
<template #column-agencyModeFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row?.agencyName }}
|
||||
<AgencyDescriptorProxy
|
||||
|
@ -208,7 +194,7 @@ const columns = computed(() => [
|
|||
/>
|
||||
</span>
|
||||
</template>
|
||||
<template #column-vehiclePlateNumber="{ row }">
|
||||
<template #column-vehicleFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row?.vehiclePlateNumber }}
|
||||
<VehicleDescriptorProxy
|
||||
|
|
|
@ -30,16 +30,16 @@ const columns = computed(() => [
|
|||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'street',
|
||||
label: t('Street'),
|
||||
field: (row) => row?.street,
|
||||
name: 'client',
|
||||
label: t('Client'),
|
||||
field: (row) => row?.nickname,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'client',
|
||||
label: t('Client'),
|
||||
field: (row) => row?.nickname,
|
||||
name: 'street',
|
||||
label: t('Street'),
|
||||
field: (row) => row?.street,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
|
@ -199,12 +199,22 @@ const confirmRemove = (ticket) => {
|
|||
const openSmsDialog = async () => {
|
||||
const clientsId = [];
|
||||
const clientsPhone = [];
|
||||
|
||||
const clientWithoutPhone = [];
|
||||
for (let ticket of selectedRows.value) {
|
||||
clientsId.push(ticket?.clientFk);
|
||||
const { data: client } = await axios.get(`Clients/${ticket?.clientFk}`);
|
||||
if (!client.phone) {
|
||||
clientWithoutPhone.push(ticket?.clientFk);
|
||||
continue;
|
||||
}
|
||||
clientsPhone.push(client.phone);
|
||||
}
|
||||
if (clientWithoutPhone.length) {
|
||||
quasar.notify({
|
||||
type: 'warning',
|
||||
message: t('components.VnNotes.clientWithoutPhone', { clientWithoutPhone }),
|
||||
});
|
||||
}
|
||||
|
||||
quasar.dialog({
|
||||
component: SendSmsDialog,
|
||||
|
@ -319,7 +329,7 @@ const openSmsDialog = async () => {
|
|||
selection="multiple"
|
||||
>
|
||||
<template #body-cell-order="{ row }">
|
||||
<QTd class="order-field">
|
||||
<QTd class="order-field" auto-width>
|
||||
<div class="flex no-wrap items-center">
|
||||
<QIcon
|
||||
name="low_priority"
|
||||
|
@ -341,7 +351,7 @@ const openSmsDialog = async () => {
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-city="{ value, row }">
|
||||
<QTd auto-width>
|
||||
<QTd>
|
||||
<span class="link" @click="goToBuscaman(row)">
|
||||
{{ value }}
|
||||
<QTooltip>{{ t('Open buscaman') }}</QTooltip>
|
||||
|
@ -349,7 +359,7 @@ const openSmsDialog = async () => {
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-client="{ value, row }">
|
||||
<QTd auto-width>
|
||||
<QTd>
|
||||
<span class="link">
|
||||
{{ value }}
|
||||
<CustomerDescriptorProxy :id="row?.clientFk" />
|
||||
|
|
|
@ -49,6 +49,12 @@ route:
|
|||
shipped: Shipped
|
||||
agencyAgreement: Agency agreement
|
||||
agencyModeName: Agency route
|
||||
isOwn: Own
|
||||
isAnyVolumeallowed: Any volume allowed
|
||||
Worker: Worker
|
||||
Agency: Agency
|
||||
Vehicle: Vehicle
|
||||
Description: Description
|
||||
hourStarted: H.Start
|
||||
hourFinished: H.End
|
||||
createRoute: Create route
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue