商品共有元素 优化

master
DongZeLiang 2024-03-07 11:00:43 +08:00
parent a6451848c3
commit 9bb3a1f8eb
1 changed files with 21 additions and 8 deletions

View File

@ -256,19 +256,19 @@
<span>添加商品属性</span> <span>添加商品属性</span>
</div> </div>
<el-row> <el-row>
<el-button v-show="!customPropertiesFormStatus" @click="customPropertiesFormStatus = true"></el-button> <el-button v-show="!customAttributeFormStatus" @click="customAttributeFormStatus = true"></el-button>
<el-form v-show="customPropertiesFormStatus" :inline="true" :model="customPropertiesForm" class="demo-form-inline"> <el-form v-show="customAttributeFormStatus" :inline="true" :model="customAttributeForm" class="demo-form-inline">
<el-form-item label="属性编码"> <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>
<el-form-item label="属性名称"> <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>
<el-form-item label="属性值"> <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-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-item>
</el-form> </el-form>
</el-row> </el-row>
@ -337,6 +337,7 @@ import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/i
import {listBrand} from "@/api/product/brand"; import {listBrand} from "@/api/product/brand";
import {getTemplateAttribute, listCategory} from "@/api/product/category"; import {getTemplateAttribute, listCategory} from "@/api/product/category";
import {listRule} from "@/api/product/rule"; import {listRule} from "@/api/product/rule";
import {addAttribute} from "@/api/product/attribute";
export default { export default {
name: "Info", name: "Info",
@ -393,10 +394,10 @@ export default {
categoryOptionValue: [], categoryOptionValue: [],
ruleList: [], ruleList: [],
activeName: "attributeGroup", activeName: "attributeGroup",
customPropertiesForm: { customAttributeForm: {
}, },
customPropertiesFormStatus: false, customAttributeFormStatus: false,
attributeIdCheckedList: [], attributeIdCheckedList: [],
attributeCheckedList: [], attributeCheckedList: [],
categoryCommonElement: { categoryCommonElement: {
@ -440,6 +441,18 @@ export default {
this.getList(); this.getList();
}, },
methods: { 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() { attributeCheckedFun() {
// attributeIdCheckedList -> attributeCheckedList // attributeIdCheckedList -> attributeCheckedList
// 1 -> ID 1 : attributeCheckedList[] -> 1 // 1 -> ID 1 : attributeCheckedList[] -> 1