|
|
@@ -5564,7 +5564,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}, true);
|
|
|
}]);
|
|
|
|
|
|
- app.controller('SaleNoticeSendByBatchCtrl', ['$scope', '$modalInstance', 'Symbol', 'selectedNotices', 'PurcNotice', 'toaster', '$state', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state){
|
|
|
+ app.controller('SaleNoticeSendByBatchCtrl', ['$scope', '$modalInstance', 'Symbol', 'selectedNotices', 'PurcNotice', 'toaster', '$state', '$timeout', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state, $timeout){
|
|
|
$scope.notices = angular.copy(selectedNotices);
|
|
|
$scope.currency = Symbol.currency;//将币别转化为对应的符号
|
|
|
$scope.saleSend = {
|
|
|
@@ -5600,6 +5600,20 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.notices.splice(index, 1);
|
|
|
};
|
|
|
|
|
|
+ $scope.lockstatus = false;
|
|
|
+ // 锁定时间按钮5秒
|
|
|
+ $scope.lockClick = function(notice) {
|
|
|
+ if($scope.saleSend.code == '') {//送货单号为空
|
|
|
+ return;
|
|
|
+ }else {
|
|
|
+ $scope.lockstatus = true;
|
|
|
+ $timeout(function() {
|
|
|
+ $scope.lockstatus = false;
|
|
|
+ }, 5000);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var isSumbit = false;
|
|
|
//确认送货
|
|
|
$scope.sendByBatch = function () {
|
|
|
$scope.saleSend.sendItems = [];
|
|
|
@@ -5630,13 +5644,19 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if(!valid) {
|
|
|
toaster.pop('error', '错误', '只有客户一致、币别一致、付款方式一致才能一起发货。');
|
|
|
} else {
|
|
|
- PurcNotice.sendByBatch({}, $scope.saleSend, function(data){
|
|
|
- toaster.pop('success', '提示', '发货成功,跳转至发货单:' + $scope.saleSend.code);
|
|
|
- $modalInstance.close('success');
|
|
|
- $state.go('sale.send_detail', {id: data.id});
|
|
|
- }, function(response){
|
|
|
- toaster.pop('error', '错误', response.data);
|
|
|
- });
|
|
|
+ if(!isSumbit) {
|
|
|
+ PurcNotice.sendByBatch({}, $scope.saleSend, function(data){
|
|
|
+ toaster.pop('success', '提示', '发货成功,跳转至发货单:' + $scope.saleSend.code);
|
|
|
+ $modalInstance.close('success');
|
|
|
+ $state.go('sale.send_detail', {id: data.id});
|
|
|
+ }, function(response){
|
|
|
+ toaster.pop('error', '错误', response.data);
|
|
|
+ });
|
|
|
+ isSumbit = true;
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|