1.监听列表数据
"copyForm.childSaveVoList": {
handler: async function () {
if (!this.queryProp.id) {
let that = this;
let preNumList = [];
const list = this.copyForm.childSaveVoList || [];
for (let i = 0; i < list.length; i++) {
const num = await that.getChildNum(preNumList);
// list[i].birthCretificateNum = num;
preNumList.push(num);
that.cretificateNumList = preNumList;
that.$forceUpdate();
}
}
}
},
2.调用接口,将拿到的值作为参数接着调用
/*获取最小出生证编号*/
getChildNum(list) {
let that = this;
return new Promise(resolve => {
that.loading = true;
let params = {
affiliationType: that.queryProp.affiliationType,
cretificateNumList: list,
};
getAvailableAndLeastBirthCretificateNum(params).then(res => {
resolve(res);
}).finally(() => {
that.loading = false;
});
})
},