From 928399eceec50e3d37ea08669a12789a9410a9d2 Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 22 十一月 2022 16:51:16 +0800
Subject: [PATCH] 111

---
 force-app/main/default/pages/SelectAssetEstimateVM.page |   84 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 76 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/pages/SelectAssetEstimateVM.page b/force-app/main/default/pages/SelectAssetEstimateVM.page
index ab498f6..991c13b 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" /> -->
@@ -48,6 +48,16 @@
 
 //add by gwy 2021-01-27 start 鎻愪氦鏃剁殑鎻愮ず妗�
 function KindsAndMonths() {
+    //   鏁呴殰鍝佸姞璐� 绯荤粺妫�鏌ヤ慨鐞嗗噺浠峰鎵瑰畬鎴� Start
+    var rowCnt = j$(escapeVfId('allPage:allForm:allBlock:assetSection:productCnt')).val();
+    for (var i = 0; i < rowCnt; i++) {
+        var ISReduced = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval')).val();
+        if(ISReduced=='鍚�' || ISReduced =='瀹℃壒涓�'){
+            alert('璇烽�氳繃淇悊鍑忎环瀹℃壒鍐嶆彁浜�');
+            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 == '鏂板搧鍚堝悓'){
@@ -106,6 +116,10 @@
 // 鍒濆鍖栬瀹氱敾闈㈤」鐩笉鍙敤
 function pageSetDisabled(){
     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);
@@ -191,6 +205,7 @@
     // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk star
     // disable1();
     // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk end
+    console.log('ApprovalBtnDisabled=='+{!ApprovalBtnDisabled});
     pageSetDisabled();
     var createdDate = new Date('{!estimate.CreatedDate}');
     // 鎶ヤ环涓澶囩殑鏈鸿韩缂栫爜涓虹┖鏃剁殑鏂板搧鍚堝悓鏈夋晥鏈熷欢闀� 20200710 gzw
@@ -339,7 +354,6 @@
     //contractStartDateChange();
     refreshAsset(cnt);
 }
-
 function refreshAsset(cnt) {
     // alert(cnt);
     // 鎻愪氦鍚庡氨椤甸潰涓嶈绠椾簡
@@ -359,6 +373,10 @@
     //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 start
     var GuranteeCount = 0;
     //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 end
+
+    //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉�
+    var isFSE = {!isFSE};
+    console.log('***isFSE',isFSE);
 
 
     // 棰勫畾寮�濮嬫棩
@@ -632,6 +650,25 @@
             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_Auto = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto')).value();
+            if (repairMoney> 0 && repairMoney <(Repair_Price_Auto*0.8) && Repair_Price_Auto != null && isFSE == true) {
+                 alert('濡傞渶鐢宠鍏姌鏇翠綆鐨勬姌鎵o紝璇风偣鍑烩�樺噺浠风敵璇锋寜閽�欒仈绯绘湇鍔$鐞嗛儴');
+                 repairMoney = 0;
+                 j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(0);
+            }
+            if (repairMoney> 0 && repairMoney <(Repair_Price_Auto*0.8)) {
+            // j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval')).val('瀹℃壒涓�');
+            // }else{
+            // j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval')).val('');
+            // }
+            tochange();
+            console.log('淇敼瀹℃壒');
+        }
+            ISReducedpriceapproval = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISReducedpriceapproval')).val();
+            console.log('鏄惁瀹℃壒閫氳繃=='+ISReducedpriceapproval);
+            //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end -->
         }
         repairSum = repairSum + localParseFloat(repairMoney);
         listSum = listSum + localParseFloat(toNum(strMoney));
@@ -1006,8 +1043,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();
@@ -1289,6 +1328,8 @@
 
     <!-- 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="Form" 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();"/>
@@ -1529,7 +1570,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" />
@@ -1547,6 +1596,11 @@
                                     <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)}" />
                                 </td>
@@ -1625,8 +1679,20 @@
                                 <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>
+                                <!-- (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;"/>
+                                </td>
+                                <apex:inputHidden value="{!estimate.IS_Reduced_price_approval__c}" id="ISReducedpriceapproval"/>
+                                <apex:inputHidden value="{!ar.rec.Reson_Can_not_Warranty__c}" id="ResonCannotWarranty"/>
+                                <!-- (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="70px" style="text-align:right;" >
+                                    <apex:inputCheckbox value="{!ar.mcae.Third_Party_Return__c}" id="Third_Party_Return__c"/>
                                 </td>
                             </tr>
 
@@ -1706,7 +1772,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 -->
@@ -1724,7 +1790,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"/>
@@ -1742,7 +1808,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">
@@ -2019,6 +2085,8 @@
                         <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="emailSend" action="{!sendEmail}" value="鎻愪氦淇悊鍑忎环" disabled="{!SendEmailBtnDisabled}" rerender="allForm" onclick="if (!EGFlgconfim()) 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();"/>
@@ -2190,7 +2258,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