1
chenjingwu
2024-04-10 5d0b45a82e2452f9f88cfaa958d053405092265c
force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js
@@ -1767,13 +1767,19 @@
            }
        }else{
            this.OnLoading(true);
            setProductEntry(dataChunanshen).then(reslut=>{
                debugger
            setProductEntry(dataChunanshen).then(reslut=>{
                var tempArr=reslut.split("---");
                var errormessage=tempArr[0];
                var quoteLineItem=JSON.parse(tempArr[1]);
                quoteLineItem=InitializeProductAssignment(quoteLineItem);
                this.jzDataToBeproduct=quoteLineItem;
                // cjw
                this.jzDataToBeproduct.forEach(item=>{
                    idList.push(item.pageObject.PricebookEntry.Product2Id);
                });
                addOptions({idList: idList}).then(result=>{
                    this.addOptionsLogic(result);
                });
                if(quoteLineItem.length!=num){
                    this.quo.IsQuoteTrial__c=false;
                }
@@ -1868,6 +1874,7 @@
            var Listvalue = this.jzDataToBeproduct;
            this.jzDataToBeproduct = additionaljzProductLogic(selectvlue,Listvalue,this.oppInfo.CurrencyIsoCode,this.quo.IsQuoteTrial__c);
            var idList = [];
            // cjw
            this.jzDataToBeproduct.forEach(item=>{
                idList.push(item.pageObject.PricebookEntry.Product2Id);
            });
@@ -1884,20 +1891,23 @@
                this.cancelProduct();
                this.SelectedNewProduct = [];
            });
            // cjw
        }
    }
    // cjw
    addOptionsLogic(result){
        const options = Object.entries(result).map(([key, value]) => ({
            label: key,
            value: value
        }));
        var Setmap = new Map()
        var key = Object.keys(result)
        key.forEach(item=>{
            Setmap.set(item,result[item]);
        });
        this.jzDataToBeproduct.forEach(item=>{
            if(result){
                item.Learning_CommunityOptions = options.get(item.pageObject.PricebookEntry.Product2Id);
                item.Learning_CommunityOptions = Setmap.get(item.pageObject.PricebookEntry.Product2Id);
            }
        });
    }
    // cjw
    //新增报价产品模态框取消按钮
    cancelProduct() {
        this.showproductfalg = false;