diff --git a/manager/src/config/index.js b/manager/src/config/index.js index a4a19129..596645d1 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -17,14 +17,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.106:8890', - // buyer: 'http://192.168.0.106:8888', - // seller: 'http://192.168.0.106:8889', - // manager: 'http://192.168.0.106: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.103:8890', + buyer: 'http://192.168.0.103:8888', + seller: 'http://192.168.0.103:8889', + manager: 'http://192.168.0.103:8887' }, api_prod: { common: "https://common-api.pickmall.cn", diff --git a/manager/src/views/order/order/orderList.vue b/manager/src/views/order/order/orderList.vue index ae5d0fd6..1a93e173 100644 --- a/manager/src/views/order/order/orderList.vue +++ b/manager/src/views/order/order/orderList.vue @@ -1,43 +1,38 @@ - @@ -254,20 +259,20 @@
- + 立即发布 - + 放入仓库 - + 推荐 - + 不推荐 @@ -275,9 +280,9 @@
+ :title="paramsGroup.groupName" + class="mb_10" + style="text-align: left" :key="paramsGroup.groupName"> {{paramsGroup.groupName}}

@@ -314,7 +319,6 @@ import * as API_GOODS from "@/api/goods"; import * as API_Shop from "@/api/shops"; import cloneObj from "@/utils/index"; -import bus from '@/libs/eventBus' import vuedraggable from "vuedraggable"; import editor from "@/views/my-components/lili/editor"; import {regular} from "@/utils"; @@ -322,7 +326,13 @@ import {regular} from "@/utils"; export default { components:{ editor, - vuedraggable, + vuedraggable + }, + props: { + firstData: { + default: {}, + type: Object + } }, data () { // 表单验证项,商品价格 @@ -363,6 +373,7 @@ export default { } }; return { + categoryId: '', // 商品分类第三级id //提交状态 submitLoading: false, //上传图片路径 @@ -387,9 +398,9 @@ export default { /** 商品相册列表 */ goodsGalleryFiles: [], /** 是否立即发布 true 立即发布 false 放入仓库 */ - release: "true", + release: true, /** 是否为推荐商品 */ - recommend: "true", + recommend: true, /** 店铺分类 */ storeCategoryPath: "", brandId: 0, @@ -411,6 +422,8 @@ export default { templateId: '', /** 参数组*/ goodsParamsDTOList: [], + /** 商品分类中文名 */ + categoryName: [] }, /** 表单数据*/ skuForm: {}, @@ -482,7 +495,7 @@ export default { /** 店铺分类列表 */ shopCategory: [], /** 商品单位列表 */ - goodsUnitList: {}, + goodsUnitList: [], ignoreColumn: [ "_index", "_rowKey", @@ -507,6 +520,7 @@ export default { * @value 参数选项值 */ selectParams(paramsGroup, groupIndex, params, paramsIndex, value) { + debugger if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) { this.baseInfoForm.goodsParamsDTOList[groupIndex] = { groupId:'', @@ -515,10 +529,9 @@ export default { } } //赋予分组id、分组名称 - this.baseInfoForm.goodsParamsDTOList[groupIndex] = { - groupId : paramsGroup.groupId, - groupName : paramsGroup.groupName - } + this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId + this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName + //参数详细为空,则赋予 if (!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]) { this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={ @@ -573,6 +586,7 @@ export default { this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url); }, updateSkuPicture() { + this.baseInfoForm.regeneratorSkuFlag = true; let _index = this.selectedSku._index; this.skuTableData[_index] = this.selectedSku; }, @@ -596,16 +610,13 @@ export default { handleFormatError(file) { this.$Notice.warning({ title: "文件格式不正确", - desc: - "File format of " + - file.name + - " is incorrect, please select jpg or png.", + desc: "文件 " + file.name + " 的格式不正确" }); }, handleMaxSize(file) { this.$Notice.warning({ title: "超过文件大小限制", - desc: "图片 " + file.name + " 不能超过2mb", + desc: "图片 " + file.name + " 不能超过2mb" }); }, handleBeforeUploadGoodsPicture() { @@ -669,27 +680,19 @@ export default { }); }, // 编辑时获取商品信息 - async GET_GoodData() { + async GET_GoodData(id,draftId) { let response = {}; - if (this.$route.query.draftId) { - response = await API_GOODS.getDraftGoodsDetail(this.$route.query.draftId); + if (draftId) { + response = await API_GOODS.getDraftGoodsDetail(draftId); } else { - response = await API_GOODS.getGoods(this.$route.query.id); + response = await API_GOODS.getGoods(id); this.goodsId = response.result.id; } this.baseInfoForm = {...this.baseInfoForm,...response.result}; - this.baseInfoForm.release = "true"; - this.baseInfoForm.recommend = this.baseInfoForm.recommend - ? "true" - : "false"; + this.baseInfoForm.release = true; - //分类名称展示 - this.activeCategoryName1 = response.result.categoryName[0]; - this.activeCategoryName2 = response.result.categoryName[1]; - this.activeCategoryName3 = response.result.categoryName[2]; - - this.baseInfoForm.categoryId = response.result.categoryPath.split(","); + this.categoryId = response.result.categoryPath.split(",")[2]; if ( @@ -703,8 +706,6 @@ export default { }); } - this.categoryId = this.baseInfoForm.categoryId[2]; - this.Get_SkuInfoByCategory(this.categoryId) this.renderGoodsDetailSku(response.result.skuList); @@ -1024,7 +1025,7 @@ export default { /** 数据改变之后 抛出数据 */ updateSkuTable(row, item) { let index = row._index; - // this.skuTableData[index][item] = row[item]; + this.baseInfoForm.regeneratorSkuFlag = true; /** 进行自定义校验 判断是否是数字(小数也能通过)重量 */ if (item === "weight") { if ( @@ -1136,11 +1137,10 @@ export default { } }); } else { - // this.baseInfoForm.goodsType = "NORMAL"; API_GOODS.createGoods(this.baseInfoForm).then((res) => { if (res.success) { this.submitLoading = false; - this.activestep = 2; + this.$parent.activestep = 2; window.scrollTo(0, 0); } else { this.submitLoading = false; @@ -1197,7 +1197,7 @@ export default { API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => { if (res.success) { this.$Message.info("保存成功!"); - this.$router.back(); + this.$router.push({name: 'template-goods'}); } }); } @@ -1212,16 +1212,34 @@ export default { this.logisticsTemplate = res.result; } }) - /** 获取该商城分类下 商品参数信息 */ - this.GET_GoodsParams(); - /** 查询品牌列表 */ - this.getGoodsBrandList(); - /** 查询分类绑定的规格信息 */ - this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId); - // 获取商品单位 - this.GET_GoodsUnit(); - // 获取当前店铺分类 - this.GET_ShopGoodsLabel(); + if (this.$route.query.id || this.$route.query.draftId) { // 编辑商品、模板 + this.GET_GoodData(this.$route.query.id, this.$route.query.draftId) + } else { // 新增商品、模板 + if (this.firstData.tempId) { // 选择模板 + this.GET_GoodData('', this.firstData.tempId) + } else { + const cateId = [] + this.firstData.category.forEach(cate => { + this.baseInfoForm.categoryName.push(cate.name) + cateId.push(cate.id) + }) + this.categoryId = cateId[2] + this.baseInfoForm.categoryPath = cateId.toString() + this.baseInfoForm.goodsType = this.firstData.goodsType; + /** 获取该商城分类下 商品参数信息 */ + this.GET_GoodsParams(); + /** 查询品牌列表 */ + this.getGoodsBrandList(); + /** 查询分类绑定的规格信息 */ + this.Get_SkuInfoByCategory(this.categoryId); + // 获取商品单位 + this.GET_GoodsUnit(); + // 获取当前店铺分类 + this.GET_ShopGoodsLabel(); + } + + } + } }