|
|
@@ -18,6 +18,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
}).state('saleInquiry', {
|
|
|
url: '/sale/inquiry/:itemId',
|
|
|
templateUrl: 'static/tpl/index_mobile/sale/saleInquiry.html'
|
|
|
+ }).state('saleNotice', {
|
|
|
+ url: '/sale/notice/:id',
|
|
|
+ templateUrl: 'static/tpl/index_mobile/sale/saleNotice.html'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -304,5 +307,50 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
});
|
|
|
};
|
|
|
});
|
|
|
+
|
|
|
+ app.controller('SaleNoticeCtrl', function($scope, $stateParams, toaster, PurcNotice, Symbol){
|
|
|
+ $scope.loading = true;
|
|
|
+ $scope.symbol = Symbol.currency;//把币别转化为符号
|
|
|
+ $scope.logShow = false;
|
|
|
+
|
|
|
+ $scope.notice = PurcNotice.get({id: $stateParams.id}, function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ }, function(response){
|
|
|
+ toaster.pop('error', '加载失败', response.data);
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.getSends = function(){
|
|
|
+ if(! $scope.notice.sendLogs) {
|
|
|
+ $scope.notice.sendLogs = PurcNotice.getSends({id: $stateParams.id}, function(data){
|
|
|
+
|
|
|
+ }, function(response){
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.onReplyClick = function(notice) {
|
|
|
+ if(notice.send.qty > notice.qty - (notice.endQty || 0)) {
|
|
|
+ toaster.pop('warning', '警告', '本次发货数量超出!');
|
|
|
+ } else {
|
|
|
+ var send = {code: notice.send.code, sendItems: [{qty: notice.send.qty}]};
|
|
|
+ $scope.loading = true;
|
|
|
+ PurcNotice.save({id: notice.id}, send, function(){
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.notice = PurcNotice.get({id: $stateParams.id}, function(data){
|
|
|
+ }, function(response){
|
|
|
+ toaster.pop('error', '加载失败', response.data);
|
|
|
+ });
|
|
|
+ toaster.pop('success', '提示', '发货成功');
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '失败', response);
|
|
|
+ });
|
|
|
+ $scope.logShow = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
return app;
|
|
|
});
|