|
@@ -170,7 +170,7 @@
|
|
|
<span slot="content">
|
|
|
填写年度,例如填写2025年时,计算年份为2024年、2023年、2022年
|
|
|
</span>
|
|
|
- <i class="el-icon-question" /><!--小问号提示-->
|
|
|
+ <i class="el-icon-question" />
|
|
|
</el-tooltip>
|
|
|
</span>
|
|
|
<div style="display: flex; align-items: center">
|
|
@@ -210,9 +210,13 @@
|
|
|
<el-tooltip
|
|
|
class="item"
|
|
|
effect="dark"
|
|
|
- content="表单中填入的新增企业近三年亩均产值"
|
|
|
+ content="新增企业的年均亩均产值=表单中填入的新增企业近三年亩均产值"
|
|
|
placement="top"
|
|
|
>
|
|
|
+ <span slot="content">
|
|
|
+ ①新增企业的年均亩均产值=表单中填入的新增企业近三年亩均产值<br />
|
|
|
+ ②其他企业的年均亩均产值=(去年亩均产值+前年亩均产值+大前年亩均产值)/3<br />
|
|
|
+ </span>
|
|
|
<span>年均亩均产值</span>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
@@ -249,9 +253,13 @@
|
|
|
<el-tooltip
|
|
|
class="item"
|
|
|
effect="dark"
|
|
|
- content="表单中填入的新增企业近三年亩均税收"
|
|
|
+ content=""
|
|
|
placement="top"
|
|
|
>
|
|
|
+ <span slot="content">
|
|
|
+ ①新增企业的年均亩均税收=表单中填入的新增企业近三年亩均税收<br />
|
|
|
+ ②其他企业的年均亩均税收=(去年亩均税收+前年亩均税收+大前年亩均税收)/3<br />
|
|
|
+ </span>
|
|
|
<span>年均亩均税收</span>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
@@ -435,6 +443,7 @@ export default {
|
|
|
])
|
|
|
.then(() => {
|
|
|
// console.log("All data fetched successfully");
|
|
|
+ this.form.year = new Date().getFullYear();
|
|
|
this.initChart();
|
|
|
})
|
|
|
.catch((error) => {
|
|
@@ -489,17 +498,6 @@ export default {
|
|
|
return item ? item.name : null;
|
|
|
},
|
|
|
submitForm() {
|
|
|
- // this.form
|
|
|
- // {
|
|
|
- // annualOutputValue: null,
|
|
|
- // taxPaid: null,
|
|
|
- // landArea: null,
|
|
|
- // typeNum: null,
|
|
|
- // code: "3252",
|
|
|
- // year: 2025,
|
|
|
- // averageOutputValuePerMuInRecentThreeYears: 22,
|
|
|
- // averageTaxPerMuInRecentThreeYears: 22,
|
|
|
- // }
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
const loading = this.$loading({
|
|
@@ -519,16 +517,13 @@ export default {
|
|
|
this.BaseData.push({
|
|
|
id: "新企业",
|
|
|
typeNum: this.form.typeNum,
|
|
|
- enterpriseName: "新企业",
|
|
|
- landUsedInRecentThreeYears: this.form.landArea,
|
|
|
- averageAnnualOutputValue: this.form.annualOutputValue,
|
|
|
- averageAnnualTaxPaid: this.form.taxPaid,
|
|
|
+ enterpriseName: "新企业"
|
|
|
});
|
|
|
this.updateChart();
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- loading.close();
|
|
|
+ // loading.close();
|
|
|
console.log("error submit!!");
|
|
|
}
|
|
|
});
|
|
@@ -549,7 +544,7 @@ export default {
|
|
|
}
|
|
|
// 更新图表数据
|
|
|
that.chartData = that.handleData(that.BaseData);
|
|
|
- // console.log(that.chartData);
|
|
|
+ console.log(that.chartData);
|
|
|
// console.log(that.chartData);
|
|
|
that.tableData = [];
|
|
|
let totalValues = that.chartData
|
|
@@ -688,7 +683,7 @@ export default {
|
|
|
const xAxisLabel = params[0].axisValueLabel; // x轴的标签
|
|
|
const yAxisLabel = params[0].seriesName;
|
|
|
// 构建自定义的 tooltip 内容,包含年份
|
|
|
- return `${xAxisLabel}</br> ${yAxisLabel}: ${value} `;
|
|
|
+ return `${xAxisLabel}</br> 企业数量: ${value} `;
|
|
|
},
|
|
|
},
|
|
|
legend: {
|
|
@@ -791,54 +786,153 @@ export default {
|
|
|
// 计算亩均产值得分、亩均税收得分、企业综合得分
|
|
|
handleData(data) {
|
|
|
return data.map((item) => {
|
|
|
- // 使用Decimal进行高精度计算
|
|
|
- const averageAnnualOutputValue = new Decimal(
|
|
|
- item.averageAnnualOutputValue || 0
|
|
|
- );
|
|
|
- const averageAnnualTaxPaid = new Decimal(
|
|
|
- item.averageAnnualTaxPaid || 0
|
|
|
- );
|
|
|
- const landArea = new Decimal(item.landUsedInRecentThreeYears || 0);
|
|
|
-
|
|
|
- // 计算亩均产值
|
|
|
- let output = landArea.gt(0)
|
|
|
- ? averageAnnualOutputValue.dividedBy(landArea)
|
|
|
+ const quNianTax = new Decimal(item.quNianTax || 0);
|
|
|
+ const quNianArea = new Decimal(item.quNianArea || 0);
|
|
|
+ const quNianInd = new Decimal(item.quNianInd || 0);
|
|
|
+
|
|
|
+ const qianNianTax = new Decimal(item.qianNianTax || 0);
|
|
|
+ const qianNianArea = new Decimal(item.qianNianArea || 0);
|
|
|
+ const qianNianInd = new Decimal(item.qianNianInd || 0);
|
|
|
+
|
|
|
+ const daQianNianTax = new Decimal(item.daQianNianTax || 0);
|
|
|
+ const daQianNianArea = new Decimal(item.daQianNianArea || 0);
|
|
|
+ const daQianNianInd = new Decimal(item.daQianNianInd || 0);
|
|
|
+
|
|
|
+ // 计算去年亩均产值 quNianChanZhi、去年亩均税收 quNianShuiShou;
|
|
|
+ const quNianChanZhi = quNianArea.gt(0)
|
|
|
+ ? quNianInd.dividedBy(quNianArea)
|
|
|
+ : new Decimal(0);
|
|
|
+ const quNianShuiShou = quNianArea.gt(0)
|
|
|
+ ? quNianTax.dividedBy(quNianArea)
|
|
|
+ : new Decimal(0);
|
|
|
+ // 计算前年亩均产值 qianNianChanZhi、亩均税收 qianNianShuiShou;
|
|
|
+ // 计算大前年的亩均产值 daQianNianChanZhi、亩均税收 daQianNianShuiShou
|
|
|
+ // 计算近三年的亩均产值 avgChanZhi = (quNianChanZhi + qianNianChanZhi + daQianNianChanZhi)/3 如果其中有数据为0,则不参与计算,即avgChanZhi = (quNianChanZhi + qianNianChanZhi)/2
|
|
|
+ // 计算近三年的亩均税收 avgShuiShou = (quNianShuiShou + qianNianShuiShou + daQianNianShuiShou)/3 如果其中有数据为0,则不参与计算,即avgShuiShou = (quNianShuiShou + qianNianShuiShou)/2
|
|
|
+ // 计算亩均产值得分 outputScore = avgChanZhi / BaseA * 40 如果outputScore计算结果大于40,则outputScore = 40
|
|
|
+ // 计算亩均税收得分 taxpaidScore = avgShuiShou / BaseB * 60 如果taxpaidScore计算结果大于60,则taxpaidScore = 60
|
|
|
+ // 计算企业综合得分 scoreTotal = outputScore + taxpaidScore
|
|
|
+ // 计算前年的亩均产值和税收
|
|
|
+ const qianNianChanZhi = qianNianArea.gt(0)
|
|
|
+ ? qianNianInd.dividedBy(qianNianArea)
|
|
|
+ : new Decimal(0);
|
|
|
+ const qianNianShuiShou = qianNianArea.gt(0)
|
|
|
+ ? qianNianTax.dividedBy(qianNianArea)
|
|
|
+ : new Decimal(0);
|
|
|
+
|
|
|
+ // 计算大前年的亩均产值和税收
|
|
|
+ const daQianNianChanZhi = daQianNianArea.gt(0)
|
|
|
+ ? daQianNianInd.dividedBy(daQianNianArea)
|
|
|
+ : new Decimal(0);
|
|
|
+ const daQianNianShuiShou = daQianNianArea.gt(0)
|
|
|
+ ? daQianNianTax.dividedBy(daQianNianArea)
|
|
|
: new Decimal(0);
|
|
|
|
|
|
- // 计算亩均税收
|
|
|
- let tax = landArea.gt(0)
|
|
|
- ? averageAnnualTaxPaid.dividedBy(landArea)
|
|
|
+ // 计算近三年平均亩均产值
|
|
|
+ const validChanZhiValues = [quNianChanZhi, qianNianChanZhi, daQianNianChanZhi].filter(v => v.gt(0));
|
|
|
+ let avgChanZhi = validChanZhiValues.length > 0
|
|
|
+ ? validChanZhiValues.reduce((sum, val) => sum.plus(val), new Decimal(0)).dividedBy(validChanZhiValues.length)
|
|
|
: new Decimal(0);
|
|
|
|
|
|
+ // 计算近三年平均亩均税收
|
|
|
+ const validShuiShouValues = [quNianShuiShou, qianNianShuiShou, daQianNianShuiShou].filter(v => v.gt(0));
|
|
|
+ let avgShuiShou = validShuiShouValues.length > 0
|
|
|
+ ? validShuiShouValues.reduce((sum, val) => sum.plus(val), new Decimal(0)).dividedBy(validShuiShouValues.length)
|
|
|
+ : new Decimal(0);
|
|
|
+
|
|
|
+ // 计算近三年年均使用土地面积(排除0值)
|
|
|
+ const validLandValues = [quNianArea, qianNianArea, daQianNianArea].filter(v => v.gt(0));
|
|
|
+ let landUsedInRecentThreeYears = validLandValues.length > 0
|
|
|
+ ? validLandValues.reduce((sum, val) => sum.plus(val), new Decimal(0)).dividedBy(validLandValues.length)
|
|
|
+ : new Decimal(0);
|
|
|
+
|
|
|
+ // 计算近三年年均产值(排除0值)
|
|
|
+ const validOutputValues = [quNianInd, qianNianInd, daQianNianInd].filter(v => v.gt(0));
|
|
|
+ let averageAnnualOutputValue = validOutputValues.length > 0
|
|
|
+ ? validOutputValues.reduce((sum, val) => sum.plus(val), new Decimal(0)).dividedBy(validOutputValues.length)
|
|
|
+ : new Decimal(0);
|
|
|
+
|
|
|
+ // 计算近三年年均税金(排除0值)
|
|
|
+ const validTaxValues = [quNianTax, qianNianTax, daQianNianTax].filter(v => v.gt(0));
|
|
|
+ let averageAnnualTaxPaid = validTaxValues.length > 0
|
|
|
+ ? validTaxValues.reduce((sum, val) => sum.plus(val), new Decimal(0)).dividedBy(validTaxValues.length)
|
|
|
+ : new Decimal(0);
|
|
|
+
|
|
|
+ // 如果是新企业,则直接拿form中的数据
|
|
|
if (item.id === "新企业") {
|
|
|
- output = new Decimal(
|
|
|
+ avgChanZhi = new Decimal(
|
|
|
this.form.averageOutputValuePerMuInRecentThreeYears
|
|
|
);
|
|
|
- tax = new Decimal(this.form.averageTaxPerMuInRecentThreeYears);
|
|
|
+ avgShuiShou = new Decimal(this.form.averageTaxPerMuInRecentThreeYears);
|
|
|
+ landUsedInRecentThreeYears = new Decimal(this.form.landArea);
|
|
|
+ averageAnnualOutputValue = new Decimal(this.form.annualOutputValue);
|
|
|
+ averageAnnualTaxPaid = new Decimal(this.form.taxPaid);
|
|
|
}
|
|
|
|
|
|
- // 计算得分
|
|
|
- let outputScore = output.dividedBy(this.BaseA).times(40);
|
|
|
- let taxpaidScore = tax.dividedBy(this.BaseB).times(60);
|
|
|
-
|
|
|
- // 限制得分不超过最大值
|
|
|
+ // 计算亩均产值得分(上限40)
|
|
|
+ let outputScore = avgChanZhi.dividedBy(this.BaseA).times(40);
|
|
|
outputScore = outputScore.gt(40) ? new Decimal(40) : outputScore;
|
|
|
+
|
|
|
+ // 计算亩均税收得分(上限60)
|
|
|
+ let taxpaidScore = avgShuiShou.dividedBy(this.BaseB).times(60);
|
|
|
taxpaidScore = taxpaidScore.gt(60) ? new Decimal(60) : taxpaidScore;
|
|
|
|
|
|
- // 计算总分
|
|
|
+ // 计算综合得分
|
|
|
const scoreTotal = outputScore.plus(taxpaidScore);
|
|
|
-
|
|
|
if (item.id === "新企业") {
|
|
|
this.newScore = scoreTotal.toNumber();
|
|
|
}
|
|
|
-
|
|
|
+ // console.log(item.enterpriseName,avgChanZhi.toNumber(),avgShuiShou.toNumber(),outputScore.toNumber(),taxpaidScore.toNumber(),scoreTotal.toNumber())
|
|
|
+ // 使用Decimal进行高精度计算
|
|
|
+ // const averageAnnualOutputValue = new Decimal(
|
|
|
+ // item.averageAnnualOutputValue || 0
|
|
|
+ // );
|
|
|
+ // const averageAnnualTaxPaid = new Decimal(
|
|
|
+ // item.averageAnnualTaxPaid || 0
|
|
|
+ // );
|
|
|
+ // const landArea = new Decimal(item.landUsedInRecentThreeYears || 0);
|
|
|
+
|
|
|
+ // // 计算亩均产值
|
|
|
+ // let output = landArea.gt(0)
|
|
|
+ // ? averageAnnualOutputValue.dividedBy(landArea)
|
|
|
+ // : new Decimal(0);
|
|
|
+
|
|
|
+ // // 计算亩均税收
|
|
|
+ // let tax = landArea.gt(0)
|
|
|
+ // ? averageAnnualTaxPaid.dividedBy(landArea)
|
|
|
+ // : new Decimal(0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // // 计算得分
|
|
|
+ // let outputScore = output.dividedBy(this.BaseA).times(40);
|
|
|
+ // let taxpaidScore = tax.dividedBy(this.BaseB).times(60);
|
|
|
+
|
|
|
+ // // 限制得分不超过最大值
|
|
|
+ // outputScore = outputScore.gt(40) ? new Decimal(40) : outputScore;
|
|
|
+ // taxpaidScore = taxpaidScore.gt(60) ? new Decimal(60) : taxpaidScore;
|
|
|
+
|
|
|
+ // // 计算总分
|
|
|
+ // const scoreTotal = outputScore.plus(taxpaidScore);
|
|
|
+
|
|
|
+ // if (item.id === "新企业") {
|
|
|
+ // this.newScore = scoreTotal.toNumber();
|
|
|
+ // }
|
|
|
+ // output: output.toNumber(),
|
|
|
+ // tax: tax.toNumber(),
|
|
|
+ // outputScore: outputScore.toNumber(),
|
|
|
+ // taxpaidScore: taxpaidScore.toNumber(),
|
|
|
+ // scoreTotal: scoreTotal.toNumber(),
|
|
|
return {
|
|
|
...item,
|
|
|
- output: output.toNumber(),
|
|
|
- tax: tax.toNumber(),
|
|
|
- outputScore: outputScore.toNumber(),
|
|
|
- taxpaidScore: taxpaidScore.toNumber(),
|
|
|
- scoreTotal: scoreTotal.toNumber(),
|
|
|
+ landUsedInRecentThreeYears: landUsedInRecentThreeYears.toNumber(),
|
|
|
+ averageAnnualOutputValue: averageAnnualOutputValue.toNumber(),
|
|
|
+ averageAnnualTaxPaid: averageAnnualTaxPaid.toNumber(),
|
|
|
+ output: avgChanZhi.toNumber(), //亩均产值
|
|
|
+ tax: avgShuiShou.toNumber(), //亩均税收
|
|
|
+ outputScore: outputScore.toNumber(), //亩均产值得分
|
|
|
+ taxpaidScore: taxpaidScore.toNumber(),//亩均税收得分
|
|
|
+ scoreTotal: scoreTotal.toNumber(),//综合得分
|
|
|
};
|
|
|
});
|
|
|
},
|