lilei 2 anni fa
parent
commit
c603ca3a2d
2 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 1 1
      components/kk-printer/printer/cpcl.js
  2. 3 3
      libs/printTools.js

+ 1 - 1
components/kk-printer/printer/cpcl.js

@@ -16,7 +16,7 @@ function Hex2Str(num) {
  * rotation:页面整体旋转 1-90度 2-180度 3-270度 其他-不旋转
  */
 export function CreatCPCLPage(width, height, printNum, rotation = 0, offset = 0) {
-	var strCmd = '! ' + offset + ' 200 200 ' + height + ' ' + printNum + '\n';
+	var strCmd = '! ' + offset + ' 203 203 ' + height + ' ' + printNum + '\n';
 	strCmd += "PAGE-WIDTH " + width + '\n';
 	if (rotation == 1)
 		strCmd += "ZPROTATE90\n";

+ 3 - 3
libs/printTools.js

@@ -146,12 +146,12 @@ export const printCpclTempl = function(cpcl,data){
 	// 初始化打印机
 	let strCmd =cpcl.CreatCPCLPage(pageW*8,pageH*8,data.currentInven,0);
 	// 经销商文字高度,是否换行
-	const a = textCpclFormat(cpcl,data.dealerName,maxFontNums,left,top,lightHeight,"center",'55',1);
+	const a = textCpclFormat(cpcl,data.dealerName,maxFontNums,left,top,lightHeight,"center",'24',0);
 	top = a.top;
 	strCmd += a.result;
 	// 数字货架名称文字
 	top = top+10;
-	const b = textCpclFormat(cpcl,data.shelfName,maxFontNums,left,top,lightHeight,"center",'55',1);
+	const b = textCpclFormat(cpcl,data.shelfName,maxFontNums,left,top,lightHeight,"center",'24',0);
 	top = b.top;
 	strCmd += b.result;
 	// 二维码
@@ -175,9 +175,9 @@ export const printCpclTempl = function(cpcl,data){
 	const e = textCpclFormat(cpcl,data.printDate,rightMaxFnums,rightLeft,top,lightHeight,"left",'7',0);
 	top = e.top;
 	strCmd += e.result;
+	strCmd += 'FORM \n\r'
 	strCmd += cpcl.addCPCLPrint();
 	console.log(strCmd)
-	console.log(gbk.strToGBKByte(strCmd))
 	return gbk.strToGBKByte(strCmd);
 }