|
@@ -149,7 +149,10 @@ export default {
|
|
[current.companyName]:subtraction(current.monthinfo[2].msale_total,current.monthinfo[2].mth_total)
|
|
[current.companyName]:subtraction(current.monthinfo[2].msale_total,current.monthinfo[2].mth_total)
|
|
}),{})
|
|
}),{})
|
|
|
|
|
|
- console.log(mapCompanySupplierSale)
|
|
|
|
|
|
+ const mapCompanySupplierSaleDay = result.data.reduce((prev,current) => ({
|
|
|
|
+ ...prev,
|
|
|
|
+ [current.companyName]:subtraction(current.dayinfo[2].sale_total,current.dayinfo[2].th_total)
|
|
|
|
+ }),{})
|
|
|
|
|
|
let tableData = (res.data || []).map(({
|
|
let tableData = (res.data || []).map(({
|
|
depart,
|
|
depart,
|
|
@@ -185,15 +188,29 @@ export default {
|
|
this.tableData = tableData.map(({depart,total_tips,dayinfo,monthinfo}) => {
|
|
this.tableData = tableData.map(({depart,total_tips,dayinfo,monthinfo}) => {
|
|
/* 月净销售 = 月销售 - 月退货 **/
|
|
/* 月净销售 = 月销售 - 月退货 **/
|
|
let monthNetSales = subtraction(monthinfo.msale_total, monthinfo.mth_total)
|
|
let monthNetSales = subtraction(monthinfo.msale_total, monthinfo.mth_total)
|
|
|
|
+ let dayNetSale = subtraction(dayinfo.sale_total,dayinfo.th_total)
|
|
|
|
|
|
const supplierSalekey = Object.keys(mapCompanySupplierSale).find(key => key.includes(depart))
|
|
const supplierSalekey = Object.keys(mapCompanySupplierSale).find(key => key.includes(depart))
|
|
|
|
+ const supplierSaleDaykey = Object.keys(mapCompanySupplierSaleDay).find(key => key.includes(depart))
|
|
|
|
+
|
|
if(supplierSalekey){
|
|
if(supplierSalekey){
|
|
monthNetSales = addition(monthNetSales,mapCompanySupplierSale[supplierSalekey])
|
|
monthNetSales = addition(monthNetSales,mapCompanySupplierSale[supplierSalekey])
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(supplierSaleDaykey){
|
|
|
|
+ dayNetSale = addition(dayNetSale,mapCompanySupplierSaleDay[supplierSaleDaykey])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if(supplierSalekey === '北京普润心堂商贸有限公司'){
|
|
if(supplierSalekey === '北京普润心堂商贸有限公司'){
|
|
monthNetSales = addition(monthNetSales,mapCompanySupplierSale['北京锦兴弘昌科技有限公司'])
|
|
monthNetSales = addition(monthNetSales,mapCompanySupplierSale['北京锦兴弘昌科技有限公司'])
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(supplierSaleDaykey === '北京普润心堂商贸有限公司'){
|
|
|
|
+ dayNetSale = addition(dayNetSale,mapCompanySupplierSaleDay['北京锦兴弘昌科技有限公司'])
|
|
|
|
+ }
|
|
|
|
+
|
|
/* 月经销售完成率 = 月净销售 / 销售指标 **/
|
|
/* 月经销售完成率 = 月净销售 / 销售指标 **/
|
|
const monthProportion = multiplication(division(monthNetSales,total_tips),100).toFixed(2)
|
|
const monthProportion = multiplication(division(monthNetSales,total_tips),100).toFixed(2)
|
|
return {
|
|
return {
|
|
@@ -202,7 +219,7 @@ export default {
|
|
dayinfo:{
|
|
dayinfo:{
|
|
...dayinfo,
|
|
...dayinfo,
|
|
/** 日销售额 = 日销售额 - 日退货额 */
|
|
/** 日销售额 = 日销售额 - 日退货额 */
|
|
- sale_total:subtraction(dayinfo.sale_total,dayinfo.th_total)
|
|
|
|
|
|
+ sale_total:dayNetSale
|
|
},
|
|
},
|
|
monthinfo:{
|
|
monthinfo:{
|
|
monthNetSales,
|
|
monthNetSales,
|