function pre(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode,$type){ //0 为大件 1为小件 var LODOP; //声明为全局变量 if($type==0){ PreviewLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode); } if($type==1){ PreviewSmall(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode); } } function PreviewLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) { LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848",""); LODOP=getLodop(); LODOP.PRINT_INITA(""); LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage"); AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode); LODOP.PRINT(); LODOP.PRINT_INITA(""); LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage"); AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode); LODOP.PRINT(); LODOP.PRINT_INITA(""); LODOP.SET_PRINT_PAGESIZE(1,1050,1500,"CreateCustomPage"); AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode); LODOP.PRINT(); }; function AddPrintContentLarge(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) { LODOP.ADD_PRINT_TEXT(20,120,500,100,"浙江美浓世纪集团有限公司产品合格证"); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",14); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(60,60,600,20,"材料标准名称: "+materialsName); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(85,60,431,20,"客户名称: "+users); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(110,60,431,20,"包装日期: "+dates); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(135,60,431,20,"规 格: "+specification); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(160,60,431,20,"生产批号:"+batchNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(185,60,431,20,"托盘/箱号:"+boxNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(210,60,431,20,"内含质量识别号:"+identifyNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(235,60,431,20,"数量:"+nums+" 张"); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(260,60,431,20,"检验号:"+checkNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(285,60,431,20,"板号:"+versionNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_BARCODE(130,330,190,190,"QRCode",rqCode); LODOP.SET_PRINT_STYLEA(1,"AngleOfPageInside",270); }; function PreviewSmall(materialsName,users,dates,nums,specification,checkNum,batchNum,versionNum,boxNum,identifyNum,rqCode) { LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848",""); LODOP=getLodop(); LODOP.PRINT_INIT(""); LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage"); AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode); LODOP.PRINT(); LODOP.PRINT_INIT(""); LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage"); AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode); LODOP.PRINT(); LODOP.PRINT_INIT(""); LODOP.SET_PRINT_PAGESIZE(1,1050,600,"CreateCustomPage"); AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode); LODOP.PRINT(); }; function AddPrintContentSmall(materialsName,dates,nums,specification,checkNum,batchNum,versionNum,identifyNum,rqCode) { LODOP.ADD_PRINT_TEXT(20,0,350,25,"浙江美浓世纪集团有限公司产品合格证"); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",11); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Alignment",2); LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",1.2); LODOP.ADD_PRINT_TEXT(45,10,600,20,"材料标准名称: "+materialsName); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(65,10,431,20,"印刷日期:"+dates); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(85,10,431,20,"规格:"+specification); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(105,10,431,20,"生产批号:"+batchNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(125,10,431,20,"质量批识别号:"+identifyNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(145,10,431,20,"数量:"+nums+" 张"); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(165,10,431,20,"检验号:"+checkNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_TEXT(185,10,431,20,"板号:"+versionNum); LODOP.SET_PRINT_STYLEA(0,"FontName","宋体"); LODOP.SET_PRINT_STYLEA(0,"FontSize",9); LODOP.SET_PRINT_STYLEA(0,"FontColor","#000000"); LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.ADD_PRINT_BARCODE(70,180,155,155,"QRCode",rqCode); };