预算计划dengji

master
lion 8 months ago
parent af24351709
commit 5705d97d89

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

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

Loading…
Cancel
Save