list.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import * as API from '@/apis/merchant.js'
  2. export default {
  3. data() {
  4. return {
  5. thisyear: 0,
  6. clientHeight:0,
  7. show1: false,
  8. show2: false,
  9. show3: false,
  10. selectForm: {
  11. select1Index:0,
  12. select2Index:0,
  13. select3Index:0,
  14. select1: '',
  15. select1Name: '全部车辆',
  16. select2: '',
  17. select2Name: '全部车票',
  18. select3: '',
  19. select3Name: '全天',
  20. },
  21. selectList1: [{
  22. id: '',
  23. licensePlateNumber: '全部车辆'
  24. },
  25. ],
  26. selectList2: [{
  27. id: '',
  28. name: '全部车票'
  29. },
  30. {
  31. id: 'wechat',
  32. name: '微信支付'
  33. },
  34. {
  35. id: 'alipay',
  36. name: '支付宝'
  37. },
  38. {
  39. id: 'cash',
  40. name: '现金购票'
  41. },
  42. {
  43. id: 'ticket',
  44. name: '纸质车票'
  45. },
  46. ],
  47. selectList3: [
  48. {
  49. id: '0',
  50. name: '全天'
  51. },
  52. {
  53. id: '1',
  54. name: '上午'
  55. },
  56. {
  57. id: '2',
  58. name: '下午'
  59. },
  60. ],
  61. listForm: {
  62. totalPage: 1,
  63. pageIndex: 1,
  64. pageSize: 20
  65. },
  66. recordList:[],
  67. sellList: {},
  68. mymap: {},
  69. }
  70. },
  71. methods: {
  72. gotoUrl(item){
  73. uni.navigateTo({
  74. url:"/pages/order/info?id="+item.id
  75. })
  76. },
  77. lower() {
  78. console.log("--------")
  79. if (this.listForm.pageIndex <= this.listForm.totalPage ) {
  80. this.getSellList(true);
  81. } else {
  82. return;
  83. }
  84. },
  85. getMerchantVehicleList() {
  86. this.$refs.common.showLoading()
  87. API.merchantVehicleList().then(response => {
  88. var selectList1 = [{
  89. id: '',
  90. licensePlateNumber: '全部车辆'
  91. },
  92. ...response.data
  93. ]
  94. // selectList1
  95. this.selectList1 = selectList1;
  96. this.$refs.common.showLoading(false);
  97. this.getSellList();
  98. }).catch(error => {
  99. this.$refs.common.showLoading(false, error);
  100. })
  101. },
  102. getSellList(bl) {
  103. if(!bl){
  104. this.listForm.pageIndex=1;
  105. }
  106. this.$refs.common.showLoading();
  107. var obj={
  108. vehicleId:this.selectForm.select1,
  109. payName:this.selectForm.select2,
  110. dateType:this.selectForm.select3,
  111. dateStr:this.thisyear,
  112. ...this.listForm
  113. }
  114. API.sellList(obj).then(response => {
  115. if (response) {
  116. if (this.listForm.pageIndex == 1) {
  117. this.recordList = response.data.data;
  118. this.listForm.pageIndex = response.data.pageNumber;
  119. this.listForm.totalPage = response.data.totalPage;
  120. } else {
  121. this.recordList = [
  122. ...this.recordList,
  123. ...response.data.data
  124. ];
  125. }
  126. }
  127. this.listForm.pageIndex++;
  128. this.$refs.common.showLoading(false);
  129. }).catch(error => {
  130. this.$refs.common.showLoading(false, error);
  131. })
  132. },
  133. show3cancel(op) {
  134. },
  135. show1confirm(op) {
  136. var i = op[0];
  137. this.selectForm.select1Index=i;
  138. var obj = this.selectList1[i]
  139. this.selectForm.select1 = obj.id;
  140. this.selectForm.select1Name = obj.licensePlateNumber;
  141. this.getSellList();
  142. },
  143. show2confirm(op) {
  144. var i = op[0];
  145. this.selectForm.select2Index=i;
  146. var obj = this.selectList2[i]
  147. this.selectForm.select2 = obj.id;
  148. this.selectForm.select2Name = obj.name;
  149. this.getSellList();
  150. },
  151. show3confirm(op) {
  152. var i = op[0];
  153. this.selectForm.select2Index=i;
  154. var obj = this.selectList2[i]
  155. this.selectForm.select3 = obj.id;
  156. this.selectForm.select3Name = obj.name;
  157. this.getSellList();
  158. },
  159. },
  160. onLoad(temp) {
  161. this.clientHeight = document.body.clientHeight;
  162. this.thisyear = temp.time
  163. //this.selectForm.select3
  164. },
  165. onReady() {
  166. this.getMerchantVehicleList();
  167. }
  168. }