diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index 850d3cf9..d6b00c3f 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -83,23 +83,22 @@
-
-
- {{ item.parentProductName }} - -
- -
- -
+
+ {{ getParentInformation(id, ordersList.items).parentProductName }} - - - - - -
+
+ +
+
+ + + + + + +
+
@@ -316,15 +315,9 @@ export default defineComponent({ }) return popover.present(); }, - selectOnlyParentProduct(id: any){ - this.ordersList.items.forEach((item: any) => { - item.isSelected = !item.parentProductId === id; - }) - }, isParentProductChecked(parentProductId: string) { - return !(this as any).ordersList.items.filter((item: any) => item.parentProductId === parentProductId).some((item: any) => { - return !item.isSelected - }) + const items = (this as any).ordersList.items.filter((item: any) => item.parentProductId === parentProductId) + return items.every((item: any) => item.isSelected) }, selectProduct(item: any, event: any) { item.isSelected = event.detail.checked; @@ -352,6 +345,9 @@ export default defineComponent({ getGroupItems(parentProductId: any, items: any) { return items.filter((item: any) => item.parentProductId == parentProductId) }, + getParentInformation(id: any, items: any) { + return items.find((item: any) => item.parentProductId == id) + }, selectAllItems() { this.ordersList.items.forEach((item: any) => { item.isSelected = true; @@ -360,7 +356,7 @@ export default defineComponent({ selectParentProduct(parentProductId: any, event: any) { this.ordersList.items.forEach((item: any) => { if (item.parentProductId == parentProductId) { - item.isSelected = event.detail.checked; + item.isSelected = event.detail.checked; } }) }