Commit bab4a7eb authored by wangxl's avatar wangxl

55

parent dcec4a2d
<template>
<div>
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>项目经费 <strong>(单位:万元)</strong></span>
</div>
</a-col>
</a-row>
<a-row>
<a-col :span="6" class="bg-gray">
预算科目
</a-col>
<a-col :span="3" class="bg-gray">
总预算数
</a-col>
<a-col :span="5" class="bg-gray">
省级财政资金
</a-col>
<a-col :span="5" class="bg-gray">
自筹资金
</a-col>
<a-col :span="5" class="bg-gray">
备注
</a-col>
</a-row>
<div v-for="(item, index) in budget" :key="'budget' + index" class="row_center">
<a-row v-if="item.type ==='count'">
<a-col :span="6" :style="'text-align: left;padding-left:'+left(item.level)+'px'">
{{item.budgetName}}
</a-col>
<a-col :span="3">
{{Count(item.source,'totalBudget',index)}}
</a-col>
<a-col :span="5">
<span v-if="!!!item.show||item.show === 'applyFunds'">{{Count(item.source,'applyFunds',index)}}</span>
</a-col>
<a-col :span="5">
{{Count(item.source,'selfFunds',index)}}
</a-col>
<a-col :span="5">
<a-input v-model="item.calculationBasis" :maxLength="100" style="width: 80%;" />
</a-col>
</a-row>
<a-row v-else>
<a-col :span="6" :style="'text-align: left;padding-left:'+left(item.level)+'px'">
{{item.budgetName}}
</a-col>
<a-col :span="3">
{{Count1(index, item.applyFunds, item.selfFunds)}}
</a-col>
<a-col :span="5">
<a-input-number v-model="item.applyFunds" :min="0" :step="0.01" style="width: 80%" v-if="!!!item.show||item.show === 'applyFunds'" />
</a-col>
<a-col :span="5">
<a-input-number v-model="item.selfFunds" :min="0" :step="0.01" style="width: 80%" v-if="!!!item.show||item.show === 'selfFunds'" />
</a-col>
<a-col :span="5">
<a-input v-model="item.calculationBasis" :maxLength="100" style="width: 80%;" />
</a-col>
</a-row>
</div>
</div>
</template>
<script>
import { budgetList } from "@/views/report/project/config"
export default {
name: "fundEdit",
data () {
return {
budget: budgetList()
};
},
props: {
// budget: {
// type: Array,
// default: () => {
// return []
// }
// },
},
created () {
},
methods: {
Count (source, type, index) {
if (!source || !source.length) {
return 0.00
}
let applyFunds = 0.00
let selfFunds = 0.00
source.forEach(i => {
applyFunds = parseFloat(applyFunds + this.budget[i].applyFunds)
selfFunds = parseFloat(selfFunds + this.budget[i].selfFunds)
})
if (type === 'applyFunds') {
this.budget[index].applyFunds = applyFunds.toFixed(2)
return applyFunds.toFixed(2)
} else if (type === 'selfFunds') {
this.budget[index].selfFunds = selfFunds.toFixed(2)
return selfFunds.toFixed(2)
} else {
this.budget[index].totalBudget = (applyFunds + selfFunds).toFixed(2)
return parseFloat(applyFunds + selfFunds).toFixed(2)
}
},
Count1 (index, applyFunds, selfFunds) {
this.budget[index].totalBudget = (applyFunds + selfFunds).toFixed(2)
return (applyFunds + selfFunds).toFixed(2)
},
left (l) {
switch (l) {
case 1:
return 4;
case 2:
return 12;
case 3:
return 20;
case 4:
return 30;
}
return 0;
}
},
};
</script>
...@@ -573,6 +573,9 @@ ...@@ -573,6 +573,9 @@
</template> </template>
<script> <script>
import fundEdit from '@/views/report/project/components/fundEdit'
import documentView from '@/views/components/common/documentView' import documentView from '@/views/components/common/documentView'
import previewFile from '@/views/components/common/previewFile' import previewFile from '@/views/components/common/previewFile'
import { getType } from '@/views/utils/auth' import { getType } from '@/views/utils/auth'
...@@ -640,7 +643,7 @@ import cascaderSelect from '@/views/components/common/cascaderSelect' ...@@ -640,7 +643,7 @@ import cascaderSelect from '@/views/components/common/cascaderSelect'
export default { export default {
name: 'projectEdit', name: 'projectEdit',
components: { components: {
projectMemberEdit, cooperativeUnitsEdit, budgetEdit, fundPlanEdit, projectKpiEdit, fileEdit, previewFile, documentView, cascaderSelect, deviceEdit, projStageGoalsEdit, manufactureEdit, unitPaymentEdit, projectSubEdit, participateUnitsEdit fundEdit, projectMemberEdit, cooperativeUnitsEdit, budgetEdit, fundPlanEdit, projectKpiEdit, fileEdit, previewFile, documentView, cascaderSelect, deviceEdit, projStageGoalsEdit, manufactureEdit, unitPaymentEdit, projectSubEdit, participateUnitsEdit
}, },
props: { props: {
value: { value: {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment