vue element新增中获取其他值加入新增中
vue 的新增方法中 js里面写的是 数据传的是一个data集合
export function addAgreementList(data) {
return request({
url: '/lock/agreementList',
method: 'post',
data: data
})
}
submitFormAgreement() {
this.formAgreement.factoryId = this.id
addAgreementList(this.formAgreement).then(response => {
// 工厂id this.id
console.log(this.formAgreement.name,this.formAgreement.key,this.id)
this.msgSuccess("新增成功");
this. agreementDialog= false;
this.getListAgreementList();
});
},
然后我的新增按钮点开后传的是this.formAgreement是从输入框传的值 但是我还需要一个其他id新增,然后我就在上面
写了一个这个this.formAgreement.factoryId = this.id 要不然传不到一个集合里面
this.formAgreement能获取到页面input框所有的值