form id changes details : kdk

This commit is contained in:
dineshkumarkannan 2018-09-05 11:39:40 +05:30
parent 8bfd4823b2
commit bc8834dacf
2 changed files with 288 additions and 311 deletions

View File

@ -21,8 +21,8 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
const LOCALTYPE = logcheck.localType;
if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE == 'R005')) {
console.log("if");
}else {
if(logcheck != null && LOCALTYPE !='R001') {
} else {
if (logcheck != null && LOCALTYPE != 'R001') {
console.log("else if");
$state.go('app.dashboard');
} else {
@ -82,7 +82,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
if (response.data.status) {
$scope.universitySearchData = response.data.details;
} else {
$scope.universitySearchData="";
$scope.universitySearchData = "";
}
});
};
@ -94,9 +94,9 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
"Status": ""
}
$scope.myUnivSearch = "";
$scope.sessionData="";
$scope.sessionData = "";
$scope.getUniveId = function (univ) {
$scope.sessionData="";
$scope.sessionData = "";
if (univ === '') {
$scope.myUnivSearch = "";
$scope.searchData.University = '';
@ -121,14 +121,14 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
};
//For session dropdown
$scope.filterSessionDetails="";
$scope.$watch('searchData.University', function (newValue,oldValue) {
if(newValue==undefined || newValue==''){
$scope.filterSessionDetails="";
$scope.filterSessionDetails = "";
$scope.$watch('searchData.University', function (newValue, oldValue) {
if (newValue == undefined || newValue == '') {
$scope.filterSessionDetails = "";
}
else{
if(angular.isString(newValue)){
$scope.filterSessionDetails=angular.fromJson(newValue);
else {
if (angular.isString(newValue)) {
$scope.filterSessionDetails = angular.fromJson(newValue);
}
}
@ -138,9 +138,9 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
$scope.Searchloader = false;
$scope.studentData = false;
$scope.onSubmit = function(){
$scope.onSubmit = function () {
$scope.Searchloader = true;
if($scope.searchData.University !== '' && $scope.searchData.Session !==''){
if ($scope.searchData.University !== '' && $scope.searchData.Session !== '') {
$scope.Searchloader = true;
var empListreq = {
method: 'POST',
@ -166,13 +166,13 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
$scope.statusMessage = $scope.data.message;
}
});
}else {
} else {
}
}
$scope.editId = -1;
$scope.setEditId=function(id){
$scope.setEditId = function (id) {
$scope.editId = id;
}
@ -184,7 +184,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
/*
* upload options json
* */
$scope.uploadOptions=[{
$scope.uploadOptions = [{
id: 1,
name: 'Received Enrolment From University',
},
@ -196,77 +196,26 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
/*
watch upload model for enable upload options
*/
$scope.showFile="0";
$scope.$watchCollection('uploadModel', function (newValue,oldValue) {
$scope.showFile = "1";
// $scope.$watchCollection('uploadModel', function (newValue, oldValue) {
if(newValue.university!='' && newValue.university!=null && newValue.uploadFor!='' && newValue.uploadFor=='1'){
$scope.showFile="1";
// if (newValue.university != '' && newValue.university != null) {
// $scope.showFile = "1";
// }
// else {
// $scope.showFile = "0";
// }
}
else if(newValue.university!='' && newValue.university!=null && newValue.uploadFor!='' && newValue.uploadFor=='2'){
$scope.showFile="2";
}
else{
$scope.showFile="0";
}
// });
});
/* update received enrolment from university
* created by kms
* */
$scope.extractDetails="";
$scope.readXlsxDetails = function (workbook) {
/* DO SOMETHING WITH workbook HERE */
for (var sheetName in workbook.Sheets) {
var jsonData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]);
if(jsonData.length!=0){
$scope.extractDetails=jsonData;
}
}
$scope.error = function (e) {
/* DO SOMETHING WHEN ERROR IS THROWN */
//console.log(e);
}
}
$scope.receiveEnrolmentDetails = function (details,uploadForDetails) {
var updateUniversityEnrolment = {
method: 'POST',
url: apiPoint.url + 'receiveEnrolmentFromUniv/',
headers: {
'Content-Type': 'application/json'
},
data: {
localDetails: localDetail,
details: details,
universityID: angular.fromJson(uploadForDetails.university).UniversityID,
universityName: angular.fromJson(uploadForDetails.university).UniversityName,
}
};
$http(updateUniversityEnrolment).then(function (response) {
if (response.data.status == true) {
swal("", "Updated Successfully", "success");
$state.go($state.current, {}, {reload: true});
} else {
swal("", "Failed", "error");
}
});
}
// end
$scope.extractFormIDDetails="";
$scope.extractFormIDDetails = "";
$scope.readXlsxFormDetails = function (workbook) {
$scope.extractFormIDDetails="";
$scope.extractFormIDDetails = "";
/* DO SOMETHING WITH workbook HERE */
for (var sheetName in workbook.Sheets) {
var jsonData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]);
if(jsonData.length!=0){
$scope.extractFormIDDetails=jsonData;
if (jsonData.length != 0) {
$scope.extractFormIDDetails = jsonData;
}
}
@ -277,7 +226,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
}
$scope.receiveFormIdFeeDetails = function(details) {
$scope.receiveFormIdFeeDetails = function (details) {
console.log(details);
var updateUniversityEnrolment = {
@ -295,7 +244,7 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
$http(updateUniversityEnrolment).then(function (response) {
if (response.data.stuFeeList == true) {
swal("", "Updated Successfully", "success");
$state.go($state.current, {}, {reload: true});
$state.go($state.current, {}, { reload: true });
} else {
swal("", "Failed", "error");
}
@ -304,13 +253,13 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
$scope.popupLoad = false;
$scope.popupLoadData = false;
$scope.formPaymentDetails="";
$scope.formPaymentDetails = "";
// Fee compare details get
$scope.getFeeCompareDetails = function(formId, enrolmentId){
$scope.getFeeCompareDetails = function (formId, enrolmentId) {
$scope.popupLoadData = false;
$scope.formPaymentDetails="";
$scope.formPaymentDetails = "";
$scope.popupLoad = true;
var getFeeCompareDetailsList = {
method: 'POST',
@ -329,19 +278,19 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
if (response.data.status == true) {
$scope.popupLoad = false;
$scope.popupLoadData = true;
$scope.formPaymentDetails=response.data;
$scope.formPaymentDetails = response.data;
} else {
$scope.popupLoad = false;
$scope.popupLoadData = true;
$scope.formPaymentDetails=response.data;
$scope.formPaymentDetails = response.data;
}
});
}
$scope.unMatchedLoadingStatus = false;
// Get unmached details
$scope.getUnmatchedRecord = function(ss){
$scope.getUnmatchedRecord = function (ss) {
$scope.unMatchedRecordDetails = '';
$scope.unMatchedNoRecordFound = false;
$scope.unMatchedLoadingStatus = true;
@ -361,14 +310,53 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
if (response.data.unMatchedRecordStatus == true) {
$scope.unMatchedLoadingStatus = false;
$scope.unMatchedNoRecordFound = false;
$scope.unMatchedRecordDetails=response.data.unMatchedRecordDetails;
$scope.unMatchedRecordDetailsType= response.data.unMatchedRecordFor;
$scope.unMatchedRecordDetails = response.data.unMatchedRecordDetails;
$scope.unMatchedRecordDetailsType = response.data.unMatchedRecordFor;
} else {
$scope.unMatchedLoadingStatus = false;
$scope.unMatchedNoRecordFound = true;
$scope.unMatchedRecordDetails=response.data.unMatchedRecordDetails;
$scope.unMatchedRecordDetails = response.data.unMatchedRecordDetails;
}
});
}
// get subtab details for the formid fee details get form the university
$scope.subTabActive= function(tab){
if( tab == 'subTabactive2'){
getDraftFormIdDetails();
}
}
// get draft form id details
function getDraftFormIdDetails(){
// $scope.unMatchedRecordDetails = '';
// $scope.unMatchedNoRecordFound = false;
// $scope.unMatchedLoadingStatus = true;
// var getDetailsFor = ss == 1 ? 'EnrolmentIDFile' : 'FormIDFile';
// var getFeeCompareDetailsList = {
// method: 'POST',
// url: apiPoint.url + 'getUnmatchedRecordDetails/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// localDetails: localDetail,
// getDetailsFor: getDetailsFor
// }
// };
// $http(getFeeCompareDetailsList).then(function (response) {
// if (response.data.unMatchedRecordStatus == true) {
// $scope.unMatchedLoadingStatus = false;
// $scope.unMatchedNoRecordFound = false;
// $scope.unMatchedRecordDetails = response.data.unMatchedRecordDetails;
// $scope.unMatchedRecordDetailsType = response.data.unMatchedRecordFor;
// } else {
// $scope.unMatchedLoadingStatus = false;
// $scope.unMatchedNoRecordFound = true;
// $scope.unMatchedRecordDetails = response.data.unMatchedRecordDetails;
// }
// });
}
}]);

View File

@ -16,7 +16,6 @@
$("#selectBranch").focus();
});
</script>
<style>
#containersPara {
width: 180px;
@ -40,7 +39,6 @@
</style>
<div>
<br>
<div class="row" ng-init="init()">
<tabset id="here" class="tabbable">
<tab tabindex="1" active="tabactive1" ng-click="tabActive('tabactive1')" heading="View Details" id="viewDetails">
@ -51,7 +49,6 @@
$("#searchIn").focus();
});
</script>
<div class="container-fluid container-fullw">
<form name="Form" id="form" novalidate ng-submit="onSubmit()" method="post">
<div class="row">
@ -59,47 +56,42 @@
<label for="form-field-select-2">
University
</label>
<select class="form-control" tabindex="3" class="cs-select cs-skin-elastic" name="university" ng-model="myUnivSearch" ng-change="getUniveId(myUnivSearch)">
<option value="" disabled selected>Select University</option>
<option ng-repeat="item in universitySearchData" value="{{item}}">{{item.UniversityName}}</option>
</select>
</div>
<div class="col-md-3">
<label for="form-field-select-2">
Session
</label>
<select ui-select2 class="form-control" tabindex="4" class="cs-select cs-skin-elastic" name="session" ng-model="searchData.Session">
<option value="" selected>Select Session</option>
<option ng-repeat="itemSession in sessionData" value="{{itemSession.SessionID}}">{{itemSession.SessionName}}</option>
</select>
</div>
<div class="col-md-2" style="padding-top: 2.3%;">
<div class="pull-right">
<button ng-disabled="searchData.Session == '' || searchData.University == ''" type="submit" class="btn btn-success btn-o" tabindex="8">
<button ng-disabled="searchData.Session == '' || searchData.University == ''" type="submit" class="btn btn-success btn-o"
tabindex="8">
Submit
</button>
</div>
</div>
</div>
</form>
</div>
<div>
<!--{{data | json}}-->
<div ng-if="Searchloader">
<div align="center" >
<h3 style="color: blue;">Loading...</h3></div>
<div ng-if="Searchloader">
<div align="center">
<h3 style="color: blue;">Loading...</h3>
</div>
<h2> {{statusMessage}} </h2>
</div>
</div>
<div class="table-responsive" ng-if="studentData">
<table class="table table-hover" >
<table class="table table-hover">
<thead>
<tr>
<th> FormID
@ -183,10 +175,12 @@
</div>
</div>
</tab>
<tab tabindex="2" active="tabactive2" ng-click="tabActive('tabactive2')" heading="Upload Files" id="uploadFiles">
<tab tabindex="2" active="tabactive2" ng-click="tabActive('tabactive2')" heading="Upload Details" id="uploadFiles">
<tabset id="uploadDetails" class="tabbable">
<tab tabindex="1" active="subTabactive1" ng-click="subTabActive('subTabactive1')" heading="Upload File" id="uploadFiles">
<div class="container-fluid">
<div class="row">
<div class="col-md-4 form-group">
<!--<div class="col-md-4 form-group">
<label>
University <span class="symbol required"></span>
</label>
@ -194,28 +188,8 @@
<option value="" selected>Select University</option>
<option ng-repeat="univ in universitySearchData" value="{{univ}}">{{univ.UniversityName}}</option>
</select>
</div>
<div class="col-md-4 form-group">
<label>
Upload For <span class="symbol required"></span>
</label>
<select class="form-control" name="uploadFor" tabindex="2" id="uploadFor"
ng-model="uploadModel.uploadFor"
ng-options="upload.id as upload.name for upload in uploadOptions"
required>
<option value=""> Select</option>
</select>
</div>
<div class="col-md-3 form-group" ng-if="showFile=='1'">
<fieldset>
<js-xls onread="readXlsxDetails" onerror="error"></js-xls>
<button type="button" class="btn btn-success btn-o" style="float: right" ng-click="receiveEnrolmentDetails(extractDetails,uploadModel)"> Submit</button>
</fieldset>
</div>
<div class="col-md-3 form-group" ng-if="showFile=='2'">
</div>-->
<div class="col-md-6 form-group" ng-if="showFile=='1'">
<fieldset>
<js-xls onread="readXlsxFormDetails" onerror="error"></js-xls>
<button type="button" class="btn btn-success btn-o" style="float: right" ng-click="receiveFormIdFeeDetails(extractFormIDDetails)"> Submit</button>
@ -226,6 +200,23 @@
</div>
</div>
</tab>
<tab tabindex="2" active="subTabactive2" ng-click="subTabActive('subTabactive2')" heading="Upload Data Manualy" id="uploadDataManualy">
<div class="container-fluid">
<!--<div class="row">
<div class="col-md-4 form-group">
<label>
University <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="1" name="formUniversity" ng-model="uploadModel.university" required>
<option value="" selected>Select University</option>
<option ng-repeat="univ in universitySearchData" value="{{univ}}">{{univ.UniversityName}}</option>
</select>
</div>
</div>-->
</div>
</tab>
</tabset>
</tab>
<tab tabindex="3" active="tabactive3" ng-click="tabActive('tabactive3')" heading="Unmatched Records" id="unmatchedRecord">
<div class="container">
@ -234,9 +225,7 @@
<label>
Upload For <span class="symbol required"></span>
</label>
<select class="form-control" name="uploadFor" tabindex="2" id="uploadFor"
ng-model="getUnmatchedDetailsFor"
ng-options="upload.id as upload.name for upload in uploadOptions"
<select class="form-control" name="uploadFor" tabindex="2" id="uploadFor" ng-model="getUnmatchedDetailsFor" ng-options="upload.id as upload.name for upload in uploadOptions"
required>
<option value=""> Select</option>
</select>
@ -256,7 +245,7 @@
</div>
<div class="container table-responsive" ng-if="!unMatchedNoRecordFound && unMatchedRecordDetails">
<div ng-if="unMatchedRecordDetailsType == 'EnrolmentIDFile'">
<table class="table table-border table-hover" >
<table class="table table-border table-hover">
<thead>
<th>FormID</th>
<th>EnrolmentNo</th>
@ -298,7 +287,7 @@
</dir-pagination-controls>
</div>
<div ng-if="unMatchedRecordDetailsType == 'FormIDFile'">
<table class="table table-border table-hover" >
<table class="table table-border table-hover">
<thead>
<th>FormID</th>
<th>FormType</th>