tg_small_v11.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * 2018-09-19
  3. * 打印小件(8mmx4mm)接装纸
  4. * */
  5. var LODOP; //声明为全局变量
  6. function small_v11_print(username,goodsName,boxSzie,weight,checkNum,date,qrcode,supply,num,number ) {
  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, 800, 400, "CreateCustomPage");
  12. AddPrintContent2(username, goodsName, boxSzie, weight, checkNum, date, qrcode, supply, number);
  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,400,800,"CreateCustomPage");
  25. AddPrintContent(username,goodsName,boxSzie,weight,checkNum,date,qrcode);
  26. LODOP.PRINT();
  27. LODOP.PRINT_INIT("");
  28. LODOP.SET_PRINT_PAGESIZE(1,400,800,"CreateCustomPage");
  29. AddPrintContent(username,goodsName,boxSzie,weight,checkNum,date,qrcode);
  30. LODOP.PRINT();*/
  31. };
  32. function AddPrintContent2(username,goodsName,boxSzie,weight,checkNum,date,qrcode,supply,number ) {
  33. LODOP.ADD_PRINT_TEXT(15,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(35,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(55,5,431,20,"规格:"+boxSzie);
  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(75,5,431,20,"流程号:");
  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(95,5,431,20,"重量:"+weight);
  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(95,120,431,20,"检验号:"+checkNum);
  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(115,5,431,20,"生产日期:"+date);
  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(115,160,431,20,"透气度:150cu");
  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(135,5,431,20,"供应商:"+supply );
  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(95,230,431,20,number);
  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.SET_PRINT_STYLEA(0,"QRCodeErrorLevel","M");
  84. LODOP.ADD_PRINT_BARCODE(20,210,'30mm','30mm',"QRCode",qrcode);
  85. };