diff --git a/src/components/RuleItem.vue b/src/components/RuleItem.vue index d9f54444..c1d53a8d 100644 --- a/src/components/RuleItem.vue +++ b/src/components/RuleItem.vue @@ -48,13 +48,13 @@ {{ translate("Facilities") }} - + - {{ getRuleConditions("ENTCT_ATP_FAC_GROUPS", "facilityGroupId", "contains") }} + {{ getRuleConditions("ENTCT_ATP_FAC_GROUPS", "facilityGroupId", "in") }} - + - {{ getRuleConditions("ENTCT_ATP_FAC_GROUPS", "facilityGroupId", "not-contains") }} + {{ getRuleConditions("ENTCT_ATP_FAC_GROUPS", "facilityGroupId", "not-in") }} diff --git a/src/utils/index.ts b/src/utils/index.ts index de1654a9..57dae48a 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -109,7 +109,7 @@ const generateRuleConditions = (ruleId: string, conditionTypeEnumId: string, app "ruleId": ruleId, conditionTypeEnumId, "fieldName": conditionTypeEnumId === "ENTCT_ATP_FACILITIES" ? "facilityId" : "facilityGroupId", - "operator": "contains", + "operator": "in", "fieldValue": "ALL" }) } else if(conditionTypeEnumId === "ENTCT_ATP_FACILITIES") { @@ -117,7 +117,7 @@ const generateRuleConditions = (ruleId: string, conditionTypeEnumId: string, app "ruleId": ruleId, conditionTypeEnumId, "fieldName": "facilityId", - "operator": "contains", + "operator": "in", "fieldValue": selectedFac.length ? selectedFac.join(",") : "" }) } else { @@ -127,7 +127,7 @@ const generateRuleConditions = (ruleId: string, conditionTypeEnumId: string, app "ruleId": ruleId, "conditionTypeEnumId": "ENTCT_ATP_FAC_GROUPS", "fieldName": "facilityGroupId", - "operator": "contains", + "operator": "in", "fieldValue": includedFacilityGroupIds.join(",") }) } @@ -138,7 +138,7 @@ const generateRuleConditions = (ruleId: string, conditionTypeEnumId: string, app "ruleId": ruleId, "conditionTypeEnumId": "ENTCT_ATP_FAC_GROUPS", "fieldName": "facilityGroupId", - "operator": "not-contains", + "operator": "not-in", "fieldValue": excludedFacilityGroupIds.join(",") }) } diff --git a/src/views/CreateUpdateSafetyStockRule.vue b/src/views/CreateUpdateSafetyStockRule.vue index ad457d8a..3246d0c2 100644 --- a/src/views/CreateUpdateSafetyStockRule.vue +++ b/src/views/CreateUpdateSafetyStockRule.vue @@ -139,13 +139,13 @@ onIonViewDidEnter(async () => { formData.value.ruleName = currentRule.value.ruleName; formData.value.safetyStock = currentRule.value.ruleActions[0]?.fieldValue ? currentRule.value.ruleActions[0].fieldValue : '' - const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "contains") + const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "in") if(includedGroups?.fieldValue === "ALL") formData.value.areAllFacilitiesSelected = true; else { const includedGroupIds = includedGroups?.fieldValue ? includedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.included = facilityGroups.value.filter((group: any) => includedGroupIds.includes(group.facilityGroupId)); - const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-contains") + const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-in") const excludedGroupIds = excludedGroups?.fieldValue ? excludedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.excluded = facilityGroups.value.filter((group: any) => excludedGroupIds.includes(group.facilityGroupId)); } diff --git a/src/views/CreateUpdateShippingRule.vue b/src/views/CreateUpdateShippingRule.vue index 7392792b..ad17a768 100644 --- a/src/views/CreateUpdateShippingRule.vue +++ b/src/views/CreateUpdateShippingRule.vue @@ -162,13 +162,13 @@ onIonViewDidEnter(async () => { formData.value.isBrokeringAllowed = currentRule.value.ruleActions[0]?.fieldValue === "Y" ? true : false; if(selectedSegment.value === "RG_SHIPPING_FACILITY") { - const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "contains") + const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "in") if(includedGroups?.fieldValue === "ALL") formData.value.areAllSelected = true else { const includedGroupIds = includedGroups?.fieldValue ? includedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.included = facilityGroups.value.filter((group: any) => includedGroupIds.includes(group.facilityGroupId)); - const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-contains") + const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-in") const excludedGroupIds = excludedGroups?.fieldValue ? excludedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.excluded = facilityGroups.value.filter((group: any) => excludedGroupIds.includes(group.facilityGroupId)); } diff --git a/src/views/CreateUpdateStorePickupRule.vue b/src/views/CreateUpdateStorePickupRule.vue index fcd35a4c..20958b2a 100644 --- a/src/views/CreateUpdateStorePickupRule.vue +++ b/src/views/CreateUpdateStorePickupRule.vue @@ -163,13 +163,13 @@ onIonViewDidEnter(async () => { formData.value.isPickupAllowed = currentRule.value.ruleActions[0]?.fieldValue === "Y" ? true : false; if(selectedSegment.value === "RG_PICKUP_FACILITY") { - const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "contains") + const includedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "in") if(includedGroups?.fieldValue === "ALL") formData.value.areAllSelected = true else { const includedGroupIds = includedGroups?.fieldValue ? includedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.included = facilityGroups.value.filter((group: any) => includedGroupIds.includes(group.facilityGroupId)); - const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-contains") + const excludedGroups = currentRule.value.ruleConditions.find((condition: any) => condition.conditionTypeEnumId === "ENTCT_ATP_FAC_GROUPS" && condition.operator === "not-in") const excludedGroupIds = excludedGroups?.fieldValue ? excludedGroups.fieldValue.split(",") : [] formData.value.selectedFacilityGroups.excluded = facilityGroups.value.filter((group: any) => excludedGroupIds.includes(group.facilityGroupId)); }