diff --git a/src/api/product/attribute.js b/src/api/product/attribute.js index 948166e..bc66f29 100644 --- a/src/api/product/attribute.js +++ b/src/api/product/attribute.js @@ -29,7 +29,7 @@ export function addAttribute(data) { // 修改商品属性 export function updateAttribute(data) { return request({ - url: '/product/attribute', + url: '/product/attribute/'+data.id, method: 'put', data: data }) diff --git a/src/api/product/attributeGroup.js b/src/api/product/attributeGroup.js index 97500df..22544a2 100644 --- a/src/api/product/attributeGroup.js +++ b/src/api/product/attributeGroup.js @@ -29,7 +29,7 @@ export function addAttributeGroup(data) { // 修改属性组 export function updateAttributeGroup(data) { return request({ - url: '/product/attributeGroup', + url: '/product/attributeGroup/'+data.id, method: 'put', data: data }) diff --git a/src/api/product/brand.js b/src/api/product/brand.js index 7221cc3..a3023a6 100644 --- a/src/api/product/brand.js +++ b/src/api/product/brand.js @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 查询商品品牌列表 +// 查询品牌信息列表 export function listBrand(query) { return request({ url: '/product/brand/list', @@ -9,7 +9,7 @@ export function listBrand(query) { }) } -// 查询商品品牌详细 +// 查询品牌信息详细 export function getBrand(id) { return request({ url: '/product/brand/' + id, @@ -17,7 +17,7 @@ export function getBrand(id) { }) } -// 新增商品品牌 +// 新增品牌信息 export function addBrand(data) { return request({ url: '/product/brand', @@ -26,16 +26,16 @@ export function addBrand(data) { }) } -// 修改商品品牌 +// 修改品牌信息 export function updateBrand(data) { return request({ - url: '/product/brand', + url: '/product/brand/'+data.id, method: 'put', data: data }) } -// 删除商品品牌 +// 删除品牌信息 export function delBrand(id) { return request({ url: '/product/brand/' + id, diff --git a/src/api/product/category.js b/src/api/product/category.js index d6ef8a4..889eebe 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -17,6 +17,14 @@ export function getCategory(id) { }) } +// 查询品类信息详细 +export function parentCommonElement(id) { + return request({ + url: '/product/category/parentCommonElement/' + id, + method: 'get' + }) +} + // 新增品类信息 export function addCategory(data) { return request({ @@ -29,7 +37,7 @@ export function addCategory(data) { // 修改品类信息 export function updateCategory(data) { return request({ - url: '/product/category', + url: '/product/category/'+data.id, method: 'put', data: data }) diff --git a/src/api/product/comment.js b/src/api/product/comment.js index c1fe87e..4c19aae 100644 --- a/src/api/product/comment.js +++ b/src/api/product/comment.js @@ -29,7 +29,7 @@ export function addComment(data) { // 修改商品评论 export function updateComment(data) { return request({ - url: '/product/comment', + url: '/product/comment/'+data.id, method: 'put', data: data }) diff --git a/src/api/product/info.js b/src/api/product/info.js index 00f7037..80b02c2 100644 --- a/src/api/product/info.js +++ b/src/api/product/info.js @@ -29,7 +29,7 @@ export function addInfo(data) { // 修改商品信息 export function updateInfo(data) { return request({ - url: '/product/info', + url: '/product/info/'+data.id, method: 'put', data: data }) diff --git a/src/api/product/rule.js b/src/api/product/rule.js index 18dacc1..f2de650 100644 --- a/src/api/product/rule.js +++ b/src/api/product/rule.js @@ -29,7 +29,7 @@ export function addRule(data) { // 修改商品规格 export function updateRule(data) { return request({ - url: '/product/rule', + url: '/product/rule/'+data.id, method: 'put', data: data }) diff --git a/src/views/product/attributeGroup/index.vue b/src/views/product/attributeGroup/index.vue index d663ac9..b9d3caf 100644 --- a/src/views/product/attributeGroup/index.vue +++ b/src/views/product/attributeGroup/index.vue @@ -9,8 +9,8 @@ @keyup.enter.native="handleQuery" /> - - + + - - + + + + @@ -112,7 +118,6 @@ - @@ -120,8 +125,8 @@ - - + + +
@@ -146,9 +152,9 @@ 已选择属性
- - + {{attribute.name}} @@ -157,42 +163,42 @@
- -
- 未选择属性 -
- - - - - - - - - - - 查询 - - - - - - {{attribute.name}} - - - -
+ +
+ 未选属性 +
+ + + + + + + + + + 查询 + + + + + + {{attribute.name}} + + + +
@@ -236,26 +242,25 @@ export default { pageNum: 1, pageSize: 10, name: null, - status: null, + states: null }, // 表单参数 form: {}, // 表单校验 rules: { - createBy: [ - { required: true, message: "创建人不能为空", trigger: "blur" } + name: [ + { required: true, message: "组名称不能为空", trigger: "blur" } ], - createTime: [ - { required: true, message: "创建时间不能为空", trigger: "blur" } + states: [ + { required: true, message: "状态不能为空", trigger: "change" } ], }, tags: [ - { name: '标签一'}, - { name: '标签二'} + { name: '标签一' }, + { name: '标签二' } ], - - checkedList:[], - attributeQuery:{ + checkedAttributeList: [], + attributeQuery: { pageNum: 1, pageSize: 10, code: null, @@ -269,11 +274,30 @@ export default { this.getList(); }, methods: { - + /** + * 选中值触发方法 + */ + checkedAttribute(attribute){ + let isCheck = this.form.attributeIdList.indexOf(attribute.id) > -1; + if (isCheck){ + this.checkedAttributeList.push(attribute); + }else { + // 删除 + this.checkedAttributeList.splice( + this.checkedAttributeList.indexOf(attribute), 1 + ) + } + }, + /** + * 删除选中值 + * @param index + */ removeChecked(index){ console.log(index) - this.checkedList.splice(index-1,1) + this.checkedAttributeList.splice(index, 1); + this.form.attributeIdList.splice(index, 1); }, + /** * 查询属性 */ @@ -303,13 +327,11 @@ export default { this.form = { id: null, name: null, - status: null, + states: null, remark: null, - createBy: null, - createTime: null, - updateBy: null, - updateTime: null + attributeIdList: [], }; + this.checkedAttributeList = [] this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -333,7 +355,7 @@ export default { this.reset(); this.open = true; this.title = "添加属性组"; - this.queryAttribute() + this.queryAttribute(); }, /** 修改按钮操作 */ handleUpdate(row) { diff --git a/src/views/product/brand/index.vue b/src/views/product/brand/index.vue index cd3f067..d257347 100644 --- a/src/views/product/brand/index.vue +++ b/src/views/product/brand/index.vue @@ -1,9 +1,9 @@