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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 {
  34. businessType
  35. } from "@/datas/businessType.js"
  36. import empty from "@/components/empty/empty.vue";
  37. import { onLoad, onReachBottom } from "@dcloudio/uni-app";
  38. import { monthStatementApi, getUserMsg } from "@/utils/network/api.js";
  39. import { stringToJson } from "@/utils/network/encryption";
  40. import { request } from "@/utils/network/request.js";
  41. import { getItem, StorageKeys } from "@/utils/storage";
  42. import { getVehiclePlateColor } from "@/datas/vehiclePlateColor";
  43. import { msg, navTo } from "@/utils/utils";
  44. const state = reactive({
  45. startTime: Date.now(), //日期
  46. listData: [],
  47. range: ['', ''],
  48. flags: false,
  49. vehicleId: "",
  50. customerIdNum: "",
  51. vehicleNum: "",
  52. vehicleColor: "",
  53. date: "请选择月份"
  54. })
  55. onLoad((option) => {
  56. console.log("option", option.vehicleId)
  57. state.vehicleId = option.vehicleId;
  58. state.vehicleNum = option.vehicleId.split('_')[0];
  59. state.vehicleColor = getVehiclePlateColor(option.vehicleId.split('_')[1]);
  60. getUserinfo()
  61. })
  62. const bindDateChange = (e) => {
  63. state.date = e.detail.value
  64. }
  65. const getUserinfo = () => {
  66. const options = {
  67. type: 2,
  68. data: { openId: getItem('openId') },
  69. method: "POST",
  70. showLoading: true,
  71. };
  72. request(getUserMsg, options).then((res) => {
  73. const data = stringToJson(res.bizContent);
  74. console.log(data, "用户信息");
  75. state.customerIdNum = data.customerIdNum
  76. });
  77. }
  78. //业务完成日志
  79. const search = () => {
  80. if (state.date == '请选择月份') {
  81. msg("请选择月份");
  82. return;
  83. }
  84. var data = {
  85. startTime: state.date,
  86. // endTime: state.range[1],
  87. vehicleId: state.vehicleId,
  88. customerIdNum: state.customerIdNum
  89. };
  90. const options = {
  91. type: 2,
  92. data: data,
  93. method: "POST",
  94. showLoading: true,
  95. };
  96. request(monthStatementApi, options).then((res) => {
  97. const data = stringToJson(res.bizContent);
  98. state.listData = stringToJson(res.bizContent).data
  99. console.log("业务完成日志", state.listData,)
  100. });
  101. }
  102. const query = (handleDate, vehicleId) => {
  103. navTo(`/subpackage/personal-center/search/select-card?vehicleId=${vehicleId}&&handleDate=${handleDate}`)
  104. }
  105. </script>
  106. <style scoped>
  107. .top-content {
  108. position: fixed;
  109. left: 0;
  110. top: 0;
  111. background-color: white;
  112. width: 100%;
  113. padding: 20rpx;
  114. box-sizing: border-box;
  115. }
  116. .content {
  117. font-size: 32rpx;
  118. padding: 20rpx 30rpx;
  119. background-color: #EEF7F7;
  120. min-height: 100vh;
  121. }
  122. .card {
  123. display: flex;
  124. margin: 0 20rpx;
  125. align-items: center;
  126. }
  127. .title {
  128. margin-bottom: 20rpx;
  129. }
  130. .uni-container {
  131. margin: 50rpx 0;
  132. margin-top: 150rpx;
  133. }
  134. /* /deep/.uni-table-th,
  135. /deep/.uni-table-td {
  136. padding: 0 !important;
  137. font-size: 12px !important;
  138. }
  139. /deep/.uni-date__x-input,
  140. /deep/.uni-select {
  141. font-size: 13px;
  142. height: 30px;
  143. line-height: 30px;
  144. }
  145. /deep/.uni-stat__select {
  146. width: 360rpx;
  147. }
  148. /deep/.uni-select__selector-empty,
  149. /deep/.uni-select__selector-item {
  150. font-size: 13px !important;
  151. }
  152. /deep/.uni-date {
  153. width: 73% !important;
  154. } */
  155. .example-body {
  156. display: flex;
  157. align-items: center;
  158. margin-top: 20rpx;
  159. }
  160. /deep/.uni-date-x {
  161. height: 76rpx !important;
  162. }
  163. .list-item {
  164. width: 95%;
  165. border-radius: 10rpx;
  166. margin: 30rpx auto;
  167. font-size: 28rpx;
  168. border: 1rpx solid #ccc;
  169. padding: 12rpx;
  170. box-sizing: border-box;
  171. background-color: white;
  172. }
  173. .list-item>view {
  174. margin-bottom: 10rpx;
  175. }
  176. .bottom-line {
  177. text-align: center;
  178. margin: 30rpx 0;
  179. }
  180. .uni-input {
  181. width: 200rpx;
  182. border: 1rpx solid #ccc;
  183. border-radius: 10rpx;
  184. }
  185. </style>