mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-24 13:40:29 +01:00
Paketmarke autoselect product according to weight
This commit is contained in:
parent
632f1c1a09
commit
56cfc54aa5
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user