Browse Source

通行流水修改

yxb
不甘寂寞 2 years ago
parent
commit
035fbf534a
3 changed files with 63 additions and 66 deletions
  1. 1
    0
      datas/fileURL.js
  2. 53
    57
      service/search/etcFlowingWater.vue
  3. 9
    9
      service/search/select-card.vue

+ 1
- 0
datas/fileURL.js View File

@@ -1,3 +1,4 @@
// export const fileURL = 'http://47.94.96.52/'
export const fileURL = 'http://222.85.144.89:19002/default-bucket/'
export const downloadFileURL = 'http://192.168.100.63:8087/user-export-excel/'
// export const fileURL = 'http://192.168.100.63:8087/default-bucket/'

+ 53
- 57
service/search/etcFlowingWater.vue View File

@@ -20,7 +20,11 @@
</view>
<view class="time-btn" @click="search">查询</view>
</view>
<view class="total-num" v-if="state.list.length > 0"><text>金额合计:{{state.aggregatAmout/100}}</text> <text class="total-space">通行次数:{{state.passTotal}}</text></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'">
@@ -103,7 +107,7 @@
import {
onLoad
} from '@dcloudio/uni-app'
import {downloadFileURL} from '@/datas/fileURL.js'
const dataTime = reactive({
startDate: "开始时间",
endDate: "结束时间"
@@ -112,23 +116,22 @@
const state = reactive({
list: [],
cardId: null,
passTotal:0,
parkTotal:0,
aggregatAmout:0,
passTotal: 0,
parkTotal: 0,
aggregateAmount: 0,
})
onLoad((option) => {
state.cardId =option.cardId;
// queryOrderDetail(option.cardId);
state.cardId = option.cardId;
})


const search = () => {
gePpassBillCount()
getPpassBillCount()

const options = {
type: 2,
data: {
cardId: state.cardId,//52011640230202987050
cardId: state.cardId,
beforeDate: dataTime.startDate,
afterDate: dataTime.endDate,
},
@@ -141,17 +144,16 @@
console.log(result);
state.list = result.data ?? []
console.log(result.data);
// let orderInfo = JSON.parse(res.bizContent);
})

}
const gePpassBillCount = ()=>{
const getPpassBillCount = () => {
const options = {
type: 2,
data: {
// cardId: state.cardId,//52011640230202987050
cardId: "52011328220201990321",//52011640230202987050
cardId: state.cardId,
starDate: dataTime.startDate,
endDate: dataTime.endDate,
},
@@ -160,33 +162,12 @@
};
request(passBillCount, options).then((res) => {
let result = stringToJson(res.bizContent)
state.aggregatAmout = result.aggregatAmout??0
state.passTotal = result.passTotal??0
state.parkTotal = result.parkTotal??0
state.aggregateAmount = result.aggregateAmount ?? 0
state.passTotal = result.passTotal ?? 0
state.parkTotal = result.parkTotal ?? 0
console.log(result);
})
}
const queryOrderDetail = (id) => {
const options = {
type: 2,
data: {
id: id,
},
method: "POST",
showLoading: true,
};
request(orderDetail, options).then((res) => {
// console.log(res);
let result = stringToJson(res.bizContent)
state.vehiclePlate = result.vehiclePlate ?? null
state.cardId = result.cardId ?? null
console.log(state);
search()
// let orderInfo = JSON.parse(res.bizContent);
})
}

// 展示日历
const bindDateStart = (e) => {
@@ -222,13 +203,13 @@
url: ""
});
}
//下载按钮事件
const doDownload= ()=>{
const doDownload = () => {
const options = {
type: 2,
data: {
cardId: state.cardId,//52011640230202987050
cardId: state.cardId,
starDate: dataTime.startDate,
endDate: dataTime.endDate,
},
@@ -237,16 +218,16 @@
};
request(downloadBills, options).then((res) => {
let result = stringToJson(res.bizContent)
// state.aggregatAmout = result.DetailDownLoadURL??0
download(result.DetailDownLoadURL)
console.log(downloadFileURL+result.ossFilePath);
download(downloadFileURL+result.ossFilePath)
})
}
//下载文件
const download = (attachLink) => {
const download = (attachLink) => {
let that = this
uni.downloadFile({
url: attachLink , //下载地址,后端接口获取的链接
url: attachLink, //下载地址,后端接口获取的链接
success: (data) => {
console.log(data.tempFilePath)
console.log(JSON.stringify(data))
@@ -254,17 +235,17 @@
uni.saveFile({ //文件保存到本地
tempFilePath: data.tempFilePath, //临时路径
success: function(res) {
console.log("下载成功"+res.savedFilePath)
console.log("下载成功" + res.savedFilePath)
console.log(JSON.stringify(res))
uni.showToast({
icon: 'none',
mask: true,
title: '文件已保存!',
title: '文件已保存!',
duration: 3000,
});
uni.openDocument({
//fileType: 'docx',
showMenu:true, //关键点,可以转发到微信
showMenu: true, //关键点,可以转发到微信
filePath: res.savedFilePath,
success: function(res) {
console.log('打开文档成功');
@@ -284,15 +265,14 @@
},
});
}

</script>

<style lang="scss" scoped>
.u-btn--primary {
background: #00B38B;
}
.blank{
.blank {
font-size: 30rpx;
text-align: center;
}
@@ -319,7 +299,9 @@
align-items: center;
box-sizing: border-box;
}

.picker{
flex: 1;
}
.search-time-box {
flex: 1;
}
@@ -376,6 +358,9 @@
.show-text {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
text-align: center;
}

.date-text {
@@ -397,13 +382,24 @@
}

.total-num {
font-size: 28rpx;
font-size: 30rpx;
color: #999999;
margin-left: 30rpx;
display: flex;
justify-content: space-evenly;
align-items: center;

.total-space {
margin-left: 41rpx;
}
// .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 {

+ 9
- 9
service/search/select-card.vue View File

@@ -1,6 +1,6 @@
<template>
<view class="selectCar-box">
<view v-if="state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.cards" :key="i">
<view v-if="state.cards.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.cards" :key="i">
<view class="iten-left">
<image :src="`${$imgUrl}card2.png`" mode=""></image>
<text>{{item.cardId}}</text>
@@ -47,7 +47,7 @@
} from "@/utils/network/encryption";

const state = reactive({
cards:[],
cards: [],
});
onLoad((option) => {
getCardList(option.vehicleId)
@@ -56,15 +56,15 @@
const flag = ref('0')

const choose = (i, item) => {
console.log(item,i)
console.log(item, i)
console.log(item.vehicleId);
getCardList(item.vehicleId)
navTo(`/service/search/etcFlowingWater?cardId=${item.cardId}`)
}
const getCardList = (vehicleId) => {
var data = {
vehicleId:vehicleId
vehicleId: vehicleId
};
const options = {
type: 2,
@@ -72,9 +72,9 @@
method: "POST",
showLoading: true,
};
request(cardList, options).then((res)=>{
let result =stringToJson(res.bizContent);
state.cards = result.cards??null;
request(cardList, options).then((res) => {
let result = stringToJson(res.bizContent);
state.cards = result.cards ?? null;
console.log(result.cards);
})
}
@@ -152,4 +152,4 @@


}
</style>
</style>

Loading…
Cancel
Save