<el-form :inline="true" :model="formData"> <el-form-item label="所属仓库"> <el-select v-model="formData.storageName" placeholder="请选择" class="w-200" @change="getData()"> <el-option v-for="item in storageNames" :key="item.storage_Id" :label="item.storageName" :value="item.storage_Id"> </el-option> </el-select> </el-form-item> </el-form> -------------------v-model="formData.storageName" 给这个model 赋值
getStorageList() {
const url = "/api/basicInfo/base/storage/getList";
const params = {};
var callback = res => {
if (res.result) {
this.storageNames = res.data;
this.formData.storageName = res.data[0].storageName;
}
};
this.common.ajax(url, params, callback);
}