Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js =================================================================== diff -u -r32811 -r32834 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js (.../proxyDisinfectionForm.js) (revision 32811) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js (.../proxyDisinfectionForm.js) (revision 32834) @@ -406,6 +406,11 @@ }); } }, { + text: '打印', + handler: function () { + getPrintProxyDisinfectionInfo(id); + } + }, { text: '取消', handler: function () { window.close(); Index: ssts-web/src/main/webapp/disinfectsystem/config/gdszyy/print/printConfig.js =================================================================== diff -u -r31647 -r32834 --- ssts-web/src/main/webapp/disinfectsystem/config/gdszyy/print/printConfig.js (.../printConfig.js) (revision 31647) +++ ssts-web/src/main/webapp/disinfectsystem/config/gdszyy/print/printConfig.js (.../printConfig.js) (revision 32834) @@ -338,7 +338,46 @@ } } +// 打印代理灭菌单 +var proxyDisinfectionApplicationPrintConfig = { + header : [ + // 标题 + {label : "代理灭菌单", dataIndex : '', fontSize : 15, position : ["20","40%","99%",5]}, + {label : "部门:", dataIndex : 'depart', fontSize : 11, position : ["55","2%","90%",5]}, + {label : "单号:", dataIndex : 'serialNumber', fontSize : 11, position : ["55","35%","90%",5]}, + {label : "申请时间:", dataIndex : 'applicationTimeStr', fontSize : 11, position : ["80","35%","90%",5]}, + {label : "申请人:", dataIndex : 'applicant', fontSize : 11, position : ["80","75%","90%",5]}, + {label : "备注:", dataIndex : 'remark', fontSize : 11, position : ["80","2%","90%",5]}, + {barcodes : [{ + codeType : "128Auto", dataIndex : 'serialNumber', position : ["3mm","74%","40mm","8mm"], + styles : [ + {itemNameID: 0, styleName: 'ShowBarText', styleValue: true}, + {itemNameID: 0, styleName: 'FontSize', styleValue: 6}, + {itemNameID: 0, styleName: 'NotOnlyHighPrecision', styleValue: true} + ] + }]} + ], + footer: { + fontSize : 14, + rowHeight:20, + content : [ + {label : "打印时间: ", dataIndex : 'printTime'} + ] + }, + goodsTable :{ + rowHeight : 25, + position : ["100","1%","90%","7cm"], + headRepeat : true, + columns : [ + {header : "序号", dataIndex : 'serialNumber', width : 60, align : 'center', fontSize : 11}, + {header : "条码", dataIndex : 'barcode', width : 160, align : 'center', fontSize : 11}, + {header : "名称", dataIndex : 'name', width : 200, align : 'center', fontSize : 11}, + {header : "数量", dataIndex : 'amount', width : 40, align : 'center', fontSize : 11} + ] + } +} + var batchPrintMaterialInvoicesConfig = { headerFooter : [ // 页眉名称 @@ -1317,7 +1356,10 @@ var printConfig = { //发货计划单 invoicePlan : invoicePlanPrintConfig, - foreignProxyDisinfectionApplication: foreignProxyDisinfectionApplicationPrintConfig,// 外部代理灭菌单 + // 外部代理灭菌单 + foreignProxyDisinfectionApplication: foreignProxyDisinfectionApplicationPrintConfig, + // 代理灭菌单 + proxyDisinfectionApplication: proxyDisinfectionApplicationPrintConfig, batchPrintInvoices: batchPrintInvoicesConfig, batchPrintMaterialInvoices:batchPrintMaterialInvoicesConfig, // 发货单(通用发货单) Index: ssts-web/src/main/webapp/disinfectsystem/print/print.js =================================================================== diff -u -r32417 -r32834 --- ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 32417) +++ ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 32834) @@ -4568,4 +4568,237 @@ LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD",1); LODOP.PREVIEW(); } +} + +//获取代理灭菌单的数据 +function getPrintProxyDisinfectionInfo(ids) { + top.Ext.MessageBox.show({ + title: '请等待', + msg: '打印中……', + width: 350, + progress: true, + closable: false + }); + + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/proxyDisinfectionAction!printProxyDisinfection.do', + params: { + ids: ids + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + for (var i = 0; i < result.data.length; i++) { + printProxyDisinfection(result.data[i], 0, (i+1), result.data.length); + } + } + top.Ext.MessageBox.hide(); + }, + failure: function (response, options) { + var result = Ext.decode(response.responseText); + if (result && result.message) { + showResult(result.message); + } + top.Ext.MessageBox.hide(); + } + }); +} + +//打印代理灭菌单 +function printProxyDisinfection(printObj, printType, pageIndex, pageCount) { + doGetLodop(); + LODOP.PRINT_INIT(""); + setPrinterByConfig(); + setDefaultProxyDisinfection(printObj, pageIndex, pageCount); + if (printType == 0) {//直接打印 + LODOP.PRINT(); + } else {//打印预览 + LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD", 1); + LODOP.PREVIEW(); + } +} + +//设置代理灭菌单的打印格式 +function setDefaultProxyDisinfection(printSummaryObj, pageIndex, pageCount) { + var myObj = printConfig['proxyDisinfectionApplication']; + if (isUndefinedOrNullOrEmpty(myObj)) { + var header = [ + // 标题 + { label: "代理灭菌单", dataIndex: '', fontSize: 15, position: ["20", "40%", "99%", 5] }, + { label: "部门:", dataIndex: 'depart', fontSize: 11, position: ["55", "2%", "90%", 5] }, + { label: "单号:", dataIndex: 'serialNumber', fontSize: 11, position: ["55", "35%", "90%", 5] }, + { label: "申请时间:", dataIndex: 'applicationTimeStr', fontSize: 11, position: ["80", "35%", "90%", 5] }, + { label: "申请人:", dataIndex: 'applicant', fontSize: 11, position: ["80", "75%", "90%", 5] }, + { label: "备注:", dataIndex: 'remark', fontSize: 11, position: ["80", "2%", "90%", 5] }, + { + barcodes: [{ + codeType: "128Auto", dataIndex: 'serialNumber', position: ["3mm", "74%", "40mm", "8mm"], + styles: [ + { itemNameID: 0, styleName: 'ShowBarText', styleValue: true }, + { itemNameID: 0, styleName: 'FontSize', styleValue: 6 }, + { itemNameID: 0, styleName: 'NotOnlyHighPrecision', styleValue: true } + ] + }] + } + ]; + var footer = { + fontSize: 14, + rowHeight: 20, + content: [ + { label: "打印时间: ", dataIndex: 'printTime' } + ] + } + var goodsTable = { + rowHeight: 25, + position: ["100", "1%", "90%", "95%"], + headRepeat: true, + columns: [ + { header: "序号", dataIndex: 'serialNumber', width: 60, align: 'center', fontSize: 11 }, + { header: "条码", dataIndex: 'barcode', width: 160, align: 'center', fontSize: 11 }, + { header: "名称", dataIndex: 'name', width: 200, align: 'center', fontSize: 11 }, + { header: "数量", dataIndex: 'amount', width: 40, align: 'center', fontSize: 11 } + ] + } + myObj = { + header: header, + footer: footer, + goodsTable: goodsTable + } + } + // 打印表头的内容 + if (!isObjEmpty(myObj.header)) { + // 设置为页眉页脚模式 + LODOP.SET_PRINT_STYLE("ItemType", 1); + + for (var i = 0; i < myObj.header.length; i++) { + var item = myObj.header[i]; + var text = item.label; + if (item.dataIndex != '' && typeof item.dataIndex != 'undefined') { + var temp = printSummaryObj[item.dataIndex]; + if (temp != null && temp != '' && typeof temp != 'undefined') { + text += temp; + } + } + + item.text = text; + + addPrintItem(item, printSummaryObj); + } + } + + // 打印条码信息 + if (!isObjEmpty(myObj.barcodes)) { + for (var i = 0; i < myObj.barcodes.length; i++) { + var item = myObj.barcodes[i]; + + addPrintBarcode(item, printSummaryObj[item.dataIndex]); + } + } + + if (!isObjEmpty(myObj.goodsTable)) { + LODOP.SET_PRINT_STYLE("ItemType", 4); + // 打印物品表格 + // 打印表格头 + var tableStyle = "border-collapse:collapse;width:100%;"; + var tableHtml = ""; + + // 如果需要表头在每页重复打印,则增加thead标签 + if (myObj.goodsTable.headRepeat) { + tableHtml += ""; + } + + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight, myObj.goodsTable.fontSize); + + for (var i = 0; i < myObj.goodsTable.columns.length; i++) { + var item = myObj.goodsTable.columns[i]; + var style = getTableTdStyle(myObj.goodsTable, i); + + tableHtml += ""; + } + tableHtml += ""; + + if (myObj.goodsTable.headRepeat) { + tableHtml += ""; + } + + // 打印物品内容行 + var columnCount = myObj.goodsTable.columns.length; + var goodsArray = printSummaryObj.instances; + var totalGoodsAmount = 0; + for (var k = 0; k < goodsArray.length; k++) { + var row = goodsArray[k]; + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight, myObj.goodsTable.fontSize); + for (var i = 0; i < columnCount; i++) { + var item = myObj.goodsTable.columns[i]; + var value = row[item.dataIndex]; + if (isUndefinedOrNullOrEmpty(value)) { + if (item.dataIndex == 'serialNumber') { + value = (k + 1); + } else if (item.dataIndex == 'amount') { + value = 1; + } else { + value = ' '; + } + } + var tdContent = value; + var style = getTableTdStyle(myObj.goodsTable, i); + var tdWidth = 'width=' + item.width; + tableHtml += ""; + } + totalGoodsAmount++; + tableHtml += ""; + } + + if (!myObj.goodsTable.donotPrintTotal) { + // 打印合计信息 + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight, myObj.goodsTable.fontSize); + var style = getTableTdStyle(myObj.goodsTable, 0); + tableHtml += ""; + for (var i = 1; i < columnCount; i++) { + var item = myObj.goodsTable.columns[i]; + var style = getTableTdStyle(myObj.goodsTable, i); + var value = ""; + var indexName = item.dataIndex; + tableHtml += ""; + } + + tableHtml += ""; + } + + if (myObj.footer) { + // 打印页脚信息 + tableHtml = appendTableRowString(tableHtml, myObj.footer.rowHeight, myObj.footer.fontSize) + tableHtml += ""; + tableHtml += ""; + } + + tableHtml += "
" + item.header + "
" + tdContent + "
合计" + totalGoodsAmount; + } else { + tableHtml += item.align; + tableHtml += " style=" + style + ">" + value; + } + tableHtml += "
"; + var text = ""; + + for (var i = 0; i < myObj.footer.content.length; i++) { + var item = myObj.footer.content[i]; + text += item.label; + if (item.dataIndex != '') { + var temp = printSummaryObj[item.dataIndex]; + + if (temp != null && temp != '' && typeof temp != 'undefined') { + text += temp; + } + } + } + tableHtml += "
" + text + "
"; + tableHtml += "
"; + tableHtml += "
"
+			tableHtml += "   第"+pageIndex+"页/共"+pageCount+"页";
+			tableHtml += "
"; + LODOP.ADD_PRINT_TABLE(myObj.goodsTable.position[0], myObj.goodsTable.position[1], myObj.goodsTable.position[2], myObj.goodsTable.position[3], tableHtml); + } } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js =================================================================== diff -u -r32443 -r32834 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js (.../proxyDisinfectionView.js) (revision 32443) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js (.../proxyDisinfectionView.js) (revision 32834) @@ -115,6 +115,23 @@ }); } +function printApplication(grid){ + var records = grid.getSelectionModel().getSelections(); + + if (records.length == 0) { + showResult("请选择要打印的灭菌记录信息!"); + return false; + } + + var idsArr = []; + for (var i = 0, len = records.length; i < len; i++) { + var id = records[i].data['id']; + idsArr.push(id); + } + + getPrintProxyDisinfectionInfo(idsArr.join(';')); +} + var departJsonStore = new Ext.data.SimpleStore({ fields: ['name', 'id'], url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do' @@ -674,6 +691,17 @@ handler: function () { endProxyDisinfection(grid); } + }, '-', { + text: '打印', + iconCls: 'icon_print', + handler: function () { + top.Ext.MessageBox.confirm("请确认", "要打印本申请单吗?",function(btn) { + if (btn == 'yes') { + printApplication(grid); + grid.dwrReload(); + } + }); + } }]; Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { }; @@ -742,4 +770,235 @@ }] }); -}); \ No newline at end of file +}); + +//获取代理灭菌单的数据 +function getPrintProxyDisinfectionInfo(ids){ + top.Ext.MessageBox.show({ + title:'请等待', + msg:'打印中……', + width:350, + progress:true, + closable:false + }); + + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/proxyDisinfectionAction!printProxyDisinfection.do', + params: { + ids: ids + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + for(var i=0;i"; + + // 如果需要表头在每页重复打印,则增加thead标签 + if (myObj.goodsTable.headRepeat){ + tableHtml += ""; + } + + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight , myObj.goodsTable.fontSize); + + for (var i=0;i" + item.header + ""; + } + tableHtml += ""; + + if (myObj.goodsTable.headRepeat){ + tableHtml += ""; + } + + // 打印物品内容行 + var columnCount = myObj.goodsTable.columns.length; + var goodsArray = printSummaryObj.instances; + var totalGoodsAmount = 0; + for ( var k = 0; k < goodsArray.length; k++) { + var row = goodsArray[k]; + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight , myObj.goodsTable.fontSize); + for (var i=0;i" + tdContent + ""; + } + totalGoodsAmount ++; + tableHtml += ""; + } + + if(!myObj.goodsTable.donotPrintTotal){ + // 打印合计信息 + tableHtml = appendTableRowString(tableHtml, myObj.goodsTable.rowHeight , myObj.goodsTable.fontSize); + var style = getTableTdStyle(myObj.goodsTable,0); + tableHtml += "合计"; + for (var i=1;i" + totalGoodsAmount; + }else{ + tableHtml += item.align; + tableHtml += " style=" + style + ">" + value; + } + tableHtml += ""; + } + + tableHtml += ""; + } + + if(myObj.footer){ + // 打印页脚信息 + tableHtml = appendTableRowString(tableHtml, myObj.footer.rowHeight , myObj.footer.fontSize) + tableHtml += ""; + var text = ""; + + for (var i=0;i" + text + ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += "
"
+			tableHtml += "   第1页/共1页";
+			tableHtml += "
"; + } + + tableHtml += ""; + LODOP.ADD_PRINT_TABLE(myObj.goodsTable.position[0], myObj.goodsTable.position[1], myObj.goodsTable.position[2], myObj.goodsTable.position[3],tableHtml); + } +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.jsp =================================================================== diff -u -r32473 -r32834 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.jsp (.../proxyDisinfectionView.jsp) (revision 32473) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.jsp (.../proxyDisinfectionView.jsp) (revision 32834) @@ -52,6 +52,13 @@ + +<%@ include file="/common/includeExtJs4_2.jsp"%> + + + +<%@ include file="/disinfectsystem/print/print.jsp"%> +