Compare commits

..

No commits in common. "3997cb795d1922141b1ac2308adaabb0e2cd25b8" and "2fc94aad3d4ab01db116a7624bc9d7507c1e9721" have entirely different histories.

2 changed files with 88 additions and 103 deletions

View File

@ -6,8 +6,7 @@
<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
@ -19,8 +18,7 @@
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">
@ -45,10 +43,7 @@
<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 }}/{{ <div class="title_">{{ orderStatistics.payMoney?orderStatistics.payMoney:0 }}/{{ orderStatistics.count }}</div>
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>
@ -60,8 +55,7 @@
<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>
@ -81,7 +75,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>{{ formatPercentage(scope.row) }}</span> <span>{{(scope.row.fuYouAmount/(scope.row.payMoney)).toFixed(2) + '%' || 0}}</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="拉卡拉交易金额">
@ -96,7 +90,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>{{ formatPercentage2(scope.row) }}</span> <span>{{(scope.row.laKaLaAmount/(scope.row.payMoney)).toFixed(2) + '%' || 0}}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -128,15 +122,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,
// //
@ -144,20 +138,21 @@ 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,
@ -166,15 +161,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',
@ -188,63 +183,53 @@ 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]=='自定义'){
@ -254,7 +239,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() {
@ -264,7 +249,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')
}) })
}, },
@ -293,10 +278,11 @@ export default {
} }
] ]
} }
console.log('res.data1111', res.data) console.log("res.data1111", res.data)
}) })
}, },
// //
getList(val) { getList(val) {
let dateRange = [] let dateRange = []
@ -305,39 +291,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>

View File

@ -725,10 +725,9 @@
SELECT SELECT
sum(CASE WHEN payment_channel = '富友' THEN pay_money ELSE 0 END) fuYouAmount, sum(CASE WHEN payment_channel = '富友' THEN pay_money ELSE 0 END) fuYouAmount,
sum(CASE WHEN payment_channel = '拉卡拉' THEN pay_money ELSE 0 END) laKaLaAmount, sum(CASE WHEN payment_channel = '拉卡拉' THEN pay_money ELSE 0 END) laKaLaAmount,
COUNT(CASE WHEN payment_channel = '富友' THEN 1 END) AS fuYouCount, count(CASE WHEN payment_channel = '富友' THEN 1 ELSE 0 END) AS fuYouCount,
COUNT(CASE WHEN payment_channel = '拉卡拉' THEN 1 END) AS laKaLaCount count(CASE WHEN payment_channel = '拉卡拉' THEN 1 ELSE 0 END) AS laKaLaCount
FROM from all_order_info
all_order_info
where where
store_id = #{order.storeId} store_id = #{order.storeId}
<if test="order.beginTime != null and order.beginTime != ''"><!-- 开始时间检索 --> <if test="order.beginTime != null and order.beginTime != ''"><!-- 开始时间检索 -->