|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="content">
- <view class="top-content">
- <view class="example-body">
- <uni-datetime-picker v-model="state.range" type="daterange" />
- <button size="mini" style="color: #ffffff;
- backgroundColor: rgb(118, 200, 77);
- borderColor: rgb(118, 200, 77);
- font-size: 26rpx;
- flex-shrink: 0;margin-left: 20rpx;" @click="search()">搜索</button>
- </view>
- </view>
-
-
- <view class="uni-container" v-if="state.listData.length>0">
- <view class="list-item" v-for="(item,index) in state.listData">
- <view><text>姓名:</text><text>{{item.customerName}}</text></view>
- <view><text>证件号码:</text><text>{{item.customerIdNum}}</text></view>
- <view><text>通行次数:</text><text>{{item.num}}</text></view>
- <view><text>通行年月:</text><text>{{item.handleDate}}</text></view>
- <view><text>通行车牌号:</text><text>{{state.vehicleNum}}</text></view>
- <view><text>通行车牌颜色:</text><text>{{state.vehicleColor}}</text></view>
- <view><text>月通行总额:</text><text>{{item.money/100}}元</text></view>
- </view>
- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
- </view>
- <view v-else class="uni-container" style="text-align: center;">
- 暂无数据
- </view>
-
- </view>
-
- </template>
-
- <script setup lang="ts">
- import { reactive } from "vue";
- import {
- businessType
- } from "@/datas/businessType.js"
- import empty from "@/components/empty/empty.vue";
- import { onLoad, onReachBottom } from "@dcloudio/uni-app";
- import { monthStatementApi,getUserMsg } from "@/utils/network/api.js";
- import { stringToJson } from "@/utils/network/encryption";
- import { request } from "@/utils/network/request.js";
- import { getItem, StorageKeys } from "@/utils/storage";
- import { getVehiclePlateColor} from "@/datas/vehiclePlateColor";
- const state = reactive({
- startTime: Date.now(), //日期
- listData: [],
- range: ['', ''],
- flags: false,
- vehicleId:"",
- customerIdNum:"",
- vehicleNum:"",
- vehicleColor:""
- })
- onLoad((option) => {
- console.log("option",option.vehicleId)
- state.vehicleId = option.vehicleId;
- state.vehicleNum = option.vehicleId.split('_')[0];
- console.log("option.vehicleId.split('_')[1]",getVehiclePlateColor(option.vehicleId.split('_')[1]))
- state.vehicleColor = getVehiclePlateColor(option.vehicleId.split('_')[1]);
- getUserinfo()
- })
- const getUserinfo = () => {
- const options = {
- type: 2,
- data: {openId: getItem('openId')},
- method: "POST",
- showLoading: true,
- };
- request(getUserMsg, options).then((res) => {
- const data = stringToJson(res.bizContent);
- console.log(data,"用户信息");
- state.customerIdNum=data.customerIdNum
- });
- }
- //业务完成日志
- const search = () => {
- var data = {
- startDate: state.range[0],
- endDate: state.range[1],
- vehicleId:state.vehicleId,
- customerIdNum:state.customerIdNum
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
-
- request(monthStatementApi, options).then((res) => {
- const data = stringToJson(res.bizContent);
- state.listData = stringToJson(res.bizContent).data
- console.log("业务完成日志", state.listData,)
- });
- }
- </script>
-
- <style scoped>
- .top-content {
- position: fixed;
- left: 0;
- top: 0;
- background-color: white;
- width: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- }
-
- .content {
- font-size: 32rpx;
- padding: 20rpx 30rpx;
- background-color: #EEF7F7;
- min-height: 100vh;
- }
-
- .card {
- display: flex;
- margin: 0 20rpx;
- align-items: center;
- }
-
- .title {
- margin-bottom: 20rpx;
- }
-
- .uni-container {
- margin: 50rpx 0;
- margin-top: 150rpx;
- }
-
- /deep/.uni-table-th,
- /deep/.uni-table-td {
- padding: 0 !important;
- font-size: 12px !important;
- }
-
- /deep/.uni-date__x-input,
- /deep/.uni-select {
- font-size: 13px;
- height: 30px;
- line-height: 30px;
- }
-
- /deep/.uni-stat__select {
- width: 360rpx;
- }
-
- /deep/.uni-select__selector-empty,
- /deep/.uni-select__selector-item {
- font-size: 13px !important;
- }
-
- /deep/.uni-date {
- width: 73% !important;
- }
-
- .example-body {
- display: flex;
- align-items: center;
- margin-top: 20rpx;
- }
-
- /deep/.uni-date-x {
- height: 76rpx !important;
- }
-
- .list-item {
- width: 95%;
- border-radius: 10rpx;
- margin: 30rpx auto;
- font-size: 28rpx;
- border: 1rpx solid #ccc;
- padding: 12rpx;
- box-sizing: border-box;
- background-color: white;
- }
-
- .list-item>view {
- margin-bottom: 10rpx;
- }
-
- .bottom-line {
- text-align: center;
- margin: 30rpx 0;
- }
- </style>
|