binxie
2024-01-16 4d3febe8045eb0fa0283af3c53b0c48344b8664d
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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;)} 
var foo = function() {
    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)};
 
//贸易合规 you
var AccDealerBlacklist = &apos;{!Consum_Apply__c.AccDealerBlacklist__c}&apos;;//判断客户是否为黑名单
var TradeComplianceStatusFlagBP = &quot;{!$Label.TradeComplianceStatusFlagBP}&quot;;//贸易合规开关
var IFTradeComplianceAlertBP = &quot;{!$Label.IFTradeComplianceAlertBP}&quot;;//贸易合规提醒
if(TradeComplianceStatusFlagBP==&apos;true&apos;){
if(AccDealerBlacklist==&apos;1&apos;){
alert(&apos;&apos;+IFTradeComplianceAlertBP);
return;
}
}
//贸易合规 you
 
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;);
    }
}
}
foo();</url>
</WebLink>