|
|
@@ -4,7 +4,7 @@ var staticRenderFns = []; |
|
|
|
|
|
|
|
Vue.component('product-unit-price', { |
|
|
|
mixins: [mixinUnit, mixinPrice, mixinTemplate], |
|
|
|
props: ['template', 'keyForm'], |
|
|
|
props: ['template', 'key'], |
|
|
|
data() { |
|
|
|
return Object.assign({ |
|
|
|
behaviorPrice: 'by-piece', |
|
|
@@ -101,7 +101,7 @@ Vue.component('product-unit-price', { |
|
|
|
|
|
|
|
Vue.component('product-form', { |
|
|
|
mixins: [mixinUnit, mixinPrice, mixinTemplate], |
|
|
|
props: ['template', 'keyForm', 'productFamily'], |
|
|
|
props: ['template', 'keyForm','productFamily'], |
|
|
|
computed: { |
|
|
|
taxRateValue: function () { |
|
|
|
return this.productFamily.taxRateValue; |
|
|
@@ -165,6 +165,7 @@ Vue.component('product-form', { |
|
|
|
return Object.assign( |
|
|
|
{ |
|
|
|
title: null, |
|
|
|
position: 0, |
|
|
|
fieldToUpdate: ['title', 'unit', 'quantity', 'price'], |
|
|
|
price: null, |
|
|
|
priceWithTax: null, |
|
|
@@ -193,8 +194,6 @@ Vue.component('product-form', { |
|
|
|
}, window.productForm[this.keyForm]) |
|
|
|
}, |
|
|
|
mounted: function () { |
|
|
|
log(this.keyForm); |
|
|
|
|
|
|
|
//INIT VAR |
|
|
|
updateSortableProducts(); |
|
|
|
//this.setUnitSelect2(); |
|
|
@@ -240,7 +239,7 @@ Vue.component('product-form', { |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.init(); |
|
|
|
|
|
|
|
//METHOD |
|
|
|
//this.updateProductForm(); |
|
|
@@ -277,23 +276,16 @@ Vue.component('product-form', { |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
saveProductForm: function () { |
|
|
|
$('#form-product-modal-' + this.keyForm).modal('hide'); |
|
|
|
$('#form-product-modal-' + this.key).modal('hide'); |
|
|
|
}, |
|
|
|
deleteProductForm: function () { |
|
|
|
if (confirm('Êtes-vous sur de cette action ?')) { |
|
|
|
log(this.keyForm); |
|
|
|
log(this.$parent.formProductArray); |
|
|
|
//this.$parent.formProductArray.splice(this.keyForm, 1); |
|
|
|
//this.$delete(this.$parent.formProductArray, this.keyForm) |
|
|
|
var niche = arrayRemove(this.$parent.formProductArray, this.$parent.formProductArray[this.keyForm]); |
|
|
|
this.$parent.formProductArray = niche; |
|
|
|
|
|
|
|
|
|
|
|
this.$delete(this.$parent.formProductArray, this.keyForm) |
|
|
|
} |
|
|
|
}, |
|
|
|
modalProductForm: function () { |
|
|
|
|
|
|
|
$('#modal-extends-product-'+this.keyForm).modal('show') |
|
|
|
$('#modal-extends-product-'+this.key).modal('show') |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: {} |
|
|
@@ -388,7 +380,8 @@ appProductFamily = new Vue({ |
|
|
|
propertyNoveltyExpirationDateActive: false, |
|
|
|
activeProducts: false, |
|
|
|
|
|
|
|
formProductArray: [], |
|
|
|
formProductArray: {}, |
|
|
|
formProductKey: [], |
|
|
|
currentSection: 'general', |
|
|
|
sectionsArray: [ |
|
|
|
{ |
|
|
@@ -445,7 +438,7 @@ appProductFamily = new Vue({ |
|
|
|
var prototype = $collectionHolder.data('prototype'); |
|
|
|
var newForm = prototype; |
|
|
|
newForm = newForm.replace(/__name__/g, this.indexFormProduct); |
|
|
|
this.formProductArray.push(newForm); |
|
|
|
this.formProductArray[this.indexFormProduct] = newForm; |
|
|
|
this.indexFormProduct++; |
|
|
|
|
|
|
|
//updateSortableProducts(); |
|
|
@@ -492,9 +485,8 @@ $(window).bind('beforeunload', function(e){ |
|
|
|
$(window).on('load', function () { |
|
|
|
for (var key in formProductTemplate) { |
|
|
|
log(key); |
|
|
|
//log(formProductTemplate[key]); |
|
|
|
|
|
|
|
appProductFamily.formProductArray[key] = formProductTemplate[key]; |
|
|
|
appProductFamily.formProductKey[key] =key; |
|
|
|
appProductFamily.indexFormProduct++; |
|
|
|
} |
|
|
|
}); |