From bfca7a84bec815da594f1d12558535ed06d2490b Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 13 九月 2022 09:57:32 +0800
Subject: [PATCH] 本地提交备份

---
 force-app/main/default/pages/SelectAssetEstimateVM.page |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/force-app/main/default/pages/SelectAssetEstimateVM.page b/force-app/main/default/pages/SelectAssetEstimateVM.page
index b448d2d..ab498f6 100644
--- a/force-app/main/default/pages/SelectAssetEstimateVM.page
+++ b/force-app/main/default/pages/SelectAssetEstimateVM.page
@@ -7,8 +7,8 @@
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
     <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
     <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
-    <apex:includeScript value="/soap/ajax/29.0/connection.js"/>
-    <apex:includeScript value="/soap/ajax/29.0/apex.js"/>
+    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
+    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
 <style type="text/css">
     table { border-collapse: collapse; }
     
@@ -61,7 +61,7 @@
     var FirstParagraphEnd = j$(escapeVfId('allPage:allForm:allBlock:contract:FirstParagraphEnd'))[0].checked;
     if(FirstParagraphEnd){
         if (confirm('鏈绛剧害缁忛攢鍟嗘槸鍏堟瀵硅薄锛岃纭鏄惁鎻愪氦鎶ヤ环锛�')) {
-			return true; 
+            return true; 
         }else{
             return false;  
         }
@@ -465,10 +465,18 @@
                     var Estimate_Num = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Estimate_NumHidden')).val();
                     if(Estimate_Num == 0){
                         if(LastMContractRecord == 'VM_Contract'){
-                            //upPrice = (strMoney) * (1 + Adjustment_ratio_Upper/100);
-                            //downPrice = (strMoney) * (1 + Adjustment_ratio_Lower/100);
-                            upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
-                            downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
+                            // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
+                            var nowdate = new Date();
+                            lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
+                            nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
+                            if(nowdate < Date.parse(lastendDate)){
+                                upPrice = strMoney;
+                                downPrice = strMoney * 0.8;
+                            }else{
+                                upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
+                                downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
+                            }
+                            // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
                         }else{
                             upPrice = strMoney;
                             downPrice = strMoney * 0.8;
@@ -555,6 +563,8 @@
                 }
                 //鏈�鍚庣粨鏉熸棩+1骞�
                 lastendDate.setMonth(lastendDate.getMonth() + 12);
+                // alert('+++++++++--------' + lastendDate);
+                // alert('+++++++++--------' + Date.parse(contractStartDate) + '77777' + Date.parse(lastendDate));
                 if (Date.parse(contractStartDate) > Date.parse(lastendDate)) {
                     oyearCount ++;
                 }
@@ -573,10 +583,19 @@
                 var Estimate_Num = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Estimate_NumHidden')).val();
                 if(Estimate_Num == 0){
                     if(LastMContractRecord == 'VM_Contract'){
-                        //upPrice = (strMoney) * (1 + Adjustment_ratio_Upper/100);
-                        //downPrice = (strMoney) * (1 + Adjustment_ratio_Lower/100);
-                        upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
-                        downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
+                        // alert('11111');
+                        // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
+                        var nowdate = new Date();
+                        lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
+                        nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
+                        if(nowdate < Date.parse(lastendDate)){
+                            upPrice = strMoney;
+                            downPrice = strMoney * 0.8;
+                        }else{
+                            upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
+                            downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
+                        }
+                        // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
                     }else{
                         upPrice = strMoney;
                         downPrice = strMoney * 0.8;
@@ -1591,6 +1610,7 @@
                                         <apex:inputHidden value="{!ar.mcae.Estimate_List_Price__c}" id="assetListPriceHidden"/>
                                         <apex:inputHidden value="{!ar.mcae.Estimate_List_Price_Page__c}" id="assetListPricePageHidden" />
                                         <apex:inputHidden value="{!ar.rec.CurrentContract_F__r.Estimate_Num__c}" id="Estimate_NumHidden" />
+
                                     </apex:outputPanel>
                                     
                                     <apex:outputPanel layout="none" rendered="{!Not($ObjectType.Maintenance_Contract_Asset_Estimate__c.createable)}" >
@@ -2015,6 +2035,7 @@
                         <td><apex:outputField value="{!estimate.Contract_End_Date__c}" id="contractenddate"/></td>
                         <td>&nbsp;</td>
                         <td><apex:commandButton id="decidebtn" value="{!$Label.QuoteDecision_Button}" disabled="{!DecideBtnDisabled}" onclick="decideJs(); return false;"/></td>
+                        <!-- <td><apex:commandButton id="decidebtn1" value="{!$Label.QuoteDecision_Button}" action="{!dosomething}"/></td> -->
                         <td style="text-align:right"><apex:commandButton id="undecidebtn" action="{!undecide}" value="鍙栨秷{!$Label.QuoteDecision_Button}" disabled="{!UnDecideBtnDisabled}" rerender="allForm" onclick="blockme();" oncomplete="unblockUI();"/></td>
                     </tr>
                 </table>

--
Gitblit v1.9.1