From 8032f3bda1a4fbcea539d2ff7940d86667fca50c Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 23 Jun 2021 16:48:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=86=E7=B1=BB=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/api/goods.js | 15 +- .../src/views/goods/goods-manage/category.vue | 1 - manager/src/views/goods/goods-manage/spec.vue | 156 +++++++----------- 3 files changed, 60 insertions(+), 112 deletions(-) diff --git a/manager/src/api/goods.js b/manager/src/api/goods.js index 4b02cd15..13a4a41a 100644 --- a/manager/src/api/goods.js +++ b/manager/src/api/goods.js @@ -76,15 +76,15 @@ export const disableCategory = (id, type) => { // 获取商品规格分页列表 export const getSpecListData = (params) => { - return getRequest('/goods/spec/page', params) + return getRequest('/goods/spec', params) } // 添加或修改规格设置 export const insertSpec = (params) => { return postRequest('/goods/spec', params) } // 添加或修改规格设置 -export const updateSpec = (params) => { - return putRequest('/goods/spec', params) +export const updateSpec = (id,params) => { + return putRequest(`/goods/spec/${id}`, params) } //根据分类id获取关联规格 export const getCategorySpecListData = (category_id, params) => { @@ -94,15 +94,6 @@ export const getCategorySpecListData = (category_id, params) => { export const delSpec = (id, params) => { return deleteRequest(`/goods/spec/${id}`, params) } -// 获取商品规格值列表 -export const getSpecValuesListData = (id, params) => { - return getRequest(`/goods/specValues/values/${id}`, params) -} -// 添加商品规格值 -export const saveSpecValues = (id, params) => { - return postRequest(`/goods/specValues/save/${id}`, params) -} - // 查询某分类下的全部子分类列表 export const getGoodsCategory = (parent_id) => { diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index 1bcc3217..deacb087 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -261,7 +261,6 @@ export default { getCategorySpecListData(v.id).then((res) => { this.categoryId = v.id; this.modalSpecTitle = "规格关联"; - console.log(res); this.specForm.categorySpecs = res.map((item) => item.id); this.modalSpecVisible = true; }); diff --git a/manager/src/views/goods/goods-manage/spec.vue b/manager/src/views/goods/goods-manage/spec.vue index 701554d8..b6cdfa3e 100644 --- a/manager/src/views/goods/goods-manage/spec.vue +++ b/manager/src/views/goods/goods-manage/spec.vue @@ -23,8 +23,8 @@ - - + + - + + + +
-
- - -
- - -
- - 提交 +
@@ -118,10 +98,9 @@ import { getSpecListData, insertSpec, updateSpec, - delSpec, - getSpecValuesListData, - saveSpecValues, + delSpec } from "@/api/goods"; + export default { name: "spec", components: {}, @@ -131,7 +110,6 @@ export default { modalType: 0, // 添加或编辑标识 modalVisible: false, // 添加或编辑显示 modalTitle: "", // 添加或编辑标题 - dialogSpecValuesVisible: false, // 添加或编辑规格值 specTitle: "", // 添加或编辑规格值 searchForm: { // 搜索框初始化对象 @@ -145,9 +123,8 @@ export default { specName: "", specValue: "", }, - specForm: {}, /** 编辑规格值 */ - specValues: [], + specValue: [], // 表单验证规则 formValidate: {}, submitLoading: false, // 添加或编辑提交状态 @@ -179,24 +156,7 @@ export default { width: 250, render: (h, params) => { return h("div", [ - h( - "Button", - { - props: { - type: "primary", - size: "small", - }, - style: { - marginRight: "5px", - }, - on: { - click: () => { - this.editSpec(params.row); - }, - }, - }, - "编辑规格值" - ), + h( "Button", { @@ -239,23 +199,28 @@ export default { }; }, methods: { + //初始化,获取数据 init() { this.getDataList(); }, + //修改分页 changePage(v) { this.searchForm.pageNumber = v; this.getDataList(); this.clearSelectAll(); }, + //修改页面大小 changePageSize(v) { this.searchForm.pageSize = v; this.getDataList(); }, + //搜索参数 handleSearch() { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 10; this.getDataList(); }, + //重置搜索参数 handleReset() { this.$refs.searchForm.resetFields(); this.searchForm.pageNumber = 1; @@ -263,6 +228,7 @@ export default { // 重新加载数据 this.getDataList(); }, + //更改排序 changeSort(e) { this.searchForm.sort = e.key; this.searchForm.order = e.order; @@ -271,36 +237,27 @@ export default { } this.getDataList(); }, + //清除已选择 clearSelectAll() { this.$refs.table.selectAll(false); }, + //修改已选择 changeSelect(e) { this.selectList = e; this.selectCount = e.length; }, + //获取数据 getDataList() { this.loading = true; // 带多条件搜索参数获取表单数据 请自行修改接口 getSpecListData(this.searchForm).then((res) => { this.loading = false; - if (res.success) { - this.data = res.result.records; - this.total = res.result.total; - } + this.data = res.records; + this.total = res.total; }); this.loading = false; }, - submitSpecValuesForm() { - saveSpecValues(this.specForm.specId, this.specForm).then((res) => { - this.submitLoading = false; - if (res.success) { - this.$Message.success("规格值保存成功"); - this.getDataList(); - this.modalVisible = false; - this.dialogSpecValuesVisible = false; - } - }); - }, + //新增规格 saveSpec() { this.$refs.form.validate((valid) => { if (valid) { @@ -318,7 +275,7 @@ export default { }); } else { // 编辑 - updateSpec(this.form).then((res) => { + updateSpec(this.form.id, this.form).then((res) => { this.submitLoading = false; if (res.success) { this.$Message.success("操作成功"); @@ -330,6 +287,7 @@ export default { } }); }, + //弹出添加框 add() { this.modalType = 0; this.modalTitle = "添加"; @@ -337,31 +295,31 @@ export default { delete this.form.id; this.modalVisible = true; }, + //弹出编辑框 edit(v) { this.modalType = 1; this.modalTitle = "编辑"; - this.$refs.form.resetFields(); // 转换null为"" for (let attr in v) { if (v[attr] === null) { v[attr] = ""; } } - let str = JSON.stringify(v); - let data = JSON.parse(str); - this.form = data; + let localVal = v.specValue; + + this.form.specName = v.specName; + this.form.id = v.id; + this.form.specValue = v.specValue; + + if (localVal && localVal.indexOf("," > 0)) { + this.form.specValue = localVal.split(",") + this.specValue = this.form.specValue + this.$set(this, 'specValue', this.form.specValue) + } else { + this.specValue = []; + } this.modalVisible = true; }, - editSpec(v) { - getSpecValuesListData(v.id).then((res) => { - this.modalType = 1; - this.modalTitle = "编辑"; - this.specValues = res.result; - this.specForm.specValue = res.result.map(item => item.specValue) - this.specForm.specId = v.id; - this.dialogSpecValuesVisible = true; - }); - }, remove(v) { this.$Modal.confirm({ title: "确认删除", @@ -415,5 +373,5 @@ export default { }; From 4133badc465ddb4a1503827e3f61de1563939a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Thu, 24 Jun 2021 10:32:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9B=B4=E6=92=AD=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E8=87=AA=E8=90=A5=E5=BA=97=E5=8F=AF=E4=BB=A5=E8=B5=A0=E9=80=81?= =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/api/promotion.js | 2 +- seller/src/config/index.js | 16 ++++++++-------- .../src/views/promotion/fullCut/newFullCut.vue | 2 ++ seller/src/views/promotion/live/addLive.vue | 5 ++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/manager/src/api/promotion.js b/manager/src/api/promotion.js index 42173562..0c7c6113 100644 --- a/manager/src/api/promotion.js +++ b/manager/src/api/promotion.js @@ -30,7 +30,7 @@ export const getLiveList = params => { // 获取直播间详情 export const getLiveInfo = studioId => { - return getRequest(`/broadcast/studio/studioInfo/${studioId}`); + return getRequest(`/broadcast/studio/${studioId}`); }; // 获取当前进行中的促销活动商品 diff --git a/seller/src/config/index.js b/seller/src/config/index.js index 27da5927..a7163666 100644 --- a/seller/src/config/index.js +++ b/seller/src/config/index.js @@ -18,14 +18,14 @@ export default { * @description api请求基础路径 */ api_dev: { - // common: 'https://common-api.pickmall.cn', - // buyer: 'https://buyer-api.pickmall.cn', - // seller: 'https://store-api.pickmall.cn', - // manager: 'https://admin-api.pickmall.cn', - common: 'http://192.168.0.109:8890', - buyer: 'http://192.168.0.109:8888', - seller: 'http://192.168.0.109:8889', - manager: 'http://192.168.0.109:8887' + common: 'https://common-api.pickmall.cn', + buyer: 'https://buyer-api.pickmall.cn', + seller: 'https://store-api.pickmall.cn', + manager: 'https://admin-api.pickmall.cn', + // common: 'http://192.168.0.109:8890', + // buyer: 'http://192.168.0.109:8888', + // seller: 'http://192.168.0.109:8889', + // manager: 'http://192.168.0.109:8887' }, api_prod: { common: 'https://common-api.pickmall.cn', diff --git a/seller/src/views/promotion/fullCut/newFullCut.vue b/seller/src/views/promotion/fullCut/newFullCut.vue index 9f44bb6d..3f4c4d9f 100644 --- a/seller/src/views/promotion/fullCut/newFullCut.vue +++ b/seller/src/views/promotion/fullCut/newFullCut.vue @@ -113,9 +113,11 @@ >  送积分 +