|
@@ -304,10 +304,13 @@
|
|
const aclist = await salesDetailAllList(activeParams).then(res => res.data)
|
|
const aclist = await salesDetailAllList(activeParams).then(res => res.data)
|
|
// 获取活动产品统计
|
|
// 获取活动产品统计
|
|
const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
|
|
const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
|
|
- // 采购额结余
|
|
|
|
- acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount) - Number(acTotal.totalUsePromoGiftsAmount)
|
|
|
|
- // 采购额超出
|
|
|
|
- acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount) - Number(acTotal.totalPromoGiftsAmount)
|
|
|
|
|
|
+ if(acTotal){
|
|
|
|
+ // 采购额结余
|
|
|
|
+ acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
|
|
|
|
+ // 采购额超出
|
|
|
|
+ acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
|
|
|
|
+ }
|
|
|
|
+
|
|
const retList = aclist.length ? [{
|
|
const retList = aclist.length ? [{
|
|
id: 'promo-'+i,
|
|
id: 'promo-'+i,
|
|
promo: promo,
|
|
promo: promo,
|
|
@@ -316,13 +319,15 @@
|
|
// 将活动产品数据拼接
|
|
// 将活动产品数据拼接
|
|
listData = aclist&&aclist.length ? listData.concat(retList) : listData
|
|
listData = aclist&&aclist.length ? listData.concat(retList) : listData
|
|
}
|
|
}
|
|
|
|
+ console.log(listData)
|
|
// 如果活动没有任何产品,不显示统计一行
|
|
// 如果活动没有任何产品,不显示统计一行
|
|
if(active.length){
|
|
if(active.length){
|
|
- const hasAcp = listData.filter(item => item.id=='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
|
|
|
|
- if(hasAcp && hasAcp.length==1){
|
|
|
|
|
|
+ const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
|
|
|
|
+ if(hasAcp && hasAcp.length==0){
|
|
listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
|
|
listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
console.log(listData)
|
|
console.log(listData)
|
|
this.dataSource = listData
|
|
this.dataSource = listData
|
|
|
|
|