农经大屏
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

1 mese fa
1 mese fa
1 mese fa
1 mese fa
1 mese fa
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import Pannel from '@/components/pannel/index.vue';
  2. import ScrollTable from '@/components/scroll-table/index.vue';
  3. import PannelTabs from '@/components/pannel-tabs/index.vue';
  4. import { debtChangeRanking } from '../../../../api/index.js';
  5. import { mapGetters } from 'vuex';
  6. export default {
  7. components: {
  8. PannelTabs,
  9. ScrollTable,
  10. Pannel
  11. },
  12. computed: {
  13. ...mapGetters(['year', 'deptId', 'deptLength'])
  14. },
  15. watch: {
  16. year: {
  17. handler () {
  18. this.getData();
  19. },
  20. immediate: true, // 立即执行
  21. },
  22. deptId: {
  23. handler () {
  24. this.getData();
  25. },
  26. immediate: true, // 立即执行
  27. }
  28. },
  29. data () {
  30. return {
  31. type: '1',
  32. pannelData: [
  33. {
  34. id: '1',
  35. name: '减少'
  36. },
  37. {
  38. id: '2',
  39. name: '增加'
  40. },
  41. ],
  42. isLoad: false,
  43. headers: ['部门名称', '债务金额', '排名'],
  44. data: [['部门名称', '债务金额', '1']]
  45. };
  46. },
  47. created () {
  48. },
  49. mounted () {
  50. },
  51. methods: {
  52. getData () {
  53. if (this.year, this.deptId) {
  54. this.isLoad = false;
  55. debtChangeRanking(this.deptId, this.year, this.type).then(res => {
  56. if (this.deptLength == 3){
  57. this.headers = ['摘要', '金额'];
  58. this.data = res.rows.map(item => {
  59. return [item.name, item.value]
  60. })
  61. }else{
  62. this.headers = ['部门名称', '债务金额', '排名']
  63. this.data = res.rows.map(item => {
  64. return [item.name, item.value, item.index]
  65. })
  66. }
  67. this.isLoad = true;
  68. })
  69. }
  70. },
  71. tabChange (info) {
  72. // console.log('indo', info);
  73. this.type = info.id;
  74. this.getData()
  75. }
  76. }
  77. };