Index: ssts-web/src/main/webapp/js/commonUtils.js =================================================================== diff -u -r41272 -r41305 --- ssts-web/src/main/webapp/js/commonUtils.js (.../commonUtils.js) (revision 41272) +++ ssts-web/src/main/webapp/js/commonUtils.js (.../commonUtils.js) (revision 41305) @@ -27,8 +27,21 @@ } } -function getContentWindowId(id) { - return top.document.getElementById('iframeForm').contentWindow.document.getElementById(id) +function getContentWindowId() { + var ids = ['addQualityMonitoringForm', 'addRoutineMonitoringForm', 'recallRecordForm']; + var dom = top.document.getElementById('iframeForm').contentWindow.document; + var returnResult = ''; + for (var i = 0; i < ids.length; i++) { + if (dom.getElementById(ids[i])) { + returnResult = ids[i]; + break; + } + } + if (returnResult == '') { + return false + } else { + return dom.getElementById(returnResult); + } } //ZSRY-60:form表单显示在iframe(可以通用) @@ -62,7 +75,7 @@ render: function (v) { if (callBack) { var timeout = setInterval(function () { - if (getContentWindowId('addQualityMonitoringForm') || getContentWindowId('addRoutineMonitoringForm')) { + if (getContentWindowId()) { clearInterval(timeout); callBack(top.document.getElementById('iframeForm').contentWindow); }