123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- app.controller('AdminFaceFuheCtrl', function($rootScope, $scope, $http, $timeout, $state, $window, $q, toaster) {
- $scope.pageObj = {pageSize: 10, total: 1, page: 1, totalPage: 1, query: '',reply_status: ''};
-
- $scope.goPage = function(page){
- if(page < 1){
- toaster.pop('error', '已是第一页');
- return;
- }else if(page > $scope.pageObj.totalPage){
- toaster.pop('error', '超过最大页码');
- return;
- }
- console.log('go page std');
- $scope.pageObj.page = page;
- var getCount = $http({
- url : $rootScope.host_url + '/adminOptr/faceFuheCount?session=' + $rootScope.session,
- method : 'post',
- data : angular.toJson($scope.pageObj)
- }).success(function(data) {
- if(data.code == 0){
- $scope.pageObj.total = data.result.stdCount;
- $scope.pageObj.totalPage = Math.ceil(data.result.stdCount / $scope.pageObj.pageSize);
- $scope.pageObj.totalPage = $scope.pageObj.totalPage == 0 ? 1 : $scope.pageObj.totalPage;
- }
- }).error(function() {
- });
-
- var getData = $http({
- url : $rootScope.host_url + '/adminOptr/faceFuhe?session=' + $rootScope.session,
- method : 'post',
- data : angular.toJson($scope.pageObj)
- }).success(function(data) {
- if(data.code == 0){
- $scope.stds = data.result;
- }
- }).error(function() {
- });
-
- $scope.myPromise = $q.all([getData, getCount]);
- }
-
- $scope.load = function(){
- $scope.goPage(1);
- }
- $scope.load();
-
- $scope.showFuheDetail = function(stdId){
- $state.go('faceFuheDetail', {std_id: stdId});
- }
- })
- .controller('AdminFaceFuheDetailCtrl', function($rootScope, $scope, $http, $timeout, $state, $window, $q, toaster, $stateParams) {
- $scope.load = function(){
- var fuheRequest = $http({
- url :$rootScope.host_url + '/acquire/getFaceScoreFuhe?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
- method : 'GET'
- }).success(function(data) {
- if(data.code == 0 && data.result){
- $scope.fuhe = data.result;
- if($scope.fuhe.zhongwen){
- $scope.fuhe.zhongwen = true;
- }
- if($scope.fuhe.waiyu){
- $scope.fuhe.waiyu = true;
- }
- if($scope.fuhe.fuyu){
- $scope.fuhe.fuyu = true;
- }
- }
- }).error(function() {
- });
-
- var stdInfoRequest = $http({
- url : $rootScope.host_url + '/acquire/getFuheStdBaseInfo?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
- method : 'GET'
- }).success(function(data) {
- if(data.code == 0){
- $scope.stdData = data.result;
- }
- }).error(function() {
- });
-
- var faceScoreRequest = $http({
- url : $rootScope.host_url + '/acquire/getFaceScoreAll?std_id=' + $stateParams.std_id + '&session=' + $rootScope.session,
- method : 'GET'
- }).success(function(data) {
- if(data.code == 0){
- $scope.score = data.result;
- }
- }).error(function() {
- });
-
- $scope.myPromise = $q.all([stdInfoRequest, fuheRequest, faceScoreRequest]);
- }
- $scope.load();
-
- $scope.submitForm = function(){
- if(!$scope.fuhe.fuhe_reply || $scope.fuhe.fuhe_reply.length == 0){
- toaster.pop('error', '请输入复核结果!');
- return;
- }
-
- $rootScope.dialogMsg("请确认是否提交复核结果", function(){
- $scope.myPromise = $http({
- url : $rootScope.host_url + '/adminOptr/postFaceFuheReply?&session=' + $rootScope.session,
- method : 'POST',
- data : angular.toJson($scope.fuhe)
- }).success(function(data) {
- if(data.code == 0){
- $scope.load();
- }
- }).error(function() {
- });
- });
-
- }
-
- $scope.showStdOverview = function(stdId){
- $state.go('faceFuheDetail', {std_id: stdId});
- }
-
- });
|