Index: ssts-web/src/main/webapp/homepage/portalPage.js
===================================================================
diff -u -r16579 -r16584
--- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 16579)
+++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 16584)
@@ -133,60 +133,63 @@
}
+/**
+ * 开启生物监测结束后的提示功能
+ * @param userName
+ * @param currentDepartCode
+ */
function runBiologicalMonitoringWarning(userName, currentDepartCode) {
- setInterval(function() {
- Ext4.Ajax.request({
- url : WWWROOT + '/disinfectSystem/biologyMonitorWarningAction!getBiologyMonitorWarning.do',
- params : {userName : userName, currentDepartCode : currentDepartCode},
- success : function(response, options) {
- var result = Ext4.decode(response.responseText, true); // 此处返回的有可能不是json字符串,因为注销之后,会被acegi拦截,返回html
- if(result && result.length > 0){
- if (!biologicalMonitoringWarningWindow) {
- biologicalMonitoringWarningGrid = new Ext.grid.GridPanel({
- store: new Ext.data.Store({
- data : result,
- reader : new Ext.data.JsonReader({
- fields : ["name", "frequency", "biologicalMonitoringEndDate", "endDate"]
- })
- }),
- columns: [
- {header: "灭菌炉名称", width: 190, dataIndex: 'name',renderer : function(v, p, record) {
- return ""+v+"";
- }},
- {header: "炉次", width: 50,dataIndex: 'frequency'},
- {header: "灭菌结束时间", width: 150,dataIndex: 'endDate'},
- {header: "生物监测结束时间", width: 150,dataIndex: 'biologicalMonitoringEndDate'}
- ],
- stripeRows: true,
- viewConfig: {
- forceFit:true
- },
- height:200
- });
-
- biologicalMonitoringWarningWindow = new Ext.Window({
- autoHeight:true,
- title : '以下灭菌记录的生物监测已结束',
- width:500,
- draggable:true,
- modal:true,
- closeAction:'hide',
- items:[biologicalMonitoringWarningGrid]
- });
- biologicalMonitoringWarningWindow.show();
- } else {
- if (biologicalMonitoringWarningWindow.isVisible()) { //前一个窗口用户还没关闭,就追加数据
- biologicalMonitoringWarningGrid.store.loadData(result, true);
- } else { //前一个窗口用户关闭了,(其实是隐藏了,下次要用时不用重新new直接show更加快速),这时就不要追加了
- biologicalMonitoringWarningGrid.store.loadData(result);
- biologicalMonitoringWarningWindow.show();
- }
+ Ext4.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/biologyMonitorWarningAction!getBiologyMonitorWarning.do',
+ params : {userName : userName, currentDepartCode : currentDepartCode},
+ success : function(response, options) {
+ var result = Ext4.decode(response.responseText, true); // 此处返回的有可能不是json字符串,因为注销之后,会被acegi拦截,返回html
+ if(result && result.length > 0){
+ if (!biologicalMonitoringWarningWindow) {
+ biologicalMonitoringWarningGrid = new Ext.grid.GridPanel({
+ store: new Ext.data.Store({
+ data : result,
+ reader : new Ext.data.JsonReader({
+ fields : ["name", "frequency", "biologicalMonitoringEndDate", "endDate"]
+ })
+ }),
+ columns: [
+ {header: "灭菌炉名称", width: 190, dataIndex: 'name',renderer : function(v, p, record) {
+ return ""+v+"";
+ }},
+ {header: "炉次", width: 50,dataIndex: 'frequency'},
+ {header: "灭菌结束时间", width: 150,dataIndex: 'endDate'},
+ {header: "生物监测结束时间", width: 150,dataIndex: 'biologicalMonitoringEndDate'}
+ ],
+ stripeRows: true,
+ viewConfig: {
+ forceFit:true
+ },
+ height:200
+ });
+
+ biologicalMonitoringWarningWindow = new Ext.Window({
+ autoHeight:true,
+ title : '以下灭菌记录的生物监测已结束',
+ width:500,
+ draggable:true,
+ modal:true,
+ closeAction:'hide',
+ items:[biologicalMonitoringWarningGrid]
+ });
+ biologicalMonitoringWarningWindow.show();
+ } else {
+ if (biologicalMonitoringWarningWindow.isVisible()) { //前一个窗口用户还没关闭,就追加数据
+ biologicalMonitoringWarningGrid.store.loadData(result, true);
+ } else { //前一个窗口用户关闭了,(其实是隐藏了,下次要用时不用重新new直接show更加快速),这时就不要追加了
+ biologicalMonitoringWarningGrid.store.loadData(result);
+ biologicalMonitoringWarningWindow.show();
}
- }
- }
- });
- }, 60000);
+ }
+ }
+ }
+ });
}
@@ -277,7 +280,8 @@
showUpToNeckSatisfactionSurveyWinTips();
if (sstsConfig.biologicalMonitoringWarning && currentOrgUnitIsFirstSupplyRoom) { //开启生物监测结束后的提示功能,目前只开发给当前科室为一级供应室的用户
- runBiologicalMonitoringWarning(name, currentDepartCode);
+ runBiologicalMonitoringWarning(name, currentDepartCode); //因为定时器会滞后60秒才开始,所以这里先运行一次
+ setInterval('runBiologicalMonitoringWarning(name, currentDepartCode)', 60000);
}
var packingImg = getById('packingImg');