Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

month-statement-query-list.vue 4.4KB

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