Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.jsp =================================================================== diff -u -r34459 -r35159 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.jsp (.../departmentMonthlyDetailDSInvoiceItemView.jsp) (revision 34459) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.jsp (.../departmentMonthlyDetailDSInvoiceItemView.jsp) (revision 35159) @@ -35,6 +35,15 @@ + + + + + + + + + Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r34487 -r35159 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 34487) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 35159) @@ -4654,16 +4654,17 @@ function exportReportExcel(data, thisID, is2Column, widthArr) { var fileName = data.fileName + data.fileType; if (isIE()) { + var iframeName = data.iframeName || 'thisIframe'; var tableHtml = ''; tableHtml += data.html; tableHtml += ''; tableHtml = Base64.encode(encodeURI(tableHtml)); var htmlTable = LZString.compressToEncodedURIComponent(tableHtml) var jsFileName = "\\disinfectsystem\\reportforms\\js\\LZString.js"; - document.getElementById('thisIframe').contentWindow.document.getElementById('htmlFileName').value = fileName; - document.getElementById('thisIframe').contentWindow.document.getElementById('jsFileName').value = jsFileName; - document.getElementById('thisIframe').contentWindow.document.getElementById('htmlTable').value = htmlTable; - document.getElementById('thisIframe').contentWindow.document.getElementById('submitForm').click(); + document.getElementById(iframeName).contentWindow.document.getElementById('htmlFileName').value = fileName; + document.getElementById(iframeName).contentWindow.document.getElementById('jsFileName').value = jsFileName; + document.getElementById(iframeName).contentWindow.document.getElementById('htmlTable').value = htmlTable; + document.getElementById(iframeName).contentWindow.document.getElementById('submitForm').click(); exportMask.hide(); } else { XSExport.excelExport( @@ -4812,7 +4813,7 @@ modal: true, resizable: false, buttonAlign: 'center', - id:'wangEditorWin', + id: 'wangEditorWin', items: [{ xtype: "panel", html: "" @@ -4855,7 +4856,7 @@ } //预览富文本内容 -function previewWangEditor(title,id) { +function previewWangEditor(title, id) { var url = WWWROOT + '/common/previewWangEditor.jsp?id=' + id; openModalWindowForExt(url, {}, title + '配包注意事项', 1000, 550); } @@ -4889,7 +4890,7 @@ hidden: false, handler: function () { var hiddenNote = top.Ext.getCmp('hiddenNote').getValue(); - sessionStorage.setItem('hiddenNote',hiddenNote) + sessionStorage.setItem('hiddenNote', hiddenNote) previewWangEditor(title); } }, { @@ -4899,7 +4900,7 @@ var hiddenNote = top.Ext.getCmp('hiddenNote').getValue(); Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!saveTousseDefinitionNote.do', - params: { + params: { id: id, note: hiddenNote }, @@ -4920,7 +4921,7 @@ var hiddenNote = top.Ext.getCmp('hiddenNote').getValue(); Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!saveTousseDefinitionNote.do', - params: { + params: { id: id, note: hiddenNote }, @@ -4944,17 +4945,17 @@ }] }) win.show(); - if(id){ + if (id) { Ext.Ajax.request({ - url : WWWROOT+'/disinfectSystem/baseData/tousseDefinitionAction!loadTousseDefinitionNote.do', - params: { - id:id + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadTousseDefinitionNote.do', + params: { + id: id }, success: function (response, options) { var result = Ext.decode(response.responseText); if (result.success) { var text; - if(result.data && result.data.note){ + if (result.data && result.data.note) { text = result.data.note; } top.Ext.getCmp('hiddenNote').setValue(text); Index: ssts-web/src/main/webapp/disinfectsystem/config/dlzxyy/config.js =================================================================== diff -u -r34516 -r35159 --- ssts-web/src/main/webapp/disinfectsystem/config/dlzxyy/config.js (.../config.js) (revision 34516) +++ ssts-web/src/main/webapp/disinfectsystem/config/dlzxyy/config.js (.../config.js) (revision 35159) @@ -163,5 +163,9 @@ //隐藏预回收确认人 hiddenPreRecyclingConfirmPeople:true, //启用灭菌炉和炉次过滤待灭菌物品 - enableSterilizersAndFrequencyFilterToSterilizeItems:true + enableSterilizersAndFrequencyFilterToSterilizeItems:true, + typesOfDetailedAccountingMonthlyReport : [ + {'optionText':'默认','reportName':'标准的明细核算月报'}, + {'optionText':'详细日期明细核算月报','reportName':'详细日期明细核算月报'} + ] } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js =================================================================== diff -u -r34604 -r35159 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 34604) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 35159) @@ -7,6 +7,7 @@ var departMode; var ALL = '全部'; var newPrintConfig; +var widthArr = []; //页眉 function getHeaderHtml(depart) { @@ -114,7 +115,7 @@ rowHeight: 30, tableWidth: '19.9cm', tableHeight: '10cm', - left:'1cm', + left: '1cm', top: 100, columns: [{ align: "center", @@ -214,6 +215,125 @@ LODOP.SET_PRINT_STYLEA(0, "Vorient", 3); } +function getDayAll(starDay, endDay) { + var arr = []; + var dates = {}; + + // 设置两个日期UTC时间 + var db = new Date(starDay); + var de = new Date(endDay); + + // 获取两个日期GTM时间 + var s = db.getTime() - 24 * 60 * 60 * 1000; + var d = de.getTime() - 24 * 60 * 60 * 1000; + + // 获取到两个日期之间的每一天的毫秒数 + for (var i = s; i <= d;) { + i = i + 24 * 60 * 60 * 1000; + arr.push(parseInt(i)) + } + var count = 0; + // 获取每一天的时间 YY-MM-DD + for (var j = 0; j < arr.length; j++) { + var time = new Date(arr[j]); + var year = time.getFullYear(time); + var mouth = (time.getMonth() + 1) >= 10 ? (time.getMonth() + 1) : ('0' + (time.getMonth() + 1)); + var day = time.getDate() >= 10 ? time.getDate() : ('0' + time.getDate()); + var YYMMDD = year + '-' + mouth + '-' + day; + dates[YYMMDD] = parseInt(day); + count++ + } + if (count > 31 || count < 1) { + return false; + } + + return dates +} + +function getTableHtml(data, dataAll) { + var tableHtml = ''; + var tableWidth = 'auto' + var sumAmount = 0; + var sumSettlementPrice = 0; + var sumTotalPrice = 0; + var sumInfo = {}; + var widthArr = []; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + widthArr = [100, 100, 100, 150] + for (var day in dataAll) { + tableHtml += ""; + widthArr.push(80); + } + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + widthArr = widthArr.concat([80, 80, 80, 80]) + tableHtml += ""; + for (var i = 0; i < data.length; i++) { + var items = data[i].items; + for (var j = 0; j < items.length; j++) { + tableHtml += ""; + if (j == 0) { + tableHtml += ""; + tableHtml += ""; + } + tableHtml += ""; + tableHtml += ""; + for (var day in dataAll) { + var amount = ''; + if (day == items[j].showTime) { + amount = items[j].amount; + if (sumInfo[items[j].showTime]) { + sumInfo[items[j].showTime] += items[j].amount; + } else { + sumInfo[items[j].showTime] = amount; + } + } + tableHtml += ""; + } + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + if (j == 0) { + tableHtml += ""; + } + tableHtml += ""; + sumAmount += items[j].amount; + sumSettlementPrice += items[j].settlementPrice; + } + sumTotalPrice += data[i].totalPrice; + } + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + for (var day in dataAll) { + var amount = ''; + if (sumInfo[day]) { + amount = sumInfo[day] + } + tableHtml += ""; + } + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += ""; + tableHtml += "
申请可算结算科室类型物品名称" + dataAll[day] + "数量单价总计(元)总价(元)
" + data[i].depart + "" + data[i].applicationDepart + "" + items[j].type + "" + items[j].goodsName + "" + amount + "" + items[j].amount + "" + items[j].price + "" + items[j].settlementPrice + "" + data[i].totalPrice + "
总计" + amount + "" + sumAmount + "" + sumSettlementPrice + "" + sumTotalPrice + "
"; + return tableHtml; +} + Ext.onReady(function () { Ext.QuickTips.init(); if (supplyRoomType == supplyRoomTypeFirstSupplyRoom || supplyRoomType == supplyRoomTypeSecondSupplyRoom || supplyRoomType == supplyRoomTypeExpensiveGoods) { @@ -247,6 +367,8 @@ reportType = 'standard'; } else if (reportName == '单个科室的明细核算月报') { reportType = 'singleDepart'; + } else if (reportName == '详细日期明细核算月报') { + reportType = 'detailedDate'; } else { continue; } @@ -261,6 +383,8 @@ var patternOfReport = null; if (reportName == '单个科室的明细核算月报') { patternOfReport = 'singleDepart'; + } else if (reportName == '详细日期明细核算月报') { + patternOfReport = 'detailedDate'; } else { patternOfReport = 'standard'; } @@ -447,8 +571,52 @@ } function reloadReport() { var params = getSearchValue(0); - var url = WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do"; - searchReport(url, params); + if (params == false) { + return; + } + if (params.patternOfReport == 'detailedDate') { + var myMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在加载,请稍候!', + removeMask: true + }); + myMask.show(); + document.getElementById('thisIframe').style.display = 'none'; + document.getElementById('thisIframe2').style.display = 'block'; + Ext.getCmp('exportButton').show(); + var url = WWWROOT + "/jasperreports/jasperreportsAction!queryDataSourceList.do"; + var startTime = params.startTime.replace(new RegExp('-', 'g'), "/"); + var endTime = params.endTime.replace(new RegExp('-', 'g'), "/"); + var dataAll = getDayAll(startTime, endTime); + if (dataAll == false) { + showResult('明细核算月报(详细日期)最多只能查询一个月的数据'); + myMask.hide(); + return; + } + Ext.Ajax.request({ + url: url, + async: false, + params: params, + success: function (response) { + var result = Ext.decode(response.responseText); + var title = result.parametMap.title; + var tableHtml = "

" + title + "

"; + tableHtml += getTableHtml(result.data, dataAll) + setTimeout(function () { + document.getElementById('thisIframe2').contentWindow.document.getElementById('table').innerHTML = tableHtml; + myMask.hide(); + }, 1000); + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); + } else { + var url = WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do"; + document.getElementById('thisIframe').style.display = 'block'; + document.getElementById('thisIframe2').style.display = 'none'; + Ext.getCmp('exportButton').hide(); + searchReport(url, params); + } } Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { }; @@ -599,7 +767,6 @@ height: 170, items: [{ layout: 'column', - height: 80, items: [{ xtype: 'hidden', name: 'departCoding', @@ -1128,6 +1295,9 @@ handler: function () { var url = WWWROOT + '/jasperreports/jasperreportsAction!queryDataSourceList.do'; var params = getSearchValue(1); + if (params == false) { + return; + } Ext.Ajax.request({ url: url, async: false, @@ -1170,7 +1340,33 @@ autoScroll: true,//自动显示滚动条 collapsible: true,//允许展开和收缩 bodyPadding: 5, - html: '' + tbar: [{ + text: '导出', + id: 'exportButton', + handler: function () { + var html = document.getElementById('thisIframe2').contentWindow.document.getElementById('table').innerHTML; + if (html !== '') { + var startTime = $Id('startTime').value; + var endTime = $Id('endTime').value; + var title = '明细核算月报(' + startTime + '至' + endTime + ')'; + var data = { + fileName: title, + fileType: ".xls", + iframeName: 'thisIframe2', + html: html + } + exportMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在导出文件,请稍候!', + removeMask: true + }); + exportMask.show(); + setTimeout(function () { + exportReportExcel(data, document.getElementById('thisIframe2').contentWindow.document.getElementById('table'), false, widthArr); + }, 1000); + } + } + }], + html: '' }); var viewport = new Ext.Viewport({ @@ -1194,6 +1390,8 @@ departSearch.setValue(orgUnitName); } + Ext.getCmp('exportButton').hide(); + //reloadReport(); if (dataForPatternOfReport.length < 1) {