Index: ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js
===================================================================
diff -u -r15605 -r15619
--- ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 15605)
+++ ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 15619)
@@ -168,9 +168,30 @@
alert('开始时间、结束时间跨度不能超过两天!!');
return ;
}
-
+ //东莞市中医院定制开发
+ if(projectName == "dgszyy"){
+ Ext.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/recyclingRecordAction!dongGuanZhongYiYuanProcess.do',
+ params : {
+ startDateTime : startDateTime,
+ endDateTime : endDateTime,
+ handlerDepartCoding : handlerDepartCoding
+ },
+ success : function(response, options) {
+ var obj = JSON.parse(response.responseText);
+ if(obj.success){
+ dongGuangZhongYiYuanRecyclingDetailPrint(printType,startDateTime,endDateTime,obj.printUser,obj);
+ }else{
+ showResult(obj.message);
+ }
+ },
+ failure : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ showResult(result.cause);
+ }
+ });
// 按器械包的资产归属过滤打印范围,需要在器械包定义中进行设置
- if (sstsConfig.recyclingRecordListFilterByAssetBelong){
+ }else if (sstsConfig.recyclingRecordListFilterByAssetBelong){
Ext.Ajax.request({
url : WWWROOT + '/disinfectSystem/recyclingRecordAction!getPrintRecyclingDetailList.do',
params : {
@@ -268,6 +289,151 @@
return tableHtml;
}
+function buildTable(data,model,defaultRow){
+ var htmlTable ="
";
+ //表列头
+ htmlTable += "";
+ var config = data["配置文件"];
+ var titleConfig = config[model];
+ var columnLength = 0;
+
+ var totalColumnName = {};
+
+ if(titleConfig.length > 0){
+ htmlTable += "科室 | ";
+ columnLength = titleConfig.length;
+ for(var i = 0 ; i < titleConfig.length ; i++){
+ var columnName = titleConfig[i].columnName;
+ htmlTable += "" + columnName + " | ";
+ }
+ htmlTable += "其他器械 | ";
+ }
+ htmlTable += "
";
+ //数据填充
+ var result = data[model];
+ if(result.length > 0){
+ for(var i = 0 ; i < result.length ; i++){
+ htmlTable += "";
+ htmlTable += "" + result[i].depart + " | ";
+
+ if(titleConfig.length > 0){
+ for(var j = 0 ; j < titleConfig.length ; j++){
+ var tmpColumnName = titleConfig[j].columnName;
+ var value = result[i][tmpColumnName];
+ //合计
+ var oldAmount = totalColumnName[tmpColumnName];
+ if(oldAmount == null ||oldAmount == ""){
+ oldAmount = 0;
+ }
+ totalColumnName[tmpColumnName] = (oldAmount + value);
+ if(value == 0){
+ value = "";
+ }
+ htmlTable += "" + value + " | ";
+ }
+ }
+ htmlTable += " | ";
+ htmlTable += "
";
+ }
+ }
+ //默认填充空行
+ if(defaultRow > result.length){
+ for(var i = 0 ; i < (defaultRow - result.length) ; i++){
+ htmlTable += "";
+ htmlTable += " | ";
+ for(var j = 0 ; j < columnLength ; j++){
+ htmlTable += " | ";
+ }
+ htmlTable += " | ";
+ htmlTable += "
";
+ }
+ }
+
+ //合计
+ if(titleConfig.length > 0){
+ htmlTable += "合计 | ";
+ columnLength = titleConfig.length;
+ for(var i = 0 ; i < titleConfig.length ; i++){
+ var columnName = titleConfig[i].columnName;
+ var totalAmount = totalColumnName[columnName];
+ if(isUndefinedOrNull(totalAmount)){
+ totalAmount = "";
+ }
+ htmlTable += "" + totalAmount + " | ";
+ }
+ htmlTable += " | ";
+ }
+
+ htmlTable += "
";
+ return htmlTable;
+}
+
+function buildDepartTable(data,model){
+ var html ="";
+ html += "";
+ html += "" + model + " | ";
+ html += "";
+ var result = data[model];
+ for(var i = 0 ; i < result.length ; i++){
+ html += ("" + result[i].showDepart + ":");
+ for(var j = 0 ; j < result[i].items.length ; j++){
+ var tousseItem = result[i].items[j];
+ html += (tousseItem.tousseName + " x " + tousseItem.amount) + "; ";
+ }
+ html += " ";
+ }
+ html += " | ";
+ html += "
";
+ html += "
";
+ return html;
+}
+
+function dongGuangZhongYiYuanRecyclingDetailPrint(printType,startDateTime,endDateTime,printUser,recyclingDetail){
+ var LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
+ LODOP.SET_PRINT_STYLE("FontSize",17);
+ LODOP.ADD_PRINT_TEXT(5,300,"100%",5,"CSSD每日回收登记表");
+ LODOP.SET_PRINT_STYLE("FontSize",11);
+ LODOP.ADD_PRINT_TEXT(35,50,"100%",5,"制单人: " + printUser);
+ LODOP.ADD_PRINT_TEXT(35,200,"100%",5,"开始时间:" + startDateTime);
+ LODOP.ADD_PRINT_TEXT(35,450,"100%",5,"结束时间: " + endDateTime);
+
+ var htmlTable ="";
+ //普通器械
+ htmlTable += "";
+ htmlTable += buildTable(recyclingDetail,"普通器械",25);
+ htmlTable += " |
";
+ //呼吸机管道
+ htmlTable += "";
+ htmlTable += buildTable(recyclingDetail,"呼吸机管道",9);
+ htmlTable += " |
";
+ //住院科室
+ htmlTable += "";
+ htmlTable += buildDepartTable(recyclingDetail,"住院专科");
+ htmlTable += " |
";
+ //门诊科室
+ htmlTable += "";
+ htmlTable += buildDepartTable(recyclingDetail,"门诊专科");
+ htmlTable += " |
";
+ //分院
+ htmlTable += "";
+ htmlTable += buildDepartTable(recyclingDetail,"分院");
+ htmlTable += " |
";
+ //其他
+ htmlTable += "";
+ htmlTable += buildDepartTable(recyclingDetail,"其他");
+ htmlTable += " |
";
+
+ htmlContent = "" + htmlTable + "";
+ LODOP.ADD_PRINT_HTM(55,5,"100%","100%",htmlContent);
+
+ if(printType == 0){//直接打印
+ LODOP.PRINT();
+ }else{//打印预览
+ LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD",1);
+ LODOP.PREVIEW();
+ }
+}
+
function lodopPrint(printType,startDateTime,endDateTime,printUser,printDetail,disinfectionDetail,tableRowSize){
var LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
LODOP.SET_PRINT_STYLE("FontSize",17);