Index: ssts-web/src/main/webapp/disinfectsystem/print/print.js =================================================================== diff -u -r35487 -r35559 --- ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 35487) +++ ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 35559) @@ -383,20 +383,20 @@ tableHtml += ""; tableHtml += ""; if (cols == 1) { - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; } else if (cols == 2) { - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; } else { - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; - tableHtml += ""+goodsTable.columns[0].header+""; - tableHtml += ""+goodsTable.columns[1].header+""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; + tableHtml += "" + goodsTable.columns[0].header + ""; + tableHtml += "" + goodsTable.columns[1].header + ""; } tableHtml += ""; if (data.tousseAmountArr.length > 6 * cols) { @@ -407,7 +407,7 @@ var amount2 = ''; var tousseName3 = ''; var amount3 = ''; - if(cols == 1){ + if (cols == 1) { if (data.tousseAmountArr[j]) { tousseName1 = data.tousseAmountArr[j].tousseName; amount1 = data.tousseAmountArr[j].amount; @@ -416,7 +416,7 @@ tableHtml += "" + tousseName1 + ""; tableHtml += "" + amount1 + ""; tableHtml += ""; - }else if(cols == 2){ + } else if (cols == 2) { if (data.tousseAmountArr[j]) { tousseName1 = data.tousseAmountArr[j].tousseName; amount1 = data.tousseAmountArr[j].amount; @@ -431,7 +431,7 @@ tableHtml += "" + tousseName2 + ""; tableHtml += "" + amount2 + ""; tableHtml += ""; - }else { + } else { if (data.tousseAmountArr[j]) { tousseName1 = data.tousseAmountArr[j].tousseName; amount1 = data.tousseAmountArr[j].amount; @@ -468,8 +468,8 @@ tousseName1 = data.tousseAmountArr[j].tousseName; amount1 = data.tousseAmountArr[j].amount; } - tableHtml += ""+tousseName1+""; - tableHtml += ""+amount1+""; + tableHtml += "" + tousseName1 + ""; + tableHtml += "" + amount1 + ""; } else if (cols == 2) { if (data.tousseAmountArr[j]) { tousseName1 = data.tousseAmountArr[j].tousseName; @@ -479,10 +479,10 @@ tousseName2 = data.tousseAmountArr[j + 1].tousseName; amount2 = data.tousseAmountArr[j + 1].amount; } - tableHtml += ""+tousseName1+""; - tableHtml += ""+amount1+""; - tableHtml += ""+tousseName2+""; - tableHtml += ""+amount2+""; + tableHtml += "" + tousseName1 + ""; + tableHtml += "" + amount1 + ""; + tableHtml += "" + tousseName2 + ""; + tableHtml += "" + amount2 + ""; } else { if (data.tousseAmountArr[j]) { tousseName1 = data.tousseAmountArr[j].tousseName; @@ -496,12 +496,12 @@ tousseName3 = data.tousseAmountArr[j + 2].tousseName; amount3 = data.tousseAmountArr[j + 2].amount; } - tableHtml += ""+tousseName1+""; - tableHtml += ""+amount1+""; - tableHtml += ""+tousseName2+""; - tableHtml += ""+amount2+""; - tableHtml += ""+tousseName3+""; - tableHtml += ""+amount3+""; + tableHtml += "" + tousseName1 + ""; + tableHtml += "" + amount1 + ""; + tableHtml += "" + tousseName2 + ""; + tableHtml += "" + amount2 + ""; + tableHtml += "" + tousseName3 + ""; + tableHtml += "" + amount3 + ""; } tableHtml += ""; } @@ -1768,18 +1768,18 @@ arr.push(t); } } - if(arr.length == 0){ + if (arr.length == 0) { obj.defaultPrintFun(); - }else if(arr.length == 1){ + } else if (arr.length == 1) { var pageType = arr[0].fullName; if (invokeTemplatePrintFunction(pageType, obj, arr[0])) { return; } - }else { - showAllLabel(arr, obj,true) + } else { + showAllLabel(arr, obj, true) } } -function createStorageLocation(orgUnit,wareHouseBelong,name,wareHouseCode,storageLocationSimpleName,parentStorageLocation,barcode,putInGoods,unitName) { +function createStorageLocation(orgUnit, wareHouseBelong, name, wareHouseCode, storageLocationSimpleName, parentStorageLocation, barcode, putInGoods, unitName) { doGetLodop(); var tableHtml = ""; tableHtml += ""; @@ -1807,23 +1807,23 @@ }; -function storageLocationDefaultPrint(orgUnit,wareHouseBelong,name,wareHouseCode,storageLocationSimpleName,parentStorageLocation,barcode,putInGoods,unitName) { +function storageLocationDefaultPrint(orgUnit, wareHouseBelong, name, wareHouseCode, storageLocationSimpleName, parentStorageLocation, barcode, putInGoods, unitName) { if (barcode != null && barcode != '') { doGetLodop(); LODOP.PRINT_INIT(""); LODOP.SET_PRINTER_INDEX(-1);// TODO 可增加切换打印机的处理 - createStorageLocation(orgUnit,wareHouseBelong,name,wareHouseCode,storageLocationSimpleName,parentStorageLocation,barcode,putInGoods,unitName); + createStorageLocation(orgUnit, wareHouseBelong, name, wareHouseCode, storageLocationSimpleName, parentStorageLocation, barcode, putInGoods, unitName); LODOP.PRINT(); } else { alert("打印内容为空"); } } //库位打印预览 -function storageLocationPreview(orgUnit,wareHouseBelong,name,wareHouseCode,storageLocationSimpleName,parentStorageLocation,barcode,putInGoods,unitName) { +function storageLocationPreview(orgUnit, wareHouseBelong, name, wareHouseCode, storageLocationSimpleName, parentStorageLocation, barcode, putInGoods, unitName) { if (barcode != null && barcode != '') { doGetLodop(); LODOP.PRINT_INIT(""); - createStorageLocation(orgUnit,wareHouseBelong,name,wareHouseCode,storageLocationSimpleName,parentStorageLocation,barcode,putInGoods,unitName); + createStorageLocation(orgUnit, wareHouseBelong, name, wareHouseCode, storageLocationSimpleName, parentStorageLocation, barcode, putInGoods, unitName); LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD", 1); LODOP.PREVIEW(); } else { @@ -1839,14 +1839,14 @@ arr.push(t); } } - if(arr.length == 0){ + if (arr.length == 0) { obj.defaultPrintFun(); - }else if(arr.length == 1){ + } else if (arr.length == 1) { var pageType = arr[0].fullName; if (invokeTemplatePrintFunction(pageType, obj)) { return; } - }else { + } else { showAllLabel(arr, obj) } } @@ -5410,7 +5410,15 @@ } } else if (dataIndex == 'tousseAmount') { if (k == 0) { - tableHtml += ""; + if (foreignTousseVoList.length > 1) { + var sumTousseAmount = 0; + for (z = 0; z < foreignTousseVoList.length; z++) { + sumTousseAmount += foreignTousseVoList[z]['tousseAmount'] + } + tableHtml += ""; + } else { + tableHtml += ""; + } } } else { if (j == 0 && k == 0) { @@ -5488,7 +5496,15 @@ } tableHtml += ""; if (k == 0) { - tableHtml += ""; + if (foreignTousseVoList.length > 1) { + var sumTousseAmount = 0; + for (z = 0; z < foreignTousseVoList.length; z++) { + sumTousseAmount += foreignTousseVoList[z]['tousseAmount'] + } + tableHtml += ""; + } else { + tableHtml += ""; + } } tableHtml += ""; } @@ -5514,109 +5530,109 @@ //GDSRMYY-555:弹出多个模版标签 var labelWindow; -function showAllLabel(data, obj, showLabelTemplate, showTime){ +function showAllLabel(data, obj, showLabelTemplate, showTime) { var labelStore = new Ext.data.JsonStore({ - data:data, - fields : [ - {name : 'dataSourceName'}, - {name : 'description'}, - {name : 'fullName'}, - {name : 'height'}, - {name : 'id'}, - {name : 'name'}, - {name : 'programCodes'}, - {name : 'styleName'}, - {name : 'templateInfo'}, - {name : 'width'} + data: data, + fields: [ + { name: 'dataSourceName' }, + { name: 'description' }, + { name: 'fullName' }, + { name: 'height' }, + { name: 'id' }, + { name: 'name' }, + { name: 'programCodes' }, + { name: 'styleName' }, + { name: 'templateInfo' }, + { name: 'width' } ] }); - + var cm = new top.Ext.grid.ColumnModel([{ - id : 'name', - header : "标签名称", - width:150, - dataIndex : 'name' + id: 'name', + header: "标签名称", + width: 150, + dataIndex: 'name' }]); - + var formObj = new top.Ext.FormPanel({ - frame : true, - labelAlign:'right', - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - autoWidth : true, - autoHeight : true, - autoScroll : true, - items:[{ - layout : 'column', - items : [{ - columnWidth : 1, + frame: true, + labelAlign: 'right', + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + autoWidth: true, + autoHeight: true, + autoScroll: true, + items: [{ + layout: 'column', + items: [{ + columnWidth: 1, layout: 'form', - items : [ + items: [ new top.Ext.grid.EditorGridPanel({ - id : 'configGrid', - store : labelStore, - cm : cm, - width : 240, + id: 'configGrid', + store: labelStore, + cm: cm, + width: 240, height: 150, - clicksToEdit : 1, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - anchor : '100%', + clicksToEdit: 1, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', viewConfig: { - forceFit:true + forceFit: true }, - hideHeaders:true, - tbar : [{ - text: '数据源为【'+data[0].dataSourceName+'】的标签模版:' + hideHeaders: true, + tbar: [{ + text: '数据源为【' + data[0].dataSourceName + '】的标签模版:' }], - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }) + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }) }) ] }] }], - buttons : [{ - id : 'saveBtn', - text : '打印', - handler : function(){ + buttons: [{ + id: 'saveBtn', + text: '打印', + handler: function () { var records = top.Ext.getCmp('configGrid').getSelectionModel().getSelections(); - if(records.length == 0){ + if (records.length == 0) { showResult('请选择一个模版!'); returnFloat } var pageType = records[0].data.fullName; var labelTemplate; var time = ''; - if(showLabelTemplate){ + if (showLabelTemplate) { labelTemplate = records[0].data; } - if(showTime){ + if (showTime) { time = showTime; } if (invokeTemplatePrintFunction(pageType, obj, labelTemplate, time)) { labelWindow.close(); return; } } - },{ - id : 'cancleBtn', - text : '取消', - handler : function() { + }, { + id: 'cancleBtn', + text: '取消', + handler: function () { labelWindow.close(); } }] }); - - labelWindow = new top.Ext.Window( { - layout : 'fit', - title : '选择标签模版', - width : 400, - modal : true, - autoHeight : true, - border : false, - plain : true, - items : [formObj] + + labelWindow = new top.Ext.Window({ + layout: 'fit', + title: '选择标签模版', + width: 400, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [formObj] }); labelWindow.show(); } \ No newline at end of file
" + foreignTousseVoList[k][dataIndex] + "" + sumTousseAmount + "" + foreignTousseVoList[k][dataIndex] + "" + foreignTousseVoList[k]['name'] + "" + foreignTousseVoList[k]['tousseAmount'] + "" + sumTousseAmount + "" + foreignTousseVoList[k]['tousseAmount'] + "