diff --git a/src/composables/useValidator.js b/src/composables/useValidator.js
index ef2dcbd90..bc48332a2 100644
--- a/src/composables/useValidator.js
+++ b/src/composables/useValidator.js
@@ -3,15 +3,13 @@ import { useI18n } from 'vue-i18n';
import axios from 'axios';
import validator from 'validator';
-
const models = ref(null);
export function useValidator() {
if (!models.value) fetch();
function fetch() {
- axios.get('Schemas/ModelInfo')
- .then(response => models.value = response.data)
+ axios.get('Schemas/ModelInfo').then((response) => (models.value = response.data));
}
function validate(propertyRule) {
@@ -38,19 +36,18 @@ export function useValidator() {
const { t } = useI18n();
const validations = function (validation) {
-
return {
presence: (value) => {
let message = `Value can't be empty`;
if (validation.message)
- message = t(validation.message) || validation.message
+ message = t(validation.message) || validation.message;
- return !validator.isEmpty(value ? String(value) : '') || message
+ return !validator.isEmpty(value ? String(value) : '') || message;
},
length: (value) => {
const options = {
min: validation.min || validation.is,
- max: validation.max || validation.is
+ max: validation.max || validation.is,
};
value = String(value);
@@ -69,14 +66,14 @@ export function useValidator() {
},
numericality: (value) => {
if (validation.int)
- return validator.isInt(value) || 'Value should be integer'
- return validator.isNumeric(value) || 'Value should be a number'
+ return validator.isInt(value) || 'Value should be integer';
+ return validator.isNumeric(value) || 'Value should be a number';
},
- custom: (value) => validation.bindedFunction(value) || 'Invalid value'
+ custom: (value) => validation.bindedFunction(value) || 'Invalid value',
};
};
return {
- validate
+ validate,
};
-}
\ No newline at end of file
+}
diff --git a/src/css/app.scss b/src/css/app.scss
index 3c8cc50b6..0f04c9ad8 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -32,10 +32,16 @@ body.body--light {
--vn-text: #000000;
--vn-gray: #f5f5f5;
--vn-label: #5f5f5f;
+ --vn-dark: white;
}
body.body--dark {
--vn-text: #ffffff;
--vn-gray: #313131;
--vn-label: #a8a8a8;
+ --vn-dark: #292929;
+}
+
+.bg-vn-dark {
+ background-color: var(--vn-dark);
}
diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js
index 62704bf8c..cfd20716b 100644
--- a/src/i18n/en/index.js
+++ b/src/i18n/en/index.js
@@ -266,6 +266,7 @@ export default {
lines: 'Lines',
rma: 'RMA',
photos: 'Photos',
+ development: 'Development',
log: 'Audit logs',
notes: 'Notes',
},
diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js
index 1cef961db..532c1bb3b 100644
--- a/src/i18n/es/index.js
+++ b/src/i18n/es/index.js
@@ -264,6 +264,7 @@ export default {
basicData: 'Datos básicos',
lines: 'Líneas',
rma: 'RMA',
+ development: 'Trazabilidad',
photos: 'Fotos',
log: 'Registros de auditoría',
notes: 'Notas',
diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue
index 9f1ecc416..03b9889f0 100644
--- a/src/pages/Claim/Card/ClaimCard.vue
+++ b/src/pages/Claim/Card/ClaimCard.vue
@@ -44,17 +44,6 @@ onMounted(async () => {
-
-
-
-
- {{ t('Development') }}
-
{
-
-
+
+
+
+
+
+
+
@@ -80,6 +74,5 @@ es:
You can search by claim id or customer name: Puedes buscar por id de la reclamación o nombre del cliente
Details: Detalles
Notes: Notas
- Development: Trazabilidad
Action: Acción
diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue
index 914de2eb2..af7e84d38 100644
--- a/src/pages/Claim/Card/ClaimDescriptor.vue
+++ b/src/pages/Claim/Card/ClaimDescriptor.vue
@@ -3,6 +3,8 @@ import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toDate } from 'src/filters';
+import { useState } from 'src/composables/useState';
+
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
@@ -19,6 +21,7 @@ const $props = defineProps({
});
const route = useRoute();
+const state = useState();
const { t } = useI18n();
const entityId = computed(() => {
@@ -67,6 +70,7 @@ function stateColor(code) {
const data = ref(useCardDescription());
const setData = (entity) => {
data.value = useCardDescription(entity.client.name, entity.id);
+ state.set('ClaimDescriptor', entity);
};
diff --git a/src/pages/Claim/Card/ClaimDevelopment.vue b/src/pages/Claim/Card/ClaimDevelopment.vue
new file mode 100644
index 000000000..ea4b178b5
--- /dev/null
+++ b/src/pages/Claim/Card/ClaimDevelopment.vue
@@ -0,0 +1,203 @@
+
+
+ (claimReasons = data)"
+ auto-load
+ />
+ (claimResults = data)"
+ auto-load
+ />
+ (claimResponsibles = data)"
+ auto-load
+ />
+ (claimRedeliveries = data)"
+ auto-load
+ />
+ (workers = data)"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+es:
+ Reason: Motivo
+ Result: Consecuencia
+ Responsible: Responsable
+ Worker: Trabajador
+ Redelivery: Devolución
+
diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue
index 9d2a12804..8680ff922 100644
--- a/src/pages/Claim/Card/ClaimLines.vue
+++ b/src/pages/Claim/Card/ClaimLines.vue
@@ -6,9 +6,8 @@ import { useQuasar } from 'quasar';
import { useRoute } from 'vue-router';
import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore';
-import VnPaginate from 'components/ui/VnPaginate.vue';
+import CrudModel from 'components/CrudModel.vue';
import FetchData from 'components/FetchData.vue';
-import VnConfirm from 'components/ui/VnConfirm.vue';
import { toDate, toCurrency, toPercentage } from 'filters/index';
import VnDiscount from 'components/common/vnDiscount.vue';
@@ -17,6 +16,7 @@ import ClaimLinesImport from './ClaimLinesImport.vue';
const quasar = useQuasar();
const route = useRoute();
const { t } = useI18n();
+
const stateStore = useStateStore();
const arrayData = useArrayData('ClaimLines');
const store = arrayData.store;
@@ -36,6 +36,7 @@ const linesFilter = {
},
};
+const claimLinesForm = ref();
const claim = ref(null);
async function onFetchClaim(data) {
claim.value = data;
@@ -46,6 +47,7 @@ async function onFetchClaim(data) {
const amount = ref(0);
const amountClaimed = ref(0);
async function onFetch(rows) {
+ if (!rows || rows.length) return;
amount.value = rows.reduce(
(acumulator, { sale }) => acumulator + sale.price * sale.quantity,
0
@@ -141,47 +143,6 @@ function onUpdateDiscount(response) {
});
}
-async function confirmRemove() {
- const rows = selected.value;
- const count = rows.length;
-
- if (count === 0) {
- return quasar.notify({
- message: 'You must select at least one row',
- type: 'warning',
- });
- }
-
- quasar
- .dialog({
- component: VnConfirm,
- componentProps: {
- title: t('Delete claimed sales'),
- message: t('You are about to remove {count} rows', count, { count }),
- data: { rows },
- promise: remove,
- },
- })
- .onOk(() => {
- for (const row of rows) {
- const orgData = store.data;
- const index = orgData.findIndex((item) => item.id === row.id);
- store.data.splice(index, 1);
- selected.value = [];
- }
- });
-}
-
-async function remove({ rows }) {
- if (!rows.length) return;
- const body = { deletes: rows.map((row) => row.id) };
- await axios.post(`ClaimBeginnings/crud`, body);
- quasar.notify({
- type: 'positive',
- message: t('globals.rowRemoved'),
- });
-}
-
function showImportDialog() {
quasar
.dialog({
@@ -191,10 +152,8 @@ function showImportDialog() {
}
-
+
- {{ t('Claimed lines') }}
-
{{ t('Amount') }}
@@ -211,7 +170,7 @@ function showImportDialog() {
-
+
-
@@ -361,46 +325,12 @@ function showImportDialog() {
-
+
-
-
-
- {{ t('globals.remove') }}
-
-
- {{ t('globals.add') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -421,7 +351,6 @@ en:
You are about to remove {count} row |
You are about to remove {count} rows'
es:
- Claimed lines: Líneas reclamadas
Delivered: Entregado
Quantity: Cantidad
Claimed: Reclamada
diff --git a/src/pages/Claim/Card/ClaimNotes.vue b/src/pages/Claim/Card/ClaimNotes.vue
index 94b53c8a2..84d350e38 100644
--- a/src/pages/Claim/Card/ClaimNotes.vue
+++ b/src/pages/Claim/Card/ClaimNotes.vue
@@ -25,7 +25,7 @@ const body = {
};
-
+
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('globals.add') }}
-
-
-
+
+
diff --git a/src/pages/Claim/Card/ClaimRma.vue b/src/pages/Claim/Card/ClaimRma.vue
index c59c11845..bba901d7b 100644
--- a/src/pages/Claim/Card/ClaimRma.vue
+++ b/src/pages/Claim/Card/ClaimRma.vue
@@ -1,48 +1,34 @@
-
-
+
-
+
@@ -107,7 +88,7 @@ async function remove({ id }) {
{{ t('claim.rma.user') }}
- {{ row.worker.user.name }}
+ {{ row?.worker?.user?.name }}
@@ -133,7 +114,7 @@ async function remove({ id }) {
round
color="orange"
icon="vn:bin"
- @click="confirmRemove(row.id)"
+ @click="claimRmaRef.remove([row])"
>
{{ t('globals.remove') }}
@@ -143,33 +124,11 @@ async function remove({ id }) {
-
+
-
-
-
-
- {{ t('globals.add') }}
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -178,16 +137,6 @@ async function remove({ id }) {
width: 100%;
max-width: 60em;
}
-.q-toolbar {
- background-color: $grey-9;
-}
-.sticky-page {
- padding-top: 66px;
-}
-
-.q-page-sticky {
- z-index: 2998;
-}
diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue
index 3a1c28d18..c833d0cf9 100644
--- a/src/pages/Customer/Card/CustomerCard.vue
+++ b/src/pages/Customer/Card/CustomerCard.vue
@@ -1,11 +1,13 @@
@@ -25,8 +27,13 @@ const { t } = useI18n();
-
-
+
+
+
+
+
+
+
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
index 5cbe72396..d24eb3ef2 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
@@ -25,8 +25,13 @@ const { t } = useI18n();
-
-
+
+
+
+
+
+
+
diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue
index e0ad5054d..91921f827 100644
--- a/src/pages/Ticket/Card/TicketCard.vue
+++ b/src/pages/Ticket/Card/TicketCard.vue
@@ -25,8 +25,13 @@ const { t } = useI18n();
-
-
+
+
+
+
+
+
+
diff --git a/src/pages/Wagon/WagonCreate.vue b/src/pages/Wagon/WagonCreate.vue
index 3f7824975..123e01d36 100644
--- a/src/pages/Wagon/WagonCreate.vue
+++ b/src/pages/Wagon/WagonCreate.vue
@@ -20,7 +20,7 @@ const $props = defineProps({
});
const entityId = computed(() => $props.id || route.params.id);
-let wagonTypes;
+let wagonTypes = [];
let originalData = {};
const wagon = ref({});
const filteredWagonTypes = ref(wagonTypes);
diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue
index 3d6b46e11..972eb52ec 100644
--- a/src/pages/Worker/Card/WorkerCard.vue
+++ b/src/pages/Worker/Card/WorkerCard.vue
@@ -25,8 +25,13 @@ const { t } = useI18n();
-
-
+
+
+
+
+
+
+
diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue
index 05ccdc373..7c8accc5d 100644
--- a/src/pages/Worker/Card/WorkerSummary.vue
+++ b/src/pages/Worker/Card/WorkerSummary.vue
@@ -1,6 +1,5 @@