diff --git a/src/pages/Ticket/Card/BasicData/BasicDataTable.vue b/src/pages/Ticket/Card/BasicData/BasicDataTable.vue
index ef7d10a46..c14c95a70 100644
--- a/src/pages/Ticket/Card/BasicData/BasicDataTable.vue
+++ b/src/pages/Ticket/Card/BasicData/BasicDataTable.vue
@@ -106,10 +106,7 @@ const totalNewPrice = computed(() => {
});
const totalDifference = computed(() => {
- return rows.value.reduce(
- (acc, item) => acc + item.component.difference * item.quantity,
- 0
- );
+ return rows.value.reduce((acc, item) => acc + item.component.difference, 0);
});
const ticketHaveNegatives = () => {
@@ -225,6 +222,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
:no-data-label="t('globals.noResults')"
+ flat
>
diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
index 678cbdf30..07e7b8043 100644
--- a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
+++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue
@@ -36,10 +36,10 @@ const companiesOptions = ref([]);
const agenciesOptions = ref([]);
const zonesOptions = ref([]);
const addresses = ref([]);
-const _formData = ref($props.formData);
+const formData = ref($props.formData);
watch(
- () => _formData.value,
+ () => formData.value,
(val) => emit('updateForm', val),
{ deep: true }
);
@@ -55,12 +55,12 @@ const agencyByWarehouseFilter = computed(() => ({
const zonesFilter = computed(() => ({
fields: ['id', 'name'],
order: 'name ASC',
- where: _formData.value?.agencyModeFk
+ where: formData.value?.agencyModeFk
? {
- shipped: _formData.value?.shipped,
- addressFk: _formData.value?.addressFk,
- agencyModeFk: _formData.value?.agencyModeFk,
- warehouseFk: _formData.value?.warehouseFk,
+ shipped: formData.value?.shipped,
+ addressFk: formData.value?.addressFk,
+ agencyModeFk: formData.value?.agencyModeFk,
+ warehouseFk: formData.value?.warehouseFk,
}
: {},
}));
@@ -71,13 +71,13 @@ const getLanded = async (params) => {
shipped.value && addressId.value && agencyModeId.value && warehouseId.value;
if (!validParams) return;
- _formData.value.zoneFk = null;
+ formData.value.zoneFk = null;
zonesOptions.value = [];
const { data } = await axios.get(`Agencies/getLanded`, { params });
if (data) {
- _formData.value.zoneFk = data.zoneFk;
- _formData.value.landed = data.landed;
- _formData.value.shipped = params.shipped;
+ formData.value.zoneFk = data.zoneFk;
+ formData.value.landed = data.landed;
+ formData.value.shipped = params.shipped;
}
} catch (error) {
console.error(error);
@@ -91,13 +91,13 @@ const getShipped = async (params) => {
landed.value && addressId.value && agencyModeId.value && warehouseId.value;
if (!validParams) return;
- _formData.value.zoneFk = null;
+ formData.value.zoneFk = null;
zonesOptions.value = [];
const { data } = await axios.get(`Agencies/getShipped`, { params });
if (data) {
- _formData.value.zoneFk = data.zoneFk;
- _formData.value.landed = params.landed;
- _formData.value.shipped = data.shipped;
+ formData.value.zoneFk = data.zoneFk;
+ formData.value.landed = params.landed;
+ formData.value.shipped = data.shipped;
} else {
notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
}
@@ -109,9 +109,9 @@ const getShipped = async (params) => {
const onChangeZone = async (zoneId) => {
try {
- _formData.value.agencyModeFk = null;
+ formData.value.agencyModeFk = null;
const { data } = await axios.get(`Zones/${zoneId}`);
- _formData.value.agencyModeFk = data.agencyModeFk;
+ formData.value.agencyModeFk = data.agencyModeFk;
} catch (error) {
console.error(error);
}
@@ -119,9 +119,9 @@ const onChangeZone = async (zoneId) => {
const onChangeAddress = async (addressId) => {
try {
- _formData.value.nickname = null;
+ formData.value.nickname = null;
const { data } = await axios.get(`Addresses/${addressId}`);
- _formData.value.nickname = data.nickname;
+ formData.value.nickname = data.nickname;
} catch (error) {
console.error(error);
}
@@ -159,26 +159,26 @@ const clientAddressesList = async (value) => {
};
const addressId = computed({
- get: () => _formData.value?.addressFk,
+ get: () => formData.value?.addressFk,
set: (val) => {
- if (val != _formData.value?.addressFk) {
- _formData.value.addressFk = val;
+ if (val != formData.value?.addressFk) {
+ formData.value.addressFk = val;
onChangeAddress(val);
getShipped({
- landed: _formData.value?.landed,
+ landed: formData.value?.landed,
addressFk: val,
- agencyModeFk: _formData.value?.agencyModeFk,
- warehouseFk: _formData.value?.warehouseFk,
+ agencyModeFk: formData.value?.agencyModeFk,
+ warehouseFk: formData.value?.warehouseFk,
});
}
},
});
const clientId = computed({
- get: () => _formData.value?.clientFk,
+ get: () => formData.value?.clientFk,
set: (val) => {
- _formData.value.clientFk = val;
- _formData.value.addressFk = null;
+ formData.value.clientFk = val;
+ formData.value.addressFk = null;
if (!val) return;
getClientDefaultAddress(val);
clientAddressesList(val);
@@ -186,81 +186,81 @@ const clientId = computed({
});
const landed = computed({
- get: () => _formData.value?.landed,
+ get: () => formData.value?.landed,
set: (val) => {
- _formData.value.landed = val;
+ formData.value.landed = val;
getShipped({
landed: val,
- addressFk: _formData.value?.addressFk,
- agencyModeFk: _formData.value?.agencyModeFk,
- warehouseFk: _formData.value?.warehouseFk,
+ addressFk: formData.value?.addressFk,
+ agencyModeFk: formData.value?.agencyModeFk,
+ warehouseFk: formData.value?.warehouseFk,
});
},
});
const agencyModeId = computed({
- get: () => _formData.value.agencyModeFk,
+ get: () => formData.value.agencyModeFk,
set: (val) => {
- if (val != _formData.value.agencyModeFk) {
- _formData.value.agencyModeFk = val;
+ if (val != formData.value.agencyModeFk) {
+ formData.value.agencyModeFk = val;
if (!val) return;
const agencyMode = agenciesOptions.value.find((a) => a.id == val);
- _formData.value.warehouseFk = agencyMode.warehouseFk;
+ formData.value.warehouseFk = agencyMode.warehouseFk;
getLanded({
- shipped: _formData.value?.shipped,
- addressFk: _formData.value?.addressFk,
+ shipped: formData.value?.shipped,
+ addressFk: formData.value?.addressFk,
agencyModeFk: val,
- warehouseFk: _formData.value?.warehouseFk,
+ warehouseFk: formData.value?.warehouseFk,
});
}
},
});
const zoneId = computed({
- get: () => _formData.value?.zoneFk,
+ get: () => formData.value?.zoneFk,
set: (val) => {
- if (val != _formData.value?.zoneFk) {
- _formData.value.zoneFk = val;
+ if (val != formData.value?.zoneFk) {
+ formData.value.zoneFk = val;
onChangeZone(val);
}
},
});
const warehouseId = computed({
- get: () => _formData.value?.warehouseFk,
+ get: () => formData.value?.warehouseFk,
set: (val) => {
- if (val != _formData.value?.warehouseFk) {
- _formData.value.warehouseFk = val;
+ if (val != formData.value?.warehouseFk) {
+ formData.value.warehouseFk = val;
getShipped({
- landed: _formData.value?.landed,
- addressFk: _formData.value?.addressFk,
- agencyModeFk: _formData.value?.agencyModeFk,
+ landed: formData.value?.landed,
+ addressFk: formData.value?.addressFk,
+ agencyModeFk: formData.value?.agencyModeFk,
warehouseFk: val,
}).then(() => {
- if (zoneId.value == null) _formData.value.agencyModeFk = null;
+ if (zoneId.value == null) formData.value.agencyModeFk = null;
});
}
},
});
const shipped = computed({
- get: () => _formData.value?.shipped,
+ get: () => formData.value?.shipped,
set: (val) => {
- if (new Date(_formData.value?.shipped).toDateString() != val.toDateString())
+ if (new Date(formData.value?.shipped).toDateString() != val.toDateString())
val.setHours(0, 0, 0, 0);
- _formData.value.shipped = val;
+ formData.value.shipped = val;
getLanded({
shipped: val,
- addressFk: _formData.value?.addressFk,
- agencyModeFk: _formData.value?.agencyModeFk,
- warehouseFk: _formData.value?.warehouseFk,
+ addressFk: formData.value?.addressFk,
+ agencyModeFk: formData.value?.agencyModeFk,
+ warehouseFk: formData.value?.warehouseFk,
});
},
});
const onFormModelInit = () => {
- if (_formData.value?.clientFk) clientAddressesList(_formData.value?.clientFk);
+ if (formData.value?.clientFk) clientAddressesList(formData.value?.clientFk);
};
const redirectToCustomerAddress = () => {
@@ -396,12 +396,12 @@ onMounted(() => onFormModelInit());
-
+
onFormModelInit());
-
+