农经大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import Pannel from '@/components/pannel/index.vue';
  2. import ScrollTable from '@/components/scroll-table/index.vue';
  3. import { Rankinganalysisofstandardcontractmanagement } from '../../../../api/index.js'
  4. import { mapGetters } from 'vuex'
  5. export default {
  6. components: {
  7. ScrollTable,
  8. Pannel
  9. },
  10. computed: {
  11. ...mapGetters(['year', 'deptId'])
  12. },
  13. watch: {
  14. year: {
  15. handler () {
  16. this.getData();
  17. },
  18. immediate: true, // 立即执行
  19. },
  20. deptId: {
  21. handler () {
  22. this.getData();
  23. },
  24. immediate: true, // 立即执行
  25. }
  26. },
  27. data () {
  28. return {
  29. data: [],
  30. isLoad: false,
  31. headers: ['部门名称', '合同数量', '排名']
  32. };
  33. },
  34. methods: {
  35. getData () {
  36. if (this.year, this.deptId) {
  37. this.isLoad = false;
  38. Rankinganalysisofstandardcontractmanagement(this.deptId, this.year).then(res => {
  39. let data = res.data.map(item => {
  40. return [item.name, item.value, item.index]
  41. })
  42. this.data = data
  43. this.isLoad = true;
  44. })
  45. }
  46. },
  47. }
  48. };