admin_faceFuhe.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. app.controller('AdminFaceFuheCtrl', function($rootScope, $scope, $http, $timeout, $state, $window, $q, toaster) {
  2. $scope.pageObj = {pageSize: 10, total: 1, page: 1, totalPage: 1, query: '',reply_status: ''};
  3. $scope.goPage = function(page){
  4. if(page < 1){
  5. toaster.pop('error', '已是第一页');
  6. return;
  7. }else if(page > $scope.pageObj.totalPage){
  8. toaster.pop('error', '超过最大页码');
  9. return;
  10. }
  11. console.log('go page std');
  12. $scope.pageObj.page = page;
  13. var getCount = $http({
  14. url : $rootScope.host_url + '/adminOptr/faceFuheCount?session=' + $rootScope.session,
  15. method : 'post',
  16. data : angular.toJson($scope.pageObj)
  17. }).success(function(data) {
  18. if(data.code == 0){
  19. $scope.pageObj.total = data.result.stdCount;
  20. $scope.pageObj.totalPage = Math.ceil(data.result.stdCount / $scope.pageObj.pageSize);
  21. $scope.pageObj.totalPage = $scope.pageObj.totalPage == 0 ? 1 : $scope.pageObj.totalPage;
  22. }
  23. }).error(function() {
  24. });
  25. var getData = $http({
  26. url : $rootScope.host_url + '/adminOptr/faceFuhe?session=' + $rootScope.session,
  27. method : 'post',
  28. data : angular.toJson($scope.pageObj)
  29. }).success(function(data) {
  30. if(data.code == 0){
  31. $scope.stds = data.result;
  32. }
  33. }).error(function() {
  34. });
  35. $scope.myPromise = $q.all([getData, getCount]);
  36. }
  37. $scope.load = function(){
  38. $scope.goPage(1);
  39. }
  40. $scope.load();
  41. $scope.showFuheDetail = function(stdId){
  42. $state.go('faceFuheDetail', {std_id: stdId});
  43. }
  44. })
  45. .controller('AdminFaceFuheDetailCtrl', function($rootScope, $scope, $http, $timeout, $state, $window, $q, toaster, $stateParams) {
  46. $scope.load = function(){
  47. var fuheRequest = $http({
  48. url :$rootScope.host_url + '/acquire/getFaceScoreFuhe?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
  49. method : 'GET'
  50. }).success(function(data) {
  51. if(data.code == 0 && data.result){
  52. $scope.fuhe = data.result;
  53. if($scope.fuhe.zhongwen){
  54. $scope.fuhe.zhongwen = true;
  55. }
  56. if($scope.fuhe.waiyu){
  57. $scope.fuhe.waiyu = true;
  58. }
  59. if($scope.fuhe.fuyu){
  60. $scope.fuhe.fuyu = true;
  61. }
  62. }
  63. }).error(function() {
  64. });
  65. var stdInfoRequest = $http({
  66. url : $rootScope.host_url + '/acquire/getFuheStdBaseInfo?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
  67. method : 'GET'
  68. }).success(function(data) {
  69. if(data.code == 0){
  70. $scope.stdData = data.result;
  71. }
  72. }).error(function() {
  73. });
  74. var faceScoreRequest = $http({
  75. url : $rootScope.host_url + '/acquire/getFaceScoreAll?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
  76. method : 'GET'
  77. }).success(function(data) {
  78. if(data.code == 0){
  79. $scope.score = data.result;
  80. }
  81. }).error(function() {
  82. });
  83. $scope.myPromise = $q.all([stdInfoRequest, fuheRequest, faceScoreRequest]);
  84. }
  85. $scope.load();
  86. $scope.submitForm = function(){
  87. if(!$scope.fuhe.fuhe_reply || $scope.fuhe.fuhe_reply.length == 0){
  88. toaster.pop('error', '请输入复核结果!');
  89. return;
  90. }
  91. $rootScope.dialogMsg("请确认是否提交复核结果", function(){
  92. $scope.myPromise = $http({
  93. url : $rootScope.host_url + '/adminOptr/postFaceFuheReply?&session=' + $rootScope.session,
  94. method : 'POST',
  95. data : angular.toJson($scope.fuhe)
  96. }).success(function(data) {
  97. if(data.code == 0){
  98. $scope.load();
  99. }
  100. }).error(function() {
  101. });
  102. });
  103. }
  104. $scope.showStdOverview = function(stdId){
  105. $state.go('faceFuheDetail', {std_id: stdId});
  106. }
  107. });