Просмотр исходного кода

移动端送货提醒界面

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@536 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 лет назад
Родитель
Сommit
cf9ad0411c
1 измененных файлов с 48 добавлено и 0 удалено
  1. 48 0
      src/main/webapp/resources/js/index/mobile.index.app.js

+ 48 - 0
src/main/webapp/resources/js/index/mobile.index.app.js

@@ -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;
 });