diff --git a/src/api/productCate.js b/src/api/productCate.js index 93cb68f..1ff1059 100644 --- a/src/api/productCate.js +++ b/src/api/productCate.js @@ -6,3 +6,32 @@ export function fetchList(parentId,params) { params:params }) } +export function deleteProductCate(id) { + return request({ + url:'/productCategory/delete/'+id, + method:'get' + }) +} + +export function createProductCate(data) { + return request({ + url:'/productCategory/create', + method:'post', + data:data + }) +} + +export function updateProductCate(id,data) { + return request({ + url:'/productCategory/update/'+id, + method:'post', + data:data + }) +} + +export function getProductCate(id) { + return request({ + url:'/productCategory/'+id, + method:'get', + }) +} diff --git a/src/router/index.js b/src/router/index.js index 08677f3..217ebd7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -68,6 +68,20 @@ export const constantRouterMap = [ component: () => import('@/views/pms/productCate/index'), meta: {title: '商品分类', icon: 'product-cate'} }, + { + path: 'addProductCate', + name: 'addProductCate', + component: () => import('@/views/pms/productCate/add'), + meta: {title: '添加商品分类'}, + hidden:true + }, + { + path: 'updateProductCate', + name: 'updateProductCate', + component: () => import('@/views/pms/productCate/update'), + meta: {title: '修改商品分类'}, + hidden:true + }, { path: 'productAttr', name: 'productAttr', diff --git a/src/views/pms/brand/components/BrandDetail.vue b/src/views/pms/brand/components/BrandDetail.vue index 0d6334c..6601d9c 100644 --- a/src/views/pms/brand/components/BrandDetail.vue +++ b/src/views/pms/brand/components/BrandDetail.vue @@ -4,7 +4,7 @@ - + @@ -66,7 +66,7 @@ }, data() { return { - brand:null, + brand:Object.assign({}, defaultBrand), rules: { name: [ {required: true, message: '请输入品牌名称', trigger: 'blur'}, @@ -107,7 +107,7 @@ type: 'success', duration:1000 }); - this.$router.push({path: '/pms/brand'}); + this.$router.back(); }); } else { createBrand(this.brand).then(response => { diff --git a/src/views/pms/productAttr/components/ProductAttrDetail.vue b/src/views/pms/productAttr/components/ProductAttrDetail.vue index c9c5985..9e82d09 100644 --- a/src/views/pms/productAttr/components/ProductAttrDetail.vue +++ b/src/views/pms/productAttr/components/ProductAttrDetail.vue @@ -93,7 +93,7 @@ }, data() { return { - productAttr: null, + productAttr: Object.assign({}, defaultProductAttr), rules: { name: [ {required: true, message: '请输入属性名称', trigger: 'blur'}, diff --git a/src/views/pms/productCate/add.vue b/src/views/pms/productCate/add.vue new file mode 100644 index 0000000..6c1f732 --- /dev/null +++ b/src/views/pms/productCate/add.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/src/views/pms/productCate/components/ProductCateDetail.vue b/src/views/pms/productCate/components/ProductCateDetail.vue new file mode 100644 index 0000000..4c03c75 --- /dev/null +++ b/src/views/pms/productCate/components/ProductCateDetail.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/views/pms/productCate/index.vue b/src/views/pms/productCate/index.vue index a198d72..db1fc0e 100644 --- a/src/views/pms/productCate/index.vue +++ b/src/views/pms/productCate/index.vue @@ -57,6 +57,7 @@