diff --git a/src/router/index.js b/src/router/index.js index 0408e5b..452c5b2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -128,6 +128,12 @@ export const constantRoutes = [ name: 'TeamView', meta: { title: '拼桌详情' } }, + { + path: 'goods/:id?', + component: () => import('@/views/bst/goodsCategory/components/goodsEdit.vue'), + name: 'GoodsEdit', + meta: { title: '商品管理' } + }, ] }, { diff --git a/src/views/bst/goods/index.vue b/src/views/bst/goods/index.vue index 0c5f2ca..ff324cc 100644 --- a/src/views/bst/goods/index.vue +++ b/src/views/bst/goods/index.vue @@ -1,22 +1,7 @@ @@ -206,21 +166,22 @@ export default { name: "Goods", mixins: [$showColumns], components: {FormCol}, + dicts: ['goods_deposit','goods_status'], data() { return { span: 24, // 字段列表 columns: [ - {key: 'id', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'storeId', visible: true, label: '店铺ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'categoryId', visible: true, label: '分类ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, {key: 'name', visible: true, label: '商品名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, {key: 'image', visible: true, label: '图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'deposit', visible: true, label: '是否可存 0-是 1-否', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'sales', visible: true, label: '销量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'virtualSales', visible: true, label: '虚拟销量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'status', visible: true, label: '商品状态 0-下架 1-在售', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + // {key: 'sales', visible: true, label: '销量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + // {key: 'virtualSales', visible: true, label: '虚拟销量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + {key: 'deposit', visible: true, label: '是否可存', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + {key: 'status', visible: true, label: '商品状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, {key: 'sort', visible: true, label: '排序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + {key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + {key: 'storeId', visible: true, label: '店铺名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, + {key: 'categoryId', visible: true, label: '分类名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, ], // 排序方式 orderSorts: ['ascending', 'descending', null], @@ -348,19 +309,14 @@ export default { }, /** 新增按钮操作 */ handleAdd() { - this.reset(); - this.open = true; - this.title = "添加商品"; + this.$router.push({ name: 'GoodsEdit' }) }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); - const id = row.id || this.ids - getGoods(id).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改商品"; - }); + this.$router.push({ + name: 'GoodsEdit', + params: { id: row.id } + }) }, /** 提交按钮 */ submitForm() { diff --git a/src/views/bst/goodsCategory/components/WD.vue b/src/views/bst/goodsCategory/components/WD.vue new file mode 100644 index 0000000..5b4954d --- /dev/null +++ b/src/views/bst/goodsCategory/components/WD.vue @@ -0,0 +1,344 @@ + + + + + diff --git a/src/views/bst/goodsCategory/components/goodsEdit.vue b/src/views/bst/goodsCategory/components/goodsEdit.vue new file mode 100644 index 0000000..bfe3e7f --- /dev/null +++ b/src/views/bst/goodsCategory/components/goodsEdit.vue @@ -0,0 +1,697 @@ + + + + +