index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import * as API from '@/apis/merchant.js'
  2. export default {
  3. data() {
  4. return {
  5. selectList: [{
  6. id: '',
  7. licensePlateNumber: '全部车辆'
  8. },
  9. ],
  10. show1: false,
  11. selectForm: {
  12. select1: '',
  13. select1Name: '全部车辆',
  14. },
  15. revenueStatisticsDown:{},
  16. revenueStatisticsUp:{},
  17. }
  18. },
  19. methods: {
  20. getMerchantVehicleList() {
  21. this.$refs.common.showLoading()
  22. API.merchantVehicleList().then(response => {
  23. var selectList1 = [{
  24. id: '',
  25. licensePlateNumber: '全部车辆'
  26. },
  27. ...response.data
  28. ]
  29. // selectList1
  30. this.selectList = selectList1;
  31. this.$refs.common.showLoading(false);
  32. //this.getProfitList();
  33. this.getRevenueStatisticsUp();
  34. }).catch(error => {
  35. this.$refs.common.showLoading(false, error);
  36. })
  37. },
  38. show1confirm(op) {
  39. var i = op[0];
  40. this.selectForm.select1Index=i;
  41. var obj = this.selectList[i]
  42. this.selectForm.select1 = obj.id;
  43. this.selectForm.select1Name = obj.licensePlateNumber;
  44. //this.getProfitList();
  45. this.getRevenueStatisticsUp();
  46. },
  47. gotoUrl(){
  48. uni.switchTab({
  49. url: '/pages/order/index'
  50. });
  51. },
  52. gotoUrl2(){
  53. uni.navigateTo({
  54. url: '/pages/class/list'
  55. });
  56. },
  57. getRevenueStatisticsDown(){
  58. this.$refs.common.showLoading()
  59. API.revenueStatisticsDown(
  60. {
  61. vehicleId:this.selectForm.select1
  62. }
  63. ).then(response => {
  64. this.revenueStatisticsDown=response.data
  65. this.$refs.common.showLoading(false);
  66. }).catch(error => {
  67. this.$refs.common.showLoading(false,error);
  68. })
  69. },
  70. getRevenueStatisticsUp(){
  71. this.$refs.common.showLoading()
  72. API.revenueStatisticsUp({
  73. vehicleId:this.selectForm.select1
  74. }
  75. ).then(response => {
  76. this.revenueStatisticsUp=response.data
  77. this.$refs.common.showLoading(false);
  78. this.getRevenueStatisticsDown()
  79. }).catch(error => {
  80. this.$refs.common.showLoading(false,error);
  81. })
  82. }
  83. },
  84. mounted() {
  85. // document.body.style.backgroundColor = '#eee';
  86. },
  87. destroyed() {
  88. //document.body.style.backgroundColor = '';
  89. },
  90. onLoad(temp) {
  91. },onReady(){
  92. this.getMerchantVehicleList()
  93. }
  94. }