预算计划dengji

master
lion 8 months ago
parent af24351709
commit 5705d97d89

@ -527,7 +527,6 @@ export default {
let m1 = row.money_total_1; let m1 = row.money_total_1;
let m3 = row.use_money_total; let m3 = row.use_money_total;
let per = 0; let per = 0;
if (m2 != 0) { if (m2 != 0) {
per = ((m3 / m2) * 100).toFixed(2); per = ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) { } else if (m1 != 0) {

@ -393,6 +393,12 @@ import {listdeptNoAuth} from "@/api/system/department";
width: 44, width: 44,
type: 'selection' type: 'selection'
}, },
{
label: "id",
prop: 'id',
align: 'center',
width: 96,
},
{ {
label: "年份", label: "年份",
prop: 'year', prop: 'year',
@ -572,7 +578,6 @@ import {listdeptNoAuth} from "@/api/system/department";
const res = await detailFundLog({ const res = await detailFundLog({
id id
}) })
console.log(res)
this.fileList = res.files_detail?.map(i => { this.fileList = res.files_detail?.map(i => {
return { return {
url: i?.url, url: i?.url,
@ -588,18 +593,19 @@ 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) 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())
await this.moneyWayChange() await this.moneyWayChange()
}, },
// //
async getContract(info) { async getContract(info,pid) {
this.contract = info this.contract = info
const res = await getFundLog({ const res = await getFundLog({
@ -608,9 +614,10 @@ 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])
}, },
// //
@ -619,7 +626,6 @@ import {listdeptNoAuth} from "@/api/system/department";
this.paymentRegistrationForm.plan.forEach(item => { this.paymentRegistrationForm.plan.forEach(item => {
total += Number(item.use_money) total += Number(item.use_money)
}) })
console.log(Number(this.paymentRegistrationForm.actMoney).toFixed(2), total.toFixed(2))
// 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',
@ -627,6 +633,7 @@ import {listdeptNoAuth} from "@/api/system/department";
// }) // })
// return // return
// } // }
// return
editorFundLog({ editorFundLog({
id: this.registrationId, id: this.registrationId,
contract_id: this.contract.id, contract_id: this.contract.id,
@ -651,7 +658,6 @@ import {listdeptNoAuth} from "@/api/system/department";
// //
// //
async getBudgets(pid) { async getBudgets(pid) {
console.log("this.paymentRegistrationForm.applyMoney",this.paymentRegistrationForm.applyMoney)
let res = await getBudget({ let res = await getBudget({
top_pid: 1, top_pid: 1,
...this.plansSelect, ...this.plansSelect,
@ -670,9 +676,10 @@ import {listdeptNoAuth} from "@/api/system/department";
}, []); }, []);
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])
} }
}, },
planPageChange(e) { planPageChange(e) {
@ -720,16 +727,26 @@ 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)) { 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
// return true
// }
// else{
plan.use_money = this.paymentRegistrationForm.applyMoney plan.use_money = this.paymentRegistrationForm.applyMoney
// } return true
}
else{
plan.use_money = this.paymentRegistrationForm.applyMoney
}
}).forEach(row => { }).forEach(row => {
this.$refs.planTable.toggleRowSelection(row) this.$refs.planTable.toggleRowSelection(row)
this.paymentRegistrationForm.plan.push({
contract_id: this.contract.id,
plan_id: row.id,
use_money: row.use_money,
new_money: row.money,
label: row.name,
plan:row
})
}) })
} else { } else {
this.$refs.planTable.clearSelection() this.$refs.planTable.clearSelection()

Loading…
Cancel
Save