Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/js/customTimePeriod.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/reportforms/js/customTimePeriod.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/js/customTimePeriod.js (revision 33244) @@ -0,0 +1,270 @@ +var formWindow; +var formPanel; +var customTimePeriodStore; + +//删除时间段 +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('保存失败'); + } + } + }); +} + +//编辑自定义时间段 +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(); +} \ No newline at end of file Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r32934 -r33244 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 32934) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 33244) @@ -4391,4 +4391,38 @@ } else { callback(''); } +} + +/** + * 导出报表,需要引入几个文件 + * xlsx.core.min.js + * xlsxStyle.core.min.js + * xlsxStyle.utils.js + * xlsxExport.utils.js + * 兼容IE + * LZString.js + */ +function exportExcel(data, thisID, is2Column, widthArr) { + 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 || false, + widthArr || [] + ); + exportMask.hide(); + } } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js =================================================================== diff -u -r33239 -r33244 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js (.../foreignTousseApplicationReport.js) (revision 33239) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.js (.../foreignTousseApplicationReport.js) (revision 33244) @@ -1,280 +1,10 @@ var entityName = "外来器械申请单统计报表"; var myMask; -var formWindow; -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('保存失败'); - } - } - }); -} - -//编辑自定义时间段 -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 = [{ @@ -667,31 +397,6 @@ 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) { @@ -1244,7 +949,7 @@ }); exportMask.show(); setTimeout(function () { - exportExcel(data, document.getElementById('thisIframe').contentWindow.document.getElementById('table')); + exportExcel(data, document.getElementById('thisIframe').contentWindow.document.getElementById('table'), is2Column, widthArr); }, 1000); } } Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp =================================================================== diff -u -r33239 -r33244 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp (.../foreignTousseApplicationReport.jsp) (revision 33239) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/foreignTousseApplicationReport.jsp (.../foreignTousseApplicationReport.jsp) (revision 33244) @@ -34,67 +34,22 @@ - - - - - - + - - - 外来器械申请单统计报表 - - - - -
-
-
- \ No newline at end of file