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 = '
" + 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); %> - - - + + + + + + + + + + +