buli
2023-06-05 e9e1806b0f4b5bae1fc36204ccc5d6fdad52d66f
force-app/main/default/pages/NewPaymentPlanLoad.page
@@ -1,4 +1,4 @@
<apex:page Controller="NewPaymentPlanLoadController"  showHeader="false" sidebar="false" action="{!init}" id="allPage" title="维修合同文本信息录入页面" pageStyle="PageStyleCss">
<apex:page Controller="NewPaymentPlanLoadController"  showHeader="false" sidebar="false" action="{!init}" id="allPage" title="维修合同文本信息录入页面" pageStyle="PageStyleCss" lightningStylesheets="true" >
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
@@ -75,6 +75,25 @@
        j$(escapeVfId('allPage:allForm:allBlock:Second_Party_Contract_Number__c')).attr("disabled", true);
        j$(escapeVfId('allPage:allForm:allBlock:Negotiate_Mean__c')).attr("disabled", true);
      }
      //XLIU-CEP8WW LY 20220905 start
      var saveBT = '{!PageMCEElement.old_Is_RecognitionModel__c}';
      var payment = j$(escapeVfId('allPage:allForm:allBlock:paymentPlan:Term_Of_Payment__c')).val();
      // var Uplimit = j$(escapeVfId('allPage:allForm:allBlock:paymentPlan:Upperlimit')).val();
      var Uplimit = '{!UpperLimitPrice}';
      console.log('Uplimit='+Uplimit);
      if (saveBT =='true' && payment=='多次付款'){
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("class", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("class", true);
      }
      if (Uplimit =='true'){
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("class", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("class", true);
      }
      //XLIU-CEP8WW LY 20220905 end
        
   }
   
@@ -83,6 +102,13 @@
      var Total_Contract_Amount_In_Words = smalltoBIG(Total_Contract_Amount);
        j$(escapeVfId('allPage:allForm:allBlock:paymentPlan:Total_Contract_Amount_In_Words')).text(Total_Contract_Amount_In_Words);
        j$(escapeVfId('allPage:allForm:Total_Contract_Amount_In_Words_Hidden')).val(Total_Contract_Amount_In_Words);
        // <!-- 上限合同 20230110 start -->
        var Limit_Price_Amount = j$(escapeVfId('allPage:allForm:Limit_Price_Amount_Hidden')).val();
      var Limit_Price_Amount_in_Word = smalltoBIG(Limit_Price_Amount);
        j$(escapeVfId('allPage:allForm:Limit_Price_Amount_in_Word_Hidden')).val(Limit_Price_Amount_in_Word);
        // <!-- 上限合同 20230110 end -->
    }
    //HWAG-BHT7XX 2019/11/26 START
  //   function paytime(status){
@@ -206,6 +232,22 @@
    
   function ChangeTermofPaymentPlanJS(){
      //XLIU-CEP8WW LY 20220905 start
      var saveBT = '{!PageMCEElement.old_Is_RecognitionModel__c}';
      var payment = j$(escapeVfId('allPage:allForm:allBlock:paymentPlan:Term_Of_Payment__c')).val();
      if (saveBT =='true' && payment=='多次付款'){
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("class", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("class", true);
      }
      if (saveBT =='true' && payment=='一次性付款') {
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("disabled", false);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:bottom:PrintButton')).attr("class", false);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("disabled", false);
         j$(escapeVfId('allPage:allForm:allBlock:allButtons:PrintButton')).attr("class", false);
      }
      //XLIU-CEP8WW LY 20220905 end
      ChangeTermofPaymentPlan();
   }
@@ -264,11 +306,16 @@
   <!-- <input type="hidden" value="{!saveErrorflag}" id="saveErrorflag"/> -->
   <!-- // fxk 2021/8/31 点检次数必须填 end -->
   <apex:inputHidden value="{!PageMCEElement.Contract_Amount__c}" id="Contract_Amount_Hidden"/>
   <!-- 上限合同 20230110 start -->
   <apex:inputHidden value="{!PageMCEElement.Limit_Price_Amount__c}" id="Limit_Price_Amount_Hidden"/>
   <apex:inputHidden value="{!PageMCEElement.Limit_Price_Amount_in_Word__c}" id="Limit_Price_Amount_in_Word_Hidden"/>
   <!-- 上限合同 20230110 end -->
   <!-- HWAG-BHT7XX 2019/11/26 START -->
   <apex:inputHidden value="{!PageMCEElement.Amount_Warranty_Coverage__c}" id="Amount_Warranty_Coverage_Hidden" />
   <apex:inputHidden value="{!PageMCEElement.Amount_Warranty_Coverage_In_Word__c}" id="Amount_Warranty_Coverage_In_Word_Hidden"/>
   <!-- HWAG-BHT7XX 2019/11/26 END -->
   <apex:inputHidden value="{!PageMCEElement.Total_Contract_Amount_In_Words__c}" id="Total_Contract_Amount_In_Words_Hidden"/>
   <apex:inputHidden value="{!PageMCEElement.Payment_Plan_Sum_First_in_Word__c}" id="Payment_Plan_Sum_1_in_Word_Hidden"/>
   <apex:inputHidden value="{!PageMCEElement.Payment_Plan_Sum_Second_in_Word__c}" id="Payment_Plan_Sum_2_in_Word_Hidden"/>
   <apex:inputHidden value="{!PageMCEElement.Payment_Plan_Sum_Third_in_Word__c}" id="Payment_Plan_Sum_3_in_Word_Hidden"/>
@@ -307,6 +354,7 @@
      <apex:selectList label="付款方式:" style="margin-right:3px" size="1" id="Term_Of_Payment__c" value="{!PageMCEElement.Term_Of_Payment__c}" onchange="ChangeTermofPaymentPlanJS();">
           <apex:selectOptions value="{!Term_Of_Payment}"/>
        </apex:selectList>
<!--         <apex:input id = "Upperlimit" style="display:none" value="{!PageMCEElement.agree_Upper_limit__c}"/> -->
        <apex:outputPanel style="display: {!IF(Check_Of_Payment, '', 'none')}" >
           <h2 style="margin-left:4%;">一次性付款:</h2>
           <p style="margin-left:4%;">
@@ -467,7 +515,9 @@
            <apex:selectList style="margin-right:3px" size="1" id="Small_Repair_Time__c" value="{!PageMCEElement.Small_Repair_Time__c}">
                  <apex:selectOptions value="{!Small_Repair_Time}"/>
              </apex:selectList>
           小时
           <!-- XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start-->
           工作日
           <!-- XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end-->
         </td>
         <td style ="text-align: left;">
@@ -487,7 +537,10 @@
         </td>
         <td style ="text-align: left;">
            <apex:selectList style="margin-right:3px" size="1" id="Live_Technical_Support_Time__c" value="{!PageMCEElement.Live_Technical_Support_Time__c}">
                  <apex:selectOptions value="{!Small_Repair_Time}"/>
               <!-- XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start-->
                  <!--<apex:selectOptions value="{!Small_Repair_Time}"/>-->
                  <apex:selectOptions value="{!Live_Technical_Support_Time}"/>
                  <!-- XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end-->
              </apex:selectList>
           小时
         </td>
@@ -582,14 +635,13 @@
   </div>
   </apex:outputPanel>
    </apex:pageBlockSection>
      <apex:pageBlockButtons >
      <apex:pageBlockButtons id="allButtons">
      <apex:outputPanel rendered="{!IF(PageMCEElement.Status__c != '引合中', 'true', 'false')}">
         <apex:commandButton disabled="true" id="SaveButton1" value="保存"  action="{!save}" onclick="blockme();" reRender="hiddenInput,Messages"  oncomplete="CloseJs();"/>
         <apex:commandButton disabled="true" id="CancelButton1" value="取消" onclick="CloseJs(); return false;"/>
         <apex:commandButton disabled="true" id="PrintButton1" value="打印" action="{!print}" onclick="blockme();" rerender="hiddenInput,Messages,pdfPrint"  oncomplete="PrintJs();" />         
      </apex:outputPanel>
      <apex:outputPanel rendered="{!IF(PageMCEElement.Status__c == '引合中', 'true', 'false')}">
      <apex:outputPanel id="bottom" rendered="{!IF(PageMCEElement.Status__c == '引合中', 'true', 'false')}">
         <apex:commandButton id="SaveButton" value="保存"  action="{!save}" onclick="blockme();" reRender="hiddenInput,Messages"  oncomplete="CloseJs();"/>
         <apex:commandButton id="CancelButton" value="取消" onclick="CloseJs(); return false;"/>
         <apex:commandButton id="PrintButton" value="打印" action="{!print}" onclick="blockme();" rerender="hiddenInput,Messages,pdfPrint"  oncomplete="PrintJs();" />
@@ -609,19 +661,34 @@
         if ('{!printContract}' == 'true') {
            //HWAG-BHT7XX 2019/11/26 START
            if('{!agreeUpperLimit}' == 'true'){
            // 打印医院合同配置
            // 打印医院限次合同配置
             window.open('/apex/NewMCHPDFLimit?id={!PageMCEElement.id}', 'MCHLimitPDF');
             window.close();
             // 打印医院上限合同配置
            }else if('{!UpperLimitPrice}' == 'true'){
            window.open('/apex/NewMCHPDFUpperLimit?id={!PageMCEElement.id}', 'MCHUpperLimitPDF');
             window.close();
            }else{
            // 打印医院合同配置
             window.open('/apex/NewMCHPDF?id={!PageMCEElement.id}', 'MCHPDF');
             window.close();
            }
            //HWAG-BHT7XX 2019/11/26 END
          }else if ('{!printAgent}' == 'true') {
          //打印经销商合同
          window.open('/apex/NewMCAgentPDF?id={!PageMCEElement.id}', 'MCHPDF');
          window.close();
             if('{!agreeUpperLimit}' == 'true'){
            //打印经销商限次合同
             window.open('/apex/NewMCAgentPDFLimit?id={!PageMCEElement.id}', 'MCAgentLimitPDF');
             window.close();
             // 打印经销商上限合同配置
            }else if('{!UpperLimitPrice}' == 'true'){
            window.open('/apex/NewMCAgentPDFUpperLimit?id={!PageMCEElement.id}', 'MCAgentUpperLimitPDF');
             window.close();
            }else{
            //打印经销商合同
             window.open('/apex/NewMCAgentPDF?id={!PageMCEElement.id}', 'MCHPDF');
             window.close();
            }
         }else {
            alert('1');
         }