我在我的要求中显示联系人以及开始日期和结束日期。 在这种情况下,我需要对两种情况进行验证。
vlocity.cardframework.registerModule.controller('ValidationToEmail', ['$scope', '$rootScope',function($scope, $rootScope) {
$('div#Next').on('click', function(evt) {
if(!baseCtrl.prototype.$scope.bpTree.response.IsContactAvailable){
$("#ContactList_nextBtn").trigger("click");
}
if(baseCtrl.prototype.$scope.bpTree.response.IsContactAvailable == true && baseCtrl.prototype.$scope.bpTree.response && baseCtrl.prototype.$scope.bpTree.response.ContactList.Contact && baseCtrl.prototype.$scope.bpTree.response.ContactList.Contact === null){
$("p#message").css("color", "red");
$("p#message").css("font-size", "15px");
$("p#message").css("font-weight", "bold");
$("p#message").text("Ingen kontakt har valts. Välj en kontakt för att fortsätta.");
}elseif(baseCtrl.prototype.$scope.bpTree.response && baseCtrl.prototype.$scope.bpTree.response.ContactList.Agreement_Startdate && baseCtrl.prototype.$scope.bpTree.response.ContactList.Agreement_Startdate < baseCtrl.prototype.$scope.bpTree.response.ContactList.Agreemeent_Enddate){
$("p#message").css("color", "red");
$("p#message").css("font-size", "15px");
$("p#message").css("font-weight", "bold");
$("p#message").text("End Date should be greater than Start Date");
}
else{
$("#ContactList_nextBtn").trigger("click");
}
});
}]);