chengwl 4 jaren geleden
bovenliggende
commit
613f904bfd
3 gewijzigde bestanden met toevoegingen van 190 en 167 verwijderingen
  1. 2 2
      application/controller/WigsOutCtrl.php
  2. 125 48
      public/script/common_wigsout copy.js
  3. 63 117
      public/script/common_wigsout.js

+ 2 - 2
application/controller/WigsOutCtrl.php

@@ -755,8 +755,8 @@ class WigsOutCtrl{
             $str = '';
             $arr = array();
             foreach($rs as $val){
-            	$str = $val['order_barcode'] . '*' . $val['goods_info'] . '*' . $val['transport'] . '*' . $val['print_time'];
-            	// $str = '<div class="str_box">'.$val['order_barcode'] . '*' . $val['goods_info'] . '*' . $val['transport'] . '*' . $val['print_time'].'</div>';
+            	// $str = $val['order_barcode'] . '*' . $val['goods_info'] . '*' . $val['transport'] . '*' . $val['print_time'];
+            	$str = '<div class="str_box">'.$val['order_barcode'] . '*' . $val['goods_info'] . '*' . $val['transport'] . '*' . $val['print_time'].'</div>';
             	$arr[] = array(
             			'barcode' => $val['order_barcode'],
             			'str' => $str

+ 125 - 48
public/script/common_wigsout copy.js

@@ -13,7 +13,33 @@ window.onload = function(){
 	$(".top_end").html(today);
 	getOrdersInit();
 	$(".code_input_in").focus();
+	
 };
+function searchOrder(){
+	var code = $('.search_code').val();
+		if(code.length == 0){
+			alert('请输入所查找编号!');
+			return false;
+		}
+		var key = getUrlParam();
+		$.ajax({
+			type: 'get',
+			url: 'application/main.php',
+			data: 'c=wigsOut&m=searchOrders&code=' + code + '&key=' + key,
+			success: function(rs){
+				if(rs == '-1'){
+					alert('查无此编号!');
+				}else{
+					$("#list").html(rs);
+				}
+				$('.search_code').val("");
+				$('.search_code').focus();
+				
+			},
+		});
+		return false;
+}
+
 
 /**
  * get any date
@@ -109,7 +135,6 @@ $(document).ready(function(){
 			},
 		});
 	});
-	
 	$('.export_btn').click(function(){
 		var shop = $("#shop").val();
 		var status = $("#orders_status").val();
@@ -128,6 +153,9 @@ $(document).ready(function(){
 		
 		window.location.href = 'application/main.php?c=wigsOut&m=exportExcel&shop='+shop+'&status='+status+'&startDate='+start_date+'&endDate='+end_date+'&type='+type+'&time_type='+time_type;
 	});
+
+
+
 	
 	$('.export_yesterday_btn').click(function(){
 		eyb();
@@ -185,43 +213,72 @@ $(document).ready(function(){
 			},
 		});
 	});
+	
 	$('#list').on('click', '.print_bc', function(){
 		var order_barcode = $(this).parent().parent('.list_block').find('.order_barcode').html();
 		var goods_info = $(this).parent().parent('.list_block').find('.goods_info').html();
 		var print_time = $(this).parent().parent('.list_block').find('.order_id').data('printtime');
 		var transport = $(this).parent().parent('.list_block').find('.order_id').data('transport');
 		var oid = $(this).parent().parent('.list_block').find('.order_id').html();
+		var LODOP;
+		LODOP=getLodop();
+		LODOP.PRINT_INIT("");
+		if (LODOP.CVERSION) CLODOP.On_Return = function(TaskID, Value) {
+			if(Value==1){
+				$.ajax({
+					type: 'post',
+					url: 'application/main.php',
+					data: 'c=wigsOut&m=updatePrint&oid=' + oid,
+					success: function(rs){
+						if(rs == -1){
+							alert('系统错误,请联系开发人员!');
+						}else{
+							$('.barcode>.box').html('');
+							$('.yp').html('').hide();
+							$('.np').show();
+							reloadNow();
+						}
+					},
+				});
+			}else{
+				alert('系统错误,请联系开发人员!');
+			}
+		}
 
-		var bctype = "code128";
-		var settings = {
-				output: "css",
-				bgColor: "#ffffff",
-				color: "#000000",
-				barWidth: "3.5",
-				barHeight: "80",
-				fontSize: 0
-		};
-		$('.barcode>.box').barcode(order_barcode, bctype, settings);
-		let barcode = $('.barcode').html();
-		let html_str = '<div class="str_box">'+order_barcode + '*' + goods_info + '*' + transport + '*' + print_time+'</div>';
-		$('.yp').append('<div>'+barcode+html_str+'</div>').show();
-		$('.np').hide();
-		window.print();
-		$.ajax({
-			type: 'post',
-			url: 'application/main.php',
-			data: 'c=wigsOut&m=updatePrint&oid=' + oid,
-			success: function(rs){
-				if(rs == -1){
-					alert('系统错误,请联系开发人员!');
-				}else{
-					$('.barcode>.box').html('');
-					$('.yp').html('').hide();
-					$('.np').show();
-					reloadNow();
-				}
-			},
-		});
+
+		LODOP.ADD_PRINT_BARCODE(3, 2, 400, 35, "128Auto", order_barcode);
+		LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
+		var str=order_barcode+'*'+goods_info + '*' + transport + '*' + print_time;
+		if(str.length>=120){
+			str1=str.slice(0,120);
+			str2=str.slice(120);
+			LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str1);
+			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+			LODOP.NewPageA();
+			LODOP.ADD_PRINT_TEXT(3, "0mm",400,"45mm", str2);
+			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+		}else{
+			LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str);
+			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+		}
+
+
+		// LODOP.ADD_PRINT_BARCODE(3, 10, 32, 400, "128Auto", order_barcode);
+		// LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
+		// LODOP.SET_PRINT_STYLEA(0, "Angle", 90)
+		// var str=order_barcode+'*'+goods_info + '*' + transport + '*' + print_time;
+		// LODOP.ADD_PRINT_TEXT(450, 4, 500, 45, str);
+		// LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
+		// LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+		// LODOP.SET_PRINT_STYLEA(0, "Angle", 90)
+			// LODOP.SET_PRINT_PAGESIZE(3,450,70,"")//设置默认纸张
+		LODOP.PRINT();
 	});
 	$('.print_all').click(function(){
 		$.ajax({
@@ -233,24 +290,44 @@ $(document).ready(function(){
 					alert('暂无可打印数据!');
 				}else{
 					var arr = JSON.parse(rs);
-					var html = '';
-					var bctype = "code128";
-					var settings = {
-							output: "css",
-							bgColor: "#ffffff",
-							color: "#000000",
-							barWidth: "3.5",
-							barHeight: "90",
-							fontSize: 0
-					};
-					for(x in arr){
-						$('.barcode>.box').barcode(arr[x].barcode, bctype, settings);
-						var barcode = $('.barcode').html();
-						html += '<div>'+barcode + arr[x].str+'</div>';
+					var r=confirm("共有"+arr.length+"个单据,是否打印")
+					console.log(r);
+					if (r==false){
+						return false;
 					}
-					$('.yp').html(html).show();
-					$('.np').hide();
-					window.print();
+					var LODOP;
+					LODOP=getLodop();
+					LODOP.PRINT_INIT("");
+					for(var i = 0; i <= arr.length; i++) {
+						(function(i) {
+						 setTimeout(function() {
+						  LODOP.ADD_PRINT_BARCODE(3, 2, 400, 35, "128Auto", arr[i].barcode);
+						  LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
+						  str=arr[i].str;
+						  if(str.length>=120){
+							str1=str.slice(0,120);
+							str2=str.slice(120);
+							LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str1);
+							LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+							LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+							LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+							LODOP.NewPageA();
+							LODOP.ADD_PRINT_TEXT(3, "0mm",400,"45mm", str2);
+							LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+							LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+							LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+						  }else{
+							LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str);
+							LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
+							LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
+							LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
+						  }
+						  // LODOP.SET_PRINT_PAGESIZE(3,450,70,"")//设置默认纸张
+						  // LODOP.PRINTA();
+						  LODOP.PRINT();
+						 }, (i + 1) * 2000);
+						})(i)
+					   }
 					$('.barcode>.box').html('');
 					$('.yp').html('').hide();
 					$('.np').show();

+ 63 - 117
public/script/common_wigsout.js

@@ -13,8 +13,22 @@ window.onload = function(){
 	$(".top_end").html(today);
 	getOrdersInit();
 	$(".code_input_in").focus();
-	
 };
+
+/**
+ * get any date
+ * by lijg
+ * 20181108
+ */
+function myGetDate(whichDay){
+	var myDate = new Date();
+	myDate.setDate(myDate.getDate()+whichDay);
+	var year = myDate.getFullYear();
+	var month = (myDate.getMonth()+1<10)?'0'+(myDate.getMonth()+1):(myDate.getMonth()+1);
+	var day = (myDate.getDate()<10)?('0'+myDate.getDate()):myDate.getDate();
+	var today = year + '-' + month + '-' + day;
+	return today;
+}
 function searchOrder(){
 	var code = $('.search_code').val();
 		if(code.length == 0){
@@ -39,23 +53,6 @@ function searchOrder(){
 		});
 		return false;
 }
-
-
-/**
- * get any date
- * by lijg
- * 20181108
- */
-function myGetDate(whichDay){
-	var myDate = new Date();
-	myDate.setDate(myDate.getDate()+whichDay);
-	var year = myDate.getFullYear();
-	var month = (myDate.getMonth()+1<10)?'0'+(myDate.getMonth()+1):(myDate.getMonth()+1);
-	var day = (myDate.getDate()<10)?('0'+myDate.getDate()):myDate.getDate();
-	var today = year + '-' + month + '-' + day;
-	return today;
-}
-
 /**
  * by lijg
  * 2018.11.07
@@ -135,6 +132,7 @@ $(document).ready(function(){
 			},
 		});
 	});
+	
 	$('.export_btn').click(function(){
 		var shop = $("#shop").val();
 		var status = $("#orders_status").val();
@@ -153,9 +151,6 @@ $(document).ready(function(){
 		
 		window.location.href = 'application/main.php?c=wigsOut&m=exportExcel&shop='+shop+'&status='+status+'&startDate='+start_date+'&endDate='+end_date+'&type='+type+'&time_type='+time_type;
 	});
-
-
-
 	
 	$('.export_yesterday_btn').click(function(){
 		eyb();
@@ -213,72 +208,43 @@ $(document).ready(function(){
 			},
 		});
 	});
-	
 	$('#list').on('click', '.print_bc', function(){
 		var order_barcode = $(this).parent().parent('.list_block').find('.order_barcode').html();
 		var goods_info = $(this).parent().parent('.list_block').find('.goods_info').html();
 		var print_time = $(this).parent().parent('.list_block').find('.order_id').data('printtime');
 		var transport = $(this).parent().parent('.list_block').find('.order_id').data('transport');
 		var oid = $(this).parent().parent('.list_block').find('.order_id').html();
-		var LODOP;
-		LODOP=getLodop();
-		LODOP.PRINT_INIT("");
-		if (LODOP.CVERSION) CLODOP.On_Return = function(TaskID, Value) {
-			if(Value==1){
-				$.ajax({
-					type: 'post',
-					url: 'application/main.php',
-					data: 'c=wigsOut&m=updatePrint&oid=' + oid,
-					success: function(rs){
-						if(rs == -1){
-							alert('系统错误,请联系开发人员!');
-						}else{
-							$('.barcode>.box').html('');
-							$('.yp').html('').hide();
-							$('.np').show();
-							reloadNow();
-						}
-					},
-				});
-			}else{
-				alert('系统错误,请联系开发人员!');
-			}
-		}
-
-
-		LODOP.ADD_PRINT_BARCODE(3, 2, 400, 35, "128Auto", order_barcode);
-		LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
-		var str=order_barcode+'*'+goods_info + '*' + transport + '*' + print_time;
-		if(str.length>=120){
-			str1=str.slice(0,120);
-			str2=str.slice(120);
-			LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str1);
-			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-			LODOP.NewPageA();
-			LODOP.ADD_PRINT_TEXT(3, "0mm",400,"45mm", str2);
-			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-		}else{
-			LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str);
-			LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-			LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-			LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-		}
 
-
-		// LODOP.ADD_PRINT_BARCODE(3, 10, 32, 400, "128Auto", order_barcode);
-		// LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
-		// LODOP.SET_PRINT_STYLEA(0, "Angle", 90)
-		// var str=order_barcode+'*'+goods_info + '*' + transport + '*' + print_time;
-		// LODOP.ADD_PRINT_TEXT(450, 4, 500, 45, str);
-		// LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
-		// LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-		// LODOP.SET_PRINT_STYLEA(0, "Angle", 90)
-			// LODOP.SET_PRINT_PAGESIZE(3,450,70,"")//设置默认纸张
-		LODOP.PRINT();
+		var bctype = "code128";
+		var settings = {
+				output: "css",
+				bgColor: "#ffffff",
+				color: "#000000",
+				barWidth: "3.5",
+				barHeight: "80",
+				fontSize: 0
+		};
+		$('.barcode>.box').barcode(order_barcode, bctype, settings);
+		let barcode = $('.barcode').html();
+		let html_str = '<div class="str_box">'+order_barcode + '*' + goods_info + '*' + transport + '*' + print_time+'</div>';
+		$('.yp').append('<div>'+barcode+html_str+'</div>').show();
+		$('.np').hide();
+		window.print();
+		$.ajax({
+			type: 'post',
+			url: 'application/main.php',
+			data: 'c=wigsOut&m=updatePrint&oid=' + oid,
+			success: function(rs){
+				if(rs == -1){
+					alert('系统错误,请联系开发人员!');
+				}else{
+					$('.barcode>.box').html('');
+					$('.yp').html('').hide();
+					$('.np').show();
+					reloadNow();
+				}
+			},
+		});
 	});
 	$('.print_all').click(function(){
 		$.ajax({
@@ -290,44 +256,24 @@ $(document).ready(function(){
 					alert('暂无可打印数据!');
 				}else{
 					var arr = JSON.parse(rs);
-					var r=confirm("共有"+arr.length+"个单据,是否打印")
-					console.log(r);
-					if (r==false){
-						return false;
+					var html = '';
+					var bctype = "code128";
+					var settings = {
+							output: "css",
+							bgColor: "#ffffff",
+							color: "#000000",
+							barWidth: "3.3",
+							barHeight: "90",
+							fontSize: 0
+					};
+					for(x in arr){
+						$('.barcode>.box').barcode(arr[x].barcode, bctype, settings);
+						var barcode = $('.barcode').html();
+						html += '<div>'+barcode + arr[x].str+'</div>';
 					}
-					var LODOP;
-					LODOP=getLodop();
-					LODOP.PRINT_INIT("");
-					for(var i = 0; i <= arr.length; i++) {
-						(function(i) {
-						 setTimeout(function() {
-						  LODOP.ADD_PRINT_BARCODE(3, 2, 400, 35, "128Auto", arr[i].barcode);
-						  LODOP.SET_PRINT_STYLEA(0, "showBarText", 0)
-						  str=arr[i].str;
-						  if(str.length>=120){
-						   str1=str.slice(0,120);
-						   str2=str.slice(120);
-						   LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str1);
-						   LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-						   LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-						   LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-						   LODOP.NewPageA();
-						   LODOP.ADD_PRINT_TEXT(3, "0mm",400,"45mm", str2);
-						   LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-						   LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-						   LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-						  }else{
-						   LODOP.ADD_PRINT_TEXT(47, "0mm",400,"45mm", str);
-						   LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
-						   LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
-						   LODOP.SET_PRINT_STYLEA(0,"FontName","黑体")
-						  }
-						  // LODOP.SET_PRINT_PAGESIZE(3,450,70,"")//设置默认纸张
-						  // LODOP.PRINTA();
-						  LODOP.PRINT();
-						 }, (i + 1) * 2000);
-						})(i)
-					   }
+					$('.yp').html(html).show();
+					$('.np').hide();
+					window.print();
 					$('.barcode>.box').html('');
 					$('.yp').html('').hide();
 					$('.np').show();