Updated auto

This commit is contained in:
2024-07-24 17:24:40 -04:00
parent 74fcd282db
commit 47e57f5758
3 changed files with 123 additions and 31 deletions

View File

@@ -632,8 +632,46 @@ export default defineComponent({
}
})
},
UpdateAuto(payload: {
gallons: string,
delivery_id: string,
}) {
let path = import.meta.env.VITE_AUTO_URL + "/delivery/add/delivery"
axios({
method: "put",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
notify({
text: 'Update',
type: 'postive',
title: 'top'
})
}
else {
notify({
text: 'Auto Failure',
type: 'negative',
title: 'Update'
})
}
})
},
onSubmit() {
if (this.deliveryOrder.automatic == 1){
let auto_payload = {
gallons: this.CreateOilOrderForm.basicInfo.gallons_delivered,
delivery_id: this.deliveryOrder.id
}
this.UpdateAuto(auto_payload);
}
let payload = {
gallons_delivered: this.CreateOilOrderForm.basicInfo.gallons_delivered,
prime: this.CreateOilOrderForm.basicInfo.prime,