农经大屏
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

71 行
1.5 KiB

  1. import Pannel from '@/components/pannel/index.vue';
  2. import Bar from '@/components/charts/bar/index.vue';
  3. import PannelTabs from '@/components/pannel-tabs/index.vue';
  4. import { mapGetters } from 'vuex';
  5. import { analysisSensitiveWarningForFundTransactions } from '../../../../api/index.js';
  6. export default {
  7. components: {
  8. PannelTabs,
  9. Bar,
  10. Pannel
  11. },
  12. data () {
  13. return {
  14. isLoad: false,
  15. tabIndex: '1',
  16. pannelTabsData: [
  17. {
  18. id: '1',
  19. name: '支出'
  20. },
  21. {
  22. id: '2',
  23. name: '收入'
  24. }
  25. ],
  26. data: []
  27. };
  28. },
  29. computed: {
  30. ...mapGetters(['year', 'deptId'])
  31. },
  32. watch: {
  33. year: {
  34. handler () {
  35. this.getData();
  36. },
  37. immediate: true, // 立即执行
  38. },
  39. deptId: {
  40. handler () {
  41. this.getData();
  42. },
  43. immediate: true, // 立即执行
  44. }
  45. },
  46. methods: {
  47. // 获取数据
  48. getData () {
  49. if (this.year || this.deptId) {
  50. this.isLoad = false;
  51. analysisSensitiveWarningForFundTransactions( this.deptId, this.year).then(res => {
  52. if (this.tabIndex == 1) {
  53. this.data = res.data.zc
  54. } else if (this.tabIndex == 2) {
  55. this.data = res.data.sr
  56. }
  57. this.isLoad = true;
  58. })
  59. }
  60. },
  61. tabChange (info) {
  62. this.tabIndex = info.id
  63. this.getData()
  64. },
  65. openTable(){
  66. this.$emit('openTable','敏感')
  67. }
  68. }
  69. };