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
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Create_NewServiceContract</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() {
//贸易合规 you
//拦截+邮件提醒
var FSEStr = new Array();
var angency = &apos;&apos;;//不涉及经销商
var accname = &apos;{!Account.Hospital__c}&apos;;
var mcid = &apos;{!Account.Id}&apos;;
var TradeComplianceStatusFlagFW = &quot;{!$Label.TradeComplianceStatusFlagFW}&quot;;//贸易合规开关
var IFTradeComplianceAlert = &quot;{!$Label.IFTradeComplianceAlert}&quot;;//贸易合规提醒
if(TradeComplianceStatusFlagFW==&apos;true&apos;){
var oppflag=false;
var sql = &quot;select id,IFTradeComplianceIntercept__c from Account where id  =&apos;{!Account.HospitalId__c}&apos;&quot;;//只有科室上有此按钮,所以不涉及经销商
var sqlResult = sforce.connection.query(sql);
var records = sqlResult.getArray(&quot;records&quot;);
if(null!=records &amp;&amp; records.length&gt;0){
var AccDealerBlacklist = records[0].IFTradeComplianceIntercept__c;//判断客户/经销商是否为黑名单
if(AccDealerBlacklist==&apos;intercept&apos;){
alert(&apos;您所选择的医院存在贸易合规风险,无法签订服务合同,建议您向客户做好不签约说明,&apos;+IFTradeComplianceAlert);
oppflag=true;
}
if(AccDealerBlacklist==&apos;WarningList&apos;){
if(!confirm(&apos;您所选择的医院存在贸易合规警示风险,不建议签订服务合同,请您确认是否继续申请,&apos;+IFTradeComplianceAlert)){
return;
}
}
if(oppflag){
var opprtn = sforce.apex.execute(&quot;OpportunityWebService&quot;, &quot;accSendEmailFW&quot;,{&quot;AccDealerBlacklist&quot;:AccDealerBlacklist,&quot;accname&quot;:accname,&quot;angency&quot;:angency,&quot;mcid&quot;:mcid,&quot;sendalert&quot;:&quot;Main_Con&quot;,&quot;FSEStr&quot;:FSEStr});
if (opprtn = true) {
return;
}
}
}
}
 
//贸易合规 you
 
var Hospital = &apos;{!URLENCODE(Account.Hospital__c)}&apos;;
var Hospitalid = &apos;{!URLENCODE(Account.HospitalId__c)}&apos;;
var Department = &apos;{!URLENCODE(Account.Department_Class__c)}&apos;;
var Departmentid = &apos;{!URLENCODE(Account.Department_ClassId__c)}&apos;;
var accountname = &apos;{!URLENCODE(Account.Name)}&apos;;
var accountid = &apos;{!URLENCODE(Account.Id)}&apos;;
 
 
var url = &apos;/a0H/e?CF00N10000002Dx56=&apos; + Hospital +&apos;&amp;CF00N10000002Dx56_lkid=&apos;
+ Hospitalid + &apos;&amp;CF00N10000002Dx4p=&apos; + Department + &apos;&amp;CF00N10000002Dx4p_lkid=&apos;
+ Departmentid + &apos;&amp;CF00N10000002Dx4q=&apos; + accountname + &apos;&amp;CF00N10000002Dx4q_lkid=&apos;
+ accountid + &apos;&amp;RecordType=01210000000gTYq&apos;;
/*window.top.location.href = url;*/
window.open(url); 
 
}
 
foo();</url>
</WebLink>