|
@@ -13,8 +13,22 @@ window.onload = function(){
|
|
$(".top_end").html(today);
|
|
$(".top_end").html(today);
|
|
getOrdersInit();
|
|
getOrdersInit();
|
|
$(".code_input_in").focus();
|
|
$(".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(){
|
|
function searchOrder(){
|
|
var code = $('.search_code').val();
|
|
var code = $('.search_code').val();
|
|
if(code.length == 0){
|
|
if(code.length == 0){
|
|
@@ -39,23 +53,6 @@ function searchOrder(){
|
|
});
|
|
});
|
|
return false;
|
|
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
|
|
* by lijg
|
|
* 2018.11.07
|
|
* 2018.11.07
|
|
@@ -135,6 +132,7 @@ $(document).ready(function(){
|
|
},
|
|
},
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+
|
|
$('.export_btn').click(function(){
|
|
$('.export_btn').click(function(){
|
|
var shop = $("#shop").val();
|
|
var shop = $("#shop").val();
|
|
var status = $("#orders_status").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;
|
|
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(){
|
|
$('.export_yesterday_btn').click(function(){
|
|
eyb();
|
|
eyb();
|
|
@@ -213,72 +208,43 @@ $(document).ready(function(){
|
|
},
|
|
},
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
$('#list').on('click', '.print_bc', function(){
|
|
$('#list').on('click', '.print_bc', function(){
|
|
var order_barcode = $(this).parent().parent('.list_block').find('.order_barcode').html();
|
|
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 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 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 transport = $(this).parent().parent('.list_block').find('.order_id').data('transport');
|
|
var oid = $(this).parent().parent('.list_block').find('.order_id').html();
|
|
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(){
|
|
$('.print_all').click(function(){
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -290,44 +256,24 @@ $(document).ready(function(){
|
|
alert('暂无可打印数据!');
|
|
alert('暂无可打印数据!');
|
|
}else{
|
|
}else{
|
|
var arr = JSON.parse(rs);
|
|
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('');
|
|
$('.barcode>.box').html('');
|
|
$('.yp').html('').hide();
|
|
$('.yp').html('').hide();
|
|
$('.np').show();
|
|
$('.np').show();
|