|
|
|
|
@ -250,7 +250,7 @@ import {
|
|
|
|
|
moneyFormatter
|
|
|
|
|
} from "@/utils";
|
|
|
|
|
import { listdeptNoAuth } from '@/api/system/department'
|
|
|
|
|
|
|
|
|
|
import { Decimal } from 'decimal.js'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
@ -553,16 +553,10 @@ import { listdeptNoAuth } from '@/api/system/department'
|
|
|
|
|
this.payment = res.data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
add (num1, num2) {
|
|
|
|
|
const num1Digits = (num1.toString().split('.')[1] || '').length;
|
|
|
|
|
const num2Digits = (num2.toString().split('.')[1] || '').length;
|
|
|
|
|
const baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));
|
|
|
|
|
return (num1 * baseNum + num2 * baseNum) / baseNum;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//确认审核
|
|
|
|
|
// this.add(pre, Number(cur.use_money))
|
|
|
|
|
editor() {
|
|
|
|
|
let total = this.planSelection.reduce((pre,cur) => this.add(pre, Number(cur.use_money)),0)
|
|
|
|
|
let total = this.planSelection.reduce((pre,cur) => new Decimal(pre).add(new Decimal(cur.use_money)),0).toNumber()
|
|
|
|
|
console.log(Number(this.paymentRegistrationForm.actMoney),total)
|
|
|
|
|
if (Number(this.paymentRegistrationForm.actMoney) !== total) {
|
|
|
|
|
this.$message({
|
|
|
|
|
|