bar.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. function pre(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode,$type){
  2. //0 为大件 1为小件
  3. var LODOP; //声明为全局变量
  4. if($type==0){
  5. PreviewLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode);
  6. }
  7. if($type==1){
  8. PreviewSmall(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode);
  9. }
  10. }
  11. function PreviewLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) {
  12. LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848","");
  13. LODOP=getLodop();
  14. LODOP.PRINT_INITA("");
  15. LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage");
  16. AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode);
  17. LODOP.PRINT();
  18. LODOP.PRINT_INITA("");
  19. LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage");
  20. AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode);
  21. LODOP.PRINT();
  22. LODOP.PRINT_INITA("");
  23. LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage");
  24. AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode);
  25. LODOP.PRINT();
  26. };
  27. function AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) {
  28. LODOP.ADD_PRINT_TEXT(20,120,500,100,"浙江美浓世纪集团有限公司产品合格证");
  29. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  30. LODOP.SET_PRINT_STYLEA(0,"FontSize",14);
  31. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  32. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  33. LODOP.ADD_PRINT_TEXT(60,60,600,20,"材料标准名称: "+materialsName);
  34. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  35. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  36. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  37. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  38. LODOP.ADD_PRINT_TEXT(85,60,431,20,"客户名称: "+users);
  39. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  40. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  41. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  42. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  43. LODOP.ADD_PRINT_TEXT(110,60,431,20,"包装日期: "+dates);
  44. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  45. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  46. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  47. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  48. LODOP.ADD_PRINT_TEXT(135,60,431,20,"规 格: "+specification);
  49. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  50. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  51. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  52. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  53. LODOP.ADD_PRINT_TEXT(160,60,431,20,"生产批号:"+batchNum);
  54. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  55. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  56. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  57. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  58. LODOP.ADD_PRINT_TEXT(185,60,431,20,"托盘/箱号:"+boxNum);
  59. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  60. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  61. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  62. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  63. LODOP.ADD_PRINT_TEXT(210,60,431,20,"内含质量识别号:"+identifyNum);
  64. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  65. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  66. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  67. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  68. LODOP.ADD_PRINT_TEXT(235,60,431,20,"数量:"+nums+" 张");
  69. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  70. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  71. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  72. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  73. LODOP.ADD_PRINT_TEXT(260,60,431,20,"检验号:"+checkNum);
  74. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  75. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  76. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  77. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  78. LODOP.ADD_PRINT_TEXT(285,60,431,20,"板号:"+versionNum);
  79. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  80. LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
  81. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  82. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  83. LODOP.ADD_PRINT_BARCODE(130,330,190,190,"QRCode",rqCode);
  84. LODOP.SET_PRINT_STYLEA(1,"AngleOfPageInside",270);
  85. };
  86. function PreviewSmall(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) {
  87. LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848","");
  88. LODOP=getLodop();
  89. LODOP.PRINT_INIT("");
  90. LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage");
  91. AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode);
  92. LODOP.PRINT();
  93. LODOP.PRINT_INIT("");
  94. LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage");
  95. AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode);
  96. LODOP.PRINT();
  97. LODOP.PRINT_INIT("");
  98. LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage");
  99. AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode);
  100. LODOP.PRINT();
  101. };
  102. function AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode) {
  103. LODOP.ADD_PRINT_TEXT(20,0,350,25,"浙江美浓世纪集团有限公司产品合格证");
  104. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  105. LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
  106. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  107. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  108. LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
  109. LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",1.2);
  110. LODOP.ADD_PRINT_TEXT(45,10,600,20,"材料标准名称: "+materialsName);
  111. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  112. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  113. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  114. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  115. LODOP.ADD_PRINT_TEXT(65,10,431,20,"印刷日期:"+dates);
  116. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  117. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  118. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  119. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  120. LODOP.ADD_PRINT_TEXT(85,10,431,20,"规格:"+specification);
  121. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  122. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  123. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  124. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  125. LODOP.ADD_PRINT_TEXT(105,10,431,20,"生产批号:"+batchNum);
  126. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  127. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  128. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  129. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  130. LODOP.ADD_PRINT_TEXT(125,10,431,20,"质量批识别号:"+identifyNum);
  131. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  132. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  133. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  134. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  135. LODOP.ADD_PRINT_TEXT(145,10,431,20,"数量:"+nums+" 张");
  136. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  137. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  138. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  139. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  140. LODOP.ADD_PRINT_TEXT(165,10,431,20,"检验号:"+checkNum);
  141. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  142. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  143. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  144. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  145. LODOP.ADD_PRINT_TEXT(185,10,431,20,"板号:"+versionNum);
  146. LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
  147. LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
  148. LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000");
  149. LODOP.SET_PRINT_STYLEA(0,"Bold",1);
  150. LODOP.ADD_PRINT_BARCODE(70,180,155,155,"QRCode",rqCode);
  151. };