From cc7487a59bd4b0fa5bed1dd59f6d0565ace81b8b Mon Sep 17 00:00:00 2001
From: 李金换 <lijinhuan@prec-tech.com>
Date: 星期五, 21 四月 2023 09:48:22 +0800
Subject: [PATCH] opd计划Cl3

---
 force-app/main/default/pages/SelectAssetEstimateVM.page |  754 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 704 insertions(+), 50 deletions(-)

diff --git a/force-app/main/default/pages/SelectAssetEstimateVM.page b/force-app/main/default/pages/SelectAssetEstimateVM.page
index aaba2e2..2644530 100644
--- a/force-app/main/default/pages/SelectAssetEstimateVM.page
+++ b/force-app/main/default/pages/SelectAssetEstimateVM.page
@@ -1,4 +1,4 @@
-<apex:page controller="SelectAssetEstimateVMController" tabStyle="Maintenance_Contract_Estimate__c" sidebar="false" showHeader="true" id="allPage" action="{!init}">
+<apex:page controller="SelectAssetEstimateVMController" tabStyle="Maintenance_Contract_Estimate__c" lightningStylesheets="true" sidebar="false" showHeader="true" id="allPage" action="{!init}">
 <head>
  <!-- <meta http-equiv="x-ua-compatible" content="ie=edge" /> -->
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1" /> -->
@@ -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; }
     
@@ -40,14 +40,45 @@
 var Confirm_EstimateRefresh = '宸茶秴杩囧垱寤烘棩3涓湀锛屾槸鍚︽洿鏂版姤浠凤紵';
 window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
 
+var RCbottonChanged = 0;
+
+// 2022鏁呴殰鍝佸姞璐� start
+// var RCButtonDisable = document.getElementById("emailSend");
+// RCButtonDisable.style.display = "none";
+// 2022鏁呴殰鍝佸姞璐� end
+
+var hasSendEmail = {!hasSendEmail};
+console.log('***hasSendEmail',hasSendEmail);
+// if(hasSendEmail == true){
+//     j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+//     j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+//     console.log('宸叉彁浜C 鎸夐挳涓嶅彲瑙�');
+// }
+
 function approvalJs() {
     approvalDate = new Date();
     var rowCnt = j$(escapeVfId('allPage:allForm:allBlock:assetSection:productCnt')).val();
     refreshAsset(rowCnt);
 }
-
+//鏁呴殰鍝佸姞璐� RC 鐐瑰嚮鍚庝笉鍙
+function rcJs() {
+    hasSendEmail = true;
+    j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+    j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+    console.log('鐐瑰嚮RC 鎸夐挳涓嶅彲瑙乭asSendEmail' +hasSendEmail);
+}
 //add by gwy 2021-01-27 start 鎻愪氦鏃剁殑鎻愮ず妗�
 function KindsAndMonths() {
+   //   鏁呴殰鍝佸姞璐� 绯荤粺妫�鏌ヤ慨鐞嗗噺浠峰鎵瑰畬鎴� Start
+         ISReduced = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+        console.log('鐐瑰嚮鎻愪氦寰呭鎵规椂 鏄惁瀹℃壒閫氳繃='+ISReduced);
+        if( ISReduced == '瀹℃壒涓�' || ISReduced == '鏈夊叓鎶樹互涓嬪緟瀹℃壒'){
+            alert('璇烽�氳繃淇悊鍑忎环瀹℃壒鍐嶆彁浜�');
+            // approvalbtntop1.style.display = "none";
+            return false;
+        }
+    
+    //   鏁呴殰鍝佸姞璐� 绯荤粺妫�鏌ヤ慨鐞嗗噺浠峰鎵瑰畬鎴� end
     var months      = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
     var contrNew    = document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXT").innerHTML;
     if(months>12 && months<60 && contrNew == '鏂板搧鍚堝悓'){
@@ -57,16 +88,16 @@
             return false;  
         }
     }
-    // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220407 start
-    var FirstParagraphEnd = j$(escapeVfId('allPage:allForm:allBlock:contract:FirstParagraphEnd')).val();
-    if(FirstParagraphEnd == 'on'){
+    // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220408 start
+    var FirstParagraphEnd = j$(escapeVfId('allPage:allForm:allBlock:contract:FirstParagraphEnd'))[0].checked;
+    if(FirstParagraphEnd){
         if (confirm('鏈绛剧害缁忛攢鍟嗘槸鍏堟瀵硅薄锛岃纭鏄惁鎻愪氦鎶ヤ环锛�')) {
-			return true; 
+            return true; 
         }else{
             return false;  
         }
     }
-    // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220407 end
+    // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220408 end
     return true;
 }
 //add by gwy 2021-01-27 end 鎻愪氦鏃剁殑鎻愮ず妗�
@@ -89,6 +120,9 @@
     j$("#sbArea").fadeOut(500, function(){
         j$("#sbArea").remove();
     });
+  
+    console.log('鍙戦�侀偖浠舵垚鍔�');
+   
 }
 //<!-- HWAG-B4R3SS  START 20181026-->
 function clearAndSearch() {
@@ -105,14 +139,37 @@
 //<!-- HWAG-B4R3SS  END 20181026-->
 // 鍒濆鍖栬瀹氱敾闈㈤」鐩笉鍙敤
 function pageSetDisabled(){
+    // if (RCbottonChanged == 0) {
+    //     console.log('test鍒濆鍖�');
+        // 鏁呴殰鍝佸姞璐� 鎻愪氦RC鎸夐挳涓嶅彲瑙� start
+        // j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+        // j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+        // 鏁呴殰鍝佸姞璐� 鎻愪氦RC鎸夐挳涓嶅彲瑙� end
+    // }
+    // 鏁呴殰鍝佸姞璐� start
+    var hasSendEmail ={!hasSendEmail};
+    console.log('page hasSendEmail',hasSendEmail);
+    if(hasSendEmail == true){
+        j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+        j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+        console.log('宸叉彁浜C 鎸夐挳涓嶅彲瑙� page set');
+    }
+
+    //鏁呴殰鍝佸姞璐� end
     var isDisabled = {!PageDisabled};
+    // ResonCannotWarranty = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ResonCannotWarranty')).value();
+    // if(!ResonCannotWarranty.contains("寮冧慨")){
+    //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto')).attr("display", none);
+    // }
     if (isDisabled) {
+
         j$(escapeVfId('allPage:allForm:allBlock:contract:depart')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:contract:estimateTarget')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:contract:EndUserType')).attr("disabled", true);
         var rowCnt = {!productCount};
+        console.log('isDisabled='+isDisabled);
         for (var i = 0; i < rowCnt; i++) {
             // alert(11111111111111 +rowCnt);
             var isManual = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':IsManual')).text();
@@ -123,6 +180,7 @@
             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetCheck')).attr("disabled", true);
             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).attr("disabled", true);
             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':comment')).attr("disabled", true);
+            j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Third_Party_Return__c')).attr("disabled", true);
         }
         j$(escapeVfId('allPage:allForm:allBlock:appendCondition:Examination_Count')).attr("disabled", true);
         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:disPercent')).attr("disabled", true);
@@ -191,7 +249,9 @@
     // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk star
     // disable1();
     // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk end
+    console.log('ApprovalBtnDisabled=='+{!ApprovalBtnDisabled});
     pageSetDisabled();
+    refreshAsset({!productCount});
     var createdDate = new Date('{!estimate.CreatedDate}');
     // 鎶ヤ环涓澶囩殑鏈鸿韩缂栫爜涓虹┖鏃剁殑鏂板搧鍚堝悓鏈夋晥鏈熷欢闀� 20200710 gzw
     var aLLManual = 'true';
@@ -222,6 +282,11 @@
             //j$(escapeVfId('allPage:allForm:decidebtn')).attr("disabled", true);
             j$(escapeVfId('allPage:allForm:savebtn')).attr("class", 'btnDisabled');
             j$(escapeVfId('allPage:allForm:approvalbtn')).attr("class", 'btnDisabled');
+
+            //鏁呴殰鍝佸姞璐� RC鎸夐挳 
+            j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+            j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+
             //j$(escapeVfId('allPage:allForm:decidebtn')).attr("class", 'btnDisabled');
             
             if (confirm(Confirm_EstimateRefresh)) {
@@ -254,6 +319,10 @@
             //j$(escapeVfId('allPage:allForm:decidebtn')).attr("disabled", true);
             j$(escapeVfId('allPage:allForm:savebtn')).attr("class", 'btnDisabled');
             j$(escapeVfId('allPage:allForm:approvalbtn')).attr("class", 'btnDisabled');
+
+            //鏁呴殰鍝佸姞璐筊C鎸夐挳
+            j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+            j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
             //j$(escapeVfId('allPage:allForm:decidebtn')).attr("class", 'btnDisabled');
             
             if (confirm('宸茶秴杩囧垱寤烘棩6涓湀锛屾槸鍚︽洿鏂版姤浠凤紵')) {
@@ -277,19 +346,15 @@
 
 function checkAll(checker) {
     var cnt = j$(escapeVfId('allPage:allForm:allBlock:assetSection:productCnt')).val();
-
+    debugger;
     for (var i = 0; i < cnt; i++) {
         //2021-11-30 fy add LJPH-C8W8FV 缃《 start
-        //if (j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox')).size() == 0) {
-        //    continue;
-        //}else{
-        //    document.getElementById('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox').checked = checker.checked;
-        //}
-        //2021-11-30 fy add LJPH-C8W8FV 缃《 end
-	 if (j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox')).size() == 0) {
-            break;
+        if (j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox')).size() == 0) {
+            continue;
+        }else{
+            document.getElementById('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox').checked = checker.checked;
         }
-        document.getElementById('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetRowCheckbox').checked = checker.checked;
+        //2021-11-30 fy add LJPH-C8W8FV 缃《 end
     }
 }
 
@@ -343,13 +408,23 @@
     //contractStartDateChange();
     refreshAsset(cnt);
 }
-
+function toChange1(){
+    tochange();
+    ISReducedpriceapproval = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+    console.log('鏂规硶1鏄惁瀹℃壒閫氳繃=='+ISReducedpriceapproval+'====================');
+}
+function toChange2(){
+    tochange2();
+    ISReducedpriceapproval = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+    console.log('鏂规硶2鏄惁瀹℃壒閫氳繃=='+ISReducedpriceapproval+'==============');
+}
 function refreshAsset(cnt) {
-    // alert(cnt);
+     // alert(cnt);
     // 鎻愪氦鍚庡氨椤甸潰涓嶈绠椾簡
     var isDisabled = {!PageDisabled};
     // 鍚堝悓鎬荤悊
     var newCount = 0;
+    var isresduce = 0;
     var oyearCount = 0;
     var firstCCount = 0;
     var conCCount = 0;
@@ -359,7 +434,22 @@
     // 鏂板搧鍚堝悓 鍒ゆ柇
     var newCon = true;
     var contractStartDate = new Date(j$(escapeVfId('allPage:allForm:contractstartdate')).value());
+    //涓婇檺鍚堝悓 20230103 LY start
+    // var mainteReal = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:mainteReal')).text();
+    // Limit_Price_Amount = localParseFloat(mainteReal)*1.3;
+    // console.log('Limit_Price_Amount'+Limit_Price_Amount);
+    // j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Limit_Price_Amount')).val(Limit_Price_Amount);
+    
+    //涓婇檺鍚堝悓 20230103 LY end
+    //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 start
+    var GuranteeCount = 0;
+    //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 end
 
+    //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� 鏄惁涓篎SE start
+    var isFSE = {!isFSE};
+    // var isFSE = true;
+    console.log('***isFSE',isFSE);
+    //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� end
 
     // 棰勫畾寮�濮嬫棩
     var startdate = new Date(j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value());
@@ -397,13 +487,14 @@
         var downPrice = 0;
         // 涓婄嚎浠锋牸
         var upPrice = 0;
-
+        
         // 12涓湀鍚堝悓閲戦
         var Price_YearTXT = 0;
         
         var isManual = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':IsManual')).text();
         var isnew = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetNewHidden')).val();
         var assetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
+        console.log('***isManual=:'+isManual);
         if (isManual == 'true') {
             var a = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Assert')).value();
             if (a != '') {
@@ -436,6 +527,10 @@
                     var lastContRange = 0;
                     if(LastMContractRecord == 'VM_Contract'){
                         newCount++;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                        GuranteeCount++;
+                        newCon = false;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
                         lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                         lastContRange = 36;
                     }else{
@@ -461,10 +556,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;
@@ -540,6 +643,10 @@
                 var lastContRange = 0;
                 if(LastMContractRecord == 'VM_Contract'){
                     newCount++;
+                    //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                    GuranteeCount++;
+                    newCon = false;
+                    //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
                     lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                     lastContRange = 36;
                 }else{
@@ -547,6 +654,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 ++;
                 }
@@ -565,10 +674,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;
@@ -603,14 +721,70 @@
             }
             //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text(toNumComma(strMoney));
             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPricePageHidden')).val(strMoney);
-            // 
-            repairMoney = j$.trim(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value());
+            //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->  
+
+            Repair_Price_AutoPrice = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto'));
+            Repair_Price_Auto = Repair_Price_AutoPrice.value();
+            repairMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value();
+            Repair_Price_pass = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_pass')).val();
+            console.log((i+1)+'鍙穜epairMoney='+repairMoney);
+            console.log((i+1)+'鍙稲epair_Price_Auto='+Repair_Price_Auto);
+            if ((repairMoney+1)==1) {
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(Repair_Price_Auto);
+                console.log('repairMoney淇敼鎴愬姛');
+            }
+            if ((Repair_Price_pass+1)==1) {
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_pass')).val(Repair_Price_Auto);
+                console.log('Repair_Price_pass淇敼鎴愬姛');
+            }
+            repairMoney1 = localParseFloat(repairMoney);
+            ISReducedpriceapproval = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+            console.log('ISReducedpriceapproval=='+ISReducedpriceapproval);
+            var isDisabled = {!PageDisabled};
+            if (ISReducedpriceapproval =='鏈夊叓鎶樹互涓嬪緟瀹℃壒' || ISReducedpriceapproval =='鏄�'|| isDisabled) {
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).attr("disabled", true);
+            }else{
+                console.log('鏃犲叓鎶樹互涓嬪緟瀹℃壒鍜屾槸鐨勯噾棰�');
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).attr("disabled", false);
+            }
+            ISReducedpriceapproval1 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval1')).val();
+            ISReduced = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+            if (repairMoney1> 0 && (repairMoney1 <Repair_Price_Auto*0.80)) {
+                
+                isresduce = isresduce+1;
+            }
+          
+            console.log('鍒濆鍖杋sresduce='+isresduce);
+        
+            ResonCannotWarranty = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ResonCannotWarranty')).value();
+            rppa =  document.getElementById('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto');
+            situation = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_situation')).value();
+            // Agreed_Date =  j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Agreed_Date')).value();
+
+            console.log('situation='+situation);
+            // console.log('Agreed_Date1='+Agreed_Date);
+            if(!(ResonCannotWarranty.indexOf("寮冧慨") != -1)&&(repairMoney+1)==1){
+                    rppa.style.display = "none";
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val('');
+                    console.log('###淇敼鎴愬姛');
+            }
+            console.log('鍒ゆ柇1'+(situation.indexOf("淇悊涓�")!=-1));
+            // console.log('鍒ゆ柇'+(Agreed_Date.indexOf("涓嶄负绌�")!=-1));
+            // if ((situation.indexOf("淇悊涓�")!=-1)&& (Agreed_Date.indexOf("涓嶄负绌�")!=-1)) {
+            //     console.log('寮�濮嬫搷浣�2');
+            //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto')).val(0);
+            //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(0);
+            // }
+        //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end -->
         }
+        
         repairSum = repairSum + localParseFloat(repairMoney);
         listSum = listSum + localParseFloat(toNum(strMoney));
         downPriceSum = downPriceSum + localParseFloat(toNum(downPrice));
         upPriceSum =  upPriceSum + localParseFloat(toNum(upPrice));
     }
+    
+   
     j$(escapeVfId('allPage:allForm:allBlock:assetRepairSumNum')).text(toNumComma(repairSum));
     //j$(escapeVfId('allPage:allForm:allBlock:assetListSumNum')).text(toNumComma(listSum));
     
@@ -629,8 +803,437 @@
     var result = '';
     if (allcount == 0) {
         result = null;
-    }else
-    if (newCount > 0 && newCount == allcount && newCon == true) {
+    //濡傛灉鎵�鏈夎澶囩殑涓婃湡鍚堝悓閮芥槸澶氬勾淇濆悎鍚岋紝鍒欏悎鍚岀绫讳负甯傚満澶氬勾淇濈画绛惧悎鍚� thh 20220315 start
+    }else if(GuranteeCount > 0 && GuranteeCount == allcount){
+        result = '甯傚満澶氬勾淇濈画绛惧悎鍚�';
+    //濡傛灉鎵�鏈夎澶囩殑涓婃湡鍚堝悓閮芥槸澶氬勾淇濆悎鍚岋紝鍒欏悎鍚岀绫讳负甯傚満澶氬勾淇濈画绛惧悎鍚� thh 20220315 end
+    }else if (newCount > 0 && newCount == allcount && newCon == true) {
+        result = '鏂板搧鍚堝悓';
+    }else if (((newCount > 0 && newCount == allcount) ||(newCount + firstCCount == allcount)) && newCon == false) {
+        result = '棣栫鍚堝悓';
+    }else if(firstCCount > 0 && firstCCount == allcount){
+        result = '棣栫鍚堝悓';
+    // 20220328 ljh update  LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 start
+    // }else if(oyearCount > 0 && oyearCount == conCCount){
+    }else if(oyearCount > 0 && oyearCount == conCCount && allcount == oyearCount ){
+    // 20220328 ljh update  LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 start
+        result = '闈炵画绛惧悎鍚岋紙绌虹櫧鏈熶竴骞翠互涓婏級';
+    }else{
+        result = '缁鍚堝悓';
+    }
+    console.log(result);
+    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXT").innerHTML = result;
+    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXTHidden").value = result;
+     
+    // 鍙栨秷閰稿寲姘�
+    //NotUseOxygenatedWaterAmount(1);
+    examinationPriceCal(cnt);
+    getLastContractRate();
+}
+function changeAsset(cnt) {
+    // alert(cnt);
+    // 鎻愪氦鍚庡氨椤甸潰涓嶈绠椾簡
+    var isDisabled = {!PageDisabled};
+    // 鍚堝悓鎬荤悊
+    var newCount = 0;
+    var isresduce = 0;
+    var oyearCount = 0;
+    var firstCCount = 0;
+    var conCCount = 0;
+    // row閲戦鍚堣▓
+    var repairSum = 0;
+    var listSum = 0;
+    // 鏂板搧鍚堝悓 鍒ゆ柇
+    var newCon = true;
+    var contractStartDate = new Date(j$(escapeVfId('allPage:allForm:contractstartdate')).value());
+
+    //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 start
+    var GuranteeCount = 0;
+    //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 end
+
+    //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� 鏄惁涓篎SE start
+    var isFSE = {!isFSE};
+    // var hasSendEmail = {!hasSendEmail};
+
+    // var isFSE = true;
+    console.log('***isFSE',isFSE);
+    // console.log('***hasSendEmail',hasSendEmail);
+    // if(hasSendEmail == true){
+    //     j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
+    //     j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
+    //     console.log('8鎶樹互涓嬫彁浜C鍙 ');
+    // }
+                 
+
+    //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� end
+
+    // 棰勫畾寮�濮嬫棩
+    var startdate = new Date(j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value());
+    // 棰勫畾寮�濮嬫棩-6涓湀
+    startdate.setMonth(startdate.getMonth() - 6);
+    // 鐢宠鏃� 褰撳墠鏃ユ湡
+    if(approvalDate != ''){
+        //鐢宠鏃�
+        approvalDate = new Date(approvalDate.toLocaleDateString());
+        if (Date.parse(approvalDate) < Date.parse(startdate)) {
+            newCon = false;
+        }
+
+    }
+
+    // 鏈�楂樸�佹渶浣庝环鏍煎悎璁�
+    var downPriceSum = 0;
+    var upPriceSum = 0;
+    // 鍚堝悓鏈堟暟涔楃畻
+    var month = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
+    if (month == undefined || month == "") {
+        month = 1;
+    }
+    var month2 = 0;
+    if (month > 12) {
+        month2 = month - 12;
+        month = 12;
+    }
+    for (var i = 0; i < cnt; i++) {
+        var strMoney = 0;
+        var repairMoney = 0;
+        // 琛岄」鐩� 鏈�楂樸�佹渶浣庝环鏍煎悎璁�
+        // 缁浠锋牸鍙栬仈鍔ㄤ环鏍奸〉闈㈣绠楋紝棣栫鎴栦骇鍝佸彇 瀹為檯浠锋牸
+        // 涓嬬嚎浠锋牸
+        var downPrice = 0;
+        // 涓婄嚎浠锋牸
+        var upPrice = 0;
+        
+        // 12涓湀鍚堝悓閲戦
+        var Price_YearTXT = 0;
+        
+        var isManual = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':IsManual')).text();
+        var isnew = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetNewHidden')).val();
+        var assetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
+        if (isManual == 'true') {
+            var a = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Assert')).value();
+            if (a != '') {
+                // 鎵�鏈夎澶囨寜瀹夎鏃ャ�佸彂璐ф棩锛堟渶鏃╃殑锛夛紝璺濈鍚堝悓寮�濮嬫棩6涓湀鍐呴兘鏄柊鍝佸悎鍚�
+                //var isNewDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':isNewDate')).value());
+                //isNewDate.setMonth(isNewDate.getMonth() + 6);
+                //if (Date.parse(contractStartDate) > Date.parse(isNewDate)) {
+                //    newCon = false;
+                //}
+
+                strMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
+                // alert(strMoney);
+                Price_YearTXT = strMoney * 12;
+                if (isnew == 'true') {
+                    newCount ++;
+                    strMoney = month * strMoney + month2 * strMoney / {!isNewPriceAdj};
+                } else {
+                    newCon = false;
+                    strMoney = month * strMoney + month2 * strMoney;
+                }
+                var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value();
+                var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
+                if(b != ''){
+                    conCCount ++;
+                    // 1.鍚堝悓鏈熶笉婊′竴骞存椂锛屽悎鍚屾湡瓒呰繃涓�鍗婃墠鍙紑濮嬬画绛炬姤浠枫��(eg:11涓湀鐨勫悎鍚屼粠6涓湀鍚庢墠鍙姤浠枫��)
+
+                    // 2.涓�骞翠互涓婄殑鍚堝悓锛屽湪缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ紑鏀剧画绛炬姤浠枫��
+
+                    var lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':End_Date')).value());
+                    var lastContRange = 0;
+                    if(LastMContractRecord == 'VM_Contract'){
+                        newCount++;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                        GuranteeCount++;
+                        newCon = false;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
+                        lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
+                        lastContRange = 36;
+                    }else{
+                        lastContRange = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':lastContRange')).value();
+                    }
+                    //鏈�鍚庣粨鏉熸棩+1骞�
+                    lastendDate.setMonth(lastendDate.getMonth() + 12);
+                    if (Date.parse(contractStartDate) > Date.parse(lastendDate) ) {
+                        oyearCount ++;
+                    }
+                    // 鍙栬仈鍔ㄤ环鏍�
+                    // 涓婁竴鏈熷悎鍚屽疄闄呮姤浠锋湀棰�
+                    // 
+                    var LastMContract_Price = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContract_Price')).val());
+                    var Adjustment_ratio_Lower = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Lower')).val());
+                    var Adjustment_ratio_Upper = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Upper')).val());
+                    //璁$畻鎯╃綒鐜�
+                    var Punish = calculateNtoMRatio( lastContRange,(month + month2));
+                    if(Punish == 0){
+                        return;
+                    }
+                    // 鍒ゆ柇鏈夋棤鎶ヤ环锛氭病鏈夋寜鐓ф爣鍑嗕环鏍煎疄闄呰仈鍔�
+                    var Estimate_Num = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Estimate_NumHidden')).val();
+                    if(Estimate_Num == 0){
+                        if(LastMContractRecord == 'VM_Contract'){
+                            // 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;
+                        }
+                    }else{
+                        upPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Upper/100);
+                        downPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Lower/100);
+                    }
+                }else{
+                    //firstCCount ++;
+                    upPrice = strMoney;
+                    downPrice = strMoney * 0.8;
+                }
+                // 涓婁笅闄愬洓鑸嶄簲鍏�
+                upPrice = upPrice.toFixed(2);
+                downPrice = downPrice.toFixed(2);
+                // 12涓湀鍚堝悓閲戦
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXT')).text(toNumComma(Price_YearTXT));
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXTHidden')).val(Price_YearTXT);
+                if (!isDisabled) {
+                    // 瀹為檯鑱斿姩浠锋牸 start
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice));
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(downPrice);
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice));
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(upPrice);
+                    // 瀹為檯鑱斿姩浠锋牸 end
+                }
+                
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text(toNumComma(strMoney));
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPricePageHidden')).val(strMoney);
+                
+                repairMoney = j$.trim(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value());
+            } else {
+                // TODO 涓�鏅傜殑銇蹇溿�併仾銈撱仹鍒ヨ銇噾椤嶃儶銉曘儸銉冦偡銉ャ仌銈屻仧锛�
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text("");
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPricePageHidden')).val();
+
+                // 12涓湀鍚堝悓閲戦
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXT')).text("");
+                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXTHidden')).val();
+                if (!isDisabled) {
+                    // 瀹為檯鑱斿姩浠锋牸 start
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text("");
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val();
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text("");
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val();
+                    // 瀹為檯鑱斿姩浠锋牸 end
+                 }
+            }
+        }
+        else {
+            // 鎵�鏈夎澶囨寜瀹夎鏃ャ�佸彂璐ф棩锛堟渶鏃╃殑锛夛紝璺濈鍚堝悓寮�濮嬫棩6涓湀鍐呴兘鏄柊鍝佸悎鍚�
+            var isNewDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':isNewDate')).value());
+            isNewDate.setMonth(isNewDate.getMonth() + 6);
+            if (Date.parse(contractStartDate) > Date.parse(isNewDate)) {
+                newCon = false;
+            }
+            strMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
+            Price_YearTXT = strMoney * 12;
+            if (isnew == 'true') {
+                strMoney = month * strMoney + month2 * strMoney / {!isNewPriceAdj};
+            } else {
+                strMoney = month * strMoney + month2 * strMoney;
+            }
+            var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value(); 
+            var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
+            if(b != ''){
+                conCCount ++;
+                // 1.鍚堝悓鏈熶笉婊′竴骞存椂锛屽悎鍚屾湡瓒呰繃涓�鍗婃墠鍙紑濮嬬画绛炬姤浠枫��(eg:11涓湀鐨勫悎鍚屼粠6涓湀鍚庢墠鍙姤浠枫��)
+
+                // 2.涓�骞翠互涓婄殑鍚堝悓锛屽湪缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ紑鏀剧画绛炬姤浠枫��
+                var lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':End_Date')).value());
+                var lastContRange = 0;
+                if(LastMContractRecord == 'VM_Contract'){
+                    newCount++;
+                    //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                    GuranteeCount++;
+                    newCon = false;
+                    //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
+                    lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
+                    lastContRange = 36;
+                }else{
+                    lastContRange = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':lastContRange')).value();
+                }
+                //鏈�鍚庣粨鏉熸棩+1骞�
+                lastendDate.setMonth(lastendDate.getMonth() + 12);
+                // alert('+++++++++--------' + lastendDate);
+                // alert('+++++++++--------' + Date.parse(contractStartDate) + '77777' + Date.parse(lastendDate));
+                if (Date.parse(contractStartDate) > Date.parse(lastendDate)) {
+                    oyearCount ++;
+                }
+                // 鍙栬仈鍔ㄤ环鏍�
+                // 涓婁竴鏈熷悎鍚屽疄闄呮姤浠锋湀棰�
+                // 
+                var LastMContract_Price = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContract_Price')).val());
+                var Adjustment_ratio_Lower = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Lower')).val());
+                var Adjustment_ratio_Upper = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Upper')).val());
+                //璁$畻鎯╃綒鐜�
+                var Punish = calculateNtoMRatio( lastContRange,(month + month2));
+                if(Punish == 0){
+                    return;
+                }
+                // 鍒ゆ柇鏈夋棤鎶ヤ环锛氭病鏈夋寜鐓ф爣鍑嗕环鏍煎疄闄呰仈鍔�
+                var Estimate_Num = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Estimate_NumHidden')).val();
+                if(Estimate_Num == 0){
+                    if(LastMContractRecord == 'VM_Contract'){
+                        // 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;
+                    }
+                }else{
+                    upPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Upper/100);
+                    downPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Lower/100);
+                }
+            }else{
+                if (isnew == 'true') {
+                    newCount ++;
+                } else {
+                    newCon = false;
+                    firstCCount ++;
+                }
+                upPrice = strMoney;
+                downPrice = strMoney * 0.8;
+            }
+            // 涓婁笅闄愬洓鑸嶄簲鍏�
+            upPrice = upPrice.toFixed(2);
+            downPrice = downPrice.toFixed(2);
+            // 12涓湀鍚堝悓閲戦
+            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXT')).text(toNumComma(Price_YearTXT));
+            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXTHidden')).val(Price_YearTXT);
+            if (!isDisabled) {
+                // 瀹為檯鑱斿姩浠锋牸 start
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice));
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(downPrice);
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice));
+                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(upPrice);
+                // 瀹為檯鑱斿姩浠锋牸 end
+            }
+            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text(toNumComma(strMoney));
+            j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPricePageHidden')).val(strMoney);
+            //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->  
+
+            Repair_Price_AutoPrice = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto'));
+            Repair_Price_Auto = Repair_Price_AutoPrice.value();
+            repairMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value();
+            // console.log('repairMoney='+repairMoney);
+            repairMoney1 = localParseFloat(repairMoney);
+            ISReducedpriceapproval1 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval1')).val();
+            ISReduced = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
+            console.log('ISReduced='+ISReduced);
+            
+            console.log('Repair_Price_Auto='+Repair_Price_Auto);
+            console.log('绗�'+(i+1)+'涓澶嘔SReducedpriceapproval1='+ISReducedpriceapproval1);
+            console.log('repairMoney1='+repairMoney1);
+            
+            Repair_Price_pass1 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_pass')).val();
+            Repair_Price_pass2 = localParseFloat(Repair_Price_pass1);
+            console.log('缁撴灉='+(repairMoney1<Repair_Price_pass2));
+            console.log('Repair_Price_pass2='+Repair_Price_pass2);
+            if (repairMoney1> 0 && repairMoney1<(Repair_Price_Auto*0.80) && Repair_Price_Auto != null && isFSE == true) {
+                 if (Repair_Price_pass1!=null && repairMoney1<Repair_Price_pass2) {
+                    alert('鐢变簬瀛樺湪鎶樻墸鐜囪秴杩�20%浠ヤ笂鐨勪慨鐞嗗姞璐瑰噺浠风敵璇凤紝璇峰厛鐐瑰嚮鈥滄彁浜C璇勪及鈥濇寜閽紝寰匯C璇勪及鍚庢湇鍔$鐞嗛儴浼氭帹杩涘鎵�');
+                        // j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", false);
+                        // j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btn');
+
+                    // RCbottonChanged = 1;
+
+                    // var change_cancel = document.getElementById("emailSend");
+                    // change_cancel.style.display = "block";
+                    repairMoney = Repair_Price_pass2;
+                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(Repair_Price_pass2);
+                 }
+            }
+             
+             repairMoney2 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value();
+            // console.log('repairMoney='+repairMoney);
+            repairMoney3 = localParseFloat(repairMoney2);
+             if (repairMoney3> 0 && (repairMoney3 <Repair_Price_Auto*0.80)) {
+                if (Repair_Price_pass1!=null && repairMoney3<Repair_Price_pass2) {
+                         isresduce = isresduce+1;
+                }
+            }
+            ResonCannotWarranty = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ResonCannotWarranty')).value();
+            rppa =  document.getElementById('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto');
+            situation = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_situation')).value();
+            // Agreed_Date =  j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Agreed_Date')).value();
+
+            console.log('situation='+situation);
+            // console.log('Agreed_Date1='+Agreed_Date);
+            //if(ResonCannotWarranty!=null&&!(ResonCannotWarranty.indexOf("寮冧慨") != -1)){
+           //         rppa.style.display = "none";
+            //        j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val('');
+            //       console.log('###淇敼鎴愬姛');
+           // }
+            // if ((situation.indexOf("淇悊涓�")!=-1)&& (Agreed_Date.indexOf("涓虹┖")!=-1)) {
+            //     console.log('寮�濮嬫搷浣�1');
+            //     rppa.style.display = "none";
+            // }
+            // if ((situation.indexOf("淇悊涓�")!=-1)&& (Agreed_Date.indexOf("涓嶄负绌�")!=-1)) {
+            //     console.log('寮�濮嬫搷浣�2');
+            //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto')).val(0);
+            //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(0);
+            // }
+        //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end -->
+        }
+        
+        repairSum = repairSum + localParseFloat(repairMoney);
+        listSum = listSum + localParseFloat(toNum(strMoney));
+        downPriceSum = downPriceSum + localParseFloat(toNum(downPrice));
+        upPriceSum =  upPriceSum + localParseFloat(toNum(upPrice));
+    }
+    console.log('鏀瑰彉閲戦isresduce='+isresduce);
+     if (isresduce!=0) {
+                toChange1();
+        }else{
+            if(ISReduced !='' ){
+                 toChange2();
+            }
+        }
+    j$(escapeVfId('allPage:allForm:allBlock:assetRepairSumNum')).text(toNumComma(repairSum));
+    if (!isDisabled) {
+        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUp')).text(toNumComma(Math.round(upPriceSum)));
+        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUpHidden')).val(toNum(Math.round(upPriceSum)));
+        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceDown')).text(toNumComma(Math.round(downPriceSum)));
+        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceDownHidden')).val(toNum(Math.round(downPriceSum)));
+    }
+    j$(escapeVfId('allPage:allForm:allBlock:contractInfo:assetRepairSumPrice')).text(toNumComma(repairSum));
+    j$(escapeVfId('allPage:allForm:allBlock:contractInfo:assetRepairSumPriceHidden')).val(toNum(repairSum));
+
+    var allcount = j$(escapeVfId('allPage:allForm:allBlock:productCount3')).value();
+    var result = '';
+    if (allcount == 0) {
+        result = null;
+    //濡傛灉鎵�鏈夎澶囩殑涓婃湡鍚堝悓閮芥槸澶氬勾淇濆悎鍚岋紝鍒欏悎鍚岀绫讳负甯傚満澶氬勾淇濈画绛惧悎鍚� thh 20220315 start
+    }else if(GuranteeCount > 0 && GuranteeCount == allcount){
+        result = '甯傚満澶氬勾淇濈画绛惧悎鍚�';
+    //濡傛灉鎵�鏈夎澶囩殑涓婃湡鍚堝悓閮芥槸澶氬勾淇濆悎鍚岋紝鍒欏悎鍚岀绫讳负甯傚満澶氬勾淇濈画绛惧悎鍚� thh 20220315 end
+    }else if (newCount > 0 && newCount == allcount && newCon == true) {
         result = '鏂板搧鍚堝悓';
     }else if (((newCount > 0 && newCount == allcount) ||(newCount + firstCCount == allcount)) && newCon == false) {
         result = '棣栫鍚堝悓';
@@ -646,12 +1249,10 @@
     }
     document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXT").innerHTML = result;
     document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXTHidden").value = result;
-    // 鍙栨秷閰稿寲姘�
-    //NotUseOxygenatedWaterAmount(1);
+     
     examinationPriceCal(cnt);
     getLastContractRate();
 }
-
 
 
 function examinationPriceCal(cntWithKara) {
@@ -975,8 +1576,10 @@
 function ComputeLTY() {
     var  urlNameJs = j$(escapeVfId('allPage:allForm:urlName')).val();
     urlNameJs = '{!$Label.ID_of_SelectAssetEstimate}'+urlNameJs ;
-    var w = window.open(encodeURI(urlNameJs),'杩囧幓涓ゅ勾淇悊瀹炵哗','menubar=no,height=720,width=986');
-    w.focus();
+    //URF闄愭鍚堝悓2鏈� LY 20220920 start
+    // var w = window.open(encodeURI(urlNameJs),'杩囧幓涓ゅ勾淇悊瀹炵哗','menubar=no,height=720,width=986');
+    // w.focus();
+    //URF闄愭鍚堝悓2鏈� LY 20220920 end
 }
 function recordNumChangeJs() {
     recordNumChangeAction();
@@ -1258,6 +1861,10 @@
 
     <!-- HWAG-B4R3SS  START 20181026-->
     <apex:actionFunction name="searchfunc" action="{!searchBtn}" rerender="Form,Block,assetSection2,pageMessages,allBlock" onComplete="unblockUI();"></apex:actionFunction>
+    <apex:actionfunction action="{!tochange}" name="tochange" rerender="ISReducedpriceapproval" oncomplete="unblockUI();">
+        </apex:actionfunction>
+        <apex:actionfunction action="{!tochange2}" name="tochange2" rerender="ISReducedpriceapproval" oncomplete="unblockUI();">
+        </apex:actionfunction>
     <!-- HWAG-B4R3SS  END 20181026-->
     <apex:actionFunction name="ComputeLTYRepair" action="{!ComputeLTYRepair}" rerender="pageMessages" oncomplete="unblockUI();ComputeLTY();"/>
     <apex:actionFunction name="ShowLTYRepair" action="{!ShowLTYRepair}"  oncomplete="unblockUI();ComputeLTY();"/>
@@ -1498,7 +2105,15 @@
                         <th style="width:90px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Estimate_List_Price_All__c.label}</th>
                         <th style="width:90px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Maintenance_Price_YearTXT__c.label}</th>-->
                         <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Repair_Price__c.label}</th>
+                        <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->
+
+                        <th style="width:70px" class="headerRow ">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Repair_Price_Auto__c.label}</th>
+
+                       <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end -->
                         <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Comment__c.label}</th>
+
+                        <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� 绗笁鏂瑰洖褰� -->
+                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Third_Party_Return__c.label}</th>
                     </tr>
                     
                     <apex:variable value="{!1}" var="cnt" />
@@ -1516,8 +2131,13 @@
                                     <apex:inputField value="{!ar.mcae.Product_Manual__c}" id="Assert" style="width:90%;" rendered="{!ar.IsManual}" onchange="blockme();refreshProductData({!ar.lineNo});"/>
                                     <apex:inputText id="ProductId" value="{!ar.mcae.Product_Manual__c}" style="display:none;" disabled="true"/>
                                 </td>
+                                <!-- URF闄愭鍚堝悓2鏈� LY 20220811 start -->
+                            
+                                    <apex:inputHidden value="{!ar.rec.URF_Maintenance_Contract__r.Management_Code__c}" rendered="{!Not(ar.IsManual)}" id="URF_Contract_No"/>
+                                
+                                <!-- URF闄愭鍚堝悓2鏈� LY 20220811 end -->
                                 <td class="dataCell" width="70px">
-                                    <apex:outputField value="{!ar.rec.Asset_situation__c}" rendered="{!Not(ar.IsManual)}" />
+                                    <apex:outputField value="{!ar.rec.Asset_situation__c}" rendered="{!Not(ar.IsManual)}" id="Asset_situation"/>
                                 </td>
                                 <td class="dataCell" width="70px">
                                     <apex:outputLink value="/{!ar.recId}" rendered="{!Not(ar.IsManual)}" >{!ar.rec.SerialNumber}</apex:outputLink>
@@ -1579,6 +2199,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)}" >
@@ -1590,11 +2211,26 @@
                                     <!-- 20200103 Gzw 璁$畻瀹為檯鎶ヤ环閲戦 end -->
 
                                 </td>
-                                <td class="dataCell" width="70px" style="text-align:right" >
-                                    <apex:inputField value="{!ar.mcae.Repair_Price__c}" id="repairPrice" style="ime-mode: disabled; width:95%; text-align:right;" onchange="refreshAsset({!productCount});"/>
+                                <td class="dataCell" width="35px" style="text-align:right" >
+                                    <apex:inputField value="{!ar.mcae.Repair_Price__c}" id="repairPrice" style="ime-mode: disabled; width:95%; text-align:right;" onchange="changeAsset({!productCount})"/>
                                 </td>
+                               <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->
+                                <td class="dataCell" width="35px" style="text-align:right" >
+                                    <apex:outputText value="{!ar.Repair_Price_Auto}" id="Repair_Price_Auto" style="width:95%; disabled:disabled;"/>
+                                    <!-- <apex:inputHiddenalue="{!ar.rec.Reson_Can_not_Warranty__c}" id="ResonCannotWarranty"/> -->
+                                    <!-- <apex:outputText value="{!ar.Agreed_Date}" id="Agreed_Date" style="width:95%;display: none;"/> -->
+                                    <apex:inputField value="{!ar.mcae.Repair_Price_pass__c}" id="Repair_Price_pass" style="width:95%;display: none;"/>
+                                    <apex:inputHidden value="{!ar.mcae.IS_Reduced_price_approval__c}" id="ISReducedpriceapproval1"/>
+                                     <apex:outputText value="{!ar.rec.Reson_Can_not_Warranty__c}" id="ResonCannotWarranty" style="display:none;" rendered="{!Not(ar.IsManual)}" /> 
+                                </td>
+                                
+                                <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end -->
                                 <td class="dataCell" width="70px" style="text-align:right" >
                                     <apex:inputField value="{!ar.mcae.Comment__c}" id="comment" style="width:95%;"/>
+                                </td>
+                                <!--(2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� 绗笁鏂瑰洖褰�  -->
+                                <td class="dataCell" width="40px" style="text-align:center;" >
+                                    <apex:inputCheckbox value="{!ar.mcae.Third_Party_Return__c}" id="Third_Party_Return__c"/>
                                 </td>
                             </tr>
 
@@ -1651,9 +2287,12 @@
                     <th width="90px" style="text-align:right">璁惧鏁伴噺</th>
                     <td width="90px" style="text-align:right"><apex:outputtext value="{!productCount3}" id="productCount3"/></td>
                     <td width="25px">&nbsp;</td>
+                    <th width="90px" style="text-align:right">
+                        <apex:inputField value="{!estimate.IS_Reduced_price_approval__c}" id="ISReducedpriceapproval" style="display:none"/></th>
+                         <!-- <apex:inputField value="{!estimate.IS_Reduced_price_approval__c}" id="ISReducedpriceapproval"/></th> -->
+                    <td width="25px">&nbsp;</td>
                     <!--<th width="90px" style="text-align:right">鎶ヤ环鎬婚</th>
                     <th width="90px" style="text-align:right"><span id="allPage:allForm:allBlock:assetListSumNum" ></span></th>-->
-                    <td width="25px">&nbsp;</td>
                     <th width="90px" style="text-align:right">淇悊鎬婚</th>
                     <th width="90px" style="text-align:right"><span id="allPage:allForm:allBlock:assetRepairSumNum" ></span></th>
                     <td width="95px">&nbsp;</td>
@@ -1674,7 +2313,7 @@
                         <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.SerialNumber.label}</th>
                         <th class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.Department_Name__c.label}</th>
                         <!-- <th style="width:90px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.Installation_Site__c.label}</th> -->
-                        <th style="width:90px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.IF_Warranty__c.label}</th>
+                        <th style="width:90px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.IF_Warranty_Service__c.label}</th>
                          <!-- //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start -->
                         <th style="width:90px" class="headerRow  booleanColumn">涓绘満/鑰楁潗</th>
                          <!-- //JZHG-BSDUT4 ---20200825---update By rentongxiao---End -->
@@ -1692,7 +2331,7 @@
                         <apex:repeat value="{!assetsView}" var="ar" id="assetTable2">
                             <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
                                 <td class="dataCell" width="25px">
-                                    <apex:inputCheckbox value="{!ar.rec_checkBox_c}" id="assetRowCheckbox2" disabled="{!IF(ar.rec.Maintenance_Price_Month__c == 0 || ar.rec.IF_Warranty__c = '鍚�', 'true', 'false')}"/>
+                                    <apex:inputCheckbox value="{!ar.rec_checkBox_c}" id="assetRowCheckbox2" disabled="{!IF(ar.rec.Maintenance_Price_Month__c == 0 || ar.rec.IF_Warranty_Service__c = '鍚�', 'true', 'false')}"/>
                                 </td>
                                 <td class="dataCell" width="25%">
                                     <apex:outputField value="{!ar.rec.name}" id="assetName"/>
@@ -1710,7 +2349,7 @@
                                     <apex:outputField value="{!ar.rec.Installation_Site__c}"/>
                                 </td> -->
                                 <td class="dataCell" width="90px" style="text-align:center">
-                                    <apex:outputField value="{!ar.rec.IF_Warranty__c}"/>
+                                    <apex:outputField value="{!ar.rec.IF_Warranty_Service__c}"/>
                                 </td>
                                  <!-- //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start -->
                                 <td class="dataCell" width="90px" style="text-align:center">
@@ -1795,6 +2434,9 @@
                         <th style="text-align: center">鐢宠鎶ヤ环閲戦</th>
                         <th style="text-align: center">鍚堝悓璁惧淇悊鎬婚</th>
                         <th style="text-align: center">鍚堝悓鎬婚噾棰�</th>
+                        <!-- 涓婇檺鍚堝悓 20230103 LY start -->
+                        <!-- <th style="text-align: center">涓婇檺閲戦</th> -->
+                        <!-- 涓婇檺鍚堝悓 20230103 LY end -->
                     </tr>
                     <tr>
                         <td style="text-align: center">
@@ -1805,6 +2447,7 @@
                             <apex:outputField value="{!estimate.GuidePrice_Up__c}" id="GuidePriceUp" />
                             <apex:inputHidden value="{!estimate.GuidePrice_Up__c}" id="GuidePriceUpHidden" />
                         </td>
+                        
                         <td style="text-align: center">
                             <!--<apex:inputField value="{!estimate.Request_quotation_Amount__c}" id="quotation_Amount" />-->
                             <apex:inputField value="{!estimate.Request_quotation_Amount__c}" style="ime-mode: disabled; text-align: right; width:100px" id="quotation_Amount" onchange="checkDiscount(this.value);"/>
@@ -1818,6 +2461,11 @@
                             <apex:inputHidden value="{!estimate.Maintenance_Price__c}" id="mainteRealHidden"/>
                             <apex:inputHidden value="{!OldMaintenancePrice}" id="oldMainteReal"/>
                         </td>
+                        <!-- 涓婇檺鍚堝悓 20230103 LY start -->
+                       <!--  <td style="text-align: center">
+                            <apex:inputField value="{!estimate.Limit_Price_Amount__c}" style="ime-mode: disabled; text-align: right; width:100px" id="Limit_Price_Amount" />
+                        </td> -->
+                        <!-- 涓婇檺鍚堝悓 20230103 LY end -->
                     </tr>
                     <tr>
                         <th style="text-align: center">{!$ObjectType.Maintenance_Contract_Estimate__c.fields.Service_discount_Rate__c.label}</th>
@@ -1987,9 +2635,12 @@
                         <td>&nbsp;</td>
                         <td width="30px">&nbsp;</td>
                         <!-- <td><apex:commandButton id="savebtn" action="{!save}" value="{!$Label.Save_Button}" disabled="{!SaveBtnDisabled}" rerender="allForm" onclick="if (!onclickCheckchangedAfterPrint('true','true')) return false;" oncomplete="unblockUI();"/></td> -->
-                        <td><apex:commandButton id="savebtn" action="{!save}" value="{!$Label.Save_Button}" disabled="{!SaveBtnDisabled}" rerender="allForm" onclick="if (!EGFlgconfim()) return false;" oncomplete="unblockUI();"/></td>
-                        
-                        <td width="200px"><apex:commandButton id="approvalbtn" action="{!approvalProcess}" value="鎻愪氦寰呭鎵�" disabled="{!ApprovalBtnDisabled}" rerender="allForm" onclick="if (!KindsAndMonths()) return false;if (!EGFlgconfim()) return false;approvalJs();" oncomplete="unblockUI();"/>
+                        <!-- 鏁呴殰淇悊璐�  娣诲姞鎻愪氦淇悊鍑忎环鎸夐挳  disabled="true" -->
+                        <td><apex:commandButton id="emailSend" action="{!sendEmail}" value="鎻愪氦RC璇勪及" rerender="allForm" disabled="{!SendEmailBtnDisabled}" onclick="if (!EGFlgconfim()) return false;" oncomplete="unblockUI();"/></td>
+                        <td>
+                            <apex:commandButton id="approvalbtn1" action="{!toApprovalProcess}" value="鎻愪氦淇悊鍑忎环瀹℃壒" disabled="{!ApprovalBtnNewDisabled}" />
+                        </td>
+                        <td width="200px"><apex:commandButton id="approvalbtn" action="{!approvalProcess}" value="鎻愪氦寰呭鎵�" disabled="{!ApprovalBtnDisabled}" rerender="allForm" onclick="if (!KindsAndMonths()) return false;if (!EGFlgconfim()) return false;approvalJs();" oncomplete="unblockUI();toApprovalProcess();"/>
                         <!-- HWAG-B399Q8 2018/08/20 鏂板璇锋彁浜ゅ緟瀹℃壒 鎻愮ず瀛楁 start-->
                         &nbsp; <apex:outputText style="color:red;font-size:20px;" value="璇锋彁浜ゅ緟瀹℃壒" rendered="{!IS_Clone_After_Decide}"/>
                         <!-- HWAG-B399Q8 2018/08/20 鏂板璇锋彁浜ゅ緟瀹℃壒 鎻愮ず瀛楁 end-->
@@ -2003,6 +2654,9 @@
                         <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="savebtn" action="{!save}" value="{!$Label.Save_Button}" disabled="{!SaveBtnDisabled}" rerender="allForm" onclick="if (!EGFlgconfim()) return false;" oncomplete="unblockUI();"/>
+                        </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>
@@ -2157,7 +2811,7 @@
         // xud 20140529 銇撱亾銇槑绱板鏇村垽鏂�
         // xudan 20150729 銈姐兗銉堥爡鐩伀Id銈掕拷鍔�
         var sql = "SELECT Id, Asset__c, Asset__r.SerialNumber, Check_Result__c, Product_Manual__c,"
-                + " Repair_Price__c, Comment__c, Maintenance_Contract_Estimate__r.Maintenance_Price__c"
+                + " Repair_Price__c, Comment__c, Maintenance_Contract_Estimate__r.Maintenance_Price__c,Third_Party_Return__c"
                 + "  FROM Maintenance_Contract_Asset_Estimate__c"
                 + " WHERE Maintenance_Contract_Estimate__c = '{!targetEstimateId}'"
                 + " ORDER BY id,Asset__c,Product_Manual__c, Asset__r.SerialNumber, Asset__r.Name, Asset__r.Department_Name__c, Asset__r.InstallDate";

--
Gitblit v1.9.1