orgInspectDetailCtrl.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. angular.module('push')
  2. .controller('orgInspectDetailCtrl', function ($scope, ConfigService, $ionicPopup, $stateParams, taskModuleService, ResourceLibraryService, CommentService, UtilService, $timeout, CommonService,UserService) {
  3. $scope.orgInspect = JSON.parse($stateParams.orgInspect);
  4. $scope.connnumber = $stateParams.connnumber;//填报次数
  5. $scope.year = new Date().getFullYear();
  6. ResourceLibraryService.getOrgByName($scope.orgInspect.title,UserService.node).then(function (res) {
  7. if (res.code == 3350) {
  8. $scope.orglogo = res.data.logo;
  9. }
  10. })
  11. //通过企业id获取企业创立时间及对应标签
  12. taskModuleService.getOrgAndLabelInfo($scope.orgInspect.orgid).then(function (res) {
  13. if (res.code == 3350) {
  14. $scope.fullOrgInfo = res.data;
  15. }
  16. })
  17. $scope.orgInspectHistoryList = [];
  18. taskModuleService.getInspectList($scope.orgInspect.title, "createtime", '0', false).then(function (res) {
  19. if (res.code == 3350) {
  20. angular.forEach(res.data, function (val) {
  21. if (val.id != $scope.orgInspect.id) {
  22. $scope.orgInspectHistoryList.push(val);
  23. }
  24. })
  25. }
  26. })
  27. //获取高企自评数据
  28. taskModuleService.getHighOrgInspectInfo($scope.orgInspect.id).then(function (res) {
  29. if (res.code == 3350) {
  30. $scope.highInspectOrg = res.data;
  31. taskModuleService.getRespectOrgInfo($scope.orgInspect.id).then(function (res1) {
  32. if (res1.code == 3350) {
  33. $scope.highorginspection = JSON.parse(res1.data);
  34. }
  35. })
  36. }
  37. })
  38. $scope.goToOrgInspect = function (value) {
  39. if (value == 1) {
  40. //进入自评报告页面
  41. var scoreConnid = $scope.orgInspect.scoretotal + "," + $scope.orgInspect.id;
  42. $scope.go('orgSelfReport', {scoreConnid: scoreConnid, registerdate: $scope.highorginspection.registerdate, connid: $scope.orgInspect.id});
  43. }
  44. if (value == 2) {
  45. //进入知识产权页面
  46. $scope.go('secondOrgSelfReport', {
  47. value: value,
  48. highorginspection: $scope.highorginspection,
  49. connid: $scope.orgInspect.id
  50. });
  51. }
  52. if (value == 3) {
  53. //进入收支信息页面
  54. $scope.go('secondOrgSelfReport', {
  55. value: value,
  56. highorginspection: $scope.highorginspection,
  57. connid: $scope.orgInspect.id
  58. });
  59. }
  60. }
  61. $scope.goOrgInspectDetail = function (orginspect) {
  62. $scope.go('orgInspectDetail', {
  63. orgInspect: JSON.stringify(orginspect),
  64. connnumber: $scope.connnumber ? $scope.connnumber : $scope.orgInspect.connnumber
  65. });
  66. }
  67. $scope.exportReport = function () {
  68. taskModuleService.exportHighOrgReport($scope.orgInspect.id).then(function (res) {
  69. console.log(res)
  70. if (res.code == 3350) {
  71. var file = res.data;
  72. // window.open(ConfigService.imgurl + file.sourceName);
  73. var aEle = document.createElement("a");
  74. aEle.setAttribute("href", ConfigService.imgurl + file.sourceName);;
  75. aEle.click()
  76. // let a = document.createElement("a");
  77. // a.setAttribute("href", ConfigService.imgurl + file.sourceName);
  78. // a.click();
  79. return;
  80. } else {
  81. $ionicPopup.alert({
  82. title: '提示',
  83. template: '导出失败!'
  84. })
  85. return;
  86. }
  87. })
  88. }
  89. })
  90. ;