Browse Source

更新打印方式

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@6376 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 9 years ago
parent
commit
de317b4db8

+ 11 - 7
src/main/webapp/resources/js/common/services.js

@@ -208,15 +208,18 @@ define(['angular', 'toaster'], function(angular) {
         var rootPath = BaseService.getRootPath();
         return {
             /**
-			 * 打印方法 enuu 企业的UU号 pageName 打印页面的名称 condition
-			 * 单据的条件(格式:{tableName.propertyName}=value;当tableName含有'$'符号时将其换成'_'符号)
-			 * title 单据标题
+			 * 打印方法 enuu 企业的UU号 reportName 对应报表的名称 whereCondition
+			 * 单据的条件(格式:where tableName.propertyName = value)
+			 * 
 			 */
-            print: function(enuu, pageName, condition, title) {
-                $http.get(rootPath + '/reports/path', {
+            print: function(enuu, reportName, whereCondition) {
+            	console.log("enter");
+            	window.open(rootPath + "/report/print?enuu=" + enuu + "&reportName=" + reportName + "&whereCondition=" + whereCondition);
+                /*$http.get(rootPath + '/report/print', {
                     params: {
                         enuu: enuu,
-                        pagename: pageName
+                        reportName: reportName,
+                        whereCondition: whereCondition
                     }
                 }).success(function(data) {
                     if (data) {
@@ -227,8 +230,9 @@ define(['angular', 'toaster'], function(angular) {
                         toaster.pop('error', '系统错误', '没有设置相应的报表');
                     }
                 }).error(function() {
+                	console.log("out");
                     toaster.pop('error', '系统错误', '获取报表名称失败');
-                });
+                });*/
             }
         }
     }]).factory('VendorService', ['$http', '$resource', 'BaseService', function($http, $resource, BaseService) {

+ 18 - 12
src/main/webapp/resources/js/index/app.js

@@ -1334,11 +1334,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		};
 		
-		//打印
+		//打印    采购单
 		$scope.print = function(order) {
 			PurcOrder.printCount({id: order.id},{});//增加打印此次
+			console.log(order);
 			if(order.display == 1) $scope.setDisplay('setRead', order.id);//设置为已查看状态
-			ReportService.print(order.enUU, 'purchase', '{purc_orders.pu_id}=' + order.id, '销售订单-' + order.code);
+			ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
 		};
 		
 		$scope.getReply = function(item) {
@@ -1488,10 +1489,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 				});
 			}
 		};
-				
+		
+		// 采购单
 		$scope.print = function(order) {
 			PurcOrder.printCount({id: order.id},{});//增加打印此次
-			ReportService.print(order.enUU, 'purchase', '{purc_orders.pu_id}=' + order.id, '销售订单-' + order.code);
+			console.log("------");
+			console.log(order);
+			ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
 		};
 		
 		//设置为已查看
@@ -3121,10 +3125,10 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 				
 			});
 		};
-		//打印
+		//打印  样品采购单
 		$scope.print = function(sample) {
 			PurcSample.printCount({id: sample.id},{});//增加打印此次
-			ReportService.print(sample.proofing.enUU, 'proofing', '{purc_proofingitems.ppi_id}=' + sample.id, '客户打样申请-' + sample.proofing.code);
+			ReportService.print(sample.proofing.enUU, 'PURCPROOFING',"where purc$proofingitems.ppi_id =" + sample.id);
 		};
 		
 		$scope.getSend = function(proofing){
@@ -3916,11 +3920,10 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		$scope.currency = Symbol.currency;//将币别转化为对应的符号
 		$scope.active = 'todo';
 		
-		//打印
+		//打印  对账单
 		$scope.print = function(check) {
-			console.log(check);
 			FaApCheck.printCount({id: check.id},{});//增加打印此次
-			ReportService.print(check.custUu, 'purcapcheck', '{purc_apcheck.pa_id}=' + check.id, '应收对账单-' + check.code);
+			ReportService.print(check.custUu, 'PURCCHECK', 'where purc$apcheck.pa_id =' + check.id);
 		};
 		
 		//状态
@@ -5528,9 +5531,10 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			}
 		};
 		
+		//委外加工单
 		$scope.print = function(order) {
 			MakeOrder.printCount({id: order.id},{});//增加打印此次
-			ReportService.print(order.enUU, 'make', '{make_orders.ma_id}=' + order.id, ' 委外订单-' + order.code);
+			ReportService.print(order.enUU, 'MAKE', 'where make$orders.ma_id=' + order.id);
 		};
 		
 		// 获取回复记录
@@ -5613,9 +5617,10 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			order.$editing = false;
 		}
 		
+		// 委外订单
 		$scope.print = function(order) {
 			MakeOrder.printCount({id: order.id},{});//增加打印此次
-			ReportService.print(order.enUU, 'make', '{make_orders.ma_id}=' + order.id, ' 委外订单-' + order.code);
+			ReportService.print(order.enUU, 'MAKE', 'where make$orders.ma_id =' + order.id);
 		};
 		
 	}]);
@@ -6097,9 +6102,10 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			order.$editing = false;
 		}
 		
+		// 自己委外加工订单
 		$scope.print = function(order) {
 			MakeOutOrder.printCount({id: order.id},{});//增加打印此次
-			ReportService.print(order.enUU, 'make', '{make_outorders.ma_id}=' + order.id, ' 自己委外加工订单-' + order.code);
+			ReportService.print(order.enUU, 'MAKE', 'where make$outorders.ma_id =' + order.id);
 		};
 	}]);