changed behaviour

This commit is contained in:
TLRZ Seyfferth
2018-01-25 11:29:48 +01:00
parent e379ef8c29
commit cc4201f2b5
6 changed files with 115 additions and 19 deletions
+10 -8
View File
@@ -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;
+8
View File
@@ -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;