duy 7 mesiacov pred
rodič
commit
42606a8c55
1 zmenil súbory, kde vykonal 5 pridanie a 2 odobranie
  1. 5 2
      src/views/project/admin/create.vue

+ 5 - 2
src/views/project/admin/create.vue

@@ -176,6 +176,7 @@ import { isNullES } from 'js-fast-way'
 import { arrIndex, formValidate, getArrValue, getObjValue } from 'js-fast-way'
 import mainApi from '~api/project/project'
 import { getDictionaryData } from '~src/utils/tools'
+import BigNumber from 'bignumber.js'
 
 const props = defineProps({
     form: {
@@ -375,9 +376,11 @@ yearOptions.value[selectIndex.value].yearForm.fourInvest,
     } else {
         isChangeyearlyInvest.value = false
     }
-    yearOptions.value[selectIndex.value].yearForm.yearlyInvest = Number(key2) + Number(key3) + Number(key4) + Number(key5)
+    // yearOptions.value[selectIndex.value].yearForm.yearlyInvest = Number(key2) + Number(key3) + Number(key4) + Number(key5)
+    yearOptions.value[selectIndex.value].yearForm.yearlyInvest = ( BigNumber( Number(key2)) .plus (BigNumber(Number(key3))) .plus (BigNumber( Number(key4))) .plus (BigNumber(Number(key5)))).toNumber()
     const totalYearlyInvest = yearOptions.value.reduce((accumulator, currentValue) => {
-        return accumulator + currentValue.yearForm.yearlyInvest
+        // return accumulator + currentValue.yearForm.yearlyInvest
+        return BigNumber(Number(accumulator)).plus(BigNumber(Number(currentValue.yearForm.yearlyInvest))).toNumber()
     }, 0)
     baseForm.value.allInvestMoney = totalYearlyInvest
 },