buli
2023-06-05 e9e1806b0f4b5bae1fc36204ccc5d6fdad52d66f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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(&quot;/soap/ajax/51.0/connection.js&quot;)} 
{!RequireScript(&quot;/soap/ajax/51.0/apex.js&quot;)} 
var foo = function() { 
if (&apos;{!Rental_Apply__c.Shipment_requested_cnt__c}&apos; &gt; 0) {
var sql = &quot;select Id from Rental_Apply_Equipment_Set__c where Rental_Apply__c = &apos;{!Rental_Apply__c.Id}&apos; and Yi_Shipment_request__c &gt; 0 and RAES_Status__c != &apos;取消&apos;&quot;;
var sqlResult = sforce.connection.query(sql);
var records = sqlResult.getArray(&quot;records&quot;);
var size =records.length;
 
var length = size%10 ==0? size/10 : parseInt(size/10) +1;
 
for(var i =0;i&lt;length;i++){
    window.open(&apos;/apex/FixtureRentalPicturePDF?raid={!Rental_Apply__c.Id}&amp;page=&apos; + i);
}
} else {
    alert(&apos;当前的申请单中没有已出库指示的配套。&apos;);
}
}
foo();</url>
</WebLink>