|
|
@@ -17,9 +17,17 @@
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="right" label-width="130px" class="form-container">
|
|
|
<div class="createPost-main-container">
|
|
|
<el-checkbox @change="checkboxChange" :disabled="isEdit" v-model="isDefaultModifier" style="margin: 0 0 10px 100px">默认规格</el-checkbox>
|
|
|
- <el-form-item label="规格名称:" style="margin-bottom: 40px;width: 60%" prop="name">
|
|
|
+ <el-form-item label="包装名称:" style="margin-bottom: 40px;width: 60%" prop="name">
|
|
|
<el-input :disabled="isDefaultModifier" v-model="postForm.name" placeholder="请输入名称" @blur="updateUnit" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="包装单位:" style="margin-bottom: 40px;width: 60%" prop="packageUnit">
|
|
|
+ <el-autocomplete
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="postForm.packageUnit"
|
|
|
+ :fetch-suggestions="queryUnits"
|
|
|
+ placeholder="单位关键词"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-row style="width: 60%">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item v-show="!isDefaultModifier" label="数值:" style="margin-bottom: 40px" prop="quantity">
|
|
|
@@ -193,6 +201,9 @@ export default {
|
|
|
if (!this.postForm.inInitUnit && unitName) {
|
|
|
this.$set(this.postForm, 'inInitUnit', unitName)
|
|
|
}
|
|
|
+ if (!this.isEdit && !this.postForm.packageUnit && unitName) {
|
|
|
+ this.$set(this.postForm, 'packageUnit', unitName)
|
|
|
+ }
|
|
|
},
|
|
|
checkboxChange(value) {
|
|
|
const name = value ? this.defaultModifierName : ''
|