| | |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/> |
| | | <style type="text/css"> |
| | |
| | | } |
| | | </style> |
| | | <script> |
| | | let isBlocking = false; |
| | | function b(){ |
| | | if (!isBlocking) { |
| | | isBlocking = true; |
| | | blockme(); |
| | | } |
| | | } |
| | | |
| | | function ub(){ |
| | | if (isBlocking) { |
| | | isBlocking = false; |
| | | unblockUI(); |
| | | } |
| | | } |
| | | |
| | | function formSubmit(){ |
| | | testFile(); |
| | |
| | | var memberEmailId = "memberEmail"+lineNum; |
| | | j$(escapeVfId(memberNameId)).attr("value",memberName); |
| | | j$(escapeVfId(memberEmailId)).attr("value",memberEmail);*/ |
| | | addMemberData(lineNum,memberId,memberName,memberEmail); |
| | | // addMemberData(lineNum,memberId,memberName,memberEmail); |
| | | j$("#memberBody tr[line-id='"+lineNum+"'] input.emailAddress").val(memberEmail); |
| | | j$("#memberBody tr[line-id='"+lineNum+"'] input.name").val(memberName); |
| | | } |
| | | function statusChabge(linenumNum,type){ |
| | | var toId = "Page:messageForm:lineDataList:"+linenumNum+":"+"to"; |
| | |
| | | function openFile(){ |
| | | // alert('111111111'); |
| | | // uploadFileS(); |
| | | document.getElementById("file_input").value = ''; |
| | | popupBox.setTitle("请选择要上传的图片!"); |
| | | popupBox.importContentNode(document.getElementById("Page:messageForm:popupBox")); |
| | | popupBox.show(document.getElementById("Page:messageForm:popupBox")); |
| | |
| | | //dialog 弹窗 end |
| | | |
| | | //上传图片 |
| | | function saveAttachment(){ |
| | | var maxFileSize = 4350000; //Base64 编码以后最大的文件字节数 |
| | | var attachmentBody; //附件内容 |
| | | var attachmentName; //附件名称 |
| | | var attachmentType; //附件名称 |
| | | var attachmentSize; //附件大小 |
| | | var parentId = j$(escapeVfId("parentId")).value(); |
| | | // 获取上传图片的数量 |
| | | var size = document.getElementById("file_input").files.length; |
| | | if (size > 0) { |
| | | var nameList = []; |
| | | var typeList = []; |
| | | var bodyList = []; |
| | | for(var i = 0;i < size;i++){ |
| | | var fbody = document.getElementById("file_input").files[i]; |
| | | attachmentName = fbody.name; |
| | | if(fbody.size <= maxFileSize) { |
| | | attachmentType = fbody.type; |
| | | nameList.push(attachmentName); |
| | | typeList.push(attachmentType); |
| | | var fileReader = new FileReader(); |
| | | fileReader.readAsBinaryString(fbody); |
| | | fileReader.onload = function(e) { |
| | | bodyList.push(window.btoa(this.result)); |
| | | } |
| | | fileReader.onerror = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | fileReader.onabort = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+attachmentName + '过大无法上传'); |
| | | function saveAttachment(){ |
| | | var maxFileSize = 4350000; //Base64 编码以后最大的文件字节数 |
| | | var attachmentBody; //附件内容 |
| | | var attachmentName; //附件名称 |
| | | var attachmentType; //附件名称 |
| | | var attachmentSize; //附件大小 |
| | | var parentId = j$(escapeVfId("parentId")).value(); |
| | | // 获取上传图片的数量 |
| | | var size = document.getElementById("file_input").files.length; |
| | | if (size > 0) { |
| | | var nameList = []; |
| | | var typeList = []; |
| | | var bodyList = []; |
| | | for(var i = 0;i < size;i++){ |
| | | var fbody = document.getElementById("file_input").files[i]; |
| | | attachmentName = fbody.name; |
| | | if(fbody.size <= maxFileSize) { |
| | | attachmentType = fbody.type; |
| | | nameList.push(attachmentName); |
| | | typeList.push(attachmentType); |
| | | var fileReader = new FileReader(); |
| | | fileReader.readAsBinaryString(fbody); |
| | | fileReader.onload = function(e) { |
| | | bodyList.push(window.btoa(this.result)); |
| | | } |
| | | fileReader.onerror = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | fileReader.onabort = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+attachmentName + '过大无法上传'); |
| | | } |
| | | |
| | | |
| | | } |
| | | if (nameList.length > 0) { |
| | | //使用RemoteAction上传附件 |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.SendEmailController.AddAttachment}', |
| | | nameList, |
| | | typeList, |
| | | bodyList, |
| | | parentId, |
| | | function(result,event) { |
| | | |
| | | if(result == '文件上传成功'){ |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else if (result == null){ |
| | | result = '文件上传失败,请重新上传'; |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else { |
| | | alert(result); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | } |
| | | if (nameList.length > 0) { |
| | | //使用RemoteAction上传附件 |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.SendEmailController.AddAttachment}', |
| | | nameList, |
| | | typeList, |
| | | bodyList, |
| | | parentId, |
| | | function(result,event) { |
| | | |
| | | if(result == '文件上传成功'){ |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else if (result == null){ |
| | | result = '文件上传失败,请重新上传'; |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else { |
| | | alert(result); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | // PI改造 By Bright 20220329 |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResourceMail = JSON.parse('{!staticResourceMail}'); |
| | | var staticResourceMailMerge = JSON.parse('{!staticResourceMailMerge}'); |
| | | var staticResourceDocument = JSON.parse('{!staticResourceDocument}'); |
| | | var isQuotesPdf = false; |
| | | |
| | | function alertErrorMessage(errorMsg) { |
| | | console.log(errorMsg); |
| | | } |
| | | |
| | | function uploadFileToAWS(data, size, fileName, callback) { |
| | | |
| | | console.log("body=" + JSON.stringify({ 'file': data, "size": size, 'fileName': fileName })); |
| | | AWSService.post(staticResourceDocument.newUrl, JSON.stringify({ |
| | | 'file': data, |
| | | "size": size, |
| | | 'fileName': fileName }) |
| | | , function(result){ |
| | | console.log("result" + JSON.stringify(result)); |
| | | |
| | | } |
| | | |
| | | |
| | | if (result.success) { |
| | | let key = result.object; |
| | | confirmTrans(result.txId,1,function(){ |
| | | if (callback) { |
| | | callback(key); |
| | | } |
| | | }) |
| | | //SendEmail(); |
| | | console.log('key' + key); |
| | | } else { |
| | | alertErrorMessage('上传失败请稍后再试!'); |
| | | } |
| | | }, staticResourceDocument.token); |
| | | |
| | | } |
| | | |
| | | function SendEmailCallBack(){ |
| | | console.log('SendEmailCallBack'); |
| | | } |
| | | |
| | | function confirmTrans(transId, isSuccess,callback) { |
| | | |
| | | AWSService.post(staticResourceDocument.updateUrl, JSON.stringify({ |
| | | "txId":transId, |
| | | "sfRecordId":"", |
| | | "isSuccess":isSuccess |
| | | }), function(data){ |
| | | console.log("confirmTrans-" + JSON.stringify(data)); |
| | | if (callback) { |
| | | callback() |
| | | } |
| | | }, staticResourceDocument.token); |
| | | |
| | | } |
| | | |
| | | function uploadFile() { |
| | | var maxFileSize = 4350000; |
| | | let files = document.getElementById("file_input").files |
| | | // 获取上传图片的数量 |
| | | |
| | | if (files.length == 0) { |
| | | alert('至少选择一个附件'); |
| | | return; |
| | | } |
| | | |
| | | let attachList=[]; |
| | | let complete_flags = new Array(files.length + 1).join(0).split('').map(function () { return false }); |
| | | let AllComplete = function(){ |
| | | for (let index = 0; index < complete_flags.length; index++){ |
| | | if(!complete_flags[index]){ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | ub(); |
| | | } |
| | | for(var i = 0;i < files.length;i++){ |
| | | var fbody = files[i]; |
| | | let j = i; |
| | | if(fbody.size <= maxFileSize) { |
| | | |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+fbody.name + '过大无法上传'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | popupBox.hide(); |
| | | b(); |
| | | for(var i = 0;i < files.length;i++){ |
| | | var fbody = files[i]; |
| | | let j = i; |
| | | var fileReader = new FileReader(); |
| | | fileReader.fbody = fbody; |
| | | fileReader.readAsDataURL(fbody); |
| | | fileReader.onload = function(e) { |
| | | let reader = this; |
| | | attachList.push({ |
| | | name:reader.fbody.name, |
| | | type:reader.fbody.type, |
| | | body:reader.result, |
| | | size:reader.fbody.size |
| | | }) |
| | | // |
| | | console.log('onload '+ j); |
| | | // ReadComplete(); |
| | | uploadFileToAWS(reader.result, reader.fbody.size, reader.fbody.name,function(key){ |
| | | complete_flags[j] = true; |
| | | AppendAttachmentHtml(reader.fbody.name,key,reader.fbody.size); |
| | | AllComplete(); |
| | | }); |
| | | |
| | | |
| | | } |
| | | fileReader.onerror = function(e) { |
| | | ub(); |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | fileReader.onabort = function(e) { |
| | | ub(); |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } |
| | | |
| | | console.log('end'); |
| | | |
| | | } |
| | | |
| | | let AfterCallBack = null; |
| | | function AddQuotesPdf(callback){ |
| | | if (isQuotesPdf) { |
| | | alert('已添加报价单,无需重复添加'); |
| | | return; |
| | | } |
| | | b(); |
| | | AfterCallBack = callback; |
| | | j$("#pdf").attr("src",'/apex/QuotesPDF?id={!typeid}&addFile=AddQuotesPdfCallBack'); |
| | | } |
| | | |
| | | function AddQuotesPdfCallBack(uri){ |
| | | let bodys = uri.split(','); |
| | | let body = bodys[bodys.length-1] |
| | | let size = window.atob(body).length; |
| | | let name = '报价单.pdf'; |
| | | uploadFileToAWS(uri, size, name,function(key){ |
| | | ub(); |
| | | AppendAttachmentHtml(name,key,size); |
| | | isQuotesPdf = true; |
| | | if (AfterCallBack) { |
| | | AfterCallBack(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function SendEmailJs(){ |
| | | |
| | | let tos = jQuery("#memberBody :checked[target='to']"); |
| | | if(tos.length<1){ |
| | | alert("至少填写一个收件人"); |
| | | return; |
| | | } |
| | | |
| | | let error_email_e = null; |
| | | j$("#memberBody .emailAddress").each(function(i,e){ |
| | | if (!/^[\w-]{1,99}@[\da-zA-Z]{1,99}\.[a-zA-Z]+$/.test(e.value)) { |
| | | error_email_e = e; |
| | | return false; |
| | | } |
| | | return true; |
| | | }) |
| | | |
| | | if (error_email_e) { |
| | | if(error_email_e.value){ |
| | | alert('邮箱地址格式不对:'+error_email_e.value); |
| | | }else{ |
| | | alert('邮箱地址必填'); |
| | | } |
| | | |
| | | j$(error_email_e).focus(); |
| | | j$(error_email_e).select(); |
| | | return; |
| | | } |
| | | |
| | | let subject = j$(".SUBJECT__c").val(); |
| | | if (!subject) { |
| | | alert("SUBJECT必填"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | let message = j$(".MESSAGE__c").val(); |
| | | if (!message) { |
| | | alert("MESSAGE必填"); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(target){ |
| | | let targets = jQuery("#memberBody :checked[target='"+target+"']"); |
| | | let emails = []; |
| | | let names = []; |
| | | targets.each(function(i,e){ |
| | | let v = j$(e).closest("tr").find(".name").val(); |
| | | names.push(v?v:'-'); |
| | | emails.push(j$(e).closest("tr").find(".emailAddress").val()); |
| | | }); |
| | | return { |
| | | emails:emails, |
| | | names:names |
| | | } |
| | | } |
| | | |
| | | |
| | | let to = Foo('to'); |
| | | let cc = Foo('cc'); |
| | | let bcc = Foo('bcc'); |
| | | |
| | | |
| | | let payload = { |
| | | "bcc": bcc.emails.join(';'), |
| | | "bccName": bcc.names.join(';'), |
| | | "cc": cc.emails.join(';'), |
| | | "ccName": cc.names.join(';'), |
| | | "from": j$(".FROM__c").html(), |
| | | "fromName": "", |
| | | "message": message, |
| | | "recipient": to.emails.join(';'), |
| | | "recordId": "{!typeid}", |
| | | "recordType": "{!type}", |
| | | "subjectCopy": subject+'~{!name}', |
| | | "toName": to.names.join(';') |
| | | }; |
| | | b(); |
| | | |
| | | |
| | | |
| | | let Send = function(){ |
| | | let fileMap = {} |
| | | j$("a.attach_link").each(function(i,e){ |
| | | fileMap[j$(e).attr("data-key")] = j$(e).attr("data-name"); |
| | | }); |
| | | payload.fileMap = fileMap; |
| | | AWSService.post(staticResourceMail.newUrl,JSON.stringify(payload),function(data){ |
| | | console.log(data); |
| | | ub(); |
| | | if (data && data.success) { |
| | | alert('发送成功') |
| | | if ('{!typeid}') { |
| | | window.location.href = '/{!typeid}?type=mail'; |
| | | }else{ |
| | | window.location.href = '/'+data.object; |
| | | } |
| | | }else{ |
| | | alert('发送失败,原因:'+(data && data.message ? data.message :'未知错误')); |
| | | } |
| | | },staticResourceMail.token); |
| | | } |
| | | |
| | | // 如果没添加报价单,自动添加 |
| | | if ('{!type}' == 'Quotes' && !isQuotesPdf) { |
| | | AddQuotesPdf(Send); |
| | | }else{ |
| | | Send(); |
| | | } |
| | | |
| | | } |
| | | |
| | | function AppendAttachmentHtml(name,key,size){ |
| | | let html = '<tr style="text-align:center; vertical-align: middle;">' |
| | | + '<td><a class="attach_link" target="_blank" data-key="'+key+'" data-name="'+name+'" href="'+staticResourceDocument.queryUrl+key+'">'+name+'</a></td>' |
| | | +'<td>'+new Date().toLocaleString()+'</td>' |
| | | +'<td>'+size+'</td>' |
| | | +'<td><input type="button" class="btn delete_attachment" value="delete" /></td>' |
| | | +'</tr>'; |
| | | j$("table.attach_preview").append(html); |
| | | } |
| | | |
| | | function AddMemberJs(){ |
| | | let line_id = new Date().getTime()+''+Math.floor(Math.random()*1000); |
| | | let html = '<tr line-id="'+line_id+'" style="text-align:center;">' |
| | | +'<td><input id="memberName2" type="hidden" value=""><input class="emailAddress" type="text" value=""/></td>' |
| | | +'<td><input class="name" type="text" value=""/></td>' |
| | | +'<td><input line-id="'+line_id+'" target="to" type="checkbox" checked="checked"/></td>' |
| | | +'<td><input line-id="'+line_id+'" target="cc" type="checkbox"/></td>' |
| | | +' <td><input line-id="'+line_id+'" target="bcc" type="checkbox"/></td>' |
| | | +' <td><input line-id="'+line_id+'" class="btn delete" value="delete" type="button"/></td>' |
| | | +' <td><input type="button" value="Search" onclick="openSearchMemberPage('+line_id +');" class="btn search"/></td>' |
| | | +' </tr>'; |
| | | j$("#memberBody").append(html); |
| | | } |
| | | |
| | | j$(function(){ |
| | | j$("table.attach_preview").on("click",".delete_attachment",function(){ |
| | | j$(this).closest("tr").remove(); |
| | | }) |
| | | |
| | | j$("#memberBody").on("click",":checkbox",function(){ |
| | | let b = j$(this).prop("checked"); |
| | | console.log(b); |
| | | j$(":checkbox[line-id='"+j$(this).attr("line-id")+"']").prop("checked",false); |
| | | j$(this).prop("checked",b); |
| | | }) |
| | | |
| | | j$("#memberBody").on("click","input.delete",function(){ |
| | | j$("tr[line-id='"+j$(this).attr("line-id")+"']").remove(); |
| | | }) |
| | | |
| | | if ('{!AWSDataId}') { |
| | | b(); |
| | | AWSService.query(staticResourceMailMerge.queryUrl,'{!AWSDataId}',function(data){ |
| | | ub(); |
| | | if (data && data.object) { |
| | | let allMembers = data.object.allMember.split(';'); |
| | | let allMemberNames = data.object.allMemberName.split(';'); |
| | | j$("#memberBody .emailAddress").each(function(i,e){ |
| | | j$(e).val(allMembers[i]); |
| | | }) |
| | | |
| | | j$("#memberBody .name").each(function(i,e){ |
| | | j$(e).val(allMemberNames[i]=='-'?'':allMemberNames[i]); |
| | | }) |
| | | } |
| | | |
| | | },staticResourceMailMerge.token); |
| | | } |
| | | }) |
| | | </script> |
| | | <div style="width : 100%;"> |
| | | <div style="width : 70%; margin: auto;"> |
| | |
| | | <!-- <apex:param name="lineNum" assignTo="{!lineNum}" value="" /> --> |
| | | </apex:actionFunction> |
| | | |
| | | <apex:actionFunction name="SendEmail" action="{!SendEmail}" oncomplete="SendEmailCallBack();" reRender="messageForm" > |
| | | <apex:param name="handleType" assignTo="{!handleType}" value="send" /> |
| | | </apex:actionFunction> |
| | | |
| | | <div style="width: 100%"> |
| | | <div class="errorMessage" style="margin-left: 39%"> |
| | | <span id="errorMessage">{!errorMessage}</span> |
| | |
| | | </tr> |
| | | <tr> |
| | | <th style="width: 20%;text-align:center;">FROM:</th> |
| | | <td><apex:outputText value="{!mail.FROM__c}" style="width: 40%"/></td> |
| | | <td><apex:outputText styleClass="FROM__c" value="{!mail.FROM__c}" style="width: 40%"/></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | |
| | | </thead> |
| | | <tbody id="memberBody"> |
| | | <apex:repeat id="lineDataList" value="{!memberLineDatas}" var="lineData"> |
| | | <tr style="text-align:center;"> |
| | | <tr line-id="{!lineData.lineNum}" style="text-align:center;"> |
| | | <td> |
| | | <input type="hidden" id="memberName{!lineData.lineNum}" value="{!lineData.name}" /> |
| | | <apex:inputText value="{!lineData.emailAddress}" /></td> |
| | | <td><apex:inputText value="{!lineData.name}" /></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'to')" id="to" value="{!lineData.to}"/></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'cc')" id="cc" value="{!lineData.cc}"/></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'bcc')" id="bcc" value="{!lineData.bcc}"/></td> |
| | | <td><apex:commandButton onclick="blockme();" action="{!deLine}" reRender="messageForm" value="delete" oncomplete="unblockUI();" disabled="{!isOnClick}"> |
| | | <apex:inputText styleClass="emailAddress" value="{!lineData.emailAddress}" /></td> |
| | | <td><apex:inputText styleClass="name" value="{!lineData.name}" /></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="to" id="to" value="{!lineData.to}"/></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="cc" id="cc" value="{!lineData.cc}"/></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="bcc" id="bcc" value="{!lineData.bcc}"/></td> |
| | | <td><input line-id="{!lineData.lineNum}" class="btn delete" value="delete" type="button"/></td> |
| | | <!-- <td><apex:commandButton onclick="b();" action="{!deLine}" reRender="messageForm" value="delete" oncomplete="ub();" disabled="{!isOnClick}"> |
| | | <apex:param name="lineNum" assignTo="{!lineNum}" value="{!lineData.lineNum}" /> |
| | | </apex:commandButton></td> |
| | | </apex:commandButton></td> --> |
| | | <td> |
| | | <apex:commandButton onclick="openSearchMemberPage({!lineData.lineNum});" value="Search" disabled="{!isOnClick}"> |
| | | |
| | |
| | | </tbody> |
| | | <thead> |
| | | <tr style="text-align:center;"> |
| | | <td><apex:commandButton id="addLine" onclick="blockme();" action="{!addLine}" reRender="messageForm" value="ADD Member" oncomplete="unblockUI();" disabled="{!isOnClick}"></apex:commandButton></td> |
| | | <!-- <td><apex:commandButton id="addLine" onclick="b();" action="{!addLine}" reRender="messageForm" value="ADD Member" oncomplete="ub();" disabled="{!isOnClick}"></apex:commandButton></td> --> |
| | | <td><apex:commandButton id="addLine" onclick="AddMemberJs();" value="ADD Member" oncomplete=""></apex:commandButton></td> |
| | | </tr> |
| | | </thead> |
| | | </table> |
| | |
| | | </tr> --> |
| | | <tr> |
| | | <th style="text-align:center;width: 20%;">SUBJECT:</th> |
| | | <td><apex:inputField value="{!mail.SUBJECT__c}" style="width: 40%"/></td> |
| | | <td><apex:inputField styleClass="SUBJECT__c" value="{!mail.SUBJECT__c}" style="width: 40%"/></td> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align:center;width: 20%;">MESSAGE:</th> |
| | | <td><apex:inputField style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td> |
| | | <td><apex:inputField styleClass="MESSAGE__c" style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | |
| | | |
| | | <tr> |
| | | <td> |
| | | <apex:commandButton value="Upload Attachment" action="{!uploadFile}" disabled="{!isOnClick}"> |
| | | </apex:commandButton> |
| | | <!-- <apex:commandButton value="Upload Attachment" action="{!uploadFile}" disabled="{!isOnClick}"> |
| | | </apex:commandButton> --> |
| | | <apex:panelGroup > |
| | | <apex:commandButton onclick="uploadFileS();return false;" value="图片批量上传" disabled="{!isOnClick}"/> |
| | | <apex:commandButton onclick="openFile();return false;" value="图片批量上传" disabled="{!isOnClick}"/> |
| | | </apex:panelGroup> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div style="margin-left: 5px;"> |
| | | <apex:outputPanel rendered="{!IF(openType == 'View', true, false)}" style="margin-left: 5px;"> |
| | | <!-- border:1px solid #000000; --> |
| | | <table class="tableCss" style="width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | | <th style="text-align:center;width: 33%;">Upload Time</th> |
| | | <th style="text-align:center;width: 33%;">File Size</th> |
| | | <!-- <th style="text-align:center;width: 33%;">File Size</th> --> |
| | | </tr> |
| | | <apex:repeat id="attachmentList" value="{!attachmentList}" var="attachment"> |
| | | <apex:repeat id="attachmentList" value="{!newAttachmentList}" var="item"> |
| | | <tr style="text-align:center; vertical-align: middle;"> |
| | | <!-- <td><input value="{!attachment.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.Name}</apex:outputLink></td> |
| | | <td><apex:inputField value="{!attachment.CreatedDate}"/></td> |
| | | <td><apex:inputField value="{!attachment.BodyLength}"/></td> |
| | | <td id="{!attachment.Id}"> |
| | | <apex:commandButton id="deleteFile" value="delete" action="{!deleteFile}" reRender="messageForm" onclick="blockme();" oncomplete="unblockUI();" disabled="{!isOnClick}"> |
| | | <apex:param name="fileId" assignTo="{!fileId}" value="{!attachment.Id}" /> |
| | | </apex:commandButton> |
| | | <!-- <td><input value="{!item.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!item.Id}">{!item.FileName__c}</apex:outputLink></td> |
| | | <td><apex:inputField value="{!item.CreatedDate}"/></td> |
| | | <!-- <td><apex:inputField value="{item.BodyLength}"/></td> --> |
| | | <td id="{!item.Id}"> |
| | | <a target="_blank" href="{!item.ViewLink__c}">查看</a> |
| | | </td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |
| | | </apex:outputPanel> |
| | | <!-- 20220222 PI改造 by Bright start --> |
| | | <apex:outputPanel rendered="{!IF(openType == 'View', false, true)}" style="margin-left: 5px;"> |
| | | <!-- border:1px solid #000000; --> |
| | | <table class="tableCss attach_preview" style="width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | | <th style="text-align:center;width: 33%;">Upload Time</th> |
| | | <th style="text-align:center;width: 33%;">File Size</th> |
| | | </tr> |
| | | |
| | | </table> |
| | | </apex:outputPanel> |
| | | <!-- 20220222 PI改造 by Bright end --> |
| | | |
| | | <div style="width: 30%;height: 5%;margin-left: 30%;margin-top: middle;"> |
| | | <apex:outputPanel rendered="{!IF(type == 'Quotes', true, false)}"> |
| | | <apex:commandButton id="open" value="查看报价单" onclick="openPDF()" style="width: 49%;height: 5%" /> |
| | | <apex:commandButton id="addPDf" value="添加报价单" action="{!addPDF}" onclick="blockme();" oncomplete="unblockUI();" reRender="messageForm" style="width: 49%;height: 5%" disabled="{!isOnClick}"/> |
| | | <apex:commandButton id="open" value="查看报价单" onclick="openPDF();return false;" style="width: 49%;height: 5%" /> |
| | | <apex:commandButton id="addPDf" value="添加报价单" onclick="AddQuotesPdf();return false;" oncomplete="" reRender="messageForm" style="width: 49%;height: 5%" disabled="{!isOnClick}"/> |
| | | </apex:outputPanel> |
| | | <apex:commandButton id="test" action="{!SendEmail}" value="Send Mail" onclick="blockme();" oncomplete="unblockUI();" reRender="messageForm" style="width: 99%;height: 5%" disabled="{!isOnClick}"> |
| | | <apex:commandButton id="test" value="Send Mail" onclick="SendEmailJs();return false;" style="width: 99%;height: 5%" disabled="{!isOnClick}"/> |
| | | <!-- <apex:commandButton id="test" action="{!SendEmail}" value="Send Mail" onclick="b();" oncomplete="ub();" reRender="messageForm" style="width: 99%;height: 5%" disabled="{!isOnClick}"> |
| | | <apex:param name="handleType" assignTo="{!handleType}" value="send" /> |
| | | </apex:commandButton> |
| | | </apex:commandButton> --> |
| | | </div> |
| | | <apex:outputPanel id="popupBox" layout="block" style="display:none"> |
| | | |
| | | <input type="file" id="file_input" name="attFile" multiple="true"/><br/> |
| | | <center> |
| | | <apex:commandButton value="确认" onclick="saveAttachment(); return false;" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | <apex:commandButton value="确认" onclick="uploadFile(); return false;" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | <apex:commandButton value="取消" onclick="popupBox.hide();" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | </center> |
| | | </apex:outputPanel> |
| | | </apex:form> |
| | | <iframe src="" id="pdf" style="position: absolute;left: 100%;" /> |
| | | </div> |
| | | </div> |
| | | </apex:page> |