|
|
@@ -314,7 +314,7 @@
|
|
|
<span>
|
|
|
<el-button size="mini" type="primary" plain @click="addNutrient(dlg.form.data)">添加</el-button>
|
|
|
</span>
|
|
|
- <el-select v-model="dlg.form.selectedNutrientTemplate" style="margin-left: 10%; display: float" @input.native="getNutrienttemplateList($event)" filterable placeholder="请输入检索词">
|
|
|
+ <el-select v-model="dlg.form.selectedNutrientTemplate" style="margin-left: 10%; display: float; margin-right: 0.5%" v-on:input.native="getNutrienttemplateList($event)" filterable placeholder="请输入检索词">
|
|
|
<el-option v-for="opt in dlg.form.nutrientTemplateOptions" :key="opt.id" :label="opt.value" :value="opt.name" />
|
|
|
</el-select>
|
|
|
<el-button v-model="dlg.form.nutrientTemplateTable" size="mini" type="primary" plain @click="importNutrientTemplate()">导入营养素模版</el-button>
|
|
|
@@ -682,8 +682,6 @@ export default {
|
|
|
},
|
|
|
// 导入营养素模版
|
|
|
importNutrientTemplate() {
|
|
|
- console.log(this.dlg.form.selectedNutrientTemplate)
|
|
|
-
|
|
|
if (this.dlg.form.selectedNutrientTemplate == undefined) {
|
|
|
return
|
|
|
}
|
|
|
@@ -694,8 +692,6 @@ export default {
|
|
|
})
|
|
|
|
|
|
fGet(`/api/nutrient-templates/${this.dlg.form.selectedNutrientTemplateId}/nutrients`, {}).then(res => {
|
|
|
- console.log(res)
|
|
|
-
|
|
|
if (res == undefined) {return}
|
|
|
|
|
|
let existed = false
|
|
|
@@ -703,8 +699,6 @@ export default {
|
|
|
res.forEach(nv => {
|
|
|
// 筛选营养素
|
|
|
this.dlg.form.data.nutrients.forEach(existNv => {
|
|
|
- console.log(nv.nutrientId)
|
|
|
- console.log(existNv)
|
|
|
if (nv.nutrientId == existNv.nutrientId) {
|
|
|
existed = true
|
|
|
}
|
|
|
@@ -725,28 +719,14 @@ export default {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
-
|
|
|
- console.log(this.dlg.form.data.nutrients)
|
|
|
-
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- // 导入营养素
|
|
|
- importNutrientFromTemplate(row) {
|
|
|
- row.nutrients.push({
|
|
|
- _edit: true,
|
|
|
- _nutrientUnitOptions: []
|
|
|
- })
|
|
|
- },
|
|
|
getNutrienttemplateList(e) {
|
|
|
- console.log(1)
|
|
|
+ this.dlg.form.nutrientTemplateOptions = []
|
|
|
fGet(`/api/nutrient-templates`, {keyword: e.target.value}).then(res => {
|
|
|
- console.log(2)
|
|
|
this.dlg.form.nutrientTemplateOptions = res
|
|
|
- console.log(res)
|
|
|
-
|
|
|
})
|
|
|
- this.$forceUpdate()
|
|
|
},
|
|
|
// 营养素选择
|
|
|
nutrientSelect(nutrient, row) {
|