新增录入时写了输入匹配,希望把从别的表查到的那条数据中别的字段,保存到这张新表中
<el-form-item label="公司名称" prop="companyName">
<el-select
v-model="form.companyName" filterable remote reserve-keyword
placeholder="请输入公司名称"
:remote-method="remoteCompanyName"
:loading="selectLoading"
style="width: 100%"
>
<el-option v-for="(item,index) in companyNameOptions" :key="index" :label="item.companyName" :value="item.companyName"
></el-option>
</el-select>
</el-form-item>
methods中:
/**远程加载公司名称**/
remoteCompanyName(query) {
this.companyNameOptions = []
if (query != null && query != undefined && query != '') {
this.selectLoading = true
const params = {}
params.companyName = query
listBaseInfo(params).then(res => {
if (res.rows != null) {
this.companyNameOptions = res.rows;
}
this.selectLoading = false
})
} else {
this.companyNameOptions = []
}
},
现在只能录入companyName这个字段,我希望录入companyName字段的同时,把phone,id这些字段也一起录入