Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!this.$route.params.id) {
- result = await Scheduling.create(this.scheduling)
- }
- if(result.status == 200) {
- let existingAlocation = await Alocations.detail(this.selectedAlocation.Id);
- existingAlocation.TotalSisaQuantity = parseInt(existingAlocation.TotalQuantity) - parseInt(this.scheduling.AlocatedProductQuantity)
- existingAlocation.SisaQuantity100 = parseInt(existingAlocation.SisaQuantity100) - parseInt(this.scheduling.Quantity100)
- existingAlocation.SisaQuantity90 = parseInt(existingAlocation.SisaQuantity90) - parseInt(this.scheduling.Quantity90)
- existingAlocation.SisaQuantity60 = parseInt(existingAlocation.SisaQuantity60) - parseInt(this.scheduling.Quantity60)
- existingAlocation.SisaQuantity30 = parseInt(existingAlocation.SisaQuantity30) - parseInt(this.scheduling.Quantity30)
- let alocation = await Alocations.edit(this.selectedAlocation.Id, existingAlocation);
- if(alocation.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Sukses Simpan Sisa ke Alokasi',
- icon: 'info',
- showConfirmButton: false
- })
- }
- this.$fire({
- title: 'Sukses',
- text: 'Input Data Sukses',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'DeliveryScheduleManagement.index' })
- location.reload()
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement