angular.module('push') .controller('orgSelfReportCtrl', function ($scope, AccountService, $stateParams, CommentService, UtilService, $timeout, CommonService) { function convertToString(s){ return s.replace(/\-/g,"/"); } $scope.registerdate=convertToString($stateParams.registerdate) $scope.registerdate = new Date( $scope.registerdate); $scope.data = $stateParams.data; $scope.scoreConnid = $stateParams.scoreConnid; $scope.highorginspection = $stateParams.highorginspection; var splitArr = $scope.scoreConnid.split(","); $scope.totalscore = splitArr[0]; $scope.connid = splitArr[1]; $scope.diffyear = new Date().getFullYear() - $scope.registerdate.getFullYear(); $scope.diffmonth = $scope.diffyear * 12 + new Date().getMonth() - $scope.registerdate.getMonth() ; console.log($scope.diffmonth) if($scope.diffmonth >= 12){ $scope.oneyearplustime = true; }else{ $scope.oneyearplustime = false; } $scope.advantegelist = [];//优势列表 $scope.drawbacklist = [];//待提升列表 AccountService.getReportByConnid($scope.connid).then(function (res) { if (res.code == 3350) { $scope.reportList = res.data; if (res.data.length > 0) { $scope.orgname = res.data[0].orgname; $scope.totalscore = res.data[0].totalscore; } angular.forEach($scope.reportList, function (val) { if (val.advantage) { $scope.advantegelist = val.advantage.split(","); } if (val.drawback) { $scope.drawbacklist = val.drawback.split(","); } $scope.intellecture = val.intellecturescore; $scope.intellecture1 = val.techadvancementscore; $scope.intellecture2 = val.coresupportscore; $scope.intellecture3 = val.intellecturenumscore; $scope.intellecture4 = val.intellectureobtainwayscore; $scope.intellecture5 = val.standardsettingscore; $scope.technical = val.techtransscore; $scope.management = val.developmanagscore; $scope.management1 = val.organizationalmanagementscore; $scope.management2 = val.developinstitutescore; $scope.management3 = val.achievetransrewardscore; $scope.management4 = val.talentperformancesystemscore; $scope.growth = val.orggrowthscore; $scope.growth1 = val.netassetsgrowthscore; $scope.growth2 = val.salescore; }) } }) $scope.goToPlatform = function () { $scope.go('tab.activityIndex'); } $scope.reInspectOrg = function () { $scope.go('orgInspect', {highorginspection: $scope.highorginspection}); } $scope.goback3 = function () { $scope.go('tab.activityIndex'); } });