Commit 8c31c17d authored by neo's avatar neo

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

parents 9979beab 39746550
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
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