|
@@ -5426,31 +5426,42 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
|
|
$scope.lockstatus = false;
|
|
$scope.lockstatus = false;
|
|
|
// 锁定时间按钮5秒
|
|
// 锁定时间按钮5秒
|
|
|
- $scope.lockClick = function() {
|
|
|
|
|
- $scope.lockstatus = true;
|
|
|
|
|
- $timeout(function() {
|
|
|
|
|
- $scope.lockstatus = false;
|
|
|
|
|
- }, 5000);
|
|
|
|
|
|
|
+ $scope.lockClick = function(notice) {
|
|
|
|
|
+ if(!notice.send || !notice.send.qty || notice.send.qty > notice.qty - (notice.endQty || 0)) {
|
|
|
|
|
+ } else if(!notice.send.code) {
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $scope.lockstatus = true;
|
|
|
|
|
+ $timeout(function() {
|
|
|
|
|
+ $scope.lockstatus = false;
|
|
|
|
|
+ }, 5000);
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ var isSumbit = false;
|
|
|
$scope.onReplyClick = function(notice) {
|
|
$scope.onReplyClick = function(notice) {
|
|
|
if(!notice.send || !notice.send.qty || notice.send.qty > notice.qty - (notice.endQty || 0)) {
|
|
if(!notice.send || !notice.send.qty || notice.send.qty > notice.qty - (notice.endQty || 0)) {
|
|
|
toaster.pop('warning', '警告', '数量填写错误!');
|
|
toaster.pop('warning', '警告', '数量填写错误!');
|
|
|
} else if(!notice.send.code) {
|
|
} else if(!notice.send.code) {
|
|
|
toaster.pop('warning', '警告', '请填写发货单号!');
|
|
toaster.pop('warning', '警告', '请填写发货单号!');
|
|
|
} else {
|
|
} else {
|
|
|
- var send = {code: notice.send.code, remark: notice.send.remark, sendItems: [{qty: notice.send.qty}]};
|
|
|
|
|
- $scope.loading = true;
|
|
|
|
|
- PurcNotice.save({id: notice.id}, send, function(data){
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('success', '提示', '发货成功,跳转至发货单:' + notice.send.code);
|
|
|
|
|
- $state.go('sale.send_detail', {id: data.id});
|
|
|
|
|
- }, function(response){
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('error', '发货失败', response.data);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if(!isSumbit) {
|
|
|
|
|
+ var send = {code: notice.send.code, remark: notice.send.remark, sendItems: [{qty: notice.send.qty}]};
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ PurcNotice.save({id: notice.id}, send, function(data){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('success', '提示', '发货成功,跳转至发货单:' + notice.send.code);
|
|
|
|
|
+ $state.go('sale.send_detail', {id: data.id});
|
|
|
|
|
+ }, function(response){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('error', '发货失败', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ isSumbit = true;
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$scope.checkboxes = {
|
|
$scope.checkboxes = {
|
|
|
checked : false
|
|
checked : false
|
|
@@ -5552,6 +5563,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
data && ($scope.tableParams.reload());
|
|
data && ($scope.tableParams.reload());
|
|
|
}, true);
|
|
}, 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', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state){
|
|
|
$scope.notices = angular.copy(selectedNotices);
|
|
$scope.notices = angular.copy(selectedNotices);
|
|
|
$scope.currency = Symbol.currency;//将币别转化为对应的符号
|
|
$scope.currency = Symbol.currency;//将币别转化为对应的符号
|