|
|
|
@ -23,7 +23,7 @@
|
|
|
|
type="year"
|
|
|
|
type="year"
|
|
|
|
placement="bottom-start"
|
|
|
|
placement="bottom-start"
|
|
|
|
style="width: 160px"
|
|
|
|
style="width: 160px"
|
|
|
|
@on-change="(e)=>select.year = e"
|
|
|
|
@on-change="(e)=>{select.year = e,getType()}"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
@ -37,7 +37,7 @@
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
style="width: 160px"
|
|
|
|
style="width: 160px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-option v-for="item in type" :key="item.id" :value="item.id" :label="item.value" />
|
|
|
|
<el-option v-for="item in type" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +97,9 @@ import {
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
getparameter
|
|
|
|
getparameter
|
|
|
|
} from '@/api/system/dictionary'
|
|
|
|
} from '@/api/system/dictionary'
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
index as getPlanType
|
|
|
|
|
|
|
|
} from '@/api/budget/plantype.js'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
moneyFormatter
|
|
|
|
moneyFormatter
|
|
|
|
} from '@/utils'
|
|
|
|
} from '@/utils'
|
|
|
|
@ -152,7 +155,10 @@ export default {
|
|
|
|
prop: 'update_money',
|
|
|
|
prop: 'update_money',
|
|
|
|
width: 180,
|
|
|
|
width: 180,
|
|
|
|
label: '调整后预算数(元)',
|
|
|
|
label: '调整后预算数(元)',
|
|
|
|
align: 'right'
|
|
|
|
align: 'right',
|
|
|
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
|
|
|
return moneyFormatter(value)
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
prop: 'use_money_total',
|
|
|
|
prop: 'use_money_total',
|
|
|
|
@ -184,7 +190,7 @@ export default {
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
fixed: 'right',
|
|
|
|
fixed: 'right',
|
|
|
|
customFn: (row) => {
|
|
|
|
customFn: (row) => {
|
|
|
|
const per = (isNaN(Number(row.use_money_total ?? 0)) ? 0 : Number(row.use_money_total ?? 0)) / ((Number(row.update_money)) || (Number(row.money)))
|
|
|
|
const per = (isNaN(Number(row.use_money_total ?? 0)) ? 0 : Number(row.use_money_total ?? 0)) / ((Number(row.update_money||0)) || (Number(row.money)))
|
|
|
|
return (<div>
|
|
|
|
return (<div>
|
|
|
|
<el-progress percentage = {
|
|
|
|
<el-progress percentage = {
|
|
|
|
Number((per * 100).toFixed(2))
|
|
|
|
Number((per * 100).toFixed(2))
|
|
|
|
@ -200,7 +206,7 @@ export default {
|
|
|
|
const res = this.type.filter(item => {
|
|
|
|
const res = this.type.filter(item => {
|
|
|
|
return item.id === value
|
|
|
|
return item.id === value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return res[0]?.value || '未知'
|
|
|
|
return res[0]?.name || '未知'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -296,10 +302,21 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
async getType() {
|
|
|
|
async getType() {
|
|
|
|
const res = await getparameter({
|
|
|
|
{/* const res = await getparameter({
|
|
|
|
number: 'money_way'
|
|
|
|
number: 'money_way'
|
|
|
|
|
|
|
|
}) */}
|
|
|
|
|
|
|
|
const res = await getPlanType({
|
|
|
|
|
|
|
|
page_size: 999,
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
sort_name: 'sort',
|
|
|
|
|
|
|
|
sort_type: 'asc',
|
|
|
|
|
|
|
|
filter: [{
|
|
|
|
|
|
|
|
key: 'year',
|
|
|
|
|
|
|
|
op: 'eq',
|
|
|
|
|
|
|
|
value: this.select.year ? this.select.year : ''
|
|
|
|
|
|
|
|
}]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.type = res.detail
|
|
|
|
this.type = res.data
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 翻页
|
|
|
|
// 翻页
|
|
|
|
pageChange(e) {
|
|
|
|
pageChange(e) {
|
|
|
|
@ -338,7 +355,7 @@ export default {
|
|
|
|
this.total = res.list.total
|
|
|
|
this.total = res.list.total
|
|
|
|
this.useMoneyTotal = res.use_money_total
|
|
|
|
this.useMoneyTotal = res.use_money_total
|
|
|
|
this.moneyTotal = res.money
|
|
|
|
this.moneyTotal = res.money
|
|
|
|
this.updateMoneyTotal = res.update_money
|
|
|
|
this.updateMoneyTotal = res.update_money||0
|
|
|
|
this.rateTotal = this.toper(this.updateMoneyTotal, this.moneyTotal, this.useMoneyTotal)
|
|
|
|
this.rateTotal = this.toper(this.updateMoneyTotal, this.moneyTotal, this.useMoneyTotal)
|
|
|
|
|
|
|
|
|
|
|
|
console.log("list",this.list)
|
|
|
|
console.log("list",this.list)
|
|
|
|
@ -372,7 +389,7 @@ export default {
|
|
|
|
money: parseFloat(pidInfo.money).toFixed(2),
|
|
|
|
money: parseFloat(pidInfo.money).toFixed(2),
|
|
|
|
type: pidInfo.type,
|
|
|
|
type: pidInfo.type,
|
|
|
|
isParent:true,
|
|
|
|
isParent:true,
|
|
|
|
update_money: parseFloat(pidInfo.update_money).toFixed(2),
|
|
|
|
update_money: parseFloat(pidInfo.update_money||0).toFixed(2),
|
|
|
|
use_money_total: parseFloat(useMoneyTotal).toFixed(2), // 子项总和
|
|
|
|
use_money_total: parseFloat(useMoneyTotal).toFixed(2), // 子项总和
|
|
|
|
children: children // 保留所有子项
|
|
|
|
children: children // 保留所有子项
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -381,7 +398,7 @@ export default {
|
|
|
|
const arrayWithPer = mergedResult.map(row => {
|
|
|
|
const arrayWithPer = mergedResult.map(row => {
|
|
|
|
// 计算 per(公式:use_money_total / (update_money || money),处理 null 和 NaN)
|
|
|
|
// 计算 per(公式:use_money_total / (update_money || money),处理 null 和 NaN)
|
|
|
|
const useMoneyTotal = Number(row.use_money_total ?? 0); // null 视为 0,转换为数字
|
|
|
|
const useMoneyTotal = Number(row.use_money_total ?? 0); // null 视为 0,转换为数字
|
|
|
|
const denominator = Number(row.update_money) || Number(row.money); // 取 update_money 或 money
|
|
|
|
const denominator = Number(row.update_money||0) || Number(row.money); // 取 update_money 或 money
|
|
|
|
const calculation_result = isNaN(useMoneyTotal / denominator) ? 0 : useMoneyTotal / denominator;
|
|
|
|
const calculation_result = isNaN(useMoneyTotal / denominator) ? 0 : useMoneyTotal / denominator;
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|