|
|
@@ -16,15 +16,14 @@ define([ 'app/app' ], function(app) {
|
|
|
// $scope.logisticsDetail = angular.fromJson($scope.logistics.companyName);
|
|
|
|
|
|
//查看物流详情
|
|
|
- $scope.listLogistics = function(data){
|
|
|
- var lgtid = $scope.logistics.id;
|
|
|
+ $scope.listLogistics = function(){
|
|
|
var modalInstance = $modal.open({
|
|
|
animation: true,
|
|
|
templateUrl: 'static/view/admin/modal/listLogistics_modal.html',
|
|
|
controller: 'listLogisticsCtrl',
|
|
|
resolve: {
|
|
|
- lgtid: function() {
|
|
|
- return lgtid;
|
|
|
+ logistics : function () {
|
|
|
+ return $scope.logistics
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -86,22 +85,26 @@ define([ 'app/app' ], function(app) {
|
|
|
}]);
|
|
|
|
|
|
// 物流信息
|
|
|
- app.register.controller('listLogisticsCtrl', [
|
|
|
- '$scope',
|
|
|
- '$modal',
|
|
|
- 'ResponseLogistics',
|
|
|
- '$modalInstance',
|
|
|
- 'lgtid',
|
|
|
- function($scope, $modal, ResponseLogistics, $modalInstance,
|
|
|
- lgtid) {
|
|
|
+ app.register.controller('listLogisticsCtrl', ['$scope', '$modal', 'ResponseLogistics', '$modalInstance', 'logistics', 'KdnLogistics', 'toaster', function($scope, $modal, ResponseLogistics, $modalInstance, logistics, KdnLogistics, toaster) {
|
|
|
$scope.Info = [];
|
|
|
$scope.getlogistics = function() {
|
|
|
- ResponseLogistics.get({
|
|
|
- id : lgtid
|
|
|
- }, {}, function(data) {
|
|
|
- $scope.Info = data;
|
|
|
- console.log(data);
|
|
|
+ var params = {};
|
|
|
+ params.companyName = logistics.companyName;
|
|
|
+ params.logisticsCode = logistics.number;
|
|
|
+ KdnLogistics.kdnQuery(params, {}, function(response){
|
|
|
+ if(!response.errorInfo) {
|
|
|
+ $scope.Info = eval ("(" + response.traces + ")");
|
|
|
+ }
|
|
|
+ }, function(){
|
|
|
+ // $scope.Info = [];
|
|
|
+ toaster.pop('info', '查询物流信息失败,请核对物流公司和运单号');
|
|
|
});
|
|
|
+ // ResponseLogistics.get({
|
|
|
+ // id : lgtid
|
|
|
+ // }, {}, function(data) {
|
|
|
+ // $scope.Info = data;
|
|
|
+ // console.log(data);
|
|
|
+ // });
|
|
|
};
|
|
|
$scope.getlogistics();
|
|
|
$scope.cancel = function() {
|