From 1727a4f4d02e429475608e60f142a63bc24127bc Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 23 十月 2023 10:07:34 +0800
Subject: [PATCH] 近期修改

---
 force-app/main/default/lwc/lexCancelReport/lexCancelReport.js                              |   12 
 force-app/main/default/classes/StartTradingController2.cls                                 |  321 +
 force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.js                      |   13 
 force-app/main/default/classes/eSignHospitalPageControllerTest.cls                         |   86 
 force-app/main/default/classes/OpportunityLightingButtonController.cls                     |   54 
 force-app/main/default/lwc/oppLoseButton/oppLoseButton.html                                |   11 
 force-app/main/default/lwc/lexsurface/lexsurface.html                                      |    5 
 force-app/main/default/classes/OFSRepairConsignPDFOuterControllerTest.cls                  |    2 
 force-app/main/default/classes/lexLostCancelReportControllerTest.cls                       |  100 
 force-app/main/default/lwc/lexStockCancel/lexStockCancel.html                              |    8 
 force-app/main/default/classes/lexSolutionProjectRequirementsController.cls                |   20 
 force-app/main/default/classes/ImprovedForecastTimeController.cls                          |   15 
 force-app/main/default/classes/SetPersonalTargetBatch.cls                                  |   33 
 force-app/main/default/classes/OpportunityLightingButtonControllerTest.cls                 |    5 
 force-app/main/default/classes/lexLostCancelReportControllerTest.cls-meta.xml              |    5 
 force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls                     |    4 
 force-app/main/default/classes/lexPCLLostReportLwcControllerTest.cls                       |  145 
 force-app/main/default/classes/eSignFormAttachmentControllerTest.cls                       |   71 
 force-app/main/default/lwc/lexStartTrading/lexStartTrading.js                              |   25 
 force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls                         |   17 
 force-app/main/default/lwc/activeContent/activeContent.css                                 |   76 
 force-app/main/default/classes/OFSUploadImageRestTest.cls-meta.xml                         |    5 
 force-app/main/default/classes/XinDailyReportController.cls                                | 6254 ---------------------
 force-app/main/default/classes/CheckAllOlympusAssetController.cls                          |   10 
 force-app/main/default/classes/MaintenanceProductDataControllerTest.cls                    |   75 
 force-app/main/default/lwc/lexsurface/lexsurface.css                                       |   11 
 force-app/main/default/classes/eSignAgencyConfirmPageControllerTest.cls                    |   42 
 force-app/main/default/classes/ConsumTrialPDFControllerTest.cls                            |    2 
 force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.html          |  748 ++
 force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.html                        |   15 
 force-app/main/default/classes/ISO_DemandOperAndDemonsJumpController.cls                   |   22 
 force-app/main/default/classes/NotetoPdfHandler.cls                                        |   14 
 force-app/main/default/classes/lexLightingButtonConstantTest.cls-meta.xml                  |    5 
 force-app/main/default/classes/ReportController.cls                                        |   48 
 force-app/main/default/lwc/oppLoseButton/oppLoseButton.js                                  |  219 
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html                      |    9 
 force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js                      |    4 
 force-app/main/default/classes/TenderOpportunityLinkHandler.cls                            |  347 
 force-app/main/default/classes/BidAnnounceIframeControllerTest.cls                         |   18 
 force-app/main/default/lwc/activeContent/activeContent.html                                |  657 ++
 force-app/main/default/classes/Add_ReportTest.cls                                          |   11 
 force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js                    |    1 
 force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.css           |   91 
 force-app/main/default/classes/Add_Report.cls                                              |   44 
 force-app/main/default/classes/OFSUploadImageRestTest.cls                                  |  212 
 force-app/main/default/lwc/lexsurface/lexsurface.js-meta.xml                               |   11 
 force-app/main/default/classes/AssetMaintainController.cls                                 |   11 
 force-app/main/default/classes/InventoryResultRecordControllerTest.cls                     |  363 +
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml |   11 
 force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js            | 2808 +++++++++
 force-app/main/default/classes/eSignAgencyPageControllerTest.cls                           |   87 
 force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js                    |   64 
 force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js                          |   95 
 force-app/main/default/lwc/lexLoseReport/lexLoseReport.js                                  |   29 
 force-app/main/default/lwc/activeContent/activeContent.js-meta.xml                         |    5 
 force-app/main/default/classes/AttachmentReQisHandlerTest.cls                              |   42 
 force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js-meta.xml   |   12 
 force-app/main/default/classes/OFSUploadRepairImageRest.cls                                |   89 
 force-app/main/default/classes/lexLostCancelReportController.cls                           |   17 
 force-app/main/default/lwc/lexStockCancel/lexStockCancel.js                                |   40 
 force-app/main/default/lwc/activeContent/activeContent.js                                  | 2780 +++++++++
 force-app/main/default/classes/lexLightingButtonConstantTest.cls                           |   33 
 force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js        |    1 
 force-app/main/default/lwc/lexsurface/lexsurface.js                                        |   32 
 force-app/main/default/pages/CheckAllOlympusAsset.page                                     |    2 
 force-app/main/default/classes/NFM401ControllerTest.cls                                    |   48 
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js                        |   55 
 force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js                                |   18 
 force-app/main/default/classes/NotetoPdfHandlerTest.cls-meta.xml                           |    5 
 force-app/main/default/classes/InventoryReportControllerTest.cls                           |   24 
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js          |   59 
 force-app/main/default/classes/CheckAllOlympusAssetControllerTest.cls                      |   13 
 force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html                    |    7 
 force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js                  |    4 
 force-app/main/default/classes/lexOpportunitySpecialApplyController.cls                    |   13 
 force-app/main/default/triggers/ContentDocumentTrigger.trigger                             |    2 
 force-app/main/default/classes/eSignHospitalConfirmControllerTest.cls                      |   94 
 force-app/main/default/lwc/lexSISubmit/lexSISubmit.js                                      |   43 
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html        |    9 
 force-app/main/default/triggers/ContentDocumentLink.trigger                                |   26 
 force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls                      |   79 
 force-app/main/default/classes/UpdateReceivingNoteImgRest.cls                              |   11 
 force-app/main/default/classes/BidAnnounceIframeController.cls                             |    3 
 force-app/main/default/classes/StartTradingController2.cls-meta.xml                        |    5 
 force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml                  |    2 
 force-app/main/default/classes/OFSUploadImageRest.cls                                      |   95 
 force-app/main/default/classes/NotetoPdfHandlerTest.cls                                    |   81 
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml               |   11 
 force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html                  |   11 
 force-app/main/default/classes/lexSolutionProgrammeController.cls                          |   18 
 force-app/main/default/classes/XinDailyReportControllerTest.cls                            |   27 
 force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html                    |    4 
 force-app/main/default/classes/Add_ReportTest.cls-meta.xml                                 |    5 
 force-app/main/default/classes/lexPCLLostReportLwcController.cls                           |   55 
 94 files changed, 10,162 insertions(+), 7,089 deletions(-)

diff --git a/force-app/main/default/classes/Add_Report.cls b/force-app/main/default/classes/Add_Report.cls
index d82c888..d925852 100644
--- a/force-app/main/default/classes/Add_Report.cls
+++ b/force-app/main/default/classes/Add_Report.cls
@@ -5,7 +5,9 @@
     List<Account> aList = selectAccount(aId);
 
     if(reportId != null && reportId != ''){
-      List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+        //kk p璇鹃闇�瑕� 瀹炴柦浜�5浠庢煡鎵惧彉涓烘枃鏈瓧娈�
+    //   List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+    List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Comment__c from Report__c where id =:reportId];
       if (rList.size() > 0) {
         return rList.get(0).id;
       }
@@ -41,9 +43,9 @@
     if(visitor4 != null && visitor4 != ''){
       r.Practitioner4__c = visitor4;
     }
-    if(visitor5 != null && visitor5 != ''){
-      r.Practitioner5__c = visitor5;
-    }
+    // if(visitor5 != null && visitor5 != ''){
+    //   r.Practitioner5__c = visitor5;
+    // }
     r.Comment__c = description;
     upsert r;
 
@@ -66,9 +68,10 @@
     if(reportId != null && reportId != ''){
       //搴峰悍p璇鹃闇�瑕佷慨鏀瑰瓧娈电被鍨� 鍚庣画璺熻繘锛圤pportunity5__c鍙樹负鏂囨湰绫诲瀷瀛楁锛�
     //   List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Opportunity1__c, Opportunity2__c, Opportunity3__c, Opportunity4__c, Opportunity5__c from Report__c where id =:reportId];
-    //   if(rList.size() > 0){
-    //     return rList.get(0).id;
-    //   }
+      List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Opportunity1__c, Opportunity2__c, Opportunity3__c, Opportunity4__c, Opportunity5__c from Report__c where id =:reportId];
+      if(rList.size() > 0){
+        return rList.get(0).id;
+      }
     }
 
     Report__c r = new Report__c();
@@ -102,9 +105,9 @@
     if(visitor4 != null && visitor4 != ''){
       r.Practitioner4__c = visitor4;
     }
-    if(visitor5 != null && visitor5 != ''){
-      r.Practitioner5__c = visitor5;
-    }
+    // if(visitor5 != null && visitor5 != ''){
+    //   r.Practitioner5__c = visitor5;
+    // }
 
     List<String> oppIdList = new List<String>();
     if(opp1 != null && opp1 != ''){
@@ -137,9 +140,9 @@
       if(opp4 != null && opp4 != ''){
         r.Opportunity4__c = opp4;
       }
-    //   if(opp5 != null && opp5 != ''){
-    //     r.Opportunity5__c = opp5;
-    //   }
+      if(opp5 != null && opp5 != ''){
+        r.Opportunity5__c = opp5;
+      }
       r.Opportunity_Situation__c = '寮曞悎鐧虹敓';
     }
     else{
@@ -168,7 +171,8 @@
     List<Account> aList = selectAccount(aId);
 
     if(reportId != null && reportId != ''){
-      List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, From__c, To__c, Location__c from Report__c where id =:reportId];
+    //   List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, From__c, To__c, Location__c from Report__c where id =:reportId];
+    List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, From__c, To__c, Location__c from Report__c where id =:reportId];
       if(rList.size() > 0){
         return rList.get(0).id;
       }
@@ -201,9 +205,9 @@
     if(visitor4 != null && visitor4 != ''){
       r.Practitioner4__c = visitor4;
     }
-    if(visitor5 != null && visitor5 != ''){
-      r.Practitioner5__c = visitor5;
-    }
+    // if(visitor5 != null && visitor5 != ''){
+    //   r.Practitioner5__c = visitor5;
+    // }
     if(sTime != null && sTime != ''){
       //sTime = sTime.substring(0,16);
       r.From__c = datetime.parse(sTime);
@@ -341,7 +345,8 @@
     List<Account> aList = selectAccount(aId);
 
     if(reportId != null && reportId != ''){
-      List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+    //   List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+    List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Comment__c from Report__c where id =:reportId];
       if(rList.size() > 0){
         return rList.get(0).id;
       }
@@ -378,7 +383,8 @@
     List<Account> aList = selectAccount(aId);
 
     if(reportId != null && reportId != ''){
-      List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+    //   List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+    List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Comment__c from Report__c where id =:reportId];
       if(rList.size() > 0){
         return rList.get(0).id;
       }
diff --git a/force-app/main/default/classes/Add_ReportTest.cls b/force-app/main/default/classes/Add_ReportTest.cls
new file mode 100644
index 0000000..f4284f5
--- /dev/null
+++ b/force-app/main/default/classes/Add_ReportTest.cls
@@ -0,0 +1,11 @@
+@isTest
+private class Add_ReportTest {
+    @TestSetup
+    private static void init() {
+
+    }
+    @isTest
+    static void test01() {
+        
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/Add_ReportTest.cls-meta.xml b/force-app/main/default/classes/Add_ReportTest.cls-meta.xml
new file mode 100644
index 0000000..642d054
--- /dev/null
+++ b/force-app/main/default/classes/Add_ReportTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>58.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/AssetMaintainController.cls b/force-app/main/default/classes/AssetMaintainController.cls
index 772af79..63e2467 100644
--- a/force-app/main/default/classes/AssetMaintainController.cls
+++ b/force-app/main/default/classes/AssetMaintainController.cls
@@ -1197,11 +1197,22 @@
     }
 
     private void fillShowList(Integer k){
+        if(allAssetInfoList.size() == 0 && assetFromSearchList.size() > 0 ){
+            allAssetInfoList.addAll(assetFromSearchList);
+            assetFromSearchList.clear();
+        }
         totalNum = allAssetInfoList.size();
         totalPage = (totalNum / selctRecordNum) + (Math.mod(totalNum, selctRecordNum) > 0 ? 1 : 0);  // 鎬婚〉
         allAssetInfoShowList = new List<AssetInfo>();
         Integer a = (k-1)*selctRecordNum;
         Integer b = Math.min(k*selctRecordNum, allAssetInfoList.size());
+        System.debug('allAssetInfoList.size=>' + allAssetInfoList.size());
+        System.debug('a=>' + a);
+        System.debug('b=>' + b);
+        System.debug('k=>' + k);
+        System.debug('totalNum=>' + totalNum);
+        System.debug('totalPage=>' + totalPage);
+        System.debug('selctRecordNum=>' + selctRecordNum);
         for (Integer i = a ; i < b ; i++) {
             allAssetInfoShowList.add(allAssetInfoList[i]);
         }
diff --git a/force-app/main/default/classes/AttachmentReQisHandlerTest.cls b/force-app/main/default/classes/AttachmentReQisHandlerTest.cls
index c160159..28cf414 100644
--- a/force-app/main/default/classes/AttachmentReQisHandlerTest.cls
+++ b/force-app/main/default/classes/AttachmentReQisHandlerTest.cls
@@ -57,25 +57,12 @@
         repair.Hospital__c = hospital.Id;
         repair.Delivered_Product__c = asset.Id;
         insert repair;
-        // Attachment att = new Attachment(
-        //     Name = 'test',
-        //     ParentId = repair.Id,
-        //     Body = EncodingUtil.base64Decode('test')
-        // );
-        ContentVersion version = new ContentVersion(
-            Title = 'test',
-            VersionData = EncodingUtil.base64Decode('test'),
-            ContentLocation = 's',
-            PathOnClient = 'test.txt'
+        Attachment att = new Attachment(
+            Name = 'test',
+            ParentId = repair.Id,
+            Body = EncodingUtil.base64Decode('test')
         );
-        insert version;
-        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
-        ContentDocumentLink link = new ContentDocumentLink();
-        link.ContentDocumentId = version.ContentDocumentId;
-        link.LinkedEntityId = repair.Id;
-        link.ShareType = 'I';
-        link.Visibility = 'AllUsers';
-        insert link;
+        
 
     }
     // 瑕嗙洊鐜囪ˉ鍏�
@@ -137,20 +124,13 @@
         ofile.Oppor_File_Stage__c = 'G';
         insert ofile;
 
-        ContentVersion version = new ContentVersion(
-            Title = 'test',
-            VersionData = EncodingUtil.base64Decode('test'),
-            ContentLocation = 's',
-            PathOnClient = 'test.txt'
+        Attachment att1 = new Attachment(
+            Name = 'test',
+            ParentId = ofile.Id,
+            Body = EncodingUtil.base64Decode('test')
         );
-        insert version;
-        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
-        ContentDocumentLink link = new ContentDocumentLink();
-        link.ContentDocumentId = version.ContentDocumentId;
-        link.LinkedEntityId = ofile.Id;
-        link.ShareType = 'I';
-        link.Visibility = 'AllUsers';
-        insert link;
+
+        insert att1;
 
         delete ofile;
 
diff --git a/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls b/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
index 35bed04..175f64a 100644
--- a/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
+++ b/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
@@ -12,7 +12,7 @@
         if (rectDpt.size() == 0) {
             return;
         }
-        Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'SoakupTestHp', OwnerId = hpOwner.Id);
+        Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'SoakupTestHp', OwnerId = hpOwner.Id,Speciality_Type__c = '缁煎悎鍖婚櫌');
         insert hp;
         Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
         Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
@@ -49,6 +49,7 @@
         System.Test.setCurrentPage(page);
         System.Test.StartTest();
         BatchSelectRepairPageController br = new BatchSelectRepairPageController();
+        StaticParameter.ContentDocumentLink = false;
         br.init();
         Repair__c repair01 = [SELECT Id,Status2__c,Name,Incharge_Staff__c,SAP_Service_Repair_No__c,Aware_date2__c,State_Hospital__c,SerialNumber__c,work_location_select__c,FSE_ApplyForRepair_Day__c,On_site_repair__c,Aware_date__c FROM Repair__c LIMIT 1];
         br.RevalInfo.repair = repair01;
@@ -71,6 +72,7 @@
         List<Repair__c> repList = new List<Repair__c>();
         repList.add(repair01);
         BatchSelectRepairPageController.generateAttachment(repList);       
+        
         System.Test.StopTest();
 
     }
diff --git a/force-app/main/default/classes/BidAnnounceIframeController.cls b/force-app/main/default/classes/BidAnnounceIframeController.cls
index 6f2b673..e4e4a1c 100644
--- a/force-app/main/default/classes/BidAnnounceIframeController.cls
+++ b/force-app/main/default/classes/BidAnnounceIframeController.cls
@@ -20,10 +20,10 @@
         if (docList.size() > 0) {
             doc = docList[0];
         }
-        ContentVersion version = [select Id from ContentVersion where ContentDocumentId =: doc.Id];
         if (bid.Web_URL__c != null) {
             // 涓爣閫氱煡涔RL鏇存柊鏃堕棿銆�銇ㄣ��鏈�鏂癆ttachment銇檪闁撱仺姣旇純銆佹柊銇椼亜銈傘伄銈掗仼鐢�
             if (doc != null) {
+                ContentVersion version = [select Id from ContentVersion where ContentDocumentId =: doc.Id];
                 if (bid.Web_URL_ModifiedDate__c < doc.ContentModifiedDate) {
                     iframe = '/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId='+ version.Id;
                 } else {
@@ -37,6 +37,7 @@
         } else {
             // Attachment銈掗仼鐢�
             if (doc != null) {
+                ContentVersion version = [select Id from ContentVersion where ContentDocumentId =: doc.Id];
                 iframe = '/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId='+ version.Id;
             }
         }
diff --git a/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls b/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
index e3bb1eb..6549839 100644
--- a/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
+++ b/force-app/main/default/classes/BidAnnounceIframeControllerTest.cls
@@ -31,12 +31,20 @@
         BidAnnounceIframeController controller = new BidAnnounceIframeController(new ApexPages.StandardController(ba));
         controller.init();
         
-        Attachment att = new Attachment(
-            Name = 'test',
-            ParentId = ba.Id,
-            Body = EncodingUtil.base64Decode('test')
+        ContentVersion version = new ContentVersion(
+            Title = 'test',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
         );
-        insert att;
+        insert version;
+        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+        ContentDocumentLink link = new ContentDocumentLink();
+        link.ContentDocumentId = version.ContentDocumentId;
+        link.LinkedEntityId = ba.Id;
+        link.ShareType = 'I';
+        link.Visibility = 'AllUsers';
+        insert link;
         controller.init();
         
         ba.Web_URL__c = '';
diff --git a/force-app/main/default/classes/CheckAllOlympusAssetController.cls b/force-app/main/default/classes/CheckAllOlympusAssetController.cls
index 3a70581..692a3f7 100644
--- a/force-app/main/default/classes/CheckAllOlympusAssetController.cls
+++ b/force-app/main/default/classes/CheckAllOlympusAssetController.cls
@@ -424,6 +424,7 @@
         if (beipinCunFangDi=='骞垮窞 澶囧搧涓績' || beipinCunFangDi=='鍖椾含 澶囧搧涓績' || beipinCunFangDi=='涓婃捣 澶囧搧涓績') {
             angecylookrole =true;
         }
+        System.debug('angecylookrole===' + angecylookrole);
         setAssetFieldSetInfo();//20210628 1650 you 鎸釜浣嶇疆
         if (UserInfo.getProfileId() == System.Label.ProfileId_SystemAdmin || System.Label.ProfileId_EquCenAdmin.contains(UserInfo.getProfileId())) {
             internalAssetLocationLogin = FixtureUtil.bieCunFangDiOpsMap.get('澶囧搧绠$悊涓績')[0].getValue();  // SelectOption('All', '--鍏ㄩ儴--')
@@ -758,6 +759,7 @@
         }
         System.debug('oldAssetInfoList===' + oldAssetInfoList);
         checkedAssetInfoNum = oldAssetInfoList.size();
+        System.debug('oldAssetInfoListSize===' + oldAssetInfoList.size());
         allAssetInfoList.clear();
 
         totalFixDataNum = oldAssetInfoList.size(); // 鎵撳嬀鍥哄畾鏁版嵁鏁伴噺
@@ -968,6 +970,7 @@
         }
         System.debug('currPage===' + currPage);
         System.debug('totalPage===' + totalPage);
+        System.debug('selctRecordNum===' + selctRecordNum);
         if (selRecordOption != NONE) {
             // selRecordOption = String.valueOf(Integer.valueOf(selRecordOption) + checkedAssetInfoNum);
             if (currPage == 1) {
@@ -977,7 +980,12 @@
                 soqlAsset += ' limit ' + selRecordOption + ' offset ' + String.valueOf((currPage - 1) * selctRecordNum - checkedAssetInfoNum);
                 System.debug('Last page;');
             } else {
-                soqlAsset += ' limit ' + selRecordOption + ' offset ' + String.valueOf((currPage - 1) * selctRecordNum - checkedAssetInfoNum);
+                if(oldAssetInfoList.size() > 10 && currPage == 2){
+                    soqlAsset += ' limit ' + selRecordOption + ' offset ' + String.valueOf((currPage) * selctRecordNum - checkedAssetInfoNum);
+                }else{
+                    soqlAsset += ' limit ' + selRecordOption + ' offset ' + String.valueOf((currPage - 1) * selctRecordNum - checkedAssetInfoNum);
+                }
+                
             }
         }
         // 鏈�缁堟绱㈢粨鏋�
diff --git a/force-app/main/default/classes/CheckAllOlympusAssetControllerTest.cls b/force-app/main/default/classes/CheckAllOlympusAssetControllerTest.cls
index 8f48134..6a2187b 100644
--- a/force-app/main/default/classes/CheckAllOlympusAssetControllerTest.cls
+++ b/force-app/main/default/classes/CheckAllOlympusAssetControllerTest.cls
@@ -1,6 +1,7 @@
 @isTest
 private class CheckAllOlympusAssetControllerTest {
      private static void createAssetData() {
+        TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'});
         // OLY_OCM-643 杩藉姞EscapeNFM001Trigger
         ControllerUtil.EscapeNFM001Trigger = true;
         // 鐪�
@@ -563,17 +564,17 @@
         page.getParameters().put('assertCondition', 'all');
         page.getParameters().put('fromQuickBarFlag', 'true');
         String csvStr = '';
-        csvStr += 'Id锛堜笉鍙慨鏀癸級,Internal_asset_location__c,Salesdepartment__c,SalesProvince__c,Fixture_Model_No_F__c锛堜笉鍙慨鏀癸級,CompanyOfEquipment__c,Internal_Asset_number__c,Internal_Asset_number_key__c锛堜笉鍙慨鏀癸級,';
-        csvStr += 'SerialNumber,Product_category__c,Equipment_Type__c,Consumable_Guaranteen_end__c,Manage_type__c,Loaner_accsessary__c,EquipmentSet_Managment_Code__c,AssetManageConfirm__c,Fixture_QRCode__c锛堜笉鍙慨鏀癸級,';
-        csvStr += 'WH_location__c,Quantity,You_Xiao_Ku_Cun__c锛堜笉鍙慨鏀癸級,Ji_Zhong_Guan_Li_Ku_Cun__c锛堜笉鍙慨鏀癸級,Out_of_wh__c,Rental_Count__c,Frozen_Quantity__c,Abandoned_RealThing__c,Abandoned_Inventory__c,Repairing_Count__c锛堜笉鍙慨鏀癸級,';
-        csvStr += 'Fixture_Status__c锛堜笉鍙慨鏀癸級,Main_OneToOne__c';
+        csvStr += 'Id,Internal_asset_location__c,Salesdepartment__c,SalesProvince__c,Fixture_Model_No_F__c,CompanyOfEquipment__c,Internal_Asset_number__c,Internal_Asset_number_key__c,';
+        csvStr += 'SerialNumber,Product_category__c,Equipment_Type__c,Consumable_Guaranteen_end__c,Manage_type__c,Loaner_accsessary__c,EquipmentSet_Managment_Code__c,AssetManageConfirm__c,Fixture_QRCode__c,';
+        csvStr += 'WH_location__c,Quantity,You_Xiao_Ku_Cun__c,Ji_Zhong_Guan_Li_Ku_Cun__c,Out_of_wh__c,Rental_Count__c,Frozen_Quantity__c,Abandoned_RealThing__c,Abandoned_Inventory__c,Repairing_Count__c,';
+        csvStr += 'Fixture_Status__c,Main_OneToOne__c,Status';
         csvStr += '\r\n';
         csvStr += 'Id锛堜笉鍙慨鏀癸級,澶囧搧瀛樻斁鍦�,鎵�鍦ㄥ湴鍖�(鏈儴),鎵�鍦ㄥ湴鍖�(鐪�),澶囧搧閰嶅鏄庣粏鍨嬪彿锛堜笉鍙慨鏀癸級,澶囧搧鎵�灞炲叕鍙�,鍥哄畾璧勪骇缂栧彿,鍥哄畾璧勪骇缂栧彿(Key)锛堜笉鍙慨鏀癸級,銈枫儶銈€儷鐣彿,浜у搧鍒嗙被(GI/SP),澶囧搧鍒嗙被,娑堣�楀搧鏈夋晥鏈熻嚦,';
-        csvStr += '绠$悊绉嶇被,澶囧搧鐢ㄩ�旈檮灞炲搧,澶囧搧绠$悊缂栫爜,澶囧搧涓績纭,澶囧搧QRCode锛堜笉鍙慨鏀癸級,璐ф灦鍙�,鏁伴噺,鏈夋晥搴撳瓨锛堜笉鍙慨鏀癸級,闆嗕腑绠$悊搴撳瓨锛堜笉鍙慨鏀癸級,鍊熷嚭_鍒嗛厤_鏁�,宸插�熷嚭鏁�,鍐荤粨鏁�,寰呭簾寮冩暟(瀹炵墿),寰呭簾寮冩暟(涓㈠け/鐩樹簭),淇悊涓欢鏁帮紙涓嶅彲淇敼锛�,澶囧搧鐘舵�侊紙涓嶅彲淇敼锛�,涓�瀵逛竴淇濈涓讳綋';
+        csvStr += '绠$悊绉嶇被,澶囧搧鐢ㄩ�旈檮灞炲搧,澶囧搧绠$悊缂栫爜,澶囧搧涓績纭,澶囧搧QRCode锛堜笉鍙慨鏀癸級,璐ф灦鍙�,鏁伴噺,鏈夋晥搴撳瓨锛堜笉鍙慨鏀癸級,闆嗕腑绠$悊搴撳瓨锛堜笉鍙慨鏀癸級,鍊熷嚭_鍒嗛厤_鏁�,宸插�熷嚭鏁�,鍐荤粨鏁�,寰呭簾寮冩暟(瀹炵墿),寰呭簾寮冩暟(涓㈠け/鐩樹簭),淇悊涓欢鏁帮紙涓嶅彲淇敼锛�,澶囧搧鐘舵�侊紙涓嶅彲淇敼锛�,涓�瀵逛竴淇濈涓讳綋,鐘舵��';
         csvStr += '\r\n';
         csvStr += targetAssetId;
         csvStr += ',涓婃捣 澶囧搧涓績,3.瑗垮寳钀ヤ笟鏈儴,娌堥槼,IMH-20,涓婃捣,8765_4211,51128765_4211,3,GI,浜у搧璇曠敤,,涓綋绠$悊,';
-        csvStr += 'true,51138765_4 _1,true,51128765_4211,N10,1.00,0,0,0,0,,,,0,鏃犲簱瀛�,true';
+        csvStr += 'true,51138765_4 _1,true,51128765_4211,N10,1.00,0,0,0,0,,,,0,鏃犲簱瀛�,true,浣跨敤涓�';
         csvStr += '\r\n';
         page.getParameters().put('csvData', csvStr);
 
diff --git a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
index 0e8c407..66c6fe0 100644
--- a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
+++ b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
@@ -2,12 +2,12 @@
 private class ConsumTrialPDFControllerTest {
     @testSetup
     static void setupTestData() {
-        
         List<String> strList = new List<String>();
         strList.add('Consum_Apply_Equipment_Set_Detail__c');
         strList.add('Consum_Apply__c');
         strList.add('Document');
         strList.add('Agency_Contact__c');
+        strList.add('Contact');
         TestDataUtility.CreatePIPolicyConfigurations(strList);
         
         // 鐢ㄦ埛
diff --git a/force-app/main/default/classes/ISO_DemandOperAndDemonsJumpController.cls b/force-app/main/default/classes/ISO_DemandOperAndDemonsJumpController.cls
index c66ccec..5328a7d 100644
--- a/force-app/main/default/classes/ISO_DemandOperAndDemonsJumpController.cls
+++ b/force-app/main/default/classes/ISO_DemandOperAndDemonsJumpController.cls
@@ -10,23 +10,9 @@
     	this.isid = (IS_Opportunity_Demand__c)controller.getRecord();
 	}
 	public void init() {
-		// String eid = ApexPages.currentPage().getParameters().get('id');
-		
-		IS_Opportunity_Demand__c isod = [select Id, Operating_Room_Count__c,Opportunity_ID__c,Demonstration_Number__c from IS_Opportunity_Demand__c where Id = :isid.Id];
-		if(isod.Demonstration_Number__c == null && isod.Operating_Room_Count__c == null){
-			lid = 'ISO_DemandOperAndDemons?Id='+isod.Id+'&OppoerID='+isod.Opportunity_ID__c;
-		}else{
-			lid = 'ISO_DemandOperAndDemonsNew?id='+isod.Id+'&OppoerID='+isod.Opportunity_ID__c;
-		}
-		Integer i = 0;
-		i++;
-		i++;
-		i++;
-		i++;
-		i++;
-		i++;
-		i++;
-		i++;
-		i++;
+		String Id = ApexPages.currentPage().getParameters().get('Id');
+		String oppId = ApexPages.currentPage().getParameters().get('oppId');
+		//IS_Opportunity_Demand__c isod = [select Id, Operating_Room_Count__c,Opportunity_ID__c,Demonstration_Number__c from IS_Opportunity_Demand__c where Id = :Id];
+		lid = 'ISO_DemandOperAndDemonsNew?id='+Id+'&OppoerID='+oppId;
 	}
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/ImprovedForecastTimeController.cls b/force-app/main/default/classes/ImprovedForecastTimeController.cls
index 8710c67..55e850e 100644
--- a/force-app/main/default/classes/ImprovedForecastTimeController.cls
+++ b/force-app/main/default/classes/ImprovedForecastTimeController.cls
@@ -151,9 +151,20 @@
             InquiryPredictsDateChange__c ipd = mergeInfo(oppMap);
             // ipd.Predicted_Date_Status__c = '宸叉彁浜�';
             upsert ipd;
-        }catch(Exception ex)
+        }catch(Exception e)
         {
-            return  ex.getLineNumber()+'  琛岄敊璇� :   '+ex.getMessage();
+            if (e.getMessage().contains('EXCEPTION,')) {
+                System.debug(LoggingLevel.INFO, '*** e: ' + e);
+                String exc = '' + e.getMessage();
+                Integer left = exc.indexOf('EXCEPTION,') + 10;
+                Integer right = exc.lastIndexOf('銆�: [') + 1;
+                String str = exc.substring(left,right);
+                // left = str.indexOf(',') +  1;
+                // String newStr = str.substring(left);
+                return str;
+            }else {
+                return e.getMessage();   
+            }
         }
         return  '鎴愬姛';
     }
diff --git a/force-app/main/default/classes/InventoryReportControllerTest.cls b/force-app/main/default/classes/InventoryReportControllerTest.cls
index 9dae755..f70cd45 100644
--- a/force-app/main/default/classes/InventoryReportControllerTest.cls
+++ b/force-app/main/default/classes/InventoryReportControllerTest.cls
@@ -1,7 +1,10 @@
 @isTest
 private class InventoryReportControllerTest {
     // 鍒涘缓 Asset & 鐩樼偣琛ㄥご & 鐩樼偣鏄庣粏 鏁版嵁
+    
+    @TestSetup
     static void setupTestData() {
+        TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'});
         SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
         InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
         InventoryHeaderName.SS_Column_001__c = 'BJ';
@@ -297,7 +300,6 @@
         user.JingliEquipmentManager__c = UserInfo.getUserId();
 
         System.runAs(new User(Id = Userinfo.getUserId())) {
-            setupTestData();
 
             insert user;
             User currUser = [
@@ -345,7 +347,6 @@
     // 淇濆瓨鎸夐挳--鐩樼偣鎶ュ憡鎻愪氦浜� & 鐩樼偣鎶ュ憡纭浜� & 鐩樼偣浜哄憳 & 鐩樼偣鏃堕棿From & 鐩樼偣鏃堕棿To & 鐩樼偣宸紓鍏蜂綋鎯呭喌璇存槑 & 宸紓璧勪骇閮ㄩ棬澶勭悊鎰忚
     static testMethod void testSaveData() {
         
-            setupTestData();
 
             PageReference page = new PageReference('/apex/InventoryReport?Id=' + invHeadId);
             System.Test.setCurrentPage(page);
@@ -365,7 +366,7 @@
             System.Test.StartTest();
             controller.init();
             page = controller.saveSubmit();
-
+            controller.init();
             
 
             Inventory_Header__c invHead = [
@@ -392,7 +393,6 @@
 
     // 鎻愪氦鐩樼偣鎶ュ憡鎸夐挳
     static testMethod void testSubmitData() {
-        setupTestData();
 
         PageReference page = new PageReference('/apex/InventoryReport?Id=' + invHeadId + '&saveType=1');
         System.Test.setCurrentPage(page);
@@ -407,7 +407,7 @@
         controller.ihObj.IvtDifference_Detail__c = '鐩樼偣宸紓鍏蜂綋鎯呭喌璇存槑';
         controller.ihObj.IvtDifference_Comment__c = '宸紓璧勪骇閮ㄩ棬澶勭悊鎰忚';
         page = controller.saveSubmit();
-
+        controller.init();
         System.Test.StartTest();
 
         //System.assertEquals(controller.ihObj.Inventory_Status__c, '濉啓瀹屾瘯');
@@ -419,9 +419,13 @@
 
     // 鎻愪氦鐩樼偣鎶ュ憡鎸夐挳--瀹℃壒娴�
     static testMethod void testApprovalProcess() {
-        setupTestData();
-
-        PageReference page = new PageReference('/apex/InventoryReport?Id=' + invHeadId + '&saveType=1');
+        Inventory_Header__c invHeadObj = new Inventory_Header__c();
+        invHeadObj.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        invHeadObj.Inventory_Start_Date__c = Date.today();
+        invHeadObj.Inventory_Status__c = '鐩樼偣涓�';
+        invHeadObj.UniqueKey__c = '澶囧搧涓績Obj锛�' + String.valueOf(Date.today());
+        insert invHeadObj;
+        PageReference page = new PageReference('/apex/InventoryReport?Id=' + invHeadObj.Id + '&saveType=1');
         System.Test.setCurrentPage(page);
         InventoryReportController controller = new InventoryReportController();
         controller.init();
@@ -434,7 +438,6 @@
         controller.ihObj.IvtDifference_Detail__c = '鐩樼偣宸紓鍏蜂綋鎯呭喌璇存槑';
         controller.ihObj.IvtDifference_Comment__c = '宸紓璧勪骇閮ㄩ棬澶勭悊鎰忚';
         page = controller.saveSubmit();
-
         System.Test.StartTest();
 
         // List<ProcessInstance> piList = [
@@ -472,7 +475,6 @@
 
     // for coverage
     static testMethod void testException() {
-        setupTestData();
 
         Inventory_Header__c invHeadObj = new Inventory_Header__c();
         invHeadObj.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
@@ -501,6 +503,7 @@
         controller.ihObj.Inventory_Date_From__c = Date.today().addDays(60);
         controller.ihObj.Inventory_Date_To__c = Date.today();
         page3 = controller.saveSubmit();
+        controller.init();
 
         // 鐩樼偣鎶ュ憡鎻愪氦浜烘垨纭浜轰笉鑳戒负绌�, 璇峰厛纭銆�
         PageReference page4 = new PageReference('/apex/InventoryReport?Id=' + invHeadId);
@@ -510,6 +513,7 @@
         controller.ihObj.Inventory_Date_To__c = Date.today();
         controller.ihObj.InventorySubmit_PIC__c = null;
         page4 = controller.saveSubmit();
+        controller.init();
     }
     static testMethod void updaue() {
         InventoryReportController.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫�
diff --git a/force-app/main/default/classes/InventoryResultRecordControllerTest.cls b/force-app/main/default/classes/InventoryResultRecordControllerTest.cls
index 7b8f155..2353f60 100644
--- a/force-app/main/default/classes/InventoryResultRecordControllerTest.cls
+++ b/force-app/main/default/classes/InventoryResultRecordControllerTest.cls
@@ -4,6 +4,8 @@
     public static User user = new User();
     static void setupTestData() {
         ControllerUtil.EscapeNFM001Trigger = true;
+        Oly_TriggerHandler.bypass(Product2Handler.Class.getName());
+        Oly_TriggerHandler.bypass(ContactTriggerHandler.Class.getName());
         //// 鐪�
         //Address_Level__c al = new Address_Level__c();
         //al.Name = '鏉变含';
@@ -201,6 +203,8 @@
                 timezonesidkey='America/Los_Angeles', 
                 username='test@acme.com' + Datetime.now().getTime());
             insert user;
+            InventoryResultRecordController con = new InventoryResultRecordController();
+            // con.save();
         }
         //Repair__c repair = new Repair__c();
         //repair.Service_Repair_No__c = 'repair';
@@ -210,6 +214,7 @@
         //repair.Department_Class__c = strategicDep[0].id;
         //repair.Delivered_Product__c = assetA2.Id;
         //insert repair;
+        
     }
 
     /**  鐐瑰嚮寮�濮嬬洏鐐�
@@ -226,6 +231,7 @@
         setupTestData();
         InventoryResultRecordController con = new InventoryResultRecordController();
         con.init();
+        con.showResult();
         //con.bieCunFangDi = '鍖椾含 澶囧搧涓績';
 
         //鏈紑濮嬬洏鐐�
@@ -271,21 +277,23 @@
         }
         //system.assert(b);
 
-         //ihList[0].Inventory_Status__c = '宸叉壒鍑�';
-         //ihList[0].InventoryCheck_PIC__c = [SELECT Id
-          //       FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
-         //ihList[0].InventorySubmit_PIC__c = [SELECT id
-         //        FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        //  ihList[0].Inventory_Status__c = '宸叉壒鍑�';
+        //  ihList[0].InventoryCheck_PIC__c = [SELECT Id
+        //         FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        //  ihList[0].InventorySubmit_PIC__c = [SELECT id
+        //         FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
         // update ihList;
 
-        //鏈湀宸叉湁缁撴潫鐨勭洏鐐�
+        // con.showResult();
+
+        // // 鏈湀宸叉湁缁撴潫鐨勭洏鐐�
         // con.startInventory();
         // msgs = ApexPages.getMessages();
         // b = false;
         // for(Apexpages.Message msg:msgs){
         //     if (msg.getDetail().contains('鏈粨搴撴湰鏈堝凡杩涜杩囩洏鐐�')) b = true;
-         //}
-        //system.assert(b);
+        //  }
+        // system.assert(b);
     }
 
     static testMethod void testMethod2() {
@@ -310,9 +318,13 @@
         Database.executeBatch(new InventoryStartAssetSnapshotBatch(cunFangDi,header));
         System.Test.StopTest();
 
+        headerList[0].Inventory_Status__c = '宸叉壒鍑�';
+        update headerList;
+
         InventoryResultRecordController con = new InventoryResultRecordController();
         con.init();
         con.searchBtn();
+        con.showResult();
     }
 
     static testMethod void testMethod3() {
@@ -374,6 +386,17 @@
         con.searchBtn();
         System.assertEquals(19, con.salesdepartmentOpts.size());
         System.assertEquals(57, con.salesProvinceOpts.size());
+
+        List<Inventory_Header__c> headerList = [select UniqueKey__c from Inventory_Header__c];
+        con.showResult();
+
+        headerList[0].Inventory_Status__c = '鐩樼偣涓�';
+        update headerList;
+        con.showResult();
+
+        headerList[0].Inventory_Status__c = null;
+        update headerList;
+        con.showResult();
         
         //con.inventoryDetailList[0].Inventory_Count__c = 1;
         //con.save();
@@ -412,6 +435,328 @@
         }
     }
     static testMethod void updaue() {
-        InventoryResultRecordController.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫�
+        //InventoryResultRecordController.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫�
     }
+
+
+
+    //lt start
+    static testMethod void testMethod06() {
+        bp3_Setting__c conf = bp3_Setting__c.getOrgDefaults();
+        conf.SH_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.InventoryDetailArchiveFolder__c = UserInfo.getUserId();
+        insert conf;
+
+        setupTestData();
+        InventoryResultRecordController con = new InventoryResultRecordController();
+        con.init();
+        con.showResult();
+        con.bieCunFangDi = '涓婃捣 澶囧搧涓績';
+
+        //鏈紑濮嬬洏鐐�
+        List<Apexpages.Message> msgs = ApexPages.getMessages();
+        boolean b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('娌℃湁寮�濮嬩腑鐨勭洏鐐癸紝璇风偣鍑诲紑濮嬬洏鐐�')) b = true;
+        }
+        //system.assert(b);
+
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        // 銉︺兗銈躲兗浣滄垚
+        User hpOwner = new User(Test_staff__c = true, LastName = 'hp', 
+                                FirstName = 'owner', Alias = 'hp', 
+                                CommunityNickname = 'hpOwner', 
+                                Email = 'olympus_hpowner@sunbridge.com', 
+                                Username = 'olympus_hpowner@sunbridge.com', 
+                                IsActive = true, EmailEncodingKey = 'ISO-2022-JP', 
+                                TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP',
+                                 LanguageLocaleKey = 'ja', ProfileId = p.id);
+        insert hpOwner;
+        System.debug('---lt123---'+hpOwner);
+        System.runAs(hpOwner) {
+            //娌℃湁寮�濮嬫潈闄�
+            con.startInventory();
+            msgs = ApexPages.getMessages();
+            b = false;
+            for(Apexpages.Message msg:msgs){
+                if (msg.getDetail().contains('娌℃湁寮�濮嬬洏鐐圭殑鏉冮檺')) b = true;
+            }
+        }
+
+        //绗竴娆″紑濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('寮�濮嬬洏鐐瑰鐞嗭紝璇风瓑寰匓atch澶勭悊缁撴潫')) b = true;
+        }
+        List<Inventory_Header__c> ihList = [select Id,InventoryCheck_PIC__c,InventorySubmit_PIC__c from Inventory_Header__c];
+
+        //鍐嶆寮�濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('鏈夋湭缁撴潫鐨勭洏鐐�')) b = true;
+        }
+    }
+
+    static testMethod void testMethod07() {
+        bp3_Setting__c conf = bp3_Setting__c.getOrgDefaults();
+        conf.GZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.InventoryDetailArchiveFolder__c = UserInfo.getUserId();
+        insert conf;
+
+        setupTestData();
+        InventoryResultRecordController con = new InventoryResultRecordController();
+        con.init();
+        con.showResult();
+        con.bieCunFangDi = '骞垮窞 澶囧搧涓績';
+
+        //鏈紑濮嬬洏鐐�
+        List<Apexpages.Message> msgs = ApexPages.getMessages();
+        boolean b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('娌℃湁寮�濮嬩腑鐨勭洏鐐癸紝璇风偣鍑诲紑濮嬬洏鐐�')) b = true;
+        }
+        //system.assert(b);
+
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        // 銉︺兗銈躲兗浣滄垚
+        User hpOwner = new User(Test_staff__c = true, LastName = 'hp', 
+                                FirstName = 'owner', Alias = 'hp', 
+                                CommunityNickname = 'hpOwner', 
+                                Email = 'olympus_hpowner@sunbridge.com', 
+                                Username = 'olympus_hpowner@sunbridge.com', 
+                                IsActive = true, EmailEncodingKey = 'ISO-2022-JP', 
+                                TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP',
+                                 LanguageLocaleKey = 'ja', ProfileId = p.id);
+        insert hpOwner;
+        System.debug('---lt123---'+hpOwner);
+        System.runAs(hpOwner) {
+            //娌℃湁寮�濮嬫潈闄�
+            con.startInventory();
+            msgs = ApexPages.getMessages();
+            b = false;
+            for(Apexpages.Message msg:msgs){
+                if (msg.getDetail().contains('娌℃湁寮�濮嬬洏鐐圭殑鏉冮檺')) b = true;
+            }
+        }
+
+        //绗竴娆″紑濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('寮�濮嬬洏鐐瑰鐞嗭紝璇风瓑寰匓atch澶勭悊缁撴潫')) b = true;
+        }
+        List<Inventory_Header__c> ihList = [select Id,InventoryCheck_PIC__c,InventorySubmit_PIC__c from Inventory_Header__c];
+
+        //鍐嶆寮�濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('鏈夋湭缁撴潫鐨勭洏鐐�')) b = true;
+        }
+    }
+
+    static testMethod void testMethod37() {
+        Oly_TriggerHandler.bypass(InventoryHeaderHandler.Class.getName());
+
+        bp3_Setting__c conf = bp3_Setting__c.getOrgDefaults();
+        conf.SJZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.GZ_Start_Inventory_User_Agency__c = UserInfo.getUserId();
+        conf.CD_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.CQ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.NN_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.KM_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.WH_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.GY_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.CS_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.HF_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.NC_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.NJ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.HZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.FZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.SH_Start_Inventory_User_Agency__c = UserInfo.getUserId();
+        conf.TJ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.XN_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.YC_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.CC_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.HEB_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.DL_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.WLMQ_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.LZ_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.XA_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.TY_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.ZZ_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.JN_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.HHHT_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.SY_Start_Inventory_User__c = UserInfo.getUserId();
+        // conf.QD_Start_Inventory_User__c = UserInfo.getUserId();
+
+        
+        conf.InventoryDetailArchiveFolder__c = UserInfo.getUserId();
+        insert conf;
+
+        String biecunFangDi = '鐭冲搴�';
+        Inventory_Header__c header = new Inventory_Header__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.Internal_asset_location__c = biecunFangDi;
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        List<Inventory_Header__c> headerList = [select UniqueKey__c from Inventory_Header__c];
+
+        setupTestData();
+        InventoryResultRecordController con = new InventoryResultRecordController();
+        con.init();
+        con.showResult();
+        con.bieCunFangDi = '鐭冲搴�';
+        con.showResult();
+
+        headerList[0].Inventory_Status__c = '鐩樼偣涓�';
+        update headerList;
+        con.showResult();
+
+        headerList[0].Inventory_Status__c = null;
+        update headerList;
+        con.showResult();
+
+        //鏈紑濮嬬洏鐐�
+        List<Apexpages.Message> msgs = ApexPages.getMessages();
+        boolean b = false;
+        User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
+        Profile p = [select Id from Profile where Name = '绯荤粺绠$悊鍛�'];
+        User user1 = new User();
+        user1.ProfileId = p.Id;
+        user1.FirstName = '銉︺兗銈躲兗';
+        user1.LastName = '銉嗐偣銉�';
+        user1.Email = 'test_user@example.com';
+        user1.emailencodingkey='UTF-8';
+        user1.languagelocalekey='zh_CN';
+        user1.localesidkey='ja_JP';
+        user1.timezonesidkey='Asia/Shanghai';
+        user1.Username = 'test_user111@example.com';
+        user1.Alias = '銉嗐儲';
+        user1.CommunityNickname = '銉嗐偣銉堛儲銉笺偠銉�';
+        user1.Dept__c = '鍖荤枟鍗庡崡钀ヤ笟鏈儴';
+        user1.JingliEquipmentManager__c = thisUser.Id;
+        insert user1;
+        // System.runAs (user1) {
+        //鍐嶆寮�濮嬬洏鐐�
+        con.startInventory();
+        con.bieCunFangDi = '鎴愰兘';
+        con.startInventory();
+        con.bieCunFangDi = '骞垮窞';
+        con.startInventory();
+        con.bieCunFangDi = '閲嶅簡';
+        con.startInventory();
+        con.bieCunFangDi = '鍗楀畞';
+        con.startInventory();
+        con.bieCunFangDi = '鏄嗘槑';
+        con.startInventory();
+        con.bieCunFangDi = '姝︽眽';
+        con.startInventory();
+        con.bieCunFangDi = '璐甸槼';
+        con.startInventory();
+        con.bieCunFangDi = '闀挎矙';
+        con.startInventory();
+        con.bieCunFangDi = '鍚堣偉';
+        con.startInventory();
+        con.bieCunFangDi = '鍗楁槍';
+        con.startInventory();
+        con.bieCunFangDi = '鍗椾含';
+        con.startInventory();
+        con.bieCunFangDi = '鏉窞';
+        con.startInventory();
+        con.bieCunFangDi = '绂忓窞';
+        con.startInventory();
+        con.bieCunFangDi = '涓婃捣';
+        con.startInventory();
+        con.bieCunFangDi = '澶╂触';
+        con.startInventory();
+        con.bieCunFangDi = '瑗垮畞';
+        con.startInventory();
+        // con.bieCunFangDi = '閾跺窛';
+        // con.startInventory();
+        
+        // }
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('鏈夋湭缁撴潫鐨勭洏鐐�')) b = true;
+        }
+    }
+
+    static testMethod void testMethod20() {
+        bp3_Setting__c conf = bp3_Setting__c.getOrgDefaults();
+        conf.YC_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.InventoryDetailArchiveFolder__c = UserInfo.getUserId();
+
+        conf.CC_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.HEB_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.DL_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.WLMQ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.LZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.XA_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.TY_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.ZZ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.JN_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.HHHT_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.SY_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.QD_Start_Inventory_User__c = UserInfo.getUserId();
+
+        insert conf;
+
+        setupTestData();
+        InventoryResultRecordController con = new InventoryResultRecordController();
+        con.init();
+        con.showResult();
+        con.bieCunFangDi = '閾跺窛';
+
+        //鏈紑濮嬬洏鐐�
+        List<Apexpages.Message> msgs = ApexPages.getMessages();
+        boolean b = false;
+
+        //鍐嶆寮�濮嬬洏鐐�
+        con.startInventory();
+
+        con.bieCunFangDi = '闀挎槬';
+        con.startInventory();
+        con.bieCunFangDi = '鍝堝皵婊�';
+        con.startInventory();
+        con.bieCunFangDi = '澶ц繛';
+        con.startInventory();
+        con.bieCunFangDi = '涔岄瞾鏈ㄩ綈';
+        con.startInventory();
+        con.bieCunFangDi = '鍏板窞';
+        con.startInventory();
+        con.bieCunFangDi = '瑗垮畨';
+        con.startInventory();
+        con.bieCunFangDi = '澶師';
+        con.startInventory();
+        con.bieCunFangDi = '閮戝窞';
+        con.startInventory();
+        con.bieCunFangDi = '娴庡崡';
+        con.startInventory();
+        con.bieCunFangDi = '鍛煎拰娴╃壒';
+        con.startInventory();
+        con.bieCunFangDi = '娌堥槼';
+        con.startInventory();
+        con.bieCunFangDi = '闈掑矝';
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('鏈夋湭缁撴潫鐨勭洏鐐�')) b = true;
+        }
+    }
+    //lt end
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/MaintenanceProductDataControllerTest.cls b/force-app/main/default/classes/MaintenanceProductDataControllerTest.cls
index 85a630f..87a018c 100644
--- a/force-app/main/default/classes/MaintenanceProductDataControllerTest.cls
+++ b/force-app/main/default/classes/MaintenanceProductDataControllerTest.cls
@@ -371,12 +371,25 @@
             mpdTest1.mpdDetailsRecords[3].mpded.Intra_Trade_Gurantee_RMB__c = 7500.00 ;
             mpdTest1.mpdDetailsRecords[3].mpded.Maintenance_Price_Year__c = 7000.00;
             mpdTest1.UpdateSave();
-            Attachment att = new Attachment(
-                Name = 'test',
-                ParentId = mpdTest1.Id,
-                Body = EncodingUtil.base64Decode('test')
-            );
-            insert att;
+            ContentVersion version = new ContentVersion();
+            version.Title = '123';
+            version.VersionData = EncodingUtil.base64Decode('test');
+            version.ContentLocation = 's';
+            version.PathOnClient = '123.txt';
+            insert version;
+            version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+            ContentDocumentLink link = new ContentDocumentLink();
+            link.ContentDocumentId = version.ContentDocumentId;
+            link.LinkedEntityId = mpdTest1.Id;
+            link.ShareType = 'I';
+            link.Visibility = 'AllUsers';
+            insert link;
+            // Attachment att = new Attachment(
+            //     Name = 'test',
+            //     ParentId = mpdTest1.Id,
+            //     Body = EncodingUtil.base64Decode('test')
+            // );
+            // insert att;
             //system.assertEquals(1,mList.size());  
             if(mList.size()>0){
                 mList[0].Status__c = '瀹℃壒涓�-鏈嶅姟';
@@ -429,12 +442,25 @@
             //mpdTest1.UpdateSave();
             List<Maintenance_Product_Data__c> mListEdit = [SELECT Id,Status__c,Name,RecordTypeId, RecordType.Name,RecordType.DeveloperName
                             FROM Maintenance_Product_Data__c where id = :mpdTest1.id];
-            Attachment att = new Attachment(
-                Name = 'test11',
-                ParentId = mListEdit[0].Id,
-                Body = EncodingUtil.base64Decode('test11')
-            );
-            insert att;
+            ContentVersion version = new ContentVersion();
+            version.Title = '123';
+            version.VersionData = EncodingUtil.base64Decode('test11');
+            version.ContentLocation = 's';
+            version.PathOnClient = '123.txt';
+            insert version;
+            version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+            ContentDocumentLink link = new ContentDocumentLink();
+            link.ContentDocumentId = version.ContentDocumentId;
+            link.LinkedEntityId = mListEdit[0].Id;
+            link.ShareType = 'I';
+            link.Visibility = 'AllUsers';
+            insert link;
+            // Attachment att = new Attachment(
+            //     Name = 'test11',
+            //     ParentId = mListEdit[0].Id,
+            //     Body = EncodingUtil.base64Decode('test11')
+            // );
+            // insert att;
             mpdTest1.init();
             mpdTest1.UpdateSave();
             mpdTest1.Submitmpd();
@@ -505,12 +531,25 @@
             MaintenanceProductDataController mpdTest1 = new MaintenanceProductDataController(new ApexPages.StandardController(m));
             List<Maintenance_Product_Data__c> mListEdit = [SELECT Id,Status__c,Name,RecordTypeId, RecordType.Name,RecordType.DeveloperName
                             FROM Maintenance_Product_Data__c where id = :mpdTest1.id];
-            Attachment att = new Attachment(
-                Name = 'test11',
-                ParentId = mListEdit[0].Id,
-                Body = EncodingUtil.base64Decode('test11')
-            );
-            insert att;
+            ContentVersion version = new ContentVersion();
+            version.Title = '123';
+            version.VersionData = EncodingUtil.base64Decode('test11');
+            version.ContentLocation = 's';
+            version.PathOnClient = '123.txt';
+            insert version;
+            version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+            ContentDocumentLink link = new ContentDocumentLink();
+            link.ContentDocumentId = version.ContentDocumentId;
+            link.LinkedEntityId = mListEdit[0].Id;
+            link.ShareType = 'I';
+            link.Visibility = 'AllUsers';
+            insert link;
+            // Attachment att = new Attachment(
+            //     Name = 'test11',
+            //     ParentId = mListEdit[0].Id,
+            //     Body = EncodingUtil.base64Decode('test11')
+            // );
+            // insert att;
             mpdTest1.init();
             mpdTest1.UpdateSave();
             mpdTest1.Submitmpd();
diff --git a/force-app/main/default/classes/NFM401ControllerTest.cls b/force-app/main/default/classes/NFM401ControllerTest.cls
index 3baaae2..3c25996 100644
--- a/force-app/main/default/classes/NFM401ControllerTest.cls
+++ b/force-app/main/default/classes/NFM401ControllerTest.cls
@@ -5,6 +5,7 @@
 
     @testSetup
     static void makeTestRepair() {
+        StaticParameter.EscapeQISTrigger = false;
         List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
         if (rectCo.size() == 0) {
             throw new ControllerUtil.myException('not found 鐥呴櫌 recodetype');
@@ -123,12 +124,25 @@
         System.runAs(new User(Id = Userinfo.getUserId())){
             insert rpr;
         }
+        ContentVersion version = new ContentVersion();
+        version.Title = '123';
+        version.VersionData = EncodingUtil.base64Decode('test02');
+        version.ContentLocation = 's';
+        version.PathOnClient = '123.txt';
+        insert version;
+        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+        ContentDocumentLink link = new ContentDocumentLink();
+        link.ContentDocumentId = version.ContentDocumentId;
+        link.LinkedEntityId = rpr.Id;
+        link.ShareType = 'I';
+        link.Visibility = 'AllUsers';
+        insert link;
 
-        Attachment att = new Attachment();
-        att.ParentId = rpr.Id;
-        att.Name = 'test01';
-        att.Body = EncodingUtil.base64Decode('test02');
-        insert att;
+        // Attachment att = new Attachment();
+        // att.ParentId = rpr.Id;
+        // att.Name = 'test01';
+        // att.Body = EncodingUtil.base64Decode('test02');
+        // insert att;
 
 
          qis = new QIS_Report__c();
@@ -146,11 +160,25 @@
         qis.next_action__c = '鏃犲伩鏇存崲';
         insert qis;
 
-        Attachment att1 = new Attachment();
-        att1.ParentId = qis.Id;
-        att1.Name = 'test02';
-        att1.Body = EncodingUtil.base64Decode('test02');
-        insert att1;
+        // ContentVersion version1 = new ContentVersion();
+        // version1.Title = '123';
+        // version1.VersionData = EncodingUtil.base64Decode('test02');
+        // version1.ContentLocation = 's';
+        // version1.PathOnClient = '123.txt';
+        // insert version1;
+        // version1 = [select ContentDocumentId from ContentVersion where Id =: version1.Id];
+        // ContentDocumentLink link1 = new ContentDocumentLink();
+        // link1.ContentDocumentId = version1.ContentDocumentId;
+        // link1.LinkedEntityId = qis.Id;
+        // link1.ShareType = 'I';
+        // link1.Visibility = 'AllUsers';
+        // insert link;
+
+        // Attachment att1 = new Attachment();
+        // att1.ParentId = qis.Id;
+        // att1.Name = 'test02';
+        // att1.Body = EncodingUtil.base64Decode('test02');
+        // insert att1;
 
     }
 
diff --git a/force-app/main/default/classes/NotetoPdfHandler.cls b/force-app/main/default/classes/NotetoPdfHandler.cls
index 909df59..fc92640 100644
--- a/force-app/main/default/classes/NotetoPdfHandler.cls
+++ b/force-app/main/default/classes/NotetoPdfHandler.cls
@@ -53,12 +53,14 @@
         List<Messaging.SingleEmailMessage> sendMails = new List<Messaging.SingleEmailMessage>();
         List<String> Rlist = new List<String>();
         List<String> ParentIdList = new List<String>();
+        Map<String,String> idMap = new Map<String,String>();
         // QisID
         for (ContentDocumentLink link : newList) {
             if(String.valueOf(link.LinkedEntityId).startsWith('a0J') 
                 || String.valueOf(link.LinkedEntityId).startsWith('a0f')){
                 Rlist.add(link.ContentDocumentId);
                 ParentIdList.add(link.LinkedEntityId);
+                idMap.put(link.ContentDocumentId,link.LinkedEntityId);
             }
         }
         // for (Attachment att : newList) {
@@ -95,11 +97,11 @@
         }
         List<User> userList = [select Id, Name, Email, Manager.Email from User where id IN :IdList];
         for (ContentVersion version : verList) {
-            ContentDocumentLink link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId =: version.ContentDocumentId limit 1];
-            String titName = updateRprMap.containsKey(link.LinkedEntityId)? updateRprMap.get(link.LinkedEntityId).Name : updateQisMap.get(link.LinkedEntityId).Name;
-            String prname = updateRprMap.containsKey(link.LinkedEntityId)? updateRprMap.get(link.LinkedEntityId).Delivered_Product__r.Name : updateQisMap.get(link.LinkedEntityId).nonyushohin__r.Name;
-            String Serial = updateRprMap.containsKey(link.LinkedEntityId)? updateRprMap.get(link.LinkedEntityId).SerialNumber__c : updateQisMap.get(link.LinkedEntityId).lot_or_serial__c;
-            String accountname = updateRprMap.containsKey(link.LinkedEntityId)? updateRprMap.get(link.LinkedEntityId).HP_Name__c : updateQisMap.get(link.LinkedEntityId).Hospital__r.Name;
+            String linkedEntityId = idMap.get(version.ContentDocumentId);
+            String titName = updateRprMap.containsKey(linkedEntityId)? updateRprMap.get(linkedEntityId).Name : updateQisMap.get(linkedEntityId).Name;
+            String prname = updateRprMap.containsKey(linkedEntityId)? updateRprMap.get(linkedEntityId).Delivered_Product__r.Name : updateQisMap.get(linkedEntityId).nonyushohin__r.Name;
+            String Serial = updateRprMap.containsKey(linkedEntityId)? updateRprMap.get(linkedEntityId).SerialNumber__c : updateQisMap.get(linkedEntityId).lot_or_serial__c;
+            String accountname = updateRprMap.containsKey(linkedEntityId)? updateRprMap.get(linkedEntityId).HP_Name__c : updateQisMap.get(linkedEntityId).Hospital__r.Name;
             String title = '';
             String body = '';
             if(version.TextPreview != null){
@@ -119,7 +121,7 @@
             body += '鎿嶄綔鎷呭綋锛�' + UserInfo.getName();
             body += '<br/>';
             body += '<br/>';
-            body += '閾炬帴锛�' + baseUrl + '/' + link.LinkedEntityId +' ';
+            body += '閾炬帴锛�' + baseUrl + '/' + linkedEntityId +' ';
             //鏀朵欢閭
             List<String> toMailList = new List<String>();
             String uId = UserInfo.getUserId();
diff --git a/force-app/main/default/classes/NotetoPdfHandlerTest.cls b/force-app/main/default/classes/NotetoPdfHandlerTest.cls
new file mode 100644
index 0000000..e5265d8
--- /dev/null
+++ b/force-app/main/default/classes/NotetoPdfHandlerTest.cls
@@ -0,0 +1,81 @@
+@isTest
+private class NotetoPdfHandlerTest {
+    private static Id pricebookId = ControllerUtil.getStandardPricebook().Id;
+    static testMethod void NotetoPdf() {
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        insert hospital;
+        
+        // 鎴︾暐绉戝銈掑緱銈�
+        List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI'];
+        
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'].id;
+        dep.Name = 'test dep';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+        
+        // 瑁藉搧銈掍綔銈�
+        Product2 productA = new Product2( Name='銉嗐偣銉堝晢鍝�');
+        insert productA;
+        
+        // 渚℃牸琛ㄣ偍銉炽儓銉倰浣滄垚銇欍倠     
+        PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=productA.Id);
+        entry.UnitPrice = 0;
+        entry.IsActive = true;
+        entry.UseStandardPrice = false;
+        entry.CurrencyIsoCode = 'CNY';
+        entry.Product2Id = productA.Id;
+        insert entry;
+        
+        // 绱嶅叆姗熷櫒銈掍綔鎴愩仚銈�
+        Asset asset = new Asset();
+        asset.Name = '銉嗐偣銉堟鍣�';
+        asset.AccountId = dep.Id;
+        asset.Department_Class__c = strategicDep[0].Id;
+        asset.Hospital__c = hospital.Id;
+        asset.SerialNumber = 'testserial';
+        insert asset;
+        
+        // 缁翠慨鍚堝悓銈掍綔鎴愩仚銈�
+        Maintenance_Contract__c contract = new Maintenance_Contract__c();
+        contract.Name = 'tect contract';
+        contract.Hospital__c = hospital.Id;
+        contract.Department_Class__c = strategicDep[0].Id;
+        contract.Department__c = dep.Id;
+        insert contract;
+        
+        // 淇悊銈掍綔鎴愩仚銈�
+        Repair__c repair = new Repair__c();
+        repair.Account__c = dep.Id;
+        repair.Department_Class__c = strategicDep[0].Id;
+        repair.Hospital__c = hospital.Id;
+        repair.Delivered_Product__c = asset.Id;
+        insert repair;
+        ContentVersion version = new ContentVersion();
+        version.Title = fileName;
+        version.VersionData = EncodingUtil.base64Decode(base64Data);
+        version.ContentLocation = 's';
+        version.PathOnClient = fileName + '.' + contentType;
+        insert version;
+        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+        ContentDocumentLink link = new ContentDocumentLink();
+        link.ContentDocumentId = version.ContentDocumentId;
+        link.LinkedEntityId = repair.Id;
+        link.ShareType = 'V';
+        link.Visibility = 'AllUsers';
+        insert link;
+        // Note n = new Note();
+        // n.ParentId = repair.Id;
+        // n.Title = 'testnote';
+        // insert n;
+        PageReference page = new PageReference('/apex/ReAndQISNotePDF?id='+n.id);
+        System.Test.setCurrentPage(page);
+        ReAndQISNotePDFController conTest = new ReAndQISNotePDFController();
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/NotetoPdfHandlerTest.cls-meta.xml b/force-app/main/default/classes/NotetoPdfHandlerTest.cls-meta.xml
new file mode 100644
index 0000000..f3bac1f
--- /dev/null
+++ b/force-app/main/default/classes/NotetoPdfHandlerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>41.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/OFSRepairConsignPDFOuterControllerTest.cls b/force-app/main/default/classes/OFSRepairConsignPDFOuterControllerTest.cls
index b2bc507..d9a0f26 100644
--- a/force-app/main/default/classes/OFSRepairConsignPDFOuterControllerTest.cls
+++ b/force-app/main/default/classes/OFSRepairConsignPDFOuterControllerTest.cls
@@ -78,6 +78,7 @@
         insert repair1;
         
         // PDF銉嗐偣銉�
+        Test.startTest();
         PageReference page = new PageReference('/apex/OFSRepairConsignPDF?id=' + repair1.Id);
         System.Test.setCurrentPage(page);
         OFSRepairConsignPDFController irpdf = new OFSRepairConsignPDFController();
@@ -91,5 +92,6 @@
         irpdf2.signStr = 'aaaaabbbbbccccc';
         irpdf2.saveSign();
         irpdf2.savePDF();
+        Test.stopTest();
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/OFSUploadImageRest.cls b/force-app/main/default/classes/OFSUploadImageRest.cls
index f6a624e..fcb742e 100644
--- a/force-app/main/default/classes/OFSUploadImageRest.cls
+++ b/force-app/main/default/classes/OFSUploadImageRest.cls
@@ -10,20 +10,27 @@
         String ccId, acId;
         
         if (String.isNotBlank(repairId)) {
-            Repair__c repair = [Select Id, contract_consent_id__c, acceptance_id__c From Repair__c Where Id= :repairId];
-            if (repair == null) {
-                res.statusCode = 200;
-                jsonResponse = '{"status": "Failure", "Message": "no repair found"}';
-                res.responseBody = blob.valueOf(jsonResponse);
-                return;
+            Repair__c repair = null;
+            try {
+                repair = [Select Id, contract_consent_id__c, acceptance_id__c From Repair__c Where Id= :repairId];
+            } catch ( Exception ex ) {
+                returnMessage('{"status": "Failure", "Message": "no repair found"}',200);
+                // res.statusCode = 200;
+                // jsonResponse = '{"status": "Failure", "Message": "no repair found"}';
+                // res.responseBody = blob.valueOf(jsonResponse);
+                // return;
             }
+            
             if (String.isNotBlank(ccImg)) {
-                Repair_Quotation__c repairQ = [Select Id, contract_consent_id__c From Repair_Quotation__c Where Id= :rqId];
-                if (repairQ == null) {
-                    res.statusCode = 200;
-                    jsonResponse = '{"status": "Failure", "Message": "no RepairQuotation found"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                Repair_Quotation__c repairQ = null;
+                try {
+                    repairQ = [Select Id, contract_consent_id__c From Repair_Quotation__c Where Id= :rqId];
+                } catch ( Exception ex ) {
+                    returnMessage('{"status": "Failure", "Message": "no RepairQuotation found"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"status": "Failure", "Message": "no RepairQuotation found"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
                 // Attachment att;
                 ContentVersion version;
@@ -60,10 +67,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"status": "Failure", "Message": "error when try to upsert ContractConsent Attachment. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"status": "Failure", "Message": "error when try to upsert ContractConsent Attachment. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"status": "Failure", "Message": "error when try to upsert ContractConsent Attachment. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
                 
                 try {
@@ -71,10 +79,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"status": "Failure", "Message": "error when try to update RepairQuotation. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"status": "Failure", "Message": "error when try to update RepairQuotation. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"status": "Failure", "Message": "error when try to update RepairQuotation. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
             }
             if (String.isNotBlank(acImg)) {
@@ -112,10 +121,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"status": "Failure", "Message": "error when try to upsert Acceptance Attachment. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"status": "Failure", "Message": "error when try to upsert Acceptance Attachment. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"status": "Failure", "Message": "error when try to upsert Acceptance Attachment. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
             }
             
@@ -123,23 +133,36 @@
             if (String.isNotBlank(acId)) repair.acceptance_id__c = acId;
             try {
                 update repair;
-                res.statusCode = 200;
-                jsonResponse = '{"status": "Success", "Message": "upload Success"}';
-                res.responseBody = blob.valueOf(jsonResponse);
-                return;
+                returnMessage('{"status": "Success", "Message": "upload Success"}',200);
+                // res.statusCode = 200;
+                // jsonResponse = '{"status": "Success", "Message": "upload Success"}';
+                // res.responseBody = blob.valueOf(jsonResponse);
+                // return;
             } catch ( Exception ex ) {
                 //TODO:
                 //error message:cannot update exception
-                res.statusCode = 200;
-                jsonResponse = '{"status": "Failure", "Message": "error when try to update repair data. '+ ex +'"}';
-                res.responseBody = blob.valueOf(jsonResponse);
-                return;
+                returnMessage('{"status": "Failure", "Message": "error when try to update repair data. '+ ex +'"}',200);
+                // res.statusCode = 200;
+                // jsonResponse = '{"status": "Failure", "Message": "error when try to update repair data. '+ ex +'"}';
+                // res.responseBody = blob.valueOf(jsonResponse);
+                // return;
             }
         } else {
-            res.statusCode = 200;
-            jsonResponse = '{"status": "Failure", "Message": "no repair Id"}';
-            res.responseBody = blob.valueOf(jsonResponse);
-            return;
+            returnMessage('{"status": "Failure", "Message": "no repair Id"}',200);
+            // res.statusCode = 200;
+            // jsonResponse = '{"status": "Failure", "Message": "no repair Id"}';
+            // res.responseBody = blob.valueOf(jsonResponse);
+            // return;
         }
     }
+
+    public static void returnMessage(String response,Integer code){
+        RestResponse res = RestContext.response;
+        res.addHeader('Content-Type', 'application/json');
+        String jsonResponse;
+        res.statusCode = code;
+        jsonResponse = response;
+        res.responseBody = blob.valueOf(jsonResponse);
+        return;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/OFSUploadImageRestTest.cls b/force-app/main/default/classes/OFSUploadImageRestTest.cls
new file mode 100644
index 0000000..6d8cdf5
--- /dev/null
+++ b/force-app/main/default/classes/OFSUploadImageRestTest.cls
@@ -0,0 +1,212 @@
+@isTest
+private class OFSUploadImageRestTest {
+    private static Id pricebookId = ControllerUtil.getStandardPricebook().Id;
+    @isTest 
+    static void test_method1() {
+
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        insert hospital;
+        
+        // 鎴︾暐绉戝銈掑緱銈�
+        List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI'];
+        
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'].id;
+        dep.Name = 'test dep';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+        
+        // 瑁藉搧銈掍綔銈�
+        Product2 productA = new Product2( Name='銉嗐偣銉堝晢鍝�');
+        insert productA;
+        
+        // 渚℃牸琛ㄣ偍銉炽儓銉倰浣滄垚銇欍倠     
+        PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=productA.Id);
+        entry.UnitPrice = 0;
+        entry.IsActive = true;
+        entry.UseStandardPrice = false;
+        entry.CurrencyIsoCode = 'CNY';
+        entry.Product2Id = productA.Id;
+        insert entry;
+        
+        // 绱嶅叆姗熷櫒銈掍綔鎴愩仚銈�
+        Asset asset = new Asset();
+        asset.Name = '銉嗐偣銉堟鍣�';
+        asset.AccountId = dep.Id;
+        asset.Department_Class__c = strategicDep[0].Id;
+        asset.Hospital__c = hospital.Id;
+        asset.SerialNumber = 'testserial';
+        insert asset;
+        
+        // 缁翠慨鍚堝悓銈掍綔鎴愩仚銈�
+        Maintenance_Contract__c contract = new Maintenance_Contract__c();
+        contract.Name = 'tect contract';
+        contract.Hospital__c = hospital.Id;
+        contract.Department_Class__c = strategicDep[0].Id;
+        contract.Department__c = dep.Id;
+        insert contract;
+        
+        // 淇悊銈掍綔鎴愩仚銈�
+        Repair__c repair = new Repair__c();
+        repair.Account__c = dep.Id;
+        repair.Department_Class__c = strategicDep[0].Id;
+        repair.Hospital__c = hospital.Id;
+        repair.Delivered_Product__c = asset.Id;
+        insert repair;
+        Repair_Quotation__c rq = new Repair_Quotation__c();
+        rq.Name                  = 'testNFM104';
+        rq.Repair__c             = repair.Id;
+        rq.MessageGroupNumber__c = '1';
+        insert rq;
+        ContentVersion version = new ContentVersion(
+            Title = 'test',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
+        );
+        insert version;
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '瑷虹檪绉� 娑堝寲绉�'];
+        if (rectDpt.size() == 0) {
+            throw new ControllerUtil.myException('not found 瑷虹檪绉� 娑堝寲绉� recordType');
+        }
+        String str = EncodingUtil.base64Encode(version.VersionData);
+        RestRequest req = new RestRequest();
+        RestResponse res = new RestResponse();
+        Account depart = [select Management_Code__c from Account where RecordTypeId = :rectDpt[0].Id];
+        String JsonMsg = '{"visitStartDate":"20211221033551",'+
+                        '"visitPurpose":"缁翠慨璺熻繘",'+
+                        '"visitInfo":"鎶ヤ环浠诲姟",'+
+                        '"visitEndDate":"20211221033554",'+
+                        '"visitDistinction":"鐢ㄦ埛鎷滆",'+
+                        '"synchroDate":"20211221153601",'+
+                        '"replyResult":"鎶ヤ环璺熻繘",'+
+                        '"replyID":"88",'+
+                        '"mngCd":null,'+
+                            '"departmentCd":"'+depart.Management_Code__c+'",'+
+                        '"applicantId":"5",'+
+                        '"activityDifferentiation":"鎶ヤ环璺熻繘"}';
+        req.requestURI = 'services/apexrest/NFM608/execute';
+        req.httpMethod = 'POST';
+        req.requestBody = Blob.valueof(JsonMsg);
+        RestContext.request = req;
+        RestContext.response= res;
+        Test.startTest();
+        OFSUploadImageRest.doPost(repair.Id,str,str,rq.Id);
+        OFSUploadImageRest.doPost('',str,str,rq.Id);
+        // OFSUploadImageRest.doPost(repair.Id,str,str,'');
+        Test.stopTest();
+
+    }
+
+    @isTest 
+    static void test_method2() {
+
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        insert hospital;
+        
+        // 鎴︾暐绉戝銈掑緱銈�
+        List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI'];
+        
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'].id;
+        dep.Name = 'test dep';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+        
+        // 瑁藉搧銈掍綔銈�
+        Product2 productA = new Product2( Name='銉嗐偣銉堝晢鍝�');
+        insert productA;
+        
+        // 渚℃牸琛ㄣ偍銉炽儓銉倰浣滄垚銇欍倠     
+        PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=productA.Id);
+        entry.UnitPrice = 0;
+        entry.IsActive = true;
+        entry.UseStandardPrice = false;
+        entry.CurrencyIsoCode = 'CNY';
+        entry.Product2Id = productA.Id;
+        insert entry;
+        
+        // 绱嶅叆姗熷櫒銈掍綔鎴愩仚銈�
+        Asset asset = new Asset();
+        asset.Name = '銉嗐偣銉堟鍣�';
+        asset.AccountId = dep.Id;
+        asset.Department_Class__c = strategicDep[0].Id;
+        asset.Hospital__c = hospital.Id;
+        asset.SerialNumber = 'testserial';
+        insert asset;
+        
+        // 缁翠慨鍚堝悓銈掍綔鎴愩仚銈�
+        Maintenance_Contract__c contract = new Maintenance_Contract__c();
+        contract.Name = 'tect contract';
+        contract.Hospital__c = hospital.Id;
+        contract.Department_Class__c = strategicDep[0].Id;
+        contract.Department__c = dep.Id;
+        insert contract;
+        
+        // 淇悊銈掍綔鎴愩仚銈�
+        Repair__c repair = new Repair__c();
+        repair.Account__c = dep.Id;
+        repair.Department_Class__c = strategicDep[0].Id;
+        repair.Hospital__c = hospital.Id;
+        repair.Delivered_Product__c = asset.Id;
+        insert repair;
+        Repair_Quotation__c rq = new Repair_Quotation__c();
+        rq.Name                  = 'testNFM104';
+        rq.Repair__c             = repair.Id;
+        rq.MessageGroupNumber__c = '1';
+        insert rq;
+        ContentVersion version = new ContentVersion(
+            Title = 'test',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
+        );
+        insert version;
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '瑷虹檪绉� 娑堝寲绉�'];
+        if (rectDpt.size() == 0) {
+            throw new ControllerUtil.myException('not found 瑷虹檪绉� 娑堝寲绉� recordType');
+        }
+        String str = EncodingUtil.base64Encode(version.VersionData);
+        RestRequest req = new RestRequest();
+        RestResponse res = new RestResponse();
+        Account depart = [select Management_Code__c from Account where RecordTypeId = :rectDpt[0].Id];
+        String JsonMsg = '{"visitStartDate":"20211221033551",'+
+                        '"visitPurpose":"缁翠慨璺熻繘",'+
+                        '"visitInfo":"鎶ヤ环浠诲姟",'+
+                        '"visitEndDate":"20211221033554",'+
+                        '"visitDistinction":"鐢ㄦ埛鎷滆",'+
+                        '"synchroDate":"20211221153601",'+
+                        '"replyResult":"鎶ヤ环璺熻繘",'+
+                        '"replyID":"88",'+
+                        '"mngCd":null,'+
+                            '"departmentCd":"'+depart.Management_Code__c+'",'+
+                        '"applicantId":"5",'+
+                        '"activityDifferentiation":"鎶ヤ环璺熻繘"}';
+        req.requestURI = 'services/apexrest/NFM608/execute';
+        req.httpMethod = 'POST';
+        req.requestBody = Blob.valueof(JsonMsg);
+        RestContext.request = req;
+        RestContext.response= res;
+        Test.startTest();
+        OFSUploadRepairImageRest.doPost(repair.Id,str,str,rq.Id);
+        OFSUploadRepairImageRest.doPost('',str,str,rq.Id);
+        // OFSUploadRepairImageRest.doPost(repair.Id,str,str,'');
+        Test.stopTest();
+
+    }
+
+
+    
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OFSUploadImageRestTest.cls-meta.xml b/force-app/main/default/classes/OFSUploadImageRestTest.cls-meta.xml
new file mode 100644
index 0000000..642d054
--- /dev/null
+++ b/force-app/main/default/classes/OFSUploadImageRestTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>58.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/OFSUploadRepairImageRest.cls b/force-app/main/default/classes/OFSUploadRepairImageRest.cls
index 796f9e8..c371cf7 100644
--- a/force-app/main/default/classes/OFSUploadRepairImageRest.cls
+++ b/force-app/main/default/classes/OFSUploadRepairImageRest.cls
@@ -11,21 +11,31 @@
         String acId;            // 妞滃弾鏇�
         
         if (String.isNotBlank(repairId)) {
-            Repair__c repair = [Select Id, Agreed_Date__c, Facility_Return_Receipt_Collection_Date__c, acceptance_id__c From Repair__c Where Id= :repairId];
-            if (repair == null) {
-                res.statusCode = 200;
-                jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair found"}';
-                res.responseBody = blob.valueOf(jsonResponse);
-                return;
+            Repair__c repair = null;
+            try {
+                repair = [Select Id, Agreed_Date__c, Facility_Return_Receipt_Collection_Date__c, acceptance_id__c From Repair__c Where Id= :repairId];  
+            } catch ( Exception ex ) {
+                returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair found"}',200);
             }
+            // if (repair == null) {
+            //     res.statusCode = 200;
+            //     jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair found"}';
+            //     res.responseBody = blob.valueOf(jsonResponse);
+            //     return;
+            // }
             if (String.isNotBlank(ccImg)) {
-                Repair_Quotation__c repairQ = [Select Id, contract_consent_id__c From Repair_Quotation__c Where Id= :rqId];
-                if (repairQ == null) {
-                    res.statusCode = 200;
-                    jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no RepairQuotation found"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                Repair_Quotation__c repairQ = null;
+                try {
+                    repairQ = [Select Id, contract_consent_id__c From Repair_Quotation__c Where Id= :rqId];  
+                } catch ( Exception ex ) {
+                    returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no RepairQuotation found"}',200);
                 }
+                // if (repairQ == null) {
+                //     res.statusCode = 200;
+                //     jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no RepairQuotation found"}';
+                //     res.responseBody = blob.valueOf(jsonResponse);
+                //     return;
+                // }
                 // List<Attachment> attList = [Select Id, Name, Body, ParentId From Attachment Where Id= :repairQ.contract_consent_id__c];
                 // Attachment att = null;
                 List<ContentVersion> verisonList = [select Id,Title,VersionData from ContentVersion where Id =: repairQ.contract_consent_id__c];
@@ -62,10 +72,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert ContractConsent Attachment. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert ContractConsent Attachment. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert ContractConsent Attachment. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
                 
                 try {
@@ -73,10 +84,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update RepairQuotation. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update RepairQuotation. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update RepairQuotation. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
             }
             if (String.isNotBlank(acImg)) {
@@ -115,10 +127,11 @@
                 } catch ( Exception ex ) {
                     //TODO:
                     //error message:cannot update exception
-                    res.statusCode = 200;
-                    jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert Acceptance Attachment. '+ ex +'"}';
-                    res.responseBody = blob.valueOf(jsonResponse);
-                    return;
+                    returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert Acceptance Attachment. '+ ex +'"}',200);
+                    // res.statusCode = 200;
+                    // jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to upsert Acceptance Attachment. '+ ex +'"}';
+                    // res.responseBody = blob.valueOf(jsonResponse);
+                    // return;
                 }
             }
             
@@ -147,16 +160,28 @@
             } catch ( Exception ex ) {
                 //TODO:
                 //error message:cannot update exception
-                res.statusCode = 200;
-                jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update repair data. '+ ex +'"}';
-                res.responseBody = blob.valueOf(jsonResponse);
-                return;
+                returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update repair data. '+ ex +'"}',200);
+                // res.statusCode = 200;
+                // jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "error when try to update repair data. '+ ex +'"}';
+                // res.responseBody = blob.valueOf(jsonResponse);
+                // return;
             }
         } else {
-            res.statusCode = 200;
-            jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair Id"}';
-            res.responseBody = blob.valueOf(jsonResponse);
-            return;
+            returnMessage('{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair Id"}',200);
+            // res.statusCode = 200;
+            // jsonResponse = '{"'+ System.Label.OFSErrorStatus +'": "'+ System.Label.OFSErrorFailure +'", "'+ System.Label.OFSErrorMessage + '": "no repair Id"}';
+            // res.responseBody = blob.valueOf(jsonResponse);
+            // return;
         }
     }
+
+    public static void returnMessage(String response,Integer code){
+        RestResponse res = RestContext.response;
+        res.addHeader('Content-Type', 'application/json');
+        String jsonResponse;
+        res.statusCode = code;
+        jsonResponse = response;
+        res.responseBody = blob.valueOf(jsonResponse);
+        return;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
index 03f0d91..d20d964 100644
--- a/force-app/main/default/classes/OpportunityLightingButtonController.cls
+++ b/force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-12 11:16:07
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-10 17:08:13
+ * @LastEditTime: 2023-10-19 16:29:00
  */
 public with sharing class OpportunityLightingButtonController {
     @AuraEnabled
@@ -462,7 +462,8 @@
                 SI_Decide_ID__c,
                 Name,
                 Opportunity_No__c,
-                IsAuthorized__c
+                IsAuthorized__c,
+                recordTypeId
                 from Opportunity where Id =: recordId
             ];
             res.authorizedDBNo = oppo.Authorized_DB_No__c;
@@ -471,6 +472,7 @@
             res.name = oppo.Name;
             res.opportunityNo = oppo.Opportunity_No__c;
             res.isAuthorized = oppo.IsAuthorized__c;
+            res.recordTypeId = oppo.recordTypeId;
         } catch (Exception e) {
             
         }
@@ -598,7 +600,7 @@
             update opp;
             return null;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -610,7 +612,7 @@
             update opp;
             return null;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -624,7 +626,7 @@
             update opp;
             return null;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -640,7 +642,7 @@
             update opp;
             return null;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -770,7 +772,7 @@
             processResults.add(Approval.process(request));
             return processResults[0].errors;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -784,7 +786,7 @@
             ];
             return user.Id;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -798,7 +800,7 @@
             ];
             return pro.Id;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -943,25 +945,29 @@
             return '1';     
         } catch (Exception ex) {
             Database.rollback(sp);
-            return errorMessage(ex);
+            return ex.getDmlMessage(0);
         }
     }
-
-    public static string errorMessage(Exception e){
-        if (e.getMessage().contains(',')) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            String exc = '' + e.getMessage();
-            Integer left = exc.indexOf(':') + 1;
-            Integer right = exc.lastIndexOf(':');
-            String str = exc.substring(left,right);
-            left = str.indexOf(',') +  1;
-            String newStr = str.substring(left);
-            return newStr;
-        }else {
-            return e.getMessage();   
+    @AuraEnabled
+    public static Boolean queryLostReport (String recordId){
+        RecordType recordType1 = [select Id from RecordType where Name = '璇环鍙栨秷鎶ュ憡'];
+        List<Lost_cancel_report__c> repList = [select Id from Lost_cancel_report__c where Opportunity__c =: recordId and RecordTypeId !=: recordType1.Id];
+        if(repList.size() > 0){
+            return true;
         }
-
+        return false;
     }
+
+    @AuraEnabled
+    public static Boolean queryCancelReport (String recordId){
+        RecordType recordType1 = [select Id from RecordType where Name = '璇环鍙栨秷鎶ュ憡'];
+        List<Lost_cancel_report__c> repList = [select Id from Lost_cancel_report__c where Opportunity__c =: recordId and RecordTypeId =: recordType1.Id];
+        if(repList.size() > 0){
+            return true;
+        }
+        return false;
+    }
+
     public class InitData{
         @AuraEnabled
         public Boolean directLossFLG;
diff --git a/force-app/main/default/classes/OpportunityLightingButtonControllerTest.cls b/force-app/main/default/classes/OpportunityLightingButtonControllerTest.cls
index d037288..927ddfa 100644
--- a/force-app/main/default/classes/OpportunityLightingButtonControllerTest.cls
+++ b/force-app/main/default/classes/OpportunityLightingButtonControllerTest.cls
@@ -112,6 +112,11 @@
         OpportunityLightingButtonController.changeTrade(oppList[0].Id);
         OpportunityLightingButtonController.queryQuote('');
         OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecTypeList('Product','',true);
+        
         Test.stopTest();
     }
+
+    static testMethod void test2(){
+        OCMManagementProvinceWebService.updateOpportunity();
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls b/force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls
index cc5aa84..24224a6 100644
--- a/force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls
+++ b/force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls
@@ -35,7 +35,18 @@
         depart2.Department_Class__c = dc1s[0].Id;
         depart2.Hospital__c         = company1.Id;
 
-        insert new Account[] {depart1, depart2};
+        //01210000000Qem1
+        Account depart3 = new Account();
+        depart3.RecordTypeId = '01210000000Qem1';
+        depart3.Name         = '*';
+        depart3.Hospital__c         = company1.Id;
+
+        insert new Account[] {depart1, depart2,depart3};
+
+        String recordtypeid = '01210000000aMAE';
+        if (NFMUtil.isSandbox()) {
+            recordtypeid = '01210000000aMAE';
+        }
         List<Product2> prdList = new List<Product2>();
         Product2 prd1 = new Product2();
         prd1.ProductCode_Ext__c     = 'HistoryPrd1';
@@ -45,6 +56,7 @@
         prd1.Manual_Entry__c        = true;
         prd1.Category5__c = '绔炰簤瀵规墜';
         prd1.Brand_Name__c = 'STORZ';
+        prd1.recordTypeId = recordtypeid; //20230221涓婄嚎鏀逛负鈥�01210000000aMAE鈥欙紝涓婂畬杩樺師recordtypeid
         // prd1.Lost_By_Company__c= 'STORZ'; //add tcm 20211213
 
         Product2 prd2 = new Product2();
@@ -55,6 +67,7 @@
         prd2.Manual_Entry__c        = true;
         prd2.Category5__c = '绔炰簤瀵规墜';
         prd2.Brand_Name__c = 'STORZ';
+        prd2.recordTypeId = recordtypeid;
         // prd2.Lost_By_Company__c= 'STORZ'; //add tcm 20211213
 
         insert new Product2[] {prd1, prd2};
@@ -92,7 +105,7 @@
             // ProductCategory__c = '3D',
             Lost_By_Company__c = 'STORZ',
             LostPrice__c = 11,
-            Agency__c = depart1.id,
+            Agency__c = depart3.id,
             Lost_reason_main__c ='鏃犱俊鎭紝璺熻繘涓嶅強鏃�'
         	);
         insert lcB;
diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index 7db2087..fc6ccde 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -305,7 +305,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //OPDtoSIS鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -330,7 +330,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
 
@@ -358,7 +358,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -384,7 +384,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //OCSM瑕佹姤鍛婃搷浣滄洿鏂扮浉搴旀暟鎹�
@@ -409,7 +409,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
 
@@ -435,7 +435,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //DispatchOCSMQARA鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -460,7 +460,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //OCSM涓嶈鎶ュ憡鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -485,7 +485,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
 
@@ -511,7 +511,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     
@@ -557,7 +557,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
 
@@ -583,7 +583,7 @@
             // }else {
             //     return e.getMessage();   
             // } 
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
 
@@ -612,7 +612,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //VOC鍥炵瓟鏇存柊鐩稿簲鏁版嵁
@@ -673,7 +673,7 @@
             // }else {
             //     return e.getMessage();   
             // }
-            return errorMessage(e);
+            return e.getDmlMessage(0);
         }
     }
     //VOC鍒ゅ畾鏇存柊鐩稿簲鏁版嵁
@@ -722,9 +722,7 @@
                 }
                 return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            String exc = e.getMessage();
-            return exc;
+            return e.getDmlMessage(0);
         }
     }
     //VOC瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -736,7 +734,7 @@
             update report;
             return null;
         } catch (Exception e) {
-            return errorMessage(e);
+            return e.getDmlMessage(0);
             // if (e.getMessage().contains(',')) {
             //     System.debug(LoggingLevel.INFO, '*** e: ' + e);
             //     String exc = '' + e.getMessage();
@@ -771,21 +769,7 @@
         }
         return profile.Id;
     }
-    public static string errorMessage(Exception e){
-        if (e.getMessage().contains(',')) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            String exc = '' + e.getMessage();
-            Integer left = exc.indexOf(':') + 1;
-            Integer right = exc.lastIndexOf(':');
-            String str = exc.substring(left,right);
-            left = str.indexOf(',') +  1;
-            String newStr = str.substring(left);
-            return newStr;
-        }else {
-            return e.getMessage();   
-        }
-
-    }
+    
     public class InitData{
         @AuraEnabled
         public String status;
diff --git a/force-app/main/default/classes/SetPersonalTargetBatch.cls b/force-app/main/default/classes/SetPersonalTargetBatch.cls
index 50836ca..e7b52b8 100644
--- a/force-app/main/default/classes/SetPersonalTargetBatch.cls
+++ b/force-app/main/default/classes/SetPersonalTargetBatch.cls
@@ -9,7 +9,7 @@
     // 鏃㈠瓨鐩爣鏁版嵁
     private Map<String, Opportunity> oppMap;
     private Map<Id, OpportunityLineItem> oliMap;
-    private static String[] amountCategory = new String[] {'GI','ET','BF','GS','URO','GYN','ENT','ENG'};
+    private static String[] amountCategory = new String[] {'GI','ET','BF','GS','URO','GYN','ENT','ENG1','ENG2'};
 
     //  褰撳墠骞村害
     private Integer iYear;
@@ -26,7 +26,7 @@
     }
 
     global Database.QueryLocator start(Database.BatchableContext BC) {
-        query = 'select key__c,Amount__c,user_Alias__c,SAP_Province__c,Is_Processing__c,iYear__c,Use_Start_Date__c from Amount_Major_Product__c where Is_Processing__c = true';
+        query = 'select key__c,Amount__c,user_Alias__c,SAP_Province__c,TargetType__c,remarks__c,Is_Processing__c,iYear__c,Use_Start_Date__c from Amount_Major_Product__c where Is_Processing__c = true';
         return Database.getQueryLocator(query);
     }
     global void execute(Database.BatchableContext BC, List<Amount_Major_Product__c> Amount_Major_Products) {
@@ -119,6 +119,8 @@
                     opp.Amount = Amount_Major_Product.Amount__c / proportionSumMap.get(target_category);
                     opp.Target_category__c = '鎷呭綋鐩爣';
                     opp.SAP_Province__c = Amount_Major_Product.SAP_Province__c;
+                    opp.TargetType__c = Amount_Major_Product.TargetType__c;
+                    opp.remarks__c = Amount_Major_Product.remarks__c; // 20230510 ljh 
                     opp.RecordTypeId = rt.Id;
                     opp.OCM_Target_period__c = String.valueOf(integer.valueOf(Amount_Major_Product.iYear__c) - 1867 + 'P');
                     opp.CurrencyIsoCode = 'CNY';
@@ -138,6 +140,8 @@
                     opp.Amount = Amount_Major_Product.Amount__c / proportionSumMap.get(target_category);
                     opp.Target_category__c = '鎷呭綋鐩爣';
                     opp.SAP_Province__c = Amount_Major_Product.SAP_Province__c;
+                    opp.TargetType__c = Amount_Major_Product.TargetType__c;
+                    opp.remarks__c = Amount_Major_Product.remarks__c;// 20230510 ljh 
                     opp.RecordTypeId = rt.Id;
                     opp.OCM_Target_period__c = String.valueOf(integer.valueOf(Amount_Major_Product.iYear__c) - 1867 + 'P');
                     opp.CurrencyIsoCode = 'CNY';
@@ -238,14 +242,23 @@
                 doubleOTH.add(Double.valueOf(strOTH));
             }
             proportion.put('OTH', doubleOTH);
-
-            String strObjectiveProportionENG = System.Label.ObjectiveProportionENG;
-            List<String> objectiveProportionENG = strObjectiveProportionENG.split(',');
-            List<Double> doubleENG = new List<Double>();
-            for (String strENG : objectiveProportionENG) {
-                doubleENG.add(Double.valueOf(strENG));
+            // DB202303443108 you start ENG鎷嗗垎涓篍NG1鍜孍NG2
+            String strObjectiveProportionENG1 = System.Label.ObjectiveProportionENG;
+            List<String> objectiveProportionENG1 = strObjectiveProportionENG1.split(',');
+            List<Double> doubleENG1 = new List<Double>();
+            for (String strENG1 : objectiveProportionENG1) {
+                doubleENG1.add(Double.valueOf(strENG1));
             }
-            proportion.put('ENG', doubleENG);
+            proportion.put('ENG1', doubleENG1);
+
+            String strObjectiveProportionENG2 = System.Label.ObjectiveProportionENG;
+            List<String> objectiveProportionENG2 = strObjectiveProportionENG2.split(',');
+            List<Double> doubleENG2 = new List<Double>();
+            for (String strENG2 : objectiveProportionENG2) {
+                doubleENG2.add(Double.valueOf(strENG2));
+            }
+            proportion.put('ENG2', doubleENG2);
+            // DB202303443108 you end ENG鎷嗗垎涓篍NG1鍜孍NG2
         }
         //鍒濆鍖栨棦瀛樼洰鏍囨暟鎹�
         oppMap = new Map<String, Opportunity>();
@@ -295,7 +308,7 @@
         Opportunity[] opportunitys = [select
                         Id, OwnerId, Opportunity_Category__c, Proportion__c, CloseDate,
                         Amount, Objective__c, Target_category__c,
-                        SAP_Province__c, RecordTypeId, OCM_Target_period__c
+                        SAP_Province__c,TargetType__c, RecordTypeId, OCM_Target_period__c
                  from Opportunity
                 where Target_category__c = '鎷呭綋鐩爣'
                   and RecordTypeId = :rt.Id
diff --git a/force-app/main/default/classes/StartTradingController2.cls b/force-app/main/default/classes/StartTradingController2.cls
new file mode 100644
index 0000000..cb52c4f
--- /dev/null
+++ b/force-app/main/default/classes/StartTradingController2.cls
@@ -0,0 +1,321 @@
+public with sharing class StartTradingController2 {
+
+    static final String RC_OPP = '寮曞悎';
+
+    /**
+     * 鎸夐挳鍒濆鍖栵紝閫氳繃LeadId鑾峰彇鍒ゆ柇闇�瑕佷娇鐢ㄧ殑瀛楁
+     */
+    @AuraEnabled
+    public static Lead init(String Id){
+        try {
+            Lead leadobject = [select Id, 
+                                Hospital_Name__c, 
+                                Close_Forecasted_Date__c, 
+                                Opp_Name_Search__c, 
+                                begin_opp_name__c, 
+                                Status 
+                            from Lead 
+                            where Id = :Id];
+            return leadobject;
+        } catch (Exception ex) {
+            throw new ControllerUtil.myException(ex.getMessage());
+        }
+    }
+
+    /**
+     * 寮�濮嬭浠�
+     */
+    @AuraEnabled
+    public static String start(String Id){
+        try{
+            // 銉兗銉夋儏鍫便倰鍙栧緱  
+            Lead lead = [select id, SI_OppoLeadSec__c,owner_not_automatically_update__c, Hospital_Name__c, Contact_Name__c, Contact_Name__r.Name, 
+                    Opportunity_stage__c,Hospital_Name__r.RecordType.DeveloperName, Hospital_Name__r.Parent.RecordType.DeveloperName,
+                    LastName, FirstName, LeadSource, Other_Society__c, Opp_Name__c, Purchase_Reason__c, Trade__c, Sales_Root__c, Campaign__c, 
+                    Close_Forecasted_Date__c, Competitor__c, Hospital_Budget__c, Promise_Class__c, Dicision_Maker__c, Purchase_Type__c,
+                    Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,Inquiry_Num__c,CreatedDate,CreatedById, 
+                    Tender_information__c, Agency_Opportunity__c, SI_PromoteInquiry__c 
+                    ,	Contact_Name__r.AccountId //2022-6-20 yjk 澧炲姞鑱旂郴浜虹殑绉戝鏌ヨ
+                    ,ET_Check__c //SWAG-CKDATG fy 銆愬鎵樸�戙�怬BSAP-鎶ヤ环濮旀墭銆戞姤浠峰鎵橀」鐩敼鍠�1
+                    from Lead where id =: Id];
+            Boolean SI_Flg = lead.SI_PromoteInquiry__c;    
+            Boolean isAgencyOpp = false;       
+            // 瑷虹檪绉戦伕鎶炪儶銈广儓銇彇寰楋紙鏉′欢锛氱梾闄�=銉兗銉夋儏鍫便伄鐥呴櫌鍚嶇О锛�
+            List<Account> departmentList = new List<Account>();
+            if (lead.Hospital_Name__r.RecordType.DeveloperName == 'HP') {
+                departmentList = [select id, name from Account where Hospital__c =: lead.Hospital_Name__c];
+            }
+            else if (lead.Hospital_Name__r.Parent.RecordType.DeveloperName == 'HP') {
+                departmentList = [select id, name from Account where ParentId =: lead.Hospital_Name__c];
+            }
+            /*
+            // xudan 20140730 璨╁2搴椼倰閬告姙銇欍倠鍫村悎銆佷笅銇绱勪竴瑕с倰鍑恒仚
+            // TODO 濂戠磩鐘舵厠銈掕銈嬶紵
+            else if (this.lead.Hospital_Name__r.RecordType.DeveloperName == 'Agency') {
+            departmentList = [select id, name from Account where ParentId =: this.lead.Hospital_Name__c];
+            isAgencyOpp = true;
+            }
+            */
+            // xudan 20140730 濂戠磩銈掗伕鎶炪仚銈嬪牬鍚堛�併仢銇伨銇惧嚭銇欍�併儠銉┿偘瑷畾
+            else if (lead.Hospital_Name__r.Parent.RecordType.DeveloperName == 'Agency') {
+                departmentList = [select id, name from Account where Id =: lead.Hospital_Name__c];
+                isAgencyOpp = true;
+            }
+            else {
+                departmentList = [select id, name from Account where Id =: lead.Hospital_Name__c];
+            }
+            // 瑷虹檪绉戦伕鎶炪儶銈广儓銇ō瀹�
+            List<SelectOption> depList = new List<SelectOption>();
+            // 2022-04-13 ssm 绱ф�ュ簲瀵� 绉戝鍜屽鎴蜂汉鍛樺繀濉� start
+            // this.depList.add(new SelectOption(NONE, NONE));
+            // 2022-04-13 ssm 绱ф�ュ簲瀵� 绉戝鍜屽鎴蜂汉鍛樺繀濉� end
+            Set<ID> depIdList = new Set<ID>();
+            for(Account d : departmentList){
+                depIdList.add(d.id);
+                depList.add(new SelectOption(String.valueOf(d.get('id')),String.valueOf(d.get('name'))));
+            }
+            // 2022-04-13 ssm 绱ф�ュ簲瀵� 绉戝鍜屽鎴蜂汉鍛樺繀濉� start
+            // this.sltDep = NONE;
+            String sltDep = lead.Contact_Name__r.AccountId;  //  2022-6-20 yjk 鏀逛负浠庤仈绯讳汉鐨勭瀹よ祴鍊�   鍘熼�昏緫锛歵his.lead.Hospital_Name__c;
+            String sltCon = lead.Contact_Name__c;
+            // 2022-04-13 ssm 绱ф�ュ簲瀵� 绉戝鍜屽鎴蜂汉鍛樺繀濉� end
+
+            // 鎷呭綋鑰呫儶銈广儓锛堝垵鏈熻ō瀹氾級
+            Map<String,List<SelectOption>> conMap = new Map<String,List<SelectOption>>();
+            List<SelectOption> sltOptNasi = new List<SelectOption>();
+            // 銉兗銉夋墍鏈夎�呫伄鍙栧緱
+            User leadOnwer = [select Province_Text__c from User where Id = :lead.OwnerId];
+
+            String oppID = null;
+            if (String.isBlank(sltDep)) {
+                return null;
+            }
+            Account dept = null;
+            if(String.isNotBlank(lead.Contact_Name__c)){
+                dept = getDepartment(lead.Contact_Name__r.AccountId);
+                updateContact(lead.Contact_Name__c, dept);
+            }
+            return updateOpportunity(getDepartment(lead.Hospital_Name__c), lead, SI_Flg, isAgencyOpp, leadOnwer);
+        } catch(Exception ex) {
+            throw new ControllerUtil.myException(ex.getMessage());
+        }
+    }
+
+    /** 
+     *  閬告姙銇椼仧瑷虹檪绉戙倰鍙栧緱
+     */
+    public static Account getDepartment(String depId){
+        List<Account> deptList = [select Id, Hospital__c, Department_Class__c, Department_Class_Wd__c from Account where id =: depId];
+        // List<Account> deptList = [select Id, Hospital__c, Department_Class__c from Account where id =: this.sltDep];
+        Account dept = deptList[0];
+        return dept;
+    }
+
+    /** 鍙栧紩鍏堣铂浠昏�呫伄鏇存柊
+     *  @param conID 鍙栧紩鍏堣铂浠昏�匢D
+     *  @param dept  瑷虹檪绉�
+    */
+    public static void updateContact(ID conID, Account dept){
+        
+        Contact cont = [select ID,Strategic_dept_Class__c from Contact where Id=:conID];
+        cont.Strategic_dept_Class__c = dept.Department_Class__c;
+        update cont;
+    }
+
+    /** 寮曞悎銇洿鏂�
+     *  @param dept 瑷虹檪绉�
+    */
+    public static String updateOpportunity(Account dept, Lead lead, Boolean SI_Flg, Boolean isAgencyOpp, User leadOnwer){
+        System.debug('dept:'+dept.Id + '|' + dept.Department_Class_Wd__c);
+        //SWAG-CEY8GZ 20220620 lt update
+        //Opportunity opp = [select ID, AccountId, Account.Department_Class_Wd__c, Opportunity_No__c, SAP_Province_CD__c, Opp_Number__c, Opp_Code__c from Opportunity where Id=:this.oppID];
+        Opportunity opp = new Opportunity();
+        opp.LeadSource = lead.LeadSource;
+        opp.AccountId = dept.Id;
+
+        //SWAG-CEY8GZ 20220620 lt update
+        system.debug('cccccccccccccccccccc:'+opp.SAP_Province_CD__c);
+        system.debug('cccccccccccccccccccc:'+opp.Opp_Number__c);
+        system.debug('cccccccccccccccccccc:'+opp.Opp_Code__c);
+        system.debug('cccccccccccccccccccc:'+opp.Opportunity_No__c);
+        String Opptype = SI_Flg==true?'SI璇环':RC_OPP;
+        RecordType rect = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and Name =: Opptype limit 1];
+        opp.RecordTypeId = rect.id;
+        // opp.Opportunity_Category__c = opp.Account.Department_Class_Wd__c;
+        //SWAG-CKDATG fy 銆愬鎵樸�戙�怬BSAP-鎶ヤ环濮旀墭銆戞姤浠峰鎵橀」鐩敼鍠�1 start
+        // opp.Opportunity_Category__c = dept.Department_Class_Wd__c;
+        opp.Opportunity_Category__c = lead.ET_Check__c ? 'ET' : dept.Department_Class_Wd__c;
+        opp.Opp_order_Type__c = lead.ET_Check__c ? 'ET'  : null;
+        //SWAG-CKDATG fy 銆愬鎵樸�戙�怬BSAP-鎶ヤ环濮旀墭銆戞姤浠峰鎵橀」鐩敼鍠�1 end
+        System.debug('this.lead.Hospital_Name__c:'+lead.Hospital_Name__c);
+        System.debug('this.lead.LeadSource:'+lead.LeadSource);
+        System.debug('this.lead.Other_Society__c:'+lead.Other_Society__c);
+        System.debug('this.lead.Purchase_Reason__c:'+lead.Purchase_Reason__c);
+        System.debug('this.lead.Trade__c:'+lead.Trade__c);
+        System.debug('this.lead.Sales_Root__c:'+lead.Sales_Root__c);
+        System.debug('this.lead.Close_Forecasted_Date__c:'+lead.Close_Forecasted_Date__c);
+        System.debug('this.lead.Competitor__c:'+lead.Competitor__c);
+        System.debug('this.lead.Hospital_Budget__c:'+lead.Hospital_Budget__c);
+        System.debug('this.lead.Promise_Class__c:'+lead.Promise_Class__c);
+        System.debug('this.lead.Dicision_Maker__c:'+lead.Dicision_Maker__c);
+        System.debug('this.lead.Purchase_Type__c:'+lead.Purchase_Type__c);
+        System.debug('this.lead.Sales_Method__c:'+lead.Sales_Method__c);
+        System.debug('this.lead.Fund_Basis__c:'+lead.Fund_Basis__c);
+        if(lead.Opp_Name__c != null && lead.Opp_Name__c != ''){
+            opp.Name = lead.Opp_Name__c;
+        }
+        else{
+            opp.Name = '*';
+        }
+        //20220412 SWAG-CBUB2W you start
+        opp.Inquiry_Num__c = lead.Inquiry_Num__c;
+        //20220412 SWAG-CBUB2W you end
+        opp.From_Lead_TF__c = true;
+        opp.Trade__c = (String.isBlank(lead.Trade__c)) ? '鍐呰部' : lead.Trade__c;
+        opp.StageName = '寮曞悎';
+        opp.owner_not_automatically_update__c = lead.owner_not_automatically_update__c;
+        opp.Lead_Num__c = lead.Lead_No__c;
+        opp.Lead_CreateBy__c = lead.CreatedById;
+        opp.Lead_CreateDate__c = lead.CreatedDate;
+        opp.CurrencyIsoCode = 'CNY';
+        opp.Purchase_Type__c = 'SI锛堟墜琛撳妗堜欢锛�';
+        system.debug('dddddddddddddddddddddd:'+lead.owner_not_automatically_update__c);
+        Integer year = date.today().year();
+        Integer month = date.today().month();
+        Date nextMonthEndDay = date.newInstance(year, month, 1);
+        Date thisMonthEndDay = nextMonthEndDay.addMonths(1);
+        thisMonthEndDay = thisMonthEndDay.addDays(-1);
+        nextMonthEndDay = nextMonthEndDay.addMonths(2);
+        nextMonthEndDay = nextMonthEndDay.addDays(-1);
+        opp.Close_Forecasted_Date__c = lead.Close_Forecasted_Date__c;
+        opp.Close_Forecasted_Date__c = opp.Close_Forecasted_Date__c == null ? thisMonthEndDay : opp.Close_Forecasted_Date__c;
+        if (nextMonthEndDay > opp.Close_Forecasted_Date__c) {
+            opp.CloseDate = nextMonthEndDay;
+        } else {
+            opp.CloseDate = opp.Close_Forecasted_Date__c.addDays(30);
+        }
+        // xudan 20140730 璨╁2搴椼亱銈夊紩鍚堛倰Convert銇欍倠鍫村悎銆丠ospital__c銈扐ccountId銈掑悓銇樸伀銇欍倠
+        if (isAgencyOpp) {
+            opp.Hospital__c = opp.AccountId;
+        } else {
+            opp.Hospital__c = dept.Hospital__c;
+            opp.Department_Class__c = dept.Department_Class__c;
+        }
+        //2021-07-08  mzy  SWAG-C4H99E 璇环涓殑鏉ユ簮鏇存敼 start
+        if('绉戝鎻愭'.equals(lead.LeadSource) || 'OPD/SIS'.equals(lead.LeadSource) 
+            || '鍏叡骞冲彴'.equals(lead.LeadSource)   //娴嬭瘯鐜 鍔犵殑  瀵瑰簲鐨勬槸 鍖绘嫇缃�
+            || '鐢佃瘽'.equals(lead.LeadSource) || '鍖绘嫇缃�'.equals(lead.LeadSource) ){            
+            opp.LeadSource = '鐩存帴鎷滆';
+        }else {
+            opp.LeadSource = lead.LeadSource;
+        }
+        //2021-07-08  mzy  SWAG-C4H99E 璇环涓殑鏉ユ簮鏇存敼 end
+        opp.Other_Society__c = lead.Other_Society__c;
+        opp.Purchase_Reason__c = lead.Purchase_Reason__c;
+        opp.Trade__c = (String.isBlank(lead.Trade__c)) ? '鍐呰部' : lead.Trade__c;
+        // 澧炲姞榛樿鍊�
+        opp.Sales_Root__c = String.isNotBlank(lead.Sales_Root__c) ? lead.Sales_Root__c : '璨╁2搴�';
+        if (lead.Competitor__c != null && lead.Competitor__c != '') {
+            opp.Competitor__c = lead.Competitor__c;
+        }
+        if (lead.Opportunity_stage__c != null && lead.Opportunity_stage__c != '') {
+            opp.Opportunity_stage__c = lead.Opportunity_stage__c;
+        }
+        opp.Hospital_Budget__c = lead.Hospital_Budget__c;
+        // 澧炲姞榛樿鍊�
+        opp.Promise_Class__c = String.isNotBlank(lead.Promise_Class__c) ? lead.Promise_Class__c : '鍐呰部';
+        opp.Dicision_Maker__c = lead.Dicision_Maker__c;
+        //**********************************************************************************
+        opp.Purchase_Type__c = SI_Flg==true?'SI锛堟墜琛撳妗堜欢锛�':lead.Purchase_Type__c;
+        opp.Opportunity_sub_owner__c = lead.SI_OppoLeadSec__c;
+        //**********************************************************************************
+        opp.Sales_Method__c = lead.Sales_Method__c;
+        opp.Fund_Basis__c = lead.Fund_Basis__c;
+        opp.SAP_Province__c = leadOnwer.Province_Text__c;
+        opp.Owner_System__c = opp.OwnerId;
+        if(lead.OwnerId != null ){
+            opp.Ownerid = lead.OwnerId ;
+        }
+        opp.Wholesale_Price__c = lead.Wholesale_Price__c;
+        List<Lead> leadcList = [Select (Select CampaignId From CampaignMembers order by CreatedDate desc) From Lead l where l.id =: lead.Id];
+        for(Lead leadc : leadcList){
+            List<CampaignMember> cmList = leadc.CampaignMembers;
+            for (CampaignMember cm : cmList) {
+                opp.CampaignId = cm.CampaignId;
+                break;
+            }
+        }
+        System.debug('opp.Hospital_Name__c:'+opp.Hospital__c);
+        System.debug('dept12345:'+dept.Hospital__c);
+        System.debug('opp.LeadSource:'+opp.LeadSource);
+        System.debug('opp.Other_Society__c:'+opp.Other_Society__c);
+        System.debug('opp.Purchase_Reason__c:'+opp.Purchase_Reason__c);
+        System.debug('opp.Trade__c:'+opp.Trade__c);
+        System.debug('opp.Sales_Root__c:'+opp.Sales_Root__c);
+        System.debug('opp.Close_Forecasted_Date__c:'+opp.Close_Forecasted_Date__c);
+        System.debug('opp.Competitor__c:'+opp.Competitor__c);
+        System.debug('opp.Hospital_Budget__c:'+opp.Hospital_Budget__c);
+        System.debug('opp.Promise_Class__c:'+opp.Promise_Class__c);
+        System.debug('opp.Dicision_Maker__c:'+opp.Dicision_Maker__c);
+        System.debug('opp.Purchase_Type__c:'+opp.Purchase_Type__c);
+        System.debug('opp.Sales_Method__c:'+opp.Sales_Method__c);
+        System.debug('opp.Fund_Basis__c:'+opp.Fund_Basis__c);
+        System.debug('opp.SAP_Province__c:'+opp.SAP_Province__c);
+
+        // 2022-04-15 OBSAP鏂板淇敼 start
+        opp.CampaignId = lead.Campaign__c;
+        System.debug('opp.CampaignId:'+opp.CampaignId);
+        // 鎷涙爣椤圭洰
+        if (String.isNotBlank(lead.Tender_information__c)) {
+            opp.Bidding_Project_Name_Bid__c = lead.Tender_information__c;
+            //SWAG-CEY8GZ 20220620 lt update
+            // 鏂板缓link
+            // Tender_Opportunity_Link__c link = new Tender_Opportunity_Link__c();
+            // link.Tender_information__c = this.lead.Tender_information__c;
+            // link.Opportunity__c = opp.Id;
+            // link.Tender_Opportunity_Uniq__c = String.valueOf(this.lead.Tender_information__c) + String.valueOf(opp.Id);
+
+            // insert link;
+            //SWAG-CEY8GZ 20220620 lt update
+        }
+        // 缁忛攢鍟嗚浠�
+        // 2022-05-20 璋冩暣缁忛攢鍟嗚浠风殑鏇存柊椤哄簭 ssm start
+        //SWAG-CEY8GZ 20220620 lt update
+        // Agency_Opportunity__c ao = null;
+        if (String.isNotBlank(lead.Agency_Opportunity__c)) {
+            opp.Agency_Opportunity__c = lead.Agency_Opportunity__c;
+            // 缁忛攢鍟嗚浠风粦瀹氳浠�
+            // ao = [select Id, Change_To_Opportunity__c from Agency_Opportunity__c where Id = :this.lead.Agency_Opportunity__c];
+            // ao.Change_To_Opportunity__c = opp.Id;
+        }
+        
+        // 2022-04-15 OBSAP鏂板淇敼 end
+        //update opp;
+        insert opp;
+        lead.Status = System.Label.StateChanges;
+        lead.begin_opp_name__c = opp.Id;
+        lead.begin_opp_date__c = Date.today();
+        update lead;
+        
+        //SWAG-CEY8GZ 20220620 lt update
+        // 2022-05-20 璋冩暣缁忛攢鍟嗚浠风殑鏇存柊椤哄簭 ssm end
+        // //SWAG-CF589P銆愬鎵樸�戙�怭:OBSAP銆戞姤浠峰鎵樼浉鍏虫柊闇�姹傝瘎浼� fy start
+        List<QuoteIrai__c> quoteir=[select id,Opportunity__c,Lead__c from QuoteIrai__c where Lead__c =:lead.Id];
+        List<QuoteIrai__c> quoteirupdate = new List<QuoteIrai__c>();
+        if(quoteir.size()>0){
+            for(QuoteIrai__c quo : quoteir){
+                if(quo.Opportunity__c==null||quo.Opportunity__c==''){
+                    quo.Opportunity__c=opp.Id;
+                    quoteirupdate.add(quo);
+                }
+            }
+        }
+        System.debug('leadId++'+lead.Id);
+        System.debug('quoteir++'+quoteir);
+        System.debug('quoteirupdate++'+quoteirupdate);
+        if(quoteirupdate.size()>0){
+            update quoteirupdate;
+        }
+        return opp.Id;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/StartTradingController2.cls-meta.xml b/force-app/main/default/classes/StartTradingController2.cls-meta.xml
new file mode 100644
index 0000000..754ecb1
--- /dev/null
+++ b/force-app/main/default/classes/StartTradingController2.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>57.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/TenderOpportunityLinkHandler.cls b/force-app/main/default/classes/TenderOpportunityLinkHandler.cls
index 197d4a5..3eb4da3 100644
--- a/force-app/main/default/classes/TenderOpportunityLinkHandler.cls
+++ b/force-app/main/default/classes/TenderOpportunityLinkHandler.cls
@@ -10,12 +10,13 @@
     this.newList = (List<Tender_Opportunity_Link__c>) Trigger.new;
     this.oldList = (List<Tender_Opportunity_Link__c>) Trigger.old;
 }
-
+ 
 protected override void afterInsert() {
     // 鍒ゆ柇鏄惁璺宠繃
+    updateTerminateTender(this.newList);  //lt 20230419 椤圭洰缁堟娴佺▼寮�鍙� add
     if (!StaticParameter.EscapeTOLinkTrigger) {
         updateTender(this.newList);
-        updateOppotunityByInsert(this.newList);
+        updateOppotunityByInsert(this.newList);      
     }
 }
 
@@ -39,6 +40,189 @@
             if (link.Tender_Opportunity_Uniq__c == null || link.Tender_Opportunity_Uniq__c == '') {
                 link.Tender_Opportunity_Uniq__c = link.Tender_information__c + '' + link.Opportunity__c;
             }
+        }
+    }
+}
+//DB202306372336  you start
+public void UpdateStrategic_department_Opp(List<Tender_Opportunity_Link__c> tenderList,List<Tender_information__c> UpdateTenders){
+    Map<String, Set<String>> updateTenMap = new Map<String, Set<String>>();//鎷涙爣椤圭洰id锛屾垬鐣ョ瀹ゅ垎绫�
+    //String partment_Opp='';
+        if(tenderList.size() > 0){
+            for (Tender_Opportunity_Link__c tender : tenderList){
+                 if(String.isNotBlank(tender.Opportunity__r.Department_Class__r.Department_Class_Label__c)){
+                    //String ten_Opp =tender.Opportunity__r.Department_Class__r.name.split(' ')[1];
+                    //if(tender.Opportunity__r.Department_Class__r.name.split(' ').size() ==3 ){
+                    //   ten_Opp =tender.Opportunity__r.Department_Class__r.name.split(' ')[2];
+                    //}
+                    String ten_Opp =tender.Opportunity__r.Department_Class__r.Department_Class_Label__c;
+                    Set<String> temp = new Set<String>();
+                    if(ten_Opp.indexOf('鍏朵粬') == -1){
+                        if(updateTenMap.containsKey(tender.Tender_information__c)){
+                            temp= updateTenMap.get(tender.Tender_information__c);
+                            temp.add(ten_Opp);
+                        } else{
+                            temp.add(ten_Opp);
+                        }
+                    }else{//鍏朵粬褰掓櫘澶�
+                        if(updateTenMap.containsKey(tender.Tender_information__c)){
+                            temp= updateTenMap.get(tender.Tender_information__c);
+                            temp.add('鏅绉�');
+                        } else{
+                            temp.add('鏅绉�');
+                        }
+                    }
+                    updateTenMap.put(tender.Tender_information__c,temp);  
+                    system.debug(tender.Opportunity__r.Department_Class__r.Department_Class_Label__c+'==temp=='+temp);
+                }
+                
+            }
+
+            if(null!=updateTenMap && updateTenMap.size()>0){
+                 for(String ksy :updateTenMap.keySet()){
+                    String partment_Opp=String.join(new List<String>(updateTenMap.get(ksy)), ';'); 
+                    system.debug('=====partment_Opp='+partment_Opp); 
+                    partment_Opp=partment_Opp.replaceAll(',', ';');
+                    if(null ==UpdateTenders || UpdateTenders.size()==0){
+                      Tender_information__c tin1 =new Tender_information__c();
+                      tin1.id=ksy;
+                      tin1.Strategic_department_Opp__c = partment_Opp;
+                      UpdateTenders.add(tin1);
+                    }else{
+                      for (Tender_information__c up : UpdateTenders){
+                        if(up.id== ksy){
+                           up.Strategic_department_Opp__c = partment_Opp; 
+                        }else{
+                          Tender_information__c tin2 =new Tender_information__c();
+                          tin2.id=ksy;
+                          tin2.Strategic_department_Opp__c = partment_Opp;
+                          UpdateTenders.add(tin2); 
+                        }
+
+                      }
+                    }
+
+                 }
+                }
+        }
+
+
+
+        //if(tenderList.size() > 0){
+        //    for (Tender_Opportunity_Link__c tender : tenderList){ 
+        //       if(String.isNotBlank(partment_Opp)){
+        //           partment_Opp.substring(0, partment_Opp.length()-1);
+        //           if(null ==UpdateTenders || UpdateTenders.size()==0){
+        //              Tender_information__c tin1 =new Tender_information__c();
+        //              tin1.id=tender.Tender_information__c;
+        //              tin1.Strategic_department_Opp__c = partment_Opp;
+        //              UpdateTenders.add(tin1);
+        //           }else{
+        //              for (Tender_information__c up : UpdateTenders){
+        //                if(up.id== tender.Tender_information__c){
+        //                   up.Strategic_department_Opp__c = partment_Opp; 
+        //                }else{
+        //                  Tender_information__c tin2 =new Tender_information__c();
+        //                  tin2.id=tender.Tender_information__c;
+        //                  tin2.Strategic_department_Opp__c = partment_Opp;
+        //                  UpdateTenders.add(tin2); 
+        //                }
+
+        //              }
+        //           }
+        //        }
+        //    }
+        //}
+}    
+ //DB202306372336  you end
+//lt 20230419 椤圭洰缁堟娴佺▼寮�鍙� 缁堟鐢宠鐘舵�佹竻闄� add
+//椤圭洰缁堟娴佺▼寮�鍙� -- 娓呴櫎鎷涙爣椤圭洰缁堟鐢宠鐨勪俊鎭紝椤圭洰閲嶅惎鏍囪瘑鎵撳嬀
+public void updateTerminateTender(List<Tender_Opportunity_Link__c> records){
+    if (records != null && records.size() > 0){
+        List<String> tenders = new List<String>();//DB202305552102 you 鍏宠仈鍙栨秷鐨勮浠� 椤圭洰涓嶉噸鍚�  鍙栦竴鏉ink
+        List<String> tenlinks = new List<String>();//DB202306372336  you start  鍙栧綋鍓嶆嫑鏍囦笅鎵�鏈塴ink
+
+        // 鑾峰緱瑕佹洿鏂扮殑鎷涙爣椤圭洰
+        for (Tender_Opportunity_Link__c record: records) {
+            String lhid=record.Tender_information__c+''+record.Opportunity__c;
+            if (!tenders.contains(lhid)) {
+                tenders.add(lhid);
+            }
+            //DB202306372336  you start
+            if(!tenlinks.contains(record.Tender_information__c)){
+                tenlinks.add(record.Tender_information__c);
+            }
+            //DB202306372336  you end
+            /**
+             if (!tenders.contains(record.Tender_information__c)) {
+                tenders.add(record.Tender_information__c);
+            }
+            **/
+        }
+
+        
+        /**
+        List<Tender_information__c> UpdateTenders = new List<Tender_information__c>();
+        if (tenders.size() > 0){
+            List<Tender_information__c> tenderList = [SELECT id, status__c, TerminateReason__c, IsTerminate__c,
+                                                             TerminateApprovalStatus__c, TerminateApprovalTime__c,
+                                                             ProjectRestartFLG__c,subInfoType__c
+                                                      FROM Tender_information__c 
+                                                      WHERE id in :tenders];
+
+            if(tenderList.size() > 0){
+                for (Tender_information__c tender : tenderList){
+                    //if(tender.status__c == '09.缁堟' && tender.TerminateReason__c != '缁忛攢鍟嗗師鍥�' && tender.subInfoType__c != '3-1锛氬簾鏍囧叕鍛�' && tender.subInfoType__c != '3-2锛氭祦鏍囧叕鍛�')
+                    if(tender.status__c == '09.缁堟'){
+                        tender.ProjectRestartFLG__c = true;
+                        tender.IsTerminate__c = null;
+                        tender.TerminateApprovalTime__c = null;
+                        tender.TerminateApprovalStatus__c = null;
+    
+                        UpdateTenders.add(tender);
+                    }
+                }
+            }
+        }
+        **/
+        //DB202305552102 you start
+        List<Tender_information__c> UpdateTenders = new List<Tender_information__c>();
+        List<Tender_Opportunity_Link__c> tolList = new List<Tender_Opportunity_Link__c>();
+        if (tenders.size() > 0) {
+           tolList =  [select id, Opportunity__r.stagename,Opportunity__r.Department_Class__r.Department_Class_Label__c, Tender_information__c,Tender_information__r.status__c,Tender_information__r.ProjectRestartFLG__c,Tender_information__r.IsTerminate__c,Tender_information__r.TerminateApprovalTime__c,Tender_information__r.TerminateApprovalStatus__c from Tender_Opportunity_Link__c where Tender_Opportunity_Uniq__c in :tenders];
+        }  
+        if(tolList.size() > 0){
+                for (Tender_Opportunity_Link__c tender : tolList){
+                    system.debug(tenders+'======='+tender.Tender_information__r.status__c+'=====缁堟===='+tender.Opportunity__r.stagename);
+                    if(tender.Tender_information__r.status__c == '09.缁堟' && tender.Opportunity__r.stagename !='鍓婇櫎'){
+                        Tender_information__c tin =new Tender_information__c();
+                        tin.id=tender.Tender_information__c;
+                        tin.ProjectRestartFLG__c = true;
+                        tin.IsTerminate__c = null;
+                        tin.TerminateApprovalTime__c = null;
+                        tin.TerminateApprovalStatus__c = null;
+                        UpdateTenders.add(tin);
+
+                    }
+                    
+                }
+        }    
+        //DB202305552102 you end
+        //DB202306372336  you start
+        List<Tender_Opportunity_Link__c> tenderList = new List<Tender_Opportunity_Link__c>();
+        if (tenlinks.size() > 0){
+            tenderList = [SELECT id, Opportunity__r.Department_Class__r.Department_Class_Label__c,Tender_information__c
+                                                      FROM Tender_Opportunity_Link__c 
+                                                      WHERE Tender_information__c in :tenlinks];
+        }
+        if(tenderList.size() > 0){
+          UpdateStrategic_department_Opp(tenderList,UpdateTenders);
+        }
+        system.debug('==闇�瑕佹洿鏂扮殑==='+UpdateTenders);        
+        //DB202306372336  you end
+        if(UpdateTenders.size() > 0){
+            StaticParameter.EscapeTenderInformationUpdate =false;
+            update UpdateTenders;
+            StaticParameter.EscapeTenderInformationUpdate =true;
         }
     }
 }
@@ -188,13 +372,15 @@
                         tender.Hospital4__c = fiveHospitalMap.get('Hospital4__c');
                     }
                 }
-                if (Trigger.isAfter && Trigger.isDelete) {
+                StaticParameter.EscapeTenderInformationUpdate = false;
+                if (Trigger.isAfter && Trigger.isDelete) {   
                     StaticParameter.EscapeOtherUpdateTenOwner = false;
                     update tender_list;
-                    StaticParameter.EscapeOtherUpdateTenOwner = true;
+                    StaticParameter.EscapeOtherUpdateTenOwner = true;                    
                 } else {
                     update tender_list;
                 }
+                StaticParameter.EscapeTenderInformationUpdate = true;
             }
         }
     }
@@ -338,6 +524,58 @@
 //20220718 you 璇环浠诲姟 start
 //鍒犻櫎link鏃讹紝浠诲姟鍙栨秷锛屾竻绌鸿浠蜂腑鏍囦俊鎭�
 public void updateOppotunityBeforeDelete(List<Tender_Opportunity_Link__c> records) {
+    //DB202306372336  you start 
+    List<String> tenlinks = new List<String>();// 鍙栧綋鍓嶆嫑鏍囦笅鎵�鏈塴ink
+    List<String> tenlink = new List<String>();// 鍙栧綋鍓嶅垹闄ょ殑link
+    if (records != null && records.size() > 0) {
+       for (Tender_Opportunity_Link__c record: records) {
+           if(!tenlinks.contains(record.Tender_information__c)){
+                tenlinks.add(record.Tender_information__c);
+            }  
+            if(!tenlink.contains(record.id)){
+                tenlink.add(record.id);
+            } 
+       } 
+    }  
+    List<Tender_information__c> UpdateTenders = new List<Tender_information__c>();  
+    List<Tender_Opportunity_Link__c> tenderList = new List<Tender_Opportunity_Link__c>();
+    if (tenlinks.size() > 0){
+        tenderList = [SELECT id, Opportunity__r.Department_Class__r.Department_Class_Label__c,Tender_information__c
+                                                  FROM Tender_Opportunity_Link__c 
+                                                  WHERE Tender_information__c in :tenlinks and id not in :tenlink];
+     }
+    
+    if(tenderList.size() > 0){
+       UpdateStrategic_department_Opp(tenderList,UpdateTenders);
+     } else{
+        //鍒犻櫎鎷涙爣椤圭洰鏈�鍚庝竴鏉ink
+        List<Tender_Opportunity_Link__c> tenderList1 = [SELECT id, Opportunity__r.Department_Class__r.Department_Class_Label__c,Tender_information__c
+                                                  FROM Tender_Opportunity_Link__c 
+                                                  WHERE id in :tenlink];
+        system.debug(tenderList1.size()+'==褰撳墠鍒犻櫎寰條ink=='+tenlink);
+        if(null!=tenderList1 && tenderList1.size()>0){
+            for(Tender_Opportunity_Link__c ti :tenderList1){
+                  Tender_information__c tin1 =new Tender_information__c();
+                  tin1.id=ti.Tender_information__c;
+                  tin1.Strategic_department_Opp__c = '';
+                  system.debug('鍒犻櫎杩涙潵浜�');
+                  UpdateTenders.add(tin1); 
+            }
+         
+        }                                          
+        
+     }
+     system.debug('=====UpdateTenders====='+UpdateTenders);
+    if(UpdateTenders.size() > 0){
+       StaticParameter.EscapeTenderInformationUpdate =false;
+       update UpdateTenders;
+       StaticParameter.EscapeTenderInformationUpdate =true;
+    }   
+    
+//DB202306372336  you end 
+
+
+
     if (records != null && records.size() > 0) {
         Set<String> oppTens = new Set<String>();//璇环锛屾嫑鏍囬」鐩� 鎷兼帴
         List<String> oppIds = new List<String>();
@@ -395,6 +633,7 @@
 
 // 鏇存柊璇环淇℃伅
 public void updateOppotunityByDelete(List<Tender_Opportunity_Link__c> records) {
+    
     if (records != null && records.size() > 0) {
         List<String> oppIds = new List<String>();
         //SWAG-CHL67J 銆愬鎵樸�戙�怓Y23璇环鏀瑰杽銆�-璇环椤甸潰/鎷涙爣椤圭洰澧炲姞缁熻瀛楁 fy start 
@@ -444,7 +683,7 @@
                         //20220718 you 璇环浠诲姟 end
                         **/
                         // 20221028 ljh SWAG-CKL5UC start
-                        opp.LeakageNumber__c = null;
+                        //opp.LeakageNumber__c = null;  //lt 20230625 DB202306421819 銆怋UG銆戞紡鍗曟暟鏈夎 update
                         // 20221028 ljh SWAG-CKL5UC end
                     } else {
                         for (Tender_Opportunity_Link__c link : links) {
@@ -505,102 +744,6 @@
 }
  @TestVisible
     public static void testI() {
-        integer i = 0;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
+        
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls b/force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls
index 7a4ad72..ff4410a 100644
--- a/force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls
+++ b/force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls
@@ -159,84 +159,5 @@
 
     }
     @TestVisible private static void test() {
-        Integer i = 0;
-        
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;//鍙互澶氬啓鐐�
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/UpdateReceivingNoteImgRest.cls b/force-app/main/default/classes/UpdateReceivingNoteImgRest.cls
index 14b0eea..37162fd 100644
--- a/force-app/main/default/classes/UpdateReceivingNoteImgRest.cls
+++ b/force-app/main/default/classes/UpdateReceivingNoteImgRest.cls
@@ -4,13 +4,19 @@
     global static void doPost(String docId, String rnId, String libId) {
         RestResponse res = RestContext.response;
         res.addHeader('Content-Type', 'application/json');
-        
+        StaticParameter.ContentDocumentTrigger = false;
+        StaticParameter.ContentDocumentLink = false;
+        StaticParameter.ContentVerisonTrigger = false;
         ContentDocumentLink cdl1 = new ContentDocumentLink();
         cdl1.Visibility='AllUsers';
         cdl1.ShareType='I';
         cdl1.ContentDocumentId = docId;
         cdl1.LinkedEntityId = rnId;
+        // cdl1.LinkedEntityId = libId;
 
+        // libId = null;
+        System.debug('zheli03'+libId);
+        // libId = null;
         ContentDocumentLink cdl2 = new ContentDocumentLink();
         if (String.isNotBlank(libId)) {
             cdl2.Visibility='AllUsers';
@@ -18,11 +24,12 @@
             cdl2.ContentDocumentId = docId;
             cdl2.LinkedEntityId = libId;
         }
-        
         try {
             if (String.isNotBlank(libId)) {
+                System.debug('zheli00');
             	insert new ContentDocumentLink[] {cdl1, cdl2};	
             } else {
+                System.debug('zheli01');
                 insert cdl1;
             }
 		} catch ( Exception ex ) {
diff --git a/force-app/main/default/classes/XinDailyReportController.cls b/force-app/main/default/classes/XinDailyReportController.cls
index 0ed1b1e..57098b8 100644
--- a/force-app/main/default/classes/XinDailyReportController.cls
+++ b/force-app/main/default/classes/XinDailyReportController.cls
@@ -4024,21 +4024,23 @@
         if (month < 4) {
             year -= 1;
         }
+
         Date dateFinalStartDate = Date.newInstance(year, 4, 1);
+        system.debug('===DepIDList=='+DepIDList+'==dateFinalStartDate==='+dateFinalStartDate);
         string yearP = year - 1868 + 'P';
         Map<ID,Account> DepartMap = 
             New Map<ID,Account> ([select id, ParentId 
                                     from Account 
                                     where id in: DepIDList 
                                     and Parent.CreateDate__c <: dateFinalStartDate
-                                    and Hospital__r.OCM_Category__c like 'H%'
+                                    and Hospital__r.OCM_Category__c like '%H%'
                                     and Parent.RecordType.DeveloperName in 
                                     ('Department_Class_GI','Department_Class_BF',
                                     'Department_Class_GS','Department_Class_URO',
                                     'Department_Class_GYN')]); 
         
         Map<Id, AggregateResult> ANCLMap = new Map<Id, AggregateResult> ();
-        
+        system.debug('===DepartMap=='+DepartMap);
         if(DepartMap != null && DepartMap.size() > 0 ){
             List<ID> DCIDList = new List<ID>();
             for(Account temDep: DepartMap.values()){
@@ -4057,11 +4059,11 @@
                     or URO_KPI_input__c ='鐧诲綍瀹屾瘯')
                     group by Account__c
             ]);
-        
+        system.debug('===activities=='+activities+'==DepartMap=='+DepartMap+'====='+ANCLMap);
             for (Integer i = 0; i < activities.size(); i++) {
                 Activity a = activities[i];
                 if (a.act.whatid__c != null && a.act.whatid__c.startsWith('001')) {
-
+                   system.debug('杩涙潵浜�'+a.act.whatid__c);
                     if(DepartMap.get(a.act.whatid__c)!=null && 
                         ANCLMap.get(DepartMap.get(a.act.whatid__c).ParentId) ==null){
                         IsAlertInputDep = true;
@@ -4235,6255 +4237,11 @@
 
     @TestVisible
     public static void testI() {
-        integer i = 0;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-          i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;  i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;  
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-                i++;
-        i++;
-        i++;
-         i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-        i++;
-
-
-
         
     }
 
     
     @TestVisible
     public static void testY() {
-        integer y = 0;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
-        y++;
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/XinDailyReportControllerTest.cls b/force-app/main/default/classes/XinDailyReportControllerTest.cls
index 703917a..f71095a 100644
--- a/force-app/main/default/classes/XinDailyReportControllerTest.cls
+++ b/force-app/main/default/classes/XinDailyReportControllerTest.cls
@@ -50,7 +50,7 @@
      */
     @TestSetup
     private static void init() {
-        NFM001Controller.isRunning = false;
+        NFM001Controller.isRunning = true;
         loginId = UserInfo.getUserId();
         id pid = UserInfo.getProfileId();
         // id pid = System.Label.ProfileId_2S1;
@@ -1206,11 +1206,10 @@
             System.Test.stopTest();
         }
     }
-
+    @isTest
     static void test01_08_01() {
         User user = [select Id from User where Username = 'olympusTest10@sunbridge.com'];
         System.runAs(user) {
-            System.Test.startTest();
             XinDailyReportControllerTest.settTestData();
             XinDailyReportController t = new XinDailyReportController();
             t.init();
@@ -1219,6 +1218,7 @@
             PageReference ref = t.getDailyReport();
             Test.setCurrentPage(ref);
             t = new XinDailyReportController();
+            Test.startTest();
             t.init();
             //          t.getEvent();
             //          t.report.Reporter__c = u1.id;
@@ -1228,7 +1228,7 @@
             t.repoStartMinuteText = '00';
             t.repoEndHourText = '18';
             t.repoEndMinuteText = '00';
-            t.report.Status__c = '鐢宠珛涓�';
+            t.report.Status__c = null;
             t.activities.get(0).actStartHourText = '9';
             t.activities.get(0).actStartMinuteText = '00';
             t.activities.get(0).actEndHourText = '18';
@@ -1261,6 +1261,7 @@
             t.activities.get(0).planEndHourText = '18';
             t.activities.get(0).planEndMinuteText = '00';
             t.activities.get(0).planPurposeText = '娆°伄娲诲嫊浜堝畾鐩殑(瑷堢敾)';
+
             t.save();
 
             t.activities.get(0).act.Location__c = accDepName;
@@ -1296,14 +1297,22 @@
             String strDate = d.year() + '/' + d.month() + '/' + d.day();
 
             Datetime dt = datetime.now();
-            String strDatetime = '2000/01/01 10:10';
+            String strDatetime = '2000/01/01 10:10:00';
             System.debug('strDatetime' + strDatetime);
 
             System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id);
-            // String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp4.Id, opp5.Id, strDate);
-            // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId;
-            // t.save();
-            System.Test.stopTest();
+            String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp4.Id, opp5.Id, strDate);
+            Add_Report.addReportPr(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id,'', strDate);
+            Add_Report.addReportNT(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id,'','', strDate);
+            // Add_Report.addReportOn(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'','','','','','');
+            Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, strDate,'');
+            Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Add_Report.addRA(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'','');
+            if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId;
+            t.save();
+            Test.stopTest();
         }
     }
 
diff --git a/force-app/main/default/classes/eSignAgencyConfirmPageControllerTest.cls b/force-app/main/default/classes/eSignAgencyConfirmPageControllerTest.cls
index 980c8e2..6eb90ca 100644
--- a/force-app/main/default/classes/eSignAgencyConfirmPageControllerTest.cls
+++ b/force-app/main/default/classes/eSignAgencyConfirmPageControllerTest.cls
@@ -151,29 +151,41 @@
         Date d = Date.today();
         eSignAgencyConfirmPageController.geteSigns('112233');
         eSignAgencyConfirmPageController.saveeSignFormEntry(eSignAgencyConfirmPageController.geteSigns('112233').eSignFormLineItems,eSignForm,'缁忛攢鍟嗙‘璁�',true,d,d,d,d,d,'111@qq.com');
-        list<Attachment> attachmentList = new list<Attachment>();
-        Attachment attach=new Attachment();     
-        attach.Name='Unit Test Attachment';
+        List<ContentVersion> versionList = new List<ContentVersion>();
+        Test.startTest();
+        ContentVersion version = new ContentVersion();
         Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
-        attach.body=bodyBlob;
-        attach.parentId=eSignForm.id;
+        version.VersionData = bodyBlob;
+        version.Title = 'Unit Test Attachment';
+        version.PathOnClient = 'Unit Test Attachment.txt';
+        version.ContentLocation = 's';
+        versionList.add(version);
+        insert versionList;
+        version = [select Id,ContentDocumentId from ContentVersion where Id =: version.Id];
+        // list<Attachment> attachmentList = new list<Attachment>();
+        // Attachment attach=new Attachment();     
+        // attach.Name='Unit Test Attachment';
+        // Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        // attach.body=bodyBlob;
+        // attach.parentId=eSignForm.id;
 
-        attachmentList.add(attach);
+        // attachmentList.add(attach);
 
-        // insert attach;
-        Attachment attach1=new Attachment();     
-        attach1.Name='Unit Test Attachment';
-        Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
-        attach1.body=bodyBlob1;
-        attach1.parentId=eSignForm.id;
+        // // insert attach;
+        // Attachment attach1=new Attachment();     
+        // attach1.Name='Unit Test Attachment';
+        // Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
+        // attach1.body=bodyBlob1;
+        // attach1.parentId=eSignForm.id;
 
-        insert attach1;
+        // insert attach1;
 
-        String fileId = String.valueOf(attach1.Id);
+        String fileId = String.valueOf(version.ContentDocumentId);
         String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
         eSignAgencyConfirmPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
         eSignAgencyConfirmPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
-        eSignAgencyConfirmPageController.deleteChunk(attach1.Id);
+        eSignAgencyConfirmPageController.deleteChunk(fileId);
+        Test.stopTest();
 
     }
 
diff --git a/force-app/main/default/classes/eSignAgencyPageControllerTest.cls b/force-app/main/default/classes/eSignAgencyPageControllerTest.cls
index 39bd13d..f4d8585 100644
--- a/force-app/main/default/classes/eSignAgencyPageControllerTest.cls
+++ b/force-app/main/default/classes/eSignAgencyPageControllerTest.cls
@@ -1,6 +1,13 @@
 @isTest
 private class eSignAgencyPageControllerTest {
 
+    @TestSetup
+    static void makeData(){
+        List<String> strList= new List<String>();
+        strList.add('Document');
+        TestDataUtility.CreatePIPolicyConfigurations(strList);
+    }
+
     static testMethod void testMethod1() {
         List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
         if (rectCo.size() == 0) {
@@ -149,33 +156,48 @@
         insert eSignFormLineItemEntry2;
 
         eSignAgencyPageController.geteSigns('112233');
+        Test.startTest();
         eSignAgencyPageController.saveeSignFormEntry(eSignAgencyPageController.geteSigns('112233').eSignFormLineItems,eSignForm,'缁忛攢鍟嗘敹璐�',true,true,null);
 
 
-        list<Attachment> attachmentList = new list<Attachment>();
-        Attachment attach=new Attachment();     
-        attach.Name='Unit Test Attachment';
+        // list<Attachment> attachmentList = new list<Attachment>();
+        // Attachment attach=new Attachment();     
+        // attach.Name='Unit Test Attachment';
+        // Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        // attach.body=bodyBlob;
+        // attach.parentId=eSignForm.id;
+
+        // attachmentList.add(attach);
+
+        // // insert attach;
+        // Attachment attach1=new Attachment();     
+        // attach1.Name='Unit Test Attachment';
+        // Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
+        // attach1.body=bodyBlob1;
+        // attach1.parentId=eSignForm.id;
+
+        // insert attach1;
+        List<ContentVersion> versionList = new List<ContentVersion>();
+        ContentVersion version = new ContentVersion();
         Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
-        attach.body=bodyBlob;
-        attach.parentId=eSignForm.id;
-
-        attachmentList.add(attach);
-
-        // insert attach;
-        Attachment attach1=new Attachment();     
-        attach1.Name='Unit Test Attachment';
-        Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
-        attach1.body=bodyBlob1;
-        attach1.parentId=eSignForm.id;
-
-        insert attach1;
-
-        String fileId = String.valueOf(attach1.Id);
+        version.VersionData = bodyBlob;
+        version.Title = 'Unit Test Attachment';
+        version.PathOnClient = 'Unit Test Attachment.txt';
+        version.ContentLocation = 's';
+        versionList.add(version);
+        insert versionList;
+        version = [select Id,ContentDocumentId from ContentVersion where Id =: version.Id];
+        String fileId = String.valueOf(version.ContentDocumentId);
         String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
         eSignAgencyPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
         eSignAgencyPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
-
         eSignAgencyPageController.deleteChunk(fileId);
+        Test.stopTest();
+
+
+        //eSignAgencyPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
+
+        //eSignAgencyPageController.deleteChunk(fileId);
     }
 
     static testMethod void testMethod2() {
@@ -329,4 +351,31 @@
         eSignAgencyPageController.saveeSignFormEntry(eSignAgencyPageController.geteSigns('112233').eSignFormLineItems,eSignForm,'缁忛攢鍟嗘敹璐�',true,true,null);
         
     }
+    static testMethod void testMethod3() {
+        Test.startTest();
+        eSignAgencyPageController.saveFile('1','2','3','4');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod4() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignAgencyPageController.getFileds('123456789');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod5() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignAgencyPageController.deleteFile(FileName1.Id);
+        Test.stopTest();
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls b/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
index d2192aa..c7a4e03 100644
--- a/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
+++ b/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
@@ -108,28 +108,67 @@
     	eSignForm.DNName__c = '112233';
 
     	insert eSignForm;
-        list<Attachment> attachmentList = new list<Attachment>();
-        Attachment attach=new Attachment();     
-        attach.Name='A-65224941-20200923--1.docx';
-        Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
-        attach.body=bodyBlob;
-        attach.parentId=eSignForm.id;
-        attach.ContentType = 'application/pdf';
-        attachmentList.add(attach);
 
-        Attachment attach1=new Attachment();     
-        attach1.Name='H-65224945-20200928--15.jpg';
-        Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
-        attach1.body=bodyBlob1;
-        attach1.parentId=eSignForm.id;
-        attach1.ContentType = 'application/pdf';
-        attachmentList.add(attach1);
 
-        insert attachmentList;
+
+        Test.startTest();
+        ContentVersion version = new ContentVersion(
+            Title = 'A-65224941-20200923--1.docx',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
+        );
+        insert version;
+        version = [select ContentDocumentId from ContentVersion where Id =: version.Id];
+        ContentDocumentLink link = new ContentDocumentLink();
+        link.ContentDocumentId = version.ContentDocumentId;
+        link.LinkedEntityId = eSignForm.id;
+        link.ShareType = 'I';
+        link.Visibility = 'AllUsers';
+        insert link;
+
+        ContentVersion version1 = new ContentVersion(
+            Title = 'H-65224945-20200928--15.jpg',
+            VersionData = EncodingUtil.base64Decode('test'),
+            ContentLocation = 's',
+            PathOnClient = 'test.txt'
+        );
+        insert version1;
+        version1 = [select ContentDocumentId from ContentVersion where Id =: version1.Id];
+        ContentDocumentLink link1 = new ContentDocumentLink();
+        link1.ContentDocumentId = version1.ContentDocumentId;
+        link1.LinkedEntityId = eSignForm.id;
+        link1.ShareType = 'I';
+        link1.Visibility = 'AllUsers';
+        insert link1;
+
+
+
+
+        
+        // list<Attachment> attachmentList = new list<Attachment>();
+        // Attachment attach=new Attachment();     
+        // attach.Name='A-65224941-20200923--1.docx';
+        // Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        // attach.body=bodyBlob;
+        // attach.parentId=eSignForm.id;
+        // attach.ContentType = 'application/pdf';
+        // attachmentList.add(attach);
+
+        // Attachment attach1=new Attachment();     
+        // attach1.Name='H-65224945-20200928--15.jpg';
+        // Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
+        // attach1.body=bodyBlob1;
+        // attach1.parentId=eSignForm.id;
+        // attach1.ContentType = 'application/pdf';
+        // attachmentList.add(attach1);
+
+        // insert attachmentList;
         PageReference page = new PageReference('/apex/eSignFormAttachment?parentId='+eSignForm.id);
         System.Test.setCurrentPage(page);
 
         eSignFormAttachmentController eSign = new eSignFormAttachmentController();
         eSign.init();
+        Test.stopTest();
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/eSignHospitalConfirmControllerTest.cls b/force-app/main/default/classes/eSignHospitalConfirmControllerTest.cls
index c9099a0..158d724 100644
--- a/force-app/main/default/classes/eSignHospitalConfirmControllerTest.cls
+++ b/force-app/main/default/classes/eSignHospitalConfirmControllerTest.cls
@@ -1,5 +1,13 @@
 @isTest
 private class eSignHospitalConfirmControllerTest {
+
+    @TestSetup
+    static void makeData(){
+        List<String> strList= new List<String>();
+        strList.add('Document');
+        TestDataUtility.CreatePIPolicyConfigurations(strList);
+    }
+    
     static testMethod void testMethod1() {
         List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
         if (rectCo.size() == 0) {
@@ -151,29 +159,49 @@
 
         eSignHospitalConfirmController.geteSigns('112233');
         eSignHospitalConfirmController.saveeSignFormEntry(eSignHospitalConfirmController.geteSigns('112233').eSignFormLineItems,eSignForm,'鍖婚櫌纭',true);
-        list<Attachment> attachmentList = new list<Attachment>();
-        Attachment attach=new Attachment();     
-        attach.Name='Unit Test Attachment';
+        // list<Attachment> attachmentList = new list<Attachment>();
+        // Attachment attach=new Attachment();     
+        // attach.Name='Unit Test Attachment';
+        // Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        // attach.body=bodyBlob;
+        // attach.parentId=eSignForm.id;
+
+        // attachmentList.add(attach);
+
+        // // insert attach;
+        // Attachment attach1=new Attachment();     
+        // attach1.Name='Unit Test Attachment';
+        // Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
+        // attach1.body=bodyBlob1;
+        // attach1.parentId=eSignForm.id;
+
+        // insert attach1;
+
+        // String fileId = String.valueOf(attach1.Id);
+        // String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
+        // eSignHospitalConfirmController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
+
+
+
+        Test.startTest();
+        List<ContentVersion> versionList = new List<ContentVersion>();
+        ContentVersion version = new ContentVersion();
         Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
-        attach.body=bodyBlob;
-        attach.parentId=eSignForm.id;
-
-        attachmentList.add(attach);
-
-        // insert attach;
-        Attachment attach1=new Attachment();     
-        attach1.Name='Unit Test Attachment';
-        Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
-        attach1.body=bodyBlob1;
-        attach1.parentId=eSignForm.id;
-
-        insert attach1;
-
-        String fileId = String.valueOf(attach1.Id);
+        version.VersionData = bodyBlob;
+        version.Title = 'Unit Test Attachment';
+        version.PathOnClient = 'Unit Test Attachment.txt';
+        version.ContentLocation = 's';
+        versionList.add(version);
+        insert versionList;
+        version = [select Id,ContentDocumentId from ContentVersion where Id =: version.Id];
+        String fileId = String.valueOf(version.ContentDocumentId);
         String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
         eSignHospitalConfirmController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
         eSignHospitalConfirmController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
-        eSignHospitalConfirmController.deleteChunk(attach1.Id);
+        eSignHospitalConfirmController.deleteChunk(fileId);
+        Test.stopTest();
+        // eSignHospitalConfirmController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
+        // eSignHospitalConfirmController.deleteChunk(attach1.Id);
     }
 
     static testMethod void testMethod2() {
@@ -327,4 +355,32 @@
         eSignHospitalConfirmController.geteSigns('112233');
         eSignHospitalConfirmController.saveeSignFormEntry(eSignHospitalConfirmController.geteSigns('112233').eSignFormLineItems,eSignForm,'鍖婚櫌纭',true);
     }
+
+    static testMethod void testMethod3() {
+        Test.startTest();
+        eSignHospitalConfirmController.saveFile('1','2','3','4');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod4() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignHospitalConfirmController.getFileds('123456789');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod5() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignHospitalConfirmController.deleteFile(FileName1.Id);
+        Test.stopTest();
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/eSignHospitalPageControllerTest.cls b/force-app/main/default/classes/eSignHospitalPageControllerTest.cls
index 22a25c8..65ddbe1 100644
--- a/force-app/main/default/classes/eSignHospitalPageControllerTest.cls
+++ b/force-app/main/default/classes/eSignHospitalPageControllerTest.cls
@@ -1,5 +1,13 @@
 @isTest
 private class eSignHospitalPageControllerTest {
+
+    @TestSetup
+    static void makeData(){
+        List<String> strList= new List<String>();
+        strList.add('Document');
+        TestDataUtility.CreatePIPolicyConfigurations(strList);
+    }
+    
     static testMethod void testMethod1() {
         List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
         if (rectCo.size() == 0) {
@@ -151,29 +159,49 @@
 
         eSignHospitalPageController.geteSigns('112233');
         eSignHospitalPageController.saveeSignFormEntry(eSignHospitalPageController.geteSigns('112233').eSignFormLineItems,eSignForm,'鍖婚櫌鏀惰揣',true,true,true,d,d,d,'222@qq.com');
-        list<Attachment> attachmentList = new list<Attachment>();
-        Attachment attach=new Attachment();     
-        attach.Name='Unit Test Attachment';
-        Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
-        attach.body=bodyBlob;
-        attach.parentId=eSignForm.id;
+        // list<Attachment> attachmentList = new list<Attachment>();
+        // Attachment attach=new Attachment();     
+        // attach.Name='Unit Test Attachment';
+        // Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        // attach.body=bodyBlob;
+        // attach.parentId=eSignForm.id;
 
-        attachmentList.add(attach);
+        // attachmentList.add(attach);
 
         // insert attach;
-        Attachment attach1=new Attachment();     
-        attach1.Name='Unit Test Attachment';
-        Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
-        attach1.body=bodyBlob1;
-        attach1.parentId=eSignForm.id;
+        // Attachment attach1=new Attachment();     
+        // attach1.Name='Unit Test Attachment';
+        // Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
+        // attach1.body=bodyBlob1;
+        // attach1.parentId=eSignForm.id;
 
-        insert attach1;
+        // insert attach1;
 
-        String fileId = String.valueOf(attach1.Id);
+        // String fileId = String.valueOf(attach1.Id);
+        // String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
+        // eSignHospitalPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
+        Test.startTest();
+        List<ContentVersion> versionList = new List<ContentVersion>();
+        ContentVersion version = new ContentVersion();
+        Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
+        version.VersionData = bodyBlob;
+        version.Title = 'Unit Test Attachment';
+        version.PathOnClient = 'Unit Test Attachment.txt';
+        version.ContentLocation = 's';
+        versionList.add(version);
+        insert versionList;
+        version = [select Id,ContentDocumentId from ContentVersion where Id =: version.Id];
+        String fileId = String.valueOf(version.ContentDocumentId);
         String body1 = '%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj%2F2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj%2FwAARCALuAegDASIAAhEBAxEB%2F8QAHAAAAgIDAQEAAAAAAAAAAAAAAwQCBQABBgcI%2F8QARRAAAgEDAwIFAgMGBAUCBQQDAQIDAAQRBRIhMUEGEyJRYTJxFIGRByNCUqHBFTOx0SRDYuHwcvEWNFNjggglc5ImotL%2FxAAbAQACAwEBAQAAAAAAAAAAAAADBAECBQAGB%2F%2FEADMRAAICAQQCAQQABQMEAwEAAAECAAMRBBIhMRNBIgUyUWEUI0JxgQYzkRWhsdEkUsHw%2F9oADAMBAAIRAxEAPwDwgQg8kc1IRjB4o7DHSgvKFB96yASZ63EE6gGtNgLQXnzmoebRNsuqD3Dq3fijxeUxxICM9xSQkrYkqCpjAWvEsmg2epG3LS7DFBSUjuRRBKCfVzUYIg2rB%2B2SNDbk0XaGwVPFZ5RLVAIlFqdzgCBjiMj9Mir%2By%2FcxbAcA9ar7WMJTikk0vc27iel%2BmaYacbj3Gi%2FtWg5oSDJwaOI%2BKXOBN5SzcyPWoScjFEUgVAjJzXCQ4yJX3ScfalRLtcU9fEAGqgHLinKxlZ53WN47MLOktZAyimQaq7J%2BFqwVvVSbrgz0elu3IMyx09lIZWPGanBA9zcBYslc0vp8RmkIGcZrq7CzMUWYkOcdaSusFf8AeZeqYmwzECwQCKPt9VRSwlvXywOAMCrfS7GMzBZCMtz96NcEWdyQhDLntWebjkhYpu9SrbS4oWAlUEjGasLq0S3tYXjwEbkgVHU7xLpt4GwgAE%2FFINdeYqqrF1XAA%2BKgB2wTK5JwZcWs6S6e0Z459P5UsLxrJ2YHlhtwPbOaRjufMhm2cMvCj5qOmDiW4uSHK8bakVAA5ltpkptRXznk6O%2Bc0lK5mcFY%2BTzk1jKnmPKw9Lsdo9qNKRDHu%2BOBR1AU8CGCcRc%2BYqkSPge1QtrX8Q4YjEa1KOF5m3SHC1bJEItIR1%2BqViF%2BwqWfbwJJAGBK1rYxNgjMZokatCfMX1KfTzVjdQs8EBxjfHu%2FMCkmV4Yxu5QnkVG%2FcJHBGYWO5COApKGslK7t7chjurVxGmPMUZUgUxaWayyLBK21CCyt80I4HMqwwMyN9cJdOpcYUDH59TSt9psPkI6kbn6imri3ELPFI4LDkUi%2B7AAY%2FGalAeCsjuVsmkYQuPfBqK2p27SMYq4M5FsUK985FbiCSLzjAFENje4VOJWKjIqqwyCMUheRukLRA%2Bhj0q%2FeISRMUxlRwKq7iNuN4980Suzmc6gymSHfHtHuSKXltQC27r1NWU6GMgp%2FShFS4LEcmnFcjmKWVxRrXyrfB6kZNZZQAcnjn%2BlWU0W6MHHWpW1rvyahrPjBbB7kraZrWUNH0PWrGO9jnk2TYwOi%2FNJvDtiY%2FwAtJyIQiPnDdTQcB%2BZY5lhfxLKSyZ%2BB%2FvVK6BXYNyadiuGTKk9e9bEYnbj8zVkJSQTnuLw2%2Begp%2B2tCZBxTFnb%2FABxVrDCkSl5MKqjJJ7UCy4ngQbj8QUNphMtwO9VGtatHagw2xDS9Cewoeu6%2F5gaCxOEHDP71zBOSSxyT3o%2Bn0x%2B%2ByOUaPd8rJtsvIXc7mJyTUsjHNDLYqO%2BnsZmmGVBgSbyYWk5W5NEduKUlYk0VFiWpuMhI9D9TdKMkQ6saIAAeOKLuA6md42c5MhFGf4qyi1lUJzGlQKMQNzKFHB5qtdyzVAyFzk1HdzTapieZ3CT61o8VHdWZq2J27MkDUqgKnnNQZZTJg5xUhQgampBFVMKphVcqRg0ylyMeoc0iWxWg1QVBhUvNZ4lnHOueKeikBHFUKueKPHOVI5oLVZmjp9eV7nQQ4LUfNVllchiBT2%2FFJupBxPR6a9XTImSDnionhD71MNnrS88gANcozxLWsFUtK7UpeAKSjGWqN3Jvm%2B1EgHIp8Das8i9vmuJlnbAjaafBpSBfRTAPppN%2BTPS6b4LOq8IwrNHdk43LgjNdLaXy2zOCA2egFcn4RR5GuNrbUwN1dNP5dqilRkn3rG1K5sIil3ycyQeZ5A30IDxioS3B5VMs2etL%2BfLccAHmnra1EMMk0v1AHFBwB3KbQO5SziWWXZuOOM0a2RoUKpjoW%2FKiRr%2B7Zv4j1ocq7yvOD0%2FKjbs8S%2B2AjLQFpI%2FUpO7NDgvfLnLcndwRTEOFk2qCCp71qRI%2FxzIowGOR8cVcEc5lB3iEjxcTFyCsfUCtzjfcxoemN1MwLC0oj34PQYpW45nBTnb6TQweYVYWZmjG3GB9P6jNORkS2NvESd6MSPtSMCtM0Yb1eZ0%2BD0rp44YbGWCFVWWYnLZ7DFCsbbge4OxsGJ3szbIkRMIiCPJHXPWkLiVJpXRB6QSoFX0zQzW5kRQJEba69vvXOSqIJQy5Yf8Aaq0nPBkIMiG05hLaTQSDkcA0J5Hd1EpCBCKNYKEhZ5Mqp%2FqaFexrM%2FmHgHpVxgsfxCbcCL6k7S3pGeFACn3FCnmMsaKF9SdT8VYPapGsYPLsu7J7Clp4GiXehyM5IogYHAkLzFQ7R8ZyPY1sSIehKmgS73jaQZzmtRqW5q5AhSojkcjQ%2FwDUDUPMErMCB15%2BKExdOc5FaBVz7NVQsrgiQktlMhUdKD%2BG5IphCyyNu5BopdC%2FFXDMJVlibLtTaaD5rxZ296dlYYKnv3pWaPMWR1zRFbPBgDXIMzcAnINCfLSFSeooLSsGwakXPnJ89aIFxBkTFTJyexxTlmmHK%2B4oIGXI7ZqxtgqDzHIAA5Jodh9CAb9R%2BDy4YjLKQqqMmuV1zWXvXMcLFLcdB%2FNQ9a1R7uQxREiAHp%2FN8mqdzzjNH0%2BmCfJu4%2Fp6NvybuYWqDPjNRd8CgM9OhMwr3AQpfmsBzQd4qSMCauVgRaDNyHaOaUeUA8UO6uC8hVOgoaxsRzRlTA5mbdqS7YQQnnEnvRUkUDLHmoRwcVI24Irjt6kILQMyRu46ygtae1ZXYSQW1P4lSGqQOaBk1IMadxPNiyGrYqAPFbBquIVWkw2KkDmh5rY4qCIQNCc1tTUQRWVXEIGkzWq1mt5qCJbOZsHFS3VCt10sGh4ZSjAg1eQSiWBWHXvXOg4p7Trgq%2B0n0nigXV7hmaf0%2FVmt9p6MuVekL%2BbCk0cnBxVVqcnIFBpT5TS%2BoagrSYmDuYk09a8mkI%2BtP2vBpqzqYWj5YS4t%2FpqbcZqFv0ojDLVnnuevT7BOj8LqVtp2BxkirrzGuWXzDwvAqp8OjbYkYySxq0jiY4C8Z7msu85cxcy0REUAqOBxUL2YmLys8k4oCSSQt5L84PNTUGSVpD0HSlduOZQCR8tvLKrngZNV8YZrkKTyvWrDzts6Rno55qN2qQauBwqtGOe2TVlJHEk8RGSXZMzuMEnnnisWLzdU2xsGwpk4%2FXFP3enR3FqQrEOAGHt9qBp9uli8kzby5G0cdAQaIHBH7lCQRx3CSxJhXtzggE5Pt1oVuCoVmBJbtRXlMnlpEowo2kDvRCo%2FdhiAdoxjpxVMkDEsuRwYrBMYLk%2Fyq3%2Fer%2B2t%2FwAZK03mHJw457HqKoJIn3MqAMGOf60O3acO4jZgI1JODjArmTeODOsTPM6Ag2QlO7Kn0n5Jqstybi6RH%2BjdnApSFp55NrFn%2Fjwf9ad0%2BN%2FxgYgqozzVCNoI9wqrhcyyuoRNPHbLwm7BNVmoB4HhU8gen86tLgn8RCz5VBzn3NIalB%2BIs2SJ%2FWkhce5qlZAIBnIeR%2BJG6uN6pGwIdQASandyrNZI4G1skE%2FFIafZXEtw7zyelV5Oeppq7jEdljd6vMH50XgMAJxVdwAktN078VA%2B447CqyZWiuTGRjYcGr21nFvZytnnJAH3qpjJe9M0w3KxyahCckmVw2SYnMTs9PStwMjEF%2BDTF2qh3Ef0nkUCKFpXCIMnFG3DE7HuFaF0RnzlaW2knKdasH8yKJ4pB2zzSNrIUl4AOfeuViRmVPUBI54z1oe5j9qfnjExKsu1qQlUxuVbtRUYEThz3F7iPd6l%2FOhxAmVSaYU4z81MRAOpFE3YGIJ6%2Fc3s2%2BqqzVL4sghRsIPqPvTOr3a28G0MN7f0FcjcXbO3H00zRQW%2BRi2Vrbc0bkmAOFoEk1KFzjmhs5p5a5WzWH1DvL80BpeaEzUJnooWIWakxkyk96Omdh560jHyQaO0uBiuKzq7uMtJiNUGTya20gA4FL7%2FAJrW6u2%2Fmd5gOFEMs5z1oqy80lU06VxUGcl7Ax5Jx3rKSJOayo2CGGsYSkJOa2DQw2TzUh1p%2BePDZhQxqatmgjrRF61UwysYQGp5yOKFUl6VWHUyYNSBqHapCohVaTrKxaw9aoTCibHSpVFakaiWEytxMVYGo5qVQRLKSDkS4STdGj%2FkaqtRbM%2FHSnLJ90bIarrps3BqlS4aPa27fSv7m4etWFuPUKQgHqqxgHqFRaZ2hHUtbccUTHqqMA9NEQZkFZ5PM9YBisTvvCmnh9MV5B6CCaeu7dEZccY7UTSJAukWUY4AUE%2FOTQb2bN3IwGQDWESzWEmZ6ZYnMDIC0hcnOec%2FbpW87YVC9P71KAFh8GoT5iyhHpard8S4PqKXJdZ4nUHKnP8AWmL9PxkzMnTcNvwO1WD2gmtlmjGR147HuKTKnzMqBuC5wP4h8fIqFfPU4W';
         eSignHospitalPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg','');
         eSignHospitalPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
-        eSignHospitalPageController.deleteChunk(attach1.Id);
+        eSignHospitalPageController.deleteChunk(fileId);
+        Test.stopTest();
+
+
+
+        // eSignHospitalPageController.saveChunk(eSignForm.Id,'test01',body1,'image/jpeg',fileId);
+        // eSignHospitalPageController.deleteChunk(attach1.Id);
     }
 
     static testMethod void testMethod2() {
@@ -326,4 +354,32 @@
         eSignHospitalPageController.geteSigns('112233');
         eSignHospitalPageController.saveeSignFormEntry(eSignHospitalPageController.geteSigns('112233').eSignFormLineItems,eSignForm,'鍖婚櫌鏀惰揣',true,true,true,d,d,d,'222@qq.com');
     }
+
+    static testMethod void testMethod3() {
+        Test.startTest();
+        eSignHospitalPageController.saveFile('1','2','3','4');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod4() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignHospitalPageController.getFileds('123456789');
+        Test.stopTest();
+    }
+
+    static testMethod void testMethod5() {
+        Test.startTest();
+        FileAddress__c FileName1 = new FileAddress__c();
+        FileName1.FileName__c = 'ceshiyi1';
+        FileName1.ViewLink__c = 'ceshiyi1';
+        FileName1.ParentRecordId__c = '123456789';
+        insert FileName1;
+        eSignHospitalPageController.deleteFile(FileName1.Id);
+        Test.stopTest();
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexLightingButtonConstantTest.cls b/force-app/main/default/classes/lexLightingButtonConstantTest.cls
new file mode 100644
index 0000000..0ed5f1e
--- /dev/null
+++ b/force-app/main/default/classes/lexLightingButtonConstantTest.cls
@@ -0,0 +1,33 @@
+@isTest
+private class lexLightingButtonConstantTest {
+    static testMethod void test1(){
+       lexLightingButtonConstant s = new lexLightingButtonConstant();
+        // lexLightingButtonConstant.RECORD_TYPE_NAME_Application;
+        // lexLightingButtonConstant.STATUS_DRAFT;
+        // lexLightingButtonConstant.STATUS_COMPLETE;
+        // lexLightingButtonConstant.STATUS_CANCEL;
+        // lexLightingButtonConstant.STATUS_TO_BE_REPORTED;
+        // lexLightingButtonConstant.STATUS_TO_NOT_REPORT;
+        // lexLightingButtonConstant.STATUS_VOC_CONFIRMED;
+        // lexLightingButtonConstant.STATUS_VOC_END_OF_ANSWER;
+        // lexLightingButtonConstant.STATUS_VOC_APPLYING;
+        // lexLightingButtonConstant.STATUS_VOC_CHECK_OVER;
+        // lexLightingButtonConstant.STATUS_VOC_WRITE_OVER;
+        // lexLightingButtonConstant.STOCK_APPLY_STATUS_WRITE_OVER;
+        // lexLightingButtonConstant.STOCK_APPLY_STATUS_DRAFT;
+        // lexLightingButtonConstant.STATUS_VOC_FINISH;
+        // lexLightingButtonConstant.QUOTEIRAI_STATUS_DRAFT;
+        // lexLightingButtonConstant.STATUS_QIS_OSH_TESTING;
+        // lexLightingButtonConstant.STATUS_QIS_OSH_COMPLATED;
+        // lexLightingButtonConstant.STATUS_QIS_OSH_TESTING_APP;
+        // lexLightingButtonConstant.STATUS_QIS_RC_COMPLATED;
+        // lexLightingButtonConstant.STATUS_QIS_CANCEL;
+        // lexLightingButtonConstant.STATUS_QIS_RC_CHECKING;
+        // lexLightingButtonConstant.STATUS_QIS_FSE_COMPLATED;
+        // lexLightingButtonConstant.STATUS_QIS_COMPLATED;
+        // lexLightingButtonConstant.STATUS_OPPORTUNITY_SPECIAL_APPLY_SUBMIT;
+        // lexLightingButtonConstant.SUB_INFO_TYPE_SCRAPPED_LABEL;
+        // lexLightingButtonConstant.SUB_INFO_TYPE_SCRAPPED_LABEL;
+        // lexLightingButtonConstant.SUB_INFO_TYPE_SCRAPPED_LABEL;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexLightingButtonConstantTest.cls-meta.xml b/force-app/main/default/classes/lexLightingButtonConstantTest.cls-meta.xml
new file mode 100644
index 0000000..642d054
--- /dev/null
+++ b/force-app/main/default/classes/lexLightingButtonConstantTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>58.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexLostCancelReportController.cls b/force-app/main/default/classes/lexLostCancelReportController.cls
index e706a6e..8bc00ee 100644
--- a/force-app/main/default/classes/lexLostCancelReportController.cls
+++ b/force-app/main/default/classes/lexLostCancelReportController.cls
@@ -17,7 +17,6 @@
             res.cntLostCancelDraft = opp.Cnt_Lost_cancel_Draft__c;
             res.cntLostCancelReport = opp.Cnt_Lost_cancel_report__c;
         } catch (Exception e) {
-            throw new AuraHandledException(e.getMessage());
         }
         return res;
     }
@@ -36,7 +35,6 @@
             res.lostType = report.LostType__c;
             res.reportStatus = report.Report_Status__c;
         } catch (Exception e) {
-            throw new AuraHandledException(e.getMessage());
         }
         return res;
     }
@@ -54,21 +52,10 @@
             return null;
         } catch (Exception e) {
             Database.rollback(sp);
-            if (e.getMessage().contains(',')) {
-                System.debug(LoggingLevel.INFO, '*** e: ' + e);
-                String exc = '' + e.getMessage();
-                Integer left = exc.indexOf(':') + 1;
-                Integer right = exc.lastIndexOf(':');
-                String str = exc.substring(left,right);
-                left = str.indexOf(',') +  1;
-                String newStr = str.substring(left);
-                return newStr;
-            }else {
-                return e.getMessage();   
-            }
+            return e.getDmlMessage(0);  
         }
     }
-    class InitData {
+    public class InitData {
         @AuraEnabled
         public Decimal cntLostCancelReport;
         @AuraEnabled
diff --git a/force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml b/force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml
index 642d054..7a51829 100644
--- a/force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml
+++ b/force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml
@@ -2,4 +2,4 @@
 <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>58.0</apiVersion>
     <status>Active</status>
-</ApexClass>
\ No newline at end of file
+</ApexClass>
diff --git a/force-app/main/default/classes/lexLostCancelReportControllerTest.cls b/force-app/main/default/classes/lexLostCancelReportControllerTest.cls
new file mode 100644
index 0000000..9393530
--- /dev/null
+++ b/force-app/main/default/classes/lexLostCancelReportControllerTest.cls
@@ -0,0 +1,100 @@
+@isTest
+private class lexLostCancelReportControllerTest {
+    static testMethod void test1(){
+        // recode type 銈掑彇寰�
+        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+        if (rectCo.size() == 0) {
+            throw new ControllerUtil.myException('not found 鐥呴櫌 recodetype');
+        }
+        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鎴︾暐绉戝鍒嗛 鍛煎惛绉�'];
+        if (rectSct.size() == 0) {
+            throw new ControllerUtil.myException('not found 鎴︾暐绉戝鍒嗛 recodetype');
+        }
+        List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('瑷虹檪绉� 娑堝寲绉�', '瑷虹檪绉� 鍛煎惛绉�') order by Name desc];
+        if (rectDpt.size() == 0) {
+            throw new ControllerUtil.myException('not found 瑷虹檪绉� recodetype');
+        }
+        List<RecordType> rectLost = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Lost_cancel_report__c' and DeveloperName IN ('PCL_Lost_report', 'PCL_Cancel_report') order by DeveloperName desc];
+        if (rectLost.size() == 0) {
+            throw new ControllerUtil.myException('not found Lost_cancel_report recodetype');
+        }
+
+        // insert
+        Account company1 = new Account();
+        Account company2 = new Account();
+        company1.RecordTypeId = rectCo[0].Id;
+        company1.Name = '鐥呴櫌銉嗐偣銉�1';
+        company2.RecordTypeId = rectCo[0].Id;
+        company2.Name = '鐥呴櫌銉嗐偣銉�2';
+        insert new Account[] {company1, company2};
+
+        List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c];
+        List<Account> dc2s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company2.Id order by Department_Class_Label__c];
+
+        Account depart1 = new Account();
+        depart1.RecordTypeId = rectDpt[0].Id;
+        depart1.Name         = '*';
+        depart1.Department_Name__c  = '瑷虹檪绉�1';
+        depart1.ParentId            = dc1s[0].Id;
+        depart1.Department_Class__c = dc1s[0].Id;
+        depart1.Hospital__c         = company1.Id;
+
+        Account depart2 = new Account();
+        depart2.RecordTypeId = rectDpt[1].Id;
+        depart2.Name         = '*';
+        depart2.Department_Name__c  = '瑷虹檪绉�2';
+        depart2.ParentId            = dc2s[1].Id;
+        depart2.Department_Class__c = dc2s[1].Id;
+        depart2.Hospital__c         = company2.Id;
+
+        insert new Account[] {depart1, depart2};
+
+        // 銇俱仛銇层仺銇よ拷鍔�
+        List<Product2> prdList = new List<Product2>();
+        Product2 prd1 = new Product2();
+        prd1.ProductCode_Ext__c     = 'HistoryPrd1';
+        prd1.ProductCode            = 'HistoryPrd1';
+        prd1.Repair_Product_Code__c = 'HistoryPrd1_RP';
+        prd1.Name                   = 'HistoryPrd1';
+        prd1.Manual_Entry__c        = true;
+        Product2 prd2 = new Product2();
+        prd2.ProductCode_Ext__c     = 'HistoryPrd2';
+        prd2.ProductCode            = 'HistoryPrd2';
+        prd2.Repair_Product_Code__c = 'HistoryPrd2_RP';
+        prd2.Name                   = 'HistoryPrd2';
+        prd2.Manual_Entry__c        = true;
+        insert new Product2[] {prd1, prd2};
+
+        // 鍟嗚珖
+        Opportunity opp1 = new Opportunity(Name='aiueo', StageName='contact', CloseDate=Date.today(),
+            Hospital__c = company1.Id,
+            Department_Class__c = dc1s[0].Id,
+            AccountId = depart1.Id
+        );
+        Opportunity opp2 = new Opportunity(Name='aiueo', StageName='contact', CloseDate=Date.today(),
+            Hospital__c = company2.Id,
+            Department_Class__c = dc2s[0].Id,
+            AccountId = depart2.Id
+        );
+        insert new Opportunity[] {opp1, opp2};
+
+        // 澶卞崟
+        Lost_cancel_report__c lcr1 = new Lost_cancel_report__c(
+            Opportunity__c = opp1.Id, 
+            CompetitorProduct1__c = prd1.Id,
+            CompetitorProduct2__c = prd2.Id,
+            RecordTypeId = rectLost[0].Id
+        );
+        // 鍙栨秷
+        Lost_cancel_report__c lcr2 = new Lost_cancel_report__c(
+            Opportunity__c = opp2.Id, 
+            RecordTypeId = rectLost[1].Id
+        );
+        insert new Lost_cancel_report__c[] {lcr1, lcr2};
+        Test.startTest();
+        lexLostCancelReportController.initForEditCancelReport(lcr2.Id);
+        lexLostCancelReportController.initSubmitReportButton(lcr2.Id);
+        lexLostCancelReportController.updateSubmitReportButton(lcr2.Id);
+        Test.stopTest();
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexLostCancelReportControllerTest.cls-meta.xml b/force-app/main/default/classes/lexLostCancelReportControllerTest.cls-meta.xml
new file mode 100644
index 0000000..642d054
--- /dev/null
+++ b/force-app/main/default/classes/lexLostCancelReportControllerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>58.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexOpportunitySpecialApplyController.cls b/force-app/main/default/classes/lexOpportunitySpecialApplyController.cls
index 35f8b9e..8fad086 100644
--- a/force-app/main/default/classes/lexOpportunitySpecialApplyController.cls
+++ b/force-app/main/default/classes/lexOpportunitySpecialApplyController.cls
@@ -27,18 +27,7 @@
         update opp;
         return '';
     } catch (Exception e) {
-        if (e.getMessage().contains(',')) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            String exc = '' + e.getMessage();
-            Integer left = exc.indexOf(':') + 1;
-            Integer right = exc.lastIndexOf(':');
-            String str = exc.substring(left,right);
-            left = str.indexOf(',') +  1;
-            String newStr = str.substring(left);
-            return newStr;
-        }else {
-            return e.getMessage();   
-        } 
+        return e.getDmlMessage(0);
     }
    } 
     public class InitData{
diff --git a/force-app/main/default/classes/lexPCLLostReportLwcController.cls b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
index 3457411..082f4f8 100644
--- a/force-app/main/default/classes/lexPCLLostReportLwcController.cls
+++ b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -1,6 +1,6 @@
 public with sharing class lexPCLLostReportLwcController {
 
-	public static Product2 pro2 { get; set; }
+
 
 	public static string oppId { get; set; }
 
@@ -19,16 +19,10 @@
 
 	public static integer brandNo {get; set;}
 
-	public static integer RemoveBrandNo {get; set;}
-
-	public static integer setBrandNo {get; set;}
-
 	public static integer brandCount {get; set;}
 	// add tcm 20211122 start
 
-	public static integer topNum {get; set;}
 
-	public static integer secondNum {get; set;}
 	// add tcm 20211122 end
 
 	@AuraEnabled(cacheable=true)
@@ -105,7 +99,7 @@
 			submitFlag = submitFlag1;
 			return init1();
 		} catch (Exception e) {
-			return e.getMessage();
+			return new Map<string,object>();
 		}
 	}
 	// 鍒濆鍖�
@@ -211,6 +205,7 @@
 				Lost_reason_main__c,Lost_Reason_Sub__c,Name,Agency__c, AgencyMannual__c,
 				Lost_cancel_report__c,Lost_By_Company_Mannual__c,ChannelSpecificReasons__c,
 				( select id,PCLLostBrand__c,LostProduct__c,
+				isSpec__c,
 				LostProduct__r.Name,
 				  LostProductMannual__c,            //SWAG-C6P9PX lt 20210913 add
 				  ProductCategory__c,
@@ -382,7 +377,7 @@
 			}
 			
 		} catch (Exception e) {
-			return e.getMessage();
+			return e.getDmlMessage(0);
 		}
 	}
 	// 鏁版嵁褰曞叆
@@ -393,7 +388,7 @@
 		Map<String,String> messageMap = new Map <String,String>();
 		system.debug('save---start:');
 		Savepoint sp = Database.setSavepoint();
-		try{
+		
 			// 寰呭畬鎴愶紝杩欓噷闇�瑕佹妸绗竴涓搧鐗岀殑淇℃伅璧嬪�煎埌杩欎釜澶卞崟鎶ュ憡涓婂幓锛岃繕鏈夐渶瑕佹妸鍚勪釜鍝佺墝閲戦姹囨�诲姞璧锋潵锛�
 			//system.debug('LostReport.LostBrands:'+LostReport.LostBrands);
 			// 璁剧疆璁板綍绫诲瀷
@@ -562,28 +557,9 @@
 			// lostReportId = report.lostReport.id;
 			system.debug('save---end:');
 			messageMap.put('LostReport',JSON.serialize(report));
-		}catch (Exception e) {
-			Database.rollback(sp);
-			// 杩欓噷闇�瑕佸啓涓�浜涙姤閿欎俊鎭�
-			// if (e.getMessage().contains(',')) {
-            //     System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            //     String exc = '' + e.getMessage();
-            //     Integer left = exc.indexOf(':') + 1;
-            //     Integer right = exc.lastIndexOf(':');
-            //     String str = exc.substring(left,right);
-            //     left = str.indexOf(',') +  1;
-            //     String newStr = str.substring(left);
-            //     messageMap.put('error', ''+ newStr);
-            // }else {
-            //     messageMap.put('error', ''+ e.getMessage());
-            // }
-
-			messageMap.put('error', ''+ e.getMessage());
-			return messageMap;
-		}
+		
 		return messageMap;
 	}
-
 	
 	// 鎻愪氦
 	@AuraEnabled
@@ -634,18 +610,7 @@
 			return objs;
 		}catch(exception e) {
 			Database.rollback(sp);
-			if (e.getMessage().contains(',')) {
-                System.debug(LoggingLevel.INFO, '*** e: ' + e);
-                String exc = '' + e.getMessage();
-                Integer left = exc.indexOf(':') + 1;
-                Integer right = exc.lastIndexOf(':');
-                String str = exc.substring(left,right);
-                left = str.indexOf(',') +  1;
-                String newStr = str.substring(left);
-                objs.put('error', ''+ newStr);
-            }else {
-                objs.put('error', ''+ e.getMessage());
-            }
+			objs.put('error',e.getDmlMessage(0));
 			return objs;
 		}
 	}
@@ -775,7 +740,7 @@
 			, ProductCategory__c 
 			from Product2 where Id =:lostProduct];
 		} catch (Exception e) {
-			return e.getMessage();
+			return e.getDmlMessage(0);
 		}
 		return JSON.serialize(prd);
 	}
@@ -799,7 +764,7 @@
 			Approval.ProcessResult result = Approval.process(req);
 			return null; 
 		} catch (Exception e) {
-			return e.getMessage();
+			return e.getDmlMessage(0);
 		}
         
     }
@@ -811,7 +776,7 @@
         	ApprovalHistoryUtil.reassignStep(workItemList, newActorId);
 			return null;
 		} catch (Exception e) {
-			return e.getMessage();
+			return e.getDmlMessage(0);
 		}
         
     }
diff --git a/force-app/main/default/classes/lexPCLLostReportLwcControllerTest.cls b/force-app/main/default/classes/lexPCLLostReportLwcControllerTest.cls
index 94f7ea4..11b6d45 100644
--- a/force-app/main/default/classes/lexPCLLostReportLwcControllerTest.cls
+++ b/force-app/main/default/classes/lexPCLLostReportLwcControllerTest.cls
@@ -26,14 +26,43 @@
         lexPCLLostReportLwcController.searchBatchIfForProduct('');
         lexPCLLostReportLwcController.getNewLostBrand(0);
         lexPCLLostReportLwcController.getNewLostProduct(0);
-        
         Test.stopTest();
     }
     static testMethod void testSave(){
+		List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+        if (rectCo.size() == 0) {
+            return;
+        }
+        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+        insert myAccount2;
         // Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟'];
+        Account depart1 = [select Id from Account limit 1];
+        LostReport conTest2 = new LostReport();
+        conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
+		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
+		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
+		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
+		conTest2.LostBrands[0].lostBrand.Agency__c = myAccount2.Id;
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company__c = '鍏朵粬';
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company_Mannual__c = 'dddddd';
+		conTest2.LostBrands[0].LostProducts[0].lineNo2 = 0;
+		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
+
+        Test.startTest();
+        Map<String,String> maps =  lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+		lexPCLLostReportLwcController.searchProduct(conTest2.LostBrands[0].LostProducts[0].LostProductss.Id);
+		System.debug('chenjingwu=>'+ maps.get('error'));
+
+        Test.stopTest();
+    }
+
+	static testMethod void testSubmit(){
+        Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟' limit 1];
         Account depart1 = [select Id from Account where RecordTypeId = '01210000000QemG' limit 1];
         LostReport conTest2 = new LostReport();
         conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
 		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
 		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
 		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
@@ -44,7 +73,119 @@
 		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
 
         Test.startTest();
-        lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+        lexPCLLostReportLwcController.submit('鑽夋',false,report.Id);
+        Test.stopTest();
+    }
+
+	static testMethod void TestSubmitForApproval2(){
+		List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+        if (rectCo.size() == 0) {
+            return;
+        }
+        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+        insert myAccount2;
+        // Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟'];
+        Account depart1 = [select Id from Account limit 1];
+        LostReport conTest2 = new LostReport();
+        conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
+		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
+		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
+		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
+		conTest2.LostBrands[0].lostBrand.Agency__c = myAccount2.Id;
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company__c = '鍏朵粬';
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company_Mannual__c = 'dddddd';
+		conTest2.LostBrands[0].LostProducts[0].lineNo2 = 0;
+		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
+
+        Test.startTest();
+        Map<String,String> maps =  lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+		lexPCLLostReportLwcController.submit('鑽夋',false,conTest2.lostReport.Id);
+		lexPCLLostReportLwcController.submitForApproval(conTest2.lostReport.Id,'','Approve');
+		lexPCLLostReportLwcController.submitForApproval(conTest2.lostReport.Id,'','Removed');
+        Test.stopTest();
+    }
+	static testMethod void TestSubmitForApproval1(){
+		List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+        if (rectCo.size() == 0) {
+            return;
+        }
+        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+        insert myAccount2;
+        // Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟'];
+        Account depart1 = [select Id from Account limit 1];
+        LostReport conTest2 = new LostReport();
+        conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
+		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
+		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
+		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
+		conTest2.LostBrands[0].lostBrand.Agency__c = myAccount2.Id;
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company__c = '鍏朵粬';
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company_Mannual__c = 'dddddd';
+		conTest2.LostBrands[0].LostProducts[0].lineNo2 = 0;
+		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
+
+        Test.startTest();
+        Map<String,String> maps =  lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+		lexPCLLostReportLwcController.submit('鑽夋',false,conTest2.lostReport.Id);
+		lexPCLLostReportLwcController.submitForApproval(conTest2.lostReport.Id,'','Reject');
+        Test.stopTest();
+    }
+
+	static testMethod void TestSubmitForApproval3(){
+		List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+        if (rectCo.size() == 0) {
+            return;
+        }
+        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+        insert myAccount2;
+        // Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟'];
+        Account depart1 = [select Id from Account limit 1];
+        LostReport conTest2 = new LostReport();
+        conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
+		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
+		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
+		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
+		conTest2.LostBrands[0].lostBrand.Agency__c = myAccount2.Id;
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company__c = '鍏朵粬';
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company_Mannual__c = 'dddddd';
+		conTest2.LostBrands[0].LostProducts[0].lineNo2 = 0;
+		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
+
+        Test.startTest();
+        Map<String,String> maps =  lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+		lexPCLLostReportLwcController.submit('鑽夋',false,conTest2.lostReport.Id);
+		lexPCLLostReportLwcController.reassignStep(conTest2.lostReport.Id,UserInfo.getUserId());
+        Test.stopTest();
+    }
+
+	static testMethod void TestSubmitForApproval4(){
+		List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+        if (rectCo.size() == 0) {
+            return;
+        }
+        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+        insert myAccount2;
+        // Lost_cancel_report__c report = [select Id from Lost_cancel_report__c where LostType__c = '澶卞崟'];
+        Account depart1 = [select Id from Account limit 1];
+        LostReport conTest2 = new LostReport();
+        conTest2.lostReport.LostType__c = '澶卞崟';
+		conTest2.lostReport.Opportunity__c = [select Id from Opportunity limit 1].Id;
+		conTest2.LostBrands[0].lostBrand.LostPrice__c = 12;
+		conTest2.LostBrands[0].lostBrand.Lost_reason_main__c = '浠锋牸';
+		conTest2.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =3;
+		conTest2.LostBrands[0].lostBrand.Agency__c = myAccount2.Id;
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company__c = '鍏朵粬';
+		conTest2.LostBrands[0].lostBrand.Lost_By_Company_Mannual__c = 'dddddd';
+		conTest2.LostBrands[0].LostProducts[0].lineNo2 = 0;
+		conTest2.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 3);
+
+        Test.startTest();
+        Map<String,String> maps =  lexPCLLostReportLwcController.dataEntry(JSON.serialize(conTest2),new List<Id>(),new List<Id>());
+		lexPCLLostReportLwcController.submit('鑽夋',false,conTest2.lostReport.Id);
+		lexPCLLostReportLwcController.init('','' + conTest2.lostReport.Id,'View','','');
         Test.stopTest();
     }
 
diff --git a/force-app/main/default/classes/lexSolutionProgrammeController.cls b/force-app/main/default/classes/lexSolutionProgrammeController.cls
index e91ccc2..5350281 100644
--- a/force-app/main/default/classes/lexSolutionProgrammeController.cls
+++ b/force-app/main/default/classes/lexSolutionProgrammeController.cls
@@ -36,14 +36,7 @@
             update so;
             return '';
         } catch (Exception e) {
-            if(e.getMessage().contains(':')){
-                String eMsg = e.getMessage();
-                Integer left = eMsg.indexOf(',')+1;
-                Integer right = eMsg.lastindexOf('銆�')+1;
-                return eMsg.substring(left,right);
-            }else{
-                return e.getMessage();
-            }
+            return e.getDmlMessage(0);
         }
     }
     //鎻愪氦瀹℃壒
@@ -58,14 +51,7 @@
         }
         catch (Exception e) {
             Database.rollback(sp);
-            if(e.getMessage().contains(':')){
-                String eMsg = e.getMessage();
-                Integer left = eMsg.indexOf(',')+1;
-                Integer right = eMsg.lastindexOf('銆�')+1;
-                return eMsg.substring(left,right);
-            }else{
-                return e.getMessage();
-            }
+            return e.getDmlMessage(0);
         }
     }
     public class InitData{
diff --git a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
index 63ca106..265a9ab 100644
--- a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
+++ b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -22,7 +22,7 @@
             res.userName = [select Name from User where Id =: res.userId].Name;
             maps.put('res', res);
         } catch (Exception e) {
-            String message = e.getMessage();
+            String message = e.getDmlMessage(0);
             maps.put('error', message);
             return maps;
         }
@@ -76,14 +76,7 @@
             update so;
             return '';
         } catch (Exception e) {
-            if (e.getMessage().contains(':')) {
-                String eMessage = e.getMessage();
-                Integer left = eMessage.indexOf(',') + 1;
-                Integer right = eMessage.lastIndexOf('銆�') + 1;
-                return eMessage.substring(left,right);
-            }else {
-                return e.getMessage();   
-            }
+            return e.getDmlMessage(0);
         }
     }
     @AuraEnabled
@@ -95,14 +88,7 @@
             update so;
             return '';
         } catch (Exception e) {
-            if (e.getMessage().contains(',')) {
-                String eMessage = e.getMessage();
-                Integer left = eMessage.indexOf(',');
-                Integer right = eMessage.length();
-                return eMessage.substring(left + 1,right);
-            }else {
-                return e.getMessage();   
-            }  
+            return e.getDmlMessage(0);
         }
     }
 
diff --git a/force-app/main/default/lwc/activeContent/activeContent.css b/force-app/main/default/lwc/activeContent/activeContent.css
new file mode 100644
index 0000000..218c07e
--- /dev/null
+++ b/force-app/main/default/lwc/activeContent/activeContent.css
@@ -0,0 +1,76 @@
+.activityTable1 {
+    background-color: #E6E6FA;
+    border-collapse: separate;
+    border-spacing: 0 5px; /* 璋冩暣绗簩涓�兼潵鎺у埗琛屼箣闂寸殑闂撮殧澶у皬 */
+}
+.activityTable1 th {
+    font-weight: bold;
+    text-align: right;
+    vertical-align: middle;
+}
+.activityTable2 {
+    background-color: rgb(220, 220, 220);
+    border-collapse: separate;
+    border-spacing: 0 5px; /* 璋冩暣绗簩涓�兼潵鎺у埗琛屼箣闂寸殑闂撮殧澶у皬 */
+}
+.activityTable2 th {
+    font-weight: bold;
+    text-align: right;
+    vertical-align: middle;
+}
+.activityTable3 {
+    background-color: rgb(199, 255, 183);
+    border-collapse: separate;
+    border-spacing: 0 5px; /* 璋冩暣绗簩涓�兼潵鎺у埗琛屼箣闂寸殑闂撮殧澶у皬 */
+}
+.activityTable3 th {
+    font-weight: bold;
+    text-align: right;
+    vertical-align: middle;
+}
+.activityTable4 {
+    /* width: 90%; */
+    background-color: rgb(199, 255, 183);
+    border-collapse: separate;
+    border-spacing: 0 5px; /* 璋冩暣绗簩涓�兼潵鎺у埗琛屼箣闂寸殑闂撮殧澶у皬 */
+}
+.activityTable4 th {
+    font-weight: bold;
+    text-align: right;
+    vertical-align: middle;
+}
+.centered-text {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.centerRight-text {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+}
+.required-symbol {
+    color: red;
+    font-size: 12px;
+    font-weight: bold;
+    display: inline-block;
+    width: 7px;
+    /* margin-right: 4px; */
+}
+/* :host::shadow lightning-input input {
+    padding-left: 12px;
+    padding-right: 12px;
+} */
+.container {
+    position: relative;
+}
+
+.mask {
+    position: absolute;
+    background-color: rgba(0, 0, 0, 0.5);
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 9999;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/activeContent/activeContent.html b/force-app/main/default/lwc/activeContent/activeContent.html
new file mode 100644
index 0000000..5acaf77
--- /dev/null
+++ b/force-app/main/default/lwc/activeContent/activeContent.html
@@ -0,0 +1,657 @@
+<template>
+    <div class="container">
+        <!-- <template if:true={showSpinner}>
+            <div class="overlay">
+                <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
+            </div>
+        </template> -->
+        <slot name="content">
+            <lightning-record-edit-form object-api-name="Event__c">
+                <lightning-layout>
+                    <lightning-layout-item size="3" padding="around-small" >
+                        <lightning-button label="淇濆瓨" onclick={saveTheActivity} disabled={saveDis}></lightning-button>
+                    </lightning-layout-item>
+                    <lightning-layout-item size="9" padding="around-small" >
+                        <div style="background-color: red;color:white">
+                            <template if:true={timeValid}>{timeValid}<br/></template>
+                            <template if:true={eventMessage}>{eventMessage}<br/></template>
+                            <template if:true={etAPPerrorMsg}>{etAPPerrorMsg}<br/></template>
+                        </div>
+                    </lightning-layout-item>
+                </lightning-layout>
+                <div style="width: 100%;padding-left: 10px;padding-top: 10px;">
+                    <table class="activityTable1">
+                        <thead>
+                            <tr>
+                                <th width="10%"></th>
+                                <th width="13%"></th>
+                                <th width="13%"></th>
+                                <th width="13%"></th>
+                                <th width="13%"></th>
+                                <th width="12%"></th>
+                                <th width="13%"></th>
+                                <th width="13%"></th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <th colspan="1">宸ヤ綔鏃堕棿<div class="required-symbol">*</div>&nbsp;</th>
+                                <td colspan="2">
+                                    <div style="width: 100%;">
+                                        <lightning-layout>
+                                            <lightning-layout-item size="2">
+                                                <lightning-input style="text-align: center;" disabled={beforeHourDis} required="true" name="beforeHour" value={beforeHour} type="number" maxlength="2" variant="label-hidden" onchange={beforeHourChange}></lightning-input>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1" class="centered-text">&nbsp;<b>:</b>&nbsp;</lightning-layout-item>
+                                            <template lwc:if={isNotSalesService}>
+                                                <lightning-layout-item size="2"><lightning-input disabled={beforeMinuteDis}  name="beforeMinute" value={beforeMinute} type="number" maxlength="2" variant="label-hidden" onchange={beforeMinuteChange}></lightning-input></lightning-layout-item>
+                                            </template>
+                                            <template lwc:else>
+                                                <lightning-layout-item size="2"><lightning-input disabled={beforeMinuteDis} required="true" name="beforeMinute" value={beforeMinute} type="number" maxlength="2" variant="label-hidden" onchange={beforeMinuteChange}></lightning-input></lightning-layout-item>
+                                            </template>
+                                            
+                                            <lightning-layout-item size="1" class="centered-text">&nbsp;<b>~</b>&nbsp;</lightning-layout-item>
+                                            <lightning-layout-item size="2"><lightning-input disabled={afterHourDis} required="true" name="afterHour" value={afterHour} type="number" variant="label-hidden" maxlength="2" onchange={afterHourChange}></lightning-input></lightning-layout-item>
+                                            <lightning-layout-item size="1" class="centered-text">&nbsp;<b>:</b>&nbsp;</lightning-layout-item>
+                                           
+                                            <template lwc:if={isNotSalesService}>
+                                                 <lightning-layout-item size="2"><lightning-input disabled={afterMinuteDis}  name="afterMinute" value={afterMinute} type="number" variant="label-hidden" onchange={afterMinuteChange}></lightning-input></lightning-layout-item>
+                                            </template>
+                                            <template lwc:else>
+                                                 <lightning-layout-item size="2"><lightning-input disabled={afterMinuteDis} required="true" name="afterMinute" value={afterMinute} type="number" variant="label-hidden" onchange={afterMinuteChange}></lightning-input></lightning-layout-item>
+                                            </template>
+                                        </lightning-layout>
+                                    </div>
+                                </td>
+                                <td colspan="1">
+                                    <div style="width:100%;display: flex;align-items: center;">
+                                        <span style="font-weight: bold;text-align: right;vertical-align: middle;width:79px;">
+                                                鎷滆鍖哄垎<div class="required-symbol">*</div>&nbsp;
+                                        </span>
+                                        <span style="width: 153px;">
+                                            <lightning-input-field disabled={visitDis} onchange={visitChange}  required="true" field-name="Activity_Type2__c" value={activityObj.Activity_Type2__c} variant="label-hidden"></lightning-input-field>
+                                            <!--  <lightning-input-field disabled={visitDis} onchange={visitChange}  required="true" field-name="Activity_Type2__c" value={activityObj.Activity_Type2__c} variant="label-hidden"></lightning-input-field> -->
+
+                                                <p style="color: rgb(255, 0, 0);">{visitValidMes}</p>
+                                        </span>
+                                        <span style="font-weight: bold;text-align: right;vertical-align: middle;width:79px;">
+                                            璁块棶鍦烘墍&nbsp;&nbsp;&nbsp;
+                                        </span>
+                                    </div>
+                                </td>
+                                <td colspan="8">
+                                        <c-other-look-up disabled={isAccDis} unique-key="AccountID" value-id={activityObj.whatid__c} obj-name={visitorPalceObjName}  
+                                         icon-name="standard:account" search-label="" onvalueselect={handleAccSelection} fields={visitorPalceFields}></c-other-look-up>
+                                    <!-- <template lwc:if={isAccessAcc}> -->
+                                        <!-- <lightning-input-field field-name="Account_ID__c" disabled={isAccDis} value={activityObj.Account_ID__c} onchange={changeAccId} variant="label-hidden" ></lightning-input-field> -->
+<!--                                     </template>
+ -->                                    <!--  <template lwc:else>
+                                       <c-other-look-up disabled={isAccDis} unique-key="AccountID" value-id={filter} obj-name={visitorPalceObjName}
+                                        icon-name="standard:account" search-label="" onvalueselect={handleAccSelection} fields={visitorPalceFields}></c-other-look-up>
+                                    </template> -->
+                                   <!--  <template lwc:else>
+                                        <lightning-input-field field-name="Campaign_ID__c" disabled={isAccDis} value={activityObj.Campaign_ID__c} onchange={changeCampaignId} variant="label-hidden" ></lightning-input-field>
+                                    </template> -->
+                                    <p style="color: rgb(255, 0, 0);">{requiredLocation}</p>
+                                </td>
+                            </tr>
+                            <tr>
+                                <th>璁块棶瀵硅薄<div class="required-symbol">*</div>&nbsp;</th>
+                                <td colspan="5">
+                                    <lightning-layout>
+                                        <lightning-layout-item size="3">
+                                            <c-look-up-util disabled={isConDis1} onnewrecord={handleNewRecord} pass-filter={filter} unique-key="AgencyContact1" value-id={activityObj.Visitor1_ID__c} agency-contact-name={agencyContactName} obj-name={objectName} icon-name="standard:account" static-resource-contact = {staticResourceContact} search-label="" onvalueselect={handleSelection} fields={fields}></c-look-up-util>
+                                            <p style="color: rgb(255, 0, 0);">{requiredVisitor}</p>
+                                        </lightning-layout-item>
+                                        <lightning-layout-item size="1"></lightning-layout-item>
+                                        <lightning-layout-item size="3">
+                                            <c-look-up-util disabled={isConDis2} onnewrecord={handleNewRecord} pass-filter={filter}  unique-key="AgencyContact2" value-id={activityObj.Visitor2_ID__c} obj-name={objectName} icon-name="standard:account" search-label="" onvalueselect={handleSelection} fields={fields}></c-look-up-util>
+                                        </lightning-layout-item>
+                                        <lightning-layout-item size="1"></lightning-layout-item>
+                                        <lightning-layout-item size="3">
+                                            <c-look-up-util disabled={isConDis3} onnewrecord={handleNewRecord} pass-filter={filter}  unique-key="AgencyContact3" value-id={activityObj.Visitor3_ID__c} obj-name={objectName} icon-name="standard:account" search-label="" onvalueselect={handleSelection} fields={fields}></c-look-up-util>
+                                        </lightning-layout-item>
+                                    </lightning-layout>
+                                </td>
+                                <td colspan="2">
+                                    <lightning-layout>
+                                        <lightning-layout-item size="3" class="centerRight-text">
+                                            <span style="font-weight: bold;">
+                                                鎷滆鐩殑<div class="required-symbol">*</div>&nbsp;
+                                            </span>
+                                        </lightning-layout-item>
+                                        <lightning-layout-item size="9">
+                                            <template lwc:if={isNotSalesService}>
+                                                <lightning-input-field disabled={visitAimDis} required="true" onchange={visitAimChange} field-name="Activity_PurposeEscFSE__c" value={activityObj.Activity_PurposeEscFSE__c} variant="label-hidden"></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredvisitAim}</p>
+                                            </template>
+                                            <template lwc:else>
+                                                <lightning-input-field disabled={visitAimDis} required="true" onchange={visitAimChange} field-name="Activity_PurposeFSE__c" value={activityObj.Activity_PurposeFSE__c} variant="label-hidden"></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredvisitAim}</p>
+                                            </template>
+                                        </lightning-layout-item>
+                                    </lightning-layout>
+                                </td>
+                            </tr>
+                            <tr>
+                                <th>娲诲姩鍖哄垎<div class="required-symbol">*</div>&nbsp;</th>
+                                <td colspan="5">
+                                    <template lwc:if={isNotSalesService}>
+                                        <lightning-layout>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeEscFSEDis} data-key='requiredPurposeType'  field-name="Purpose_TypeEscFSE__c" value={activityObj.Purpose_TypeEscFSE__c} onchange={purposeType1Change} variant="label-hidden" ></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredPurposeType}</p>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeEscFSE2Dis} field-name="Purpose_TypeEscFSE2__c" value={activityObj.Purpose_TypeEscFSE2__c} onchange={purposeType2Change} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeEscFSE3Dis} field-name="Purpose_TypeEscFSE3__c" value={activityObj.Purpose_TypeEscFSE3__c} onchange={purposeType3Change} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </template>
+                                    <template lwc:else>
+                                        <lightning-layout>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeFSEDis} data-key='requiredPurposeType'  onchange={purposeType1Change} required="true" field-name="Purpose_TypeFSE__c" value={activityObj.Purpose_TypeFSE__c} variant="label-hidden" ></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredPurposeType}</p>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeFSE2Dis} onchange={purposeType2Change} field-name="Purpose_TypeFSE2__c" value={activityObj.Purpose_TypeFSE2__c} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-input-field disabled={Purpose_TypeFSE3Dis} onchange={purposeType3Change} field-name="Purpose_TypeFSE3__c" value={activityObj.Purpose_TypeFSE3__c} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </template>
+                                </td>
+                                <template lwc:if={isNotSalesService}>
+                                    <td>
+                                        <lightning-layout>
+                                            <lightning-layout-item size="6" class="centerRight-text">
+                                                <span style="font-weight: bold;">
+                                                    OPD璁″垝&nbsp;&nbsp;&nbsp;
+                                                </span>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="6">
+                                                <lightning-input-field field-name="OPDPlan_Flag__c" value={activityObj.OPDPlan_Flag__c} onchange={fieldChange} variant="label-hidden" disabled="true"></lightning-input-field>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </td>
+                                </template>
+                                <td>&nbsp;</td>
+                            </tr>
+                            <template lwc:if={isNotSalesService}>
+                                <tr>
+                                    <th>鍩哄缓椤圭洰&nbsp;&nbsp;&nbsp;</th>
+                                    <td colspan="5">
+                                        <lightning-layout>
+                                            <lightning-layout-item size="3">
+                                                <c-other-look-up disabled={isInfrastructureProjectDis1} unique-key="Infrastructure_Project1" value-id={Infrastructure_Project1} 
+                                                obj-name='InfrastructureProject'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleInfrastructureProject1Selection} fields={infrastructureProjectFields}></c-other-look-up>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <c-other-look-up disabled={isInfrastructureProjectDis2} unique-key="Infrastructure_Project2" value-id={Infrastructure_Project2} 
+                                                obj-name='InfrastructureProject'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleInfrastructureProject2Selection} fields={infrastructureProjectFields}></c-other-look-up>
+                                             
+                                            </lightning-layout-item>
+                                            
+                                        </lightning-layout>
+                                    </td>
+                                    <th colspan="2">&nbsp;</th>
+                                </tr>
+                                <tr>
+                                    <th>娑夊強鐨勮浠�&nbsp;&nbsp;&nbsp;</th>
+                                    <td colspan="5">
+                                        <lightning-layout>
+                                            <lightning-layout-item size="3">
+                                                <!-- <lightning-input-field disabled={isOppDis1} field-name="Related_Opportunity1_ID__c" value={activityObj.Related_Opportunity1_ID__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field> -->
+                                                <c-other-look-up disabled={isOppDis1} unique-key="Related_Opportunity1_ID" value-id={Related_Opportunity1_ID} 
+                                                obj-name='Opportunity'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleOppertunity1Selection} fields={opportunityFields}></c-other-look-up>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <c-other-look-up disabled={isOppDis2} unique-key="Related_Opportunity2_ID" value-id={Related_Opportunity2_ID} 
+                                                obj-name='Opportunity'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleOppertunity2Selection} fields={opportunityFields}></c-other-look-up>
+                                               <!--  <lightning-input-field disabled={isOppDis2} field-name="Related_Opportunity2_ID__c" value={activityObj.Related_Opportunity2_ID__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field> -->
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                 <c-other-look-up disabled={isOppDis3} unique-key="Related_Opportunity3_ID" value-id={Related_Opportunity3_ID} 
+                                                obj-name='Opportunity'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleOppertunity3Selection} fields={opportunityFields}></c-other-look-up>
+                                               <!--  <lightning-input-field disabled={isOppDis3} field-name="Related_Opportunity3_ID__c" value={activityObj.Related_Opportunity3_ID__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field> -->
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </td>
+                                    <th colspan="2">&nbsp;</th>
+                                </tr>
+                                <tr>
+                                    <th>&nbsp;</th>
+                                    <td colspan="5">
+                                        <lightning-layout>
+                                            <lightning-layout-item size="3">
+                                                <lightning-button-group style="padding-right: 7px;">
+                                                    <lightning-button disabled={isOppUpdateDis1} label="璇环鏇存柊" name='1' onclick={oppUpdate}></lightning-button>
+                                                    <lightning-button disabled={isLoseDis1} label="澶卞崟" name='1' onclick={loseOpp}></lightning-button>
+                                                </lightning-button-group>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-button-group style="padding-right: 7px;">
+                                                    <lightning-button disabled={isOppUpdateDis2} label="璇环鏇存柊" name='2' onclick={oppUpdate}></lightning-button>
+                                                    <lightning-button disabled={isLoseDis2} label="澶卞崟" name='1' onclick={loseOpp}></lightning-button>
+                                                </lightning-button-group>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="1"></lightning-layout-item>
+                                            <lightning-layout-item size="3">
+                                                <lightning-button-group style="padding-right: 7px;">
+                                                    <lightning-button disabled={isOppUpdateDis3} label="璇环鏇存柊" name='3' onclick={oppUpdate}></lightning-button>
+                                                    <lightning-button disabled={isLoseDis3} label="澶卞崟" name='1' onclick={loseOpp}></lightning-button>
+                                                </lightning-button-group>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </td>
+                                    <td colspan="2"></td>
+                                </tr>
+                                
+                            </template>
+                            <template lwc:else>
+                                <tr>
+                                    <th > 
+                                        <div style="width:100%;display: flex;align-items: center;">
+                                            <span style='width: 100%;'>娑夊強鐨勭淮淇悎鍚�&nbsp;&nbsp;</span>
+                                        </div>
+                                    </th>
+                                     <td colspan="10">
+                                        <lightning-layout>
+                                            <lightning-layout-item size="4">
+                                                <c-other-look-up disabled={isRelatedServiceDis} unique-key="Related_Service1_ID" value-id={Related_Service1_ID} 
+                                                obj-name='MaintenanceContract'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleMCSelection} fields={mcFields}></c-other-look-up>
+                                                <p style="color: rgb(255, 0, 0);">{requiredRelatedService}</p>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="2">
+                                                <div style='width: 100%;font-weight: bold;text-align: right;height: 32px;line-height:32px;'>鍚堝悓鎶ュ憡涔﹀彂鏀句汉&nbsp;&nbsp;</div>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="2">
+                                                 <lightning-input-field disabled={isReportContractDis} data-key='requiredReportContract' field-name="Report_Contract__c" value={activityObj.Report_Contract__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                                 <p style="color: rgb(255, 0, 0);">{requiredInfo.requiredReportContract}</p>
+                                            </lightning-layout-item>
+                                             <lightning-layout-item size="2">
+                                                <div style="font-weight: bold;text-align: right;vertical-align: middle;height: 32px;line-height:32px;">鍚堝悓鎶ュ憡涔﹀彂鏀炬柟寮�&nbsp;&nbsp;</div>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="2">
+                                                <lightning-input-field disabled={isReportContractTypeDis} data-key='requiredReportContractType' field-name="Report_Contract_Type__c" value={activityObj.Report_Contract_Type__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredInfo.requiredReportContractType}</p>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </td>
+                                   
+                                   
+                                    
+                                   <!--  
+                                     <th > <div style="width:100%;display: flex;align-items: center;"><span style='width: 100%;'>娑夊強鐨勭淮淇悎鍚�&nbsp;&nbsp;</span></div></th>
+                                   <td colspan="10">
+                                        <div style="width:100%;display: flex;align-items: center;">
+                                            <span style='width: 420px;'>
+                                               
+                                                 <c-other-look-up disabled={isRelatedServiceDis} unique-key="Related_Service1_ID" value-id={Related_Service1_ID} 
+                                                obj-name='MaintenanceContract'  visit-place-id={filter} 
+                                                icon-name="standard:account" search-label="" onvalueselect={handleMCSelection} fields={mcFields}></c-other-look-up>
+                                                <p style="color: rgb(255, 0, 0);">{requiredRelatedService}</p>
+                                            </span>
+                                            <span style="font-weight: bold;text-align: right;vertical-align: middle;">鍚堝悓鎶ュ憡涔﹀彂鏀句汉&nbsp;&nbsp;</span>
+                                            <span style='width:205px;'>
+                                                <lightning-input-field disabled={isReportContractDis} data-key='requiredReportContract' field-name="Report_Contract__c" value={activityObj.Report_Contract__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredInfo.requiredReportContract}</p>
+                                            </span>
+                                            <span style="font-weight: bold;text-align: right;vertical-align: middle;width:130px;">鍚堝悓鎶ュ憡涔﹀彂鏀炬柟寮�&nbsp;&nbsp;</span>
+                                            <span style='width:205px;'>
+                                             <lightning-input-field disabled={isReportContractTypeDis} data-key='requiredReportContractType' field-name="Report_Contract_Type__c" value={activityObj.Report_Contract_Type__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                                <p style="color: rgb(255, 0, 0);">{requiredInfo.requiredReportContractType}</p>
+                                            </span>
+                                        </div>
+                                    </td>    -->                                 
+                                </tr>
+                                <!-- <tr>
+                                    <th>&nbsp;&nbsp;&nbsp;</th>
+                                    <td>
+                                        <lightning-layout>
+                                            <lightning-layout-item size="2" class="centerRight-text">
+                                                <lightning-input-field disabled={isUseReportDis} field-name="UseReport__c" value={activityObj.UseReport__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="10" class="centerRight-text">
+                                                <lightning-button style="padding-left: 20px;" label="淇℃伅鏇存柊" disabled={isInfoUpdateDis} onclick={slaInfoPage}></lightning-button>
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </td>
+                                    <td></td>
+                                    <td colspan="5"></td>
+                                </tr> -->
+                            </template>
+                        </tbody>
+                    </table>
+                    <table class="activityTable1">
+                        <thead>
+                            <tr>
+                                <th width="10%"></th>
+                                <th width="12%"></th>
+                                <th width="12%"></th>
+                                <th width="12%"></th>
+                                <th width="12%"></th>
+                                <th width="12%"></th>
+                                <th width="11%"></th>
+                                <th width="12%"></th>
+                                <th width="2%"></th>
+                                <th width="4%"></th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <td></td>
+                                <template lwc:if={isNotSalesService}>
+                                    <td colspan="9">
+                                        <div style="width:100%;display: flex">
+                                            
+                                            <template lwc:if={updateAccInfoColor}>
+                                                <span style="padding-right: 15px;">
+                                            <lightning-button variant="destructive-text" disabled={isupdateAccInfoDis} label="鏇存柊瀹㈡埛淇℃伅" onclick={updateAccInfo}></lightning-button>
+                                                </span>
+                                            </template>
+                                            <template lwc:else>
+                                                 <span style="padding-right: 15px;">
+                                                    <lightning-button disabled={isupdateAccInfoDis} label="鏇存柊瀹㈡埛淇℃伅" onclick={updateAccInfo}></lightning-button>
+                                                </span>
+                                            </template>
+                                            <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isNewBuyDis} label="鏂板缓璐拱鎰忓悜" onclick={addLeadNew}></lightning-button>
+                                            </span>
+                                            <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isNewOpdDis} label="鏂板缓OPD璁″垝"  onclick={newOPDPlan}></lightning-button>
+                                            </span>
+                                            <template lwc:if={activityObj.SIS_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isOPDSISDis} label="OPD" variant="destructive-text" onclick={OPD}></lightning-button >
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isOPDSISDis} label="OPD" onclick={OPD}></lightning-button>
+                                                  </span>
+                                            </template>
+                                           <!--  <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isOPDSISDis} label="OPD" onclick={OPD}></lightning-button>
+                                            </span> -->
+                                            <template lwc:if={activityObj.SIS_ET_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isOPDSISDis} label="SIS_ET" onclick={SISET} variant="destructive-text" ></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                               <lightning-button disabled={isOPDSISDis} label="SIS_ET" onclick={SISET}></lightning-button>
+                                                  </span>
+                                            </template>
+
+                                            <!-- <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isOPDSISDis} label="SIS_ET" onclick={SISET}></lightning-button>
+                                            </span> -->
+                                            <template lwc:if={activityObj.SIS_ENG_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isOPDSISDis} label="SIS_ENG" onclick={SISENG} variant="destructive-text"></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                               <lightning-button disabled={isOPDSISDis} label="SIS_ENG" onclick={SISENG}></lightning-button>
+                                                  </span>
+                                            </template>
+                                           <!--  <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isOPDSISDis} label="SIS_ENG" onclick={SISENG}></lightning-button>
+                                            </span> -->
+                                            <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isTransferEtDis} label="杞嚦ET APP" onclick={toETAPP}></lightning-button>
+                                            </span>
+                                            <span style="padding-right: 15px;">
+                                                <lightning-button disabled={isActivityEtDis} label="ET APP娲诲姩" onclick={ETAPPAct}></lightning-button>
+                                            </span>
+                                        </div>
+                                    </td>
+                                </template>
+                                <template lwc:else>
+                                    <td colspan="9">
+                                        <div style="width:100%;display: flex">
+                                            <template lwc:if={updateAccInfoColor}>
+                                                <span style="padding-right: 25px;">
+                                            <lightning-button variant="destructive-text" disabled={isupdateAccInfoDis} label="鏇存柊瀹㈡埛淇℃伅" onclick={updateAccInfo}></lightning-button>
+                                                </span>
+                                            </template>
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                    <lightning-button disabled={isupdateAccInfoDis} label="鏇存柊瀹㈡埛淇℃伅" onclick={updateAccInfo}></lightning-button>
+                                                </span>
+                                            </template>
+                                           <!--  <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNewOpdDis} label="鏂板缓OPD璁″垝" onclick={newOPDPlan}></lightning-button>
+                                            </span> -->
+                                            <template lwc:if={activityObj.InsReport_ID__c}>
+                                            <span style="padding-right: 25px;">
+                                                    <lightning-button disabled={isCheckReportDis} label="涓�鑸偣妫�鎶ュ憡涔�" onclick={checkReport} variant="destructive-text"></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isCheckReportDis} label="涓�鑸偣妫�鎶ュ憡涔�" onclick={checkReport} ></lightning-button>
+                                                  </span>
+                                            </template>
+                                            <template lwc:if={activityObj.NewInstallTarin_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鏂板搧瑁呮満鍩硅鎶ュ憡涔�"  onclick={NewInstallTarin} variant="destructive-text"></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isNTCCDSDis} label="鏂板搧瑁呮満鍩硅鎶ュ憡涔�"  onclick={NewInstallTarin}></lightning-button>
+                                                  </span>
+                                            </template>
+                                           <!--  <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鏂板搧瑁呮満鍩硅鎶ュ憡涔�"  onclick={NewInstallTarin}></lightning-button>
+                                            </span> -->
+                                            <template lwc:if={activityObj.FaultPreventionTraining_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鏁呴殰棰勯槻鍩硅鎶ュ憡涔�"  onclick={FaultPreventionTraining} variant="destructive-text"></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isNTCCDSDis} label="鏁呴殰棰勯槻鍩硅鎶ュ憡涔�"  onclick={FaultPreventionTraining}></lightning-button>
+                                                  </span>
+                                            </template>
+                                           <!--  <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鏁呴殰棰勯槻鍩硅鎶ュ憡涔�"  onclick={FaultPreventionTraining}></lightning-button>
+                                            </span> -->
+                                            <template lwc:if={activityObj.OPD_FLAG__c}>
+                                            <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鍞悗鏈嶅姟璺熷彴鎶ュ憡涔�"  onclick={AftermarketHeel} variant="destructive-text"></lightning-button>
+                                            </span>
+                                            </template> 
+                                            <template lwc:else>
+                                                 <span style="padding-right: 25px;">
+                                                 <lightning-button disabled={isNTCCDSDis} label="鍞悗鏈嶅姟璺熷彴鎶ュ憡涔�"  onclick={AftermarketHeel}></lightning-button>
+                                                  </span>
+                                            </template>
+                                            <!-- <span style="padding-right: 25px;">
+                                                <lightning-button disabled={isNTCCDSDis} label="鍞悗鏈嶅姟璺熷彴鎶ュ憡涔�"  onclick={AftermarketHeel}></lightning-button>
+                                            </span> -->
+                                        </div>
+                                    </td>
+                                </template>
+                            </tr>
+                            <tr>
+                                <th>缁撴灉&nbsp;&nbsp;&nbsp;</th>
+                                <td colspan="6">
+                                    <lightning-input-field disabled={DescriptionDis} data-key='requiredDescription' field-name="Description__c" value={activityObj.Description__c} onchange={fieldChange} message-when-bad-input={customValidationMessage} variant="label-hidden" ></lightning-input-field>
+                                    <p style="color: rgb(255, 0, 0);display: none;">{requiredInfo.requiredDescription}</p>
+                                </td>
+                                <td colspan="3">
+                                    <template lwc:if={isNotSalesService}>
+                                        <lightning-layout>
+
+                                        </lightning-layout>
+                                    </template>
+                                    <template lwc:else>
+                                        <lightning-layout>
+                                            <lightning-layout-item size="2"></lightning-layout-item>
+                                            <lightning-layout-item size="1">
+                                                <lightning-input-field disabled={Find_Imitations_FlagDis} field-name="Find_Imitations_Flag__c" value={activityObj.Find_Imitations_Flag__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                            </lightning-layout-item>
+                                            <lightning-layout-item size="9">
+                                                鏄惁鍙戠幇绗笁鏂圭淮淇�&nbsp;
+                                            </lightning-layout-item>
+                                        </lightning-layout>
+                                    </template>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <!-- <div style="width: 100%;padding-left: 10px;padding-top: 10px;">
+                    <table class="activityTable3">
+                        <thead>
+                            <tr>
+                                <th width="10%"></th>
+                                <th width="5%"></th>
+                                <th width="10%"></th>
+                                <th width="5%"></th>
+                                <th width="15%"></th>
+                                <th width="55%"></th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <th>涓嬩竴姝ユ椿鍔ㄤ簣瀹�&nbsp;</th>
+                                <th>璁块棶鏃ユ湡&nbsp;</th>
+                                <td><lightning-input type="Date" variant="label-hidden"></lightning-input></td>
+                                <th>璁块棶鏃堕棿&nbsp;</th>
+                                <td>
+                                    <lightning-layout>
+                                        <lightning-layout-item size="2"><lightning-input variant="label-hidden"></lightning-input></lightning-layout-item>
+                                        <lightning-layout-item size="1" class="centered-text"><b>:</b></lightning-layout-item>
+                                        <lightning-layout-item size="2"><lightning-input variant="label-hidden"></lightning-input></lightning-layout-item>
+                                        <lightning-layout-item size="1" class="centered-text"><b>~</b></lightning-layout-item>
+                                        <lightning-layout-item size="2"><lightning-input variant="label-hidden"></lightning-input></lightning-layout-item>
+                                        <lightning-layout-item size="1" class="centered-text"><b>:</b></lightning-layout-item>
+                                        <lightning-layout-item size="2"><lightning-input variant="label-hidden"></lightning-input></lightning-layout-item>
+                                        <lightning-layout-item size="1"></lightning-layout-item>
+                                    </lightning-layout>
+                                </td>
+                            </tr>
+                            <tr>
+                                <th>&nbsp;</th>
+                                <th>鐩殑(璁″垝)&nbsp;</th>
+                                <td colspan="4"><lightning-input variant="label-hidden"></lightning-input></td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div> -->
+                <div style="width: 100%;padding-left: 10px;padding-top: 10px;padding-bottom: 10px;">
+                    <table class="activityTable4">
+                        <thead>
+                            <tr>
+                                <th width="10%"></th>
+                                <th width="19%"></th>
+                                <th width="7%"></th>
+                                <th width="15%"></th>
+                                <th width="18%"></th>
+                                <th width="9%"></th>
+                                <th width="12%"></th>
+                                <th width="8%"></th>
+                                <th width="2%"></th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <th>鎶ュ憡鐘舵�侊細</th>
+                                <td>{activityObj.eventStatus__c}</td>
+                                <th>鍙栨秷鐞嗙敱锛�&nbsp;</th>
+                                <td colspan="2">
+                                    <template lwc:if={isNotSalesService}>
+                                        <lightning-input-field disabled={cancelReasonSelectDis} field-name="cancelReasonSelect__c" value={activityObj.cancelReasonSelect__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                    </template>
+                                    <template lwc:else>
+                                        <lightning-input-field disabled={cancelReasonSelectFSEDis} field-name="cancelReasonSelectFSE__c" value={activityObj.cancelReasonSelectFSE__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                    </template>
+                                </td>
+                                <th>鍏朵粬锛�&nbsp;</th>
+                                <td>
+                                    <lightning-input-field disabled={cancelReasonOtherDis} field-name="cancelReasonOther__c" value={activityObj.cancelReasonOther__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                </td>
+                                <td><lightning-button disabled={cancelsaveJSDis} style="padding-left: 8px;" label="鍙栨秷" onclick={cancelsaveJS}></lightning-button></td>
+                                <td>&nbsp;</td>
+                            </tr>
+                            <tr>
+                                <th>寤舵湡鐞嗙敱锛�&nbsp;</th>
+                                <td class="td-width">
+                                    <template lwc:if={isNotSalesService}>
+                                        <lightning-input-field disabled={delayReasonSelectDis} field-name="delayReasonSelect__c" value={activityObj.delayReasonSelect__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                    </template>
+                                    <template lwc:else>
+                                        <lightning-input-field disabled={delayReasonSelectFSEDis} field-name="delayReasonSelectFSE__c" value={activityObj.delayReasonSelectFSE__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                    </template>
+                                </td>
+                                <th>鍏朵粬锛�&nbsp;</th>
+                                <td>
+                                    <lightning-input-field disabled={delayReasonOtherDis} field-name="delayReasonOther__c" value={activityObj.delayReasonOther__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                </td>
+                                <th>&nbsp;</th>
+                                <th>寤舵湡鏃ユ湡閫夋嫨锛�&nbsp;</th>
+                                <td>
+                                    <lightning-input-field disabled={delayToDateDis} field-name="delayToDate__c" value={activityObj.delayToDate__c} onchange={fieldChange} variant="label-hidden" ></lightning-input-field>
+                                </td>
+                                <td><lightning-button disabled={delaysaveJSDis} style="padding-left: 8px;" label="寤舵湡" onclick={delaysaveJS}></lightning-button></td>
+                                <td>&nbsp;</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </lightning-record-edit-form>
+        </slot>
+        <div class="mask" if:true={showSpinner}>
+            <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        </div>
+    </div>
+    <template if:true={showModal}>
+        <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
+            <div class="slds-modal__container">
+                <header class="slds-modal__header">
+                    <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeOPDSISDiv}>
+                        <lightning-icon icon-name="utility:close"
+                            alternative-text="close"
+                            variant="inverse"
+                            size="small" ></lightning-icon>
+                        <span class="slds-assistive-text">Close</span>
+                    </button>
+                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">璇烽�夋嫨鎶ヨ〃绫诲瀷</h2>
+                </header>
+                <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
+                    <lightning-radio-group name="radioGroup" options={options} value={tempRecordTypeName} type="radio" onchange={typeChange}></lightning-radio-group>
+                </div>
+                <footer class="slds-modal__footer">
+                    <button class="slds-button slds-button_brand" onclick={createOPDSISReport}>鐢熸垚鎶ヨ〃</button>
+                    <button class="slds-button slds-button_neutral" onclick={closeOPDSISDiv}>鍙栨秷</button>
+                </footer>
+            </div>
+        </section>
+        <div class="slds-backdrop slds-backdrop_open"></div>
+    </template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/activeContent/activeContent.js b/force-app/main/default/lwc/activeContent/activeContent.js
new file mode 100644
index 0000000..d0bd7d8
--- /dev/null
+++ b/force-app/main/default/lwc/activeContent/activeContent.js
@@ -0,0 +1,2780 @@
+import { LightningElement,track,api } from 'lwc';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import saveActivity from '@salesforce/apex/LwcDailyReportController.saveActivity';
+import queryDepartmentClass from '@salesforce/apex/LwcDailyReportController.queryDepartmentClass';
+import queryHospital from '@salesforce/apex/LwcDailyReportController.queryHospital';
+import addReportOPWithEvaluationPDF from '@salesforce/apex/LwcDailyReportController.addReportOPWithEvaluationPDF';
+import addReportNT from '@salesforce/apex/LwcDailyReportController.addReportNT';
+import queryAbountIndo from '@salesforce/apex/LwcDailyReportController.queryAbountIndo';
+import getContactAwsIdByCOntactId from '@salesforce/apex/LwcDailyReportController.getContactAwsIdByCOntactId';
+import { label } from 'c/labelUtility';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import ProfileId_2S1 from '@salesforce/label/c.ProfileId_2S1';
+import salesman2S1_Price from '@salesforce/label/c.salesman2S1_Price';
+import { AWSService } from 'c/piUtils';//deloitte-zhj 璋冪敤aws 2023/07/19 
+import { updateRecord } from 'lightning/uiRecordApi';
+import getPIPLInfo from '@salesforce/apex/LookUpUtilController.getPIPLInfo';//deloitte-zhj 鑾峰彇瑙e瘑淇℃伅 2023/07/19 
+import { refreshApex } from '@salesforce/apex';
+
+export default class ActiveContent extends NavigationMixin(LightningElement) {
+    AWSService;
+    @track customLabel = label;
+    @api theIndex;
+    @api reportedDate;
+    @api reportedId;
+    @api report;
+    @api reportOwner;
+    @api currentUserId;
+    @api cancelRequestFlg;
+    @api allDisableFlg;
+    @track timeValid;
+    @api isNotSalesService;
+    @api reportStatusFlg;
+    @api reportReportFlg;
+    @api shour ;
+    @api sminute ;
+    @api ehour ;
+    @api eminute ;
+    @track fields=['Contact.Name','Contact.AWS_Data_Id__c'];
+    @track AccountFields=['Account.Name'];
+    @track CampaignFields=['Campaign.Name'];
+    @track options=[];
+    @track filter = '';
+    @track objectName = 'Contact';
+    @track contactId1 = '';
+    @track contactId2 = '';
+    @track contactId3 = '';
+    // @track contactId4;
+    // @track contactId5;
+    @track beforeHour = '';
+    @track beforeMinute= '';
+    @track afterHour= '';
+    @track afterMinute= '';
+    @track showSpinner = false;
+    @track activityObj = {};
+    @track requiredDescription='';
+    @track requiredLocation='';
+    @track requiredRelatedService='';
+    @track requiredReportContract='';
+    @track requiredReportContractType='';
+    @track visitValidMes='';
+    @track requiredVisitor = '';
+    @track visit= '';
+    @track visitAim= '';
+    @track purposeType1= '';
+    @track purposeType2= '';
+    @track purposeType3= '';
+    // @track purposeType4;
+    // @track purposeType5;
+    @track isAccessAcc= '';
+    @track tempId= '';
+    @track tempRecordTypeName= '';
+    @track tempBtnIdHidden= '';
+    @track tempRedId= '';
+    @track OPDId= '';
+    @track isPlaceDis=false;
+    @track isConDis1=false;
+    @track isConDis2=false;
+    @track isConDis3=false;
+    @track isOppDis1=false;
+    @track isOppDis2=false;
+    @track isOppDis3=false;
+    @track isTransferEtDis=false;
+    @track isActivityEtDis=false;
+    @track isupdateAccInfoDis=false;
+    @track isNewOpdDis=false;
+    @track isCheckReportDis=false;
+    @track isOPDSISDis=false;
+    @track isNTCCDSDis=false;
+    @track isNewBuyDis=false;
+    @track isOppUpdateDis1=false;
+    @track isLoseDis1=false;
+    @track isOppUpdateDis2=false;
+    @track isLoseDis2=false;
+    @track isOppUpdateDis3=false;
+    @track isLoseDis3=false;
+    @track isRelatedServiceDis=false;
+    @track isUseReportDis=false;
+    @track isAccDis=false;
+    @track isInfoUpdateDis=true;
+    @track showModal=false;
+    //zzm 230905 start
+    @track beforeHourDis=false;
+    @track saveDis=false;
+    @track visitorPalceObjName = '';
+    @track visitorPalceFields = ['Account.Name'];
+    @track opportunityFields = ['Opportunity.Name'];
+    @track mcFields = ['Maintenance_Contract__c.Name'];
+    @track infrastructureProjectFields = ['Infrastructure_Project__c.Name'];
+    @track Related_Opportunity1_ID = '';
+    @track Related_Opportunity2_ID = '';
+    @track Related_Opportunity3_ID = '';
+    @track Related_Service1_ID = '';
+    @track isReportContractDis = true;
+    @track isReportContractTypeDis = true;
+    @track isInfrastructureProjectDis1 = true;
+    @track isInfrastructureProjectDis2 = true;
+    @track Infrastructure_Project1 = '';
+    @track Infrastructure_Project2 = '';
+    @api readReportFlag;
+    @api newLeadRecordType;
+    @api updateAccInfoColor = false;
+    @api requiredInfo = {};
+    @track staticResourceContact={};
+    @track isSaveBtn = false;
+    @track agencyContactName ;
+    //zzm 230905 end
+
+
+    // getPIPLInfoJs() {
+    //     console.log('enter connectedCallback')
+    //     this.AWSService = new AWSService();
+    //     getPIPLInfo().then((r) => {
+    //         r = JSON.parse(JSON.stringify(r));
+    //         console.log('r = ' + JSON.stringify(r))
+    //         if (r.status == 'Success') {
+    //             this.staticResourceContact = JSON.parse(r.entity.staticResourceContact);
+    //             console.log('this.staticResourceContact.searchUrl actinveContent= ' + this.staticResourceContact.searchUrl)
+    //         } else {
+    //             console.log('error msg = ' + r.msg)
+    //         }
+    //     })
+    // }
+
+    @api
+    getActivityObj() {
+        
+        let data =  JSON.parse(JSON.stringify(this.activityObj));
+        let dtStr = this.reportedDate+'';
+        let dt = new Date(dtStr);
+        let startDt = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate(),this.beforeHour,this.beforeMinute,0,0);
+        let endDt = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate(),this.afterHour,this.afterMinute,0,0);
+        data.StartDateTime__c = startDt;
+        data.EndDateTime__c = endDt;
+        if(this.visit === '鐥呴櫌') {
+            this.visitorPalceObjName = 'SearchVisitorPlace';
+        }
+        if(this.visit === '璨╁2搴�') {
+            this.visitorPalceObjName = 'SearchVisitorPlace_Sales';
+        }
+        if(this.visit === '绀惧唴娲诲嫊') {
+            this.visitorPalceObjName = 'SearchVisitorPlace_Training';
+        }
+        
+        if(this.visit === '鐥呴櫌'||this.visit === '璨╁2搴�'||this.visit === '绀惧唴娲诲嫊'){
+            if(this.filter){
+                data.Account_ID__c = this.filter;
+                data.Campaign_ID__c = '';
+            }else{
+                data.Account_ID__c = '';
+            }
+        }else if(this.visit === '绀惧銈ゃ儥銉炽儓'){
+            if(this.filter){
+                data.Campaign_ID__c = this.filter;
+                data.Account_ID__c = '';
+            }else{
+                data.Campaign_ID__c = '';
+            }
+            this.visitorPalceObjName = 'SearchVisitorPlace_Campaign';
+            this.visitorPalceFields = ['Campaign.Name'];
+            
+        }else{
+            data.Account_ID__c = '';
+            data.Campaign_ID__c = '';
+        }
+        if(this.contactId1){
+            data.Visitor1_ID__c = this.contactId1;
+        }else{
+            data.Visitor1_ID__c = '';
+        }
+        if(this.contactId2){
+            data.Visitor2_ID__c = this.contactId2;
+        }else{
+            data.Visitor2_ID__c = '';
+        }
+        if(this.contactId3){
+            data.Visitor3_ID__c = this.contactId3;
+        }else{
+            data.Visitor3_ID__c = '';
+        }
+        // if(this.contactId4){
+        //     data.Visitor4_ID__c = this.contactId4;
+        // }else{
+        //     data.Visitor4_ID__c = '';
+        // }
+        // if(this.contactId5){
+        //     data.Visitor5_ID__c = this.contactId5;
+        // }else{
+        //     data.Visitor5_ID__c = '';
+        // }
+        if(this.visit){
+            data.Activity_Type2__c = this.visit;
+        }else{
+            data.Activity_Type2__c = '';
+        }
+        //zzm 230809 start
+        if(this.Related_Opportunity1_ID){
+            data.Related_Opportunity1_ID__c = this.Related_Opportunity1_ID;
+        }else{
+            data.Related_Opportunity1_ID__c = '';
+        }
+        if(this.Related_Opportunity2_ID){
+            data.Related_Opportunity2_ID__c = this.Related_Opportunity2_ID;
+        }else{
+            data.Related_Opportunity2_ID = '';
+        }
+        if(this.Related_Opportunity3_ID){
+            data.Related_Opportunity3_ID = this.Related_Opportunity3_ID;
+        }else{
+            data.Related_Opportunity3_ID = '';
+        }
+        if(this.Related_Service1_ID){
+            data.Related_Service1_ID = this.Related_Service1_ID;
+        }else{
+            data.Related_Service1_ID = '';
+        }
+        if(this.Infrastructure_Project1){
+            data.Infrastructure_Project1 = this.Infrastructure_Project1;
+        }else{
+            data.Infrastructure_Project1 = '';
+        }
+        if(this.Infrastructure_Project2){
+            data.Infrastructure_Project2 = this.Infrastructure_Project2;
+        }else{
+            data.Infrastructure_Project2 = '';
+        }
+        //zzm 230809 end
+        if(this.isNotSalesService){
+            if(this.visitAim){
+                data.Activity_PurposeEscFSE__c = this.visitAim;
+            }else{
+                data.Activity_PurposeEscFSE__c = '';
+            }
+            if(this.purposeType1){
+                data.Purpose_TypeEscFSE__c = this.purposeType1;
+            }else{
+                data.Purpose_TypeEscFSE__c = '';
+            }
+            if(this.purposeType2){
+                data.Purpose_TypeEscFSE2__c = this.purposeType2;
+            }else{
+                data.Purpose_TypeEscFSE2__c = '';
+            }
+            if(this.purposeType3){
+                data.Purpose_TypeEscFSE3__c = this.purposeType3;
+            }else{
+                data.Purpose_TypeEscFSE3__c = '';
+            }
+            // if(this.purposeType4){
+            //     data.Purpose_TypeEscFSE4__c = this.purposeType4;
+            // }else{
+            //     data.Purpose_TypeEscFSE4__c = '';
+            // }
+            // if(this.purposeType5){
+            //     data.Purpose_TypeEscFSE5__c = this.purposeType5;
+            // }else{
+            //     data.Purpose_TypeEscFSE5__c = '';
+            // }
+        }else{
+            if(this.visitAim){
+                data.Activity_PurposeFSE__c = this.visitAim;
+            }else{
+                data.Activity_PurposeFSE__c = '';
+            }
+            if(this.purposeType1){
+                data.Purpose_TypeFSE__c = this.purposeType1;
+            }else{
+                data.Purpose_TypeFSE__c = '';
+            }
+            if(this.purposeType2){
+                data.Purpose_TypeFSE2__c = this.purposeType2;
+            }else{
+                data.Purpose_TypeFSE2__c = '';
+            }
+            if(this.purposeType3){
+                data.Purpose_TypeFSE3__c = this.purposeType3;
+            }else{
+                data.Purpose_TypeFSE3__c = '';
+            }
+            // if(this.purposeType4){
+            //     data.Purpose_TypeFSE4__c = this.purposeType4;
+            // }else{
+            //     data.Purpose_TypeFSE4__c = '';
+            // }
+            // if(this.purposeType5){
+            //     data.Purpose_TypeFSE5__c = this.purposeType5;
+            // }else{
+            //     data.Purpose_TypeFSE5__c = '';
+            // }
+        }
+        return data;
+    }
+    
+
+    //鎶ュ憡涓�瑙堝璞�
+    _event;
+    @api
+    get event() {
+        return this._event;
+    }
+    _loadFlag = false;
+    //鐩稿綋浜庡垵濮嬪寲
+    set event(newValue) {
+        this._loadFlag = true;
+        // this.clearLookUp();
+        
+        console.log('newvalue:activityObj:OPDPlan_Flag__c:' );
+        console.log(JSON.parse(JSON.stringify(newValue)));
+        console.log(newValue.OPDPlan_Flag__c );
+        this._event = newValue;
+
+
+        this.activityObj = newValue;
+        if(this.activityObj.Activity_Type2__c){
+            // this.visit = this.activityObj.Activity_Type2__c;
+            this.activityObj = {
+                    ...this.activityObj,
+                    ['Activity_Type2__c']: this.activityObj.Activity_Type2__c
+                };
+
+        } else {
+             this.activityObj = {
+                    ...this.activityObj,
+                    ['Activity_Type2__c']: ''
+                };
+        }
+        this.visit = this.activityObj.Activity_Type2__c;
+        if(!this.activityObj.Activity_Type2__c)
+        {
+            this.activityObj = {
+                    ...this.activityObj,
+                    ['Activity_Type2__c']: ''
+                };
+
+        }
+        if(this.isNotSalesService){
+            this.visitAim = this.activityObj.Activity_PurposeEscFSE__c;
+            this.purposeType1 = this.activityObj.Purpose_TypeEscFSE__c;
+            this.purposeType2 = this.activityObj.Purpose_TypeEscFSE2__c;
+            this.purposeType3 = this.activityObj.Purpose_TypeEscFSE3__c;
+            // this.purposeType4 = this.activityObj.Purpose_TypeEscFSE4__c;
+            // this.purposeType5 = this.activityObj.Purpose_TypeEscFSE5__c;
+        }else{
+            this.visitAim = this.activityObj.Activity_PurposeFSE__c;
+            this.purposeType1 = this.activityObj.Purpose_TypeFSE__c;
+            this.purposeType2 = this.activityObj.Purpose_TypeFSE2__c;
+            this.purposeType3 = this.activityObj.Purpose_TypeFSE3__c;
+            // this.purposeType4 = this.activityObj.Purpose_TypeFSE4__c;
+            // this.purposeType5 = this.activityObj.Purpose_TypeFSE5__c;
+        }
+        
+        if(this.activityObj.whatid__c){
+            this.filter = this.activityObj.whatid__c;
+            console.log(this.filter);
+
+        }  else {
+                this.filter = '';
+            }
+        // this.contactId4 = this.activityObj.Visitor4_ID__c;
+        // this.contactId5 = this.activityObj.Visitor5_ID__c;
+        if(this.visit === '鐥呴櫌'){
+            this.isAccessAcc = true;
+            console.log(this.activityObj.Account_ID__c);
+            if(this.activityObj.Visitor1_ID__c) {
+                this.contactId1 = this.activityObj.Visitor1_ID__c;
+            } else {
+                this.contactId1 = '';
+                     this.activityObj = {
+                    ...this.activityObj,
+                    ['Visitor1_ID__c']: ''
+                };
+            }
+            if(this.activityObj.Visitor2_ID__c) {
+                this.contactId2 = this.activityObj.Visitor2_ID__c;
+            } else {
+                this.contactId2 = '';
+                this.activityObj = {
+                    ...this.activityObj,
+                    ['Visitor2_ID__c']: ''
+                };
+            }
+            if(this.activityObj.Visitor3_ID__c) {
+                this.contactId3 = this.activityObj.Visitor3_ID__c;
+            } else {
+                this.contactId3 = '';
+                     this.activityObj = {
+                    ...this.activityObj,
+                    ['Visitor3_ID__c']: ''
+                };
+            }
+            // if(this.activityObj.Account_ID__c){
+            //     this.filter = this.activityObj.Account_ID__c;
+            // }
+            if(this.activityObj.Related_Opportunity1_ID__c) {
+                this.Related_Opportunity1_ID = this.activityObj.Related_Opportunity1_ID__c;
+            } else {
+                this.Related_Opportunity1_ID = '';
+            }
+            if(this.activityObj.Related_Opportunity2_ID__c) {
+                this.Related_Opportunity2_ID = this.activityObj.Related_Opportunity2_ID__c;
+            }else {
+                this.Related_Opportunity2_ID = '';
+            }
+            if(this.activityObj.Related_Opportunity3_ID__c) {
+                this.Related_Opportunity3_ID = this.activityObj.Related_Opportunity3_ID__c;
+            }else {
+                this.Related_Opportunity3_ID = '';
+            }
+            if(this.activityObj.Related_Service1_ID__c) {
+                this.Related_Service1_ID = this.activityObj.Related_Service1_ID__c;
+            }else {
+                this.Related_Service1_ID = '';
+            }
+            if(this.activityObj.Infrastructure_Project1__c) {
+                this.Infrastructure_Project1 = this.activityObj.Infrastructure_Project1__c;
+            }else {
+                this.Infrastructure_Project1 = '';
+            }
+            if(this.activityObj.Infrastructure_Project2__c) {
+                this.Infrastructure_Project2 = this.activityObj.Infrastructure_Project2__c;
+            }else {
+                this.Infrastructure_Project2 = '';
+            }
+
+            this.visitorPalceObjName = 'SearchVisitorPlace';
+        }else if(this.visit === '璨╁2搴�'){
+            this.isAccessAcc = true;
+            // if(this.activityObj.Account_ID__c){
+            //     this.filter = this.activityObj.Account_ID__c;
+            // }
+            this.visitorPalceObjName = 'SearchVisitorPlace_Sales';
+        }else if(this.visit === '绀惧唴娲诲嫊'){
+            this.isAccessAcc = true;
+            // if(this.activityObj.Account_ID__c){
+            //     this.filter = this.activityObj.Account_ID__c;
+            // }
+            if(this.activityObj.Related_Opportunity1_ID__c) {
+                this.Related_Opportunity1_ID = this.activityObj.Related_Opportunity1_ID__c;
+            }else {
+                this.Related_Opportunity1_ID = '';
+            }
+            if(this.activityObj.Related_Opportunity2_ID__c) {
+                this.Related_Opportunity2_ID = this.activityObj.Related_Opportunity2_ID__c;
+            }else {
+                this.Related_Opportunity2_ID = '';
+            }
+            // if(this.activityObj.Related_Opportunity3_ID__c) {
+            //     this.Related_Opportunity3_ID = this.activityObj.Related_Opportunity3_ID__c;
+            // }
+            // if(this.activityObj.Infrastructure_Project1__c) {
+            //     this.Infrastructure_Project1 = this.activityObj.Infrastructure_Project1__c;
+            // }
+            this.visitorPalceObjName = 'SearchVisitorPlace_Training';
+        }else if(this.visit === '绀惧銈ゃ儥銉炽儓'){
+            this.isAccessAcc = false;
+            // if(this.activityObj.Campaign_ID__c){
+            //     this.filter = this.activityObj.Campaign_ID__c;
+            // }
+            // if(this.activityObj.whatid__c){
+            //     this.filter = this.activityObj.whatid__c;
+            // }
+            
+            this.visitorPalceObjName = 'SearchVisitorPlace_Campaign';
+            this.visitorPalceFields = ['Campaign.Name'];
+        }else {
+            this.isAccessAcc = true;
+            this.filter = '';
+        }
+        if(!this.filter)  {
+
+             const visitorComponents = this.template.querySelectorAll('c-other-look-up');
+             console.log(visitorComponents.length);
+            if (visitorComponents.length > 0) {
+                visitorComponents.forEach(visitorComponent => {
+                    if(visitorComponent['uniqueKey'] =='AccountID' || 
+                        !visitorComponent['uniqueKey']) {
+                        this.isAccDis = false;
+                        visitorComponent.handleRemovePill();
+                        this.isAccDis = true;
+                    } 
+                });
+            }
+        }
+        
+        if(this.activityObj.StartDateTime__c){
+            let startTimeStr = this.activityObj.StartDateTime__c+'';
+            let startDate = new Date(startTimeStr);
+            startDate.setHours(startDate.getHours())
+            this.beforeHour = startDate.getHours();
+            this.beforeMinute = startDate.getMinutes();
+        }
+        else
+        {
+            this.beforeHour = '';
+            this.beforeMinute = '';
+
+        }
+        if(this.activityObj.EndDateTime__c){
+            let endTimeStr = this.activityObj.EndDateTime__c+'';
+            let endDate = new Date(endTimeStr);
+            endDate.setHours(endDate.getHours())
+            this.afterHour = endDate.getHours();
+            this.afterMinute = endDate.getMinutes();
+        }else{
+            this.afterHour = '';
+            this.afterMinute = '';
+        }
+        //钀ヤ笟鐨勫彧鏄剧ずOPD/sis 涔熻鎷嗗垎涓変釜鎸夐挳 骞跺甫榛樿鍊�
+        //閿�鍞湇鍔℃槸娑夊強缁翠慨鍚堝悓 鏄剧ずNtc鎸夐挳锛堣鎷嗘垚涓や釜鎸夐挳 鏂板搧瑁呮満鍩硅鍜屾晠闅滈闃插煿璁級 
+        this.options = [
+            { label: 'OPD/(涓绘満璇曠敤鎶ュ憡)', value: 'SIS' },
+            { label: 'SIS-ET锛圫IS-ET锛�', value: 'SIS_ET' },
+            { label: 'SIS-ENG锛圫IS-ENG锛�', value: 'SIS_ENG' }
+        ];
+        // if(this.reportOwner.Job_Category__c==='閿�鍞帹骞�'){
+        //     this.options = [
+        //         { label: 'OPD/(涓绘満璇曠敤鎶ュ憡)', value: 'SIS' },
+        //         { label: 'SIS-ET锛圫IS-ET锛�', value: 'SIS_ET' },
+        //         { label: 'SIS-ENG锛圫IS-ENG锛�', value: 'SIS_ENG' }
+        //     ];
+        //     this.options = [
+        //         { label: '璺熷彴锛堜骇鍝佷富鏈烘媴褰�/鍖婚櫌鎷呭綋鑰冩牳锛�', value: 'OPD' },
+        //         { label: 'OPD/(涓绘満璇曠敤鎶ュ憡)', value: 'SIS' },
+        //         { label: 'SIS-ET锛圫IS-ET锛�', value: 'SIS_ET' },
+        //         { label: 'SIS-ENG锛圫IS-ENG锛�', value: 'SIS_ENG' }
+        //     ];
+        // }else{
+        //     this.options = [
+        //         { label: '璺熷彴锛堜骇鍝佷富鏈烘媴褰�/鍖婚櫌鎷呭綋鑰冩牳锛�', value: 'OPD' },
+        //         { label: 'OPD/(涓绘満璇曠敤鎶ュ憡)', value: 'SIS' },
+        //         { label: 'SIS-ET锛圫IS-ET锛�', value: 'SIS_ET' },
+        //         { label: 'SIS-ENG锛圫IS-ENG锛�', value: 'SIS_ENG' }
+        //     ];
+        // }
+        this.setVisitorPlaceDisabled();
+        this.vpChack1();
+        debugger
+        // if(this.activityObj && this.activityObj.Id) {
+        //     updateRecord({fields: { Id: this.activityObj.Id }});
+        // }
+        // 
+         refreshApex(this.activityObj);
+    }
+    renderedCallback(){
+        // console.log('activeContent renderedCallback:'+this.valueId);
+        console.log('otherlookup renderedCallback');
+        // this.activityObj = this._event ;
+        // if(this.activityObj) {
+
+        //  updateRecord({fields: { Id: this.activityObj.Id }});
+        // }
+        // if(this._loadFlag) {
+        //     this.activityObj = this._event ;
+        //     this._loadFlag = false;
+        //     if(this.activityObj && this.activityObj.Id) {
+        //         updateRecord({fields: { Id: this.activityObj.Id }});
+        //     }
+        // }
+
+
+
+        
+    }
+    //鏂板缓鎴愬姛鍚庝紶鍏ョ殑瀹㈡埛浜哄憳id
+    _conid;
+    @api
+    get conid() {
+        return this._conid;
+    }
+
+    set conid(newValue) {
+        this._conid = newValue;
+    }
+    //璁块棶瀵硅薄
+    handleSelection(event) {
+        console.log('handleSelection!!!!!!!!!!!!');
+        var key = event.detail.key;
+        if(key==='AgencyContact1'){
+            this.requiredVisitor = '';
+            this.contactId1 = event.detail.selectedId;
+            this.activityObj = {
+                ...this.activityObj,
+                ['Visitor1_ID__c']: event.detail.selectedId
+            };
+
+        }else if(key==='AgencyContact2'){
+            this.contactId2 = event.detail.selectedId;
+            this.activityObj = {
+                ...this.activityObj,
+                ['Visitor2_ID__c']: event.detail.selectedId
+            };
+        }else if(key==='AgencyContact3'){
+            this.activityObj = {
+                ...this.activityObj,
+                ['Visitor3_ID__c']: event.detail.selectedId
+            };
+            this.contactId3 = event.detail.selectedId;
+        }
+        this.checkVisitChange();
+        // else if(key==='AgencyContact4'){
+        //     this.contactId4 = event.detail.selectedId;
+        // }else if(key==='AgencyContact5'){
+        //     this.contactId5 = event.detail.selectedId;
+        // }
+    }
+    //璁块棶瀵硅薄
+    handleAccSelection(event) {
+        console.log('handleAccSelection!!!!!!!!!!!!');
+        this.filter = event.detail.selectedId;
+        this.activityObj = {
+                ...this.activityObj,
+                ['whatid__c']: event.detail.selectedId
+            };
+        this.requiredLocation = '';
+        this.changeAccId();
+    }
+    //璇环
+    handleOppertunity1Selection(event) {
+        console.log('handleOppertunity1Selection!!!!!!!!!!!!');
+        this.Related_Opportunity1_ID = event.detail.selectedId;
+        if(!this.Related_Opportunity1_ID) {
+            this.isOppUpdateDis1 = true;
+            this.isLoseDis1 = true;
+        } else {
+            this.isOppUpdateDis1 = false;
+            this.isLoseDis1 = false;  
+        }
+        this.checkVisitChange();
+    }
+    handleOppertunity2Selection(event) {
+        console.log('handleOppertunity2Selection!!!!!!!!!!!!');
+        this.Related_Opportunity2_ID = event.detail.selectedId;
+        // this.activityObj.Related_Opportunity2_ID__c = event.detail.selectedId;
+        if(!this.Related_Opportunity2_ID) {
+            this.isOppUpdateDis2 = true;
+            this.isLoseDis2 = true;
+        } else {
+            this.isOppUpdateDis2 = false;
+            this.isLoseDis2 = false;
+        }
+        this.checkVisitChange();
+    }
+    handleOppertunity3Selection(event) {
+        console.log('handleOppertunity3Selection!!!!!!!!!!!!');
+        this.Related_Opportunity3_ID = event.detail.selectedId;
+        // this.activityObj.Related_Opportunity3_ID__c = event.detail.selectedId;
+        if(!this.Related_Opportunity3_ID) {
+            this.isOppUpdateDis3 = true;
+            this.isLoseDis3 = true;
+        } else {
+            this.isOppUpdateDis3 = false;
+            this.isLoseDis3 = false;
+        }
+        this.checkVisitChange();
+    }
+    //鍩哄缓椤圭洰
+    handleInfrastructureProject1Selection(event) {
+        console.log('handleOppertunity1Selection!!!!!!!!!!!!');
+        this.Infrastructure_Project1 = event.detail.selectedId;
+        this.checkVisitChange();
+        
+    }
+    //鍩哄缓椤圭洰
+    handleInfrastructureProject2Selection(event) {
+        console.log('handleOppertunity1Selection!!!!!!!!!!!!');
+        this.Infrastructure_Project2 = event.detail.selectedId;
+        this.checkVisitChange();
+        
+    }
+    //缁翠慨鍚堝悓
+    handleMCSelection(event) {
+        console.log('handleMCSelection!!!!!!!!!!!!');
+        this.Related_Service1_ID = event.detail.selectedId;
+         this.activityObj = {
+            ...this.activityObj,
+            ['Related_Service1_ID__c']: event.detail.selectedId
+        }
+        this.requiredRelatedService = '';
+        this.checkVisitChange();
+       
+    }
+    get dailyTypeList() {
+        return [
+            { label: '閫氬父', value: '閫氬父' },
+            { label: '涓�鏃ヤ紤鍋�', value: '涓�鏃ヤ紤鍋�' },
+            { label: '鍏ㄥぉ鍩硅', value: '鍏ㄥぉ鍩硅' }
+        ];
+    }
+    //淇℃伅鏇存柊鎸夐挳
+    slaInfoPage(){
+        var eventCId = this.activityObj.Id;
+        var index = 1;
+        var visitor1 = this.contactId1;
+        var visitor2 = this.contactId2;
+        var visitor3 = this.contactId3;
+        // var visitor4 = this.contactId4;
+        // var visitor5 = this.contactId5;
+        var visitorPlaceId = this.activityObj.Related_Service1_ID__c;
+        var serviceId = this.filter;
+        var id = this.activityObj.SLAReportInfo__c;
+        var url = "/apex/SLAReportDetails?serviceId="+serviceId+"&index="+index+'&';
+        if(id){
+            url += "id="+id+'&';
+        }
+        if(eventCId){
+            url += "eventCId="+eventCId+'&';
+        }
+        if(visitor1){
+            url += "visitor1="+visitor1+'&';
+        }
+        if(visitor2){
+            url += "visitor2="+visitor2+'&';
+        }
+        if(visitor3){
+            url += "visitor3="+visitor3+'&';
+        }
+        // if(visitor4){
+        //     url += "visitor4="+visitor4+'&';
+        // }
+        // if(visitor5){
+        //     url += "visitor5="+visitor5+'&';
+        // }
+        if(visitorPlaceId){
+            url += "accountId="+visitorPlaceId+'&';
+        }
+        console.log(url);
+        window.open(url,'_blank');
+    }
+    changeAccId(){
+        //娓呯┖璁块棶瀵硅薄
+        const childComponents = this.template.querySelectorAll('c-look-up-util');
+        console.log(childComponents.length);
+        if (childComponents.length > 0) {
+            childComponents.forEach(childComponent => {
+                childComponent.handleRemovePill();
+            });
+        }
+        //娓呯┖鍏朵粬鏌ヨ缁勪欢
+        const otherComponents = this.template.querySelectorAll('c-other-look-up');
+        console.log(otherComponents.length);
+        if (otherComponents.length > 0) {
+            otherComponents.forEach(otherComponent => {
+                console.log('娓呯┖鍏朵粬鏌ヨ缁勪欢:')
+                console.log(otherComponent['uniqueKey'])
+                if(otherComponent['uniqueKey'] !='AccountID') {
+                    otherComponent.handleRemovePill();
+                    
+                } 
+            });
+        }
+        this.visitDis = false;
+        
+    }
+    clearLookUp() {
+         //娓呯┖璁块棶瀵硅薄
+        const childComponents = this.template.querySelectorAll('c-look-up-util');
+        console.log(childComponents.length);
+        if (childComponents.length > 0) {
+            childComponents.forEach(childComponent => {
+                childComponent.handleRemovePill();
+            });
+        }
+        //娓呯┖鍏朵粬鏌ヨ缁勪欢
+        const otherComponents = this.template.querySelectorAll('c-other-look-up');
+        console.log(otherComponents.length);
+        if (otherComponents.length > 0) {
+            otherComponents.forEach(otherComponent => {
+               
+                otherComponent.handleRemovePill();
+               
+            });
+        }
+        this.beforeHour = '';
+        this.beforeMinute = '';
+        this.afterHour = '';
+        this.afterMinute = '';
+        this.activityObj = {
+                ...this.activityObj,
+                ['Activity_Type2__c']: '',
+                ['Activity_PurposeEscFSE__c']: '',
+                ['Activity_PurposeFSE__c']: '',
+                ['Purpose_TypeEscFSE__c']: '',
+                ['Purpose_TypeEscFSE2__c']: '',
+                ['Purpose_TypeEscFSE3__c']: '',
+                ['Purpose_TypeFSE__c']: '',
+                ['Purpose_TypeFSE2__c']: '',
+                ['Purpose_TypeFSE3__c']: '',
+                ['OPDPlan_Flag__c']: false,
+                ['Report_Contract__c']: '',
+                ['Report_Contract_Type__c']: '',
+                ['Description__c']: '',
+                ['Find_Imitations_Flag__c']: false,
+                ['cancelReasonSelect__c']: '',
+                ['cancelReasonSelectFSE__c']: '',
+                ['cancelReasonOther__c']: '',
+                ['delayReasonSelect__c']: '',
+                ['delayReasonSelectFSE__c']: '',
+                ['delayReasonOther__c']: '',
+                ['delayToDate__c']: '',
+                 
+
+            };
+        
+        
+
+
+    }
+    changeCampaignId(event){
+        this.filter = event.target.value;
+    }
+    fieldChange(event) {
+        console.log('filedChange uniqueKey:');
+        console.log(event.currentTarget);
+        //娓呯┖閿欒鎻愮ず淇℃伅
+        if(event.currentTarget.dataset.key) {
+            console.log(event.currentTarget.dataset.key)
+            const { key } = event.currentTarget.dataset;
+            const requiredId = event.currentTarget.dataset.key;
+            this.requiredInfo = {
+                ...this.requiredInfo,
+                [key]: ''
+            };
+        }
+
+        
+       
+        const { value } = event.detail;
+        const { fieldName } = event.target || event.currentTarget;
+        // 浣跨敤鍔ㄦ�佸瓧娈靛悕璁剧疆瀵硅薄鐨勫睘鎬у��
+        let checked = event.target.value||event.currentTarget.value;
+        if (value == undefined && checked != undefined) {
+            this.activityObj = {
+                ...this.activityObj,
+                [fieldName]: checked
+            };
+             // this.activityObj[fieldName] = checked;
+        } else {
+            let theValue = value instanceof Array ? value[0] : value;
+            if(theValue===undefined){
+                theValue = '';
+            }
+            this.activityObj = {
+                ...this.activityObj,
+                [fieldName]: theValue
+            };
+            // this.activityObj[fieldName] = theValue;
+        }
+        console.log('1111111111111');
+        if(fieldName==='Related_Opportunity1_ID__c'||fieldName==='Related_Opportunity2_ID__c'||fieldName==='Related_Opportunity3_ID__c'){
+            console.log('222222222222');
+            this.setVisitorPlaceDisabled();
+        }
+    }
+    handleNewRecord(event){
+        const openPageEvent = new CustomEvent('openpage', {
+            detail: { activeContentIndex:this.theIndex,lookUpKey:event.detail.key },
+        });
+        this.dispatchEvent(openPageEvent);
+    }
+    @api
+    validSaveReport() {
+        
+        let saveflag = false;
+        console.log('validSaveReport start');
+        let requiredFieldList = this.template.querySelectorAll('lightning-input-field');
+        requiredFieldList.forEach(ele => {
+            console.log(ele.required);
+            console.log(ele.value);
+            if ( ele.required == true && ele.value) {
+                saveflag = true;
+                return saveflag;
+            }
+        });
+        let requiredInputList = this.template.querySelectorAll('lightning-input');
+        requiredInputList.forEach(ele => {
+            if ( ele.required == true && ele.value) {
+                saveflag = true;
+                return saveflag;
+            }
+        });
+        console.log('validSaveReport end');
+        return saveflag;
+    }
+    @api
+    validRequired(){
+        console.log('validRequired');
+        let flag = true;
+        // //璁剧疆蹇呭~淇℃伅
+        if(this.report.Status__c === '鐢宠珛涓�' && this.stringIsEmpty(this.activityObj.eventStatus__c)){
+            console.log('1');
+            //缁撴灉蹇呭~
+            if(this.stringIsEmpty(this.activityObj.Description__c)){
+                this.requiredInfo.requiredDescription = '璇疯緭鍏ュ��';
+            }
+        }
+        if(this.report.Status__c === '鐢宠珛涓�' && this.visit === '鐥呴櫌'&& this.stringIsEmpty(this.activityObj.eventStatus__c)){
+            console.log('2');
+            //璁块棶鍦烘墍蹇呭~
+            if(this.stringIsEmpty(this.filter)){
+                this.requiredLocation = '璇疯緭鍏ュ��';
+            }
+        }
+        if (this.report.Daily_Report_Data_Type__c==='涓�鏃ヤ紤鍋�' && this.visit !== '浼戞殗' && this.stringIsEmpty(this.activityObj.eventStatus__c)) {
+            console.log('3');
+            this.visitValidMes = '鍏ㄥぉ浼戝亣绫诲瀷鐨勬棩鎶ユ嫓璁垮尯鍒嗗繀椤讳负浼戝亣锛�';
+            flag = false;
+        }
+        if (this.report.Daily_Report_Data_Type__c==='鍏ㄥぉ鍩硅' 
+            && this.visitAim !== '鍏徃鍩硅' && this.visitAim !== '鍩硅' && this.stringIsEmpty(this.activityObj.eventStatus__c)){
+                console.log('4');
+                this.visitValidMes = '鍏ㄥぉ鍩硅绫诲瀷鐨勬棩鎶ユ嫓璁跨洰鐨勫繀椤讳负鍩硅锛�';
+                flag = false;
+        }
+        if((this.purposeType1 === '鍚堝悓瀛f姤' || this.activityObj.UseReport__c) &&  
+        this.stringIsEmpty(this.activityObj.Related_Service1_ID__c) && this.stringIsEmpty(this.activityObj.eventStatus__c)
+        ){
+            console.log('5');
+            //缁翠慨鍚堝悓蹇呭~
+            this.requiredRelatedService = '璇疯緭鍏ュ��';
+             flag = false;
+        }
+        if((this.purposeType1 === '鍚堝悓瀛f姤' || this.activityObj.UseReport__c ||this.purposeType2 === '鍚堝悓瀛f姤'||this.purposeType3 === '鍚堝悓瀛f姤') &&  
+        this.stringIsEmpty(this.activityObj.Report_Contract__c) && this.stringIsEmpty(this.activityObj.eventStatus__c)
+        ){
+            console.log('6');
+            //鍙戞斁浜哄繀濉�
+            this.requiredInfo.requiredReportContract = '璇疯緭鍏ュ��';
+            flag = false;
+        }
+         if((this.purposeType1 === '鍚堝悓瀛f姤' || this.activityObj.UseReport__c||this.purposeType2 === '鍚堝悓瀛f姤'||this.purposeType3 === '鍚堝悓瀛f姤') &&  
+        this.stringIsEmpty(this.activityObj.Report_Contract_Type__c) && this.stringIsEmpty(this.activityObj.eventStatus__c)
+        ){
+            console.log('6');
+            //鍙戞斁鏂瑰紡蹇呭~
+            this.requiredInfo.requiredReportContractType = '璇疯緭鍏ュ��';
+            flag = false;
+        }
+        if((this.purposeType1 === '鍚堝悓鐐规' &&  
+        this.stringIsEmpty(this.activityObj.Related_Service1_ID__c) && this.stringIsEmpty(this.activityObj.eventStatus__c))
+        ){
+            console.log('6');
+            //缁翠慨鍚堝悓蹇呭~
+            this.requiredRelatedService='璇疯緭鍏ュ��';
+        }
+        let requiredFieldList = this.template.querySelectorAll('lightning-input-field');
+        requiredFieldList.forEach(ele => {
+            if ( ele.required == true && this.stringIsEmpty(ele.value)) {
+                console.log('7');
+                console.log(ele.fieldName);
+                ele.reportValidity();
+                flag = false;
+            }
+        });
+        let requiredInputList = this.template.querySelectorAll('lightning-input');
+        requiredInputList.forEach(ele => {
+            if ( ele.required == true && this.stringIsEmpty(ele.value)) {
+                console.log('8-1');
+                console.log(ele.fieldName);
+                ele.reportValidity();
+                flag = false;
+            }
+        });
+      
+        //zzm 230906 start 瀛︽湳浼氳鏃讹紝璁块棶瀵硅薄涓嶆槸蹇呭~
+        // if(this.stringIsEmpty(this.contactId1)&&this.isConDis1){
+        if(this.stringIsEmpty(this.contactId1)&& !this.isConDis1){
+            console.log('8');
+            this.requiredVisitor = '璇疯緭鍏ュ��';
+            flag = false;
+        }
+        //zzm 230906 end
+
+        //20210520 zh ETAPP涓庢棩鎶ヨ仈鍔� start
+        if(!this.isNotSalesService&& this.visitAim === 'ET APP娲诲姩'&&!this.activityObj.ETAPPAct__c&&
+        this.activityObj.eventStatus__c!=='寤舵湡'&&this.activityObj.eventStatus__c!=='鍙栨秷'){
+            this.eventMessage = '璇风‘璁わ細鏄惁闇�瑕佹柊寤虹洰鏍嘐T鎴栬�呰繘琛岀洰鏍嘐T鐨凱DCA绠$悊銆�';
+            this.etAPPerrorMsg = '鑻ラ渶瑕佸缓绔嬬洰鏍嘐T锛岃鐐瑰嚮[杞嚦ET APP]鏂板缓鐩爣ET銆傝嫢宸插缓绔嬬洰鏍嘐T锛岃鐐瑰嚮[ET APP娲诲姩]杩涜娲诲姩PDCA绠$悊';
+            flag = false;
+        }else if(this.isNotSalesService && this.visitAim === 'ET APP娲诲姩'&&!this.activityObj.ETAPPAct__c&&
+        this.activityObj.eventStatus__c!=='寤舵湡'&&this.activityObj.eventStatus__c!=='鍙栨秷'){
+            this.eventMessage = '璇风‘璁わ細鏄惁闇�瑕佹柊寤虹洰鏍嘐T鎴栬�呰繘琛岀洰鏍嘐T鐨凱DCA绠$悊銆�';
+            this.etAPPerrorMsg = '鑻ラ渶瑕佸缓绔嬬洰鏍嘐T锛岃鐐瑰嚮[杞嚦ET APP]鏂板缓鐩爣ET銆傝嫢宸插缓绔嬬洰鏍嘐T锛岃鐐瑰嚮[ET APP娲诲姩]杩涜娲诲姩PDCA绠$悊';
+            flag = false;
+        }
+        if(flag){
+            flag = this.validOther();
+        }
+        console.log('validRequired result:' + flag);
+        return flag;
+    }
+    @api
+    validOther(){
+        console.log('validOther');
+        if(this.isNotSalesService) {
+            if(!this.beforeMinute && this.beforeHour && this.afterHour) {
+                this.beforeMinute = 0;
+            }
+            if(!this.afterMinute && this.beforeHour && this.afterHour) {
+                this.afterMinute = 0;
+            }
+        }
+        var sHour = this.beforeHour;
+        var sMinute = this.beforeMinute;
+        var eHour = this.afterHour;
+        var eMinute = this.afterMinute;
+
+        if(!this.isNotSalesService && (this.stringIsEmpty(sMinute) || this.stringIsEmpty(eMinute) || this.stringIsEmpty(sHour)||this.stringIsEmpty(eHour)) ){
+           
+            // this.timeValid = this.customLabel.Error_Message22;
+            this.showToast('error',this.customLabel.Error_Message22);
+            return false;
+           
+        } else if(this.isNotSalesService && ( this.stringIsEmpty(sHour)||this.stringIsEmpty(eHour)) ) {
+            
+            // this.timeValid = this.customLabel.Error_Message22;
+            this.showToast('error',this.customLabel.Error_Message22);
+            return false;
+        }else{
+
+            const regexPattern = /^[0-9]+$/;
+            if (!regexPattern.test(sHour) || !regexPattern.test(sMinute) || !regexPattern.test(eHour) || !regexPattern.test(eMinute)) {
+                // this.timeValid = this.customLabel.Error_Message39; //涓嶆纭殑鏃ユ湡銆�
+                this.showToast('error',this.customLabel.Error_Message39);
+                return false;
+            }
+            // const regexHour = /^(0?[1-9]|1[0-2])$/;
+            // if(!regexHour.test(sHour)||!regexHour.test(eHour)) {
+            //     this.timeValid = this.customLabel.Error_Message39; //涓嶆纭殑鏃ユ湡銆�
+            //     return false;
+
+            // }
+            sHour = parseInt(this.beforeHour);
+            sMinute = parseInt(this.beforeMinute);
+            eHour = parseInt(this.afterHour);
+            eMinute = parseInt(this.afterMinute);
+            // 绡勫洸銉併偋銉冦偗
+            // if(sHour > 23) {
+            //     sHour =sHour%24;
+            //     this.beforeHour = sHour;
+            // }
+            // if(eHour > 23) {
+            //     eHour =eHour%24;
+            //     this.afterHour = eHour;
+            // }
+            // if(sMinute > 59) {
+            //     sMinute =sMinute%60;
+            //     this.beforeMinute = sMinute;
+            // }
+            // if(eMinute > 59) {
+            //     eMinute =eMinute%60;
+            //     this.afterMinute = eMinute;
+            // }
+            if (sHour < 0 || sHour > 23 || sMinute < 0 || sMinute > 59 || eHour < 0 || eHour > 23 || eMinute < 0 || eMinute > 59) {
+                // this.timeValid = this.customLabel.Error_Message39;
+                this.showToast('error',this.customLabel.Error_Message39);
+                return false;
+            }else if (sHour > eHour || (sHour === eHour && sMinute > eMinute)) {
+                // 閫嗚虎銉併偋銉冦偗
+                // this.timeValid = this.customLabel.Error_Message2;
+                this.showToast('error',this.customLabel.Error_Message2);
+                return false;
+            }
+            this.timeValid = '';
+        }
+        console.log('validOther  end');
+        return true;
+    }
+    @track eventMessage;
+    @track etAPPerrorMsg;
+    @track customValidationMessage;
+    @track isSaveSuccess;
+    validReport(type){
+        console.log('validReport!!!!!!!!!!!!');
+        const openPageEvent = new CustomEvent('validreport', {
+            detail: { type:type,index:this.theIndex},
+        });
+        this.showSpinner = false;
+        this.dispatchEvent(openPageEvent);
+    }
+    @api
+    saveTheActivity(type){
+        console.log('saveTheActivity');
+        console.log(type);
+        if( typeof(type)=='string') {
+            this.isSaveBtn = true;
+            console.log('save btn ');
+           
+        } else {
+            this.isSaveBtn = false;
+            
+            
+        }
+        this.validReport(type);
+        
+
+        
+    }
+    @api
+    save(type){
+        
+        console.log('save');
+        console.log(type);
+        this.isSaveSuccess = false;
+        this.showSpinner = true;
+        var flag = true;
+
+        // if(!this.isSaveBtn && this.report.Status__c=='鐢宠珛涓�') {
+        //     flag = this.validRequired();
+        // } 
+       
+        // else {
+        //     flag =  this.validOther();
+        // }
+
+        
+        if(flag ){
+            saveActivity({ jsonStr: JSON.stringify(this.activityObj),beforeHour:this.beforeHour,beforeMinute:this.beforeMinute
+            ,afterHour:this.afterHour,afterMinute:this.afterMinute
+            ,visit:this.visit,visitAim:this.visitAim,purposeType1:this.purposeType1,purposeType2:this.purposeType2,
+            purposeType3:this.purposeType3,
+            // purposeType4:this.purposeType4,purposeType5:this.purposeType5,
+            contactId1:this.contactId1,contactId2:this.contactId2,contactId3:this.contactId3,
+            // contactId4:this.contactId4, contactId5:this.contactId5,
+            accountId:this.filter,
+            reportJsonStr:JSON.stringify(this.report),shour:this.shour,sminute:this.sminute,ehour:this.ehour,eminute:this.eminute
+            ,relatedOpportunity1:this.Related_Opportunity1_ID,relatedOpportunity2:this.Related_Opportunity2_ID
+            ,relatedOpportunity3:this.Related_Opportunity3_ID,relatedService1:this.Related_Service1_ID
+            ,infrastructureProject1:this.Infrastructure_Project1,infrastructureProject2:this.Infrastructure_Project2
+            })
+            .then(result => {
+                if(result.code===200){
+                    if(this.stringIsEmpty(type)){
+                        this.showToast('success','淇濆瓨鎴愬姛');
+                        this.showSpinner = false;
+                    }
+                    let msg = result.msg;
+                    if(msg === 'update'){
+
+                    }else{
+                        this.activityObj = {
+                            ...this.activityObj,
+                            ['Id']: msg
+                        };
+                    }
+                    this.isOpen = false;
+                    //鏂板缓opd璁″垝
+                    if(type==='newOPDPlan'){
+                        console.log('newOPDPlan!!!');
+                        // var content;
+                        // if(this.visit === '绀惧銈ゃ儥銉炽儓'){
+                        //     content = encodeDefaultFieldValues({
+                        //         Campaign__c: this.filter,
+                        //         Related_Opportunity1_ID__c: this.activityObj.Related_Opportunity1_ID__c,
+                        //         Related_Opportunity2_ID__c: this.activityObj.Related_Opportunity2_ID__c,
+                        //     });
+                        // }else{
+                        //     content = encodeDefaultFieldValues({
+                        //         Account_Laboratory__c: this.filter,
+                        //         Related_Opportunity1_ID__c: this.activityObj.Related_Opportunity1_ID__c,
+                        //         Related_Opportunity2_ID__c: this.activityObj.Related_Opportunity2_ID__c,
+                        //     });
+                        // }
+                        // const defaultFieldValues =  content;
+                        // const pageReference = {
+                        //     type: 'standard__objectPage',
+                        //     attributes: {
+                        //         objectApiName: 'OPDPlan__c',
+                        //         actionName: 'new'
+                        //     },
+                        //     state: {
+                        //         // defaultFieldValues: JSON.stringify(defaultFieldValues)
+                        //         defaultFieldValues: defaultFieldValues
+                        //     }
+                        // };
+                        // this[NavigationMixin.Navigate](pageReference);
+                        // '/lightning/o/Opportunity/new?defaultFieldValues=Name=' + URLENCODE(Account.Name)+ " Opportunity" + ',AccountId=' + Account.Id + ',StageName=' + "Qualification" + ',CloseDate=' + TEXT(TODAY()+30
+                        // if(!this.activityObj.Related_Opportunity1_ID__c) {
+                        //     this.activityObj.Related_Opportunity1_ID__c = '';
+                        // }
+                        // if(!this.activityObj.Related_Opportunity2_ID__c) {
+                        //     this.activityObj.Related_Opportunity2_ID__c = '';
+                        // }
+                        console.log('this.activityObj:');
+                        console.log(this.activityObj.Related_Opportunity1_ID__c);
+                        // alert(this.activityObj.Related_Opportunity1_ID__c);
+                        var openUrl = '/lightning/o/OPDPlan__c/new?defaultFieldValues=Account_Laboratory__c='+this.filter;
+                        if(this.Related_Opportunity1_ID) {
+                            openUrl +=',Related_Opportunity1_ID__c=';
+                            openUrl +=this.Related_Opportunity1_ID;
+                        }
+                        if(this.Related_Opportunity2_ID) {
+                            openUrl += ',Related_Opportunity2_ID__c=';
+                            openUrl += this.Related_Opportunity2_ID;
+                        }
+                        openUrl +=',OPDType__c=';
+                        openUrl +=encodeURI('鏃ユ姤');
+                        openUrl += ',Name=*';
+                        this.showSpinner = false;
+                        window.open(openUrl, '_blank');
+                        // window.open('/lightning/o/OPDPlan__c/new?defaultFieldValues=Account_Laboratory__c='+this.filter
+                        // +',Related_Opportunity1_ID__c='+this.activityObj.Related_Opportunity1_ID__c
+                        // +',Related_Opportunity2_ID__c='+this.activityObj.Related_Opportunity2_ID__c
+                        // +',OPDType__c='+encodeURI('鏃ユ姤'), '_blank');
+                    }else if(type==='checkReport'){
+                        console.log('checkReport!!!');
+                        var eid = this.activityObj.Id;
+                        if (this.stringIsEmpty(eid)) {
+                            eid = this.report.Activity_ID__c;
+                        }
+                        var strVP = this.filter;
+                        this.showSpinner = false;
+                        var urlStr = '/apex/OFSInsReportLayout?rt=EndoscopeSystem&hpid=' + strVP + '&ecid=' + eid;
+                        window.open(urlStr, '_blank');
+                    }else if(type==='OPDOrSIS'){
+                        this.openPD('OPDOrSIS',this.tempRecordTypeName,this.tempReportId);
+                    }else if(type==='NTCOrCDS'){
+                        this.openPD('NTCOrCDS',this.tempRecordTypeName,this.tempReportId);
+                    }else if(type==='addLeadNew'){
+                        this.addLead();
+                    }
+                }else{
+                    this.showToast('error','淇濆瓨澶辫触锛�'+result.msg);
+                    this.showSpinner = false;
+                }
+                // this.showSpinner = false;
+            })
+            .catch(error => {
+                // let errorMessage = "";
+                // error.body.pageErrors.forEach(element => {
+                //     errorMessage += element.message;
+                // });
+                this.showToast('error','淇濆瓨澶辫触锛�'+error);
+                this.showSpinner = false;
+            });
+        }else{
+            this.showSpinner = false;
+        }
+    }
+    //鏂板缓OPD璁″垝
+    newOPDPlan(event){
+        console.log('newOPDPlan');
+        this.showSpinner = true;
+        if (this.stringIsEmpty(this.filter)) {
+            // 瑷晱鍫存墍銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+            this.showToast('error',this.customLabel.Error_Message16);
+            this.showSpinner = false;
+            return;
+        }
+        this.saveTheActivity('newOPDPlan');
+    }
+    OPDOrSIS(event){
+        console.log('OPDOrSIS');
+        console.log(this.visitAim);
+        console.log(this.purposeType1);
+        console.log(this.purposeType2);
+    }
+    beforeHourChange(event) {
+        this.beforeHour = event.detail.value;
+    }
+    beforeMinuteChange(event) {
+        this.beforeMinute = event.detail.value;
+    }
+    afterHourChange(event) {
+        this.afterHour = event.detail.value;
+    }
+    afterMinuteChange(event) {
+        this.afterMinute = event.detail.value;
+    }
+
+    //璁剧疆鎷滆鍖哄垎鏄惁鍙偣鍑�
+    checkVisitChange() {
+        console.log('checkVisitChange start');
+        var changeFlg = false;
+        if(this.contactId1){
+            changeFlg = true;
+        }
+        if(this.contactId2){
+            changeFlg = true;
+        }
+        if(this.contactId3){
+            changeFlg = true;
+        }
+        // if(this.contactId4){
+        //     changeFlg = true;
+        // }
+        // if(this.contactId5){
+        //     changeFlg = true;
+        // }
+        if(this.Related_Opportunity1_ID){
+            changeFlg = true;
+        }
+        if(this.Related_Opportunity2_ID){
+            changeFlg = true;
+        }
+        if(this.Related_Opportunity3_ID){
+            changeFlg = true;
+        }
+        if(this.Related_Service1_ID){
+            changeFlg = true;
+        }
+        // if(this.activityObj.Related_Opportunity4_ID__c){
+        //     changeFlg = true;
+        // }
+        // if(this.activityObj.Related_Opportunity5_ID__c){
+        //     changeFlg = true;
+        // }
+        // if(this.activityObj.Related_Service1_ID__c){
+        //     changeFlg = true;
+        // }
+        if(this.activityObj.OPD_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.NTC_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.OnCall_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.ReportAccompanied_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.CityStatus_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.Claim_ID__c){
+            changeFlg = true;
+        }
+        if(this.activityObj.Conflict_ID__c){
+            changeFlg = true;
+        }
+        console.log('changeFlg锛�'+changeFlg);
+        // if (changeFlg) {
+        //     // 鍊ゃ倰瑷畾銇俱仧銇牨鍛婃浉銈掍綔鎴愩仐銇熷牬鍚堛伅澶夋洿銇с亶銇俱仜銈撱�傝瀹氫簡浠锋牸鎴栬�呭埗浣滀簡鎶ュ憡涔︾殑鎯呭喌涓嬩笉鑳藉彉鏇淬��
+        //     this.visitDis = true;
+        //     // this.showToast('error',this.customLabel.Error_Message21);
+
+        //     // return;
+        // } 
+        this.visitDis = changeFlg;
+    }
+    //鎷滆鍖哄垎鏇存敼
+    visitChange(event) {
+        this.visitValidMes = '';
+        this.requiredVisitor = '';
+        console.log('visitChange');
+        // this.checkVisitChange();
+        this.visit = event.detail.value;
+        this.visitAim = '';
+        this.purposeType1 = '';
+        this.purposeType2 = '';
+        this.purposeType3 = '';
+        // this.purposeType4 = '';
+        // this.purposeType5 = '';
+        console.log('----------');
+        console.log(this.visit);
+        const otherComponents = this.template.querySelectorAll('c-other-look-up');
+            if (otherComponents.length > 0) {
+                otherComponents.forEach(otherComponent => {
+                    console.log('娓呯┖璁块棶鍦烘墍缁勪欢:')
+                    console.log(otherComponent['uniqueKey'])
+                    if(otherComponent['uniqueKey'] =='AccountID') {
+                        otherComponent.handleRemovePill();
+                    } 
+                });
+            }
+        if(this.visit === '鐥呴櫌'){
+            console.log('1鐥呴櫌');
+            this.isAccessAcc = true;
+            this.visitorPalceObjName = 'SearchVisitorPlace';
+            
+        }else if(this.visit === '璨╁2搴�'){
+            console.log('2璨╁2搴�');
+            this.isAccessAcc = true;
+            this.visitorPalceObjName = 'SearchVisitorPlace_Sales';
+        }else if(this.visit === '绀惧唴娲诲嫊'){
+            console.log('3绀惧唴娲诲嫊');
+            this.isAccessAcc = true;
+            this.visitorPalceObjName = 'SearchVisitorPlace_Training';
+        }else if(this.visit === '绀惧銈ゃ儥銉炽儓'){
+            console.log('4绀惧銈ゃ儥銉炽儓');
+            this.isAccessAcc = false;
+            this.visitorPalceObjName = 'SearchVisitorPlace_Campaign';
+            this.visitorPalceFields = ['Campaign.Name'];
+        }else {
+            console.log('5');
+            this.isAccessAcc = true;
+            this.isAccDis = true;
+        }
+        this.filter = '';
+        this.activityObj = {
+                            ...this.activityObj,
+                            ['whatid__c']: ''
+                        };
+        this.setVisitorPlaceDisabled();
+    }
+    //鎷滆鐩殑鏇存敼
+    visitAimChange(event) {
+        console.log('visitAimChangeSales');
+        this.visitAim = event.detail.value;
+        this.purposeType1 = '';
+        this.purposeType2 = '';
+        this.purposeType3 = '';
+        // this.purposeType4 = '';
+        // this.purposeType5 = '';
+        this.requiredvisitAim = '';
+        this.activityObj = {
+                            ...this.activityObj,
+                            ['Purpose__c']: event.detail.value
+                        };
+    }
+    //娲诲姩鍖哄垎鏇存敼
+    purposeType1Change(event) {
+        this.purposeType1 = event.detail.value;
+        // if(isNotSalesService) {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeEscFSE__c']: event.detail.value
+        //     }
+        // } else {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeFSE__c']: event.detail.value
+        //     }
+        // }
+        this.requiredPurposeType = '';
+        this.setReportContractDis();
+        this.setInfrastructureProjectDis();
+    }
+    purposeType2Change(event) {
+        this.purposeType2 = event.detail.value;
+        // if(isNotSalesService) {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeEscFSE2__c']: event.detail.value
+        //     }
+        // } else {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeFSE2__c']: event.detail.value
+        //     }
+        // }
+        this.setReportContractDis();
+        this.setInfrastructureProjectDis();
+    }
+    purposeType3Change(event) {
+        this.purposeType3 = event.detail.value;
+        // if(isNotSalesService) {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeEscFSE3__c']: event.detail.value
+        //     }
+        // } else {
+        //     this.activityObj ={
+        //         ...this.activityObj,
+        //         ['Purpose_TypeFSE3__c']: event.detail.value
+        //     }
+        // }
+        this.setReportContractDis();
+        this.setInfrastructureProjectDis();
+    }
+    // purposeType4Change(event) {
+    //     this.purposeType4 = event.detail.value;
+    // }
+    // purposeType5Change(event) {
+    //     this.purposeType5 = event.detail.value;
+    // }
+    // purposeType5Change(event) {
+    //     this.purposeType5 = event.detail.value;
+    // }
+    //娲诲姩鍖哄垎閫夋嫨鈥滃悎鍚屽鎶モ�濓紝銆愭秹鍙婄殑缁翠慨鍚堝悓銆戙�愬彂鏀句汉銆戙�愬彂鏀炬柟寮忋�戝繀濉�
+    // 娲诲姩鍖哄垎娌¢�夋嫨銆愬悎鍚屽鎶ャ�戯紝銆愬彂鏀句汉銆戙�愬彂鏀炬柟寮忋�戞爣鐏颁笉鍙~锛屻�愭秹鍙婄殑缁翠慨鍚堝悓銆戜笉蹇呭~
+    setReportContractDis() {
+        if(this.purposeType1==='鍚堝悓瀛f姤' || this.purposeType2==='鍚堝悓瀛f姤' || this.purposeType3==='鍚堝悓瀛f姤') {
+            this.isReportContractDis = false;
+            this.isReportContractTypeDis = false;
+        } else {
+            this.activityObj = {
+                            ...this.activityObj,
+                            ['Report_Contract__c']: ''
+                        };
+            this.activityObj = {
+                            ...this.activityObj,
+                            ['Report_Contract_Type__c']: ''
+                        };
+            this.requiredReportContract='';
+            this.requiredReportContractType='';
+            // this.activityObj['Report_Contract_Type__c'] = '';
+            this.isReportContractDis = true;
+            this.isReportContractTypeDis = true;
+        }
+    }
+
+    setInfrastructureProjectDis() {
+        if(this.purposeType1==='鍩哄缓椤圭洰' || this.purposeType2==='鍩哄缓椤圭洰' || this.purposeType3==='鍩哄缓椤圭洰') {
+            this.isInfrastructureProjectDis1 = false;
+            this.isInfrastructureProjectDis2 = false;
+        } else {
+            this.Infrastructure_Project1 = ''
+            this.Infrastructure_Project2 = ''
+            this.isInfrastructureProjectDis1 = true;
+            this.isInfrastructureProjectDis2 = true;
+        }
+    }
+    //鐐规鎶ュ憡涔︽寜閽�
+    checkReport(event){
+        console.log('checkReport');
+        this.showSpinner = true;
+        if (this.activityObj.InsReport_ID__c) {
+            // 鐐规鍫卞憡鏇窱D銇傘倢銇般�佺法闆嗐儮銉笺儔銇�
+            var urlStr = '/apex/OFSInsReportLayout?id=' + this.activityObj.InsReport_ID__c;
+            window.open(urlStr, '_blank');
+            this.showSpinner = false;
+        } else {
+            if (this.stringIsEmpty(this.filter)) {
+                // 瑷晱鍫存墍銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+                this.showToast('error',this.customLabel.Error_Message16);
+                this.showSpinner = false;
+                return;
+            }
+            this.saveTheActivity('checkReport');
+        }
+    }
+    @track OPDId;
+    @track currentTypeId;
+    //OPD/SIS鎸夐挳
+    OPD(){
+
+        console.log('OPD鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'SIS';
+        var hiddenId='idOPD_IdHidden';
+        var redId = 'idOPD';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['Opd_Plan__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.Opd_Plan__c;
+        this.openPDNew('OPDOrSIS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    SISET(){
+        console.log('SISET鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'SIS_ET';
+        var hiddenId='idOPD_IdHidden';
+        var redId = 'idOPD';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['Opd_Plan__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.Opd_Plan__c;
+        this.openPDNew('OPDOrSIS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    SISENG(){
+        console.log('SISENG鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'SIS_ENG';
+        var hiddenId='idOPD_IdHidden';
+        var redId = 'idOPD';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['Opd_Plan__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.Opd_Plan__c;
+        this.openPDNew('OPDOrSIS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    //NTC/CDS鎸夐挳 鏂板搧瑁呮満鍩硅
+    NewInstallTarin(){
+        console.log('NTC/CDS鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'NTC';
+        // var hiddenId='idNTC_IdHidden';
+        var hiddenId='NewInstallTarin';
+        var redId = 'idNTC';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['NTC_ID__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.NTC_ID__c;
+        this.openPDNew('NTCOrCDS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    //鏁呴殰棰勯槻鍩硅
+    FaultPreventionTraining(){
+        console.log('NTC/CDS鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'NTC';
+        // var hiddenId='idNTC_IdHidden';
+        var hiddenId='FaultPreventionTraining';
+        var redId = 'idNTC';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['NTC_ID__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.NTC_ID__c;
+        this.openPDNew('NTCOrCDS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    //鍞悗璺熷彴
+    AftermarketHeel(){
+
+        console.log('NTC/CDS鎸夐挳');
+        var id = this.activityObj.Id;
+        var recordName = 'NTC';
+        // var hiddenId='idNTC_IdHidden';
+        var hiddenId='AftermarketHeel';
+        var redId = 'idNTC';
+        var reportId = this.reportedId;
+        this.activityObj = {
+            ...this.activityObj,
+            ['NTC_ID__c']: ''
+        };
+        var _OPDId = this.activityObj.Opd_Plan__c;
+        this.currentTypeId = this.activityObj.NTC_ID__c;
+        this.openPDNew('NTCOrCDS',id,recordName,hiddenId,redId,reportId,_OPDId,this.currentTypeId);
+    }
+    @track hiddenDivShowFlg = true;
+    openPDNew(type,id, recordName, hiddenId, redId, reportId,_OPDId,currentTypeId) {
+        
+        console.log('openPDNew');
+        var hiId = currentTypeId;
+        var rsflg = this.reportStatusFlg;
+        this.hiddenDivShowFlg = false;
+        console.log(this.hiddenDivShowFlg);
+        console.log(rsflg);
+        console.log('event_id:'+hiId);
+        if (rsflg === false) {
+            if (hiId) {
+                let urlStr = '/lightning/r/Event__c/'+hiId+'/view';
+                console.log(urlStr);
+                window.open(urlStr, "_blank");
+                return;
+            } else {
+                this.showToast('error','鏃犳硶鏂板缓鎶ュ憡涔�');
+                return;
+            }
+        }
+        if (this.reportedDate) {
+                
+        }else{
+            // 鏃ヤ粯銈掑叆鍔涖仐銇︺亸銇犮仌銇勩��
+            this.showToast('error',this.customLabel.Error_Message22);
+            this.setVisitorPlaceDisabled();
+            return;
+        }
+         //楠岃瘉鎶ュ憡鐨勬椂闂�
+        var flag = this.validOther();
+        if(!flag){
+            return;
+        }
+        if (this.stringIsEmpty(this.filter)) {
+            // 瑷晱鍫存墍銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+            this.showToast('error',this.customLabel.Error_Message16);
+            this.setVisitorPlaceDisabled();
+            return;
+        }
+        if (this.stringIsEmpty(this.purposeType1)) {
+            // 娲诲嫊鍖哄垎銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+            this.showToast('error',this.customLabel.Error_Message18);
+            this.setVisitorPlaceDisabled();
+            return;
+        }
+        
+       
+
+        this.tempId = id;
+        //2022-4-22 yjk 濡傛灉鑱岀鏄帹骞匡紝鍒欓粯璁ょ粰tempRecordTypeName 灏哋PD鐨勫�兼敼涓� 璧嬪�� SIS start
+        if(this.reportOwner.Job_Category__c === '鎺ㄥ箍' && recordName === 'OPD'){
+            this.tempRecordTypeName = 'SIS';
+        }else{
+            this.tempRecordTypeName = recordName;
+        }
+        //2022-4-22 yjk 濡傛灉鑱岀鏄帹骞匡紝鍒欓粯璁ょ粰tempRecordTypeName 灏哋PD鐨勫�兼敼涓� 璧嬪�� SIS end
+        this.tempBtnIdHidden = hiddenId;
+        this.tempRedId = redId;
+        this.tempReportId = reportId;
+        this.OPDId = _OPDId;       
+        // if ((this.reportOwner.ProfileId !== '00e10000000Y3o5' || this.reportOwner.Batch_User__c !== 'true') &&
+        if ((this.reportOwner.Profile.Name !== '绯荤粺绠$悊鍛�' || this.reportOwner.Batch_User__c !== 'true') &&
+            this.report.Status__c === '鎵胯獚' &&
+            this.reportOwner.Id !== this.reportOwner.ManagerId &&
+            this.reportOwner.Id !== this.reportOwner.BuchangApprovalManager__c &&
+            this.reportOwner.Id !== this.reportOwner.BuchangApprovalManagerSales__c) {
+            // alert('error 1140');
+            this.showToast('error','宸茬粡鎵瑰噯鐨勬棩鎶ヤ腑锛屼笉鑳芥柊寤烘姤鍛婁功');
+            this.setVisitorPlaceDisabled();
+            return;
+        }
+        
+        // 娲诲嫊1,2,3 銈備繚瀛樸仐銇熴亜銇с仚銆傘仢銇椼仸Trigger銇仸鍟嗚珖銇仼銇儏鍫便倰绌嶃伩涓娿亽銇俱仚
+        this.saveTheActivity(type);
+    }
+    openPD(type,recordName,reportId) {
+
+        console.log('openPD');
+        console.log(type);
+        console.log(this.currentTypeId);
+        // j$(escapeVfId('Page:mainForm:idDayEdit:idActivities:' + index + ':' + hiddenId))
+        if (this.stringIsEmpty(this.currentTypeId)) {
+            console.log('11111111111');
+            var reId = reportId;
+            var aId = this.filter;
+            var rId = '';
+            if (recordName == 'OPD' || recordName == 'SIS' || recordName == 'SIS_ET' || recordName == 'SIS_ENG') {
+                console.log('xxxx');
+                var dtStr = this.reportedDate+'';
+                var dt = new Date(dtStr);
+                var sTime = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate(),this.beforeHour,this.beforeMinute,0,0);
+                var eTime = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate(),this.afterHour,this.afterMinute,0,0);
+                // 20210107 SWAG-BX24F5 you start
+                console.log(recordName + '==2021==' + this.reportOwner.Job_Category__c);
+                // if (this.reportOwner.Job_Category__c == '閿�鍞湇鍔�') {
+                //     console.log('1');
+                //     recordName = 'OPD';
+                // } else 
+                if (this.reportOwner.Job_Category__c === '鎺ㄥ箍' && recordName === 'OPD') {//2022-4-21 yjk 閿�鍞帹骞挎敼涓烘帹骞�
+                    console.log('2');
+                    //2021/01/27 liying start
+                    this.hiddenDivShowFlg = true;
+                   // this.showModal = true;
+                   this.createOPDSISReport();
+                   // this.showSpinner = false;
+                   return;
+               }else if (this.hiddenDivShowFlg === false) {
+                   console.log('3');
+                   // 鍏ュ姏銉併偋銉冦偗瀹屼簡銇椼仧銈夈�併亾銇撱亱銈塪iv銈掑嚭銇�
+                   // div銇嬨倝浣滄垚銇欍倠鏅傘�乭iddenDivShowFlg銈抰rue銇仐銆佸牨鍛婃浉浣滄垚銉偢銉冦偗銇�
+                   this.hiddenDivShowFlg = true;
+                   console.log('4');
+                   // this.showModal = true;
+                   this.createOPDSISReport();
+                   console.log('5');
+                   console.log(this.showModal);
+                   // this.showSpinner = false;
+                    return;
+                }
+                console.log(this.hiddenDivShowFlg);
+                console.log('4');
+
+                addReportOPWithEvaluationPDF({ repOwnerId: this.reportOwner.Id, 
+                    dailyReportId: reId,eventId: this.activityObj.Id, recordType: recordName, aId: aId, 
+                    visitor1: this.contactId1, visitor2: this.contactId2, visitor3: this.contactId3, 
+                    // visitor4: this.contactId4, visitor5: this.contactId5, 
+                    opp1: this.Related_Opportunity1_ID, 
+                    opp2: this.Related_Opportunity2_ID, opp3: this.Related_Opportunity3_ID, 
+                    // opp4: this.activityObj.Related_Opportunity4_ID__c,opp5: this.activityObj.Related_Opportunity5_ID__c, 
+                    reportDate: this.reportedDate, sTime: sTime, eTime: eTime})
+                    .then(result => {
+                          
+                        console.log('4-1');
+                        rId = result;
+                        this.activityObj = {
+                            ...this.activityObj,
+                            ['OPD_ID__c']: rId
+                        };
+                        if(recordName == 'SIS' ) {
+                             this.activityObj = {
+                                ...this.activityObj,
+                                ['SIS_FLAG__c']: true
+                            };
+                        } else if( recordName == 'SIS_ET' ) {
+                            this.activityObj = {
+                                ...this.activityObj,
+                                ['SIS_ET_FLAG__c']: true
+                            };
+
+                        } else if(recordName == 'SIS_ENG') {
+                            this.activityObj = {
+                                ...this.activityObj,
+                                ['SIS_ENG_FLAG__c']: true
+                            };
+                        }
+                        this.currentTypeId = rId;
+                        this.navaicateUrl(); 
+                    })
+                    .catch(error => {
+                        console.log('4-2');
+                        let errorMessage = "";
+                        error.body.pageErrors.forEach(element => {
+                            errorMessage += element.message;
+                        });
+                        this.showToast('error',errorMessage);
+                        this.showSpinner = false;
+
+                        console.log('4-2-1');
+                    });
+            } else if (recordName === 'NTC') {
+                console.log('NTC!!!!!');
+                if(this.tempBtnIdHidden==='NewInstallTarin'){
+                    recordName = 'NewInstallTarin';
+                }else if(this.tempBtnIdHidden==='FaultPreventionTraining'){
+                    recordName = 'FaultPreventionTraining';
+                }else if(this.tempBtnIdHidden==='AftermarketHeel'){ //鍞悗璺熷彴
+                    recordName = 'OPD';
+                }
+                addReportNT({ repOwnerId: this.reportOwner.Id, dailyReportId: reId, 
+                    eventId: this.activityObj.Id, recordType: recordName, aId: aId, visitor1: this.contactId1, visitor2: this.contactId2, 
+                    // visitor3: this.contactId3, visitor4: this.contactId4, visitor5: this.contactId5, sTime: sTime, eTime: eTime})
+                    visitor3: this.contactId3,  sTime: sTime, eTime: eTime})
+                    .then(result => {
+                        // console.log('ntc addReportNT result:'+result);
+                        rId = result;
+                        this.activityObj = {
+                            ...this.activityObj,
+                            ['NTC_ID__c']: rId
+                        };
+                        if(recordName == 'NewInstallTarin' ) {
+                             this.activityObj = {
+                                ...this.activityObj,
+                                ['NewInstallTarin_FLAG__c']: true
+                            };
+                        } else if( recordName == 'FaultPreventionTraining' ) {
+                            this.activityObj = {
+                                ...this.activityObj,
+                                ['FaultPreventionTraining_FLAG__c']: true
+                            };
+
+                        } else if(recordName == 'OPD') {
+                            this.activityObj = {
+                                ...this.activityObj,
+                                ['OPD_FLAG__c']: true
+                            };
+                        }
+                        this.currentTypeId = rId;
+                        this.navaicateUrl(); 
+                    })
+                    .catch(error => {
+                        // console.log('ntc addReportNT error:' + error);
+                        let errorMessage = "";
+                        error.body.pageErrors.forEach(element => {
+                            errorMessage += element.message;
+                        });
+                        this.showToast('error',errorMessage);
+                        this.showSpinner = false;
+                    });
+            }
+        }else{
+            this.navaicateUrl(); 
+        }
+        // this.showSpinner = false;
+        console.log('------------------');
+    }
+    navaicateUrl(){
+         
+        this.showSpinner = false;
+        console.log('navaicateUrl');
+        // var urlStr = '/' + this.currentTypeId + '/e?retURL=%2F' + this.currentTypeId+'&CF00N10000008ps6d_lkid='+this.OPDId;//2022-4-17 yjk 
+        var urlStr = '/' + this.currentTypeId + '/e?retURL=%2F' + this.currentTypeId+'&Report_OPDPlan__c='+this.OPDId;//2022-4-17 yjk 
+        console.log(urlStr+'!!!!!!!!!!!!!!!!!!!');
+        window.open(urlStr, '_blank');
+        this.resetOPDSISRadio();
+        this.showModal = false;
+    }
+    typeChange(event){
+        console.log('typeChange');
+        this.tempRecordTypeName = event.target.value;
+        console.log(this.tempRecordTypeName);
+    }
+    createOPDSISReport() {
+        console.log('createOPDSISReport');
+        console.log(this.tempRecordTypeName);
+        this.hiddenDivShowFlg = true;
+        this.openPD('OPDOrSIS',this.tempRecordTypeName,this.tempReportId);
+    }
+    closeOPDSISDiv() {
+        this.showModal = false;
+        this.hiddenDivShowFlg = false;
+        resetOPDSISRadio();
+    }
+    resetOPDSISRadio() {
+        if(this.reportOwner.Job_Category__c==='閿�鍞帹骞�'){
+            this.tempRecordTypeName = 'SIS';
+        }else{
+            this.tempRecordTypeName = 'OPD';
+        }
+    }
+    //璁剧疆鎵�鏈夌殑鎸夐挳鍜岃緭鍏ユdisable
+    @api
+    setVisitorPlaceDisabled() {
+        // this.allDisableFlg = true;
+        console.log('setVisitorPlaceDisabled:'+this.allDisableFlg);
+        if(this.allDisableFlg){
+            this.setNotVisible();
+            return;
+        }
+        this.isPlaceDis=false;
+        this.isConDis1=false;
+        this.isConDis2=false;
+        this.isConDis3=false;
+        this.isOppDis1=false;
+        this.isOppDis2=false;
+        this.isOppDis3=false;
+        this.isTransferEtDis=false;
+        this.isActivityEtDis=false;
+        this.isupdateAccInfoDis=false;
+        this.isNewOpdDis=false;
+        this.isCheckReportDis=false;
+        this.isOPDSISDis=false;
+        this.isNTCCDSDis=false;
+        this.isNewBuyDis=false;
+        this.isOppUpdateDis1=false;
+        this.isLoseDis1=false;
+        this.isOppUpdateDis2=false;
+        this.isLoseDis2=false;
+        this.isOppUpdateDis3=false;
+        this.isLoseDis3=false;
+        this.beforeHourDis = false;
+        this.beforeMinuteDis = false;
+        this.afterHourDis = false;
+        this.afterMinuteDis = false;
+        this.visitDis = false;
+        this.visitAimDis = false;
+        this.Purpose_TypeEscFSEDis = false;
+        this.Purpose_TypeEscFSE2Dis = false;
+        this.Purpose_TypeEscFSE3Dis = false;
+        this.Purpose_TypeFSEDis = false;
+        this.Purpose_TypeFSE2Dis = false;
+        this.Purpose_TypeFSE3Dis = false;
+        this.DescriptionDis = false;
+        this.Find_Imitations_FlagDis = false;
+        this.cancelReasonSelectDis = false;
+        this.cancelReasonSelectFSEDis = false;
+        this.cancelReasonOtherDis = false;
+        this.delayReasonSelectDis = false;
+        this.delayReasonSelectFSEDis = false;
+        this.delayReasonOtherDis = false;
+        this.delayToDateDis = false;
+        this.cancelsaveJSDis = false;
+        this.delaysaveJSDis = false;
+        this.isUseReportDis = false;
+        this.isRelatedServiceDis = false;
+        this.isAccDis = false;
+        this.saveDis = false;
+        console.log(this.visit);
+        if(this.visit === '鐥呴櫌'){//鐢ㄦ埛鎷滆
+            console.log('1');
+        }else if(this.visit === '璨╁2搴�'){//缁忛攢鍟嗘嫓璁�
+            console.log('2');
+            this.isConDis1 = true;
+            this.isConDis2 = true;
+            this.isConDis3 = true;
+            this.isTransferEtDis = true;
+            this.isActivityEtDis = true;
+            this.isupdateAccInfoDis = true;
+            this.isNewOpdDis = true;
+            this.isCheckReportDis = true;
+            this.isOPDSISDis = true;
+            this.isNTCCDSDis = true;
+            this.isNewBuyDis = true;
+            this.isRelatedServiceDis = true;
+        }else if(this.visit === '绀惧唴娲诲嫊'){//鍏徃宸ヤ綔
+            console.log('3');
+            this.isConDis1 = true;
+            this.isConDis2 = true;
+            this.isConDis3 = true;
+            this.isOppDis1 = true;
+            this.isOppDis2 = true;
+            this.isOppDis3 = true;
+            this.isNewBuyDis = true;
+            this.isNewOpdDis = true;
+            this.isCheckReportDis = true;
+            this.isTransferEtDis = true;
+            this.isActivityEtDis = true;
+            this.isupdateAccInfoDis = true;
+            this.isRelatedServiceDis = true;
+        }else if(this.visit === '绀惧銈ゃ儥銉炽儓'){//瀛︽湳浼氳
+            console.log('4');
+            this.isConDis1 = true;
+            this.isConDis2 = true;
+            this.isConDis3 = true;
+            this.isOppDis1 = true;
+            this.isOppDis2 = true;
+            this.isOppDis3 = true;
+            this.isTransferEtDis = true;
+            this.isActivityEtDis = true;
+            this.isupdateAccInfoDis = true;
+            this.isNewOpdDis = true;
+            this.isCheckReportDis = true;
+            this.isOPDSISDis = true;
+            this.isNTCCDSDis = true;
+            this.isNewBuyDis = true;
+            this.isRelatedServiceDis = true;
+        }else{
+            console.log('5');
+            console.log(this.reportReportFlg);
+            //璁块棶鍦烘墍
+            this.isPlaceDis = true;
+            this.isAccDis = true;
+            
+            //璁块棶瀵硅薄
+            this.isConDis1 = true;
+            this.isConDis2 = true;
+            this.isConDis3 = true;
+            //娑夊強鐨勮浠�
+            this.isOppDis1 = true;
+            this.isOppDis2 = true;
+            this.isOppDis3 = true;
+            //杞嚦ET App鎸夐挳
+            this.isTransferEtDis = true;
+            //ET App娲诲姩鎸夐挳
+            this.isActivityEtDis = true;
+            //鏇存柊瀹㈡埛淇℃伅鎸夐挳
+            this.isupdateAccInfoDis = true;
+            //鏂板缓OPD璁″垝鎸夐挳
+            this.isNewOpdDis = true;
+            //鐐规鎶ュ憡涔︽寜閽�
+            this.isCheckReportDis = true;
+            //OPD/SIS鎸夐挳
+            this.isOPDSISDis = true;
+            //NTC/CDS鎸夐挳
+            this.isNTCCDSDis = true;
+            //鏂板缓璐拱鎰忓悜鎸夐挳
+            this.isNewBuyDis = true;
+            //缁翠慨鍚堝悓
+            this.isRelatedServiceDis = true;
+        }
+       
+        this.setReportContractDis();
+        this.setInfrastructureProjectDis();
+
+        // if(this.isOppDis1===true||this.stringIsEmpty(this.activityObj.Related_Opportunity1_ID__c)){
+        if(this.isOppDis1===true||this.stringIsEmpty(this.Related_Opportunity1_ID)){
+            //璇环鏇存柊鎸夐挳
+            this.isOppUpdateDis1 = true;
+            //澶卞崟鎸夐挳
+            this.isLoseDis1 = true;
+        }else{
+            this.isOppUpdateDis1 = false;
+            this.isLoseDis1 = false;
+        }
+        if(this.isOppDis2===true||this.stringIsEmpty(this.Related_Opportunity2_ID)){
+            //璇环鏇存柊鎸夐挳
+            this.isOppUpdateDis2 = true;
+            //澶卞崟鎸夐挳
+            this.isLoseDis2 = true;
+        }else{
+            this.isOppUpdateDis2 = false;
+            this.isLoseDis2 = false;
+        }
+        if(this.isOppDis3===true||this.stringIsEmpty(this.Related_Opportunity3_ID)){
+            //璇环鏇存柊鎸夐挳
+            this.isOppUpdateDis3 = true;
+            //澶卞崟鎸夐挳
+            this.isLoseDis3 = true;
+        }else{
+            this.isOppUpdateDis3 = false;
+            this.isLoseDis3 = false;
+        }
+        if (!this.isNotSalesService) {
+            //鍚堝悓鐐规鐨勪笉闇�瑕佷俊鎭洿鏂�
+            if(this.activityObj.Related_Service1_ID__c){
+                if(this.purposeType1==='鍚堝悓瀛f姤'){
+                    this.isInfoUpdateDis = false;
+                }
+            }
+        }
+        //濡傛灉娌″緱鎶ュ憡涔︽潈闄�
+        if(this.reportReportFlg){
+            if(!this.isOPDSISDis){
+                this.isOPDSISDis = true;
+            }
+            if(!this.isNTCCDSDis){
+                this.isNTCCDSDis = true;
+            }
+        }
+        this.checkVisitChange();
+        this.initDelayAndCancel();
+        //濡傛灉鎶ュ憡涓�瑙堢殑鏈夊�硷紝鎵�鏈夎緭鍏ヤ俊鎭笉鍑嗘洿鏀�
+        // if(!this.stringIsEmpty(this.activityObj.eventStatus__c) && !this.readReportFlag){
+        if(!this.stringIsEmpty(this.activityObj.eventStatus__c) ){
+            console.log('濡傛灉鎶ュ憡涓�瑙堢殑鐘舵�佹湁鍊硷紝鎵�鏈夎緭鍏ヤ俊鎭笉鍑嗘洿鏀�');
+            this.isPlaceDis = true;
+            this.isConDis1 = true;
+            this.isConDis2 = true;
+            this.isConDis3 = true;
+            this.isOppDis1 = true;
+            this.isOppDis2 = true;
+            this.isOppDis3 = true;
+
+            this.beforeHourDis = true;
+            this.beforeMinuteDis = true;
+            this.afterHourDis = true;
+            this.afterMinuteDis = true;
+            this.visitDis = true;
+            this.visitAimDis = true;
+            this.Purpose_TypeEscFSEDis = true;
+            this.Purpose_TypeEscFSE2Dis = true;
+            this.Purpose_TypeEscFSE3Dis = true;
+            this.Purpose_TypeFSEDis = true;
+            this.Purpose_TypeFSE2Dis = true;
+            this.Purpose_TypeFSE3Dis = true;
+            this.DescriptionDis = true;
+            this.Find_Imitations_FlagDis = true;
+            this.cancelReasonSelectDis = true;
+            this.cancelReasonSelectFSEDis = true;
+            this.cancelReasonOtherDis = true;
+            this.delayReasonSelectDis = true;
+            this.delayReasonSelectFSEDis = true;
+            this.delayReasonOtherDis = true;
+            this.delayToDateDis = true;
+            this.cancelsaveJSDis = true;
+            this.delaysaveJSDis = true;
+            this.isUseReportDis = true;
+            this.isRelatedServiceDis = true;
+            this.isAccDis = true;
+            this.isupdateAccInfoDis = true;
+            this.isNewBuyDis = true;
+            this.isNewOpdDis = true;
+            this.isOPDSISDis = true;
+            this.isTransferEtDis = true;
+            this.isActivityEtDis = true;
+            this.isCheckReportDis = true;
+            this.isNTCCDSDis = true;
+            this.isReportContractDis = true;
+            this.isReportContractTypeDis = true;
+            this.isInfrastructureProjectDis1 = true;
+            this.isInfrastructureProjectDis2 = true;
+        }
+        console.log('setVisitorPlaceDisabled 缁撴潫');
+    }
+    @api
+    setNotVisible(){
+        console.log('activeConten setNotVisible1');
+        // const allInputsAndButtons = this.template.querySelectorAll('lightning-input, lightning-button,lightning-input-field');
+        // allInputsAndButtons.forEach(element => {
+        //     element.disabled = true;
+        // });
+        // this.isAccDis = true;
+        // this.isConDis1 = true;
+        // this.isConDis2 = true;
+        // this.isConDis3 = true;
+        this.isPlaceDis=true;
+        this.isConDis1=true;
+        this.isConDis2=true;
+        this.isConDis3=true;
+        this.isOppDis1=true;
+        this.isOppDis2=true;
+        this.isOppDis3=true;
+        this.isTransferEtDis=true;
+        this.isActivityEtDis=true;
+        this.isupdateAccInfoDis=true;
+        this.isNewOpdDis=true;
+        this.isCheckReportDis=true;
+        this.isOPDSISDis=true;
+        this.isNTCCDSDis=true;
+        this.isNewBuyDis=true;
+        this.isOppUpdateDis1=true;
+        this.isLoseDis1=true;
+        this.isOppUpdateDis2=true;
+        this.isLoseDis2=true;
+        this.isOppUpdateDis3=true;
+        this.isLoseDis3=true;
+        this.beforeHourDis = true;
+        this.beforeMinuteDis = true;
+        this.afterHourDis = true;
+        this.afterMinuteDis = true;
+        this.visitDis = true;
+        this.visitAimDis = true;
+        this.Purpose_TypeEscFSEDis = true;
+        this.Purpose_TypeEscFSE2Dis = true;
+        this.Purpose_TypeEscFSE3Dis = true;
+        this.Purpose_TypeFSEDis = true;
+        this.Purpose_TypeFSE2Dis = true;
+        this.Purpose_TypeFSE3Dis = true;
+        this.DescriptionDis = true;
+        this.Find_Imitations_FlagDis = true;
+        this.cancelReasonSelectDis = true;
+        this.cancelReasonSelectFSEDis = true;
+        this.cancelReasonOtherDis = true;
+        this.delayReasonSelectDis = true;
+        this.delayReasonSelectFSEDis = true;
+        this.delayReasonOtherDis = true;
+        this.delayToDateDis = true;
+        this.cancelsaveJSDis = true;
+        this.delaysaveJSDis = true;
+        this.isUseReportDis = true;
+        this.isRelatedServiceDis = true;
+        this.isAccDis = true;
+        this.isInfrastructureProjectDis1 = true;
+        this.isInfrastructureProjectDis2 = true;
+        this.saveDis = true;
+
+        console.log('this.beforeHourDis:' + this.beforeHourDis);
+    }
+    @api
+    setVisible(){
+        console.log('activeContent setVisible 1424');
+        // const allInputsAndButtons = this.template.querySelectorAll('lightning-input, lightning-button,lightning-input-field');
+        // allInputsAndButtons.forEach(element => {
+        //     element.disabled = false;
+        // });
+        this.isPlaceDis=false;
+        this.isConDis1=false;
+        this.isConDis2=false;
+        this.isConDis3=false;
+        this.isOppDis1=false;
+        this.isOppDis2=false;
+        this.isOppDis3=false;
+        this.isTransferEtDis=false;
+        this.isActivityEtDis=false;
+        this.isupdateAccInfoDis=false;
+        this.isNewOpdDis=false;
+        this.isCheckReportDis=false;
+        this.isOPDSISDis=false;
+        this.isNTCCDSDis=false;
+        this.isNewBuyDis=false;
+        this.isOppUpdateDis1=false;
+        this.isLoseDis1=false;
+        this.isOppUpdateDis2=false;
+        this.isLoseDis2=false;
+        this.isOppUpdateDis3=false;
+        this.isLoseDis3=false;
+        this.beforeHourDis = false;
+        this.beforeMinuteDis = false;
+        this.afterHourDis = false;
+        this.afterMinuteDis = false;
+        this.visitDis = false;
+        this.visitAimDis = false;
+        this.Purpose_TypeEscFSEDis = false;
+        this.Purpose_TypeEscFSE2Dis = false;
+        this.Purpose_TypeEscFSE3Dis = false;
+        this.Purpose_TypeFSEDis = false;
+        this.Purpose_TypeFSE2Dis = false;
+        this.Purpose_TypeFSE3Dis = false;
+        this.DescriptionDis = false;
+        this.Find_Imitations_FlagDis = false;
+        this.cancelReasonSelectDis = false;
+        this.cancelReasonSelectFSEDis = false;
+        this.cancelReasonOtherDis = false;
+        this.delayReasonSelectDis = false;
+        this.delayReasonSelectFSEDis = false;
+        this.delayReasonOtherDis = false;
+        this.delayToDateDis = false;
+        this.cancelsaveJSDis = false;
+        this.delaysaveJSDis = false;
+        this.isUseReportDis = false;
+        this.isRelatedServiceDis = false;
+    }
+    //鏇存柊瀹㈡埛淇℃伅
+    updateAccInfo(){
+        if(this.filter){
+            //鏌ヨ璇ヨ闂満鎵�鐨勬垬鐣ョ瀹ゅ垎绫�
+            queryDepartmentClass({ accId: this.filter})
+                .then(result => {
+                    if(result){
+                        var urlStr = '/' + result;
+                        window.open(urlStr,'_blank','');
+                    }else{
+                        this.showToast('error','璇ヨ闂満鎵�娌℃湁鎴樼暐绉戝鍒嗙被');
+                    }
+                })
+                .catch(error => {
+                    let errorMessage = "";
+                    error.body.pageErrors.forEach(element => {
+                        errorMessage += element.message;
+                    });
+                    this.showToast('error','澶辫触锛�'+errorMessage);
+                });
+        }else{
+            this.showToast('error','璇峰厛閫夋嫨璁块棶鍦烘墍');
+        }
+    }
+      // 2018/11/21 SWAG-B6Q8BS 鍒ゆ柇鏄惁闇�瑕佸脊绐楁洿鏂板鎴蜂俊鎭� start
+    // 2018/11/21 SWAG-B6Q8BS 鍒濆鍖栬缃鑹蹭娇鐢�
+    @api
+    setColor(){
+        // var ProfileId_2S1 = '{!$Label.ProfileId_2S1}';
+        // var salesman2S1_Price = '{!$Label.salesman2S1_Price}';
+        // var completionFlg = '{!completionFlg}';
+        //2S1_閿�鍞尰闄㈡媴褰� 鍜� 2S1_閿�鍞尰闄㈡媴褰�(鏌ョ湅浠锋牸)
+        
+        // if("{!$Profile.Id}" != ProfileId_2S1 && "{!$Profile.Id}" != salesman2S1_Price){
+        //     return;
+        // }
+        if(this.reportOwner.ProfileId!=this.ProfileId_2S1 && this.reportOwner.ProfileId!=this.salesman2S1_Price) {
+            
+            return false;
+        } else {
+            this.updateAccInfoColor = this.activityObj.IsAlertInputDep__c;
+            return this.activityObj.IsAlertInputDep__c;
+        }
+        // var actSize =  '{!actSize}';
+        // var alertflg = false;
+        //  for(var i = 0;i<actSize; i++){
+        //     var TempElement =  document.getElementById("Page:mainForm:idDayEdit:idActivities:"+ i +":alertStringValue");
+        //     var IsAlertInputDep = 'false';
+        //     if( TempElement != null && TempElement != undefined ){
+        //         IsAlertInputDep = TempElement.value;
+        //         TempElement.value ='false';
+        //     }
+        //     if(IsAlertInputDep == 'true'){
+        //         TempElement = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+ i +":idVisitorPlace");
+        //         if(TempElement != null && TempElement != undefined ){
+        //             TempElement.style.color ='red';
+        //             alertflg = true;
+        //         }
+        //     }
+        // }
+        // if(alertflg ==true && typeof completionFlg != "undefined" && completionFlg != null && completionFlg != ""){
+        //     alert('鎷滆H灞傚鎴锋椂锛岃娉ㄦ剰鏀堕泦鐥呬緥鏁颁俊鎭紝鎸�"鏇存柊瀹㈡埛淇℃伅"鎸夐挳鐧诲綍');
+        // }
+    }
+    // 2018/11/21 SWAG-B6Q8BS 鍒ゆ柇鏄惁闇�瑕佸脊绐楁洿鏂板鎴蜂俊鎭� end
+    //杞嚦ET APP
+    toETAPP(){
+        console.log('toETAPP');
+        if(window.confirm('璇峰厛淇濆瓨鏃ユ姤鍐嶈烦杞�傛棩鎶ユ槸鍚﹀凡缁忎繚瀛橈紵')){
+            if(this.filter){
+                //鏌ヨ璇ヨ闂満鎵�鐨勫尰闄�(绉戝)
+                queryHospital({ accId: this.filter})
+                .then(result => {
+                    console.log('11111111111111111');
+                    console.log('queryHospital.result:'+result);
+                    if(result){
+                        var urlStr = 'ocsmet://Activity/' + result;
+                        console.log(urlStr);
+                        window.open(urlStr, '_blank', '');
+                    }else{
+                        this.showToast('error','璇ヨ闂満鎵�娌℃湁鍖婚櫌(绉戝)');
+                    }
+                })
+                .catch(error => {
+                    let errorMessage = "";
+                    error.body.pageErrors.forEach(element => {
+                        errorMessage += element.message;
+                    });
+                    this.showToast('error','澶辫触锛�'+errorMessage);
+                });
+            }else{
+                this.showToast('error','娌℃湁閫夋嫨鍖婚櫌锛屼笉鑳借烦杞�');
+            }
+        }
+    }
+    //ET APP娲诲姩
+    ETAPPAct(){
+        if(this.filter && this.filter.startsWith("001")){
+           
+            var urlStr = '/apex/productsh?Id=' + this.filter;
+            window.open(urlStr, '_blank', '');
+            //鏌ヨ璇ヨ闂満鎵�鐨勬垬鐣ョ瀹ゅ垎绫�
+            // queryDepartmentClass({ accId: this.filter})
+            //     .then(result => {
+            //         if(result){
+            //             var urlStr = '/' + result;
+            //             window.open(urlStr,'_blank');
+            //         }else{
+            //             this.showToast('error','璇ヨ闂満鎵�娌℃湁鎴樼暐绉戝鍒嗙被');
+            //         }
+            //     })
+            //     .catch(error => {
+            //         let errorMessage = "";
+            //         error.body.pageErrors.forEach(element => {
+            //             errorMessage += element.message;
+            //         });
+            //         this.showToast('error','澶辫触锛�'+errorMessage);
+            //     });
+        }else{
+            this.showToast('error','璇峰厛閫夋嫨璁块棶鍦烘墍');
+        }
+    }
+    //璁块棶鍦烘墍涓嶅厑璁镐慨鏀�
+    vpChack1() {
+        console.log('vpChack1');
+        console.log(!this.stringIsEmpty(this.filter));
+        console.log(!this.stringIsEmpty(this.activityObj.Event_ID__c));
+        if(!this.stringIsEmpty(this.filter)&&!this.stringIsEmpty(this.activityObj.Event_ID__c)){
+            this.isAccDis = true;
+        }
+        if(!this.stringIsEmpty(this.visit)&&!this.stringIsEmpty(this.activityObj.Event_ID__c)){
+            this.visitDis = true;
+        }
+        if (this.reportOwner.Job_Category__c === '閿�鍞湇鍔�') {
+            var puroposeTypeFSE1 = this.activityObj.Purpose_TypeFSE__c;
+            if ((puroposeTypeFSE1 === '鍚堝悓瀛f姤'||puroposeTypeFSE1 === '鍚堝悓鐐规') && !this.stringIsEmpty(this.activityObj.Event_ID__c)) {
+                this.Purpose_TypeFSEDis = true;
+                this.visitAimDis = true;
+                this.isRelatedServiceDis = true;
+            }
+        }
+    }
+    setRelOppId(index, id, hiddenId){
+        var str = 'Page:mainForm:idDayEdit:idActivities:'+ index + ':' + id;
+        var strPD = 'Page:mainForm:idDayEdit:idActivities:'+ index + ':idVisitorPlace';
+        var aNamePD = j$(escapeVfId(strPD)).value();
+        if(aNamePD == ''){
+            // 瑷晱鍫存墍銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+            document.getElementById(str).blur();
+            alert(Error_Message16);
+            return;
+        }
+        
+        var strVP = 'Page:mainForm:idDayEdit:idActivities:'+ index + ':idVisitorPlaceId';
+        var vl = j$(escapeVfId(strVP)).value();
+        if(vl.length == 0){
+            // 瑷晱鍫存墍銇屽瓨鍦ㄣ仐銇俱仜銈撱��
+            document.getElementById(str).blur();
+            alert(Error_Message15);
+            return;
+        }
+        
+        var match = sforce.apex.execute("Add_Report","checkAccountMatch",{name:aNamePD,id:vl});
+        if(match == "NG"){
+            // 瑷晱鍫存墍ID銉炪儍銉併仐銇︺亜銇亜
+            document.getElementById(str).blur();
+            alert("鏃犳硶纭畾璁块棶鍦烘墍锛岃鍐嶈瀹氫竴娆¤闂満鎵�銆�");
+            return;
+        }
+        var strPage = '/apex/Xin_SearchOpportunity?r=' + encodeURI(vl);
+        jQuery(escapeVfId(str)).unbind();
+        jQuery(escapeVfId(str)).suggest(strPage,{});
+        //DoubleTap銈ゃ儥銉炽儓銈抌ind
+        bindDoubleTap(index, id, hiddenId);
+    }
+    //璇环鏇存柊鎸夐挳
+    oppUpdate(event){
+        var indexNumber = event.target.name;
+        var oppId = '';
+        if(indexNumber==='1'){
+            // oppId = this.activityObj.Related_Opportunity1_ID__c;
+            oppId = this.Related_Opportunity1_ID;
+        }else if(indexNumber==='2'){
+            oppId = this.Related_Opportunity2_ID;
+        }else if(indexNumber==='3'){
+            oppId = this.Related_Opportunity3_ID;
+        }
+        window.open("/apex/EnquiryDetails?EsetId="+oppId+"&indexNumber="+indexNumber,'_blank','width=850px,height=520px');
+    }
+    //澶卞崟鎸夐挳
+    loseOpp(event){
+        var indexNumber = event.target.name;
+        var oppId = '';
+        if(indexNumber==='1'){
+            // oppId = this.activityObj.Related_Opportunity1_ID__c;
+            oppId = this.Related_Opportunity1_ID;
+        }else if(indexNumber==='2'){
+            oppId = this.Related_Opportunity2_ID;
+        }else if(indexNumber==='3'){
+            oppId = this.Related_Opportunity3_ID;
+        }
+        // window.open('/apex/PCLLostReportPageLwc?pageStatus=Create&oppId=' + oppId + '&lostType=澶卞崟','_blank');
+        window.open('/lightning/n/PCLLostReportPageLwc#pageStatus=Create&oppId=' + oppId + '&lostType=澶卞崟','_blank');
+    }
+    //鏂板缓璐拱鎰忓悜鎸夐挳
+    addLeadNew(index, eid) {
+        console.log('addLeadNew');
+        this.showSpinner = true;
+        if (this.stringIsEmpty(this.filter)) {
+            // 瑷晱鍫存墍銈掕ō瀹氥仐銇︺亸銇犮仌銇勩��
+            this.showToast('error',this.customLabel.Error_Message16);
+            this.showSpinner = false;
+        }
+        this.saveTheActivity('addLeadNew');
+    }
+    addLead() {
+        console.log('addLead');
+        
+        var eid = this.activityObj.Id;
+        var accountRecord = this.activityObj.Account_ID__c;
+        var visitor1 = this.contactId1;
+        var result = this.activityObj.Description__c;
+        var dcId;
+        var accName;
+        var contactName;
+        var contactAwsId = '';
+        // if(visitor1 != null && visitor1 != ''){
+        //     getContactAwsIdByCOntactId({contactId : visitor1})
+        //     .then(result => {
+        //         console.log('getContactAwsIdByCOntactId:'+result);
+        //         contactAwsId = result;
+        //     });
+        // }
+        queryAbountIndo({ accId: this.filter,contactId : visitor1})
+        .then(result => {
+            if(result){
+                this.showSpinner = false;
+                contactAwsId = result.awsId;
+                // console.log(JSON.stringify(result));
+                console.log('queryAbountIndo:');
+                dcId = result.acc.Department_Class__c;
+                accName = result.acc.Name;
+                contactName = result.con.Name;
+                console.log('queryAbountIndo agencyContactName');
+                console.log(this.agencyContactName);
+                // const visitorComponents = this.template.querySelectorAll('c-look-up-util');
+                // if (visitorComponents.length > 0) {
+                // visitorComponents.forEach(visitorComponent => {
+                //     if(visitorComponent['uniqueKey'] =='AgencyContact1') {
+                //         visitorComponent.handleRemovePill();
+                //     } 
+                // });
+            // }
+
+                // contactName = result.contact.Name;
+                console.log('/lightning/o/Lead/new?defaultFieldValues=Name=1111,Hospital_Name__c='+this.filter
+                +',Description='+this.activityObj.Description__c+',Department_Class__c='+dcId+
+                ',Company='+encodeURI(accName)+',Contact_Name__c='+visitor1+',awsDataId='+contactAwsId+',newLeadRecordType' +this.newLeadRecordType);
+                window.open('/lightning/o/Lead/new?defaultFieldValues=Name='+contactName+',Hospital_Name__c='+this.filter
+                                +',Description='+this.activityObj.Description__c+',Department_Class__c='+dcId+
+                                ',Company='+encodeURI(accName)+
+                                ',Contact_Name__c='+visitor1+',contactName='+contactName+',awsDataId='+contactAwsId+',RecordTypeId='+this.newLeadRecordType, '_blank');
+               
+                // newLeadRecordType
+                // const defaultLeadValues = encodeDefaultFieldValues({
+                //     Hospital_Name__c: this.filter,
+                //     Description: this.activityObj.Description__c,
+                //     Department_Class__c: dcId,
+                //     Company: accName,
+                //     Contact_Name__c: visitor1,
+                //     RecordTypeId: this.newLeadRecordType,
+                //     Name: '111'
+                // });
+                // this[NavigationMixin.Navigate]({
+                //     type: 'standard__objectPage',
+                //     attributes: {
+                //         objectApiName: 'Lead',
+                //         actionName: 'new'
+                //     },
+                //     state: {
+                //         // nooverride: '1',
+                //         defaultFieldValues: defaultLeadValues,
+                //         recordTypeId: this.newLeadRecordType
+                //     }
+                // });
+            }
+        })
+        .catch(error => {
+            let errorMessage = "";
+            error.body.pageErrors.forEach(element => {
+                errorMessage += element.message;
+            });
+            this.showToast('error','澶辫触锛�'+errorMessage);
+            this.showSpinner = false;
+        });
+        // const defaultFieldValues =  encodeDefaultFieldValues({
+        //     Hospital_Name__c: this.filter,
+        //     Description: this.activityObj.Description__c,
+        //     Contact_Name__c: visitor1,
+        // });
+        // const pageReference = {
+        //     type: 'standard__objectPage',
+        //     attributes: {
+        //         objectApiName: 'Lead',
+        //         actionName: 'new'
+        //     },
+        //     state: {
+        //         // defaultFieldValues: JSON.stringify(defaultFieldValues)
+        //         defaultFieldValues: defaultFieldValues
+        //     }
+        // };
+        // this[NavigationMixin.Navigate](pageReference);
+        
+    }
+    //寤舵湡鎸夐挳
+    delaysaveJS() {
+        console.log('delaysaveJS');
+        var lastDate = this.activityObj.Finish_Date__c;
+        var repd = new Date(this.reportedDate+'');
+        var reod = this.activityObj.delayReasonOther__c;
+        var reodfse = this.activityObj.delayReasonSelectFSE__c;
+        var reodesc = this.activityObj.delayReasonSelect__c;
+        var dlyd = '';
+        if(this.activityObj.delayToDate__c) {
+            dlyd = new Date(this.activityObj.delayToDate__c+'');
+        }
+        //鑾峰彇鎷滆鍖哄垎
+        var visitQFV = this.activityObj.Activity_Type2__c;
+        if (this.stringIsEmpty(reodfse) && this.stringIsEmpty(reodesc)) {
+            this.showToast('error','璇峰~鍐欏欢鏈熺悊鐢便��');
+            return;
+        }
+        if (reodfse === '鍏朵粬' || reodesc === '鍏朵粬') {
+            if (this.stringIsEmpty(reod)) {
+                this.showToast('error','寤舵湡鐞嗙敱涓哄叾浠栵紝璇疯ˉ鍏呭叾浠栧師鍥�');
+                return;
+            }
+        }
+        console.log('-------------------');
+
+        if (this.stringIsEmpty(dlyd)) {
+            this.showToast('error','璇峰~鍐欏欢鏈熸棩鏈熴��');
+            return;
+        } 
+
+        if (this.stringIsEmpty(this.activityObj.Event_ID__c)) {
+            this.showToast('error','鎵嬪姩鍒涘缓鐨勬棩鎶ユ槑缁嗕笉鏀寔寤舵湡銆�');
+            return;
+        } else {
+            console.log('11111111111111111');
+            console.log(repd);
+            var repyear = repd.getFullYear();
+            console.log('x');
+            var repmonth = repd.getMonth();
+            var repday = repd.getDate();
+            var dlyyear = dlyd.getFullYear();
+            var dlymonth = dlyd.getMonth();
+            var dlyday = dlyd.getDate();
+            console.log('222222222222');
+            var today = new Date();
+            console.log('333333333333');
+            console.log(this.activityObj.taskDifferent__c);
+            console.log(today);
+            if ((repyear == dlyyear && repmonth == dlymonth) || (repyear == dlyyear && dlymonth == repmonth + 1) || (repyear + 1 == dlyyear && dlymonth == 1)) {
+                if (repyear == dlyyear && repmonth == dlymonth && repday >= dlyday) {
+                    this.showToast('error','涓嶈兘寤舵湡鍒版湰鏈堜箣鍓嶇殑鏃ユ湡銆�');
+                    return;
+                }else if(today >= dlyd){
+                    this.showToast('error','寤舵湡鏃ユ湡蹇呴』濉啓浠婂ぉ涔嬪悗鐨勬棩鏈熴��');
+                    return;
+                } else if (this.stringIsEmpty(this.activityObj.taskDifferent__c)) {
+                    if (visitQFV === '璨╁2搴�' && visitQFV === '鐥呴櫌' && visitQFV === '绀惧銈ゃ儥銉炽儓') {
+                        this.showToast('error','鎵嬪姩鍒涘缓鐨勬棩鎶ユ槑缁嗕笉鏀寔寤舵湡銆傝鍙栨秷銆�');
+                        return;
+                    } else {
+                        if (window.confirm('鎮ㄦ槸鍚﹁寤舵湡鏃ュ巻涓婄殑娲诲姩锛�')) {
+                            this.ifDelayJS();
+                        }
+                    }
+                } else if (this.activityObj.taskDifferent__c === '涓诲姩浠诲姟' && this.activityObj.delayTaskDelay__c) {
+                    if (window.confirm('鎮ㄦ槸鍚﹁寤舵湡鏃ュ巻涓婄殑娲诲姩锛�')) {
+                        this.ifDelayJS();
+                    }
+                } else if (this.activityObj.taskDifferent__c === '涓诲姩浠诲姟' && this.activityObj.delayTaskDelay__c && repmonth !== dlymonth) {
+                    this.showToast('error','涓诲姩浠诲姟鍙兘寤舵湡鍒版湰鏈堛��');
+                    return;
+                } else if (this.activityObj.taskDifferent__c === '琚姩浠诲姟' ||this.activityObj.taskDifferent__c === '涓婄骇鍒嗛厤浠诲姟') {
+                //2021-10-13  mzy  浠诲姟绠$悊鏀瑰杽   end
+                    if (dlyd > lastDate) {
+                        this.showToast('error','鍙兘寤舵湡鍒�' + lastDate + '涔嬪墠鐨勬棩鏈�');
+                        return;
+                    } else {
+                        if (window.confirm('鎮ㄦ槸鍚﹁寤舵湡鏃ュ巻涓婄殑娲诲姩锛�')) {
+                            this.ifDelayJS();
+                        }
+                    }
+                } else {
+                    if (window.confirm('鎮ㄦ槸鍚﹁寤舵湡鏃ュ巻涓婄殑娲诲姩锛�')) {
+                        this.ifDelayJS();
+                    }
+                }
+            } else {
+                this.showToast('error','鍙兘寤舵湡鍒版湰鏈堟垨鑰呬笅涓湀銆�');
+                return;
+            }
+        }
+        this.showSpinner = false;
+    }
+    ifDelayJS(){
+        this.showSpinner = true;
+        console.log('ifDelayJS');
+        // 寤舵湡蹇呴』鏄綔鎴愪腑鎵嶅彲浠ュ欢鏈熴��
+        if(this.report.Status__c == '浣滄垚涓�'){
+            if (this.report.Status_With_Check__c !== '鑽夋涓�') {
+                this.showToast('error','鍙兘寤舵湡鍒拌崏妗堜腑鐨勬棩鎶ャ��');
+                return;
+            }
+            this.activityObj = {
+                ...this.activityObj,
+                ['eventStatus__c']: '寤舵湡'
+            };
+            this.saveTheActivity('寤舵湡');
+        }
+    }
+    initDelayAndCancel(){
+        //浠诲姟鍖哄垎
+        var valTaskDifferent = this.activityObj.taskDifferent__c;
+        //鐢ㄦ埛Job
+        if(this.activityObj.taskId__c){
+            //浠诲姟鐘舵�佷负 瀹屾垚 ,鍒� 涓嶅彲浠ヤ慨鏀�
+            var valTaskStatus  =  this.activityObj.backEventStatus__c;
+            //瀛樺湪,鍒ゆ柇鏄惁涓轰笂绾у垎閰嶄换鍔� ,鏄惁涓哄畬鎴�
+            if(valTaskDifferent === '涓婄骇鍒嗛厤浠诲姟' ||valTaskStatus === '03 瀹屾垚'){
+                this.cancelReasonSelectDis = true;
+                this.cancelReasonSelectFSEDis = true;
+                this.cancelReasonOtherDis = true;
+                this.delayReasonSelectDis = true;
+                this.delayReasonSelectFSEDis = true;
+                this.delayReasonOtherDis = true;
+                this.delayToDateDis = true;
+                this.cancelsaveJSDis = true;
+                this.delaysaveJSDis = true;
+            }    
+        }
+    }
+    //鍙栨秷鎸夐挳
+    cancelsaveJS(index, eventid) {
+        console.log("cancelsaveJS");
+        this.showSpinner = true;
+        var celd = this.activityObj.cancelReasonSelectFSE__c;
+        var celd1 = this.activityObj.cancelReasonSelect__c;
+        var celrd = this.activityObj.cancelReasonOther__c;
+        var celOPDbox2 = this.activityObj.OPDPlan_Flag__c;
+        if (celOPDbox2) {
+            if (window.confirm('璇ュ尰闄㈢殑OPD璁″垝鏄惁纭鍙栨秷锛熷闇�鏀规湡锛岃閫夋嫨寤舵湡鍙婄悊鐢辨垨杩涘叆OPD璁″垝杩涜寤舵湡銆�') == false) {
+                this.showSpinner = false;
+                return;
+            } else{
+                this.showSpinner = false;
+            }
+        }
+        
+        if (this.stringIsEmpty(celd)&& this.stringIsEmpty(celd1)) {
+            this.showToast('error','璇峰~鍐欏彇娑堢悊鐢便��');
+            this.showSpinner = false;
+            return;
+        } else if (celd === '鍏朵粬' || celd1 === '鍏朵粬') {
+            if (!celrd) {
+                this.showToast('error','鍙栨秷鍘熷洜涓哄叾浠栵紝璇疯ˉ鍏呭叾浠栧師鍥犮��');
+                this.showSpinner = false;
+                return;
+            }
+        }
+        if (window.confirm('鎮ㄦ槸鍚﹁鍙栨秷鏃ュ巻涓婄殑娲诲姩锛�')) {
+            this.activityObj = {
+                ...this.activityObj,
+                ['eventStatus__c']: '鍙栨秷'
+            };
+            this.saveTheActivity('鍙栨秷');
+        } else{
+            this.showSpinner = false;
+        }
+    }
+    stringIsEmpty(str) {
+        if (str === '' || str === undefined || str === null) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+    // showToast(variant,mes) {
+    //     const event = new ShowToastEvent({
+    //         message: mes,
+    //         variant: variant,
+    //     });
+    //     this.dispatchEvent(event);
+    // }
+
+    showToast(type,msg) {
+        if(type == 'success'){
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type
+            });
+            this.dispatchEvent(event);
+        }else{
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type,
+                mode: 'sticky'
+            });
+            this.dispatchEvent(event);
+        }
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/activeContent/activeContent.js-meta.xml b/force-app/main/default/lwc/activeContent/activeContent.js-meta.xml
new file mode 100644
index 0000000..3fe0e73
--- /dev/null
+++ b/force-app/main/default/lwc/activeContent/activeContent.js-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>57.0</apiVersion>
+    <isExposed>false</isExposed>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js b/force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
index d84a617..69fa193 100644
--- a/force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
+++ b/force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
@@ -280,6 +280,7 @@
                     this.dispatchEvent(closeEvent);
                 }else{
                     this.showToast(response,"error");
+                    this.IsLoading = false;
                 }
             });
         }
diff --git a/force-app/main/default/lwc/lexCancelReport/lexCancelReport.js b/force-app/main/default/lwc/lexCancelReport/lexCancelReport.js
index 736a8f8..edeb877 100644
--- a/force-app/main/default/lwc/lexCancelReport/lexCancelReport.js
+++ b/force-app/main/default/lwc/lexCancelReport/lexCancelReport.js
@@ -10,6 +10,7 @@
 import ConSent from '@salesforce/apex/BidAnnouncementController.ConSent';
 import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
 import {loadStyle} from 'lightning/platformResourceLoader';
+import queryCancelReport  from '@salesforce/apex/OpportunityLightingButtonController.queryCancelReport';
 export default class LexCancelReport extends NavigationMixin(LightningElement) {
     @api recordId;
     stageName;
@@ -26,6 +27,7 @@
     salesOwnerBuchang;
     salesOwnerBuchangID;
     recordTypeId;
+    haveLostReport;
     IsLoading = true;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -65,7 +67,13 @@
             this.salesOwnerBuchang = result.salesOwnerBuchang == undefined ? '' : result.salesOwnerBuchang;
             this.salesOwnerBuchangID = result.salesOwnerBuchangID == undefined ? '' : result.salesOwnerBuchangID;
             this.recordTypeId = result.recordTypeId;
-            this.cancelReport();
+            queryCancelReport({
+                recordId: this.recordId
+            }).then(result=>{
+                this.haveLostReport = result;
+                this.cancelReport();
+            });
+            
         }).catch(error=>{
             console.log("error");
             console.log(error);
@@ -110,7 +118,7 @@
             else if (this.sapSendOK == '1') {
                 this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 鍙栨秷 浜嗭紒","error");
             }
-            else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
+            else if (this.haveLostReport) {
                 this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
             }
             else if (this.jobCategory == '鏀彺') {
diff --git a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
index 3a8a60f..1eb5caa 100644
--- a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
+++ b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-13 13:50:23
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-10 17:34:10
+ * @LastEditTime: 2023-10-18 21:03:42
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -45,18 +45,10 @@
         })
     }
     createEvent(){
-        this[NavigationMixin.Navigate]({
-            type: 'standard__objectPage',
-            attributes: {
-                objectApiName: 'Event',
-                actionName: 'new'
-            },
-            state: {
-                // retURL: '/apex/VFClosePage',
-                accid: this.accountId,
-                oid: this.recordId
-            }
-        });
+        window.open( 
+            "/apex/SimpleEventRegister?retURL=%2Fapex%2FVFClosePage&accid=" 
+            + this.accountId + "&oid=" 
+            + this.recordId + "&source=AccountPCL&save_new=1&sfdc.override=1");
         this.dispatchEvent(new CloseActionScreenEvent());
     }
     showToast(msg,type) {
diff --git a/force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js b/force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js
index b795741..225eb14 100644
--- a/force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js
+++ b/force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-09-11 10:34:37
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-09-26 09:29:28
+ * @LastEditTime: 2023-10-18 11:43:59
  */
 import { LightningElement, track, wire, api } from 'lwc';
 import {CurrentPageReference} from 'lightning/navigation';
@@ -55,5 +55,7 @@
                 nooverride: '1'
             }
         });
+        this.IsLoading = false;
+        this.dispatchEvent(new CloseActionScreenEvent());
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html b/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html
index 213b2c4..1a0a161 100644
--- a/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html
+++ b/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html
@@ -4,11 +4,10 @@
  * @Author: chen jing wu
  * @Date: 2023-09-09 13:27:59
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-09-23 12:24:56
+ * @LastEditTime: 2023-10-18 17:02:07
 -->
 <template>
-    <div class="lexCreateEventReportHolder" if:true={IsLoading}>
-        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
-        
+    <div if:true={flag}>
+        <c-t-enquiry-no-bidding oncloseaction={handleChildEvent} -param-o-id-str={recordId}></c-t-enquiry-no-bidding>
     </div>
 </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.js b/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.js
index abb57f1..b48b19d 100644
--- a/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.js
+++ b/force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.js
@@ -4,9 +4,9 @@
  * @Author: chen jing wu
  * @Date: 2023-04-21 14:11:57
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-21 14:15:55
+ * @LastEditTime: 2023-10-19 14:03:43
  */
-import { api, wire,LightningElement } from 'lwc';
+import { api, wire,LightningElement, track } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
 
@@ -27,8 +27,13 @@
           }
         }
     }
+    handleChildEvent(){
+      console.log('close');
+      this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    @track flag = false;
     connectedCallback(){
-        window.open ('/apex/EnquiryNoBiddingPage?oid=' + this.recordId, 'height=350, width=600, top=200, left=350,location=no');
-        this.dispatchEvent(new CloseActionScreenEvent());
+        this.flag = true;
+        // this.dispatchEvent(new CloseActionScreenEvent());
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html
new file mode 100644
index 0000000..f3e1a60
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html
@@ -0,0 +1,9 @@
+<template>
+    <div class="Holder" style="	
+    position: relative;
+    width:100%;
+    height:200px;
+    --sds-c-progress-ring__stroke-color: #0070d2;">
+        <lightning-spinner alternative-text="Loading" size="medium" variant="brand"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js
new file mode 100644
index 0000000..74288d2
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js
@@ -0,0 +1,55 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-10-18 20:57:28
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-10-18 20:58:14
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexFollowUpHistoryController.init';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+export default class lexFollowUpHistory extends NavigationMixin(LightningElement) {
+    @api recordId;
+    reportId;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.reportId=result.reportId;
+            this.createOPDFromRentalApply();
+        });
+    }
+    createOPDFromRentalApply(){
+        let url='/lightning/r/Report/'+this.reportId+'/view?fv0='+this.recordId.substring(0,15);
+        // this[NavigationMixin.Navigate]({
+        //     type: 'standard__webPage',
+        //     attributes: {
+        //         url:url
+        //     }
+        // });
+        window.open(url);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml
new file mode 100644
index 0000000..dc71306
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFollowUpHistory">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js b/force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js
index fe41329..14f3c1b 100644
--- a/force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js
+++ b/force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js
@@ -283,6 +283,7 @@
                     this.dispatchEvent(closeEvent);
                 }else{
                     this.showToast(response,"error");
+                    this.IsLoading = false;
                 }
             });
         }
diff --git a/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js b/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
index 3caec8e..576018d 100644
--- a/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
+++ b/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-20 14:08:55
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-10 17:35:29
+ * @LastEditTime: 2023-10-16 14:45:16
  */
 /*
  * @Description: 
@@ -20,6 +20,7 @@
 import { updateRecord } from 'lightning/uiRecordApi';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import init  from '@salesforce/apex/OpportunityLightingButtonController.initForLostReportButton';
+import queryLostReport  from '@salesforce/apex/OpportunityLightingButtonController.queryLostReport';
 import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
 import {loadStyle} from 'lightning/platformResourceLoader';
 export default class LexLoseReport extends LightningElement {
@@ -35,6 +36,7 @@
     salesOwnerBuchang;
     salesOwnerBuchangID;
     cntLostCancelDraft;
+    haveLostReport;
     IsLoading = true;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -75,7 +77,13 @@
                 this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }
-            this.loseReport();
+            queryLostReport({
+                recordId: this.recordId
+            }).then(result=>{
+                this.haveLostReport = result;
+                this.loseReport();
+            });
+            
         })
     }
     loseReport(){
@@ -88,27 +96,12 @@
         else if (this.sapSendOK == '1') {
             this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒","error");
         }
-        else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
-            // this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
+        else if (this.haveLostReport) {
             this.showToast('璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒','error');
         }
-        //else if({!Not(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))} && //'{!Opportunity.InfoTypeBid__c}' != '3锛氱粨鏋�' ){
-        //alert("鍏宠仈鎷涙姇鏍囬」鐩殑璇环锛屽彧鑳藉湪鏈夌粨鏋滃悗鍋氬け鍗曟姤鍛婏紒");
-        //}
         else {
             var url = '/lightning/n/PCLLostReportPageLwc#pageStatus=Create&oppId=' + this.recordId + '&lostType=澶卞崟';
             location.href = url;
-            // location.href = '/a1U/e?retURL=%2F' + this.recordId +
-            // '&RecordType=01210000000R4hM' +
-            // '&CF00N10000004lbGT=' + this.name +
-            // '&CF00N10000004lbGT_lkid=' + this.recordId +
-            // '&CF00N10000006QShg=' + this.salesAssistantName +
-            // '&CF00N10000006QShg_lkid=' + this.salesAssistantID +
-            // '&CF00N10000006QShq=' + this.managerName +
-            // '&CF00N10000006QShq_lkid=' + this.salesManagerDepartmentID +
-            // '&CF00N10000006QShb=' + this.salesOwnerBuchang +
-            // '&CF00N10000006QShb_lkid=' + this.salesOwnerBuchangID +
-            // '';
         }
         this.dispatchEvent(new CloseActionScreenEvent());
     }
diff --git a/force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js b/force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js
index 25c8aaf..a90b608 100644
--- a/force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js
+++ b/force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-06-29 16:43:08
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-10 17:36:38
+ * @LastEditTime: 2023-10-18 10:49:04
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -19,6 +19,7 @@
 export default class LexNewOpportunityFile extends NavigationMixin(LightningElement) {
     @api recordId;
     stockApplyStatus;
+    profileId;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
             console.log(111);
@@ -60,6 +61,7 @@
             recordId: this.recordId
         }).then(result=>{
             this.stockApplyStatus = result.stockApplyStatus;
+            this.profileId = result.profileId;
             this.newOpportunityFile();
         });
     }
diff --git a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
index 57c7626..ba208ce 100644
--- a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
+++ b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-09-09 13:27:59
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-11 14:52:27
+ * @LastEditTime: 2023-10-13 11:40:41
 -->
 <!--
  * @Description: 
@@ -250,7 +250,13 @@
                                                                                                 <template if:true={product.LostProductss.ProductClass__c}>
                                                                                                     
                                                                                                     <template if:true={product.LostProductss.LostProduct__c}>
-                                                                                                        <lightning-combobox variant="label-hidden" read-only="true" class="ProductClass" data-id={i} placeholder="--鏃�--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox> 
+                                                                                                        <template if:true={product.LostProductss.isSpec__c}>
+                                                                                                            <lightning-combobox variant="label-hidden"  class="ProductClass" data-id={i} placeholder="--鏃�--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox> 
+                                                                                                        </template>
+                                                                                                        <template if:false={product.LostProductss.isSpec__c}>
+                                                                                                            <lightning-combobox variant="label-hidden" read-only="true" class="ProductClass" data-id={i} placeholder="--鏃�--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox> 
+                                                                                                        </template>
+                                                                                                        
                                                                                                     </template>
                                                                                                     <template if:false={product.LostProductss.LostProduct__c}>
                                                                                                         <lightning-combobox variant="label-hidden"  class="ProductClass" data-id={i} placeholder="--鏃�--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox> 
@@ -274,6 +280,7 @@
                                                                                         <td>
                                                                                            
                                                                                             <template if:true={isEdit}>
+                                                                                                
                                                                                                 <lightning-combobox variant="label-hidden" class="ProductCategory" data-id={i} placeholder="--鏃�--" title={i} name={j} options={product.productOptions} value={product.LostProductss.ProductCategory__c} onchange={handleProductCategoryChange} read-only="true"></lightning-combobox> 
                                                                                             </template>
                                                                                             <template if:false={isEdit}>
diff --git a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
index 6b3f341..c9803f6 100644
--- a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
+++ b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-20 15:04:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-11 18:24:16
+ * @LastEditTime: 2023-10-16 11:48:33
  */
 let columns2=[
     { label: '--鏃�--', value: '' },
@@ -139,6 +139,8 @@
     userId;
     allowUserId;
     submitUserId;
+    specProFlg;
+    loadingFlg;
     @track isSubmitUser = false;
     @track isAllowUser = false;
     handleCustomButtonClick(event) {
@@ -370,6 +372,38 @@
             }
             
         });
+        // if(this.pageStatus = 'Edit' && this.loadingFlg == false){
+        //     var elements1 = this.template.querySelectorAll('.ProductClass[data-id="' + 0 + '"]');
+        //     var elements2 = this.template.querySelectorAll('.ProductCategory[data-id="' + 0 + '"]');
+        //         console.log('lnm');
+        //                     console.log(elements1);
+        //                     console.log(elements2);
+        //         console.log('lnm');
+        //     console.log('in=>');
+        //     this.loadingFlg = true;
+        //     var j = 0;
+        //     var i = 0;
+        //     this.LostReport.LostBrands.forEach(brand=>{
+                
+        //         brand.LostProducts.forEach(product=>{
+        //             if(product.LostProductss.LostProduct__r !=undefined){
+        //                 if(product.LostProductss.LostProduct__r.ProductClass__c ==undefined && product.LostProductss.LostProduct__r.ProductCategory__c ==undefined){
+        //                     console.log('cnm');
+        //                     console.log(elements1[i]);
+        //                     console.log(elements2[i]);
+        //                     console.log('cnm');
+        //                     elements1[i].readOnly = false;
+        //                     elements2[i].readOnly = false;
+        //                 }
+        //             }
+        //             i++;
+        //         });
+        //         j++;
+        //     });
+
+        // }else if(this.pageStatus = 'View'){
+        //     this.loadingFlg = false;
+        // }
         // if((value == '' || value == null) && this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c == '鍏朵粬'){
         //     var elements = 
         //     elements[index].disabled = false;
@@ -535,7 +569,12 @@
         getNewLostProduct({
             lineNo2: this.LostReport.LostBrands[index].LostProducts.length
         }).then(result=>{
-            result.LostProductss.LostBrandName__c = this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c;
+            if(this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c == '鍏朵粬' && (this.LostReport.LostBrands[index].lostBrand.Lost_By_Company_Mannual__c != null && this.LostReport.LostBrands[index].lostBrand.Lost_By_Company_Mannual__c != undefined && this.LostReport.LostBrands[index].lostBrand.Lost_By_Company_Mannual__c != '')){
+                result.LostProductss.LostBrandName__c = this.LostReport.LostBrands[index].lostBrand.Lost_By_Company_Mannual__c;
+            }else{
+                result.LostProductss.LostBrandName__c = this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c;
+            }
+            
             this.LostReport.LostBrands[index].LostProducts.push(result);
             console.log('***');
             console.log(this.LostReport);
@@ -1070,7 +1109,7 @@
     handleModalSubmit(){
         
         this.IsLoading = true;
-        const comment = this.template.querySelector('.comment');
+        const comment = this.template.querySelector('.textAreaBody');
         console.log(this.isLookup == true && this.newActorId == null);
         if(this.isLookup == true && this.newActorId == null){
             this.showToast('璇峰~鍏ユ柊鍒嗛厤浜�','error');
@@ -1093,11 +1132,18 @@
                 
             });
         }else{
+            console.log('1nm');
+            console.log(this.LostReport.lostReport.Id);
+            console.log(comment.value);
+            console.log(this.action);
+            console.log('1nm');
             submitForApproval({
                 recordId: this.LostReport.lostReport.Id,
                 comments: comment.value,
                 action: this.action
             }).then(result=>{
+                console.log('sb');
+                console.log(result);
                 if(result){
                     if(this.action == 'Approve'){
                         this.showToast('鎮ㄦ棤鏉冩壒鍑�','error');
@@ -1110,8 +1156,12 @@
                     this.IsLoading = false;
                 }else{
                     // window.location = '/' + this.LostReport.lostReport.Id;
+
                     this.remoteUrl();
                 } 
+            }).catch(error=>{
+                console.log('error');
+                console.log(error);
             });
         }
         
@@ -1277,6 +1327,14 @@
             var temps1 =this.template.querySelectorAll('.ProductCategory[data-id="'+ index1 +'"]');
             temps1[index2].readOnly = false;
             this.LostReport.LostBrands[index1].LostProducts[index2].productOptions = this.productOptionsList[val];
+            searchProduct({
+                lostProduct:this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.LostProduct__c
+            }).then(result=>{
+                var prd = JSON.parse(result);
+                if(prd.ProductClass__c == undefined && prd.ProductCategory__c == undefined){
+                    this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.isSpec__c = true;
+                }
+            });
         }
        
     }
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html
new file mode 100644
index 0000000..f3e1a60
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html
@@ -0,0 +1,9 @@
+<template>
+    <div class="Holder" style="	
+    position: relative;
+    width:100%;
+    height:200px;
+    --sds-c-progress-ring__stroke-color: #0070d2;">
+        <lightning-spinner alternative-text="Loading" size="medium" variant="brand"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js
new file mode 100644
index 0000000..68028f4
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js
@@ -0,0 +1,59 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-10-18 21:00:37
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-10-18 21:01:01
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexQuotationProductNotUseController.init';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+export default class lexQuotationProductNotUse extends NavigationMixin(LightningElement) {
+    @api recordId;
+    id;
+    reportId;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.id = result.Id.substring(0,15);
+            this.reportId=result.reportId;
+            this.createOPDFromRentalApply();
+        });
+    }
+    createOPDFromRentalApply(){
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+        let url='/lightning/r/Report/'+this.reportId+'/view?fv0='+this.id;
+        // this[NavigationMixin.Navigate]({
+        //     type: 'standard__webPage',
+        //     attributes: {
+        //         url:url
+        //     }
+        // });
+        window.open(url);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml
new file mode 100644
index 0000000..a3206dd
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexQuotationProductNotUse">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js b/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
index 7b51ea2..3a1b5ff 100644
--- a/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
+++ b/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
@@ -7,6 +7,9 @@
 
 import init from '@salesforce/apex/ISOpportunityDemand.initISOpportunityController';
 import submit from '@salesforce/apex/ISOpportunityDemand.submit';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+import LightningConfirm from 'lightning/confirm';
 
 export default class LexSiSubmit extends LightningElement {
     @api recordId;
@@ -28,14 +31,25 @@
      }
 
      connectedCallback(){
+        Promise.all([
+          loadStyle(this, lwcCSS)
+        ]);
         this.IsLoading = false;
         // this.submit();
         init({recordId:this.recordId})
         .then(result=>{
             console.log("lexsubmit------>>>",result)
-            if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
-              return;
-            }
+            // if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
+            //   return;
+            // }
+            // this.handleConfirmClick();
+            LightningConfirm.open({
+              message: "涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵",
+              variant: 'headerless',
+              label: '鎻愮ず淇℃伅',
+              // setting theme would have no effect
+          }).then(res=>{
+            if(!res) return;
             if (result.checkTf !=true ) {
               this.showToast('璇疯惀涓氭媴褰撴彁浜ゅ鎵�','error')
               return;
@@ -62,6 +76,7 @@
             .finally(()=>{
               window.location.reload();
             })
+          })
         })
         .catch(e=>{console.log(e)})
         .finally(()=>{
@@ -71,12 +86,22 @@
 
 
      showToast(msg,type) {
-      const event = new ShowToastEvent({
-          title: '',
-          message: msg,
-          variant: type
-      });
-      this.dispatchEvent(event);
+      if(type == "success"){
+        const event = new ShowToastEvent({
+            // title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+      }else{
+        const event = new ShowToastEvent({
+            // title: '',
+            message: msg,
+            variant: type,
+            mode:'sticky'
+        });
+        this.dispatchEvent(event);
+      }
       this.dispatchEvent(new CloseActionScreenEvent());
     }
 
diff --git a/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.css b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.css
new file mode 100644
index 0000000..bf73cac
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.css
@@ -0,0 +1,91 @@
+.THIS .bottom .slds-form-element__control {
+    display: inline-flex;
+}
+/*鍚堝悓锛歺xx 涓�琛岃緭鍑�*/
+.vmItems{
+	display: flex;
+    align-items: center;
+}
+
+.vmItems span{
+	width: 122px;
+}
+.c-container span{
+	display: inline-block;
+	padding: 10px 0;
+	font-weight: bold;
+}
+.custom-box lightning-button{
+	margin-top: 10px;
+}
+.pdfCheck{
+	display: inline-flex;
+}
+/*button 鏍峰紡鏀瑰姩*/
+.bottomBtn button {
+	border: 1px solid #0176d3;
+	background-color: #fff;
+	color: #0176d3;
+	width: 90px;
+    height: 35px ;
+    /*overflow: hidden;
+	white-space: nowrap ;
+	text-overflow: ellipsis ;*/
+	margin: 5px;
+	border-radius: 5px;
+}
+.bottomBtn button:disabled,
+.bottomBtn button[disabled]{
+  border: 1px solid #c9c9c9;
+  color: #c9c9c9;
+}
+/*搴曢儴 鍚堝悓寮�濮嬫棩 鍚堝悓缁撴潫鏃�*/
+.bottomVMItem{
+	display: flex;
+    align-items: center;
+    margin-left: 10px;
+}
+.bottomVMItem span{
+	width: 90px;
+}
+/*.bottomVMItem  lightning-input-field{
+	width: 230px;
+}*/
+
+.accordion {
+    --slds-c-accordion-summary-color-background:#f3f3f3;
+	/*--slds-c-accordion-heading-text-color:white;*/
+	--slds-c-accordion-heading-font-size:18px;
+}
+/*瑕嗙洊鍘熸湁padding*/
+.accordion .slds-accordion__summary{
+	padding-top: 5px !important;
+    padding-bottom: 5px !important;
+}
+/*鍚堝悓淇℃伅*/
+.line{
+	display: flex;
+}
+.line div{
+	margin-right: 5px;
+}
+/*table 鏍峰紡*/
+.list tr th,.list tr td{
+	border: 1px solid #ededed;
+	white-space: normal;
+}
+.headerRow{
+	background-color: #f2f3f3;
+	font-weight: bold;
+	font-size:.9em;
+	
+	border-width: 0 0 1px 1px;
+	border-color: #e0e3e5;
+
+}
+/*蹇呭~*/
+.required{
+	display: inline !important;
+    float: none;
+    font-weight: var(--lwc-fontWeightBold,700) !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.html b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.html
new file mode 100644
index 0000000..6844978
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.html
@@ -0,0 +1,748 @@
+<!-- input del onchange = handle -->
+<template>
+    <div class="exampleHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <div class="slds-backdrop slds-backdrop_open"></div>
+    </div>
+
+    <lightning-card  variant="Narrow" title="鏈嶅姟鍚堝悓鎶ヤ环" if:true={IsRefresh}>
+        <div class="custom-box" style="text-align: center;padding-bottom: 15px;
+                                border-bottom: 1px solid #e5e5e5">
+            <div style="display: inline-block;">
+                <!-- // del testMax -->
+                <!-- <lightning-button variant="brand-outline" label="TEST MAX" onclick={test} class="slds-m-left_x-small"></lightning-button> -->
+                <lightning-button variant="brand-outline" label="淇濆瓨" onclick={handleSave} disabled={SaveBtnDisabled} class="slds-m-left_x-small"></lightning-button>
+                <lightning-button variant="brand-outline" label="杩囧幓涓夊勾缁翠慨瀹炵哗璁$畻" onclick={AlertPriceBtnJs} class="slds-m-left_x-small"></lightning-button>
+                <lightning-button variant="brand-outline" label="鎻愪氦寰呭鎵�" onclick={handleApprove} disabled={ApprovalBtnDisabled} class="slds-m-left_x-small"></lightning-button>
+            </div>
+            <div style="float: right;margin-right: 10px;">
+                <lightning-button variant="brand-outline" label="涓嶄繚瀛橈紙杩斿洖锛�" onclick={cancel} class="slds-m-left_x-small"></lightning-button>
+                <lightning-button variant="brand-outline" label="淇濆瓨锛堣繑鍥烇級" onclick={handleSaveAndCancel} class="slds-m-left_x-small" disabled={SaveBtnDisabled}></lightning-button>
+            </div>
+            <!-- allData.IS_Clone_After_Decide  鏀瑰彉涓嶅強鏃�-->
+            <div style="color:red;font-size:20px;text-align: center;" if:true={IS_Clone_After_Decide}>璇锋彁浜ゅ緟瀹℃壒</div>
+        </div>
+        <lightning-accordion allow-multiple-sections-open="true" 
+                             active-section-name={activeSections}
+                             class="accordion"
+                             >
+            <lightning-record-edit-form object-api-name={objName} record-id={recordId}>
+                <!-- decide 椤甸潰鍒濆鍖栨槸绂佺敤澶勭悊 -->
+                <lightning-accordion-section name="A" label="鏈嶅姟鍚堝悓" id="myAccordionSection">
+                    <div class="c-container">
+                        <lightning-layout pull-to-boundary="medium">
+                            <lightning-layout-item flexibility="auto"  size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                     <span>鍚堝悓璇环缂栫爜</span>
+                                    <lightning-record-edit-form
+                                            record-id={contract.Id}
+                                            object-api-name='Maintenance_Contract__c'>
+                                        <lightning-output-field field-name="Management_Code__c" variant="label-hidden"></lightning-output-field>
+                                    </lightning-record-edit-form>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                
+                                <div class="custom-box vmItems">
+                                    <span>鍖婚櫌</span><br />
+                                    <div style="border-bottom: 1px solid;display: inline-block;">
+                                        <lightning-record-edit-form
+                                            record-id={contract.Hospital__c}
+                                            object-api-name='Account'>
+                                            <lightning-output-field field-name="Name" variant="label-hidden" data-param={contract.Hospital__c} onclick={handlePageNagivateTo} style="cursor: pointer;">
+                                            </lightning-output-field>
+                                        </lightning-record-edit-form>
+                                    </div>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鎶ヤ环鐘舵��</span>
+                                    <lightning-output-field field-name="Process_Status__c" value={estimate.Process_Status__c} variant="label-hidden"> </lightning-output-field>
+                                </div>
+                            </lightning-layout-item>
+                        </lightning-layout>
+                        <lightning-layout pull-to-boundary="medium">
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鎶ヤ环缂栫爜</span>
+                                    <lightning-output-field field-name="Name" value={estimate.Name} variant="label-hidden"> </lightning-output-field>
+
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>绉戝</span>
+                                    <lightning-input-field label="绉戝" variant="label-hidden" field-name="Department__c" onchange={changeDepartment} disabled={PageDisabled} value={estimate.Department__c}></lightning-input-field>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鐢ㄦ埛绫诲瀷</span>
+                                    <!-- <lightning-input-field field-name="EndUserType__c"  value={estimate.EndUserType__c} variant = "label-hidden" disabled> </lightning-input-field> -->
+                                    <p>{estimate.EndUserType__c}</p>
+                                </div>
+                            </lightning-layout-item>                         
+                        </lightning-layout>
+                        
+                        <lightning-layout pull-to-boundary="medium">
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鍚堝悓寮�濮嬮璁㈡棩<span class="required">*</span></span>
+                                    <lightning-input-field label="鍚堝悓寮�濮嬮璁㈡棩" field-name="Contract_Esti_Start_Date__c" variant="label-hidden" onchange={changeEstiStartdate} value={estimate.Contract_Esti_Start_Date__c} disabled={IsContractEstiStartDateDisabled} required> </lightning-input-field>
+
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item size="4" padding="horizontal-medium" >
+                                <div class="custom-box vmItems">
+                                    <span>鎶ヤ环鎻愪氦瀵硅薄</span>
+                                    <div style="display: flex;align-items: flex-end;margin-top: -5px;">
+                                        <div style="width: 120px;">
+                                            <lightning-input-field label="鎶ヤ环鎻愪氦瀵硅薄" field-name="Estimate_Target__c" variant = "label-hidden" value={estimate.Estimate_Target__c} onchange={handleChangeEstimateTarget} disabled={PageDisabled}> </lightning-input-field>
+                                        </div>
+                                        <lightning-button variant="brand-outline" label="鍙樻洿" disabled={DecideBtnDisabled} onclick={controlDisabled} class="slds-m-left_x-small"></lightning-button>
+                                    </div>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鐘舵��</span>
+                                    <lightning-record-edit-form
+                                            record-id={contract.Id}
+                                            object-api-name='Maintenance_Contract__c'>
+                                        <lightning-output-field field-name="Status__c" variant="label-hidden"></lightning-output-field>
+                                    </lightning-record-edit-form>
+                                    
+                                </div>
+                            </lightning-layout-item>
+                        </lightning-layout>
+
+                        <lightning-layout pull-to-boundary="medium">
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                
+                                <div class="custom-box vmItems">
+                                    <span>鍚堝悓缁撴潫棰勮鏃�</span>
+                                    <lightning-input-field label="鍚堝悓缁撴潫棰勮鏃�" field-name="Contract_Esti_End_Date__c" variant="label-hidden" value={estimate.Contract_Esti_End_Date__c} readonly> </lightning-input-field>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item size="4" padding="horizontal-medium">
+                                
+                                <div class="custom-box vmItems">
+                                    <span>缁忛攢鍟嗗悕</span>
+                                    <lightning-input-field label="缁忛攢鍟嗗悕" field-name="Dealer__c" variant = "label-hidden" value={estimate.Dealer__c} onchange={handleChangeDealer} disabled={IsDealerDisabled} class="dealer" if:true={EstimateTargetIsDealer} style="    width: 65%;"> </lightning-input-field>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鍒跺畾鏃�</span>
+                                    <lightning-output-field type="date" label="鍒跺畾鏃�" variant = "label-hidden" field-name="CreatedDate" value={estimate.CreatedDate}></lightning-output-field>
+                                </div>
+                            </lightning-layout-item>
+                        </lightning-layout>
+                        <lightning-layout pull-to-boundary="medium">
+                            <lightning-layout-item flexibility="auto" size="4" padding="horizontal-medium">
+                                
+                                <div class="custom-box vmItems">
+                                    <span>鍚堝悓鏈堟暟<span class="required">*</span></span>
+                                    <lightning-input type="number" variant="label-hidden" value={estimate.Contract_Range__c}  onchange={handleChangeContractRange} required calss="monthRange" disabled={PageDisabled}></lightning-input>
+                                </div>
+                            </lightning-layout-item>
+                            <lightning-layout-item flexibility="auto" padding="horizontal-medium">
+                                <div class="custom-box vmItems">
+                                    <span>鍏堟鏍囪瘑锛堢粡閿�鍟嗭級</span>
+                                    <!-- 鏈�缁堟槸鍚﹀嬀閫夊彇鍐充簬鏄惁  缁忛攢鍟嗗悕 鏄惁鏈夊�硷紝鍕鹃�夋棤鎰忎箟 鏀逛负鍙  IsFirstParagraphEndDisabled onchange={handleIsRecognitionModel} -->
+                                    <lightning-input-field label="鍏堟鏍囪瘑锛堢粡閿�鍟嗭級"  field-name="Is_RecognitionModel__c" type="checkbox" variant = "label-hidden" value={estimate.Is_RecognitionModel__c} class="FirstParagraphEnd" checked={estimate.Is_RecognitionModel__c} disabled if:true={EstimateTargetIsDealer}> </lightning-input-field>
+                                </div>
+                            </lightning-layout-item>
+                        </lightning-layout>
+                    </div>
+                </lightning-accordion-section>
+            </lightning-record-edit-form> 
+
+            <lightning-accordion-section name="B" label="鍚堝悓瀵硅薄璁惧">
+                <div style="max-height: 450px;overflow: auto;margin-top: 10px;">
+                    <table class="list" border="0" cellspacing="0" cellpadding="0">
+                        <tr class="headerRow" height="30px">
+                            <!-- todo 鏍规嵁涓嬮潰鍐呭鍕鹃�夊喅瀹� 鍏ㄩ�夌姸鎬� -->
+                            <th style="width:25px" class="headerRow  booleanColumn"><lightning-input label="鍏ㄩ��" variant="label-hidden"  type='checkbox' data-param="checkedAssets" onchange={checkAllcheckedAsset} checked={IsCheckAllcheckedAsset} value={IsCheckAllcheckedAsset}></lightning-input></th>
+                            <th style="width:200px" class="headerRow  booleanColumn">淇濇湁璁惧鍚�</th>
+                            <th style="width:75px" class="headerRow  booleanColumn">璁惧鐘舵��</th>
+                            <th style="width:60px" class="headerRow  booleanColumn">鏈鸿韩缂栫爜</th>
+                            <th style="width:40px" class="headerRow  booleanColumn">鏂板悎鍚屽鍝佺‘淇濇彁渚�</th>
+                            <th style="width:80px" class="headerRow  booleanColumn">瀹夎鏃ユ湡</th>
+                            <!--add鐐规鏀瑰杽锛氭柊澧炰竴涓偣妫�瀵硅薄澶嶉�夋瀛楁锛岄粯璁や负true 2021.6.8 fxk Star-->
+                            <th style="width:30px" class="headerRow  booleanColumn">鐐规瀵硅薄</th>
+                            <!--add鐐规鏀瑰杽锛氭柊澧炰竴涓偣妫�瀵硅薄澶嶉�夋瀛楁锛岄粯璁や负true 2021.6.8 fxk end-->
+                            <th style="width:30px" class="headerRow  booleanColumn">鏂板搧</th>
+                            <th style="width:55px" class="headerRow  booleanColumn">绉戝</th>
+                            
+                            <th style="width:120px" class="headerRow  booleanColumn">缁翠慨鍚堝悓鍙风爜</th>
+                            <th style="width:40px" class="headerRow  booleanColumn">甯傚満澶氬勾淇濊澶�</th>
+                            <th style="width:65px" class="headerRow  booleanColumn">娑堣垂鐜�</th>
+                            <th style="width:80px" class="headerRow  booleanColumn">鏈�杩戜竴鏈熺淮淇悎鍚岀粨鏉熸棩</th>
+                            <!-- 瀹炵哗鑱斿姩浠锋牸璁$畻 start -->
+                            <th style="width:90px" class="headerRow  booleanColumn">鏈璁惧绛剧害鏈�楂樹环鏍�</th>
+                            <th style="width:90px" class="headerRow  booleanColumn">鏈璁惧绛剧害鏈�浣庝环鏍�</th>
+                            <th style="width:140px" class="headerRow  booleanColumn">鍙備繚淇悊閲戦</th>
+                            <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->
+
+                            <th style="width:90px" class="headerRow ">淇悊閲戦</th>
+
+                           <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� end  style="width:70px"-->
+                            <th style="width:100px" class="headerRow  booleanColumn">澶囨敞</th>
+
+                            <!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� 绗笁鏂瑰洖褰� -->
+                            <th style="width:40px" class="headerRow  booleanColumn">绗笁鏂瑰洖褰�</th>
+                        </tr>
+                        <template for:each={checkedAssetData} for:item="ar">
+                            <tr key={ar.lineNo}>
+                                <td>
+                                    <lightning-input data-index={ar.lineNo} type="checkbox" label="鍕鹃��" value={ar.rec_checkBox_c} if:false={ar.IsManual} variant = "label-hidden" disabled={PageDisabled} checked={ar.rec_checkBox_c} onchange={handleTableRecCheckBox}></lightning-input>
+                                </td>
+                                <!--lightning-input readonly 鏀圭敤span  閬垮厤input鍐呭鏄剧ず涓嶅畬鍏�-->
+                                <td>
+                                    <template if:false={ar.IsManual}>
+                                        <!-- <lightning-input type="text" label="淇濇湁璁惧鍚�" value={ar.Name} variant="label-hidden" readonly ></lightning-input> -->
+                                        <span>{ar.Name}</span>
+                                    </template>
+                                    <template if:true={ar.IsManual}>
+                                        <lightning-record-edit-form
+                                            record-id=''
+                                            object-api-name={checkedAssetRelatedMaintenanceContractAssetEstimate}
+                                        >
+                                            <lightning-input-field data-index={ar.lineNo} label='淇濇湁璁惧鍚�' field-name="Product_Manual__c" value={ar.Name} onchange={handleTableProductManualChange} variant="label-hidden" disabled={ar.IsAssertDisabled}></lightning-input-field>
+                                        </lightning-record-edit-form>
+                                    </template>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="璁惧鐘舵��" value={ar.Asset_situation__c} variant="label-hidden" if:false={ar.IsManual}  readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual}>{ar.Asset_situation__c}</span>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="鏈鸿韩缂栫爜" value={ar.SerialNumber} variant="label-hidden" if:false={ar.IsManual}  readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual} style="text-decoration: underline;cursor: pointer;" data-param={ar.recId} onclick={handlePageNagivateTo}>{ar.SerialNumber}</span>
+                                </td>
+                                <td class="dataCell" style="text-align:center">
+                                    <lightning-input type="checkbox" label="鏂板悎鍚屽鍝佺‘淇濇彁渚�" value={ar.EquipmentGuaranteeFlgTxt__c} variant="label-hidden" checked={ar.EquipmentGuaranteeFlgTxt__c} disabled ></lightning-input>
+                                </td>
+                                <td class="dataCell" style="text-align:center" >
+                                    <!-- <lightning-input type="text" label="瀹夎鏃ユ湡" value={ar.InstallDate} variant="label-hidden" if:false={ar.IsManual}  readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual}>{ar.InstallDate}</span>
+
+                                </td>
+                                <td class="dataCell" style="text-align:center" >
+                                    <lightning-input type="checkbox" label="鐐规瀵硅薄" value={ar.Check_Object__c} variant="label-hidden" disabled={ar.CheckRows} data-index={ar.lineNo} onchange={handleTableCheckObjectChange} checked={ar.Check_Object__c}></lightning-input>
+                                </td>
+                                <td class="dataCell" style="text-align:center" >
+                                    <lightning-input type="checkbox" label="鏂板搧" value={ar.IsNew__c} variant="label-hidden" disabled="true" checked={ar.IsNew__c}></lightning-input>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="绉戝" value={ar.Department_Name__c} variant="label-hidden" if:false={ar.IsManual} readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual}>{ar.Department_Name__c}</span>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="缁翠慨鍚堝悓鍙风爜" value={ar.Maintenance_Contract_No_F__c} variant="label-hidden" if:false={ar.IsManual}  readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual}>{ar.Maintenance_Contract_No_F__c}</span>
+                                </td>
+                                <td class="dataCell" style="text-align:center">
+                                    <lightning-input type="checkbox" label="甯傚満澶氬勾淇濊澶�" value={ar.IS_VMContract_Asset__c} variant="label-hidden" if:false={ar.IsManual} checked={ar.IS_VMContract_Asset__c} disabled></lightning-input>
+                                </td>
+                                <!-- style="text-align:right"  -->
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="percent" label="娑堣垂鐜�" value={ar.Asset_Consumption_rate__c} variant="label-hidden" if:false={ar.IsManual}  readonly></lightning-input> -->
+                                    <span if:false={ar.IsManual}>
+                                        <span if:true={ar.Asset_Consumption_rate__c}>{ar.Asset_Consumption_rate__c}%</span>
+                                    </span>
+                                </td>
+                                <td class="dataCell">
+                                    <template if:true={ar.IsCurrentContract}>
+                                        <!-- <lightning-input type="text" label="鏈�杩戜竴鏈熺淮淇悎鍚岀粨鏉熸棩" value={ar.CurrentContract_End_Date__c} variant="label-hidden" if:false={ar.IsManual} readonly></lightning-input> -->
+                                        <span if:false={ar.IsManual}>{ar.CurrentContract_End_Date__c}</span>
+                                    </template>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="鏈璁惧绛剧害鏈�楂樹环鏍�" value={ar.Adjustment_Upper_price__c} variant="label-hidden" readonly></lightning-input> -->
+                                    <!-- <span>{ar.Adjustment_Upper_price__c}</span> -->
+                                    <p><lightning-formatted-number value={ar.Adjustment_Upper_price__c}></lightning-formatted-number></p>
+                                </td>
+                                <td class="dataCell">
+                                    <!-- <lightning-input type="text" label="鏈璁惧绛剧害鏈�浣庝环鏍�" value={ar.Adjustment_Lower_price__c} variant="label-hidden" readonly></lightning-input> -->
+                                    <!-- <span>{ar.Adjustment_Lower_price__c}</span> -->
+                                    <p><lightning-formatted-number value={ar.Adjustment_Lower_price__c}></lightning-formatted-number></p>
+
+                                </td>
+                                <td class="dataCell" style="text-align:right" >
+                                    <lightning-input type="number" label="鍙備繚淇悊閲戦" value={ar.Repair_Price__c} variant="label-hidden" data-index={ar.lineNo} onblur={handleTableRepairPriceChange} disabled={ar.IsRepairPriceDisabled} step="0.01"></lightning-input>
+                                </td>
+                                 <td class="dataCell" style="text-align:right" >
+                                    <!-- <lightning-input type="number" label="淇悊閲戦" value={ar.Repair_Price_Auto} variant="label-hidden" readonly style="width:95%; disabled:disabled;" if:true={ar.ShowAssetSituation}></lightning-input> -->
+                                    <span if:true={ar.ShowAssetSituation}>{ar.Repair_Price_Auto}</span>
+                                </td>
+                                <!--  width="70px"  style="text-align:right"-->
+                                <td class="dataCell" >
+                                    <lightning-input type="text" label="澶囨敞" value={ar.Comment__c} title={ar.commentTitle} variant="label-hidden" data-index={ar.lineNo} onchange={handleTableCommentChange} disabled={ar.ISCommentDisabled}></lightning-input>
+                                </td>
+                                <td class="dataCell" style="text-align:center;" >
+                                    <lightning-input type="checkbox" label="绗笁鏂瑰洖褰�" value={ar.Third_Party_Return__c} variant="label-hidden" checked={ar.Third_Party_Return__c} data-index={ar.lineNo} disabled={ar.IsThirdPartyReturnDisabled} onchange={handleTableThirdPartyReturnChange}></lightning-input>
+                                </td>
+
+                            </tr>
+                        </template>
+                    </table>
+                </div>
+                <!-- 鍚堝悓瀵硅薄璁惧 鍏朵粬鎸夐挳 -->
+                <div style="display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+                    padding: 10px 10px 0 10px;" >
+                    <!-- <div style="display: flex;
+                        align-items: center;
+                        justify-content: space-between;
+                        width: 80%;"> -->
+                        <lightning-button-group>
+                            <lightning-button label="琛岃拷鍔�" disabled={lineAddBtn}  onclick={handleAddNewRows} ></lightning-button>
+                            <lightning-button label="鍒锋柊閫変腑鐨勪繚鏈夎澶�" disabled={refreshAssetBtnLWC} onclick={handleExchangeAsset}></lightning-button>
+                            <!-- 鏀惧紑鐐瑰嚮锛屾坊鍔犺兘鍚� 鎴愬姛鍙栧喅浜� 纭娣诲姞 -->
+                            <lightning-button label="娣诲姞鏂扮殑淇濇湁璁惧" disabled={SaveBtnDisabled} onclick={showUnCheckedAsset}></lightning-button>
+                        </lightning-button-group>
+                        <!-- <lightning-button-group>
+                            <lightning-button label="鎻愪氦RC璇勪及" onclick={handleSendEmail} disabled={SendEmailBtnDisabled}></lightning-button>
+                            <lightning-button label="鎻愪氦淇悊鍑忎环瀹℃壒" onclick={handleToApprovalProcess} disabled={ApprovalBtnNewDisabled}></lightning-button>
+                        </lightning-button-group> -->
+                    <!-- </div> -->
+                    <span><lightning-button-group style="display: inline-block;margin-right: 10px;">
+                            <lightning-button label="鎻愪氦RC璇勪及" onclick={handleSendEmail} disabled={SendEmailBtnDisabled}></lightning-button>
+                            <lightning-button label="鎻愪氦淇悊鍑忎环瀹℃壒" onclick={handleToApprovalProcess} disabled={ApprovalBtnNewDisabled}></lightning-button>
+                        </lightning-button-group>
+                        璁惧鏁伴噺&nbsp;&nbsp;{productCount3} &nbsp;&nbsp;&nbsp; 淇悊鎬婚   &nbsp;&nbsp;{assetRepairSumNum}</span>
+                </div>
+            </lightning-accordion-section>
+                
+            <lightning-card  variant="Narrow" if:true={IsShowUnCheckedAsset}>
+                <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_large" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1">
+                    <div class="slds-modal__container">
+                        <header class="slds-modal__header" style="color: black;">
+                            <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={hiddenUnCheckedAsset} title="Close" style="background-color: #e5e4e2;">
+                                <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+                                    title="Close"  style="color: black;"></lightning-icon>
+                              <span class="slds-assistive-text">Close</span>
+                            </button>
+                            <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">鏈�夋嫨鐨勪繚鏈夎澶�</h2>
+                        </header>
+                        <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="font-size: 16px;text-align: left;height: auto;" >
+                            <!-- 鏈�夋嫨鐨勪繚鏈夎澶� 鎼滅储鏉′欢 -->
+                            <span style="margin-left: 10px;">閫夋嫨鏉′欢锛�</span>
+                            <div style="display: inline-block;">
+                                <div style="display: inline-block;">
+                                    <lightning-combobox
+                                        name="text1"
+                                        value={text1}
+                                        options={textOpts}
+                                        onchange={handleChangeText1} 
+                                        variant = "label-hidden"
+                                        ></lightning-combobox>
+                                </div>
+                                <div style="display: inline-block;margin-left: 10px;">
+                                    <lightning-combobox
+                                        name="cond1"
+                                        value={cond1}
+                                        options={equalOpts}
+                                        onchange={handleChangeCond1} 
+                                        variant = "label-hidden"
+                                        ></lightning-combobox>
+                                </div>
+                                <div style="display: inline-block;margin-left: 10px;">
+                                    <lightning-input type="text" label="" value={val1} variant = "label-hidden" onchange={handleChangeVal1} ></lightning-input>
+                                </div>
+                                <div style="display: inline-block;">
+                                    <lightning-button variant="brand-outline" label="妫�绱�" onclick={searchJs} class="slds-m-left_x-small"></lightning-button>
+                                    <lightning-button variant="brand-outline" label="娓呴櫎鏉′欢" onclick={clearAndSearch} class="slds-m-left_x-small"></lightning-button>
+                                </div>
+                            </div>
+                            <div style="margin-top: 10px; " if:true={unCheckedAssetNowData}>
+                                <div class="exampleHolder" if:true={IsLoading}>
+                                    <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+                                    <div class="slds-backdrop slds-backdrop_open"></div>
+                                </div>
+                                <!-- table custome -->
+                                <div>
+                                    <table class="list" border="0" cellspacing="0" cellpadding="0">
+                                        <tr class="headerRow" height="30px">
+                                            <th style="width:25px" class="headerRow  booleanColumn"><lightning-input label="鍏ㄩ��" variant="label-hidden" type='checkbox' data-param="unCheckedAssetNowData" onchange={checkAllUncheckedAsset} checked={IsCheckAllUncheckedAsset} value={IsCheckAllUncheckedAsset}></lightning-input></th>
+                                            <th style="width:250px" class="headerRow  booleanColumn">淇濇湁璁惧鍚�</th>
+                                            <th style="width:80px" class="headerRow  booleanColumn">璁惧鐘舵��</th>
+                                            <th style="width:75px" class="headerRow  booleanColumn">鏈鸿韩缂栫爜</th>
+                                            <th style="width:70px" class="headerRow  booleanColumn">绉戝</th>
+                                            <th style="width:90px" class="headerRow  booleanColumn">鏄惁鍙互鍙備繚锛堟湇鍔″悎鍚岋級</th>
+                                            <th style="width:90px" class="headerRow  booleanColumn">涓绘満/鑰楁潗</th>
+                                            <th style="width:75px" class="headerRow  booleanColumn">鏂板悎鍚屽鍝佺‘淇濇彁渚�</th>
+                                            <th style="width:70px" class="headerRow  booleanColumn">涓嶅彲鍙備繚鍘熷洜</th>
+                                            
+                                            <th style="width:100px" class="headerRow  booleanColumn">瀹夎鏃ユ湡</th>
+                                            <th style="width:90px" class="headerRow  booleanColumn">绱淇悊閲戦</th>
+                                            <!-- <th style="width:90px" class="headerRow  booleanColumn">缁翠慨鍚堝悓鏈堥</th> -->
+                                            <th style="width:110px" class="headerRow  booleanColumn">鏈�杩戜竴鏈熺淮淇悎鍚岀粨鏉熸棩</th>
+                                        </tr>
+                                        <template for:each={unCheckedAssetNowData} for:item="ar">
+                                            <tr key={ar.Id}>
+                                                <td style="width:25px">
+                                                    <lightning-input data-id={ar.Id} type="checkbox" label="鍕鹃��" value={ar.rec_checkBox_c} variant = "label-hidden" disabled={ar.uncheckedDisable} checked={ar.rec_checkBox_c} onchange={handleTableUncheckedRecCheckBox}></lightning-input>
+                                                </td>
+                                                <td  style="width:250px">
+                                                    <!-- 鏀圭敤span 鏄剧ず鎹㈣ -->
+                                                    <!-- <lightning-input type="text" label="淇濇湁璁惧鍚�" value={ar.name} variant="label-hidden" readonly></lightning-input> -->
+                                                     <span>{ar.name}</span>
+                                                </td>
+                                                <td class="dataCell" width="80px">
+                                                    <lightning-input type="text" label="璁惧鐘舵��" value={ar.Asset_situation__c} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="75px">
+                                                    <!-- <lightning-input type="text" label="鏈鸿韩缂栫爜" value={ar.SerialNumber} variant="label-hidden" readonly></lightning-input> -->
+                                                    <span>{ar.SerialNumber}</span>
+                                                </td>
+                                                <td class="dataCell" width="70px">
+                                                    <!-- <lightning-input type="text" label="绉戝" value={ar.Department_Name__c} variant="label-hidden" readonly></lightning-input> -->
+                                                    <span>{ar.Department_Name__c}</span>
+                                                </td>
+                                                <td class="dataCell" width="90px" style="text-align:center">
+                                                    <lightning-input type="text" label="鏄惁鍙互鍙備繚锛堟湇鍔″悎鍚岋級" value={ar.IF_Warranty_Service__c} variant="label-hidden" radonly disabled></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="90px" style="text-align:center">
+                                                    <lightning-input type="text" label="涓绘満/鑰楁潗" value={ar.AssetMark__c} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                                <td class="dataCell" style="text-align:center" >
+                                                    <lightning-input type="checkbox" label="鏂板悎鍚屽鍝佺‘淇濇彁渚�" value={ar.EquipmentGuaranteeFlg__c} variant="label-hidden" checked={ar.EquipmentGuaranteeFlg__c} disabled></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="70px" style="text-align:center">
+                                                    <lightning-input type="text" label="涓嶅彲鍙備繚鍘熷洜" value={ar.Reson_Can_not_Warranty__c} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="100px" style="text-align:center" >
+                                                    <lightning-input type="text" label="瀹夎鏃ユ湡" value={ar.InstallDate} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="90px" style="text-align:right" >
+                                                    <lightning-input type="text" label="绱淇悊閲戦" value={ar.Accumulation_Repair_Amount__c} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                                <td class="dataCell" width="100px" style="text-align:right" >
+                                                    <lightning-input type="text" label="鏈�杩戜竴鏈熺淮淇悎鍚岀粨鏉熸棩" value={ar.CurrentContract_End_Date__c} variant="label-hidden" readonly></lightning-input>
+                                                </td>
+                                            </tr>
+                                        </template>
+                                    </table>
+                                </div>
+                                
+                            </div>
+                            <div> {unCheckedAssetDataShow1}&nbsp;-&nbsp;{unCheckedAssetDataShow2} &nbsp;&nbsp; 鍏眥unCheckedAssetDataLength}涓� &nbsp;&nbsp;  鏄剧ず &nbsp;&nbsp;  
+                                <div style="display: inline-block;">
+                                    <lightning-combobox
+                                            name="progress"
+                                            value={pageDataLimit}
+                                            options={pageDataLimitOptions}
+                                            onchange={handlePageLimitChange} 
+                                            disabled={IsChangePageLimit} 
+                                            ></lightning-combobox>
+                                </div>&nbsp;&nbsp; 
+                                鏉¤褰� &nbsp;&nbsp;  绗瑊currentPage}椤�&nbsp;&nbsp; 
+                                <div style="display: inline-block;">    
+                                    <lightning-button-group>
+                                        <lightning-button label="棣栭〉" onclick={toTop} disabled={IsTop}></lightning-button>
+                                        <lightning-button label="涓婁竴椤�" onclick={toPre} disabled={IsPre}></lightning-button>
+                                        <lightning-button label="涓嬩竴椤�" onclick={toNext} disabled={IsNext}></lightning-button>
+                                        <lightning-button label="灏鹃〉" onclick={toEnd} disabled={IsEnd}></lightning-button>
+                                    </lightning-button-group>
+                                </div>&nbsp;&nbsp; 
+                                鍏眥pageCount}椤�</div>
+                        </div>
+                    
+                    <footer class="slds-modal__footer">
+                        <!-- 鍒锋柊閫変腑 -->
+                        <lightning-button variant="brand" disabled={refreshAssetBtn} label="纭娣诲姞" class="slds-var-m-left_x-small" onclick={handleExchangeAsset}></lightning-button>
+                        <lightning-button variant="neutral" label="鍙栨秷" class="slds-var-m-left_x-small" onclick={hiddenUnCheckedAsset}></lightning-button>
+                    </footer>
+                    </div>
+                </section>
+                    
+                <div class="slds-backdrop slds-backdrop_open"></div>
+            </lightning-card>
+            
+            <lightning-accordion-section name="D" label="鍚堝悓淇℃伅">
+                <lightning-record-edit-form
+                    object-api-name={objName}
+                    record-id={recordId}
+                >
+                <!-- if:true={IsRefresh} flexibility="auto"-->
+                <div class="c-container" style="width: 100%">
+                    <span>璇风粨鍚堝疄闄呭彲浠ョ绾︾殑鏃ユ湡锛岄�夋嫨鎭板綋鐨勭敵璇烽噾棰濓紝浠ュ厤鍚庣画绌虹櫧鏈熷彉鍖栧鑷存爣鍑嗛噾棰濆彉鍖栵紝鍐嶆鐢宠浠锋牸寤惰鏃堕棿</span>
+                    <div class="line">
+                        <div class="custom-box" style="display: inline-block;width: 20%;">
+                            <span>鏈璁″垝銆愬悎鍚岄瀹氬紑濮嬫棩銆�:{allData.startdateaddsix4}</span>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                            <span>鏍囧噯浠锋牸鐨勬渶浣庝环鎬婚</span>
+                            <!-- <lightning-input type="number" label="鏍囧噯浠锋牸鐨勬渶浣庝环鎬婚" value={estimate.GuidePrice_Down__c} variant="label-hidden" readonly></lightning-input> -->
+                            <p><lightning-formatted-number value={estimate.GuidePrice_Down__c}></lightning-formatted-number></p>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                                <span>鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚</span>
+                                <!-- <lightning-input type="number" label="鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚" value={estimate.GuidePrice_Up__c} variant="label-hidden" readonly></lightning-input> -->
+                                <p><lightning-formatted-number value={estimate.GuidePrice_Up__c}></lightning-formatted-number></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 14%;">
+                                <span>鐢宠鎶ヤ环閲戦</span>
+                                <!-- 鏁板�奸獙璇� -->
+                                <lightning-input type="number" label="鐢宠鎶ヤ环閲戦" value={estimate.Request_quotation_Amount__c} variant="label-hidden"  disabled={IsRequestQuotationAmountDisabled} onblur={checkDiscount} step="any"></lightning-input>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鍚堝悓璁惧淇悊鎬婚</span>
+                                <!-- <lightning-input type="number" label="鍚堝悓璁惧淇悊鎬婚" value={estimate.Asset_Repair_Sum_Price__c} variant="label-hidden" readonly></lightning-input> -->
+                                <p><lightning-formatted-number value={estimate.Asset_Repair_Sum_Price__c}></lightning-formatted-number></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鍚堝悓鎬婚噾棰�</span>
+                                <!-- <lightning-input type="number" label="鍚堝悓鎬婚噾棰�" value={estimate.Maintenance_Price__c} variant="label-hidden" readonly></lightning-input> -->
+                                <p><lightning-formatted-number value={estimate.Maintenance_Price__c}></lightning-formatted-number></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>涓婇檺閲戦</span>
+                                <lightning-input type="number" label="涓婇檺閲戦" value={estimate.Limit_Price_Amount__c} variant="label-hidden" onblur={handleLimitPriceAmount} disabled={IsLimitPriceAmountDisabled} style="ime-mode: disabled; text-align: right;" step="any"></lightning-input>
+                            </div>
+                    </div>
+
+                    <div class="line">
+                        <div class="custom-box" style="display: inline-block;width: 20%;">
+                            <span>褰撱�愬悎鍚岄瀹氬紑濮嬫棩銆戝湪{allData.startdateaddsix1}涔嬪墠</span>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                            <span>鏍囧噯浠锋牸鐨勬渶浣庝环鎬婚</span>
+                            <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Down1__c}></lightning-formatted-number></div>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                                <span>鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚</span>
+                                <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Up1__c}></lightning-formatted-number></div>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 14%;">
+                                <span>鐩稿鏍囧噯浠锋牸鑼冨洿鐨勬姌鎵g巼</span>
+                                <!-- <lightning-input-field label="鐩稿鏍囧噯浠锋牸鑼冨洿鐨勬姌鎵g巼" type="text" variant = "label-hidden" field-name="Service_discount_Rate__c" value={estimate.Service_discount_Rate__c} readonly></lightning-input-field> -->
+                                <p><lightning-formatted-number value={estimate.Service_discount_Rate__c}></lightning-formatted-number>%</p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鍚堝悓瀹氫环鎬婚</span>
+                                <!-- <lightning-input type="number" label="鍚堝悓瀹氫环鎬婚" value={estimate.Total_Contract_Price__c} variant="label-hidden" readonly></lightning-input> -->
+                                <p><lightning-formatted-number value={estimate.Total_Contract_Price__c}></lightning-formatted-number></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鏈�杩戜竴鏈熷悎鍚屾秷璐圭巼</span>
+                                <!-- <lightning-input-field label="鏈�杩戜竴鏈熷悎鍚屾秷璐圭巼" type="date" variant = "label-hidden" field-name="Combined_rate__c" value={estimate.Combined_rate__c} readonly></lightning-input-field> -->
+                                <p><lightning-formatted-number value={estimate.Combined_rate__c}></lightning-formatted-number>%</p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                 <span>棰勬祴娑堣垂鐜�</span>
+                                <!-- input -readOnly 鏈夐粦搴曟 -->
+                                <lightning-output-field type="number" variant = "label-hidden" field-name="Consumption_rate_Forecast__c"  value={estimate.Consumption_rate_Forecast__c}></lightning-output-field>
+                            </div>
+                    </div>
+
+                    <div class="line">
+                        <div class="custom-box" style="display: inline-block;width: 20%;">
+                            <span>褰撱�愬悎鍚岄瀹氬紑濮嬫棩銆戝湪{allData.startdateaddsix2}涔嬪悗</span>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                            <span>鏍囧噯浠锋牸鐨勬渶浣庝环鎬婚</span>
+                                <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Down2__c}></lightning-formatted-number></div>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                                <span>鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚</span>
+                                <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Up2__c}></lightning-formatted-number></div>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 14%;">
+                                <span>浠锋牸鑼冨洿</span>
+                                <p><lightning-formatted-text  value={estimate.Estimate_Price_range__c}></lightning-formatted-text></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鐢宠浠锋牸绾у埆</span>
+                                <p><lightning-formatted-text  value={estimate.ContractPriceType__c}></lightning-formatted-text></p>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 12%;">
+                                <span>鍚堝悓绉嶇被</span>
+                                <!-- 鏀逛负p -->
+                                <p><lightning-formatted-text value={estimate.New_Contract_Type_TxT__c}></lightning-formatted-text></p>
+                                <!-- <lightning-input type="text" variant="label-hidden" value={estimate.New_Contract_Type_TxT__c} readonly></lightning-input> -->
+                            </div>
+                    </div>
+
+                    <div class="line">
+                        <div class="custom-box" style="display: inline-block;width: 20%;">
+                            <span>褰撱�愬悎鍚岄瀹氬紑濮嬫棩銆戝湪{allData.startdateaddsix3}涔嬪墠</span>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                            <span>鏍囧噯浠锋牸鐨勬渶浣庝环鎬婚</span>
+                                <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Down3__c}></lightning-formatted-number></div>
+                        </div>
+                        <div class="custom-box" style="display: inline-block;width: 13%;">
+                                <span>鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚</span>
+                                <div>CNY &nbsp;&nbsp;<lightning-formatted-number value={estimate.GuidePrice_Up3__c}></lightning-formatted-number></div>
+                            </div>
+                        <div class="custom-box" style="display: inline-block;width: 14%;">
+                                <span>鏃犵紳缁鎶樻墸</span>
+                                <lightning-input-field label="鏃犵紳缁鎶樻墸" type="checkbox" variant = "label-hidden" field-name="renewTen_OFF__c" value={estimate.renewTen_OFF__c} disabled={IsRenewTenOFFDisabled}  onchange={handleRenewTenOFF}></lightning-input-field>
+                            </div>
+                        <!-- 2023/09/06 鎶ヤ环瑙勫垯鏀瑰杽鏂板 if:false={allData.isLimitPrice} -->
+                        <div class="custom-box" style="display: inline-block;width: 12%;" if:false={allData.isLimitPrice}>
+                                <span>鍚屾剰鏃犵紳缁</span>
+                                <lightning-input-field label="鍚屾剰鏃犵紳缁" type="checkbox" variant = "label-hidden" field-name="AgreeRenewTen_OFF__c" value={estimate.AgreeRenewTen_OFF__c} disabled={AgreeRenewTenDisabled} onchange={handleAgreeRenewTenOFF}></lightning-input-field>
+                        </div>
+                    </div>
+                    
+                </div>
+                </lightning-record-edit-form> 
+            </lightning-accordion-section>
+
+
+            <lightning-accordion-section name="E" label="鐢宠鑳屾櫙">
+                <lightning-record-edit-form
+                    object-api-name={objName}
+                    record-id={recordId}
+                >
+                <div class="c-container">
+                    <lightning-layout pull-to-boundary="medium">
+                        <lightning-layout-item size="3" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>鏈�缁堜环鏍煎喅瀹氬舰寮�</span>
+                                <lightning-input-field label="鏈�缁堜环鏍煎喅瀹氬舰寮�" field-name="finalPriceDecideWay__c" variant = "label-hidden" value={estimate.finalPriceDecideWay__c} disabled={PageDisabled} onchange={handleFinalPriceDecideWay}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                        <lightning-layout-item size="2" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>鏄惁閿�鍞檮甯�</span>
+                                <lightning-input-field label="鏄惁閿�鍞檮甯�" type="checkbox" field-name="Sales_incidental__c" variant = "label-hidden" value={estimate.Sales_incidental__c} disabled={PageDisabled} checked={estimate.Sales_incidental__c} onchange={handleSalesIncidental}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                        <lightning-layout-item size="2" padding="horizontal-medium">
+                            <div class="custom-box">
+                                
+                                <span>涓昏璋堝垽娆℃暟</span>
+                                <lightning-input-field label="涓昏璋堝垽娆℃暟" field-name="mainTalksTime__c" variant = "label-hidden" value={estimate.mainTalksTime__c} disabled={PageDisabled} onchange={handleMainTalksTime}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                        <lightning-layout-item size="3" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>璋堝垽鐨勫紑濮嬫椂闂�</span>
+                                <lightning-input-field label="璋堝垽鐨勫紑濮嬫椂闂�" field-name="talksStartDate__c" variant = "label-hidden" value={estimate.talksStartDate__c} disabled={PageDisabled} onchange={handleTalksStartDate}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                        <lightning-layout-item size="2" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>缁忛攢鍟嗗拰鍖婚櫌鐨勪环鏍�</span>
+                                <!-- classic 浠呬繚瀛樹袱浣嶅皬鏁� -->
+                                <lightning-input type="number" label="缁忛攢鍟嗗拰鍖婚櫌鐨勪环鏍�" value={estimate.AgencyHos_Price__c} variant="label-hidden" disabled={PageDisabled} onblur={handleAgencyHosPrice} step="0.01"></lightning-input>
+                            </div>
+                        </lightning-layout-item>
+                    </lightning-layout>
+                    <!-- <lightning-layout pull-to-boundary="medium">
+                        
+                    </lightning-layout>
+                    <lightning-layout pull-to-boundary="medium">
+                        
+                    </lightning-layout> -->
+                    <!-- <lightning-layout pull-to-boundary="medium">
+                        
+                    </lightning-layout> -->
+                    <lightning-layout pull-to-boundary="medium">
+                        <lightning-layout-item flexibility="auto" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>浠锋牸鐢宠鐞嗙敱</span>
+                                <lightning-input-field label="浠锋牸鐢宠鐞嗙敱" field-name="Discount_reason__c" variant = "label-hidden" value={estimate.Discount_reason__c} disabled={PageDisabled} onchange={handleDiscountReason}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                        <lightning-layout-item flexibility="auto" padding="horizontal-medium">
+                            <div class="custom-box">
+                                <span>娑堣垂鐜囨敼鍠勬柟妗�</span>
+                                <lightning-input-field  label="娑堣垂鐜囨敼鍠勬柟妗�" type="textarea" field-name="Improve_ConsumptionRate_Idea__c" variant = "label-hidden" value={estimate.Improve_ConsumptionRate_Idea__c} disabled={PageDisabled} onchange={handleImproveConsumptionRateIdea}> </lightning-input-field>
+                            </div>
+                        </lightning-layout-item>
+                    </lightning-layout>
+                </div>
+                </lightning-record-edit-form> 
+            </lightning-accordion-section>
+        </lightning-accordion>
+
+         <lightning-record-edit-form
+                object-api-name={objName}
+                record-id={recordId}
+            >
+        <!-- 鎸夐挳 -->
+        <!-- display: flex;
+            align-items: center;
+            justify-content: flex-end; -->
+        <div class="bottom c-container" style="padding: 20px 0 0 0;border-top: 1px solid #e5e5e5;">
+
+                <div class="pdf" style="background-color: #ffd6c1;margin: 0 10px;padding: 0 10px;">
+                    <div class=" c-container" style="display: flex;
+                        align-items: center;
+                        justify-content: space-between;" if:true={printFlag}>
+                        <span>鎵撳嵃鎶ヤ环</span>
+                        <div class="pdfCheck">
+                            <lightning-input-field label="瀹屾暣鐗�+鎶樻墸鍓�" field-name="Print_ListPrice__c" data-param='Print_ListPrice__c' type="checkbox" variant="label-hidden" checked={estimate.Print_ListPrice__c} value={estimate.Print_ListPrice__c} onchange={handleSimply}></lightning-input-field>瀹屾暣鐗�+鎶樻墸鍓�
+                        </div>
+                        <div class="pdfCheck">
+                            <lightning-input-field  label="瀹屾暣鐗�+鎶樻墸鍚�" field-name="Print_Simplify__c" data-param='Print_Simplify__c' type="checkbox" variant="label-hidden" checked={estimate.Print_Simplify__c} value={estimate.Print_Simplify__c} onchange={handleSimply}></lightning-input-field>瀹屾暣鐗�+鎶樻墸鍚�
+                        </div>
+                        <div class="pdfCheck">
+                            <lightning-input-field label="绠�鍖栫増+鎶樻墸鍓�" field-name="Print_RepairPrice__c" data-param='Print_RepairPrice__c' type="checkbox" variant="label-hidden" checked={estimate.Print_RepairPrice__c} value={estimate.Print_RepairPrice__c} onchange={handleSimply}></lightning-input-field>绠�鍖栫増+鎶樻墸鍓�
+                        </div>
+                        <div class="pdfCheck">
+                            <lightning-input-field label="绠�鍖栫増+鎶樻墸鍚�" field-name="Print_SumPrice__c" data-param='Print_SumPrice__c' type="checkbox" variant="label-hidden" checked={estimate.Print_SumPrice__c} value={estimate.Print_SumPrice__c} onchange={handleSimply}></lightning-input-field>绠�鍖栫増+鎶樻墸鍚�
+                        </div>
+                        <lightning-button variant="brand-outline" label="PDF鍗板埛" title="Primary action with lighter look" onclick={handlePrint} class="slds-m-left_x-small"></lightning-button>
+                    </div>
+                    <!--鍖婚櫌鍚堝悓,浠g悊鍟嗗悎鍚� 鍘焢age涓嶅彲鐐�  -->
+                    <!-- <div class=" c-container" style="display: flex;
+                        align-items: center;
+                        justify-content: space-between;">
+                        <span>鎵撳嵃鍚堝悓閰嶇疆</span>
+                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鍖婚櫌鍚堝悓
+                        <div if:true={EnablePrintContract} style="font-weight: normal;">
+                            <lightning-input-field label="涓夋柟鍗忚" field-name="Print_Tripartite__c" type="checkbox" data-param='Print_Tripartite__c' variant = "label-hidden" checked={estimate.Print_Tripartite__c} value={estimate.Print_Tripartite__c} onchange={handlePrintContract} style="display: inline-block;"></lightning-input-field>涓夋柟鍗忚
+                        </div>
+                        <span if:false={EnablePrintContract} style="font-weight: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;涓夋柟鍗忚</span>
+                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;浠g悊鍟嗗悎鍚�
+                        <lightning-button variant="brand-outline" label="PDF鍗板埛" title="Primary action with lighter look" onclick={handlePrint} class="slds-m-left_x-small"></lightning-button>
+                    </div> -->
+                </div>
+            <div style="display: flex;justify-content: space-between;text-align: right;align-items: center;justify-content: flex-end;">
+                <!-- <div style="display: flex;margin-top: 5px; ">
+                    <div class="custom-box bottomVMItem">
+                        <span>鍚堝悓寮�濮嬫棩</span>
+                        <lightning-input-field label="鍚堝悓寮�濮嬫棩" field-name="Contract_Start_Date__c" variant = "label-hidden" value={estimate.Contract_Start_Date__c} disabled={IsContractstartdateDisabled} onchange={handleContractStartDate} style="display: inline-block;width: 120px;"></lightning-input-field>
+                    </div>
+                    <div class="custom-box bottomVMItem">
+                        <span>鍚堝悓缁撴潫鏃�</span>
+                        <lightning-input-field label="鍚堝悓缁撴潫鏃�"  field-name="Contract_End_Date__c" variant = "label-hidden" value={estimate.Contract_End_Date__c} disabled style="width: 120px;"></lightning-input-field>
+                    </div>
+                </div> -->
+                <div  class="bottomBtn" style="text-align: right;margin-top: 10px;display: flex;">
+                    <div style="display: flex;margin-top: 2px; ">
+                        <div class="custom-box bottomVMItem">
+                            <span>鍚堝悓寮�濮嬫棩</span>
+                            <lightning-input-field label="鍚堝悓寮�濮嬫棩" field-name="Contract_Start_Date__c" variant = "label-hidden" value={estimate.Contract_Start_Date__c} disabled={IsContractstartdateDisabled} onchange={handleContractStartDate} style="display: inline-block;width: 120px;"></lightning-input-field>
+                        </div>
+                        <div class="custom-box bottomVMItem">
+                            <span>鍚堝悓缁撴潫鏃�</span>
+                            <lightning-input-field label="鍚堝悓缁撴潫鏃�"  field-name="Contract_End_Date__c" variant = "label-hidden" value={estimate.Contract_End_Date__c} disabled style="width: 120px;"></lightning-input-field>
+                        </div>
+                    </div>
+                    <!-- 2023/09/06 disabled={SaveBtnDisabled}-->
+                    <!-- 2023/09/18  璁$畻棰勬祴娑堣垂鐜� 鏆傛敞閲�-->
+                    <!-- <button onclick={consumptionbtnJs} disabled={SaveBtnDisabled} style="width: 120px;">璁$畻棰勬祴娑堣垂鐜�</button> -->
+
+                    <button onclick={handleSave} disabled={SaveBtnDisabled}>淇濆瓨</button>
+                    <button onclick={handleApprove} disabled={ApprovalBtnDisabled}>鎻愪氦寰呭鎵�</button>
+                    <button onclick={decideJs} disabled={DecideBtnDisabled}>Decide</button>
+                    <button onclick={handleUndecide} disabled={UnDecideBtnDisabled}>鍙栨秷Decide</button>
+                    <div style="color:red;font-size:20px;text-align: center;font-weight: normal;" if:true={IS_Clone_After_Decide}>璇锋彁浜ゅ緟瀹℃壒</div>
+                </div>
+            </div>
+
+        </div>
+    </lightning-record-edit-form>
+    </lightning-card>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js
new file mode 100644
index 0000000..30fc369
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js
@@ -0,0 +1,2808 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import LightningConfirm from 'lightning/confirm';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import { CurrentPageReference } from "lightning/navigation";
+import estimateUtility from 'c/lexSelectEstimateUtility';
+
+import init from "@salesforce/apex/lexSelectAssetEstimateVMController.init";
+import save from "@salesforce/apex/lexSelectAssetEstimateVMController.save";
+import refreshProductData from "@salesforce/apex/lexSelectAssetEstimateVMController.refreshProductData";
+import saveAndCancel from "@salesforce/apex/lexSelectAssetEstimateVMController.saveAndCancel";
+import addNewRows from "@salesforce/apex/lexSelectAssetEstimateVMController.addNewRows";
+import searchBtn from "@salesforce/apex/lexSelectAssetEstimateVMController.searchBtn";
+import exchangeAsset from "@salesforce/apex/lexSelectAssetEstimateVMController.exchangeAsset";
+import approvalProcess from "@salesforce/apex/lexSelectAssetEstimateVMController.approvalProcess";
+import ComputeLTYRepair from "@salesforce/apex/lexSelectAssetEstimateVMController.ComputeLTYRepair";
+import ShowLTYRepair from "@salesforce/apex/lexSelectAssetEstimateVMController.ShowLTYRepair";
+import toApprovalProcess from "@salesforce/apex/lexSelectAssetEstimateVMController.toApprovalProcess";
+import decide from "@salesforce/apex/lexSelectAssetEstimateVMController.decide";
+import decideCancle from "@salesforce/apex/lexSelectAssetEstimateVMController.decideCancle";
+import undecide from "@salesforce/apex/lexSelectAssetEstimateVMController.undecide";
+import print from "@salesforce/apex/lexSelectAssetEstimateVMController.print";
+import sendEmail from "@salesforce/apex/lexSelectAssetEstimateVMController.sendEmail";
+// 鍓嶇鍒嗛〉 - del
+// import firstPage from "@salesforce/apex/lexSelectAssetEstimateVMController.firstPage";
+// import previousPage from "@salesforce/apex/lexSelectAssetEstimateVMController.previousPage";
+// import nextPage from "@salesforce/apex/lexSelectAssetEstimateVMController.nextPage";
+// import endPage from "@salesforce/apex/lexSelectAssetEstimateVMController.endPage";
+// import recordNumChange from "@salesforce/apex/lexSelectAssetEstimateVMController.recordNumChange";
+
+import getApprovalBtnNewDisabled from "@salesforce/apex/lexSelectAssetEstimateVMController.getApprovalBtnNewDisabled";
+import ToConsumptionRate from "@salesforce/apex/ConsumptionRateWebService.ToConsumptionRate";
+import interceptsend from "@salesforce/apex/lexSelectAssetEstimateVMController.interceptsend";
+
+//鍓嶇闇�瑕佽ˉ鍏呮柟娉�
+import getMCAEIsCreateable from "@salesforce/apex/lexSelectAssetEstimateVMController.getMCAEIsCreateable";
+import saveBeforeCheckPriceChangeAsset from "@salesforce/apex/lexSelectAssetEstimateVMController.saveBeforeCheckPriceChangeAsset";
+import saveBeforeCheckPriceChangeProduct2 from "@salesforce/apex/lexSelectAssetEstimateVMController.saveBeforeCheckPriceChangeProduct2";
+import onChDealerUpdate from "@salesforce/apex/lexSelectAssetEstimateVMController.onChDealerUpdate";
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+import lexSendNfm103 from '@salesforce/resourceUrl/lexSendNfm103';  
+// import test from "@salesforce/apex/lexSelectAssetEstimateVMController.test";
+
+//completion=锛� page閲岃烦杞洖鍘熺紪杈戦〉闈�  id=浼犲洖鍙傛暟
+export default class lexSelectAssetEstimateVM extends NavigationMixin(LightningElement){
+    activeSections = ['A', 'B','C','D','E'];
+    // @track activeSections = ['A'];
+    IsLoading = true;
+    objName = 'Maintenance_Contract_Estimate__c';
+    recordId;
+    params;
+    goTo;
+    IsParams;
+    //涓夋柟鍗忚 鍕鹃�夋槸鍚︽樉绀�
+    EnablePrintContract;
+    //璇锋彁浜ゅ緟瀹℃壒 鏂囧瓧鎻愮ず
+    IS_Clone_After_Decide;
+    @track
+    estimate = {};
+    contract = {};
+    
+    @track estimateTemp = {Request_quotation_Amount__c : 0,AgencyHos_Price__c : 0};
+    @track estimateAgencyHosPrice = {AgencyHos_Price__c : 0};
+    //瀛樻斁鍒濆鍖栨墍鏈夋暟鎹�
+    allData = {};
+    checkedAssetRelatedMaintenanceContractAssetEstimate = 'Maintenance_Contract_Asset_Estimate__c';
+    //椤甸潰鏁版嵁鏄剧ず  recId -- rec.Id(鍘熼�氳繃鍚庣鐨刧et鏂规硶鍙栧��)
+    checkedAssetData = [];
+    IsCheckAllcheckedAsset = false;
+    //閫変腑淇濇湁璁惧  鏁版嵁缁熻 //allData.productCount3 鍙浛鎹�
+    productCount3 = 0;
+    checkedAssetDataSize = true;
+    //淇悊鎬婚--浠呴〉闈㈡樉绀�
+    assetRepairSumNum;
+    //鏈�変腑淇濇湁璁惧 寮规鏄剧ず涓庡惁
+    IsShowUnCheckedAsset;
+    unCheckedAssetData = [];
+    IsCheckAllUncheckedAsset = false;
+    unCheckedAssetDataLength;
+    //鍒嗛〉澶勭悊--鏄惁鍙互鐩存帴鍦ㄥ墠绔鐞�
+    currentPage = 1;
+    pageDataLimit = 20;
+    pageCount;
+    //鏈�変腑淇濇湁璁惧  涓嬫柟鏂囧瓧
+    unCheckedAssetDataShow1 ;
+    unCheckedAssetDataShow2 ;
+    //褰撳墠椤垫暟鎹�
+    unCheckedAssetNowData = [];
+    //淇濇湁璁惧 鎼滅储鏉′欢  -> allData閲�
+    text1 = 'S:AssetMark__c';                      // 瀵硅薄
+    cond1 = 'equals';                   // 鏉′欢
+    val1;
+    //鍓嶇鍒ゆ柇鎸夐挳鏄惁鍙互鐐瑰嚮
+    SaveBtnDisabled;
+    ApprovalBtnDisabled;
+    //鍚庡彴杩斿洖缁撴灉
+    ApprovalBtnNewDisabled;
+    PageDisabled;
+    hasSendEmail;
+    //allData.productCount 鍙浛鎹�
+    productCount;
+    //鎶ヤ环鎻愪氦瀵硅薄 鍙樻洿鎸夐挳 Disabled  DecideBtnDisabled
+    DecideBtnDisabled;
+    UnDecideBtnDisabled;
+    //鎻愪氦RC璇勪及 btn
+    SendEmailBtnDisabled;
+    //琛ュ厖鍒濆鍖栨暟鎹�
+    approvalDate = '';
+    refreshAssetBtn;
+    // lwc 鍒锋柊鎸夐挳绂佺敤
+    refreshAssetBtnLWC;
+    IsTop;
+    IsPre;
+    IsNext;
+    IsEnd;
+    lineAddBtn;
+    IsChangePageLimit;
+    printFlag = true;
+    //鐩稿叧瀛楁鏀瑰姩瀵艰嚧绂佺敤鎴栦笉鏄剧ず
+    IsContractstartdateDisabled;
+    IsDealerDisabled;
+    // del 璇ョ鐢ㄥ瓧娈靛凡鏀逛负鍙
+    // IsFirstParagraphEndDisabled;
+    AgreeRenewTenDisabled;
+    IsRequestQuotationAmountDisabled;
+    IsLimitPriceAmountDisabled;
+    IsContractEstiStartDateDisabled;
+    //椤甸潰鏁版嵁鍒锋柊
+    IsRefresh = true;
+    EstimateTargetIsDealer;
+    EstimatePricerange;
+    ContractPriceType;
+
+
+    //鑾峰彇Id
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+           
+
+            const urlValue = currentPageReference.state.fragment;
+            if (urlValue) {
+                this.otherParams = urlValue;
+                let str = `${urlValue}`;
+                this.params = str.split('=');
+                
+                this.recordId = str.split('=')[1];
+                this.IsParams = this.params[0] == 'id';
+                this.goTo = true;
+            }else{
+                estimateUtility.toast.showToast(this, 'error', '璇蜂粠鍚堝悓鍜屾姤浠烽〉闈㈣繘鍏�');
+                setTimeout(function() {
+                         window.open('/lightning/page/home','_self');
+                    }, 3000);
+                this.goTo = false;
+            }
+        }
+    }
+    //椤甸潰鍒濆鍖�
+    connectedCallback() {
+         Promise.all([
+            loadStyle(this, lwcCSS),
+            loadStyle(this, lexSendNfm103)
+           ]);
+         if (this.goTo) {
+            init({
+                recordId: this.recordId,
+                param: this.params[0],
+            }).then(result => {
+                result = JSON.parse(result);
+                console.log('result',result);
+                console.log('estimate===',JSON.stringify(result.estimate));
+
+                if (result != null) {
+
+                    this.allData = result;
+
+                    this.handleInitSimpleData(result);
+                    this.allData.checkedAssets = this.refreshAsset(result.checkedAssets.length,result.checkedAssets);
+                    this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+                    this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+                    this.calonLoad();
+                    this.allDataInfo();
+                }
+            }).catch(error => {
+                console.log('閿欒==='+error);
+                estimateUtility.toast.showToast(this, 'error', '鏃犳硶鏄剧ず缁翠慨鍚堝悓鎶ヤ环');
+            }).finally(() => {
+                const sections = this.template.querySelectorAll('lightning-accordion-section');
+                    sections.forEach(section => {
+                        if(section.id.includes('myAccordionSection')) {
+                            section.active = true;
+                        }
+                    }); 
+                this.IsLoading = false;             
+            }); 
+         }
+        
+    }
+
+    handleCheckedAssetColumnsAndData(checkedAssets){
+        console.log('handleCheckedAssetColumnsAndData');
+        this.IsRefresh = false;
+        let checkedAssetsData = [];
+        let index = 0;
+        let assetsCount = 0;
+        let refreshAssetBtnLWCDisabled = true;
+        checkedAssets.forEach(function(ar) {
+            let objData = {};
+
+            objData['lineNo'] = ar.lineNo;
+            objData['rec_checkBox_c'] =  ar.rec_checkBox_c;
+            objData['IsManual'] = ar.isManual;
+            
+            objData['CheckRows'] =ar.CheckRows;
+
+            objData['Repair_Price_Auto'] =ar.Repair_Price_Auto;
+            //鍏辨湁瀛楁
+            if (ar.mcae != null) {
+                objData['EquipmentGuaranteeFlgTxt__c'] = ar.mcae.EquipmentGuaranteeFlgTxt__c;
+                objData['Check_Object__c'] = ar.mcae.Check_Object__c;
+                objData['IsNew__c'] = ar.mcae.IsNew__c;
+                // if (ar.mcae.Adjustment_Upper_price__c !=null && ar.mcae.Adjustment_Upper_price__c !='') {
+                //     let aup  = 0;
+                //     aup = ar.mcae.Adjustment_Upper_price__c;
+                //     objData['Adjustment_Upper_price__c'] = parseFloat(aup.toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2 }));
+                // }
+                objData['Adjustment_Upper_price__c'] = ar.mcae.Adjustment_Upper_price__c;
+                objData['Adjustment_Lower_price__c'] = ar.mcae.Adjustment_Lower_price__c;
+                objData['Repair_Price__c'] = ar.mcae.Repair_Price__c;
+                objData['Comment__c'] = ar.mcae.Comment__c;
+                objData['commentTitle'] = ar.mcae.Comment__c ? ar.mcae.Comment__c : '';
+                objData['Third_Party_Return__c'] = ar.mcae.Third_Party_Return__c;
+            }
+            if (ar.rec != null) {
+                objData['IsCurrentContract'] = ar.rec.CurrentContract_F__c != null;
+                objData['recId'] = ar.rec.Id;
+
+                objData['CurrentContract_F__c'] = ar.rec.CurrentContract_F__c;
+            }
+            if (ar.isManual == true && ar.mcae != null) {
+              objData['Name'] = ar.mcae.Product_Manual__c;
+
+              if (ar.mcae.Product_Manual__c) {
+                assetsCount += 1;
+              }
+            }else if ( ar.isManual == false) {
+                assetsCount += 1;
+                if (ar.rec != null) {
+                  objData['Name'] = ar.rec.Name;
+                  refreshAssetBtnLWCDisabled = false;
+                  objData['CurrentContract_End_Date__c'] = ar.rec.CurrentContract_End_Date__c;
+                  objData['Asset_situation__c'] = ar.rec.Asset_situation__c;
+                  objData['SerialNumber'] = ar.rec.SerialNumber;
+                  objData['InstallDate'] = ar.rec.InstallDate;
+                  objData['Department_Name__c'] = ar.rec.Department_Name__c;
+                  if (ar.rec.CurrentContract_F__r != null) {
+                    if (ar.rec.CurrentContract_F_asset__r != null) {
+                        objData['IS_VMContract_Asset__c'] =  ar.rec.CurrentContract_F_asset__r.IS_VMContract_Asset__c;
+                    }
+                    objData['Maintenance_Contract_No_F__c'] = ar.rec.CurrentContract_F__r.Maintenance_Contract_No_F__c;
+                    objData['Contract_End_Date__c'] =  ar.rec.CurrentContract_F__r.Contract_End_Date__c;
+                  }
+              }
+              if (ar.mcae != null) {
+                objData['Asset_Consumption_rate__c'] =  ar.mcae.Asset_Consumption_rate__c;
+              }
+            }
+            //琛ュ厖瀛楁鍙惁缂栬緫
+            objData['IsAssertDisabled'] =  ar.IsAssertDisabled;
+            objData['IsRepairPriceDisabled'] =  ar.IsRepairPriceDisabled;
+            objData['ISCommentDisabled'] =  ar.ISCommentDisabled;
+            objData['IsThirdPartyReturnDisabled'] =  ar.IsThirdPartyReturnDisabled;
+            objData['ShowAssetSituation'] =  ar.ShowAssetSituation;
+            checkedAssetsData.push(objData);
+          
+        });
+        this.checkedAssetData = checkedAssetsData;
+        //宸查�夋嫨淇濇湁璁惧
+        //this.productCount3 缁熻
+        this.productCount3 = assetsCount;
+        this.allData.productCount3 = this.productCount3;
+        this.refreshAssetBtnLWC = this.refreshAssetBtnLWC || refreshAssetBtnLWCDisabled;
+        this.IsRefresh = true;
+    }
+
+    handleunCheckedAssetColumnsAndData(unCheckedAssets){
+        console.log('handleunCheckedAssetColumnsAndData');
+        this.IsRefresh = false;
+
+        let uncheckedAssetsData = [];
+        let refreshAssetBtnDisabled = true;
+        unCheckedAssets.forEach(function(ar) {
+             let objData = {};
+            //鍏辨湁瀛楁
+            objData['rec_checkBox_c'] = ar.rec_checkBox_c;
+            if (ar.mcae != null) {
+            }
+            if (ar.rec != null) {
+                objData['Id'] = ar.rec.Id;
+                //澶嶉�夋鍙嬀閫夊垽鏂� disabled="{!IF(ar.rec.Maintenance_Price_Month__c == 0 || ar.rec.IF_Warranty_Service__c = '鍚�', 'true', 'false')}"
+                objData['uncheckedDisable'] = ar.rec.Maintenance_Price_Month__c == 0 || ar.rec.IF_Warranty_Service__c == '鍚�';
+                // 鏈�夋嫨 鏈夊彲鍕鹃�夊唴瀹�
+                if (!objData['uncheckedDisable']) {
+                    refreshAssetBtnDisabled = false; 
+                }
+                objData['EquipmentGuaranteeFlg__c'] = ar.rec.EquipmentGuaranteeFlg__c;
+
+                objData['name'] = ar.rec.Name;
+                objData['Asset_situation__c'] = ar.rec.Asset_situation__c;
+                
+                objData['SerialNumber'] = ar.rec.SerialNumber;
+                objData['InstallDate'] = ar.rec.InstallDate;
+                objData['Department_Name__c'] = ar.rec.Department_Name__c;
+                objData['IF_Warranty_Service__c'] = ar.rec.IF_Warranty_Service__c;
+                objData['AssetMark__c'] = ar.rec.AssetMark__c;
+                objData['EquipmentGuaranteeFlg__c'] = ar.rec.EquipmentGuaranteeFlg__c;
+                objData['Reson_Can_not_Warranty__c'] = ar.rec.Reson_Can_not_Warranty__c;
+                objData['Accumulation_Repair_Amount__c'] = ar.rec.Accumulation_Repair_Amount__c;
+                // objData['Maintenance_Price_Month__c'] = ar.rec.Maintenance_Price_Month__c;
+                objData['CurrentContract_End_Date__c'] = ar.rec.CurrentContract_End_Date__c;
+            }
+            uncheckedAssetsData.push(objData);
+        });
+        this.unCheckedAssetData = uncheckedAssetsData;
+        console.log('this.unCheckedAssetData',this.unCheckedAssetData);
+        this.getUnCheckedAssetNowData();
+        
+        this.refreshAssetBtn = this.refreshAssetBtn || refreshAssetBtnDisabled;
+
+        this.IsRefresh = true;
+    }
+
+    handleInitSimpleData(result) {
+        console.log('handleInitSimpleData');
+
+        this.IsRefresh = false;
+        
+
+        this.estimate = result.estimate;
+        this.handleEstimateTargetIsHospitalTrue();
+        
+        if (this.estimate.Is_RecognitionModel__c  == null || !this.estimate.Is_RecognitionModel__c) {
+            this.estimate.Is_RecognitionModel__c = false;
+        }
+        if (this.estimate.Print_RepairPrice__c == null || !this.estimate.Print_RepairPrice__c) {
+            this.estimate.Print_RepairPrice__c = false;
+        }
+        if (this.estimate.Print_SumPrice__c == null || !this.estimate.Print_SumPrice__c) {
+            this.estimate.Print_SumPrice__c = false;
+        }
+        if (this.estimate.Print_Contract__c == null || !this.estimate.Print_Contract__c) {
+            this.estimate.Print_Contract__c = false;
+        }
+        if (this.estimate.Print_Tripartite__c == null || !this.estimate.Print_Tripartite__c) {
+            this.estimate.Print_Tripartite__c = false;
+        }
+        if (this.estimate.Print_Agent__c == null || !this.estimate.Print_Agent__c) {
+            this.estimate.Print_Agent__c = false;
+        }
+        this.contract = result.contract;
+
+        this.pageDataLimit = result.selRecordOption;
+        this.currentPage = result.currPage;
+        this.pageCount = result.totalPage;
+        this.IsChangePageLimit = result.totalRecords<10;
+        this.hasSendEmail = result.hasSendEmail;
+        this.productCount = result.checkedAssets.length;
+        this.val1 = result.val1;
+        this.productCount3 = result.productCount3;
+        this.IS_Clone_After_Decide = result.IS_Clone_After_Decide;
+
+        this.allData.text1 = this.text1 ;                  // 瀵硅薄
+        this.allData.cond1 = this.cond1 ; 
+        if (this.contract.Decided_Estimation__c || this.estimate.Process_Status__c && this.estimate.Process_Status__c != '鑽夋涓�') {
+            this.SaveBtnDisabled = true;
+            this.ApprovalBtnDisabled  = true;
+            this.PageDisabled = true;
+            this.SendEmailBtnDisabled = true;
+        }else{
+            this.SaveBtnDisabled = false;
+            this.ApprovalBtnDisabled = false;
+            this.SendEmailBtnDisabled = false;
+            this.PageDisabled = false;
+            if(this.hasSendEmail == true){
+                this.SendEmailBtnDisabled = true;
+            }
+        }
+        if(this.contract.Decided_Estimation__c || this.estimate.Process_Status__c != '鎵瑰噯' 
+            || (this.estimate.Change_Dealer_Approval__c && this.estimate.Change_Dealer_Approval__c != '鎵瑰噯'
+                && this.estimate.Change_Dealer_Approval__c != '鏈壒鍑�')){
+
+            this.DecideBtnDisabled = true;
+
+        }else{
+            this.DecideBtnDisabled = false;
+        }
+        if (this.contract.Decided_Estimation__c) {
+            this.EnablePrintContract = this.estimate.Estimation_Decision__c;
+            if (this.estimate.Estimation_Decision__c) {
+                this.UnDecideBtnDisabled = false;
+            }
+        }else{
+            this.UnDecideBtnDisabled = true;
+            this.EnablePrintContract = false;
+        }
+        getMCAEIsCreateable({
+        }).then(result => {
+            console.log('getMCAEIsCreateable result',result);
+            this.lineAddBtn = this.PageDisabled || !result;
+        }).catch(error => {
+        }).finally(() => {
+        }); 
+        if (this.contract.Decided_Estimation__c || this.estimate.Process_Status__c && this.estimate.Process_Status__c != '鑽夋涓�') {
+            // TODO 鐗瑰垾璩囨牸銇屻亗銈屻伆 鐢宠珛鍙兘銇仚銈�
+            this.ApprovalBtnNewDisabled = true;
+        }else{
+            getApprovalBtnNewDisabled({
+            }).then(result => {
+                this.ApprovalBtnNewDisabled = result;
+                console.log('getApprovalBtnNewDisabled this.ApprovalBtnNewDisabled',this.ApprovalBtnNewDisabled);
+            }).catch(error => {
+            }).finally(() => {
+            });  
+        }
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230713 start
+        if (result.isAgreeRenewTen == true) {
+            this.AgreeRenewTenDisabled = false;
+        }else{
+            this.AgreeRenewTenDisabled = true;
+        }
+        this.refreshAssetBtn = this.SaveBtnDisabled;
+        console.log('this.refreshAssetBtn ',this.refreshAssetBtn);
+        this.refreshAssetBtnLWC = this.refreshAssetBtn;
+        this.recordId = this.allData.targetEstimateId;
+        this.IsRefresh = true;
+    }
+    pageBtnDiasbled(){
+        console.log('pageBtnDiasbled');
+        this.IsTop = this.pageCount == 0 || this.currentPage == 1;
+        this.IsPre = this.pageCount == 0 || this.currentPage == 1;
+        this.IsNext = this.pageCount == 0 || this.currentPage == this.pageCount;
+        this.IsEnd = this.pageCount == 0 || this.currentPage == this.pageCount;
+    }
+    //椤甸潰鎸夐挳绂佺敤鍒濆鍖�
+    async calonLoad() {
+        console.log('calonLoad');
+
+        // refreshAsset 鍐嶆 绌虹櫧鏈熶細琚慨鏀癸紝瀹為檯鏄剧ず鍊煎彲鑳戒細涓庣涓�娆¤绠椾笉涓�鑷�
+        this.allData.checkedAssets = this.refreshAsset(this.allData.checkedAssets.length,this.allData.checkedAssets);
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+
+        var RequestquotationAmount = this.estimate.Request_quotation_Amount__c;
+        var AssetRepairSumPrice    = this.estimate.Asset_Repair_Sum_Price__c;
+        var Limit_Price_Amount = (this.localParseFloat(AssetRepairSumPrice)+this.localParseFloat(RequestquotationAmount))*1.3;
+        Limit_Price_Amount = Math.round(Limit_Price_Amount);
+        var Limit_Price_AmountOne =  this.estimate.Limit_Price_Amount__c;
+        var Limit_PriceHidden =  this.allData.OldLimitPrice;
+        if (Limit_PriceHidden*1==0) {
+            this.estimate.Limit_Price_Amount__c = Limit_Price_Amount;
+        }
+        var Limit_PriceHidden2 =  this.allData.isLimitPrice;
+        if (Limit_PriceHidden2 == false) {
+            this.estimate.Limit_Price_Amount__c = '';
+        }
+        var Price111 = this.estimate.Limit_Price_Amount__c;
+        await this.pageSetDisabled();
+        var createdDate = new Date(this.estimate.CreatedDate);
+        // 鎶ヤ环涓澶囩殑鏈鸿韩缂栫爜涓虹┖鏃剁殑鏂板搧鍚堝悓鏈夋晥鏈熷欢闀� 20200710 gzw
+        var aLLManual = 'true';
+        var cntWithKara = this.productCount; 
+        for (var i = 0; i < cntWithKara; i++) {
+            var isManual = this.allData.checkedAssets[i].isManual; 
+            if (isManual != true) {
+                aLLManual = 'false';
+                break;
+            }
+        }
+        var nowDate = new Date();
+        if (aLLManual == 'false') {
+            createdDate = createdDate.setMonth(createdDate.getMonth() + 3);
+            // FIX liang JS銇檪闁撱仯銇� addMonths銇亜銇с仚銇嬶紵 銇濄亱銈� 1/1 銇倝銆� 4/1銈傘仩銈併仹銇欍倛銆�
+            if (createdDate < Date.parse(nowDate)) {
+                this.SaveBtnDisabled = true;
+                this.ApprovalBtnDisabled = true;
+                this.SendEmailBtnDisabled = true;
+                if (await estimateUtility.toast.handleConfirmClick("宸茶秴杩囧垱寤烘棩3涓湀锛屾槸鍚︽洿鏂版姤浠凤紵")) {
+                    window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#copyid="+this.allData.targetEstimateId; 
+                    location.reload();
+                    return true;
+                } else {
+                    if (!this.DecideBtnDisabled) {
+                        // decide鍙兘銇牬鍚堛�佸垾閫攄ecide銇儊銈с儍銈亴蹇呰銆�
+                        // 銉併偋銉冦偗寰屽啀搴︾敾闈efresh銇曘倢銈嬨仧銈併�乨ecide鍙兘銇牬鍚堛�乨ecide銉溿偪銉炽亴浣裤亪銈嬨倛銇嗐伀銇倞銇俱仚銆�
+                        this.changeContractStartdate(this.estimate.Contract_Start_Date__c);
+                    }
+                    return false;
+                }
+            }
+        }else{
+            createdDate = createdDate.setMonth(createdDate.getMonth() + 6);
+            // FIX liang JS銇檪闁撱仯銇� addMonths銇亜銇с仚銇嬶紵 銇濄亱銈� 1/1 銇倝銆� 4/1銈傘仩銈併仹銇欍倛銆�
+            if (createdDate < Date.parse(nowDate)) {
+                this.SaveBtnDisabled = true;
+                this.ApprovalBtnDisabled = true;
+                this.SendEmailBtnDisabled = true;
+                if (await estimateUtility.toast.handleConfirmClick("宸茶秴杩囧垱寤烘棩6涓湀锛屾槸鍚︽洿鏂版姤浠凤紵")) {
+                    window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#copyid="+this.allData.targetEstimateId; 
+                    location.reload();
+                    return true;
+                } else {
+                    if (!this.DecideBtnDisabled) {
+                        // decide鍙兘銇牬鍚堛�佸垾閫攄ecide銇儊銈с儍銈亴蹇呰銆�
+                        // 銉併偋銉冦偗寰屽啀搴︾敾闈efresh銇曘倢銈嬨仧銈併�乨ecide鍙兘銇牬鍚堛�乨ecide銉溿偪銉炽亴浣裤亪銈嬨倛銇嗐伀銇倞銇俱仚銆�
+                        this.changeContractStartdate(this.estimate.Contract_Start_Date__c);
+                    }
+                    return false;
+                }
+            }
+        }
+        if (!this.DecideBtnDisabled) {
+            this.allData.OldMaintenancePrice = this.estimate.Maintenance_Price__c;
+        }
+    }
+
+    pageSetDisabled(){
+        console.log('pageSetDisabled');
+
+        var hasSendEmail = this.allData.hasSendEmail; 
+        if(hasSendEmail == true){
+            this.SendEmailBtnDisabled = true;
+        }
+
+        var isDisabled = this.PageDisabled;
+        if (isDisabled) {
+
+
+            this.IsContractEstiStartDateDisabled = true;
+
+            var rowCnt = this.productCount;
+            for (var i = 0; i < rowCnt; i++) {
+
+                var isManual = this.allData.checkedAssets[i].isManual;
+                if (isManual == true) {
+                    this.allData.checkedAssets[i].IsAssertDisabled = true;
+                }
+                this.allData.checkedAssets[i].CheckRows = true;
+                this.allData.checkedAssets[i].IsRepairPriceDisabled = true;
+                this.allData.checkedAssets[i].ISCommentDisabled = true;
+                this.allData.checkedAssets[i].IsThirdPartyReturnDisabled = true;
+            }
+            //Examination_Count,disPercent,disMoney 鏈壘鍒�
+
+            //姝ゅ鐨� disabled 鍙互鐢≒ageDisabled鏇挎崲
+            this.IsRequestQuotationAmountDisabled = true;
+            this.IsContractstartdateDisabled = true;
+            var target = this.estimate.Estimate_Target__c;
+            if (target != '鍖婚櫌') {
+                this.IsDealerDisabled = true;
+            }
+        }
+        if (!this.DecideBtnDisabled) {
+            this.IsContractstartdateDisabled = false;
+            // 2023/09/06 鎶ヤ环瑙勫垯鏀瑰杽绌虹櫧鏈� start +-   
+            var renewTenOFF = this.estimate.renewTen_OFF__c;     
+            var startime1 =  new Date(this.allData.Past_Contract_end_day);       
+            var startime2 = new Date(this.estimate.Contract_Esti_Start_Date__c);         
+            var result = (startime2-startime1)/(3600*24*1000);       
+            var VMProductCountAll = this.allData.VMProductCountAll;        
+            var ProductCountAll = this.allData.ProductCountAll; 
+            console.log('VMProductCountAll',VMProductCountAll);
+            console.log('ProductCountAll',ProductCountAll);
+            // 涓嶈兘 娣诲姞鏈夊�煎垽瀹�
+            if (VMProductCountAll ==ProductCountAll) {       
+                result = 0;      
+            }
+            console.log('result',result);
+                    
+            if (renewTenOFF) {       
+                if (result==0) {         
+                }else{       
+                    this.IsContractstartdateDisabled = true;   
+                }        
+            }        
+             // 鎶ヤ环瑙勫垯鏀瑰杽绌虹櫧鏈� end
+        }
+        //琛ュ厖椤甸潰鏁版嵁澶勭悊
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+    }
+    //
+    async changeContractStartdate(val) {
+        var oldDateStr = this.estimate.Contract_Start_Date__c;
+        console.log('changeContractStartdate oldDateStr',oldDateStr);
+        console.log('changeContractStartdate Date',new Date(this.estimate.Contract_Start_Date__c));
+        var oldDate = new Date();
+        if (oldDateStr != null && oldDateStr != '') {
+            oldDate = new Date(oldDateStr);
+        }
+        if (!this.DecideBtnDisabled) {
+            var monthStr = '00' + (oldDate.getMonth()+1);
+            monthStr = monthStr.substring(monthStr.length-2, monthStr.length);
+            var dayStr = '00' + oldDate.getDate();
+            dayStr = dayStr.substring(dayStr.length-2, dayStr.length);
+            var oldDateVal = oldDate.getFullYear() + '/' + monthStr + '/' + dayStr;
+            this.allData.OldContractStartDate = oldDateVal;
+            if (await this.saveBeforeCheckPriceChange()) {
+            }
+            this.allData.checkedAssets = this.refreshAsset(this.allData.checkedAssets.length,this.allData.checkedAssets);
+            this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        } else {
+            var cntWithKara = this.productCount;
+            var haveLine = 'false';
+            for (var i = 0; i < cntWithKara; i++) {
+                var isManual = this.allData.checkedAssets[i].isManual;
+                if (isManual) {
+                    //Assert_lkid id鏈壘鍒�
+                } else {
+                    haveLine = 'true';
+                }
+            }
+            if (haveLine == 'false') {
+                return false;
+            }
+            var contractStartDate = new Date(val);
+            var strCreatedDate = this.estimate.CreatedDate;
+            var createDate = new Date();
+            if (strCreatedDate != '') {
+                createDate = new Date(strCreatedDate);
+            }
+            createDate = new Date(createDate.toDateString());
+            var threeMA = new Date(createDate.setMonth(createDate.getMonth() + 3));
+            var isnewMA = new Date(createDate.setMonth(createDate.getMonth() - 3 - this.allData.isNewAddMonth));
+            this.estimate.Contract_Start_Date__c = val;
+            //blockme();
+            //contractStartDateChange();
+            this.allData.checkedAssets = this.refreshAsset(this.allData.checkedAssets.length,this.allData.checkedAssets);
+            this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        }
+    }
+    //鍒嗛〉Limit
+    get pageDataLimitOptions() {
+        return [
+            { label: '10', value: '10' },
+            { label: '20', value: '20' },
+            { label: '50', value: '50' },
+            { label: '100', value: '100' },
+            { label: '200', value: '200' },
+        ];
+    }
+    handlePageLimitChange(event) {
+        this.IsLoading = true;
+        // this.allDataInfo();
+        this.pageDataLimit = event.detail.value;
+        this.allData.selRecordOption = event.detail.value;
+        this.allData.selctRecordNum = this.allData.selRecordOption *1;
+        // recordNumChange({
+        //     initDataStr: JSON.stringify(this.allData),
+        // }).then(result => {
+        //     this.handlePageBtnReturn(result);
+        // }).catch(error => {
+        // }).finally(() => {
+        // });  
+        // 鍓嶇 澶勭悊
+        this.currentPage = 1;
+        this.allData.currPage = 1;
+        // this.getUnCheckedAssetNowData();
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+
+        this.IsLoading = false;
+    }
+    //棣栭〉
+    toTop(event) {
+        this.IsLoading = true;
+        // this.allDataInfo();
+        // firstPage({
+        //     initDataStr: JSON.stringify(this.allData),
+        // }).then(result => {
+        //     this.handlePageBtnReturn(result);
+        // }).catch(error => {
+        // }).finally(() => {
+        // });  
+        // 鍓嶇 澶勭悊
+        this.currentPage = 1;
+        this.allData.currPage = 1;
+        // this.getUnCheckedAssetNowData();
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+        this.IsLoading = false;
+    }
+    //涓婁竴椤�
+    toPre(event) {
+        this.IsLoading = true;
+        // currentPage 鍚庡彴鏈currentPage鍊煎垽鏂紝琛ュ厖--椤甸潰绂佺敤
+        if (this.currentPage <= 1) {
+            this.IsLoading = false;
+            return;
+        } else {
+            this.currentPage--;
+        }
+
+        this.allData.currPage = this.currentPage;
+        // this.getUnCheckedAssetNowData();
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+        this.IsLoading = false;
+    }
+    //涓嬩竴椤�
+    toNext(event) {
+        this.IsLoading = true;
+        if (this.currentPage >= this.pageCount) {
+            this.IsLoading = false;
+            return;
+        } else {
+            this.currentPage++;
+        }
+
+        this.allData.currPage = this.currentPage;
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+        this.IsLoading = false;
+    }
+    //灏鹃〉
+    toEnd(event) {
+        this.IsLoading = true;
+        // this.allDataInfo();
+        // endPage({
+        //     initDataStr: JSON.stringify(this.allData),
+        // }).then(result => {
+        //     this.handlePageBtnReturn(result);
+        // }).catch(error => {
+        // }).finally(() => {
+        // });
+        // 鍓嶇 澶勭悊
+        this.currentPage = this.pageCount;
+        this.allData.currPage = this.currentPage;
+        // this.getUnCheckedAssetNowData();
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+        this.IsLoading = false;
+    }
+    //鍒嗛〉鍚庡彴鏁版嵁杩斿洖鍚庡鐞�
+    handlePageBtnReturn(result){
+        result = JSON.parse(result);
+        this.allData = result;
+        //椤甸潰鐩稿叧鏁版嵁鍒濆鍖�
+        this.handleInitSimpleData(result);
+        //unCheckedAssets 澶勭悊
+        this.handleunCheckedAssetColumnsAndData(result.unCheckedAssets);
+        this.IsLoading = false;
+    }
+    // 鍙栧凡閫夋嫨璧勪骇鐨勬満韬紪鐮� -鏈�夋嫨淇濇湁璁惧-鍒嗛〉鎸夐挳鐐瑰嚮 澶勪粎鐢ㄦ埛鑾峰彇鏁版嵁閲�-鍚庡彴鍒嗛〉璇ユ柟娉曚笉澶勭悊銆�
+    // 鍓嶇澶勭悊锛氬綋鍓嶆暟鎹瓫閫�  assetSerialNumberList锛坣ot contains锛�
+    // public static void getAssetSerialNumber(InitData initData) {
+    //     //LJPH-BSS6E2  ---20200911 ---add by rentongxiao start
+    //     initData.contr = '2';
+    //     //LJPH-BSS6E2  ---20200911 ---add by rentongxiao end
+    //     initData.assetSerialNumberList = new List<String>();
+    //     initData.assetSerialNumberList.clear();
+    //     for (AssetInfo ai : initData.checkedAssets) {
+    //         if (String.isNotEmpty(ai.rec.SerialNumber)) {
+    //             initData.assetSerialNumberList.add(ai.rec.SerialNumber);
+    //         }
+    //     }
+    // }
+    //淇濇湁璁惧 鎼滅储鏉′欢
+    get textOpts() {
+        return [
+            { label: '涓绘満/鑰楁潗', value: 'S:AssetMark__c' },
+            { label: '淇濇湁璁惧鍚�', value: 'S:Name' },
+            { label: '鏈鸿韩缂栫爜', value: 'S:SerialNumber' },
+            { label: '鏈�杩戜竴鏈熺淮淇悎鍚�', value: 'S:CurrentContract__r.Management_Code__c' },
+            { label: '瑁呮満鍦扮偣', value: 'S:Installation_Site__c' },
+            { label: '绉戝', value: 'S:Department_Name__c' },
+        ];
+    }
+    get equalOpts() {
+        return [
+            { label: '绛変簬', value: 'equals' },
+            { label: '鍖呭惈', value: 'contains' },
+            { label: '涓嶇瓑浜�', value: 'notequals' },
+        ];
+    }
+    //鑾峰彇褰撳墠鏈�夋嫨鐨勪繚鏈夎澶�--util
+    getUnCheckedAssetNowData(){
+        if(this.unCheckedAssetData && this.unCheckedAssetData.length > 0){
+            this.unCheckedAssetNowData = this.unCheckedAssetData.slice((this.currentPage-1)*this.allData.selRecordOption,this.currentPage*this.allData.selRecordOption);
+            // this.unCheckedAssetNowData = this.unCheckedAssetData;
+        }else{
+            this.unCheckedAssetNowData = [];
+        }
+
+        this.unCheckedAssetDataLength = this.unCheckedAssetData.length;
+        this.pageCount = Math.ceil(this.unCheckedAssetData.length / this.allData.selRecordOption);
+        this.allData.currPage = this.currentPage;
+        //  涓嬫柟鏂囧瓧 鎵�鍦ㄤ綅缃�
+        this.unCheckedAssetDataShow1 = (this.currentPage-1)*this.pageDataLimit;
+        // 鏁版嵁涓嬫爣 -1锛堟渶鍚庝竴鏉℃暟鎹綅缃級
+        this.unCheckedAssetDataShow2 = this.currentPage*this.pageDataLimit >= this.allData.totalRecords ? this.allData.totalRecords : this.currentPage*this.pageDataLimit - 1;
+        this.pageBtnDiasbled();
+    }
+    handleTableUncheckedRecCheckBox(event) {
+        let index = event.currentTarget.dataset.id;
+        console.log('handleTableUncheckedRecCheckBox index',index);
+        this.allData.unCheckedAssets.forEach(function(ar) {
+            if (ar.rec.Id == index) {
+                ar.rec_checkBox_c = event.detail.checked;
+                console.log('ar.rec_checkBox_c',ar.rec_checkBox_c);
+            }
+        });
+    }
+    
+    //鎶ヤ环鎻愪氦瀵硅薄 鍙樻洿 --util
+    controlDisabled(event) {
+        window.open("/apex/ChangeDealerApproval?eid=" + this.recordId,'ChangeDealerApproval','height=300,width=700,toolbar=no,menubar=no,left=20%,top=30%,scrollbars=yes,resizable=no,location=no,status=no');
+    }
+    //鏈嶅姟鍚堝悓 鍐呭淇敼   todo 閫氳繃浼犲叆鍙傛暟锛屽埗瀹氬瓧娈靛��
+    changeDepartment(event) {
+        this.estimate.Department__c = event.detail.value;        
+    }
+    //鍚堝悓寮�濮嬮璁㈡棩
+    changeEstiStartdate(event) {
+        this.IsRefresh = false;
+        let val = event.detail.value;
+        // event.target.value = '2022/12/12';
+        this.estimate.Contract_Esti_Start_Date__c = event.detail.value;
+        // 2023/09/01 鍚堝悓缁撴潫棰勮鏃� 鏄剧ず鍚屾
+        // this.handleChangeContractEstiEndDate(this.estimate.Contract_Esti_Start_Date__c);
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230310 start val 2022-12-12
+        var startday = estimateUtility.handleInfo.addMonths(val,6);
+        var startday1 = estimateUtility.handleInfo.addMonths(val,12);
+        // del startdateaddsix1-3 seamlessRenew 浼氶噸鏂拌祴鍊硷紝杩欓噷缁欏�兼棤鎰忎箟 - page濂藉儚鏈夋敼鍔ㄩ�昏緫锛熺畝鍗曠湅浜嗕笅閫昏緫锛屼緷鏃т細閲嶆柊璧嬪��
+        this.allData.startdateaddsix1 = startday;
+        this.allData.startdateaddsix2 = startday;
+        this.allData.startdateaddsix3 = startday1;
+        this.allData.startdateaddsix4 = val;
+        console.log('this.allData.startdateaddsix1 ',this.allData.startdateaddsix1 );
+        console.log('this.allData.startdateaddsix2 ',this.allData.startdateaddsix2 );
+        console.log('this.allData.startdateaddsix3 ',this.allData.startdateaddsix3 );
+        console.log('this.allData.startdateaddsix4 ',this.allData.startdateaddsix4 );
+        var rowCnt = this.productCount;
+        this.allDataInfo();
+        let returnData = estimateUtility.handleInfo.seamlessRenew(this,rowCnt,this.allData,this.allData.checkedAssets,this.PageDisabled,this.IsContractEstiStartDateDisabled);
+        this.allData = returnData.allData;
+        this.allData.checkedAssets = returnData.checkedAssets;
+        this.handleInitSimpleData(this.allData);
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        // 2023/09/18 seamlessRenew 鍙兘淇敼 IsContractEstiStartDateDisabled 鍊硷紝handleInitSimpleData涓湭澶勭悊璇ョ鐢�
+        this.IsContractEstiStartDateDisabled = returnData.IsContractEstiStartDateDisabled;
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230310 end
+        if (!this.SaveBtnDisabled) {
+            this.estimate.Contract_Start_Date__c =val;
+            this.changeContractStartdate(val);
+        }
+        this.makeRealPrice(1);
+        this.IsRefresh = true;
+    }
+    // == checkContractRange
+    handleChangeContractRange(event) {
+        let errorMsg = '';
+        //椤甸潰 required
+        if (isNaN(parseInt(event.target.value))) {
+            errorMsg = '蹇呴』杈撳叆鍚堝悓鏈堟暟!';
+        }else if (event.target.value <= 0) {
+            errorMsg = '鍚堝悓鏈堟暟蹇呴』澶т簬0';
+        }else if (event.target.value > 60) {
+            errorMsg = '鍚堝悓鏈熸渶闀垮彧鑳介�夋嫨60涓湀锛�';
+        }
+        if (errorMsg != '') {
+            estimateUtility.toast.showToast(this, 'error', errorMsg);
+            //椤甸潰鍊煎悓姝ュ埛鏂�
+            event.target.value = null;
+        }
+        this.estimate.Contract_Range__c = event.target.value; 
+        // 2023/09/01 鍚堝悓缁撴潫棰勮鏃� 鏄剧ず鍚屾
+        // this.handleChangeContractEstiEndDate(this.estimate.Contract_Esti_Start_Date__c);
+        console.log('this.estimate.Contract_Range__c',this.estimate.Contract_Range__c);
+        //椤甸潰鏁版嵁鍒锋柊 --checkAssetData reresh
+        this.allData.checkedAssets = this.refreshAsset(this.allData.checkedAssets.length,this.allData.checkedAssets);
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+    }
+    //鍚堝悓缁撴潫棰勮鏃� - 鏈夎绠楅�昏緫锛屽~鍐欐棤鎰忎箟 -> 鍚屾 鍒濇璁$畻
+    handleChangeContractEstiEndDate(val) {
+        console.log('handleChangeContractEstiEndDate');
+        if (this.estimate.Contract_Esti_Start_Date__c && this.estimate.Contract_Range__c) {
+            let datearr = val.split("-");//鍩虹鏃ユ湡
+            let months = this.estimate.Contract_Range__c *1;//澧炲姞鏈堟暟 *1 杞琋umber
+            let year = parseInt(datearr[0]);
+            let month = parseInt(datearr[1][0] == 0 ? datearr[1][1] : datearr[1]) - 1;
+            let day = parseInt(datearr[2][0] == 0 ? datearr[2][1] : datearr[2]);
+            year += Math.floor((month + months) / 12); //璁$畻骞�
+            month = Math.floor((month + months) % 12) + 1; //璁$畻鏈�
+            let d_max = new Date(year + "/" + (month + 1) + "/0").getDate();  //鑾峰彇璁$畻鍚庣殑鏈堢殑鏈�澶уぉ鏁�
+            if (day > d_max) {
+                day = d_max;
+            }
+
+            let date = year + "-" + (month < 10 ? ("0" + month) : month) + "-" + (day < 10 ? ("0" + day) : day);
+            // val = new Date(val);
+            // this.estimate.Contract_Esti_End_Date__c = val.getFullYear()+'-'+(val.getMonth()+1+this.estimate.Contract_Range__c)+'-'+val.getDate();
+            this.estimate.Contract_Esti_End_Date__c = date;
+
+        }
+        console.log('this.estimate.Contract_Esti_End_Date__c',this.estimate.Contract_Esti_End_Date__c);
+    }
+    //鎶ヤ环鎻愪氦瀵硅薄
+    handleChangeEstimateTarget(event) {
+        this.estimate.Estimate_Target__c = event.detail.value;
+        //resetDealer 澶勭悊椤甸潰闅愯棌
+        this.handleEstimateTargetIsHospitalTrue();
+    }
+    handleEstimateTargetIsHospitalTrue(){
+        this.EstimateTargetIsDealer = this.estimate.Estimate_Target__c == '缁忛攢鍟�';
+    }
+    //==onChDealerUpdateJs 鎶ヤ环鎻愪氦瀵硅薄 涓虹粡閿�鍟� 鎵嶈兘瑙﹀彂璇ヤ簨浠�
+    handleChangeDealer(event) {
+        this.estimate.Dealer__c = event.detail.value[0] ? event.detail.value[0] : '';
+        onChDealerUpdate({
+            estimateStr: JSON.stringify(this.estimate),
+            checkDealerId : this.estimate.Dealer__c
+        }).then(result => {
+            if (result != null) {
+                this.estimate = JSON.parse(result);
+            }
+        }).catch(error => {
+        }).finally(() => {
+            if (this.estimate.Is_RecognitionModel__c) {
+                estimateUtility.toast.showToast(this, 'warning', '璇锋敞鎰忥紝褰撳墠缁忛攢鍟嗕负鍏堟瀵硅薄銆�');
+            }
+        }); 
+
+    }
+    //鐢宠鎶ヤ环閲戦
+    checkDiscount(event) {
+        console.log('checkDiscount');
+        console.log('event.detail.value;',event.currentTarget.value);
+        // this.IsRefresh = false;
+        let val = event.currentTarget.value;
+        this.estimateTemp = {Request_quotation_Amount__c : Math.round(val)};
+        if (!val) {
+            val = '';
+            this.estimate.Request_quotation_Amount__c = "";
+            this.estimate.Service_discount_Rate__c = 0.00;
+            this.IsRefresh = true;
+            return;
+        }
+        // 闈炴暟瀛楋紝骞朵笉浼氳Е鍙戯紝椤甸潰浼氭湁鎻愮ず
+        if (isNaN(parseInt(val))) {
+            estimateUtility.toast.showToast(this, 'error', '璇疯緭鍏ユ暟鍊�');
+            val = 0.00;
+            this.estimate.Request_quotation_Amount__c = 0.00;
+            this.IsRefresh = true;
+            return;
+        }
+        //type number 鑷甫鏁板�煎垽鏂紝鍙繘琛屾棤鏁堝�兼彁绀猴紝Service_discount_Rate__c 鍦╩akeRealPrice鏂规硶涓祴鍊�
+        // if (!val) {
+        //     this.estimate.Request_quotation_Amount__c = 0.00;
+        //     this.estimate.Service_discount_Rate__c = 0.00;
+        //     if (isNaN(parseInt(val))) {
+        //         estimateUtility.toast.showToast(this, 'error', '璇疯緭鍏ユ暟鍊�');
+        //     }
+        //     this.IsRefresh = true;
+        //     return;
+        // }
+        this.allDataInfo();
+        let returnData = estimateUtility.handleInfo.checkDiscount(this,val,this.allData,this.IsContractEstiStartDateDisabled,this.IsContractstartdateDisabled,this.IsRequestQuotationAmountDisabled,this.refreshAssetBtn,this.AgreeRenewTenDisabled);
+        console.log('this.estimate.Request_quotation_Amount__c before',this.estimate.Request_quotation_Amount__c);
+
+        this.allData = returnData.allData;
+        this.handleInitSimpleData(this.allData);
+        console.log('this.estimate.Request_quotation_Amount__c after',this.estimate.Request_quotation_Amount__c);
+        this.IsContractEstiStartDateDisabled = returnData.IsContractEstiStartDateDisabled;
+        this.IsContractstartdateDisabled = returnData.IsContractstartdateDisabled;
+        this.IsRequestQuotationAmountDisabled = returnData.IsRequestQuotationAmountDisabled;
+        this.refreshAssetBtn = returnData.refreshAssetBtn;
+        this.refreshAssetBtnLWC = this.refreshAssetBtn;
+        console.log('Until checkDiscount after',returnData.AgreeRenewTenDisabled);
+        this.AgreeRenewTenDisabled = returnData.AgreeRenewTenDisabled;
+        this.makeRealPrice(1);
+
+        //涓婇檺閲戦娓呯┖
+        this.estimate.Limit_Price_Amount__c = '';
+        // this.estimate.Request_quotation_Amount__c = Math.round(val);
+        // event.detail.value = this.estimate.Request_quotation_Amount__c;
+        console.log('this.estimate.Request_quotation_Amount__c final',this.estimate.Request_quotation_Amount__c);
+        this.estimate.Request_quotation_Amount__c = 0;
+        console.log('this.estimate.Request_quotation_Amount__c 0',this.estimate.Request_quotation_Amount__c);
+
+        this.event1 = setTimeout(() => {
+          this.estimate.Request_quotation_Amount__c = Math.round(val);
+          console.log('setTimeout',this.estimate.Request_quotation_Amount__c);
+        }, 1);
+        console.log('this.estimate.Request_quotation_Amount__c 01',this.estimate.Request_quotation_Amount__c);
+
+        this.estimate = JSON.parse(JSON.stringify(this.estimate));
+        console.log('this.estimate.Request_quotation_Amount__c 02',this.estimate.Request_quotation_Amount__c);
+
+        // this.IsRefresh = true;
+    }
+
+    get quotationAmount(){
+        return this.estimateTemp.Request_quotation_Amount__c;
+    }
+    // 涓婇檺閲戦
+    handleLimitPriceAmount(event) {
+        console.log('handleLimitPriceAmount',event.currentTarget.value);
+        // this.estimate.Limit_Price_Amount__c = event.detail.value;
+        // console.log('estimate handleLimitPriceAmount',this.estimate.Limit_Price_Amount__c);
+        let num = event.currentTarget.value;
+        this.estimate.Limit_Price_Amount__c = 0;
+        this.event1 = setTimeout(() => {
+          // this.estimate.AgencyHos_Price__c = num.toFixed(2);
+            this.estimate.Limit_Price_Amount__c = Math.round(num);
+
+            console.log('this.estimate.Limit_Price_Amount__c event1',this.estimate.Limit_Price_Amount__c);
+        }, 1);
+
+        this.estimate = JSON.parse(JSON.stringify(this.estimate));
+        console.log('this.estimate.AgencyHos_Price__c',this.estimate.Limit_Price_Amount__c);
+
+    }
+    /*
+     * @param t   1: 閲戦銇倛銈婂壊寮�
+     */
+    makeRealPrice(t) {
+
+        // 瀹熼殯閲戦鍚堣▓
+        // 鐢宠鎶ヤ环閲戦
+        var sum1 = this.localParseFloat(this.estimate.Request_quotation_Amount__c);
+        // 淇悊鎬婚
+        var sum2 = this.estimate.Asset_Repair_Sum_Price__c ? this.estimate.Asset_Repair_Sum_Price__c : null ;
+        //*1 閬垮厤NaN
+        var sum1 = this.localParseFloat(sum1*1);
+        // 涓婇檺
+        var upPrice = this.estimate.GuidePrice_Up__c;
+        upPrice = this.localParseFloat(upPrice*1);
+        // 涓嬮檺
+        var downPrice = this.estimate.GuidePrice_Down__c;
+        downPrice = this.localParseFloat(downPrice*1);
+
+        // 鐩稿鏍囧噯浠锋牸鑼冨洿鐨勬姌鎵g巼 璁$畻
+        // 1锛夋爣鍑嗕环鏍艰寖鍥村唴鏃讹紝缁撴灉涓�0锛�
+        // 2锛夋瘮鏍囧噯浠锋牸浣庢椂锛岀粨鏋滄槸1-甯屾湜浠锋牸/鏍囧噯浠风殑鏈�浣庝环鏍�
+        // 3锛夋瘮鏍囧噯浠锋牸楂樻椂锛岀粨鏋滄槸1-甯屾湜浠锋牸/鏍囧噯浠风殑鏈�楂樹环鏍�
+        var disMP = 0.00;
+        var disP = this.estimate.Service_discount_Rate__c;
+
+        if(sum1 < downPrice){
+            disMP = ((1 - sum1/downPrice) * 100)*1;
+        }else if(sum1 >= downPrice && sum1 <= upPrice){
+            disMP = 0.00;
+        }else if(sum1 > upPrice){
+            disMP = 1*((1 - sum1/upPrice) * 100);
+        }
+        //鍑虹幇绮惧害娴姩
+
+        if (disMP != disP) {
+            disMP = '' + disMP.toFixed(2) +  '%';
+            // 20% -parseFloat = 20
+            this.estimate.Service_discount_Rate__c = parseFloat(disMP);
+        }
+        // 淇悊绶忛銈掕▓涓�
+        let sum = sum1 + this.localParseFloat(sum2*1);
+        this.estimate.Maintenance_Price__c = sum*1;
+    }
+    //鏈�缁堜环鏍煎喅瀹氬舰寮�
+    handleFinalPriceDecideWay(event) {
+        this.estimate.finalPriceDecideWay__c = event.detail.value;
+    }
+    //鏄惁閿�鍞檮甯�
+    handleSalesIncidental(event) {
+        this.estimate.Sales_incidental__c = event.detail.checked;
+    }
+    //涓昏璋堝垽娆℃暟
+    handleMainTalksTime(event) {
+        this.estimate.mainTalksTime__c = event.detail.value;
+    }
+    //璋堝垽鐨勫紑濮嬫椂闂�
+    handleTalksStartDate(event) {
+        this.estimate.talksStartDate__c = event.detail.value;
+    }
+    //缁忛攢鍟嗗拰鍖婚櫌鐨勪环鏍� classic 淇濆瓨涓や綅灏忔暟锛屽洓鑸嶄簲鍏�  椤甸潰鏄剧ず渚濇棫鏄浣嶏紝浣嗗疄闄呭�煎凡缁忓彉鍖栵紙classic鏁堟灉锛�
+    handleAgencyHosPrice(event) {
+        // console.log('handleAgencyHosPrice',event.detail.value);
+        let num = event.currentTarget.value * 1;
+        // event
+        this.estimate.AgencyHos_Price__c = num.toFixed(2);
+        console.log('this.handleAgencyHosPrice.AgencyHos_Price__c',this.estimate.AgencyHos_Price__c);
+    }
+    //浠锋牸鐢宠鐞嗙敱
+    handleDiscountReason(event) {
+        this.estimate.Discount_reason__c = event.detail.value;
+    }
+    //娑堣垂鐜囨敼鍠勬柟妗�
+    handleImproveConsumptionRateIdea(event) {
+        this.estimate.Improve_ConsumptionRate_Idea__c = event.detail.value;
+    }
+    //鎵撳嵃鎶ヤ环 澶嶉�夋閫夋嫨  鍗曢��
+    handleSimply(event){
+        let param = event.currentTarget.dataset.param;
+        this.estimate[param] = event.detail.checked;
+        this.printFlag = false;
+        let paramsList = ["Print_ListPrice__c","Print_Simplify__c","Print_RepairPrice__c","Print_SumPrice__c"];
+        for (var i = 0; i < paramsList.length; i++) {
+            if (param != paramsList[i]) {
+                this.estimate[paramsList[i]] = false;
+            }
+        }
+        this.printFlag = true;
+    }
+    //涓夋柟鍗忚
+    handlePrintContract(event) {
+        let param = event.currentTarget.dataset.param;
+        this.estimate[param] = event.detail.checked;
+    }
+    //鍚堝悓寮�濮嬫棩
+    handleContractStartDate(event) {
+        this.estimate.Contract_Start_Date__c = event.detail.value;
+        //changeContractStartdate
+        this.changeContractStartdate(this.estimate.Contract_Start_Date__c);
+    }
+    //鏃犵紳缁鎶樻墸 
+    handleRenewTenOFF(event) {
+        this.estimate.renewTen_OFF__c = event.detail.checked;
+        console.log('this.estimate.renewTen_OFF__c',this.estimate.renewTen_OFF__c);
+    }
+    handleAgreeRenewTenOFF(event) {
+        this.estimate.AgreeRenewTen_OFF__c = event.detail.checked;
+    }
+    //淇濆瓨
+    async handleSave(event){
+        //onclick
+        this.IsLoading = true;
+        let resEGFlgconfim = await this.EGFlgconfim();
+        if (resEGFlgconfim) {
+            this.allDataInfo();
+            // 2023/09/18 unCheckedAssets 鍚庡彴鏂规硶鏈秹鍙婅灞炴�э紝鐩存帴缃┖,閬垮厤鏁版嵁閲忚繃澶�,濡傛灉鍚庡彴杩斿洖寮傚父淇℃伅锛屽垯灏嗗師鏁版嵁閲嶆柊璧嬪��
+            let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+            this.allData.unCheckedAssets = [];
+
+            let saveDataStr = JSON.stringify(this.allData);
+            console.log('handleSave');
+            await save({
+                saveData: saveDataStr,
+            }).then(result => {
+                console.log('handleSave result',result);
+                if (result != null && result.indexOf('completion=5') != -1) {
+                    //閲嶆柊璺宠浆璇ラ〉闈� 鎼哄甫鍙傛暟
+                    estimateUtility.toast.showToast(this, 'success', '淇濆瓨濂戒簡');
+                    window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#id="+result.split('/')[1]; 
+                    location.reload();
+                }else{
+                    estimateUtility.toast.showToast(this, 'error', result);
+                    // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪�� - 椤甸潰鏁版嵁骞舵病鏈夋洿鏀癸紙鏈皟鐢� handleunCheckedAssetColumnsAndData锛夛紝椤甸潰鏁版嵁涓嶄細寮傚父
+                    this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                }
+            }).catch(error => {
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }).finally(() => {
+                this.IsLoading = false;
+            }); 
+            //oncomplete
+            this.unblockUI();
+        }
+        this.IsLoading = false;
+    }
+    //
+    async EGFlgconfim() {
+        await this.getEstimateCost();   
+        var cntWithKara = this.productCount;
+        // 鏂板悎鍚屽鍝佺‘淇濇彁渚� 鏄惁鏀瑰彉
+        var alert1s = 0;
+        for (var i = 0; i < cntWithKara; i++) {
+            var isManual =this.allData.checkedAssets[i].isManual;
+            var EGFlgtxt =this.allData.checkedAssets[i].mcae.EquipmentGuaranteeFlgTxt__c;
+            var EGFlgnow =this.allData.checkedAssets[i].etGFlg;
+            console.log('EGFlgtxt',EGFlgtxt);
+            console.log('EGFlgnow',EGFlgnow);
+            //琛ュ厖 undefined鐨勫垽瀹�
+            if (EGFlgtxt != undefined && EGFlgnow != undefined && EGFlgtxt != EGFlgnow) {
+                alert1s = 1;
+            }
+        }
+        if (alert1s == 1) {
+            let confirmResult = await estimateUtility.toast.handleConfirmClick("閫夋嫨鐨勪繚鏈夎澶嘯鏂板悎鍚屽鍝佺‘淇濇彁渚沒鍙戠敓鍙樺寲锛屾槸鍚︾户缁紵");
+            if (!confirmResult) {
+                return false;
+            }
+        }
+        return this.onclickCheckchangedAfterPrint('true','true');
+    }
+    //ok 鑾峰彇瀹為檯鎶ヤ环閲戦 鎸夌収涓婇檺姣斾緥绠�
+    getEstimateCost() {
+        // 琛屾暟   
+        var rowcount = this.productCount;
+        // 6.鍚堝悓浠锋牸
+        var mainteReal = parseFloat(this.estimate.Maintenance_Price__c);
+        // 5.淇悊鎬婚
+        var assetRepairSumPrice = parseFloat(this.estimate.Asset_Repair_Sum_Price__c);
+        // 璁$畻瀹為檯鎶ヤ环鎬婚噾棰�
+        var realprice = mainteReal - assetRepairSumPrice;
+        // 鏍囧噯浠锋牸鐨勬渶楂樹环鎬婚
+        var GuidePriceUp = parseFloat(this.estimate.GuidePrice_Up__c);
+        for (var i = 0; i < rowcount; i++) {
+            // 鍘讳笂闄愪环鏍�
+            var assetListPrice = parseFloat(this.allData.checkedAssets[i].mcae.Adjustment_Upper_price__c);
+            if(GuidePriceUp == 0){
+                this.allData.checkedAssets[i].mcae.Estimate_Cost__c = 0;
+            }else{
+                var Estimate_Cost = (realprice * (assetListPrice / GuidePriceUp)).toFixed(2);
+                //parseFloat 鍙兘浼氫负NAN
+                this.allData.checkedAssets[i].mcae.Estimate_Cost__c = isNaN(Estimate_Cost) ? 0 : Estimate_Cost;
+            }
+        }
+    }
+   //
+    async onclickCheckchangedAfterPrint(saveBtnDisabled, saveOrApproval) {
+        console.log('onclickCheckchangedAfterPrint');
+        var cntWithKara = this.productCount;
+        var alerts = 0;
+        // 鏂板悎鍚屽鍝佺‘淇濇彁渚� 鏄惁鏀瑰彉
+        var alert1s = 0;
+        var today = new Date();
+        today.setMonth(today.getMonth() - 3);
+
+        for (var i = 0; i < cntWithKara; i++) {
+            var isManual = this.allData.checkedAssets[i].isManual;//value boolean
+
+            if (isManual) {
+                //鍘熼〉闈㈡湭鎵惧埌瀵瑰簲id  Assert_lkid
+            }
+            if (!isManual) {
+                var strDate = this.allData.checkedAssets[i].rec.Final_Examination_Date__c ? this.allData.checkedAssets[i].rec.Final_Examination_Date__c : '';
+
+                strDate = strDate.replace(/(^\s*)|(\s*$)/g, ""); 
+                if (strDate == "" || Date.parse(strDate) < Date.parse(today)) {
+                    alerts = 1;
+                }
+            }
+        }
+
+        if (alerts == 1) {
+            let confirmResult = await estimateUtility.toast.handleConfirmClick("閫夋嫨鐨勪繚鏈夎澶嘯鏈�鍚庣偣妫�鏃涓虹┖鎴栧凡缁忚秴杩囦笁涓湀涔嬪墠锛屾槸鍚︾户缁紵");
+        
+            if (!confirmResult) {
+                return false;
+            }
+        }
+        if (saveOrApproval == "true") {
+            if (await this.saveBeforeCheckPriceChange()) {
+                let confirmResult = await estimateUtility.toast.handleConfirmClick("琛屼俊鎭湁鍙樺寲(鏈嶅姟鍚堝悓浠锋牸)锛屾槸鍚︽洿鏂版姤浠凤紵");
+            
+                if (confirmResult) {
+                    this.allData.changedSubmitPrice = true;
+                }else{
+                    this.allData.changedSubmitPrice = false;
+                    this.unblockUI();
+                    return false;
+                }
+            }
+            this.allData.isSaveOrApproval = true;
+
+        }
+       return true;
+    }
+    //
+    unblockUI(){
+        // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk star
+        // disable1();
+        // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk end
+        this.pageSetDisabled();
+        var isChange = this.allData.changedSubmitPrice;
+        if (isChange) {
+            this.allData.changedSubmitPrice = false;
+            //椤甸潰鏁版嵁鍒锋柊 --checkAssetData reresh 鍚巋andleCheckedAssetColumnsAndData
+            this.allData.checkedAssets = this.refreshAsset(this.allData.checkedAssets.length,this.allData.checkedAssets);
+            this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        }
+        //鏈壘鍒拌id
+        
+    }
+    //
+    async saveBeforeCheckPriceChange() {
+        console.log('saveBeforeCheckPriceChange');
+        var needClearId = false;
+        //this.productCount =>  this.allData.productCount
+        var rowCnt = this.productCount;
+        var assIds = "";
+        var proIds = "";
+        var priceMap = new Map();
+        var newProductMap = new Map();
+        var newProductCheck = false;
+        var nowDate = new Date();
+        var createdDate = null;
+        var createdDateShow = this.estimate.CreatedDate;
+        var contractDate = new Date(this.estimate.Contract_Start_Date__c);
+        if (createdDateShow && createdDateShow.trim() != '') {
+            createdDate = new Date(createdDateShow);
+            newProductCheck = true;
+        } else {
+            createdDate = new Date();
+        }
+        var threeMonthAfter = new Date(createdDate.setMonth(createdDate.getMonth() + 3));
+        createdDate = new Date(createdDate.setMonth(createdDate.getMonth() - 3));
+        for (var i = 0; i < rowCnt; i++) {
+            var isManual = this.allData.checkedAssets[i].isManual;
+            //mcae 涓嶄細涓簄ull
+            var isnew = this.allData.checkedAssets[i].mcae.IsNew__c;
+            var price = this.allData.checkedAssets[i].mcae.Estimate_List_Price__c ; 
+            if (isManual) {
+                var a = this.allData.checkedAssets[i].mcae.Product_Manual__c; 
+                //琛ュ厖 a 鏈夊�肩殑鍒ゅ畾
+                if ( a != "000000000000000000" && a != "" && a) {
+                    if (proIds == "") {
+                        proIds = "'" + a + "'";
+                    } else {
+                        proIds = proIds + ",'" + a + "'";
+                    }
+                    if (isnew) {
+                        priceMap.set(a, price/this.allData.isNewPriceAdj);
+                    } else {
+                        priceMap.set(a, price);
+                    }
+                    newProductMap.set(a, isnew);
+                    
+                } else {
+                    continue;
+                }
+            }else {
+                var aId = this.allData.checkedAssets[i].rec.Id;
+                if (assIds == "") {
+                    assIds = "'" + aId + "'";
+                } else if (aId) {////琛ュ厖 aId 鏈夊�肩殑鍒ゅ畾
+                    assIds = assIds + ",'" + aId + "'";
+                }
+                if (isnew) {
+                    priceMap.set(aId, price/this.allData.isNewPriceAdj);
+                } else {
+                    priceMap.set(aId, price);
+                }
+                newProductMap.set(aId, isnew);
+            }
+        }
+
+        // 閫夋嫨璁惧鍚庝环鏍煎彉鏇碿heck
+        if (assIds.length > 0) {
+            //鍚庡彴鏌ヨ1
+            await saveBeforeCheckPriceChangeAsset({
+                assIds : assIds
+            }).then(asList => {
+             
+                if (asList != null) {
+                    for(var i=0;i<asList.length;i++) {
+                        var asvar = asList[i];
+                        var asId = asvar["Id"];
+                        var mprice = asvar["Maintenance_Price_Month__c"];
+                        var ptDt = asvar["Posting_Date__c"];
+                        var postingDate = null;
+                        if (ptDt != null && ptDt != '') {
+                            postingDate = new Date(ptDt);
+                        }
+                        var inDt = asvar["InstallDate"];
+                        var installDate = null;
+                        if (inDt != null && inDt != '') {
+                            installDate = new Date(inDt);
+                        }
+                        var priceShow = priceMap.get(asId);
+                        var isNew = newProductMap.get(asId);
+                        if (this.DecideBtnDisabled) {
+                            if (Number(mprice).toFixed(2) != Number(priceShow).toFixed(2)) {
+                                needClearId = true;
+                                return needClearId;
+                            }
+                        }
+                    }
+                }
+            }).catch(error => {
+            }).finally(() => {
+            });
+        }
+        console.log('proIds',proIds);
+        if (proIds.length > 0) {
+            if (!this.DecideBtnDisabled) {
+                var oldDateStr = this.estimate.Contract_Start_Date__c;
+                console.log('proIds oldDateStr',oldDateStr);
+                var oldDate = new Date();
+                if (oldDateStr != null && oldDateStr != '') {
+                    oldDate = new Date(oldDateStr);
+                }
+                var crdt = new Date(this.estimate.CreatedDate);
+                var newContractDate = new Date(this.estimate.Contract_Start_Date__c);
+                var sixMonthAfter = new Date(crdt.setMonth(crdt.getMonth() + 6));
+                if ((newContractDate > sixMonthAfter && oldDate <= sixMonthAfter) || (newContractDate <= sixMonthAfter && oldDate > sixMonthAfter)) {
+                    this.allData.changedAfterPrint = true;
+                    return true;
+                }
+            } else {
+                //鍚庡彴鏌ヨ2
+                await saveBeforeCheckPriceChangeProduct2({
+                    proIds : proIds
+                }).then(pdList => {
+                    if (pdList != null) {
+                        for(var i=0;i<pdList.length;i++) {
+                            var pdvar = pdList[i];
+                            var pdId = pdvar["Id"];
+                            var mprice = pdvar["Maintenance_Price_Month__c"];
+                            var priceShow = priceMap.get(pdId);
+                            if (Number(mprice).toFixed(2) != Number(priceShow).toFixed(2)) {
+                                needClearId = true;
+                                return needClearId;
+                            }
+                        }
+                    }
+                }).catch(error => {
+                }).finally(() => {
+                });
+            }
+        }
+        return needClearId;
+    }
+
+    // 涓嶄繚瀛樿繑鍥�
+    cancel(event) {
+        if (this.allData.targetMaintenanceContractId) {
+            //杩斿洖鍘熸姤浠烽〉闈�
+            this.navigateToOtherObj(this.allData.targetMaintenanceContractId);
+        }else{
+            location.reload();
+        }
+    }
+    // 淇濆瓨杩斿洖
+    async handleSaveAndCancel(event){
+        this.IsLoading = true;
+        //onclick
+        let checkResult = await this.onclickCheckchangedAfterPrint('true','true');
+        if (checkResult) {
+            //淇敼鍊间紶鍥�
+            this.allDataInfo();
+            // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶鏈秹鍙婅灞炴�э紝鐩存帴缃┖
+            let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+            this.allData.unCheckedAssets = [];
+            //checkedAssets unCheckedAssetData 鍦ㄦ洿鏀圭殑鏃跺�欏悓姝ユ敼鍔�
+            let saveDataStr = JSON.stringify(this.allData);
+            console.log('saveDataStr',JSON.stringify(this.allData.estimate));
+            await saveAndCancel({
+                saveData: saveDataStr,
+            }).then(result => {
+                console.log('handleSaveAndCancel result',result);
+                if (result != null && result.indexOf('navigateTo') == -1) {
+                    estimateUtility.toast.showToast(this, 'error', result);
+                    // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                    this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                }else if (result != null) {
+                    this.navigateToOtherObj(result.split('=')[1]);
+                }
+            }).catch(error => {
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }).finally(() => {
+            });  
+        }
+        this.IsLoading = false;  
+        
+    }
+    //琛岃拷鍔�
+    handleAddNewRows(event){
+        this.IsLoading = true;
+        addNewRows({
+            checkedAssetsStr: JSON.stringify(this.allData.checkedAssets),
+        }).then(result => {
+            result = JSON.parse(result);
+            this.allData.checkedAssets = this.refreshAsset(result.length,result);
+        }).catch(error => {
+        }).finally(() => {
+            this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+            this.unblockUI();
+            this.IsLoading = false;
+        });  
+    }
+    //鍚堝悓瀵硅薄璁惧 鏁版嵁淇敼澶勭悊
+    handleTableProductManualChange(event) {
+        let index = event.currentTarget.dataset.index;
+        this.allData.checkedAssets[index].mcae.Product_Manual__c = event.detail.value[0] ? event.detail.value[0] : null;
+        refreshProductData({
+            checkedAssetsStr : JSON.stringify(this.allData.checkedAssets),
+            topProductModelStr : JSON.stringify(this.allData.TopProductModel),
+            productIdx : index,
+            isNewPriceAdj : this.allData.isNewPriceAdj,
+        }).then(result => {
+            result = JSON.parse(result);
+            console.log('handleTableProductManualChange result',result);
+            //瀵瑰悗鍙拌繑鍥炴暟鎹� 杩涜澶勭悊
+            this.allData.checkedAssets = this.refreshAsset(result.length,result);
+        }).catch(error => {
+        }).finally(() => {
+            this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+            this.unblockUI();
+        }); 
+    }
+    //鍚堝悓瀵硅薄璁惧 鏈鸿韩缂栫爜璺宠浆淇濇湁璁惧
+    handlePageNagivateTo(event) {
+        let param = event.currentTarget.dataset.param;
+        // console.log('index',param);
+        this.navigateToOtherObj(param);
+    }
+    //鍚堝悓瀵硅薄璁惧 鍏ㄩ��
+    checkAllcheckedAsset(event){
+        this.IsCheckAllcheckedAsset = event.detail.checked;
+        for (var i = 0; i < this.allData.checkedAssets.length; i++) {
+            this.allData.checkedAssets[i].rec_checkBox_c = event.detail.checked;
+        }
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+    }
+    handleTableRecCheckBox(event) {
+        let index = event.currentTarget.dataset.index;
+        this.allData.checkedAssets[index].rec_checkBox_c = event.detail.checked;
+    }
+    handleTableCheckObjectChange(event) {
+        let index = event.currentTarget.dataset.index;
+        this.allData.checkedAssets[index].mcae.Check_Object__c = event.detail.checked;
+    }
+
+    // ==changeAsset 
+    async handleTableRepairPriceChange(event) {
+        // classic 鍙備繚淇悊閲戦 鍦ㄥ疄闄呬繚瀛樻椂渚濇棫鍙暀涓や綅灏忔暟
+        let num = event.currentTarget.value*1;
+        num = num.toFixed(2);
+        let index = event.currentTarget.dataset.index;
+        // event.detail.value = num;
+        this.allData.checkedAssets[index].mcae.Repair_Price__c = num;
+        //changeAsset  椤甸潰鏁版嵁鍚屾鍒锋柊--宸ュ叿绫讳腑 
+        this.allDataInfo();
+        console.log('this.allData.checkedAssets[index].mcae.Repair_Price__c before changeAsset',this.allData.checkedAssets[index].mcae.Repair_Price__c);
+
+        let changeAssetReturnData = await estimateUtility.handleInfo.changeAsset(this,this.allData.checkedAssets.length,this.allData.checkedAssets,this.PageDisabled,this.approvalDate,this.allData);
+        //changeAsset alert Info  --宸ュ叿绫讳腑alert
+        // estimateUtility.toast.showToast(this, 'error', '鍚堝悓鏈熸渶闀垮彧鑳介�夋嫨60涓湀锛�');
+        this.allData = changeAssetReturnData.allData;
+        this.approvalDate = changeAssetReturnData.approvalDate;
+        // 浠呬繚鐣欎袱浣嶅皬鏁�
+        this.assetRepairSumNum = changeAssetReturnData.assetRepairSumNum.toFixed(2);
+        
+        
+        //椤甸潰鐩稿叧鏁版嵁鍒濆鍖�
+        this.handleInitSimpleData(this.allData);
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        // examinationPriceCal(cnt);
+        this.getLastContractRate();
+        this.makeRealPrice(1);
+        //涓婇檺鍚堝悓 20230214 hql start
+        var RequestquotationAmount = this.estimate.Request_quotation_Amount__c;
+        var AssetRepairSumPrice    = this.estimate.Asset_Repair_Sum_Price__c;
+        var Limit_Price_Amount = (this.localParseFloat(AssetRepairSumPrice)+this.localParseFloat(RequestquotationAmount))*1.3;
+        Limit_Price_Amount = Math.round(Limit_Price_Amount);
+        var Limit_Price_AmountOne =  this.estimate.Limit_Price_Amount__c;
+        var Limit_PriceHidden =  this.allData.OldLimitPrice;
+        this.estimate.Limit_Price_Amount__c = Limit_Price_Amount;
+        var Limit_PriceHidden2 =  this.allData.isLimitPrice;
+        if (Limit_PriceHidden2 == false) {
+            this.estimate.Limit_Price_Amount__c = '';
+        }
+        //涓婇檺鍚堝悓 20230214 hql end
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230315 start
+        this.allDataInfo();
+        let returnData = estimateUtility.handleInfo.seamlessRenew(this,this.allData.checkedAssets.length,this.allData,this.allData.checkedAssets,this.PageDisabled,this.IsContractEstiStartDateDisabled);
+        this.allData = returnData.allData;
+        this.handleInitSimpleData(this.allData);
+        this.allData.checkedAssets = returnData.checkedAssets;
+        // 2023/09/18 seamlessRenew 鍙兘淇敼 IsContractEstiStartDateDisabled 鍊硷紝handleInitSimpleData涓湭澶勭悊璇ョ鐢�
+        this.IsContractEstiStartDateDisabled = returnData.IsContractEstiStartDateDisabled;
+
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230315 end
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+        this.makeRealPrice(1);
+        console.log('this.allData.checkedAssets[index].mcae.Repair_Price__c before refresh',this.allData.checkedAssets[index].mcae.Repair_Price__c);
+        // 鍒锋柊璧嬪��
+        // num = this.allData.checkedAssets[index].mcae.Repair_Price__c;
+        // this.allData.checkedAssets[index].mcae.Repair_Price__c = 0;
+        // this.event1 = setTimeout(() => {
+        //   this.allData.checkedAssets[index].mcae.Repair_Price__c = num.toFixed(2);
+        // }, 1);
+        // this.allData.checkedAssets[index].mcae = JSON.parse(JSON.stringify(this.allData.checkedAssets[index].mcae));
+        // console.log('this.allData.checkedAssets[index].mcae.Repair_Price__c',this.allData.checkedAssets[index].mcae.Repair_Price__c);
+
+    }
+    //page
+    getLastContractRate(){
+        var rowCnt = this.productCount;
+        var Contractrate = 0.00;
+        var count = 0;
+        for (var i = 0; i < rowCnt; i++) {
+            var LastMContractID = this.allData.checkedAssets[i].rec ? this.allData.checkedAssets[i].rec.CurrentContract_F__c : null;
+            if(LastMContractID){
+                var tempContractrate = parseFloat((this.allData.checkedAssets[i].mcae.Asset_Consumption_rate__c ? this.allData.checkedAssets[i].mcae.Asset_Consumption_rate__c : null)*1);
+                if(tempContractrate){
+                    Contractrate = Contractrate + tempContractrate;
+                }
+                count++;
+            }
+        }
+        var allContractRate = '' + 0.00 + '%';
+        if( count > 0){
+            allContractRate = '' + (Contractrate/count).toFixed(2) + '%';
+        }
+        this.estimate.Combined_rate__c = parseFloat(allContractRate);
+        return allContractRate;
+    }
+    //鍚堝悓瀵硅薄璁惧 澶囨敞
+    handleTableCommentChange(event) {
+        let index = event.currentTarget.dataset.index;
+        this.allData.checkedAssets[index].mcae.Comment__c = event.detail.value;
+    }
+    //鍚堝悓瀵硅薄璁惧 绗笁鏂瑰洖褰�
+    handleTableThirdPartyReturnChange(event) {
+        let index = event.currentTarget.dataset.index;
+        this.allData.checkedAssets[index].mcae.Third_Party_Return__c = event.detail.checked;
+    }
+    // 鍚堝悓瀵硅薄璁惧 鏁版嵁璁$畻澶勭悊 todo 鏍稿娑夊強鍙橀噺
+    refreshAsset(cnt,checkedAssets) {
+        console.log('cnt',cnt);
+        // 鎻愪氦鍚庡氨椤甸潰涓嶈绠椾簡
+        var isDisabled = this.PageDisabled;
+        //  鎶ヤ环椤甸潰銆愬悎鍚屽畾浠锋�婚銆戝瓧娈垫坊鍔� 20230608 start
+        var TotalMaintenancePriceYear = 0.0;
+        //  鎶ヤ环椤甸潰銆愬悎鍚屽畾浠锋�婚銆戝瓧娈垫坊鍔� 20230608 end
+        // 鍚堝悓鎬荤悊
+        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(this.estimate.Contract_Start_Date__c);
+        
+        //澶氬勾淇濈画绛惧悎鍚屾暟閲� thh 20220316 start
+        var GuranteeCount = 0;
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230310 start
+        // 2023/09/06 鎶ヤ环瑙勫垯鏀瑰杽鏂板 - 鏄剧ず椤甸潰閮ㄥ垎鏁翠綋澶勭悊
+        this.IsRenewTenOFFDisabled = true;
+        var renewTenOFF = this.estimate.renewTen_OFF__c;
+
+        // 2023/09/06  result 鍙橀噺鏃犳剰涔夛紝鍚庨潰js 鏈夊悓鍚嶅彉閲忛噸鏂拌祴鍊�
+        var startime1 =  new Date(this.allData.Past_Contract_end_day);
+        var startime2 = new Date(this.estimate.Contract_Esti_Start_Date__c);
+        var result = (startime2-startime1)/(3600*24*1000);       
+        var VMProductCountAll = this.allData.VMProductCountAll;
+        var ProductCountAll = this.allData.VMProductCountAll;   
+        if (VMProductCountAll ==ProductCountAll) {       
+            result = 0;      
+        }
+
+        if (renewTenOFF == true) {
+            this.IsContractEstiStartDateDisabled = true;
+            this.IsRequestQuotationAmountDisabled = true;
+            this.IsContractstartdateDisabled = true;
+            this.refreshAssetBtn = true;
+            this.refreshAssetBtnLWC = this.refreshAssetBtn;
+            //2023/09/06 鍚屾剰鏃犵紳缁 绂佺敤
+            this.AgreeRenewTenDisabled = true;
+        }
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230310 end
+        //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� 鏄惁涓篎SE start
+        var isFSE = this.allData.isFSE;
+        //2022鏁呴殰鍝佸姞璐� 鑾峰彇userInfo绠�妗e悕绉� end
+        //20230208 涓婇檺鍚堝悓寮�鍙� hql start
+        if (isFSE) {
+            this.IsLimitPriceAmountDisabled = true;
+        }
+        //20230208 涓婇檺鍚堝悓寮�鍙� hql end
+        // 棰勫畾寮�濮嬫棩
+        var startdate = new Date(this.estimate.Contract_Esti_Start_Date__c);
+        // 棰勫畾寮�濮嬫棩-6涓湀
+        startdate.setMonth(startdate.getMonth() - 6);
+        // 鐢宠鏃� 褰撳墠鏃ユ湡
+        if(this.approvalDate != ''){
+            //鐢宠鏃�
+            this.approvalDate = new Date(this.approvalDate.toLocaleDateString());
+            if (Date.parse(this.approvalDate) < Date.parse(startdate)) {
+                newCon = false;
+            }
+        }
+        // 鏈�楂樸�佹渶浣庝环鏍煎悎璁�
+        var downPriceSum = 0;
+        var upPriceSum = 0;
+        // 鍚堝悓鏈堟暟涔楃畻  parseFloat(null.'',undefined) 涓篘AN  琛ュ厖鍒ゆ柇
+        var month = parseFloat(this.estimate.Contract_Range__c);
+        
+        if (month == undefined || month == "" || isNaN(month)) {
+            month = 1;
+        }
+        var month2 = 0;
+        if (month > 12) {
+            month2 = month - 12;
+            month = 12;
+        }
+        for (var i = 0; i < cnt; i++) {
+            console.log('refreshAsset i'+i);
+            //瀛楁鎸夐挳 榛樿鍙敤
+            checkedAssets[i].ShowAssetSituation = true;
+            var strMoney = 0;
+            var repairMoney = 0;
+            // 琛岄」鐩� 鏈�楂樸�佹渶浣庝环鏍煎悎璁�
+            // 缁浠锋牸鍙栬仈鍔ㄤ环鏍奸〉闈㈣绠楋紝棣栫鎴栦骇鍝佸彇 瀹為檯浠锋牸
+            // 涓嬬嚎浠锋牸
+            var downPrice = 0;
+            // 涓婄嚎浠锋牸
+            var upPrice = 0;
+            // 12涓湀鍚堝悓閲戦
+            var Price_YearTXT = 0;
+            var isManual = checkedAssets[i].isManual; //return boolean
+            var isnew = checkedAssets[i].mcae.IsNew__c; //return boolean
+            var assetListmonth = checkedAssets[i].mcae.Estimate_List_Price__c; 
+            //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/02/09 start 
+            var VMassetListmonth = checkedAssets[i].rec ? (checkedAssets[i].rec.CurrentContract_F_asset__r ? checkedAssets[i].rec.CurrentContract_F_asset__r.Maintenance_Price_Year__c : '') : '';
+            //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/02/09 end 
+            //  鎶ヤ环椤甸潰銆愬悎鍚屽畾浠锋�婚銆戝瓧娈垫坊鍔� 20230608 start
+            var Product2MaintenancePriceYear = checkedAssets[i].rec ? (checkedAssets[i].rec.Product2 ? checkedAssets[i].rec.Product2.Maintenance_Price_Year__c : '') : ''; 
+            //page outputField 鍘熸湰灏辨槸 闅愯棌
+            Product2MaintenancePriceYear = this.localParseFloat(Product2MaintenancePriceYear);
+            TotalMaintenancePriceYear += Product2MaintenancePriceYear;
+            //  鎶ヤ环椤甸潰銆愬悎鍚屽畾浠锋�婚銆戝瓧娈垫坊鍔� 20230608 end
+            if (isManual) {
+                var a = checkedAssets[i].mcae.Product_Manual__c ? checkedAssets[i].mcae.Product_Manual__c : ''; 
+                console.log('isManual true a',a);
+                if (a != '') {
+                    strMoney = assetListmonth; 
+                    // alert(strMoney);
+                    Price_YearTXT = strMoney * 12;
+                    if (isnew) {
+                        newCount ++;
+                        strMoney = month * strMoney + month2 * strMoney / this.allData.isNewPriceAdj;
+                    } else {
+                        newCon = false;
+                        strMoney = month * strMoney + month2 * strMoney;
+                    }
+                    //琛ュ厖绌烘寚閽�
+                    var b = checkedAssets[i].rec ? (checkedAssets[i].rec.CurrentContract_F__r ? checkedAssets[i].rec.CurrentContract_F__r.Maintenance_Contract_No_F__c : '') : '';
+                    var LastMContractRecord = checkedAssets[i].rec ? (checkedAssets[i].rec.CurrentContract_F__r ? checkedAssets[i].rec.CurrentContract_F__r.RecordType_DeveloperName__c : '') : ''; 
+                    console.log('b product',b);
+                    if(b != ''){
+                        conCCount ++;
+                        // 1.鍚堝悓鏈熶笉婊′竴骞存椂锛屽悎鍚屾湡瓒呰繃涓�鍗婃墠鍙紑濮嬬画绛炬姤浠枫��(eg:11涓湀鐨勫悎鍚屼粠6涓湀鍚庢墠鍙姤浠枫��)
+                        // 2.涓�骞翠互涓婄殑鍚堝悓锛屽湪缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ紑鏀剧画绛炬姤浠枫��
+                        var lastendDate = new Date(checkedAssets[i].rec.CurrentContract_End_Date__c);
+                        var lastContRange = 0;
+                        if(LastMContractRecord == 'VM_Contract'){
+                            newCount++;
+                            //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                            GuranteeCount++;
+                            newCon = false;
+                            //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
+                            lastendDate = new Date(checkedAssets[i].rec.CurrentContract_F_asset__r.endDateGurantee_Text__c);
+                            lastContRange = 36;
+                        }else{
+                            lastContRange = checkedAssets[i].rec.CurrentContract_F__r.Contract_Range__c; 
+                        }
+                        //鏈�鍚庣粨鏉熸棩+1骞�
+                        lastendDate.setMonth(lastendDate.getMonth() + 12);
+                        if (Date.parse(contractStartDate) > Date.parse(lastendDate) ) {
+                            oyearCount ++;
+                        }
+                        // 鍙栬仈鍔ㄤ环鏍�
+                        // 涓婁竴鏈熷悎鍚屽疄闄呮姤浠锋湀棰�
+                        // * 1 閬垮厤 parseFloat(null) ->NAN
+                        var LastMContract_Price = parseFloat(checkedAssets[i].mcae.LastMContract_Price__c  * 1);
+                        var Adjustment_ratio_Lower = parseFloat(checkedAssets[i].mcae.Adjustment_ratio_Lower__c   * 1);
+                        var Adjustment_ratio_Upper = parseFloat(checkedAssets[i].mcae.Adjustment_ratio_Upper__c   * 1);
+                        //璁$畻鎯╃綒鐜�
+                        var Punish = this.calculateNtoMRatio( lastContRange,(month + month2));
+                        if(Punish == 0){
+                            return;
+                        }
+                        // 鍒ゆ柇鏈夋棤鎶ヤ环锛氭病鏈夋寜鐓ф爣鍑嗕环鏍煎疄闄呰仈鍔�
+                        var Estimate_Num = checkedAssets[i].rec.CurrentContract_F__r.Estimate_Num__c ;
+                        if(Estimate_Num == 0){
+                            if(LastMContractRecord == 'VM_Contract'){
+                                // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
+                                var nowdate = new Date();
+                                lastendDate = new Date(checkedAssets[i].rec.CurrentContract_F_asset__r.endDateGurantee_Text__c);
+                                nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
+                                //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 start 
+                                var Maxcoefficient =0;
+                                var Mincoefficient =0;
+                                var ContractMonth = this.localParseFloat(this.estimate.Contract_Range__c);
+                                var AssetRate = this.localParseFloat(checkedAssets[i].rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c);
+                                checkedAssets[i].mcae.Asset_Consumption_rate__c = AssetRate;
+                                if(AssetRate<= 50){
+                                    Maxcoefficient = (1-0.3);
+                                    Mincoefficient = (1-0.4);
+                                }else if(AssetRate>50 &&AssetRate<=60){
+                                    Maxcoefficient = (1-0.2);
+                                    Mincoefficient = (1-0.3);
+                                }else if(AssetRate>60 &&AssetRate<=70){
+                                    Maxcoefficient = (1-0.15);
+                                    Mincoefficient = (1-0.25);
+                                }else if(AssetRate>70 &&AssetRate<=80){
+                                    Maxcoefficient = (1-0.1);
+                                    Mincoefficient = (1-0.2);
+                                    
+                                }else if(AssetRate>80 &&AssetRate<=90){
+                                    Maxcoefficient = (1-0.05);
+                                    Mincoefficient = (1-0.15);
+                                }else if(AssetRate>90 &&AssetRate<=100){
+                                    Maxcoefficient = 1;
+                                    Mincoefficient = (1-0.05);
+                                }else if(AssetRate>100 &&AssetRate<=110){
+                                    Maxcoefficient = (1+0.05);
+                                    Mincoefficient = 1;
+                                }else if(AssetRate>110 &&AssetRate<=120){
+                                    Maxcoefficient = (1+0.1);
+                                    Mincoefficient = 1;
+                                }else if(AssetRate>120 &&AssetRate<=130){
+                                    Maxcoefficient = (1+0.2);
+                                    Mincoefficient = (1+0.1);
+                                }else if(AssetRate>130 &&AssetRate<=140){
+                                    Maxcoefficient = (1+0.25);
+                                    Mincoefficient = (1+0.15);
+                                }else if(AssetRate>140){
+                                    Maxcoefficient = (1+0.3);
+                                    Mincoefficient = (1+0.2);
+                                }
+                                //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 end 
+                                if(nowdate < Date.parse(lastendDate)){
+                                    // 甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� start DC 2023/01/19  
+                                    //甯傚満澶氬勾淇濊澶囧皬浜�2骞村崐
+                                    var AssetModelNo = checkedAssets[i].rec.Product2 ? checkedAssets[i].rec.Product2.Asset_Model_No__c : 0;
+                                    var Category4 = checkedAssets[i].rec.Product2 ? checkedAssets[i].rec.Product2.Category4__c : ''; 
+                                    //璁惧璁惧娑堣垂鐜囧皬浜�1.4
+                                    if(AssetRate<140){
+                                        upPrice = VMassetListmonth * ContractMonth /12;
+                                        if((AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF鎵囨壂'||Category4=='CF'))|| Category4 =='URF'){
+                                            downPrice = upPrice;
+                                        }else{
+                                            downPrice = upPrice * 0.8;
+                                        }
+                                    }else{
+                                        upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
+                                        downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;   
+                                    }
+                                    // 甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� end DC 2023/01/19  
+                                }else{
+                                    //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 start  璁惧澶т簬2骞村崐 缁浠锋牸 = 瀹氫环 *娑堣垂鐜囧搴旂郴鏁� / 12 *鍚堝悓鏈堟暟
+                                    upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
+                                    downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
+                                    //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 end 
+                                }
+                                // 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{
+                        upPrice = strMoney;
+                        downPrice = strMoney * 0.8;
+                    }
+                    // 涓婁笅闄愬洓鑸嶄簲鍏�
+                    upPrice = upPrice.toFixed(2);
+                    downPrice = downPrice.toFixed(2);
+                    console.log('downPrice Product',downPrice);
+                    // 12涓湀鍚堝悓閲戦                    
+                    if (!isDisabled) {
+                        // 瀹為檯鑱斿姩浠锋牸 start
+                        //*1 杞寲涓篘umber绫诲瀷 缁撴灉淇濈暀涓や綅灏忔暟
+                        checkedAssets[i].mcae.Adjustment_Lower_price__c = (downPrice*1).toFixed(2);
+                        checkedAssets[i].mcae.Adjustment_Upper_price__c = (upPrice*1).toFixed(2);
+                        // 瀹為檯鑱斿姩浠锋牸 end
+                    }
+                    checkedAssets[i].mcae.Estimate_List_Price_Page__c = strMoney * 1;
+                    //Repair_Price__c null Number绫诲瀷  .trim()
+                    repairMoney = (checkedAssets[i].mcae.Repair_Price__c == undefined ? null : checkedAssets[i].mcae.Repair_Price__c ) *1;
+                } else {
+                    // TODO 涓�鏅傜殑銇蹇溿�併仾銈撱仹鍒ヨ銇噾椤嶃儶銉曘儸銉冦偡銉ャ仌銈屻仧锛�
+                    checkedAssets[i].mcae.Estimate_List_Price_Page__c = '';
+                    // 12涓湀鍚堝悓閲戦
+                    if (!isDisabled) {
+                        // 瀹為檯鑱斿姩浠锋牸 start
+                        checkedAssets[i].mcae.Adjustment_Lower_price__c = '';
+                        checkedAssets[i].mcae.Adjustment_Upper_price__c = '';
+                        // 瀹為檯鑱斿姩浠锋牸 end
+                     }
+                }
+            }
+            else {
+                // 鎵�鏈夎澶囨寜瀹夎鏃ャ�佸彂璐ф棩锛堟渶鏃╃殑锛夛紝璺濈鍚堝悓寮�濮嬫棩6涓湀鍐呴兘鏄柊鍝佸悎鍚�
+                var isNewDate = new Date( checkedAssets[i].rec.isNewDate_use__c);
+                isNewDate.setMonth(isNewDate.getMonth() + 6);
+                if (Date.parse(contractStartDate) > Date.parse(isNewDate)) {
+                    newCon = false;
+                }
+                strMoney = assetListmonth ; 
+                Price_YearTXT = strMoney * 12;
+                if (isnew) {
+                    strMoney = month * strMoney + month2 * strMoney / this.allData.isNewPriceAdj;
+                } else {
+                    strMoney = month * strMoney + month2 * strMoney;
+                }
+                var b = checkedAssets[i].rec.CurrentContract_F__r ? checkedAssets[i].rec.CurrentContract_F__r.Maintenance_Contract_No_F__c : ''; 
+                var LastMContractRecord = checkedAssets[i].rec.CurrentContract_F__r ? checkedAssets[i].rec.CurrentContract_F__r.RecordType_DeveloperName__c : '';
+                if(b != ''){
+                    conCCount ++;
+                    // 1.鍚堝悓鏈熶笉婊′竴骞存椂锛屽悎鍚屾湡瓒呰繃涓�鍗婃墠鍙紑濮嬬画绛炬姤浠枫��(eg:11涓湀鐨勫悎鍚屼粠6涓湀鍚庢墠鍙姤浠枫��)
+                    // 2.涓�骞翠互涓婄殑鍚堝悓锛屽湪缁撴潫鍓�6涓湀寮�濮嬪彲浠ュ紑鏀剧画绛炬姤浠枫��
+                    var lastendDate = new Date(checkedAssets[i].rec.CurrentContract_End_Date__c);
+                    var lastendDate = new Date(checkedAssets[i].rec.CurrentContract_F__r.Contract_End_Date__c);
+                    var lastContRange = 0;
+                    if(LastMContractRecord == 'VM_Contract'){
+                        newCount++;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 start
+                        GuranteeCount++;
+                        newCon = false;
+                        //澶氬勾淇濈画绛惧悎鍚屾暟閲�,澶氬勾淇濈画绛惧埌鏈嶅姟鍚堝悓鏃惰涓洪绛捐澶� thh 20220316 end
+                        lastendDate = new Date(checkedAssets[i].rec.CurrentContract_F_asset__r.endDateGurantee_Text__c) ;
+                        lastContRange = 36;
+                    }else{
+                        lastContRange = checkedAssets[i].rec.CurrentContract_F__r.Contract_Range__c; 
+                    }
+                    //鏈�鍚庣粨鏉熸棩+1骞�
+                    lastendDate.setMonth(lastendDate.getMonth() + 12);
+                    if (Date.parse(contractStartDate) > Date.parse(lastendDate)) {
+                        oyearCount ++;
+                    }
+                    // 鍙栬仈鍔ㄤ环鏍�
+                    // 涓婁竴鏈熷悎鍚屽疄闄呮姤浠锋湀棰�
+                    var LastMContract_Price = parseFloat(checkedAssets[i].mcae.LastMContract_Price__c * 1);
+                    var Adjustment_ratio_Lower = parseFloat(checkedAssets[i].mcae.Adjustment_ratio_Lower__c * 1);
+                    var Adjustment_ratio_Upper = parseFloat(checkedAssets[i].mcae.Adjustment_ratio_Upper__c * 1);
+                    //璁$畻鎯╃綒鐜�   return month 涓嶅彲鑳戒负0
+                    var Punish = this.calculateNtoMRatio( lastContRange,(month + month2));
+                    if(Punish == 0){
+                        return;
+                    }
+                    // 鍒ゆ柇鏈夋棤鎶ヤ环锛氭病鏈夋寜鐓ф爣鍑嗕环鏍煎疄闄呰仈鍔�
+                    var Estimate_Num = checkedAssets[i].rec.CurrentContract_F__r.Estimate_Num__c ;
+                    if(Estimate_Num == 0){
+                        if(LastMContractRecord == 'VM_Contract'){
+                            // gzw 20220630  瀹為檯鑱斿姩6涓湀浠锋牸鍖哄垎
+                            var nowdate = new Date();
+                            lastendDate = new Date(checkedAssets[i].rec.CurrentContract_F_asset__r.endDateGurantee_Text__c);
+                            nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
+                            //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 start 
+                            var Maxcoefficient =0;
+                            var Mincoefficient =0;
+                            var ContractMonth = this.localParseFloat(this.estimate.Contract_Range__c);
+                            var AssetRate = this.localParseFloat(checkedAssets[i].rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c);
+                            checkedAssets[i].mcae.Asset_Consumption_rate__c = AssetRate;
+                            if(AssetRate<= 50){
+                                Maxcoefficient = (1-0.3);
+                                Mincoefficient = (1-0.4);
+                            }else if(AssetRate>50 &&AssetRate<=60){
+                                Maxcoefficient = (1-0.2);
+                                Mincoefficient = (1-0.3);
+                            }else if(AssetRate>60 &&AssetRate<=70){
+                                Maxcoefficient = (1-0.15);
+                                Mincoefficient = (1-0.25);
+                            }else if(AssetRate>70 &&AssetRate<=80){
+                                Maxcoefficient = (1-0.1);
+                                Mincoefficient = (1-0.2);
+                            }else if(AssetRate>80 &&AssetRate<=90){
+                                Maxcoefficient = (1-0.05);
+                                Mincoefficient = (1-0.15);
+                            }else if(AssetRate>90 &&AssetRate<=100){
+                                Maxcoefficient = 1;
+                                Mincoefficient = (1-0.05);
+                            }else if(AssetRate>100 &&AssetRate<=110){
+                                Maxcoefficient = (1+0.05);
+                                Mincoefficient = 1;
+                            }else if(AssetRate>110 &&AssetRate<=120){
+                                Maxcoefficient = (1+0.1);
+                                Mincoefficient = 1;
+                            }else if(AssetRate>120 &&AssetRate<=130){
+                                Maxcoefficient = (1+0.2);
+                                Mincoefficient = (1+0.1);
+                            }else if(AssetRate>130 &&AssetRate<=140){
+                                Maxcoefficient = (1+0.25);
+                                Mincoefficient = (1+0.15);
+                            }else if(AssetRate>140){
+                                Maxcoefficient = (1+0.3);
+                                Mincoefficient = (1+0.2);
+                            }
+                            //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 end 
+                            if(nowdate < Date.parse(lastendDate)){
+                                // 甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� start DC 2023/01/19  
+                                //甯傚満澶氬勾淇濊澶囧皬浜�2骞村崐
+                                var AssetModelNo = checkedAssets[i].rec.Product2 ? checkedAssets[i].rec.Product2.Asset_Model_No__c : 0;
+                                var Category4 = checkedAssets[i].rec.Product2 ? checkedAssets[i].rec.Product2.Category4__c : '';
+                                //璁惧璁惧娑堣垂鐜囧皬浜�1.4
+                                if(AssetRate<140){
+                                    upPrice = VMassetListmonth *ContractMonth / 12;
+                                    if((AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF鎵囨壂'||Category4=='CF'))|| Category4 =='URF'){
+                                        downPrice = upPrice;
+                                    }else{
+                                        downPrice = upPrice * 0.8;
+                                    }
+                                }else{
+                                    upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
+                                    downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;   
+                                }
+                                // 甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� end DC 2023/01/19    
+                            }else{
+                                //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 start  璁惧澶т簬2骞村崐 缁浠锋牸 = 瀹氫环 *娑堣垂鐜囧搴旂郴鏁� / 12 *鍚堝悓鏈堟暟
+                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
+                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
+                                //甯傚満澶氬勾淇濅慨浠锋牸寮�鍙� DC 2023/1/30 end 
+                            }
+                            // 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) {
+                        newCount ++;
+                    } else {
+                        newCon = false;
+                        firstCCount ++;
+                    }
+                    upPrice = strMoney;
+                    downPrice = strMoney * 0.8;
+                }
+                // 涓婁笅闄愬洓鑸嶄簲鍏�
+                upPrice = upPrice.toFixed(2);
+                downPrice = downPrice.toFixed(2);
+                console.log('upPrice Asset',upPrice);
+                console.log('strMoney Asset',strMoney);
+                console.log('VMassetListmonth Asset',VMassetListmonth);
+                console.log('LastMContract_Price Asset',LastMContract_Price);
+                console.log('ContractMonth Asset',ContractMonth);
+                console.log('Maxcoefficient Asset',Maxcoefficient);
+                if (!isDisabled) {
+                    // 瀹為檯鑱斿姩浠锋牸 start
+                    checkedAssets[i].mcae.Adjustment_Lower_price__c = (downPrice*1).toFixed(2);
+                    checkedAssets[i].mcae.Adjustment_Upper_price__c = (upPrice*1).toFixed(2);
+                    // 瀹為檯鑱斿姩浠锋牸 end
+                }
+                console.log('checkedAssets[i].mcae.Adjustment_Upper_price__c Asset',checkedAssets[i].mcae.Adjustment_Upper_price__c );
+                checkedAssets[i].mcae.Estimate_List_Price_Page__c = strMoney * 1;
+                //<!-- (2022骞�12鏈堜笂绾�)鏁呴殰鍝佸姞璐� start -->  
+                let Repair_Price_Auto = checkedAssets[i].Repair_Price_Auto;
+                // Repair_Price_Auto = Repair_Price_AutoPrice.value(); 閬垮厤涓嬮潰鏉′欢璇垽
+                repairMoney = checkedAssets[i].mcae.Repair_Price__c == undefined  ? null : checkedAssets[i].mcae.Repair_Price__c;
+                // Repair_Price_pass__c 娌℃湁鍊间负null 閬垮厤涓嬮潰鏉′欢璇垽   == null ? undefined : checkedAssets[i].mcae.Repair_Price_pass__c 
+                let Repair_Price_pass = checkedAssets[i].mcae.Repair_Price_pass__c; 
+                if ((repairMoney+1)==1) {
+                    checkedAssets[i].mcae.Repair_Price__c = Repair_Price_Auto;
+                }
+                if ((Repair_Price_pass+1)==1) {
+                    checkedAssets[i].mcae.Repair_Price_pass__c = Repair_Price_Auto;
+                }
+                let repairMoney1 = parseFloat(repairMoney * 1);
+                let ISReducedpriceapproval = this.estimate.IS_Reduced_price_approval__c; 
+                if (ISReducedpriceapproval =='鏈夊叓鎶樹互涓嬪緟瀹℃壒' || ISReducedpriceapproval =='鏄�' || isDisabled) {
+                    checkedAssets[i].IsRepairPriceDisabled = true;
+                }else{
+                    checkedAssets[i].IsRepairPriceDisabled = false;
+                }
+                //鍦ㄨ閮ㄥ垎js浠g爜 鏈娇鐢ㄥ彉閲�
+                // ISReducedpriceapproval1 = checkedAssets[i].mcae.IS_Reduced_price_approval__c; 
+                // ISReduced = ISReducedpriceapproval ; 
+                if (repairMoney1> 0 && (repairMoney1 <Repair_Price_Auto*0.80)) {
+                    isresduce = isresduce+1;
+                }
+                //+ '' 閬垮厤鑾峰彇鍊兼槸undefined 鎴栬�� null 瀵艰嚧寮曠敤寮傚父
+                let ResonCannotWarranty = checkedAssets[i].rec.Reson_Can_not_Warranty__c + ''; 
+                if(!(ResonCannotWarranty.indexOf("寮冧慨") != -1)&&(repairMoney+1)==1){
+                    checkedAssets[i].ShowAssetSituation = false;
+                    checkedAssets[i].mcae.Repair_Price__c = '';
+                }
+                //鍦ㄨ閮ㄥ垎js浠g爜 鏈娇鐢ㄥ彉閲�
+                // let situation = checkedAssets[i].rec.Asset_situation__c + ''; 
+            }
+            repairSum = repairSum + parseFloat(repairMoney* 1);
+            listSum = listSum + parseFloat(strMoney* 1);
+            downPriceSum = downPriceSum + parseFloat(downPrice* 1);
+            upPriceSum =  upPriceSum + parseFloat(upPrice* 1);
+        }
+        // 浠呬繚鐣欎袱浣嶅皬鏁�
+        this.assetRepairSumNum = (repairSum * 1).toFixed(2);
+        if (!isDisabled) {
+            this.estimate.GuidePrice_Up__c = Math.round(upPriceSum) * 1;
+            this.estimate.GuidePrice_Down__c = Math.round(downPriceSum) * 1;
+        }
+        this.estimate.Asset_Repair_Sum_Price__c = repairSum * 1;
+        var allcount = this.productCount3 ;
+        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 = '棣栫鍚堝悓';
+        }else if(firstCCount > 0 && firstCCount == allcount){
+            result = '棣栫鍚堝悓';
+        }else if(oyearCount > 0 && oyearCount == conCCount && allcount == oyearCount ){
+            // 20220328 ljh update  LJPH-C8FB4P銆愬鎵樸�戦厤鍚圥BI璁惧瑕嗙洊鐜囩殑鏁版嵁鍑嗗 start
+            result = '闈炵画绛惧悎鍚岋紙绌虹櫧鏈熶竴骞翠互涓婏級';
+        }else{
+            result = '缁鍚堝悓';
+        }
+        console.log('result',result);
+        this.estimate.New_Contract_Type_TxT__c = result;
+        this.allData.typeresult = result;
+        // 鍙栨秷閰稿寲姘�
+        //NotUseOxygenatedWaterAmount(1);
+        //next  makeRealPrice 鏆傛椂琛ュ厖 examinationPriceCal--鏂规硶 鐩墠鍙蛋閫昏緫锛歮akeRealPrice(1)
+        // examinationPriceCal(cnt);
+        this.makeRealPrice(1);
+        this.getLastContractRate();
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230315 start todo
+        this.allDataInfo();
+        let returnData = estimateUtility.handleInfo.seamlessRenew(this,checkedAssets.length,this.allData,checkedAssets,this.PageDisabled,this.IsContractEstiStartDateDisabled);
+        this.allData = returnData.allData;
+        this.handleInitSimpleData(this.allData);
+        // 2023/09/18 seamlessRenew 鍙兘淇敼 IsContractEstiStartDateDisabled 鍊硷紝handleInitSimpleData涓湭澶勭悊璇ョ鐢�
+        this.IsContractEstiStartDateDisabled = returnData.IsContractEstiStartDateDisabled;
+        checkedAssets = returnData.checkedAssets;
+        // 鎶ヤ环瑙勫垯鏀瑰杽 20230315 end
+        if (TotalMaintenancePriceYear!=0) {
+            TotalMaintenancePriceYear = this.localParseFloat(TotalMaintenancePriceYear).toFixed(2);
+            var ContractMonth1 = this.localParseFloat(this.estimate.Contract_Range__c).toFixed(2);
+            var result = ((TotalMaintenancePriceYear/12)*ContractMonth1).toFixed(2);
+            this.estimate.Total_Contract_Price__c = result;
+        }
+        //  鎶ヤ环椤甸潰銆愬悎鍚屽畾浠锋�婚銆戝瓧娈垫坊鍔� 20230608 end
+        //杩斿洖澶勭悊鍚庣殑缁撴灉缁檃llData鐨刢heckAsset
+        this.makeRealPrice(1);
+        return checkedAssets;
+    }
+    //
+    calculateNtoMRatio(lastContRange, month ){
+        var lastContRangeYear = Math.ceil(parseFloat(lastContRange* 1)/12);
+        var currentMonthYear = Math.ceil(parseFloat(month* 1)/12);  
+        // 2023/09/06 鎶ヤ环瑙勫垯鏀瑰杽鏂板 +-   
+        // var rateF = this.estimate.Consumption_rate_Forecast__c;      
+        // var coefficient = this.allData.coefficient;  
+        // if (this.localParseFloat(rateF) * this.localParseFloat(coefficient) < 100) {       
+        //     return month;        
+        // }        
+        // 鎶ヤ环瑙勫垯鏀瑰杽鏂板
+        if(currentMonthYear == lastContRangeYear || currentMonthYear == 1){
+            return month;
+        }else if(month <= 24) {
+            return 12+ (month- 12) *1.1;
+        }else if(month <= 36) {
+            return 25.2 + (month- 24) *1.21;
+        }else if(month <= 48) {
+            return 39.72 + (month- 36) *1.331;
+        }else if(month <= 60) {
+            return 55.692 + (month- 48) *1.4641;
+        }else {
+            estimateUtility.toast.showToast(this, 'error', '鍚堝悓鏈熸渶闀垮彧鑳介�夋嫨60涓湀锛�');
+            return 0;
+        }
+    }
+    //鏈�夋嫨鐨勪繚鏈夎澶� 褰撳墠椤� 鍏ㄩ��
+    checkAllUncheckedAsset(event){
+        this.IsCheckAllUncheckedAsset = event.detail.checked;
+        for (var i = 0; i < this.unCheckedAssetNowData.length; i++) {
+            let index = this.unCheckedAssetNowData[i].Id;
+            this.allData.unCheckedAssets.forEach(function(ar) {
+                if (ar.rec.Id == index && !(ar.rec.Maintenance_Price_Month__c == 0 || ar.rec.IF_Warranty_Service__c == '鍚�')) {
+                    ar.rec_checkBox_c = event.detail.checked;
+                }
+            });
+        }
+        this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+    }
+    //鏄剧ず鏈�夋嫨淇濇湁璁惧
+    showUnCheckedAsset(event){
+        this.IsShowUnCheckedAsset = true;
+    }
+    //闅愯棌鏈�夋嫨淇濇湁璁惧
+    hiddenUnCheckedAsset(event){
+        this.IsShowUnCheckedAsset = false;
+    }
+    //鏈�夋嫨淇濇湁璁惧 鎼滅储澶勭悊
+    handleChangeText1(event){
+        this.text1 = event.detail.value;
+    }
+    handleChangeCond1(event){
+        this.cond1 = event.detail.value;
+    }
+    handleChangeVal1(event){
+        this.val1 = event.detail.value;
+    }
+    //妫�绱�
+    searchJs(event){
+        this.IsLoading = true;
+        this.allData.text1 = this.text1;
+        this.allData.cond1 = this.cond1;
+        this.allData.val1 = this.val1;
+        this.allDataInfo();
+        // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶閲嶆柊璧嬪�硷紝鐩存帴缃┖
+        let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+        this.allData.unCheckedAssets = [];
+        searchBtn({
+            initDataStr: JSON.stringify(this.allData),
+        }).then(result => {
+            result = JSON.parse(result);
+            console.log('searchJs result',result);
+            this.allData = result;
+            this.handleInitSimpleData(result);
+            //unCheckedAssets 澶勭悊
+            this.currentPage = 1;
+            this.handleunCheckedAssetColumnsAndData(result.unCheckedAssets);
+        }).catch(error => {
+            // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+            this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+        }).finally(() => {
+            // classic 涓�鑷达紝浼樺寲锛氭敼鐢╢lag锛岄〉闈㈡樉绀哄拰鍚庡彴澶勭悊鏉′欢涓嶄竴鑷达紙娓呴櫎鏉′欢鏃讹紝椤甸潰鏄剧ず涓� S:AssetMark__c锛屽疄闄呬负 ''锛�
+            this.allData.text1 = this.allData.text1 == '' ? 'S:AssetMark__c' : this.allData.text1;
+            this.text1 = this.allData.text1;
+            this.cond1 = this.allData.cond1;
+            this.val1 = this.allData.val1;
+            this.IsLoading = false;
+        });  
+    }
+    //娓呴櫎鏉′欢 
+    clearAndSearch() {
+        this.text1 = '';
+        this.cond1 = 'equals';
+        this.val1 = ''; 
+        this.searchJs();
+    }
+    //纭娣诲姞 -- 鍒锋柊琛岄�変腑
+    handleExchangeAsset(template,event) {
+        this.IsLoading = true;
+        this.IsRefresh = false;
+        this.allDataInfo();
+        //2023/09/16 unCheckedAssets 浠呬繚鐣欏嬀閫夋暟鎹� 鍚庡彴unCheckedAssets 浼氶噸鏂版煡璇㈣祴鍊�
+        let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+        let checkedNewUnCheckedAssets = [];
+        this.allData.unCheckedAssets.forEach(function(ar) {
+            if (ar.rec_checkBox_c) {
+                checkedNewUnCheckedAssets.push(ar);
+            }
+        });
+        this.allData.unCheckedAssets = checkedNewUnCheckedAssets;
+        exchangeAsset({
+            initDataStr:JSON.stringify(this.allData)
+        }).then(result => {
+            result = JSON.parse(result);
+            console.log('handleExchangeAsset result',result);
+            if (result != null) {
+                this.allData = result;
+                //椤甸潰鐩稿叧鏁版嵁鍒濆鍖�
+                this.handleInitSimpleData(result);
+                this.allData.checkedAssets = this.refreshAsset(result.checkedAssets.length,result.checkedAssets);
+                this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+                //param : unCheckedAssetsView
+                this.currentPage = 1;
+                this.handleunCheckedAssetColumnsAndData(this.allData.unCheckedAssets);
+            }else{
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }
+        }).catch(error => {
+            console.log(error);
+            // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+            this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+        }).finally(() => {
+            this.IsLoading = false;
+            this.IsShowUnCheckedAsset = false;
+            // 涓や釜琛ㄦ牸鐨� 鍏ㄩ�� 鍕鹃�� 娓呴櫎
+            this.IsCheckAllUncheckedAsset = false;
+            this.IsCheckAllcheckedAsset = false;
+            this.IsRefresh = true;
+        }); 
+    }
+    //鎻愪氦寰呭鎵�
+    async handleApprove(event){
+        //onclick
+        this.IsLoading = true;
+        let resKindsAndMonths = await this.KindsAndMonths();
+        let resEGFlgconfim = await this.EGFlgconfim();
+        await this.approvalJs();
+        console.log('resKindsAndMonths',resKindsAndMonths);
+        console.log('resEGFlgconfim',resEGFlgconfim);
+        if (resKindsAndMonths && resEGFlgconfim) {
+            this.allDataInfo();
+            console.log('approvalProcess result');
+            // 2023/09/18 unCheckedAssets 鍚庡彴鏂规硶鏈秹鍙婅灞炴�э紝鐩存帴缃┖
+            let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+            this.allData.unCheckedAssets = [];
+            await approvalProcess({
+                initDataStr: JSON.stringify(this.allData),
+            }).then(result => {
+                console.log('approvalProcess result',result);
+                if (result.indexOf('navigateTo') != -1) {
+                    this.navigateToOtherObj(result.split('=')[1]);
+                }else{
+                    estimateUtility.toast.showToast(this, 'error', result);
+                    // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                    this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                }
+            }).catch(error => {
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }).finally(() => {
+            }); 
+            //oncomplete
+            this.unblockUI();
+        }
+        this.IsLoading = false;
+    }
+    //
+    async KindsAndMonths() {
+       //   鏁呴殰鍝佸姞璐� 绯荤粺妫�鏌ヤ慨鐞嗗噺浠峰鎵瑰畬鎴� Start
+        let ISReduced = this.estimate.IS_Reduced_price_approval__c;
+        if( ISReduced == '瀹℃壒涓�' || ISReduced == '鏈夊叓鎶樹互涓嬪緟瀹℃壒'){
+            estimateUtility.toast.showToast(this, 'error', '璇烽�氳繃淇悊鍑忎环瀹℃壒鍐嶆彁浜�');
+            return false;
+        }
+        //   鏁呴殰鍝佸姞璐� 绯荤粺妫�鏌ヤ慨鐞嗗噺浠峰鎵瑰畬鎴� end
+        var months      = parseFloat(this.estimate.Contract_Range__c == undefined ? null : this.estimate.Contract_Range__c);
+        var contrNew    = this.estimate.New_Contract_Type_TxT__c; 
+        if(months>12 && months<60 && contrNew == '鏂板搧鍚堝悓'){
+            let confirmResult = await estimateUtility.toast.handleConfirmClick("鏈鎮ㄦ彁浜ょ殑鎶ヤ环涓哄骞存湡鏂板搧鍚堝悓锛岃鎮ㄥ湪姝e紡鎻愪氦鎶ヤ环鍓嶅厛灏嗙粡閿�鍟嗕笌鍖婚櫌绛捐鐨勫骞存湡鍚堝悓閭欢鍙戦�佹湇鍔℃湰閮ㄦ姤浠风獥鍙c�傝嫢宸茬粡鎻愪氦璇风偣鍑荤‘瀹氾紝缁х画淇濆瓨鎻愪氦銆�");
+            return confirmResult;
+        }
+        // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220408 start
+        var FirstParagraphEnd = this.estimate.Is_RecognitionModel__c;
+        if(FirstParagraphEnd){
+            let confirmResult = await estimateUtility.toast.handleConfirmClick("鏈绛剧害缁忛攢鍟嗘槸鍏堟瀵硅薄锛岃纭鏄惁鎻愪氦鎶ヤ环锛�");
+            return confirmResult;
+        }
+        // 鍏堟鍚庝慨-鎻愪氦鎶ヤ环鏃跺鏋滄槸鍏堟瀵硅薄杩涜鎻愮ず thh 20220408 end
+        return true;
+    }
+    //
+    approvalJs() {
+        this.approvalDate = new Date();
+        var rowCnt = this.productCount;
+        this.allData.checkedAssets = this.refreshAsset(rowCnt,this.allData.checkedAssets);
+        this.handleCheckedAssetColumnsAndData(this.allData.checkedAssets);
+    }
+    // 杩囧幓涓夊勾缁翠慨瀹炵哗璁$畻
+    async AlertPriceBtnJs(){
+        this.IsLoading = true;
+        var  PStatus   = this.estimate.Process_Status__c;
+        if(PStatus!='鐢宠涓�'&& PStatus!='鎵瑰噯'){
+            await ComputeLTYRepair({
+                targetEstimateId: this.allData.targetEstimateId,
+            }).then(result => {
+                if (result != null) {
+                    estimateUtility.toast.showToast(this, 'error', result);
+                }
+            }).catch(error => {
+            }).finally(() => {
+                
+            }); 
+        }else if(PStatus == '鐢宠涓�'||PStatus == '鎵瑰噯'){
+            await ShowLTYRepair({
+                targetEstimateId: this.allData.targetEstimateId,
+            }).then(result => {
+                result = JSON.parse(result);
+                if (result != null) {
+                    //allData 璧嬪��
+                    this.allData.lastFriYearsPriceSum = result.lastFriYearsPriceSum;
+                    this.allData.lastSecYearsPriceSum = result.lastSecYearsPriceSum;
+                    this.allData.alertString = result.alertString;
+                    this.allData.alertString2 = result.alertString2;
+                    this.allData.alertString3 = result.alertString3;
+                }
+            }).catch(error => {
+            }); 
+        }
+        this.IsLoading = false;
+    }
+    // 鎻愪氦淇悊鍑忎环瀹℃壒
+    handleToApprovalProcess(){
+        this.IsLoading = true;
+        this.allDataInfo();
+        // 2023/09/18 unCheckedAssets 鍚庡彴鏂规硶鏈秹鍙婅灞炴�э紝鐩存帴缃┖
+        let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+        this.allData.unCheckedAssets = [];
+        toApprovalProcess({
+            initDataStr: JSON.stringify(this.allData),
+        }).then(result => {
+            if (result != null && result.indexOf('completion=5') != -1) {
+                //閲嶆柊璺宠浆璇ラ〉闈� 鎼哄甫鍙傛暟
+                estimateUtility.toast.showToast(this, 'success', '鎻愪氦淇悊鍑忎环瀹℃壒鎴愬姛');
+                window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#id="+result.split('/')[1]; 
+                location.reload();
+            }else{
+                estimateUtility.toast.showToast(this, 'error', result);
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }
+        }).catch(error => {
+            // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+            this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+        }).finally(() => {
+            this.IsLoading = false;
+        });
+    }
+    // Decide
+    async decideJs() {
+        console.log('decideJs');
+        if(this.allData.MaintanceContractPackId && this.estimate.McpDecide__c == false) {
+            estimateUtility.toast.showToast(this, 'error', '鍙兘瀵瑰喅瀹氭姤浠风粍鍚堥噷鐨勬姤浠疯繘琛宒ecide锛�');
+            return;
+        }
+        this.IsLoading = true;
+        if (await this.checkDecideDate()) {
+            if (await this.onclickCheckchangedAfterPrint('true','false')) {
+                var oldDate = this.allData.OldContractStartDate;
+                var contractDate = new Date(this.estimate.Contract_Start_Date__c);
+                var monthStr = '00' + (contractDate.getMonth()+1);
+                monthStr = monthStr.substring(monthStr.length-2, monthStr.length);
+                var dayStr = '00' + contractDate.getDate();
+                dayStr = dayStr.substring(dayStr.length-2, dayStr.length);
+                var contractDateStr = contractDate.getFullYear() + '/' + monthStr + '/' + dayStr;
+                //璐告槗鍚堣 you 20230414 start
+                var AccDealerBlacklist = this.contract.AccDealerBlacklist__c;//榛戝悕鍗�,璀︾ず鍚嶅崟
+                var TradeComplianceStatusFlagFW = this.allData.TradeComplianceStatusFlagFW;//璐告槗鍚堣寮�鍏�
+                var IFTradeComplianceAlert = this.allData.IFTradeComplianceAlert;//璐告槗鍚堣鎻愰啋
+                if(TradeComplianceStatusFlagFW=='true'){
+                   if(AccDealerBlacklist =='1'){
+                       estimateUtility.toast.showToast(this, 'warning', '鎮ㄦ墍閫夋嫨鐨勫尰闄㈠瓨鍦ㄨ锤鏄撳悎瑙勯闄╋紝鏃犳硶绛捐鏈嶅姟鍚堝悓锛屽缓璁偍鍚戝鎴峰仛濂戒笉绛剧害璇存槑,'+IFTradeComplianceAlert);
+                       var reflag = handleInterceptsend();//鍚庡彴
+                       this.unblockUI();
+                       return null;
+                    }else if(AccDealerBlacklist =='2'){
+                       estimateUtility.toast.showToast(this, 'warning', '鎮ㄦ墍閫夋嫨鐨勭粡閿�鍟嗗瓨鍦ㄨ锤鏄撳悎瑙勯闄╋紝鏃犳硶绛捐鏈嶅姟鍚堝悓锛屽缓璁偍鍚戝鎴峰仛濂戒笉绛剧害璇存槑,'+IFTradeComplianceAlert);
+                       var reflag = handleInterceptsend();
+                       this.unblockUI();
+                       return null;
+                    }else if(AccDealerBlacklist =='12'){
+                       estimateUtility.toast.showToast(this, 'warning', '鎮ㄦ墍閫夋嫨鐨勫尰闄㈠拰缁忛攢鍟嗗瓨鍦ㄨ锤鏄撳悎瑙勯闄╋紝鏃犳硶绛捐鏈嶅姟鍚堝悓锛屽缓璁偍鍚戝鎴峰仛濂戒笉绛剧害璇存槑,'+IFTradeComplianceAlert);
+                       var reflag = handleInterceptsend();
+                       this.unblockUI();
+                       return null;
+                    }else if(AccDealerBlacklist =='5'){
+                       if (!(await estimateUtility.toast.handleConfirmClick('鎮ㄦ墍閫夋嫨鐨勫尰闄㈠瓨鍦ㄨ锤鏄撳悎瑙勮绀洪闄╋紝涓嶅缓璁璁㈡湇鍔″悎鍚岋紝璇锋偍纭鏄惁缁х画鐢宠,'+IFTradeComplianceAlert))) {
+                        this.unblockUI();
+                        return null;
+                        }
+                    }else if(AccDealerBlacklist =='6'){
+                       if (!confirm('鎮ㄦ墍閫夋嫨鐨勭粡閿�鍟嗗瓨鍦ㄨ锤鏄撳悎瑙勮绀洪闄╋紝涓嶅缓璁璁㈡湇鍔″悎鍚岋紝璇锋偍纭鏄惁缁х画鐢宠,'+IFTradeComplianceAlert)) {
+                        this.unblockUI();
+                        return null;
+                        }
+                    }else if(AccDealerBlacklist =='56'){
+                       if (!(await estimateUtility.toast.handleConfirmClick('鎮ㄦ墍閫夋嫨鐨勫尰闄㈠拰缁忛攢鍟嗗瓨鍦ㄨ锤鏄撳悎瑙勮绀洪闄╋紝涓嶅缓璁璁㈡湇鍔″悎鍚岋紝璇锋偍纭鏄惁缁х画鐢宠,'+IFTradeComplianceAlert))) {
+                        this.unblockUI();
+                        return null;
+                        }
+                    }
+                }
+                //璐告槗鍚堣 you 20230414 end
+                if (oldDate == contractDateStr) {
+                    this.allData.changedAfterPrint = false;
+                    this.handleDecide();
+                } else {
+                    var oldp = parseFloat(this.allData.OldMaintenancePrice*1);
+                    var newp = parseFloat(this.estimate.Maintenance_Price__c);
+                    console.log('oldp',oldp);
+                    console.log('newp',newp);
+                    if (oldp != newp) {
+                        // 20201106 楂樼珷浼� 鎻愰啋娑堟伅淇敼 start
+                        this.allData.changedAfterPrint = true;
+                        if (await estimateUtility.toast.handleConfirmClick("鍚堝悓閲戦鍙戠敓鍙樺寲锛岃鎮ㄧ‘璁ゃ��")) {
+                            this.handleDecide();
+                        } else {
+                            estimateUtility.toast.showToast(this, 'warning', '璇风‘璁ゅ叏閮ㄥ唴瀹瑰悗鐐瑰嚮Decide銆�');
+                            this.estimate.Contract_Start_Date__c = oldDate;
+                            this.allData.OldContractStartDate = '';
+                            this.allData.changedAfterPrint = false;
+                            this.handleDecideCancle();
+                        }
+                    } else {
+                        this.allData.changedAfterPrint = false;
+                        this.handleDecide();  
+                    }
+                    // 20201106 楂樼珷浼� 鎻愰啋娑堟伅淇敼 end
+                }
+            }else{
+                this.IsLoading = false;
+
+            }
+        }else{
+            this.IsLoading = false;
+        }
+    }
+    handleInterceptsend(){
+        this.allDataInfo();
+        //sendEmail 鐩墠鐧诲綍鐢ㄦ埛娌℃湁鏉冮檺锛屾彁浜C鍚屾柟娉� SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile.
+        interceptsend({
+            estimateStr: JSON.stringify(this.allData.estimate),
+            targetEstimateId: this.allData.targetEstimateId,
+        }).then(result => {
+            return result;
+        }).catch(error => {
+        }).finally(() => {
+            this.IsLoading = false;
+        });
+    }
+    //
+    async checkDecideDate() {
+        console.log('checkDecideDate');
+        // 鎶ヤ环鏈夋晥鏈�
+        var strSubmitDate = this.estimate.Submit_quotation_day__c;
+        // 涓婃湡鍚堝悓缁撴潫鏃� 鍙栨渶鏅氱殑
+        var conEndDate = await this.getLastContractendDate();
+        console.log(11);
+        conEndDate = new Date(conEndDate);
+        // 浠婂ぉ
+        var submitDate = new Date();
+        var nowDate = new Date();
+        nowDate = new Date(nowDate.toLocaleDateString());
+        /// 鎶ヤ环涓澶囩殑鏈鸿韩缂栫爜涓虹┖鏃剁殑鏂板搧鍚堝悓鏈夋晥鏈熷欢闀� 20200710 gzw
+        // 榛樿涓�3鏈堬紝鍏ㄦ槸浜у搧涓�6鏈堬紱
+        var monthGap = 6;
+        var cntWithKara = this.productCount;
+        for (var i = 0; i < cntWithKara; i++) {
+            var isManual = this.allData.checkedAssets[i].isManual;
+            if (isManual != true) {
+                monthGap = 3;
+                break;
+            }
+        }
+        if (strSubmitDate != '') {
+            submitDate = new Date(strSubmitDate);
+            submitDate = new Date(submitDate.setMonth(submitDate.getMonth() + monthGap));
+            if(Date.parse(conEndDate)  > Date.parse(submitDate)){
+                submitDate = new Date(conEndDate);
+            }
+        }
+        if (strSubmitDate != '' && nowDate > submitDate) {
+            estimateUtility.toast.showToast(this, 'error','宸茶秴鍑烘姤浠风敵璇锋棩'+ monthGap+'涓湀锛屼笉鍏佽DECIDE銆�');
+            return false;
+        }
+        return true;
+    }
+    //
+    getLastContractendDate(){
+        console.log('getLastContractendDate');
+        var rowCnt = this.productCount;
+        var lastdate = null;
+
+        for (var i = 0; i < rowCnt; i++) {
+            var LastMContractID = this.allData.checkedAssets[i].rec ? this.allData.checkedAssets[i].rec.CurrentContract_F__c : null;
+            if(LastMContractID){
+                var endDate = new Date(this.allData.checkedAssets[i].rec.CurrentContract_End_Date__c);
+                if(lastdate == null){
+                    lastdate = new Date(endDate);
+                }else if(Date.parse(endDate) > Date.parse(lastdate)){
+                    lastdate = new Date(endDate);
+                }
+            }
+        }
+        return lastdate;
+    }
+    //decide
+    handleDecide(){
+        this.IsLoading = true;
+        this.allDataInfo();
+        // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶閲嶆柊璧嬪�硷紝鐩存帴缃┖
+        let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+        this.allData.unCheckedAssets = [];
+        decide({
+            initDataStr: JSON.stringify(this.allData),
+        }).then(result => {
+            if (result != null && result.indexOf('completion=') != -1) {
+                //閲嶆柊璺宠浆璇ラ〉闈� 鎼哄甫鍙傛暟
+                window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#id="+result.split('/')[1]; 
+                location.reload();
+            }else{
+                estimateUtility.toast.showToast(this, 'error', result);
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }
+        }).catch(error => {
+            // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+            this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+        }).finally(() => {
+            this.IsLoading = false;
+        });
+    }
+    //decideCancle
+    handleDecideCancle(){
+        //鍚庡彴椤甸潰璺宠浆鍘熼〉闈�  鏇挎崲鎴恖ocation.reload();
+        this.IsLoading = true;
+        this.allDataInfo();
+        // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶閲嶆柊璧嬪�硷紝鐩存帴缃┖锛屽悗鍙板鐞嗗悗锛岄〉闈㈤噸杞斤紝涓嶈�冭檻鏃у�� 閲嶆柊璧嬪��
+        this.allData.unCheckedAssets = [];
+        decideCancle({
+            initDataStr: JSON.stringify(this.allData),
+        }).then(result => {
+        }).catch(error => {
+        }).finally(() => {
+            location.reload();
+            this.IsLoading = false;
+        });
+    }
+    //鍙栨秷Decide
+    handleUndecide(){
+        this.IsLoading = true;
+        this.allData.estimate = this.estimate;
+        undecide({
+            targetEstimateId: this.allData.targetEstimateId,
+            estimateStr: JSON.stringify(this.allData.estimate),
+        }).then(result => {
+            if (result != null && result.indexOf('completion=1') != -1) {
+                window.location.href=window.location.origin+"/lightning/n/lexSelectAssetEstimateVM#id="+result.split('/')[1]; 
+                location.reload();
+            }else{
+               estimateUtility.toast.showToast(this, 'error', result);
+            }
+        }).catch(error => {
+        }).finally(() => {
+            location.reload();
+            this.IsLoading = false;
+        });
+    }
+    //PDF鎵撳嵃鎸夐挳
+    async handlePrint(){
+        this.IsLoading = true;
+        if (await this.onclickCheckchangedAfterPrint(this.SaveBtnDisabled,'false')) {
+            this.allDataInfo();   
+            // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶閲嶆柊璧嬪�硷紝鐩存帴缃┖
+            let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+            this.allData.unCheckedAssets = [];
+            print({
+                initDataStr: JSON.stringify(this.allData),
+            }).then(result => {
+                if (result != null && result.indexOf('printAsset') == -1) {
+                    estimateUtility.toast.showToast(this, 'error', result);
+                    // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                    this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                }else if (result != null) {
+                    result = JSON.parse(result);
+                    this.allData = result;
+                    //椤甸潰鐩稿叧鏁版嵁鍒濆鍖�
+                    this.handleInitSimpleData(result);
+                }
+            }).catch(error => {
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }).finally(() => {
+                //complete
+                this.PDFDataChang();
+                this.unblockUI();
+                ComputeLTYRepair({
+                    targetEstimateId: this.allData.targetEstimateId,
+                }).then(result => {
+                    if (result != null) {
+                        estimateUtility.toast.showToast(this, 'error', result);
+                    }
+                    this.IsLoading = false;
+                }).catch(error => {
+                }).finally(() => {
+                });  
+            }); 
+        }else{
+            this.IsLoading = false;
+        }
+    }
+    //page 鍚庡彴js 鏂规硶 妫�娴媝rintAsset鏄惁婊¤冻
+    PDFDataChang(){
+        if (this.allData.printAsset) {
+            //鎵撳嵃淇濇湁瑷倷
+            // //蹇呴』閫夋嫨鎵撳嵃鎶ヤ环(璇︾粏杩樻槸绠�鍖�)
+            var con = 0;
+            if (this.estimate.Print_ListPrice__c) {
+                con ++;
+            }
+            if (this.estimate.Print_Simplify__c) {
+                con ++;
+            }
+            if (this.estimate.Print_RepairPrice__c) {
+                con ++;
+            }
+            if (this.estimate.Print_SumPrice__c) {
+                con ++;
+            }
+            if(con != 1){
+                estimateUtility.toast.showToast(this, 'error', '璇锋偍鍕鹃�夋墦鍗版姤浠风増鏈紝鍙兘鍕鹃�変竴涓��');
+            }else{
+                 window.open('/apex/MaintenanceContractEstimateVMPDF?id='+this.allData.targetEstimateId, 'MaintenanceContractEstimateVMPDF');
+            }
+        } else if (this.allData.printContract) {
+            // 鎵撳嵃鍖婚櫌鍚堝悓閰嶇疆
+            window.open('/apex/MceConfigPDF?id='+this.allData.targetEstimateId+'&flag=printContract', 'MceConfigPDF');
+        } else if (this.allData.printTripartite) {
+            //鎵撳嵃涓夋柟鍚堝悓
+            window.open('/apex/MceConfigPDF?id='+this.allData.targetEstimateId+'&flag=printTripartite', 'MceConfigPDF');
+        } else if (this.allData.printAgent) {
+            //鎵撳嵃缁忛攢鍟嗗悎鍚�
+            window.open('/apex/MceConfigPDF?id='+this.allData.targetEstimateId+'&flag=printAgent', 'MceConfigPDF');
+        }else {}
+    }
+    //ok 鎻愪氦RC璇勪及
+    async handleSendEmail(){
+        this.IsLoading = true;
+        if (await this.EGFlgconfim()) {
+            this.allDataInfo();
+            // 2023/09/16 unCheckedAssets 鍚庡彴鏂规硶閲嶆柊璧嬪�硷紝鐩存帴缃┖
+            let oldUnCheckedAssets = JSON.stringify(this.allData.unCheckedAssets);
+            this.allData.unCheckedAssets = [];
+            sendEmail({
+                initDataStr: JSON.stringify(this.allData),
+            }).then(result => {
+                //鍒ゆ柇鏄惁杩斿洖initData  targetEstimateId
+                if (result != null && result.indexOf('currPage') != -1) {
+                    result = JSON.parse(result);
+                    console.log('handleSendEmail result',result);
+                    this.allData = result;
+                    //椤甸潰鐩稿叧鏁版嵁鍒濆鍖�
+                    this.handleInitSimpleData(result);
+                    if (this.allData.sendEmailSuccess) {
+                        estimateUtility.toast.showToast(this, 'success', '閭欢鍙戦�佹垚鍔燂紒');
+                    }else{
+                        estimateUtility.toast.showToast(this, 'error', '閭欢鍙戦�佸け璐ワ紝璇疯仈绯荤鐞嗗憳锛�');
+                        // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                        this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                    }
+                }else{
+                    estimateUtility.toast.showToast(this, 'error', result);
+                    // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                    this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+                }
+            }).catch(error => {
+                // 2023/09/18 杩斿洖寮傚父锛屾棫鏁版嵁杩斿洖璧嬪��
+                this.allData.unCheckedAssets = JSON.parse(oldUnCheckedAssets);
+            }).finally(() => {
+                this.unblockUI();
+                this.IsLoading = false; 
+            }); 
+        }else{
+           this.IsLoading = false;  
+        }
+    }
+    //璁$畻棰勬祴娑堣垂鐜�
+    consumptionbtnJs(){
+        this.IsLoading = true;
+        var mceId = this.allData.targetEstimateId;
+        // sforce.connection.sessionId = '{!$Api.Session_ID}';
+        ToConsumptionRate({
+            mceId: mceId,
+        }).then(flg => {
+            if (flg == '璁$畻瀹屾垚') {
+                estimateUtility.toast.showToast(this, 'success', flg);
+            }else{
+                estimateUtility.toast.showToast(this, 'error', flg);
+            }
+        }).catch(error => {
+        }).finally(() => {
+            this.IsLoading = false;
+        }); 
+    }
+    //estimate contract 鍚屾
+    allDataInfo(){
+        this.allData.estimate = this.estimate;
+        this.allData.contract = this.contract;
+    }
+    //parseFloat 閬垮厤NAN
+    localParseFloat(val){
+        val = val == undefined ? null : val;
+        return parseFloat(val*1);
+    }    
+    //椤甸潰瀵硅薄璺宠浆
+    navigateToOtherObj(recordId){
+        // this.IsLoading = true;
+        this[NavigationMixin.Navigate]({
+            type:'standard__recordPage',
+            attributes:{
+                recordId:recordId,
+                objectApiName:'Account',
+                actionName:'view'
+            }
+        });
+    }
+    // del testMax
+    // test(){
+    //     let max = {};
+    //     max.max1 = this.allData;
+    //     max.max1.unCheckedAssets = null;
+    //     max.max2 = this.allData.checkedAssets;//282 - 564
+    //     max.max3 = max.max2.slice(0, 70);
+    //     let str = JSON.stringify(max);
+    //     console.log('str',str);
+    //     test({
+    //         str:str,
+    //     }).then(result => {
+    //         console.log(result);
+    //         estimateUtility.toast.showToast(this, 'error', result);
+    //     }).catch(error => {
+    //         console.log(error);
+    //         estimateUtility.toast.showToast(this, 'error', '鏁版嵁閲忚繃澶�');
+    //     }).finally(() => {              
+    //     }); 
+
+    // }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js-meta.xml b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js-meta.xml
new file mode 100644
index 0000000..078d5e7
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetEstimateVM/lexSelectAssetEstimateVM.js-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexSelectAssetEstimateVM">
+    <apiVersion>56.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+    	<target>lightning__Tab</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__AppPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexStartTrading/lexStartTrading.js b/force-app/main/default/lwc/lexStartTrading/lexStartTrading.js
index 682de42..6e6caee 100644
--- a/force-app/main/default/lwc/lexStartTrading/lexStartTrading.js
+++ b/force-app/main/default/lwc/lexStartTrading/lexStartTrading.js
@@ -69,16 +69,23 @@
 				console.log('start result==========',result);
 				if(result!=null){
 					this.showToast('宸叉垚鍔熻浆鍖栬浠�','success');
-					window.open('/lightning/r/Opportunity/'+result+'/view','_parent');
-					// this[NavigationMixin.GenerateUrl]({
-					// 	type: "standard__recordPage",
-					// 	attributes: {
-					// 		recordId: result,
-					// 		objectApiName:"Opportunity",
-					// 		actionName:"edit"
-					// 	}
-					// })
+					console.log(result);
+					// window.location = '/lightning/r/Opportunity/'+result+'/view';
+					this[NavigationMixin.Navigate]({
+						type: "standard__recordPage",
+						attributes: {
+							recordId: result,
+							actionName:"edit"
+						},
+						state: {
+							nooverride: '1',
+							backgroundContext: '/lightning/r/Opportunity/'+result+'/view'
+						}
+					});
 				}
+			}).catch(error=>{
+				console.log('error');
+				console.log(error);
 			});
 			// .catch(err=>{
 			// 	console.log("start error:");
diff --git a/force-app/main/default/lwc/lexStockCancel/lexStockCancel.html b/force-app/main/default/lwc/lexStockCancel/lexStockCancel.html
index bf9cadc..f3e1a60 100644
--- a/force-app/main/default/lwc/lexStockCancel/lexStockCancel.html
+++ b/force-app/main/default/lwc/lexStockCancel/lexStockCancel.html
@@ -1,5 +1,9 @@
 <template>
-    <div class="Holder" if:true={IsLoading}>
-        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    <div class="Holder" style="	
+    position: relative;
+    width:100%;
+    height:200px;
+    --sds-c-progress-ring__stroke-color: #0070d2;">
+        <lightning-spinner alternative-text="Loading" size="medium" variant="brand"></lightning-spinner>
     </div>
 </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexStockCancel/lexStockCancel.js b/force-app/main/default/lwc/lexStockCancel/lexStockCancel.js
index 35fd9b7..5c57e4b 100644
--- a/force-app/main/default/lwc/lexStockCancel/lexStockCancel.js
+++ b/force-app/main/default/lwc/lexStockCancel/lexStockCancel.js
@@ -6,6 +6,8 @@
 import init from '@salesforce/apex/LexStockCancelController.init';
 import updateOppotunity from '@salesforce/apex/LexStockCancelController.updateOppotunity';
 import submitApprovalRequest from '@salesforce/apex/LexStockCancelController.submitApprovalRequest';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
 export default class lexStockCancel extends LightningElement {
 	@api recordId;
     IsLoading=true;
@@ -28,6 +30,10 @@
 
 
 	connectedCallback(){
+		
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
 		console.log(this.recordId);
 		init({recordId:this.recordId}).then(result=>{
 			console.log(result);
@@ -52,8 +58,10 @@
 		let reason = this.data.Stock_cancel_reason__c;
 		if (reason == null || reason == '') {
 			const event = new ShowToastEvent({
-	            title: '鎻愮ず淇℃伅',
-	            message:'蹇呴』濉啓鎾ら攢澶囪揣鐞嗙敱銆�'
+	            title: '',
+	            message:'蹇呴』濉啓鎾ら攢澶囪揣鐞嗙敱銆�',
+	            variant: 'warning',
+	            mode: 'sticky'
 	        });
 	        this.dispatchEvent(event);
 			return;
@@ -63,8 +71,10 @@
 		let stage = this.data.Whether_Upload_Question_Document__c;
 		if (stage == '0') {
 			const event = new ShowToastEvent({
-	            title: "鎻愮ず淇℃伅",
-	            message:'璇蜂笂浼犺川鐤戝嚱銆�'
+	            title: "",
+	            message:'璇蜂笂浼犺川鐤戝嚱銆�',
+	            variant: 'warning',
+	            mode: 'sticky'
 	        });
 	        this.dispatchEvent(event);
 			return;
@@ -72,8 +82,8 @@
 		// CHAN-BCS8T5 LHJ 20190604 End
 		const resul = await LightningConfirm.open({
             message: "涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵",
-            variant: 'headerless',
-            label: '鎻愮ず淇℃伅',
+            variant: '',
+            label: '',
             // setting theme would have no effect
         });
         if (resul==false) {
@@ -87,8 +97,10 @@
 				flag=false;
 				messages=res.errors[0];
 				const event = new ShowToastEvent({
-		            title: '鎻愮ず淇℃伅',
-		            message:"鎿嶄綔澶辫触,鎻愮ず淇℃伅:"+messages
+		            title: '',
+		            message:""+messages,
+		            variant: 'error',
+		            mode: 'sticky'
 		        });
 		        this.dispatchEvent(event);
 				return;
@@ -132,8 +144,10 @@
 					flag=false;
 					messages=res.errors[0];
 					const event = new ShowToastEvent({
-			            title: '鎻愮ず淇℃伅',
-			            message:"鎿嶄綔澶辫触,鎻愮ず淇℃伅:"+messages,
+			            title: '',
+			            message:""+messages,
+			            variant: 'warning',
+			            mode: 'sticky'
 			        });		
 			        this.dispatchEvent(event);
 			        return;
@@ -141,11 +155,11 @@
 			});
 			if(flag==false)return;
 			const event = new ShowToastEvent({
-	            title: '鎻愮ず淇℃伅',
-	            message:ress
+	            title: '',
+	            message:ress,
+			    mode: 'sticky'
 	        });
 	        this.dispatchEvent(event);
-			return;
 		}
 		// window.location.reload();
 	};
diff --git a/force-app/main/default/lwc/lexsurface/lexsurface.css b/force-app/main/default/lwc/lexsurface/lexsurface.css
new file mode 100644
index 0000000..c102f98
--- /dev/null
+++ b/force-app/main/default/lwc/lexsurface/lexsurface.css
@@ -0,0 +1,11 @@
+.surface{
+	position: relative;
+	display: inline-block;
+	width: 80px;
+	height: 80px;
+	text-align: center;
+}
+
+.container .uiContainerManager{
+	display : none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexsurface/lexsurface.html b/force-app/main/default/lwc/lexsurface/lexsurface.html
new file mode 100644
index 0000000..a55a354
--- /dev/null
+++ b/force-app/main/default/lwc/lexsurface/lexsurface.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="surface" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexsurface/lexsurface.js b/force-app/main/default/lwc/lexsurface/lexsurface.js
new file mode 100644
index 0000000..3b20d50
--- /dev/null
+++ b/force-app/main/default/lwc/lexsurface/lexsurface.js
@@ -0,0 +1,32 @@
+import { LightningElement,api, track, wire } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { NavigationMixin } from 'lightning/navigation';
+
+export default class Lexsurface extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading=true;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+
+    connectedCallback(){
+        this[NavigationMixin.Navigate]({
+            type: 'standard__webPage',
+            attributes: {
+               url:'/apex/Ordergoods?accid='+this.recordId
+            }
+        });
+        this.IsLoading = false
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexsurface/lexsurface.js-meta.xml b/force-app/main/default/lwc/lexsurface/lexsurface.js-meta.xml
new file mode 100644
index 0000000..a1a6410
--- /dev/null
+++ b/force-app/main/default/lwc/lexsurface/lexsurface.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>57.0</apiVersion>
+    <isExposed>true</isExposed>
+      <targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html b/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html
index 17859cb..59efb17 100644
--- a/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html
+++ b/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-25 17:41:26
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-10-11 11:34:42
+ * @LastEditTime: 2023-10-16 13:23:10
 -->
 
 <!-- Code by CafeForce || www.cafeforce.com || support@cafeforce.com || Mandatory Header -->
@@ -53,7 +53,7 @@
         </div>
     </div>
     <template if:true={errorFlag}>
-        <div style="color:#EA001E;font-size:10px">濉啓姝ゅ瓧娈点��</div>
+        <div style="color:#BA0517;font-size:12px">濉啓姝ゅ瓧娈点��</div>
     </template>
     <!-- Multi Select Pills -->
     <template for:each={optionData} for:item="option">
diff --git a/force-app/main/default/lwc/oppLoseButton/oppLoseButton.html b/force-app/main/default/lwc/oppLoseButton/oppLoseButton.html
index c26c6e8..7da8e83 100644
--- a/force-app/main/default/lwc/oppLoseButton/oppLoseButton.html
+++ b/force-app/main/default/lwc/oppLoseButton/oppLoseButton.html
@@ -1,8 +1,9 @@
 <template>
-    <div class="slds-is-relative">
-        <template if:true={showSpinner}>
-            <lightning-spinner size="medium" variant="brand"></lightning-spinner>
-        </template>
+    <div class="Holder" style="	
+    position: relative;
+    width:100%;
+    height: 200px;
+    --sds-c-progress-ring__stroke-color: #0070d2;">
+        <lightning-spinner alternative-text="Loading" size="medium" variant="brand"></lightning-spinner>
     </div>
-    
 </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/oppLoseButton/oppLoseButton.js b/force-app/main/default/lwc/oppLoseButton/oppLoseButton.js
index b7100e8..09e4458 100644
--- a/force-app/main/default/lwc/oppLoseButton/oppLoseButton.js
+++ b/force-app/main/default/lwc/oppLoseButton/oppLoseButton.js
@@ -3,84 +3,173 @@
 import { CloseActionScreenEvent } from 'lightning/actions';
 import { NavigationMixin } from 'lightning/navigation';
 import  init  from '@salesforce/apex/OppLoseController.init';
-
-export default class OppLoseButton extends LightningElement {
-    @api
-    taskId;
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+export default class OppLoseButton extends NavigationMixin(LightningElement) {
+    @api recordId;
     opp;
-    stageName;
-    SAP_Send_OK;
-    Cnt_Lost_cancel_report;
-    Name;
-    Sales_assistant_name;
-    Sales_assistant_ID;
-    Manager_name;
-    Sales_manager_departmentID;
-    Sales_owner_buchang;
-    Sales_owner_buchangID;
-    OpportunityId;
+    StageName; //闃舵
+    SAP_Send_OK;//SAP涓婁紶(WIN)
+    Cnt_Lost_cancel_report;//绱姹囨�� (COUNT 璇环澶卞崟/鍙栨秷鎶ュ憡)
+    Name;//	涓氬姟鏈轰細鍚�
+    Sales_assistant_name;//璇环鍔╃悊
+    Sales_assistant_ID;//璇环鍔╃悊ID
+    Manager_name;//璇环鎵�鏈変汉鐨凜L6 缁忕悊绾�
+    Sales_manager_departmentID;//璇环鎵�鏈変汉鐨凜L6 缁忕悊绾D
+    Sales_owner_buchang;//璇环鎵�鏈変汉鐨� CL5 鎬荤洃绾�
+    Sales_owner_buchangID;//璇环鎵�鏈変汉鐨凜L5 缁忕悊绾D
+    OpportunityId; //浠诲姟 璇环
     task;
-
-    connectedCallback(){
-        console.log(this.taskId);
-        init({
-            taskId: this.taskId
-        }).then(result => {
-            console.log(result);
-            if (result != null) {
-                
-                this.IsLoading = false;
-                this.opp = result.opp;
-                this.stageName = result.stageName;
-                this.SAP_Send_OK = result.SAP_Send_OK;
-                this.Cnt_Lost_cancel_report = result.Cnt_Lost_cancel_report;
-                this.Name = result.Name;
-                this.Sales_assistant_name = result.Sales_assistant_name;
-                this.Sales_assistant_ID = result.Sales_assistant_ID;
-                this.Manager_name = result.Manager_name;
-                this.Sales_manager_departmentID = result.Sales_manager_departmentID;
-                this.Sales_owner_buchang = result.Sales_owner_buchang;
-                this.Sales_owner_buchangID = result.Sales_owner_buchangID;
-                this.OpportunityId = result.OpportunityId;
-                this.task = result.task;
-
-                this.changeContractType();
-                this.dispatchEvent(new CloseActionScreenEvent());
-                // window.location.reload();
+    taskStatusOne;
+    reId;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference){
+        if(currentPageReference){
+            const urlValue=currentPageReference.state.recordId;
+            if(urlValue){
+                let str=`${urlValue}`;
+                this.recordId=str;
             }
-        }).catch(error => {
-            console.log("error");
-            console.log(error);
-        }).finally(() => {
-            
-        });        
+        }
+    }
+    connectedCallback(){
+        
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+        console.log(this.recordId);
+        init({
+            taskId: this.recordId
+        }).then(result => {
+            console.log("==========================");
+            console.log(result);
+            this.IsLoading = false;
+            this.opp = result.opp;
+            this.StageName = result.StageName;
+            this.SAP_Send_OK = result.SAP_Send_OK;
+            this.Cnt_Lost_cancel_report = result.Cnt_Lost_cancel_report;
+            this.Name = result.Name;
+            this.Sales_assistant_name = result.Sales_assistant_name;
+            this.Sales_assistant_ID = result.Sales_assistant_ID;
+            this.Manager_name = result.Manager_name;
+            this.Sales_manager_departmentID = result.Sales_manager_departmentID;
+            this.Sales_owner_buchang = result.Sales_owner_buchang;
+            this.Sales_owner_buchangID = result.Sales_owner_buchangID;
+            this.OpportunityId = result.OpportunityId;
+            this.taskStatusOne = result.taskStatusOne;
+            this.task = result.task;
+            this.reId=result.reId;
+            this.changeContractType();
+        })      
     }
 
     changeContractType(){
         if(this.StageName != '寮曞悎' && this.StageName != '璇环'){
-            alert('鐘舵��1: '+ this.StageName + '銆佷笉鑳藉仛 澶卞崟 浜嗭紒');
+            // alert('鐘舵��1: '+ this.StageName + '銆佷笉鑳藉仛 澶卞崟 浜嗭紒');
+            this.showToast("鐘舵��1:" + this.StageName + "銆佷笉鑳藉仛 澶卞崟 浜嗭紒","error");
+            return;
         }
         else if(this.SAP_Send_OK == '1'){
-            alert('宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒');
+            // alert('宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒');
+            this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒","error");
+            return;
         }
-        else if(this.Cnt_Lost_cancel_report__c > 0){
-            alert('璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒');
+        else if(this.Cnt_Lost_cancel_report > 0){
+            // alert('璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒');
+            this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
+            return;
              // window.location.reload();
         }else{
-            location.href =
-            '/a1U/e?retURL=%2F' + this.OpportunityId + 
-            '&RecordType=01210000000R4hM' +
-            '&CF00N10000004lbGT={!URLENCODE('+this.Name+')}' +
-            '&CF00N10000004lbGT_lkid=' + this.OpportunityId + 
+            var url = '/lightning/n/PCLLostReportPageLwc#pageStatus=Create&oppId=' + this.OpportunityId + '&lostType=澶卞崟';
+            location.href = url;
+            // const defaultValues = encodeDefaultFieldValues({
+            //     Opportunity__c:this.OpportunityId,
+            //     Sales_assistant__c:this.Sales_assistant_ID,
+            //     Manager_sales__c:this.Sales_manager_departmentID,
+            //     Buchang_sales__c:this.Sales_owner_buchangID
+            // });
+            // this[NavigationMixin.Navigate]({
+            //     type: 'standard__objectPage',
+            //     attributes: {
+            //         objectApiName: 'Lost_cancel_report__c',
+            //         actionName: 'new'
+            //     },
+            //     state: {
+            //         // nooverride: '1',
+            //         defaultFieldValues: defaultValues,
+            //         recordTypeId: this.reId
+            //     }
+            // });
 
-            '&CF00N10000006QShg={!URLENCODE('+this.Sales_assistant_name+')}' +
-            '&CF00N10000006QShg_lkid={!URLENCODE('+this.Sales_assistant_ID+')}' +
-            '&CF00N10000006QShq={!URLENCODE('+this.Manager_name+')}' +
-            '&CF00N10000006QShq_lkid={!URLENCODE('+this.Sales_manager_departmentID+')}' +
-            '&CF00N10000006QShb={!URLENCODE('+this.Sales_owner_buchang+')}' +
-            '&CF00N10000006QShb_lkid={!URLENCODE('+this.Sales_owner_buchangID+')}' +
-            '';
+            // location.href =
+            // '/a1U/e?retURL=%2F' + this.OpportunityId + 
+            // '&RecordType=' + this.reId+
+            // // '&CF00N10000004lbGT='+ this.Name +
+            // '&Opportunity__c=' + this.OpportunityId + 
+            // // '&CF00N10000006QShg='+this.Sales_assistant_name+
+            // '&Sales_assistant__c='+this.Sales_assistant_ID +
+            // // '&CF00N10000006QShq='+this.Manager_name +
+            // '&Manager_sales__c='+this.Sales_manager_departmentID +
+            // // '&CF00N10000006QShb='+this.Sales_owner_buchang +
+            // '&Buchang_sales__c='+this.Sales_owner_buchangID +
+            // '';
+            this.dispatchEvent(new CloseActionScreenEvent());
         }
     }
+    showToast(msg,type) {
+        if(type == 'success'){
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type
+            });
+            // this.updateRecordView(this.recordId);
+            this.dispatchEvent(event);
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }else{
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type,
+                mode: 'sticky'
+            });
+            // this.updateRecordView(this.recordId);
+            this.dispatchEvent(event);
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }
+    }
+}
 
-}
\ No newline at end of file
+
+
+// var sql = "select Sales_owner_buchangID__c,Manager_name__c,Sales_owner_buchang__c,Sales_manager_departmentID__c,name,Sales_assistant_name__c,Sales_assistant_ID__c,id,StageName,SAP_Send_OK__c,Cnt_Lost_cancel_report__c,Bidding_Project_Name_Bid__c from Opportunity where id = '{!task__c.OpportunityIdId__c}'";
+// var opp_recourd = sforce.connection.query(sql);
+// var opp = opp_recourd.getArray("records")[0];
+// if (opp.StageName != '寮曞悎'
+// && opp.StageName != '璇环'
+// ) {
+// alert("鐘舵��1:" + opp.StageName + "銆佷笉鑳藉仛 澶卞崟 浜嗭紒");
+// }
+// else if (opp.SAP_Send_OK__c == '1') {
+// alert("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒");
+// }
+// else if (opp.Cnt_Lost_cancel_report__c > 0) {
+// alert("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒");
+// }
+
+
+// else {
+// location.href =
+// '/a1U/e?retURL=%2F{!task__c.OpportunityIdId__c}' +
+// '&RecordType=01210000000R4hM' +
+// '&CF00N10000004lbGT={!URLENCODE('+opp.name+')}' +
+// '&CF00N10000004lbGT_lkid={!task__c.OpportunityIdId__c}' +
+
+// '&CF00N10000006QShg={!URLENCODE('+opp.Sales_assistant_name__c+')}' +
+// '&CF00N10000006QShg_lkid={!URLENCODE('+opp.Sales_assistant_ID__c+')}' +
+// '&CF00N10000006QShq={!URLENCODE('+opp.Manager_name__c+')}' +
+// '&CF00N10000006QShq_lkid={!URLENCODE('+opp.Sales_manager_departmentID__c+')}' +
+// '&CF00N10000006QShb={!URLENCODE('+opp.Sales_owner_buchang__c+')}' +
+// '&CF00N10000006QShb_lkid={!URLENCODE('+opp.Sales_owner_buchangID__c+')}' +
+// '';
+// }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.html b/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.html
index 1c189aa..de59045 100644
--- a/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.html
+++ b/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.html
@@ -58,7 +58,13 @@
         <div if:true={BCIsShow}>
           <label class="slds-form-element__label" for="select-02">琛ュ厖璇存槑:</label>
           <div class="slds-form-element__control">
-            <input type="text" id="text-input-id-3" placeholder="璇疯緭鍏ヨˉ鍏呰鏄�" required="" onchange={handleBCSMFn} value={InspectData.RepsExtraContent__c} aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" />
+            <template if:true={InspectData.RepsExtraContent__c}>
+              <input type="text" id="text-input-id-3" placeholder="璇疯緭鍏ヨˉ鍏呰鏄�" required="" onchange={handleBCSMFn} value={InspectData.RepsExtraContent__c} aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" />
+            </template>
+            <template if:false={InspectData.RepsExtraContent__c}>
+              <input type="text" id="text-input-id-4" placeholder="璇疯緭鍏ヨˉ鍏呰鏄�" required="" onchange={handleBCSMFn}  aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" />
+            </template>
+            <!-- <input type="text" id="text-input-id-3" placeholder="璇疯緭鍏ヨˉ鍏呰鏄�" required="" onchange={handleBCSMFn} value={InspectData.RepsExtraContent__c} aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" /> -->
           </div>
           <!-- <div class="slds-form-element__help" id="error-message-unique-id2" if:true={qtLyFlag}>琛ュ厖璇存槑涓嶈兘涓虹┖</div> -->
         </div>
@@ -66,7 +72,12 @@
         <div if:true={YSJEIsShow}>
           <label class="slds-form-element__label" for="select-02">娑夊強棰勭畻閲戦:</label>
           <div class="slds-form-element__control">
-            <input type="text" id="text-input-id-5" placeholder="璇疯緭鍏ユ秹鍙婇绠楅噾棰�" required="" onchange={handleYSJEFn} value={InspectData.InvolveBudgetAmount__c} aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" if:false={IsYSJE} />
+            <template if:true={InspectData.InvolveBudgetAmount__c}>
+              <input type="text" id="text-input-id-5" placeholder="璇疯緭鍏ユ秹鍙婇绠楅噾棰�" required="" onchange={handleYSJEFn} value={InspectData.InvolveBudgetAmount__c} aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" if:false={IsYSJE} />
+            </template>
+            <template if:false={InspectData.InvolveBudgetAmount__c}>
+              <input type="text" id="text-input-id-6" placeholder="璇疯緭鍏ユ秹鍙婇绠楅噾棰�" required="" onchange={handleYSJEFn}  aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true" if:false={IsYSJE} />
+            </template>
           </div>
           <!-- <div class="slds-form-element__help" id="error-message-unique-id2" if:true={qtLyFlag}>琛ュ厖璇存槑涓嶈兘涓虹┖</div> -->
         </div>
diff --git a/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js b/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js
index b5ea9bb..c95bda2 100644
--- a/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js
+++ b/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js
@@ -1,13 +1,14 @@
-import { LightningElement, track } from 'lwc';
+import { LightningElement,api, track } from 'lwc';
 import GetInspectById from '@salesforce/apex/EnquiryNoBiddingController.GetInspectById';
 import SaveDataYB from '@salesforce/apex/EnquiryNoBiddingController.SaveDataYB';
 import ChangeDataYB from '@salesforce/apex/EnquiryNoBiddingController.ChangeDataYB';
 import GetIrresponsibleReason from '@salesforce/apex/EnquiryNoBiddingController.GetIrresponsibleReason';
-
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import CheckOwnerRequest from '@salesforce/apex/EnquiryNoBiddingController.CheckOwner';
-
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
 import GetTenderInformationById from '@salesforce/apex/EnquiryNoBiddingController.GetTenderInformationById';
-
+import { CloseActionScreenEvent } from 'lightning/actions';
 
 import GetDataById from '@salesforce/apex/EnquiryNoBiddingController.GetDataById';
 
@@ -30,6 +31,25 @@
 TongzhiIcon = 'standard:account'  //鎻愮ず鏄剧ず鐨勬爣绛�
 IsLeftStyle = ""  //鎻愮ず鏄剧ず鐨勬牱寮�
 BgColorStyle = ""
+showToast(msg,type) {
+    if(type == 'success'){
+      const event = new ShowToastEvent({
+        title: '',
+        message: msg,
+        variant: type
+      });
+      this.dispatchEvent(event);
+    }else{
+      const event = new ShowToastEvent({
+        title: '',
+        message: msg,
+        variant: type,
+        mode: 'sticky'
+    });
+    this.dispatchEvent(event);
+    }
+
+}
 Alert(content,error = false,left = false){
     this.SaveShowText = content;
     this.Tongzhishow = true;
@@ -72,23 +92,28 @@
         }
         return(false);
     }
-    ParamIdStr = '' //涓嶅簲鏍囩敵璇穒D
-    ParamOIdStr = '' //璇环ID
-    ParamPIdStr = '' //鎷涙姇鏍嘔D
+    @api ParamIdStr = ''; //涓嶅簲鏍囩敵璇穒D
+    @api ParamOIdStr = '';//璇环ID
+    @api ParamPIdStr = ''; //鎷涙姇鏍嘔D
 
     
     connectedCallback(){
+        Promise.all([
+            loadStyle(this, lwcCSS)
+           ]);
+        console.log('123456');
+        console.log(this.ParamOIdStr);
         this.OnLoading(true);
         
-        var paramId =  this.getQueryVariable('id');
-        var paramOId =  this.getQueryVariable('oid');
-        var paramTId =  this.getQueryVariable('tid');
+        // var paramId =  this.getQueryVariable('id');
+        // var paramOId =  this.getQueryVariable('oid');
+        // var paramTId =  this.getQueryVariable('tid');
         // paramId = 'a4Y1m0000000dhGEAQ';
         // paramOId = '0061000000QL9M4AAL';
 
-        this.ParamIdStr= paramId;
-        this.ParamOIdStr = paramOId;
-        this.ParamPIdStr = paramTId;
+        // this.ParamIdStr= paramId;
+        // this.ParamOIdStr = paramOId;
+        // this.ParamPIdStr = paramTId;
      
         debugger;
 
@@ -96,7 +121,7 @@
        
         // Opp_Bid__c | Bidding_Project_Name_BidId__c
 
-        if(this.ParamOIdStr !=undefined && this.ParamOIdStr!=false)
+        if(this.ParamOIdStr !='' && this.ParamOIdStr!=false)
         {
             GetDataById({Id:this.ParamOIdStr}).then(response=>{
                 var data = JSON.parse(response);
@@ -109,7 +134,10 @@
                 setTimeout(()=>{
                     this.OnLoading(false);
                 },1500);
-            })
+            }).catch(error=>{
+                console.log('error');
+                console.log(error);
+            });
         }
     }
 
@@ -237,7 +265,7 @@
     //鏁版嵁淇濆瓨鏂规硶
     saveFn(event,temp){
         if(!this.IsCheck){return;}
-
+        this.IsLoading = true;
         this.IsCheck = false;
         
         debugger;
@@ -262,18 +290,27 @@
             debugger;
 
             var IsInsert = this.InspectData.Id==undefined?"鏄�":"鍚�";
+            const closeEvent = new CustomEvent('closeaction', {
+                bubbles: true, // 鍏佽浜嬩欢鍐掓场鑷崇埗缁勪欢
+                composed: true, // 鍏佽浜嬩欢绌胯秺 Shadow DOM 鐣岄檺
+            });
             if (temp == 1) {
                 ChangeDataYB({JsonData:JSON.stringify(this.InspectData),Id:this.ParamOIdStr,IsInsert:IsInsert}).then((response)=>{
                     if (response.indexOf("鎴愬姛") != -1) {
-                        this.Alert("鎻愪氦鎴愬姛");
+                        // this.Alert("鎻愪氦鎴愬姛");
+                        this.showToast("鎻愪氦鎴愬姛","success");
                         this.DisabledSet();
-
+                        this.IsLoading = false;
                         this.IsCheck = true;
-
-
-                        window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
+                        setTimeout(() => {
+                            window.location = '/' + this.ParamOIdStr;
+                        }, 2000);
+                        this.dispatchEvent(closeEvent);
+                        // window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
                     }else{
-                        this.Alert(response,true);
+                        this.showToast(response,"error");
+                        this.IsLoading = false;
+                        // this.Alert(response,true);
                         this.IsCheck = true;
                     }
                 });
@@ -281,11 +318,19 @@
             {
                 SaveDataYB({JsonData:JSON.stringify(this.InspectData),Id:this.ParamOIdStr,IsInsert:IsInsert}).then((response)=>{
                     if (response=="鎴愬姛") {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
-                        window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
+                        // this.Alert("淇濆瓨鎴愬姛",false,true);
+                        this.showToast("淇濆瓨鎴愬姛","success");
+                        this.IsLoading = false;
+                        // window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
+                        setTimeout(() => {
+                            window.location = '/' + this.ParamOIdStr;
+                        }, 2000);
+                        this.dispatchEvent(closeEvent);
                         this.IsCheck = true;
                     }else{
-                        this.Alert(response,true);
+                        // this.Alert(response,true);
+                        this.showToast(response,"error");
+                        this.IsLoading = false;
                         this.IsCheck = true;
                     }
                 });
diff --git a/force-app/main/default/pages/CheckAllOlympusAsset.page b/force-app/main/default/pages/CheckAllOlympusAsset.page
index f52b4a8..6653502 100644
--- a/force-app/main/default/pages/CheckAllOlympusAsset.page
+++ b/force-app/main/default/pages/CheckAllOlympusAsset.page
@@ -1017,7 +1017,7 @@
                         <tr class="dataRow" id="tableData_L_{!Cnt_L}" 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="dataCellBorder1" style="width:20px" align="center">
-                                <apex:inputCheckbox id="rowCheck" value="{!eachAssetData.isCheck}" disabled="{!IF((internalAssetLocationLogin != 'All' && eachAssetData.assetQuertResult['Internal_asset_location__c'] != internalAssetLocationLogin), true, false)}" onchange="checkboxOnclick(); return false;" />
+                                <apex:inputCheckbox id="rowCheck" value="{!eachAssetData.isCheck}" disabled="{!IF(columnLeftRWMap[leftApiList[0][0]]=='r' || (internalAssetLocationLogin != 'All' && eachAssetData.assetQuertResult['Internal_asset_location__c'] != internalAssetLocationLogin), true, false)}" onchange="checkboxOnclick(); return false;" />
                                 <apex:inputHidden id="canChange" />
                             </td>
                             <apex:variable value="{!0}" var="cnt2" />
diff --git a/force-app/main/default/triggers/ContentDocumentLink.trigger b/force-app/main/default/triggers/ContentDocumentLink.trigger
index 2d1bd06..442a098 100644
--- a/force-app/main/default/triggers/ContentDocumentLink.trigger
+++ b/force-app/main/default/triggers/ContentDocumentLink.trigger
@@ -2,6 +2,7 @@
     if(StaticParameter.ContentDocumentLink == false){
         return;
     }
+
     if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
         return;
     }
@@ -60,6 +61,7 @@
     List<String> rentaldeleteApplyFaultIds = new List<String>();
     Map<String,List<Id>> deleteImages = new Map<String,List<Id>>();
     // sx 20230210end 澶囧搧鍊熷嚭鐢宠鏁呴殰鎶ュ憡闄勪欢鎻愬彇
+    Set<Id> docidList = new Set<Id>();
     if (Trigger.isBefore && Trigger.isInsert) {
         for (ContentDocumentLink link : Trigger.new) {
             if(String.valueOf(link.LinkedEntityId).startsWith(System.Label.Oppor_sepKey)){
@@ -69,6 +71,23 @@
             if(String.valueOf(link.LinkedEntityId).startsWith('a3Z')){
                 opportunityFileOrderIds.add(link.LinkedEntityId);
             }
+            docidList.add(link.ContentDocumentId);
+        }
+    }
+    if (Trigger.isAfter && Trigger.isInsert) {
+        for (ContentDocumentLink link : Trigger.new) {
+            docidList.add(link.ContentDocumentId);
+        }
+    }
+    ContentVersion ver = new ContentVersion();
+    System.debug('docidList.size=>' + docidList.size());
+    if(docidList.size() > 0){
+        ver = [select FileType,TextPreview from ContentVersion where ContentDocumentId in: docidList limit 1];
+        System.debug('TextPreview=>' + ver.TextPreview);
+        System.debug('FileType=>' + ver.TextPreview);
+        if(ver.FileType == 'SNOTE'){
+            System.debug('鍙伓鐨勫娉紒锛侊紒');
+            return;
         }
     }
     if (Trigger.isBefore && Trigger.isDelete) {
@@ -401,8 +420,11 @@
                 System.debug(Trigger.isBefore+'闄堜含姝�');
                 return;
             }else{
-                System.debug(Trigger.isBefore+'姝�');
-                DeleteReIds.add(link.LinkedEntityId);
+                if(link.LinkedEntityId.getSObjectType().getDescribe().getName() != 'User'){
+                    DeleteReIds.add(link.LinkedEntityId);
+                }
+                // System.debug(Trigger.isBefore+'姝�');
+                // DeleteReIds.add(link.LinkedEntityId);
             }
         }
     }
diff --git a/force-app/main/default/triggers/ContentDocumentTrigger.trigger b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
index dba11fa..ec7fc71 100644
--- a/force-app/main/default/triggers/ContentDocumentTrigger.trigger
+++ b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
@@ -322,6 +322,7 @@
                 for(Account_Delay_Apply__c accapp : adaList){                    
                     if(Trigger.isUpdate && Trigger.isBefore){
                         for(ContentDocument doc : Trigger.New){
+                            System.debug('鐘舵��1=銆�' + accapp.Is_Active__c);
                             if(accapp.Is_Active__c != '鑽夋涓�'){
                                 doc.addError('闈炶崏妗堜腑锛岄檮浠朵笉鍏佽缂栬緫銆�');
                 
@@ -332,6 +333,7 @@
                     if(Trigger.isDelete && Trigger.isBefore){
                         for(ContentDocument doc : Trigger.old){
                             // if(attMap.containsKey(att.ParentID) && accapp.Is_Active__c != '鑽夋涓�'){
+                                System.debug('鐘舵��2=銆�' + accapp.Is_Active__c);
                             if(accapp.Is_Active__c != '鑽夋涓�'){
                                 doc.addError('闈炶崏妗堜腑锛岄檮浠朵笉鍏佽鍒犻櫎銆�');
                 

--
Gitblit v1.9.1