소스 검색

创建项目修改

duy 7 달 전
부모
커밋
42606a8c55
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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
 },