small_v3_print.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * 2018-08-17
  3. * 打印小件(4mmx8mm)接装纸
  4. * */
  5. var LODOP; //声明为全局变量
  6. function small_v3_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, 400, 800, "CreateCustomPage");
  12. AddPrintContent1(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. //为正式服务器,打印
  21. LODOP.PRINT();
  22. }
  23. }
  24. /* LODOP.PRINT_INIT("");
  25. LODOP.SET_PRINT_PAGESIZE(1,400,800,"CreateCustomPage");
  26. AddPrintContent(username,goodsName,boxSzie,weight,checkNum,date,qrcode);
  27. LODOP.PRINT();
  28. LODOP.PRINT_INIT("");
  29. LODOP.SET_PRINT_PAGESIZE(1,400,800,"CreateCustomPage");
  30. AddPrintContent(username,goodsName,boxSzie,weight,checkNum,date,qrcode);
  31. LODOP.PRINT();*/
  32. };
  33. function AddPrintContent1(username,goodsName,boxSzie,weight,checkNum,date,qrcode,supply,number ) {
  34. LODOP.ADD_PRINT_TEXT(15,5,400,100,"客户:"+username);
  35. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  36. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  37. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  38. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  39. LODOP.ADD_PRINT_TEXT(35,5,431,20,"品名:"+goodsName);
  40. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  41. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  42. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  43. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  44. LODOP.ADD_PRINT_TEXT(55,5,431,20,"规格:"+boxSzie);
  45. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  46. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  47. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  48. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  49. LODOP.ADD_PRINT_TEXT(75,5,431,20,"流程号:");
  50. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  51. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  52. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  53. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  54. LODOP.ADD_PRINT_TEXT(95,5,431,20,"重量:"+weight);
  55. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  56. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  57. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  58. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  59. LODOP.ADD_PRINT_TEXT(95,120,431,20,"检验号:"+checkNum);
  60. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  61. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  62. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  63. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  64. LODOP.ADD_PRINT_TEXT(115,5,431,20,"生产日期:"+date);
  65. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  66. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  67. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  68. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  69. LODOP.ADD_PRINT_TEXT(115,160,431,20,"透气度:150cu");
  70. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  71. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  72. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  73. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  74. LODOP.ADD_PRINT_TEXT(135,5,431,20,"供应商:"+supply );
  75. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  76. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  77. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  78. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  79. LODOP.ADD_PRINT_TEXT(95,230,431,20,number);
  80. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  81. LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
  82. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  83. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  84. LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel","M");
  85. LODOP.ADD_PRINT_BARCODE(20,210,'30mm','30mm',"QRCode",qrcode);
  86. LODOP.SET_PRINT_STYLEA(1,"AngleOfPageInside",90);
  87. };