Commit 846a78d8 by 张晓玮

Merge branch 'feature/584/zxw' into 'SAAS+V5.8.4'

商户管理编辑修改

See merge request !852
2 parents c68649ff fb050ff5
...@@ -271,7 +271,12 @@ export default { ...@@ -271,7 +271,12 @@ export default {
const productDetailsForSubmit = this.mapProductDetailsForSubmit(this.productDetails); const productDetailsForSubmit = this.mapProductDetailsForSubmit(this.productDetails);
this.saving = true; this.saving = true;
try { try {
traffic.guaranteeList?.forEach((val) => { // 使用组件方法构建包含 dataType 的兜底条件列表
console.log(trafficRef.buildGuaranteeListForSubmit);
const guaranteeList = typeof trafficRef.buildGuaranteeListForSubmit === "function"
? trafficRef.buildGuaranteeListForSubmit()
: traffic.guaranteeList || [];
guaranteeList?.forEach((val) => {
if (val.compensationMode == 2 && val.ladderConditions?.length) { if (val.compensationMode == 2 && val.ladderConditions?.length) {
val.ladderConditions = JSON.stringify(val.ladderConditions); val.ladderConditions = JSON.stringify(val.ladderConditions);
} }
...@@ -284,7 +289,7 @@ export default { ...@@ -284,7 +289,7 @@ export default {
businessForm, businessForm,
productDetailsForSubmit, productDetailsForSubmit,
baseSceneList: this.baseSceneList, baseSceneList: this.baseSceneList,
guaranteeList: traffic.guaranteeList, guaranteeList,
}); });
console.log(payload); console.log(payload);
await merchantOnShelf(payload); await merchantOnShelf(payload);
......
...@@ -1071,6 +1071,20 @@ export default { ...@@ -1071,6 +1071,20 @@ export default {
} }
return null; return null;
}, },
/**
* 构建提交用的兜底条件列表(添加 dataType)
*/
buildGuaranteeListForSubmit() {
const list = this.componentData.guaranteeList || [];
return list.map((item) => {
// 从当前场景的指标选项中查找对应的 dataType
const indicator = this.currentSceneIndicatorOptions.find(opt => opt.value === item.guaranteeIndex);
return {
...item,
dataType: indicator?.dataType || null, // 1: 比例,2: 数值
};
});
},
getSelectText(i) { getSelectText(i) {
const value = this.componentData[i.key]; const value = this.componentData[i.key];
if (this.isViewMode && i.viewKey) { if (this.isViewMode && i.viewKey) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!