contract-statistics-annual-report.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div>
  3. <div class="my-title">年度合同统计</div>
  4. <div style="margin-left: 20px;margin-right: 20px">
  5. <!-- todo -->
  6. <div id="myChart" :style="{width: '600px', height: '300px'}"></div>
  7. </div>
  8. <span slot="footer" class="dialog-footer">
  9. <el-button @click="onChose">返回</el-button>
  10. </span>
  11. </div>
  12. </template>
  13. <script>
  14. // import echarts from 'echarts'
  15. import EDesc from '../common/e-desc'
  16. import EDescItem from '../common/e-desc-item'
  17. export default {
  18. name: 'contract-statistics-annual-report',
  19. components: {
  20. EDesc, EDescItem
  21. },
  22. data () {
  23. return {
  24. id: 0,
  25. dataForm: {}
  26. }
  27. },
  28. methods: {
  29. onChose () {
  30. this.$emit('onChose')
  31. },
  32. async init (id) {
  33. this.id = id || 0
  34. this.dataForm = {
  35. year: 2020
  36. }
  37. // this.drawLine()
  38. this.getDetails()
  39. },
  40. drawLine () {
  41. // // 基于刚刚准备好的 DOM 容器,初始化 EChart 实例
  42. // let myChart = this.$echarts.init(document.getElementById('myChart'))
  43. // // 绘制图表
  44. // myChart.setOption({
  45. // title: { text: '太阳系八大行星的卫星数量' },
  46. // tooltip: {},
  47. // xAxis: {
  48. // data: ['水星', '金星', '地球', '火星', '木星', '土星', '金王星', '海王星']
  49. // },
  50. // yAxis: {},
  51. // series: [{
  52. // name: '数量',
  53. // type: 'bar',
  54. // data: [0, 0, 1, 2, 79, 82, 27, 14]
  55. // }]
  56. // })
  57. },
  58. getDetails () {
  59. this.$http({
  60. url: this.$http.adornUrl(`/biz-service/cusContractCensus/year/info`),
  61. method: 'get',
  62. params: this.$http.adornParams({
  63. 'year': this.dataForm.year
  64. })
  65. }).then(({data}) => {
  66. if (data && data.code === '200') {
  67. this.dataForm = data.data
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped>
  75. .my-line{
  76. border-bottom: 1px solid #c0c4cc;
  77. margin-bottom: 10px;
  78. }
  79. .title{
  80. padding: 10px 0 ;
  81. }
  82. </style>