Fixed page layout and edit delivery

This commit is contained in:
2025-09-06 09:44:01 -04:00
parent 45b536baca
commit 9d86b4a60e
8 changed files with 120 additions and 82 deletions

View File

@@ -413,8 +413,8 @@ export default defineComponent({
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
this.deliveryOrder = response.data
if (response.data && response.data.ok) {
this.deliveryOrder = response.data.delivery
this.getCustomer(this.deliveryOrder.customer_id)
if (this.deliveryOrder.payment_type === 1) {
@@ -427,14 +427,15 @@ export default defineComponent({
this.getPaymentCard(this.deliveryOrder.payment_card_id);
}
this.FinalizeOilOrderForm.cash_recieved = response.data.cash_recieved;
this.FinalizeOilOrderForm.check_number = response.data.check_number;
this.FinalizeOilOrderForm.credit_card_id = response.data.payment_card_id;
this.FinalizeOilOrderForm.cash_recieved = response.data.delivery.cash_recieved;
this.FinalizeOilOrderForm.check_number = response.data.delivery.check_number;
this.FinalizeOilOrderForm.credit_card_id = response.data.delivery.payment_card_id;
if (response.data.customer_filled == 1) {
if (response.data.delivery.customer_filled == 1) {
this.FinalizeOilOrderForm.customer_filled = true
}
} else {
console.error("API Error:", response.data.error || "Failed to fetch delivery data.");
}
})
},
@@ -698,4 +699,4 @@ export default defineComponent({
})
</script>
<style scoped></style>
<style scoped></style>

View File

@@ -397,13 +397,17 @@ export default defineComponent({
withCredentials: true,
})
.then((response: any) => {
this.delivery = response.data;
this.getCustomer(this.delivery.customer_id)
this.getCreditCards(this.delivery.customer_id)
if (this.delivery.promo_id != null) {
this.getPromo(this.delivery.promo_id);
this.promo_active = true;
}
if (response.data && response.data.ok) {
this.delivery = response.data.delivery;
this.getCustomer(this.delivery.customer_id)
this.getCreditCards(this.delivery.customer_id)
if (this.delivery.promo_id != null) {
this.getPromo(this.delivery.promo_id);
this.promo_active = true;
}
} else {
console.error("API Error:", response.data.error || "Failed to fetch delivery data.");
}
})
.catch(() => {
notify({
@@ -489,4 +493,4 @@ export default defineComponent({
})
</script>
<style scoped></style>
<style scoped></style>

View File

@@ -5,19 +5,19 @@ import Ticket from "../ticket/ticket.vue";
import TicketAuto from "../ticket/ticketauto.vue";
const payRoutes = [
const ticketRoutes = [
{
path: '/ticket/:id',
path: ':id',
name: 'Ticket',
component: Ticket,
},
{
path: '/ticket/auto/:id',
path: 'auto/:id',
name: 'TicketAuto',
component: TicketAuto,
},
]
export default payRoutes
export default ticketRoutes
//sourceMappingURL=index.ts.map

View File

@@ -285,14 +285,17 @@ export default defineComponent({
withCredentials: true,
})
.then((response: any) => {
this.delivery = response.data;
this.getCustomer(this.delivery.customer_id)
if (this.delivery.promo_id != null) {
this.getPromo(this.delivery.promo_id);
this.promo_active = true;
this.getPrice(delivery_id)
if (response.data && response.data.ok) {
this.delivery = response.data.delivery;
this.getCustomer(this.delivery.customer_id)
if (this.delivery.promo_id != null) {
this.getPromo(this.delivery.promo_id);
this.promo_active = true;
this.getPrice(delivery_id)
}
} else {
console.error("API Error:", response.data.error || "Failed to fetch delivery data.");
}
})
.catch(() => {
notify({