Przeglądaj źródła

送货提醒-送货记录

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@768 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 lat temu
rodzic
commit
3c8354e6d6

+ 7 - 3
src/main/webapp/resources/js/index/app.js

@@ -1117,11 +1117,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 		
 		$scope.getSends = function(notice){
-			if( ! notice.sends){
+			if( ! notice.sends && notice.endQty > 0){
+				notice.getSendsing = true;
+				notice.getSendsError = false;
 				PurcNotice.getSends({id: notice.id}, function(data){
+					notice.getSendsing = false;
+					notice.getSendsError = false;
 					notice.sends = data;
 				}, function(response){
-					
+					notice.getSendsing = false;
+					notice.getSendsError = true;
 				});
 			}
 		};	
@@ -2148,7 +2153,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	 */
 	app.filter('timespan', function(){
 		return function(time) {
-			console.log(time);
 			if(time == null)
 				return '9999年';
 			var now = new Date().getTime(), span = time - now, 

+ 32 - 8
src/main/webapp/resources/tpl/index/sale/notice.html

@@ -323,9 +323,22 @@
 			</td>
 			<td class="br-l">
 				<div ng-show="notice.endQty >= notice.qty" class="text-center dropdown">
-					<a href="javascript:void(0);" class="dropdown-toggle text-default" ng-click="getSends(notice)">发货记录<i class="fa fa-fw fa-angle-down"></i></a>
+					<a href="javascript:void(0);" class="dropdown-toggle text-default" ng-mouseenter="getSends(notice)">发货记录<i class="fa fa-fw fa-angle-down"></i></a>
 					<div class="dropdown-menu order-send arrow-border arrow-bottom-right" style="padding: 10px 15px">
-						<span class="text-muted">还未发货</span>
+						<span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
+						<span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
+						<span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
+						<ul class="list-unstyled list-menu" ng-if="notice.sends">
+							<li ng-repeat="send in notice.sends">
+								<div ng-class="{'text-inverse': $index==0}">
+									{{::send.send.date | date:'MM-dd HH:mm'}}
+								</div>
+								<div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}} {{::send.orderItem.product.unit}}</div>
+								<div class="text-muted">单号:{{::send.send.code}}
+									<i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
+								</div>
+							</li>
+						</ul>
 					</div>
 				</div>
 				<div ng-show="!notice.endQty || notice.endQty < notice.qty">
@@ -334,13 +347,24 @@
 							<li>本次需求:{{::notice.qty}}<span class="text-muted pull-right">[订单数:{{::notice.orderItem.qty}}]</span></li>
 							<li class="dropdown dropdown-submenu">剩余未发:<span
 								class="text-num text-inverse"
-								ng-bind="notice.qty-(notice.endQty || 0)"></span> <a
-								href="javascript:void(0);" class="dropdown-toggle pull-right"><span
+								ng-bind="notice.qty-(notice.endQty || 0)"></span> <a ng-click="" class="pull-right dropdown-toggle" ng-mouseenter="getSends(notice)"><span
 									ng-class="{'text-muted' : notice.endQty == null || notice.endQty == 0,'text-default': notice.endQty > 0}">[已发货:{{notice.endQty}}]</span></a>
-								<div
-									class="dropdown-menu order-send arrow-border arrow-bottom-right"
-									style="padding: 10px 15px">
-									<span class="text-muted">还未发货</span>
+								<div class="dropdown-menu order-send arrow-border arrow-bottom-right"
+									style="padding: 10px 15px; width: 220px;">
+									<span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
+									<span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
+									<span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
+									<ul class="list-unstyled list-menu" ng-if="notice.sends">
+										<li ng-repeat="send in notice.sends">
+											<div ng-class="{'text-inverse': $index==0}">
+												{{::send.send.date | date:'MM-dd HH:mm'}}
+											</div>
+											<div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}} {{::send.orderItem.product.unit}}</div>
+											<div class="text-muted">单号:{{::send.send.code}}
+												<i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
+											</div>
+										</li>
+									</ul>
 								</div>
 							</li>
 						</ul>