123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- <template>
- <view class="wrapper">
- <!-- 背景颜色充满屏 -->
- <view class="bg-color"></view>
- <!-- 补卡额订单列表-->
- <view class="search-time">
- <view class="search-time-box">
- <view class="show-info">
- <view class="show-text">
- <picker class="picker date" mode="date" :value="dataTime.startDate" @change="bindDateStart">
- <text class="date-text text-val">{{dataTime.startDate?dataTime.startDate:'开始时间'}}</text>
- </picker>
- <text class="line"></text>
- <picker class="picker date" mode="date" :value="dataTime.endDate" @change="bindDateEnd">
- <text class="date-text text-val">{{dataTime.endDate?dataTime.endDate:'结束时间'}}</text>
- </picker>
- </view>
- <u-icon name="calendar" :custom-style="{color:'#999999', size: '28rpx'}"></u-icon>
- </view>
- </view>
- <view class="time-btn" @click="search">查询</view>
- </view>
- <view class="total-num" v-if="state.list.length > 0">
- <text>金额合计:{{state.aggregateAmount/100}}</text>
- <text class="total-space">通行次数: {{state.passTotal}}</text>
- <view class="btn btn-download" @click="doDownload">下载报表</view>
- </view>
- <view class="list-wrap" v-if="state.list.length >0">
- <view v-for="item in state.list" :key="item.listNo"
- :class="item.status === 3 ? ' card-info finished' : 'card-info'">
- <view class="info-wrap">
- <view class="info-left">
- <view class="info-left-text">
- <text class="label">单号:</text>
- <text class="val">{{item.listNo}}</text>
- </view>
- <view>
- <text class="label">卡号:</text>
- <text class="val">{{item.cardId}}</text>
- </view>
- </view>
- <view class="info-right">
- <view class="price-label">
- 交易金额
- </view>
- <view class="price-val">
- <text>¥</text>
- <text class="price-val-text">{{item.fee/100}}</text>
- </view>
- </view>
- </view>
- <view class="card-text-wrap">
- <view class="text-box">
- <text class="name-text">{{item.enName}}</text>
- <text
- class="time-text">{{item.enTime.substring(item.enTime.length -8 ,item.enTime.length-3)}}</text>
- <text class="date-text">{{item.enTime.substring(0,10)}}</text>
- </view>
- <view class="arrow-wrap">
- <text class="arrow-text">{{item.vehiclePlate}}</text>
- <image class="d-img" :src="`${$imgUrl}order/arrowCard.png`"></image>
- </view>
- <view class="text-box">
- <text class="name-text">{{item.exName}}</text>
- <text
- class="time-text">{{item.exTime.substring(item.exTime.length -8 ,item.exTime.length-3)}}</text>
- <text class="date-text">{{item.exTime.substring(0,10)}}</text>
- </view>
- </view>
- <view class="btn-wrap">
- <view>
- <text v-if="item.status === 2" class="status-wrap">审核进度:<text
- class="status-text">审核中</text></text>
- <text v-if="item.status === 3" class="status-wrap">审核进度:<text>已完成</text></text>
- </view>
- <view class="btn-1 btn" v-if="item.status === 1" @click="toApply(item)">补卡额申请</view>
- <view class="btn-1 btn" v-if="item.status === 2" @click="toView(item)">查看进度</view>
- <view class="btn-1 btn" v-if="item.status === 3" @click="toEvaluate(item)">去评价</view>
- </view>
- </view>
-
- </view>
- <view class="blank" v-else>
- <view class="text-center">暂无数据</view>
- </view>
- </view>
- </template>
-
- <script setup>
- import {
- reactive,
- ref
- } from "vue";
- import {
- request
- } from "@/utils/network/request.js";
-
- import {
- stringToJson
- } from "@/utils/network/encryption.js";
- import {
- orderDetail,
- passBills,
- passBillCount,
- downloadBills,
- } from "@/utils/network/api.js";
- import {
- onLoad
- } from '@dcloudio/uni-app'
- import {downloadFileURL} from '@/datas/fileURL.js'
- const dataTime = reactive({
- startDate: "开始时间",
- endDate: "结束时间"
- })
-
- const state = reactive({
- list: [],
- cardId: null,
- passTotal: 0,
- parkTotal: 0,
- aggregateAmount: 0,
- })
- onLoad((option) => {
- state.cardId = option.cardId;
- })
-
-
- const search = () => {
- getPpassBillCount()
-
- const options = {
- type: 2,
- data: {
- cardId: state.cardId,
- beforeDate: dataTime.startDate,
- afterDate: dataTime.endDate,
- },
- method: "POST",
- showLoading: true,
- };
- request(passBills, options).then((res) => {
- console.log(res);
- let result = stringToJson(res.bizContent)
- console.log(result);
- state.list = result.data ?result.data: []
- console.log(result.data);
-
- // let orderInfo = JSON.parse(res.bizContent);
- })
-
- }
- const getPpassBillCount = () => {
- const options = {
- type: 2,
- data: {
- cardId: state.cardId,
- starDate: dataTime.startDate,
- endDate: dataTime.endDate,
- },
- method: "POST",
- showLoading: true,
- };
- request(passBillCount, options).then((res) => {
- let result = stringToJson(res.bizContent)
- state.aggregateAmount = result.aggregateAmount ?result.aggregateAmount: 0
- state.passTotal = result.passTotal ? result.passTotal: 0
- state.parkTotal = result.parkTotal ?result.parkTotal: 0
- console.log(result);
- })
- }
-
- // 展示日历
- const bindDateStart = (e) => {
- console.log(e);
- // show.value = true
- dataTime.startDate = e.detail.value
- }
- // 展示日历
- const bindDateEnd = (e) => {
- console.log(e);
- dataTime.endDate = e.detail.value
- // show.value = true
- }
-
- // 补卡申请
- const toApply = (item) => {
- uni.navigateTo({
- // url: `/subpackage/orders/cardAmount?id=${item.id}`
- url: ""
- });
- }
- // 去评价
- const toEvaluate = (item) => {
- uni.navigateTo({
- // url: `/subpackage/orders/order-evaluate?id=${item.id}`
- url: ""
- });
- }
- // 查看进度
- const toView = (item) => {
- uni.navigateTo({
- // url: `/subpackage/orders/cardAmountDetail?id=${item.id}`
- url: ""
- });
- }
-
- //下载按钮事件
- const doDownload = () => {
- const options = {
- type: 2,
- data: {
- cardId: state.cardId,
- starDate: dataTime.startDate,
- endDate: dataTime.endDate,
- },
- method: "POST",
- showLoading: true,
- };
- request(downloadBills, options).then((res) => {
- let result = stringToJson(res.bizContent)
- console.log("downloadFileURL",downloadFileURL+result.ossFilePath);
- download(downloadFileURL+result.ossFilePath)
- })
- }
-
- //下载文件
- const download = (attachLink) => {
- let that = this
- uni.downloadFile({
- url: attachLink, //下载地址,后端接口获取的链接
- success: (data) => {
- console.log(data.tempFilePath)
- console.log(JSON.stringify(data))
- if (data.statusCode === 200) {
- uni.saveFile({ //文件保存到本地
- tempFilePath: data.tempFilePath, //临时路径
- success: function(res) {
- console.log("下载成功" + res.savedFilePath)
- console.log(JSON.stringify(res))
- uni.showToast({
- icon: 'none',
- mask: true,
- title: '文件已保存!',
- duration: 3000,
- });
- uni.openDocument({
- //fileType: 'docx',
- showMenu: true, //关键点,可以转发到微信
- filePath: res.savedFilePath,
- success: function(res) {
- console.log('打开文档成功');
- }
- });
- }
- });
- }
- },
- fail: (err) => {
- console.log(err);
- uni.showToast({
- icon: 'none',
- mask: true,
- title: '失败请重新下载',
- });
- },
- });
- }
- </script>
-
- <style lang="scss" scoped>
- .u-btn--primary {
- background: #00B38B;
- }
-
- .blank {
- font-size: 30rpx;
- text-align: center;
- }
-
- .bg-color {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: #EEF7F7;
- z-index: -1;
- }
-
- .search-box {
- margin: 30rpx 30rpx 20rpx 30rpx;
- height: 72rpx;
- height: 81rpx;
- background: #FFFFFF;
- border: 1px solid #DCDCDC;
- border-radius: 40rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- box-sizing: border-box;
- }
- .picker{
- flex: 1;
- }
- .search-time-box {
- flex: 1;
- }
-
- .search-box .icon {
- width: 48rpx;
- height: 48rpx;
- margin: 0 20rpx;
- }
-
- .search-box .search {
- flex: 1;
- margin-right: 20rpx;
- height: 100%;
- padding: 0 10rpx;
- font-size: 28rpx;
- color: #00b38b;
- }
-
- .scroll-view {
- white-space: nowrap;
- position: sticky;
- top: 0;
- background: #ffffff;
- box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
- }
-
- .search-time {
- display: flex;
- margin: 20rpx 30rpx 48rpx 30rpx;
-
- .time-btn {
- width: 130rpx;
- height: 80rpx;
- background: #00B38B;
- border-radius: 40rpx;
- color: #FFFFFF;
- font-size: 32rpx;
- line-height: 80rpx;
- text-align: center;
- margin-left: 19rpx;
- }
-
- .show-info {
- height: 80rpx;
- padding: 0 31rpx;
- background: #FFFFFF;
- border: 1px solid #DCDCDC;
- border-radius: 40rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .show-text {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- text-align: center;
- }
-
- .date-text {
- color: #999999;
- font-size: 28rpx;
- }
-
- .text-val {
- color: #333
- }
-
- .line {
- width: 25rpx;
- height: 1rpx;
- background: #999999;
- margin: 0 24rpx;
- }
- }
- }
-
- .total-num {
- font-size: 30rpx;
- color: #999999;
- display: flex;
- justify-content: space-evenly;
- align-items: center;
-
- // .total-space {
- // margin-left: 41rpx;
- // }
- }
- .btn-download{
- padding: 0 20rpx;
- border: 1px solid #00B38B;
- height: 60rpx;
- line-height: 60rpx;
- border-radius: 30rpx;
- font-size: 28rpx;
- color: #00B38B;
- }
-
- .list-wrap {
- margin: 30rpx;
- padding-bottom: 20rpx;
- }
-
- .card-info {
- background: #FFFFFF;
- box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- margin-bottom: 30rpx;
- padding: 30rpx 20rpx 10rpx 20rpx;
-
- .info-wrap {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1px solid #dcdcdc;
- padding-bottom: 30rpx;
-
- .info-left-text {
- margin-bottom: 15rpx;
- }
-
- .label {
- color: #999999;
- font-size: 26rpx;
- font-weight: 400;
- }
-
- .val {
- color: #333333;
- font-size: 26rpx;
- font-weight: 400;
- }
-
- .price-label {
- color: #999999;
- font-size: 24rpx;
- font-weight: 400;
- margin-bottom: 22rpx;
- text-align: center;
- }
-
- .price-val-text {
- font-size: 32rpx;
- font-weight: 700;
- color: #333333;
- margin-left: 9rpx;
- }
-
- .price-val {
- font-size: 26rpx;
- color: #333333;
- }
-
- }
-
- .card-text-wrap {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 38rpx 0 46rpx 0;
-
- .text-box {
- display: flex;
- flex-direction: column;
- align-items: center;
-
- .name-text {
- font-size: 30rpx;
- font-weight: 400;
- color: #333333;
- }
-
- .time-text {
- font-size: 30rpx;
- color: #333333;
- font-weight: 400;
- margin-top: 8rpx;
- }
-
- .date-text {
- font-size: 24rpx;
- color: #999999;
- font-weight: 400;
- margin-top: 8rpx;
- }
- }
-
- .arrow-wrap {
- display: flex;
- flex-direction: column;
- align-items: center;
-
- .d-img {
- width: 186rpx;
- height: 12rpx;
- }
-
- .arrow-text {
- color: #666666;
- font-size: 26rpx;
- }
- }
- }
-
- .btn-wrap {
- margin-top: 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .status-wrap {
- color: #999999;
- font-size: 26rpx;
- margin-right: 23rpx;
- }
-
- .status-text {
- color: #00B38B;
- }
-
- .btn {
- background: #FFFFFF;
- border: 1px solid #00B38B;
- border-radius: 30rpx;
- line-height: 61rpx;
- text-align: center;
- color: #00B38B;
- font-size: 26rpx;
- }
-
- .btn-1 {
- width: 171rpx;
- height: 61rpx;
- }
-
- .btn-2 {
- width: 141rpx;
- height: 61rpx;
- }
-
- .btn-3 {
- width: 121rpx;
- height: 61rpx;
- }
- }
- }
-
- .finished .info-wrap,
- .finished .card-text-wrap {
-
- .price-val,
- .price-val-text,
- .val,
- .text-box .time-text,
- .text-box .name-text,
- .arrow-wrap .arrow-text {
- color: #999999;
- }
- }
- </style>
|