上一个then方法中的数据怎么在下一个then方法中调用?

问题相关代码,请勿粘贴截图

const tem=this.customerTemplate
this.createNewPaper(paperInfo).then(paperId => {
if(!paperId) {
this.$message.error('创建失败,请重新整理')
return
}
for(var i=0;i<tem.tquestionList.length;i++){
const quesParam = {
paperId:paperId,
type:tem.tquestionList[i].type,
title:tem.tquestionList[i].title
}
console.log(tem.tquestionList.toptions.length)
this.createQuestion(quesParam).then(questionId =>{
const ques={
id:questionId,
paperId:Number(paperInfo.paperId),
type:tem.tquestionList[i].type,
title:tem.tquestionList[i].title,
options:[]
}
if(ques.type<2){
for(var k=0;k<tem.tquestionList.toptions.length;k++){
ques.options.push({ content: ${tem.tquestionList.toptions[k]} })
}
}
this.updateQuestion(ques).then((res) => {
if (res) {
this.$message.success('保存成功')
} else {
this.$message.error('保存失敗')
}
})
})

我想要达到的结果

还有一个问题:代码中的toptions是个三级嵌套数组,获取数据的时候为什么会是undefined?


this.updateQuestion(ques).then((res) => {
    if (res) {
    this.$message.success('保存成功')
    } else {
    this.$message.error('保存失敗')
    }
    }).then(res => {
        
    })