update container select packing list

This commit is contained in:
edmondlang
2022-04-05 19:05:57 +08:00
parent 8c35601ccd
commit 5aa93b30c7
2 changed files with 15 additions and 5 deletions
@@ -28,10 +28,11 @@
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
data(){
return {
selected: false,
}
props: {
selectedPackageList: {
type: Array,
required: false,
}
},
methods: {
activate(){
@@ -45,6 +46,15 @@
},
noPackage() {
return ( this.item.packages.reduce((total, obj) => 1 + total, 0));
},
selected() {
var response = false;
this.selectedPackageList.forEach((value, index) => {
if (value.id == this.item.id) {
response = true;
}
});
return response;
}
},
mixins: [componentHandler]
@@ -455,7 +455,7 @@
</div>
<div class="row" v-for="packingList in container.packing_lists">
<div class="col">
<list-packagelist-form-component :data="packingList" v-on:input="updateList($event)"></list-packagelist-form-component>
<list-packagelist-form-component :data="packingList" :selectedPackageList="selectedPackageList" v-on:input="updateList($event)"></list-packagelist-form-component>
</div>
</div>
</div>