商品共有元素 优化
parent
a6451848c3
commit
9bb3a1f8eb
|
@ -256,19 +256,19 @@
|
|||
<span>添加商品属性</span>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-button v-show="!customPropertiesFormStatus" @click="customPropertiesFormStatus = true">添加自有属性</el-button>
|
||||
<el-form v-show="customPropertiesFormStatus" :inline="true" :model="customPropertiesForm" class="demo-form-inline">
|
||||
<el-button v-show="!customAttributeFormStatus" @click="customAttributeFormStatus = true">添加自有属性</el-button>
|
||||
<el-form v-show="customAttributeFormStatus" :inline="true" :model="customAttributeForm" class="demo-form-inline">
|
||||
<el-form-item label="属性编码">
|
||||
<el-input v-model="customPropertiesForm.code" placeholder="属性编码"></el-input>
|
||||
<el-input v-model="customAttributeForm.code" placeholder="属性编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性名称">
|
||||
<el-input v-model="customPropertiesForm.name" placeholder="属性名称"></el-input>
|
||||
<el-input v-model="customAttributeForm.name" placeholder="属性名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值">
|
||||
<el-input v-model="customPropertiesForm.value" placeholder="属性值"></el-input>
|
||||
<el-input v-model="customAttributeForm.value" placeholder="属性值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="customPropertiesFormStatus = false">确定</el-button>
|
||||
<el-button type="primary" @click="saveCustomAttribute">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
@ -337,6 +337,7 @@ import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/i
|
|||
import {listBrand} from "@/api/product/brand";
|
||||
import {getTemplateAttribute, listCategory} from "@/api/product/category";
|
||||
import {listRule} from "@/api/product/rule";
|
||||
import {addAttribute} from "@/api/product/attribute";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
|
@ -393,10 +394,10 @@ export default {
|
|||
categoryOptionValue: [],
|
||||
ruleList: [],
|
||||
activeName: "attributeGroup",
|
||||
customPropertiesForm: {
|
||||
customAttributeForm: {
|
||||
|
||||
},
|
||||
customPropertiesFormStatus: false,
|
||||
customAttributeFormStatus: false,
|
||||
attributeIdCheckedList: [],
|
||||
attributeCheckedList: [],
|
||||
categoryCommonElement: {
|
||||
|
@ -440,6 +441,18 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
saveCustomAttribute(){
|
||||
addAttribute({"code": this.customAttributeForm.code, "name": this.customAttributeForm.name}).then(response => {
|
||||
if (response.code === 200){
|
||||
// 添加逻辑
|
||||
let attributeId = response.data,
|
||||
code = this.customAttributeForm.code,
|
||||
name = this.customAttributeForm.name,
|
||||
value = this.customAttributeForm.value;
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
attributeCheckedFun() {
|
||||
// attributeIdCheckedList -> attributeCheckedList 不在
|
||||
// 1 -> ID 1 : attributeCheckedList[] -> 1
|
||||
|
|
Loading…
Reference in New Issue