diff --git a/src/views/capital/api/index.js b/src/views/capital/api/index.js index c150576..b6f19ce 100644 --- a/src/views/capital/api/index.js +++ b/src/views/capital/api/index.js @@ -62,4 +62,30 @@ export function analysisOfCapitalExpenditureRend (deptId, year) { method: 'get', params: query }) +} + +// 资金一张图-右上-资产负债分析 +export function assetLiabilityAnalysis (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/finance/zcfzfx', + method: 'get', + params: query + }) +} + +// 资金一张图-右中-资金收入排名 +export function rankingOfFundIncome (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/finance/zjsrpm', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/src/views/capital/comps/right/middle/1/index.html b/src/views/capital/comps/right/middle/1/index.html index 2063689..cebb952 100644 --- a/src/views/capital/comps/right/middle/1/index.html +++ b/src/views/capital/comps/right/middle/1/index.html @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/views/capital/comps/right/middle/1/index.js b/src/views/capital/comps/right/middle/1/index.js index bcaba7d..a30f7c9 100644 --- a/src/views/capital/comps/right/middle/1/index.js +++ b/src/views/capital/comps/right/middle/1/index.js @@ -1,13 +1,33 @@ import Pannel from '@/components/pannel/index.vue'; import ScrollTable from '@/components/scroll-table/index.vue'; - +import { rankingOfFundIncome } from '../../../../api/index.js'; +import { mapGetters } from 'vuex'; export default { components: { ScrollTable, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { + isLoad: false, + data: [] }; }, created () { @@ -15,5 +35,19 @@ export default { mounted () { }, methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + rankingOfFundIncome(this.deptId, this.year).then(res => { + console.log(res.data, 992); + let data = res.data.map(item => { + return [item.name, item.value, item.index] + }) + console.log(data, 999); + this.data = data; + this.isLoad = true; + }) + } + } } }; diff --git a/src/views/capital/comps/right/top/1/index.html b/src/views/capital/comps/right/top/1/index.html index 558d141..c0ad1f9 100644 --- a/src/views/capital/comps/right/top/1/index.html +++ b/src/views/capital/comps/right/top/1/index.html @@ -1,4 +1,9 @@ - +
diff --git a/src/views/capital/comps/right/top/1/index.js b/src/views/capital/comps/right/top/1/index.js index dd153d1..0740385 100644 --- a/src/views/capital/comps/right/top/1/index.js +++ b/src/views/capital/comps/right/top/1/index.js @@ -1,11 +1,45 @@ import Pannel from '@/components/pannel/index.vue'; import Block from '@/components/block/index.vue'; import data from './data.js'; +import { assetLiabilityAnalysis } from '../../../../api/index.js'; +import { mapGetters } from 'vuex'; export default { components: { Block, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, + methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + assetLiabilityAnalysis(this.deptId, this.year).then(res => { + this.data[0][0].value = res.data.zc // 总资产(万元) + this.data[0][1].value = res.data.fz // 总负债(万元) + + this.data[1][0].value = res.data.sr // 总收入(万元) + this.data[1][1].value = res.data.zhc // 总支出(万元) + this.isLoad = true; + }) + } + } + }, data () { return { data