chenjingwu
2024-04-11 87b65352e004a7e773bd2a2c18ab7dec122de29c
force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js
@@ -1775,8 +1775,11 @@
                this.jzDataToBeproduct=quoteLineItem;
                // cjw
                var idList = [];
                console.log('123');
                console.log(reslut);
                console.log(this.jzDataToBeproduct);
                this.jzDataToBeproduct.forEach(item=>{
                    idList.push(item.pageObject.PricebookEntry.Product2Id);
                    idList.push(item.pageObject.Id__c);
                });
                addOptions({idList: idList}).then(result=>{
                    this.addOptionsLogic(result);
@@ -1827,15 +1830,19 @@
                    var errormessage = tempArr[0];
                    var quoteLineItem = JSON.parse(tempArr[1]);
                    quoteLineItem = InitializeProductAssignment(quoteLineItem);
                    this.tobeflag=true;
                    this.jzDataToBeproduct = quoteLineItem;
                    // cjw
                    console.log('xxx');
                    console.log(this.jzDataToBeproduct);
                    var idList = [];
                    this.jzDataToBeproduct.forEach(item=>{
                        idList.push(item.pageObject.PricebookEntry.Product2Id);
                        idList.push(item.pageObject.Id__c);
                    });
                    addOptions({idList: idList}).then(result=>{
                        this.addOptionsLogic(result);
                    });
                    this.tobeflag=false;
                    if(quoteLineItem.length!=num){
                        this.quo.IsQuoteTrial__c = false;
                    }
@@ -1885,7 +1892,7 @@
            var idList = [];
            // cjw
            this.jzDataToBeproduct.forEach(item=>{
                idList.push(item.pageObject.PricebookEntry.Product2Id);
                idList.push(item.pageObject.Id__c);
            });
            addOptions({idList: idList}).then(result=>{
                this.addOptionsLogic(result);
@@ -1910,11 +1917,37 @@
        key.forEach(item=>{
            Setmap.set(item,result[item]);
        });
        var optionMap = new Map();
        var map1 = Setmap.get('optionMap');
        var key1 = Object.keys(map1)
        key1.forEach(item=>{
            optionMap.set(item,map1[item]);
        });
        var priceMap = new Map();
        var map2 = Setmap.get('priceMap');
        var key2 = Object.keys(map2)
        key2.forEach(item=>{
            priceMap.set(item,map2[item]);
        });
        console.log('loh');
        console.log(this.jzDataToBeproduct);
        this.jzDataToBeproduct.forEach(item=>{
            if(result){
                item.Learning_CommunityOptions = Setmap.get(item.pageObject.PricebookEntry.Product2Id);
                item.Learning_CommunityOptions = optionMap.get(item.pageObject.Id__c);
                item.multiYearWarrantyList = priceMap.get(item.pageObject.Id__c);
                if(item.Learning_Community){
                    item.multiYearWarrantyList.forEach(it=>{
                        if('' + (it.AgeLimit__c) == item.Learning_Community){
                            item.exPrice = it.MultiOneYearWarrantyPrice__c;
                        }
                    });
                    if(item.exPrice == null || item.exPrice == '' || item.exPrice == undefined){
                        item.exPrice = 0;
                    }
                }
            }
        });
        console.log(this.jzDataToBeproduct);
    }
    // cjw
    //新增报价产品模态框取消按钮