( async function(){
Vue.prototype.$types = window.ctp.types;
Vue.component('item-rows', {
props: ['index', 'item'],
template: `
|
{{item.sku}}
|
|
{{item.expectedProductionQuantity}}
|
`
});
Vue.component('cut-piece', {
props: ['index', 'piece', 'pIndex'],
methods: {
removePiece: function (e) {
e.preventDefault();
this.$emit('piece-remove', this.index)
}
},
template: `
`
});
Vue.component('job-card-details',{
props:[ 'jobCard' ],
template : `
Item |
Item Sku/Title |
Cut Pieces |
Expected Production |
`
});
let app = new Vue({
el : '#receiveInvApp',
data :{
jobCard : {}
},
computed: {
getStatus: function() {
return `badge-${this.jobCard.status}`;
},
getInvStatus: function() {
return `badge-${this.jobCard.inventoryStatus}`;
}
},
methods : {
onCardSelect : function ( id, card ) {
$.ajax({
url: `/ctp/rest/job-cards/find/${id}`,
method: 'GET',
contentType: 'application/json',
dataType: 'json',
success: ( data ) => {
this.jobCard = data;
},
error : function ( err ){
alert( err );
}
})
}
},
mounted : function () {
}
})
})(jQuery);