|
|
@@ -57,7 +57,7 @@
|
|
|
<el-autocomplete
|
|
|
class="inline-input"
|
|
|
v-model="params.unit"
|
|
|
- :fetch-suggestions="queryNutrientUnits"
|
|
|
+ :fetch-suggestions="(query, cb) => {queryNutrientUnits(query, params.nutrientId, cb)}"
|
|
|
@input="handleUnitChanged"
|
|
|
placeholder="单位关键词"
|
|
|
/>
|
|
|
@@ -165,7 +165,12 @@
|
|
|
<el-table-column label="计量单位" align="center" width="150">
|
|
|
<template slot-scope="{row}">
|
|
|
<template v-if="row.edit">
|
|
|
- <el-autocomplete v-model="row.unit" @input="handleRowUnitChanged(row)" :fetch-suggestions="queryUnits" placeholder="单位关键词" />
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="row.unit"
|
|
|
+ @input="handleRowUnitChanged(row)"
|
|
|
+ :fetch-suggestions="(query, cb) => {queryNutrientUnits(query, row.nutrientId, cb)}"
|
|
|
+ placeholder="单位关键词"
|
|
|
+ />
|
|
|
<el-select
|
|
|
clearable
|
|
|
v-show="showRowNutrientSource"
|
|
|
@@ -418,9 +423,9 @@ export default {
|
|
|
this.nutrients = []
|
|
|
})
|
|
|
},
|
|
|
- queryNutrientUnits(query, cb) {
|
|
|
+ queryNutrientUnits(query, nutrientId, cb) {
|
|
|
let units = []
|
|
|
- getNutrientUnits(this.params.nutrientId, { query }).then(res => {
|
|
|
+ getNutrientUnits(nutrientId, { query }).then(res => {
|
|
|
res.data.forEach(item => units.push({ value: item }))
|
|
|
cb(units)
|
|
|
})
|