From 532cbc943dac2f1b457420dfce53a43f30ae90a0 Mon Sep 17 00:00:00 2001 From: mabo Date: Thu, 24 Jun 2021 18:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=95=86=E5=93=81=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/goods-seller/goodsOperation.vue | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/seller/src/views/goods/goods-seller/goodsOperation.vue b/seller/src/views/goods/goods-seller/goodsOperation.vue index f03d393c..43f7ce47 100644 --- a/seller/src/views/goods/goods-seller/goodsOperation.vue +++ b/seller/src/views/goods/goods-seller/goodsOperation.vue @@ -373,11 +373,12 @@ :title="paramsGroup.groupName" style="text-align: left" :key="paramsGroup.groupName"> + {{paramsGroup.groupName}}

- @@ -864,14 +865,13 @@ export default { required:'', } } - //赋予参数明 - this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex].paramName = params.paramName - //赋予参数值 - this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex].paramValue = value - //参数是否索引 - this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex].isIndex = params.isIndex - //参数是否必填 - this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex].required = params.required + this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={ + paramName: params.paramName, + paramValue: value, + isIndex: params.isIndex, + required: params.required, + } + console.log(this.baseInfoForm.goodsParamsDTOList); }, // 编辑sku图片 @@ -1137,14 +1137,31 @@ export default { this.params_panel.push(item.groupName) } ) - // 循环参数分组 - this.goodsParams.forEach((parmsGroup) => { - this.baseInfoForm.goodsParamsDTOList.forEach(paramsGroup=>{ - paramsGroup.goodsParamsItemDTOList.forEach(params=>{ - params.paramName=params.paramValue - }) - }) - }); + if (this.baseInfoForm.goodsParamsDTOList) { + // 已选值集合 + const paramsArr = [] + this.baseInfoForm.goodsParamsDTOList.forEach(group =>{ + group.goodsParamsItemDTOList.forEach(param => { + param.groupId = group.groupId + paramsArr.push(param) + console.log(param); + }) + }) + // 循环参数分组 + this.goodsParams.forEach((parmsGroup) => { + parmsGroup.params.forEach(param => { + + paramsArr.forEach(arr=>{ + if(param.paramName == arr.paramName){ + param.paramValue = arr.paramValue + } + }) + }) + }); + console.log(this.goodsParams); + } else { + this.baseInfoForm.goodsParamsDTOList = [] + } } ); },