|
|
@ -169,12 +169,20 @@ export default { |
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const fullTextWidth = '55mm'; // 单行完整文字区域宽度
|
|
|
const fullTextWidth = '55mm'; // 单行完整文字区域宽度
|
|
|
const fontSize = 4; // 字体大小(缩小到2.5号,确保超长文本能显示)
|
|
|
const fontSize = 4; // 字体大小(缩小到2.5号,确保超长文本能显示)
|
|
|
|
|
|
const packingFontSize = 3.5; // Packing List 比主文本小一号
|
|
|
const lineHeight = '3mm'; // 行高
|
|
|
const lineHeight = '3mm'; // 行高
|
|
|
|
|
|
|
|
|
// 第1行:编码
|
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3mm', startX, fullTextWidth, lineHeight, `No.:${printData.partNo || ''}`); |
|
|
|
|
|
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
|
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3mm', startX, '34mm', lineHeight, `No.:${printData.partNo || ''}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); // 使用Arial,比微软雅黑窄
|
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); // 使用Arial,比微软雅黑窄
|
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
|
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('3mm', '54mm', '14mm', lineHeight, `${packingList}`); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", packingFontSize); |
|
|
|
|
|
// 双保险:部分打印环境按对象索引设置更稳定
|
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
|
|
|
|
|
|
// 第2行:卷号 - 关键字段,使用最宽区域和最紧凑设置
|
|
|
// 第2行:卷号 - 关键字段,使用最宽区域和最紧凑设置
|
|
|
const text2 = LODOP.ADD_PRINT_TEXT('6.5mm', startX, fullTextWidth, lineHeight, `RN.:${printData.rollNo || ''}`); |
|
|
const text2 = LODOP.ADD_PRINT_TEXT('6.5mm', startX, fullTextWidth, lineHeight, `RN.:${printData.rollNo || ''}`); |
|
|
@ -304,11 +312,19 @@ export default { |
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const textWidth = '55mm'; // 文字区域宽度
|
|
|
const textWidth = '55mm'; // 文字区域宽度
|
|
|
const fontSize = 5; // 字体大小(比A002稍大,因为只有3行)
|
|
|
const fontSize = 5; // 字体大小(比A002稍大,因为只有3行)
|
|
|
|
|
|
const packingFontSize = 4.5; // Packing List 比主文本小一号
|
|
|
|
|
|
|
|
|
// 第1行:编码
|
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3.5mm', startX, textWidth, '4mm', `No.:${printData.partNo || ''}`); |
|
|
|
|
|
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
|
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3.5mm', startX, '34mm', '4mm', `No.:${printData.partNo || ''}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
|
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('3.5mm', '54mm', '14mm', '4mm', `${packingList}`); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", packingFontSize); |
|
|
|
|
|
// 双保险:部分打印环境按对象索引设置更稳定
|
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
|
|
|
|
|
|
// 第2行:卷号
|
|
|
// 第2行:卷号
|
|
|
const text2 = LODOP.ADD_PRINT_TEXT('8mm', startX, textWidth, '4mm', `RN.:${printData.rollNo || ''}`); |
|
|
const text2 = LODOP.ADD_PRINT_TEXT('8mm', startX, textWidth, '4mm', `RN.:${printData.rollNo || ''}`); |
|
|
|