Переглянути джерело

1.修复虚拟加载导致的批量赋值经济使用年限未加载的数据无直接观察成新率
2.修复参考信息设置错误的问题

GouGengquan 2 місяців тому
батько
коміт
da7c2c1939

+ 14 - 7
src/views/assets/workbench/eqpt/calculate/importInfo.vue

@@ -1628,9 +1628,15 @@ export default {
     // 计算直接观察成新率(操作Table Row数据)
     countDepreciationRate(row) {
       row.depreciationRateByAge =
-        (row.economicServiceLife - row.yearsInUse) / row.economicServiceLife < 0.15
-          ? ((row.remainingUsefulLife * 1) / (row.yearsInUse * 1 + row.remainingUsefulLife * 1)).toFixed(2) * 100
-          : ((row.economicServiceLife - row.yearsInUse) / row.economicServiceLife).toFixed(2) * 100
+        (row.economicServiceLife - (getDaysBetween(row.activationDate,
+              this.calculateBaseInfo.valuationBasisDate) /
+              365).toFixed(2)) / row.economicServiceLife < 0.15
+          ? ((row.remainingUsefulLife * 1) / ((getDaysBetween(row.activationDate,
+              this.calculateBaseInfo.valuationBasisDate) /
+              365).toFixed(2) * 1 + row.remainingUsefulLife * 1)).toFixed(2) * 100
+          : ((row.economicServiceLife - (getDaysBetween(row.activationDate,
+              this.calculateBaseInfo.valuationBasisDate) /
+              365).toFixed(2)) / row.economicServiceLife).toFixed(2) * 100
       /**
        * 年限成新率个位<=2成新率个位为0不进位
        * 年限成新率个位>=8个位为0进一位
@@ -1809,13 +1815,14 @@ export default {
     mostSimilar() {
       for (let index = 0; index < this.eqptPageData.length; index++) {
         for (const item of this.eqptLifeIfrRefs) {
-          if (this.eqptPageData[index].equipmentName.includes(item.type) && this.eqptPageData[index].economicServiceLife && this.eqptPageData[index].installationRate) {
-            this.eqptPageData[index].economicServiceLife = item.lifeRecommendedValue
-            this.eqptPageData[index].installationRate = item.ifrRecommendedValue
+          // 判断设备名称包含type名称且经济使用年限与安装费率是否为空
+          if (this.eqptPageData[index].equipmentName.includes(item.type) && !this.eqptPageData[index].economicServiceLife && !this.eqptPageData[index].installationRate) {
+            this.eqptPageData[index].economicServiceLife = item.lifeRecommendedValue;
+            this.eqptPageData[index].installationRate = item.ifrRecommendedValue;
             // 计算年限成新率
             this.eqptPageData[index].yearsInUse = (
               this.getDaysBetween(this.eqptPageData[index].activationDate, this.calculateBaseInfo.valuationBasisDate) / 365
-            ).toFixed(2)
+            ).toFixed(2);
             this.eqptPageData[index].depreciationRateByAge =
               ((this.eqptPageData[index].economicServiceLife * 1 - this.eqptPageData[index].yearsInUse * 1) /
                 this.eqptPageData[index].economicServiceLife) *