tg_small_v10.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * 打印盒包装纸(10cmx6cm)
  3. * 2018/8/31
  4. * */
  5. var LODOP; //声明为全局变量
  6. function small_v10_print(username,goodsName,date,number,boxDate,batch,boxSzie,check,qrcode,supply,tuopan,num) {
  7. LODOP=getLodop();
  8. for(var i=0;i<num;i++){
  9. LODOP.PRINT_INIT("");
  10. LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848","");
  11. LODOP.SET_PRINT_PAGESIZE(1,1000,600,"CreateCustomPage");
  12. AddPrintContentV10(username,goodsName,date,number,boxDate,batch,boxSzie,check,qrcode,supply,tuopan);
  13. if(window.location.host=="dm-test.7in6.com"){
  14. //为测试服务器,预览
  15. LODOP.PREVIEW();
  16. }else if(window.location.host=="dm.7in6.com"){
  17. //为正式服务器,打印
  18. LODOP.PRINT();
  19. }else{
  20. LODOP.PREVIEW();
  21. }
  22. }
  23. /* LODOP.PRINT_INIT("");
  24. LODOP.SET_PRINT_PAGESIZE(1,1000,600,"CreateCustomPage");
  25. AddPrintContent(username,goodsName,date,number,boxDate,batch,boxSzie,check,qrcode,supply);
  26. LODOP.PRINT();
  27. LODOP.PRINT_INIT("");
  28. LODOP.SET_PRINT_PAGESIZE(1,1000,600,"CreateCustomPage");
  29. AddPrintContent(username,goodsName,date,number,boxDate,batch,boxSzie,check,qrcode,supply);
  30. LODOP.PRINT();*/
  31. };
  32. function AddPrintContentV10(username,goodsName,date,number,boxDate,batch,boxSzie,check,qrcode,supply,tuopan) {
  33. LODOP.ADD_PRINT_TEXT(10,5,400,100,"客户名称:"+username);
  34. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  35. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  36. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  37. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  38. LODOP.ADD_PRINT_TEXT(30,5,431,20,"产品名称:"+goodsName);
  39. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  40. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  41. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  42. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  43. LODOP.ADD_PRINT_TEXT(50,5,431,20,"生产日期:"+date);
  44. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  45. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  46. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  47. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  48. LODOP.ADD_PRINT_TEXT(70,5,431,20,"包装日期:"+boxDate);
  49. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  50. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  51. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  52. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  53. LODOP.ADD_PRINT_TEXT(90,5,431,20,"规格:"+boxSzie);
  54. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  55. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  56. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  57. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  58. LODOP.ADD_PRINT_TEXT(110,5,431,20,"检验:"+check);
  59. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  60. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  61. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  62. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  63. LODOP.ADD_PRINT_TEXT(130,5,431,20,"数量:"+number);
  64. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  65. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  66. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  67. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  68. LODOP.ADD_PRINT_TEXT(170,170,431,20,"流程号:");
  69. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  70. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  71. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  72. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  73. LODOP.ADD_PRINT_TEXT(150,5,431,20,"批次号:"+batch);
  74. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  75. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  76. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  77. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  78. LODOP.ADD_PRINT_TEXT(170,5,431,20,"检验号:");
  79. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  80. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  81. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  82. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  83. LODOP.ADD_PRINT_TEXT(190,5,431,20,"本包版号:");
  84. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  85. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  86. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  87. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  88. LODOP.ADD_PRINT_TEXT(190,170,431,20,"包装:");
  89. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  90. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  91. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  92. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  93. LODOP.ADD_PRINT_TEXT(210,5,431,20,"供应商:"+supply );
  94. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  95. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  96. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  97. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  98. LODOP.ADD_PRINT_TEXT(155,288,431,20,tuopan);
  99. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  100. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  101. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  102. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  103. LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel","M");
  104. LODOP.ADD_PRINT_BARCODE(45,248,'40mm','40mm',"QRCode",qrcode);
  105. };