From d789704930ef5af7e2f61ba8b6b7a19301b48d34 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Wed, 17 Jul 2024 16:39:15 +0800 Subject: [PATCH] 1 --- .../contract/components/editorContract.vue | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue index 8bddba8..1af04c4 100644 --- a/src/views/contract/components/editorContract.vue +++ b/src/views/contract/components/editorContract.vue @@ -558,8 +558,14 @@ import { listdeptNoAuth } from '@/api/system/department' { label: "计划金额", prop: 'money', + width: 136, align: 'right', - width: 120, + customFn: (row) => { + let m1 = row.money; + let m2 = row.update_money; + + return m2 == 0 ? m1 : m2; + } }, { label: "实付金额", @@ -687,20 +693,12 @@ import { listdeptNoAuth } from '@/api/system/department' row.useMoney = 0 return } - if (e <= (Number(row.money) - Number(row.has_money_total))) { - row.useMoney = e - this.plan.forEach(item => { - if (item.value.plan_id == row.id) { - item.value.use_money = e - } - }) + if ((parseFloat(e) + parseFloat(row.has_money_total)) > (parseFloat(row.update_money) || parseFloat(row.money))) { + this.$message.warning("使用金额不能大于计划金额"); + row.use_money = 0 return } - Message({ - type: 'warning', - message: '使用金额大于剩余预算' - }) - row.useMoney = 0 + row.useMoney = e }, //确认计划选择 planSelect() {