涂煌豪
2022-05-06 ff435968945d457f9ee653a9620fa1c7d78d2d4c
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
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OPDSupplementaryApplication</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>OPD补充申请</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;)}
{!RequireScript(&quot;/resource/CommonUtilJs&quot;)}
//2021-10-21 gwy 版本更改为51.0 
var toHerf= function (){
//状态
var status = &quot;{!OPDPlan__c.Status__c}&quot;;
if(status != &apos;计划中&apos;){
alert(&quot;只有OPD计划状态为计划中,才能进行OPD补充申请&quot;);
return;
}
//补充申请
var supplementaryApplication = &quot;{!OPDPlan__c.supplementaryApplication__c}&quot;;
if(supplementaryApplication == &apos;1&apos;){
   alert(&apos;OPD计划无法进行补充申请&apos;);
   return;
}
var rental = &quot;{!OPDPlan__c.OriginalOpdPlanRental__c}&quot;;
if(rental != &apos;&apos;){
 alert(&apos;请转至OPD计划原单进行申请&apos;);
 return;
}
var raId = &quot;{!OPDPlan__c.Rental_Apply2__c}&quot;;
var datacheck = sforce.apex.execute(&quot;OpdPlanWebService&quot;, &quot;dataCheck&quot;, {rentalApplyId: raId});
 
if(datacheck != &apos;OK&apos;){
   alert(datacheck);
   return;
}
 
 
var resultSet = sforce.connection.query(&quot;SELECT Id, Name,supplementaryApplication__c FROM OPDPlan__c WHERE supplementaryApplication__c = true AND OriginalOpdPlanApplication__c = &apos;{!OPDPlan__c.Id}&apos;&quot;);
var records = resultSet.getArray(&quot;records&quot;);
if(records != null &amp;&amp; records.length &gt; 0){
   alert(&apos;OPD计划已进行过补充申请,无法再次进行补充申请&apos;);
   return;
}
var url = &apos;/{!OPDPlan__c.Id}/e?clone=1&apos;+
&apos;&amp;CF00N10000009EGnM_lkid=&apos; +
&apos;&amp;CF00N10000009EGnM=&apos;+
&apos;&amp;CF00N100000098dwI_lkid=&apos; +
&apos;&amp;CF00N100000098dwI=&apos;+
&apos;&amp;00N100000098sCI=&apos;+
&apos;&amp;00N100000098lrh=&apos;+
&apos;&amp;00N100000098dWZ=&apos;+
&apos;&amp;00N100000098dWX=&apos;+
&apos;&amp;00N100000098dWg=&apos;+
&apos;&amp;00N100000098ew4=&apos;+
&apos;&amp;00N100000098dWe=&apos;+
&apos;&amp;00N100000098dWd=&apos;+
&apos;&amp;CF00N10000009EKeX_lkid=&apos;+
&apos;&amp;CF00N10000009EKeX=&apos;+
&apos;&amp;CF00N10000008ps5k_lkid=&apos;+
&apos;&amp;CF00N10000008ps5k=&apos;+
&apos;&amp;CF00N10000009EJj7_lkid={!OPDPlan__c.Id}&apos; +
&apos;&amp;CF00N10000009EJj7={!HTMLENCODE(OPDPlan__c.Name)}&apos;+
&apos;&amp;00N100000098x8w=追加配套&apos; +
&apos;&amp;00N10000008ps5o=草案中&apos;;
 
window.open(url);
 
}
 
toHerf();</url>
</WebLink>