Li Jun
2022-05-10 51fb56f3f5b0dc96d7f93a71f9b61263e303243f
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>OPD_Report</fullName>
    <availability>online</availability>
    <description>根据备品借出申请的状态,来确认能否创建报告书</description>
    <displayType>massActionButton</displayType>
    <linkType>javascript</linkType>
    <masterLabel>OPD报告</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <requireRowSelection>false</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 foo = function() {
var status = &quot;{!Rental_Apply__c.RA_Status__c}&quot;;
if(status != &quot;已出库&quot; &amp;&amp; status != &quot;申请者已收货&quot; &amp;&amp; status != &quot;医院已装机确认&quot; &amp;&amp; status != &quot;已回寄&quot; &amp;&amp; status != &quot;已回收&quot; &amp;&amp; status != &quot;完了&quot; &amp;&amp; status != &quot;欠品中&quot;){
 alert(&quot;备品借出状态:&quot; + status + &quot;,不能创建报告书!&quot;);
 return; 
}
 
//var d = new Date(&quot;{!Rental_Apply__c.Asset_return_day2__c}&quot;);
//var d15 = new Date(&quot;{!Rental_Apply__c.Asset_return_day2__c}&quot;);
//d15.setDate(d.getDate()+7);
//if(status == &quot;已回寄&quot; &amp;&amp; ( new Date()&lt; d || new Date() &gt; d15)){
// alert(&quot;备品借出状态:&quot; + status + &quot;,但不在回寄日之后7天之内,不能创建报告书!&quot;);
// return;
//}
//2021/7/15 fxk Start
var str;
var url;
 
str=&apos;&amp;RecordType=01210000000RLTi&apos;;
url = &apos;/a0B/e?retURL=%2Fa0B%2Fo&apos;+str;
 
//2021/7/15 fxk End
 
//SWAG-BVW8CW 20201217 让user自己选择recordtype
//目的2为---试用(有询价) 带询价
var demo_purpose2 = &quot;{!Rental_Apply__c.demo_purpose2__c}&quot;;
var strs ;
if(demo_purpose2==&apos;试用(有询价)&apos;){
strs=&apos;&amp;CF00N10000002DT68={!Rental_Apply__c.Follow_UP_Opp__c}&apos; +
&apos;&amp;CF00N10000002DT68_lkid={!Rental_Apply__c.Follow_UP_OppId__c}&apos; +
&apos;&amp;00N10000002DHk5=跟进询价&apos;
}
//window.open(&apos;/a0B/e?retURL=%2F{!Rental_Apply__c.Id}&apos;+
//&apos;&amp;RecordType=01210000000Qekj&amp;ent=01I10000000SWfe&apos;+ 
 
window.open(url +=
&apos;&amp;CF00N10000004maf3={!Rental_Apply__c.Name}&apos; +
&apos;&amp;CF00N10000004maf3_lkid={!Rental_Apply__c.Id}&apos; +
&apos;&amp;CF00N10000002DPUD={!Rental_Apply__c.Hospital__c}&apos;+ 
&apos;&amp;CF00N10000002DPUD_lkid={!Rental_Apply__c.HospitalId__c}&apos;+ 
&apos;&amp;CF00N10000002Dh0f={!Rental_Apply__c.Strategic_dept__c}&apos; +
&apos;&amp;CF00N10000002Dh0f_lkid={!Rental_Apply__c.Strategic_deptId__c}&apos;+
&apos;&amp;CF00N10000008ps6d={!Rental_Apply__c.OPDPlan__c}&apos; +
&apos;&amp;CF00N10000008ps6d_lkid={!Rental_Apply__c.OPDPlanId__c}&apos;+  
&apos;&amp;CF00N10000002CWW4={!Rental_Apply__c.Account__c}&apos;+
&apos;&amp;CF00N10000002CWW4_lkid={!Rental_Apply__c.AccountId__c}&apos;+strs)
}
foo();</url>
</WebLink>