Commit eb7f8c86 by caoyanzhi

update: 兼容老数据

parent cf49676d
...@@ -1220,7 +1220,54 @@ export default { ...@@ -1220,7 +1220,54 @@ export default {
// 对channelList进行排序 // 对channelList进行排序
const channelListSort = [3, 1, 9, 8, 11, 10] const channelListSort = [3, 1, 9, 8, 11, 10]
let channelList = channelListSort.map(el => item.channelList.find(item => item.channelType == el)); let channelList = channelListSort.map(el => {
let result = item.channelList.find(item => item.channelType == el);
if (!result) {
switch(el) {
case 11:
result = {
integralStrategyChannelId: "", //id
enterpriseId: "",
integralStrategyId: "", //策略id
channelType: "11", //渠道类型 1微信 3:线下 5淘宝 6京东 7唯品会 8天猫 11抖音
openStatus: 0, //渠道配置是否启用 1启用 0停用
channelRelationEnterpriseType: "1", // 策略关联企业 1所有企业 2部分企业
channelRelationStoreType: "1", //策略关联门店类型 1所有门店 2门店分组 3部分门店
channelStoreType: "-1", // 策略选择门店类型 (-1:所有 0:自营 1:联营 2:加盟,3代销4托管)
channelRelationProType: "1", // 策略关联商品类型 1所有商品 2商品品牌 3商品类目 4部分商品
integralUseDiscountControl: "1", // 折扣控制 1所有折扣商品适用 2折扣范围
integralUseDiscountControlUpper: undefined,
integralUseDiscountControlLower: undefined,
useProportionalRestriction: "0.0", // 抵现比例限制
strategyGoodsRelationIdArr: [], // 商品
storeRelationIdArr: [], //门店
enterpriseRelationIdArr: [] //商户
}
break;
case 10:
result = {
integralStrategyChannelId: "", //id
enterpriseId: "",
integralStrategyId: "", //策略id
channelType: "10", //渠道类型 1微信 3:线下 5淘宝 6京东 7唯品会 8天猫 9微盟 10其他 11抖音
openStatus: 0, //渠道配置是否启用 1启用 0停用
channelRelationEnterpriseType: "1", // 策略关联企业 1所有企业 2部分企业
channelRelationStoreType: "1", //策略关联门店类型 1所有门店 2门店分组 3部分门店
channelStoreType: "-1", // 策略选择门店类型 (-1:所有 0:自营 1:联营 2:加盟,3代销4托管)
channelRelationProType: "1", // 策略关联商品类型 1所有商品 2商品品牌 3商品类目 4部分商品
integralUseDiscountControl: "1", // 折扣控制 1所有折扣商品适用 2折扣范围
integralUseDiscountControlUpper: undefined,
integralUseDiscountControlLower: undefined,
useProportionalRestriction: "0.0", // 抵现比例限制
strategyGoodsRelationIdArr: [], // 商品
storeRelationIdArr: [], //门店
enterpriseRelationIdArr: [] //商户
}
break;
}
}
return result
});
// 将channelListSort中不存在的渠道拼到channelList上 // 将channelListSort中不存在的渠道拼到channelList上
channelList = channelList.concat(item.channelList.filter(el => !channelListSort.some(item => el.channelType == item))); channelList = channelList.concat(item.channelList.filter(el => !channelListSort.some(item => el.channelType == item)));
item.channelList = channelList; item.channelList = channelList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment