From 0eb78222966d0ff09dd8715dd5dd430af87dbfee Mon Sep 17 00:00:00 2001 From: zw <945943551@qq.com> Date: Tue, 28 Jun 2016 15:29:58 +0800 Subject: [PATCH] Merge branch 'master' of https://git.oschina.net/wshi215/GR_EXPAPP Conflicts: js/app.js --- js/app-service.js | 14 ++++++++ js/app.js | 11 +++++++ js/base-factory.js | 25 ++++++++++++++- js/controllers.js | 7 ++++ js/mission.js | 60 +++++++++++++++++++++++++++++++++++ js/orderaccept.js | 46 +++++++++++++++++++++++++++ templates/tab-sell.html | 24 ++++++++------ templates/tab-setting.html | 2 +- templates/tab-take.html | 7 ++++ templates/tasks/missions.html | 13 ++++++++ templates/tasks/waitTake.html | 35 ++++++++++++++++++++ 11 files changed, 233 insertions(+), 11 deletions(-) create mode 100644 templates/tasks/waitTake.html diff --git a/js/app-service.js b/js/app-service.js index 81cccab..93824ff 100644 --- a/js/app-service.js +++ b/js/app-service.js @@ -179,6 +179,20 @@ service.factory('appFactory',['$q','$timeout','$ae','$cordovaDevice','$cordovaAp q.reject(err); }); return q.promise; + }, + /*** + * 扫码查单 + * @author zhangwei + */ + getOrderStatus:function(param){ + var q = $q.defer(); + var func = new $ae.Function('api.logistics.getOrderStatus'); + func.invoke(param).then(function(data){ + q.resolve(data); + }).catch(function (err) { + q.reject(err); + }); + return q.promise; } }; return _service; diff --git a/js/app.js b/js/app.js index 82a5b7c..3b04139 100644 --- a/js/app.js +++ b/js/app.js @@ -257,6 +257,17 @@ angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', ' } } }) + //待领取任务列表 + .state('tab.waittake',{ + url: '/waittake', + cashed: false, + views: { + 'tab-tasks': { + templateUrl: 'templates/tasks/waitTake.html', + controller: 'WaitTakeCtrl' + } + } + }) /** * 新任务 end */ diff --git a/js/base-factory.js b/js/base-factory.js index d870804..4d49f9a 100644 --- a/js/base-factory.js +++ b/js/base-factory.js @@ -17,6 +17,18 @@ app.factory('BaseFactory',['$q','$ae',function($q,$ae){ }) return q.promise ; }, + taskWaitTake:function(uid){ + var q = $q.defer(); + var query = new $ae.Function('api.logistics.taskWaitTake'); + query.invoke({uid:uid}).then(function(data){ + console.log(data); + q.resolve(data) + }).catch(function(err){ + q.reject(err) + }) + return q.promise ; + }, + //获取所有在派送任务数据 inExpress:function(uid,page,page_size){ var q = $q.defer(); @@ -194,7 +206,18 @@ app.factory('BaseFactory',['$q','$ae',function($q,$ae){ }) return q.promise ; }, - + //待领取任务列表 + waitList:function(uid){ + var q = $q.defer(); + var query = new $ae.Function('api.logistics.taskWaitTakeList'); + query.invoke({uid:uid}).then(function(data){ + console.log(data); + q.resolve(data) + }).catch(function(err){ + q.reject(err) + }) + return q.promise ; + }, /** * 营销 */ diff --git a/js/controllers.js b/js/controllers.js index e002430..9a29c2b 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -217,4 +217,11 @@ app.controller('EcologicalCircleCtrl',['$scope','$cordovaInAppBrowser',"$User",f var link = 'http://61.147.75.91/apireport/reportJsp/showReport.jsp?raq=wlkjmx.raq'; $cordovaInAppBrowser.open(link, '_system', options).then(function(event) {}).catch(function(event) {}); }; + //派送提成报表 + $scope.showpstc = function() { + //跳转至系统的浏览器中打开 + var link = 'http://61.147.75.91/apireport/reportJsp/showReport.jsp?raq=v3pstc.raq'; + $cordovaInAppBrowser.open(link, '_system', options).then(function(event) {}).catch(function(event) {}); + }; + }]); \ No newline at end of file diff --git a/js/mission.js b/js/mission.js index da63e8c..bd26448 100644 --- a/js/mission.js +++ b/js/mission.js @@ -28,6 +28,7 @@ app.controller('TaskHomeCtrl',['$scope','$state','$stateParams','BaseFactory','$ }; //用户id $scope.taskHome = {inExpress:0,finishExpress:0,backGoods:0,changeGoods:0, bookTime:0,reject:0}; + $scopce.wait = {waittake:0,dsd:0,sd:0}; var uid = $User.get('id') ; $scope.init =function(){ @@ -46,8 +47,26 @@ app.controller('TaskHomeCtrl',['$scope','$state','$stateParams','BaseFactory','$ $scope.$broadcast('scroll.refreshComplete'); }); } + + $scope.initwait =function(){ + BaseFactory.taskWaitTake(uid).then(function(data){ + var waittake = data[0].waittake ||0; + var dsd = data[0].dsd ||0; + var sd = data[0].sd ||0; + $scopce.wait = {waittake:waittake,dsd:dsd,sd:sd}; + }).catch(function(err){ + console.log(err) + }).finally(function(){ + $scope.$broadcast('scroll.refreshComplete'); + }); + } + //展示首页 $scope.init(); + + //展示待领取 + $scope.initwait(); + //搜索 $scope.searchTask = function(code){ //根据输入的订单编号搜索 @@ -84,6 +103,10 @@ app.controller('TaskHomeCtrl',['$scope','$state','$stateParams','BaseFactory','$ //显示所有状态为9000,9999的订单并且is_account=1 $state.go('tab.reject') ; }; + //跳转到待领单列表 + $scope.waittake = function(){ + $state.go('tab.waittake') ; + }; //扫码领单 $scope.barscan = function(){ @@ -1086,6 +1109,43 @@ app.controller('RejectListCtrl',['$scope','$state','$stateParams','BaseFactory', } ]); +//待领取任务页面 +app.controller('WaitTakeCtrl',['$scope','$state','$stateParams','BaseFactory','$ionicPopup','$User','$cordovaGeolocation', + function($scope,$state,$stateParams,BaseFactory,$ionicPopup,$User,$cordovaGeolocation){ + $scope.tasks = [] ; + $scopce.wait = {waittake:0,dsd:0,sd:0}; + //用户id + var uid = $User.get('id') ; + $scope.init =function(){ + BaseFactory.waitList(uid).then(function(data){ + console.log(data) + $scope.tasks = data; + }).catch(function(err){ + console.log(err) + }).finally(function(){ + $scope.$broadcast('scroll.refreshComplete'); + }); + } + + $scope.initwait =function(){ + BaseFactory.taskWaitTake(uid).then(function(data){ + var waittake = data[0].waittake ||0; + var dsd = data[0].dsd ||0; + var sd = data[0].sd ||0; + $scopce.wait = {waittake:waittake,dsd:dsd,sd:sd}; + }).catch(function(err){ + console.log(err) + }).finally(function(){ + $scope.$broadcast('scroll.refreshComplete'); + }); + } + //展示列表 + $scope.init(); + + $scope.initwait(); + } +]); + app.controller('MissionTest',['$scope','$state','$stateParams','BaseFactory', function($scope,$state,$stateParams,BaseFactory) { $scope.test = function(){ diff --git a/js/orderaccept.js b/js/orderaccept.js index 7cdb813..f442d1b 100644 --- a/js/orderaccept.js +++ b/js/orderaccept.js @@ -238,4 +238,50 @@ app.controller('OrderAcceptCtrl', function($scope,$state,$ionicPlatform,$ionicLo } }); } + + //扫码查单,查询订单状态 + $scope.barscanQuery = function(){ + $cordovaBarcodeScanner + .scan() + .then(function(barcodeData) { + var cancelled = barcodeData.cancelled; + var result = JSON.parse(barcodeData.text); + if(!cancelled){ + $scope.getOrderStatus(result); + }else{ + var r = confirm('扫描异常或退出扫描!\r\n是否继续扫码?'); + if(r===true){ + $scope.barscanQuery(); + } + } + }, function(error) { + // An error occurred + var r = confirm('扫描异常或退出扫描!\r\n是否继续扫码?'); + if(r===true){ + $scope.barscanQuery(); + } + }); + }; + + $scope.getOrderStatus = function(mhOid){ + if(mhOid===undefined || mhOid.length<6){ + alert("请输入6位连续的订单单号"); + $scope.$broadcast('scroll.refreshComplete'); + return; + } + + param = {orderid:mhOid}; + appFactory.getOrderStatus(param).then(function(data){ + alert(data.msg); + var r = confirm('是否继续扫码?'); + if(r===true){ + $scope.barscanQuery(); + } + }).catch(function(err){ + var r = confirm('扫描异常!\r\n是否继续扫码?'); + if(r===true){ + $scope.barscanQuery(); + } + }); + } }); diff --git a/templates/tab-sell.html b/templates/tab-sell.html index b413458..3168f99 100644 --- a/templates/tab-sell.html +++ b/templates/tab-sell.html @@ -4,27 +4,25 @@
-
- -
+ + + + + +
-
-
-
+
+
+
+ +
+
diff --git a/templates/tab-setting.html b/templates/tab-setting.html index 4d9f3d8..3f4bbab 100644 --- a/templates/tab-setting.html +++ b/templates/tab-setting.html @@ -27,7 +27,7 @@
  • - 版本更新 [3.1.3.R] + 版本更新 [3.1.4.R]
  • diff --git a/templates/tab-take.html b/templates/tab-take.html index 8c534da..0da6fde 100644 --- a/templates/tab-take.html +++ b/templates/tab-take.html @@ -47,6 +47,13 @@ + +
    +
    + 扫码查单 +
    +
    +

    {{order.areaName}}区- diff --git a/templates/tasks/missions.html b/templates/tasks/missions.html index ffb428d..cfa0fae 100644 --- a/templates/tasks/missions.html +++ b/templates/tasks/missions.html @@ -83,6 +83,19 @@

    + +
    +
    +
    + +
    +
    +
    +