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

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