You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

month-statement-query-list.vue 4.2KB

1 year ago
1 year ago
7 months ago
7 months ago
7 months ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
1 year ago
7 months ago
7 months ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="content">
  3. <view class="top-content">
  4. <view class="example-body">
  5. <text>请选择月份:</text>
  6. <picker mode="date" @change="bindDateChange" fields="month">
  7. <view class="uni-input">{{state.date}}</view>
  8. </picker>
  9. <button size="mini" style="color: #ffffff;
  10. backgroundColor: rgb(118, 200, 77);
  11. borderColor: rgb(118, 200, 77);
  12. font-size: 26rpx;
  13. flex-shrink: 0;margin-left: 20rpx;" @click="search()">搜索</button>
  14. </view>
  15. </view>
  16. <view class="uni-container" v-if="state.listData.length>0">
  17. <view class="list-item" v-for="(item,index) in state.listData"
  18. @click="query(item.handleDate,item.vehicleId)">
  19. <view><text>姓名:</text><text>{{item.customerName}}</text></view>
  20. <view><text>证件号码:</text><text>{{item.customerIdNum}}</text></view>
  21. <view><text>通行次数:</text><text>{{item.num}}</text></view>
  22. <view><text>通行年月:</text><text>{{item.handleDate}}</text></view>
  23. <view><text>通行车牌号:</text><text>{{state.vehicleNum}}</text></view>
  24. <view><text>通行车牌颜色:</text><text>{{state.vehicleColor}}</text></view>
  25. <view><text>月通行总额:</text><text>{{item.money/100}}元</text></view>
  26. </view>
  27. <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
  28. </view>
  29. </view>
  30. </template>
  31. <script setup lang="ts">
  32. import { reactive } from "vue";
  33. import { onLoad} from "@dcloudio/uni-app";
  34. import {getUserMsg,monthlyStatementQuery } from "@/utils/network/api.js";
  35. import {requestNew } from "@/utils/network/request.js";
  36. import { getItem } from "@/utils/storage";
  37. import { getVehiclePlateColor } from "@/datas/vehiclePlateColor";
  38. import { msg, navTo } from "@/utils/utils";
  39. const state = reactive({
  40. startTime: Date.now(), //日期
  41. listData: [],
  42. range: ['', ''],
  43. flags: false,
  44. vehicleId: "",
  45. customerIdNum: "",
  46. vehicleNum: "",
  47. vehicleColor: "",
  48. date: "请选择月份"
  49. })
  50. onLoad((option) => {
  51. console.log("option", option.vehicleId)
  52. state.vehicleId = option.vehicleId;
  53. state.vehicleNum = option.vehicleId.split('_')[0];
  54. state.vehicleColor = getVehiclePlateColor(option.vehicleId.split('_')[1]);
  55. getUserinfo()
  56. })
  57. const bindDateChange = (e) => {
  58. state.date = e.detail.value
  59. }
  60. const getUserinfo = () => {
  61. const options = {
  62. type: 2,
  63. data: { openId: getItem('openId') },
  64. method: "POST",
  65. showLoading: true,
  66. };
  67. requestNew(getUserMsg, options).then((res) => {
  68. const data = res;
  69. console.log(data, "用户信息");
  70. state.customerIdNum = data.customerIdNum
  71. });
  72. }
  73. //业务完成日志
  74. const search = () => {
  75. if (state.date == '请选择月份') {
  76. msg("请选择月份");
  77. return;
  78. }
  79. var data = {
  80. startTime: state.date,
  81. // endTime: state.range[1],
  82. vehicleId: state.vehicleId,
  83. customerIdNum: state.customerIdNum
  84. };
  85. const options = {
  86. type: 2,
  87. data: data,
  88. method: "POST",
  89. showLoading: true,
  90. };
  91. requestNew(monthlyStatementQuery, options).then((res) => {
  92. state.listData = res.result
  93. console.log("业务完成日志", state.listData,)
  94. });
  95. }
  96. const query = (handleDate, vehicleId) => {
  97. navTo(`/subpackage/personal-center/search/select-card?vehicleId=${vehicleId}&&handleDate=${handleDate}`)
  98. }
  99. </script>
  100. <style scoped>
  101. .top-content {
  102. position: fixed;
  103. left: 0;
  104. top: 0;
  105. background-color: white;
  106. width: 100%;
  107. padding: 20rpx;
  108. box-sizing: border-box;
  109. }
  110. .content {
  111. font-size: 32rpx;
  112. padding: 20rpx 30rpx;
  113. background-color: #EEF7F7;
  114. min-height: 100vh;
  115. }
  116. .card {
  117. display: flex;
  118. margin: 0 20rpx;
  119. align-items: center;
  120. }
  121. .title {
  122. margin-bottom: 20rpx;
  123. }
  124. .uni-container {
  125. margin: 50rpx 0;
  126. margin-top: 150rpx;
  127. }
  128. .example-body {
  129. display: flex;
  130. align-items: center;
  131. margin-top: 20rpx;
  132. }
  133. /deep/.uni-date-x {
  134. height: 76rpx !important;
  135. }
  136. .list-item {
  137. width: 95%;
  138. border-radius: 10rpx;
  139. margin: 30rpx auto;
  140. font-size: 28rpx;
  141. border: 1rpx solid #ccc;
  142. padding: 12rpx;
  143. box-sizing: border-box;
  144. background-color: white;
  145. }
  146. .list-item>view {
  147. margin-bottom: 10rpx;
  148. }
  149. .bottom-line {
  150. text-align: center;
  151. margin: 30rpx 0;
  152. }
  153. .uni-input {
  154. width: 200rpx;
  155. border: 1rpx solid #ccc;
  156. border-radius: 10rpx;
  157. }
  158. </style>