index.js 2.9 KB

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