农经大屏
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

52 行
1.3 KiB

  1. import Pannel from '@/components/pannel/index.vue';
  2. import ScrollTable from '@/components/scroll-table/index.vue';
  3. import { longTermIdleResourceWarning } 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. isLoad: false,
  30. headers: ['资产名称', '资产类别', '资产原值(元)', '部门'],
  31. data: [
  32. ['资产名称', '资产类别', '资产原值(元)', '部门']
  33. ]
  34. };
  35. },
  36. methods: {
  37. getData () {
  38. if (this.year, this.deptId) {
  39. this.isLoad = false;
  40. longTermIdleResourceWarning(this.deptId, this.year).then(res => {
  41. console.log('longTermIdleResourceWarning', res);
  42. let data = res.data.map(item => {
  43. return [item.name, item.resourceSort, item.resourceType, item.deptName]
  44. })
  45. this.data = data;
  46. this.isLoad = true;
  47. })
  48. }
  49. }
  50. }
  51. };