Multiple calls to api endpoints having issues with asynchronous data

I’m writing some code that will be put into a pdf files. Once these pdf files are created, they are merged into one document.

I have some code that, calls out to different api endpoints, and am having problems with data not being populated correctly. I suspect this is due to the asynchronous nature of the api calls and how the pdf is being generated.

getdata(){
    let docnos = this.cb
    
    docnos.forEach(docno => {
        this.ns=false;
        let thisvue = this;
        let url = this.$store.state.url;
        
        const params = new URLSearchParams();
        params.append('ty', 'getmailpdf');
        params.append('prikey', docno);
        
        axios({
            method:"post",
            url:url,
            data:params
        })
        .then(function(response){
            thisvue.maildata=response.data;
           
        })
        .then(function(){
            thisvue.maildata.pay=JSON.parse(thisvue.maildata.pay);
            thisvue.maildata.deductions=JSON.parse(thisvue.maildata.deductions);
            thisvue.maildata.exemptions=JSON.parse(thisvue.maildata.exemptions);
            thisvue.maildata.explanations=JSON.parse(thisvue.maildata.explanations);
        }).then(function(){
            thisvue.newTaxRate();
        }).then(function(){
           // thisvue.getaddress();
           // let thisvue = this;
            let url = thisvue.$store.state.url;
            let prikey=thisvue.maildata.companyprikey;
            
            const params = new URLSearchParams();
            params.append('ty', 'acntAddress');
            params.append('prikey' , prikey);
            
            axios({
                method:"post",
                url:url,
                data:params
            })
            .then(function(response){
                thisvue.mailaddress=response.data;
            })
            .then(function(){
                thisvue.formataddress();
            })
            .then(function(){
                thisvue.premakepdf();
            });
        });//.then(function(){thisvue.premakepdf();})
    });
    doc.save('taxes.pdf', {returnPromise:true}).then(this.donemessage());
    this.clearcb();
   
}

this.cb is data gathered from checkboxes on the front end. Then this cb data is looped through, passed as a data parameter into my api call.

thisvue.maildata.pay=JSON.parse(thisvue.maildata.pay);
thisvue.maildata.deductions=JSON.parse(thisvue.maildata.deductions);
thisvue.maildata.exemptions=JSON.parse(thisvue.maildata.exemptions);
thisvue.maildata.explanations=JSON.parse(thisvue.maildata.explanations);

These fields are not being populated correctly. In some forms, previous customer data (pay, deductions, exemptions, explanations) is being populated into the new pdf form with new name and address data being populated. While some pages are left blank.

I’m really at a loss, I’ve tried to refactor some of this code and use async/await, but still getting the same behavior. I’m not quite sure if I can accomplish what I need with this code.

Just looking for suggestions.