accountstatic.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <el-card :header="head">
  3. <avue-data-display :option="option"></avue-data-display>
  4. </el-card>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. head: {},
  10. statData: {
  11. todayIn: null,
  12. todayOut:null,
  13. historyIn:null,
  14. historyOut:null
  15. }
  16. },
  17. data() {
  18. return {
  19. option: {
  20. span: 6,
  21. data: [{
  22. click: function() {
  23. },
  24. count: this.statData.todayOut,
  25. decimals: 2,
  26. title: '今日扣款',
  27. },
  28. {
  29. click: function() {
  30. },
  31. count: this.statData.historyOut,
  32. decimals: 2,
  33. title: '历史扣款',
  34. },
  35. {
  36. click: function() {
  37. },
  38. count: this.statData.todayIn,
  39. decimals: 2,
  40. title: '今日采购',
  41. },
  42. {
  43. click: function() {},
  44. count: this.statData.historyIn,
  45. decimals: 2,
  46. title: '历史采购',
  47. }
  48. ]
  49. },
  50. }
  51. },
  52. watch:{
  53. statData:{
  54. handler(){
  55. this.option.data[0].count = this.statData.todayOut;
  56. this.option.data[1].count = this.statData.historyOut;
  57. this.option.data[2].count = this.statData.todayIn;
  58. this.option.data[3].count = this.statData.historyIn;
  59. this.$forceUpdate()
  60. },
  61. immediate:true,
  62. deep:true
  63. }
  64. },
  65. mounted() {
  66. }
  67. }
  68. </script>
  69. <style>
  70. </style>