123
chenjingwu
2024-04-19 450f9922c8b9435e219e9ee44ccc90df581dcd60
force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
@@ -1300,6 +1300,14 @@
        jzdtbt.pageObject.ServicePrice__c = 0;
        jzdtbt.warrantyType__c = '';
        var NoDiscountTotal = 0;
        if(jzdtbt.exPrice != 0 && jzdtbt.exPrice != null && jzdtbt.exPrice != undefined ){
            jzdtbt.exPriceCopy = jzdtbt.exPrice;
        }
        if(jzdtbt.Learning_Community != null && jzdtbt.Learning_Community != undefined && jzdtbt.Learning_Community != '0' && jzdtbt.Learning_Community != ''){
            jzdtbt.Learning_CommunityCopy = jzdtbt.Learning_Community;
        }
        jzdtbt.exPrice = 0;
        jzdtbt.Learning_Community = '0';
        if (GuranteeType == '服务') {
            multiYearWarranty = true;
            jzdtbt.warrantyType__c = '服务多年保修';
@@ -1307,21 +1315,25 @@
        } else if (GuranteeType == '市场' && contractmultiYearWarranty == false) {
            multiYearWarranty = true;
            jzdtbt.pageObject.ServicePrice__c = ServicePrice;
            jzdtbt.exPrice = jzdtbt.exPriceCopy;
            jzdtbt.Learning_Community = jzdtbt.Learning_CommunityCopy;
            jzdtbt.warrantyType__c = '市场多年保修';
            warrantyType = '市场多年保修';
            var Quantity =jzdtbt.Quantity__c;
            MultiYearWarrantyTotalPrice__c = MultiYearWarrantyTotalPrice__c + localParseFloat(ServicePrice) * localParseFloat(Quantity);
            // ExtendedWarrantyAmountTotalPrice__c = ExtendedWarrantyAmountTotalPrice__c + localParseFloat(jzdtbt.exPrice) * localParseFloat(Quantity);
            ExtendedWarrantyAmountTotalPrice__c = ExtendedWarrantyAmountTotalPrice__c + localParseFloat(jzdtbt.exPrice) * localParseFloat(Quantity);
            NoDiscountTotal = localParseFloat(ServicePrice) * localParseFloat(Quantity);
        }
        else if (GuranteeType == '市场' && contractmultiYearWarranty && CanNotCancelledGurantee) {
            multiYearWarranty = true;
            jzdtbt.pageObject.ServicePrice__c = ServicePrice;
            jzdtbt.exPrice = jzdtbt.exPriceCopy;
            jzdtbt.Learning_Community = jzdtbt.Learning_CommunityCopy;
            jzdtbt.warrantyType__c = '市场多年保修';
            warrantyType = '市场多年保修';
            // 数量
            var Quantity = jzdtbt.Quantity__c;
            MultiYearWarrantyTotalPrice__c = MultiYearWarrantyTotalPrice__c + localParseFloat(ServicePrice) * localParseFloat(Quantity);
            // MultiYearWarrantyTotalPrice__c = MultiYearWarrantyTotalPrice__c + localParseFloat(ServicePrice) * localParseFloat(Quantity);
            // ExtendedWarrantyAmountTotalPrice__c = ExtendedWarrantyAmountTotalPrice__c + localParseFloat(jzdtbt.exPrice) * localParseFloat(Quantity);
            NoDiscountTotal = localParseFloat(ServicePrice) * localParseFloat(Quantity);
        }
@@ -1631,11 +1643,11 @@
        }
    });
    thirdPartyEstimation_List_Price = localParseFloat(thirdPartyEstimation_List_Price);
    quo.Quote_Adjust_Amount_Page__c = toNumComma(x - noDiscountPriceTotal - y);
    quo.Quote_Adjust_Amount_Page__c = toNumComma(x - noDiscountPriceTotal - y - z);
    if (y - thirdPartyEstimation_List_Price == 0) {
        quo.Quote_Adjust_Calculate__c = toNumComma(0);
    } else {
        quo.Quote_Adjust_Calculate__c = toNumComma((x - noDiscountPriceTotal - y) / (y - thirdPartyEstimation_List_Price) * 100);
        quo.Quote_Adjust_Calculate__c = toNumComma((x - noDiscountPriceTotal - y - z) / (y - thirdPartyEstimation_List_Price) * 100);
    }
    quoExp = quo;
    return jzDataToBeproduct;
@@ -1990,6 +2002,7 @@
        quo.OCM_Agent1_Price_Page__c = '';
    }
    quo.MultiYearWarrantyTotalPrice__c = toNumComma(quo.MultiYearWarrantyTotalPrice__c);
    quo.ExtendedWarrantyAmountTotalPrice__c = toNumComma(quo.ExtendedWarrantyAmountTotalPrice__c);
    quo.Agency1_Profit__c = toNumComma(quo.Agency1_Profit__c);
    quo.Agency2_Profit__c = toNumComma(quo.Agency2_Profit__c);
    //预测金额修改 fy
@@ -2235,7 +2248,7 @@
                        jzdtbt.exPrice = item.MultiOneYearWarrantyPrice__c;
                    }
                });
                if(jzdtbt.exPrice == null || jzdtbt.exPrice == '' || jzdtbt.exPrice == undefined){
                if(jzdtbt.exPrice == null || jzdtbt.exPrice == '' || jzdtbt.exPrice == undefined || jzdtbt.Learning_Community == '0'){
                    jzdtbt.exPrice = 0;
                }
            }
@@ -2343,7 +2356,9 @@
        x = localParseFloat(x);
        y = y + localParseFloat(x);
    });
    quo.QuoteTotal_Page__c = toNumComma(y);
    var e = quo.ExtendedWarrantyAmountTotalPrice__c;
    e = localParseFloat(e);
    quo.QuoteTotal_Page__c = toNumComma(y + e);
    var z = quo.Estimation_List_Price__c;
    var id = quoId;
    // if(!id){
@@ -2354,7 +2369,7 @@
            var num = quo.Quote_Adjust_Calculate__c;
            num = localParseFloat(num);
            var ex = quo.ExtendedWarrantyAmountTotalPrice__c;
            ex.localParseFloat(ex);
            ex = localParseFloat(ex);
            quo.Quote_Adjust_Calculate__c = toNumComma(num);
            num = (100 + num) / 100;
            z=localParseFloat(z);