You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
5.6 KiB
155 lines
5.6 KiB
var LODOP = getCLodop();
|
|
|
|
//初始化
|
|
function initPrintSetting(clodoplisence) {
|
|
try{
|
|
var LODOP= getCLodop();
|
|
if (LODOP.VERSION) {
|
|
if (LODOP.CVERSION){
|
|
//alert("当前有WEB打印服务C-Lodop可用!\n C-Lodop版本:"+LODOP.CVERSION+"(内含Lodop"+LODOP.VERSION+")");
|
|
//如果没有问题打印的信息
|
|
//LODOP.SET_LICENSES("","646464550585055535859561289003","688858710010010811411756128900","");
|
|
LODOP.SET_LICENSES("",clodoplisence,"","");
|
|
//判断当前打印模式
|
|
/* if(printerData.seq >= 0){
|
|
LODOP.SET_PRINTER_INDEXA(printerData.printName);
|
|
LODOP.PRINT();
|
|
}else if(printerData.seq === -1){
|
|
LODOP.PREVIEW();
|
|
}else if(printerData.seq === -2){
|
|
LODOP.PRINT_DESIGN();
|
|
}*/
|
|
}else {
|
|
alert("本机已成功安装了Lodop控件!\n 版本号:"+LODOP.VERSION);
|
|
}
|
|
};
|
|
}catch(err){
|
|
}
|
|
};
|
|
|
|
|
|
//总调用打印的方法
|
|
function printQcRollLabel(printRow, printerData){
|
|
//初始化打印
|
|
initPrintSetting(printerData.clodopLicense);
|
|
//调用打印的方法
|
|
printIndiaQcPage(printRow);
|
|
//区分各种打印的模式
|
|
let printerSeq = printerData.printerSeq;
|
|
if (printerSeq >= 0){
|
|
LODOP.SET_PRINTER_INDEXA(printerData.printerName);
|
|
LODOP.PRINT();
|
|
}else if (printerSeq == -1){
|
|
LODOP.PREVIEW();
|
|
}else if (printerSeq == -2){
|
|
LODOP.PRINT_DESIGN();
|
|
}
|
|
}
|
|
|
|
function printIndiaQcPage(printRow, printerData){
|
|
LODOP.NewPage();
|
|
LODOP.SET_PRINT_PAGESIZE(2,800,975,"");
|
|
|
|
LODOP.ADD_PRINT_TEXT(3,3,135,15,"P/N:"+printRow.customerPartNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(16,3,135,20,"128A",printRow.customerPartNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(37,3,135,15,"QTY:"+printRow.standardRollQty);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(50,3,65,20,"128A",printRow.standardRollQty);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(71,3,135,15,"Mfr P/N:"+printRow.partNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",6);
|
|
LODOP.ADD_PRINT_BARCODE(84,3,65,20,"128A",printRow.partNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(105,3,135,15,"Date Code:"+printRow.dateCode);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(118,3,135,20,"128A",printRow.dateCode);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(139,3,135,15,"Lot NO:"+printRow.finalRollNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",6);
|
|
LODOP.ADD_PRINT_BARCODE(152,3,130,20,"128A",printRow.finalRollNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(173,3,135,15,"PKG ID:"+printRow.pkcId);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",6);
|
|
LODOP.ADD_PRINT_BARCODE(186,5,135,20,"128A",printRow.pkcId);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
//二维码以及下面的部分
|
|
LODOP.ADD_PRINT_BARCODE(208,3,105,105,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.pkcId);
|
|
|
|
LODOP.ADD_PRINT_TEXT(280,3,80,15,printRow.username);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
|
|
LODOP.ADD_PRINT_TEXT(208,82,75,20,"Rev:"+printRow.revNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
|
LODOP.ADD_PRINT_IMAGE(225,75,55,20,"<img src='/img/cclimg.png'>");
|
|
LODOP.SET_PRINT_STYLEA(0,"Stretch",1);
|
|
LODOP.SET_PRINT_STYLEA(0,"ScalX",0.75);
|
|
LODOP.SET_PRINT_STYLEA(0,"ScalY",0.75);
|
|
|
|
LODOP.ADD_PRINT_TEXT(258,80,30,20,"HF");
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
|
//第二部分的标签
|
|
LODOP.ADD_PRINT_TEXT(3,130,188,21,"P/N:"+printRow.customerPartNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(16,130,156,15,"128A",printRow.customerPartNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(37,130,186,21,"QTY:"+printRow.standardRollQty);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(50,130,65,15,"128A",printRow.standardRollQty);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(71,130,189,20,"Mfr P/N:"+printRow.partNo);
|
|
LODOP.ADD_PRINT_BARCODE(84,130,161,15,"128A",printRow.partNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(105,125,190,20,"Date Code:"+printRow.dateCode);
|
|
LODOP.ADD_PRINT_BARCODE(118,125,132,15,"128A",printRow.dateCode);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(139,130,185,15,"Lot NO:"+printRow.finalRollNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(152,130,185,20,"128A",printRow.finalRollNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_TEXT(173,130,192,20,"PKG ID:"+printRow.pkcId);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.ADD_PRINT_BARCODE(186,130,168,15,"128A",printRow.pkcId);
|
|
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
|
|
|
|
LODOP.ADD_PRINT_BARCODE(208,141,105,105,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.pkcId);
|
|
|
|
LODOP.ADD_PRINT_TEXT(280,141,117,15,printRow.username);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
|
|
LODOP.ADD_PRINT_TEXT(208,220,75,20,"Rev:"+printRow.revNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
|
LODOP.ADD_PRINT_IMAGE(225,220,55,20,"<img src='/img/cclimg.png'>");
|
|
LODOP.SET_PRINT_STYLEA(0,"Stretch",1);
|
|
|
|
LODOP.ADD_PRINT_TEXT(258,220,30,20,"HF");
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
|
|
|
//第二部分右侧的部分
|
|
LODOP.ADD_PRINT_BARCODE(4,300,110,80,"QRCode",printRow.finalRollNo);
|
|
LODOP.ADD_PRINT_TEXT(73,261,100,15,printRow.finalRollNo);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
|
|
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
|
|
|
|
LODOP.ADD_PRINT_TEXT(105,260,100,25,printRow.status);
|
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
|
|
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
|
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
|
}
|