Browse Source

修改后台平台出货单查询物流接口

hulh 8 years ago
parent
commit
b7c5513e1e

+ 20 - 17
src/main/webapp/resources/js/admin/controllers/trade/InvoicefromOrderDetailCtrl.js

@@ -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() {

+ 2 - 2
src/main/webapp/resources/js/admin/controllers/trade/InvoicefromPurcDetailCtrl.js

@@ -93,7 +93,7 @@ define([ 'app/app' ], function(app) {
 	
 
 				// 物流信息
-			app.register.controller('listLogisticsCtrl', ['$scope', '$modal', 'ResponseLogistics', '$modalInstance', 'logistics', 'KdnLogistics', function($scope, $modal, ResponseLogistics, $modalInstance, logistics, KdnLogistics) {
+			app.register.controller('listLogisticsCtrl', ['$scope', '$modal', 'ResponseLogistics', '$modalInstance', 'logistics', 'KdnLogistics', 'toaster', function($scope, $modal, ResponseLogistics, $modalInstance, logistics, KdnLogistics, toaster) {
 						$scope.Info = [];
 						$scope.getlogistics = function() {
 							var params = {};
@@ -105,7 +105,7 @@ define([ 'app/app' ], function(app) {
 									// statusOfLogistics($scope.logisticsInfo[$scope.logisticsInfo.length - 1].AcceptStation);
 								}
 							}, function(){
-								$scope.logisticsInfo = [];
+								// $scope.Info = [];
 								toaster.pop('info', '查询物流信息失败,请核对物流公司和运单号');
 							});
 							// ResponseLogistics.get({id : lgtid}, {}, function(data) {

+ 2 - 2
src/main/webapp/resources/js/admin/controllers/trade/TradePurchaseDetailCtrl.js

@@ -106,7 +106,7 @@ define([ 'app/app' ], function(app) {
 		loadData();
 	}]);
 	
-	app.register.controller('listLogisticsCtrl', [ '$scope', '$modal', 'ResponseLogistics', '$modalInstance', 'logistics', 'KdnLogistics', function($scope, $modal, ResponseLogistics, $modalInstance, logistics, KdnLogistics){
+	app.register.controller('listLogisticsCtrl', [ '$scope', '$modal', 'ResponseLogistics', '$modalInstance', 'logistics', 'KdnLogistics', 'toaster', function($scope, $modal, ResponseLogistics, $modalInstance, logistics, KdnLogistics, toaster){
 		$scope.Info = [];
 		$scope.getlogistics = function() {
 			var params = {};
@@ -118,7 +118,7 @@ define([ 'app/app' ], function(app) {
 					// statusOfLogistics($scope.logisticsInfo[$scope.logisticsInfo.length - 1].AcceptStation);
 				}
 			}, function(){
-				$scope.logisticsInfo = [];
+				// $scope.Info = [];
 				toaster.pop('info', '查询物流信息失败,请核对物流公司和运单号');
 			});
 			// ResponseLogistics.get({id : lgtid}, {}, function(data) {

+ 4 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js

@@ -209,6 +209,10 @@ define(['app/app'], function(app) {
 		}
 
 		$scope.updateTotal = function (data) {
+			if (data.currentTaxUnitPrice == null){
+				data.currentTaxUnitPrice = 0.000001;
+				return;
+			}
 			if (isNaN(data.currentTaxUnitPrice)){
 				data.currentTaxUnitPrice = 0.000001;
 				toaster.pop('warning', '提示', '输入的价格必须是数字');

+ 1 - 1
src/main/webapp/resources/view/admin/trade/trade_invoicefromorder_detail.html

@@ -105,7 +105,7 @@
 				<span>快递单号:</span>
 				<span ng-bind="logistics.number"></span>
 			</div>
-			<a  ng-click="listLogistics(logistics)" style="text-decoration : none ">点击查看物流详情</a>
+			<a  ng-click="listLogistics()" style="text-decoration : none ">点击查看物流详情</a>
 		</div>
 <!-- 
 		<div class="row-fluid">