|
|
@@ -3,7 +3,7 @@
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="right" label-width="90px" class="form-container">
|
|
|
<div class="createPost-main-container">
|
|
|
<el-form-item label="规格名称:" style="margin-bottom: 40px;width: 60%" prop="name">
|
|
|
- <el-input v-model="postForm.name" placeholder="请输入名称" />
|
|
|
+ <el-input v-model="postForm.name" placeholder="请输入名称" @blur="updateUnit" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数值:" style="margin-bottom: 40px;width: 60%" prop="quantity">
|
|
|
<el-input v-model="postForm.quantity" placeholder="请输入数值" />
|
|
|
@@ -136,6 +136,12 @@ export default {
|
|
|
res.data.list.forEach(item => units.push({ value: item.name }))
|
|
|
cb(units)
|
|
|
})
|
|
|
+ },
|
|
|
+ updateUnit(event) {
|
|
|
+ const unitName = event.target.value
|
|
|
+ if (!this.postForm.inInitUnit && unitName) {
|
|
|
+ this.$set(this.postForm, 'inInitUnit', unitName)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|