Commit 7aaf0076 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 0d95b3da 6de77904
......@@ -13,6 +13,7 @@ import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
import javax.servlet.http.HttpServletResponse;
......@@ -51,8 +52,8 @@ public class ApprovalController {
@ResponseBody
@RequestMapping(value = "/tasks/{assignee}")
public List<ApprovalTask> data(@PathVariable String assignee) {//accountant manager
return approvalService.getTask(assignee);
public List<ApprovalTaskInfo> data(@PathVariable String assignee) {//accountant manager
return approvalService.getTask();
}
@ResponseBody
......
......@@ -14,11 +14,11 @@ import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.PeriodApproveMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import pwc.taxtech.atms.vat.entity.PeriodReport;
......@@ -26,8 +26,6 @@ import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import java.util.*;
import static pwc.taxtech.atms.exception.Exceptions.SERVER_ERROR_EXCEPTION;
@Service
public class ApprovalService {
private static Logger logger = LoggerFactory.getLogger(ApprovalService.class);
......@@ -42,6 +40,7 @@ public class ApprovalService {
@Autowired
AuthUserHelper authUserHelper;
@Transactional
public void startInstanceAndAssignee(ApprovalDto dto) {
PeriodApprove pa = new PeriodApprove();
......@@ -51,14 +50,10 @@ public class ApprovalService {
}
public List<ApprovalTask> getTask(String assignee) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(assignee).list();
List<ApprovalTask> list = new ArrayList<>();
for (Task task : tasks) {
ApprovalTask t = new ApprovalTask();
list.add(t.copyfrom(task));
}
return list;
public List<ApprovalTaskInfo> getTask() {
String userId = authUserHelper.getCurrentUserId();//TODO query user role from sesstion or db
String assignee = ("66933E7B-DA75-4B2E-B7D6-AB65DCA20D50".equalsIgnoreCase(userId)) ? "manager" : "accountant";
return periodApproveMapper.queryApprovalList(assignee.equalsIgnoreCase("manager") ? null : userId);
}
private void startInstance(ApprovalDto dto, PeriodApprove pa) {
......@@ -95,10 +90,11 @@ public class ApprovalService {
pa.setTemplateIds(reportTemplateIds.toString());
pa.setStatus(Constant.APPROVAL_COMMITTED);
pa.setProjectId(dto.getProjectId());
pa.setCreateBy(authUserHelper.getCurrentUserId()==null?"Admin":authUserHelper.getCurrentUserId());
pa.setCreateBy(authUserHelper.getCurrentUserId() == null ? "Admin" : authUserHelper.getCurrentUserId());
pa.setCreateTime(new Date());
periodApproveMapper.insert(pa);
}
private void startAssignee(PeriodApprove pa) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_ACCOUNTANT).processInstanceId(
pa.getInstanceId()).list();
......
......@@ -3,8 +3,10 @@ package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
......@@ -105,4 +107,27 @@ public interface PeriodApproveMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(PeriodApprove record);
@Select("<script>" +
"SELECT " +
" p.NAME AS projectName, " +
" pa.PERIOD AS period, " +
" pa.INSTANCE_ID AS instanceId, " +
" u1.USER_NAME AS createBy, " +
" u2.USER_NAME AS approvalBy, " +
" pa.STATUS AS status, " +
" pa.APPROVAL_RESUALT AS approvalResult, " +
" pa.CREATE_TIME AS createTime, " +
" pa.APPROVAL_TIME AS approvalTime, " +
" pa.REPORT_PATHS AS reportPaths " +
"FROM " +
" PERIOD_APPROVE pa " +
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
" JOIN \"USER\" u1 ON pa.CREATE_BY = u1.id " +
" LEFT JOIN \"USER\" u2 ON pa.APPROVAL_BY = u2.id " +
"<where> 1=1 " +
" <if test=\"createId != null and createId !='' \">AND pa.CREATE_BY=#{createId}</if>" +
"</where>" +
"</script>")
List<ApprovalTaskInfo> queryApprovalList(@Param("createId") String createId);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo;
import java.sql.Date;
public class ApprovalTaskInfo {
private String projectName;
private Integer period;
private String instanceId;
private String createBy;
private String approvalBy;
private String status;
private String approvalResult;
private Date createTime;
private Date approvalTime;
private String reportPaths;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getApprovalBy() {
return approvalBy;
}
public void setApprovalBy(String approvalBy) {
this.approvalBy = approvalBy;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getApprovalResult() {
return approvalResult;
}
public void setApprovalResult(String approvalResult) {
this.approvalResult = approvalResult;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getApprovalTime() {
return approvalTime;
}
public void setApprovalTime(Date approvalTime) {
this.approvalTime = approvalTime;
}
public String getReportPaths() {
return reportPaths;
}
public void setReportPaths(String reportPaths) {
this.reportPaths = reportPaths;
}
}
......@@ -228,6 +228,22 @@ var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.c
sticky: true
});
$stateProvider.state({
name: 'listApproval',
url: '/overview/listApproval',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat,appTranslation.appPart]);
}],
template: '<app-approve servicetypeid="2"></app-overview>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'overviewAssetsManage',
url: '/overview/assetsManage',
......
......@@ -161,7 +161,7 @@
field: 'name',
name: $translate.instant('OrganizationStructureName'),
width: '50%',
cellTemplate: '<div class="orangization-structure-gridcell-name" style="text-align: center"><span style="text-align: center;float:left;">{{row.entity.name}}</span><span ng-hide="true">{{row.entity.id}}</span></div>'
cellTemplate: '<div class="orangization-structure-gridcell-name" style="text-align: center"><span>{{row.entity.name}}</span><span ng-hide="true">{{row.entity.id}}</span></div>'
}, {
field: 'isActive',
name: $translate.instant('OrganizationStructureStatus'),
......
(function () {
'use strict';
angular.module('app.config', [])
// region of current application
.constant('region', 'zh-CN')
//.constant('region', 'en-US')
// version of current application
.constant('version', '1.0.0.0')
// Exceptionless Server URL
.constant('exceptionlessServerURL', '')
.run([
'region', function (region) {
$.when(
$.getJSON("/Scripts/cldr/main/zh/numbers.json"),
$.getJSON("/Scripts/cldr/main/zh/ca-gregorian.json"),
$.getJSON("/Scripts/cldr/supplemental/likelySubtags.json")
).then(function () {
return [].slice.apply(arguments, [0]).map(function (result) {
return result[0];
});
}).then(Globalize.load).then(function () {
Globalize.locale("zh-CN");
// Globalize.locale("en-US");
DevExpress.localization.locale(region);
//DevExpress.localization.locale(navigator.language || navigator.browserLanguage);
});
}
]);
}());
\ No newline at end of file
//
// app module for online DPMS
//
var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls', 'ui.event', 'pascalprecht.translate', 'ngMessages', 'ui.utils',
'ngRoute', 'ngCookies', 'ngSanitize', 'ct.ui.router.extras', 'chieffancypants.loadingBar', 'ngDraggable', 'ngFileUpload', 'LocalStorageModule', 'exceptionless',
'app.config', 'app.common', 'app.webservices', 'app.framework', 'app.vat', 'app.invoice', 'app.cit', 'app.assetsManage', 'pasvaz.bindonce', 'app.vatDashboard', 'app.vatDongfeng', 'vs-repeat', 'ivh.treeview', 'angular-cache',
'app.cache', 'angularBootstrapNavTree', 'ngAnimate', 'cgNotify', 'dx', 'ngNumeraljs', 'app.noPermissionPage'])
//run blocks are executed after the injector is created and are the first
//methods that are executed in any Angular app.
.run(['$log', '$http', 'CacheFactory', 'userService', 'loginContext', '$rootScope', 'vatSessionService', '$q', function ($log, $http, CacheFactory, userService, loginContext, $rootScope, vatSessionService, $q) {
$log.debug('app.run()...');
$rootScope.vatPermission = constant.vatPermission;
// 控制用户机构维度上的权限
$rootScope.checkUserOrganizationPermissionList = function (permissionCodeList) {
var deferred = $q.defer();
var promise = deferred.promise;
var model = {};
var orgID = vatSessionService.project.organizationID;
userService.getUserPermissionNew(loginContext.userName, function (data) {
permissionCodeList.forEach(function (permissionCode) {
var ret = window.PWC.isHaveOrganizationPermission(orgID, permissionCode, data);
model[permissionCode] = ret;
});
deferred.resolve(model);
});
var successFunction = function (fn) {
promise.then(function (model) {
fn(model);
});
return this;
}
return {
success: successFunction,
};
};
$rootScope.checkUserOrganizationPermissionList([]);
$rootScope.checkUserPermissionList = function (permissionCodeList) {
var deferred = $q.defer();
var promise = deferred.promise;
var model = {};
// 这种方式 重新登录,并发去后台 取数据 会出现问题
//userService.getUserPermission(loginContext.userName).success(function (data) {
// permissionCodeList.forEach(function (permissionCode) {
// var ret = window.PWC.isHavePermission(permissionCode, data);
// model[permissionCode] = ret;
// });
// deferred.resolve(model);
//});
userService.getUserPermissionNew(loginContext.userName, function (data) {
permissionCodeList.forEach(function (permissionCode) {
var ret = window.PWC.isHavePermission(permissionCode, data);
model[permissionCode] = ret;
});
deferred.resolve(model);
});
var successFunction = function (fn) {
promise.then(function (model) {
fn(model);
});
return this;
}
return {
success: successFunction,
};
};
$http.defaults.headers.common['X-XSRF-Token'] =
angular.element('input[name="__RequestVerificationToken"]').attr('value');
}])
// We always place constant at the beginning of all configuration blocks.
.constant('application', {
// the current logged on user
currentUser: {},
// convert date to display time based on current user
toDisplayTimeString: function (dateTime) {
if (!_.isDate(dateTime)) {
throw new TypeError('"dateTime" should be "Date" type!');
}
return dateTime.toString('h:mmtt').toLowerCase();
},
// define angular events for $broadcast/$emit and $on
events: {
beforeUnload: 'event:beforeUnload',
navigateToTab: 'event:navigateToTab',
showNotificationBar: 'event:showNotificationBar'
}
})
// only providers and constants should be injected in config block
.config(['$logProvider', '$translateProvider', '$translatePartialLoaderProvider', 'region', '$compileProvider',
function ($logProvider, $translateProvider, $translatePartialLoaderProvider, region, $compileProvider) {
'use strict';
// to disable various debug runtime information in the compiler to DOM elements.
$compileProvider.debugInfoEnabled(false);
// enable output $log.debug by default
$logProvider.debugEnabled(true);
// angular-translate configuration
var configurateTranslation = function () {
$translateProvider.useLoader('$translatePartialLoader', {
// the translation table are organized by language and module under folder 'app/i18n/'
urlTemplate: '/app-resources/i18n/{lang}/{part}.json'
});
$translateProvider
.preferredLanguage(region)
.fallbackLanguage(region);
//https://github.com/Contactis/translations-manager/issues/7
//https://angular-translate.github.io/docs/#/guide/19_security
$translateProvider.useSanitizeValueStrategy('escape');
};
configurateTranslation();
}
])
// IE10 fires input event when a placeholder is defined so that form element is in dirty instead of pristine state
// refer to: https://github.com/angular/angular.js/issues/2614
.config(['$provide', function ($provide) {
$provide.decorator('$sniffer', ['$delegate', function ($sniffer) {
var msieVersion = parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent)) || [])[1], 10);
var hasEvent = $sniffer.hasEvent;
$sniffer.hasEvent = function (event) {
if (event === 'input' && msieVersion === 10) {
return false;
}
hasEvent.call(this, event);
};
return $sniffer;
}]);
}])
.config(['$ExceptionlessClient', 'exceptionlessServerURL', function ($ExceptionlessClient, exceptionlessServerURL) {
if (!PWC.isNullOrEmpty(exceptionlessServerURL)) {
$ExceptionlessClient.config.apiKey = 'HK0XK49LbufV6E4q8HLW7CGncwSBJvdBrJQwUnzw';
$ExceptionlessClient.config.serverUrl = exceptionlessServerURL;
$ExceptionlessClient.config.setUserIdentity('0', 'Anonymous');
$ExceptionlessClient.config.useSessions();
$ExceptionlessClient.config.defaultTags.push('JavaScript', 'Angular');
}
}])
.config(['CacheFactoryProvider', function (CacheFactoryProvider) {
var options = {
storageMode: 'localStorage', // This cache will use `localStorage`.
storagePrefix: 'atms.'
};
if (!window.localStorage) {
options.storageImpl = localStoragePolyfill;
}
angular.extend(CacheFactoryProvider.defaults, options);
}])
.config(['ivhTreeviewOptionsProvider', function (ivhTreeviewOptionsProvider) {
ivhTreeviewOptionsProvider.set({
defaultSelectedState: false,
validate: true,
// Twisties can be images, custom html, or plain text
twistieCollapsedTpl: '<i class="fa fa-plus" aria-hidden="true"></i>',
twistieExpandedTpl: '<i class="fa fa-minus" aria-hidden="true"></i>',
twistieLeafTpl: '<span style="color:white">&#9679;</span>'
});
}])
// refer to: https://github.com/oitozero/ngSweetAlert
.factory('SweetAlert', ['$rootScope', '$log', '$translate', function ($rootScope, $log, $translate) {
$log.debug('SweetAlert.run()...');
var swal = window.swal;
//public methods
var self = {
swal: function (arg1, arg2, arg3) {
$rootScope.$evalAsync(function () {
if (typeof (arg2) === 'function') {
swal(arg1, function (isConfirm) {
$rootScope.$evalAsync(function () {
arg2(isConfirm);
});
}, arg3);
} else {
swal(arg1, arg2, arg3);
}
});
},
success: function (title, message) {
$rootScope.$evalAsync(function () {
//swal(title, message, 'success');
swal({
title: title,
text: message,
type: "success",
confirmButtonText: $translate.instant('Confirm'),
});
});
},
error: function (title, message) {
$rootScope.$evalAsync(function () {
//swal(title, message, 'error');
swal({
title: title,
text: message,
type: "error",
confirmButtonText: $translate.instant('Confirm'),
});
});
},
warning: function (title, message) {
$rootScope.$evalAsync(function () {
//swal(title, message, 'warning');
swal({
title: title,
text: message,
type: "warning",
confirmButtonText: $translate.instant('Confirm'),
});
});
},
info: function (title, message) {
$rootScope.$evalAsync(function () {
//swal(title, message, 'info');
swal({
title: title,
text: message,
type: "info",
confirmButtonText: $translate.instant('Confirm'),
});
});
}
};
return self;
}])
//turn off angular-loading-bar spinner
//refer to https://github.com/chieffancypants/angular-loading-bar
.config(['cfpLoadingBarProvider', function (cfpLoadingBarProvider) {
cfpLoadingBarProvider.includeSpinner = false;
}])
//initialize localStorage
//refer to https://github.com/grevory/angular-local-storage#get-started
.config(['localStorageServiceProvider', function (localStorageServiceProvider) {
localStorageServiceProvider.setPrefix('pwcdashboard').setStorageType('sessionStorage');
}])
// Provide the localization function for application and support async load translation table by parts on demand.
// Note: When trying to adding new translation resource into .json file, please check if the same KEY is existing
// in .json files under i18n folder. Because if two parts have the same property, the property value will be overwrited
// by the loaded last part.
// for example,
// We load app.json first and then load patient.json. "app.json" file contains a property {"Text" : "Test"}
// and "patient.json" file contains property {"Text" : "Overwrite Test"} the "Text" on view will be translated to
// be "Overwrite Test".
.factory('appTranslation', ['$log', '$translatePartialLoader', '$translate',
function ($log, $translatePartialLoader, $translate) {
'use strict';
$log.debug('appTranslation.ctor()...');
var translation = {
// part names for modules
// AppPart is for the translation of application level, not for a module for a business logic.
appPart: 'app',
vat: 'vat',
cit: 'cit',
noPermissionPage: 'noPermissionPage',
/// <summary>
/// async load translation tables into application for specified part names that required for the view.
/// </summary>
/// <param name="partNames">part names of array type</param>
load: function (partNames) {
if (!angular.isArray(partNames)) {
throw new TypeError('"partNames" should be an array!');
}
partNames.forEach(function (name) {
$translatePartialLoader.addPart(name);
});
$translate.refresh();
},
loadAll: function () {
_.map(_.values(translation), function (part) {
if (_.isString(part)) {
$translatePartialLoader.addPart(part);
}
});
$translate.refresh();
}
};
return translation;
}
])
.controller('AppController', ['$scope', '$log', '$location', '$translate', '$translatePartialLoader',
'$window', 'appRoute', 'application', 'appTranslation', '$timeout', '$uibModal', 'loginContext', '$ExceptionlessClient', 'signalRSvc',
'exceptionlessServerURL', function ($scope, $log, $location, $translate, $translatePartialLoader, $window, appRoute,
application, appTranslation, $timeout, $uibModal, loginContext, $ExceptionlessClient, signalRSvc, exceptionlessServerURL) {
'use strict';
$log.debug('AppController.ctor()...');
$scope.localName = loginContext.localName;
if (!PWC.isNullOrEmpty(exceptionlessServerURL)) {
$ExceptionlessClient.config.setUserIdentity(loginContext.userId, loginContext.localName);
$ExceptionlessClient.config.useSessions();
}
$scope.$on('$locationChangeSuccess', function () {
$scope.actualLocation = $location.path();
});
$scope.$watch(function () { return $location.path() }, function (newLocation) {
if ($scope.actualLocation === newLocation) {
// back or forward
$log.debug('Go back or go forward to view browser history. Url: ' + newLocation);
}
});
$scope.$on('$stateChangeSuccess',
function () {
$log.debug('$stateChangeSuccess: ');
});
// publish unbeforeunload event to child scopes
$scope.onbeforeunload = function () {
$scope.$broadcast(application.events.beforeUnload);
};
$scope.main = function () {
$location.path('/main');
$location.url('main');
};
$scope.createDemo = function () {
$location.path('/accountDemo');
$location.url($location.path());
};
appTranslation.loadAll();
signalRSvc.initialize();
}
]);
\ No newline at end of file
......@@ -12,8 +12,9 @@
}, apiConfig.createVat());
},
queryOutputInvoiceItemList: function (invoiceID) {
return $http.get('/outputInvoiceImport/queryOutputInvoiceItemList/' + invoiceID, apiConfig.createVat());
approvalTasks: function () {
var assignee='accountant';
return $http.get('/approval/tasks/'+assignee, apiConfig.createVat());
},
getExportOutputInvoiceList: function (param) {
......
frameworkModule.controller('appApproveController', ['$rootScope', '$scope', '$timeout', '$q', '$log', '$translate', '$state', '$interval',
'uiGridConstants', 'projectService', 'vatSessionService', 'orgService', 'serviceTypeService', 'userService', 'loginContext', 'enums',
'citSessionService', 'region', 'SweetAlert', 'productService', 'localStorageService', 'assetsManageSessionService','serviceLogService',
'ackUibModal', 'Upload', 'apiInterceptor','vatApproveService',
function ($rootScope, $scope, $timeout, $q, $log, $translate, $state, $interval, uiGridConstants, projectService, vatSessionService,
orgService, serviceTypeService, userService, loginContext, enums, citSessionService, region, SweetAlert, productService,
localStorageService, assetsManageSessionService, serviceLogService, ackUibModal, Upload, apiInterceptor, vatApproveService) {
'use strict';
$log.debug('appApproveController.ctor()...');
var uploadUrl = apiInterceptor.webApiHostUrl + '/product/NewFile';
var resumable = true;
$scope.chunkSize = 100000;
$scope.conditionChange = false;
var token = $('input[name="__RequestVerificationToken"]').val();
//**********************************************************************************************
$scope.dateFormat = $translate.instant('dateFormat4Year');
//always select a month before current month: update the year if the current month is Jan.(1)
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth();
//$scope.selectedDate = new Date(year, month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1);
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.selectedStartDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.serviceTypeId = $scope.servicetypeid.toString();
$scope.ongoingNum = 0;
$scope.notBeginNum = 0;
$scope.completedNum = 0;
//*************************************************************************************************
$scope.randomCounter = 0;
$scope.allResults = [];
$scope.checkedOrgs = {};
$scope.orgList = [];
$scope.orderYear = true;
$scope.orderName = true;
$scope.orderStatus = true;
$scope.orderType = true;
$scope.isFirst = true;
$scope.haveVatPermission = false;
$scope.currentSelectedMonth = vatSessionService.month;
$scope.currentSelectedYear = vatSessionService.year;
var thisData = {
userPermission: {}
};
userService.getUserByName(loginContext.userName).success(function (userData) {
vatSessionService.logUser = userData;
});
//设置项目状态Title
function setLayoutStatusTitle(statusIds) {
var currentMonth = vatSessionService.month;
var statusId;
if (statusIds === null || (statusIds !== null && statusIds[currentMonth] === undefined))
statusId = 0;
else {
statusId = statusIds[currentMonth];
}
var status = "../../../app-resources/images/overview/";
if (region === 'zh-CN') {
status += 'zh-CN';
}
else {
status += 'en-US';
}
switch (statusId) {
case constant.ProjectStatusEnum.UnStarted:
status += "/01.png"; //$translate.instant('ProjectStatusUnStarted');
break;
case constant.ProjectStatusEnum.Imported:
status += "/02.png"; // $translate.instant('ProjectStatusImported');
break;
case constant.ProjectStatusEnum.AccountMapSubmitted:
status += "/03.png";// $translate.instant('ProjectStatusAcccountMapSubmitted');
break;
case constant.ProjectStatusEnum.Generated:
status += "/04.png";// $translate.instant('ProjectStatusGenerated');
break;
case constant.ProjectStatusEnum.ReportSubmitted:
status += "/05.png"; //$translate.instant('ProjectStatusReportSubmitted');
break;
case constant.ProjectStatusEnum.ReportApproved:
status += "/07.png"; //$translate.instant('ProjectStatusReportApproved');
break;
case constant.ProjectStatusEnum.ReportRejected:
status += "/06.png"; //$translate.instant('ProjectStatusReportRejected');
break;
case constant.ProjectStatusEnum.Completed:
status += "/08.png";// $translate.instant('ProejctStatusCompleted');
break;
default:
status += "/01.png";
}
return status;
}
// TODO: REAL Translation for Industry and Region
$scope.smartSearch = function (isReset) {
if (isReset) {
$scope.searchKeyword = "";
}
vatSessionService.queryDto.searchKeyword = $scope.searchKeyword;
if ($scope.serviceTypeId !== '12') {
$scope.query();
}
};
$scope.query = function () {
if (!$scope.allResults) return;
var temp = $scope.allResults;
if ($scope.checkedOrgs && _.keys($scope.checkedOrgs).length > 0) {
temp = _.filter(temp, function (i) {
return _.contains(_.values($scope.checkedOrgs), i.organizationName);
});
}
if ($scope.serviceTypeId) {
temp = _.filter(temp, function (i) {
return $scope.serviceTypeId == i.serviceTypeID;
});
}
if (vatSessionService.year) {
if ($scope.serviceTypeId === enums.serviceType.VAT) {
temp = _.filter(temp, function (i) {
if (i.startPeriod <= vatSessionService.month && i.endPeriod >= vatSessionService.month && i.year == vatSessionService.year) {
return i;
}
});
}
else if ($scope.serviceTypeId === enums.serviceType.CIT) {
temp = _.filter(temp, function (i) {
return vatSessionService.year == i.year;
});
}
}
if ($scope.checkedRegions && $scope.checkedRegions.length > 0) {
temp = _.filter(temp, function (i) {
return _.contains(_.pluck($scope.checkedRegions, 'name'), i.region);
});
}
if ($scope.checkedStatus && $scope.checkedStatus.length > 0) {
temp = _.filter(temp, function (i) {
return _.contains(_.pluck($scope.checkedStatus, 'name'), i.status);
});
}
if ($scope.searchKeyword !== undefined && $scope.searchKeyword.length > 0) {
temp = _.filter(temp, function (i) {
return (i.name.toUpperCase().indexOf($scope.searchKeyword.toUpperCase()) > -1 || i.organizationName.toUpperCase().indexOf($scope.searchKeyword.toUpperCase()) > -1);
// return $scope.selectedService.id == i.serviceTypeID
})
}
var demoData = $scope.demoDataWithStateSaved(temp);
var counter = 0;
var setWarningToTrue = false;
temp.forEach(function (project) {
setWarningToTrue = false;
project.finalStatus = setLayoutStatusTitle(project.projectStatusList);
project.periodDate = $scope.currentSelectedYear + "." + $scope.currentSelectedMonth;
var oneDemoData = _.find(demoData, function (one) { return one.id === project.id });
if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.projectStatusList !== null && project.projectStatusList[vatSessionService.month] !== undefined && project.projectStatusList[vatSessionService.month] !== 10 && oneDemoData!==undefined) {
project.taxAmount = oneDemoData.taxAmount;
project.prepadidTaxAmount = oneDemoData.prepadidTaxAmount;
project.taxRate = oneDemoData.taxRate;
project.hasWarning = oneDemoData.hasWarning;
}
}
counter++;
});
$scope.queryResults = temp;
$scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length });
var notBeginTemp = _.filter(temp, function (i) {
if (i.serviceTypeID === enums.serviceType.VAT)
return ((i.projectStatusList === null || (i.projectStatusList !== null && i.projectStatusList[vatSessionService.month] === undefined) || (i.projectStatusList !== null && i.projectStatusList[vatSessionService.month] === 10)));
else
return ((i.projectStatusList === null || (i.projectStatusList !== null && Object.keys(i.projectStatusList).length === 0) || i.projectStatusList[Object.keys(i.projectStatusList)[Object.keys(i.projectStatusList).length - 1]] === 10));
});
if (notBeginTemp) {
$scope.notBeginNum = notBeginTemp.length;
}
var completedTemp = _.filter(temp, function (i) {
if (i.serviceTypeID === enums.serviceType.VAT) {
if (i.projectStatusList && i.projectStatusList[vatSessionService.month] != null) {
return i.projectStatusList[vatSessionService.month] === 100;
}
}
else {
if (i.projectStatusList && i.projectStatusList.length > 0) {
return i.projectStatusList[Object.keys(i.projectStatusList)[Object.keys(i.projectStatusList).length - 1]] === 100;
}
}
});
if (completedTemp) {
$scope.completedNum = completedTemp.length;
}
$scope.ongoingNum = $scope.queryResults.length - $scope.notBeginNum - $scope.completedNum;
};
$scope.demoDataWithStateSaved = function (temp) {
var demoData = [];
var data;
var demoDataComposedByLocalStorage = $scope.serviceTypeId + "_" + vatSessionService.year + "_" + vatSessionService.month;
data = localStorageService.get(demoDataComposedByLocalStorage);
if (data === null || data.length === 0) {
var counter = 0;
var everyXnumberToSetTrue = 3;
var dData;
// Set State:
temp.forEach(function (item) {
dData = new Object();
//generate random data
dData.id = item.id;
dData.taxAmount = randomXToY(10000, 99999999, 2);
dData.prepadidTaxAmount = randomXToY(10000, 99999999, 2);
dData.taxRate = randomXToY(1, 35, 0);
dData.hasWarning = false;
if (counter >= everyXnumberToSetTrue && (counter % everyXnumberToSetTrue === 0))
dData.hasWarning = true;
demoData.push(dData);
counter++;
});
localStorageService.set(demoDataComposedByLocalStorage, demoData);
}
else {
// Get from State:
demoData = localStorageService.get(demoDataComposedByLocalStorage);
}
return demoData;
};
var thisDataService = {
isHaveOrganizationPermission: function (orgID) {
var permission = thisData.userPermission;
var isShow = false;
if (permission) {
if (permission.isSuperAdmin || permission.isADUser) {
isShow = true;
} else {
// 查找机构
var findOrg = _.find(permission.organizationPermissionList, function (num) {
return num.id === orgID;
});
if (findOrg && findOrg.permissionList && findOrg.permissionList.length > 0) {
// 查看具体权限
isShow = true;
}
}
}
return isShow;
},
};
var initDatePickers = function () {
if ($scope.serviceTypeId === enums.serviceType.CIT) {
$scope.systemTitle = $translate.instant('CIT');
$scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4Year');
}
if ($scope.serviceTypeId === enums.serviceType.VAT) {
$scope.systemTitle = $translate.instant('增值税申报');
$scope.viewMode = 1;
$scope.dateFormat = $translate.instant(' yyyy 年 mm 月');
}
var ele1 = $("#overviewDatepicker");
ele1.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
viewMode: $scope.viewMode,
minViewMode: $scope.viewMode,
autoclose: true, //选中之后自动隐藏日期选择框
clearBtn: true, //清除按钮
todayBtn: false, //今日按钮
format: $scope.dateFormat //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (e) {
$scope.changeDate(e);
});
ele1.datepicker("setDate", $scope.selectedDate);
};
$scope.changeStartDate = function (e) {
if (e&&e.date) {
var tempYear = e.date.getFullYear();
var tempMonth = e.date.getMonth() + 1;
$scope.currentSelectedStartMonth = tempMonth;
$scope.currentSelectedStartYear = tempYear;
}
};
$scope.changeDate = function (e) {
if (e && e.date) {
var isDateUpdated = false;
var tempYear = e.date.getFullYear();
var tempMonth = e.date.getMonth() + 1;
if (tempYear !== vatSessionService.year || tempMonth !== vatSessionService.month) {
isDateUpdated = true;
}
vatSessionService.year = tempYear;
vatSessionService.month = tempMonth;
$scope.currentSelectedMonth = tempMonth;
$scope.currentSelectedYear = tempYear;
if (isDateUpdated) {
//$scope.$apply(function () {
// $scope.conditionChange = !$scope.conditionChange;
//});
$timeout(function () {
$scope.conditionChange = !$scope.conditionChange;
});
}
}
};
var orgDisplay = {
orgList: [],
grayColorD9: '#d9d9d9',
currentIdcol: '',
currentNamecol: 'orgName',
activeColor: 'black',
activeBackgroundColor: '#fbf8f5',
whiteColor: 'white',
main: function () {
$scope.dimensionOrgShow = function (idcol, namecol) {
orgDisplay.showBusy();
vatSessionService.queryDto.fieldId = idcol;
vatSessionService.queryDto.filedName = namecol;
orgDisplay.currentIdcol = idcol;
orgDisplay.currentNamecol = namecol;
$('.operate-icon').css('background-color', orgDisplay.whiteColor);
$('.operate-icon i').css('color', orgDisplay.grayColorD9);
$scope.checkedOrgs = {};
//$scope.query();
var orgData = [];
if (idcol) {
orgData = orgDisplay.otherShow(idcol, namecol);
} else {
orgData = orgDisplay.orgShow();
}
$('.' + namecol).css('color', orgDisplay.activeColor);
$('.' + namecol).parent().css('background-color', orgDisplay.activeBackgroundColor);
$timeout(function () {
orgDisplay.hideBusy();
if ($scope.isFirst) {
$scope.setTreeChecked(orgData);
$scope.isFirst = false;
}
$scope.orgData = orgData;
}, 50);
};
orgDisplay.getOrgData();
},
getOrgData: function () {
orgService.getOrgListLevel().success(function (data) {
if (!data) {
data = [];
}
var result = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (thisDataService.isHaveOrganizationPermission(item.id)) {
result.push(item);
}
}
orgDisplay.orgList = result;
//$scope.dimensionOrgShow('', 'orgName');
$scope.dimensionOrgShow(vatSessionService.queryDto.fieldId, vatSessionService.queryDto.filedName);
});
// orgDisplay.orgList = testOrgList;
},
orgShow: function () {
var showList = angular.copy(orgDisplay.orgList);
// 构造父子节点
for (var i = 0; i < showList.length; i++) {
var item = showList[i];
if (item.parentID === null) {
continue;
}
var parentNode = _.find(showList, function (num) {
return num.id === item.parentID
});
if (parentNode) {
continue;
}
item.parentID = orgDisplay.getParentID(item, orgDisplay.orgList, showList);
}
var idList = _.pluck(showList, 'id');
var topNodeList = _.filter(showList, function (org) {
return idList.indexOf(org.parentID) === -1;
});
var orgList = [];
topNodeList.forEach(function (org) {
var item = {
id: org.id,
name: org.name
};
var tempList = orgDisplay.getSubOrgDropDownList(org, showList);
item.subOrgs = tempList;
// 构造子节点
orgList.push(item);
// orgList = _.union(orgList, tempList);
});
return orgList;
},
// 获取父节点
getParentID: function (current, allList, orgDtoList) {
if (current.parentID === null) {
return null;
}
var findParent = _.find(allList, function (num) {
return num.id === current.parentID;
});
if (!findParent) {
return null;
}
var parent = _.find(orgDtoList, function (num) {
return num.id === findParent.id;
});
if (parent != null) {
return parent.id;
} else {
return orgDisplay.getParentID(findParent, allList, orgDtoList);
}
},
getSubOrgDropDownList: function (current, showList) {
var sublist = _.filter(showList, function (row) {
return row.parentID === current.id;
});
var list = [];
if (!sublist || sublist.length === 0) {
return list;
}
sublist.forEach(function (row) {
var item = {
id: row.id,
name: row.name,
parentID: current.id,
expanded: true,
};
var tempList = orgDisplay.getSubOrgDropDownList(row, showList);
item.subOrgs = tempList;
list.push(item);
});
return list;
},
otherShow: function (idcol, namecol) {
var showList = angular.copy(orgDisplay.orgList);
var otherList = orgDisplay.getMap(showList, idcol, namecol);
var list = [];
otherList.forEach(function (other) {
var item = other;
item.dimensionId = idcol;
item.subOrgs = _.filter(showList, function (t) {
return t[idcol] === other.id;
});
list.push(item);
});
return list;
},
getMap: function (data, idCol, nameCol) {
if (data && data.length > 0) {
var idList = _.uniq(_.pluck(data, idCol));
var list = [];
idList.forEach(function (row) {
if (row) {
var findOne = _.find(data, function (o) {
return o[idCol] === row;
});
if (findOne && findOne[nameCol]) {
list.push({
id: row,
name: findOne[nameCol],
selected: true,
});
}
}
});
return list;
} else {
return [];
}
},
showBusy: function () {
$('#busy-indicator-container').show();
},
hideBusy: function () {
$('#busy-indicator-container').hide();
}
};
$scope.setTreeChecked = function (dataList) {
if (dataList && dataList.length > 0 && _.keys(vatSessionService.queryDto.checkedOrgs).length > 0) {
dataList.forEach(function (v) {
if (vatSessionService.queryDto.checkedOrgs[v.id]) {
v.isChecked = true;
}
if (v.subOrgs && v.subOrgs.length > 0) {
$scope.setTreeChecked(v.subOrgs);
}
});
}
}
//function to get random number upto m
function randomXToY(minVal, maxVal, floatVal) {
var randVal = minVal + (Math.random() * (maxVal - minVal));
return typeof floatVal == 'undefined' ? Math.round(randVal) : randVal.toFixed(floatVal);
}
var loadApprovalFromDB = function (pageIndex) {
vatApproveService.approvalTasks().success(function (data) {
if (data) {
var index = 1;
data.forEach(function (v) {
v.index = index++;
v.amount = PWC.round(v.amount, 2);
v.taxAmount = PWC.round(v.taxAmount, 2);
});
$scope.gridOptions.data = data;
}
});
};
(function initialize() {
initDatePickers();
$scope.updateStatus = false;
userService.getUserPermission(loginContext.userName).success(function (userPermission) {
thisData.userPermission = userPermission;
userPermission.permissionList.forEach(function (p) {
if (p.code.startWith('02')) {
$scope.haveVatPermission = true;
return;
}
});
vatSessionService.userPermission = userPermission;
orgDisplay.main();
loadApprovalFromDB();
});
/**
private String projectName;
private Integer period;
private String instanceId;
private String createBy;
private String approvalBy;
private String status;
private String approvalResult;
private Date createTime;
private Date approvalTime;
private String reportPaths;
*/
$scope.gridOptions = {
rowHeight: constant.UIGrid.rowHeight,
selectionRowHeaderWidth: constant.UIGrid.rowHeight,
virtualizationThreshold: 50,//默认加载50条数据,避免在数据展示时,只显示前面4条
enableSorting: false,
enableColumnMenus: false,
columnDefs: [
{ name: '序号', width: '7%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>' },
{ name: '项目名称', width: '12%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.projectName}}<span></div>' },
{ name: '期间', width: '7%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.period}}<span></div>' },
{ name: '提审人', width: '10%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.createBy}}</span></div>' },
{ name: '审批人', width: '10%', cellTemplate: '<div class="ui-grid-cell-contents"><span> {{row.entity.approvalBy}}</span></div>' },
{ name: '审批状态', width: '10%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.status}}</span></div>' },
{ name: '审批意见', width: '15%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.approvalResult}}</span></div>' },
{ name: '创建时间', width: '7.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.createTime | date:"yyyy-MM-dd"}}</span></div>' },
{ name: '审批时间', width: '7.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.approvalTime | date:"yyyy-MM-dd"}}</span></div>' },
{ name: '操作', width: '15%', cellTemplate: '<div class="ui-grid-cell-contents"><span>审批</span>|<span>下载</span>|<span>流程图</span></div>' }
]
};
})();
}
]);
<div id="app-approve" class="app-overview ">
<div class="app-overview-left">
<div class="group-operate-icon" style="margin-bottom: 5px;">
<span class="operate-icon left-first" title="机构" ng-click="dimensionOrgShow('','orgName')"><i
class="fa fa-sitemap fa-2x orgName" aria-hidden="true"></i></span><span class="operate-icon"
title="事业部"
ng-click="dimensionOrgShow('businessUnitID','businessUnitName')">
<i class="fa fa-bank fa-2x businessUnitName" aria-hidden="true"></i>
</span><span class="operate-icon" title="区域" ng-click="dimensionOrgShow('areaID','areaName')">
<i class="material-icons areaName">place</i>
</span><span class="operate-icon" title="机构层级" ng-click="dimensionOrgShow('structureID','structureName')">
<i class="fa fa-mortar-board fa-2x structureName"></i>
</span><span class="operate-icon" title="行业" ng-click="dimensionOrgShow('industryID','industryName')">
<i class="fa fa-bars fa-2x industryName" aria-hidden="true"></i>
</span>
</div>
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20">
<div ui-tree data-drag-enabled="false">
<ul ui-tree-nodes="" ng-model="orgData">
<li ng-repeat="item in orgData track by $index" ui-tree-node ng-include="'tree_view_template'">
</li>
</ul>
</div>
</perfect-scrollbar>
</div>
<div class="app-overview-right">
<div class="row" style="margin:20px; display:none;">
<div class="col-lg-2 col-md-2 col-sm-2">
<span class="textLabelHeader" translate="TotalProjectRecords"></span> <span class="textLabelHeader">{{queryResults.length}}</span>
<span translate="NumberOfTaskes"></span>
</div>
<div class="col-lg-8 col-md-8 col-sm-8">
<span translate="CurrentlyInProgress" class=""> </span> <i
class="badge progressNumberBadges marginRight10">3</i>
<span translate="AlreadyCompleted" class=""> </span> <i
class="badge progressNumberBadges marginRight10">4</i>
<span translate="NotYetStart" class=""> </span> <i
class="badge progressNumberBadges marginRight10 ">5</i>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<div id="app-workflow-action-panel" class="pull-right">
<i class="fa fa-calendar red-color" style="font-size:20px;"></i>
<input type="text" class="datepicker"
style="border-width: 0; outline: none; width: 100px; cursor: pointer; z-index: 1000"
readonly="readonly"/>
<i class="fa fa-caret-down red-color" style="font-size:10px;"></i>
</div>
</div>
</div>
<div style="display:none;">
<span translate="AssignmentsList" class="textLabelHeader"></span>
<hr/>
</div>
<div class="new-right-header">
<div class="head-row">
<span class="total-projects">报表审批</span>
</div>
<div class="project-staus">
<span style="padding-right: 10px;" class="result-style">{{projectMsg}}</span>
<span style="padding-right:10px;">提审中</span><span class="num-style">{{ongoingNum}}</span>
<span style="padding-right:10px;padding-left:20px;">通过</span><span
class="num-style">{{notBeginNum}}</span>
<span style="padding-right:10px;padding-left:20px;">未通过</span><span
class="num-style">{{completedNum}}</span>
<span style="padding-right:10px;padding-left:20px;">作废</span><span
class="num-style">{{completedNum}}</span>
</div>
<div class="task-list">
<span class="taskMsg" ng-show="serviceTypeId !=='12'">审批列表</span>
</div>
</div>
<div class="new-right-body">
<div class="right-header">
<div class="col-lg-3 col-md-3" style="padding-left:20px;">
<div class="search-container">
<input id="txtSmartSearch" class="search-input" type="text" value="" placeholder="提审人"
ng-model="searchKeyword" ng-change="smartSearch(false)"/><span
ng-class="(searchKeyword!==undefined && searchKeyword.length>0)? 'glyphicon glyphicon-remove input-group-addon search-icon':'glyphicon glyphicon-search input-group-addon search-icon'"
search ng-click="smartSearch(true)"></span>
</div>
</div>
<div class="overview-picker">
<input type="text" id="overviewDatepicker" class="datepicker vat-subheader" style="width:120px;"
readonly="readonly"/>
<i class="fa fa-calendar vat-subheader red-color" style="width:20px;"></i>
</div>
<span class="clear"></span>
</div>
<div class="vat-preview-input-invoice" id="mainPreviewDiv">
<div id="mainAreaDiv" class="main-area">
<div class="inputInvoiceGrid" ui-grid-expandable ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
frameworkModule.directive('appApprove', ['$log', 'region', 'enums',
function ($log, region, enums) {
'use strict';
$log.debug('appOverview.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/framework/app-approve/app-approve.html' + '?_=' + Math.random(),
replace: true,
scope: {
servicetypeid : '='
},
controller: 'appApproveController',
link: function ($scope, $element, $attr) {
var ele = $(".datepicker");
ele.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
viewMode: 1,
minViewMode: 1,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: false,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (e) {
$scope.changeDate(e);
});
ele.datepicker("setDate", $scope.selectedDate);
$scope.elePicker = ele;
}
};
}
]);
\ No newline at end of file
......@@ -20,6 +20,11 @@
<span class="nav-icon-color">{{'MenuVAT' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
<a ui-sref="listApproval">
<span class="nav-icon-color">{{'报表审批' | translate}}</span>
</a>
</div>
<!--<div class="nav-element-left">-->
<!--<a ui-sref="summaryDashboard" hover-show="second">-->
<!--<span class="nav-icon-color">{{'MenuTaxAnalysisPlatform' | translate}}</span>-->
......
webservices.factory('vatSessionService', ['$log', 'localStorageService', function ($log, localStorageService) {
'use strict';
$log.debug('vatSessionService.ctor()...');
var date = new Date();
var month = date.getMonth();
var projectyear = date.getFullYear();
if (month <= 0) {
month = 1;
}
var logUser =
{
ID: "66933E7B-DA75-4B2E-B7D6-AB65DCA20D50",
UserName: "Admin",
};
var userPermission = {};
var queryDto = {
searchKeyword: '',
fieldId: '',
filedName: 'orgName',
checkedOrgs: {},
};
var reset = function () {
var date = new Date();
var m = date.getMonth();
if (m <= 0) {
m = 1;
}
this.month = m;
setProperty("month", m);
};
var cacheObj = {
month: month,
userPermission: {},
project: { year: 2017 },
projects: [],
dataChanged: false
};
var temp = localStorageService.get('tesla-cache');
if (temp) {
cacheObj = temp;
} else {
localStorageService.set('tesla-cache', cacheObj);
}
var setProperty = function (propertyName, propertyValue) {
cacheObj[propertyName] = propertyValue
//$cookieStore.put('tesla-cache', JSON.stringify(apiTokenObj));
localStorageService.set('tesla-cache', cacheObj);
}
var getProperty = function (propertyName) {
//console.log($cookieStore.get('tesla-cache'));
return cacheObj[propertyName];
}
// 跳转到admin或者outputinvoice management 需要清空所选择的project,不然会影响权限
var clearSelectProject = function () {
var tempProject = { year: 2017 };
setProperty('project', tempProject);
};
return {
month: month,
year: projectyear,
project: { year: 2017 },
projects: [],
dataChanged: false,
logUser: logUser,
reset: reset,
userPermission: userPermission,
queryDto: queryDto,
setProperty: setProperty,
getProperty: getProperty,
clearSelectProject: clearSelectProject,
}
}]);
\ No newline at end of file
//Common Bind Module Method
var bindModule = function (thisModule, controllerProvider, compileProvider, filterProvider, provide) {
thisModule.controller = controllerProvider.register;
thisModule.directive = compileProvider.directive;
thisModule.filter = filterProvider.register;
thisModule.factory = provide.factory;
thisModule.service = provide.service;
return thisModule;
};
// register common module for shared functionalities for all other feature modules
var commonModule = angular.module('app.common', ['pascalprecht.translate', 'ngAnimate', 'ui.grid', 'ui.grid.selection', 'ui.grid.selection', 'ui.grid.treeView', 'ui.grid.resizeColumns', 'ui.grid.grouping', 'ui.grid.exporter', 'app.config', 'ui.grid.edit'])
.run(['$log', function ($log) {
$log.debug('app.common.run()...');
}])
// define the script files for lazy loading and method to create depencency map for resovle config in route
.provider('scriptDependency', ['version', function (version) {
'use strict';
// Here must add version parameter ?v=***,
// to solve the problem that the bundle is not refreshed when its content changed.
this.commdataimport = [{
url: '/bundles/commdataimport.js?v=' + version,
type: 'text/javascript'
}, {
url: '/bundles/commdataimport.css?v=' + version,
type: 'text/css'
}];
this.vat = [{
url: '/bundles/vat.js?v=' + version,
type: 'text/javascript'
}, {
url: '/bundles/vat.css?v=' + version,
type: 'text/css'
}, {
url: '/bundles/vat.less?v=' + version,
type: 'text/css'
}];
this.cit = [{
url: '/bundles/cit.js?v=' + version,
type: 'text/javascript'
}, {
url: '/bundles/cit.css?v=' + version,
type: 'text/css'
}, {
url: '/bundles/cit.less?v=' + version,
type: 'text/css'
}];
this.noPermissionPage = [{
url: '/bundles/noPermissionPage.js?v=' + version,
type: 'text/javascript'
}, {
url: '/bundles/noPermissionPage.less?v=' + version,
type: 'text/css'
}];
this.assetsManage = [{
url: '/bundles/assetsManage.js?v=' + version,
type: 'text/javascript'
}, {
url: '/bundles/assetsManage.css?v=' + version,
type: 'text/css'
}, {
url: '/bundles/assetsManage.less?v=' + version,
type: 'text/css'
}];
this.summary = [
// {
// url: '/bundles/summary.js?v=' + version,
// type: 'text/javascript'
//},
{
url: '/bundles/summary.css?v=' + version,
type: 'text/css'
}];
this.createDependenciesMap = function (dependencies) {
if (!angular.isArray(dependencies)) {
throw new TypeError('"scriptUrls" should be an array type!');
}
var dependenciesMap = {
dependency: ['$q', '$rootScope',
function ($q, $rootScope) {
var deferred = $q.defer();
PWC.Loader.load(dependencies, function (hasNewJsLoaded) {
// If has new JavaScript resource loaded, should call $apply, otherwise,
// should not call it.
if (hasNewJsLoaded) {
$rootScope.$apply(function () {
deferred.resolve();
});
} else {
deferred.resolve();
}
});
return deferred.promise;
}
]
};
return dependenciesMap;
};
this.$get = function () {
return {
createDependenciesMap: createDependenciesMap,
infrastructure: infrastructure,
vat: vat,
cit: cit,
assetsManage: assetsManage,
noPermissionPageModule: noPermissionPageModule
//subjectCorrespondingInfrastructure: subjectCorrespondingInfrastructure
//subjectCorresponding: subjectCorresponding,
//configurationInfrastructure: configurationInfrastructure,
//declarationFormConfiguration: declarationFormConfiguration
};
};
}]);
// register services module
var webservices = angular.module('app.webservices', ['app.common'])
.run(['$log', function ($log) {
$log.debug('app.webservices.run()...');
}]);
// register framework module for application framework
var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.common'])
.run(['$log', function ($log) {
$log.debug('app.framework.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', 'scriptDependencyProvider', '$stateProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, scriptDependencyProvider, $stateProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(frameworkModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'overview',
url: '/overview',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.appPart]);
}],
template: '<app-overview servicetypeid="2"></app-overview>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'notification',
url: '/notification',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.appPart]);
}],
template: '<app-push-notification></app-push-notification>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'overviewVat',
url: '/overview/vat',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat,appTranslation.appPart]);
}],
template: '<app-overview servicetypeid="2"></app-overview>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
/*$stateProvider.state({
name: 'overviewAssetsManage',
url: '/overview/assetsManage',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.appPart]);
}],
template: '<app-overview servicetypeid="12"></app-overview>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'overviewCit',
url: '/overview/cit',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.appPart]);
}],
template: '<app-overview servicetypeid="6"></app-overview>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'summary',
url: '/summary',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.appPart]);
}],
template: '<app-summary></app-summary>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.summary),
deepStateRedirect: true,
sticky: true
});*/
}
]);
// register cache module for application framework
var cacheModule = angular.module('app.cache', ['app.common'])
.run(['$log', 'cacheService', function ($log, cacheService) {
$log.debug('app.cache.run()...');
}]);
var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngAnimate', 'ngSanitize', 'ui.bootstrap', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning',])
.run(['$log', function ($log) {
$log.debug('app.vat.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(vatModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
uiSelectConfig.theme = 'select2';
$stateProvider.state({
name: 'vat',
url: '/vat',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-layout></vat-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData',
url: '/importData',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-layout></vat-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.balanceSheet',
url: '/balanceSheet',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-trial-balance></vat-import-trial-balance>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.journalEntry',
url: '/journalEntry',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-journal-entry></vat-import-journal-entry>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.erpData',
url: '/erpData',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-erp></vat-import-erp>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.outputInvoice',
url: '/outputInvoice',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-output-invoice></vat-import-output-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.inputInvoice',
url: '/inputInvoice',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-income-invoice></vat-import-income-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.customInvoice',
url: '/customInvoice',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-custom-invoice></vat-import-custom-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.voucherMapping',
url: '/voucherMapping',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-voucher-mapping></vat-voucher-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.invoiceMapping',
url: '/invoiceMapping',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-invoice-mapping></vat-invoice-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.importData.auditAdjust',
url: '/auditAdjust',
views: {
'@vat.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-audit-adjust></vat-audit-adjust>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData',
url: '/previewData',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-layout></vat-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.balanceSheet',
url: '/balanceSheet',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-balance-sheet></vat-preview-balance-sheet>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.accountVoucher',
url: '/accountVoucher',
views: {
'@vat.previewData': {
controller: [
'$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}
],
template: '<vat-preview-account-voucher></vat-preview-account-voucher>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.outputInvoice',
url: '/outputInvoice',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-output-invoice></vat-preview-output-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.inputInvoice',
url: '/inputInvoice',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-input-invoice></vat-preview-input-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.customInvoice',
url: '/customInvoice',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-custom-invoice-sheet></vat-preview-custom-invoice-sheet>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.reductionData',
url: '/reductionData',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-import-layout></vat-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
// $stateProvider.state({
// name: 'vat.reductionData.accountMapping',
// url: '/accountMapping',
// views: {
// '@vat.reductionData': {
// controller: ['$scope', '$stateParams', 'appTranslation',
// function ($scope, $stateParams, appTranslation) {
// appTranslation.load([appTranslation.vat]);
// }],
// template: '<vat-account-mapping></vat-account-mapping>',
// }
// },
// resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
// deepStateRedirect: true,
// sticky: true
// });
//
// $stateProvider.state({
// name: 'vat.reductionData.goodsMapping',
// url: '/goodsMapping',
// views: {
// '@vat.reductionData': {
// controller: ['$scope', '$stateParams', 'appTranslation',
// function ($scope, $stateParams, appTranslation) {
// appTranslation.load([appTranslation.vat]);
// }],
// template: '<vat-goods-mapping></vat-goods-mapping>',
// }
// },
// resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
// deepStateRedirect: true,
// sticky: true
// });
$stateProvider.state({
name: 'vat.reductionData.caculateData',
url: '/caculateData',
views: {
'@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-caculate-data></vat-caculate-data>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.reductionData.inputInvoice',
url: '/inputInvoice',
views: {
'@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<p>inputInvoice</p>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.reductionData.unbilledInvoice',
url: '/unbilledInvoice',
views: {
'@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-unbilled-invoice></vat-unbilled-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.generateReport',
url: '/generateReport',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
$scope.isFromTopMenu = true;
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-report-layout></vat-report-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.generateReport.reportView',
url: '/reportView?{id:string}&{templateid:string}&{name:string}&{templatecode:string}',
views: {
'@vat.generateReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
$scope.reportId = $stateParams.id;
$scope.templateId = $stateParams.templateid;
$scope.templateName = $stateParams.name;
$scope.templateCode = $stateParams.templatecode;
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-report-view report-id="reportId" template-id="templateId" template-name="templateName" template-code="templateCode" ></vat-report-view>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
/**********a beautiful separated line for analyzeReport*********/
$stateProvider.state({
name: 'vat.analyzeLayout',
url: '/analyzeLayout',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-analysis-menu></vat-analysis-menu>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeLayout.analyzeReport',
url: '/analyzeReport',
views: {
'@vat.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-model-analysis></vat-model-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeLayout.vatTaxDifference',
url: '/vatTaxDifference',
views: {
'@vat.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-tax-difference></vat-tax-difference>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeReport',
url: '/analyzeReport',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-model-analysis></vat-model-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeReport.dataSummary',
url: '/dataSummary',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-data-summary></vat-data-summary>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeReport.vatAnalysis',
url: '/vatAnalysis',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-vat-analysis></vat-vat-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeReport.financeTargetAnalysis',
url: '/financeTargetAnalysis',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-finance-target-analysis></vat-finance-target-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.analyzeReport.vatModelAnalysis',
url: '/vatModelAnalysis',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-model-analysis></vat-model-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
/**********the end of a beautiful separated line for analyzeReport*********/
$stateProvider.state({
name: 'vat.devGrid',
url: '/devGrid',
views: {
'@vat': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dev-grid></dev-grid>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
}]);
\ No newline at end of file
//Common Bind Module Method
var bindModule = function (thisModule, controllerProvider, compileProvider, filterProvider, provide) {
thisModule.controller = controllerProvider.register;
thisModule.directive = compileProvider.directive;
thisModule.filter = filterProvider.register;
thisModule.factory = provide.factory;
thisModule.service = provide.service;
return thisModule;
};
var invoiceModule = angular.module('app.invoice', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngSanitize', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning'])
.run(['$log', function ($log) {
$log.debug('app.invoice.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(invoiceModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
uiSelectConfig.theme = 'select2';
//发票管理框架
$stateProvider.state({
name: 'invoiceManagement',
url: '/invoiceManagement',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation', '$state',
function ($scope, $stateParams, appTranslation, $state) {
appTranslation.load([appTranslation.vat]);
$scope.state = $state;
}],
template: '<invoice-manage-infrastructure state="state"></invoice-manage-infrastructure>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
//发票管理主要界面
$stateProvider.state('invoiceManagement.main', {
url: "/main",
sticky: true,
dsr: true,
views: {
'main-view@invoiceManagement': {
template: '<invoice-manage-main></invoice-manage-main>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理上传index
$stateProvider.state('invoiceManagement.uploadIndex', {
url: "/main/uploadIndex",
sticky: true,
dsr: true,
views: {
'uploadIndex-view@invoiceManagement': {
template: '<invoice-manage-main-upload-index></invoice-manage-main-upload-index>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理上传paper invoice
$stateProvider.state('invoiceManagement.uploadPaperInvoice', {
url: "/main/uploadPaperInvoice",
sticky: true,
dsr: true,
views: {
'uploadPaperInvoice-view@invoiceManagement': {
template: '<invoice-manage-main-upload-paper-invoice></invoice-manage-main-upload-paper-invoice>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理上传electonic invoice
$stateProvider.state('invoiceManagement.uploadElecInvoice', {
url: "/main/uploadElecInvoice",
sticky: true,
dsr: true,
views: {
'uploadElecInvoice-view@invoiceManagement': {
template: '<invoice-manage-main-upload-electronic-invoice></invoice-manage-main-upload-electronic-invoice>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理上传scan invoice
$stateProvider.state('invoiceManagement.uploadScanInvoice', {
url: "/main/uploadScanInvoice",
sticky: true,
dsr: true,
views: {
'uploadScanInvoice-view@invoiceManagement': {
template: '<invoice-manage-main-upload-scan-invoice></invoice-manage-main-upload-scan-invoice>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理未收票认证
$stateProvider.state('invoiceManagement.noInvoiceVerify', {
url: "/noInvoiceVerify",
sticky: true,
dsr: true,
views: {
'noInvoiceVerify-view@invoiceManagement': {
template: '<invoice-manage-verify></invoice-manage-verify>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//开票管理
$stateProvider.state('invoiceManagement.billingManage',
{
url: "/billingManage",
sticky: true,
dsr: true,
views: {
'billingManage-view@invoiceManagement': {
template: '<iframe id="dfiframe" src="/app/df/code/pages/PreViewFapiao.html" scrolling="auto" height="100%" style="border:none" width="100%"></iframe>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票查询
$stateProvider.state('invoiceManagement.invoiceQuery',
{
url: "/invoiceQuery",
sticky: true,
dsr: true,
views: {
'invoiceQuery-view@invoiceManagement': {
template: '<iframe id="dfiframe" src="/app/df/code/pages/FapiaoInqury.html" scrolling="auto" height="100%" style="border:none" width="100%"></iframe>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理待退票管理
$stateProvider.state('invoiceManagement.pendingRefundInvoice', {
url: "/pendingRefundInvoice",
sticky: true,
dsr: true,
views: {
'pendingRefundInvoice-view@invoiceManagement': {
template: '<invoice-manage-refund></invoice-manage-refund>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理关联管理
$stateProvider.state('invoiceManagement.mapInvoice', {
url: "/mapInvoice",
sticky: true,
dsr: true,
views: {
'mapInvoice-view@invoiceManagement': {
template: '<invoice-manage-map></invoice-manage-map>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理框架
$stateProvider.state({
name: 'outputInvoiceManage',
url: '/outputInvoiceManage',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation', '$state',
function ($scope, $stateParams, appTranslation, $state) {
appTranslation.load([appTranslation.vat]);
$scope.state = $state;
}],
template: '<output-invoice-infrastructure state="state"></output-invoice-infrastructure>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
//发票管理主要界面
$stateProvider.state('outputInvoiceManage.imported', {
url: "/imported",
sticky: false,
dsr: true,
views: {
'outputInvoiceImported-view@outputInvoiceManage': {
template: '<output-invoice-imported></output-invoice-imported>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理编辑界面
$stateProvider.state('outputInvoiceManage.outputInvoiceEdit', {
url: "/outputInvoiceEdit",
sticky: false,
dsr: true,
views: {
'outputInvoiceEdit-view@outputInvoiceManage': {
template: '<output-invoice-edit></output-invoice-edit>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理已打印BD-USER发票
$stateProvider.state('outputInvoiceManage.issuedInvoiceBdView', {
url: "/issuedInvoiceBdView",
sticky: false,
dsr: true,
views: {
'issuedInvoiceBd-view@outputInvoiceManage': {
template: '<issued-invoice-bd-view></issued-invoice-bd-view>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
$stateProvider.state('outputInvoiceManage.bdViewByVin', {
url: "/bdViewByVin",
sticky: false,
dsr: true,
views: {
'bdViewByVin-view@outputInvoiceManage': {
template: '<bd-view-by-vin></bd-view-by-vin>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//GD已开具发票特殊处理
$stateProvider.state('outputInvoiceManage.issuedInvoiceSpecial', {
url: "/issuedInvoiceSpecial",
sticky: false,
dsr: true,
views: {
'issuedInvoiceSpecial-view@outputInvoiceManage': {
template: '<special-vat-invoice></special-vat-invoice>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//GD已开具发票特殊处理
$stateProvider.state('outputInvoiceManage.GDViewByVIN', {
url: "/GDViewByVIN",
sticky: false,
dsr: true,
views: {
'GDViewByVIN-view@outputInvoiceManage': {
template: '<gd-view-by-vin></gd-view-by-vin>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
$stateProvider.state('outputInvoiceManage.outputReconciliationOverview', {
url: "/outputReconciliationOverview",
sticky: false,
dsr: true,
views: {
'output-reconciliation-overview@outputInvoiceManage': {
template: '<output-reconciliation-overview></output-reconciliation-overview>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
$stateProvider.state('outputInvoiceManage.reconciliationRuleConfig', {
url: "/reconciliationRuleConfig",
sticky: false,
dsr: true,
views: {
'reconciliation-rule-config@outputInvoiceManage': {
template: '<reconciliation-rule-config></reconciliation-rule-config>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
$stateProvider.state('outputInvoiceManage.outputReconciliationConfiguration', {
url: "/outputReconciliationConfiguration",
sticky: false,
dsr: true,
views: {
'output-reconciliation-configuration@outputInvoiceManage': {
template: '<output-reconciliation-configuration></output-reconciliation-configuration>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
$stateProvider.state('outputInvoiceManage.taxControlDisk', {
url: "/taxControlDisk",
sticky: false,
dsr: true,
views: {
'tax-control-disk@outputInvoiceManage': {
template: '<tax-control-disk></tax-control-disk>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
////GD已开具发票详情
//$stateProvider.state('outputInvoiceManage.issuedInvoiceSpecialDetail', {
// url: "/issuedInvoiceSpecialDetail/{gdid}/{parentPage}",
// sticky: true,
// dsr: true,
// //params: {
// // GDID: null,
// // parentPage:null
// //},
// views: {
// 'issuedInvoiceSpecialDetail-view@outputInvoiceManage': {
// controller: ['$scope', '$stateParams', 'appTranslation',
// function ($scope, $stateParams, appTranslation) {
// console.log($stateParams.gdid);
// $scope.gdInvoiceID = $stateParams.gdid;
// $scope.parentPage = $stateParams.parentPage;
// }],
// template: '<invoice-detail-vehicle></invoice-detail-vehicle>'
// }
// },
// resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
//});
//发票管理已打印GD-BD发票
$stateProvider.state('outputInvoiceManage.issuedInvoiceGdView', {
url: "/issuedInvoiceGdView",
sticky: false,
dsr: true,
views: {
'issuedInvoiceGd-view@outputInvoiceManage': {
template: '<issued-invoice-gd-view></issued-invoice-gd-view>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理编辑界面
$stateProvider.state('outputInvoiceManage.gdInvoicePrint', {
url: "/gdInvoicePrint",
sticky: false,
params: { "invoiceList": null },
dsr: true,
views: {
'gdInvoicePrint-view@outputInvoiceManage': {
template: '<gd-invoice-print></gd-invoice-print>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
//发票管理编辑界面
$stateProvider.state('outputInvoiceManage.importShipmentList', {
url: "/importShipmentList",
sticky: false,
dsr: true,
views: {
'importShipment-view@outputInvoiceManage': {
template: '<import-shipment-list></import-shipment-list>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat)
});
}]);
var citModule = angular.module('app.cit', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngAnimate', 'ngSanitize', 'ui.bootstrap', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning'])
.run(['$log', function ($log) {
$log.debug('app.cit.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(citModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
uiSelectConfig.theme = 'select2';
$urlRouterProvider.when('/cit', '/cit/importData/balanceSheet');
$urlRouterProvider.when('/cit/importData', '/cit/importData/balanceSheet');
$urlRouterProvider.when('/cit/previewData', '/cit/previewData/balanceSheet');
$urlRouterProvider.when('/cit/reductionData', 'cit/reductionData/calculateData');
$urlRouterProvider.when('/cit/analyzeReport', 'cit/analyzeReport/citModelAnalysis');
$stateProvider.state({
name: 'cit',
url: '/cit',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-layout></cit-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData',
url: '/importData',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-layout></cit-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.balanceSheet',
url: '/balanceSheet',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-trial-balance></cit-import-trial-balance>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.assetList',
url: '/assetList',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-asset></cit-import-asset>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.journalEntry',
url: '/journalEntry',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-journal-entry></cit-import-journal-entry>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.erpData',
url: '/erpData',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-erp></cit-import-erp>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.outputInvoice',
url: '/outputInvoice',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-output-invoice></cit-import-output-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.inputInvoice',
url: '/inputInvoice',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-income-invoice></cit-import-income-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.customInvoice',
url: '/customInvoice',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-custom-invoice></cit-import-custom-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.voucherMapping',
url: '/voucherMapping',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-voucher-mapping></cit-voucher-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.invoiceMapping',
url: '/invoiceMapping',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-invoice-mapping></cit-invoice-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.importData.auditAdjust',
url: '/auditAdjust',
views: {
'@cit.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-audit-adjust></cit-audit-adjust>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData',
url: '/previewData',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-layout></cit-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData.balanceSheet',
url: '/balanceSheet',
views: {
'@cit.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-preview-balance-sheet></cit-preview-balance-sheet>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData.accountVoucher',
url: '/accountVoucher',
views: {
'@cit.previewData': {
controller: [
'$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}
],
template: '<cit-preview-account-voucher></cit-preview-account-voucher>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData.outputInvoice',
url: '/outputInvoice',
views: {
'@cit.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-preview-output-invoice></cit-preview-output-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData.inputInvoice',
url: '/inputInvoice',
views: {
'@cit.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-preview-input-invoice></cit-preview-input-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.previewData.customInvoice',
url: '/customInvoice',
views: {
'@cit.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-preview-custom-invoice-sheet></cit-preview-custom-invoice-sheet>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.reductionData',
url: '/reductionData',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-layout></cit-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.reductionData.accountMapping',
url: '/accountMapping',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-account-mapping></cit-account-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
/*$stateProvider.state({
name: 'cit.reductionData.goodsMapping',
url: '/goodsMapping',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-goods-mapping></cit-goods-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});*/
$stateProvider.state({
name: 'cit.reductionData.caculateData',
url: '/caculateData',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-caculate-data></cit-caculate-data>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.reductionData.inputInvoice',
url: '/inputInvoice',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<p>inputInvoice</p>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.reductionData.unbilledInvoice',
url: '/unbilledInvoice',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-unbilled-invoice></cit-unbilled-invoice>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.generateReport',
url: '/generateReport',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-report-layout></cit-report-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.generateReport.reportView',
url: '/reportView?{id:string}&{templateid:string}&{name:string}',
views: {
'@cit.generateReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
$scope.reportId = $stateParams.id;
$scope.templateId = $stateParams.templateid;
$scope.templateName = $stateParams.name;
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-report-view report-id="reportId" template-id="templateId" template-name="templateName"></cit-report-view>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.analyzeReport',
url: '/analyzeReport',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-import-layout></cit-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.analyzeReport.citModelAnalysis',
url: '/citModelAnalysis',
views: {
'@cit.analyzeReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-model-analysis></cit-model-analysis>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.analyzeReport.citIndexAnalysis',
url: '/citIndexAnalysis',
views: {
'@cit.analyzeReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<iframe id="dfiframe" src="/app/df/code/pages/citdashboard.html" scrolling="auto" height="100%" style="border:none" width="100%"></iframe>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'cit.analyzeReport.dataSummary',
url: '/dataSummary',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-data-summary></cit-data-summary>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
/**********the end of a beautiful separated line for analyzeReport*********/
$stateProvider.state({
name: 'cit.devGrid',
url: '/devGrid',
views: {
'@cit': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<dev-grid></dev-grid>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
}]);
\ No newline at end of file
//Common Bind Module Method
var bindModule = function (thisModule, controllerProvider, compileProvider, filterProvider, provide) {
thisModule.controller = controllerProvider.register;
thisModule.directive = compileProvider.directive;
thisModule.filter = filterProvider.register;
thisModule.factory = provide.factory;
thisModule.service = provide.service;
return thisModule;
};
var assetsManageModule = angular.module('app.assetsManage', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngSanitize', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning'])
.run(['$log', function ($log) {
$log.debug('app.assetsManage.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(assetsManageModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
uiSelectConfig.theme = 'select2';
$urlRouterProvider.when('/assetsManage', '/assetsManage/importData/productItem');
$urlRouterProvider.when('/assetsManage/importData', '/assetsManage/importData/productItem');
$urlRouterProvider.when('/assetsManage/previewData', '/assetsManage/previewData/productItem');
$urlRouterProvider.when('/assetsManage/productMix', '/assetsManage/productMix/productItem');
$stateProvider.state({
name: 'assetsManage',
url: '/assetsManage',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-layout></assets-manage-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.importData',
url: '/importData',
views: {
'@assetsManage': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-import-layout></assets-manage-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.importData.productItem',
url: '/productItem',
views: {
'@assetsManage.importData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<product-item-import></product-item-import>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.previewData',
url: '/previewData',
views: {
'@assetsManage': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-import-layout></assets-manage-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.previewData.productItem',
url: '/productItem',
views: {
'@assetsManage.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<product-item-preview></product-item-preview>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.generateReport',
url: '/generateReport',
views: {
'@assetsManage': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-report-layout></assets-manage-report-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.productMix',
url: '/productMix',
views: {
'@assetsManage': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-import-layout></assets-manage-import-layout>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.productMix.productItem',
url: '/productMix',
views: {
'@assetsManage.productMix': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<product-item-mix></product-item-mix>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.generateReport.reportView',
url: '/reportView?{id:string}&{templateid:string}&{name:string}',
views: {
'@assetsManage.generateReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
$scope.reportId = $stateParams.id;
$scope.templateId = $stateParams.templateid;
$scope.templateName = $stateParams.name;
appTranslation.load([appTranslation.cit]);
}],
template: '<assets-manage-report-view report-id="reportId" template-id="templateId" template-name="templateName"></assets-manage-report-view>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'assetsManage.generateReport.reportViewCit',
url: '/reportViewCit?{id:string}&{templateid:string}&{name:string}',
views: {
'@assetsManage.generateReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
$scope.reportId = $stateParams.id;
$scope.templateId = $stateParams.templateid;
$scope.templateName = $stateParams.name;
appTranslation.load([appTranslation.cit]);
}]
//template: '<cit-report-view2 report-id="reportId" template-id="templateId" template-name="templateName"></cit-report-view2>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.assetsManage),
deepStateRedirect: true,
sticky: true
});
}]);
var vatDashboardModule = angular.module('app.vatDashboard', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngSanitize', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning'])
.run(['$log', function ($log) {
$log.debug('app.vatDashboard.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(vatDashboardModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'summaryDashboard',
url: '/summaryDashboard',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<summary-dashboard></summary-dashboard>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'summaryDashboardConfig',
url: '/summaryDashboardConfig/{id}',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<summary-dashboard-config></summary-dashboard-config>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'reportAnalysisDashboardConfig',
url: '/reportAnalysisDashboardConfig/{id}',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<report-analysis-dashboard-config></report-analysis-dashboard-config>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'organizationDashboard',
url: '/organizationDashboard/{id}',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<organization-dashboard></organization-dashboard>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'analyzeOrganizeDashboard',
url: '/analyzeOrganizeDashboard/{id}',
views: {
'@vat.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<organization-dashboard></organization-dashboard>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'analyzeOrganizeDashboardConfig',
url: '/analyzeOrganizeDashboardConfig/{id}',
views: {
'@vat.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<report-analysis-dashboard-config></report-analysis-dashboard-config>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
}]);
var vatDongfengModule = angular.module('app.vatDongfeng', ['ui.grid', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.grouping', 'ui.grid.expandable', 'ui.grid.treeView', 'ui.grid.exporter', 'ui.grid.resizeColumns', 'mc.resizer', 'ui.select', 'ngSanitize', 'ui.grid.edit', 'perfect_scrollbar', 'dx', 'ui.grid.pinning'])
.run(['$log', function ($log) {
$log.debug('app.vatDongfeng.run()...');
}])
.config(['$controllerProvider', '$urlRouterProvider', '$compileProvider', '$filterProvider', '$provide', '$stateProvider', 'uiSelectConfig', 'scriptDependencyProvider',
function ($controllerProvider, $urlRouterProvider, $compileProvider, $filterProvider, $provide, $stateProvider, uiSelectConfig, scriptDependencyProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(vatDongfengModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'IncomeTax',
url: '/IncomeTax',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dongfeng-nav-bar type="1"></dongfeng-nav-bar>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'CashFlow',
url: '/CashFlow',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dongfeng-nav-bar type="2"></dongfeng-nav-bar>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'DataSummary',
url: '/DataSummary',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dongfeng-nav-bar type="3"></dongfeng-nav-bar>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'GlobalSearch',
url: '/GlobalSearch',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dongfeng-nav-bar type="4"></dongfeng-nav-bar>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'RiskPanel',
url: '/RiskPanel',
cache: false,
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<dongfeng-nav-bar type="5"></dongfeng-nav-bar>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
}]);
\ No newline at end of file

var noPermissionPageModule = angular.module('app.noPermissionPage', [])
.run(['$log', function ($log) {
$log.debug('app.noPermissionPage.run()...');
}])
.config(['$controllerProvider', '$compileProvider', '$filterProvider', '$provide', 'scriptDependencyProvider', '$stateProvider', '$urlRouterProvider',
function ($controllerProvider, $compileProvider, $filterProvider, $provide, scriptDependencyProvider, $stateProvider, $urlRouterProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(noPermissionPageModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'noPermissionPage',
url: '/noPermissionPage',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.noPermissionPage]);
}],
template: '<no-permission-page></no-permission-page>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.noPermissionPage),
deepStateRedirect: true,
sticky: true
});
}]);
\ No newline at end of file
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