|
|
@@ -1462,6 +1462,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$rootScope.truck = [];
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
$scope.openTrack = function () {
|
|
|
$modal.open({
|
|
|
templateUrl: 'static/tpl/index/sale/track.html',
|
|
|
@@ -1476,7 +1477,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
- app.controller('TruckModalCtrl', ['$scope', '$rootScope', '$modalInstance', 'SaleTruck', 'PurcNotice', 'toaster', '$state', '$filter', '$timeout', function ($scope, $rootScope, $modalInstance, SaleTruck, PurcNotice, toaster, $state, $filter, $timeout) {
|
|
|
+ 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.saleSend = {sendItems: []};
|
|
|
SaleTruck.detail({}, function (data) {
|
|
|
// 按物料编号排序
|
|
|
@@ -1513,6 +1514,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.lockstatus = false;
|
|
|
}, 5000);
|
|
|
}
|
|
|
+ var getToken = function() {
|
|
|
+ if($scope.token == null) {
|
|
|
+ token.info({userType: 'salenotice'}, {}, function(data) {
|
|
|
+ $scope.token = data.token;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getToken();
|
|
|
$scope.send = function () {// 发货
|
|
|
if (!$scope.saleSend.code || $scope.saleSend.code == '') {//送货单号为空
|
|
|
toaster.pop('error', '错误', '请输入送货单号');
|
|
|
@@ -1541,13 +1552,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
payments: payments,
|
|
|
sendItems: items
|
|
|
});
|
|
|
- PurcNotice.sendByBatch({}, send, function (data) {
|
|
|
- toaster.pop('success', '提示', '发货成功,跳转至发货单:' + send.code);
|
|
|
- $modalInstance.close(true);
|
|
|
- $state.go('sale.send_detail', {id: data.id});
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', '错误', response.data);
|
|
|
- });
|
|
|
+ if($scope.token != null) {
|
|
|
+ PurcNotice.sendByBatch({token: $scope.token}, send, function (data) {
|
|
|
+ toaster.pop('success', '提示', '发货成功,跳转至发货单:' + send.code);
|
|
|
+ $modalInstance.close(true);
|
|
|
+ $state.go('sale.send_detail', {id: data.id});
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', '错误', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$scope.setCheckedNoticeRead = function () {
|
|
|
@@ -15311,7 +15324,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
// 查询代采定单在信扬中的审批情况
|
|
|
app.controller('ViewApprovalDetailCtrl', ['$scope', 'toaster', '$modalInstance', 'DeputyOrder', 'BaseService', 'ngTableParams', 'uu', 'salecode', function ($scope, toaster, $modalInstance, DeputyOrder, BaseService, ngTableParams, uu, salecode) {
|
|
|
- DeputyOrder.approve({uu: uu, code: salecode}, {}, function (data) {
|
|
|
+ DeputyOrder.approve({uu: uu, code: 'SS16214340'}, {}, function (data) {
|
|
|
$scope.nodes = data.nodes;
|
|
|
$scope.process = data.process;
|
|
|
if(data.error) {
|