|
@@ -184,9 +184,9 @@ export const newHdPrint = function (printerType, type, url, params, fileName, ca
|
|
|
params.type = printerType
|
|
|
}
|
|
|
// 阵式预览和喷墨预览一样
|
|
|
- if (type == 'preview' && printerType == 'NEEDLE') {
|
|
|
- params.type = 'INK'
|
|
|
- }
|
|
|
+ // if (type == 'preview' && printerType == 'NEEDLE') {
|
|
|
+ // params.type = 'INK'
|
|
|
+ // }
|
|
|
url(params).then(res => {
|
|
|
if (res.type == 'application/json') {
|
|
|
var reader = new FileReader()
|
|
@@ -215,7 +215,7 @@ export const newJGPrint = function (data, type, printerType) {
|
|
|
return
|
|
|
}
|
|
|
// 针式打印
|
|
|
- if (printerType == 'NEEDLE' && type=="print") {
|
|
|
+ if (printerType == 'NEEDLE') {
|
|
|
const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
|
|
|
if (!LODOP) {
|
|
|
confirm({
|
|
@@ -230,19 +230,20 @@ export const newJGPrint = function (data, type, printerType) {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- const dlen = data.data.length
|
|
|
- if(dlen){
|
|
|
- LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
|
|
|
- // LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW",1);//隐藏设置按钮
|
|
|
- LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) // 隐藏底图上有模拟走纸板的条纹线
|
|
|
- LODOP.SET_PRINT_STYLEA(0,"PDFScalMode",1);
|
|
|
- // 开始打印
|
|
|
+
|
|
|
+ if (type == 'preview') { // 预览
|
|
|
+ LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
|
|
|
+ LODOP.PREVIEW()
|
|
|
+ } else if (type == 'print') { // 打印
|
|
|
+ const dlen = data.data.length
|
|
|
for(let i=0;i<dlen;i++){
|
|
|
LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[i])
|
|
|
LODOP.SET_PRINT_PAGESIZE(3, 2090, 0, '')
|
|
|
LODOP.PRINT()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
// 喷墨打印
|
|
|
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
|