Commit 8cf16608 authored by Cheng C Yang's avatar Cheng C Yang

Permission Debug

parent 655eb0b8
......@@ -233,6 +233,8 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location'
// });
// }
// else
// Data Preview
if (data[constant.citPermission.dataPreview.journalMerge.queryCode]) {
$scope.menus.push({
name: 'previewData', state: 'previewData', num: 2,
......@@ -307,6 +309,7 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location'
});
}
// Data Manage
if (data[constant.citPermission.dataManage.caculateDataCode]) {
$scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3,
......@@ -319,18 +322,7 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location'
permission: constant.citPermission.dataManage.caculateDataCode,
url: '#/cit/reductionData/caculateData'
});
} else if (data[constant.citPermission.dataManage.accountMappingCode]) {
$scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3,
permission: constant.citPermission.dataManage.dataManageCode, url: '#/cit/reductionData'
});
subMenus.push({
name: 'reductionData.accountMapping',
state: 'reductionData.accountMapping',
num: 3,
permission: constant.citPermission.dataManage.accountMappingCode,
url: '#/cit/reductionData/accountMapping'
});
} else if (data[constant.citPermission.dataManage.assetEamMapping]) {
$scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3,
......@@ -356,6 +348,20 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location'
url: '#/cit/reductionData/distributionTable'
});
}
// } else if (data[constant.citPermission.dataManage.accountMappingCode]) {
// $scope.menus.push({
// name: 'reductionData', state: 'reductionData', num: 3,
// permission: constant.citPermission.dataManage.dataManageCode, url: '#/cit/reductionData'
// });
// subMenus.push({
// name: 'reductionData.accountMapping',
// state: 'reductionData.accountMapping',
// num: 3,
// permission: constant.citPermission.dataManage.accountMappingCode,
// url: '#/cit/reductionData/accountMapping'
// });
if (data[constant.citPermission.reportView.bsplCode]
|| data[constant.citPermission.reportView.quarterlyFilingReturnTypeCode]
......
......@@ -63,7 +63,7 @@
taxGroupType:''
};
$scope.refreshAssetResultListGrid = function () {
debugger;
$log.debug("refreshAssetResultListGrid");
getAssetResultList($scope.citAssetsListDto.assetType);
};
......@@ -265,7 +265,7 @@
$scope.TotalTaxCurrentYearDepreciationAmount = 0;
$scope.TotalYearDifferenceAmount = 0;
assetListService.getAssetResultListPage($scope.citAssetsListDto).success(function (assetListData) {
debugger;
var data = assetListData.data.list;
if (data) {
var index = 1;
......@@ -987,14 +987,14 @@
};
var doDataFilter = function () {
debugger;
// initParamFilter();
getAssetResultList($scope.citAssetsListDto.assetType);
}
var doDataFilterReset = function () {
debugger;
// initParamFilter();
$scope.citAssetsListDto.taxAccountCompare =2;
$scope.citAssetsListDto.assetGroupName = null;
......@@ -1007,7 +1007,7 @@
//开始
(function initialize() {
//分页的设置
debugger;
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
......@@ -1024,14 +1024,14 @@
$scope.changeSheet = changeSheet;
$scope.doDataFilter = doDataFilter;
$scope.doDataFilterReset = doDataFilterReset;
debugger;
function init(){
initColumns();
initDxGrid();
initAssetResultDxGrid();
getAssetResultList(1);
debugger;
getGroupList();
getGroupDetailList();
getUserPermission();
......
......@@ -72,7 +72,7 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi
else if ($location && $location.absUrl().indexOf('reductionData') > -1) {
$scope.nodeDicKey = constant.DictionaryDictKey.DataProcess;
$scope.linkShort = enums.linkShort.ReductionData;
debugger;
$scope.menus = [
{
name: 'caculateData', permission: constant.citPermission.dataManage.caculateDataCode,
......
......@@ -14,7 +14,7 @@
$scope.moduleid = enums.vatModuleEnum.Import_CalculateData;
var initTasks = function () {
debugger;
var task = function (id, status, name,code) {
this.id = id;
this.name = _.isEmpty(name) ? $translate.instant(id) : name;
......@@ -199,7 +199,7 @@ debugger;
task.prototype.code =null;
citReportService.getCitTemplate(vatSessionService.project.id, constant.serviceType.CIT).then(function (report) {
debugger;
var result = [];
// result.push({ name: $translate.instant('ProcessData'), items: [new task('GenerateStdTb', 'unstarted')] });
// result.push({ name: $translate.instant('ProcessData'), items: [new task('CompareUnbilled', 'unstarted')] });
......@@ -248,7 +248,7 @@ debugger;
i++;
taskList = taskList.concat(item.items);
});
debugger;
$scope.tasks = result;
getInitTaskStatus();
});
......@@ -289,16 +289,16 @@ debugger;
function doStartCaculate2(isMergeManualDataSource) {
citReportService.generateAllCitReport(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
debugger;
$scope.readonly = true;
if(data && data.result)
updateTasksStatus(data.data);
if(data.data.jobStatus=='Begin'||data.data.jobStatus=='Running'){
if(!$scope.timer)
$scope.timer= $interval(function(){
debugger;
citReportService.getJobStatus(vatSessionService.project.id,0,data.data.id).then(function(result){
debugger;
if(result.data && result.status == 200){
updateTasksStatus(result.data);
}else{
......@@ -326,9 +326,9 @@ debugger;
}
var startCaculate = function () {
debugger;
var a = vatSessionService.project.projectStatusList;
debugger;
if (vatSessionService.project.projectStatusList[0] >= constant.ProjectStatusEnum.Generated) {
swal({
title: "warning!",
......@@ -379,9 +379,9 @@ debugger;
};
var startCaculate2 = function () {
debugger;
var a = vatSessionService.project.projectStatusList;
debugger;
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) {
swal({
title: "warning!",
......@@ -576,17 +576,17 @@ debugger;
var updateTasksStatus = function(job){
var items = $scope.tasks;
var tasks = JSON.parse(job.status);
debugger;
if(job.jobStatus == 'End'){
debugger;
items.forEach(function(item,index){
debugger;
item.status = 'completed';
item.text = $translate.instant('completed');
item.items.forEach(function (_task, index) {
debugger;
tasks.forEach(function(task){
debugger;
if(task.code==_task.code){
_task.status = 'completed';
_task.text = $translate.instant(_task.status);
......@@ -628,13 +628,13 @@ debugger;
if($scope.timer)$interval.cancel($scope.timer);
}
}
debugger;
items.forEach(function(item,index){
debugger;
item.items.forEach(function (_task, index) {
debugger;
tasks.forEach(function(task){
debugger;
if(task.code==_task.code){
if(task.status == 'Error'){
_task.status = 'error';
......@@ -651,19 +651,19 @@ debugger;
}
var getInitTaskStatus = function(){
debugger;
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) {
debugger;
if(result.data && result.status == 200){
updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
if(!$scope.timer)
debugger;
$scope.timer= $interval(function(){
debugger;
citReportService.getJobStatus(vatSessionService.project.id,0,result.data.id)
.then(function(result){
debugger;
if(result.data && result.status == 200){
updateTasksStatus(result.data);
}else{
......
......@@ -9,7 +9,6 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http,
return $http.get('/asset/getAssetResultList?assetType=' + assetType + '&projectId=' + projectId + '&taxAccountCompare=' + taxAccountCompare, apiConfig.create());
},
getAssetResultListPage: function (citAssetsListDto) {
debugger;
return $http.post('/asset/getAssetResultListPage', citAssetsListDto, apiConfig.create());
},
getAssetGroupResultData: function (projectId) {
......
......@@ -4,8 +4,8 @@
// AppNavBarController controller for the navigation bar of the application. This controller is responsible for
// manage the different types of the tabs and corresponding menus.
frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log', '$state' ,'loginContext', 'application', 'userService', '$translate', 'vatSessionService', '$interval', 'workflowService',
function ($rootScope, $scope, $log, $state ,loginContext, application, userService, $translate, vatSessionService, $interval, workflowService) {
frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log', '$state', 'loginContext', 'application', 'userService', '$translate', 'vatSessionService', '$interval', 'workflowService',
function ($rootScope, $scope, $log, $state, loginContext, application, userService, $translate, vatSessionService, $interval, workflowService) {
'use strict';
$log.debug('AppNavController.ctor()...');
......@@ -116,39 +116,51 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log',
// todo 增值税申报和报表审批菜单没有做权限管理,可以在这里一起加上
var list = [];
list.push(constant.adminPermission.WebAdmin);
list.push(constant.vatPermission.code);
list.push(constant.citPermission.code);
list.push(constant.analysisPermisson.code);
list.push(constant.menuRecordManagePermission.code);
list.push(constant.menuListApprovalPermission.code);
$scope.$root.checkUserPermissionList(list).success(function (data) {
$scope.adminSettingShow = data[constant.adminPermission.WebAdmin];
$scope.vatShow = data[constant.vatPermission.code];
$scope.citShow = data[constant.citPermission.code];
$scope.analysisShow = data[constant.analysisPermisson.code];
$scope.menuRecordManageShow = data[constant.menuRecordManagePermission.code];
$scope.menuListApprovalShow = data[constant.menuListApprovalPermission.code];
});
};
//设置 菜单选中状态
var initState = function(){
var initState = function () {
$($('.nav-container .nav-element-left a')[0]).addClass('active');
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
$log.debug("$stateChangeStart: toState="+toState.name);
$log.debug("$stateChangeStart: toState=" + toState.name);
// 这里没想好怎么搞,暂时先这样点击导入按钮更新下display,nav-bar里其他的按钮更新display,其他不做操作
var isNeedHide = angular.equals('notification',toState.name)||
angular.equals('summary',toState.name)||
angular.equals('taxDocumentManage',toState.name)||
angular.equals('overviewCit',toState.name)||
angular.equals('overviewAssetsManage',toState.name)||
angular.equals('listApproval',toState.name)||
angular.equals('overviewVat',toState.name)||
angular.equals('taxDocumentManage',toState.name)||
angular.equals('overview',toState.name);
if(isNeedHide){
var isNeedHide = angular.equals('notification', toState.name) ||
angular.equals('summary', toState.name) ||
angular.equals('taxDocumentManage', toState.name) ||
angular.equals('overviewCit', toState.name) ||
angular.equals('overviewAssetsManage', toState.name) ||
angular.equals('listApproval', toState.name) ||
angular.equals('overviewVat', toState.name) ||
angular.equals('taxDocumentManage', toState.name) ||
angular.equals('overview', toState.name);
if (isNeedHide) {
$('.data-import-contents')[0].style.display = "none";
$('.main-contents')[0].style.width = "";
$('.main-contents')[0].style.float = "";
$('.main-contents')[0].style.styleFloat = "";
$('.main-contents')[0].style.cssFloat = "";
// $('.data-import-contents').removeClass('data-import-contents');
}else if(angular.equals('overviewDataImp',toState.name)){
} else if (angular.equals('overviewDataImp', toState.name)) {
$('.data-import-contents')[0].style.display = "block";
}else if(angular.equals('overviewAnalysis',toState.name)){
} else if (angular.equals('overviewAnalysis', toState.name)) {
$('.data-import-contents')[0].style.display = "block";
}
/*$('.nav-container .nav-element-left a').removeClass('active');
......@@ -156,18 +168,25 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log',
});
};
var getMenuIndex = function(name){
switch(name){
case 'GlobalSearch': return 0;
case 'summary': return 0;
case 'summaryDashboard': return 3;
case 'RiskPanel': return 3;
case 'DataSummary': return 3;
default: return 2;
};
var getMenuIndex = function (name) {
switch (name) {
case 'GlobalSearch':
return 0;
case 'summary':
return 0;
case 'summaryDashboard':
return 3;
case 'RiskPanel':
return 3;
case 'DataSummary':
return 3;
default:
return 2;
}
;
};
$scope.search = function(){
$scope.search = function () {
PWC.simulateProgress();
$state.go('GlobalSearch');
};
......
......@@ -16,26 +16,26 @@
<!--</a>-->
<!--</div>-->
<div class="nav-element-left">
<a ui-sref="overviewVat" hover-show="first">
<a ui-sref="overviewVat" hover-show="first" ng-if="vatShow">
<span class="nav-icon-color">{{'MenuVAT' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
<div class="nav-element-left" ng-if="citShow">
<a ui-sref="overviewCit">
<span class="nav-icon-color">{{'MenuCIT' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
<div class="nav-element-left" ng-if="analysisShow">
<a ui-sref="taxDocumentManage">
<span class="nav-icon-color">{{'MenuRecordManage' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
<div class="nav-element-left" ng-if="menuRecordManageShow">
<a ui-sref="overviewAnalysis">
<span class="nav-icon-color">{{'MenuAnalysis' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
<div class="nav-element-left" ng-if="menuListApprovalShow">
<a ui-sref="listApproval">
<span class="nav-icon-color">{{'MenuListApproval' | translate}}</span>
</a>
......
......@@ -16,8 +16,8 @@
<i class="fa fa-calendar vat-subheader red-color" style="font-size:20px;"></i>
<input type="text" id="vatDatepicker" class="datepicker vat-subheader" style="border-width:0;outline:none;" readonly="readonly" />
<div id="vat-menu-buttons" style="display:inline-block;">
<a ng-repeat="menu in menus" ui-sref-active="active" ng-click="setReportSession(menu.name);" ui-sref=".{{menu.name}}"
atms-permission permission-control-type="ngIf" permission-code="{{menu.permission}}">{{menu.state | translate}}</a>
<a ng-repeat="menu in menus" ui-sref-active="active" ng-click="setReportSession(menu.name);" ui-sref=".{{menu.state}}"
atms-permission permission-control-type="ngIf" permission-code="{{menu.permission}}">{{menu.name | translate}}</a>
</div>
<!--<button class="btn btn-vat-primary" translate="TriggerMessageSchedulerJob" ng-click="triggerSchedulerJob()"></button>-->
......
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