彭锟
2022-03-22 2ecb63062fe10bbfb6853e37a38a74dcc10291db
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
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>PostponeReport</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>改期</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 foo = function() {
var Status = &quot;{!OPDPlan__c.Status__c}&quot;;
if(Status == &apos;取消&apos; || Status == &apos;完毕&apos; ){
alert(&apos;OPD计划的状态为取消或完毕时,不能改期&apos;);
return;
}
/*//当OPD计划中的备品申请单 无/草案 备品申请的出库指示为空时,可以进行改期操作
var RentalApplyCount = new Array();
RentalApplyCount = sforce.connection.query(&quot;select id from Rental_Apply__c where OPDPlan__c = &apos;{!OPDPlan__c.Id}&apos; and ((Status__c !=&apos;草案中&apos; and Status__c != &apos;取消&apos; ) or Shipment_request_Cnt__c &gt;0 ) &quot;);
 
if(RentalApplyCount.size &gt;0){
alert(&apos;只有当OPD计划中的备品申请单无/草案/备品申请的出库指示为空时,才可以进行改期操作!&apos;);
return;
}*/
//判断符合条件得备品借出申请 SWAG-BVH3Q7 20201119 you
var opdplanid = &apos;{!OPDPlan__c.Id}&apos;;
var rtn = sforce.apex.execute(&quot;OpdPlanWebService&quot;, &quot;changeTrade&quot;,
{opdplanId:opdplanid});
if (rtn != &apos;OK&apos;) {
alert(rtn);
return;
}
window.open(&apos;/a3D/e?CF00N10000008ps4s={!OPDPlan__c.Name}&amp;00N10000008ps4u=延期报告&amp;RecordType=01210000000gQyM&apos;);
}
foo();</url>
</WebLink>