Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js =================================================================== diff -u -r33231 -r33239 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js (.../foreignTousseApplicationReport.js) (revision 33231) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js (.../foreignTousseApplicationReport.js) (revision 33239) @@ -1,17 +1,697 @@ var entityName = "外来器械申请单统计报表"; -var grid; -var apparatusInfuTypeStore; +var myMask; var formWindow; -function removeGridItem() { - var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为 - if (rows) { - for (var i = 0; i < rows.length; i++) { - apparatusInfuTypeStore.remove(rows[i]); +var formPanel; +var customTimePeriodStore; +var searchCustomTimePeriodStore; +var enableShowForeignTousseApplicationReportMaterials; +var is2Column = false; +var widthArr = []; + +//删除时间段 +function deleteCustomTimePeriod(id) { + top.Ext.Msg.confirm("删除确认", "是否要删除该记录?", function (btn) { + if (btn == 'yes') { + Ext.Ajax.request({ + url: WWWROOT + '/report/customTimePeriodReportAction!deleteCustomTimePeriod.do', + params: { id: id }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + var success = result.success; + if (success) { + customTimePeriodStore.load(); + searchCustomTimePeriodStore.load(); + showResult(result.message); + } + } + }); } + }) +} + +//保存自定义时间段 +function saveOrUpdateCustomTimePeriod() { + var topStartTime = top.Ext.getCmp('topStartTime').getValue(); + var topEndTime = top.Ext.getCmp('topEndTime').getValue(); + if (parseInt(topStartTime.split(':')[0]) > parseInt(topEndTime.split(':')[0])) { + showResult('开始时间不能大于结束时间'); + return; + } else if (parseInt(topStartTime.split(':')[0]) == parseInt(topEndTime.split(':')[0])) { + if (parseInt(topStartTime.split(':')[1]) > parseInt(topEndTime.split(':')[1])) { + showResult('开始时间不能大于结束时间'); + return; + } } + formPanel.form.submit({ + url: WWWROOT + '/report/customTimePeriodReportAction!saveOrUpdateCustomTimePeriod.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + timeout: 600000, + waitTitle: '提交表单', + success: function (form, action) { + showResult('保存成功'); + customTimePeriodStore.load(); + searchCustomTimePeriodStore.load(); + formWindow.close(); + }, + failure: function (form, action) { + if (action.result.msg) { + showResult(action.result.msg); + } else if (action.result.message) { + showResult(action.result.message); + } else { + showResult('保存失败'); + } + } + }); } -var myMask; -var enableShowForeignTousseApplicationReportMaterials; + +//编辑自定义时间段 +function editCustomTimePeriod(id, startTime, endTime, timePeriodName) { + var title = '添加时间段'; + if (id) { + title = '修改时间段'; + } + + formPanel = new top.Ext.FormPanel({ + id: 'editCustomTimePeriodFormPanel', + 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', + labelWidth: 70, + items: [{ + columnWidth: 1, + layout: 'form', + labelWidth: 80, + items: [{ + xtype: 'hidden', + id: 'id', + name: 'id', + value: id || '' + }, { + xtype: 'textfield', + fieldLabel: '名称', + maxLength: '41', + id: 'timePeriodName', + name: 'timePeriodName', + allowBlank: false, + value: timePeriodName, + anchor: '100%' + }, { + xtype: 'timefield', + fieldLabel: '开始时间', + id: 'topStartTime', + name: 'startTime', + format: 'H:i', + anchor: '100%', + allowBlank: false, + value: startTime, + emptyText: '时间格式如:05:30' + }, { + xtype: 'timefield', + fieldLabel: '结束时间', + id: 'topEndTime', + name: 'endTime', + format: 'H:i', + anchor: '100%', + allowBlank: false, + value: endTime, + emptyText: '时间格式如:05:30' + }] + }] + }] + }], + buttons: [{ + id: 'saveBtn', + text: '保存', + handler: function () { + if (formPanel.getForm().isValid()) { + saveOrUpdateCustomTimePeriod(); + } else { + showResult('请填写表单!'); + return false; + } + } + }, { + id: 'cancleBtn', + text: '取消', + handler: function () { + formWindow.close(); + } + }] + }); + + formWindow = new top.Ext.Window({ + id: 'editCustomTimePeriod', + layout: 'fit', + title: title, + width: 300, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [formPanel] + }); + + formWindow.show(); +} + +//显示自定义时间段的窗口 +function showCustomTimePeriodWin() { + customTimePeriodStore = new top.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' + }, { + name: 'startTime' + }, { + name: 'endTime' + }] + }) + }); + customTimePeriodStore.load(); + + var cm = new top.Ext.grid.ColumnModel([{ + id: 'name', + header: "名称", + width: 160, + dataIndex: 'timePeriodName' + }, { + id: 'timePeriod', + header: "时间段", + width: 160, + renderer: function (v, p, record) { + var startTime = record.data.startTime; + var endTime = record.data.endTime; + return startTime + ' - ' + endTime; + } + }, { + header: '操作', + width: 40, + menuDisabled: true, + renderer: function (v, p, record) { + var id = record.data.id; + var startTime = record.data.startTime; + var endTime = record.data.endTime; + var timePeriodName = record.data.timePeriodName; + var html = ''; + html += ''; + return html; + } + }]); + + var tbar = [{ + text: '添加', + handler: function () { + editCustomTimePeriod(); + } + }]; + + var formObj = new top.Ext.FormPanel({ + id: 'customTimePeriodFormPanel', + 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: [ + new top.Ext.grid.GridPanel({ + id: 'configGrid', + store: customTimePeriodStore, + tbar: tbar, + cm: cm, + width: 240, + height: 240, + isCheckboxSelectionModel: true, + frame: false, + viewConfig: { + forceFit: true + }, + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }) + }) + ] + }] + }] + }); + + var formWindow = new top.Ext.Window({ + id: 'customTimePeriod', + layout: 'fit', + title: '自定义时间段', + width: 620, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [formObj] + }); + + formWindow.show(); +} + +//获取表头列 +function getTableHeaderColumnArray(customColumnName1) { + var columnNameArray = [{ + name: '申请时间', + width: 120 + }, { + name: '接收时间', + width: 120 + }, { + name: '申请科室', + width: 70 + }]; + if (customColumnName1 !== '') { + columnNameArray.push({ + name: customColumnName1, + width: 90 + }) + } + columnNameArray.push({ + name: '住院号', + width: 80 + }, { + name: '病人姓名', + width: 70 + }, { + name: '床位', + width: 70 + }, { + name: '物品名称', + width: 200 + }); + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + columnNameArray.push({ + name: '材料明细', + width: 140 + }) + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + columnNameArray.push({ + name: '材料汇总', + width: 180 + }) + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + columnNameArray.push({ + name: '大小', + width: 120 + }) + } + columnNameArray.push({ + name: '灭菌包数量', + width: 70 + }, { + name: '价格', + width: 70 + }, { + name: '发货时间', + width: 120 + }, { + name: '供应商', + width: 140 + }, { + name: '外来器械包已使用', + width: 120 + }, { + name: '发货状态', + width: 60 + }, { + name: '手术医生', + width: 60 + }, { + name: '手术名称', + width: 140 + }, { + name: '申请人', + width: 60 + }, { + name: '处理方式', + width: 70 + }); + 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(customColumnName1) { + var html = ''; + var columnNameArray = getTableHeaderColumnArray(customColumnName1); + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials || sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += ''; + 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 += ''; + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + html += getHeadTd('工具', 60, 1, 1); + html += getHeadTd('植入物', 60, 1, 1); + html += getHeadTd('合计', 60, 1, 1); + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += getHeadTd('大包', 60, 1, 1); + html += getHeadTd('小包', 60, 1, 1); + } + html += ''; + is2Column = true; + } else { + var columnNameArray = getTableHeaderColumnArray(); + html += ''; + for (var i = 0; i < columnNameArray.length; i++) { + html += getHeadTd(columnNameArray[i].name, columnNameArray[i].width, 1, 1); + widthArr.push(columnNameArray[i].width); + } + html += ''; + } + return html; +} + +//获取表内容的html +function getTableBodyHtml(data, totalMaterialDetails, customColumnName1) { + var html = ''; + var sumTousseInstanceAmount = 0; + var sumPrice = 0; + var sumToolAmount = 0; + var sumImplantAmount = 0; + var resultSumCount = 0; + var sumPackageSizeBig = 0; + var sumPackageSizeSmall = 0; + for (var i = 0; i < data.length; i++) { + var tousseItems = data[i].tousseItems; + if (tousseItems.length > 1) { + for (var j = 0; j < tousseItems.length; j++) { + var itemName = tousseItems[j].itemName || ''; + var materialDetails = tousseItems[j].materialDetails || ''; + var tousseInstanceAmount = tousseItems[j].tousseInstanceAmount || 0; + tousseInstanceAmount = (tousseInstanceAmount == 0) ? '' : tousseInstanceAmount; + var price = tousseItems[j].price || ''; + var newPrice = ''; + if (itemName !== '' && price == '') { + newPrice = parseFloat(0).toFixed(2); + } else if (itemName !== '' && price !== '') { + newPrice = parseFloat(price).toFixed(2); + } + var invoiceSendTimeStr = tousseItems[j].invoiceSendTimeStr || ''; + var supplierName = tousseItems[j].supplierName || ''; + var used = tousseItems[j].used || ''; + var packageSize = tousseItems[j].packageSize || ''; + var packageSizeBig = ''; + var packageSizeSmall = ''; + if (packageSize == '大包') { + packageSizeBig = 1; + } else if (packageSize == '小包') { + packageSizeSmall = 1 + } + + var toolAmount = tousseItems[j].toolAmount || 0; + var implantAmount = tousseItems[j].implantAmount || 0; + var sumCount = parseInt(toolAmount) + parseInt(implantAmount); + + if (price !== '') { + sumPrice += price; + } + if (tousseInstanceAmount !== '') { + sumTousseInstanceAmount += tousseInstanceAmount; + } + if (packageSizeBig !== '') { + sumPackageSizeBig += parseInt(packageSizeBig) + } + if (packageSizeSmall !== '') { + sumPackageSizeSmall += parseInt(packageSizeSmall) + } + sumToolAmount += parseInt(toolAmount); + sumImplantAmount += parseInt(implantAmount); + resultSumCount += parseInt(sumCount); + + var receiveTimeStr = (data[i].receiveTimeStr == null) ? '' : data[i].receiveTimeStr; + + if (j == 0) { + html += ''; + html += getBodyTd(data[i].applicationTimeStr, tousseItems.length, 1); + html += getBodyTd(receiveTimeStr, tousseItems.length, 1); + html += getBodyTd(data[i].depart, tousseItems.length, 1); + if (customColumnName1 !== '') { + html += getBodyTd(data[i].ascriptionDepartment, tousseItems.length, 1); + } + html += getBodyTd(data[i].hospitalNumber, tousseItems.length, 1); + html += getBodyTd(data[i].patient, tousseItems.length, 1); + html += getBodyTd(data[i].bedNumber, tousseItems.length, 1); + html += getBodyTd(itemName, 1, 1, '#EAFFFF'); + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + html += getBodyTd(materialDetails, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + html += getBodyTd(toolAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(implantAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(sumCount, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += getBodyTd(packageSizeBig, 1, 1, '#EAFFFF'); + html += getBodyTd(packageSizeSmall, 1, 1, '#EAFFFF'); + } + html += getBodyTd(tousseInstanceAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(newPrice, 1, 1, '#EAFFFF'); + html += getBodyTd(invoiceSendTimeStr, 1, 1, '#EAFFFF'); + html += getBodyTd(supplierName, 1, 1, '#EAFFFF'); + html += getBodyTd(used, 1, 1, '#EAFFFF'); + html += getBodyTd(data[i].deliverStatus, tousseItems.length, 1); + html += getBodyTd(data[i].doctor, tousseItems.length, 1); + html += getBodyTd(data[i].surgery, tousseItems.length, 1); + html += getBodyTd(data[i].applicant, tousseItems.length, 1); + html += getBodyTd(data[i].processType, tousseItems.length, 1); + html += ''; + } else { + html += ''; + html += getBodyTd(itemName, 1, 1, '#EAFFFF'); + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + html += getBodyTd(materialDetails, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + html += getBodyTd(toolAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(implantAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(sumCount, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += getBodyTd(packageSizeBig, 1, 1, '#EAFFFF'); + html += getBodyTd(packageSizeSmall, 1, 1, '#EAFFFF'); + } + html += getBodyTd(tousseInstanceAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(newPrice, 1, 1, '#EAFFFF'); + html += getBodyTd(invoiceSendTimeStr, 1, 1, '#EAFFFF'); + html += getBodyTd(supplierName, 1, 1, '#EAFFFF'); + html += getBodyTd(used, 1, 1, '#EAFFFF'); + html += ''; + } + } + } else { + var itemName = tousseItems[0].itemName || ''; + var materialDetails = tousseItems[0].materialDetails || ''; + var tousseInstanceAmount = tousseItems[0].tousseInstanceAmount || 0; + tousseInstanceAmount = (tousseInstanceAmount == 0) ? '' : tousseInstanceAmount; + var price = tousseItems[0].price || ''; + var newPrice = ''; + if (itemName !== '' && price == '') { + newPrice = parseFloat(0).toFixed(2); + } else if (itemName !== '' && price !== '') { + newPrice = parseFloat(price).toFixed(2); + } + + var invoiceSendTimeStr = tousseItems[0].invoiceSendTimeStr || ''; + var supplierName = tousseItems[0].supplierName || ''; + var used = tousseItems[0].used || ''; + var packageSize = tousseItems[0].packageSize || ''; + var packageSizeBig = ''; + var packageSizeSmall = ''; + if (packageSize == '大包') { + packageSizeBig = 1; + } else if (packageSize == '小包') { + packageSizeSmall = 1 + } + + var toolAmount = tousseItems[0].toolAmount || 0; + var implantAmount = tousseItems[0].implantAmount || 0; + var sumCount = parseInt(toolAmount) + parseInt(implantAmount); + + if (tousseInstanceAmount !== '') { + sumTousseInstanceAmount += tousseInstanceAmount; + } + if (price !== '') { + sumPrice += price; + } + if (packageSizeBig !== '') { + sumPackageSizeBig += parseInt(packageSizeBig) + } + if (packageSizeSmall !== '') { + sumPackageSizeSmall += parseInt(packageSizeSmall) + } + sumToolAmount += parseInt(toolAmount); + sumImplantAmount += parseInt(implantAmount); + resultSumCount += parseInt(sumCount); + + var receiveTimeStr = (data[i].receiveTimeStr == null) ? '' : data[i].receiveTimeStr; + + html += ''; + html += getBodyTd(data[i].applicationTimeStr, 1, 1); + html += getBodyTd(receiveTimeStr, 1, 1); + html += getBodyTd(data[i].depart, 1, 1); + if (customColumnName1 !== '') { + html += getBodyTd(data[i].ascriptionDepartment, 1, 1); + } + html += getBodyTd(data[i].hospitalNumber, 1, 1); + html += getBodyTd(data[i].patient, 1, 1); + html += getBodyTd(data[i].bedNumber, 1, 1); + html += getBodyTd(itemName, 1, 1, '#EAFFFF'); + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + html += getBodyTd(materialDetails, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + html += getBodyTd(toolAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(implantAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(sumCount, 1, 1, '#EAFFFF'); + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += getBodyTd(packageSizeBig, 1, 1, '#EAFFFF'); + html += getBodyTd(packageSizeSmall, 1, 1, '#EAFFFF'); + } + html += getBodyTd(tousseInstanceAmount, 1, 1, '#EAFFFF'); + html += getBodyTd(newPrice, 1, 1, '#EAFFFF'); + html += getBodyTd(invoiceSendTimeStr, 1, 1, '#EAFFFF'); + html += getBodyTd(supplierName, 1, 1, '#EAFFFF'); + html += getBodyTd(used, 1, 1, '#EAFFFF'); + html += getBodyTd(data[i].deliverStatus, 1, 1); + html += getBodyTd(data[i].doctor, 1, 1); + html += getBodyTd(data[i].surgery, 1, 1); + html += getBodyTd(data[i].applicant, 1, 1); + html += getBodyTd(data[i].processType, 1, 1); + html += ''; + } + } + //合计 + html += ''; + html += getBodyTd('合计', 1, 1); + if (customColumnName1 !== '') { + html += getBodyTd('', 1, 7); + } else { + html += getBodyTd('', 1, 6); + } + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + html += getBodyTd(totalMaterialDetails, 1, 1); + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + html += getBodyTd('' + sumToolAmount + '', 1, 1); + html += getBodyTd('' + sumImplantAmount + '', 1, 1); + html += getBodyTd('' + resultSumCount + '', 1, 1); + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + html += getBodyTd('' + sumPackageSizeBig + '', 1, 1); + html += getBodyTd('' + sumPackageSizeSmall + '', 1, 1); + } + html += getBodyTd('' + sumTousseInstanceAmount + '', 1, 1); + html += getBodyTd('' + ((sumPrice == 0) ? "0.00" : sumPrice) + '', 1, 1); + html += getBodyTd('', 1, 8); + html += ''; + return html; +} + +//获取表格html +function getTableHtml(result) { + var tableWidth = 1730; + if (sstsConfig.enableShowForeignTousseApplicationReportMaterials) { + tableWidth += 140; + } + if (sstsConfig.enableShowForeignTousseApplicationReportSummaryOfMaterials) { + tableWidth += 180; + } + if (sstsConfig.enableTheSizeDisplayOfTheForeignTousseApplicationReport) { + tableWidth += 120; + } + var totalMaterialDetails = ''; + var customColumnName1 = ''; + if (result.parametMap) { + totalMaterialDetails = result.parametMap.totalMaterialDetails || ''; + customColumnName1 = result.parametMap.customColumnName1 || ''; + } + var html = ""; + html += ""; + html += getTableHeadHtml(customColumnName1); + html += ""; + html += ""; + html += getTableBodyHtml(result.data, totalMaterialDetails, customColumnName1); + html += ""; + html += "
"; + return html; +} + +function exportExcel(data, thisID) { + var fileName = data.fileName + data.fileType; + if (isIE()) { + 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(); + exportMask.hide(); + } else { + XSExport.excelExport( + thisID, + data.fileName, + is2Column, + widthArr + ); + exportMask.hide(); + } +} + Ext.onReady(function () { Ext.QuickTips.init(); if (sstsConfig.hasOwnProperty('enableShowForeignTousseApplicationReportMaterials') && sstsConfig.enableShowForeignTousseApplicationReportMaterials) { @@ -28,6 +708,7 @@ // var goodsName = $Id('goodsSearch').value; var departOfPatient = $Id('departOfPatient').value; var companyName = $Id('companyName').value; + var customTimePeriodId = Ext.getCmp('customTimePeriodId').getValue(); var goodsName = ''; var noDisplayTerminatedIPValue = $Id('noDisplayTerminatedIP').value; var noDisplayTerminatedIP = true; @@ -57,15 +738,9 @@ removeMask: true }); myMask.show(); - var jasperreportName; - if (enableShowForeignTousseApplicationReportMaterials) { - jasperreportName = 'foreignTousseApplicationShowMaterialsReport.jasper'; - } else { - jasperreportName = 'foreignTousseApplicationReport.jasper'; - } - var url = WWWROOT + '/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do'; + + var url = WWWROOT + '/jasperreports/jasperreportsAction!queryDataSourceList.do'; var params = { - jasperreportName: jasperreportName, startDay: startTime, endDay: endTime, deptName: deptName, @@ -79,11 +754,26 @@ showNoInvoie: showNoInvoie, foreignTousseName: foreignTousseName, timeType: timeType, + customTimePeriodId: customTimePeriodId, used: used, reportName: 'foreignTousseApplicationReport' } - - searchReport(url, params); + Ext.Ajax.request({ + url: url, + async: false, + params: params, + success: function (response) { + var result = Ext.decode(response.responseText); + var title = '外来器械申请单统计报表(' + startTime + '至' + endTime + ')'; + var tableHtml = "

" + title + "

"; + tableHtml += getTableHtml(result) + document.getElementById('thisIframe').contentWindow.document.getElementById('table').innerHTML = tableHtml; + myMask.hide(); + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); } var dt = new Date(); @@ -131,7 +821,6 @@ }); //材料名称store var materialStore; - var formHigth; if (enableShowForeignTousseApplicationReportMaterials) { materialStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ @@ -148,25 +837,20 @@ { name: 'isImplant', mapping: 'isImplant' } ]) }); - formHigth = 180; - } else { - formHigth = 153; } - var tousseAndDiposableGoodsStore = new Ext.data.Store({ + //时间段 + searchCustomTimePeriodStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ - url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchInsideTousseAndDiposableGoods.do?showUnAppDiposableGoods=true', + url: WWWROOT + '/report/customTimePeriodReportAction!queryAllCustomTimePeriod.do', method: 'POST' }), reader: new Ext.data.JsonReader({ - totalProperty: 'totalCount', - root: 'data' - }, [ - { name: 'id', mapping: 'id' }, - { name: 'spelling', mapping: 'spelling' }, - { name: 'name', mapping: 'name' }, - { name: 'displayName', mapping: 'displayName' }, - { name: 'amount', mapping: 'amount' }] - ) + fields: [{ + name: 'id' + }, { + name: 'timePeriodName' + }] + }) }); var form = new Ext.form.FormPanel({ @@ -180,7 +864,7 @@ border: 0, frame: true, bodyStyle: 'padding:0px auto;margin:0px',// padding:1px;padding-top:5px; - height: formHigth, + height: 180, items: [{ layout: 'column', height: 150, @@ -201,7 +885,7 @@ displayField: 'value', store: new Ext.data.SimpleStore({ fields: ['value'], - data: [['接收时间'], ['发货时间']] + data: [['接收时间'], ['发货时间'], ['申请时间']] }), forceSelection: true, value: '接收时间', @@ -478,6 +1162,28 @@ typeAhead: false, allowBlank: true }] + }, { + columnWidth: .25, + 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 + }] }] }], buttons: [{ @@ -496,13 +1202,20 @@ handler: function () { $Id('startTime').value = ""; $Id('endTime').value = ""; - // $Id('goodsSearch').value = ""; $Id('departSearch').value = ""; $Id('patientName').value = ""; $Id('deliverStatus').value = ""; $Id('departOfPatient').value = ""; $Id('companyName').value = ""; } + }, { + xtype: 'button', + text: '自定义时间段', + iconCls: 'icon_set', + minWidth: 100, + handler: function () { + showCustomTimePeriodWin(); + } }] }); @@ -512,8 +1225,31 @@ autoScroll: true,//自动显示滚动条 collapsible: true,//允许展开和收缩 bodyPadding: 5, - html: '' - + tbar: [{ + text: '导出', + handler: function () { + var html = document.getElementById('thisIframe').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", + html: html + } + exportMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在导出文件,请稍候!', + removeMask: true + }); + exportMask.show(); + setTimeout(function () { + exportExcel(data, document.getElementById('thisIframe').contentWindow.document.getElementById('table')); + }, 1000); + } + } + }], + html: '' }); var viewport = new Ext.Viewport({ Index: ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js =================================================================== diff -u -r33238 -r33239 --- ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js (.../config.js) (revision 33238) +++ ssts-web/src/main/webapp/disinfectsystem/config/zjyy/config.js (.../config.js) (revision 33239) @@ -194,5 +194,9 @@ //开启外来器械包申请单统计报表材料显示 enableShowForeignTousseApplicationReportMaterials:true, //外来器械包自定义入筐时显示大小属性 - displayTheSizeAttributeOfTheForeignTousseWhenCustomIntoBasket:true + displayTheSizeAttributeOfTheForeignTousseWhenCustomIntoBasket:true, + //开启外来器械申请单统计报表材料汇总显示 + enableShowForeignTousseApplicationReportSummaryOfMaterials:true, + //开启外来器械申请单统计报表大小显示 + enableTheSizeDisplayOfTheForeignTousseApplicationReport:true } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp =================================================================== diff -u -r31146 -r33239 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp (.../foreignTousseApplicationReport.jsp) (revision 31146) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp (.../foreignTousseApplicationReport.jsp) (revision 33239) @@ -19,19 +19,27 @@ request.setAttribute("supplyRoomType",supplyRoomType); %> - - - + + + + + + + + + + +