|
@@ -28,6 +28,21 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="供应商:" prop="compId">
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ v-model="value.compId"
|
|
|
+ @change="handleSupplierChange"
|
|
|
+ placeholder="请选择供应商"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in supplierOptList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="生产地:" prop="placeOfProductionId">
|
|
|
<el-select
|
|
|
filterable
|
|
@@ -201,6 +216,12 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /** 获取供应商下拉列表 */
|
|
|
+ getSupplierOptList() {
|
|
|
+ selectCompList().then(response => {
|
|
|
+ this.supplierOptList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
getOriginList() {
|
|
|
fetchOriginList({pageNum: 1, pageSize: 100}).then(response => {
|
|
|
// console.log('getOriginList',response);
|
|
@@ -258,6 +279,13 @@
|
|
|
}
|
|
|
this.value.brandName = brandName;
|
|
|
},
|
|
|
+ handleSupplierChange(val) {
|
|
|
+ let supplierInfoObj = {};
|
|
|
+ supplierInfoObj = this.supplierOptList.find(item => {
|
|
|
+ return item.value === val;
|
|
|
+ });
|
|
|
+ this.value.compName = supplierInfoObj.label;
|
|
|
+ },
|
|
|
handleOriginChange(val) {
|
|
|
let placeOfProduction = '';
|
|
|
for (let i = 0; i < this.originOptions.length; i++) {
|