mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +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({
|
const createshipmentapp = new Vue({
|
||||||
el: '#createshipmentapp',
|
el: '#createshipmentapp',
|
||||||
data: [JSON],
|
data: [JSON],
|
||||||
|
mounted() {
|
||||||
|
this.autoselectproduct();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
total_value() {
|
total_value() {
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
@ -287,17 +290,20 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
|||||||
},
|
},
|
||||||
customsRequired: function () {
|
customsRequired: function () {
|
||||||
return this.countries[this.form.country].eu == '0';
|
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 () {
|
beforeUpdate: function () {
|
||||||
if (!this.productAvailable(this.products[this.form.product])) {
|
this.autoselectproduct();
|
||||||
for (prod in this.products) {
|
|
||||||
if (!this.productAvailable(this.products[prod]))
|
|
||||||
continue;
|
|
||||||
this.form.product = prod;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user