diff --git a/src/api/product/category.js b/src/api/product/category.js index 19ff711..aea97c7 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -1,4 +1,3 @@ -import { instance } from '../request/http' /** * 品类相关接口 */ @@ -21,7 +20,7 @@ }) } -// 品类更新 +// 品类详情 export function detail(data) { return request({ url: `/categoryInfo/detail`, diff --git a/src/api/product/category.js b/src/api/product/category.js index 19ff711..aea97c7 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -1,4 +1,3 @@ -import { instance } from '../request/http' /** * 品类相关接口 */ @@ -21,7 +20,7 @@ }) } -// 品类更新 +// 品类详情 export function detail(data) { return request({ url: `/categoryInfo/detail`, diff --git a/src/components/mycomponent/dialog/brandAddDialog.vue b/src/components/mycomponent/dialog/brandAddDialog.vue index 952978e..b9c132d 100644 --- a/src/components/mycomponent/dialog/brandAddDialog.vue +++ b/src/components/mycomponent/dialog/brandAddDialog.vue @@ -29,9 +29,9 @@ > @@ -113,7 +113,7 @@ watch: { dataInfo: { handler(vla) { - if (vla != '') { + if (vla !== '') { this.addInfo = { brandCode: vla.brandCode, // 编号 brandName: vla.brandName, @@ -122,6 +122,7 @@ categoryIds: this.categoryName(vla.categorys), remark: vla.remark } + debugger } else { this.addInfo = { brandCode: '', // 编号 @@ -155,38 +156,31 @@ save() { if (this.title == '新增品牌') { add(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('保存成功') - } + this.close() + this.$emit('refresh') + Message.success('保存成功') }) } else { update(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('更新成功') - } + this.close() + this.$emit('refresh') + Message.success('更新成功') }) } }, // 数据处理 categoryName(category) { const ary = [] - if (category.length == 0) return '' + if (category.length === 0) return '' category.forEach(ele => { ary.push(ele.categoryId) }) return ary }, supplierName(supplier) { - const ary = [] - if (supplier.length == 0) return '' - supplier.forEach(ele => { - ary.push(ele.supplierName) - }) - return ary + if (supplier.length === 0) return [] + const supplierIds = supplier.map(item => item.id) + return supplierIds } } diff --git a/src/api/product/category.js b/src/api/product/category.js index 19ff711..aea97c7 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -1,4 +1,3 @@ -import { instance } from '../request/http' /** * 品类相关接口 */ @@ -21,7 +20,7 @@ }) } -// 品类更新 +// 品类详情 export function detail(data) { return request({ url: `/categoryInfo/detail`, diff --git a/src/components/mycomponent/dialog/brandAddDialog.vue b/src/components/mycomponent/dialog/brandAddDialog.vue index 952978e..b9c132d 100644 --- a/src/components/mycomponent/dialog/brandAddDialog.vue +++ b/src/components/mycomponent/dialog/brandAddDialog.vue @@ -29,9 +29,9 @@ > @@ -113,7 +113,7 @@ watch: { dataInfo: { handler(vla) { - if (vla != '') { + if (vla !== '') { this.addInfo = { brandCode: vla.brandCode, // 编号 brandName: vla.brandName, @@ -122,6 +122,7 @@ categoryIds: this.categoryName(vla.categorys), remark: vla.remark } + debugger } else { this.addInfo = { brandCode: '', // 编号 @@ -155,38 +156,31 @@ save() { if (this.title == '新增品牌') { add(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('保存成功') - } + this.close() + this.$emit('refresh') + Message.success('保存成功') }) } else { update(this.addInfo).then(res => { - if (!res.code) { - this.close() - this.$emit('refresh') - Message.success('更新成功') - } + this.close() + this.$emit('refresh') + Message.success('更新成功') }) } }, // 数据处理 categoryName(category) { const ary = [] - if (category.length == 0) return '' + if (category.length === 0) return '' category.forEach(ele => { ary.push(ele.categoryId) }) return ary }, supplierName(supplier) { - const ary = [] - if (supplier.length == 0) return '' - supplier.forEach(ele => { - ary.push(ele.supplierName) - }) - return ary + if (supplier.length === 0) return [] + const supplierIds = supplier.map(item => item.id) + return supplierIds } } diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue index 4e547d4..c47e73c 100644 --- a/src/components/mycomponent/dialog/categoryAddDialog.vue +++ b/src/components/mycomponent/dialog/categoryAddDialog.vue @@ -8,19 +8,20 @@ @close="close" >
-
-
-
- - -
-
- - + + + + + + + + + + + + + + + - -
-
- - - - -
-
-
-
- - -
-
- - + + + + - + + + + + + + + +
+
+ + 添加产品参数 +
-
-
-
-
- - 添加产品参数 - -
-
-
-
- - -
-
- - - - -
-
- +
+
+ + + + + + +
必填 - -
-
- - 删除 - +
+
+ + 删除 + +
-
+ +
+