|
@@ -265,49 +265,35 @@ export default {
|
|
|
computed: {
|
|
|
columns () {
|
|
|
const _this = this
|
|
|
+ const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
|
|
|
+ const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
|
|
|
const arr = [
|
|
|
- { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '区域负责人', dataIndex: 'bizUserName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '省份', dataIndex: 'dealerInfo.provinceName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '130px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '品牌', dataIndex: 'brandName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandName' } },
|
|
|
- { title: '二级分类', dataIndex: 'brandtypeName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } }
|
|
|
- // { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
|
|
|
- // { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
|
|
|
- // { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
|
|
|
- // { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
|
|
|
- // { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
- // { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
|
|
|
+ { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '区域负责人', dataIndex: 'bizUserName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '省份', dataIndex: 'dealerInfo.provinceName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '客户名称', dataIndex: 'dealerInfo.dealerName', show: true, width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', show: true, width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'brandName', show: true, width: '80px', align: 'center', scopedSlots: { customRender: 'brandName' } },
|
|
|
+ { title: '二级分类', dataIndex: 'brandtypeName', show: true, width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
|
|
|
+ { title: '销售额', dataIndex: 'totalSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '促销成本费用', dataIndex: 'promoCostFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
|
|
|
+ { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
|
|
|
+ { title: '促销销售费用', dataIndex: 'promoSaleFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
|
|
|
+ { title: '参与活动销售额', dataIndex: 'promoSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '未参与活动销售额', dataIndex: 'notpromotionSale', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '产品赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '产品赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '物料赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '物料赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '促销成本费用+产品/物料成本费用', dataIndex: 'promoCostFeeAndAllocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '成本合计占比', dataIndex: 'totalCostRate', show: isCostFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
|
|
|
+ { title: '促销销售费用+产品/物料销售费用', dataIndex: 'promoSaleFeeAndAllocateAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
|
|
|
+ { title: '销售合计占比', dataIndex: 'totalSaleRate', show: isSellFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
|
|
|
]
|
|
|
- if (this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')) { // 售价权限
|
|
|
- const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
|
|
|
- arr.splice(8, 0, { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 11 : 9, 0, { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 12 : 10, 0, { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
|
|
|
- arr.splice(isCostFlag ? 12 : 11, 0, { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 13 : 12, 0, { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 16 : 13, 0, { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 19 : 14, 0, { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isCostFlag ? 20 : 15, 0, { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
|
|
|
- }
|
|
|
- if (this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')) { // 成本
|
|
|
- const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
|
|
|
- arr.splice(isSellFlag ? 9 : 8, 0, { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isSellFlag ? 10 : 9, 0, { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
|
|
|
- arr.splice(isSellFlag ? 15 : 10, 0, { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isSellFlag ? 17 : 11, 0, { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
|
|
|
- arr.splice(isSellFlag ? 18 : 12, 0, { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
|
|
|
- }
|
|
|
- return arr
|
|
|
+
|
|
|
+ return arr.filter(item => item.show)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|