buli
2023-06-27 8e07b5f23afd4c93d7e8d1f04d2e8dbca2628e5e
force-app/main/default/objects/Rental_Apply_Equipment_Set__c/webLinks/Loaner_arranged_e_mail.webLink-meta.xml
@@ -9,7 +9,6 @@
    <protected>false</protected>
    <url>{!RequireScript(&quot;/soap/ajax/51.0/connection.js&quot;)} 
{!RequireScript(&quot;/soap/ajax/51.0/apex.js&quot;)}
//2021-10-21 gwy 版本更改为51.0
var buttons = document.getElementsByName(&apos;loaner_arranged_e_mail&apos;);
for (var i=0; i&lt;buttons.length; i++)
{
@@ -18,28 +17,34 @@
}
var campaignStatus = &apos;&apos;;  
var records = null;  // 20220217 ljh  OBPM市场活动联动
var records = null;  // 20220217 ljh  OBPM市场活动联动
var statusSting = &quot;{!$Label.StatusProcessState}&quot;; // 20220322 ljh add
var statusList = statusSting.split(&apos;,&apos;);
var raliveryGood = new Array();
reliveryGood = sforce.connection.query(&quot;select Id,Campaign__c,Repair__c,Status__c, Demo_purpose1__c,Contract_pdf_updated__c,Repair_Final_Inspection_Date_F__c,RC_return_to_office__c from Rental_Apply__c where Name=&apos;{!Rental_Apply_Equipment_Set__c.Rental_Apply__c}&apos;&quot;); 
var rarecords= reliveryGood.getArray(&quot;records&quot;);
var RentalApply = rarecords[0];
if(RentalApply.Campaign__c != &apos;&apos; &amp;&amp; RentalApply.Campaign__c != null) { 
var DeliveryGood = new Array();
// 20220217 ljh update OBPM市场活动联动 start
// DeliveryGood = sforce.connection.query(&quot;select Status, Rental_Apply_Flag__c from Campaign where id =&apos;&quot; + RentalApply.Campaign__c +  &quot;&apos;&quot;);
// var records= DeliveryGood.getArray(&quot;records&quot;);
DeliveryGood = sforce.connection.query(&quot;select Status, Rental_Apply_Flag__c,IF_Approved__c,Meeting_Approved_No__c,Approved_Status__c from Campaign where id =&apos;&quot; + RentalApply.Campaign__c +  &quot;&apos;&quot;);
records = DeliveryGood.getArray(&quot;records&quot;);
// 20220217 ljh update OBPM市场活动联动 end
    var DeliveryGood = new Array();
    // 20220217 ljh update OBPM市场活动联动 start
    // DeliveryGood = sforce.connection.query(&quot;select Status, Rental_Apply_Flag__c from Campaign where id =&apos;&quot; + RentalApply.Campaign__c +  &quot;&apos;&quot;);
    // var records= DeliveryGood.getArray(&quot;records&quot;);
    DeliveryGood = sforce.connection.query(&quot;select Status, Rental_Apply_Flag__c,IF_Approved__c,Meeting_Approved_No__c,Approved_Status__c from Campaign where id =&apos;&quot; + RentalApply.Campaign__c +  &quot;&apos;&quot;);
    records = DeliveryGood.getArray(&quot;records&quot;);
    // 20220217 ljh update OBPM市场活动联动 end
campaignStatus = records[0].Status;
    campaignStatus = records[0].Status;
}
if(&quot;{!Rental_Apply__c.Wei_Assigned_Cnt__c}&quot; &gt; &quot;0&quot;) { 
    alert(&quot;申请单内存在未分配的配套,请分配备品或分割申请单&quot;); 
}else if(campaignStatus == &apos;取消&apos;){
    alert(&quot;学会取消,不可出库指示&quot;);
// 20230220 ljh DB202301265636 start
// }else if(campaignStatus == &apos;取消&apos;){
//     alert(&quot;学会取消,不可出库指示&quot;);
}else if(campaignStatus == &apos;取消&apos; || campaignStatus == &apos;取消申请中&apos;){
    alert(&quot;学会取消申请中或者已取消,不可出库指示&quot;);
// 20230220 ljh DB202301265636 end
}else if (&quot;{!Rental_Apply_Equipment_Set__c.Assigned_Not_Shipment__c}&quot; == &quot;0&quot;) {
    alert(&quot;没有可以出库指示的明细&quot;);
} else if (RentalApply.Demo_purpose1__c == &quot;长期借出&quot; &amp;&amp; RentalApply.Contract_pdf_updated__c == &quot;0&quot;) {
@@ -49,6 +54,8 @@
// 20220217 ljh add OBPM市场活动联动 start
} else if (records != null &amp;&amp; records[0].IF_Approved__c == &quot;true&quot; &amp;&amp; (records[0].Meeting_Approved_No__c == null || records[0].Meeting_Approved_No__c == &quot;&quot;) ) {
    alert(&quot;没有决裁号的,暂不能出借,请更新裁决信息。&quot;);
} else if (records != null &amp;&amp; records[0].IF_Approved__c == &quot;true&quot; &amp;&amp; records[0].Meeting_Approved_No__c != &quot;&quot; &amp;&amp; statusList.indexOf(records[0].Approved_Status__c) != -1 ) {
    alert(&quot;已申请决裁但决裁状态不符合条件。&quot;);
// 20220217 ljh add OBPM市场活动联动 end
} else {
    sforce.connection.sessionId = &quot;{!GETSESSIONID()}&quot;;