财务付款确认 默认金额

master
lion 7 months ago
parent 38fe11301f
commit 456f2a1b26

@ -214,6 +214,7 @@
</template> </template>
</xy-table> </xy-table>
</template> </template>
<template v-slot:extraFormBottom v-else> <template v-slot:extraFormBottom v-else>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<el-select <el-select
@ -245,7 +246,7 @@
style="width: 160px;margin-left: 6px;" style="width: 160px;margin-left: 6px;"
@change="(e) => (plansSelect.type = e[e.length - 1] || '')" @change="(e) => (plansSelect.type = e[e.length - 1] || '')"
/> />
<Input style="margin-left: 6px;" search enter-button=" " placeholder="搜索预算计划.." v-model="plansSelect.name" @on-search="getBudgets" /> <Input style="margin-left: 6px;" search enter-button=" " placeholder="搜索预算计划.." v-model="plansSelect.name" @on-search="getBudgets('',true)" />
</div> </div>
<div class="contract-add-plan" style="min-width: 300px;"> <div class="contract-add-plan" style="min-width: 300px;">
<template v-if="false"> <template v-if="false">
@ -680,15 +681,15 @@ import {listdeptNoAuth} from "@/api/system/department";
for (var m of res.plan_link) { for (var m of res.plan_link) {
m.label = m.plan ? m.plan.name : "无计划名称"; m.label = m.plan ? m.plan.name : "无计划名称";
} }
// this.paymentRegistrationForm.plan = res.plan_link this.paymentRegistrationForm.plan = res.plan_link
this.paymentRegistrationForm.actMoney = res.apply_money 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,res.plan_link?.map(i => i.plan_id)?.toString()) await this.getContract(res.contract,res.plan_link?.map(i => i.plan_id)?.toString())
// this.getBudgets(this.paymentRegistrationForm.plan?.map(i => i.plan_id)?.toString()) // this.getBudgets(this.paymentRegistrationForm.plan?.map(i => i.plan_id)?.toString())
// this.getBudgets(res.plan_link?.map(i => i.plan_id)?.toString()) this.getBudgets(res.plan_link?.map(i => i.plan_id)?.toString())
this.getBudgets() // this.getBudgets()
await this.moneyWayChange() await this.moneyWayChange()
}, },
@ -702,18 +703,56 @@ import {listdeptNoAuth} from "@/api/system/department";
}) })
this.payment = res.data this.payment = res.data
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => { this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
// return item.plan_id return item.plan_id
// })) }))
this.toggleSelection([pid]) // this.toggleSelection([pid])
}, },
// //
editor() { editor() {
let total = 0 console.log('this.paymentRegistrationForm.plan123',this.paymentRegistrationForm.plan,this.paymentRegistrationForm.plan_act_link_by_unit_loan)
this.paymentRegistrationForm.plan.forEach(item => {
total += Number(item.use_money) let contract_plan_act_links = []
if(this.paymentRegistrationForm.plan_act_link_by_unit_loan.length>0){
this.paymentRegistrationForm.plan_act_link_by_unit_loan.map(item=>{
item.fund_log_id = this.registrationId
})
contract_plan_act_links = this.paymentRegistrationForm.plan_act_link_by_unit_loan
}else{
//
contract_plan_act_links = [...new Map(this.paymentRegistrationForm.plan.map(item => [item.plan_id, item])).values()]
}
//
let contract_plan_act_links_filter = contract_plan_act_links.filter(i=>i.plan.pid!=0)
console.log("this.paymentRegistrationForm",this.paymentRegistrationForm)
console.log("contract_plan_act_links",contract_plan_act_links,contract_plan_act_links_filter)
if(contract_plan_act_links_filter.length<1){
Message({
type: 'warning',
message: '请选择预算计划'
})
return
}
// 0
let money0 = 0
contract_plan_act_links_filter.map(i=>{
if(parseFloat(i.use_money)<=0 || !i.use_money){
money0++
}
}) })
if(money0>0){
Message({
type: 'warning',
message: '预算计划的使用金额不能为0'
})
return
}
// let total = 0
// contract_plan_act_links_filter.forEach(item => {
// total += Number(item.use_money)
// })
// if (Number(this.paymentRegistrationForm.actMoney).toFixed(2) !== total.toFixed(2)) { // if (Number(this.paymentRegistrationForm.actMoney).toFixed(2) !== total.toFixed(2)) {
// Message({ // Message({
// type: 'warning', // type: 'warning',
@ -722,15 +761,6 @@ import {listdeptNoAuth} from "@/api/system/department";
// return // return
// } // }
// return // return
let contract_plan_act_links = []
if(this.paymentRegistrationForm.plan_act_link_by_unit_loan.length>0){
this.paymentRegistrationForm.plan_act_link_by_unit_loan.map(item=>{
item.fund_log_id = this.registrationId
})
contract_plan_act_links = this.paymentRegistrationForm.plan_act_link_by_unit_loan
}else{
contract_plan_act_links = this.paymentRegistrationForm.plan
}
editorFundLog({ editorFundLog({
id: this.registrationId, id: this.registrationId,
contract_id: this.contract.id, contract_id: this.contract.id,
@ -739,7 +769,7 @@ import {listdeptNoAuth} from "@/api/system/department";
apply_money: this.paymentRegistrationForm.applyMoney, apply_money: this.paymentRegistrationForm.applyMoney,
// discount_money: this.paymentRegistrationForm.deductionMoney, // discount_money: this.paymentRegistrationForm.deductionMoney,
// money_way_id: this.paymentRegistrationForm.moneyWay.toString(), // money_way_id: this.paymentRegistrationForm.moneyWay.toString(),
contract_plan_act_links: contract_plan_act_links, contract_plan_act_links: contract_plan_act_links_filter,
property: this.paymentRegistrationForm.property, property: this.paymentRegistrationForm.property,
property_type_id: this.paymentRegistrationForm.property_type_id, property_type_id: this.paymentRegistrationForm.property_type_id,
}).then(res => { }).then(res => {
@ -754,7 +784,12 @@ import {listdeptNoAuth} from "@/api/system/department";
// //
// //
async getBudgets(pid) { async getBudgets(pid,search) {
if(search){
this.$refs.planTable.clearSelection()
this.paymentRegistrationForm.plan = []
}
let res = await getBudget({ let res = await getBudget({
top_pid: 1, top_pid: 1,
...this.plansSelect, ...this.plansSelect,
@ -762,7 +797,8 @@ import {listdeptNoAuth} from "@/api/system/department";
}) })
if (res.list.data) { if (res.list.data) {
this.plans = res.list.data.map(i => ({ this.plans = res.list.data.map(i => ({
use_money: this.paymentRegistrationForm.applyMoney, use_money:0,
// use_money: this.paymentRegistrationForm.applyMoney,
...i ...i
})).reduce((accumulator, current) => { })).reduce((accumulator, current) => {
const duplicate = accumulator.find(item => item.id === current.id); const duplicate = accumulator.find(item => item.id === current.id);
@ -771,12 +807,13 @@ import {listdeptNoAuth} from "@/api/system/department";
} }
return accumulator; return accumulator;
}, []); }, []);
this.planTotal = res.list.total this.planTotal = res.list.total
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => { this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
// return item.plan_id return item.plan_id
// })) }))
this.toggleSelection([pid]) // this.toggleSelection([pid])
} }
}, },
planPageChange(e) { planPageChange(e) {
@ -791,7 +828,8 @@ import {listdeptNoAuth} from "@/api/system/department";
plan_id: item.id, plan_id: item.id,
use_money: item.use_money, use_money: item.use_money,
new_money: item.money, new_money: item.money,
label: item.name label: item.name,
plan:sel
} }
}); });
// //
@ -824,14 +862,20 @@ import {listdeptNoAuth} from "@/api/system/department";
toggleSelection(plans) { toggleSelection(plans) {
if (plans) { if (plans) {
this.plans.filter(plan => { this.plans.filter(plan => {
if (plans.includes(plan.pid.toString())) { // if (plans.includes(plan.pid.toString())) {
// plan.use_money = this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money // // plan.use_money = this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money
plan.use_money = this.paymentRegistrationForm.applyMoney // plan.use_money = this.paymentRegistrationForm.applyMoney
// return true
// }
// else{
// plan.use_money = this.paymentRegistrationForm.applyMoney
// }
if (plans.includes(plan.pid)) {
plan.use_money = this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money
return true return true
} }
else{ // plan.use_money = this.paymentRegistrationForm.applyMoney
plan.use_money = this.paymentRegistrationForm.applyMoney
}
}).forEach(row => { }).forEach(row => {
this.$refs.planTable.toggleRowSelection(row) this.$refs.planTable.toggleRowSelection(row)
@ -901,6 +945,11 @@ import {listdeptNoAuth} from "@/api/system/department";
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-table th.el-table-column--selection .cell .el-checkbox__inner {
display: none;
}
.payment-registration { .payment-registration {
&-row { &-row {

Loading…
Cancel
Save