|
|
@@ -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() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|