Browse Source

货车发货后5s内不能重复点击

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9370 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 years ago
parent
commit
6807d0ecc2

+ 10 - 1
src/main/webapp/resources/js/index/app.js

@@ -1451,7 +1451,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		};
 	}]);
 	
-	app.controller('TruckModalCtrl', ['$scope', '$rootScope', '$modalInstance', 'SaleTruck', 'PurcNotice', 'toaster', '$state', '$filter', function($scope, $rootScope, $modalInstance, SaleTruck, PurcNotice, toaster, $state, $filter){
+	app.controller('TruckModalCtrl', ['$scope', '$rootScope', '$modalInstance', 'SaleTruck', 'PurcNotice', 'toaster', '$state', '$filter', '$timeout', function($scope, $rootScope, $modalInstance, SaleTruck, PurcNotice, toaster, $state, $filter, $timeout){
 		$scope.saleSend = {sendItems: []};
 		SaleTruck.detail({}, function(data){
 			// 按物料编号排序
@@ -1479,6 +1479,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.cancel = function() {
 			$modalInstance.close();
 		};
+		
+		$scope.lockstatus = false;
+		// 锁定时间按钮5秒
+		$scope.lockClick = function() {
+			$scope.lockstatus = true;
+			$timeout(function() {
+				$scope.lockstatus = false;
+			}, 5000);
+		}
 		$scope.send = function() {// 发货
 			if(!$scope.saleSend.code || $scope.saleSend.code == '') {//送货单号为空
 				toaster.pop('error', '错误', '请输入送货单号');

+ 2 - 2
src/main/webapp/resources/tpl/index/sale/track.html

@@ -85,7 +85,7 @@
 				class="text-num text-bold" ng-bind="total | number:2"></span></li>
 		</ul>
 	</div>
-	<button class="btn btn-primary" ng-click="send()"
-		ng-disabled="!notices||notices.length==0" type="button">确认送货</button>
+	<button class="btn btn-primary" ng-click="send(); lockClick()"
+		ng-disabled="!notices||notices.length==0 || lockstatus" type="button">确认送货</button>
 	<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
 </div>