Commit 5fb3d18c by NGUYEN HOANG SON

check search value null

parent 072c9ae1
...@@ -3067,20 +3067,20 @@ CHK.createOperationList = function(operationList, isSearched = false) { ...@@ -3067,20 +3067,20 @@ CHK.createOperationList = function(operationList, isSearched = false) {
operationList = operationList.filter(function(operation) { operationList = operationList.filter(function(operation) {
var result = true; var result = true;
if (searchKeyword.length) { if (searchKeyword && searchKeyword.length) {
result = result * operation.operationName.includes(searchKeyword); result = result * operation.operationName.includes(searchKeyword);
} }
if (searchStartDate.length && !searchEndDate.length) { if (searchStartDate && searchEndDate && searchStartDate.length && !searchEndDate.length) {
result = result * (operation.operationStartDate >= searchStartDate); result = result * (operation.operationStartDate >= searchStartDate);
} }
if (searchEndDate.length && !searchStartDate.length) { if (searchStartDate && searchEndDate && searchEndDate.length && !searchStartDate.length) {
result = result * (operation.operationEndDate <= searchEndDate); result = result * (operation.operationEndDate <= searchEndDate);
} }
if (searchStartDate.length && searchEndDate.length) { if (searchStartDate && searchEndDate && searchStartDate.length && searchEndDate.length) {
result = result * ((operation.operationStartDate <= searchEndDate) && (operation.operationEndDate >= searchStartDate)); result = result * ((operation.operationStartDate <= searchEndDate) && (operation.operationEndDate >= searchStartDate));
} }
if (operationGroupMasterId != 0) { if (CHK.operationGroupMasterRelation && operationGroupMasterId != 0) {
var operationGroupMasterIdList = CHK.operationGroupMasterRelation.operationGroupMasterRelationList.filter(function(operationGroupMasterRelation) { var operationGroupMasterIdList = CHK.operationGroupMasterRelation.operationGroupMasterRelationList.filter(function(operationGroupMasterRelation) {
return operationGroupMasterRelation.operationId == operation.operationId; return operationGroupMasterRelation.operationId == operation.operationId;
}) })
...@@ -3253,7 +3253,6 @@ CHK.search = function() { ...@@ -3253,7 +3253,6 @@ CHK.search = function() {
CHK.isSearched = true; CHK.isSearched = true;
CHK.operation.searchOperationList = searchResult; CHK.operation.searchOperationList = searchResult;
CHK.createOperationList(searchResult, CHK.isSearched); CHK.createOperationList(searchResult, CHK.isSearched);
CHK_PU.createOperationList(searchResult, CHK.isSearched);
}; };
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment