finance.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form','echarts', 'echarts-theme'], function ($, undefined, Backend, Table, Form,Echarts) {
  2. var Controller = {
  3. amount_statistics: function () {
  4. Form.events.daterangepicker($('.form'))
  5. var myChart = Echarts.init(document.getElementById('amountShow'));
  6. var option = {
  7. xAxis: {
  8. type: 'category',
  9. data: ['订单金额','退款金额','销售额','销售提成']
  10. },
  11. yAxis: {
  12. type: 'value'
  13. },
  14. series: [
  15. {
  16. data: [payAmount,refundAmount,sellAmount,commissionAmount],
  17. type: 'bar'
  18. }
  19. ],
  20. tooltip:{
  21. trigger:'axis',
  22. axisPointer: {
  23. type: 'cross',
  24. label: {
  25. backgroundColor: '#6a7985'
  26. }
  27. }
  28. }
  29. };
  30. myChart.setOption(option);
  31. },
  32. add: function () {
  33. Controller.api.bindevent();
  34. },
  35. edit: function () {
  36. Controller.api.bindevent();
  37. },
  38. api: {
  39. bindevent: function () {
  40. Form.api.bindevent($("form[role=form]"));
  41. }
  42. }
  43. };
  44. return Controller;
  45. });