Paketmarke autoselect product according to weight

This commit is contained in:
OpenXE 2024-03-19 18:10:43 +00:00
parent 632f1c1a09
commit 56cfc54aa5

View File

@ -239,6 +239,9 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
const createshipmentapp = new Vue({
el: '#createshipmentapp',
data: [JSON],
mounted() {
this.autoselectproduct();
},
computed: {
total_value() {
let sum = 0;
@ -287,17 +290,20 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
},
customsRequired: function () {
return this.countries[this.form.country].eu == '0';
},
autoselectproduct: function () {
if (!this.productAvailable(this.products[this.form.product])) {
for (prod in this.products) {
if (!this.productAvailable(this.products[prod]))
continue;
this.form.product = prod;
break;
}
}
}
},
beforeUpdate: function () {
if (!this.productAvailable(this.products[this.form.product])) {
for (prod in this.products) {
if (!this.productAvailable(this.products[prod]))
continue;
this.form.product = prod;
break;
}
}
this.autoselectproduct();
}
})
</script>