Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r35414 -r35937 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 35414) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 35937) @@ -2623,22 +2623,31 @@ function initPrintConfig() { //forgonKeyValueSettings.addkeyValueFromLocalFile(IniTypePrint,'C:\\forgon\\config\\printConfig.ini',true); } + // 根据名字(大标签,小标签)获取打印机名称,如果没有配置,则返回null function getPrinterNameByType(type) { var printerName = null; if (typeof (type) == undefined || type == null) { return null; } - //printerName = forgonKeyValueSettings.getStringValue(IniTypePrint,type+'.printerName',null); - // 改为通过jason对象来获取,不用ini的方式了。 - if (typeof (printerNameMapping) != 'undefined' && printerNameMapping != null) { - if (printerNameMapping[type] != undefined) { - printerName = printerNameMapping[type]; + if(sstsConfig.enablePrintLabelsOutputPrinterSettingsFunction){ + if(sessionStorage.getItem('clientComputerPrinters')){ + var clientComputerPrinters = eval('('+sessionStorage.getItem('clientComputerPrinters')+')'); + if (clientComputerPrinters[type] != undefined) { + printerName = clientComputerPrinters[type]; + } } + return printerName; + }else { + // 改为通过jason对象来获取,不用ini的方式了。 + if (typeof (printerNameMapping) != 'undefined' && printerNameMapping != null) { + if (printerNameMapping[type] != undefined) { + printerName = printerNameMapping[type]; + } + } + return printerName; } - //alert(printerName); - return printerName; } //initPrintConfig(); /////////////////////////// 打印相关API ///////////////////////////