Index: ssts-web/src/main/webapp/disinfectsystem/print/print.js =================================================================== diff -u -r36229 -r36620 --- ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 36229) +++ ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 36620) @@ -2109,25 +2109,19 @@ // 未配置,设置为默认打印机 invokeResult = LODOP.SET_PRINTER_INDEX(-1); var msg = '配置前缀:' + name + ',打印机:' + printerName + ',调用结果:' + invokeResult; - if(sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ - msg = '标签类型【'+name+'】无法找到指定打印机,请检查配置或打印机连接。'; - } - if(sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ - alert(msg); - }else { + if(!sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ if (!invokeResult) { alert(msg); } } } else { invokeResult = LODOP.SET_PRINTER_INDEX(printerName); var msg = '配置前缀:' + name + ',打印机:' + printerName + ',调用结果:' + invokeResult; - if(sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ - msg = '标签类型【'+name+'】无法找到指定打印机【'+printerName+'】,请检查配置或打印机连接。'; + if(!sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ + if (!invokeResult) { + alert(msg); + } } - if (!invokeResult) { - alert(msg); - } } } @@ -4836,6 +4830,22 @@ function invokeTemplatePrintFunction(pageType, obj, labelTemplate, time) { var funName = getTemplatePrintFunName(pageType); if (funName != null && !isUndefinedOrNull(printTemplateMap[funName])) { + if(sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ + var clientComputerName = sessionStorage.getItem('clientComputerName') || ''; + var clientComputerPrinters = sessionStorage.getItem('clientComputerPrinters'); + if(clientComputerName !== '' && (clientComputerPrinters == 'null' || clientComputerPrinters == null)){ + alert('clientComputerName指定的客户端电脑名称【'+clientComputerName+'】,未在标签输出打印机设置中找到对应的配置,请检查!'); + return true + }else if(clientComputerName !== '' && clientComputerPrinters !== 'null' && clientComputerPrinters !== null){ + var items = eval('(' + clientComputerPrinters + ')'); + var printerName = items[pageType]; + var invokeResult = LODOP.SET_PRINTER_INDEX(printerName); + if(!invokeResult){ + alert('clientComputerName指定的客户端电脑名称【'+clientComputerName+'】,标签类型【'+pageType+'】无法找到指定打印机【'+printerName+'】,请检查配置或打印机连接'); + return true + } + } + } logPrintTousse(obj, obj.barcode); doGetLodop(); window['printTemplate_' + printTemplateMap[funName]](obj);