Updated auto
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user