SubsidyauditafteExportCtrl.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. angular.module('push')
  2. .controller('SubsidyauditafteExportCtrl', function ($scope, $ionicActionSheet, ResourceLibraryService,UserService,dataToolsService,$ionicPopup,ConfigService, CommentService, UtilService, $timeout, CommonService) {
  3. $scope.rewardHollLists = [
  4. {title1: '待审核', type: "0"},
  5. {title1: '已退回', type: "-2"},
  6. {title1: '已通过', type: "1"},
  7. {title1: '已共享', type: '8,9'},
  8. ]
  9. $scope.page = 1
  10. $scope.selectedtypes= '0'
  11. entrylist(["0"])
  12. $scope.changeSelected = function (row) {
  13. entrylist(row.split(','))
  14. }
  15. function entrylist( demandStatus) {
  16. console.log(demandStatus)
  17. var pa = {
  18. demandStatus: demandStatus,
  19. nodeId: UserService.node,
  20. restType: 1611726857,
  21. userId: UserService.id,
  22. pageNum: $scope.page,
  23. pageFlag: false
  24. }
  25. //获取产学研补助审核列表
  26. ResourceLibraryService.cooperateresearchlist(pa).then(function (res) {
  27. console.log(res)
  28. $scope.checkList = res.data;
  29. })
  30. }
  31. $scope.exportResource=function(){
  32. var params={
  33. demandIds:[],
  34. userId:UserService.id
  35. }
  36. $scope.checkList.forEach(function (res) {
  37. if(res.isselected==true){
  38. params.demandIds.push(res.id)
  39. }
  40. })
  41. ResourceLibraryService.exportresearchcost(params).then(function (res) {
  42. console.log(res)
  43. if(res.code==3350){
  44. window.open(ConfigService.imgurl + res.data.sourceName);
  45. }else {
  46. $ionicPopup.alert({
  47. title: '提示',
  48. template: res.message
  49. });
  50. }
  51. })
  52. }
  53. $scope.clickResource1 = function (resource) {
  54. resource.isselected = !resource.isselected;
  55. }
  56. $scope.flag = true;
  57. $scope.choiceAllResource1 = function () {
  58. if ($scope.flag) {
  59. angular.forEach($scope.checkList, function (val) {
  60. val.isselected = true;
  61. })
  62. } else {
  63. angular.forEach($scope.checkList, function (val) {
  64. val.isselected = false;
  65. })
  66. }
  67. $scope.flag = !$scope.flag;
  68. }
  69. })