Input.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div>
  3. <common-car ref="common" @asynCallBack="asynCallBack"></common-car>
  4. <top-header :pageTitle="pageTitle"></top-header>
  5. <div class="mui-content vongi-car-index">
  6. <div class="vongi-car-banner">
  7. <!-- <h5 class="mui-ellipsis">停车位置:{{detail.parkingName}}</h5>
  8. --> <div class="flew">
  9. <input type="text" v-model="searchForm.carNumber" placeholder="请输入车牌号查询">
  10. <button @click="searchByCarNumber" class="mui-btn mui-btn-blue">查询</button>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="vongi-qingjiadt" v-if="kongResult">
  15. <form class="mui-input-group vongi-cd-payli">
  16. <div class="mui-input-row">
  17. <label>车牌号</label>
  18. <span v-text="channelForm.carNumber"></span>
  19. </div>
  20. <div class="mui-input-row">
  21. <label>生效时间</label>
  22. <span v-text="detail.inTime"></span>
  23. </div>
  24. <div class="mui-input-row">
  25. <label>截止时间</label>
  26. <span v-text="detail.memberTime"></span>
  27. </div>
  28. </form>
  29. <div class="fyy-footer padd30">
  30. <div class="bindfyy-btn">
  31. <button type="button" @click="submit" class="mui-btn mui-btn-primary ">确认录入</button>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="vongi-car-footer" style="
  36. bottom: 80px;
  37. ">
  38. <div class="mui-media-body">
  39. <b>注:</b>
  40. <br>
  41. 1.请于确认录入后1分钟再离场。
  42. <br>
  43. 2.会员续租车辆请于到期后再到前台扫码续租
  44. </div>
  45. </div>
  46. <loading :visible="isLoading"></loading>
  47. </div>
  48. </template>
  49. <script>
  50. import * as API_Car from '@/apis/car'
  51. import CommonCar from '@/components/CommonCar.vue'
  52. import Loading from '$project/components/Loading.vue'
  53. import TopHeader from '$project/components/TopHeader.vue'
  54. import {
  55. mapGetters,
  56. mapMutations
  57. } from 'vuex'
  58. import * as types from '$project/store/mutation-types'
  59. export default {
  60. name: 'CarSearch',
  61. components: {
  62. CommonCar,
  63. Loading,
  64. TopHeader,
  65. },
  66. data() {
  67. return {
  68. isLoading: false,
  69. pageTitle: '车牌查询',
  70. searchForm: {
  71. carNumber: '',
  72. companyId: '',
  73. },
  74. channelForm: {
  75. channelId: '',
  76. companyId: '',
  77. },
  78. kongResult: false,
  79. detail: {}
  80. }
  81. },
  82. created() {
  83. if (this.$route.query.companyId) {
  84. //入口页必须带merchantId
  85. this.set_parking_company_id(this.$route.query.companyId);
  86. } else {
  87. if (!this.parking_company_id) {
  88. mui.alert('参数错误');
  89. }
  90. }
  91. },
  92. methods: {
  93. //获取停车场信息
  94. submit(){
  95. this.isLoading = true;
  96. API_Car.userGetCarMember(this.channelForm.carNumber,this.channelForm.companyId).then(response => {
  97. this.isLoading = false;
  98. this.kongResult = false;
  99. this.searchForm.carNumber=""
  100. mui.alert('录入成功');
  101. }).catch(error => {
  102. this.isLoading = false;
  103. mui.toast(error);
  104. })
  105. },
  106. //检测
  107. checkForm() {
  108. if (!this.searchForm.carNumber) {
  109. mui.toast('请输入车牌号码');
  110. return false;
  111. } else {
  112. return true;
  113. }
  114. },
  115. //查询车牌信息
  116. searchByCarNumber() {
  117. if (this.checkForm()) {
  118. this.isLoading = true;
  119. API_Car.userGetCarDetail(this.searchForm.carNumber,this.parking_company_id).then(response => {
  120. this.detail=response;
  121. this.channelForm={
  122. carNumber:this.searchForm.carNumber,
  123. companyId:this.parking_company_id
  124. }
  125. this.isLoading = false;
  126. this.kongResult = true;
  127. }).catch(error => {
  128. this.isLoading = false;
  129. mui.toast(error);
  130. })
  131. }
  132. },
  133. asynCallBack() {},
  134. ...mapMutations({
  135. set_parking_company_id: types.SET_PARKING_COMPANY_ID,
  136. })
  137. },
  138. mounted() {
  139. },
  140. destroyed() {
  141. },
  142. computed: {
  143. ...mapGetters({
  144. wx_openId: 'wx_openid',
  145. ali_openId: 'ali_openid',
  146. parking_company_id: 'parking_company_id'
  147. })
  148. }
  149. }
  150. </script>
  151. <style scoped src="$project/assets/css/xpwyfyy.css"></style>
  152. <style src="$project/assets/css/iconfont.css"></style>
  153. <style>
  154. </style>