|
|
@ -2,22 +2,22 @@ import { getLodop } from '@/utils/LodopFuncs'; |
|
|
|
import hwyPrintNew from '@/utils/print/index'; |
|
|
|
import hwyPrintNew from '@/utils/print/index'; |
|
|
|
|
|
|
|
|
|
|
|
/** 处理标签打印 */ |
|
|
|
/** 处理标签打印 */ |
|
|
|
const handleTitlePrint = (LODOP, templateData)=>{ |
|
|
|
const handleTitlePrint = (LODOP, templateData) => { |
|
|
|
LODOP.PRINT_INITA(""); |
|
|
|
LODOP.PRINT_INITA(''); |
|
|
|
// LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
|
|
|
|
// LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
|
|
|
|
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
|
|
|
|
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
|
|
|
|
// // 设置打印整宽且不变形
|
|
|
|
// // 设置打印整宽且不变形
|
|
|
|
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '60%'); |
|
|
|
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '95%'); |
|
|
|
// // 设置打印后自动关闭
|
|
|
|
// // 设置打印后自动关闭
|
|
|
|
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1); |
|
|
|
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1); |
|
|
|
// // data就是一段html文本
|
|
|
|
// // data就是一段html文本
|
|
|
|
LODOP.ADD_PRINT_HTM('30', '0%', '100%', '100%', templateData); |
|
|
|
LODOP.ADD_PRINT_HTM('30', '0%', '100%', '100%', templateData); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** 打印配送单 */ |
|
|
|
/** 打印配送单 */ |
|
|
|
const handleDeliveryPrint = (LODOP, templateData)=>{ |
|
|
|
const handleDeliveryPrint = (LODOP, templateData) => { |
|
|
|
LODOP.PRINT_INITA(""); |
|
|
|
LODOP.PRINT_INITA(''); |
|
|
|
// LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
|
|
|
|
// LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
|
|
|
|
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
|
|
|
|
// LODOP.SET_PRINT_STYLE('FontColor', '#000000');
|
|
|
@ -27,8 +27,8 @@ const handleDeliveryPrint = (LODOP, templateData)=>{ |
|
|
|
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1); |
|
|
|
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1); |
|
|
|
|
|
|
|
|
|
|
|
// // data就是一段html文本
|
|
|
|
// // data就是一段html文本
|
|
|
|
LODOP.ADD_PRINT_HTM('0', '0%', '100%%', "100%", templateData); |
|
|
|
LODOP.ADD_PRINT_HTM('0', '0%', '100%%', '100%', templateData); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据传入的元素列表进行打印 |
|
|
|
* 根据传入的元素列表进行打印 |
|
|
@ -50,10 +50,8 @@ const print = (nodeList, type = 'deliveryPrint') => { |
|
|
|
let templateData = orderNode.innerHTML; |
|
|
|
let templateData = orderNode.innerHTML; |
|
|
|
// let templateData="<h1>1111</h1>"
|
|
|
|
// let templateData="<h1>1111</h1>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (type === 'titlePrint') handleTitlePrint(LODOP, templateData); |
|
|
|
|
|
|
|
else handleDeliveryPrint(LODOP, templateData); |
|
|
|
if (type === 'titlePrint') handleTitlePrint(LODOP, templateData) |
|
|
|
|
|
|
|
else handleDeliveryPrint(LODOP, templateData) |
|
|
|
|
|
|
|
// LODOP.NewPage()
|
|
|
|
// LODOP.NewPage()
|
|
|
|
// LODOP.PRINT(); //直接打印
|
|
|
|
// LODOP.PRINT(); //直接打印
|
|
|
|
LODOP.PRINT_DESIGN(); |
|
|
|
LODOP.PRINT_DESIGN(); |
|
|
@ -74,7 +72,4 @@ const newPrint = nodeName => { |
|
|
|
hwyPrintNew('.el-dialog__body>div>div>div'); |
|
|
|
hwyPrintNew('.el-dialog__body>div>div>div'); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default print; |
|
|
|
export default print; |
|
|
|