diff --git a/src/api/product/good.js b/src/api/product/good.js new file mode 100644 index 0000000..72c8406 --- /dev/null +++ b/src/api/product/good.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询商品测试列表 +export function listGood(query) { + return request({ + url: '/product/good/list', + method: 'get', + params: query + }) +} + +// 查询商品测试详细 +export function getGood(id) { + return request({ + url: '/product/good/' + id, + method: 'get' + }) +} + +// 新增商品测试 +export function addGood(data) { + return request({ + url: '/product/good', + method: 'post', + data: data + }) +} + +// 修改商品测试 +export function updateGood(data) { + return request({ + url: '/product/good/'+data.id, + method: 'put', + data: data + }) +} + +// 删除商品测试 +export function delGood(id) { + return request({ + url: '/product/good/' + id, + method: 'delete' + }) +} diff --git a/src/api/product/productInfo.js b/src/api/product/info.js similarity index 53% rename from src/api/product/productInfo.js rename to src/api/product/info.js index 69f3940..80b02c2 100644 --- a/src/api/product/productInfo.js +++ b/src/api/product/info.js @@ -1,44 +1,44 @@ import request from '@/utils/request' // 查询商品信息列表 -export function listProductInfo(query) { +export function listInfo(query) { return request({ - url: '/product/productInfo/list', + url: '/product/info/list', method: 'get', params: query }) } // 查询商品信息详细 -export function getProductInfo(id) { +export function getInfo(id) { return request({ - url: '/product/productInfo/' + id, + url: '/product/info/' + id, method: 'get' }) } // 新增商品信息 -export function addProductInfo(data) { +export function addInfo(data) { return request({ - url: '/product/productInfo', + url: '/product/info', method: 'post', data: data }) } // 修改商品信息 -export function updateProductInfo(data) { +export function updateInfo(data) { return request({ - url: '/product/productInfo/'+data.id, + url: '/product/info/'+data.id, method: 'put', data: data }) } // 删除商品信息 -export function delProductInfo(id) { +export function delInfo(id) { return request({ - url: '/product/productInfo/' + id, + url: '/product/info/' + id, method: 'delete' }) } diff --git a/src/components/AttributeGroup/index.vue b/src/components/AttributeGroup/index.vue index 5a7f82e..8c95e66 100644 --- a/src/components/AttributeGroup/index.vue +++ b/src/components/AttributeGroup/index.vue @@ -26,11 +26,11 @@ - - + + - - + + 查询 diff --git a/src/views/product/attributeGroup/index.vue b/src/views/product/attributeGroup/index.vue index cf53160..8f6e2c6 100644 --- a/src/views/product/attributeGroup/index.vue +++ b/src/views/product/attributeGroup/index.vue @@ -221,7 +221,7 @@ :total="attributeTotal" :page.sync="attribute.pageNum" :limit.sync="attribute.pageSize" - @pagination="getList1" + @pagination="attributeQuery" /> {{ attributeIdList }} @@ -295,7 +295,7 @@ export default { }, // 表单参数 form: { - attributeIds:"", + attributeIdList: [], }, // 表单校验 rules: { @@ -310,12 +310,11 @@ export default { }, created() { this.getList(); - this.getList1(); }, methods: { attributeQuery() { - listAttribute(this.queryParams).then(response => { + listAttribute(this.attribute).then(response => { this.attributeList = response.data.rows; this.attributeTotal = response.data.total; }); @@ -323,13 +322,6 @@ export default { handleClose(index) { this.attributeIdList.splice(this.attributeIdList.indexOf(index), 1) }, - /** 查询商品属性列表 */ - getList1() { - listAttribute(this.attribute).then(response => { - this.attributeList = response.data.rows; - this.attributeTotal = response.data.total; - }); - }, /** 查询商品属性组列表 */ getList() { this.loading = true; @@ -387,6 +379,7 @@ export default { this.reset(); const id = row.id || this.ids getAttributeGroup(id).then(response => { + console.log(response) this.form = response.data; this.attributeIdList=response.data.attributeIdList this.open = true; @@ -409,7 +402,6 @@ export default { this.attributeIdList=[] }); } else { - this.form.attributeIdList=this.attributeIdList addAttributeGroup(this.form).then(response => { this.$modal.msgSuccess("新增成功"); diff --git a/src/views/product/category/index.vue b/src/views/product/category/index.vue index 9741022..9598dcd 100644 --- a/src/views/product/category/index.vue +++ b/src/views/product/category/index.vue @@ -216,7 +216,11 @@ export default { introduction: null, }, // 表单参数 - form: {}, + form: { + attributeInfoList: [], + brandInfoList: [], + attributeGroupList: [], + }, // 表单校验 rules: { name: [ @@ -354,11 +358,18 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { + this.form.brandInfoList=this.brandInfoList + this.form.attributeInfoList=this.attributeInfoList + this.form.attributeGroupList=this.attributeGroupList + console.log(this.form) if (this.form.id != null) { updateCategory(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + this.attributeInfoList=[] + this.attributeGroupList=[] + this.brandInfoList=[] }); } else { addCategory(this.form).then(response => { @@ -366,6 +377,9 @@ export default { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + this.attributeInfoList=[] + this.attributeGroupList=[] + this.brandInfoList=[] }); } } diff --git a/src/views/product/good/index.vue b/src/views/product/good/index.vue new file mode 100644 index 0000000..67c1e1c --- /dev/null +++ b/src/views/product/good/index.vue @@ -0,0 +1,540 @@ + + + diff --git a/src/views/product/productInfo/index.vue b/src/views/product/productInfo/index.vue index f357e0a..8fd03ee 100644 --- a/src/views/product/productInfo/index.vue +++ b/src/views/product/productInfo/index.vue @@ -9,22 +9,6 @@ @keyup.enter.native="handleQuery" /> - - - - - - 搜索 重置 @@ -39,7 +23,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - v-hasPermi="['product:productInfo:add']" + v-hasPermi="['product:info:add']" >新增 @@ -50,7 +34,7 @@ size="mini" :disabled="single" @click="handleUpdate" - v-hasPermi="['product:productInfo:edit']" + v-hasPermi="['product:info:edit']" >修改 @@ -61,7 +45,7 @@ size="mini" :disabled="multiple" @click="handleDelete" - v-hasPermi="['product:productInfo:remove']" + v-hasPermi="['product:info:remove']" >删除 @@ -71,13 +55,13 @@ icon="el-icon-download" size="mini" @click="handleExport" - v-hasPermi="['product:productInfo:export']" + v-hasPermi="['product:info:export']" >导出 - + @@ -95,7 +79,11 @@ - + + + @@ -105,14 +93,14 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - v-hasPermi="['product:productInfo:edit']" + v-hasPermi="['product:info:edit']" >修改 删除 @@ -128,44 +116,149 @@ + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + {{dict.label}} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + 上一步 + 下一步 + + +