|
|
|
|
@ -13,7 +13,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">合同金额</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{contract.money}}</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{moneyFormat(contract.money)}} (元)</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
@ -95,7 +95,7 @@
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为预算内确定项目
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-switch disabled v-model="paymentRegistrationForm.isLast"/>
|
|
|
|
|
<el-switch v-model="paymentRegistrationForm.isLast"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -109,13 +109,25 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:moneyWay>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>资金列支渠道
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select multiple style="width: 300px;" v-model="paymentRegistrationForm.moneyWay" placeholder="请选择资金列支渠道">
|
|
|
|
|
<el-option v-for="item in planTypes" :value="item.id" :label="item.value"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
|
<Input search enter-button="搜 索" placeholder="搜索预算计划.." v-model="searchContent" @on-search="getBudgets"/>
|
|
|
|
|
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;" ref="planTable" @select="selectPlan">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column label="使用金额" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input disabled :value="scope.row.use_money" @input="(e)=>scope.row.use_money = e"/>
|
|
|
|
|
<Input :value="scope.row.use_money" @input="inputMoney($event,scope.row)"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
@ -135,7 +147,7 @@ import {getFundLog,detailFundLog,editorFundLog} from "@/api/paymentRegistration/
|
|
|
|
|
import {getBudget} from "@/api/budget/budget";
|
|
|
|
|
import {detailContract} from "@/api/contract/contract";
|
|
|
|
|
import {Message} from "element-ui";
|
|
|
|
|
import {parseTime} from "@/utils";
|
|
|
|
|
import {parseTime,moneyFormatter} from "@/utils";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
@ -174,7 +186,8 @@ export default {
|
|
|
|
|
type:"",
|
|
|
|
|
isLast:false,
|
|
|
|
|
plan:[],
|
|
|
|
|
actMoney:''
|
|
|
|
|
actMoney:'',
|
|
|
|
|
moneyWay:'',//资金列支渠道
|
|
|
|
|
},
|
|
|
|
|
paymentRegistrationRules:{
|
|
|
|
|
applyMoney:[
|
|
|
|
|
@ -191,16 +204,16 @@ export default {
|
|
|
|
|
actMoney:[
|
|
|
|
|
{required:true,message:"必填"},
|
|
|
|
|
{pattern:/^\d+(\.\d+)?$/, message: '必须为数字'}
|
|
|
|
|
],
|
|
|
|
|
moneyWay:[
|
|
|
|
|
{required:true,message:"必填"}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
planTable:[
|
|
|
|
|
{
|
|
|
|
|
sortable:false,
|
|
|
|
|
width:36,
|
|
|
|
|
type:'selection',
|
|
|
|
|
selectable:()=>{
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
type:'selection'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"分类",
|
|
|
|
|
@ -226,6 +239,14 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
inputMoney(e,row){
|
|
|
|
|
row.useMoney = e
|
|
|
|
|
this.paymentRegistrationForm.plan.forEach(item => {
|
|
|
|
|
if(item.plan_id == row.id){
|
|
|
|
|
item.use_money = e
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getPlanTypes(){
|
|
|
|
|
const res = await getparameter({number:'money_way'})
|
|
|
|
|
this.planTypes = res.detail
|
|
|
|
|
@ -242,12 +263,12 @@ export default {
|
|
|
|
|
this.payment.map(item => {
|
|
|
|
|
total += Number(item.act_money)
|
|
|
|
|
})
|
|
|
|
|
return total.toFixed(2)
|
|
|
|
|
return moneyFormatter(total)
|
|
|
|
|
},
|
|
|
|
|
//支付占比
|
|
|
|
|
percentPay(){
|
|
|
|
|
let total = this.totalMoney()
|
|
|
|
|
return (total/this.contract.money)*100 || 0
|
|
|
|
|
return ((total/this.contract.money)*100).toFixed(2) || 0
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getRegistration(id){
|
|
|
|
|
@ -270,8 +291,6 @@ export default {
|
|
|
|
|
const res = await getFundLog({contract_id:this.contract.id})
|
|
|
|
|
this.payment = res.data
|
|
|
|
|
|
|
|
|
|
if(!this.paymentRegistrationForm.isLast) return
|
|
|
|
|
|
|
|
|
|
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
|
return item.plan_id
|
|
|
|
|
}))
|
|
|
|
|
@ -283,11 +302,12 @@ export default {
|
|
|
|
|
id:this.registrationId,
|
|
|
|
|
contract_id:this.contract.id,
|
|
|
|
|
act_money:this.paymentRegistrationForm.actMoney,
|
|
|
|
|
status:1
|
|
|
|
|
status:1,
|
|
|
|
|
money_way_id:this.paymentRegistrationForm.moneyWay.toString(),
|
|
|
|
|
contract_plan_links:this.paymentRegistrationForm.plan
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.paymentRegistrationForm.actMoney = ''
|
|
|
|
|
Message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'操作成功'
|
|
|
|
|
@ -298,14 +318,12 @@ export default {
|
|
|
|
|
//计划
|
|
|
|
|
//获取预算计划
|
|
|
|
|
async getBudgets(){
|
|
|
|
|
let res = await getBudget({name:this.searchContent,page_size:10,page:this.pageIndex})
|
|
|
|
|
let res = await getBudget({name:this.searchContent,page_size:10,page:this.plansPageIndex})
|
|
|
|
|
this.plans = res.list.data
|
|
|
|
|
this.planTotal = res.list.total
|
|
|
|
|
|
|
|
|
|
if(!this.paymentRegistrationForm.is_end) return
|
|
|
|
|
|
|
|
|
|
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
|
|
|
|
|
return item.plan_id
|
|
|
|
|
return item.value.plan_id
|
|
|
|
|
}))
|
|
|
|
|
},
|
|
|
|
|
planPageChange(e){
|
|
|
|
|
@ -325,25 +343,39 @@ export default {
|
|
|
|
|
this.paymentRegistrationForm.plan = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//默认选择计划
|
|
|
|
|
toggleSelection(plans) {
|
|
|
|
|
//console.log(this.paymentRegistrationForm)
|
|
|
|
|
if (plans) {
|
|
|
|
|
plans.map((plan,index) => {
|
|
|
|
|
let list = this.plans.map(item => {return item.id})
|
|
|
|
|
if(list.indexOf(plan) != -1){
|
|
|
|
|
this.plans[list.indexOf(plan)].use_money = this.paymentRegistrationForm.plan[index].use_money
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.plans.filter(plan => {
|
|
|
|
|
return plans.includes(plan.id)
|
|
|
|
|
if(plans.includes(plan.id)){
|
|
|
|
|
plan.useMoney = this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].value.use_money
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}).map(row => {
|
|
|
|
|
this.$refs.planTable.toggleRowSelection(row);
|
|
|
|
|
this.$refs.planTable.toggleRowSelection(row)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.planTable.clearSelection();
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed:{
|
|
|
|
|
moneyFormat(){
|
|
|
|
|
return function (money){
|
|
|
|
|
return moneyFormatter(money)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
isShow(newVal){
|
|
|
|
|
if(!newVal){
|
|
|
|
|
this.paymentRegistrationForm.actMoney = ''
|
|
|
|
|
this.paymentRegistrationForm.moneyWay = ''
|
|
|
|
|
this.paymentRegistrationForm.plan = []
|
|
|
|
|
this.$refs.planTable.clearSelection()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
await this.getBudgets()
|
|
|
|
|
await this.getPlanTypes()
|
|
|
|
|
|