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