added export csv & horizontal scroll to audit

This commit is contained in:
Safiyu 2013-12-11 12:19:11 +05:30
parent 74eadc05b0
commit 33c3f243b0
5 changed files with 65 additions and 37 deletions

View File

@ -2281,6 +2281,10 @@
"editemployee": "Edit Employee",
"navoffices": "Navigation",
"adminusers": "System Users",
"awaiting.approval":"Awaiting Approval",
"invalid":"Invalid",
"rejected":"Rejected",
"processed":"Processed",
"----------------------": "------------"
}

View File

@ -4,6 +4,7 @@
scope.formData = [];
scope.isCollapsed = true;
scope.date = {};
resourceFactory.auditResource.get({templateResource: 'searchtemplate'} , function(data) {
scope.template = data;
});
@ -28,6 +29,8 @@
if (scope.formData.entity) { params.entityName = scope.formData.entity; };
if(scope.formData.status) {params.processingResult = scope.formData.status;};
if (scope.formData.resourceId) { params.resourceId = scope.formData.resourceId; };
if (scope.formData.user) { params.makerId = scope.formData.user; };
@ -43,14 +46,23 @@
if (scope.date.fourth) { params.checkerDateTimeTo = reqFourthDate; };
resourceFactory.auditResource.search(params , function(data) {
scope.searchData = data;
scope.row = [];
scope.csvData = [];
if(scope.userTypeahead){
scope.formData.user = '';
scope.userTypeahead = false;
scope.user = '';
}
scope.row = ['Id','Resource Id','Status','Office','Made on','Maker','Checked on','Checker','Entity','Action','Client'];
scope.csvData.push(scope.row);
for(var i in scope.searchData){
scope.row = [scope.searchData[i].id,scope.searchData[i].resourceId,scope.searchData[i].processingResult,scope.searchData[i].officeName,dateFilter(scope.searchData[i].madeOnDate,'d MMMM y h:mm:ss'),scope.searchData[i].maker,dateFilter(scope.searchData[i].checkedOnDate,'d MMMM y h:mm:ss'),scope.searchData[i].checker,scope.searchData[i].entityName,scope.searchData[i].actionName,scope.searchData[i].clientName];
scope.csvData.push(scope.row);
}
});
};
}
});
mifosX.ng.application.controller('AuditController', ['$scope', 'ResourceFactory','dateFilter','$location', mifosX.controllers.AuditController]).run(function($log) {

View File

@ -983,4 +983,8 @@ nav:hover:after{
.gray-head{
background-color: #F5F5F5;
}
.highlight-row:hover{
background-color: deepskyblue;
}

View File

@ -13,9 +13,8 @@
<div collapse="isCollapsed" class="blockoverlay" width="100%" style="overflow-y: scroll">
<div class="control-group">
<div class="controls">
<select ng-model="formData.status">
<select value="{{status.id}}" ng-model="formData.status" data-ng-options="status.id as status.processingResult | translate for status in template.processingResults">
<option value="">--{{'label.selectstatus' | translate}}--</option>
<option ng-repeat="status in template.processingResults" value="{{status.id}}">{{status.processingResult}}</option>
</select>
</div>
</div>
@ -76,34 +75,41 @@
</div>
<span><a ng-click="search()" class="btn btn-primary control"><i class="icon-search icon-white"></i>{{'label.button.advancesearch' | translate}}</a></span>
</div>
<div ng-show="displayResults" class="row-fluid">
<table class="table table-bordered">
<thead>
<tr class="graybg">
<th>{{'label.heading.id' | translate}}</th>
<th>{{'label.heading.status' | translate}}</th>
<th>{{'label.heading.madeby' | translate}}</th>
<th>{{'label.heading.action' | translate}}</th>
<th>{{'label.heading.entity' | translate}}</th>
<th>{{'label.heading.office' | translate}}</th>
<th>{{'label.heading.madedate' | translate}}</th>
<th>{{'label.heading.checker' | translate}}</th>
<th>{{'label.heading.checkeddate' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in searchData">
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.id}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.processingResult}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.maker}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.actionName}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.entityName}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.officeName}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.madeOnDate | date:'d MMM y h:mm:ss'}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.checker}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.checkedOnDate | date:'d MMM y h:mm:ss'}}</td>
</tr>
</tbody>
</table>
<div ng-show="displayResults">
<div class="pull-right">
<button type="button" class="btn btn-primary" ng-csv="csvData"><i class="icon-file icon-white"></i>{{'label.button.exportcsv' | translate }}</button>
</div>
<div scroll>
<table width="100%" style="width:1200px" class="table table-bordered" data-anchor>
<thead>
<tr class="graybg">
<th>{{'label.heading.id' | translate}}</th>
<th>{{'label.heading.resourceid' | translate}}</th>
<th>{{'label.heading.status' | translate}}</th>
<th>{{'label.heading.madeby' | translate}}</th>
<th>{{'label.heading.action' | translate}}</th>
<th>{{'label.heading.entity' | translate}}</th>
<th>{{'label.heading.office' | translate}}</th>
<th>{{'label.heading.madedate' | translate}}</th>
<th>{{'label.heading.checker' | translate}}</th>
<th>{{'label.heading.checkeddate' | translate}}</th>
</tr>
</thead>
<tbody>
<tr class="highlight-row" style="cursor: pointer" data-ng-click="routeTo(data.id)" ng-repeat="data in searchData">
<td>{{data.id}}</td>
<td>{{data.resourceId}}</td>
<td>{{data.processingResult | translate}}</td>
<td>{{data.maker}}</td>
<td>{{data.actionName}}</td>
<td>{{data.entityName}}</td>
<td>{{data.officeName}}</td>
<td>{{data.madeOnDate | date:'d MMM y h:mm:ss'}}</td>
<td>{{data.checker}}</td>
<td>{{data.checkedOnDate | date:'d MMM y h:mm:ss'}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

View File

@ -50,18 +50,20 @@
</table>
</div>
<hr/>
<table class="table" data-ng-show="details.commandAsJson">
<thead>
<div scroll>
<table class="table" data-ng-show="details.commandAsJson" data-anchor>
<thead>
<tr class="graybg">
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ 'label.heading.command' | translate }}</th>
<th></th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
<tr data-ng-repeat="json in jsondata">
<td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{json.name}}</strong></td>
<td>{{json.property}}</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
</div>