| <apex:page controller="InsReportPDFOuterController" showHeader="false" sidebar="false" action="{!init}" applyHtmlTag="false" id="Page"> | 
| <head> | 
| <meta name="viewport" content="width=860,user-scalable=yes" /> | 
| <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> | 
| <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> | 
| <apex:includeScript value="{!URLFOR($Resource.signaturePadMinJs)}"/> | 
| <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> | 
|   | 
| <script type="text/javascript"> | 
| var signaturePad; | 
| function signCanvas() { | 
|     j$(escapeVfId('Page:Form:outputCanvas')).hide(); | 
|     j$(escapeVfId('myCanvas')).show(); | 
|     j$(escapeVfId('myCanvas')).css("pointer-events",""); | 
|     j$(escapeVfId('myCanvas')).css("background-color",""); | 
|     signaturePad.clear(); | 
| } | 
|   | 
| function bolckCanvas() { | 
|     blockme(); | 
|     saveSignfunc(signaturePad.toDataURL()); | 
| } | 
| </script> | 
| <title>{!ir.Name}</title> | 
| </head> | 
|     <apex:form id="Form"> | 
|         <iframe src="/apex/InsReportPDF?id={!URLENCODE(ir.Id)}" scrolling="true" width="100%;" height="450px;"></iframe> | 
|          | 
|         <apex:actionFunction name="saveSignfunc" action="{!saveSign}" rerender="Form" onComplete="savePDF();"> | 
|             <apex:param name="firstParam" assignTo="{!signStr}" value="" /> | 
|         </apex:actionFunction> | 
|          | 
|         <apex:actionFunction name="savePDF" action="{!savePDF}" rerender="Form" onComplete="location.href='/apex/OFSInsReportLayout?id={!URLENCODE(ir.Id)}';return false;" /> | 
|          | 
|         <div style="float:right;"> | 
|             <apex:outputPanel layout="none" rendered="{!ir.ResponsiblePerson_Sign__c == null}"> | 
|                 <div id="myCanvas_div" style="border:1px solid #000000; width:300px; height:150px;"><apex:outputField Id="outputCanvas" value="{!ir.ResponsiblePerson_Sign__c}" /></div> | 
|             </apex:outputPanel> | 
|             <br/> | 
|             <!-- update by rentx 20210913 start --> | 
|             <!-- <input type="button" value="返回" onclick="location.href='/apex/OFSInsReportLayout?id={!URLENCODE(ir.Id)}';return false;" style="width:100px"/> --> | 
|             <apex:outputText rendered="{!isVm == 'FALSE'}"> | 
|                 <input type="button" value="返回" onclick="location.href='/apex/OFSInsReportLayout?id={!URLENCODE(ir.Id)}';return false;" style="width:100px"/> | 
|             </apex:outputText> | 
|             <apex:outputText rendered="{!isVm == 'TRUE'}"> | 
|                 <input type="button" value="返回" onclick="location.href='/apex/OFSInsReportLayoutForVm?id={!URLENCODE(ir.Id)}';return false;" style="width:100px"/> | 
|             </apex:outputText> | 
|             <!-- update by rentx 20210913 end --> | 
|             <apex:outputPanel layout="none" rendered="{!ir.ResponsiblePerson_Sign__c == null}"> | 
|                 <input type="button" value="签字" onclick="signCanvas();return false;" style="width:100px"/> | 
|                 <input type="button" value="确认并上传" onclick="bolckCanvas();" style="width:100px"/> | 
|             </apex:outputPanel> | 
|         </div> | 
| <script type="text/javascript"> | 
| jQuery(document).ready(function() { | 
|     j$(escapeVfId('myCanvas_div')).append("<canvas id='myCanvas' width='300px' height='150px'></canvas>"); | 
|     var canvas = j$(escapeVfId('myCanvas'))[0]; | 
|     signaturePad = new SignaturePad(canvas); | 
|     j$(escapeVfId('myCanvas')).css("pointer-events","none"); | 
|     //if ('{!ir.ResponsiblePerson_Sign__c}' != null && '{!ir.ResponsiblePerson_Sign__c}' != '') { | 
|         j$(escapeVfId('myCanvas')).hide(); | 
|     //} else { | 
|     //    j$(escapeVfId('myCanvas')).css("background-color","rgba(0, 0, 0, 0.06)"); | 
|     //} | 
|      | 
|     var rt = document.getElementsByClassName('sfdc_richtext')[0]; | 
|     rt.style.width = "300px"; | 
|     rt.style.height = "150px"; | 
| }); | 
| </script> | 
|     </apex:form> | 
| </apex:page> |