DATOS DE CARGA
@@ -572,7 +572,7 @@
.calculator-card__subtitle {
// background-color: #50b1e5;
background-color: #FBBA33;
- padding: 10px 20px;
+ padding: 8px 20px;
color: #FFF;
text-align: center;
font-size: 1.2rem;
@@ -580,7 +580,7 @@
}
.calculator-card__loads_data {
- padding: 24px 24px;
+ padding: 20px 24px;
}
.calculator-card__totals {
diff --git a/src/components/LoadDetailModal.vue b/src/components/LoadDetailModal.vue
new file mode 100644
index 0000000..b9bdb96
--- /dev/null
+++ b/src/components/LoadDetailModal.vue
@@ -0,0 +1,188 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/MakeProposalModal.vue b/src/components/MakeProposalModal.vue
index d7142e6..1850bc7 100644
--- a/src/components/MakeProposalModal.vue
+++ b/src/components/MakeProposalModal.vue
@@ -1,11 +1,12 @@
@@ -117,7 +151,7 @@
{
console.log(error);
return null;
}
+}
+
+export const updateProposal = async(id, formData) => {
+ try {
+ const endpoint = `/proposals/${id}`;
+ const {data} = await api.patch(endpoint, formData);
+ return data;
+ } catch (error) {
+ console.log(error);
+ return null;
+ }
}
\ No newline at end of file
diff --git a/src/stores/company.js b/src/stores/company.js
index 7dbabbf..22b22e9 100644
--- a/src/stores/company.js
+++ b/src/stores/company.js
@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
import { ref } from "vue";
import { getBudgets, getCompany, updateBudget, updateCompany, deleteBudget, createBudget, getUsers, updateUser, createUser, deleteUser, getLocations, createLocation, updateLocation, deleteLocation } from "../services/company";
import api from "../lib/axios";
+import { saveProposal, updateProposal } from "../services/vehicles";
export const useCompanyStore = defineStore('company', () => {
@@ -123,6 +124,32 @@ export const useCompanyStore = defineStore('company', () => {
}
}
+ const createPropsal = async(formData) => {
+ const data = await saveProposal(formData);
+ console.log(data);
+ if(data) {
+ return 'success';
+ } else {
+ return 'Algo salio mal, intente más tarde';
+ }
+ }
+
+ const updatePropsalLoad = async(id, formData, localData) => {
+ const data = await updateProposal(id, formData);
+ if(data) {
+ console.log(data);
+ const index = proposals.value.findIndex((prop) => prop._id === id);
+ proposals.value[index] = {
+ ...proposals.value[index],
+ ...data,
+ ...localData
+ };
+ return 'success';
+ } else {
+ return 'Algo salio mal, intente más tarde';
+ }
+ }
+
const getBudgetsCompany = async(filterQuery, reload = false) => {
let filterArr = Object.values(filterQuery);
@@ -261,6 +288,8 @@ export const useCompanyStore = defineStore('company', () => {
return {
getCompanyData,
getProposalsCompany,
+ createPropsal,
+ updatePropsalLoad,
getBudgetsCompany,
getUsersCompany,
createUserCompany,
diff --git a/src/views/SearchLoadsView.vue b/src/views/SearchLoadsView.vue
index 1ae0811..a0baf23 100644
--- a/src/views/SearchLoadsView.vue
+++ b/src/views/SearchLoadsView.vue
@@ -168,7 +168,7 @@
v-if="loads.length > 0"
v-for="load in loads"
:load="load"
- :read-only="true"
+ :read-only="false"
@set-load="handleSetCurrentLoad(load)"
/>
{
getInitData();
@@ -16,17 +21,45 @@
await companyStore.getProposalsCompany();
loading.value = false;
}
+
+ const handleSetCurrentProposal = (data) => {
+ if(data.modal === 'detail') {
+ openModal.value = true;
+ } else {
+ openModalProposal.value = true;
+ }
+ proposalCurrent.value = data.proposal;
+ }
+
+ const handleResetCurrentProposal = () => {
+ openModal.value = false;
+ openModalProposal.value = false;
+ proposalCurrent.value = null;
+ console.log('clear proposal');
+ }
+
+
-
Mis vehiculos publicadas
+ Mis ofertas aceptadas