From 2165dd66bdfca973835ea8905667836fe07ac329 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Tue, 30 Apr 2024 18:14:51 +0800 Subject: [PATCH] 1 --- .../components/detailPaymentRegistration.vue | 25 ++++--------------- .../components/examineRegistration.vue | 25 ++++--------------- .../components/paymentRegistration.vue | 15 +++++------ src/views/contract/contractEdit.vue | 7 +++--- src/views/contract/contractProgress.vue | 22 ++++++---------- .../components/examineRegistration.vue | 11 +++++--- src/views/finance/paymentRegistrationList.vue | 3 +++ 7 files changed, 39 insertions(+), 69 deletions(-) diff --git a/src/views/contract/components/detailPaymentRegistration.vue b/src/views/contract/components/detailPaymentRegistration.vue index 859533d..67e36ce 100644 --- a/src/views/contract/components/detailPaymentRegistration.vue +++ b/src/views/contract/components/detailPaymentRegistration.vue @@ -152,25 +152,7 @@ }, { label: "分类", - prop: 'type', - formatter: (cell, data, value) => { - switch (value) { - case 1: - return "部门预算" - break; - case 2: - return "水务计划" - break; - case 3: - return '补助经费' - break; - case 4: - return '其他' - break; - default: - return "未知" - } - } + prop: 'type_detail.value', }, { label: "名称", @@ -180,7 +162,10 @@ { label: "计划金额", prop: 'money', - align: 'right' + align: 'right', + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } } ], rules: { diff --git a/src/views/contract/components/examineRegistration.vue b/src/views/contract/components/examineRegistration.vue index 4693829..652a802 100644 --- a/src/views/contract/components/examineRegistration.vue +++ b/src/views/contract/components/examineRegistration.vue @@ -199,25 +199,7 @@ export default { }, { label:"分类", - prop:'type', - formatter:(cell,data,value)=>{ - switch (value){ - case 1: - return "部门预算" - break; - case 2: - return "水务计划" - break; - case 3: - return '补助经费' - break; - case 4: - return '其他' - break; - default: - return "未知" - } - } + prop: 'type_detail.value', }, { label:"名称", @@ -227,7 +209,10 @@ export default { { label:"计划金额", prop:'money', - align:'right' + align:'right', + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } } ], } diff --git a/src/views/contract/components/paymentRegistration.vue b/src/views/contract/components/paymentRegistration.vue index 02407da..19461ed 100644 --- a/src/views/contract/components/paymentRegistration.vue +++ b/src/views/contract/components/paymentRegistration.vue @@ -323,7 +323,7 @@ export default { isLast: false, plan: [], remark: "", - files: [] + //files: [] }, form: { audit_money: 0, @@ -364,13 +364,7 @@ export default { }, { label: "分类", - prop: "type", - formatter: (cell, data, value) => { - let res = this.planTypes.filter((item) => { - return item.id === value; - }); - return res[0]?.value || "未知"; - }, + prop: "type_detail.value" }, { label: "名称", @@ -381,6 +375,9 @@ export default { label: "计划金额", prop: "money", align: "right", + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } }, ], }; @@ -490,7 +487,7 @@ export default { remark: this.paymentRegistrationForm.remark, audit_money: '', //audit_money: this.paymentRegistrationForm.audit_money, - files:this.fileList? this.fileList.map(i => i?.response?.id):[] + //files:this.fileList? this.fileList.map(i => i?.response?.id):[] }; addFundLog(data).then((res) => { //付款申请后同时更新一下合同中审计金额 diff --git a/src/views/contract/contractEdit.vue b/src/views/contract/contractEdit.vue index fe98fa1..d7009ac 100644 --- a/src/views/contract/contractEdit.vue +++ b/src/views/contract/contractEdit.vue @@ -1121,8 +1121,9 @@ export default { prop: "money", align: "right", width: 120, - formatter: (v1, v2, value) => - value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "", + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } }, { label: "实付金额", @@ -1296,7 +1297,7 @@ export default { }); return; } - if (i._inputMoney > Number(i.money) - Number(i.has_money_total)) { + if (i._inputMoney > ((Number(i.money) || Number(i.update_money)) - Number(i.has_money_total))) { this.$message({ type: "warning", message: `【${i.year}】${i.name} 使用金额大于剩余预算!`, diff --git a/src/views/contract/contractProgress.vue b/src/views/contract/contractProgress.vue index 3deb710..1170aa6 100644 --- a/src/views/contract/contractProgress.vue +++ b/src/views/contract/contractProgress.vue @@ -841,13 +841,7 @@ export default { planTableSearch: [ { label: "分类", - prop: "type", - formatter: (cell, data, value) => { - let res = this.moneyWay.filter((item) => { - return item.id === value; - }); - return res[0]?.value || "未知"; - }, + prop: "type_detail.value", }, { label: "年份", @@ -863,6 +857,9 @@ export default { label: "计划金额", prop: "money", align: "right", + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } }, ], planTable: [ @@ -874,13 +871,7 @@ export default { }, { label: "分类", - prop: "type", - formatter: (cell, data, value) => { - let res = this.moneyWay.filter((item) => { - return item.id === value; - }); - return res[0]?.value || "未知"; - }, + prop: "type_detail.value", width: 100, fixed: "left", }, @@ -908,6 +899,9 @@ export default { prop: "money", align: "right", width: 120, + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } }, ], diff --git a/src/views/finance/components/examineRegistration.vue b/src/views/finance/components/examineRegistration.vue index 1505330..160a5ae 100644 --- a/src/views/finance/components/examineRegistration.vue +++ b/src/views/finance/components/examineRegistration.vue @@ -395,7 +395,7 @@ import { listdeptNoAuth } from '@/api/system/department' }, { label: "已经使用", - prop: 'use_money_total', + prop: 'has_money_total', width: 136, align: 'right', } @@ -441,12 +441,17 @@ import { listdeptNoAuth } from '@/api/system/department' }, inputMoney(e, row) { + if ((parseFloat(e) + parseFloat(row.has_money_total)) > (parseFloat(row.money) || parseFloat(row.update_money))) { + this.$message.warning("使用金额不能大于计划金额"); + return + } row.use_money = e this.paymentRegistrationForm.plan.forEach(item => { if (item.plan_id == row.id) { item.use_money = e } }) + }, async getPlanTypes() { const res = await getparameterTree({ @@ -523,10 +528,10 @@ import { listdeptNoAuth } from '@/api/system/department' this.paymentRegistrationForm.plan = res.plan_link this.paymentRegistrationForm.actMoney = res.apply_money - this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',').map(item => Number(item)) + this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',')?.map(item => Number(item)) await this.getContract(res.contract) - await this.moneyWayChange() + await this.moneyWayChange(this.paymentRegistrationForm.moneyWay) }, //获取合同信息 diff --git a/src/views/finance/paymentRegistrationList.vue b/src/views/finance/paymentRegistrationList.vue index bbe6a5b..0e39c0d 100644 --- a/src/views/finance/paymentRegistrationList.vue +++ b/src/views/finance/paymentRegistrationList.vue @@ -229,6 +229,9 @@ export default { prop: "money", align: "right", width: 160, + formatter: (v1, v2, value) => { + return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + } }, ], plans: [], //预算数据