Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.js (revision 33272) @@ -0,0 +1,526 @@ +var entityName = "外来器械包供应商统计报表"; +var myMask; +var searchCustomTimePeriodStore; +var is2Column = false; +var widthArr = []; + +//获取表头列 +function getTableHeaderColumnArray(reportType) { + var columnNameArray = []; + if (reportType) { + columnNameArray = [{ + name: '日期', + width: 100 + }, { + name: '供应商', + width: 300 + }, { + name: '材料汇总', + width: 210 + }, { + name: '大小', + width: 140 + }, { + name: '灭菌包数量', + width: 80 + }]; + } else { + columnNameArray = [{ + name: '序号', + width: 100 + }, { + name: '供应商', + width: 300 + }, { + name: '材料汇总', + width: 210 + }, { + name: '大小', + width: 140 + }, { + name: '灭菌包数量', + width: 80 + }]; + } + return columnNameArray; +} + +//获取表头的td +function getHeadTd(name, width, rowspan, colspan) { + var html = '' + name + ''; + return html; +} + +//获取表格的td +function getBodyTd(value, rowspan, colspan, background) { + var html = '' + value + ''; + return html; +} + +//获取表头html +function getTableHeadHtml(reportType) { + var html = ''; + var columnNameArray = getTableHeaderColumnArray(reportType); + for (var i = 0; i < columnNameArray.length; i++) { + if (columnNameArray[i].name == '材料汇总') { + html += getHeadTd(columnNameArray[i].name, 'auto', 1, 3); + } else if (columnNameArray[i].name == '大小') { + html += getHeadTd(columnNameArray[i].name, 'auto', 1, 2); + } else { + html += getHeadTd(columnNameArray[i].name, columnNameArray[i].width, 2, 1); + } + widthArr.push(columnNameArray[i].width); + } + html += ''; + html += ''; + html += getHeadTd('工具', 70, 1, 1); + html += getHeadTd('植入物', 70, 1, 1); + html += getHeadTd('合计', 70, 1, 1); + html += getHeadTd('打包', 70, 1, 1); + html += getHeadTd('小包', 70, 1, 1); + html += ''; + is2Column = true; + return html; +} + +//获取表内容的html +function getTableBodyHtml(data) { + var html = ''; + var allToolAmount = 0; + var allImplantAmount = 0; + var allSumCount = 0; + var allBigTousseAmount = 0; + var allSmallTousseAmount = 0; + var allSterilizationTousseAmount = 0; + for (var i = 0; i < data.length; i++) { + html += ''; + var toolAmount = data[i].toolAmount; + var implantAmount = data[i].implantAmount; + var sumCount = toolAmount + implantAmount; + var bigTousseAmount = data[i].bigTousseAmount; + var smallTousseAmount = data[i].smallTousseAmount; + var sterilizationTousseAmount = data[i].sterilizationTousseAmount; + html += getBodyTd((i + 1), 1, 1); + html += getBodyTd(data[i].supplierName, 1, 1); + html += getBodyTd(toolAmount, 1, 1); + html += getBodyTd(implantAmount, 1, 1); + html += getBodyTd(sumCount, 1, 1); + html += getBodyTd(bigTousseAmount, 1, 1); + html += getBodyTd(smallTousseAmount, 1, 1); + html += getBodyTd(sterilizationTousseAmount, 1, 1); + allToolAmount += toolAmount; + allImplantAmount += implantAmount; + allSumCount += sumCount; + allBigTousseAmount += bigTousseAmount; + allSmallTousseAmount += smallTousseAmount; + allSterilizationTousseAmount += sterilizationTousseAmount; + html += ''; + } + //合计 + html += ''; + html += getBodyTd('合计', 1, 2); + html += getBodyTd('' + allToolAmount + '', 1, 1); + html += getBodyTd('' + allImplantAmount + '', 1, 1); + html += getBodyTd('' + allSumCount + '', 1, 1); + html += getBodyTd('' + allBigTousseAmount + '', 1, 1); + html += getBodyTd('' + allSmallTousseAmount + '', 1, 1); + html += getBodyTd('' + allSterilizationTousseAmount + '', 1, 1); + html += ''; + return html; +} + +//按日期归类 +function newArr(data) { + var dest = []; + var map = {}; + for (var i = 0; i < data.length; i++) { + var ai = data[i]; + if (!map[ai.dateStr]) { + ai.items = [ai]; + dest.push(ai); + map[ai.dateStr] = ai; + } else { + for (var j = 0; j < dest.length; j++) { + var dj = dest[j]; + if (dj.dateStr == ai.dateStr) { + dj.items.push(ai); + } + } + } + } + return dest; +} + +//按日期汇总 +function getTableBodyHtmlForReportType(data2) { + var data = newArr(data2); + var html = ''; + var allToolAmount = 0; + var allImplantAmount = 0; + var allSumCount = 0; + var allBigTousseAmount = 0; + var allSmallTousseAmount = 0; + var allSterilizationTousseAmount = 0; + for (var i = 0; i < data.length; i++) { + for (var j = 0; j < data[i].items.length; j++) { + var toolAmount = data[i].items[j].toolAmount; + var implantAmount = data[i].items[j].implantAmount; + var sumCount = toolAmount + implantAmount; + var bigTousseAmount = data[i].items[j].bigTousseAmount; + var smallTousseAmount = data[i].items[j].smallTousseAmount; + var sterilizationTousseAmount = data[i].items[j].sterilizationTousseAmount; + html += ''; + if (j == 0) { + html += getBodyTd(data[i].items[j].dateStr, data[i].items.length, 1); + } + html += getBodyTd(data[i].items[j].supplierName, 1, 1); + html += getBodyTd(toolAmount, 1, 1); + html += getBodyTd(implantAmount, 1, 1); + html += getBodyTd(sumCount, 1, 1); + html += getBodyTd(bigTousseAmount, 1, 1); + html += getBodyTd(smallTousseAmount, 1, 1); + html += getBodyTd(sterilizationTousseAmount, 1, 1); + allToolAmount += toolAmount; + allImplantAmount += implantAmount; + allSumCount += sumCount; + allBigTousseAmount += bigTousseAmount; + allSmallTousseAmount += smallTousseAmount; + allSterilizationTousseAmount += sterilizationTousseAmount; + html += ''; + } + } + //合计 + html += ''; + html += getBodyTd('合计', 1, 2); + html += getBodyTd('' + allToolAmount + '', 1, 1); + html += getBodyTd('' + allImplantAmount + '', 1, 1); + html += getBodyTd('' + allSumCount + '', 1, 1); + html += getBodyTd('' + allBigTousseAmount + '', 1, 1); + html += getBodyTd('' + allSmallTousseAmount + '', 1, 1); + html += getBodyTd('' + allSterilizationTousseAmount + '', 1, 1); + html += ''; + return html; +} + +//获取表格html +function getTableHtml(result, reportType) { + var tableWidth = 830; + var html = ""; + html += ""; + html += getTableHeadHtml(reportType); + html += ""; + html += ""; + if (reportType) { + html += getTableBodyHtmlForReportType(result.data); + } else { + html += getTableBodyHtml(result.data); + } + html += ""; + html += "
"; + return html; +} + +Ext.onReady(function () { + Ext.QuickTips.init(); + function reloadReport() { + var timeType = Ext.getCmp('timeType').getValue(); + var startDate = Ext.getCmp('startDate').getRawValue(); + var endDate = Ext.getCmp('endDate').getRawValue(); + var supplierName = Ext.getCmp('supplierName').getRawValue(); + var customTimePeriodId = Ext.getCmp('customTimePeriodId').getValue(); + var reportType = Ext.getCmp('reportType').getValue(); + + myMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在加载,请稍候!', + removeMask: true + }); + myMask.show(); + + var url = WWWROOT + '/jasperreports/jasperreportsAction!queryDataSourceList.do'; + var params = { + startDate: startDate, + endDate: endDate, + supplierName: supplierName, + timeType: timeType, + customTimePeriodId: customTimePeriodId, + reportType: reportType ? '按日期汇总' : '', + reportName: 'foreignTousseSupplierStatisticsReport' + } + Ext.Ajax.request({ + url: url, + async: false, + params: params, + success: function (response) { + var result = Ext.decode(response.responseText); + var title = '外来器械包供应商统计报表(' + startDate + '至' + endDate + ')'; + var tableHtml = "

" + title + "

"; + tableHtml += getTableHtml(result, reportType) + document.getElementById('thisIframe').contentWindow.document.getElementById('table').innerHTML = tableHtml; + myMask.hide(); + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); + } + + var dt = new Date(); + var startDayofMonth = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/01"; + var endDayofMonth = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/" + dt.getDate() + " 23:59"; + + //供应商 + var supplierStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierInfoByType.do?supplierType=' + encodeURI(supplierType), + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'companyName', mapping: 'companyName' } + ] + ) + }); + + //时间段 + searchCustomTimePeriodStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/report/customTimePeriodReportAction!queryAllCustomTimePeriod.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + fields: [{ + name: 'id' + }, { + name: 'timePeriodName' + }] + }) + }); + + var form = new Ext.form.FormPanel({ + title: entityName, + region: 'north', + labelAlign: 'right', + buttonAlign: 'center', + collapsible: true, + collapseMode: 'mini', + split: true, + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px',// padding:1px;padding-top:5px; + height: 130, + items: [{ + layout: 'column', + height: 150, + labelWidth: 120, + items: [{ + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'combo', + fieldLabel: '查询时间类型', + id: 'timeType', + name: 'timeType', + valueField: 'value', + displayField: 'value', + store: new Ext.data.SimpleStore({ + fields: ['value'], + data: [['接收时间'], ['发货时间'], ['申请时间']] + }), + forceSelection: true, + value: '接收时间', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%' + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '开始时间', + id: 'startDate', + name: 'startDate', + editable: false, + format: 'Y-m-d H:i', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: false, + anchor: '95%', + value: new Date(startDayofMonth), + listeners: { + specialkey: function (field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + var isOK = field.validate(); + if (isOK) { + var value = field.getValue(); + field.setValue(value); + var endDate = Ext.getCmp('endDate'); + endDate.selectText(); + endDate.focus(); + } + + } + } + } + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '结束时间', + id: 'endDate', + name: 'endDate', + editable: false, + format: 'Y-m-d H:i', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: false, + anchor: '95%', + value: new Date(endDayofMonth), + listeners: { + specialkey: function (field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + var isOK = field.validate(); + if (isOK) { + var value = field.getValue(); + field.setValue(value); + reloadReport(); + } + } + } + } + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'combo', + id: 'supplierName', + name: 'supplierName', + queryParam: 'spell', + fieldLabel: '供应商', + minChars: 0, + valueField: 'companyName', + displayField: 'companyName', + store: supplierStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: true, + anchor: '95%' + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'combo', + id: 'customTimePeriodId', + name: 'customTimePeriodId', + queryParam: 'spell', + fieldLabel: '时间段', + minChars: 0, + valueField: 'id', + displayField: 'timePeriodName', + anchor: '95%', + store: searchCustomTimePeriodStore, + lazyInit: false, + listWidth: 380, + triggerAction: 'all', + forceSelection: true, + hideTrigger: false, + typeAhead: false, + allowBlank: true + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + id: 'reportType', + name: 'reportType', + fieldLabel: '按日期汇总', + xtype: 'checkbox', + inputValue: '按日期汇总', + cls: 'sterilizerCheckbox', + labelSeparator: '' + }] + }] + }], + buttons: [{ + xtype: 'button', + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { + reloadReport(); + } + }, { + xtype: 'button', + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { + Ext.getCmp('timeType').setValue('接收时间'); + Ext.getCmp('startDate').setValue(new Date(startDayofMonth)); + Ext.getCmp('endDate').setValue(new Date(endDayofMonth)); + Ext.getCmp('supplierName').setValue(''); + Ext.getCmp('customTimePeriodId').setValue(''); + Ext.getCmp('reportType').setValue(false); + } + }, { + xtype: 'button', + text: '自定义时间段', + iconCls: 'icon_set', + minWidth: 100, + handler: function () { + showCustomTimePeriodWin(); + } + }] + }); + + + var reportForm = new Ext.Panel({ + frame: false,//渲染面板 + autoScroll: true,//自动显示滚动条 + collapsible: true,//允许展开和收缩 + bodyPadding: 5, + tbar: [{ + text: '导出', + handler: function () { + var html = document.getElementById('thisIframe').contentWindow.document.getElementById('table').innerHTML; + if (html !== '') { + var startDate = $Id('startDate').value; + var endDate = $Id('endDate').value; + var title = '外来器械包供应商统计报表(' + startDate + '至' + endDate + ')'; + var data = { + fileName: title, + fileType: ".xls", + html: html + } + exportMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在导出文件,请稍候!', + removeMask: true + }); + exportMask.show(); + setTimeout(function () { + exportReportExcel(data, document.getElementById('thisIframe').contentWindow.document.getElementById('table'), true, [100, 300]); + }, 1000); + } + } + }], + html: '' + }); + + new Ext.Viewport({ + layout: 'border', + items: [form, { + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: reportForm + }] + }); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r33176 -r33272 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 33176) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 33272) @@ -716,6 +716,7 @@ {hidden :SSTS_GoodsDistributeReportChart,text:"物品发放分布饼图",href:WWWROOT+'/disinfectsystem/reportforms/goodsDistributeReportChartView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_TousseDeliverReport,text:"器械包发货统计报表",href:WWWROOT+'/disinfectsystem/reportforms/tousseDeliverStatisticsView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ForeignTousseReport,text:"外来器械申请单统计报表",href:WWWROOT+'/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableForeignTousseSupplierStatisticsReport,text:"外来器械包供应商统计报表",href:WWWROOT+'/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ForeignTousseSupplierChargeReport,text:"外来器械包供应商收费报表",href:WWWROOT+'/disinfectsystem/reportforms/foreignTousseSupplierChargeReport.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :!hasForeignTousseSizeSetting,text:"外来器械包大小统计报表",href:WWWROOT+'/disinfectsystem/reportforms/foreignTousseSizeReport.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ApparatusInfusionisType,text:"各类型输液器报表",href:WWWROOT+'/disinfectsystem/reportforms/apparatusInfusionisTypeView.jsp',hrefTarget:linkTarget,leaf:true}, Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseSupplierStatisticsReport.jsp (revision 33272) @@ -0,0 +1,35 @@ +<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplier.Supplier"%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + + + + + + + + + +外来器械包供应商统计报表 + + + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js =================================================================== diff -u -r33239 -r33272 --- ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js (.../config.js) (revision 33239) +++ ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js (.../config.js) (revision 33272) @@ -198,5 +198,9 @@ //开启外来器械申请单统计报表材料汇总显示 enableShowForeignTousseApplicationReportSummaryOfMaterials:true, //开启外来器械申请单统计报表大小显示 - enableTheSizeDisplayOfTheForeignTousseApplicationReport:true + enableTheSizeDisplayOfTheForeignTousseApplicationReport:true, + //使用记录字段别名设置 + aliasNameOfUseRecordFields:[ {"fieldName":"hospitalNumber","displayText":"ID"}, {"fieldName":"patient","displayText":"患者姓名"}, {"fieldName":"departNameOfpatient","displayText":"患者所属科室"}], + //启用外来器械包供应商统计报表 + enableForeignTousseSupplierStatisticsReport:true } \ No newline at end of file