| <?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("/soap/ajax/51.0/connection.js")} | 
| {!RequireScript("/soap/ajax/51.0/apex.js")} | 
| {!RequireScript("/resource/CommonUtilJs")} | 
| //2021-10-21 gwy 版本更改为51.0 | 
| var foo = function() { | 
| var Status = "{!OPDPlan__c.Status__c}"; | 
| if(Status == '取消' || Status == '完毕' ){ | 
| alert('OPD计划的状态为取消或完毕时,不能改期'); | 
| return; | 
| } | 
| /*//当OPD计划中的备品申请单 无/草案 备品申请的出库指示为空时,可以进行改期操作 | 
| var RentalApplyCount = new Array(); | 
| RentalApplyCount = sforce.connection.query("select id from Rental_Apply__c where OPDPlan__c = '{!OPDPlan__c.Id}' and ((Status__c !='草案中' and Status__c != '取消' ) or Shipment_request_Cnt__c >0 ) "); | 
|   | 
| if(RentalApplyCount.size >0){ | 
| alert('只有当OPD计划中的备品申请单无/草案/备品申请的出库指示为空时,才可以进行改期操作!'); | 
| return; | 
| }*/ | 
| //判断符合条件得备品借出申请 SWAG-BVH3Q7 20201119 you | 
| var opdplanid = '{!OPDPlan__c.Id}'; | 
| var rtn = sforce.apex.execute("OpdPlanWebService", "changeTrade", | 
| {opdplanId:opdplanid}); | 
| if (rtn != 'OK') { | 
| alert(rtn); | 
| return; | 
| } | 
| window.open('/a3D/e?CF00N10000008ps4s={!OPDPlan__c.Name}&00N10000008ps4u=延期报告&RecordType=01210000000gQyM'); | 
| } | 
| foo();</url> | 
| </WebLink> |