Browse Source

利用filter生成随机送货单号

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1040 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 years ago
parent
commit
c9b44c6d6e
1 changed files with 3 additions and 7 deletions
  1. 3 7
      src/main/webapp/resources/js/index/app.js

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

@@ -1099,16 +1099,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		    item[openParam] = !item[openParam];
 		};
 		
+		//生成随机单号
 		$scope.autoCode = function(notice){
-			var date = new Date();
-			var yy = ('' + date.getFullYear()).substr(2,2);
-			var mm = (date.getMonth() > 8) ? '' + (date.getMonth() + 1) : '0' + (date.getMonth() + 1);
-			var dd = (date.getDate() > 9) ? '' + date.getDate() : '0' + date.getDate();
-			var code = '' + yy + mm + dd + date.getHours() 
-				+ date.getMinutes() + date.getSeconds() + '-' + date.getMilliseconds();
-			notice.send.code = code;
+			notice.send.code = $filter('date')(new Date(), 'yyMMddHHmmss-sss');
 		};
 		
+		//可送货日期
 		$scope.sendDate = function(notice) {
 			var stock = notice.orderItem.product.ltinstock || 0;
 			var de = new Date(notice.delivery);