<apex:page controller="OFSRepairConsignPDFOuterController" showHeader="false" sidebar="false" action="{!init}" applyHtmlTag="false" id="Page">
|
<head>
|
<meta name="viewport" content="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)}"/>
|
|
<style type="text/css">
|
.ifrm-container {
|
overflow:auto;
|
-webkit-overflow-scrolling:touch;
|
height:800px;
|
}
|
.ifrm {
|
width:100%;
|
height: 80%;
|
border:none;
|
}
|
</style>
|
|
<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());
|
}
|
|
function finishAlert() {
|
alert("已签字完毕");
|
location.href='/apex/OFSWindowClose';
|
}
|
</script>
|
<title>{!rp.Name}</title>
|
</head>
|
<apex:form id="Form">
|
<div class="ifrm-container">
|
<iframe src="/apex/OFSRepairConsignPDF?id={!
|
URLENCODE(rp.Id)}" scrolling="true" width="100%;" class="ifrm"></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="finishAlert();return false;" />
|
|
<div style="float:right;">
|
<apex:outputPanel layout="none" rendered="{!rp.Sign__c == null}">
|
<div id="myCanvas_div" style="border:1px solid #000000; width:300px; height:150px;"><apex:outputField Id="outputCanvas" value="{!rp.Sign__c}" /></div>
|
</apex:outputPanel>
|
<br/>
|
<!-- <input type="button" value="返回" onclick="location.href='/apex/OFSInsReportLayout?id={!rp.Id}';return false;" style="width:100px"/> -->
|
<apex:outputPanel layout="none" rendered="{!rp.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 ('{!rp.Sign__c}' != null && '{!rp.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>
|
</div>
|
</apex:form>
|
</apex:page>
|