|
@@ -45,39 +45,46 @@
|
|
|
|
|
|
<el-table-column label="当日营业收入" align="center" width="95px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.companyName === '合计-元隆雅图' ? unit2TenThousand(calcAmount('sale_total'), isTenThound) : unit2TenThousand(scope.row.sale_total, isTenThound) }}
|
|
|
+ {{
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('sale_total'), isTenThound)
|
|
|
+ : unit2TenThousand(scope.row.sale_total, isTenThound) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="营收目标" align="center" min-width="95px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.companyName === '合计-元隆雅图' ? unit2TenThousand(calcAmount('total_tips'), isTenThound) : unit2TenThousand(scope.row.total_tips, isTenThound) }}
|
|
|
+ {{
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('total_tips'), isTenThound)
|
|
|
+ : unit2TenThousand(scope.row.total_tips, isTenThound)
|
|
|
+ }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="营业收入(净)" align="center" min-width="115px">
|
|
|
<template slot-scope="scope">
|
|
|
- <div style="display:flex;justify-content:center" :style="`${scope.row.companyName === '合计-元隆雅图' ? '' :getCurrentValueStyle(scope.row.msale_total, scope.row.total_tips)}`">
|
|
|
+ <div style="display:flex;justify-content:center" :style="`${isSubProp(scope.row.companyName) ? '' :getCurrentValueStyle(scope.row.msale_total, scope.row.total_tips)}`">
|
|
|
{{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('msale_total'), isTenThound)
|
|
|
- : unit2TenThousand(scope.row.msale_total, isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('msale_total'), isTenThound)
|
|
|
+ : unit2TenThousand(scope.row.msale_total, isTenThound)
|
|
|
}}
|
|
|
<el-popover placement="right" :width="200" trigger="click">
|
|
|
<div class="table-size">
|
|
|
<p>直营/自营: {{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.0.monthinfo.msale_total', true), isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('0.monthinfo.msale_total', true), isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[0].monthinfo.msale_total, isTenThound)
|
|
|
}}</p>
|
|
|
<p>支付渠道: {{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.1.monthinfo.msale_total', true), isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('1.monthinfo.msale_total', true), isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[1].monthinfo.msale_total, isTenThound)
|
|
|
}}</p>
|
|
|
<p>供应商端: {{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.2.monthinfo.msale_total', true), isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('2.monthinfo.msale_total', true), isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[2].monthinfo.msale_total, isTenThound) }}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -95,7 +102,7 @@
|
|
|
<el-table-column label="营收完成%" align="center" min-width="85px">
|
|
|
<template slot-scope="scope">
|
|
|
<div :style="`${scope.row.companyName === '合计-元隆雅图' ? '' : getCurrentRateStyle(scope.row.completion_rate)}`">
|
|
|
- {{ scope.row.companyName === '合计-元隆雅图' ? calcAmountCompletionRate() : (String(scope.row.completion_rate) === 'NaN' ? 0 : scope.row.completion_rate) + "%" }}
|
|
|
+ {{ isSubProp(scope.row) ? calcAmountCompletionRate() : isLineValue((String(scope.row.completion_rate) === 'NaN' ? 0 : scope.row.completion_rate))}}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -114,9 +121,9 @@
|
|
|
|
|
|
<el-table-column label="毛利完成" align="center" min-width="90px">
|
|
|
<template slot-scope="scope">
|
|
|
- <div :style="`${scope.row.companyName === '合计-元隆雅图' ? '' : getCurrentValueStyle(scope.row.gross_completion, scope.row.cost_tips)}`">
|
|
|
+ <div :style="`${isSubProp(scope.row) ? '' : getCurrentValueStyle(scope.row.gross_completion, scope.row.cost_tips)}`">
|
|
|
{{ costField
|
|
|
- ? scope.row.companyName === '合计-元隆雅图' ? unit2TenThousand(calcAmount('gross_completion'), isTenThound) : unit2TenThousand(scope.row.gross_completion, isTenThound)
|
|
|
+ ? isSubProp(scope.row) ? unit2TenThousand(calcAmount('gross_completion'), isTenThound) : unit2TenThousand(scope.row.gross_completion, isTenThound)
|
|
|
: '***'
|
|
|
}}
|
|
|
</div>
|
|
@@ -127,7 +134,7 @@
|
|
|
<el-table-column label="毛利完成%" align="center" min-width="85px">
|
|
|
<template slot-scope="scope">
|
|
|
<div :style="scope.row.companyName === '合计-元隆雅图' ? '' : getCurrentRateStyle(scope.row.gross_completion_rate)">
|
|
|
- {{ scope.row.companyName === '合计-元隆雅图' ? calcAmountGrossCompletionRate() : scope.row.gross_completion_rate + '%' }}
|
|
|
+ {{ isSubProp(scope.row) ? calcAmountGrossCompletionRate() : isLineValue(scope.row.gross_completion_rate) }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -136,7 +143,7 @@
|
|
|
<el-table-column label="成本合计" align="center" min-width="125px">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display:flex;justify-content:center" v-if="costField">
|
|
|
- {{ scope.row.companyName === '合计-元隆雅图'
|
|
|
+ {{ isSubProp(scope.row)
|
|
|
? unit2TenThousand(calcAmount('mcost_total'), isTenThound)
|
|
|
: unit2TenThousand(scope.row.mcost_total, isTenThound)
|
|
|
}}
|
|
@@ -144,27 +151,27 @@
|
|
|
<div class="table-size">
|
|
|
<p>直营/自营:
|
|
|
{{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.0.monthinfo.mcost_total',true),isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('0.monthinfo.mcost_total',true),isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[0].monthinfo.mcost_total, isTenThound)
|
|
|
}}
|
|
|
</p>
|
|
|
<p>支付渠道:
|
|
|
{{
|
|
|
- scope.row.companyName ==='合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.1.monthinfo.mcost_total', true), isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('1.monthinfo.mcost_total', true), isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[1].monthinfo.mcost_total, isTenThound)
|
|
|
}}</p>
|
|
|
<p>供应商端:
|
|
|
{{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.2.monthinfo.mcost_total', true),isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('2.monthinfo.mcost_total', true),isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[2].monthinfo.mcost_total, isTenThound)
|
|
|
}}</p>
|
|
|
<p>物流费用:
|
|
|
{{
|
|
|
- scope.row.companyName === '合计-元隆雅图'
|
|
|
- ? unit2TenThousand(calcAmount('0.3.monthinfo.mcost_total', true), isTenThound)
|
|
|
+ isSubProp(scope.row)
|
|
|
+ ? unit2TenThousand(calcAmount('3.monthinfo.mcost_total', true), isTenThound)
|
|
|
: unit2TenThousand(scope.row.info[3].monthinfo.mcost_total, isTenThound)
|
|
|
}}
|
|
|
</p>
|
|
@@ -183,7 +190,7 @@
|
|
|
<el-table-column label="实际毛利率" align="center" width="85px">
|
|
|
<template slot-scope="scope">
|
|
|
{{ costField
|
|
|
- ? scope.row.companyName === '合计-元隆雅图' ? calcAmountRealRate() : unit2TenThousand(scope.row.gross_sale_completion_rate) + "%"
|
|
|
+ ? isSubProp(scope.row) ? calcAmountRealRate() : unit2TenThousand(scope.row.gross_sale_completion_rate) + "%"
|
|
|
: '***'
|
|
|
}}
|
|
|
</template>
|
|
@@ -276,18 +283,21 @@ export default {
|
|
|
return Number(multiplication(Number(division(msale_total, total_tips)).toFixed(2), 100)).toFixed(2) + '%'
|
|
|
},
|
|
|
calcAmount(prop, isInfo = false){
|
|
|
- const sourceData = this.tableData.find(({companyName}) => companyName === '合计-元隆雅图')
|
|
|
+ const sourceData = this.tableData.find(({companyName}) => companyName === '北京元隆雅图文化传播股份有限公司')
|
|
|
if(!isInfo){
|
|
|
- return sourceData.children.reduce((prev,current) => {
|
|
|
- const value = Number(addition(prev,isNaN(current[prop]) ? 0 : current[prop]))
|
|
|
- return value === 0 ? 0 : value.toFixed(2)
|
|
|
- }, 0)
|
|
|
+ if(prop === 'total_tips'){
|
|
|
+ return sourceData[prop]
|
|
|
+ }
|
|
|
+
|
|
|
+ if(prop === 'cost_tips'){
|
|
|
+ return sourceData[prop]
|
|
|
+ }
|
|
|
+
|
|
|
+ return Number(subtraction(sourceData[prop], this.filterCompany[prop])).toFixed(2)
|
|
|
} else {
|
|
|
- const [i1, i2,i3, i4] = prop.split('.')
|
|
|
- return sourceData.children.reduce((prev,current) => {
|
|
|
- const value = Number(addition(prev, isNaN(current.info[i1][i2][i3][i4]) ? 0 : current.info[i1][i2][i3][i4]))
|
|
|
- return value === 0 ? 0 : value.toFixed(2)
|
|
|
- }, 0)
|
|
|
+ const [i1, i2,i3] = prop.split('.')
|
|
|
+ console.log(sourceData.info[i1][i2][i3], this.filterCompany.info[i1][i2][i3])
|
|
|
+ return Number(subtraction(sourceData.info[i1][i2][i3], this.filterCompany.info[i1][i2][i3])).toFixed(2)
|
|
|
}
|
|
|
},
|
|
|
unit2TenThousand,
|
|
@@ -309,29 +319,6 @@ export default {
|
|
|
const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
|
|
|
return Number(currentTotalTip) > Number(current) ? 'color: red' : '';
|
|
|
},
|
|
|
- addDataToCompany(c1, c2) {
|
|
|
- return {
|
|
|
- companyName: '普润',
|
|
|
- cost_tips: Number(c1.cost_tips).toFixed(2),
|
|
|
- total_tips: Number(c1.total_tips).toFixed(2),
|
|
|
- monthinfo: c1.monthinfo.map((item, index) => ({
|
|
|
- mcgd_th_total: Number(addition(item.mcgd_th_total, c2.monthinfo[index].mcgd_th_total)).toFixed(2),
|
|
|
- mcgd_total: Number(addition(item.mcgd_total, c2.monthinfo[index].mcgd_total)).toFixed(2),
|
|
|
- msale_total: Number(addition(item.msale_total, c2.monthinfo[index].msale_total)).toFixed(2),
|
|
|
- mth_total: Number(addition(item.mth_total, c2.monthinfo[index].mth_total)).toFixed(2),
|
|
|
- type: item.type
|
|
|
- })),
|
|
|
- dayinfo: c1.dayinfo.map((item, index) => {
|
|
|
- return {
|
|
|
- cgd_th_total: Number(addition(item.cgd_th_total, c2.dayinfo[index].cgd_th_total)).toFixed(2),
|
|
|
- cgd_total: Number(addition(item.cgd_total, c2.dayinfo[index].cgd_total)).toFixed(2),
|
|
|
- sale_total: Number(addition(item.sale_total, c2.dayinfo[index].sale_total)).toFixed(2),
|
|
|
- th_total: Number(addition(item.th_total, c2.dayinfo[index].th_total)).toFixed(2),
|
|
|
- type: item.type
|
|
|
- }
|
|
|
- }),
|
|
|
- }
|
|
|
- },
|
|
|
setCellClassName({ column ,row }) {
|
|
|
const { label } = column;
|
|
|
let base = ''
|
|
@@ -365,6 +352,9 @@ export default {
|
|
|
}
|
|
|
return base
|
|
|
},
|
|
|
+ isLineValue(value){
|
|
|
+ return value === '-' ? '-' : value + '%'
|
|
|
+ },
|
|
|
setHeaderClassName({ column }) {
|
|
|
const { label } = column;
|
|
|
if (label === "营收目标") return "bg__success"
|
|
@@ -431,7 +421,10 @@ export default {
|
|
|
|
|
|
/** 月营业收入 = 月销售额 - 月退货额 */
|
|
|
let msale_total = 0;
|
|
|
- if(Number(type) !== 4){ msale_total = subtraction(_monthinfo.msale_total, _monthinfo.mth_total) || 0 }
|
|
|
+ if(Number(type) !== 4){
|
|
|
+ msale_total = subtraction(_monthinfo.msale_total, isChildren ? _monthinfo.msale_th_total : _monthinfo.mth_total)
|
|
|
+ msale_total = isNaN(msale_total) ? 0 : msale_total
|
|
|
+ }
|
|
|
|
|
|
/** 日营业收入 = 日销售额 - 日退货额 */
|
|
|
const sale_total = subtraction(_dayinfo.sale_total, _dayinfo.th_total) || 0;
|
|
@@ -440,11 +433,11 @@ export default {
|
|
|
/** 月成本 = 月采购额 - 月退货额 */
|
|
|
let mcost_total = 0;
|
|
|
|
|
|
- if(Number(type) !== 4){
|
|
|
+ // if(Number(type) !== 4){
|
|
|
mcost_total = subtraction(_monthinfo.mcgd_total, _monthinfo.mcgd_th_total) || 0;
|
|
|
- }else{
|
|
|
- mcost_total = Number(_monthinfo.mcgd_total || 0).toFixed(2);
|
|
|
- }
|
|
|
+ // }else{
|
|
|
+ // mcost_total = Number(_monthinfo.mcgd_total || 0).toFixed(2);
|
|
|
+ // }
|
|
|
|
|
|
prev_sale_total = Number(addition(prev_sale_total, sale_total)).toFixed(2);
|
|
|
prev_msale_total = Number(addition(prev_msale_total, msale_total)).toFixed(2);
|
|
@@ -461,6 +454,10 @@ export default {
|
|
|
const gross_completion = Number(subtraction(prev_msale_total, prev_mcost_total)).toFixed(2) //当月毛利完成 = 月营收 - 月成本
|
|
|
|
|
|
|
|
|
+
|
|
|
+ total_tips = Number(total_tips) === 0 ? '-' : total_tips
|
|
|
+ cost_tips = Number(cost_tips) === 0 ? '-' : cost_tips
|
|
|
+
|
|
|
sourceData = [
|
|
|
...sourceData,
|
|
|
{
|
|
@@ -474,9 +471,9 @@ export default {
|
|
|
msale_total: prev_msale_total, // 当月营业收入
|
|
|
mcost_total: prev_mcost_total,// 当月成本总额
|
|
|
gross_completion, //当月毛利完成 = 月营收 - 月成本
|
|
|
- completion_rate: multiplication(division(prev_msale_total, total_tips), 100).toFixed(2), // 当月应收完成率
|
|
|
- gross_completion_rate: Number(cost_tips) === 0 ? 0 : multiplication(division(gross_completion, cost_tips) || 0, 100).toFixed(2), // 当月毛利完成率
|
|
|
- gross_sale_completion_rate: Number(multiplication(division(gross_completion, prev_msale_total) || 0, 100)).toFixed(2), // 本月毛利率 = 当月毛利完成 / 当月营业收入
|
|
|
+ completion_rate: total_tips=== '-' ? '-' : multiplication(division(prev_msale_total, total_tips), 100).toFixed(2), // 当月应收完成率
|
|
|
+ gross_completion_rate: cost_tips === '-' ? '-' : Number(cost_tips) === 0 ? 0 : multiplication(division(gross_completion, cost_tips) || 0, 100).toFixed(2), // 当月毛利完成率
|
|
|
+ gross_sale_completion_rate:Number(gross_completion) <= 0 ? 0 : Number(multiplication(Number(division(gross_completion, prev_msale_total)).toFixed(2), 100)).toFixed(2), // 本月毛利率 = 当月毛利完成 / 当月营业收入
|
|
|
}
|
|
|
]
|
|
|
})
|
|
@@ -486,11 +483,14 @@ export default {
|
|
|
|
|
|
return sourceData
|
|
|
},
|
|
|
+ isSubProp(row){
|
|
|
+ return row.companyName === '北京元隆雅图文化传播股份有限公司'
|
|
|
+ },
|
|
|
async requestData() {
|
|
|
let platformlist = await this.getData()
|
|
|
|
|
|
// 显示的公司列表
|
|
|
- let displayedCompanylist = ["北京万宇恒通国际科贸有限公司", '北京泰文创供应链管理有限公司' ,"北京元隆雅图文化传播股份有限公司"];
|
|
|
+ let displayedCompanylist = ["北京元隆雅图文化传播股份有限公司"];
|
|
|
let values = this.plat_cp_companies.map(({value}) => value)
|
|
|
const l = platformlist.map(item => item.companyName);
|
|
|
displayedCompanylist = displayedCompanylist.filter(item => l.includes(item));
|
|
@@ -499,12 +499,9 @@ export default {
|
|
|
const composeCompanyIndex = platformlist.findIndex(({ companyNo }) => companyNo === 'GS2404151642335170')
|
|
|
|
|
|
if(composeCompanyIndex !== -1){
|
|
|
-
|
|
|
const sourceData = (await this.getData({ isChildren: true }))
|
|
|
const children = sourceData.filter(({companyName}) => companyName !== '结算单E企购')
|
|
|
- this.filterCompany = sourceData.filter(({companyName}) => companyName === '结算单E企购')
|
|
|
-
|
|
|
- console.log(this.filterCompany)
|
|
|
+ this.filterCompany = sourceData.filter(({companyName}) => companyName === '结算单E企购')[0]
|
|
|
const [composeCompany] = platformlist.splice(composeCompanyIndex, 1)
|
|
|
platformlist.unshift({ hasChildren: true, children ,...composeCompany })
|
|
|
}
|