changed behaviour
This commit is contained in:
@@ -9,13 +9,6 @@ Vue.filter('number', function(number, precision = 2){
|
||||
var app = new Vue({
|
||||
el: "#app",
|
||||
data : {
|
||||
dimensions: [
|
||||
'l',
|
||||
'Stk.',
|
||||
'Gl.',
|
||||
'Fl.',
|
||||
'T.',
|
||||
],
|
||||
articles : [],
|
||||
inventory : {
|
||||
ug : [],
|
||||
@@ -70,13 +63,22 @@ var app = new Vue({
|
||||
ia = new InventoryArticle();
|
||||
ia.article = a;
|
||||
this.inventory.ug.push(ia);
|
||||
this.bon.push({count: 0, name: a.name, price: a.portion.price});
|
||||
this.bon.push({count: 0, name: a.name, short: a.short, price: a.portion.price});
|
||||
});
|
||||
}).then( x => {
|
||||
M.updateTextFields();
|
||||
this.ready = true;
|
||||
});
|
||||
},
|
||||
resetInventur: function() {
|
||||
|
||||
},
|
||||
exportInventur: function() {
|
||||
this.$http.post('./backend?controller=Inventur&action=export', JSON.stringify(this.inventory.ug))
|
||||
.then(response => {
|
||||
M.toast({html: response.body});
|
||||
})
|
||||
},
|
||||
resetBon: function(article) {
|
||||
this.bon.forEach(function (item){
|
||||
item.count = 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
function Article() {
|
||||
this.name = "";
|
||||
this.short = "";
|
||||
this.dimension = "";
|
||||
this.content = {
|
||||
size : 0,
|
||||
@@ -19,6 +20,12 @@ Article.prototype = {
|
||||
set Name(value) {
|
||||
this.name = value;
|
||||
},
|
||||
get Short() {
|
||||
return this.short;
|
||||
},
|
||||
set Short(value) {
|
||||
this.short = value;
|
||||
},
|
||||
get ContentSize() {
|
||||
return this.content.size;
|
||||
},
|
||||
@@ -61,6 +68,7 @@ Article.thaw = function (json) {
|
||||
var article = new Article();
|
||||
article.id = json.id;
|
||||
article.Name = json.name;
|
||||
article.Short = json.short;
|
||||
article.Dimension = json.dimension;
|
||||
article.ContentSize = json.content.size;
|
||||
article.PortionPrice = json.portion.price;
|
||||
|
||||
Reference in New Issue
Block a user