@@ -63,6 +63,14 @@ Vue.component('product-unit-price', { | |||
}, | |||
supplierTaxRate: function () { | |||
//this.setBuyingPriceWithTax(); | |||
}, | |||
activeProducts:function () { | |||
this.$parent.updateActiveProducts(); | |||
}, | |||
behaviorPrice:function () { | |||
if(this.behaviorPrice == 'by-reference-unit'){ | |||
this.quantity = 1; | |||
} | |||
} | |||
} | |||
}); | |||
@@ -144,7 +152,6 @@ Vue.component('product-form', { | |||
availableQuantityDefault: null, | |||
availableQuantity: null, | |||
propertyExpirationDate: null, | |||
titleInherited: false, | |||
priceInherited: false, | |||
priceWithTaxInherited: false, | |||
@@ -248,6 +255,7 @@ appProductFamily = new Vue({ | |||
propertyAllergens: null, | |||
propertyOrganicLabelActive: false, | |||
propertyNoveltyExpirationDateActive: false, | |||
activeProducts:false, | |||
formProductArray: [], | |||
currentSection: 'price', | |||
@@ -317,10 +325,8 @@ appProductFamily = new Vue({ | |||
return this.$refs.productUnitPrice.unitReference; | |||
} | |||
}, | |||
isProductsActice: function () { | |||
if (typeof this.$refs.productUnitPrice !== 'undefined') { | |||
return this.$refs.productUnitPrice.activeProducts; | |||
} | |||
updateActiveProducts: function () { | |||
this.activeProducts = this.$refs.productUnitPrice.activeProducts; | |||
}, | |||
getBehaviorPrice: function () { | |||
if (typeof this.$refs.productUnitPrice !== 'undefined') { |
@@ -8,7 +8,7 @@ | |||
<ul class="nav nav-tabs" id="nav-params"> | |||
<li class="nav-item" v-for="section in sectionsArray"> | |||
<button type="button" | |||
v-if="(section.name == 'products' && isProductsActice() == true) || (section.name != 'products')" | |||
v-if="(section.name == 'products' && activeProducts == true) || (section.name != 'products')" | |||
:class="'btn '+((currentSection == section.name) ? 'btn btn-primary' : 'btn ')" | |||
@click="changeSection(section)"> | |||
${ section.nameDisplay } | |||
@@ -42,6 +42,8 @@ | |||
{% if formValues.typeExpirationDate %}typeExpirationDate: "{{ formValues.typeExpirationDate }}",{% endif %} | |||
{% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %} | |||
{% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate|date('d/m/Y') }}",{% endif %} | |||
{% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %} | |||
}; | |||
multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}" | |||
window.productUnitPriceValues = { |
@@ -44,7 +44,7 @@ | |||
{{ form_row(form.unit, {"attr":{'v-model': 'unit', '@change': "unitUpdated"}}) }} | |||
</div> | |||
<div class="col-6"> | |||
<div class="col-6" v-show="behaviorPrice=='by-piece'"> | |||
<div class="form-group field-weight"> | |||
{{ form_label(form.quantity) }} | |||
<div class="form-widget"> |
@@ -9,7 +9,7 @@ | |||
{{ form_label(form.behaviorCountStock) }} | |||
{% for field in form.behaviorCountStock %} | |||
{% if field.vars.value == "by-product" %} | |||
<div v-if="isProductsActice() == true"> | |||
<div v-if="activeProducts == true"> | |||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | |||
</div> | |||
{% else %} |