mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
123 lines
5.4 KiB
Vue
123 lines
5.4 KiB
Vue
<template>
|
|
<div class="inline">
|
|
<div class="btn btn-sm btn-success b-rad-none requestModal p-t-10 p-b-10" data-type="receiveNote">Warehouse Received</div>
|
|
<modal-component type="receiveNote">
|
|
<notification-component ref="notification"></notification-component>
|
|
<loading-component style="left: 0;" v-show="isLoading"></loading-component>
|
|
<div class="card card-default no-border">
|
|
<div class="card-block no-padding">
|
|
<div class="row p-t-30">
|
|
<div class="col no-padding">
|
|
<div class="b-l b-success p-l-15 m-b-15" style="border-left-width: 3px;">
|
|
<h6 class="bold all-caps no-margin text-success">Warehouse Received</h6>
|
|
<div class="muted all-caps fs-12">Order Receive Note</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<form method="post" class="receiveForm">
|
|
<div class="row">
|
|
<div class="col no-padding">
|
|
<div class="form-group form-group-default input-group">
|
|
<div class="row w-100">
|
|
<div class="col no-padding">
|
|
<label class="muted block">Tracking Number</label>
|
|
<input class="form-control block" name="tracking_number" v-model="receiveNote.tracking_number">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group form-group-default input-group" style=" overflow: visible; ">
|
|
<div class="form-input-group">
|
|
<label>Date Received</label>
|
|
<date-picker-component v-model="complete_date" :value="complete_date" name="complete_date"></date-picker-component>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col text-right no-padding">
|
|
<div class="row">
|
|
<div class="col no-padding">
|
|
<button class="btn b-rad-none btn-default" data-dismiss="modal">Cancel</button>
|
|
<button type="button" @click="createReceiveNote()" data-dismiss="modal" class="btn b-rad-none btn-success">Confirm</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</modal-component>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
'data': {
|
|
required: true
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
receiveNote: {
|
|
type: 0,
|
|
tracking_number: '',
|
|
},
|
|
complete_date: null,
|
|
showCompleteDate: false,
|
|
isLoading: false
|
|
}
|
|
},
|
|
mounted: function() {
|
|
$(this.$el).find('.receiveForm').validate({
|
|
rules: {
|
|
tracking_number: "required",
|
|
complete_date: "required"
|
|
},
|
|
errorPlacement: function ( error, element ) {
|
|
|
|
if(element.parents('.form-group').hasClass('form-group')){
|
|
error.insertAfter( element.parents('.form-group') );
|
|
} else {
|
|
error.insertAfter( element );
|
|
}
|
|
|
|
},
|
|
highlight: function(element) {
|
|
$(element).parents(".form-group").addClass('has-error');
|
|
},
|
|
unhighlight: function(element) {
|
|
$(element).parents(".form-group").removeClass('has-error')
|
|
}
|
|
});
|
|
},
|
|
methods: {
|
|
createReceiveNote() {
|
|
if($(this.$el).find('.receiveForm').valid()) {
|
|
|
|
//turn on loading animation
|
|
this.isLoading = true;
|
|
|
|
fetch(route('api.order.attachment.tracking.update', {orderId: this.data}), {
|
|
method: 'post',
|
|
body: JSON.stringify(this.receiveNote),
|
|
headers: {
|
|
'content-type': 'application/json'
|
|
}
|
|
}).then(() => {
|
|
this.$emit('updateStep', {'complete_date': this.complete_date, 'type': 'WAREHOUSE_RECEIVE'});
|
|
this.clearForm();
|
|
|
|
//turn off loading animation
|
|
this.isLoading = false;
|
|
});
|
|
}
|
|
},
|
|
clearForm(){
|
|
this.receiveNote.tracking_number = '';
|
|
this.complete_date = null;
|
|
}
|
|
}
|
|
}
|
|
</script> |