Promise 应用
let list = [
this.$refs.jwryIndex.checkForm('form'),
this.$refs.jwryCommonDialog.checkForm('form'),
];
Promise.all(list).then((res) => {
let param = {
basicInfo: JSON.stringify(this.formData),
jwInfo: res[1].jwInfo,
addressObj: res[1].addressObj,
type: 'jwry'
}
if(this.family){
param. familyRelations = this.formData.familyRelations
this.$emit('addJwry', param);
this.$refs.rsDialog.close();
}else {
addObj(param).then(res => {
this.$message.success('添加成功')
this.$refs.rsDialog.close()
this.$emit('refreshDataList')
})
}
}, (err) => {
console.log(err)
})
择善人而交,择善书而读,择善言而听,择善行而从。