cultivatelistCtrl.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. angular.module('push')
  2. .controller('cultivatelistCtrl', function ($scope,SelfcheckService,$stateParams,UserService,$ionicPopup,
  3. $timeout,$ionicModal,$ionicActionSheet,ionicDatePicker,$ionicScrollDelegate) {
  4. $scope.passname=$stateParams.name
  5. $scope.fostertype=$stateParams.restype
  6. $scope.isShowSearchButton = true;
  7. $scope.keyfilter=''
  8. $scope.findtype='01'
  9. $scope.tablist=[{name:'全部',type:true,value:'01'},
  10. {name:'建议申报',type:false,value:'1'},
  11. {name:'不建议申报',type:false,value:'0'},
  12. ]
  13. $scope.CaseDatalist =function (orgname){
  14. $scope.showLoadingToast();
  15. var paramslist={
  16. userid:UserService.id,
  17. restype:$stateParams.restype,
  18. node:UserService.node,
  19. orgname: orgname,
  20. isQualified:$scope.findtype
  21. }
  22. console.log(paramslist)
  23. SelfcheckService.getSelfchecklist(paramslist).then(function (res){
  24. $scope.hideLoadingToast();
  25. console.log(res)
  26. if(res.code==3350){
  27. $scope.list=res.data
  28. }else {
  29. $ionicPopup.alert({
  30. title: '提示',
  31. template: res.message
  32. });
  33. }
  34. }).catch(function (res){
  35. $scope.hideLoadingToast();
  36. $ionicPopup.alert({
  37. title: '提示',
  38. template: "服务器错误"
  39. });
  40. })
  41. }
  42. $scope.CaseDatalist('0')
  43. $scope.showSearchButtonLeft = function () {
  44. $scope.isShowSearchButton = false;
  45. $timeout(function () {
  46. $(".showSearchInput").focus();
  47. }, 300)
  48. };
  49. $scope.clearSearch = function () {
  50. $scope.isShowSearchButton = true;
  51. $scope.keyfilter= '';
  52. $scope.CaseDatalist('0');
  53. }
  54. $scope.handletab=function (item){
  55. $scope.tablist.forEach((res)=>{
  56. res.type=false
  57. })
  58. item.type=true
  59. $scope.findtype=item.value
  60. $scope.CaseDatalist($scope.keyfilter?$scope.keyfilter:'0');
  61. }
  62. $scope.ondetail=function (item){
  63. if($scope.fostertype==0){
  64. $scope.go('orgInspectDetail', {orgInspect: JSON.stringify(item), connid: item.id});
  65. }else {
  66. let row={
  67. id:item.id,
  68. type: '1',
  69. restype:$stateParams.restype,
  70. }
  71. $scope.go('Selfcheckdetail', {obj: JSON.stringify(row)});
  72. }
  73. }
  74. })