黄千龙
2023-03-28 083202a12647b4f1f8545b8e7bc423bc035786a2
上限合同VM
2个文件已修改
1380 ■■■■■ 已修改文件
force-app/main/default/classes/SelectAssetEstimateVMController.cls 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/SelectAssetEstimateVM.page 1153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SelectAssetEstimateVMController.cls
@@ -18,6 +18,11 @@
    public Boolean printAgent { get; private set; }
    public boolean inDicideFlag {get; set;}                         //作为补充,对应报价决定之后,却未能讲合同起止日期传递给合同的问题
    public String isPaymentSet {get; set;}
    // 报价规则改善 20230309 start
    // public Boolean Is_Blank_period {get; set;}
    // public String Cost_rate_ForecastF{get;set;}
    // public String PastContractendday{get;set;}
    // 报价规则改善 20230309 end
    //public String PaymentSet {get;set;}
    // 引数のサービス契約の情報を格納する。
    public Maintenance_Contract__c contract { get; private set; }
@@ -132,7 +137,7 @@
    public Decimal Denominator {get; set; }
    public Decimal Accrued {get; set; }
    public String ProductModel{get;set;}
    // public String Category{get;set;}
    public String Category{get;set;}
    public Decimal Consumption_rate_Gurante{get;set;}
@@ -392,9 +397,9 @@
                      //URF限次合同2期 LY 20220811 end
                      //多年保设备续签计算逻辑调整 2022/12/14 start 消费率
                      +'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,Product2.Category4__c,Product2.Asset_Model_No__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,'
                      +'CurrentContract_F_asset__r.IS_VMContract_Asset__c,'
                      +'CurrentContract_F__r.endDateGurantee__c,'
                      // +'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,Product2.Category4__c,Product2.Asset_Model_No__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,'
                      // +'CurrentContract_F_asset__r.IS_VMContract_Asset__c,'
                      // +'CurrentContract_F__r.endDateGurantee__c,'
                      //多年保设备续签计算逻辑调整 2022/12/14 end
                      + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c,NoPartRiskDate_F__c,NoPartRiskDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' ';
@@ -827,7 +832,10 @@
                         , Maintenance_Contract__r.Open_RenewalQuotation__c,Maintenance_Contract__r.VM_Contract_Check__c
                         //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220419 end'
                        //LJPH-C9SCX7 【委托】合同无空白期的提醒  lt  20211221  start
                        //, Maintenance_Contract__r.Past_Contract_end_day__c //过去合同结束日
                         // 报价规则改善20230314 start
                        // , Maintenance_Contract__r.Past_Contract_end_day__c //过去合同结束日
                        // ,renewTen_OFF__c
                         // 报价规则改善20230314 end
                        //LJPH-C9SCX7 【委托】合同无空白期的提醒  lt  20211221  end
                        // URF限次合同2期 LY 20220811 start
                        ,URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c
@@ -1030,14 +1038,18 @@
                            , URF_Maintenance_Contract__r.Management_Code__c
                            , URF_Maintenance_Contract__r.Contract_End_Date__c
                            //URF限次合同2期 LY 20220811 end
                            // 报价规则改善 20230315 start
                            // ,IS_StandardPricing__c
                            // 报价规则改善 20230315 end
                            //多年保设备续签计算逻辑调整 2023/1/17 start
                            ,CurrentContract_F_asset__r.Asset_Consumption_Rate__c
                            ,CurrentContract_F_asset__r.Maintenance_Price_Year__c
                            ,CurrentContract_F_asset__r.IS_VMContract_Asset__c
                            ,Product2.Asset_Model_No__c
                            ,Product2.Category4__c
                            ,CurrentContract_F__r.endDateGurantee__c
                            // ,CurrentContract_F_asset__r.Asset_Consumption_Rate__c
                            // ,CurrentContract_F_asset__r.Maintenance_Price_Year__c
                            // ,CurrentContract_F_asset__r.IS_VMContract_Asset__c
                            // ,Product2.Asset_Model_No__c
                            // ,Product2.Category4__c
                            // ,CurrentContract_F__r.endDateGurantee__c
                            //添加是否服务多年保修,多年保维修期至
                            // ,IS_Extend_Gurantee__c,Extend_Gurantee_DateTo__c
                             //多年保设备续签计算逻辑调整 2023/1/17 end
                            FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty_Service__c asc];
            //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start
@@ -1063,7 +1075,17 @@
            }else{
                this.isLimitPrice = false;
            }
        // 上限合同 hql 20230216 start
        // 上限合同 hql 20230216 end
        // 报价规则改善 20230309 start
            // Maintenance_Contract__c mc1 = [SELECT id,Is_Blank_period__c,Cost_rate_ForecastF__c FROM Maintenance_Contract__c  WHERE Id =: this.targetMaintenanceContractId];
            // Boolean IsBlankperiod = mc1.Is_Blank_period__c;
            // this.Cost_rate_ForecastF = mc1.Cost_rate_ForecastF__c;
            // if(IsBlankperiod){
            //     this.Is_Blank_period = true;
            // }else{
            //     this.Is_Blank_period = false;
            // }
        // 报价规则改善 20230309 end
        // 選択済みの納入機器情報を取得
        Map<Id, Integer> selectedAssetIds = new Map<Id, Integer>();
        List<Maintenance_Contract_Asset_Estimate__c> selectedMcaes = new List<Maintenance_Contract_Asset_Estimate__c>();
@@ -1077,12 +1099,12 @@
                Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,
                Asset__r.CurrentContract_F_asset__r.endDateGurantee_Text__c,
                //多年保设备续签计算逻辑调整 2023/1/18 start 设备消费率
                Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c,
                Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c,
                Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c,
                Asset__r.Product2.Asset_Model_No__c,
                Asset__r.Product2.Category4__c,
                Asset__r.CurrentContract_F__r.endDateGurantee__c,
                // Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c,
                // Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c,
                // Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c,
                // Asset__r.Product2.Asset_Model_No__c,
                // Asset__r.Product2.Category4__c,
                // Asset__r.CurrentContract_F__r.endDateGurantee__c,
                //多年保设备续签计算逻辑调整 2022/1/18 end
                Asset__r.CurrentContract_F__r.First_Estimate_Date__c,
                Asset__r.CurrentContract_F__r.Contract_Consumption_rate__c,
@@ -1202,7 +1224,7 @@
                                                                Asset__r.EquipmentGuaranteeFlg__c,
                                                                //2021-11-30 fy add LJPH-C8W8FV 置顶 start
                                                                Asset__r.OwnershipMachine_No__c,
                                                                Product_Manual__r.Category4__c,
                                                                // Product_Manual__r.Category4__c,
                                                                //2021-11-30 fy add LJPH-C8W8FV 置顶 end
                                                                Asset_Consumption_rate__c,
                                                                Asset__r.CurrentContract_F__c,
@@ -1252,7 +1274,7 @@
                                                                Adjustment_Lower_price__c,
                                                                Adjustment_Upper_price__c,
                                                                // 服务合同报价规则改善 20230227 start
                                                                IS_StandardPricing__c,
                                                                // IS_StandardPricing__c,
                                                                // 服务合同报价规则改善 20230227 end
                                                                Last_inspection_day__c,
                                                                Check_Result__c,
@@ -1262,6 +1284,9 @@
                                                                Repair_Price_Auto__c,
                                                                Third_Party_Return__c,
                                                                 //   (2022年12月上线)故障品加费 end 
                                                                // 报价规则改善 20230308 start
                                                                 // Blank_period__c,
                                                                // 报价规则改善 20230308 end
                                                                Comment__c,
                                                                Asset__r.Posting_Date__c,
                                                                EquipmentGuaranteeFlgTxt__c,
@@ -1272,12 +1297,12 @@
                                                                // Gzw 20200807 五个去年合同相关,所以报价产品,获取上期合同 eng
                                                                // LJPH-C9GD34 gzw fix start
                                                                //市场多年保修价格开发 2023/01/28 start
                                                                ,Asset__r.Product2.Asset_Model_No__c
                                                                ,Asset__r.Product2.Category4__c
                                                                ,Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c
                                                                ,Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c
                                                                ,Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c
                                                                ,Asset__r.CurrentContract_F__r.endDateGurantee__c
                                                                // ,Asset__r.Product2.Asset_Model_No__c
                                                                // ,Asset__r.Product2.Category4__c
                                                                // ,Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c
                                                                // ,Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c
                                                                // ,Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c
                                                                // ,Asset__r.CurrentContract_F__r.endDateGurantee__c
                                                                //市场多年保修价格开发 2023/01/28 end
                                                                ,Estimate_List_Price_Page__c
@@ -1328,6 +1353,7 @@
        // Map<String,repair__c> assNewRepMap  = new Map<String,repair__c>();
        // assNewRepMap = getNewrep(this.assetRecords);
        datatemp = getChartData();
        // System.debug(LoggingLevel.INFO, '*** this.assetRecords: ' + this.assetRecords);
        for (Asset ast : this.assetRecords) {
            Boolean isNew = false;
            Decimal listPrice = ast.Maintenance_Price_Month__c;
@@ -1384,7 +1410,9 @@
                //
                //
                //
                // ast.CurrentContract_End_Date__c = ast.CurrentContract_F_asset__r.IS_VMContract_Asset__c ? ast.Extend_Gurantee_DateTo__c : ast.CurrentContract_End_Date__c;
                checkedAssets.add(new AssetInfo(checkedAssets.size(), ast, isNew, listPrice, selectedLocal,estimate));
            } else {
                //update by rentongxiao 2020-09-23 start
                if (ast.AssetMark__c == '主机') {
@@ -1405,6 +1433,8 @@
               }
             */
        }
            // System.debug(LoggingLevel.INFO, '*** checkedAssets: ' + checkedAssets);
        totalPage = (totalRecords / selctRecordNum) + (Math.mod(totalRecords, selctRecordNum) > 0 ? 1 : 0);
    
        system.debug('顺序检测' + checkedAssets);
@@ -1431,7 +1461,7 @@
        //2021-11-30 fy add LJPH-C8W8FV 置顶 start
        List<AssetInfo> topAsset =new List<AssetInfo>();
        List<AssetInfo> otherAsset =new List<AssetInfo>();
        // System.debug(LoggingLevel.INFO, '*** 顺序: ' + checkedAssets);
        for(AssetInfo ched : checkedAssets){
            system.debug('顺序检测2' + ched.ProductModelNoc);
            system.debug('顺序检测3' + ched.AssetModelNoc);
@@ -1456,6 +1486,7 @@
        }
        checkedAssets=NumberSort;
        //2021-11-30 fy add LJPH-C8W8FV 置顶 end
    // System.debug(LoggingLevel.INFO, '*** checkedAssetsEND: ' + checkedAssets);
    }
    
    //
@@ -1504,12 +1535,12 @@
                            + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,'
                            //URF限次合同2期 LY 20220811 end
                            //市场多年保价格开发 start DC 2023/01/17 设备消费率 产品型号 第四分类 是否为多年保设备
                            + 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,'
                            + 'CurrentContract_F_asset__r.Maintenance_Price_Year__c,'
                            + 'CurrentContract_F_asset__r.IS_VMContract_Asset__c,'
                            + 'Product2.Asset_Model_No__c,'
                            + 'Product2.Category4__c,'
                            + 'CurrentContract_F__r.endDateGurantee__c,'
                            // + 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,'
                            // + 'CurrentContract_F_asset__r.Maintenance_Price_Year__c,'
                            // + 'CurrentContract_F_asset__r.IS_VMContract_Asset__c,'
                            // + 'Product2.Asset_Model_No__c,'
                            // + 'Product2.Category4__c,'
                            // + 'CurrentContract_F__r.endDateGurantee__c,'
                            //市场多年保价格开发 end DC 2023/01/17
                            + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' '
                            + 'AND Id NOT IN ' + notInId;
@@ -1569,7 +1600,7 @@
            //URF限次合同2期 LY 20220811 end
            
            //市场多年保价格开发 start DC 2023/01/17 设备消费率
            sqlStr += 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,CurrentContract_F_asset__r.IS_VMContract_Asset__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,Product2.Asset_Model_No__c,Product2.Category4__c,CurrentContract_F__r.endDateGurantee__c,';
            // sqlStr += 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,CurrentContract_F_asset__r.IS_VMContract_Asset__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,Product2.Asset_Model_No__c,Product2.Category4__c,CurrentContract_F__r.endDateGurantee__c,';
            //市场多年保价格开发 start DC 2023/01/17
            sqlStr += ' CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\'';
@@ -1777,6 +1808,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c > :LastYearDate
            and Agreed_Date__c <= :today
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        List<AggregateResult> SecRepairList = [
@@ -1801,6 +1835,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :LastYearDate
            and Agreed_Date__c > :LastSecondYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        // 过去3年间修理实绩
@@ -1826,6 +1863,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :LastSecondYearDate
            and Agreed_Date__c > :LastThirdYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        // 过去3年修理实绩
@@ -1851,6 +1891,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :today
            and Agreed_Date__c > :LastThirdYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
    
@@ -1992,6 +2035,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c > :LastYearDate
            and Agreed_Date__c <= :today
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        List<AggregateResult> SecRepairList = [
@@ -2016,6 +2062,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :LastYearDate
            and Agreed_Date__c > :LastSecondYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        // 过去3年间修理实绩
@@ -2041,6 +2090,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :LastSecondYearDate
            and Agreed_Date__c > :LastThirdYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        // 过去3年修理实绩
@@ -2066,6 +2118,9 @@
            and Agreed_Date__c != null
            and Agreed_Date__c <= :today
            and Agreed_Date__c > :LastThirdYearDate
            // DB202302544421 LHJ add
            and Status2__c !='00.删除'
            and Status2__c !='00.取消'
            group by Delivered_Product__c
        ];
        // 过去1年间
@@ -3523,6 +3578,9 @@
                if (newValue.size() > 0) insert newValue;
            }
            // ④ start
            // 报价规则改善 20230309 start
            // this.contract.Is_Blank_period__c = this.Is_Blank_period;
            // 报价规则改善 20230309 end
            this.contract.Estimation_Id__c = this.targetEstimateId;     
            this.contract.Contract_Esti_Start_Date__c = this.estimate.Contract_Esti_Start_Date__c;
            this.contract.Contract_Range__c = this.estimate.Contract_Range__c;
@@ -3898,23 +3956,23 @@
                //2.一年以上的合同,在结束前6个月开始可以开放续签报价。
                //3.管理员跳过,
                //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220413
                // if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin &&
                //         String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') {
                if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin &&
                        String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') {
                //     Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F__r.Contract_End_Date__c);
                //     Decimal monthCon = (Decimal)noOfDays / 365 * 12;
                //     // 可开始报价的月数限制
                //     if (input.rec.CurrentContract_F__r.Contract_Range__c >= 12 && monthCon > 6) {
                //         input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 合同结束前6个月开始可以制作报价。');
                //         rtn = false;
                //     }
                //     //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + monthCon  + ' +++ ' + Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c/2)));
                //     //rtn = false;
                //     if (input.rec.CurrentContract_F__r.Contract_Range__c < 12 && monthCon > Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c / 2)) {
                //         input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 经历月数过半方可制作报价');
                //         rtn = false;
                //     }
                // }
                    Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F__r.Contract_End_Date__c);
                    Decimal monthCon = (Decimal)noOfDays / 365 * 12;
                    // 可开始报价的月数限制
                    if (input.rec.CurrentContract_F__r.Contract_Range__c >= 12 && monthCon > 6) {
                        input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 合同结束前6个月开始可以制作报价。');
                        rtn = false;
                    }
                    //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + monthCon  + ' +++ ' + Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c/2)));
                    //rtn = false;
                    if (input.rec.CurrentContract_F__r.Contract_Range__c < 12 && monthCon > Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c / 2)) {
                        input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 经历月数过半方可制作报价');
                        rtn = false;
                    }
                }
        // 多年保判断
        if ( String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
            //if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') {
@@ -3926,14 +3984,14 @@
            //市场多年保修价格开发 DC 2023/02/02 Start  结束日空白期大于6个月 报错提示
            Date endDate6Month = input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c.addMonths(6);
            Date cotractEndDay = input.rec.CurrentContract_F__r.endDateGurantee__c;
            // Date endDate6Month = input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c.addMonths(6);
            // Date cotractEndDay = input.rec.CurrentContract_F__r.endDateGurantee__c;
            if(today>endDate6Month && cotractEndDay <today){
                input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 建议空白期控制在1个月以内,如不得己空白期在6个月以上,请先联络服务管理部评估。');
            // if(today>endDate6Month && cotractEndDay <today){
            //     input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 市场多年保结束已超过6个月,由于空白期过长,请先联系服务管理部评估。');
            }
            // }
            //市场多年保修价格开发 DC 2023/02/02 end
@@ -3943,18 +4001,18 @@
            // gzw 20220630 开通续签报价权限后,超过6个月也可以续签
            // 续签情况 ① 上期合同 Open_RenewalQuotation__c & 6个月以内  ② VM_Contract_Check__c Open_RenewalQuotation__c 2个都打钩
            // ① 2个开关都打开 ②VM_Contract_Check__c打开 小于6个月
            // if (!((this.contract.Open_RenewalQuotation__c && input.rec.CurrentContract_F__r.VM_Contract_Check__c) || (input.rec.CurrentContract_F__r.VM_Contract_Check__c && monthCon < 6))) {
            //     if(monthCon < 6){
            //         input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 可以加入服务合同,加入价格请联系服务管理部。');
            //     }else{
            //         input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。');
            //     }
            //     System.debug(LoggingLevel.INFO, '*** this.contract.Open_RenewalQuotation__c: ' + this.contract.Open_RenewalQuotation__c);
            //     System.debug(LoggingLevel.INFO, '*** : input.rec.CurrentContract_F__r.VM_Contract_Check__c' + input.rec.CurrentContract_F__r.VM_Contract_Check__c);
            //     System.debug(LoggingLevel.INFO, '*** monthCon: ' + monthCon);
            //     //input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。');
            //     rtn = false;
            // }
            if (!((this.contract.Open_RenewalQuotation__c && input.rec.CurrentContract_F__r.VM_Contract_Check__c) || (input.rec.CurrentContract_F__r.VM_Contract_Check__c && monthCon < 6))) {
                if(monthCon < 6){
                    input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 可以加入服务合同,加入价格请联系服务管理部。');
                }else{
                    input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。');
                }
                // System.debug(LoggingLevel.INFO, '*** this.contract.Open_RenewalQuotation__c: ' + this.contract.Open_RenewalQuotation__c);
                // System.debug(LoggingLevel.INFO, '*** : input.rec.CurrentContract_F__r.VM_Contract_Check__c' + input.rec.CurrentContract_F__r.VM_Contract_Check__c);
                // System.debug(LoggingLevel.INFO, '*** monthCon: ' + monthCon);
                //input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。');
                rtn = false;
            }
            /*if (input.rec.CurrentContract_F__r.Gurantee_Renew_startDate__c > Date.today()) {
                input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 第一个设备结束后可以制作报价。');
                rtn = false;
@@ -4111,7 +4169,7 @@
    public class AssetInfo {
    // 新合同备品确保提供 当前标记
    public Boolean etGFlg {get; set;}
    public String ISStandardPricing{get; set;}
    // public String ISStandardPricing{get; set;}
    public Integer lineNo {get; private set;}
    public Decimal Repair_Price_Auto {get; set;}
    public String Agreed_Date{get; set;}
@@ -4122,6 +4180,7 @@
    public Maintenance_Contract_Estimate__c estimate {get; set;}
    public Transient Decimal orgPrice {get; private set;}
    public Transient Decimal orgPrice12 {get; private set;}
    // public String Blank_period {get;  set;}
    // add by fxk 2021/9/9 控制点检对象是否可选 Star
    public Boolean CheckRows {get; private set;}
    // add by fxk 2021/9/9 控制点检对象是否可选 End
@@ -4143,7 +4202,7 @@
    public String MDMModelNoc;
    //2021-11-30 fy add LJPH-C8W8FV 置顶 end
    //市场多年保 价格开发 start 2023/01/17
    public String Category;
    // public String Category;
    //市场多年保 价格开发 end 2023/01/17
    public Id getRecId() {
        Id rtn = null;
@@ -4178,9 +4237,16 @@
    public AssetInfo(Integer lineNo, Asset record, Boolean isNew, Decimal listPrice, Maintenance_Contract_Asset_Estimate__c mcae,Maintenance_Contract_Estimate__c estimate) {
        this.lineNo = lineNo;
        this.rec = record;
        this.ISStandardPricing = mcae.IS_StandardPricing__c;
        // this.rec.CurrentContract_End_Date__c = record.CurrentContract_End_Date__c;
        // this.rec.CurrentContract_End_Date__c = record.IS_Extend_Gurantee__c ? record.Extend_Gurantee_DateTo__c : record.CurrentContract_End_Date__c;
        // this.ISStandardPricing = record.IS_StandardPricing__c;
        this.estimate = new Maintenance_Contract_Estimate__c();
        this.estimate.IS_Reduced_price_approval__c = estimate.IS_Reduced_price_approval__c;
         // 报价规则改善 20230308 start
        // this.estimate.Contract_Esti_Start_Date__c = estimate.Contract_Esti_Start_Date__c;
        // this.estimate.renewTen_OFF__c = estimate.renewTen_OFF__c;
         // 报价规则改善 20230308 end
        //   (2022年12月上线)故障品加费 start
        // if (record.Asset_situation__c == '修理中' && record.Return_Without_Repair__r.Agreed_Date__c!=null) {
        //     this.Agreed_Date = '不为空';
@@ -4209,6 +4275,9 @@
            Check_Result__c = mcae.Check_Result__c,
            Repair_Price__c = mcae.Repair_Price__c,
            Repair_Price_pass__c = mcae.Repair_Price_pass__c,
            // 报价规则改善 20230308 start
            // Blank_period__c = mcae.Blank_period__c,
            // 报价规则改善 20230308 end
            Comment__c = mcae.Comment__c,
            EquipmentGuaranteeFlgTxt__c = mcae.EquipmentGuaranteeFlgTxt__c,
            Estimate_Cost__c = mcae.Estimate_Cost__c,
@@ -4232,6 +4301,17 @@
                this.mcae.Repair_Price_pass__c = this.mcae.Repair_Price__c;
            }
        }
         // 报价规则改善 20230308 start
            // if (this.estimate.Contract_Esti_Start_Date__c!=null  && this.rec.CurrentContract_End_Date__c != null) {
            //        this.mcae.Blank_period__c = String.valueof(this.rec.CurrentContract_End_Date__c.daysbetween(this.estimate.Contract_Esti_Start_Date__c));
            // }
            // if (this.estimate.Contract_Esti_Start_Date__c==null && this.rec.CurrentContract_End_Date__c != null) {
            //        this.mcae.Blank_period__c = String.valueof(this.rec.CurrentContract_End_Date__c.daysbetween(system.today()));
            // }
            // if (this.mcae.Blank_period__c!=null&&integer.valueOf(this.mcae.Blank_period__c)<15 ) {
            //         this.mcae.Blank_period__c = '无缝续签';
            // }
        // 报价规则改善 20230308 end
        this.isManual = false;
        this.rec_checkBox_c = true;
        this.orgPrice = record.Maintenance_Price_Month__c;
@@ -4249,7 +4329,7 @@
        //add by rentx 2020-11-12 LJPH-BV93RZ end
        //市场多年保 价格开发 start 2023/01/17
        this.Category = mcae.Product_Manual__r.Category4__c;
        // this.Category = mcae.Product_Manual__r.Category4__c;
        //市场多年保 价格开发 end 2023/01/17
        //add by mzy 2021-02-07 start
@@ -4262,7 +4342,6 @@
    public AssetInfo(Integer lineNo, Maintenance_Contract_Asset_Estimate__c mcae) {
        this.lineNo = lineNo;
        this.rec = null;
        this.ISStandardPricing = mcae.IS_StandardPricing__c;
        this.mcae = new Maintenance_Contract_Asset_Estimate__c(
            //                id = mcae.Id,             // 本当にいらないの? セットしたら、新規権限がなくでも、更新できます。後藤さんに確認した、なくでもいいです。
            isNew__c = mcae.IsNew__c,
@@ -4308,7 +4387,7 @@
        //2021-11-30 fy add LJPH-C8W8FV 置顶 end
        //市场多年保 价格开发 start 2023/01/17
        this.Category = mcae.Product_Manual__r.Category4__c;
        // this.Category = mcae.Product_Manual__r.Category4__c;
        //市场多年保 价格开发 end 2023/01/17
    }
    
force-app/main/default/pages/SelectAssetEstimateVM.page
@@ -41,11 +41,9 @@
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
var RCbottonChanged = 0;
// 故障品
var hasSendEmail = {!hasSendEmail};
console.log('***hasSendEmail',hasSendEmail)// 故障品;
// if(hasSendEmail == true){
//     j$(escapeVfId('allPage:allForm:emailSend')).attr("disabled", true);
//     j$(escapeVfId('allPage:allForm:emailSend')).attr("class", 'btnDisabled');
@@ -271,9 +269,9 @@
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Limit_Price_Amount')).val('');
    }
    Price111 = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Limit_Price_Amount')).val();
    console.log('上限金额为'+Limit_Price_Amount);
    console.log('原有上限金额为'+Limit_PriceHidden);
    console.log('不是上限合同的金额为'+Price111);
    // console.log('上限金额为'+Limit_Price_Amount);
    // console.log('原有上限金额为'+Limit_PriceHidden);
    // console.log('不是上限合同的金额为'+Price111);
    //上限合同 20230103 hql end
    pageSetDisabled();
    var createdDate = new Date('{!estimate.CreatedDate}');
@@ -364,7 +362,7 @@
    }
    
    if ('{!DecideBtnDisabled}' == 'false') {
        console.log('oldMainteReal修改完成');
        // console.log('oldMainteReal修改完成');
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:oldMainteReal')).val(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:mainteReal')).text());
    }
}
@@ -395,6 +393,7 @@
}
function checkDiscount(val) {
    // var alerts = 0;
    if (val == null || val == "") {
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:quotation_Amount')).val("");
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:discount_Rate')).text("");
@@ -406,6 +405,27 @@
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:quotation_Amount')).val(0.00);
        return;
    }
    // 报价金额改善 20230314 start
    // var startime1 =  new Date(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value());
    // var startime2 = new Date(j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value());
    // var result = (startime2-startime1)/(3600*24*1000);
    // Is_Blank_period1 =  j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Is_Blank_period')).value();
    // Cost_rate_ForecastF =  j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Cost_rate_ForecastF')).value();
    // downprice = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceDown')).value();
    // var renewTenOFF = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:renewTenOFF')).value();
    // if (Is_Blank_period1 == 'true' && ((parseFloat(Cost_rate_ForecastF)<100)||Cost_rate_ForecastF.length == 0) && result <=1 && downprice > val ) {
    //    alerts = 1;
    // }
    // if (alerts == 1 && renewTenOFF == 'false') {
    //     if (confirm("本单可以继续申请10%折扣,请确认是否申请,申请后合同开始日自动锁定为合同预定开始日,后续无法更改合同开始日")) {
    //         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:renewTenOFF')).val(true);
    //         val = val*0.9;
    //         j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).attr("disabled", true);
    //     } else {
    //     }
    // }
    // 报价金额改善 20230314 end
    val = localParseFloat(val);
    //val = Math.round(val * 100) / 100;
    val = Math.round(val);
@@ -466,9 +486,188 @@
    console.log('方法2是否审批通过=='+ISReducedpriceapproval+'==============');
}
var number1 = 0;
// function seamlessRenew(cnt){
//     // 报价规则改善 20230309 start
//     var isSeamlessRenew = 0;
//     var isSeamlessRenew1 = 0;
//     var isSeamlessRenew3 = 0;
//     var isSeamlessRenew4 = 0;
//     // 报价规则改善 20230309 end
//     // 报价规则改善 20230310 start
//     var downPriceSum = 0;
//     var upPriceSum = 0;
//     var downPriceSum1 = 0;
//     var upPriceSum1 = 0;
//     var downPriceSum3 = 0;
//     var upPriceSum3 = 0;
//     var downPriceSum4 = 0;
//     var upPriceSum4 = 0;
//     // 报价规则改善 20230310 end
//     // 报价规则改善 20230310 start
//     var renewTenOFF = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:renewTenOFF')).value();
//     if (renewTenOFF == 'true') {
//         j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).attr("disabled", true);
//     }
//         document.getElementById("startdateaddsix1").value = addMonths(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value(),6);
//         document.getElementById("startdateaddsix2").value = addMonths(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value(),6);
//         document.getElementById("startdateaddsix3").value = addMonths(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value(),12);
//     // 报价规则改善 20230310 end
//     for (var i = 0; i < cnt; i++) {
//         // 报价规则改善 20230310 start
//         var  downPrice1 = 0;
//         var  upPrice1 = 0;
//         var  downPrice3 = 0;
//         var  upPrice3 = 0;
//         var  downPrice4 = 0;
//         var  upPrice4 = 0;
//          var Price_YearTXT = 0;
//         var LastMContract_Price = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContract_Price')).val());
//         var isnew = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetNewHidden')).val();
//         // 合同月数乗算
//         var month = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
//         if (month == undefined || month == "") {
//             month = 1;
//         }
//         var month2 = 0;
//         if (month > 12) {
//             month2 = month - 12;
//             month = 12;
//         }
//         var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value();
//         var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
//         if(b != ''){
//                     // var lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':End_Date')).value());
//                     var lastContRange = 0;
//                     if(LastMContractRecord == 'VM_Contract'){
//                         // lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
//                         lastContRange = 36;
//                     }else{
//                         lastContRange = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':lastContRange')).value();
//                     }
//         }
//         var Punish = calculateNtoMRatio( lastContRange,(month + month2));
//          // 报价规则改善 20230310 end
//         if (!isDisabled) {
//             var Adjustment_ratio_Lower = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Lower')).val());
//             var Adjustment_ratio_Upper = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_ratio_Upper')).val());
//              strMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
//                 Price_YearTXT = strMoney * 12;
//                 if (isnew == 'true') {
//                     strMoney = month * strMoney + month2 * strMoney / {!isNewPriceAdj};
//                 } else {
//                     strMoney = month * strMoney + month2 * strMoney;
//                 }
//             // 服务合同报价规则改善 20230227 start
//                     var LastMContractID = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractID')).value();
//                     // var ISStandardPricing = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISStandardPricing')).value();
//                     // 缺少首签设备逻辑
//                     if (LastMContractID == '') {
//                         console.log('新签设备');
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(strMoney));
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(strMoney);
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(strMoney));
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(strMoney);
//                     }
//             // 服务合同报价规则改善 20230227 end
//             var startdate11 = j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value();
//             var startdate1 = j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value();
//             var startdate = new Date(startdate1);
//             var startdatesix1 = new Date(addMonths(startdate11,6));
//             startdatesix1.setDate(startdatesix1.getDate()-1);
//             var startdatesix2 = new Date(addMonths(startdate11,6));
//             startdatesix2.setDate(startdatesix2.getDate()+1);
//             var startdatesix3 = new Date(addMonths(startdate11,12));
//             startdatesix3.setDate(startdatesix3.getDate()+1);
//             // 第一个日期
//             var result1 = Blankperiod(startdate,i,LastMContract_Price,Punish,Adjustment_ratio_Upper,Adjustment_ratio_Lower,strMoney,1);
//             var arr=result1.split( '/');
//             downPrice=parseInt(arr[0]);
//             upPrice=parseInt(arr[1]);
//             isSeamlessRenew=isSeamlessRenew+parseInt(arr[2]);
//             // console.log('result1='+result1);
//             // 第二个日期
//             var result2 = Blankperiod(startdatesix1,i,LastMContract_Price,Punish,Adjustment_ratio_Upper,Adjustment_ratio_Lower,strMoney,2);
//             var arr2=result2.split( '/');
//             downPrice1=parseInt(arr2[0]);
//             upPrice1=parseInt(arr2[1]);
//             isSeamlessRenew1=isSeamlessRenew1+parseInt(arr2[2]);
//             // console.log('result2='+result2);
//             // 第三个日期
//             var result3 = Blankperiod(startdatesix2,i,LastMContract_Price,Punish,Adjustment_ratio_Upper,Adjustment_ratio_Lower,strMoney,2);
//             var arr3=result3.split( '/');
//             downPrice3=parseInt(arr3[0]);
//             upPrice3=parseInt(arr3[1]);
//             isSeamlessRenew3=isSeamlessRenew3+parseInt(arr3[2]);
//             // console.log('result3='+result3);
//             // 第四个日期
//             var result4 = Blankperiod(startdatesix3,i,LastMContract_Price,Punish,Adjustment_ratio_Upper,Adjustment_ratio_Lower,strMoney,2);
//             var arr4=result4.split( '/');
//             downPrice4=parseInt(arr4[0]);
//             upPrice4=parseInt(arr4[1]);
//             isSeamlessRenew4=isSeamlessRenew4+parseInt(arr4[2]);
//             // console.log('result4='+result4);
//             // 报价规则改善 20230308 end
//             // 报价规则改善 20230310 start
//             downPriceSum = downPriceSum + localParseFloat(toNum(downPrice));
//             upPriceSum =  upPriceSum + localParseFloat(toNum(upPrice));
//             downPriceSum1 = downPriceSum1 + localParseFloat(toNum(downPrice1));
//             upPriceSum1 =  upPriceSum1 + localParseFloat(toNum(upPrice1));
//             downPriceSum3 = downPriceSum3 + localParseFloat(toNum(downPrice3));
//             upPriceSum3=  upPriceSum3 + localParseFloat(toNum(upPrice3));
//             downPriceSum4 = downPriceSum4 + localParseFloat(toNum(downPrice4));
//             upPriceSum4=  upPriceSum4 + localParseFloat(toNum(upPrice4));
//             // 报价规则改善 20230310 end
//         }
//     }
//     // 报价规则改善 20230309 start
//     // console.log('isSeamlessRenew='+isSeamlessRenew);
//         if (isSeamlessRenew==0) {
//             j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Is_Blank_period')).val(true);
//         }else{
//             j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Is_Blank_period')).val(false);
//         }
//         var startime1 =  new Date(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:PastContractendday')).value());
//         var startime2 = new Date(j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value());
//         var result = (startime2-startime1)/(3600*24*1000);
//         Is_Blank_period1 =  j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Is_Blank_period')).value();
//         Cost_rate_ForecastF =  j$(escapeVfId('allPage:allForm:allBlock:contractInfo:Cost_rate_ForecastF')).value();
//         // 5.当预测成本率为空时实绩连动价格是否享受9折优惠
//         if (isSeamlessRenew==0 && ((parseFloat(Cost_rate_ForecastF)<100)||Cost_rate_ForecastF.length == 0)) {
//             downPriceSum = downPriceSum*0.9;
//             upPriceSum = upPriceSum*0.9;
//         }
//         if (isSeamlessRenew1==0) {
//             downPriceSum1 = downPriceSum1*0.9;
//             upPriceSum1 = upPriceSum1*0.9;
//         }
//         if (isSeamlessRenew3==0) {
//             downPriceSum3 = downPriceSum3*0.9;
//             upPriceSum3 = upPriceSum3*0.9;
//         }
//         if (isSeamlessRenew4==0) {
//             downPriceSum4 = downPriceSum4*0.9;
//             upPriceSum4 = upPriceSum4*0.9;
//         }
//         if (!isDisabled) {
//         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUp')).text(toNumComma(Math.round(upPriceSum)));
//         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUpHidden')).val(toNum(Math.round(upPriceSum)));
//         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceDown')).text(toNumComma(Math.round(downPriceSum)));
//         j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceDownHidden')).val(toNum(Math.round(downPriceSum)));
//         }
//         document.getElementById("GuidePriceDown5").value = toNumComma(Math.round(downPriceSum));
//         document.getElementById("GuidePriceUp5").value = toNumComma(Math.round(upPriceSum));
//         document.getElementById("GuidePriceDown4").value = toNumComma(Math.round(downPriceSum1));
//         document.getElementById("GuidePriceUp4").value = toNumComma(Math.round(upPriceSum1));
//         document.getElementById("GuidePriceDown3").value = toNumComma(Math.round(downPriceSum3));
//         document.getElementById("GuidePriceUp3").value = toNumComma(Math.round(upPriceSum3));
//         document.getElementById("GuidePriceDown2").value = toNumComma(Math.round(downPriceSum4));
//         document.getElementById("GuidePriceUp2").value = toNumComma(Math.round(upPriceSum4));
//     // 报价规则改善 20230309 end
// }
function refreshAsset(cnt) {
    console.log('执行refreshAsset');
    console.log('decide==='+{!DecideBtnDisabled});
     // alert(cnt);
    // 提交后就页面不计算了
    var isDisabled = {!PageDisabled};
@@ -488,6 +687,8 @@
    var GuranteeCount = 0;
    //多年保续签合同数量 thh 20220316 end
    //2022故障品加费 获取userInfo简档名称 是否为FSE start
    var isFSE = {!isFSE};
    // var isFSE = true;
@@ -503,6 +704,10 @@
    //20230208 上限合同开发 hql end
    // 预定开始日
    var startdate = new Date(j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value());
    // 报价规则改善
    // document.getElementById("startdateaddsix4").value = j$(escapeVfId('allPage:allForm:allBlock:contract:startdate')).value();
    // 报价规则改善
    // 预定开始日-6个月
    startdate.setMonth(startdate.getMonth() - 6);
    // 申请日 当前日期
@@ -529,6 +734,7 @@
        month = 12;
    }
    for (var i = 0; i < cnt; i++) {
        // console.log('第'+i+'个设备');
        var strMoney = 0;
        var repairMoney = 0;
        // 行项目 最高、最低价格合计
@@ -536,8 +742,7 @@
        // 下线价格
        var downPrice = 0;
        // 上线价格
        var upPrice = 0;
        var upPrice = 0;
        // 12个月合同金额
        var Price_YearTXT = 0;
@@ -546,7 +751,7 @@
        var assetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
        //市场多年保修价格开发 DC 2023/02/09 start 
        var VMassetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Maintenance_Price_Year__c')).val();
        // var VMassetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Maintenance_Price_Year__c')).val();
        // console.log('***合同定价:'+VMassetListmonth);
        //市场多年保修价格开发 DC 2023/02/09 end 
@@ -576,7 +781,7 @@
                }
                var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value();
                var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
                console.log('***维修合同记录类型1'+LastMContractRecord);
                // console.log('***维修合同记录类型1'+LastMContractRecord);
                if(b != ''){
                    conCCount ++;
                    // 1.合同期不满一年时,合同期超过一半才可开始续签报价。(eg:11个月的合同从6个月后才可报价。)
@@ -620,112 +825,118 @@
                            var nowdate = new Date();
                            lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                            nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
                            if(nowdate < Date.parse(lastendDate)){
                                upPrice = strMoney;
                                downPrice = strMoney * 0.8;
                            }else{
                                upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                                downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                            //市场多年保修价格开发 DC 2023/1/30 start 
                            var Maxcoefficient =0;
                            var Mincoefficient =0;
                        //     var Maxcoefficient =0;
                        //     var Mincoefficient =0;
                            var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                        //     var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                            var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            console.log('***消费率:'+AssetRate);
                        //     var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                        //     // console.log('***消费率:'+AssetRate);
                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                        //      j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            if(AssetRate>0 &&AssetRate<=0.5){
                                Maxcoefficient = (1-0.3);
                                Mincoefficient = (1-0.4);
                            }else if(AssetRate>0.5 &&AssetRate<=0.6){
                                Maxcoefficient = (1-0.2);
                                Mincoefficient = (1-0.3);
                        //     if(AssetRate>0 &&AssetRate<=0.5){
                        //         Maxcoefficient = (1-0.3);
                        //         Mincoefficient = (1-0.4);
                        //     }else if(AssetRate>0.5 &&AssetRate<=0.6){
                        //         Maxcoefficient = (1-0.2);
                        //         Mincoefficient = (1-0.3);
                                
                            }else if(AssetRate>0.6 &&AssetRate<=0.7){
                                Maxcoefficient = (1-0.15);
                                Mincoefficient = (1-0.25);
                        //     }else if(AssetRate>0.6 &&AssetRate<=0.7){
                        //         Maxcoefficient = (1-0.15);
                        //         Mincoefficient = (1-0.25);
                                
                            }else if(AssetRate>0.7 &&AssetRate<=0.8){
                                Maxcoefficient = (1-0.1);
                                Mincoefficient = (1-0.2);
                        //     }else if(AssetRate>0.7 &&AssetRate<=0.8){
                        //         Maxcoefficient = (1-0.1);
                        //         Mincoefficient = (1-0.2);
                                
                            }else if(AssetRate>0.8 &&AssetRate<=0.9){
                                Maxcoefficient = (1-0.05);
                                Mincoefficient = (1-0.15);
                        //     }else if(AssetRate>0.8 &&AssetRate<=0.9){
                        //         Maxcoefficient = (1-0.05);
                        //         Mincoefficient = (1-0.15);
                                
                            }else if(AssetRate>0.9 &&AssetRate<=1.0){
                                Maxcoefficient = 1;
                                Mincoefficient = (1-0.05);
                        //     }else if(AssetRate>0.9 &&AssetRate<=1.0){
                        //         Maxcoefficient = 1;
                        //         Mincoefficient = (1-0.05);
                                
                            }else if(AssetRate>1.0 &&AssetRate<=1.1){
                                Maxcoefficient = (1+0.05);
                                Mincoefficient = 1;
                        //     }else if(AssetRate>1.0 &&AssetRate<=1.1){
                        //         Maxcoefficient = (1+0.05);
                        //         Mincoefficient = 1;
                                
                            }else if(AssetRate>1.1 &&AssetRate<=1.2){
                                Maxcoefficient = (1+0.1);
                                Mincoefficient = 1;
                        //     }else if(AssetRate>1.1 &&AssetRate<=1.2){
                        //         Maxcoefficient = (1+0.1);
                        //         Mincoefficient = 1;
                                
                            }else if(AssetRate>1.2 &&AssetRate<=1.3){
                                Maxcoefficient = (1+0.2);
                                Mincoefficient = (1+0.1);
                        //     }else if(AssetRate>1.2 &&AssetRate<=1.3){
                        //         Maxcoefficient = (1+0.2);
                        //         Mincoefficient = (1+0.1);
                                
                            }else if(AssetRate>1.3 &&AssetRate<=1.4){
                                Maxcoefficient = (1+0.25);
                                Mincoefficient = (1+0.15);
                        //     }else if(AssetRate>1.3 &&AssetRate<=1.4){
                        //         Maxcoefficient = (1+0.25);
                        //         Mincoefficient = (1+0.15);
                                
                            }else if(AssetRate>1.4){
                                Maxcoefficient = (1+0.3);
                                Mincoefficient = (1+0.2);
                        //     }else if(AssetRate>1.4){
                        //         Maxcoefficient = (1+0.3);
                        //         Mincoefficient = (1+0.2);
                                
                            }
                            //市场多年保修价格开发 DC 2023/1/30 end
                            console.log('***最高系数'+Maxcoefficient);
                            console.log('***最低系数'+Mincoefficient);
                        //     }
                        //     //市场多年保修价格开发 DC 2023/1/30 end
                        //     // console.log('***最高系数'+Maxcoefficient);
                        //     // console.log('***最低系数'+Mincoefficient);
                        if(nowdate < Date.parse(lastendDate)){
                            //设备小于两年半
                            // upPrice = strMoney;
                            // downPrice = strMoney * 0.8;
                        console.log('***小于2年半')
                        // 市场多年保修价格开发 start DC 2023/01/19
                            //市场多年保设备小于2年半
                            var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                            var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                            console.log('***设备型号'+AssetModelNo);
                            console.log('***产品类型'+Category4);
                        // if(nowdate < Date.parse(lastendDate)){
                        //     //设备小于两年半
                        //     // upPrice = strMoney;
                        //     // downPrice = strMoney * 0.8;
                        // // console.log('***小于2年半')
                        // // 市场多年保修价格开发 start DC 2023/01/19
                        //     //市场多年保设备小于2年半
                        //     var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                        //     var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                        //     // console.log('***设备型号'+AssetModelNo);
                        //     // console.log('***产品类型'+Category4);
                            //设备设备消费率小于1.4
                            if(AssetRate<1.4){
                                upPrice = VMassetListmonth * ContractMonth /12;
                                console.log('消费率小于1.4 upPrice = 定价 *经历月数 /12'+ upPrice);
                        //     //设备设备消费率小于1.4
                        //     if(AssetRate<1.4){
                        //         upPrice = VMassetListmonth * ContractMonth /12;
                        //         // console.log('消费率小于1.4 upPrice = 定价 *经历月数 /12'+ upPrice);
                                if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                                    downPrice = upPrice;
                                    console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                        //         if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                        //             downPrice = upPrice;
                        //             // console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                                }else{
                                    downPrice = upPrice * 0.8;
                                    console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                        //         }else{
                        //             downPrice = upPrice * 0.8;
                        //             // console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                                }
                            }else{
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                console.log('消费率大于1.4 upPrice'+ upPrice);
                                console.log('消费率大于1.4 downPrice'+ downPrice);
                            }
                            // 市场多年保修价格开发 end DC 2023/01/19
                            }else{
                                // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                                // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                        //         }
                        //     }else{
                        //         upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                        //         downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                        //         // console.log('消费率大于1.4 upPrice'+ upPrice);
                        //         // console.log('消费率大于1.4 downPrice'+ downPrice);
                        //     }
                        //     // 市场多年保修价格开发 end DC 2023/01/19
                        //     }else{
                        //         // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                        //         // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                                //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数
                        //         //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数
                               
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                        //         upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                        //         downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 upPrice'+ upPrice);
                                console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 downPrice'+ downPrice);
                                // console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 upPrice'+ upPrice);
                                // console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 downPrice'+ downPrice);
                                //市场多年保修价格开发 DC 2023/1/30 end 
                            
@@ -734,18 +945,18 @@
                        }else{
                            upPrice = strMoney;
                            downPrice = strMoney * 0.8;
                            console.log('选择1');
                            // console.log('选择1');
                        }
                    }else{
                        upPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Upper/100);
                        downPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Lower/100);
                        console.log('选择2');
                        // console.log('选择2');
                    }
                }else{
                    //firstCCount ++;
                    upPrice = strMoney;
                    downPrice = strMoney * 0.8;
                    console.log('选择3');
                    // console.log('选择3');
                }
                // 上下限四舍五入
                upPrice = upPrice.toFixed(2);
@@ -754,24 +965,12 @@
                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXT')).text(toNumComma(Price_YearTXT));
                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXTHidden')).val(Price_YearTXT);
                if (!isDisabled) {
                    // // 服务合同报价规则改善 20230227 start
                    // var LastMContractID = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractID')).value();
                    // var ISStandardPricing = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISStandardPricing')).value();
                    // if (LastMContractID == '' && ISStandardPricing == '是') {
                    //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(upPrice));
                    //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(upPrice);
                    //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice));
                    //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(upPrice);
                    // }
                    // // 服务合同报价规则改善 20230227 end
                    // else{
                    // 实际联动价格 start
                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice));
                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(downPrice);
                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice));
                    j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(upPrice);
                    // 实际联动价格 end
                    // }
                }
                
                //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text(toNumComma(strMoney));
@@ -815,7 +1014,7 @@
            var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value(); 
            var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
            console.log('***维修合同记录类型2'+LastMContractRecord);
            // console.log('***维修合同记录类型2'+LastMContractRecord);
            if(b != ''){
                conCCount ++;
@@ -862,124 +1061,129 @@
                        var nowdate = new Date();
                        lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                        nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
                        console.log('**结束日',lastendDate);
                        // console.log('**结束日',lastendDate);
                        //市场多年保修价格开发 DC 2023/1/30 start 
                            var Maxcoefficient =0;
                            var Mincoefficient =0;
                            // var Maxcoefficient =0;
                            // var Mincoefficient =0;
                            var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                            console.log('***经历月数'+ContractMonth);
                            var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            console.log('***消费率:'+AssetRate);
                            // var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                            // // console.log('***经历月数'+ContractMonth);
                            // var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            // // console.log('***消费率:'+AssetRate);
                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            //  j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            if(AssetRate>0 &&AssetRate<=0.5){
                                Maxcoefficient = (1-0.3);
                                Mincoefficient = (1-0.4);
                            }else if(AssetRate>0.5 &&AssetRate<=0.6){
                                Maxcoefficient = (1-0.2);
                                Mincoefficient = (1-0.3);
                            // if(AssetRate>0 &&AssetRate<=0.5){
                            //     Maxcoefficient = (1-0.3);
                            //     Mincoefficient = (1-0.4);
                            // }else if(AssetRate>0.5 &&AssetRate<=0.6){
                            //     Maxcoefficient = (1-0.2);
                            //     Mincoefficient = (1-0.3);
                                
                            }else if(AssetRate>0.6 &&AssetRate<=0.7){
                                Maxcoefficient = (1-0.15);
                                Mincoefficient = (1-0.25);
                            // }else if(AssetRate>0.6 &&AssetRate<=0.7){
                            //     Maxcoefficient = (1-0.15);
                            //     Mincoefficient = (1-0.25);
                                
                            }else if(AssetRate>0.7 &&AssetRate<=0.8){
                                Maxcoefficient = (1-0.1);
                                Mincoefficient = (1-0.2);
                            // }else if(AssetRate>0.7 &&AssetRate<=0.8){
                            //     Maxcoefficient = (1-0.1);
                            //     Mincoefficient = (1-0.2);
                                
                            }else if(AssetRate>0.8 &&AssetRate<=0.9){
                                Maxcoefficient = (1-0.05);
                                Mincoefficient = (1-0.15);
                            // }else if(AssetRate>0.8 &&AssetRate<=0.9){
                            //     Maxcoefficient = (1-0.05);
                            //     Mincoefficient = (1-0.15);
                                
                            }else if(AssetRate>0.9 &&AssetRate<=1.0){
                                Maxcoefficient = 1;
                                Mincoefficient = (1-0.05);
                            // }else if(AssetRate>0.9 &&AssetRate<=1.0){
                            //     Maxcoefficient = 1;
                            //     Mincoefficient = (1-0.05);
                                
                            }else if(AssetRate>1.0 &&AssetRate<=1.1){
                                Maxcoefficient = (1+0.05);
                                Mincoefficient = 1;
                            // }else if(AssetRate>1.0 &&AssetRate<=1.1){
                            //     Maxcoefficient = (1+0.05);
                            //     Mincoefficient = 1;
                                
                            }else if(AssetRate>1.1 &&AssetRate<=1.2){
                                Maxcoefficient = (1+0.1);
                                Mincoefficient = 1;
                            // }else if(AssetRate>1.1 &&AssetRate<=1.2){
                            //     Maxcoefficient = (1+0.1);
                            //     Mincoefficient = 1;
                                
                            }else if(AssetRate>1.2 &&AssetRate<=1.3){
                                Maxcoefficient = (1+0.2);
                                Mincoefficient = (1+0.1);
                            // }else if(AssetRate>1.2 &&AssetRate<=1.3){
                            //     Maxcoefficient = (1+0.2);
                            //     Mincoefficient = (1+0.1);
                                
                            }else if(AssetRate>1.3 &&AssetRate<=1.4){
                                Maxcoefficient = (1+0.25);
                                Mincoefficient = (1+0.15);
                            // }else if(AssetRate>1.3 &&AssetRate<=1.4){
                            //     Maxcoefficient = (1+0.25);
                            //     Mincoefficient = (1+0.15);
                                
                            }else if(AssetRate>1.4){
                                Maxcoefficient = (1+0.3);
                                Mincoefficient = (1+0.2);
                            // }else if(AssetRate>1.4){
                            //     Maxcoefficient = (1+0.3);
                            //     Mincoefficient = (1+0.2);
                                
                            }
                            // }
                            //市场多年保修价格开发 DC 2023/1/30 end 
                            console.log('***最高系数'+Maxcoefficient);
                            console.log('***最低系数'+Mincoefficient);
                            // console.log('***最高系数'+Maxcoefficient);
                            // console.log('***最低系数'+Mincoefficient);
                        if(nowdate < Date.parse(lastendDate)){
                            //设备小于两年半
                            // upPrice = strMoney;
                            // downPrice = strMoney * 0.8;
                        // 市场多年保修价格开发 start DC 2023/01/19
                            //市场多年保设备小于2年半
                            var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                            var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                            console.log('***设备型号'+AssetModelNo);
                            console.log('***产品类型'+Category4);
                            //设备设备消费率小于1.4
                            if(AssetRate<1.4){
                                upPrice = VMassetListmonth *ContractMonth / 12;
                                console.log('消费率小于1.4 upPrice = VMassetListmonth *month /12'+ upPrice);
                                if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                                    downPrice = upPrice;
                                    console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                                }else{
                                    downPrice = upPrice * 0.8;
                                    console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                                }
                            }else{
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                console.log('消费率大于1.4 upPrice'+ upPrice);
                                console.log('消费率大于1.4 downPrice'+ downPrice);
                            }
                        // 市场多年保修价格开发 end DC 2023/01/19
                            upPrice = strMoney;
                            downPrice = strMoney * 0.8;
                        }else{
                            //设备大于两年半
                            // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                            // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                            upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                            downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                        //     //设备小于两年半
                        //     // upPrice = strMoney;
                        //     // downPrice = strMoney * 0.8;
                        // // 市场多年保修价格开发 start DC 2023/01/19
                        //     //市场多年保设备小于2年半
                        //     var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                        //     var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                        //     // console.log('***设备型号'+AssetModelNo);
                        //     // console.log('***产品类型'+Category4);
                            //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数
                            upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                            downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                        //     //设备设备消费率小于1.4
                        //     if(AssetRate<1.4){
                        //         upPrice = VMassetListmonth *ContractMonth / 12;
                        //         // console.log('消费率小于1.4 upPrice = VMassetListmonth *month /12'+ upPrice);
                            console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 upPrice'+ upPrice);
                            console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 downPrice'+ downPrice);
                        //         if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                        //             downPrice = upPrice;
                        //             // console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                        //         }else{
                        //             downPrice = upPrice * 0.8;
                        //             // console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                        //         }
                        //     }else{
                        //         upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                        //         downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                        //         // console.log('消费率大于1.4 upPrice'+ upPrice);
                        //         // console.log('消费率大于1.4 downPrice'+ downPrice);
                        //     }
                        // // 市场多年保修价格开发 end DC 2023/01/19
                        // }else{
                        //     //设备大于两年半
                        //     // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                        //     // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                        //     //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数
                        //     upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                        //     downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                            // console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 upPrice'+ upPrice);
                            // console.log('设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数 downPrice'+ downPrice);
                            //市场多年保修价格开发 DC 2023/1/30 end 
                        }
                        // gzw 20220630  实际联动6个月价格区分
                    }else{
                        upPrice = strMoney;
                        downPrice = strMoney * 0.8;
                        console.log('选择4');
                        // console.log('选择4');
                    }
                }else{
                    upPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Upper/100);
                    downPrice = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Lower/100);
                    console.log('选择5');
                    // console.log('选择5');
                }
            }else{
                if (isnew == 'true') {
@@ -998,18 +1202,7 @@
            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXT')).text(toNumComma(Price_YearTXT));
            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceTXTHidden')).val(Price_YearTXT);
            if (!isDisabled) {
                // // 服务合同报价规则改善 20230227 start
                // var LastMContractID = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractID')).value();
                // var ISStandardPricing = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':ISStandardPricing')).value();
                // console.log('ISStandardPricing=='+ISStandardPricing);
                // if (LastMContractID == '' && ISStandardPricing == '是') {
                //     console.log('开始执行');
                //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(upPrice));
                //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_priceHidden')).val(upPrice);
                //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice));
                //     j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_priceHidden')).val(upPrice);
                // }
                // // 服务合同报价规则改善 20230227 end
                // else{
                // 实际联动价格 start
                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice));
@@ -1021,13 +1214,14 @@
            }
            //j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPrice')).text(toNumComma(strMoney));
            j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPricePageHidden')).val(strMoney);
            //<!-- (2022年12月上线)故障品加费 start -->
            
            //<!-- (2022年12月上线)故障品加费 start -->
            Repair_Price_AutoPrice = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_Auto'));
            Repair_Price_Auto = Repair_Price_AutoPrice.value();
            repairMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).value();
            Repair_Price_pass = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Repair_Price_pass')).val();
            console.log((i+1)+'号repairMoney='+repairMoney);
            // console.log((i+1)+'号repairMoney='+repairMoney);
            // console.log((i+1)+'号Repair_Price_Auto='+Repair_Price_Auto);
            if ((repairMoney+1)==1) {
                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).val(Repair_Price_Auto);
@@ -1039,7 +1233,7 @@
            }
            repairMoney1 = localParseFloat(repairMoney);
            ISReducedpriceapproval = j$(escapeVfId('allPage:allForm:allBlock:ISReducedpriceapproval')).val();
            console.log('ISReducedpriceapproval=='+ISReducedpriceapproval);
            // console.log('ISReducedpriceapproval=='+ISReducedpriceapproval);
            var isDisabled = {!PageDisabled};
            if (ISReducedpriceapproval =='有八折以下待审批' || ISReducedpriceapproval =='是'|| isDisabled) {
                j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':repairPrice')).attr("disabled", true);
@@ -1086,6 +1280,7 @@
        listSum = listSum + localParseFloat(toNum(strMoney));
        downPriceSum = downPriceSum + localParseFloat(toNum(downPrice));
        upPriceSum =  upPriceSum + localParseFloat(toNum(upPrice));
    }
    
   
@@ -1094,6 +1289,7 @@
    
    //j$(escapeVfId('allPage:allForm:allBlock:contractInfo:assetSumPrice')).text(toNumComma(listSum));
    //j$(escapeVfId('allPage:allForm:allBlock:contractInfo:assetSumPriceHidden')).val(toNum(listSum));
    if (!isDisabled) {
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUp')).text(toNumComma(Math.round(upPriceSum)));
        j$(escapeVfId('allPage:allForm:allBlock:contractInfo:GuidePriceUpHidden')).val(toNum(Math.round(upPriceSum)));
@@ -1125,14 +1321,18 @@
    }else{
        result = '续签合同';
    }
    console.log(result);
    // console.log(result);
    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXT").innerHTML = result;
    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXTHidden").value = result;
    // 取消酸化水
    //NotUseOxygenatedWaterAmount(1);
    examinationPriceCal(cnt);
    getLastContractRate();
    // 报价规则改善 20230315 start
    // seamlessRenew(cnt);
    // 报价规则改善 20230315 end
    number1++;
}
function changeAsset(cnt) {
    console.log('执行了changeAsset');
@@ -1216,7 +1416,7 @@
        var isnew = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetNewHidden')).val();
        var assetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
        //市场多年保修价格开发 DC 2023/02/09 start 
        var VMassetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Maintenance_Price_Year__c')).val();
        // var VMassetListmonth = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Maintenance_Price_Year__c')).val();
        //市场多年保修价格开发 DC 2023/02/09 end 
        if (isManual == 'true') {
@@ -1232,8 +1432,8 @@
                strMoney = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':assetListPriceHidden')).val();
                var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
                // alert(strMoney);
                console.log('***维修合同记录类型3'+LastMContractRecord);
                // // alert(strMoney);
                // console.log('***维修合同记录类型3'+LastMContractRecord);
                Price_YearTXT = strMoney * 12;
                if (isnew == 'true') {
@@ -1289,107 +1489,111 @@
                            var nowdate = new Date();
                            lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                            nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
                            if(nowdate < Date.parse(lastendDate)){
                                upPrice = strMoney;
                                downPrice = strMoney * 0.8;
                            //市场多年保修价格开发 DC 2023/1/30 start 
                            var Maxcoefficient =0;
                            var Mincoefficient =0;
                        //     var Maxcoefficient =0;
                        //     var Mincoefficient =0;
                            var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            console.log('***消费率:'+AssetRate);
                        //     var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                        //     console.log('***消费率:'+AssetRate);
                            var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                        //     var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                        //      j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            if(AssetRate>0 &&AssetRate<=0.5){
                                Maxcoefficient = (1-0.3);
                                Mincoefficient = (1-0.4);
                            }else if(AssetRate>0.5 &&AssetRate<=0.6){
                                Maxcoefficient = (1-0.2);
                                Mincoefficient = (1-0.3);
                        //     if(AssetRate>0 &&AssetRate<=0.5){
                        //         Maxcoefficient = (1-0.3);
                        //         Mincoefficient = (1-0.4);
                        //     }else if(AssetRate>0.5 &&AssetRate<=0.6){
                        //         Maxcoefficient = (1-0.2);
                        //         Mincoefficient = (1-0.3);
                                
                            }else if(AssetRate>0.6 &&AssetRate<=0.7){
                                Maxcoefficient = (1-0.15);
                                Mincoefficient = (1-0.25);
                        //     }else if(AssetRate>0.6 &&AssetRate<=0.7){
                        //         Maxcoefficient = (1-0.15);
                        //         Mincoefficient = (1-0.25);
                                
                            }else if(AssetRate>0.7 &&AssetRate<=0.8){
                                Maxcoefficient = (1-0.1);
                                Mincoefficient = (1-0.2);
                        //     }else if(AssetRate>0.7 &&AssetRate<=0.8){
                        //         Maxcoefficient = (1-0.1);
                        //         Mincoefficient = (1-0.2);
                                
                            }else if(AssetRate>0.8 &&AssetRate<=0.9){
                                Maxcoefficient = (1-0.05);
                                Mincoefficient = (1-0.15);
                        //     }else if(AssetRate>0.8 &&AssetRate<=0.9){
                        //         Maxcoefficient = (1-0.05);
                        //         Mincoefficient = (1-0.15);
                                
                            }else if(AssetRate>0.9 &&AssetRate<=1.0){
                                Maxcoefficient = 1;
                                Mincoefficient = (1-0.05);
                        //     }else if(AssetRate>0.9 &&AssetRate<=1.0){
                        //         Maxcoefficient = 1;
                        //         Mincoefficient = (1-0.05);
                                
                            }else if(AssetRate>1.0 &&AssetRate<=1.1){
                                Maxcoefficient = (1+0.05);
                                Mincoefficient = 1;
                        //     }else if(AssetRate>1.0 &&AssetRate<=1.1){
                        //         Maxcoefficient = (1+0.05);
                        //         Mincoefficient = 1;
                                
                            }else if(AssetRate>1.1 &&AssetRate<=1.2){
                                Maxcoefficient = (1+0.1);
                                Mincoefficient = 1;
                        //     }else if(AssetRate>1.1 &&AssetRate<=1.2){
                        //         Maxcoefficient = (1+0.1);
                        //         Mincoefficient = 1;
                                
                            }else if(AssetRate>1.2 &&AssetRate<=1.3){
                                Maxcoefficient = (1+0.2);
                                Mincoefficient = (1+0.1);
                        //     }else if(AssetRate>1.2 &&AssetRate<=1.3){
                        //         Maxcoefficient = (1+0.2);
                        //         Mincoefficient = (1+0.1);
                                
                            }else if(AssetRate>1.3 &&AssetRate<=1.4){
                                Maxcoefficient = (1+0.25);
                                Mincoefficient = (1+0.15);
                        //     }else if(AssetRate>1.3 &&AssetRate<=1.4){
                        //         Maxcoefficient = (1+0.25);
                        //         Mincoefficient = (1+0.15);
                                
                            }else if(AssetRate>1.4){
                                Maxcoefficient = (1+0.3);
                                Mincoefficient = (1+0.2);
                        //     }else if(AssetRate>1.4){
                        //         Maxcoefficient = (1+0.3);
                        //         Mincoefficient = (1+0.2);
                                
                            }
                            //市场多年保修价格开发 DC 2023/1/30 end
                            console.log('***最高系数'+Maxcoefficient);
                            console.log('***最低系数'+Mincoefficient);
                        //     }
                        //     //市场多年保修价格开发 DC 2023/1/30 end
                        //     // console.log('***最高系数'+Maxcoefficient);
                        //     // console.log('***最低系数'+Mincoefficient);
                        if(nowdate < Date.parse(lastendDate)){
                            //设备小于两年半
                            // upPrice = strMoney;
                            // downPrice = strMoney * 0.8;
                        console.log('***小于2年半')
                        // 市场多年保修价格开发 start DC 2023/01/19
                            //市场多年保设备小于2年半
                            var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                            var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                            console.log('***设备型号'+AssetModelNo);
                            console.log('***产品类型'+Category4);
                        // if(nowdate < Date.parse(lastendDate)){
                        //     //设备小于两年半
                        //     // upPrice = strMoney;
                        //     // downPrice = strMoney * 0.8;
                        // // console.log('***小于2年半')
                        // // 市场多年保修价格开发 start DC 2023/01/19
                        //     //市场多年保设备小于2年半
                        //     var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                        //     var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                        //     // console.log('***设备型号'+AssetModelNo);
                        //     // console.log('***产品类型'+Category4);
                            //设备设备消费率小于1.4
                            if(AssetRate<1.4){
                                upPrice = VMassetListmonth * ContractMonth / 12 ;
                                console.log('消费率小于1.4 upPrice = VMassetListmonth *ContractMonth / 12'+ upPrice);
                        //     //设备设备消费率小于1.4
                        //     if(AssetRate<1.4){
                        //         upPrice = VMassetListmonth * ContractMonth / 12 ;
                        //         // console.log('消费率小于1.4 upPrice = VMassetListmonth *ContractMonth / 12'+ upPrice);
                                if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                                    downPrice = upPrice;
                                    console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                        //         if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                        //             downPrice = upPrice;
                        //             // console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                                }else{
                                    downPrice = upPrice * 0.8;
                                    console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                        //         }else{
                        //             downPrice = upPrice * 0.8;
                        //             // console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                                }
                            }else{
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                console.log('消费率大于1.4 upPrice'+ upPrice);
                                console.log('消费率大于1.4 downPrice'+ downPrice);
                            }
                        //         }
                        //     }else{
                        //         upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                        //         downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                        //             // console.log('消费率大于1.4 upPrice'+ upPrice);
                        //             // console.log('消费率大于1.4 downPrice'+ downPrice);
                        //     }
                            // 市场多年保修价格开发 end DC 2023/01/19  
                            }else{
                                upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                                downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                                // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                                // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                                //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 =定价*消费率对应系数 / 12 *合同月数
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                // upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                // downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                //市场多年保修价格开发 DC 2023/1/30 end 
                            }
                            // gzw 20220630  实际联动6个月价格区分
@@ -1509,104 +1713,108 @@
                        nowdate = nowdate.setMonth(nowdate.getMonth() + 6);
                         //市场多年保修价格开发 DC 2023/1/30 start 
                            var Maxcoefficient =0;
                            var Mincoefficient =0;
                            // var Maxcoefficient =0;
                            // var Mincoefficient =0;
                            var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            console.log('***消费率:'+AssetRate);
                            // var AssetRate = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':AssetConsumptionRateNew')).val());
                            // console.log('***消费率:'+AssetRate);
                            var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                            // var ContractMonth = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contract:monthRange')).val());
                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            //  j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contractrate')).text(AssetRate +'%');
                            if(AssetRate>0 &&AssetRate<=0.5){
                                Maxcoefficient = (1-0.3);
                                Mincoefficient = (1-0.4);
                            }else if(AssetRate>0.5 &&AssetRate<=0.6){
                                Maxcoefficient = (1-0.2);
                                Mincoefficient = (1-0.3);
                            // if(AssetRate>0 &&AssetRate<=0.5){
                            //     Maxcoefficient = (1-0.3);
                            //     Mincoefficient = (1-0.4);
                            // }else if(AssetRate>0.5 &&AssetRate<=0.6){
                            //     Maxcoefficient = (1-0.2);
                            //     Mincoefficient = (1-0.3);
                                
                            }else if(AssetRate>0.6 &&AssetRate<=0.7){
                                Maxcoefficient = (1-0.15);
                                Mincoefficient = (1-0.25);
                            // }else if(AssetRate>0.6 &&AssetRate<=0.7){
                            //     Maxcoefficient = (1-0.15);
                            //     Mincoefficient = (1-0.25);
                                
                            }else if(AssetRate>0.7 &&AssetRate<=0.8){
                                Maxcoefficient = (1-0.1);
                                Mincoefficient = (1-0.2);
                            // }else if(AssetRate>0.7 &&AssetRate<=0.8){
                            //     Maxcoefficient = (1-0.1);
                            //     Mincoefficient = (1-0.2);
                                
                            }else if(AssetRate>0.8 &&AssetRate<=0.9){
                                Maxcoefficient = (1-0.05);
                                Mincoefficient = (1-0.15);
                            // }else if(AssetRate>0.8 &&AssetRate<=0.9){
                            //     Maxcoefficient = (1-0.05);
                            //     Mincoefficient = (1-0.15);
                                
                            }else if(AssetRate>0.9 &&AssetRate<=1.0){
                                Maxcoefficient = 1;
                                Mincoefficient = (1-0.05);
                            // }else if(AssetRate>0.9 &&AssetRate<=1.0){
                            //     Maxcoefficient = 1;
                            //     Mincoefficient = (1-0.05);
                                
                            }else if(AssetRate>1.0 &&AssetRate<=1.1){
                                Maxcoefficient = (1+0.05);
                                Mincoefficient = 1;
                            // }else if(AssetRate>1.0 &&AssetRate<=1.1){
                            //     Maxcoefficient = (1+0.05);
                            //     Mincoefficient = 1;
                                
                            }else if(AssetRate>1.1 &&AssetRate<=1.2){
                                Maxcoefficient = (1+0.1);
                                Mincoefficient = 1;
                            // }else if(AssetRate>1.1 &&AssetRate<=1.2){
                            //     Maxcoefficient = (1+0.1);
                            //     Mincoefficient = 1;
                                
                            }else if(AssetRate>1.2 &&AssetRate<=1.3){
                                Maxcoefficient = (1+0.2);
                                Mincoefficient = (1+0.1);
                            // }else if(AssetRate>1.2 &&AssetRate<=1.3){
                            //     Maxcoefficient = (1+0.2);
                            //     Mincoefficient = (1+0.1);
                                
                            }else if(AssetRate>1.3 &&AssetRate<=1.4){
                                Maxcoefficient = (1+0.25);
                                Mincoefficient = (1+0.15);
                            // }else if(AssetRate>1.3 &&AssetRate<=1.4){
                            //     Maxcoefficient = (1+0.25);
                            //     Mincoefficient = (1+0.15);
                                
                            }else if(AssetRate>1.4){
                                Maxcoefficient = (1+0.3);
                                Mincoefficient = (1+0.2);
                            // }else if(AssetRate>1.4){
                            //     Maxcoefficient = (1+0.3);
                            //     Mincoefficient = (1+0.2);
                                
                            }
                            // }
                            //市场多年保修价格开发 DC 2023/1/30 end 
                            console.log('***最高系数'+Maxcoefficient);
                            console.log('***最低系数'+Mincoefficient);
                            // console.log('***最高系数'+Maxcoefficient);
                            // console.log('***最低系数'+Mincoefficient);
                        if(nowdate < Date.parse(lastendDate)){
                            upPrice = strMoney;
                            downPrice = strMoney * 0.8;
                            //设备小于两年半
                            // upPrice = strMoney;
                            // downPrice = strMoney * 0.8;
                        console.log('***小于2年半')
                        // console.log('***小于2年半')
                        // 市场多年保修价格开发 start DC 2023/01/19  
                            //市场多年保设备小于2年半
                            var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                            var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                            console.log('***设备型号'+AssetModelNo);
                            console.log('***产品类型'+Category4);
                            // var AssetModelNo = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Asset_Model_No__c')).value();
                            // var Category4 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Category4__c')).value();
                            // // console.log('***设备型号'+AssetModelNo);
                            // // console.log('***产品类型'+Category4);
                            //设备设备消费率小于1.4
                            if(AssetRate<1.4){
                                upPrice = VMassetListmonth * ContractMonth /12;
                                console.log('消费率小于1.4 upPrice = VMassetListmonth *ContractMonth /12'+ upPrice);
                            // //设备设备消费率小于1.4
                            // if(AssetRate<1.4){
                            //     upPrice = VMassetListmonth * ContractMonth /12;
                            //     // console.log('消费率小于1.4 upPrice = VMassetListmonth *ContractMonth /12'+ upPrice);
                                if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                                    downPrice = upPrice;
                                    console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                            //     if(AssetModelNo.includes('290')&&( Category4 =='BF'|| Category4=='BF扇扫'||Category4=='CF')){
                            //         downPrice = upPrice;
                            //         // console.log('消费率小于1.4 产品无最低价 downPrice '+ downPrice);
                                }else{
                                    downPrice = upPrice * 0.8;
                                    console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                            //     }else{
                            //         downPrice = upPrice * 0.8;
                            //         // console.log('消费率小于1.4 产品最低价 downPrice = upPrice* 0.8:'+ downPrice);
                                }
                            }else{
                                upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                                downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                                console.log('消费率大于1.4 upPrice'+ upPrice);
                                console.log('消费率大于1.4 downPrice'+ downPrice);
                            }
                            //     }
                            // }else{
                            //     upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                            //     downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                            //     // console.log('消费率大于1.4 upPrice'+ upPrice);
                            //     // console.log('消费率大于1.4 downPrice'+ downPrice);
                            // }
                            // 市场多年保修价格开发 end DC 2023/01/19  
                        }else{
                             upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                            downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                            // upPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Upper/100);
                            // downPrice = (assetListmonth * Punish) * (1 + Adjustment_ratio_Lower/100);
                            //市场多年保修价格开发 DC 2023/1/30 start  设备大于2年半 续签价格 = 定价 *消费率对应系数 / 12 *合同月数
                            upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                            downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                            // upPrice = VMassetListmonth * ContractMonth *Maxcoefficient / 12;
                            // downPrice = VMassetListmonth * ContractMonth * Mincoefficient / 12;
                            //市场多年保修价格开发 DC 2023/1/30 end 
                        }
@@ -1785,6 +1993,9 @@
    }
    console.log('上限金额为'+Limit_Price_Amount);
    //上限合同 20230214 hql end
    // 报价规则改善 20230315 start
    // seamlessRenew(cnt);
    // 报价规则改善 20230315 end
}
@@ -2014,8 +2225,136 @@
    //     return true;
    // }
}
// 报价规则改善 20230310 start
// function addMonths(yearMonthDay ,monthNum){
//     var arr=yearMonthDay.split( '/');
//     var year=parseInt(arr[0]);
//     var month=parseInt(arr[1]);
//     var day=parseInt(arr[2]);
//     month=month+monthNum;
//     if(month>12){//月份加
//         var yearNum=parseInt( (month-1)/12);
//         month=month%12==0?12 :month%12;
//         year+=yearNum;
//         }else if(month<=0){//月份减
//             month=Math.abs( month);
//             var yearNum=parseInt( (month+12)/12);
//             year-=yearNum;
//         }
//         month=month<10?"0"+month :month;
//         return year+"/"+month+"/"+day;
// }
// function Blankperiod(startdate,i,LastMContract_Price,Punish,Adjustment_ratio_Upper,Adjustment_ratio_Lower,strMoney,type){
//             var  downPrice = 0;
//             var  upPrice = 0;
//             var  isSeamlessRenew = 0;
//             Blank_period = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Blank_period')).value();
//             var lastendDate1= j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':End_Date')).value()
//             var lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':End_Date')).value());
//             // console.log("lastendDate1="+lastendDate1);
//             var today = new Date();
//             if (lastendDate1.length !=0) {
//                 if (startdate == null) {
//                     // console.log(1);
//                      Blank_period=(today-lastendDate)/(3600*24*1000);
//                 }else{
//                     // console.log(2);
//                     Blank_period=(startdate-lastendDate)/(3600*24*1000);
//                 }
//                 j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Blank_period')).val(Blank_period);
//             }
//             if (Number(Blank_period)<15&&Blank_period.length != 0) {
//                 // console.log(3);
//                 j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Blank_period')).val('无缝续签');
//             }
//             Blank_period1 = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Blank_period')).value();
//             // console.log('Blank_period1='+Blank_period1);
//             // 2.无空白期设备是否算无缝续签设备 是否包含在无缝续签的报价判断中(首签的设备)?
//             if (Blank_period1 != '无缝续签' && Blank_period.length != 0) {
//                 isSeamlessRenew++;
//             }
//             // 1.实绩连动价格和设备参保定价 逻辑查看
//             upPrice1 = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Upper/100);
//             downPrice1 = (LastMContract_Price * Punish) * (1 + Adjustment_ratio_Lower/100);
//             // 定价8折
//             downPrice2 = strMoney * 0.8;
//             upPrice1 = upPrice1.toFixed(2);
//             upPrice2 = strMoney.toFixed(2);
//             downPrice1 = downPrice1.toFixed(2);
//             downPrice2 = downPrice2.toFixed(2);
//             // console.log('LastMContract_Price='+LastMContract_Price);
//             // console.log('upPrice1='+upPrice1);
//             // console.log('downPrice1='+downPrice1);
//             // console.log('upPrice2='+upPrice2);
//             // console.log('downPrice2='+downPrice2);
//             if (!isDisabled) {
//                 if (Blank_period1.length==0) {
//                     downPrice = downPrice2;
//                     upPrice = upPrice2;
//                 }
//                 if (Blank_period1.length!=0 && Number(Blank_period1)<180 || Blank_period1 == '无缝续签' ) {
//                     if (type == 1) {
//                         console.log('续签设备小于6个月');
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice1));
//                         j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice1));
//                     }
//                      downPrice = downPrice1;
//                      upPrice = upPrice1;
//                 }
//                 if (Blank_period1 != '无缝续签' && Number(Blank_period1)>180 && Number(Blank_period1)<365) {
//                     if (downPrice1<downPrice2) {
//                         if (type == 1) {
//                             console.log('续签设备6-12个月1');
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice2));
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice2));
//                         }
//                         downPrice = downPrice2;
//                         upPrice = upPrice2;
//                     }else{
//                          if (type == 1) {
//                             console.log('续签设备6-12个月2');
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice1));
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice1));
//                           }
//                         downPrice = downPrice1;
//                         upPrice = upPrice1;
//                     }
//                 }
//                 if (Blank_period1 != '无缝续签' && Number(Blank_period1)>365) {
//                     if (downPrice1<upPrice2) {
//                         if (type == 1) {
//                             console.log('续签设备12个月1');
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(upPrice2));
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice2));
//                         }
//                         downPrice = upPrice2;
//                         upPrice = upPrice2;
//                     }else{
//                         if (type == 1) {
//                             console.log('续签设备12个月2');
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Lower_price')).text(toNumComma(downPrice1));
//                             j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Adjustment_Upper_price')).text(toNumComma(upPrice1));
//                         }
//                         downPrice = downPrice1;
//                         upPrice = upPrice1;
//                     }
//                 }
//             }
//         return downPrice+"/"+upPrice+"/"+isSeamlessRenew;
// }
// 报价规则改善 20230310 end
function changeEstiStartdate(val) {
    // 报价规则改善 20230310 start
       // var startday = addMonths(val,6);
       // var startday1 = addMonths(val,12);
       //  document.getElementById("startdateaddsix1").value = startday;
       //  document.getElementById("startdateaddsix2").value = startday;
       //  document.getElementById("startdateaddsix3").value = startday1;
       //  document.getElementById("startdateaddsix4").value = val;
    // 报价规则改善 20230310 end
    if ('{!SaveBtnDisabled}' == 'false') {
        j$(escapeVfId('allPage:allForm:contractstartdate')).val(val);
        changeContractStartdate(val);
@@ -2200,8 +2539,8 @@
            } else {
                var oldp = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:oldMainteReal')).value());
                var newp = localParseFloat(j$(escapeVfId('allPage:allForm:allBlock:contractInfo:mainteReal')).text());
                console.log('oldp='+oldp);
                 console.log('newp='+newp);
                // console.log('oldp='+oldp);
                //  console.log('newp='+newp);
                if (oldp != newp) {
                    // 20201106 高章伟 提醒消息修改 start
                    j$(escapeVfId('allPage:allForm:changedAfterPrint')).val('true');
@@ -2618,17 +2957,22 @@
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.Department_Name__c.label}</th>
                        
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.Management_Code__c.label}</th>
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Asset_Consumption_rate__c.label}</th>
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.CurrentContract_End_Date__c.label}</th>
                        <!-- 市场多年保修价格开发 DC 2023/02/20  start-->
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset__c.fields.IS_VMContract_Asset__c.label}</th>
                       <!--  <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset__c.fields.IS_VMContract_Asset__c.label}</th> -->
                        <!-- 市场多年保修价格开发 DC 2023/02/20  end-->
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Asset_Consumption_rate__c.label}</th>
                       <!--  <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Asset_Consumption_rate__c.label}</th> -->
                        <!-- 市场多年保修价格开发 DC 2023/1/30 start -->
                        <!-- <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Asset_Consumption_rate__c.label}</th>
 -->
                        <!-- 市场多年保修价格开发 DC 2023/1/30 end -->
                        <th style="width:70px" class="headerRow  booleanColumn">{!$ObjectType.Asset.fields.CurrentContract_End_Date__c.label}</th>
                        <!-- <th style="width:70px" class="headerRow  booleanColumn"> -->
                            <!-- 最近一期维修合同结束 -->
                            <!-- {!$ObjectType.Asset.fields.CurrentContract_End_Date__c.label} -->
                        <!-- </th> -->
                        <!-- 实绩联动价格计算 start -->
                        <th style="width:35px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Adjustment_Upper_price__c.label}</th>
                        <th style="width:35px" class="headerRow  booleanColumn">{!$ObjectType.Maintenance_Contract_Asset_Estimate__c.fields.Adjustment_Lower_price__c.label}</th>
@@ -2725,23 +3069,23 @@
                                    <!-- <apex:outputField value="{!ar.rec.CurrentContract_F_asset__r.IS_VMContract_Asset__c}" rendered="{!Not(ar.IsManual)}" id="IS_VMContract_Asset"/> -->
                                    <apex:inputHidden value="{!ar.rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c}" id="AssetConsumptionRateNew"/>
                                  <!--   <apex:inputHidden value="{!ar.rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c}" id="AssetConsumptionRateNew"/>
                                    <apex:inputHidden value="{!ar.rec.CurrentContract_F_asset__r.Maintenance_Price_Year__c}" id="Maintenance_Price_Year__c"/>
                                    <apex:inputHidden value="{!ar.rec.CurrentContract_F_asset__r.Maintenance_Price_Year__c}" id="Maintenance_Price_Year__c"/> -->
                                 <!--    <apex:inputField value="{!ar.rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c}" id="AssetConsumptionRateNew2" style="display: none" showDatePicker="false" />
                                    <apex:outputText value="{!ar.rec.CurrentContract_F_asset__r.Asset_Consumption_Rate__c}" id="AssetConsumptionRateNew3" rendered="{!Not(ar.IsManual)}" style="display: none"/> -->
                                    <apex:inputField value="{!ar.rec.Product2.Asset_Model_No__c}" id="Asset_Model_No__c" style="display: none" showDatePicker="false"/>
                                  <!--   <apex:inputField value="{!ar.rec.Product2.Asset_Model_No__c}" id="Asset_Model_No__c" style="display: none" showDatePicker="false"/>
                                    <apex:inputField value="{!ar.rec.Product2.Category4__c}" id="Category4__c" style="display: none" showDatePicker="false"/>
                                    <apex:inputField value="{!ar.rec.Product2.Category4__c}" id="Category4__c" style="display: none" showDatePicker="false"/> -->
                                    <!-- 市场多年保价格开发 end 20223/01/17 设备消费率 -->
                                </td>
                                <!-- </td> -->
                                 <!-- 市场多年保价格开发 end 20223/02/20 是否多年保设备 start -->
                                <td class="dataCell" width="90px" style="text-align:center">
                                    <apex:outputField value="{!ar.rec.CurrentContract_F_asset__r.IS_VMContract_Asset__c}" rendered="{!Not(ar.IsManual)}" id="IS_VMContract_Asset"/>
                              <!--   <td class="dataCell" width="90px" style="text-align:center">
                                    <apex:outputField value="{!ar.rec.CurrentContract_F_asset__r.IS_VMContract_Asset__c}" rendered="{!Not(ar.IsManual)}" id="IS_VMContract_Asset"/> -->
                                </td>
                                 <!-- 市场多年保价格开发 end 20223/02/20 是否多年保设备 end -->
@@ -2749,9 +3093,14 @@
                                    <apex:outputField value="{!ar.mcae.Asset_Consumption_rate__c}" rendered="{!Not(ar.IsManual)}" id="Contractrate"/>
                                    <apex:inputHidden value="{!ar.rec.CurrentContract_F__r.Contract_Range__c}" id="lastContRange"/>
                                </td>
                                <!-- 2023/03/21  !ar.rec.CurrentContract_F_asset__r.IS_VMContract_Asset__c 为true  保有设备结束时间:true:多年保:保修期至;false.最近一期维修合同结束日 -->
                                <td class="dataCell" width="70px">
                                    <apex:outputField value="{!ar.rec.CurrentContract_F__r.Contract_End_Date__c}" rendered="{!(Not(ar.IsManual)&& ar.rec.CurrentContract_F__c != null)}" id="End_Date" />
                                    <!-- old: 直接拿保有设备的最近一期维修合同 -->
                                    <!-- <apex:outputField value="{!ar.rec.CurrentContract_F__r.Contract_End_Date__c}" rendered="{!(Not(ar.IsManual)&& ar.rec.CurrentContract_F__c != null)}" id="End_Date" /> -->
                                    <!-- new: 在获取保有设备信息时直接判断保有设备的字段时间(保修期至/最近一期维修合同结束日) -->
                                    <apex:outputField value="{!ar.rec.CurrentContract_End_Date__c}" rendered="{!(Not(ar.IsManual) && ar.rec.CurrentContract_F__c != null )}" id="End_Date" />
                                </td>
                                 <!-- 实绩联动价格计算 start -->
                                <td class="dataCell" width="35px">
                                    <apex:outputText value="{!ar.mcae.Adjustment_Upper_price__c}" id="Adjustment_Upper_price"/>
@@ -2788,6 +3137,9 @@
                                </td>
                               <!-- (2022年12月上线)故障品加费 start -->
                                <td class="dataCell" width="35px" style="text-align:right" >
                                     <!-- // 报价规则改善 20230308 start -->
                                  <!--   <apex:inputField value="{!ar.mcae.Blank_period__c}" id="Blank_period" style="display:none"/> -->
                                     <!-- // 报价规则改善 20230308 start -->
                                    <apex:outputText value="{!ar.Repair_Price_Auto}" id="Repair_Price_Auto" style="width:95%; "/>
                                    <!-- <apex:inputHiddenalue="{!ar.rec.Reson_Can_not_Warranty__c}" id="ResonCannotWarranty"/> -->
                                    <!-- <apex:outputText value="{!ar.Agreed_Date}" id="Agreed_Date" style="width:95%;display: none;"/> -->
@@ -3038,6 +3390,12 @@
                            <apex:inputField value="{!estimate.Limit_Price_Amount__c}" style="ime-mode: disabled; text-align: right; width:100px" id="Limit_Price_Amount" />
                            <apex:inputHidden value="{!isLimitPrice}" id="Limit_Price2Hidden" />
                            <apex:inputHidden value="{!OldLimitPrice}" id="Limit_PriceHidden" />
                            <!-- // 报价规则改善 20230309 start  -->
                            <!-- <apex:inputHidden value="{!Is_Blank_period}" id="Is_Blank_period" />
                            <apex:inputField value="{!estimate.Maintenance_Contract__r.Past_Contract_end_day__c}" style="display:none"  id="PastContractendday" />
                            <apex:inputHidden value="{!estimate.renewTen_OFF__c}" id="renewTenOFF" />
                            <apex:inputHidden value="{!Cost_rate_ForecastF}" id="Cost_rate_ForecastF" /> -->
                            <!-- // 报价规则改善 20230309 end  -->
                        </td>
                        <!-- 上限合同 20230103 hql end -->
                    </tr>
@@ -3085,6 +3443,71 @@
                        <td style="text-align: center"></td>
                    </tr>
                </table>
                <!-- // 报价规则改善 20230309 start  -->
               <!--  <table style="width:100%">
                    <tr>
                        <th style="text-align: center" colspan="3">请结合实际可以签约的日期,选择恰当的申请金额,以免后续空白期变化导致标准金额变化,再次申请价格延误时间</th>
                        <th style="text-align: center"></th>
                        <th style="text-align: center"></th>
                    </tr>
                    <tr>
                        <th style="text-align: center">本次计划【合同预定开始日】:<input type="text" id="startdateaddsix4" readonly="readonly" style="border: none;width:70px"></input> </th>
                        <th style="text-align: center">标准价格的最低价总额</th>
                        <th style="text-align: center">标准价格的最高价总额</th>
                    </tr>
                    <tr>
                        <td style="text-align: center"></td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceDown5" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceUp5" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">当【合同预定开始日】在<input type="text" id="startdateaddsix1" readonly="readonly" style="border: none;width:70px"></input> 之前</th>
                        <th style="text-align: center">标准价格的最低价总额</th>
                        <th style="text-align: center">标准价格的最高价总额</th>
                    </tr>
                    <tr>
                        <td style="text-align: center"></td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceDown4" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceUp4" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">当【合同预定开始日】在<input type="text" id="startdateaddsix2" readonly="readonly" style="border: none;width:70px"></input> 之后</th>
                        <th style="text-align: center">标准价格的最低价总额</th>
                        <th style="text-align: center">标准价格的最高价总额</th>
                    </tr>
                    <tr>
                        <td style="text-align: center"></td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceDown3" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceUp3" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">当【合同预定开始日】在<input type="text" id="startdateaddsix3" readonly="readonly" style="border: none;width:70px"></input> 之后</th>
                        <th style="text-align: center">标准价格的最低价总额</th>
                        <th style="text-align: center">标准价格的最高价总额</th>
                    </tr>
                    <tr>
                        <td style="text-align: center"></td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceDown2" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                        <td style="text-align: center">
                            CNY<input type="text" id="GuidePriceUp2" readonly="readonly" style="border: none;width:70px"></input>
                        </td>
                    </tr>
                </table> -->
                <!-- // 报价规则改善 20230309 end  -->
            </apex:outputPanel>
        </apex:pageblocksection>