李彤
2022-05-30 115b1ebc6e433315a9835af24d4fe0f90343a3ca
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
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Consum_Select</fullName>
    <availability>online</availability>
    <displayType>massActionButton</displayType>
    <linkType>javascript</linkType>
    <masterLabel>分配</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <requireRowSelection>true</requireRowSelection>
    <url>{!RequireScript(&quot;/soap/ajax/51.0/connection.js&quot;)} 
{!RequireScript(&quot;/soap/ajax/51.0/apex.js&quot;)} 
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)} 
//2021-10-22 gwy 版本更改为51.0
    var buttons = document.getElementsByName(&apos;Consum_Select&apos;.toLowerCase());
    for (var i=0; i&lt;buttons.length; i++) {
        buttons[i].className = &quot;btnDisabled&quot;;
        buttons[i].disabled = true;
    }
 
var ids = {!GETRECORDIDS($ObjectType.Consum_Apply_Equipment_Set__c)};
 
if(&quot;{!Consum_Apply__c.Yi_loaner_arranged__c}&quot; &gt; 0) {
    alert(&quot;出库之后不能点击分配按钮,如果有需要分配的明细请分单后继续操作&quot;);
} else if (ids.length &lt; 1) {
    alert(&quot;请选择耗材备品一览&quot;);
} else if (ids.length &gt; 1) {
    alert(&quot;请选择一条耗材备品一览&quot;);
}
else {
var soql = &quot;select Id, Zan_Ding_Fen_Pei_Shu__c from Consum_Apply_Equipment_Set__c where Id=&apos;&quot; 
+ ids[0] + &quot;&apos;&quot;; 
        var allRecords = sforce.connection.query(soql).getArray(&quot;records&quot;); 
    if (allRecords[0].Zan_Ding_Fen_Pei_Shu__c &gt; 0) {
        alert(&apos;请在默认分配后再做分配操作。&apos;);
    }
    else {
        window.open(&quot;/apex/ConsumSelect?recid=&quot; + ids[0], &quot;_top&quot;);
    }
}</url>
</WebLink>