index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import * as API from '@/apis/merchant.js'
  2. export default {
  3. data() {
  4. return {
  5. thisyear: 0,
  6. params: {
  7. year: true,
  8. month: true,
  9. day: false,
  10. hour: false,
  11. minute: false,
  12. second: false,
  13. // 选择时间的时间戳
  14. timestamp: true,
  15. },
  16. show1: false,
  17. show2: false,
  18. show3: false,
  19. selectForm: {
  20. select1Index:0,
  21. select2Index:0,
  22. select1: '',
  23. select1Name: '全部车辆',
  24. select2: '',
  25. select2Name: '全部车票',
  26. select3: '',
  27. select3Name: '当前月份',
  28. },
  29. selectList1: [{
  30. id: '',
  31. licensePlateNumber: '全部车辆'
  32. },
  33. ],
  34. selectList2: [{
  35. id: '',
  36. name: '全部车票'
  37. },
  38. {
  39. id: 'wechat',
  40. name: '微信支付'
  41. },
  42. {
  43. id: 'alipay',
  44. name: '支付宝'
  45. },
  46. {
  47. id: 'cash',
  48. name: '现金购票'
  49. },
  50. {
  51. id: 'ticket',
  52. name: '纸质车票'
  53. },
  54. ],
  55. profitList: [],
  56. mymap: {},
  57. }
  58. },
  59. methods: {
  60. gotoUrl(data){
  61. uni.navigateTo({
  62. url:"/pages/order/list?time="+data
  63. })
  64. },
  65. getMerchantVehicleList() {
  66. this.$refs.common.showLoading()
  67. API.merchantVehicleList().then(response => {
  68. var selectList1 = [{
  69. id: '',
  70. licensePlateNumber: '全部车辆'
  71. },
  72. ...response.data
  73. ]
  74. // selectList1
  75. this.selectList1 = selectList1;
  76. this.$refs.common.showLoading(false);
  77. this.getProfitList();
  78. }).catch(error => {
  79. this.$refs.common.showLoading(false, error);
  80. })
  81. },
  82. getProfitList() {
  83. this.$refs.common.showLoading();
  84. var obj={
  85. vehicleId:this.selectForm.select1,
  86. payName:this.selectForm.select2,
  87. dateStr:this.selectForm.select3,
  88. }
  89. API.profitList(obj).then(response => {
  90. // selectList1
  91. this.profitList = response.data;
  92. this.$refs.common.showLoading(false);
  93. }).catch(error => {
  94. this.$refs.common.showLoading(false, error);
  95. })
  96. },
  97. show3cancel(op) {
  98. },
  99. show1confirm(op) {
  100. var i = op[0];
  101. this.selectForm.select1Index=i;
  102. var obj = this.selectList1[i]
  103. this.selectForm.select1 = obj.id;
  104. this.selectForm.select1Name = obj.licensePlateNumber;
  105. this.getProfitList();
  106. },
  107. show2confirm(op) {
  108. var i = op[0];
  109. this.selectForm.select2Index=i;
  110. var obj = this.selectList2[i]
  111. this.selectForm.select2 = obj.id;
  112. this.selectForm.select2Name = obj.name;
  113. this.getProfitList();
  114. },
  115. show3confirm(op) {
  116. console.log(op)
  117. var select = op.year + "-" + op.month;
  118. var selectName = op.year + "年" + op.month + "月";
  119. this.selectForm.select3 = select;
  120. this.selectForm.select3Name = selectName;
  121. this.getProfitList();
  122. },
  123. },
  124. onLoad(temp) {
  125. var myDate = new Date();
  126. var tYear = myDate.getFullYear();
  127. this.thisyear = tYear
  128. //this.selectForm.select3
  129. },
  130. onReady() {
  131. this.getMerchantVehicleList();
  132. }
  133. }