From 4488f711dbc01a8db6753907cae2ef4021dede68 Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期三, 13 十二月 2023 16:30:27 +0800
Subject: [PATCH] 修改前备份

---
 force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js | 4128 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 3,272 insertions(+), 856 deletions(-)

diff --git a/force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js b/force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js
index 707ee4e..deb308c 100644
--- a/force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js
+++ b/force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js
@@ -1,869 +1,3285 @@
-import { LightningElement, track, wire } from 'lwc';
-import jQuery from '@salesforce/resourceUrl/jquery183minjs';
-export default class lexSINewQuoteEntry extends LightningElement {
-	renderedCallback() {
-        Promise.all([loadScript(this, jQuery)])
-            .then(() => {
-                // jquery183minjs宸插姞杞芥垚鍔�
-                const $ = jQuery.noConflict();
-                // 鍙互鍦ㄨ繖閲屼娇鐢╦query
-            })
-            .catch(error => {
-                console.error('Error ====> ', error);
-            })
+import { LightningElement,wire,track,api} from 'lwc';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import Quoto_No from '@salesforce/label/c.Quoto_No';
+import Quoto_Name from '@salesforce/label/c.Quoto_Name';
+import HP_Name from '@salesforce/label/c.HP_Name';
+import Department_Name from '@salesforce/label/c.Department_Name';
+import Currency from '@salesforce/label/c.Currency';
+import Total_Price from '@salesforce/label/c.Total_Price';
+import Contact_Price from '@salesforce/label/c.Contact_Price';
+import Forecast_Amounts from '@salesforce/label/c.Forecast_Amounts';
+import Sales_Root from '@salesforce/label/c.Sales_Root';
+import Status_Update from '@salesforce/label/c.Status_Update';
+import Set_Product from '@salesforce/label/c.Set_Product';
+import Excel_Import from '@salesforce/label/c.Excel_Import';
+import deleteLabel from '@salesforce/label/c.deleteLabel';
+import Cost from '@salesforce/label/c.Cost';
+import Calculate from '@salesforce/label/c.Calculate';
+import AdjustAmount from '@salesforce/label/c.AdjustAmount';
+import Quote_Adjustment from '@salesforce/label/c.Quote_Adjustment';
+import Amount from '@salesforce/label/c.Amount';
+import Sales_Profit from '@salesforce/label/c.Sales_Profit';
+import Percent from '@salesforce/label/c.Percent';
+import Sales_Name1 from '@salesforce/label/c.Sales_Name1';
+import Sales_Name2 from '@salesforce/label/c.Sales_Name2';
+import Error_Message33 from '@salesforce/label/c.Error_Message33';
+import Opp_Button from '@salesforce/label/c.Opp_Button';
+import QuoteDecision_Button from '@salesforce/label/c.QuoteDecision_Button';
+import Copy_Detail from '@salesforce/label/c.Copy_Detail';
+import Quote_Print from '@salesforce/label/c.Quote_Print';
+import Detail_Price from '@salesforce/label/c.Detail_Price';
+import Detail_Sum from '@salesforce/label/c.Detail_Sum';
+import Total_Discount_Percent from '@salesforce/label/c.Total_Discount_Percent';
+import Total_Discount_Amount from '@salesforce/label/c.Total_Discount_Amount';
+import Row_Total_Sum from '@salesforce/label/c.Row_Total_Sum';
+import Contract_Breakdown from '@salesforce/label/c.Contract_Breakdown';
+import Print_HPName from '@salesforce/label/c.Print_HPName';
+import Print_Button from '@salesforce/label/c.Print_Button';
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+import QuoteEntryMaxLine2 from '@salesforce/label/c.QuoteEntryMaxLine2';
+import Sales_Outlet from '@salesforce/label/c.Sales_Outlet';
+import OCM_Direct from '@salesforce/label/c.OCM_Direct';
+import Price_Valid_Period from '@salesforce/label/c.Price_Valid_Period';
+import Message_001 from '@salesforce/label/c.Message_001';
+import ImportText from '@salesforce/label/c.ImportText';
+import Tab_Text from '@salesforce/label/c.Tab_Text';
+import Paste_IE from '@salesforce/label/c.Paste_IE';
+import { CurrentPageReference } from "lightning/navigation";
+import Admin from '@salesforce/label/c.ProfileId_SystemAdmin';
+import Admin2 from '@salesforce/label/c.ProfileId_SystemAdmin2';
+import SI2M3ID from '@salesforce/label/c.SI_2M3_ID';
+import ProfSystAdmin from '@salesforce/label/c.ProfileId_SystemAdmin';
+import selectQuoteById from '@salesforce/apex/lexSINewQuoteEntryController.selectQuoteById';
+import selectQuoteListLineItemCount from '@salesforce/apex/lexSINewQuoteEntryController.selectQuoteListLineItemCount';
+import selectQuoteLineItem from '@salesforce/apex/lexSINewQuoteEntryController.selectQuoteLineItem';
+import selecUser from '@salesforce/apex/lexSINewQuoteEntryController.selecUser';
+import QuotCalfagAss from '@salesforce/apex/lexNewQuoteEntryController.QuotCalfagAss';
+import selectOpportunityById from '@salesforce/apex/lexSINewQuoteEntryController.selectOpportunityById';
+import selectAccountById from '@salesforce/apex/lexSINewQuoteEntryController.selectAccountById';
+import getPicklistValues from '@salesforce/apex/lexSINewQuoteEntryController.getPicklistValues';
+import SaveQuote from '@salesforce/apex/lexSINewQuoteEntryController.SaveQuote';
+import Print from '@salesforce/apex/lexSINewQuoteEntryController.Print';
+import QuoteDecision from '@salesforce/apex/lexSINewQuoteEntryController.QuoteDecision';
+import serContact from '@salesforce/apex/lexSINewQuoteEntryController.serContact'
+import serSetContact from '@salesforce/apex/lexSINewQuoteEntryController.serSetContact'
+import setProductEntry from '@salesforce/apex/lexSINewQuoteEntryController.setProductEntry'
+import excelImport from '@salesforce/apex/lexSINewQuoteEntryController.excelImport'
+import getModulus from '@salesforce/apex/lexSINewQuoteEntryController.getModulus'
+import submitOppoApplyStock from '@salesforce/apex/lexSINewQuoteEntryController.submitOppoApplyStock'
+import QuoteConfirm from '@salesforce/apex/lexSINewQuoteEntryController.QuoteConfirm'
+import selectProById from '@salesforce/apex/lexSINewQuoteEntryController.selectProById'
+import getquoDes from '@salesforce/apex/lexSINewQuoteEntryController.getquoDes'
+import getProduct2 from '@salesforce/apex/NewQuoteEntryWebService.getProduct2';
+import updateOTCodeweb from '@salesforce/apex/NewQuoteEntryWebService.updateOTCode';
+import getQuoteLineItem from '@salesforce/apex/NewQuoteEntryWebService.getQuoteLineItem';
+import Message_Please_Save_Quote from '@salesforce/label/c.Please_Save_Quote';
+import Message_Check_Your_Clipboard from '@salesforce/label/c.Check_Your_Clipboard';
+import SelectAllDataDiscount from '@salesforce/apex/QuoteTrialController.selectAllDataDiscount';
+import GetPromotionDefalut from '@salesforce/apex/QuoteTrialController.GetPromotionDefalut';
+import GetPromotionPromotionSearch from '@salesforce/apex/QuoteTrialController.GetPromotionPromotionSearch';
+import GetNormalProductSearch from '@salesforce/apex/QuoteTrialController.GetNormalProductSearch';
+import GetAuthorizerSearch from '@salesforce/apex/QuoteTrialController.GetAuthorizerSearch';
+import GetSearchProductById from '@salesforce/apex/QuoteTrialController.GetSearchProductById';
+import saveAllDataProduct from '@salesforce/apex/QuoteTrialController.saveAllDataProduct';
+import SelectAllDataProduct from '@salesforce/apex/QuoteTrialController.selectAllDataProduct';
+import GetQuoteData from '@salesforce/apex/QuoteTrialController.GetQuoteData';
+import GetAgencyRName from '@salesforce/apex/QuoteTrialController.GetAgencyRName';
+import selectUpdateFiexedpriceData from '@salesforce/apex/QuoteTrialController.selectUpdateFiexedpriceData';
+import selectUpdateQuoteLineItemData from '@salesforce/apex/QuoteTrialController.selectUpdateQuoteLineItemData';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {localParseInt,toNum,initDataTableToBeproductConfig,saveEvoluationLogic,oppInfosave,quoLineItemsave,filterNameoptionList,initDataSetProductTablefig,quoteTotalPriceActionLogic,CheckForCost,actState,MarkRed,EstimationL,resultFlag,
+toNumComma,localParseFloat,NewQcopyLogic,productCompareLogic,bflag,jzProductsearchLogic,additionaljzProductLogic,initDataProductTablefig,checkNMPA,saveQuotel,CheckForListPrice,calGuranteePeriodLogic,initOpportunityById,enableSalesExp,nafgExp,
+additionabuttonLoc,DataStatus,InitializeProductAssignment,PriceStatusUpdateLogic,newQuoteFlagex,calGuranteeAllFieldsLogic,MultiYearWarrantyTotalPriceExport,newQuoteFlagExp,AlertForCFDA,UnitPriceUpdateLogic,DisAmountfunctionc,enableContractExp,
+PrintCustomerNameoptionsvlue,selection_hpExp,options_hpflgExp,initquoassignment,initquoassignmentcopy,salesProfit1Logic,salesCalculation1Logic,salesProfit2Logic,salesCalculation2Logic,SubtotalupdateLogic,alfExp,IsQuoteTrialExp,displayFlgExp,
+initquocheck,lookMapE,quoteAgencyTotalPriceActionLogic,calPriceAllLogic,QuoteAdjustLogic,quoExp,AgencyDiscountCalculation1Logic,onsaveToBeproductLoc,fagExp,PrintButtonLoc,alertExp,setOCMAmountc,initOpportunityById2,decisionlol,flg,checkch,
+saverebackloc,DisCalculationfunctionLoc,quoteTotalPriceLoc,calUnitPriceTotalLoc,ListPriceTotalExp,unitPriceTotalExp,pageArrangeLoc,openQuotePage,errorflg,StrExp,quoteinit,Savebuttondetermine,submitOppoApplyStockJsLogic,QuoteConfirmJsExp,
+SbuttonExp,sapbuttonExp,pbuttonflgExp,selectQuoteLineExp,initQuoteLineItemcheck,productStatusUpdatedExp,Saleslet}  from "./lexSINexQuoteEntryUtil.js";
+import {arrTempsss,arrProductTempsss,initDataTableProduct2,initDataTable2,initSearchForm2,getQueryVariable,ChangeFiexedData,GetUUID,initDataTableDefault2,
+initSearchFormDefalt2,initDataTableFixedPrice2,initDataTableDiscount2,initDataTableSpecial2,initSearchFormFix2,initDataTableFix2,CompareDataL,isChangeExp,
+initDataTableOtherData2,initDataTableCommonly2,ProductAssignmentSelect,ProductSelected,UnselectedScheme,SelectedScheme,commonlyDiscountLogic,ChangeProductData,
+PriceConsolidation,ReplacementUnitPriceLogic,ConsolidatedDiscountDetailsLogic,ConsolidatedDiscountPolicyLogic,QTcssE,initquoT,buttonIsShowE,initDTFP,initDTD,initDTOD,initDTC,
+addOfferLogic,ReverseCalculationModifyDiscountLogic,HeTongPriceComputeLogic,InverseCalculationTiShi,ContractPriceComputeLogic,GeneralDiscountContractSummaryLogic,handleSaveFixedPriceLogic,
+SpecialSavesChangePartLogic,NewDefaultDatass,AddProductDatass,jzDataFixedPriceTemps,jzDataDiscountTemps,updatesNumsLogic,updateCDLogic,DeftCopyQtyLists,
+countListAndNodLogic,jzDataDefaultExp,jzDataProductExp,jzDataFixedPriceExp,jzDataDiscountExp,comparisonUniqueKeyLogic,SearchProductByIdLogic,jzDataDefaultCopyQuantityListExp,AddNumsLogic,CompareFullDataExp,SelectedFnCommonlyLogic,
+ComputeDataPromotionLogic,newArrsTemp3Exp,newArrsTemp4Exp,jzDataDefaultCopyExp,ComputeDataNormalProductLogic,ComputeDiscountAuthorizerLogic,newArrsTempExp,newArrsTemp2Exp,MergeDuplicateSchemesLogic,delectTableDiscountTempLogic,
+handleSaveDiscountLogic,booleanExp,boolean2Exp,boolean3Exp,newDataExp,newData2Exp,newData3Exp,editnewDateExp,GuaranteeDiscount__cZuiXiaoExp,NormalDiscount__cZuiXiaoExp,HeTongTotalExp,SelectedFnDataFixedPriceExp,deleteFixedPriceLogic,
+CompareFullDataTempExp,jzDataDefaultNotChangeExp,DeleteChangesFnLogic,deleteFixedPriceTempLogic,GetSearchProductByIdLogic,iflagExp,getTableDataCommonlyLogic,idsExp,DeleteIsChangelogicExp,DeleteIsChangesFnjiage,falgExp,
+DeleteIsChangesFnzhekou,SaveGeneralDiscountLogic,DeleteSchemeMatchingLogic,savecountLogic,ComparePushDataLogic,newTempExp,saveAllDataProductFnChuanshen,saveAllDataProductFnPanduan,ifnullExp} from "./lexSIquoteTrialUtil.js";
+
+
+
+export default class LexSINewQuoteEntry extends LightningElement {
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+            const urlValue = currentPageReference.state.fragment;
+            if (urlValue) {
+                this.location = urlValue;
+            }
+        }
+    }
+    location = '';
+    @track
+    pricePolicyflag1 = false;
+    @track
+    ImportText = ImportText;
+    @track
+    Tab_Text = Tab_Text;
+    @track
+    Paste_IE = Paste_IE;
+    @track
+    QuotoNo = Quoto_No;
+    @track
+    QuotoName = Quoto_Name;
+    @track
+    HPName = HP_Name;
+    @track
+    DepartmentName = Department_Name;
+    @track
+    Currency = Currency;
+    @track
+    TotalPrice = Total_Price;
+    @track
+    ContactPrice = Contact_Price;
+    @track
+    ForecastAmounts = Forecast_Amounts;
+    @track
+    SalesRoot = Sales_Root;
+    @track
+    StatusUpdate = Status_Update;
+    @track
+    SetProduct = Set_Product;
+    @track
+    ExcelImport = Excel_Import;
+    @track
+    deleteLabel = deleteLabel;
+    @track
+    Cost = Cost;
+    @track
+    Calculate = Calculate;
+    @track
+    AdjustAmount = AdjustAmount;
+    @track
+    QuoteAdjustment = Quote_Adjustment;
+    @track
+    Amount = Amount;
+    @track
+    SalesProfit = Sales_Profit;
+    @track
+    Percent = Percent;
+    @track
+    SalesName1 = Sales_Name1;
+    @track
+    Sales_Name2 = Sales_Name2;
+    @track
+    Opp_Button = Opp_Button;
+    @track
+    QuoteDecision_Button = QuoteDecision_Button;
+    @track
+    Copy_Detail = Copy_Detail;
+
+    @track
+    Quote_Print = Quote_Print;
+    @track
+    Detail_Price = Detail_Price;
+    @track
+    Detail_Sum = Detail_Sum;
+    @track
+    Total_Discount_Percent = Total_Discount_Percent;
+    @track
+    Total_Discount_Amount = Total_Discount_Amount;
+    @track
+    Row_Total_Sum = Row_Total_Sum;
+    @track
+    Contract_Breakdown = Contract_Breakdown;
+    @track
+    Print_HPName = Print_HPName;
+    @track
+    Print_Button = Print_Button;
+    @track
+    QuotCalfag = false;
+
+    quoteEntryMaxLine = QuoteEntryMaxLine2;
+    // 鍏ㄥ眬鍔犺浇鏍囪瘑 start
+    @track
+    IsLoading = false;
+    OnLoading(flag) {
+        this.IsLoading = flag;
+    }
+    // 鍏ㄥ眬鍔犺浇鏍囪瘑 end
+
+    //椤甸潰鍒濆鍖栨柟娉�
+    //鍒濆鍖栨椂璋冪敤
+    stylesLoaded = false;
+    renderedCallback(){ 
+        if (!this.stylesLoaded) {
+            Promise.all([loadStyle(this, WrappedHeaderTable)])
+                .then(() => {
+                    this.stylesLoaded = true;
+                })
+                .catch((error) => {
+                });
+        }
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+    }
+    //鎶ヤ环瀵硅薄
+    @track
+    quo = {Installation_location__c:'',QuotationChange__c:''};
+    //璇环瀵硅薄
+    @track
+    oppInfo ={};
+    //鑷畾涔夌粨鏋�
+    @track
+    qb = {};
+    @track
+    hidden = false;
+    //鎴愭湰
+    hidden_Stocking_Price = '';
+    //璇环Id
+    oppId = '';
+    //鎶ヤ环Id
+    quoId = '';
+    //鏄惁璺宠繃鎶ヤ环璁$畻鏍囪瘑
+    SkipQuotefilg = false;
+    //澶嶅埗鎶ヤ环Id
+    copyid = '';
+    //鍐呭璐�
+    trade = '';
+    //鐩撮攢缁忛攢鍟嗘爣璇�
+    enableSales;
+    //鍒ゆ柇鐗规畩缁忛攢鍟嗕环鏍兼樉绀烘潈闄愭爣璇�
+    displayFlg;
+    //鐗规畩缁忛攢鍟嗕环鏍兼樉绀烘潈闄�
+    viewSpecialAgencyAmout
+    //褰撳墠鐧诲綍鐢ㄦ埛
+    User;
+    //鎶ヤ环淇敼鏉冮檺鏍囪瘑
+    verified;
+    //涓婁紶璁㈠崟鏉冮檺鏍囪瘑
+    specialAuthority;
+    //璇环浜у搧鎴愭湰鍙傜収鏉冮檺鏍囪瘑
+    displayCost;
+    //init鏌ヨ璇环鐩稿叧鏍囪瘑 start
+    QuoteDecision;
+    QuoteDecide;
+    QuoteSapSented;
+    QuoteCorrect;
+    @track
+    enableContract;
+    productStatusUpdated =false;
+    //鍚堝悓淇濅慨鏈燂紙骞达級鍏ㄥ眬
+    quoteGurantee_Period;
+    //鍙栨秷甯傚満澶氬勾淇濅慨鍏ㄥ眬
+    quotemultiYearWarranty;
+    //缁忛攢鍟嗗垵濮嬪寲鏃跺浠� start
+    agency1Name;
+    agency2Name;
+    //缁忛攢鍟嗗垵濮嬪寲鏃跺浠� end
+    //鏁版嵁鏄惁鍙戠敓鍙樺寲鏍囪瘑
+    newQuoteFlag = false;
+    //鐘舵�佹洿鏂�
+    productStatusUpdated = false;
+    //鏌ヨ璇环鑾峰彇瀹㈡埛Id
+    accountid;
+    //鎵撳嵃鏍囪瘑
+    print_buttonflg = false;
+    //decide鎸夐挳鏍囪瘑
+    Decision_button = false;
+    sap_button;
+    //save鍜宒ecide鎸夐挳鏍囪瘑
+    Save_button = false;
+    Decisiontag = false;
+    //缁忛攢鍟嗕竴鍒╂鼎鏄剧ず
+    Salesprofit1value;
+    //缁忛攢鍟嗕簩鍒╂鼎鏄剧ず
+    Salesprofit2value;
+    //缁忛攢鍟嗕竴鐧惧垎姣旀樉绀�
+    SalesCalculation1value
+    //缁忛攢鍟嗕簩鐧惧垎姣旀樉绀�
+    SalesCalculation2value
+    //闅愯棌澶氬勾淇濅慨浠锋牸鍚堣
+    hidden_MultiYearWarrantyTotalPrice
+    //缁忛攢鍟嗘姌鎵�
+    WinOrDecideAlert;
+    //澶囦唤鍒濆鍖栨椂鐨勬姤浠疯椤圭洰
+    CheckItem;
+    Save_button1 = 0;
+    CSVflag = true;
+    UnConfirmQuote = false;
+    //鍒濆鍖栨柟娉�
+    ifquocom = false;
+    acts = false;
+    actL = [];
+    connectedCallback() {
+        this.tobeflag = false;
+        this.quoteEntryMaxLine = Number(this.quoteEntryMaxLine);
+        debugger
+        this.SkipQuotefilg = false;
+        var quoteflg = true;
+        this.displayFlg = true;
+        this.WinOrDecideAlert = false;
+        this.OnLoading(true);
+        if(this.quoId == ''){
+            this.quoId =  getQueryVariable('Id',this.location);
+            this.CSVflag = this.quoId?false:true;
+        }
+        if(this.copyid == ''){
+            this.copyid =  getQueryVariable('copyid',this.location);
+        }
+        if(this.oppId == ''){
+            this.oppId =  getQueryVariable('oppid',this.location);
+        }
+        this.nafg = resultFlag(this.nafg,'');
+        QuotCalfagAss().then(r=>{
+            this.QuotCalfag = r;
+        });
+        selectQuoteListLineItemCount({quoId:this.quoId,oppId:this.oppId,copyid:this.copyid}).then(quoteByopp=>{
+            debugger
+            if(this.oppId){
+                if(this.copyid){
+                    this.quoId =  this.copyid;
+                    this.CSVflag = this.quoId?false:true;
+                }
+            }
+            if(quoteByopp.length > 0){
+                if (!this.oppId) {
+                    this.oppId = quoteByopp[0].OpportunityId;
+                }
+            }
+            selecUser().then(Userobj=>{
+                this.User = Userobj;
+                console.warn('aa '+ Userobj.length);
+                if(JSON.stringify(Userobj) != "{}"){
+                    this.verified =this.User.Quote_Correct__c;
+                    this.specialAuthority = this.User.Quote_Special_Operation__c;
+                    this.displayCost = this.User.Cost_Referable__c;
+                    this.viewSpecialAgencyAmout = this.User.ViewSpecialAgencyAmout__c; 
+                }
+                selectOpportunityById({oppId:this.oppId}).then(oppobj=>{
+                    debugger
+                    this.oppInfo = oppobj;
+                    var oppvalue = JSON.stringify(oppobj);
+                    getModulus({oppInfoc:oppvalue}).then(rtn=>{
+                        this.oppInfo.rate_hospital = rtn.rate_hospital;
+                        this.oppInfo.rate_agency1 =  rtn.rate_agency1;
+                    });
+                    this.trade = '澶栬部';
+                    if(JSON.stringify(oppobj) != "{}"){
+                        this.trade = oppobj.Trade__c;
+                        this.QuoteDecision = oppobj.Estimation_Decision__c;
+                        this.QuoteDecide = this.QuoteDecision;
+                        this.QuoteSapSented = oppobj.SAP_Send_OK__c;
+                        this.QuoteCorrect = oppobj.New_Opportunity__c;
+                        this.enableSales = false;
+                        this.accountid = this.oppInfo.AccountId;
+                        this.oppInfo = initOpportunityById(this.oppInfo,oppobj,this.enableSales,this.QuoteDecision,this.enableContract,this.displayFlg,this.viewSpecialAgencyAmout,Sales_Outlet,OCM_Direct);
+                        this.enableSales = enableSalesExp;
+                        this.enableContract = enableContractExp;
+                        this.displayFlg = displayFlgExp;
+                    }
+                    this.Decision_button = initOpportunityById2(this.QuoteCorrect,this.User,this.QuoteDecision,this.QuoteSapSented,this.print_buttonflg,this.sap_button,this.Decision_button,this.Save_button);
+                    this.Save_button = SbuttonExp;
+                    if(SbuttonExp){
+                        this.Decisiontag = true;
+                        var lg = this.template.querySelectorAll('c-jzlookuplightning2');
+                        lg.forEach(l=>{
+                            l.todisabled();
+                        })
+                    }else{
+                        this.Decisiontag = false;
+                        this.initDataTableToBeproduct.columns[4].editable = true;
+                    }
+                    this.sap_button = sapbuttonExp;
+                    this.print_buttonflg = pbuttonflgExp;
+                    this.Save_button1 = Savebuttondetermine(this.oppInfo,this.Save_button1);
+                    this.tobeflag = true;
+                    this.OnLoading(false);
+                });
+            });
+            getquoDes().then(it=>{
+                if(this.quoId !=''){
+                    selectQuoteById({quoId:this.quoId}).then(quote=>{
+                        debugger
+                        this.quo=quote;
+                        selectQuoteLineItem({quoId:this.quoId,copyid:this.copyid}).then(result=>{
+                            debugger
+                            var tempArr = result.split("---");
+                            var quoteLineItem = JSON.parse(tempArr[0]);
+                            this.CheckItem = JSON.parse(tempArr[1]);
+                            if(JSON.stringify(quote) != "{}"){
+                                debugger
+                                if(this.copyid == ''){
+                                    this.quo = initquoassignment(quote,this.quo,it);
+                                    this.hidden = this.quo.rtn;
+                                    this.quoteGurantee_Period = quote.Gurantee_Period__c;
+                                    this.quotemultiYearWarranty = quote.multiYearWarranty__c;
+                                    this.agency1Name = quote.Agency1__c;
+                                    this.agency2Name = quote.Agency2__c;
+                                    this.Salesprofit1value = quote.Agency1_Profit__c;
+                                    this.Salesprofit2value = quote.Agency2_Profit__c;
+                                    this.SalesCalculation1value = quote.Agency1_Profit_Rate__c;
+                                    this.SalesCalculation2value = quote.Agency2_Profit_Rate__c;
+                                    this.hidden_MultiYearWarrantyTotalPrice = quote.MultiYearWarrantyTotalPrice__c;
+                                    this.template.querySelector('[data-parent-id="Agency1Id"]').setvalue(this.quo.Agency1__c);
+                                    this.template.querySelector('[data-parent-id="Agency2Id"]').setvalue(this.quo.Agency2__c);
+                                }else{
+                                    this.hidden_MultiYearWarrantyTotalPrice = quote.MultiYearWarrantyTotalPrice__c;
+                                    this.quo = initquoassignmentcopy(quote,this.quo,it);
+                                    this.hidden = this.quo.rtn;
+                                    this.template.querySelector('[data-parent-id="Agency1Id"]').setvalue(this.quo.Agency1__c);
+                                    this.template.querySelector('[data-parent-id="Agency2Id"]').setvalue(this.quo.Agency2__c);
+                                    
+                                }
+                            }
+                            var product2Ids = initquocheck(quoteLineItem,this.CheckItem);
+                            var loopMap = lookMapE;
+                            if(this.CheckItem.length>0){
+                                var proList = JSON.stringify(product2Ids);
+                                selectProById({proList:proList}).then(plo=>{
+                                    if(plo.length>0){
+                                        plo.forEach(prd2=>{
+                                            if(prd2.SFDA_Status__c != loopMap.get(prd2.Id)){
+                                                this.WinOrDecideAlert = true;
+                                            }
+                                        });
+                                    }
+                                    if(quoteLineItem.length > 0 && !this.QuoteDecision){
+                                        this.productStatusUpdated = false;
+                                        quoteLineItem = initQuoteLineItemcheck(quoteLineItem,this.productStatusUpdated);
+                                        this.newQuoteFlag = newQuoteFlagExp;
+                                        this.productStatusUpdated = productStatusUpdatedExp;   
+                                    }
+                                    if(JSON.stringify(quoteLineItem) != "{}"){
+                                        quoteLineItem = InitializeProductAssignment(quoteLineItem); 
+                                        if(this.acts){
+                                            quoteLineItem = actState(this.actL,quoteLineItem);
+                                        }
+                                        this.jzDataToBeproduct =[].concat(quoteLineItem);
+                                    }
+                                    this.EstimationListPrice();
+                                    this.calUnitPriceTotal();
+                                    this.quoteTotalPrice();
+                                    this.setOCMAmount();
+                                    this.checkProductStatusValidPeriod();
+                                    setTimeout(() => {
+                                        debugger
+                                        if(this.WinOrDecideAlert){
+                                            this.Alert('浜у搧鐘舵�佸彂鐢熷彉鍖栥��','warning');
+                                        }
+                                    }, 1000);
+                                    this.calGuranteeAllFields();
+                                    this.OnLoading(false);
+                                    var IsQuoteTrial =this.quo.IsQuoteTrial__c;
+                                    this.ifquocom = IsQuoteTrial;
+                                    debugger
+                                    if(this.copyid){
+                                        this.quoId = '';
+                                        this.SkipQuotefilg = true;
+                                    }else{
+                                        debugger
+                                        this.UnConfirmQuote = selectQuoteLineExp(quote,this.User,SI2M3ID,ProfSystAdmin,this.UnConfirmQuote);
+                                        this.quo = quoExp;
+                                        if(alertExp){
+                                            this.Alert(alertExp,'error');
+                                        }
+                                    }
+                                });
+                            }
+                        });
+                        this.quo = quoteinit(this.quo);
+                        this.HiddenGurantee_Period = this.quo.Gurantee_Period__c;
+                    });
+                }else{
+                    this.quo = quoteinit(this.quo);
+                    this.HiddenGurantee_Period = this.quo.Gurantee_Period__c;
+                    this.quo.multiYearWarranty__c = false;
+                    this.pageArrange();
+                    this.hidden = it;
+                }
+            });
+        });
+
+        //Add Jz - kkbes 20231019 Start
+        const inputAlignright = document.createElement('style');
+        inputAlignright .innerText = `.input-text-align_right input{ text-align: right!important; }`;
+        document.body.appendChild(inputAlignright);
+        //Add Jz - kkbes 20231019 End
     }
 
-	// 	//const duration = document.getElementById('dur');
-    //         //娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 start
-    //     //dialog 寮圭獥 start 
-    //     var popupBox;
-    //     popupBox = new SimpleDialog("SpeedDialogId", false);  // 涓嶅彲鎷栧姩
-    //     popupBox.createDialog();
-    //     //绮剧悽鎶�鏈� 2021/02/08 start
-    //     function openAddMultipleRow(){
-    //         popupBox.setTitle("璇疯緭鍏ラ渶瑕佸鍔犵殑琛屽彿锛�");
-    //         popupBox.importContentNode(document.getElementById("speedDiv"));
-    //         popupBox.show(document.getElementById("speedDiv"));
-    //         document.getElementById("speedDiv").style.display = 'block';
-            
-    //     }
-    //     //dialog 寮圭獥 end 
-    //     // 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 end 
+    pageArrange(){
+          this.quo = pageArrangeLoc(this.quo);
+    }
+    
+    calPriceAll() {
+        debugger
+        this.calGuranteeAllFields();
+        this.jzDataToBeproduct = calPriceAllLogic(this.jzDataToBeproduct);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.EstimationListPrice();
+        this.calUnitPriceTotal();
+        this.quoteTotalPrice();
+        this.quoteAgencyTotalPriceAction();
+        this.AgencyDiscountCalculation1();
+    }
+    //
+    calGuranteeAllFields() {
+        this.jzDataToBeproduct = calGuranteeAllFieldsLogic(this.jzDataToBeproduct,this.quo);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.hidden_MultiYearWarrantyTotalPrice = MultiYearWarrantyTotalPriceExport;
+        this.quo.MultiYearWarrantyTotalPrice__c = toNumComma(MultiYearWarrantyTotalPriceExport);
+    }
+    EstimationListPrice() {
+        this.jzDataToBeproduct = EstimationL(this.jzDataToBeproduct,this.quo);
+        this.quo = quoExp;
+    }
+    
+    ListPriceTotalhidden = 0;
+    UnitPriceTotalhidden = 0;
+    calUnitPriceTotal() {
+        this.jzDataToBeproduct = calUnitPriceTotalLoc(this.jzDataToBeproduct);
+        this.ListPriceTotalhidden = ListPriceTotalExp;
+        this.UnitPriceTotalhidden = unitPriceTotalExp;
+    }
+    
+    quoteTotalPrice() {
+        var result = quoteTotalPriceLoc(this.jzDataToBeproduct,this.quo,this.quoId,this.oppInfo,Saleslet);
+        this.quo = quoExp;
+        this.jzDataToBeproduct =[].concat(result);
+        var id = this.quoId;
+        if(!id){
+            var IsQuoteTrial =this.quo.IsQuoteTrial__c;
+            if(!IsQuoteTrial){
+                this.setOCMAmount();
+                this.calFromContactPrice();
+            }
+        }
+        this.DisAmountfunction();
+        this.QuoteAdjust();
+        this.salesProfit2();
+        this.setCostTatal();
+    }
+    setOCMAmount() {
+        debugger
+        this.oppInfo = setOCMAmountc(this.enableSales,this.quo,this.oppInfo);
+        this.quo = quoExp;
+    }
+    /*
+    鍖婚櫌鐨勫悎鍚岄噾棰� 鏍煎紡鍖栦负 甯﹀垎浣嶇鐨勫瓧娈�;
+    */
+    calFromContactPrice() {
+        var x = 0;
+        x = this.quo.Dealer_Final_Price_Page__c;
+        x = localParseFloat(x);
+        this.quo.Dealer_Final_Price_Page__c = toNumComma(x);
+        this.DisAmountfunction();
+        this.salesProfit1();
+        this.salesProfit2();
+        this.setCostTatal();
+    }
+    
+    DisAmountfunction() {
+        this.quo = DisAmountfunctionc(this.quo);
+        this.DisCalculationfunction();
+    }
+    
+    DisCalculationfunction() {
+        this.quo = DisCalculationfunctionLoc(this.quo);
+    }
+    salesProfit1() {
+        this.Salesprofit1value = salesProfit1Logic(this.quo,this.Salesprofit1value);
+        this.quo = quoExp;
+        this.salesCalculation1();
+    }
+    salesCalculation1() {
+        this.SalesCalculation1value = salesCalculation1Logic(this.quo,this.Salesprofit1value,this.SalesCalculation1value);
+        this.quo = quoExp;
+    }
+    salesProfit2() {
+        this.Salesprofit2value = salesProfit2Logic(this.quo,this.Salesprofit2value);
+        this.quo = quoExp;
+        this.salesCalculation2();
+        this.salesProfit1();
+    }
+    
+    salesCalculation2() {
+        this.SalesCalculation2value = salesCalculation2Logic(this.quo,this.Salesprofit2value,this.SalesCalculation2value)
+        this.quo = quoExp;
+    }
+    setCostTatal() {
+        var z = 0;
+        this.jzDataToBeproduct.forEach(jzdtbt=>{
+            var s = 0;
+            s = localParseFloat(jzdtbt.Cost_Subtotal_c);
+            if (!isNaN(s)) {
+                z = z + s;
+            }
+        });
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.hidden_Stocking_Price = toNum(z);
+        if (this.displayCost) {
+            this.quo.Stocking_Price__c = toNumComma(z);
+        }
+    }
+    QuoteAdjust() {
+        this.jzDataToBeproduct = QuoteAdjustLogic(this.jzDataToBeproduct,this.quo,this.hidden_MultiYearWarrantyTotalPrice,this.QuoteDecision_Button);
+        this.quo = quoExp;
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+    }
+    
+    quoteAgencyTotalPriceAction() {
+        this.jzDataToBeproduct = quoteAgencyTotalPriceActionLogic(this.jzDataToBeproduct,this.quo,this.oppInfo,this.QuoteDecision_Button,this.hidden_MultiYearWarrantyTotalPrice);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+    }
+    AgencyDiscountCalculation1() {
+        this.jzDataToBeproduct = AgencyDiscountCalculation1Logic(this.quo,this.jzDataToBeproduct,this.QuoteDecision_Button,this.hidden_MultiYearWarrantyTotalPrice);
+        this.quo = quoExp;
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+    }
+    Confirm_PriceRefresh = '鎶ヤ环浣滄垚鍚�'+Price_Valid_Period+'澶�,杩樻病鏈夋洿鏂拌繃浠锋牸锛岄渶瑕佹墽琛�'+Status_Update+'锛�';
+    checkProductStatusValidPeriod() {
+        debugger
+        var period = this.quo.PriceRefreshPeriod;
+        if (parseInt(period) > parseInt(Price_Valid_Period) && this.QuoteDecide != true) {
+            if (confirm(this.Confirm_PriceRefresh)) {
+                this.productCompare();
+                return true;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
+    productCompare() {
+        try {
+            var returnflg;
+            var b = true;
+            var t = this.trade;
+            var ids = new Array();
+            this.jzDataToBeproduct.forEach(jzdtbt=>{
+                var id =jzdtbt.pageObject.Id__c;
+                if (id != '') {
+                    ids.push(jzdtbt.pageObject.Id__c);
+                }
+            });
+            getProduct2({ids:ids}).then(results=>{
+                debugger
+                var id2Product = new Object();
+                for (var j = 0; j < results.length; j++) {
+                    id2Product[results[j].Id] = results[j];
+                }
+                var reslut = productCompareLogic(this.jzDataToBeproduct,id2Product,t,b);
+                b = bflag;
+                this.jzDataToBeproduct =[].concat(reslut);
+                if (b == false) {
+                    if (window.confirm(Message_001)) {
+                        this.PriceStatusUpdate();
+                        this.OnLoading(false);
+                        this.calPriceAll();
+                        this.quoteAgencyTotalPriceAction()
+                        this.productStatusUpdated = true;
+                        this.WinOrDecideAlert = false;
+                        returnflg = true;
+                    } else {
+                        returnflg = false;
+                    }
+                } else {
+                    this.Alert("浠锋牸鐘舵�佹病鏈夊彉鍖栥��",'warning');
+                    this.productStatusUpdated = true;
+                    returnflg = false;
+                }
+            });
+            return returnflg;
+        } catch (e) {
+            this.Alert(e,'error');
+        }
 
-    //     var QuoteEntryMaxLine = {!QuoteEntryMaxLine};
-    //     var trade = '{!oppInfo.Trade}';
-    //     var displayCost = '{!displayCost}';
-    //     var quoid = '{!quoid}';
-    //     var Session_ID = '{!$Api.Session_ID}';
-    //     var Price_Valid_Period = '{!$Label.Price_Valid_Period}';
-    //     var Message_001 = '{!$Label.Message_001}';
-    //     var Message_Please_Save_Quote = '{!$Label.Please_Save_Quote}';
-    //     var Message_Check_Your_Clipboard = '{!$Label.Check_Your_Clipboard}';
-    //     var Error_Message3 = '{!$Label.Error_Message3}';
-    //     var Error_Message11 = '{!$Label.Error_Message11}';
-    //     var Error_Message29 = '{!$Label.Error_Message29}';
-    //     var Error_Message33 = '{!$Label.Error_Message33}';
-    //     var Error_Message34 = '{!$Label.Error_Message34}';
-    //     var Error_Message35 = '{!$Label.Error_Message35}';
-    //     var Error_Message36 = '{!$Label.Error_Message36}';
-    //     var Error_Message40 = '{!$Label.Error_Message40}';
-    //     var Confirm_ChangedAfterPrint = '鎵撳嵃鍚庤淇℃伅鏈夊彉鍖栵紝鏄惁缁х画鎿嶄綔锛堟姤浠风紪鐮佷細鍙樻柊锛夛紵';
-    //     var Confirm_ChangedAfterBid = '璇ユ姤浠峰凡鎴愪负false浼犵エ锛屾槸鍚︾户缁搷浣滐紙灏嗕細鍋氬嚭涓�涓柊鐨勬姤浠凤級锛�';
-    //     var Confirm_PriceRefresh = '鎶ヤ环浣滄垚鍚巤!$Label.Price_Valid_Period}澶�,杩樻病鏈夋洿鏂拌繃浠锋牸锛岄渶瑕佹墽琛寋!$Label.Status_Update}锛�';
-    //     window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
-    //     var openQuoteExcelImportWindow = null;
-        
-    //     function selectAll() {
-    //         var checklist = j$("input[name='checklist']");
-    //         var all = j$(escapeVfId("checkAll"));
-    //         for(var i = 0; i < checklist.length; i++){
-    //             if (all[0].checked == true) {
-    //                 checklist[i].checked = true;
-    //             } else {
-    //                 checklist[i].checked = false;
-    //             }
-    //         }
-    //     }
-    //     // xudan 20140627 鍓婇櫎寰屻伄銉併偋銉冦偗澶栥仚銉偢銉冦偗
-    //     function clearAllCheck() {
-    //         j$(escapeVfId("checkAll"))[0].checked = false;
-    //         var checklist = j$("input[name='checklist']");
-    //         for(var i = 0; i < checklist.length; i++){
-    //             checklist[i].checked = false;
-    //         }
-    //     }
-    // // 鎶ヤ环璇曠畻
-    //     function JumpJs() {
-    //         // console.log(ApexPages.currentPage().getParameters().get('core.apexpages.request.devconsole'));
-    //         // var t = '{!quoId}';
-    //         // window.open('/apex/test02?Id=' + t);
-    //         blockme();
-    //         Jump.call();
-    //         return true;
-    //     }
-    //     function DownloadCsvGet(){
-    //         DownloadCsv();
-    //     }
-    //     function DownloadCsvJs(){
-    //         var a =  j$(escapeVfId("Page:mainForm:oppoidforCSV")).val();
-    //         var b = '{!oppId}';
-    //         //window.open('/apex/SI_CsvModel?'+(a==''?'':'id='+a)+'&'+(a==''?'':'oppId='+b)+'','name','features','replace');
-    //         window.open('/apex/SI_CsvModel?id='+encodeURI(a),'name','features','replace');
-    //     }
-    //     function QuoteConfirmJs() {
-    //         debugger
-    //         // body...
-    //         blockme();
-    //         //SWAG-C5DBAL  銆愬鎵樸�� [绱ф�SI璇环鑲栧瘨鏃犳硶淇敼鎶ヤ环鍗� 绮剧悽鎶�鏈� 2021/07/30 start 
-    //         //鑾峰彇褰撳墠鐧诲綍浜虹畝妗�
-    //         var profileId = '{!$User.profileId}';
-    //         //鑾峰彇鑷畾涔夋爣绛� 绯荤粺绠$悊鍛樼畝妗�
-    //         var adminId = '{!$Label.ProfileId_SystemAdmin}';
-    //         //XLIU-CHRD8P銆愬鎵樸�戙�怬BSAP銆戣缁橭BSAP绠�妗BA2_璇环绠$悊 SI璇环鎶ヤ环鍗曠‘璁ゆ潈闄� fy start 
-    //         var adminId2 = '{!$Label.ProfileId_SystemAdmin2}';
-    //         var flag=true;
-    //         var profileId15=profileId;
-    //         if(profileId&&profileId.length>15){
-    //             profileId15=profileId.substring(0,15);
-    //         }
-    //         if(adminId2.includes(profileId15)){
-    //             flag=false;
-    //         }else{
-    //             flag=true;
-    //         }
-    //         //XLIU-CHRD8P銆愬鎵樸�戙�怬BSAP銆戣缁橭BSAP绠�妗BA2_璇环绠$悊 SI璇环鎶ヤ环鍗曠‘璁ゆ潈闄� fy end 
-    //         //鍙湁绯荤粺绠$悊鍛樺彲浠ョ偣鍑�
-    //         if(profileId!=adminId&&flag){
-    //             alert('鍙湁绯荤粺绠$悊鍛樺拰钀ヤ笟鍔╃悊鏈夋潈闄愮‘璁ゆ姤浠凤紒');
-    //             unblockUI();
-    //         }else{
-    //             QuoteConfirm();
-    //         }
-    //         //SWAG-C5DBAL  銆愬鎵樸�� [绱ф�SI璇环鑲栧瘨鏃犳硶淇敼鎶ヤ环鍗� 绮剧悽鎶�鏈� 2021/07/30 end
-    //         // QuoteConfirm();
-    //     }
-    //     function ReloadPage() {
-    //         // body...
-    //         window.location.reload();
-    //     }
-    //     function submitOppoApplyStockJs(){
-    //         // SI璇环淇敼 update by vivek start 20191129
-    //         var Save_button1 = '{!Save_button1}';
-    //         console.log(Save_button1);
-    //         if(Save_button1 == '111'){
-    //             alert('1銆佽仈绯籗I鏈儴鍋氶厤缃缓璁�俓n2銆佽钀ヤ笟鏈儴鍋氶厤缃缓璁弽棣堛�俓n3銆佽SI鏈儴鍋氶厤缃枃浠舵鏌ャ��');
-    //         }else if(Save_button1 == '211'){
-    //             alert('1銆佽钀ヤ笟鏈儴鍋氶厤缃缓璁弽棣堛�俓n2銆佽SI鏈儴鍋氶厤缃枃浠舵鏌ャ��');
-    //         }else if(Save_button1 == '221'){
-    //             alert('1銆佽SI鏈儴鍋氶厤缃枃浠舵鏌ャ��');
-    //         }else if(Save_button1 == '1'){
-    //             alert('1銆佽SI鏈儴鍋氶厤缃枃浠舵鏌ャ��');
-    //         }else if(Save_button1 == '112'){
-    //             alert('1銆佽仈绯籗I鏈儴鍋氶厤缃缓璁�俓n2銆佽钀ヤ笟鏈儴鍋氶厤缃缓璁弽棣堛��');
-    //         }else if(Save_button1 == '212'){
-    //             alert('1銆佽钀ヤ笟鏈儴鍋氶厤缃缓璁弽棣堛��');
-    //         }else{
-    //             blockme();
-    //             submitOppoApplyStock();
-    //         }
-    //         // SI璇环淇敼 update by vivek end 20191129
-    //         // blockme();
-    //         // submitOppoApplyStock();
-    //     }
-    //     // SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28 by vivek start
-    //     function IfRadioChecker2(){
-    //         var msg = "涓嶈兘鍒犻櫎锛屽鏋滃垹闄ゅ彲鑳藉奖鍝嶈澶囧畨瑁呫�俓n\n璇风‘璁わ紒";
-    //         if(confirm(msg)==true){
-    //             radioChecker2('del');
-    //         }
-    //     }
-    //     // SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28 by vivek end
+    }
+    //鏇挎崲浜у搧otcode
+    updateOtcode() {
+        this.OnLoading(true);
+        var id = this.quoId;
+        var nmpa = checkNMPA(this.jzDataToBeproduct);
+        if (nmpa) {
+            updateOTCodeweb({tempQuoId: id}).then(results=>{
+                if (results) {
+                    this.Alert('浜у搧otcode鏇挎崲瀹屾垚锛�','success');
+                    window.location.reload();
+                } else {
+                    this.Alert('浜у搧otcode鏇挎崲澶辫触锛岃鑱旂郴绠$悊鍛橈紒','error');
+                }
+                this.OnLoading(false);
+            });
+        } else {
+            this.OnLoading(false);
+            this.Alert('鎶ヤ环琛岄」鐩病鏈塏MPA鐘舵�佷负鍋滄鐨勪骇鍝侊紝鏃犳硶鏇挎崲锛�','error');
+        }
+    }
+    PriceStatusUpdate(){
+        this.setOppFromOppInfo();
+        //鍏ㄤ欢娲椼亜鏇裤亪銇椼伨銇欍��
+        if (this.jzDataToBeproduct.length > 0) {
+            this.jzDataToBeproduct = PriceStatusUpdateLogic(this.jzDataToBeproduct,this.newQuoteFlag);
+            this.newQuoteFlag = newQuoteFlagex;
+            this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+            this.productStatusUpdated = true;
+        }
+        this.pageArrange();
+        this.calPriceAll();
+        this.Alert('鏇存柊瀹屾瘯锛�','success');
+    }
+    //
+    setOppFromOppInfo() {
+        this.oppInfo.Agency1__c = this.quo.Agency1__c;
+        this.oppInfo.Agency2__c = this.quo.Agency2__c;
+    }
+    
+    quoteAgencyTotalPriceAction1(str) {
+        var Sales_Root =  this.oppInfo.Sales_Root__c;
+        Sales_Root = Sales_Root + '';
+        Sales_Root = Sales_Root.replace(/\s+/g, "");
+        if (str == Sales_Root) {
+            this.quoteAgencyTotalPriceAction();
+        }
+    }
+    //鎶ヤ环鍚嶇О璧嬪��
+    QuoteNameAssignment(event){
+        this.quo.QuoteName__c = event.target.value;
+    }
+    //鏈�缁堝鎴锋垚浜や环Change浜嬩欢
+    DealerFinalPricePageChange(event){
+        this.quo.Dealer_Final_Price_Page__c = event.target.value;
+        debugger
+        this.calFromContactPrice();
+        this.setOCMAmount();
+        this.quoteAgencyTotalPriceAction1('OCM鐩存帴閿�鍞�');
+    }
+    //璁$畻锛呯殑change
+    QuoteAdjustCalculateChange(event){
+        if(this.quo.Quote_Adjust_Calculate__c !== event.target.value){
+            this.quo.Quote_Adjust_Calculate__c = event.target.value;
+            this.UnitPriceUpdate();
+            event.target.value = this.quo.Quote_Adjust_Calculate__c;
+        }
+    }
+    //璋冩暣閲戦鐨刢hange
+    QuoteAdjustAmountPageChange(event){
+        if(this.quo.Quote_Adjust_Amount_Page__c !== event.target.value){
+            this.quo.Quote_Adjust_Amount_Page__c = event.target.value;
+            this.calFromQuoAmont()
+        }
+    }
+    //缁忛攢鍟嗕竴鍚堝悓閲戦change
+    OCMAgent1PricePageonChange(event){
+        this.quo.OCM_Agent1_Price_Page__c = event.target.value;
+        this.salesProfit1();
+        this.setOCMAmount();
+        this.quoteAgencyTotalPriceAction1('缁忛攢鍟�');
+        this.AgencyDiscountCalculation1();
+    }
+    //缁忛攢鍟嗕簩鍚堝悓閲戦change
+    Agent1Agent2PricePageChange(event){
+        this.quo.Agent1_Agent2_Price_Page__c = event.target.value;
+        this.salesProfit2();
+    }
+    //澶嶅埗鎸夐挳change
+    copyToClipboardNewQuoteEntry() {
+        var QuoteId = this.quoId;
+        if (QuoteId == null || QuoteId == '') {
+            this.Alert(Message_Please_Save_Quote,'error');
+            return null;
+        }
+        var records;
+        var x;
+        var targetString = 'No.\t缂栫爜\t鐘舵�乗t鍚嶇О\tListPrice\t鏁伴噺\t瑙勬牸\t鍖婚櫌鍗曚环\t鍖婚櫌灏忚\t璧犻�乗t缁忛攢鍟嗗崟浠穃t缁忛攢鍟嗗皬璁�';
+        targetString += '\t澶氬勾淇濅慨\t淇濅慨\tNoDiscount灏忚';
+        targetString += '\t淇濅慨鏈焅t閫氳揣';
+        try {
+            getQuoteLineItem({
+                quoId: QuoteId
+            }).then(reslut=>{
+                NewQcopyLogic(Message_Check_Your_Clipboard,records,x,targetString,reslut,this.displayCost,this.oppInfo.CurrencyIsoCode);
+                if(alfExp){
+                    this.Alert(alertExp,'success');
+                }else{
+                    this.Alert(alertExp,'error');
+                }
+            });
+        } catch (e) {
+            this.Alert(e.faultcode + ',' + e.faultstring,'error');
+        }
+    }
+    @track
+    nafg={};
+    //淇濆瓨鎶ヤ环鎸夐挳
+    savebuttonClick(){
+        this.OnLoading(true);
+        this.checkchangedAfterPrint('sa');
+        if(this.fg){
+            this.sal();
+        }
+    }
+    sal(){
+        debugger
+        this.tobeflag=false;
+        var shut = AlertForCFDA(this.jzDataToBeproduct);
+        if (shut == true) {
+            this.Alert('鎻愮ず锛氬寘鍚噸鏂扮敵璇稢FDA鐨勪骇鍝侊紝涓嶅彲杩涜璁㈣揣銆�','error');
+        }
+        var cost = CheckForCost(this.jzDataToBeproduct);
+        if (cost) {
+            this.Alert('浜у搧鎴愭湰涓虹┖鏃朵笉鍙姤浠�!','error');
+            this.OnLoading(false);
+            this.tobeflag=true;
+        } else {
+            var er = '';
+            var listPrice = CheckForListPrice(this.jzDataToBeproduct);
+            if (listPrice) {
+                er = '鐩墠浜у搧瀹氫环鏈‘瀹氾紝璇蜂簬浜у搧鏈儴鑱旂郴纭锛�';
+            }
+            var SaveQuotecan = saveQuotel(this.quo,this.oppInfo,this.jzDataToBeproduct,this.CheckItem,this.WinOrDecideAlert,this.productStatusUpdated,this.enableSales,
+                this.oppId,this.quoId,this.newQuoteFlag,this.changedAfterPrint,this.quoteGurantee_Period,this.quotemultiYearWarranty,this.selection_hp,this.SkipQuotefilg,this.quoteflg);
+            SaveQuote(SaveQuotecan).then(resaut=>{
+                debugger
+                var Setmap = new Map()
+                var key = Object.keys(resaut)
+                key.forEach(item=>{
+                    Setmap.set(item,resaut[item]);
+                });
+                if(Setmap.has('errormessage')){
+                    er += Setmap.get('errormessage');
+                    this.quoteflg = false;
+                }else{
+                    if(this.Sback){
+                        window.open('/' +this.oppId, '_self');
+                    }else{
+                        if(Setmap.has('QuoteNo')){
+                            this.quo.Quote_No__c = Setmap.get('QuoteNo');
+                        }
+                        if(this.quoteflg){
+                            if(Setmap.has('quoId')){
+                                this.quoId = Setmap.get('quoId');
+                                this.CSVflag = this.quoId?false:true;
+                                this.quo.IsQuoteTrial__c = false;
+                                this.ifquocom = false;
+                                this.quoteGurantee_Period = this.quo.Gurantee_Period__c;
+                                this.quotemultiYearWarranty = this.quo.multiYearWarranty__c;
+                            }
+                            this.index = 3;
+                            this.quoteTrialInit();
+                        }else{
+                            if(Setmap.has('warn')){
+                                this.Alert(Setmap.get('warn'),'warning');
+                                this.jzDataToBeproduct = actState(Setmap.get('act'),this.jzDataToBeproduct);
+                                this.acts = true;
+                                this.actL = Setmap.get('act');
+                            }else{
+                                this.Alert(Setmap.get('success'),'success');
+                            }
+                            if(Setmap.has('quoId')){
+                                this.quoId = Setmap.get('quoId');
+                                this.CSVflag = this.quoId?false:true;
+                                window.open('/lightning/n/lexSINewQuoteEntry#Id=' + Setmap.get('quoId'), '_self');
+                                this.location = 'Id='+ Setmap.get('quoId'); 
+                                this.copyid = '';
+                                this.oppId = '';
+                                this.connectedCallback();
+                            }
+                        }
+                    }
+                }
+                this.nafg = resultFlag(this.nafg,Setmap);
+                if(er){
+                    this.Alert(er,'error');
+                }
+                this.tobeflag=true;
+                this.OnLoading(false);
+            });
+            return true;
+        }
+    }
+    //澶囪揣纭鐢宠
+    submitOppoApplyStockJs(){
+        this.OnLoading(true);
+        var flag =submitOppoApplyStockJsLogic(this.Save_button1);
+        if(flag){
+            submitOppoApplyStock({oppIdc:this.oppId,quoIdc:this.quoId}).then(rlt=>{
+                debugger
+                var relt = rlt.split('errorss:');
+                if(relt.length<2){
+                    this.Alert(relt[0],'success');
+                }else{
+                    this.Alert(relt[1],'error');
+                }
+                this.OnLoading(false);
+            });
+        }else{
+            this.Alert(alertExp,'error');
+            this.OnLoading(false);
+        }
+    }
+    DownloadCsvGet(){
+        window.open('/apex/SI_CsvModel?id='+encodeURI(this.quoId),'name','features','replace');
+    }
+    QuoteConfirmJs(){
+        this.OnLoading(true);
+        var a = QuoteConfirmJsExp(this.User,Admin,Admin2);
+        debugger
+        if(a){
+            this.Alert(alertExp,'error');
+        }else{
+            QuoteConfirm({quoid:this.quoId}).then(res=>{
+                var relt = res.split('errorss:');
+                if(relt.length > 2){
+                    this.Alert(relt[1],'error');
+                }
+                this.OnLoading(false);
+                window.location.reload();
+            });
+        }
+    }
+    //浠锋牸鏀跨瓥琛ㄥ崟寮�鍏虫爣璇嗙
+    jzDataTableFixedPriceIsShow = false;
+    //鎶ヤ环璁$畻鍒濆鍖�
+    quoteTrialInit(){
+        this.OnLoadSavesDatas();
+        this.OnLoadQuoteData(this.quoId);
+        var event = {
+            page: 1,
+            pageLimit: 10,
+            search: "",
+            sortOrder: "asc",
+            sortPlus: undefined,
+            fag: true
+        };
+        setTimeout(() => {
+            this.getTableDataFix(event);
+            this.getTableData(event);
+        }, 1000);
+    }
+    OnLoadProduct = []; //鏈�夋嫨浜у搧 
+    OnLoadSaveProduct = []; //宸查�夋嫨浜у搧
+    OnLoadDiscount = []; //鎶樻墸鏀跨瓥
+    OnLoadFixDiscount = []; //浠锋牸鏀跨瓥
+    flagall = false;
+    OnLoadSavesDatas() {
+        debugger
+        //鑾峰彇浜у搧鏁版嵁
+        SelectAllDataDiscount({
+            ParamIdStr: this.quoId
+        }).then(result => {
+            result.forEach(item => {
+                if (item.ismatch__c == "0") {
+                    item = ProductAssignmentSelect(item);
+                    this.OnLoadProduct.push(item);
+                } else if (item.ismatch__c == "1") {
+                    item = ProductSelected(item);
+                    this.OnLoadSaveProduct.push(item);
+                }
+            })
+            var arrss = [].concat(this.OnLoadSaveProduct);
+            this.addOffer(arrss);
+            this.comparisonUniqueKey();
+            if (this.OnLoadProduct != undefined && this.OnLoadProduct.length > 0) {
+                this.flagall = true;
+                this.jzDataDefault = this.OnLoadProduct;
+                if (this.jzDataDefault != undefined && this.jzDataDefault.length > 0) {
+                    this.UpdateSaveDataQuoteLineItemSelectByID(0);
+                }
+            }
+            if (this.OnLoadSaveProduct != undefined && this.OnLoadSaveProduct.length > 0) {
+                this.flagall = true;
+                this.jzDataProduct = this.OnLoadSaveProduct;
+                debugger
+                if (this.jzDataProduct != undefined && this.jzDataProduct.length > 0) {
+                    this.UpdateSaveDataQuoteLineItemSelectByID(1);
+                }
+                this.updateIdStr("1");
+                this.ContractPriceCompute();
+            }
+        })
+        //鑾峰彇 鎶樻墸鏂规鏁版嵁  UpdateBy 2021 06 29
+        SelectAllDataProduct({
+            ParamIdStr: this.quoId
+        }).then(result => {
+            result.forEach(items => {
+                if (items.typess__c == "鎶樻墸鏀跨瓥") {
+                    items = UnselectedScheme(items);
+                    this.OnLoadDiscount.push(items);
+                } else if (items.typess__c == "浠锋牸鏀跨瓥") {
+                    items = SelectedScheme(items)
+                    this.OnLoadFixDiscount.push(items);
+                }
+            })
+            this.comparisonUniqueKey();
+            if (this.OnLoadFixDiscount != undefined && this.OnLoadFixDiscount.length > 0) {
+                this.jzDataFixedPrice = this.OnLoadFixDiscount;
+                if (this.jzDataFixedPrice != undefined && this.jzDataFixedPrice.length > 0) {
+                    this.UpdateSaveDataFixedPriceSelectByID();
+                }
+            }
+            if (this.OnLoadDiscount != undefined && this.OnLoadDiscount.length > 0) {
+                this.jzDataDiscount = this.OnLoadDiscount;
+                this.updateIdStr("2");
+            }
+        })
+    }
+    //鍚堝苟涓婁竴娆$殑鎶ヤ环琛�
+    lastQuotation = [];
+    addOffer(TrialLine) {
+        this.lastQuotation = [].concat(addOfferLogic(TrialLine));
+    }
+    index = 3;
+    comparisonUniqueKey() {
+        this.index--;
+        if (this.index == 0) {
+        comparisonUniqueKeyLogic(this.index,this.flagall,this.jzDataDefaultCopy,this.jzDataDefault,this.jzDataProduct,this.jzDataFixedPrice,this.jzDataDiscount,this.lastQuotation);
+            this.jzDataDefault = jzDataDefaultExp;
+            this.jzDataProduct = jzDataProductExp;
+            this.jzDataFixedPrice = jzDataFixedPriceExp;
+            this.jzDataDiscount = jzDataDiscountExp;
+            this.ContractPriceCompute()
+        }
+    }
+    Complate = false;
+    //浠庢暟鎹簱鏇存柊宸蹭繚瀛樼殑鏁版嵁 浜у搧  UpdateBy 2021 06 29
+    UpdateSaveDataQuoteLineItemSelectByID(flag) {
+        if (flag == 0) {
+            var idArr = [];
+            this.jzDataDefault.forEach(item => {
+                idArr.push(item.QuiteLineitem__c);
+            })
+            selectUpdateQuoteLineItemData({
+                ItemId: idArr
+            }).then(result => {
+                var newArr = [];
+                this.jzDataDefault.forEach(dp => {
+                    var temp = {
+                        ...{},
+                        ...dp
+                    };
+                    result.forEach(item => {
+                        if (item.Id == temp.QuiteLineitem__c) {
+                            var keys = Object.keys(temp);
+                            keys.forEach(k => {
+                                var flag = ChangeProductData(k);
+                                if (flag && item[k] != undefined && item[k] != temp[k]) {
+                                    this.Complate = true;
+                                    temp[k] = item[k];
+                                }
+                            })
+                        }
+                    })
+                    newArr.push(temp);
+                })
+                this.jzDataDefault = newArr;
+            })
+        }
+        if (flag == 1) {
+            var idArrPro = [];
+            this.jzDataProduct.forEach(item => {
+                idArrPro.push(item.QuiteLineitem__c);
+            })
+            selectUpdateQuoteLineItemData({
+                ItemId: idArrPro
+            }).then(result => {
+                var newArr = [];
+                this.jzDataProduct.forEach(dp => {
+                    var temp = {
+                        ...{},
+                        ...dp
+                    };
+                    result.forEach(item => {
+                        if (item.Id == temp.QuiteLineitem__c) {
+                            var keys = Object.keys(temp);
+                            keys.forEach(k => {
+                                var flag = ChangeProductData(k);
+                                if (flag && item[k] != undefined && item[k] != temp[k]) {
+                                    this.Complate = true;
+                                    temp[k] = item[k];
+                                }
+                            })
+                        }
+                    })
+                    newArr.push(temp);
+                })
+                debugger
+                this.jzDataProduct = newArr;
+                //瑙e喅鍒犻櫎鏍峰紡涓嶆洿鏂伴棶棰�
+                this.updateIdStr("1");
+                //鍚堝悓浠锋牸姹囨��
+                this.ContractPriceCompute();
+            })
+        }
+    }
+    //鍒犻櫎鏃堕渶瑕佺敤鐨勫敮涓�id鐨勬坊鍔�
+    updateIdStr(str) {
+        var newArr = [];
+        var indexNum = 0;
+        var jzdpdc = [];
+        if (str == "1") {
+            jzdpdc = [].concat(this.jzDataProduct);
+        } else if (str == "2") {
+            jzdpdc = [].concat(this.jzDataDiscount);
+        } else if (str == "3") {
+            jzdpdc = [].concat(this.jzDataFixedPrice);
+        }
+        jzdpdc.forEach(item => {
+            indexNum++;
+            var temp = {
+                ...item
+            };
+            temp.DelectId = indexNum;
+            newArr.push(temp);
+        })
+        if (str == "1") {
+            this.jzDataProduct = [].concat(newArr);
+        } else if (str == "2") {
+            this.jzDataDiscount = [].concat(newArr);
+        } else if (str == "3") {
+            this.jzDataFixedPrice = [].concat(newArr);
+        }
+    }
+    //鍚堝悓浠锋牸姹囨��
+    ContractPrice = 0;
+    ContractPriceCompute() {
+        this.HeTongPriceCompute();
+        this.ContractPrice = 0;
+        var sum = this.ContractPrice;
+        sum = parseFloat(sum);
+        sum=ContractPriceComputeLogic(sum,this.jzDataProduct,this.jzDataDiscount,this.jzDataFixedPrice);
+        this.ContractPrice = sum;
+    }
+    HeTongPriceCompute() {
+        var HeTongPriceList = [];
+        HeTongPriceList=HeTongPriceComputeLogic(this.jzDataDiscount,this.jzDataProduct);
+        if (HeTongPriceList.length > 0) {
+            this.jzDataDiscount = HeTongPriceList;
+        }
+    }
+    //浠庢暟鎹簱鏇存柊宸蹭繚瀛樼殑鏁版嵁 鏂规  UpdateBy 2021 06 29
+    UpdateSaveDataFixedPriceSelectByID() {
+        var idArr = [];
+        this.jzDataFixedPrice.forEach(item => {
+            idArr.push(item.Id);
+        })
+        selectUpdateFiexedpriceData({
+            ProId: idArr
+        }).then(result => {
+            var newArr = [];
+            this.jzDataFixedPrice.forEach(dp => {
+                var temp = {
+                    ...{},
+                    ...dp
+                };
+                result.forEach(item => {
+                    if (item.Id == temp.Id) {
+                        var keys = Object.keys(temp);
+                        keys.forEach(k => {
+                            var flag = ChangeFiexedData(k);
+                            if (flag && item[k] != undefined && item[k] != temp[k]) {
+                                temp[k] = item[k];
+                                this.Complate = true;
+                            }
+                        })
+                    }
+                })
+                newArr.push(temp);
+            })
+            this.jzDataFixedPrice = newArr;
+            this.updateIdStr("3");
+        })
+    }
+    //鍔犺浇鎶ヤ环鏁版嵁
+    QuoteData = [];
+    OnLoadQuoteData(idStr) { //idStr  鎶ヤ环id
+        GetQuoteData({
+            QuoteID: idStr
+        }).then(result => {
+            var responseObj = JSON.parse(result);
+            this.QuoteData = initquoT(responseObj,this.buttonIsShow,this.initDataTableFixedPrice,this.initDataTableDiscount,this.initDataTableOtherData,this.initDataTableCommonly);
+            this.buttonIsShow = buttonIsShowE;
+            this.initDataTableFixedPrice = initDTFP;
+            this.initDataTableDiscount = initDTD;
+            this.initDataTableOtherData = initDTOD;
+            this.initDataTableCommonly = initDTC;
+            this.jzDataTableFixedPriceIsShow = true;
+            this.jzDataTableDiscountIsShow = true;
+            this.QTcss = QTcssE(this.pricePolicyflag);
+            this.pricePolicyflag = true;
+            if(!this.QuoteDecision){
+                this.Save_button = true;
+                this.Decision_button = true;
+            }
+        })
+    }
+    //鎵撳嵃鎸夐挳
+    PrintButton(){
+        var id = this.quoId;
+        if (id == null || id == '') {
+            this.Alert(Error_Message33,'error');
+            return false;
+        }
+        return this.chkEstimation_Entry_Possibility(id);
+    }
+    chkEstimation_Entry_Possibility(q) {
+        try {
+            this.OnLoading(true);
+            var dataChun = PrintButtonLoc(this.quo,this.oppInfo,this.jzDataToBeproduct,this.CheckItem,this.WinOrDecideAlert,
+                this.productStatusUpdated,this.enableSales,this.oppId,this.quoId,this.newQuoteFlag,this.changedAfterPrint,this.quoteGurantee_Period,
+                this.quotemultiYearWarranty,this.selection_hp,this.SkipQuotefilg,this.QuoteDecision)
+            Print(dataChun).then(resaut=>{
+                debugger
+                this.quoId = saverebackloc(resaut,this.quoId,this.nafg);
+                this.CSVflag = this.quoId?false:true;
+                this.OnLoading(false);
+                if(errorflg){
+                   this.Alert(alertExp,'error');
+                   this.nafg = nafgExp;
+                }
+                if(flg){
+                    this.location = 'Id='+ this.quoId; 
+                    this.copyid = '';
+                    this.oppId = '';
+                    this.connectedCallback();
+                }
+                openQuotePage(this.quo.Contract__c,errorflg,this.quoId);
+            });
+        } catch (e) {
+            this.Alert(e,'error');
+        }
+    }
+    //涓嶄繚瀛樿繑鍥炴寜閽�
+    noSaveback(){
+        window.open('/' +this.oppId, '_self');
+    }
+    //淇濆瓨骞惰繑鍥�
+    Sback = false;
+    Saveandback(){
+        this.Sback = true;
+        this.savebuttonClick();
+    }
+    //decide鎶ヤ环鎸夐挳
+    decisionbuttonClick(){
+        debugger
+        this.checkchangedAfterPrint('de');
+        if(this.fg){
+            this.decisionlo();
+        }
+    }
+    decisionlo(){
+        var ff = decisionlol(this.jzDataToBeproduct,this.oppInfo,this.QuotationCalculationFag);
+        if(ff){
+            this.Alert(alertExp,'error');
+        }else{
+            this.chkSalesPossibilityDecision();
+        }
+    }
+    chkSalesPossibilityDecision() {
+        try {
+            debugger
+            this.tobeflag=false;
+            var quoc = saveEvoluationLogic(this.quo,this.oppInfo,this.jzDataToBeproduct);
+            var oppInfoc = oppInfosave;
+            var quoLineItemc = quoLineItemsave;
+            var quoLineItemCan = JSON.stringify(quoLineItemc);
+            var CheckItemCan = JSON.stringify(this.CheckItem);
+            var oppInfoCan = JSON.stringify(oppInfoc);
+            var quoCan = JSON.stringify(quoc);
+            this.OnLoading(true);
+            if(this.WinOrDecideAlert &&(!this.productStatusUpdated)){
+                this.PriceStatusUpdate();
+            }
+            QuoteDecision({activitiesCan:quoLineItemCan,
+                CheckItemCan:CheckItemCan,
+                WinOrDecideAlertc:this.WinOrDecideAlert,
+                productStatusUpdatedc:this.productStatusUpdated,
+                oppInfoc:oppInfoCan,
+                quoc:quoCan,
+                enableSalesc:this.enableSales,
+                oppIdc:this.oppId,
+                quoIdc:this.quoId,
+                newQuoteFlagc:this.newQuoteFlag,
+                changedAfterPrintc:this.changedAfterPrint,
+                quoteGurantee_Periodc:this.quoteGurantee_Period,
+                quotemultiYearWarrantyc:this.quotemultiYearWarranty,
+                selection_hpc:this.selection_hp,
+                SkipQuotefilgc:this.SkipQuotefilg
+            }).then(resaut=>{
+                debugger
+                var Setmap = new Map()
+                var key = Object.keys(resaut)
+                key.forEach(item=>{
+                    Setmap.set(item,resaut[item]);
+                });
+                if(Setmap.has('errormessage')){
+                    this.Alert(Setmap.get('errormessage'),'error');
+                    if(Setmap.get('act')){
+                        this.jzDataToBeproduct = actState(Setmap.get('act'),this.jzDataToBeproduct);
+                    }
+                }else{
+                    if(Setmap.has('warn')){
+                        this.Alert(Setmap.get('warn'),'warning');
+                        this.jzDataToBeproduct = actState(Setmap.get('act'),this.jzDataToBeproduct);
+                        this.acts = true;
+                        this.actL = Setmap.get('act');
+                    }else{
+                        this.Alert(Setmap.get('success'),'success');
+                    }
+                    if(Setmap.has('quoId')){
+                        window.open('/lightning/n/lexSINewQuoteEntry#Id=' + Setmap.get('quoId'), '_self');
+                        this.location = 'Id='+ Setmap.get('quoId'); 
+                        this.copyid = '';
+                        this.oppId = '';
+                        this.connectedCallback();
+                    }
+                    this.QuoteDecision = true;
+                    this.enableContract = true;
+                    this.Save_button = true;
+                    this.Decisiontag = true;
+                    var lg = this.template.querySelectorAll('c-jzlookuplightning2');
+                        lg.forEach(l=>{
+                            l.todisabled();
+                        })
+                    this.initDataTableToBeproduct.columns[4].editable = false;
+                    if (this.QuoteDecision == false) {
+                        this.sap_button = true;
+                    } else if (this.specialAuthority == false) {
+                        this.sap_button = true;
+                    } else {
+                        this.sap_button = false;
+                    }
+                    this.Decision_button = true;
+                }
+                this.nafg = resultFlag(this.nafg,Setmap);
+                this.tobeflag=true;
+                this.OnLoading(false);
+            });
+            return true;
+        } catch (e) {
+            this.Alert(e,'error');
+        }
+    }
+    //淇濆瓨鍒ゆ柇鏄惁鐢熸垚鏂版姤浠锋爣璇�
+    fg = true;
+    changedAfterPrint = false;
+    QuotationCalculationFag = false;
+    checkchangedAfterPrint(dec) {
+        this.fg = true;
+        var id = this.quoId;
+        this.changedAfterPrint = false;
+        var detailChanged = false;
+        if (!id) {
+            return;
+        }else{
+            this.fg = false;
+        }
+        var activities = checkch(this.jzDataToBeproduct);
+        getQuoteLineItem({
+            quoId: id
+        }).then(results=>{
+            var quote_Date__c = null;
+            if (results.length > 0) {
+                quote_Date__c = results[0]['Quote']['Quote_Date__c'];
+            }
+            if (!detailChanged) {
+                if (activities.length != results.length) {
+                    detailChanged = true;
+                }
+            }
+            if (!detailChanged) {
+                for (var j = 0; j < results.length; j++) {
+                    if (results[j].PricebookEntryId != activities[j].PricebookEntryId ||
+                        results[j].SFDA_Status__c != activities[j].SFDA_Status__c ||
+                        results[j].UnitPrice__c != activities[j].UnitPrice__c ||
+                        results[j].ListPrice__c != activities[j].ListPrice__c ||
+                        results[j].Quantity != activities[j].Quantity
+                    ) {
+                        detailChanged = true;
+                        break;
+                    }
+                }
+            }
+            if(dec === 'de'){
+                var IsQuoteTrial = this.quo.IsQuoteTrial__c;
+            }else if(dec === 'sa'){
+                var IsQuoteTrial = this.ifquocom;
+            }
+            if (detailChanged && ((quote_Date__c != null && quote_Date__c != "" && quote_Date__c != undefined) || IsQuoteTrial)) {
+                this.changedAfterPrint = true;
+            }
+            if(detailChanged && !this.changedAfterPrint){
+                this.QuotationCalculationFag= true;
+            }else{
+                this.QuotationCalculationFag= false;
+            }
+            if(dec === 'de'){
+                this.decisionlo();
+            }else if(dec === 'sa'){
+                this.sal();
+            }
+        });
+        return;
+    }
+    calFromQuoAmont() {
+        var x = 0,
+            y = 0;
+        x = this.quo.hidden_Estimation_List;
+        x = localParseFloat(x);
+        y = this.quo.Quote_Adjust_Amount_Page__c;
+        this.quo.Quote_Adjust_Amount_Page__c = toNumComma(y);
+        y = localParseFloat(y);
+        var noDiscountPriceTotal = this.hidden_MultiYearWarrantyTotalPrice;
+        noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
+        this.quo.QuoteTotal_Page__c = toNumComma(y + x + noDiscountPriceTotal);
+        var z = this.quo.Estimation_List_Price__c;
+        var id = this.quoId;
+        if(!id){
+            var IsQuoteTrial = this.quo.IsQuoteTrial__c;
+            if(!IsQuoteTrial){
+                var mp =this.quo.MultiYearWarrantyTotalPrice__c;
+                mp = localParseFloat(mp);
+                var num = this.quo.Quote_Adjust_Calculate__c;
+                num = localParseFloat(num);
+                this.quo.Quote_Adjust_Calculate__c = toNumComma(num);
+                num = (100 + num) / 100;
+                z = localParseFloat(z);
+                var rh = this.oppInfo.rate_hospital;
+                var ra = this.oppInfo.rate_agency1;
+                this.quo.Dealer_Final_Price_Page__c = toNumComma(z*rh);
+                this.quo.OCM_Agent1_Price_Page__c = Saleslet ? toNumComma(z*num*ra+mp) : '';
+                this.setOCMAmount();
+                this.calFromContactPrice();
+            }
+        }
+        if (y == 0) {
+            this.quo.Quote_Adjust_Calculate__c = 0;
+            this.UnitPriceUpdate();
+        } else {
+            this.quoteTotalPriceAction();
+        }
+    }
+    UnitPriceUpdate() {
+        this.jzDataToBeproduct = UnitPriceUpdateLogic(this.quo,this.jzDataToBeproduct,this.QuoteDecision_Button);
+        this.quo = quoExp;
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.Subtotalupdate();
+        this.calUnitPriceTotal();
+        this.quoteTotalPrice();
+    }
+    Subtotalupdate() {
+        this.jzDataToBeproduct = SubtotalupdateLogic(this.jzDataToBeproduct);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+    }
+    quoteTotalPriceAction() {
+        this.jzDataToBeproduct = quoteTotalPriceActionLogic(this.quo,this.jzDataToBeproduct,this.hidden_MultiYearWarrantyTotalPrice,this.QuoteDecision_Button);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.quo = quoExp;
+        this.calUnitPriceTotal();
+        this.QuoteAdjust();
+        this.DisAmountfunction();
+    }
+    
+    //鍙栨秷甯傚満澶氬勾淇濅慨change浜嬩欢
+    multiYearWarrantyChange(event){
+        debugger
+        this.quo.multiYearWarranty__c = event.detail.checked;
+        this.calPriceAll();
+    }
+    //涓绘満涓嶅甫鐩戣鍣ㄥ彴杞hange浜嬩欢
+    MainEngineWithoutMonitorChange(event){
+        this.quo.MainEngineWithoutMonitor__c = event.detail.checked;
+    }
+    //璺ㄧ瀹hange浜嬩欢
+    InterdepartmentalChange(event){
+        this.quo.Interdepartmental__c = event.detail.checked;
+        this.calPriceAll();
+    }
+    //鍗曚环change浜嬩欢
+    UnitPriceChange(event){
+        this.quo.Unit_Price__c = event.detail.checked;
+    }
+    //鎶ヤ环閲戦change浜嬩欢
+    OfferAmountChange(event){
+        this.quo.Offer_Amount__c = event.detail.checked;
+    }
+    //鎶ヤ环鎬婚change浜嬩欢
+    TOTALChange(event){
+        this.quo.TOTAL__c = event.detail.checked;
+    }
+    //浼樻儬鎶樻墸change浜嬩欢
+    DiscountChange(event){
+        this.quo.Discount__c = event.detail.checked;
+    }
+    //浼樻儬浠锋牸change浜嬩欢
+    PricingChange(event){
+        this.quo.Pricing__c = event.detail.checked;
+    }
+    //浼樻儬鎴愪氦浠穋hange浜嬩欢
+    PreferentialTradingPriceChange(event){
+        this.quo.Preferential_Trading_Price__c = event.detail.checked;
+    }
+    //淇濅慨骞撮檺change浜嬩欢
+    PreferentialGuranteePeriodChange(event){
+        this.quo.Preferential_Gurantee_Period__c = event.detail.checked;
+    }
+    //鍚堝悓閰嶇疆change浜嬩欢
+    ContractcChange(event){
+        this.quo.Contract__c = event.detail.checked;
+    }
+    
+    //涓绘満瑁呮満鍦� start
+    //涓绘満瑁呮満鍦� optionList
+    HostInstallationLocationoptionsvalue = [];
+    get HostInstallationLocationoptions() {
+        if(this.HostInstallationLocationoptionsvalue.length<=0){
+            getPicklistValues({objstr:'Quote',fld:'Installation_location__c',ifempty:true}).then(keyvalue=>{
+                this.HostInstallationLocationoptionsvalue = keyvalue;
+            });
+        }else{
+            return this.HostInstallationLocationoptionsvalue
+        }
+    }
 
+    HostInstallationLocationhandleChange(event) {
+        this.quo.Installation_location__c = event.detail.value;
+    }
+    //鍚堝悓淇濅慨鏈燂紙骞达級optionList
+    ContractWarrantyPeriodYearOptionsvalue = [];
+    get ContractWarrantyPeriodYearOptions() {
+        if(this.ContractWarrantyPeriodYearOptionsvalue.length<=0){
+            getPicklistValues({objstr:'Quote',fld:'Gurantee_Period__c',ifempty:false}).then(keyvalue=>{
+                this.ContractWarrantyPeriodYearOptionsvalue = keyvalue;
+            });
+        }else{
+            return this.ContractWarrantyPeriodYearOptionsvalue
+        }
+    }
 
+    ContractWarrantyPeriodYearHandleChange(event) {
+        this.quo.Gurantee_Period__c = event.detail.value;
+        this.calGuranteePeriod();
+    }
+    // 鏇存柊澶氬勾淇濅慨 淇濅慨鏈�
+    //闅愯棌鍚堝悓淇濅慨鏈燂紙骞达級
+    HiddenGurantee_Period;
+    calGuranteePeriod() {
+        var AllGurantee_Period = this.quo.Gurantee_Period__c;
+        this.HiddenGurantee_Period = AllGurantee_Period;
+        this.jzDataToBeproduct = calGuranteePeriodLogic(this.jzDataToBeproduct,AllGurantee_Period);
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+    }
+    //鍚堝悓淇濅慨鏈燂紙骞达級end
+    //鎶ヤ环鍙樺寲 optionList
+    QuotationChangesOptionsvalue = [];
+    get QuotationChangesOptions() {
+        if(this.QuotationChangesOptionsvalue.length<=0){
+            getPicklistValues({objstr:'Quote',fld:'QuotationChange__c',ifempty:true}).then(keyvalue=>{
+                this.QuotationChangesOptionsvalue = keyvalue;
+            });
+        }else{
+            return this.QuotationChangesOptionsvalue
+        }
+    }
 
+    QuotationChangesHandleChange(event) {
+        this.quo.QuotationChange__c = event.detail.value;
+    }
+    //鎶ヤ环鍙樺寲 end
 
-    //     function changeV() {
-    //         var speed = document.getElementById('speed');
-    //         //durVal = parseFloat(duration.value);
-    //         spdVal = parseFloat(speed.value);
-    //         //const durationPercent = parseFloat(durVal, 2) * 100
-    //         const speedPercent = parseFloat((spdVal / 100), 2)*100;
-    //         //duration.style.backgroundSize = `${durationPercent}%, 100%`
-    //         speed.style.background = `linear-gradient(to right, #ffa200, white ${speedPercent}%, white`
-    //         document.getElementById("addMultipleRow").value= speed.value;
-            
-    //     };
-    //     function changeI() {
-    //         var speed = document.getElementById('speed');
-    //         //durVal = parseFloat(duration.value);
-    //         spdVal = parseFloat(document.getElementById("addMultipleRow").value);
-    //         //const durationPercent = parseFloat(durVal, 2) * 100
-    //         const speedPercent = parseFloat((spdVal / 100), 2)*100;
-    //         //duration.style.backgroundSize = `${durationPercent}%, 100%`
-    //         speed.style.background = `linear-gradient(to right, #ffa200, white ${speedPercent}%, white`
-    //         speed.value = document.getElementById("addMultipleRow").value;
+    // 缁忛攢鍟嗕竴鍚嶇О杈撳叆妗� start
+    onsearchchange1(event){
+        debugger
+        this.quo.Agency1__c = event.detail.value;
+    }
+    // 缁忛攢鍟嗕竴鍚嶇О杈撳叆妗� end
 
-            
-    //     };
+    // 缁忛攢鍟嗕簩鍚嶇О杈撳叆妗� start
+    onsearchchange2(event){
+        this.quo.Agency2__c = event.detail.value;
+    }
+    // 缁忛攢鍟嗕簩鍚嶇О杈撳叆妗� end
+    //鎶ヤ环浜у搧閫変腑鏁版嵁
+    @track
+    selectjzDataTableToBeproduct = [];
+    SelectedToBeproduct(event) {
+        let arr = event.detail.rows;
+        this.selectjzDataTableToBeproduct = arr;
+    }
+    //鍒犻櫎鎶ヤ环浜у搧鎸夐挳
+    deletejzDataToBeproduct(){
+        debugger
+        var msg = "涓嶈兘鍒犻櫎锛屽鏋滃垹闄ゅ彲鑳藉奖鍝嶈澶囧畨瑁呫�俓n\n璇风‘璁わ紒";
+        if(confirm(msg)){
+            var num = this.jzDataToBeproduct.length;
+            for (var j = 0; j < this.selectjzDataTableToBeproduct.length; j++) {
+                for (var i = 0; i < this.jzDataToBeproduct.length; i++) {
+                    if (this.selectjzDataTableToBeproduct[j].lineNo == this.jzDataToBeproduct[i].lineNo) {
+                        this.jzDataToBeproduct.splice(i, 1);
+                        i--;
+                    }
+                }
+            }
+            var ItemL = MarkRed(this.jzDataToBeproduct);
+            this.jzDataToBeproduct =[].concat(ItemL);
+            if(this.jzDataToBeproduct.length!=num){
+                this.quo.IsQuoteTrial__c = false;
+            }
+            console.warn(this.jzDataToBeproduct.length);
+            this.calPriceAll();
+        }
+    }
+    getTableDataToBeproduct(event) {
+    }
+    @track jzDataToBeproduct = []; 
+    @track tableIsLodingToBeproduct = false;
+    @track
+    initDataTableToBeproduct = initDataTableToBeproductConfig;
+    @track
+    tobeflag = true
+    //鎶ヤ环浜у搧缂栬緫鍒�
+    onsaveToBeproduct(event){
+        debugger
+        this.tobeflag = false
+        var data = event.detail.rows;
+        this.jzDataToBeproduct = onsaveToBeproductLoc(data,this.jzDataToBeproduct);
+        if(fagExp){
+            this.quo.IsQuoteTrial__c = false;
+            this.quoteAgencyTotalPriceAction();
+            this.AgencyDiscountCalculation1();
+        }
+        this.updateNoDiscountPricetotal();
+        this.EstimationListPrice();
+        this.calUnitPriceTotal();
+        this.quoteTotalPrice();
+        setTimeout(() => {
+            this.tobeflag = true;
+        },1);
+    }
+    // 璁$畻 No Discount Price鍚堣
+    updateNoDiscountPricetotal() {
+        var noDiscountPriceTotal = 0;
+        this.jzDataToBeproduct.forEach(jzdtbt=>{
+            var noDiscountPrice = jzdtbt.pageObject.ServicePrice__c;
+            noDiscountPrice = localParseFloat(noDiscountPrice);
+            var Quantity = jzdtbt.Quantity__c;
+            Quantity = localParseFloat(Quantity);
+            noDiscountPriceTotal = noDiscountPriceTotal + noDiscountPrice * Quantity;
+            if (jzdtbt.NoDiscountTotal__c) {
+                jzdtbt.NoDiscountTotal__c = toNumComma(noDiscountPrice * Quantity);
+            }
+        });
+        this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
+        this.hidden_MultiYearWarrantyTotalPrice = noDiscountPriceTotal;
+        this.quo.MultiYearWarrantyTotalPrice__c = toNumComma(noDiscountPriceTotal);
+    }
 
-    //     //SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩鏍囩孩锛� lt 20210928 add start
-    //     MarkRed();
-    //     //SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩鏍囩孩锛� lt 20210928 add end
-        
-}
+    handleRowAction(event){
+        debugger
+        const actionName = event.detail.row;
+    }
+    //========鎼滅储浜у搧閰嶅妯℃�佹===========
+    //鎵撳紑浜у搧閰嶅妯℃�佹寮�鍏�
+    @track
+    showSetProductfalg = false;
+    //浜у搧閰嶅鎸夐挳
+    openSetProduct(event){
+        this.showSetProductfalg = true;
+    }
+    //浜у搧閰嶅 optionList
+    get listViewOptions() {
+        return filterNameoptionList();
+    }
+    // 浜у搧閰嶅妯℃�佹鍏抽棴
+    cancelsetProduct(){
+        this.showSetProductfalg = false;
+        this.jzSetProductData = [];
+    }
+    // 閫傜敤绉戝
+    filterName;
+    // 閫傜敤绉戝Change浜嬩欢
+    filterNameChange(event){
+        this.filterName = event.target.value;
+    }
+    // 浜у搧閰嶅鍚�
+    setSearchName;
+    //浜у搧閰嶅鍚岰hange浜嬩欢
+    jzSearchNameChange(event){
+       this.setSearchName = event.target.value;
+    }
+    //浜у搧閰嶅缂栫爜
+    SearchCode;
+    //浜у搧閰嶅缂栫爜Change浜嬩欢
+    jzSearchCodeChange(event){
+       this.SearchCode = event.target.value;
+    }
+    initDataSetProductTable = initDataSetProductTablefig;
+    
+    @track
+    jzSetProductData = [];
+    @track
+    tableIsSetProductLoding = false;
+    @track
+    IsLoadingjdspt = false;
+    //浜у搧閰嶅鎼滅储
+    jzsetProductsearchbutton(){
+        debugger
+        this.IsLoadingjdspt = true;
+        let SearchCode = this.SearchCode;
+        let filterName = this.filterName;
+        let setSearchName = this.setSearchName;
+        serSetContact({SearchName:setSearchName,SearchCode:SearchCode,filterName:filterName}).then(result=>{
+            this.jzSetProductData = result;
+            this.IsLoadingjdspt = false;
+        });
+    }
+    //浜у搧閰嶅閫変腑鏁版嵁
+    SelectedNewsetProduct = []
+    //浜у搧閰嶅閫変腑鏁版嵁
+    SelectedSetProductFn(event){
+        let arr = event.detail.rows;
+        this.SelectedNewsetProduct = arr;
+    }
+    //杩藉姞浜у搧閰嶅鎼滅储
+    additionaljzsetProductbutton(){
+        debugger
+        var dataChunanshen = additionabuttonLoc(this.SelectedNewsetProduct,this.quo,this.oppInfo,this.jzDataToBeproduct)
+        var num = this.jzDataToBeproduct.length;
+        var isPrepared = DataStatus;
+        var Str = StrExp;
+        if(isPrepared!='Fin'){
+            confirm(isPrepared);
+        }else if(!Str){
+            if(confirm("鎮ㄥ皻鏈�夊彇浠讳綍浜у搧閰嶅锛岀‘璁ゅ畬鎴愪箞锛�")){
+                this.cancelsetProduct();
+            }else{
+            }
+        }else{
+            this.OnLoading(true);
+            setProductEntry(dataChunanshen).then(reslut=>{
+                var tempArr=reslut.split("---");
+                var errormessage=tempArr[0];
+                var quoteLineItem=JSON.parse(tempArr[1]);
+                quoteLineItem = InitializeProductAssignment(quoteLineItem);
+                this.jzDataToBeproduct = quoteLineItem;
+                if(quoteLineItem.length!=num){
+                    this.quo.IsQuoteTrial__c = false;
+                }
+                this.calPriceAll();
+                if(errormessage.indexOf('鎴愬姛') >= 0){
+                    this.Alert(errormessage,'success');
+                }else{
+                    this.Alert(errormessage,'error');
+                }
+                this.OnLoading(false);
+            });
+            this.cancelsetProduct();
+        }
+        this.SelectedNewsetProduct = [];
+    }
+    
+    getTableSetProductData(event) {
+        this.tableIsproductLoding = false;
+    }
+    //======鎼滅储浜у搧閰嶅妯℃�佹===========
+    //=======鏂板Excel瀵煎叆妯℃�佹=======
+    @track
+    showQuoteExcelImport = false;
+    //Excel瀵煎叆鎸夐挳
+    openQuoteExcelImport(event){
+        this.showQuoteExcelImport = true;
+    }
+    // Excel瀵煎叆鎬佹鍏抽棴
+    cancelQuoteExcelImport(){
+        this.showQuoteExcelImport = false;
+        this.exceltextvalue = '';
+    }
+    //Excel瀵煎叆淇濆瓨
+    SavesSQuoteExcelImport(){
+        let Str = this.exceltextvalue;
+        var num = this.jzDataToBeproduct.length;
+        var quoc = saveEvoluationLogic(this.quo,this.oppInfo,this.jzDataToBeproduct);
+        var oppInfoc = oppInfosave;
+        var quoLineItemc = quoLineItemsave;
+        var quoLineItemCan = JSON.stringify(quoLineItemc);
+        var oppInfoCan = JSON.stringify(oppInfoc);
+        var quoCan = JSON.stringify(quoc);
+        this.OnLoading(true);
+            excelImport({excel_text:Str,
+                activitiesCan:quoLineItemCan,
+                oppInfoc:oppInfoCan,
+                quoc:quoCan}).then(reslut=>{
+                    debugger
+                    var tempArr = reslut.split("---");
+                    var errormessage = tempArr[0];
+                    var quoteLineItem = JSON.parse(tempArr[1]);
+                    quoteLineItem = InitializeProductAssignment(quoteLineItem);
+                    this.jzDataToBeproduct = quoteLineItem;
+                    if(quoteLineItem.length!=num){
+                        this.quo.IsQuoteTrial__c = false;
+                    }
+                    this.calPriceAll();
+                    if(errormessage.indexOf('鎴愬姛') >= 0){
+                        this.Alert(errormessage,'success');
+                    }else{
+                        console.log('----------------------------SavesSQuoteExcelImport');
+                        this.Alert(errormessage,'error');
+                    }
+                    this.OnLoading(false);
+                    this.cancelQuoteExcelImport();
+            });
+    }
+    //excel鍊�
+    @track
+    exceltextvalue;
+    //textArea浜嬩欢
+    exceltextChange(event){
+        let value = event.detail.value;
+        this.exceltextvalue = value;
+    }
+    
+    //鎵撳紑鏂板缓浜у搧妯℃�佹寮�鍏�
+    showproductfalg = false;
+    //鏂板鎶ヤ环浜у搧鎸夐挳
+    NewQuotationProducts(event){
+        this.showproductfalg = true;
+    }
+    @track
+    IsLoadingjdpt = false;
+    //閫夋嫨鏁版嵁
+    SelectedNewProduct = [];
+    //鏂板鎶ヤ环浜у搧鍒楄〃閫変簨浠�
+    SelectedProductFn(event) {
+        let arr = event.detail.rows;
+        this.SelectedNewProduct = arr;
+    }
+    //杩藉姞鏂板浜у搧鎸夐挳
+    additionaljzProductbutton(){
+        if(this.SelectedNewProduct.length == 0){
+            if(confirm("鎮ㄥ皻鏈�夊彇浠讳綍浜у搧锛岀‘璁ゅ畬鎴愪箞锛�")){
+                this.cancelProduct();
+            }
+        }else{
+            this.tobeflag = false
+            var selectvlue = this.SelectedNewProduct;
+            var Listvalue = this.jzDataToBeproduct;
+            this.jzDataToBeproduct = additionaljzProductLogic(selectvlue,Listvalue,this.oppInfo.CurrencyIsoCode,this.quo.IsQuoteTrial__c);
+            if(alertExp){
+                this.Alert(alertExp,'error');
+            }
+            setTimeout(() => {
+                this.tobeflag = true;
+            },1);
+            this.quo.IsQuoteTrial__c = IsQuoteTrialExp;
+            this.calPriceAll();
+            this.cancelProduct();
+            this.SelectedNewProduct= [];
+        }
+    }
+    //鏂板鎶ヤ环浜у搧妯℃�佹鍙栨秷鎸夐挳
+    cancelProduct() {
+        this.showproductfalg = false;
+        this.jzProductData = [];
+    }
+    //鏂板鎶ヤ环浜у搧妫�绱㈡潯浠�
+    @track
+    SearchName = '';
+    jzProductsearchChange(event){
+        if(this.SearchName != event.target.value){
+            this.SearchName = event.target.value;
+        }
+    }
+    //鏂板鎶ヤ环浜у搧妫�绱㈡寜閽�
+    jzProductsearchbutton(event){
+        debugger
+        this.IsLoadingjdpt = true;
+        let tradec = this.oppInfo.CurrencyIsoCode;
+        let celon = this.oppInfo.CelonOpportunity;
+        let SearchName = this.SearchName;
+        serContact({tradec:tradec,SearchName:SearchName,celon:celon}).then(result=>{
+            console.warn('1234'+JSON.stringify(result));
+            this.jzProductData = jzProductsearchLogic(result);
+            this.IsLoadingjdpt = false;
+        });
+    }
+    //鏂板鎶ヤ环浜у搧鍒楄〃鍔犺浇鏁版嵁
+    getTableProductData(event) {
+        this.tableIsproductLoding = false;
+    }
+    //鏂板鎶ヤ环浜у搧鍒楄〃鏁版嵁
+    @track jzProductData = [];
+    //鏂板鎶ヤ环浜у搧鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
+    @track tableIsproductLoding = true;
+    // 鏂板鎶ヤ环浜у搧鍒楄〃鍒楅厤缃�
+    @track
+    initDataProductTable = initDataProductTablefig;
+    
+    //鎶ヤ环璁$畻鎵撳紑鎸夐挳 start
+    //鎵撳紑鎶ヤ环璁$畻鏍囪瘑
+    quoteflg = false;
+    @track
+    QTcss="slds-button slds-button_neutral slds-button_stretch lexBorder";
+    showQuotationCalculation(event){
+        if(this.pricePolicyflag){
+            this.QTcss = QTcssE(this.pricePolicyflag);
+            this.pricePolicyflag = false;
+            this.quoteflg = false;
+            this.OnLoadProduct = [];
+            this.jzDataDefault = [];
+            this.OnLoadSaveProduct = [];
+            this.jzDataProduct = [];
+            this.OnLoadDiscount = [];
+            this.jzDataDiscount = [];
+            this.OnLoadFixDiscount = [];
+            this.jzDataFixedPrice =  [];
+            this.ContractPriceCompute();
+            if(!this.QuoteDecision){
+                this.Save_button = false;
+                this.Decision_button = false;
+            }
+        }else{
+            this.quoteflg = true;
+            if(this.QuoteDecision){
+                this.quoteTrialInit();
+            }else{
+                this.savebuttonClick();
+            }
+        }
+    }
+    //鎶ヤ环璁$畻鍖哄煙灞曞紑鏍囪瘑
+    pricePolicyflag = false;
+    //鎶ヤ环璁$畻鎸夐挳灞曞紑鏍囪瘑
+    buttonIsShow = false;
+    //鍚堝悓鎬讳环
+    ContractPrice = 0;
+    ifFTip=true;
+    //淇濆瓨鎶ヤ环璁$畻缁撴灉鎸夐挳鏂规硶
+    saveAllDataProductFn() {
+        var dataChunanshen = saveAllDataProductFnChuanshen(this.jzDataFixedPrice,this.jzDataDiscount,this.quoId,this.QuoteData,this.jzDataProduct,this.jzDataDefault,this.ContractPrice)
+        var newTemp = newTempExp;
+        if (this.jzDataDefault.length == 0) {
+            var ifnunum = saveAllDataProductFnPanduan(this.jzDataProduct,newTemp);
+            var ifnull = ifnullExp;
+            if (ifnull&&ifnunum==1) {
+                this.IsLoading=true;
+                saveAllDataProduct(dataChunanshen).then(result => {
+                    this.IsLoading=false;
+                    this.quo.IsQuoteTrial__c = true;
+                    this.SkipQuotefilg = false;
+                    this.ifquocom = true;
+                    if(this.oppInfo.Sales_Root__c == Sales_Outlet){
+                        var target = {value :this.ContractPrice}
+                        var event = {target:target}
+                        this.OCMAgent1PricePageonChange(event);
+                    }else{
+                        this.quo.Dealer_Final_Price_Page__c = toNumComma(this.ContractPrice);
+                        var target = {value :this.ContractPrice}
+                        var event = {target:target}
+                        this.DealerFinalPricePageChange(event);
+                    }
+                    this.Alert("鏁版嵁宸蹭繚瀛�", 'success');
+                });
+            } else {
+                if(ifnunum==2){
+                    this.ifFTip=false;
+                    this.Alert("浜у搧鏄庣粏涓噾棰濇湁璐熸暟锛屼笉鍙繚瀛�",'error');
+                }else{
+                    this.ifFTip=false;
+                    this.Alert("涓�鑸骇鍝佺殑鍚堝悓浠锋牸涓虹┖锛屼笉鍙繚瀛�",'error');
+                }
+            }
+        } else {
+            this.ifFTip=false;
+            this.Alert("浜у搧鏈�夊畬锛屼笉鍙繚瀛�",'error');
+        }
+    }
+    //鎶ヤ环璁$畻鎵撳紑鎸夐挳 end
+    SelectedFnDefault(rows) {
+        let arr = rows;
+    }
+    //鑾峰彇寰呴�夋嫨浜у搧鍒楄〃鏁版嵁
+    UniqueKey = new Map();
+    getTableDataDefault(event) {
+        let data = [];
+        //todu10
+        GetPromotionDefalut({
+            IdParam: this.quoId
+        }).then(result => {
+            this.jzDataDefaultNotChange = [];
+            this.jzDataDefaultCopy = [];
+            var i = 1;
+            result.forEach(rItem => {
+                rItem.ListPrice = rItem.ListPrice__c;
+                rItem.HangHao = i++;
+                // if (!this.flagall) {
+                rItem.Id = rItem.Product2Id;
+                // }
+                let tempS = {
+                    ...{},
+                    ...rItem
+                };
+                this.jzDataDefaultNotChange.push(tempS);
+                this.jzDataDefaultCopy.push(tempS);
+            });
+            this.getschemedetails();
+            if (this.flagall) {
+                var newList = [];
+                this.OnLoadProduct.forEach(items => {
+                    var DataTemp = {};
+                    result.forEach(reItgem => {
+                        if (reItgem.Id == items.Id) {
+                            DataTemp = reItgem;
+                            return;
+                        }
+                        reItgem.ListPrice = reItgem.ListPrice__c;
+                    })
+                    if (DataTemp != undefined && DataTemp != {}) {
+                        DataTemp = {
+                            ...DataTemp,
+                            ...items
+                        };
+                    }
+                    newList.push(DataTemp);
+                })
+                this.jzDataDefault = newList;
+                this.tableIsLodingDefault = false;
+                this.comparisonUniqueKey();
+                return;
+            } else {
+                result.forEach(rItems => {
+                    rItems.ListPrice = rItems.ListPrice__c;
+                });
+                this.jzDataDefault = result;
+                this.tableIsLodingDefault = false;
+                var event = {
+                    page: 1,
+                    pageLimit: 10,
+                    search: "",
+                    sortOrder: "asc",
+                    sortPlus: undefined,
+                    fag: true
+                };
+                this.getTableDataFix(event);
+            }
+        })
+        this.tableIsLodingDefault = false;
+    }
+    //鏌ヨ浠锋牸鏀跨瓥鏂规鍏宠仈浜у搧鏄庣粏
+    //绠楀嚭鐨勫悎璁�
+    sumTotal = [];
+    getschemedetails() {
+        this.jzDataFixedPrice.forEach(jdfp => {
+            var SeachData = {
+                SearchId: jdfp.Id
+            };
+            GetSearchProductById(SeachData).then(result => {
+                var tempObject = {
+                    ...{},
+                    ...jdfp
+                }
+                jdfp = this.countListAndNod(tempObject, result);
+                this.sumTotal.push(jdfp);
+            });
+        });
+    }
+    @track jzDataDefault = []; //鏁版嵁 寰呴�夋嫨浜у搧鏁版嵁鎹�
+    jzDataDefaultNotChange = [];
+    jzDataDefaultCopy = [];
+    @track tableIsLodingDefault = true;
+    @track
+    initSearchFormDefalt = initSearchFormDefalt2;
+    @track
+    initDataTableDefault = initDataTableDefault2;
+    //*******鎶ヤ环璁$畻寰呴�変骇鍝� end************
+    @track
+    show = false
+    //閫夋嫨淇冮攢鏂规鎵撳紑鎸夐挳
+    showModal(){
+        this.show = true;
+    }
+    //閫夋嫨淇冮攢鏂规妯℃�佹鍙栨秷鎸夐挳
+    cancel() {
+        this.show = false
+    }
+    @track ShowFix;
+    showModalFix() {
+        this.ShowFix = true
+    }
+    cancelFix() {
+        this.ShowFix = false
+    }
+    @track
+    initSearchFormFix = initSearchFormFix2;
+    @track
+    initDataTableFix = initDataTableFix2;
 
-// <!-- <template>
-// <!--     <link rel="stylesheet" type="text/css" href="{!URLFOR($Resource.blockUIcss)}"/>
-//     <script src="{!URLFOR($Resource.jquery183minjs)}"></script>
-//     <script src="{!URLFOR($Resource.PleaseWaitDialog)}"></script>
-//     <script src="{!URLFOR($Resource.NewQuoteEntryJS)}"></script>
-//     <script src="{!URLFOR($Resource.clipboardminjs)}"></script>
-//     <script src="{!URLFOR($Resource.connection20)}"></script>
-//     <script src="{!URLFOR($Resource.apex20)}"></script>
-//     <script src="{!$Resource.lexSINewQuoteEntry+ '/lexSINewQuoteEntry.js'}"></script>
-//     <link rel="stylesheet" type="text/css" href="{!$Resource.lexSINewQuoteEntry + '/lexSINewQuoteEntry.css'}"/> -->
-//     <form id="mainForm">
-//         <lightning-formatted-text id="hiddenQuoid" value="{!quoid}" style="display:none;"/>
-//         <lightning-input type="hidden" id="oppoidforCSV" value="{!oppoidforCSV}"/>
-//         <lightning-input type="hidden" id="changedAfterPrint" value="{!changedAfterPrint}"/>
-//         <lightning-input type="hidden" id="changedAfterBid" value="{!changedAfterBid}"/>
-//         <lightning-input type="hidden" id="productStatusUpdated" value="{!productStatusUpdated}"/>
-//         <!-- 20211011 lt add MarkRed();-->
-//         <apex:actionFunction action="{!setProductEntry}" name="setProductEntry" reRender="mainForm" oncomplete="unblockUI();calPriceAll();MarkRed();">
-//             <apex:param assignTo="{!    }" name="setProduct_text" value=""/>
-//         </apex:actionFunction>
-//         <!-- 20211011 lt add MarkRed();-->
-//         <apex:actionFunction action="{!excelImport}" name="excelImport" reRender="mainForm" oncomplete="unblockUI();calPriceAll();MarkRed();">
-//             <apex:param assignTo="{!excel_text}" name="select_index" value=""/>
-//         </apex:actionFunction>
-//         <apex:actionFunction action="{!addRow}" name="addRow" reRender="mainForm" oncomplete="unblockUI();calPriceAll();">
-//             <apex:param assignTo="{!rowIdx}" name="rowIdx" value=""/>
-//         </apex:actionFunction>
-//         <!-- 娣诲姞琛� -->
-//         <apex:actionFunction action="{!addMultipleRow}" name="addMultipleRow" reRender="mainForm" oncomplete="unblockUI();calPriceAll();">
-//         <apex:param assignTo="{!rowIdx}" name="rowIdx" value=""/>
-//         </apex:actionFunction>
-//         <apex:actionFunction action="{!DownloadCsv}" name="DownloadCsv" reRender="oppoidforCSV" oncomplete="DownloadCsvJs();"/>
-//         <apex:actionFunction action="{!submitOppoApplyStock}" name="submitOppoApplyStock" reRender="mainForm,message1" oncomplete="unblockUI();"/>
-//         <apex:actionFunction action="{!QuoteConfirm}" name="QuoteConfirm" reRender="mainForm" oncomplete="unblockUI();ReloadPage();"/>
-//         <apex:actionFunction action="{!getSalesId1}" name="getSalesId1" reRender="mainForm"/>
-//         <apex:actionFunction action="{!getSalesId2}" name="getSalesId2" reRender="mainForm"/>
-//           <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗗崟浠疯绠� start -->
-//         <apex:actionFunction action="{!PriceStatusUpdate}" name="PriceStatusUpdate" reRender="listsTable" oncomplete="unblockUI();calPriceAll();alert('鏇存柊瀹屾瘯锛�');quoteAgencyTotalPriceAction();"/>
-//             <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗗崟浠疯绠� end -->
-//         <!-- CHAN-B8RCU9 start -->
-//         <apex:actionFunction action="{!QuoteDecision}" name="QuoteDecision" reRender="mainForm" oncomplete="unblockUI();alertUpdatewhenDecide();"/>
-//         <!-- CHAN-B8RCU9 start -->
+    @track jzDataFix = [];
+    @track tableIsLodingFix = true;
+    // 鐐瑰嚮鎼滅储瑙﹀彂
+    searchDataFix(event) {
+        let searchParams = event.detail.searchParams || {};
+        this.template.querySelector('[data-parent-id="parent-div-idFix"]').refreshDataTable({
+            searchParams: searchParams
+        });
+    }
+    deleteFixedPrice(){
+        debugger
+        var fag = deleteFixedPriceLogic(this.SelectedFnDataFixedPrice,this.CompareFullData);
+        this.SelectedFnDataFixedPrice = SelectedFnDataFixedPriceExp;
+        this.CompareFullData = CompareFullDataExp;
+        var ids = idsExp;
+        if (fag) {
+            //鍒犻櫎鎵�閫夋柟妗堝尮閰嶇殑浜у搧
+            this.DeleteChangesFn(ids, "浠锋牸鏀跨瓥");
+            //璋冪敤鍒犻櫎浠锋牸鏀跨瓥
+            this.deleteFixedPriceTemp();
+            //鍚堝悓浠锋牸姹囨��
+            this.ContractPriceCompute();
+        }else{
+            this.Alert("涓�鑸骇鍝佷负寮哄埗鍖归厤锛屼笉鍙垹闄�",'error');
+        }
+    }
+    // 鍒犻櫎鎵�閫夋柟妗堝尮閰嶇殑浜у搧
+    DeleteChangesFn(ids, TypeName) { //  ids  閫変腑鐨勬柟妗圛d TypeName 鏂规绫诲瀷
+        var CompareFullDataTemp = [];
+        ids.forEach(id => {
+            this.jzDataProduct = DeleteChangesFnLogic(id,TypeName,CompareFullDataTemp,this.CompareFullData,this.jzDataFixedPrice,this.jzDataDiscount,this.jzDataProduct,this.jzDataDefault,this.jzDataDefaultNotChange);
+            CompareFullDataTemp = CompareFullDataTempExp;
+            this.jzDataFixedPrice = jzDataFixedPriceExp;
+            this.jzDataDiscount = jzDataDiscountExp;
+            this.jzDataDefault = jzDataDefaultExp;
+            this.jzDataDefaultNotChange = jzDataDefaultNotChangeExp;
+            //鍚堝悓浠锋牸姹囨��
+            this.ContractPriceCompute();
+        });
+        this.CompareFullData = CompareFullDataTemp;
+    }
+    //鍒犻櫎浠锋牸鏀跨瓥
+    deleteFixedPriceTemp() {
+        this.jzDataFixedPrice = deleteFixedPriceTempLogic(this.SelectedFnDataFixedPrice,this.jzDataFixedPrice,this.CompareFullData);
+        this.CompareFullData = CompareFullDataExp;
+        this.SelectedFnDataFixedPrice = [];
+    }
+    //浠锋牸鏀跨瓥鍒楄〃閫変腑鐨勬暟鎹�
+    @track SelectedFnDataFixedPrice = [];
+    //浠锋牸鏀跨瓥閫夋嫨浜嬩欢
+    SelectedFnFixedPrice(event) {
+        let arr = event.detail.rows;
+        this.SelectedFnDataFixedPrice = arr;
+    }
+    //浠锋牸鏀跨瓥鍒楄〃閰嶇疆鍒�
+    @track
+    initDataTableFixedPrice = initDataTableFixedPrice2;
+    //浠锋牸鏀跨瓥鍔犺浇鏁版嵁鏂规硶
+    getTableDataFixedPrice(event) {
+        this.tableIsLodingFixedPrice = false;
+    }
+    //浠锋牸鏀跨瓥鏁版嵁
+    @track jzDataFixedPrice = [];
+    //浠锋牸鏀跨瓥鍒楄〃loding
+    @track tableIsLodingFixedPrice = true;
+    //浠锋牸鏀跨瓥鍒楄〃灞曠ず鏍囪瘑
+    @track jzshows3 = true;
+    //瀵规瘮浠锋牸鏀跨瓥璧嬪��
+    comparativeAssignment() {
+        debugger
+        this.jzDataFixedPrice.forEach(jdfp => { //浠锋牸鏀跨瓥闆嗗悎
+            this.sumTotal.forEach(stl => { //鍒濆鍖栨椂浠锋牸鏀跨瓥闆嗗悎
+                if (jdfp.Id == stl.Id) {
+                    if (stl.sumListPrice != undefined && stl.sumNoDiscount != undefined) {
+                        jdfp.sumListPrice = stl.sumListPrice;
+                        jdfp.sumNoDiscount = stl.sumNoDiscount;
+                    }
+                }
+            });
+        });
+    }
+    //淇濆瓨浠锋牸鏀跨瓥缂栬緫鍒楁柟娉�
+    handleSaveFixedPrice(event) {
+        this.comparativeAssignment();
+        let editnewDate = [];
+        editnewDate = handleSaveFixedPriceLogic(this.CompareFullData,event,this.jzDataFixedPrice,this.jzDataDefaultCopyQuantityList,this.jzDataDefault);
+        this.CompareFullData = CompareFullDataExp;
+        var HeTongTotal = HeTongTotalExp;
+        let newData = newDataExp;
+        var boolean = booleanExp;
+        var newArrs = [].concat(editnewDate);//20230214
+        if (boolean == 1) {
+            this.jzDataFixedPrice = newData;
+            newArrs.forEach(item => {
+                this.ComputeData(item.Id, '浠锋牸鏀跨瓥');
+                this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
+            });
+            this.jzDataProduct = this.newArrsTemp3.concat(this.newArrsTemp4);//20230213
+            //鍚堝悓浠锋牸姹囨��
+            this.ContractPriceCompute();
+        } else if (boolean == 3) {
+            this.Alert("淇敼閿欒锛屾鏁板凡缁忚秴杩囨渶澶у�硷紝涓嶅彲澧炲姞",'error');
+        } else if (boolean == 4) {
+            this.Alert("淇敼閿欒锛屾鏁颁笉鍙互涓�0",'error');
+        } else if (boolean == 5) {
+            this.Alert("璇ユ柟妗堜负寮哄埗鍖归厤锛屾鏁颁笉鍙慨鏀癸紒",'error');
+        } else if (boolean == 6) {
+            var str1 = String(HeTongTotal);
+            var str = "淇敼閿欒锛屽悎鍚屼环鏍间笉寰楀皬浜�";
+            var str3 = str + str1;
+            this.Alert(str3,'error');
+        }
+        //鍒锋柊
+        this.jzshows3 = false;
+        this.IsLoading3 = true;
+        setTimeout(() => {
+            this.IsLoading3 = false;
+            this.jzshows3 = true;
+        }, 800);
+    }
+    newArrsTemp3 = [];
+    newArrsTemp4 = [];
+    //=======淇冮攢鏂规妯℃�佹 start=======
+    // 淇冮攢鏂规鎼滅储妗嗘悳绱㈡寜閽柟娉�
+    searchData(event) {
+        let searchParams = event.detail.searchParams || {};
+        let temp = this.template;
+        this.template.querySelector('[data-parent-id="parent-div-id"]').refreshDataTable({
+            searchParams: searchParams
+        });
+    }
+    // 淇冮攢鏂规鎼滅储妗嗛厤缃垪
+    @track
+    initSearchForm = initSearchForm2;
+    //淇冮攢鏂规鍒楄〃閫変簨浠�
+    SelectedFn(event) {
+        let arr = event.detail.rows;
+        if (arr.length > 1) {
+            this.Alert("浠锋牸鏀跨瓥鍙彲閫夋嫨涓�涓柟妗�",'error');
+        } else {
+            this.ifqianpi = true;
+            this.GetSearchProductByIdFn(arr[0].Id, arr[0], "浠锋牸鏀跨瓥", [], arr);
+        }
+        this.cancel();
+    }
+    //淇冮攢鏂规鍒楄〃鍔犺浇鏁版嵁
+    // 鍚庡彴浜や簰锛岃幏鍙栧垪琛ㄦ暟鎹�
+    getTableData(event) {
+        debugger
+        let listQuery = event;
+        if (event.fag == undefined) {
+            listQuery = event.detail.listQuery;
+        }
+        GetPromotionPromotionSearch(listQuery).then(result => { //淇冮攢鏂规鏌ヨ缁撴灉
+            debugger
+            var responseObj = JSON.parse(result);
+            responseObj.records.forEach(item => {
+                var SeachData = {
+                    SearchId: item.Id
+                };
+                GetSearchProductById(SeachData).then(result => { //鏂规鍏宠仈鐨勪骇鍝�
+                    debugger
+                    var newarrjdf = SearchProductByIdLogic(result,this.jzDataFixedPrice,this.jzDataDefaultCopyQuantityList,item);
+                    this.jzDataDefaultCopyQuantityList = jzDataDefaultCopyQuantityListExp;
+                    this.jzDataFixedPrice = [].concat(newarrjdf);
+                });
+            });
+            this.jzData = [].concat(responseObj.records);
+            this.tableIsLoding = false;
+        })
+    }
+    jzDataDefaultCopyQuantityList = [];
+    // 鍚庡彴浜や簰锛岃幏鍙栦竴鑸骇鍝佸垪琛ㄦ暟鎹�
+    ifqianpi = true;
+    getTableDataFix(event) {
+        let listQuery = event;
+        if (event.fag) {
+            this.ifqianpi = false;
+        } else {
+            listQuery = event.detail.listQuery;
+        }
+        listQuery.pageLimit = 200;
+        GetNormalProductSearch(listQuery).then(result => {
+            //BBBB 
+            var tempArr = result.split("--");
+            var responseObj = JSON.parse(tempArr[0]);
+            var responseObjAll = JSON.parse(tempArr[1]);
+            //鎺掑簭
+            var newArrs = new Array;
+            responseObjAll.forEach(item => {
+                newArrs.push(item);
+            })
+            newArrs.sort((a, b) => {
+                return a.OrderNo__c - b.OrderNo__c;
+            })
+            newArrs.forEach(item => { //鎺掑簭鍚庣殑涓�鑸骇鍝佷富鏁版嵁
+                var SeachData = {
+                    SearchId: item.Id
+                };
+                GetSearchProductById(SeachData).then(results => {
+                    var newarrjdf = GetSearchProductByIdLogic(item,results,this.jzDataDefaultCopyQuantityList,this.jzDataFixedPrice);
+                    this.jzDataFixedPrice = [].concat(newarrjdf);
+                    var iflag = iflagExp;
+                    this.jzDataDefaultCopyQuantityList = jzDataDefaultCopyQuantityListExp;
+                    if (event.fag && iflag) {
+                        var newArr = [];
+                        newArr.push(item);
+                        this.ifqianpi = false;
+                        this.GetSearchProductByIdFn(item.Id, item, "浠锋牸鏀跨瓥", [], newArr, false);
+                    }
+                });
+            });
+            var respons = [];
+            responseObj.records.forEach(rrds => { //鏌ュ嚭鐨勫墠鍗佹潯
+                responseObjAll.forEach(rsja => { //鏌ュ嚭鐨勬墍鏈変竴鑸骇鍝佹暟鎹�
+                    if (rrds.Id == rsja.Id) {
+                        respons.push(rsja);
+                    }
+                })
+            })
+            this.jzDataFix = [].concat(respons);
+            this.tableIsLodingFix = false;
+        })
+    }
+    SelectedFnFix(event) {
+        let arr = event.detail.rows;
+        this.ifqianpi = true;
+        if (arr.length > 1) {
+            this.Alert("浠锋牸鏀跨瓥鍙彲閫夋嫨涓�涓柟妗�",'error');
+        } else {
+            //鑾峰彇鏁版嵁
+            this.GetSearchProductByIdFn(arr[0].Id, arr[0], "浠锋牸鏀跨瓥", [], arr);
+        }
+        this.cancelFix();
+    }
+    //浠锋牸鏀跨瓥鍖归厤
+    GetSearchProductByIdFn(idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow = true) {
+        //dddd
+        var SeachData = {
+            SearchId: idStr
+        };
+        GetSearchProductById(SeachData).then(result => {
+            var tempObject = {
+                ...{},
+                ...jzDataProductParam
+            }
+            jzDataProductParam = this.countListAndNod(tempObject, result);
+            arrData = [].concat(jzDataProductParam);
+            //杩斿洖鏁版嵁姣旇緝瑙勫垯
+            this.CompareData(result, idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow);
+        })
+    }
+    //璁$畻listPrice鐨勫拰浠ュ強nod鍜�
+    countListAndNod(item, result) {
+        var ifTrade = this.QuoteData[0].Opportunity.Trade__c; //鍐呭璐镐俊鎭�
+        var copydate=this.jzDataDefaultCopy;
+        var DeftCopyQtyList = this.jzDataDefaultCopyQuantityList;
+        //璁$畻list鍜宯od鍚堣閫昏緫
+        item=countListAndNodLogic(ifTrade,copydate,item,result,DeftCopyQtyList);
+        this.jzDataDefaultCopyQuantityList=DeftCopyQtyLists;
+        var arr = {
+            ...{},
+            ...item
+        };
+        return arr;
+    }
+    //鍖归厤浠锋牸鏀跨瓥鏃舵暟鎹瘮杈冭鍒�
+    CompareData(list, idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow) {
+        var TempsJzDataToCompare = CompareDataL(list,this.jzDataDefault);
+        var isChange = isChangeExp;
+        //End
+        if (TempsJzDataToCompare.length == list.length&&list.length!=0) {
+            TempsJzDataToCompare.forEach(TempsItems => {
+                this.ComparePushData(TempsItems.item.Quantity, TempsItems.element.Quantity__c, TempsItems.element.Asset_Model_No__c, idStr, jzDataProductParam, TypeName);
+            });
+            //鍒ゆ柇鏄惁鏄剧ず 鎻愮ず妗�
+            if (isShow) {
+                if (this.ifqianpi) {
+                    this.Alert("淇冮攢鏂规閫夋嫨瀹屾垚", 'success');
+                }
+            }
+        } else {
+            if (isShow) {
+                if (this.ifqianpi) {
+                    this.Alert("淇冮攢鏂规涓嶆弧瓒筹紝璇烽噸鏂伴�夋嫨",'error');
+                }
+            }
+            return;
+        }
+        if (isChange) {
+            this.ChangeNumZeroTrueChanges();
+        }
+        var temps = this.CompareFullData;
+        //娣诲姞
+        this.UpdateJZData(arrData);
+        //鏇存柊娆℃暟
+        this.updatesNums();
+        //鍚堝苟閲嶅浠锋牸鏀跨瓥鏂规
+        var jzarr = [].concat(this.jzDataFixedPrice);;
+        this.MergeDuplicateSchemes(jzarr);
+        //淇濆瓨鏈�澶ф鏁�
+        this.savecount(idStr);
+        //璁$畻浠锋牸
+        this.ComputeData(idStr, '浠锋牸鏀跨瓥');
+    }
+    ComparePushData(length, Quantity, Asset_Model_No__c, Id, jzDataProductParam, TypeName) {
+        //淇敼 浜у搧鏄庣粏
+        let num = parseInt(length / Quantity);
+        var newDataDefault = ComparePushDataLogic(this.jzDataDefault,this.jzDataProduct,Asset_Model_No__c,Id,TypeName,jzDataProductParam,Quantity,num);
+        this.jzDataProduct = jzDataProductExp;
+        this.ContractPriceCompute();
+        this.jzDataDefault = newDataDefault;
+        this.ChangeNumZeroTrue();
+        this.AddNums(TypeName, Asset_Model_No__c, num, Id);
+    }
+    ChangeNumZeroTrueChanges() {
+        if (this.jzDataDefault.length != this.ChangeNumZeroTrueData) {
+            this.jzDataDefault = this.ChangeNumZeroTrueData;
+        }
+    }
+    UpdateJZData(arrs) { //arrs  閫変腑鐨勬暟鎹泦鍚�
+        if (this.jzDataFixedPrice == null || this.jzDataFixedPrice.length <= 0) {
+            this.jzDataFixedPrice = arrs;
+        } else {
+            this.jzDataFixedPrice = this.jzDataFixedPrice.concat(arrs);
+        };
+    }
+    // =======鏇存柊淇冮攢鏂规娆℃暟鏁版嵁
+    updatesNums() {
+        var jzDataFixedPriceTemp = [].concat(this.jzDataFixedPrice);
+        var jzDataDiscountTemp = [].concat(this.jzDataDiscount);
+        var CompareFullData = this.CompareFullData;
+        updatesNumsLogic(jzDataFixedPriceTemp,jzDataDiscountTemp,CompareFullData);
+        this.jzDataFixedPrice = jzDataFixedPriceTemps;
+        this.jzDataDiscount = jzDataDiscountTemps;
+    }
+    //鍚堝苟閲嶅浠锋牸鏀跨瓥鏂规
+    MergeDuplicateSchemes(SchemeSet) {
+        var arr = [];
+        arr = MergeDuplicateSchemesLogic(this.CompareFullData,SchemeSet);
+        this.CompareFullData = CompareFullDataExp;
+        this.jzDataFixedPrice = [].concat(arr);
+        this.ConsolidationProgramProducts(arr);
+    }
+    //璁$畻浠锋牸鏀跨瓥浠锋牸
+    ComputeData(id, category) {
+        this.ReplacementUnitPrice();
+        //鏁版嵁 
+        this.updateIdStr("3");
+        var arrTemp = this.jzDataFixedPrice; // id   浠锋牸鏀跨瓥
+        this.updateIdStr("1");
+        var arrProductTemp = this.jzDataProduct; // PromotionId   浜у搧鏄庣粏
+        var arrTemp2 = this.jzDataDefault; //寰呴�変骇鍝�
+        if (category == '浠锋牸鏀跨瓥') {
+            arrTemp.forEach(item => { // item浠锋牸鏀跨瓥
+                if (id == item.Id) {
+                    item.Total = item.Counts * item.Price_CNY__c;
+                    item.sumNoDiscountTotal = item.sumNoDiscount * item.Counts;
+                    //璁$畻淇冮攢鎬讳环&& item.HeTongTotal == undefined
+                    if (item.Price_CNY__c != undefined) {
+                        if (item.determine != '鏀硅繃') {
+                            if (item.if_Contain_Nod__c) {
+                                item.HeTongTotal = item.Total;
+                            } else {
+                                item.HeTongTotal = item.Total + item.sumNoDiscountTotal;
+                            }
+                        }
+                    }
+                    //璁$畻閫夋嫨淇冮攢鏀跨瓥鐨勭粡閿�鍟嗗崟浠峰拰灏忚
+                    var PromotionHeadRecordId = item.recordTypeName__c;
+                    if (PromotionHeadRecordId == "Promotion") { //淇冮攢鏂规
+                        arrProductTemp = ComputeDataPromotionLogic(this.newArrsTemp3,this.newArrsTemp4,this.jzDataDefaultCopyQuantityList,this.jzDataDefaultCopy,this.QuoteData,arrProductTemp,item,arrTemp2,this.jzDataDefault);
+                        this.newArrsTemp3 = newArrsTemp3Exp;
+                        this.newArrsTemp4 = newArrsTemp4Exp;
+                        this.jzDataDefault = jzDataDefaultExp;
+                        this.jzDataDefaultCopy = jzDataDefaultCopyExp;
+                        this.jzDataProduct = arrProductTemp;
+                        //鍚堝悓浠锋牸姹囨��
+                        this.ContractPriceCompute();
+                    } else if (PromotionHeadRecordId == "NormalProduct") { //涓�鑸骇鍝�
+                        //todu3
+                        arrProductTemp = ComputeDataNormalProductLogic(this.newArrsTemp3,this.newArrsTemp4,this.jzDataDefaultCopyQuantityList,this.jzDataDefaultCopy,this.QuoteData,arrProductTemp,item,arrTemp2,this.jzDataDefault);
+                        this.newArrsTemp3 = newArrsTemp3Exp;
+                        this.newArrsTemp4 = newArrsTemp4Exp;
+                        this.jzDataDefault = jzDataDefaultExp;
+                        this.jzDataDefaultCopy = jzDataDefaultCopyExp;
+                        this.jzDataProduct = arrProductTemp;
+                        //鍚堝悓浠锋牸姹囨��
+                        this.ContractPriceCompute();
+                    }
+                }
+            });
+            this.jzDataFixedPrice = [].concat(arrTemp);
+        }
+    }
+    ReplacementUnitPrice() {
+        var ifTrade = this.QuoteData[0].Opportunity.Trade__c; //鍐呭璐�
+        var arr = [].concat(this.jzDataProduct);//20230214
+        this.jzDataProduct = [].concat(ReplacementUnitPriceLogic(arr, ifTrade));//20230214
+        this.ContractPriceCompute();
+    }
+    //淇濆瓨鏈�澶ф鏁�
+    savecount(idStr) { //idStr 閫変腑鐨勬暟鎹甀D
+        this.jzDataFixedPrice = savecountLogic(this.jzDataFixedPrice,idStr);
+    }
+    ChangeNumZeroTrueData = []
+    ChangeNumZeroTrue() {
+        this.ChangeNumZeroTrueData = [].concat(this.jzDataDefault);
+        var newJzDataDefault = this.ChangeNumZeroTrueData.filter(item => {
+            if (item.Quantity > 0) {
+                return true;
+            } else {
+                return false;
+            }
+        })
+        this.ChangeNumZeroTrueData = newJzDataDefault;
+    }
+    //鐢ㄤ簬濉厖娆℃暟 
+    CompareFullData = []
+    AddNums(ListName, Asset_Model_No__c, addNums, Id) {
+        this.CompareFullData = AddNumsLogic(ListName, Asset_Model_No__c, addNums, Id,this.CompareFullData);
+    }
+    //褰掑苟鐩稿悓浠锋牸鏀跨瓥鏂规鐨勪骇鍝�
+    ConsolidationProgramProducts(arrSchemes) {
+        var jzdataList = [].concat(this.jzDataProduct);
+        this.jzDataProduct = PriceConsolidation(arrSchemes, jzdataList);
+    }
+    //淇冮攢鏂规鍒楄〃鏁版嵁
+    @track jzData = [];
+    //淇冮攢鏂规鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
+    @track tableIsLoding = true;
+    // 淇冮攢鏂规鍒楄〃鍒楅厤缃�
+    @track
+    initDataTable =initDataTable2;
+    jzdateflag=true;
+    IsLoading6 = false;
+    //淇冮攢鏂规鍒楄〃缂栬緫鍒椾繚瀛�
+    savejzData(event){
+        var data = event.detail.rows;
+        for (var i = 0; i < this.jzData.length; i++) {
+            for (var j = 0; j < data.length; j++) {
+                var id = data[j].Id.replace("row-", "");
+                if (this.jzData[i].Id == id) {
+                    this.jzData[i].Quantity__c=data[j].Quantity__c;
+                }
+            }
+        }
+        this.jzdateflag = false;
+        this.IsLoading6 = true;
+        setTimeout(() => {
+            this.jzdateflag = true;
+            this.IsLoading6 = false;
+        }, 1000);
+    }
+    //============淇冮攢鏂规妯℃�佹 end==========
+    //**********浠锋牸鏀跨瓥 end**********
 
-//         <!-- 鍋滄棰勮  20210930  lt  add  MarkRed(); -->
-//         <apex:actionFunction action="{!Save}" name="Save" reRender="mainForm,message1" oncomplete="unblockUI();MarkRed();"/>
-//         <!-- 鎶ヤ环璇曠畻 -->
-//         <apex:actionFunction action="{!Jump}" name="Jump" reRender="mainForm" oncomplete="unblockUI();" />
-//         <apex:actionFunction action="{!OppReflection}" name="OppReflection" reRender="mainForm" oncomplete="unblockUI();"/>
-//         <apex:actionFunction action="{!Print}" name="Print" reRender="mainForm" oncomplete="openQuotePage('{!quo.Contract__c}','{!errorflg}','{!quoid}');unblockUI();"/>
-//         <lightning-card id="block">
-//             <lightning-input type="hidden" value="{!oppInfo.Direct_Separate}" id="Direct_Separate"/>
-//             <lightning-input type="hidden" value="{!oppInfo.Trade}" id="Trade"/>
-//             <lightning-input type="hidden" value="{!oppId}" id="oppId"/>
-//             <lightning-input type="hidden" value="{!SalesId1}" id="SalesId1"/>
-//             <lightning-input type="hidden" value="{!qb.PriceRefreshPeriod}" id="hidden_PriceRefreshPeriod"/>
-//             <lightning-input type="hidden" value="{!qb.Estimation_List_Price}" id="hidden_Estimation_List" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!DisCalculation}" id="DisCalculationvalue" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!DisAmount}" id="hidden_DisAmountvalue" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!Salesprofit1}" id="Salesprofit1value" rendered="{!displayFlg}"/>
-//             <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗘姌鎵� start -->
-//             <lightning-input type="hidden" value="{!AgencyDiscount}" id="AgencyDiscountValue" rendered="{!displayFlg}"/>
-//             <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗘姌鎵� end -->  
-//             <lightning-input type="hidden" value="{!Salesprofit2}" id="Salesprofit2value" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!qb.SalesCalculation1}" id="SalesCalculation1value" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!qb.SalesCalculation2}" id="SalesCalculation2value" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!quoStocking_Price_c}" id="hidden_Stocking_Price" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!oppInfo.Wholesale_Price}" id="hidden_Wholesale_Price" rendered="{!displayFlg}"/>
-//             <!-- 澶氬勾淇濅慨 start -->
-//             <lightning-input type="hidden" id="hidden_MultiYearWarrantyTotalPrice" value="{!quo.MultiYearWarrantyTotalPrice__c}"/>
-//             <!-- 澶氬勾淇濅慨 end -->
-//             <lightning-input type="hidden" value="{!enableSales}" id="SalesRoot_Flg"/>
-//             <lightning-input type="hidden" value="{!oppInfo.CurrencyIsoCode}" id="CurrencyIsoCode"/>
-//             <lightning-input type="hidden" value="{!baseUrl}" id="baseUrl"/>
-//             <lightning-input type="hidden" value="{!WinOrDecideAlert}" id="SFDA_Flg"/>
-//             <!-- LHJ Start -->
-//             <lightning-input type="hidden" value="{!oppInfo.Authorized_DB_No}" id="Authorized_DB_No" rendered="{!displayFlg}"/>
-//             <lightning-input type="hidden" value="{!oppInfo.If_Need_Authorize}" id="If_Need_Authorize" rendered="{!displayFlg}"/>
-//             <!-- LHJ End -->
-//             <template id="message1">
-//                 <apex:messages styleClass="editListError"/>
-//             </template>
-//             <template if:true="{!errorflg}" >
-//                 <table width="100%">
-//                     <tr>
-//                         <td align="left"><div class="errorMsg">{!errorMessage}</div></td>
-//                     </tr>
-//                 </table>
-//             </template>
-//             <template if:true="{!errorflg}" >
-//                 <table width="100%">
-//                     <tr>
-//                         <td align="left"><div style="font-size:22px" class="errorMsg">{!errorMessagechack}</div></td>
-//                     </tr>
-//                 </table>
-//             </template>
-//             <template if:true="{!Messageflg}" >
-//                 <table width="100%">
-//                     <tr>
-//                         <td align="left">{!Message}</td>
-//                     </tr>
-//                 </table>
-//             </template>
-//             <div>
-//                 <table border="0">
-//                     <tr>
-//                         <th style="text-align:right;width:90px;">{Label.Quoto_No}</th>
-//                         <td style="text-align:right;width:130px;"><span>{quo.Quote_No__c}</span></td>
-//                         <th style="text-align:right;width:80px;">{Label.Quoto_Name}</th>
-//                         <td style="width:110px;"><div class="requiredInput"><div class="requiredBlock"></div><lightning-input-field value={quo.QuoteName__c} /></div></td>
-//                         <th style="text-align:right;width:100px;">{Label.HP_Name}</th>
-//                         <td style="width:180px;"><span>{oppInfo.HP_Name}</span></td>
-//                         <th style="text-align:right;width:100px;">{Label.Department_Name}</th>
-//                         <td style="width:130px;"><span>{oppInfo.Department_Name}</span></td>
-//                         <th style="text-align:right;width:90px;">{Label.Currency}</th>
-//                         <td style="width:80px;"><span>{oppInfo.CurrencyIsoCode}</span></td>
-//                     </tr>
-//                     <tr>
-//                         <th style="text-align:right">{displayFlg ? Label.Total_ListPrice : ''}</th>
-//                         <td style="text-align:right;"><lightning-formatted-text id="Estimation_List_Price" style={displayFlg ? '' : 'display:none'} value="{0, number, ###,##0.00}">
-//                             <slot>{qb.Estimation_List_Price}</slot>
-//                         </lightning-formatted-text></td>
-//                         <th style="text-align:right;">{displayFlg ? Label.Total_Price : ''}</th>
-//                         <td><div style={displayFlg ? '' : 'display:none'}><lightning-input-field id="quoTotalPrice" value={quo.QuoteTotal_Page__c} onchange={quoteTotalPriceAction} disabled={true} style="text-align:right;"/></div></td>
-//                         <th style="text-align:right;">{displayFlg ? Label.Contact_Price : ''}</th>
-//                         <td><div class="requiredInput"><div class="requiredBlock"></div><lightning-input-field id="Dealer_Final_Price" value={quo.Dealer_Final_Price_Page__c} onchange={calFromContactPrice} onblur={setOCMAmount} onclick={quoteAgencyTotalPriceAction1} style={displayFlg ? '' : 'display:none'} ></lightning-input-field></div></td>
-//                         <th style="text-align:right;">{displayFlg ? Label.Forecast_Amounts : ''}</th>
-//                         <td style={displayFlg ? '' : 'display:none'}><span id="Wholesale_Price">{oppInfo.Wholesale_Price}</span></td>
-//                         <th style="text-align:right">{Label.Sales_Root}</th>
-//                         <td><span id="Sales_Root">{oppInfo.Sales_Root}</span></td>
-//                     </tr>
-//                 </table>
-//                 <table border="0">
-//                     <tr>
-//                         <th style="text-align:right;width:50px;">&nbsp;</th>
-//                         <td style="text-align:right;width:110px;"><lightning-button onclick={productCompare} label={Label.Status_Update}></lightning-button></td>
-//                         <th style="text-align:right;width:50px;">&nbsp;</th>
-//                         <td style="text-align:right;width:100px;"><lightning-button onclick={updateOtcode} label="鏇挎崲浜у搧otcode" ></lightning-button></td>
-//                         <th style="text-align:right;width:50px;">&nbsp;</th>
-//                         <td style="width:110px;"><lightning-button id="SetProduct" onclick={searchSetProductSI} label={Label.Set_Product}></lightning-button></td>
-//                         <th style="text-align:right;width:50px;">&nbsp;</th>
-//                         <td style="width:130px;"><lightning-button onclick={openQuoteExcelImport} label={Label.Excel_Import}></lightning-button></td>
-//                         <td style="text-align:right;width:50px;"><lightning-button id="Btn_RowDelete" onclick={IfRadioChecker2.bind(this, 'del')} value="{!Label.deleteLabel}" style="width:60px;"></lightning-button></td>
-//                         <!-- 娣诲姞琛� -->
-//                         <td width="40px;">
-//                             <lightning-button onclick={openAddMultipleRow} label="澧炲姞琛�" ></lightning-button>
-//                         </td>
-//                         <td style="width:130px;">
-//                             <lightning-button id="Btn_RowUp" onclick={radioChecker2.bind(this, 'up')} value="{!Label.Row_Up}" style="width:60px;"></lightning-button>
-//                             <lightning-button id="Btn_RowDown" onclick={radioChecker2.bind(this, 'down')} value="{!Label.Row_Down}" style="width:60px;"></lightning-button>
-//                         </td>
-//                         <th style="text-align:right;width:100px;">涓绘満瑁呮満鍦扮偣</th>
-//                         <td><lightning-input-field value={quo.Installation_location__c} /></td>
-//                         <th style="text-align:right;width:90px;">{displayCost && displayFlg ? Label.Cost : ''}</th>
-//                         <td style="text-align:right;width:80px;"><lightning-formatted-text id="Stocking_Price" value="{0, number, ###,##0.00}" style={displayCost && displayFlg ? '' : 'display:none;'}><apex:param value={quoStocking_Price_c}/></lightning-formatted-text></td>
-//                     </tr>
-//                 </table>
-//             </div>
-//              <!-- 澶氬勾淇濅慨 start -->
-//               <!--  鍘熶唬鐮� start
-//             <table>
-//                 <tr>
-//                     <td>&nbsp;</td>
-//                 </tr>
-//             </table>
-//             -->
-//             <!-- 鍘熶唬鐮� end -->
-//             <table>
-//                 <tr>
-//                     <td>&nbsp;</td>
-//                 </tr>
-//                 <tr>
-//                     <th style="text-align:right;width:30px;">&nbsp;</th>
-//                     <th style="text-align:right;width:50px;">鍚堝悓淇濅慨鏈燂紙骞达級:&nbsp;</th>
-//                     <td style="width:190px;">
-//                         <lightning-input-field id="AllGurantee_Period" value={quo.Gurantee_Period__c} onchange={calGuranteePeriod} style="width:50px; text-align:right;"></lightning-input-field>
-//                         <input type="hidden" id="Gurantee_Period_c" value={quo.Gurantee_Period__c}/>
-//                     </td>
-//                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount 鍚堣 闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 start -->
-//                     <template if:true={contractWarranty}>
-//                             <th style="text-align:right;width:50px;">
-//                                 {!quoteObject.fields.MultiYearWarrantyTotalPrice__c.label}&nbsp;
-//                             </th>
-//                             <td style="width:470px;">
-//                                 <lightning-formatted-text id="MultiYearWarrantyTotalPrice_out" value={quo.MultiYearWarrantyTotalPrice__c} style="text-align:right;width:180px;"></lightning-formatted-text>
-//                             </td>
-//                             <th style="text-align:right;width:50px;">
-//                                 {!quoteObject.fields.multiYearWarranty__c.label}&nbsp;
-//                             </th>
-//                             <td style="width:200px;">
-//                                 <lightning-input type="number" min="0" max="99" id="multiYearWarranty" value={quo.multiYearWarranty__c} onchange={callFromCancelgurantee_MD} style="text-align:right;width:30px;"></lightning-input>
-//                             </td>
-//                         </template>
-//                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount 鍚堣 闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                 </tr>
-//                 <!-- 娣诲姞琛� 鏀惧湪澶栭潰 鍥犱负鍐呭璐镐笉鍚�-->
-//                     <!-- <th style="text-align:right;width:50px;">
-//                         娣诲姞琛�
-//                     :&nbsp;</th> -->
-//                     <!-- 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 start -->
-//                     <!-- 鍙兘杈撳叆姝f暣鏁� 杈撳叆鍏跺畠浼氬己鍒舵竻绌� -->
-//                     <td style="width:200px;display: none;">
-//                         <div class="" id="speedDiv" style="">
-//                         <!--  <p>鍛ㄦ湡</p>
-//                         <input type="range" id="dur" value="0.50" min="0" max="1.00" step="0.01" onchange="changeV()"/>
-//                         <p>閫熷害</p> -->
-//                         <p class="diap">鈶犳粦鍔ㄩ�夋嫨琛屾暟!</p>
-//                         <!-- 婊戞潯 -->
-//                         <input type="range" id="speed" value="50" min="0" max="100" step="1" onchange="changeV()" style="background: linear-gradient(to right, rgb(255, 162, 0), white 50%, white);" />
-//                         <p class="diap">鈶¤緭鍏ラ�夋嫨琛屾暟!</p>
-//                         <!-- 杈撳叆妗� -->
-//                         <input id="addMultipleRow" value="50" style="text-align:right;width: 30px;" rendered="{!displayFlg}" class="diaInput" onchange="changeI();" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" 
-//                         onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"/>
+    //*********鎶樻墸鏀跨瓥 start**********
+    //閫夋嫨鐗圭害鎶樻墸鎵撳紑鎸夐挳
+    showModalSpecial(){
+        this.QuoteData.forEach(qtd => {
+            if (!qtd.Opportunity.IsAuthorized__c) {
+                this.Alert("璇ヨ浠蜂笉鏄壒绾︾粡閿�鍟嗘巿鏉�",'error');
+            } else {
+                this.ShowSpecial = true;
+            }
+        });
+    }
+    //閫夋嫨涓�鑸姌鎵f墦寮�鎸夐挳
+    showModalCommonly(){
+        this.ShowCommonly = true
+    }
+    //鎶樻墸鏀跨瓥鍒犻櫎鎸夐挳浜嬩欢
+    delectTableDiscount(){
+        let ids = [];
+        for (var j = 0; j < this.SelectedFnDataDiscount.length; j++) {
+            ids.push(this.SelectedFnDataDiscount[j].Id);
+        }
+        this.DeleteSchemeMatching(this.SelectedFnDataDiscount, "鎶樻墸鏀跨瓥");
+        this.delectTableDiscountTemp();
+        this.ContractPriceCompute();
+    }
+    DeleteSchemeMatching(ids, TypeName) {
+        var CompareFullDataTemp = [];
+        ids.forEach(id => {
+            this.jzDataProduct = DeleteSchemeMatchingLogic(id,TypeName,CompareFullDataTemp,this.CompareFullData,this.jzDataFixedPrice,this.jzDataDiscount,this.jzDataProduct,this.jzDataDefault,this.jzDataDefaultNotChange);
+            CompareFullDataTemp = CompareFullDataTempExp;
+            this.jzDataFixedPrice = jzDataFixedPriceExp;
+            this.jzDataDiscount = jzDataDiscountExp;
+            this.jzDataDefault = jzDataDefaultExp;
+            this.jzDataDefaultNotChange = jzDataDefaultNotChangeExp;
+            //鍚堝悓浠锋牸姹囨��
+            this.ContractPriceCompute();
+        });
+        this.CompareFullData = CompareFullDataTemp;
+    }
+    //鎶樻墸鏀跨瓥閫変腑鍒楄〃鏁版嵁
+    @track SelectedFnDataDiscount = []
+    //鎶樻墸鏀跨瓥閫夋嫨浜嬩欢
+    SelectedFnDiscount(event) {
+        let arr = event.detail.rows;
+        this.SelectedFnDataDiscount = arr;
+    }
+    //鎶樻墸鏀跨瓥鍒楄〃鏁版嵁
+    @track jzDataDiscount = [];
+    //鎶樻墸鏀跨瓥鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
+    @track tableIsLodingDiscount = true;
+    //鎶樻墸鏀跨瓥鍒楄〃鍒楅厤缃�
+    @track
+    initDataTableDiscount = initDataTableDiscount2;
+    //鎶樻墸鏀跨瓥鍒楄〃鍒楀姞杞芥柟娉�
+    getTableDataDiscount(event) {
+        this.tableIsLodingDiscount = false;
+    }
+    @track 
+    Tongzhishow = false; //鎻愮ず鏄剧ず鐨勬爣璇�
+    SaveShowText = "鎿嶄綔鎴愬姛"; //鎻愮ず妗嗙殑鏂囨湰
+    TongzhiIcon = 'standard:account' //鎻愮ず妗嗙殑鍥炬爣
+    IsLeftStyle = "" //鎻愮ず妗嗙殑鏍峰紡
+    BgColorStyle = ""
+    //寮规鎻愮ず content 鍐呭 error 鏄惁鏄敊璇彁绀烘  left 鏄惁灞呭乏
+    Alert(msg,type) {
+        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);
+        }   
+    }
+    //鎶樻墸鏀跨瓥缂栬緫鍒椾繚瀛樻柟娉�
+    handleSaveDiscount(event) {
+        this.jzDataDiscount = handleSaveDiscountLogic(this.jzDataDiscount,this.jzDataProduct,event);
+        var boolean = booleanExp;
+        var boolean2 = boolean2Exp;
+        var boolean3 = boolean3Exp;
+        let newData = newDataExp;
+        let newData2 = newData2Exp;
+        let newData3 = newData3Exp;
+        let editnewDate = editnewDateExp;
+        var GuaranteeDiscount__cZuiXiao = GuaranteeDiscount__cZuiXiaoExp;
+        var NormalDiscount__cZuiXiao = NormalDiscount__cZuiXiaoExp;
+        this.jzDataProduct = jzDataProductExp;
+        //haha2
+        debugger
+        if (boolean == 0) {
+            this.jzDataDiscount = newData;
+            var newArrs = [].concat(editnewDate);//20230214
+            newArrs.forEach(item => {
+                //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
+                this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
+                this.ComputeDiscount(item.Id, item.NormalDiscount__c_Input, item.GuaranteeDiscount__c_Input, item.Category__c, item.JxsType);
+            });
+            this.jzDataProduct = this.newArrsTemp2.concat(this.newArrsTemp);//20230213
+            //鍚堝悓浠锋牸姹囨��
+            this.ContractPriceCompute();
+            this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
+        } else if (boolean == 1) {
+            this.Alert("淇敼閿欒锛屽璞″搧鎶樻墸涓嶅緱灏忎簬瀵硅薄鍝佹渶浣庢姌鎵�:"+GuaranteeDiscount__cZuiXiao+"%",'error');
+        } else if (boolean == 2) {
+            this.Alert("淇敼閿欒锛岄潪瀵硅薄鍝佹姌鎵d笉寰楀皬浜庨潪瀵硅薄鍝佹渶浣庢姌鎵�:"+NormalDiscount__cZuiXiao+"%",'error');
+        } else if (boolean == 3) {
+            this.Alert("淇敼閿欒锛屼竴鑸姌鎵f病鏈夊璞″搧鎶樻墸",'error');
+        } else if (boolean == 5) {
+            this.Alert("闈炲璞″搧鎶樻墸涓嶅彲浠ヤ负绌烘垨灏忎簬0",'error');
+        } else if (boolean == 4) {
+            this.jzDataDiscount = newData;
+            var ffgg=0;
+            if(boolean3){
+                newData2.forEach(HeTo => {
+                    //鏍规嵁鍚堝悓浠锋牸璁$畻涓�鑸姌鎵�
+                    HeTo = this.ComouteProductDiscount(HeTo.Id,HeTo.Category__c,HeTo.GuaranteeDiscount__c_Input, HeTo.NormalDiscount__c_Input, HeTo.GuaranteeDiscount_H_Money__c,HeTo.NormalDiscount_H_Money__c, HeTo);
+                    if(HeTo==1||HeTo==2||HeTo==12||HeTo==3){
+                        ffgg=HeTo;
+                        return ;
+                    }
+                    //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
+                    let jzDataDiscountx = [].concat(this.jzDataDiscount);//20230214
+                    this.ConsolidatedDiscountPolicy(jzDataDiscountx);
+                    //涓�鑸姌鎵f洿鏀硅繃鍚堝悓浠锋牸璁$畻
+                    this.updateCommonlyDiscountLogic(HeTo.Id,HeTo.JxsType,HeTo.GuaranteeDiscount__c_Input,HeTo.NormalDiscount__c_Input,HeTo.Category__c,this.jzDataDiscount);
+                });
+            }
+            if(boolean2&&ffgg==0){
+                newData3.forEach(TeYue=>{
+                    //鏍规嵁鍚堝悓浠锋牸璁$畻鐗圭害鎶樻墸
+                    GuaranteeDiscount__cZuiXiao=parseFloat(TeYue.GuaranteeDiscount__c);
+                    NormalDiscount__cZuiXiao=parseFloat(TeYue.NormalDiscount__c);
+                    TeYue=this.ComouteProductDiscount(TeYue.Id,TeYue.Category__c,TeYue.GuaranteeDiscount__c_Input, TeYue.NormalDiscount__c_Input, TeYue.GuaranteeDiscount_H_Money__c,TeYue.NormalDiscount_H_Money__c, TeYue);
+                    if(TeYue==1||TeYue==2||TeYue==12||TeYue==3){
+                        ffgg=TeYue;
+                        return ;
+                    }else{
+                        //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
+                        this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
+                        //涓�鑸姌鎵f洿鏀硅繃鍚堝悓浠锋牸璁$畻
+                        this.updateCommonlyDiscountLogic(TeYue.Id,TeYue.JxsType,TeYue.GuaranteeDiscount__c_Input,TeYue.NormalDiscount__c_Input,TeYue.Category__c,this.jzDataDiscount);
+                    }
+                });
+            }
+            if(ffgg==1||ffgg==2||ffgg==12||ffgg==3){
+                this.Alert(InverseCalculationTiShi(ffgg,GuaranteeDiscount__cZuiXiao,NormalDiscount__cZuiXiao),'error');
+            }else{
+                this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
+            }
+        }
+        //鍒锋柊
+        this.jzshows2 = false;
+        setTimeout(() => {
+            this.jzshows2 = true;
+        }, 800)
+    }
+    newArrsTemp = [];
+    newArrsTemp2 = [];
+    //璁$畻涓�鑸姌鎵i潪瀵硅薄鍝佹姌鎵�
+    ComouteProductDiscount(Id,Category__c,GuaranteeDiscount__c_Input, NormalDiscount__c_Input,GuaranteeDiscount_H_Money__c, NormalDiscount_H_Money__c, item) {
+        //todu12
+        this.updateIdStr("2");
+        this.updateIdStr("1");
+        var reslut=ReverseCalculationModifyDiscountLogic(this.jzDataDiscount,this.jzDataProduct,Id,Category__c,GuaranteeDiscount__c_Input, NormalDiscount__c_Input,GuaranteeDiscount_H_Money__c, NormalDiscount_H_Money__c, item);
+        this.jzDataDiscount=[].concat(arrTempsss);
+        this.jzDataProduct=[].concat(arrProductTempsss);//20230214
+        return reslut;
+    }
+    //涓�鑸姌鎵f洿鏀硅繃鍚堝悓浠锋牸璁$畻
+    updateCommonlyDiscountLogic(Id,JxsType,GuaranteeDiscount__c_Input,NormalDiscount__c_Input,Category__c,jzDataDiscount) {
+        //todu13
+        this.updateIdStr("1");
+        this.jzDataProduct=updateCDLogic(Id,JxsType,GuaranteeDiscount__c_Input,NormalDiscount__c_Input,Category__c,jzDataDiscount,this.jzDataProduct);
+        this.GeneralDiscountContractSummary();
+    } 
+    //鏇存敼涓�鑸姌鎵e悎鍚屼环鏍艰绠楀悎鍚屾�讳环
+    GeneralDiscountContractSummary(){
+        this.ContractPrice = 0;
+        var sum = this.ContractPrice;
+        sum = parseFloat(sum);
+        sum=GeneralDiscountContractSummaryLogic(sum,this.jzDataDiscount,this.jzDataFixedPrice);
+        this.ContractPrice = sum;
+    }
+    //鎶樻墸鏀跨瓥鍒楄〃灞曠ず鏍囪瘑
+    jzshows2 = true;
 
-//                         <div class="slds-text-align_center">
-//                             <lightning-button label="纭" onclick={addMultipleRowJS} style="margin: 20px 10px 0px 10px;"></lightning-button>
-//                             <lightning-button label="鍙栨秷" onclick={popupBoxHide} style="margin: 20px 10px 0px 10px;"></lightning-button>
-//                         </div>
-//                     </div>
-//                     </td>
-//                     <!-- SWAG-CKDATG 銆愬鎵樸�戙�怬BSAP-鎶ヤ环濮旀墭銆戞姤浠峰鎵橀」鐩敼鍠�1 fy start -->
-//                     <tr>
-//                         <th style="text-align:right;width:30px;">&nbsp;</th>
-//                         <th style="text-align:left;width:50px;">{!$ObjectType.Quote.fields.QuotationChange__c.label}:&nbsp;</th>
-//                         <td style="width:190px;"><lightning-input-field id="QuotationChange" value="{!quo.QuotationChange__c}"  style="width:80px; text-align:right;" />
-//                         </td>
-//                         <th style="text-align:left;width:50px;">{!$ObjectType.Quote.fields.MainEngineWithoutMonitor__c.label}:&nbsp;</th>
-//                         <td style="width:500px;"><lightning-input-field id="RemarksOnChanges" value="{!quo.MainEngineWithoutMonitor__c}"  style="width:450px; text-align:left;" />
-//                         </td>
-//                         <th style="text-align:right;width:50px;">
-//                             {!$ObjectType.Quote.fields.Interdepartmental__c.label}
-//                         :&nbsp;</th>
-//                         <td style="width:200px;"><lightning-input-field id="Interdepartmental" value="{!quo.Interdepartmental__c}"  style="text-align:right;width:30px;" /></td>
-//                     </tr>
-//                     <!-- SWAG-CKDATG 銆愬鎵樸�戙�怬BSAP-鎶ヤ环濮旀墭銆戞姤浠峰鎵橀」鐩敼鍠�1 fy end -->
-//                 <tr>
-//                     <td>&nbsp;</td>
-//                 </tr>
-//             </table>
-//             <!-- 澶氬勾淇濅慨 end -->
-//             <div style="width:1260px;">
-//                 <div style="overflow-x: auto;">
-//                     <!-- 澶栬锤澶氬勾淇� 鍐呭璐歌〃鏍奸暱搴︿竴鑷� 鍘�1635px 绮剧悽鎶�鏈� wql 2021/01/28 start -->
-//                     <table style="width:1935px;" border="0">
-//                     <!-- 澶栬锤澶氬勾淇� 鍐呭璐歌〃鏍奸暱搴︿竴鑷�  绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                         <tr>
-//                             <th style="text-align:center;width:20px;">&nbsp;<input type="checkbox" id="checkAll" onclick="selectAll()" style="width:10px;"/></th>
-//                             <th style="text-align:center;width:15px;">No</th>
-//                             <th style="text-align:center;width:150px;">{!$Label.Asset_No}</th>
-//                             <th style="text-align:center;width:100px;">{!$Label.SFDA_Status}</th>
-//                             <th style="text-align:center;width:100px;">{!$ObjectType.product2.fields.VenderName__c.label}</th>
-                           
-//                             <th style="text-align:center;width:85px;">{!$Label.ListPrice}</th>
-//                             <th style="text-align:center;width:100px;">{!$Label.Quantity}</th>
-//                             <th style="text-align:center;width:50px;">{!$Label.Specifications}</th>
-//                             <th style="text-align:center;width:100px;">鍖婚櫌鍗曚环</th>
-//                             <th style="text-align:center;width:100px;">鍖婚櫌灏忚</th>
-//                             <!-- 
-//                             <th style="text-align:center;width:50px;">{!$Label.Present}</th>
-//                             --Savebutton-->
+    //============鐗圭害鎶樻墸妯℃�佹 start=========
+    ///鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄩ�夋嫨鏁版嵁
+    @track SelectedFnDataSpecial = [];
+    //鐗圭害鎶樻墸妯℃�佹閿欒鎻愮ず寮�鍏�
+    ShowSpecialIsError = false;
+    //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄩ�変腑鏂规硶
+    SelectedFnSpecial(event) {
+        let arr = event.detail.rows;
+        if (event.detail.rows.length > 1) {
+            this.ShowSpecialIsError = true;
+        } else {
+            this.ShowSpecialIsError = false;
+        }
+        var TempArr = [];
+        TempArr.push(arr[0])
+        var tempObject = {
+            ...{},
+            ...TempArr[0]
+        }
+        tempObject.CompareId = GetUUID();
+        this.SelectedFnDataSpecial = [tempObject];
+    }
+    //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ姞杞芥柟娉�
+    getTableDataSpecial(event) {
+        let listQuery = event.detail.listQuery;
+        var Agency1__c = this.QuoteData[0].Agency1__c;
+        listQuery.pageLimit = 40;
+        listQuery.Agency1c = Agency1__c;
+        GetAuthorizerSearch(listQuery).then(result => {
+            var responseObj = JSON.parse(result);
+            this.jzDataSpecial = responseObj.records;
+            this.jzDataSpecial.forEach(element => {
+                element.JxsType = "鐗圭害鎶樻墸";
+                element.NormalDiscount__c = element.NormalDiscount__c+"%";
+                element.GuaranteeDiscount__c = element.GuaranteeDiscount__c+'%';
+            });
+            GetAgencyRName().then(gar => { //鑾峰彇缁忛攢鍟嗗鍚�
+                var a = JSON.parse(gar);
+                a.forEach(ga => {
+                    if (ga.Agency__r != undefined) {
+                        var arr = [];
+                        this.jzDataSpecial.forEach(jzdsc => { //鐗圭害鎶樻墸鏂规鏁版嵁
+                            if (ga.Agency__c == jzdsc.Agency__c) {
+                                jzdsc.Agency__Name = ga.Agency__r.Name;
+                                arr.push(jzdsc);
+                            } else {
+                                arr.push(jzdsc);
+                            }
+                        });
+                        this.jzDataSpecial = [].concat(arr);//20230214
+                    }
+                });
+            })
+            this.tableIsLodingSpecial = false;
+        })
+    }
+    //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ垪閰嶇疆
+    @track
+    initDataTableSpecial = initDataTableSpecial2;
+    //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄦ暟鎹�
+    @track jzDataSpecial = [];
+    //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ姞杞藉姩鍥炬爣璇�
+    @track tableIsLodingSpecial = true;
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄩ�夋嫨鏁版嵁
+    @track SelectedOtherDataArr = [];
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄩ�変腑鏂规硶
+    SelectedFnOtherData(event) {
+        let arr = event.detail.rows;
+        this.SelectedOtherDataArr = arr;
+    }
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ垪閰嶇疆
+    @track
+    initDataTableOtherData =  initDataTableOtherData2;
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄦ暟鎹�
+    @track jzDataOtherData = [];
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ姞杞藉姩鍥炬爣璇�
+    @track tableIsLodingOtherData = true;
+    //鐗圭害鎶樻墸妯℃�佹寮�鍏�
+    @track ShowSpecial;
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ姞杞芥柟娉�
+    getTableDataOtherData(event) {
+        if (!this.IsLoadingFlag1) {
+            return
+        };
+        this.jzDataOtherData = this.jzDataDefault;
+        var jzDataOtherDataTemp = [];
+        this.jzDataOtherData.forEach(jzdod => {
+            var ItemsTemp = {
+                ...{},
+                ...jzdod
+            };
+            ItemsTemp.SplitQuantity = ItemsTemp.Quantity;
+            jzDataOtherDataTemp.push(ItemsTemp);
+        })
+        this.jzDataOtherData = jzDataOtherDataTemp;
+        this.tableIsLodingOtherData = false;
+    }
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ鍔犺浇鍔ㄥ浘鏍囪瘑
+    IsLoading5 = false;
+    //鐗圭害鎶樻墸寰呴�変骇鍝佸睍绀烘爣璇�
+    jzshows5 = true;
+    //
+    IsLoadingFlag1 = true;
+    //鐗圭害鎶樻墸寰呴�変骇鍝佺紪杈戝垪淇濆瓨鏂规硶
+    SaveSpecialDiscount(event) {
+        debugger
+        var data = event.detail.rows;
+        let newData = [];
+        let editnewDate = [];
+        var boolean = 1;
+        for (var i = 0; i < this.jzDataOtherData.length; i++) {
+            var editData = {};
+            var flag = false;
+            for (var j = 0; j < data.length; j++) {
+                var id = data[j].Id;
+                if (this.jzDataOtherData[i].Id == id) {
+                    editData = {
+                        SplitQuantity: ''
+                    };
+                    //鎷嗗垎娆℃暟
+                    editData.SplitQuantity = data[j].SplitQuantity;
+                    flag = true;
+                }
+            }
+            if (flag) {
+                var newItem = {
+                    ...this.jzDataOtherData[i],
+                    ...{}
+                };
+                if (editData.SplitQuantity != undefined) {
+                    newItem.SplitQuantity = Number(editData.SplitQuantity);
+                }
+                newData.push(newItem);
+                editnewDate.push(newItem);
+            } else {
+                newData.push({
+                    ...{},
+                    ...this.jzDataOtherData[i]
+                });
+            }
+        }
+        //haha4
+        var newArrs = [].concat(editnewDate);//20230214
+        newArrs.forEach(item => {
+            if (item.Quantity < item.SplitQuantity) {
+                boolean = 2;
+            } else if (item.SplitQuantity == 0 || item.SplitQuantity == '') {
+                boolean = 3;
+            }
+        });
+        if (boolean == 1) {
+            this.jzDataOtherData = newData;
+            this.ShowSpecialIsError = false;
+        } else if (boolean == 2) {
+            this.errorTiShi("淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰楀ぇ浜庢暟閲�");
+        } else if (boolean == 3) {
+            this.errorTiShi("淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰椾负0鎴栦负绌�");
+        }
 
-//                             <!--    2018/09/28 CHAN-B4YAB8 璧犻�併�佺粡閿�鍟嗕环鏍煎拰灏忚 end -->
-//                             <!-- 澶氬勾淇濅慨 start -->
-//                             <!-- 澶栬锤澶氬勾淇� 鍙栨秷澶氬勾淇濅慨 淇濅慨 闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 start -->
-//                             <apex:variable value="{!1}" var="abc" >
-//                                 <th style="text-align:center;width:50px;">
-//                                     {!$ObjectType.QuoteLineItem.fields.multiYearWarranty__c.label}
-//                                 </th>
-//                                 <th style="text-align:center;width:150px;">
-//                                     {!$ObjectType.QuoteLineItem.fields.warrantyType__c.label}
-//                                 </th>
-                                
-//                             </apex:variable>
-//                             <!-- 澶栬锤澶氬勾淇� 鍙栨秷澶氬勾淇濅慨 淇濅慨 闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                             <th style="text-align:center;width:50px;">
-//                                 {!$ObjectType.QuoteLineItem.fields.GuaranteePeriod__c.label}</th>
-//                             <!-- 澶氬勾淇濅慨 end -->
-//                             <!-- 鏂板姞鐨� -->
-
-//                             <!-- SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩锛� lt 20210924 add start -->
-//                             <th style="text-align:center;width:130px;">{!$ObjectType.product2.fields.Estimated_ConsumptionDueDate__c.label}</th>
-//                             <!-- SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩锛� lt 20210924 add end -->
-
-//                             <th style="text-align:center;width:100px;">搴撳瓨鐘舵��</th>
-//                             <th style="text-align:center;width:100px;">浜у搧閰嶅</th>
-//                             <th style="text-align:center;width:350px;">{!$Label.Product_Name}</th>
-                            
-//                             <th style="text-align:center;width:100px;" hidden="hidden">{!$Label.AgencyPrice}</th>
-//                             <th style="text-align:center;width:100px;" hidden="hidden">{!$Label.AgencySum_Total}</th>
-//                             <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 start -->
-//                             <apex:variable value="{!1}" var="abc" >
-//                                 <th style="text-align:center;width:100px;" hidden="hidden">
-//                                     {!$ObjectType.QuoteLineItem.fields.NoDiscountTotal__c.label}
-//                                 </th>
-//                             </apex:variable>
-//                             <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                             <th style="text-align:center;width:20px;"><apex:image id="plusicon" value="{!$Resource.plusicon}" onclick="addRowJs(0);"/></th>
-//                         </tr>
-//                     </table>
-//                     <!-- 澶栬锤澶氬勾淇� 鍐呭璐竧able涓�鑷� 绮剧悽鎶�鏈� wql 2021/01/28 start -->
-//                     <div id="iframelike" style="width:1960px;">
-//                         <input type="hidden" id="ListPriceTotal" value="0" />
-//                         <input type="hidden" id="UnitPriceTotal" value="0" />
-//                         <template id="listsTable">
-//                         <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;width:1938px;" border="">
-//                     <!-- 澶栬锤澶氬勾淇� 鍐呭璐竧able涓�鑷� 绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                             <apex:variable value="{!1}" var="cnt" />
-//                             <apex:variable value="{!0}" var="CntIndex" />
-//                             <colgroup span="11"></colgroup>
-//                             <template for:each={} for:item="" for:index=""> 
-//                             <apex:repeat value="{!activities}" var="s" id="lists">
-//                                 <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
-//                                     <td class="dataCell" style="width:20px;">
-//                                         <input type="checkbox" name="checklist" value="{!s.lineNo}" style="width:10px;"/>
-//                                     </td>
-//                                     <td class="dataCell" style="width:15px;text-align:right;">
-//                                         <apex:outputLabel id="indexNo" value="{!IF(s.PageObject.Id__c==null,null,s.lineNo + 1)}" style="width:10px;"/>
-//                                     </td>
-//                                     <td class="dataCell" style="text-align:center;width:150px;">
-//                                         <lightning-input id="Assert" style="width:120px;" value="{!s.Asset_Model}" onclick="searchProduct('{!s.lineNo}',this.value, '')" />
-//                                     </td>
-//                                     <td class="dataCell" id="{!Text(cnt-1)}:td_Status__c" style="width:100px;">
-//                                         <lightning-output-field style="width:75px;" id="Status__c" value="{!s.PageObject.SFDA_Status__c}"/>
-//                                         <lightning-input type="hidden" id="SFDA" value="{!s.PageObject.SFDA_Status__c}"/>
-//                                         <template layout="none" rendered="{!IF(ISBLANK(s.PageObject.Product_Sales_Possibility__c) || s.PageObject.Product_Sales_Possibility__c == '鈼�', false, true)}">
-//                                         <script type="text/javascript">
-//                                         //alert(j$(escapeVfId('{!Text(cnt-1)}' + ':td_Status__c')).size());
-//                                         j$(escapeVfId('{!Text(cnt-1)}' + ':td_Status__c')).css({"color":"red"});
-//                                         </script>
-//                                         </template>
-//                                         <template layout="none" rendered="{!IF(s.haveno_Register == true, true, false)}">
-//                                         <script type="text/javascript">
-//                                             j$(escapeVfId('{!Text(cnt-1)}' + ':td_Status__c')).css({"color":"red"});
-//                                         </script>
-//                                     </template>
-//                                     </td>
-//                                     <td class="dataCell" style="width:100px;">
-//                                         <lightning-formatted-text id="VenderName" value="{!s.VenderName}" />
-//                                         <lightning-input type="hidden" id="VenderName__c" value="{!s.VenderName}" />
-//                                         <!-- 浜у搧涓绘暟鎹鍔犫�滀笉鍙彇娑堝骞翠繚鈥� 2020/08/28 绮剧悽鎶�鏈� wql start -->
-//                                         <lightning-input type="hidden" id="CanNotCancelledGurantee__c" value="{!s.CanNotCancelledGurantee}" />
-//                                         <!-- 浜у搧涓绘暟鎹鍔犫�滀笉鍙彇娑堝骞翠繚鈥� 2020/08/28 绮剧悽鎶�鏈� wql end -->
-//                                     </td>
-                                   
-//                                     <td class="dataCell" style="width:85px;text-align:right;">
-//                                         <lightning-formatted-text style="width:85px;display:{!IF(displayFlg, '', 'none')}" id="ListPricetext" value="{0, number, ###,##0.00}">
-//                                             <apex:param value="{!s.ListPrice_Page}" />
-//                                         </lightning-formatted-text>
-//                                         <lightning-input type="hidden" id="ListPrice" rendered="{!displayFlg}" value="{!s.ListPrice_Page}"/>
-//                                     </td>
-//                                     <td class="dataCell" style="text-align:center;width:100px;">
-//                                             <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗗崟浠疯绠� start -->
-//                                          <lightning-input-field id="Quantity" style="width:30px;text-align:right;" value="{!s.PageObject.Quantity__c}" onChange="calPrice('{!s.lineNo}');quoteAgencyTotalPriceAction();AgencyDiscountCalculation1();"/>
-//                                             <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗗崟浠疯绠� end -->
-//                                     </td>
-
-//                                     <td class="dataCell" style="width:50px;text-align:center">
-//                                         <lightning-formatted-text style="width:40px;text-align:center;" id="Specifications" value="{!if(s.latestInfo.Specifications=0||s.latestInfo.Specifications=null,'',s.latestInfo.Specifications)}"/>
-//                                     </td>
-
-//                                     <td class="dataCell" style="text-align:center;width:100px;">
-//                                         <lightning-input-field id="UnitPrice" style="width:80px;text-align:right;" rendered="{!displayFlg}" value="{!s.PageObject.UnitPrice_Page__c}" onChange="calPrice('{!s.lineNo}')"/>
-//                                         <!-- &&IF(s.VenderName!='OSH',false,true) -->
-//                                         <script type="text/javascript">
-//                                         var isOSH = j$(escapeVfId('Page:mainForm:block:lists:'+{!CntIndex}+':VenderName')).value();
-//                                         if(isOSH != 'OSH'&&isOSH != ''){
-//                                              j$(escapeVfId('Page:mainForm:block:lists:'+{!CntIndex}+':UnitPrice')).attr('disabled','disabled');
-//                                         }
-//                                         </script>
-//                                         <apex:variable value="{!CntIndex + 1}" var="CntIndex" />
-//                                     </td>
-
-//                                     <td class="dataCell" style="width:100px;text-align:right;">
-//                                         <lightning-formatted-text style="width:80px;display:{!IF(displayFlg, '', 'none')}" id="TotalPrice" value="{0, number, ###,##0.00}">
-//                                             <apex:param value="{!s.PageObject.Subtotal__c}" />
-//                                         </lightning-formatted-text>
-//                                         <lightning-input type="hidden" id="Subtotal__c" value="{!s.PageObject.Subtotal__c}"  rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="NameCode" value="{!s.latestInfo.ProductCode}"/>
-//                                         <lightning-input type="hidden" id="Product_Name" value="{!s.latestInfo.ProductName}"/>
-//                                         <lightning-input type="hidden" id="Product_SFDA" value="{!s.latestInfo.SFDA_Status}"/>
-//                                         <lightning-input type="hidden" id="Product_Specifications" value="{!s.latestInfo.Specifications}"/>
-//                                         <lightning-input type="hidden" id="Sales_Possibility" value="{!s.latestInfo.Sales_Possibility}"/>
-//                                         <lightning-input type="hidden" id="Product_ListPrice" value="{!s.latestInfo.ListPrice}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="Product_Cost" value="{!s.latestInfo.Cost}"/>
-//                                         <lightning-input type="hidden" id="Cost" value="{!s.Cost_c}"/>
-//                                         <lightning-input type="hidden" id="CostSubTotal" value="{!s.Cost_Subtotal_c}"/>
-//                                         <lightning-input type="hidden" id="Bsscategory" value="{!s.PageObject.BSS_Category__c}"/>
-//                                         <lightning-input type="hidden" id="Product_Id" value="{!s.PageObject.Id__c}"/>
-//                                         <lightning-input type="hidden" id="PricebookEntryId" value="{!s.pageObject.PricebookEntryId}"/>
-//                                         <lightning-input type="hidden" id="lineNo" value="{!s.lineNo}"/>
-//                                     </td>
-
-//                                     <!-- CHAN-B4YAB8 2018/9/28 缁忛攢鍟嗗崟浠峰拰灏忚 start -->
-//                                     <!-- <td class="dataCell" style="width:15px;">
-//                                         <lightning-input-field id="Present__c" style="width:10px;" value="{!s.PageObject.Present__c}"
-//                                         onChange="quoteAgencyTotalPriceAction();AgencyDiscountCalculation1();" />
-//                                     </td> -->
-
-//                                     <!-- CHAN-B4YAB8 2018/9/28 缁忛攢鍟嗗崟浠峰拰灏忚 end -->
-//                                     <!-- 澶氬勾淇濅慨 start -->
-//                                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷澶氬勾淇濅慨 淇濅慨鐨勯殣钘� 绮剧悽鎶�鏈� wql 2021/01/28 start rendered="{!IF(trade  == '鍐呰部',true,false)}"-->
-//                                     <apex:variable value="{!1}" id="warranty" var="abc" >
-//                                         <td class="dataCell" style="width:50px;text-align:center;">
-//                                           <lightning-input-field style="width:30px; text-align:center; display:{!IF(displayFlg, '', 'none')}" id="itemMultiYearWarranty" html-disabled="true" value="{!s.PageObject.multiYearWarranty__c}" />
-//                                         </td>
-//                                         <td class="dataCell" style="width:150px;text-align:center;">
-//                                           <lightning-input-field style="width:120px; text-align:center; display:{!IF(displayFlg, '', 'none')}" id="warrantyType" html-disabled="true" value="{!s.PageObject.warrantyType__c}" />
-//                                         </td>
-
-//                                     </apex:variable>
-//                                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷澶氬勾淇濅慨 淇濅慨鐨勯殣钘� 绮剧悽鎶�鏈� wql 2021/01/28 end rendered="{!IF(trade  == '鍐呰部',true,false)}"-->
-
-//                                     <td class="dataCell" style="width:50px;text-align:center;">
-//                                         <lightning-output-field style="width:30px; text-align:center; display:{!IF(displayFlg, '', 'none')}" id="itemGuaranteePeriod" value="{!s.PageObject.GuaranteePeriod__c}" />
-//                                     </td>
-//                                     <!-- 澶氬勾淇濅慨 end -->
-
-//                                     <!-- SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩锛� lt 20210924 add start -->
-//                                     <td class="dataCell" style="width:130px;text-align: center;">
-//                                         <lightning-formatted-text id="Estimated_ConsumptionDueDate" value="{!s.Estimated_ConsumptionDueDate}" />
-//                                         <lightning-input type="hidden" id="Estimated_ConsumptionDueDate1" value="{!s.Estimated_ConsumptionDueDate}" />
-//                                     </td>   
-//                                     <!-- SFDC鍋滄棰勮锛堥璁℃秷鑰楀埌鏈熸棩锛� lt 20210924 add end -->
-
-//                                     <!-- 鏂板姞鐨� -->
-//                                     <td class="dataCell" style="width:100px;text-align:center;">
-//                                         <apex:outputLabel id="Storagestatustext" value="{!s.StorageStatus}"/>
-//                                         <lightning-input type="hidden" id="Storagestatus" rendered="{!displayFlg}" value="{!s.StorageStatus}"/>
-//                                     </td>
-//                                     <td class="dataCell" style="width:100px;">
-//                                         <lightning-input type="hidden" id="Product_Set_Name__c" value="{!s.Product_Set_Name}" />
-//                                         <lightning-formatted-text id="Product_Set_Name" value="{!s.Product_Set_Name}" />
-//                                     </td>
-//                                     <td class="dataCell" id="{!Text(cnt-1)}:td_Name__c" style="width:350px;">
-//                                         <div id="Page:mainForm:block:lists:{!s.lineNo}:NameLink"><apex:outputLink style="width:300px;" value="{!baseUrl}/{!s.PageObject.Id__c}" id="Nametext1" target="_blank">{!s.PageObject.Name__c}</apex:outputLink></div>
-//                                         <lightning-input type="hidden" id="Name__c" value="{!s.PageObject.Name__c}"/>
-//                                         <template layout="none" rendered="{!IF(s.wrong_Register == true, true, false)}">
-//                                         <script type="text/javascript">
-//                                             j$(escapeVfId('Page:mainForm:block:lists:{!Text(cnt-1)}' + ':Nametext1')).css({"color":"red"});
-//                                         </script>
-//                                     </template>
-//                                     </td>
-
-//                                     <!-- 鎶ヤ环璇曠畻 娉ㄩ噴 -->
-//                                     <td class="dataCell" style="text-align:center;width:100px;" hidden="hidden">
-//                                         <lightning-input-field id="Agency_UnitPrice" html-disabled="true" style="width:80px;text-align:right;" rendered="{!displayFlg}" value="{!s.PageObject.AgencyUnitPrice__c}" onChange="calAgencyPrice('{!s.lineNo}')"/>
-//                                     </td>
-//                                     <!-- 鎶ヤ环璇曠畻 娉ㄩ噴 -->
-//                                     <td class="dataCell" style="width:100px;text-align:right;" hidden="hidden">
-//                                         <lightning-formatted-text style="width:80px;display:{!IF(displayFlg, '', 'none')}" id="Agency_TotalPrice" value="{0, number, ###,##0.0}">
-//                                             <apex:param value="{!IF(s.PageObject.Id__c==null,null,s.PageObject.AgencySubtotal__c)}"/>
-//                                         </lightning-formatted-text>
-//                                          <lightning-input type="hidden" id="AgencySubtotal__c" value="{!s.PageObject.AgencySubtotal__c}" rendered="{!displayFlg}"/>
-
-//                                         <!-- 澶氬勾淇濅慨 start -->
-//                                         <lightning-input type="hidden" id="GuaranteePeriod__c" value="{!s.PageObject.GuaranteePeriod__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="provistonPeriod__c" value="{!s.PageObject.provistonPeriod__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="If_Cancel_Guarantee__c" value="{!s.PageObject.If_Cancel_Guarantee__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="ServicePrice__c" value="{!s.PageObject.ServicePrice__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="GuranteePrice__c" value="{!s.GuranteePrice}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="Maintenance_Price_Year__c" value="{!s.Maintenance_Price_Year}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="GuranteeType" value="{!s.PageObject.GuranteeType__c}" rendered="{!displayFlg}"/>
-
-//                                         <lightning-input type="hidden" id="ProductEntend_gurantee_period_all__c" value="{!s.PageObject.ProductEntend_gurantee_period_all__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="ProductGuranteePrice__c" value="{!s.ProductGuranteePrice}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="productServicePrice__c" value="{!s.PageObject.productServicePrice__c}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="latestGuranteeType"
-//                                         value="{!s.latestInfo.GuranteeType}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="latestMaintenance_Price_Year" value="{!s.latestInfo.Maintenance_Price_Year}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="latestIntra_Trade_Gurantee"
-//                                         value="{!s.latestInfo.Intra_Trade_Gurantee}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="latestProductEntend_gurantee_period_all"
-//                                         value="{!s.latestInfo.ProductEntend_gurantee_period_all}" rendered="{!displayFlg}"/>
-//                                         <lightning-input type="hidden" id="latestProductIntra_Trade_Service"
-//                                         value="{!s.latestInfo.Intra_Trade_Service}" rendered="{!displayFlg}"/>
-//                                         <!-- 澶氬勾淇濅慨 end -->
-//                                     </td>
-//                                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 start rendered="{!IF(trade  == '鍐呰部',true,false)}"-->
-//                                     <!--鎶ヤ环璇曠畻 娉ㄩ噴  -->
-//                                     <apex:variable value="{!1}" id="warranty2" var="abc" >
-//                                         <td class="dataCell" style="width:100px;text-align:right;" hidden="hidden">
-//                                             <lightning-input-field style="width:80px;display:{!IF(displayFlg, '', 'none')}" html-disabled="true" id="NoDiscountTotal" value="{!s.PageObject.NoDiscountTotal__c}"/>
-//                                         </td>
-//                                     </apex:variable>
-//                                     <!-- 澶栬锤澶氬勾淇� 鍙栨秷nodiscount闅愯棌 绮剧悽鎶�鏈� wql 2021/01/28 end -->
-//                                     <td class="dataCell" style="width:15px;" >
-//                                         <template if:true="{!s.lineNo < 149}" layout="none">
-//                                             <apex:image id="plusicon" value="{!$Resource.plusicon}" onclick="addRowJs({!s.lineNo + 1});"/>
-//                                         </template>
-//                                     </td>
-//                                 </tr>
-//                         <apex:variable value="{!cnt + 1}" var="cnt" />
-//                         </apex:repeat>
-//                         </table>  <!-- /table class="list" -->
-//                         </template>
-//                     </div>
-//                 </div>
-//             </div>
-//             <BR></BR>
-//             <div>
-//                 <table border="0">
-//                     <tr>
-//                         <td>
-//                              <!--澶氬勾淇濅慨 澧炲姞瀹藉害 start -->
-//                             <table border="0" style="background-color:#ffd6c1; width: 878px;">
-//                                 <!--澶氬勾淇濅慨 end -->
-//                                 <tr>
-//                                     <th style="width:100px;">&nbsp;</th>
-//                                     <th style="width:140px;text-align:center;" bgcolor="#ffd6c1">{!$Label.Calculate}</th>
-//                                     <!-- CHAN-B6H4MH  20181114UpdateStart-->
-//                                     <th style="width:120px;text-align:center;" bgcolor="#ffd6c1">{!$Label.AdjustAmount}</th>
-//                                     <!-- <th style="width:120px;" bgcolor="#ffd6c1">&nbsp;</th>
-//                                     <th style="width:120px;" bgcolor="#ffd6c1">&nbsp;</th>
-//                                     <th style="width:120px;text-align:center;" bgcolor="#ffd6c1">{!$Label.Calculate}</th>
-//                                     <th style="width:120px;text-align:center;" bgcolor="#ffd6c1">{!$Label.Amount}</th> -->
-//                                     <!-- CHAN-B6H4MH  20181114UpdateEnd-->
-//                                 </tr>
-//                                 <tr>
-//                                     <th style="width:100px;text-align:right">{!$Label.Quote_Adjustment}</th>
-//                                     <td style="width:140px;"><lightning-input style="width:110px;text-align:right" id="QuoCalculation" rendered="{!displayFlg}" value="{!qb.Quote_Adjust_Calculate}" onchange="UnitPriceUpdate();"/></td>
-//                                     <td style="width:120px;"><lightning-input-field style="width:110px;text-align:right" id="QuoAmount" rendered="{!displayFlg}" value="{!quo.Quote_Adjust_Amount_Page__c}" onchange="calFromQuoAmont();"/></td>
-//                                     <!-- CHAN-B6H4MH  20181114UpdateStart-->
-//                                     <!-- <th style="width:120px;" bgcolor="#ffd6c1">&nbsp;</th>
-//                                     <th style="width:120px;text-align:center">{!$Label.Discount_Amount}</th>
-//                                     <td style="width:120px;text-align:right"><apex:outputLabel style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="DisCalculation" value="{!DisCalculation}"/></td>
-//                                     <td style="width:120px;text-align:right"><lightning-formatted-text style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="DisAmount" value="{0, number, ###,##0.00}"><apex:param value="{!DisAmount}"/></lightning-formatted-text></td> -->
-//                                     <!-- CHAN-B6H4MH  20181114UpdateEnd-->
-//                                     <th style="width:120px;text-align:center;"></th>
-//                                     <td style="width:120px;" align="center">
-//                                         <!-- <lightning-button action="{!Jump}" rerender="hiddenQuoid" value="璺宠浆" style="width:90px;"
-//                                         /> -->
-//                                         <lightning-button onclick="JumpJs();return false;"  style="width:90px;" value="鎶ヤ环璁$畻"
-//                                         />
-//                                     </td>
-//                                     <th style="width:100px;" bgcolor="#ffd6c1">
-//                                         <!-- 鐢ㄨ繖涓� disabled 棰滆壊澶殫 -->
-//                                         鏄惁杩涜杩囨姤浠疯绠楋細<lightning-input-field style="width:20px;text-align:right" id="IsQuoteTrial" rendered="{!displayFlg}" value="{!quo.IsQuoteTrial__c}"  onclick="return false;" />
-//                                     </th>
-//                                 </tr>
-//                                 <tr><!-- style="display:{!IF(oppInfo.Account_RecordType_DeveloperName!='AgencyContract','table-row','none')};" -->
-//                                     <th style="width:100px;">&nbsp;</th>
-//                                     <th colspan="2" style="width:260px;text-align:center;">{!$Label.Sales_Name}</th>
-//                                     <!-- 鎶ヤ环璇曠畻娉ㄩ噴 -->
-//                                     <!-- <th style="width:120px;text-align:center;">{!$Label.Sales_Div}</th> -->
-//                                     <th style="width:120px;text-align:center;"></th>
-//                                     <th style="width:120px;text-align:center;">{!$Label.Amount}</th>
-//                                     <th style="width:120px;text-align:center;">{!$Label.Sales_Profit}</th>
-//                                     <th style="width:120px;text-align:center;">{!$Label.Percent}</th>
-//                                 </tr>
-//                                 <tr>
-//                                     <th style="width:100px;text-align:right;">{!$Label.Sales_Name1}</th>
-//                                      <!--    2018/09/28 CHAN-B4YAB8 鍘绘帀onchange function getID1(); start -->
-//                                     <td colspan="2" style="width:260px;"><lightning-input-field style="width:230px;" id="SalesName1" value="{!quo.Agency1__c}"/></td>
-//                                      <!--    2018/09/28 CHAN-B4YAB8 鍘绘帀onchange function getID1(); end -->
-//                                     <!-- 澶氬勾淇濅慨娉ㄩ噴    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗘姌鎵� start -->
-//                                     <!--<td style="width:120px;text-align:center">
-//                                         <lightning-formatted-text style="width:110px;text-align:right" id="AgencyDiscount" value="{!AgencyDiscount}"/>
-//                                     </td> -->
-//                                     <!-- 澶氬勾淇濅慨 绗竴缁忛攢鍟� 鎶樻墸鍙樹负 鍙緭鍏� start -->
-//                                     <td style="width:120px;text-align:center" hidden="hidden">
-//                                         <lightning-input style="width:50px;text-align:right" id="AgencyDiscount" value="{!AgencyDiscount}" onchange="callFromAgencyDiscount();"/>
-//                                     </td>
-//                                     <td style="width:120px;text-align:center" >
-//                                     </td>
-//                                     <!-- 澶氬勾淇濅慨 绗竴缁忛攢鍟� 鎶樻墸鍙樹负 鍙緭鍏� end -->
-//                                     <td style="width:120px;"><lightning-input-field style="width:110px;text-align:right" id="SalesAmount1" value="{!quo.OCM_Agent1_Price_Page__c}" rendered="{!displayFlg}" onchange="salesProfit1();setOCMAmount();quoteAgencyTotalPriceAction1('缁忛攢鍟�');AgencyDiscountCalculation1();"/></td>
-//                                     <!--    2018/09/28 CHAN-B4YAB8 缁忛攢鍟嗘姌鎵� end -->  
-//                                     <td style="width:120px;text-align:right"><apex:outputLabel style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="Salesprofit1" value="{!Salesprofit1}"/></td>
-//                                     <td style="width:120px;text-align:right"><apex:outputLabel style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="SalesCalculation1" value="{!qb.SalesCalculation1}" /></td>
-//                                 </tr>
-//                                 <tr>
-//                                     <th style="width:100px;text-align:right;">{!$Label.Sales_Name2}</th>
-//                                     <td colspan="2" style="width:260px;"><lightning-input-field style="width:230px;" id="SalesName2" value="{!quo.Agency2__c}" onChange="getId2();"/></td>
-//                                     <td style="width:120px;"><apex:outputLabel style="width:110px;text-align:right;" id="SalesShopClass2" value="{!SalesShopClass2}" /></td>
-//                                     <td style="width:120px;"><lightning-input-field style="width:110px;text-align:right;" id="SalesAmount2" value="{!quo.Agent1_Agent2_Price_Page__c}" rendered="{!displayFlg}" onchange="salesProfit2();"/></td>
-//                                     <td style="width:120px;text-align:right;"><apex:outputLabel style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="Salesprofit2" value="{!Salesprofit2}" /></td>
-//                                     <td style="width:120px;text-align:right;"><apex:outputLabel style="width:110px;display:{!IF(displayFlg, '', 'none')}" id="SalesCalculation2" value="{!qb.SalesCalculation2}" /></td>
-//                                 </tr>
-//                             </table>
-//                         </td>
-//                         <td>
-//                             <table border="0" style="display:{!IF(hiddenSaveBtn, 'none', '')}">
-//                                 <!-- SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28  by vivek start -->
-//                                 <tr>
-//                                     <td style="width:150px;" align="right"><lightning-button onclick="QuoteConfirmJs();return false;"  rendered="{!UnConfirmQuote}" value="纭鎶ヤ环" style="width:90px;"  /></td>
-//                                 </tr>
-//                                 <!-- SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28 by vivek end -->
-//                                 <tr>
-//                                     <th style="width:150px;" align="right">&nbsp;</th>
-//                                 </tr>
-//                                 <tr>
-//                                     <td style="width:150px;" align="right"><lightning-button onclick="save2btn();return false;" rerender="hiddenQuoid,SFDA_Flg" value="{!$Label.Save_Button}" style="width:90px;" disabled="{!Save_button}" /></td>
-//                                 </tr>
-//                                 <tr>
-//                                     <!-- SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28 by vivek start -->
-//                                     <td style="width:150px;" align="right"><lightning-button onclick="submitOppoApplyStockJs();return false;" rerender="hiddenQuoid,SFDA_Flg" value="澶囪揣纭鐢宠" style="width:90px;" disabled="{!Save_button}" /></td>
-//                                     <!-- <td style="width:150px;" align="right"><lightning-button onclick="submitOppoApplyStockJs();return false;" rerender="hiddenQuoid,SFDA_Flg" value="澶囪揣纭鐢宠" style="width:90px;" disabled="{!Save_button1}" /></td> -->
-//                                     <!-- SI涓氬姟绯荤粺娴佺▼鏀瑰杽鍜屾彁鍗囬」鐩�2019-10-28 by vivek end -->
-//                                 </tr>
-//                                 <tr>
-//                                     <td style="width:150px;" align="right"><lightning-button onclick="oppReflection2btn();return false;" rerender="hiddenQuoid" value="{!$Label.Opp_Button}" style="width:90px;" disabled="{!Save_button}"/></td>
-//                                 </tr>
-//                                 <tr>
-//                                     <!-- 20211029 lt SFDC鍋滄棰勮 add oncomplete="MarkRed();" -->
-//                                     <td style="width:150px;" align="right"><lightning-button onclick="decision2btn();return false;" rerender="errorMsg,hiddenQuoid,SFDA_Flg" value="{!$Label.QuoteDecision_Button}" style="width:90px;" disabled="{!Decision_button}" oncomplete="MarkRed();"/></td>
-//                                     <!--{!Decision_button} --> 
-//                                 </tr>
-//                                 <tr>
-//                                     <!--    2018/09/28 CHAN-B4YAB8 澶嶅埗绮樿创鏉� start -->
-//                                     <td style="width:150px;" align="right"><lightning-button onClick="copyToClipboardNewQuoteEntry(event, displayCost, document.getElementById( 'Page:mainForm:hiddenQuoid').innerHTML, '{!oppInfo.CurrencyIsoCode}');return false;" value="{!$Label.Copy_Detail}" style="width:90px;" rendered="{!displayFlg}" rerender="dummy"/></td>
-//                                     <!--    2018/09/28 CHAN-B4YAB8 澶嶅埗绮樿创鏉� end -->
-//                                 </tr>
-//                                 <tr>
-//                                     <td style="width:150px;" align="right">
-//                                         <lightning-button onclick="DownloadCsvGet()" disabled="{!IF(quoId!=null,false,true)}" value="CSV涓嬭浇" style="width:90px;" reRender="dummy"/>
-//                                     </td>
-//                                 </tr>
-//                             </table>
-//                             <table border="0" >
-//                                 <tr>
-//                                     <td style="width:150px;" align="right"><lightning-button action="{!Back}" rerender="hiddenQuoid" value="杩斿洖璇环" style="width:90px;" /></td>
-//                                 </tr>
-//                                 <!-- 鎶ヤ环璇曠畻 -->
-//                                 <!-- <tr>
-//                                     <td style="width:150px;" align="right">
-                                        
-//                                         <lightning-button onclick="JumpJs();return false;"  style="width:90px;" value="鎶ヤ环璇曠畻"
-//                                         />
-//                                     </td>
-//                                 </tr> -->
-//                             </table>
-//                         </td>
-//                     </tr>
-//                     </table>
-//                 <br></br>
-//                  <!--澶氬勾淇濅慨 澧炲姞瀹藉害 start -->
-//                 <table border="0" style="background-color:#ffd6c1; width: 878px;">
-//                  <!--澶氬勾淇濅慨 澧炲姞瀹藉害 end -->
-//                     <tr>
-//                         <th style="text-align:right;width:80px;">{!$Label.Quote_Print}</th>
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.Unit_Price__c}"/>{!$Label.Detail_Price}</td>
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.Offer_Amount__c}"/>{!$Label.Detail_Sum}</td>
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.TOTAL__c}"/>{!$Label.Total_Price}</td>
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.Discount__c}"/>{!$Label.Total_Discount_Percent}</td>
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.Pricing__c}"/>{!$Label.Total_Discount_Amount}</td>
-//                         <td style="text-align:center;"><lightning-input value="{!quo.Preferential_Trading_Price__c}"/>{!$Label.Row_Total_Sum}</td>
-//                         <!-- 澶氬勾淇濅慨 start -->
-//                         <td style="text-align:center;width:80px;"><lightning-input value="{!quo.Preferential_Gurantee_Period__c}"/>{!$ObjectType.Quote.fields.Preferential_Gurantee_Period__c.label}</td>
-//                         <!-- 澶氬勾淇濅慨 end -->
-//                         <td style="width:120px;text-align:right" colspan="2"><lightning-input value="{!quo.Contract__c}" rendered="{!enableContract}"/>{!$Label.Contract_Breakdown}</td>
-//                     </tr>
-//                     <tr>
-//                         <th style="text-align:right;width:100px;">{!$Label.Print_HPName}</th>
-//                         <td colspan="6">
-//                             <lightning-combobox id="selection_hp" value="{!selection_hp}" style="width:400px;" size="1">
-//                                 <apex:sele
-
-//                                 ctOptions value="{!options_hp}"/>
-//                             </lightning-combobox>
-//                         </td>
-//                         <td  colspan="2" align="right" style="display:{!IF(hiddenSaveBtn, 'none', '')}"><lightning-button onclick="print2btn();return false;" value="{!$Label.Print_Button}" style="width:90px;" disabled="{!print_button}" rendered="{!displayFlg}" rerender="dummy"/></td>
-//                     </tr>
-//                 </table>
-//             </div>
-//         </lightning-card>
-//     </form>
-//     <!-- 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 start -->
-//     <script type="text/javascript">
-        
-//     </script>
-//     <!-- //娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 end -->
-
-
-
-
-// </template> -->
\ No newline at end of file
+        //鍒锋柊
+        this.jzshows5 = false;
+        this.IsLoading5 = true;
+        this.IsLoadingFlag1 = false;
+        setTimeout(() => {
+            this.SelectedOtherDataArr = [];
+            this.IsLoading5 = false;
+            this.jzshows5 = true;
+        }, 1000);
+        setTimeout(() => {
+            this.IsLoadingFlag1 = true;
+        }, 2000);
+    }
+    //鐗圭害閿欒鎻愮ず
+    errorTiShi(str){
+        this.ShowSpecialIsError = true;
+        this.ShowSpecial = true;
+        this.ShowSpecialError = str;
+    }
+    //鐗圭害鎶樻墸妯℃�佹鍙栨秷鎸夐挳鏂规硶
+    cancelSpecial() {
+        this.ShowSpecial = false
+        this.ShowSpecialIsError = false;
+        this.SelectedFnDataSpecial = [];
+        this.SelectedOtherDataArr = [];
+    }
+    //鐗圭害鎶樻墸妯℃�佹淇濆瓨鎸夐挳鏂规硶
+    SavesSpecial() {
+        this.ShowSpecialIsError = false;
+        this.ShowSpecial = false;
+        var ItempTempData = {
+            ...{},
+            ...this.SelectedFnDataSpecial[0]
+        };
+        if (this.SelectedOtherDataArr.length == 0 && this.SelectedFnDataSpecial.length != 0) {
+            this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸浜у搧锛�");
+        } else if (this.SelectedFnDataSpecial.length == 0 && this.SelectedOtherDataArr.length != 0) {
+            this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸鏂规锛�");
+        } else if (this.SelectedFnDataSpecial.length == 0 && this.SelectedOtherDataArr.length == 0) {
+            this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸鏂规鍜屼骇鍝侊紒");
+        } else {
+            ItempTempData.itemss = this.SelectedOtherDataArr;
+            ItempTempData.IsTempItems = true;
+            ItempTempData.NormalDiscount__c_Input = ItempTempData.NormalDiscount__c;
+            ItempTempData.GuaranteeDiscount__c_Input = ItempTempData.GuaranteeDiscount__c;
+            this.SelectedFnDataSpecial[0] = ItempTempData;
+            this.UpdateDiscountData(this.SelectedFnDataSpecial);
+            this.SpecialSavesChange("鐗圭害鎶樻墸", ItempTempData, this.SelectedFnDataSpecial[0].Id, this.SelectedFnDataSpecial[0].CompareId);
+            this.Alert("鐗圭害鎶樻墸閫夋嫨瀹屾垚", 'success');
+            this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
+            this.ComputeDiscount(ItempTempData.Id, ItempTempData.NormalDiscount__c, ItempTempData.GuaranteeDiscount__c, ItempTempData.Category__c, ItempTempData.JxsType);
+            this.SelectedFnDataSpecial = [];
+            this.SelectedOtherDataArr = [];
+        }
+    }
+    //璁$畻鎶樻墸鏀跨瓥
+    ComputeDiscount(id, NormalDiscount__c_Input, GuaranteeDiscount__c_Input, Category__c, JxsType) {
+        //todu2
+        this.updateIdStr("1");
+        var arrProductTemp = this.jzDataProduct; // PromotionId   浜у搧鏄庣粏
+        this.updateIdStr("2");
+        var arrTemp1 = this.jzDataDiscount; //鎶樻墸鏀跨瓥
+        arrTemp1.forEach(item => { //item鎶樻墸鏀跨瓥
+            if (JxsType == '鐗圭害鎶樻墸') {
+                if (item.JxsType == '鐗圭害鎶樻墸') {
+                    if (id == item.Id) {
+                        if (item.iftrue != "鏀硅繃" &&
+                            item.GuaranteeDiscount__c_Input == undefined &&
+                            item.NormalDiscount__c_Input == undefined) {
+                            item.GuaranteeDiscount__c_Input = item.GuaranteeDiscount__c;
+                            item.NormalDiscount__c_Input = item.NormalDiscount__c;
+                        }
+                        if (NormalDiscount__c_Input == item.NormalDiscount__c_Input && //闈炲璞″搧鎶樻墸褰曞叆
+                            GuaranteeDiscount__c_Input == item.GuaranteeDiscount__c_Input) { //瀵硅薄鍝佹姌鎵e綍鍏�
+                            arrProductTemp = ComputeDiscountAuthorizerLogic(this.newArrsTemp,this.newArrsTemp2,item,arrProductTemp);
+                            this.newArrsTemp = newArrsTempExp;
+                            this.newArrsTemp2 = newArrsTemp2Exp;
+                            this.jzDataProduct = arrProductTemp;
+                            //鍚堝悓浠锋牸姹囨��
+                            this.ContractPriceCompute();
+                        }
+                    }
+                }
+            } else if (JxsType == '涓�鑸姌鎵�') {
+                if (item.JxsType == '涓�鑸姌鎵�') {
+                    if (NormalDiscount__c_Input == item.NormalDiscount__c_Input &&
+                        Category__c == item.Category__c) {
+                        this.newArrsTemp = [];
+                        this.newArrsTemp2 = [];
+                        arrProductTemp.forEach(itemss => { //itemss浜у搧鏄庣粏
+                            if (itemss.NormalDiscount__c_Input == item.NormalDiscount__c_Input &&
+                                itemss.Category__c == item.Category__c) {
+                                itemss = commonlyDiscountLogic(itemss, item); //涓�鑸姌鎵h绠楅�昏緫
+                                this.newArrsTemp.push(itemss);
+                            } else if (itemss.Category__c != item.Category__c ||
+                                itemss.NormalDiscount__c_Input != item.NormalDiscount__c_Input) {
+                                this.newArrsTemp2.push(itemss);
+                            }
+                        });
+                        this.jzDataProduct = arrProductTemp;
+                        //鍚堝悓浠锋牸姹囨��
+                        this.ContractPriceCompute();
+                    }
+                }
+            }
+        });
+        this.jzDataDiscount = [].concat(arrTemp1);//20230214
+    }
+    //鎶樻墸鏀跨瓥鍖归厤瑙勫垯
+    SpecialSavesChange(SaveName, SelectedData, IdStr, CompareId) {
+        var newDicountData = [];
+        newDicountData=SpecialSavesChangePartLogic(this.jzDataDefault,SaveName, SelectedData, IdStr, CompareId,0,newDicountData,this.jzDataDiscount);
+        this.jzDataDefault = NewDefaultDatass;
+        this.jzDataProduct =this.jzDataProduct.concat(AddProductDatass);//20230213
+        //鍚堝悓浠锋牸姹囨��
+        this.ContractPriceCompute();
+        this.jzDataDiscount = newDicountData;
+    }
+    //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
+    ConsolidatedDiscountPolicy(SchemeSet) {
+        var arr = [];
+        arr = ConsolidatedDiscountPolicyLogic(SchemeSet, arr);
+        this.jzDataDiscount = [].concat(arr);
+        this.ConsolidatedDiscountDetails(arr);
+    }
+    //鍚堝苟鎶樻墸鏀跨瓥浜у搧鏄庣粏
+    ConsolidatedDiscountDetails(arrSchemes) {
+        var jzdataList = [].concat(this.jzDataProduct);
+        this.jzDataProduct = ConsolidatedDiscountDetailsLogic(arrSchemes, jzdataList);
+    }
+    //=======鐗圭害鎶樻墸妯℃�佹 end======
+    //========涓�鑸姌鎵fā鎬佹 start========
+    //涓�鑸姌鎵fā鎬佹寮�鍏�
+    @track ShowCommonly;
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ鍔犺浇鍔ㄥ浘鏍囪瘑
+    IsLoading4 = false;
+    //涓�鑸姌鎵e緟閫変骇鍝佸睍绀烘爣璇�
+    jzshows4 = true;
+    //
+    IsLoadingFlag = true;
+    //涓�鑸姌鎵e緟閫変骇鍝佺紪杈戝垪淇濆瓨鏂规硶
+    SaveGeneralDiscount(event) {
+        var data = event.detail.rows;
+        let newData = SaveGeneralDiscountLogic(data,this.jzDataCommonly);
+        var boolean = booleanExp;
+        if (boolean == 1) {
+            this.jzDataCommonly = newData;
+            this.ShowCommonlyIsError = false;
+        } else if (boolean == 2) {
+            this.ShowCommonlyIsError = true;
+            this.ShowCommonlyError = "淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰楀ぇ浜庢暟閲�";
+        } else if (boolean == 3) {
+            this.ShowCommonlyIsError = true;
+            this.ShowCommonlyError = "淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰椾负0鎴栦负绌�";
+        }
+        //鍒锋柊
+        this.jzshows4 = false;
+        this.IsLoading4 = true;
+        this.IsLoadingFlag = false;
+        setTimeout(() => {
+            this.SelectedFnCommonlyData = [];
+            this.IsLoading4 = false;
+            this.jzshows4 = true;
+        }, 1000);
+        setTimeout(() => {
+            this.IsLoadingFlag = true;
+        }, 2000);
+    }
+    //涓�鑸姌鎵fā鎬佹鍙栨秷鎸夐挳鏂规硶
+    cancelCommonly() {
+        this.ShowCommonly = false;
+        this.ShowCommonlyIsError = false;
+        this.SelectedFnCommonlyData = [];
+        this.SaveLb = '';
+        this.SaveZk = '';
+    }
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ垪閰嶇疆
+    @track
+    initDataTableCommonly = initDataTableCommonly2;
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄦ暟鎹�
+    @track jzDataCommonly = [];
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ姞杞藉姩鍥炬爣璇�
+    @track tableIsLodingCommonly = true;
+    //涓�鑸姌鎵e緟閫夋柟妗堝垪琛ㄥ姞杞芥柟娉�
+    getTableDataCommonly(event) {
+        if (!this.IsLoadingFlag) {
+            return
+        };
+        this.jzDataCommonly = this.jzDataDefault;
+        this.jzDataCommonly = getTableDataCommonlyLogic(this.jzDataCommonly);
+        this.tableIsLodingCommonly = false;
+    }
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄩ�夋嫨鏁版嵁
+    SelectedFnCommonlyData = [];
+    //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄩ�変腑鏂规硶
+    SelectedFnCommonly(event) {
+        let arr = event.detail.rows;
+        this.SelectedFnCommonlyData = SelectedFnCommonlyLogic(arr);
+    }
+    //浜у搧绯诲垪鏁版嵁
+    SaveLb = '';
+    //浣跨敤鎶樻墸鏁版嵁
+    SaveZk = '';
+    //浜у搧绯诲垪鏂规硶
+    handleChangeLb(event) {
+        this.SaveLb = event.target.value;
+    }
+    //浣跨敤鎶樻墸鏂规硶
+    handleChangeZk(event) {
+        if (event.target.value !== '') {
+            event.target.value = parseFloat(event.target.value) + "%";
+        }
+        this.SaveZk = event.target.value;
+    }
+    //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず鏂规硶
+    errorTiShiYi(str){
+        this.ShowCommonlyIsError = true;
+        this.ShowCommonlyError = str;
+    }
+    //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず榛樿鍐呭
+    ShowCommonlyError = "璇烽�夋嫨涓�鑸骇鍝侊紒";
+    //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず寮�鍏�
+    ShowCommonlyIsError = false;
+    //涓�鑸姌鎵fā鎬佹鍙栨秷鎸夐挳鏂规硶
+    cancelSaveCommonly() {
+        //澶勭悊鏁版嵁
+        var arr = this.SelectedFnCommonlyData;
+        this.ShowCommonlyIsError = false;
+        if (this.SelectedFnCommonlyData.length != 0) {
+            var ItempTempData = {};
+            ItempTempData.Id = GetUUID();
+            ItempTempData.CompareId = GetUUID();
+            ItempTempData.Name = '涓�鑸姌鎵�';
+            ItempTempData.JxsType = "涓�鑸姌鎵�";
+            ItempTempData.itemss = arr;
+            if (this.SaveLb == '' || this.SaveZk == '') {
+                if (this.SaveLb == '' && this.SaveZk != '') {
+                    this.errorTiShiYi("璇烽�夋嫨浜у搧绫诲埆锛�");
+                } else if (this.SaveZk == '' && this.SaveLb != '') {
+                    this.errorTiShiYi("璇疯緭鍏ヤ娇鐢ㄦ姌鎵o紒");
+                } else if (this.SaveZk == '' && this.SaveLb == '') {
+                    this.errorTiShiYi("璇疯緭鍏ヤ娇鐢ㄦ姌鎵e拰浜у搧绫诲埆锛�");
+                }
+            } else {
+                ItempTempData.Category__c = this.SaveLb;
+                ItempTempData.NormalDiscount__c_Input = this.SaveZk;
+                ItempTempData.if_Contain_Nod__c = false;
+                var TempList = [];
+                TempList.push(ItempTempData);
+                this.UpdateDiscountData(TempList);
+                this.SpecialSavesChange("涓�鑸姌鎵�", ItempTempData, ItempTempData.Id, ItempTempData.CompareId);
+                this.cancelCommonly();
+                this.Alert("涓�鑸姌鎵i�夋嫨瀹屾垚", 'success');
+                this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
+                //璁$畻鎶樻墸鏀跨瓥浠锋牸
+                this.ComputeDiscount(ItempTempData.Id, ItempTempData.NormalDiscount__c_Input, ItempTempData.GuaranteeDiscount__c, ItempTempData.Category__c, ItempTempData.JxsType);
+            }
+        } else {
+            this.errorTiShiYi("璇烽�夋嫨涓�鑸骇鍝侊紒");
+        }
+    }
+    //灏嗕骇鍝佷笌鏂规鍖归厤
+    UpdateDiscountData(arrs) { //閫変腑鐨勬暟鎹�
+        if (this.jzDataDiscount == null || this.jzDataDiscount.length <= 0) {
+            this.jzDataDiscount = arrs;
+        } else {
+            this.jzDataDiscount = this.jzDataDiscount.concat(arrs);
+        }
+    }
+    //========涓�鑸姌鎵fā鎬佹 end=======
+    //浜у搧鏄庣粏鍒犻櫎鏂规硶
+    delectTableProduct(){
+        this.DeleteIsChangesFnSingle(this.SelectedFnProductData);
+    }
+    DeleteIsChangesFnSingle(list) {
+        let num = 0;
+         list.forEach(item => {
+             num++;
+             var falg = true;
+             if (item.TypeName == "浠锋牸鏀跨瓥") {
+                 this.DeleteIsChangelogic(item, item.TypeName, num, list);
+                 var TempItem = DeleteIsChangesFnjiage(this.jzDataFixedPrice,this.jzDataProduct,falg,item);
+                 falg = falgExp;
+                 if (TempItem && falg) {
+                     this.SelectedFnDataFixedPrice.push(TempItem);
+                     this.deleteFixedPriceTemp();
+                 }
+             } else if (item.TypeName == "鎶樻墸鏀跨瓥") {
+                 this.DeleteIsChangelogic(item, item.TypeName, num, list);
+                 var TempItemTOName = DeleteIsChangesFnzhekou(this.jzDataDiscount,this.jzDataProduct,falg,item);
+                 falg = falgExp;
+                 if (TempItemTOName != undefined && falg) {
+                     this.SelectedFnDataDiscount.push(TempItemTOName);
+                     this.delectTableDiscountTemp();
+                 }
+             }
+             this.ContractPriceCompute();
+         })
+    }
+    //鍒犻櫎浜у搧鏄庣粏鍜屽緟閫変骇鍝�  item鏄�変腑鐨勪骇鍝佹槑缁嗗璞�  TypeName鏄�変腑鐨勪骇鍝佹槑缁嗗瀵瑰簲鐨勬柟妗堢被鍨�
+    DeleteIsChangelogic(item, TypeName, num, list) {
+        var boofag = DeleteIsChangelogicExp(item,TypeName,this.jzDataProduct,this.jzDataDefault,this.jzDataDefaultCopy);
+        this.jzDataProduct = jzDataProductExp;
+        this.jzDataDefault = jzDataDefaultExp;
+        this.jzDataDefaultCopy = jzDataDefaultCopyExp;
+        if(boofag == 1){
+            this.Alert("淇冮攢鏂规鍐呬骇鍝佸瀷鍙凤紝鏁伴噺鍥哄畾锛屼笉鍙垹闄ゆ槑缁�",'error');
+        }else if(boofag == 2){
+            this.Alert("璇ヤ骇鍝佷负涓�鑸骇鍝侊紝涓嶅彲鍒犻櫎鏄庣粏",'error');
+        }
+        //鍚堝悓浠锋牸姹囨��
+        this.ContractPriceCompute();
+    }
+    delectTableDiscountTemp() {
+        this.jzDataDiscount = delectTableDiscountTempLogic(this.SelectedFnDataDiscount,this.jzDataDiscount);
+        this.SelectedFnDataDiscount = [];
+    }
+    //浜у搧鏄庣粏鍒楄〃鏁版嵁鍔犺浇鏂规硶
+    getTableDataProduct(event) {
+        this.tableIsLodingProduct = false;
+    }
+    //浜у搧鏄庣粏閫変腑鍒楄〃鏁版嵁
+    @track SelectedFnProductData = [];
+    //浜у搧鏄庣粏閫変腑鍒楄〃鏂规硶
+    SelectedFnProduct(event) {
+        let arr = event.detail.rows;
+        this.SelectedFnProductData = arr;
+    }
+    //浜у搧鏄庣粏鍒楄〃鍒楅厤缃�
+    @track
+    initDataTableProduct = initDataTableProduct2;
+    //浜у搧鏄庣粏鍒楄〃鏁版嵁
+    @track jzDataProduct = [];
+    //浜у搧鏄庣粏鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
+    @track tableIsLodingProduct = true;
+    //浜у搧鏄庣粏鍒楄〃灞曠ず鏍囪瘑
+    jzshows= true;
+    //鎵撳嵃瀹㈡埛鍚嶇О start
+    selection_hp = '';
+    options_hp = [];
+    options_hpflg = true;
+    get PrintCustomerNameoptions() {
+        if (this.accountid) {
+            if(this.options_hpflg){
+                selectAccountById({accountid : this.accountid}).then(accs =>{
+                    this.options_hp = PrintCustomerNameoptionsvlue(this.options_hp,this.selection_hp,this.quo,this.options_hpflg,accs);
+                    this.selection_hp = selection_hpExp;
+                    this.options_hpflg = options_hpflgExp;
+                });
+            }else{
+                return this.options_hp;
+            }
+        }else{
+            return this.options_hp;
+        }
+    }
+    PrintCustomerNamehandleChange(event) {
+        this.selection_hp = event.detail.value;
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1