lion 9 months ago
commit 5cda7a307c

@ -234,7 +234,7 @@
<Input style="margin-left: 6px;" search enter-button=" " placeholder="搜索预算计划.." v-model="plansSelect.name" @on-search="getBudgets" />
</div>
<div class="contract-add-plan" style="min-width: 300px;">
<template v-if="paymentRegistrationForm.plan.length > 0">
<template v-if="false">
<template v-for="item in paymentRegistrationForm.plan">
<Tag closable color="primary" @on-close="delPlan(item)">{{item.label}}</Tag>
</template>
@ -401,22 +401,38 @@ import {listdeptNoAuth} from "@/api/system/department";
label: "分类",
width: 136,
prop: 'type_detail.value',
formatter: (row, column, value) => {
const findVal = (arr, id) => {
for (let i = 0;i < arr.length;i++) {
if (i.id === id) {
return arr[i].name
} else if (arr.children instanceof Array) {
findVal(arr.children, id)
}
}
}
return value ? value : findVal(this.planTypes, row.type_id)
}
},
{
label: "科室",
prop: 'plan_department.name',
width: 140,
align: 'center',
formatter: (row, column, value) => {
return value ? value : this.departments.find(i => i.id === row.department_id)?.name
}
},
{
label: "科室",
prop: 'plan_department.name',
width: 100,
align: 'center'
}, {
label: "隶属",
prop: 'pid_info.name',
width: 180,
align: 'left'
},
// {
// label: "",
// prop: 'pid_info.name',
// width: 180,
// align: 'left'
// },
{
label: "名称",
prop: 'name',
width: 280,
width: 280,
align: 'left'
},
@ -486,7 +502,7 @@ import {listdeptNoAuth} from "@/api/system/department";
});
this.plansSelect[`type`]=_arr +'';
}
this.getBudgets()
// this.getBudgets()
},
inputMoney(e, row) {
@ -575,6 +591,7 @@ import {listdeptNoAuth} from "@/api/system/department";
this.paymentRegistrationForm.actMoney = res.apply_money
this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',').map(item => Number(item))
this.getBudgets()
await this.getContract(res.contract)
await this.moneyWayChange()
},
@ -641,15 +658,29 @@ import {listdeptNoAuth} from "@/api/system/department";
//
async getBudgets() {
let res = await getBudget({
top_pid: 1,
top_pid: 0,
...this.plansSelect
})
this.plans = res.list.data
this.planTotal = res.list.total
if (res.list.data) {
this.plans = [...this.paymentRegistrationForm.plan.map(i => ({
use_money: i.use_money,
...i.plan
})), ...res.list.data.map(i => ({
use_money: 0,
...i
}))].reduce((accumulator, current) => {
const duplicate = accumulator.find(item => item.id === current.id);
if (!duplicate) {
return accumulator.concat([current]);
}
return accumulator;
}, []);
this.planTotal = res.list.total
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id
}))
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id
}))
}
},
planPageChange(e) {
this.plansSelect.page = e

Loading…
Cancel
Save