加项目成本计算逻辑
This commit is contained in:
parent
a498a44851
commit
d79b015163
|
|
@ -24,14 +24,15 @@
|
|||
"clipboard": "1.7.1",
|
||||
"codemirror": "^5.38.0",
|
||||
"connect": "3.6.6",
|
||||
"mathjs": "12.4.2",
|
||||
"echarts": "^4.1.0",
|
||||
"element-ui": "^2.15.11",
|
||||
"moment": "^2.25.3",
|
||||
"file-saver": "1.3.8",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsencrypt": "^3.0.0-rc.1",
|
||||
"jszip": "3.1.5",
|
||||
"mavon-editor": "^2.7.0",
|
||||
"moment": "^2.25.3",
|
||||
"node-sass": "^6.0.1",
|
||||
"normalize.css": "7.0.0",
|
||||
"nprogress": "0.2.0",
|
||||
|
|
@ -72,7 +73,6 @@
|
|||
"html-webpack-plugin": "^3.0.0",
|
||||
"mini-css-extract-plugin": "0.4.1",
|
||||
"node-notifier": "5.2.1",
|
||||
|
||||
"optimize-css-assets-webpack-plugin": "5.0.0",
|
||||
"ora": "3.0.0",
|
||||
"portfinder": "1.0.16",
|
||||
|
|
|
|||
|
|
@ -110,17 +110,34 @@
|
|||
<span> {{ scope.row.projectCost }}</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<af-table-column align="center" label="项目利润">
|
||||
<af-table-column align="center" label="项目毛利润">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ scope.row.projectProfit }}</span>
|
||||
<span>
|
||||
{{ maolirun(scope.row) }}
|
||||
</span>
|
||||
<!-- {{ scope.row.projectProfit }} -->
|
||||
</template>
|
||||
</af-table-column>
|
||||
<af-table-column align="center" label="项目利润率">
|
||||
<af-table-column align="center" label="项目毛利润率">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.projectProfitRate }}</span>
|
||||
<span> {{ maolirunlv(scope.row) }}</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<af-table-column align="center" label="发票成本">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ fapiaochengben(scope.row) }}</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<af-table-column align="center" label="项目净利润">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ jinglirun(scope.row) }}</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<af-table-column align="center" label="项目净利润率">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ jinglirunlv(scope.row) }}</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column align="center" label="操作" width="220">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="editBtn(scope)"
|
||||
|
|
@ -152,6 +169,11 @@ import {
|
|||
xyProjectinfoSelectBm
|
||||
} from "@/api/article";
|
||||
import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
|
||||
// 一、原来的项目利润 改成 项目毛利润 计算方式:项目毛利润=项目总金额-项目成本金额
|
||||
// 二、原来的项目利润率 改成 项目毛利润率 计算方式:项目毛利润=(项目总金额-项目成本金额)/项目总金额*100%
|
||||
// 三、发票成本=项目总金额*8%
|
||||
// 四、项目净利润=项目总金额-项目成本金额-发票成本
|
||||
// 五、项目净利润率=项目净利润/项目总金额*100%
|
||||
|
||||
export default {
|
||||
name: "ArticleList",
|
||||
|
|
@ -207,6 +229,43 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
maolirun(row) {
|
||||
const data1 = this.$math.subtract(row.xpGuessget, row.projectCost);
|
||||
|
||||
return data1.toFixed(2);
|
||||
},
|
||||
|
||||
maolirunlv(row) {
|
||||
const data1 = this.$math.subtract(row.xpGuessget, row.projectCost);
|
||||
|
||||
const data2 = this.$math.divide(data1, row.xpGuessget);
|
||||
const data3 = this.$math.multiply(data2, 100);
|
||||
if (row.xpGuessget > 0) {
|
||||
return data3.toFixed(2) + "%";
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
fapiaochengben(row) {
|
||||
const data1 = this.$math.multiply(row.xpGuessget, 0.08);
|
||||
return data1.toFixed(2);
|
||||
},
|
||||
jinglirun(row) {
|
||||
const data1 = this.maolirun(row);
|
||||
const data2 = this.fapiaochengben(row);
|
||||
const data3 = this.$math.subtract(data1, data2);
|
||||
return data3.toFixed(2);
|
||||
},
|
||||
jinglirunlv(row) {
|
||||
const data1 = this.jinglirun(row);
|
||||
const data2 = this.$math.divide(data1, row.xpGuessget);
|
||||
const data4 = this.$math.multiply(data2, 100);
|
||||
if (row.xpGuessget > 0) {
|
||||
return data4.toFixed(2) + "%";
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
searchBtn() {
|
||||
this.listQuery.page = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user