加项目成本计算逻辑

This commit is contained in:
wangyan 2024-05-30 17:38:09 +08:00
parent a498a44851
commit d79b015163
2 changed files with 66 additions and 7 deletions

View File

@ -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",

View File

@ -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;