From 9fbc61f7426f9284eb69667746fe910407f972d1 Mon Sep 17 00:00:00 2001 From: mabo Date: Tue, 29 Jun 2021 11:50:37 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=8B=86=E5=88=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods-seller/goodsOperationFirst.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 seller/src/views/goods/goods-seller/goodsOperationFirst.vue diff --git a/seller/src/views/goods/goods-seller/goodsOperationFirst.vue b/seller/src/views/goods/goods-seller/goodsOperationFirst.vue new file mode 100644 index 00000000..5eaee9b6 --- /dev/null +++ b/seller/src/views/goods/goods-seller/goodsOperationFirst.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file From e493f26442337a341f17023a52dc2cd0ced190c0 Mon Sep 17 00:00:00 2001 From: mabo Date: Tue, 29 Jun 2021 17:53:50 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=8B=86=E5=88=86=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/verify/index.vue | 2 +- .../goods/goods-seller/goodsOperation.vue | 331 ++++-------------- .../goods-seller/goodsOperationFirst.vue | 190 +++++++++- .../goods/goods-seller/goodsOperationSec.vue | 20 ++ .../goods-seller/goodsOperationThird.vue | 20 ++ 5 files changed, 288 insertions(+), 275 deletions(-) create mode 100644 seller/src/views/goods/goods-seller/goodsOperationSec.vue create mode 100644 seller/src/views/goods/goods-seller/goodsOperationThird.vue diff --git a/buyer/src/components/verify/index.vue b/buyer/src/components/verify/index.vue index 39ecee85..eb6b7705 100644 --- a/buyer/src/components/verify/index.vue +++ b/buyer/src/components/verify/index.vue @@ -112,7 +112,7 @@ export default { handler: function (v) { this.type = v; } - }, + } } }; diff --git a/seller/src/views/goods/goods-seller/goodsOperation.vue b/seller/src/views/goods/goods-seller/goodsOperation.vue index f88e7c76..a1f874b5 100644 --- a/seller/src/views/goods/goods-seller/goodsOperation.vue +++ b/seller/src/views/goods/goods-seller/goodsOperation.vue @@ -1,32 +1,5 @@ @@ -441,43 +381,49 @@ import * as API_Shop from "@/api/shops"; import cloneObj from "@/utils/index"; import vuedraggable from "vuedraggable"; +import firstStep from './goodsOperationFirst' +import secondStep from './goodsOperationSec' +import thirdStep from './goodsOperationThird' export default { name: "addGoods", components: { editor, - vuedraggable + vuedraggable, + firstStep, + secondStep, + thirdStep }, watch: { - selectGoodsType: { - handler(val) { - if (val && this.baseInfoForm.goodsType) { - this.goodsTypeWay.forEach((item) => { - item.check = false; - if (item.type == this.baseInfoForm.goodsType) { - item.check = true; - } - if (!item.type) { - this.defaultBaseInfo(); - } - }); - } - }, - }, - $route(to, from) { - if (to.query.draftId) { - this.draftId = to.query.draftId; - this.activestep = 1; - this.isOperationGoods = false; - this.GET_GoodData(); - } else if (to.query.id) { - this.activestep = 1; - this.goodsId = this.$route.query.id; - this.GET_GoodData(); - } else { - this.selectGoodsType = true; - this.defaultBaseInfo(); - } - }, + // selectGoodsType: { + // handler(val) { + // if (val && this.baseInfoForm.goodsType) { + // this.goodsTypeWay.forEach((item) => { + // item.check = false; + // if (item.type == this.baseInfoForm.goodsType) { + // item.check = true; + // } + // if (!item.type) { + // this.defaultBaseInfo(); + // } + // }); + // } + // }, + // }, + // $route(to, from) { + // if (to.query.draftId) { + // this.draftId = to.query.draftId; + // this.activestep = 1; + // this.isOperationGoods = false; + // this.GET_GoodData(); + // } else if (to.query.id) { + // this.activestep = 1; + // this.goodsId = this.$route.query.id; + // this.GET_GoodData(); + // } else { + // this.selectGoodsType = true; + // this.defaultBaseInfo(); + // } + // }, }, data() { // 表单验证项,商品价格 @@ -519,35 +465,12 @@ export default { }; return { - selectGoodsType: false, //是否选择商品类型 - showGoodsTemplates: false, //是否显示选择商品模板 - goodsTypeWay: [ - { - title: "实物商品", - img: require("@/assets/goodsType1.png"), - desc: "零售批发,物流配送", - type: "PHYSICAL_GOODS", - check: false, - }, - { - title: "虚拟商品", - img: require("@/assets/goodsType2.png"), - desc: "虚拟核验,无需物流", - type: "VIRTUAL_GOODS", - check: false, - }, - { - title: "商品模板导入", - img: require("@/assets/goodsTypeTpl.png"), - desc: "商品模板,一键导入", - check: false, - }, - ], + //提交状态 submitLoading: false, //上传图片路径 uploadFileUrl: API_GOODS.uploadFile, - // 预览图片 + // 预览图片路径 previewPicture: "", //商品图片 previewGoodsPicture: "", @@ -559,9 +482,7 @@ export default { showSkuPicture: false, //选择的sku selectedSku: {}, - //选择店铺分类 - strict: true, - //模版 / 草稿 id + //模版 id draftId: undefined, /** 当前激活步骤*/ activestep: 0, @@ -569,30 +490,7 @@ export default { isOperationGoods: true, //是否在发布商品 isPublish: false, - /** 当前点击的1级分类索引*/ - activeCategoryIndex1: -1, - - /** 当前点击的2级分类索引*/ - activeCategoryIndex2: -1, - - /** 当前点击的3级分类索引*/ - activeCategoryIndex3: -1, - /** 当前商品分类名称1*/ - activeCategoryName1: "", - - /** 当前商品分类名称2*/ - activeCategoryName2: "", - - /** 当前商品分类名称3*/ - activeCategoryName3: "", - /** 1级分类列表*/ - categoryListLevel1: [], - - /** 2级分类列表*/ - categoryListLevel2: [], - - /** 3级分类列表*/ - categoryListLevel3: [], + /** 请求的商品参数组列表 */ goodsParams: [], @@ -688,7 +586,7 @@ export default { {validator: checkPrice}, ], weight: [ - {required: true, message: "请输入物流参数"}, + {required: true, message: "请输入商品重量"}, {validator: checkWeight}, ], templateId: [{required: true, message: '请选择物流模板'}], @@ -702,7 +600,6 @@ export default { shopCategory: [], /** 商品单位列表 */ goodsUnitList: {}, - goodsTemplates: [], ignoreColumn: [ "_index", "_rowKey", @@ -734,8 +631,6 @@ export default { this.activestep = 1; this.goodsId = this.$route.query.id; this.GET_GoodData(); - this.selectGoodsType = false; - } // 编辑模板 else if (this.$route.query.draftId) { @@ -743,11 +638,10 @@ export default { this.activestep = 1; this.isOperationGoods = false; this.GET_GoodData(); - this.selectGoodsType = false; } //新增商品 else { - this.selectGoodsType = true; + this.$refs.first.selectGoodsType = true; this.defaultBaseInfo(); } }, @@ -775,66 +669,10 @@ export default { }; this.activestep = 0; this.isPublish = true; - this.GET_GoodsTemplate(); - this.GET_NextLevelCategory(); - }, - // 获取已选模板 - checkedTemplate () { - if(this.goodsTemplates.length) { - return this.goodsTemplates.find(item=>{return item.id == this.draftId}).goodsName - } else { - return "" - } - }, - // 选择商品模板 - handleClickGoodsTemplate(val) { - this.draftId = val.id; - this.selectGoodsType = false; - }, - // 点击商品类型 - handleClickGoodsType(val) { - this.goodsTypeWay.map((item) => { - return (item.check = false); - }); - - val.check = !val.check; - if (!val.type) { - this.showGoodsTemplates = true; - } else { - this.baseInfoForm.goodsType = val.type; - this.draftId = ""; - } + this.$refs.first.GET_NextLevelCategory(); }, - // 移动商品图片位置 - handleGoodsPicRemoteUp(fieldData, index) { - if (index != 0) { - fieldData[index] = fieldData.splice(index - 1, 1, fieldData[index])[0]; - } else { - fieldData.push(fieldData.shift()); - } - }, - // 移动商品图片位置 - handleGoodsPicRemoteDown(fieldData, index) { - if (index != fieldData.length - 1) { - fieldData[index] = fieldData.splice(index + 1, 1, fieldData[index])[0]; - } else { - fieldData.unshift(fieldData.splice(index, 1)[0]); - } - }, - // 获取商品模板 - GET_GoodsTemplate() { - let searchParams = { - saveType: "TEMPLATE", - sort: "create_time", - order: "desc", - }; - API_GOODS.getDraftGoodsListData(searchParams).then((res) => { - if (res.success) { - this.goodsTemplates = res.result.records; - } - }); - }, + /** * 选择参数 * @paramsGroup 参数分组 @@ -1433,17 +1271,10 @@ export default { /** 上一步*/ pre() { window.scrollTo(0, 0); - this.loading = true; if (this.activestep === 1) { - this.toPreCount > 0 - ? this.GET_NextLevelCategory() - : this.GET_NextLevelCategory(null, 0, true); if (this.activestep-- < 0) this.activestep = 0; - this.toPreCount++; - this.loading = false; } else { this.activestep--; - this.loading = false; } }, /** 下一步*/ @@ -1454,16 +1285,13 @@ export default { this.GET_GoodData(); return; } - this.GET_GoodsParams(); + /** 1级校验 */ - this.loading = true; - if (this.activestep === 0 && !this.activeCategoryName1) { + if (this.activestep === 0 && !this.activeCategoryName1) { this.$Message.error("请选择商品分类"); - this.loading = false; return; } else if (this.activestep === 0 && this.activeCategoryIndex3 === -1) { this.$Message.error("必须选择到三级分类"); - this.loading = false; return; } else if ( this.activestep === 0 && @@ -1471,6 +1299,7 @@ export default { this.currentStatus === 0 ) { /** 获取该商城分类下 商品参数信息 */ + this.GET_GoodsParams(); /** 查询品牌列表 */ this.getGoodsBrandList(); /** 查询分类绑定的规格信息 */ @@ -1487,13 +1316,10 @@ export default { if (valid) { /** 规格校验 */ if (!this.skuFormVali()) { - this.loading = false; return; } - this.loading = false; if (this.activestep++ > 2) return; } else { - this.loading = false; this.$message.error( "表单中存在未填写或者填写有误的地方,已有错误标示,请检查并正确填写" ); @@ -1502,7 +1328,6 @@ export default { return; } /** 下一步 */ - this.loading = false; if (this.activestep++ > 2) return; }, // 店内分类选择 @@ -1653,46 +1478,8 @@ export default { } }); }, - /** 选择商城商品分类 */ - handleSelectCategory(row, index, level) { - if (level === 1) { - this.baseInfoForm.categoryPath = row.id; - this.activeCategoryName1 = row.name; - this.activeCategoryName2 = this.activeCategoryName3 = ""; - this.activeCategoryIndex1 = index; - this.activeCategoryIndex2 = -1; - this.activeCategoryIndex3 = -1; - this.categoryListLevel2 = this.categoryListLevel1[index].children; - this.categoryListLevel3 = []; - } else if (level === 2) { - this.baseInfoForm.categoryPath = - this.baseInfoForm.categoryPath + "," + row.id; - this.activeCategoryName2 = row.name; - this.activeCategoryName3 = ""; - this.activeCategoryIndex2 = index; - this.activeCategoryIndex3 = -1; - this.categoryListLevel3 = this.categoryListLevel2[index].children; - } else { - this.baseInfoForm.categoryPath = - this.baseInfoForm.categoryPath + "," + row.id; - this.activeCategoryName3 = row.name; - this.activeCategoryIndex3 = index; - } - // 设置当前商城分类ID - this.baseInfoForm.categoryId = row.id; - this.categoryId = row.id; - this.baseInfoForm.categoryName = row.name; - }, - /** 查询下一级 商城商品分类*/ - GET_NextLevelCategory(row, level, not_click = false) { - this.loading = true; - const _id = row && row.id !== 0 ? row.id : 0; - API_GOODS.getGoodsCategoryAll().then((res) => { - if (res.success && res.result) { - this.categoryListLevel1 = res.result; - } - }); - }, + + }, }; diff --git a/seller/src/views/goods/goods-seller/goodsOperationFirst.vue b/seller/src/views/goods/goods-seller/goodsOperationFirst.vue index 5eaee9b6..b7015b0f 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationFirst.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationFirst.vue @@ -1,17 +1,203 @@ diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue new file mode 100644 index 00000000..5eaee9b6 --- /dev/null +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/seller/src/views/goods/goods-seller/goodsOperationThird.vue b/seller/src/views/goods/goods-seller/goodsOperationThird.vue new file mode 100644 index 00000000..5eaee9b6 --- /dev/null +++ b/seller/src/views/goods/goods-seller/goodsOperationThird.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file From c403fce7860caeae1122e2acbab8c69a1f286d5f Mon Sep 17 00:00:00 2001 From: mabo Date: Fri, 2 Jul 2021 18:04:17 +0800 Subject: [PATCH 03/12] no message --- .../views/goods/goods-seller/draftGoods.vue | 79 ++----------------- 1 file changed, 5 insertions(+), 74 deletions(-) diff --git a/seller/src/views/goods/goods-seller/draftGoods.vue b/seller/src/views/goods/goods-seller/draftGoods.vue index fdd63905..401e5d10 100644 --- a/seller/src/views/goods/goods-seller/draftGoods.vue +++ b/seller/src/views/goods/goods-seller/draftGoods.vue @@ -59,8 +59,6 @@ :data="data" ref="table" sortable="custom" - @on-sort-change="changeSort" - @on-selection-change="changeSelect" > - -
- - - -
-
- - -
-
@@ -110,11 +85,7 @@ export default { components: {}, data() { return { - id: "", //要操作的id - openSearch: true, // 显示搜索 loading: true, // 表单加载状态 - modalVisible: false, // 添加或编辑显示 - modalTitle: "", // 添加或编辑标题 drop: false, dropDownContent: "展开", dropDownIcon: "ios-arrow-down", @@ -124,24 +95,8 @@ export default { pageSize: 10, // 页面大小 sort: "create_time", // 默认排序字段 order: "desc", // 默认排序方式 + saveType: "TEMPLATE" }, - underForm: { // 下架表单 - reason: "", - }, - form: { - // 添加或编辑表单对象初始化数据 - goodsName: "", - sn: "", - marketEnable: "", - price: "", - sellerName: "", - }, - // 表单验证规则 - - formValidate: {}, - submitLoading: false, // 添加或编辑提交状态 - selectList: [], // 多选数据 - selectCount: 0, // 多选计数 columns: [ // 表头 { title: "ID", @@ -202,7 +157,7 @@ export default { "Button", { props: { - type: "primary", + type: "success", size: "small", }, style: { @@ -244,22 +199,14 @@ export default { }, methods: { init() { - let here = this.$route.matched.find((v) => v.name === this.$route.name); - this.pageType = here.props.default ? here.props.default.type : ""; - if (this.pageType === "TEMPLATE") { - this.searchForm.saveType = "TEMPLATE"; - } else { - this.searchForm.saveType = "DRAFT"; - } this.getDataList(); }, + // 编辑模板 editGoods(v) { - this.searchForm.saveType === "TEMPLATE" ? - this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } }): - this.$router.push({ name: "goods-draft-operation-edit", query: { draftId: v.id } }); + this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } }) }, removeDraft (id) { - let showType = this.searchForm.saveType === "TEMPLATE" ? "模版" : "草稿"; + let showType = "模版"; this.$Modal.confirm({ title: "确认审核", content: "您确认要删除id为 " + id + " 的" + showType + "吗?", @@ -278,7 +225,6 @@ export default { changePage(v) { this.searchForm.pageNumber = v; this.getDataList(); - this.clearSelectAll(); }, changePageSize(v) { this.searchForm.pageSize = v; @@ -296,21 +242,6 @@ export default { // 重新加载数据 this.getDataList(); }, - changeSort(e) { - this.searchForm.sort = e.key; - this.searchForm.order = e.order; - if (e.order === "normal") { - this.searchForm.order = ""; - } - this.getDataList(); - }, - clearSelectAll() { - this.$refs.table.selectAll(false); - }, - changeSelect(e) { - this.selectList = e; - this.selectCount = e.length; - }, dropDown() { if (this.drop) { this.dropDownContent = "展开"; From 9b9295ea94d71106cf3c93f663b19d21ea89ec78 Mon Sep 17 00:00:00 2001 From: mabo Date: Mon, 5 Jul 2021 16:08:12 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=8B=86=E5=88=86=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goodsDetail/ShowGoodsDetail.vue | 7 +- buyer/src/config/index.js | 16 +- .../src/pages/home/memberCenter/Favorites.vue | 7 +- seller/src/libs/eventBus.js | 3 + .../goods/goods-seller/goodsOperation.vue | 1417 +---------------- .../goods-seller/goodsOperationFirst.vue | 117 +- .../goods/goods-seller/goodsOperationSec.vue | 1216 +++++++++++++- .../goods-seller/goodsOperationThird.vue | 33 +- 8 files changed, 1342 insertions(+), 1474 deletions(-) create mode 100644 seller/src/libs/eventBus.js diff --git a/buyer/src/components/goodsDetail/ShowGoodsDetail.vue b/buyer/src/components/goodsDetail/ShowGoodsDetail.vue index ab2ca565..3ec0b9af 100644 --- a/buyer/src/components/goodsDetail/ShowGoodsDetail.vue +++ b/buyer/src/components/goodsDetail/ShowGoodsDetail.vue @@ -90,7 +90,7 @@