前端BUG

This commit is contained in:
zhaohengkun 2024-10-08 11:41:23 +08:00
parent 11a2fe0512
commit 3997cb795d

View File

@ -6,7 +6,8 @@
<div class="d-s" style="margin-bottom: 0px;justify-content: space-between"> <div class="d-s" style="margin-bottom: 0px;justify-content: space-between">
<div class="d-s"> <div class="d-s">
<div class="anniu-h" :class="{ 'anniu-act': index == timeIndex }" v-for="(item,index) in timeList" <div class="anniu-h" :class="{ 'anniu-act': index == timeIndex }" v-for="(item,index) in timeList"
:key="index" @click="editColor(index)"> :key="index" @click="editColor(index)"
>
{{ item }} {{ item }}
</div> </div>
<el-date-picker <el-date-picker
@ -18,7 +19,8 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:disabled="disabled" :disabled="disabled"
@click="handleQuery"> @click="handleQuery"
>
</el-date-picker> </el-date-picker>
<div style="margin-left: 15px;margin-top: 17px"> <div style="margin-left: 15px;margin-top: 17px">
<el-form-item label="" prop="deptId" style="width: 180px"> <el-form-item label="" prop="deptId" style="width: 180px">
@ -43,7 +45,10 @@
<div class="wrap-boxs"> <div class="wrap-boxs">
<div class="k_" id="k_1"> <div class="k_" id="k_1">
<div class="size_">交易金额汇总数/交易笔数</div> <div class="size_">交易金额汇总数/交易笔数</div>
<div class="title_">{{ orderStatistics.payMoney?orderStatistics.payMoney:0 }}/{{ orderStatistics.count }}</div> <div class="title_">{{ orderStatistics.payMoney ? orderStatistics.payMoney : 0 }}/{{
orderStatistics.count
}}
</div>
</div> </div>
<div class="k_" id="k_2" v-for="item in orderStatistics.fenxiByDaili2ByData"> <div class="k_" id="k_2" v-for="item in orderStatistics.fenxiByDaili2ByData">
<div class="size_">{{ item.paymentChannel }}交易金额</div> <div class="size_">{{ item.paymentChannel }}交易金额</div>
@ -55,7 +60,8 @@
<div class="table-box"> <div class="table-box">
<el-table <el-table
:data="orderList" :data="orderList"
style="width: 100%"> style="width: 100%"
>
<el-table-column type="index" width="50" align="center" label="序号"/> <el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column align="center" prop="storeName" label="机构名称"></el-table-column> <el-table-column align="center" prop="storeName" label="机构名称"></el-table-column>
<el-table-column align="center" prop="parentName" label="所属机构"></el-table-column> <el-table-column align="center" prop="parentName" label="所属机构"></el-table-column>
@ -75,7 +81,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="fuYouAmount" label="富友交易占比"> <el-table-column align="center" prop="fuYouAmount" label="富友交易占比">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{(scope.row.fuYouAmount/(scope.row.payMoney)).toFixed(2) + '%' || 0}}</span> <span>{{ formatPercentage(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="laKaLaAmount" label="拉卡拉交易金额"> <el-table-column align="center" prop="laKaLaAmount" label="拉卡拉交易金额">
@ -90,7 +96,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="count92" label="拉卡拉交易占比"> <el-table-column align="center" prop="count92" label="拉卡拉交易占比">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{(scope.row.laKaLaAmount/(scope.row.payMoney)).toFixed(2) + '%' || 0}}</span> <span>{{ formatPercentage2(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -122,15 +128,15 @@ import {
getRunningWaterByTissueApi, getRunningWaterByTissueApi,
getTissueByDataApi, getTissueByDataApi,
getTradingPageApi getTradingPageApi
} from "@/api/allOrder"; } from '@/api/allOrder'
import {getFenXiOilOrderDataApi, getFenXiOilOrderListApi} from "@/api/financialStatement/yunyingfenxi"; import { getFenXiOilOrderDataApi, getFenXiOilOrderListApi } from '@/api/financialStatement/yunyingfenxi'
import {parseTime} from "@/utils/fuint"; import { parseTime } from '@/utils/fuint'
export default { export default {
name: "dai_yunyingfenxi-paym", name: 'dai_yunyingfenxi-paym',
data() { data() {
return { return {
radio1: "油号选错", radio1: '油号选错',
loading: false, loading: false,
dialogVisible: false, dialogVisible: false,
// //
@ -138,21 +144,20 @@ export default {
ordersInfo: {}, ordersInfo: {},
// //
dateRange: [], dateRange: [],
beginTime: "", beginTime: '',
endTime: "", endTime: '',
// //
isSysDate: false, isSysDate: false,
// //
orderList: [], orderList: [],
deptList: [], deptList: [],
timeList: [ timeList: [
"今日", '今日',
"近一周", '近一周',
"近一月", '近一月',
"近一年", '近一年',
"自定义", '自定义'
], ],
timeIndex: 0, timeIndex: 0,
disabled: true, disabled: true,
@ -161,15 +166,15 @@ export default {
queryParams: { queryParams: {
page: 1, page: 1,
pageSize: 10, pageSize: 10,
beginTime: "", beginTime: '',
endTime: "", endTime: '',
orderNo: "", orderNo: '',
status: "", status: '',
payType: "", payType: '',
payChannel: "", payChannel: '',
deptType: "3", deptType: '3',
storeId: "", storeId: '',
deptId: "", deptId: ''
}, },
orderStatistics: { orderStatistics: {
count: '0', count: '0',
@ -183,53 +188,63 @@ export default {
{ {
paymentChannel: '拉卡拉', paymentChannel: '拉卡拉',
payMoneyChannel: '0' payMoneyChannel: '0'
}, }
] ]
}, },
total: 0, total: 0
} }
}, },
created() { created() {
let start = new Date(); let start = new Date()
start.setHours(0) start.setHours(0)
start.setMinutes(0) start.setMinutes(0)
start.setSeconds(0) start.setSeconds(0)
start.setMilliseconds(0) start.setMilliseconds(0)
this.dateRange = [start, new Date()]; this.dateRange = [start, new Date()]
this.beginTime = start this.beginTime = start
this.endTime = new Date() this.endTime = new Date()
this.isSysDate = true this.isSysDate = true
let start1 = new Date(); let start1 = new Date()
start1.setHours(0) start1.setHours(0)
start1.setMinutes(0) start1.setMinutes(0)
start1.setSeconds(0) start1.setSeconds(0)
start1.setMilliseconds(0) start1.setMilliseconds(0)
this.value2 = [parseTime(start1), parseTime(new Date())]; this.value2 = [parseTime(start1), parseTime(new Date())]
this.getList(); this.getList()
this.getDeptList(); this.getDeptList()
}, },
methods: { methods: {
formatPercentage(row) {
const percentage = (row.fuYouAmount / row.payMoney) * 100
return percentage.toFixed(2) + '%' || '0%'
},
formatPercentage2(row) {
const percentage = (row.laKaLaAmount / row.payMoney) * 100
return percentage.toFixed(2) + '%' || '0%'
},
editColor(index) { editColor(index) {
this.timeIndex = index this.timeIndex = index
this.disabled = true this.disabled = true
if (this.timeList[index] == '今日') { if (this.timeList[index] == '今日') {
let start = new Date(); let start = new Date()
start.setHours(0) start.setHours(0)
start.setMinutes(0) start.setMinutes(0)
start.setSeconds(0) start.setSeconds(0)
start.setMilliseconds(0) start.setMilliseconds(0)
this.value2 = [start, new Date()]; this.value2 = [start, new Date()]
} else if (this.timeList[index] == '近一周') { } else if (this.timeList[index] == '近一周') {
let nowDate = new Date(); let nowDate = new Date()
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)]
} else if (this.timeList[index] == '近一月') { } else if (this.timeList[index] == '近一月') {
let nowDate = new Date(); let nowDate = new Date()
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)]
} else if (this.timeList[index] == '近一年') { } else if (this.timeList[index] == '近一年') {
let nowDate = new Date(); let nowDate = new Date()
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate()) let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)]
} else if (this.timeList[index] == '自定义') { } else if (this.timeList[index] == '自定义') {
@ -239,7 +254,7 @@ export default {
}, },
getDeptList() { getDeptList() {
getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then(response => { getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then(response => {
this.deptList = response.data.records; this.deptList = response.data.records
}) })
}, },
exportExcelCashier() { exportExcelCashier() {
@ -249,7 +264,7 @@ export default {
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res => { exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res => {
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}); const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
this.$download.saveAs(blob, '交易明细统计.xLsx') this.$download.saveAs(blob, '交易明细统计.xLsx')
}) })
}, },
@ -278,11 +293,10 @@ export default {
} }
] ]
} }
console.log("res.data1111", res.data) console.log('res.data1111', res.data)
}) })
}, },
// //
getList(val) { getList(val) {
let dateRange = [] let dateRange = []
@ -291,39 +305,39 @@ export default {
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
getFenxiByDailiApi(this.addDateRange(this.queryParams, this.value2)).then(response => { getFenxiByDailiApi(this.addDateRange(this.queryParams, this.value2)).then(response => {
this.orderList = response.data.records; this.orderList = response.data.records
this.total = response.data.total; this.total = response.data.total
this.isSysDate = false this.isSysDate = false
}) })
this.getOrderStatistics() this.getOrderStatistics()
}, },
getOrdersInfo(data) { getOrdersInfo(data) {
this.dialogVisible = true; this.dialogVisible = true
this.ordersInfo = data this.ordersInfo = data
}, },
// //
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1
this.getList(); this.getList()
}, },
// //
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.queryParams = { this.queryParams = {
page: 1, page: 1,
pageSize: 10, pageSize: 10
} }
this.beginTime = "" this.beginTime = ''
this.endTime = "" this.endTime = ''
let start1 = new Date(); let start1 = new Date()
start1.setHours(0) start1.setHours(0)
start1.setMinutes(0) start1.setMinutes(0)
start1.setSeconds(0) start1.setSeconds(0)
start1.setMilliseconds(0) start1.setMilliseconds(0)
this.value2 = [parseTime(start1), parseTime(new Date())]; this.value2 = [parseTime(start1), parseTime(new Date())]
this.timeIndex = 0 this.timeIndex = 0
this.handleQuery(); this.handleQuery()
}, }
} }
} }
</script> </script>