orgSelfReportCtrl.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. angular.module('push')
  2. .controller('orgSelfReportCtrl', function ($scope, AccountService, $stateParams, CommentService, UtilService, $timeout, CommonService) {
  3. function convertToString(s){
  4. return s.replace(/\-/g,"/");
  5. }
  6. $scope.registerdate=convertToString($stateParams.registerdate)
  7. $scope.registerdate = new Date( $scope.registerdate);
  8. $scope.data = $stateParams.data;
  9. $scope.scoreConnid = $stateParams.scoreConnid;
  10. $scope.highorginspection = $stateParams.highorginspection;
  11. var splitArr = $scope.scoreConnid.split(",");
  12. $scope.totalscore = splitArr[0];
  13. $scope.connid = splitArr[1];
  14. $scope.diffyear = new Date().getFullYear() - $scope.registerdate.getFullYear();
  15. $scope.diffmonth = $scope.diffyear * 12 + new Date().getMonth() - $scope.registerdate.getMonth() ;
  16. console.log($scope.diffmonth)
  17. if($scope.diffmonth >= 12){
  18. $scope.oneyearplustime = true;
  19. }else{
  20. $scope.oneyearplustime = false;
  21. }
  22. $scope.advantegelist = [];//优势列表
  23. $scope.drawbacklist = [];//待提升列表
  24. AccountService.getReportByConnid($scope.connid).then(function (res) {
  25. if (res.code == 3350) {
  26. $scope.reportList = res.data;
  27. if (res.data.length > 0) {
  28. $scope.orgname = res.data[0].orgname;
  29. $scope.totalscore = res.data[0].totalscore;
  30. }
  31. angular.forEach($scope.reportList, function (val) {
  32. if (val.advantage) {
  33. $scope.advantegelist = val.advantage.split(",");
  34. }
  35. if (val.drawback) {
  36. $scope.drawbacklist = val.drawback.split(",");
  37. }
  38. $scope.intellecture = val.intellecturescore;
  39. $scope.intellecture1 = val.techadvancementscore;
  40. $scope.intellecture2 = val.coresupportscore;
  41. $scope.intellecture3 = val.intellecturenumscore;
  42. $scope.intellecture4 = val.intellectureobtainwayscore;
  43. $scope.intellecture5 = val.standardsettingscore;
  44. $scope.technical = val.techtransscore;
  45. $scope.management = val.developmanagscore;
  46. $scope.management1 = val.organizationalmanagementscore;
  47. $scope.management2 = val.developinstitutescore;
  48. $scope.management3 = val.achievetransrewardscore;
  49. $scope.management4 = val.talentperformancesystemscore;
  50. $scope.growth = val.orggrowthscore;
  51. $scope.growth1 = val.netassetsgrowthscore;
  52. $scope.growth2 = val.salescore;
  53. })
  54. }
  55. })
  56. $scope.goToPlatform = function () {
  57. $scope.go('tab.activityIndex');
  58. }
  59. $scope.reInspectOrg = function () {
  60. $scope.go('orgInspect', {highorginspection: $scope.highorginspection});
  61. }
  62. $scope.goback3 = function () {
  63. $scope.go('tab.activityIndex');
  64. }
  65. });