diff --git a/VNMS_Frontend_Build_08-09-2023.zip b/VNMS_Frontend_Build_21-09-2023.zip similarity index 90% rename from VNMS_Frontend_Build_08-09-2023.zip rename to VNMS_Frontend_Build_21-09-2023.zip index d272168..89969e0 100644 Binary files a/VNMS_Frontend_Build_08-09-2023.zip and b/VNMS_Frontend_Build_21-09-2023.zip differ diff --git a/src/app/pages/order/order-form/order-form.component.html b/src/app/pages/order/order-form/order-form.component.html index 5c6f1f3..157dcc7 100644 --- a/src/app/pages/order/order-form/order-form.component.html +++ b/src/app/pages/order/order-form/order-form.component.html @@ -163,7 +163,7 @@ - {{user.productName }}({{user.skuId }} ) diff --git a/src/app/pages/order/order-form/order-form.component.ts b/src/app/pages/order/order-form/order-form.component.ts index 16072b9..b0e7668 100644 --- a/src/app/pages/order/order-form/order-form.component.ts +++ b/src/app/pages/order/order-form/order-form.component.ts @@ -250,6 +250,8 @@ fieldTitle:any ='New Order' }) } + + getUniqueProducts(products: any[], propertyName: string): any[] { const uniqueProducts = []; const seen = new Set(); @@ -903,6 +905,28 @@ this.onCreateConfirm() // } // }) +} + +checkProductArray() { + console.log(this.inputFieldGroups) + const hasNullId = this.inputFieldGroups.some((group) => group.id === null); +console.log(hasNullId) +if (!hasNullId) { + // There's an object with id = null in the inputFieldGroups array + console.log('There is an object with id = null'); + return this.product; +} else { + // There is no object with id = null in the inputFieldGroups array + // Filter products based on the condition (productName !== 'Mixed Gas' in inputFieldGroups) + const filteredProducts = this.product.filter((product) => { + const isSelected = this.inputFieldGroups.some((group) => group.id === product.id); + return product.productName === 'Mixed Gas' || !isSelected; + }); + + return filteredProducts; +} + + } addInputFieldGroup() {