From 19451095b071ba5f954d18f1f3d82d4738106959 Mon Sep 17 00:00:00 2001 From: yuzongping <835949940@qq.com> Date: Wed, 16 Jul 2025 10:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E4=B8=8D=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=8E=92=E5=90=8D=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/resources/api/index.js | 26 ++++++++++ .../resources/comps/right/bottom/1/index.html | 9 +++- .../resources/comps/right/bottom/1/index.js | 34 +++++++++++++- .../resources/comps/right/middle/1/index.html | 9 +++- .../resources/comps/right/middle/1/index.js | 47 ++++++++++++++++++- .../resources/comps/right/top/1/index.js | 1 - 6 files changed, 118 insertions(+), 8 deletions(-) diff --git a/src/views/resources/api/index.js b/src/views/resources/api/index.js index 6ac9c57..7ec49ae 100644 --- a/src/views/resources/api/index.js +++ b/src/views/resources/api/index.js @@ -116,3 +116,29 @@ export function analysisContractTypes (deptId, year) { params: query }) } + +// 资源一张图-右中-合同数量/金额排名分析 +export function rankinganalysisofcontractquantityandamount (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/resource/htsljepmfx', + method: 'get', + params: query + }) +} + +// 资源一张图-右下-合同不规范管理排名分析 +export function Rankinganalysisofstandardcontractmanagement (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/resource/htbgfglpmfx', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/views/resources/comps/right/bottom/1/index.html b/src/views/resources/comps/right/bottom/1/index.html index acc4586..dd334b7 100644 --- a/src/views/resources/comps/right/bottom/1/index.html +++ b/src/views/resources/comps/right/bottom/1/index.html @@ -1,3 +1,8 @@ - - + + \ No newline at end of file diff --git a/src/views/resources/comps/right/bottom/1/index.js b/src/views/resources/comps/right/bottom/1/index.js index 82f0947..75b2b02 100644 --- a/src/views/resources/comps/right/bottom/1/index.js +++ b/src/views/resources/comps/right/bottom/1/index.js @@ -1,13 +1,33 @@ import Pannel from '@/components/pannel/index.vue'; import ScrollTable from '@/components/scroll-table/index.vue'; - +import { Rankinganalysisofstandardcontractmanagement } 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 { + data: [], + isLoad: false, headers: ['部门名称', '合同数量', '排名'] }; }, @@ -16,5 +36,17 @@ export default { mounted () { }, methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + Rankinganalysisofstandardcontractmanagement(this.deptId, this.year).then(res => { + let data = res.data.map(item => { + return [item.name, item.value, item.index] + }) + this.data = data + this.isLoad = true; + }) + } + }, } }; diff --git a/src/views/resources/comps/right/middle/1/index.html b/src/views/resources/comps/right/middle/1/index.html index 2b75f12..a15512f 100644 --- a/src/views/resources/comps/right/middle/1/index.html +++ b/src/views/resources/comps/right/middle/1/index.html @@ -1,11 +1,16 @@ - +
- +
\ No newline at end of file diff --git a/src/views/resources/comps/right/middle/1/index.js b/src/views/resources/comps/right/middle/1/index.js index a6d9491..78debc6 100644 --- a/src/views/resources/comps/right/middle/1/index.js +++ b/src/views/resources/comps/right/middle/1/index.js @@ -1,14 +1,36 @@ import Pannel from '@/components/pannel/index.vue'; import ScrollTable from '@/components/scroll-table/index.vue'; import PannelTabs from '@/components/pannel-tabs/index.vue'; +import { rankinganalysisofcontractquantityandamount } from '../../../../api/index.js' +import { mapGetters } from 'vuex' export default { components: { PannelTabs, ScrollTable, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { + id: '1', + isLoad: false, + data: [], headers: ['部门名称', '数量', '排名'], pannelTabData: [ { @@ -19,7 +41,7 @@ export default { id: '2', name: '金额' } - ], + ] }; }, created () { @@ -27,7 +49,28 @@ export default { mounted () { }, methods: { - tabChange () { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + rankinganalysisofcontractquantityandamount(this.deptId, this.year).then(res => { + if (this.id == 1) { + let data = res.data.sl.map(item => { + return [item.name, item.value, item.index] + }) + this.data = data; + } else if (this.id == 2) { + let data = res.data.je.map(item => { + return [item.name, item.value, item.index] + }) + this.data = data; + } + this.isLoad = true; + }) + } + }, + tabChange (info) { + this.id = info.id + this.getData() } } diff --git a/src/views/resources/comps/right/top/1/index.js b/src/views/resources/comps/right/top/1/index.js index 0f26271..8ef93d3 100644 --- a/src/views/resources/comps/right/top/1/index.js +++ b/src/views/resources/comps/right/top/1/index.js @@ -35,7 +35,6 @@ export default { if (this.year, this.deptId) { this.isLoad = false; analysisContractTypes(this.deptId, this.year).then(res => { - console.log('analysisContractTypes', res); this.data[0][0].value = res.data.numHt this.data[0][1].value = res.data.zhte this.data[1][0].value = res.data.yjk