发布商品回显问题

master
mabo 2021-06-24 18:36:08 +08:00
parent d645f4ea6b
commit 532cbc943d
1 changed files with 35 additions and 18 deletions

View File

@ -373,11 +373,12 @@
:title="paramsGroup.groupName"
style="text-align: left" :key="paramsGroup.groupName">
<Panel :name="paramsGroup.groupName">
{{paramsGroup.groupName}}
<p slot="content">
<FormItem v-for="( params, paramsIndex) in paramsGroup.params" :key="paramsIndex"
:label="`${params.paramName}`">
<Select v-model="params.paramName" placeholder="请选择" style="width: 200px" clearable
@on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.val)">
<Select v-model="params.paramValue" placeholder="请选择" style="width: 200px" clearable
@on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.paramValue)">
<Option v-for="option in params.options.split(',')" :label="option"
:value="option"></Option>
</Select>
@ -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 = []
}
}
);
},