|
|
@@ -1704,6 +1704,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
app.controller('TruckModalCtrl', ['$scope', '$rootScope', '$modalInstance', 'SaleTruck', 'PurcNotice', 'toaster', '$state', '$filter', '$timeout', 'token', function ($scope, $rootScope, $modalInstance, SaleTruck, PurcNotice, toaster, $state, $filter, $timeout, token) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.saleSend = {sendItems: []};
|
|
|
SaleTruck.detail({}, function (data) {
|
|
|
// 按物料编号排序
|
|
|
@@ -1749,8 +1750,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
getToken();
|
|
|
$scope.send = function () {// 发货
|
|
|
+ $scope.loading = true;
|
|
|
if (!$scope.saleSend.code || $scope.saleSend.code == '') {//送货单号为空
|
|
|
toaster.pop('error', '错误', '请输入送货单号');
|
|
|
+ $scope.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
var currency = $scope.notices[0].orderItem.order.currency,
|
|
|
@@ -1778,10 +1781,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
if($scope.token != null) {
|
|
|
PurcNotice.sendByBatch({token: $scope.token}, send, function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop('success', '提示', '发货成功,跳转至发货单:' + send.code);
|
|
|
$modalInstance.close(true);
|
|
|
$state.go('sale.send_detail', {id: data.id});
|
|
|
}, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
});
|
|
|
}
|