<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>EquipmentRentalPicturePDF</fullName> 
 | 
    <availability>online</availability> 
 | 
    <displayType>button</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>配套清单</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")}  
 | 
{!RequireScript("/soap/ajax/51.0/apex.js")}  
 | 
var foo = function() {  
 | 
if ('{!Rental_Apply__c.Shipment_requested_cnt__c}' > 0) { 
 | 
var sql = "select Id from Rental_Apply_Equipment_Set__c where Rental_Apply__c = '{!Rental_Apply__c.Id}' and Yi_Shipment_request__c > 0 and RAES_Status__c != '取消'"; 
 | 
var sqlResult = sforce.connection.query(sql); 
 | 
var records = sqlResult.getArray("records"); 
 | 
var size =records.length; 
 | 
  
 | 
var length = size%10 ==0? size/10 : parseInt(size/10) +1; 
 | 
  
 | 
for(var i =0;i<length;i++){ 
 | 
    window.open('/apex/FixtureRentalPicturePDF?raid={!Rental_Apply__c.Id}&page=' + i); 
 | 
} 
 | 
} else { 
 | 
    alert('当前的申请单中没有已出库指示的配套。'); 
 | 
} 
 | 
} 
 | 
foo();</url> 
 | 
</WebLink> 
 |