Index: ssts-web/src/main/webapp/homepage/portalPage.js
===================================================================
diff -u -r15564 -r15698
--- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 15564)
+++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 15698)
@@ -3,6 +3,8 @@
var reviewPackingMenu ;
var sterilizationRecordMenu ;
var tabs; //tabPanel
+//tips提示的元素,在addIconTips()方法中添加
+var tipsEle = [];
function setTaskGroup(taskGroup){
packingMenu = new Ext4.menu.Menu({
@@ -93,6 +95,33 @@
}
});*/
}
+
+/**
+ * 为桌面图标添加显示数量提示
+ * @param amount 对应的数量
+ * @param domObj 图标的dom节点
+ * @param tipId 图标dom节点的id
+ * @param showTipsFn 要显示的方法 (用于下面的满意度调查数字提醒)
+ * @param domIsDisplay 是否隐藏 (用于下面的满意度调查数字提醒)
+ */
+function addIconTips(amount,domObj,tipId,showTipsFn,domIsDisplay) {
+ if (!isUndefinedOrNullOrEmpty(amount)){
+ amount = amount > 0 && amount < 11 ? amount : '10+';
+ insertHtml('
');
+ if (showTipsFn){
+ showTipsFn();
+ }
+ }
+ else{
+ if (domIsDisplay){
+ //否则隐藏
+ domObj.style.display = "none";
+ }
+ }
+ tipsEle.push(tipId);
+}
+
+
//window.onload start
Ext4.onReady(function(){
//屏蔽回退键,防止点击backspace键时,浏览器后退
@@ -225,51 +254,63 @@
var satisfactionSurveyTableObj = document.getElementById('satisfactionSurveyTable');
if(satisfactionSurveyTableObj){
//给个人桌面图标添加入iphone风格的数字提示信息
- DWREngine.setAsync(false);
- SatisfactionSurveyTemplateTableManager.loadSatisfactionSurveyTemplateNoticeNum(function (amount){
- if(amount>0 && amount<11){
- insertHtml('');
- showSatisfactionSurveyWinTips();
- }else if(amount >= 11){
- insertHtml('');
- showSatisfactionSurveyWinTips();
- }else{
- //否则隐藏
- satisfactionSurveyTableObj.style.display = "none";
- }
- });
- DWREngine.setAsync(true);
+ // DWREngine.setAsync(false);
+ // SatisfactionSurveyTemplateTableManager.loadSatisfactionSurveyTemplateNoticeNum(function (amount){
+ // if(amount>0 && amount<11){
+ // insertHtml('');
+ // showSatisfactionSurveyWinTips();
+ // }else if(amount >= 11){
+ // insertHtml('');
+ // showSatisfactionSurveyWinTips();
+ // }else{
+ // //否则隐藏
+ // satisfactionSurveyTableObj.style.display = "none";
+ // }
+ // });
+ // DWREngine.setAsync(true);
+ sendDWRAsync(function () {
+ SatisfactionSurveyTemplateTableManager.loadSatisfactionSurveyTemplateNoticeNum(function(amount){
+ addIconTips(amount,satisfactionSurveyTableObj,'satisfactionSurveyTableTip',showSatisfactionSurveyWinTips,true);
+ });
+ })
}
//科室问题反馈,显示待回复的数量
var problemReport = document.getElementById('problemReport');
if(problemReport && isShowTipNumber =='true'){
//给个人桌面图标添加入iphone风格的数字提示信息
- DWREngine.setAsync(false);
- ProblemTableManager.getUnAnsweredQuestion(function (amount){
- if(amount > 0 && amount < 11){
- insertHtml('');
- }else if(amount >= 11){
- insertHtml('');
- }
+ sendDWRAsync(function () {
+ ProblemTableManager.getUnAnsweredQuestion(function(amount){
+ addIconTips(amount,problemReport,'problemReportTip');
+ });
});
- DWREngine.setAsync(true);
}
//科室问题反馈,显示待回复的数量--结束
-
+
+ //发货计划管理
var invoicePlanObj = document.getElementById('invoicePlan');
if(invoicePlanObj){
- //给个人桌面图标添加入iphone风格的数字提示信息
- DWREngine.setAsync(false);
- InvoicePlanTableManager.getUnfinishedInvoicePlanAmount(function(amount){
- if(amount>0 && amount<11){
- insertHtml('');
- }else if(amount >= 11){
- insertHtml('');
- }
+ sendDWRAsync(function () {
+ InvoicePlanTableManager.getUnfinishedInvoicePlanAmount(function(amount){
+ addIconTips(amount,invoicePlanObj,'invoicePlanTip');
+ });
});
- DWREngine.setAsync(true);
}
+
+ //借物管理
+ var borrowManagerObj = document.getElementById('borrowManager');
+ if(borrowManagerObj){
+ sendDWRAsync(function () {
+ BorrowRecordTableManager.findAwaitDeliverInvoicePlanAmount(function(amount){
+ if (amount == -1){
+ alert("借物管理查询待发货数量发生异常!");
+ }
+ else {
+ addIconTips(amount,borrowManagerObj,'borrowManagerTip');
+ }
+ });
+ });
+ }
var store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : WWWROOT + '/disinfectSystem/recallRecordAction!getRecallRecord.do',
@@ -692,19 +733,21 @@
function onTabChange(title){
//控制红色数字提醒的显示和隐藏
if(title == personalDesktopTitle){
- showElement('invoicePlanTip');
- showElement('problemReportTip');
- showElement('satisfactionSurveyTableTip');
- /*$('#invoicePlanTip').show();
- $('#problemReportTip').show();
- $('#satisfactionSurveyTableTip').show();*/
+ // showElement('invoicePlanTip');
+ // showElement('problemReportTip');
+ // showElement('satisfactionSurveyTableTip');
+ // showElement('borrowManagerTip');
+ Ext.each(tipsEle,function (item) {
+ showElement(item);
+ });
}else{
- hideElement('invoicePlanTip');
- hideElement('problemReportTip');
- hideElement('satisfactionSurveyTableTip');
- /*$('#invoicePlanTip').hide();
- $('#problemReportTip').hide();
- $('#satisfactionSurveyTableTip').hide();*/
+ // hideElement('invoicePlanTip');
+ // hideElement('problemReportTip');
+ // hideElement('satisfactionSurveyTableTip');
+ // hideElement('borrowManagerTip');
+ Ext.each(tipsEle,function (item) {
+ hideElement(item);
+ });
}
//选择tab 则显示该tab所对应打开的页面,其他页面隐藏上一个页面