oil-station/fuintAdmin_zt/src/views/financialStatement/reconciliation/tab/trading.vue
2024-05-13 14:18:31 +08:00

455 lines
15 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 收银台订单-->
<template>
<div style="margin-top: 30px">
<el-card class="box-card">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="流水编号:">
<el-input v-model="queryParams.orderNo"></el-input>
</el-form-item>
<el-form-item label="交易时间:">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 400px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="datetimerange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<el-date-picker
v-model="beginTime"
style="width: 140px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 140px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="机构:" prop="deptId">
<el-select
v-model="queryParams.deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付渠道:" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="全部"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
<el-form-item label="支付方式:" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="全部"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item label="支付状态 " prop="status">
<el-select
v-model="queryParams.status"
clearable
placeholder="全部"
>
<el-option label="已支付" value="paid"/>
<el-option label="未支付" value="unpaid"/>
<el-option label="已退款" value="refund"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card">
<!-- <div slot="header" class="clearfix">-->
<!-- <span>收银台订单统计</span>-->
<!-- </div>-->
<div class="box-gang">
<div class="box">
<div class="size-hui">微信收款</div>
<div class="size-bole">{{ orderStatistics.cash }}元/{{orderStatistics.cashcount}}笔</div>
</div>
<div class="box">
<div class="size-hui">支付宝收款</div>
<div class="size-bole">{{ orderStatistics.wechat }}元/{{orderStatistics.wechatcount}}笔</div>
</div>
<div class="box">
<div class="size-hui">会员钱包收款</div>
<div class="size-bole">{{ orderStatistics.alipay }}元/{{orderStatistics.alipaycount}}笔</div>
</div>
<!-- <div class="box">-->
<!-- <div class="size-hui">银行卡收款</div>-->
<!-- <div class="size-bole">{{ 0 }}元/{{0}}笔</div>-->
<!-- </div>-->
<!-- <div class="box">-->
<!-- <div class="size-hui">银联云闪付收款</div>-->
<!-- <div class="size-bole">{{ 0 }}元/{{0}}笔</div>-->
<!-- </div>-->
<div class="box">
<div class="size-hui">现金支付收款</div>
<div class="size-bole">{{ orderStatistics.balance }}元/{{orderStatistics.balanceCount}}笔</div>
</div>
</div>
</el-card>
<el-card class="box-card">
<div class="wgang">
<div>机构流水分析列表</div>
</div>
<div class="table-box">
<el-table
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="payTime" align="center" label="支付时间" width="220"> </el-table-column>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="storeName" align="center" label="门店"> </el-table-column>
<el-table-column prop="createBy" align="center" label="收银员"> </el-table-column>
<el-table-column prop="payChannel" align="center" label="支付渠道"> </el-table-column>
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="amount" align="center" label="费率"> </el-table-column>
<el-table-column prop="type" align="center" label="订单来源">
</el-table-column>
<el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<span v-if="scope.row.payType=='CASH'">现金</span>
<span v-else-if="scope.row.payType=='WECHAT'">微信</span>
<span v-else-if="scope.row.payType=='ALIPAY'">支付宝</span>
<span v-else="">余额</span>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="支付状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status == 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="refMoney" align="center" label="退款金额"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>
<!-- <el-table-column prop="payAmount" align="center" label="手续费"> </el-table-column>-->
<el-table-column prop="userName" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="content" align="content" label="备注" width="110"> </el-table-column>
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini"
@click="getOrdersInfo(scope.row)"
type="success" plain round>详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- <div class="pagination-box">-->
<!-- <el-pagination-->
<!-- background-->
<!-- v-show="total>0"-->
<!-- layout="prev, pager, next"-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @current-change="getList">-->
<!-- </el-pagination>-->
<!-- </div>-->
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
<el-dialog
title="订单信息"
:visible.sync="dialogVisible">
<el-descriptions :title="'订单号:'+ordersInfo.orderNo">
<el-descriptions-item label="门店">{{ordersInfo.storeName}}</el-descriptions-item>
<el-descriptions-item label="收银员">{{ordersInfo.createBy}}</el-descriptions-item>
<el-descriptions-item label="支付渠道">{{ordersInfo.payChannel}}</el-descriptions-item>
<el-descriptions-item label="商户号">{{ordersInfo.mchntCd}}</el-descriptions-item>
<el-descriptions-item label="费率">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="订单来源">{{ordersInfo.type}}</el-descriptions-item>
<el-descriptions-item label="所属模块">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{ordersInfo.payType}}</el-descriptions-item>
<el-descriptions-item label="付款用户">{{ordersInfo.userName}}</el-descriptions-item>
<el-descriptions-item label="支付状态">{{ordersInfo.status}}</el-descriptions-item>
<el-descriptions-item label="备注">{{ordersInfo.content}}</el-descriptions-item>
<!-- <el-descriptions-item label="备注">-->
<!-- <el-tag size="small">学校</el-tag>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
<el-descriptions class="margin-top" title="金额详情" :column="3" border>
<el-descriptions-item>
<template slot="label">
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>
<script>
import {
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi
} from "@/api/allOrder";
export default {
name: "reconciliation-trading",
data(){
return{
radio1:"油号选错",
loading:false,
dialogVisible:false,
// 员工列表
staffList:[],
ordersInfo:{},
// 日期范围
dateRange: [],
beginTime:"",
endTime:"",
// 是否为当天时间
isSysDate:false,
// 收银台订单列表
orderList:[],
deptList:[],
// 查询参数
queryParams: {
page: 1,
pageSize: 10,
beginTime:"",
endTime:"",
orderNo:"",
status:"",
payType:"",
payChannel:"",
deptType:"3",
storeId:"",
deptId:"",
},
orderStatistics:{
CASH:"0",
WECHAT:"0",
ALIPAY:"0",
balance:"0",
CASHCount:"0",
WECHATCount:"0",
ALIPAYCount:"0",
balanceCount:"0",
refBalance:"0",
refBalanceCount:"0",
},
total:0,
}
},
created() {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.dateRange = [start,new Date()];
this.beginTime = start
this.endTime = new Date()
this.isSysDate = true
this.getList();
this.getDeptList();
},
methods:{
getDeptList() {
getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
this.deptList = response.data.records;
})
},
exportExcelCashier() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// exportExcelCashierApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
// this.$download.saveAs(blob,'收银台订单统计.xLsx')
// })
},
// 获取订单统计信息
getOrderStatistics() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getTissueByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
// 获取列表信息
getList(val){
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getTradingPageApi(this.addDateRange(this.queryParams),dateRange).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
},
// 搜索按钮操作
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
// 重置按钮操作
resetQuery() {
this.dateRange = [];
this.queryParams = {
page: 1,
pageSize: 10,
}
this.beginTime = ""
this.endTime = ""
this.handleQuery();
},
}
}
</script>
<style scoped>
.app-top{
width: 100%;
height: 60px;
box-sizing: border-box;
padding: 10px;
}
.clearfix{
width: 100%;
}
.box-card{
width: 100%;
margin-bottom: 15px;
}
.box-gang{
width: 100%;
display: flex;
align-items: center;
}
.box{
width: 200px;
box-sizing: border-box;
padding: 10px;
background: #f9f9f9;
height: 86px;
margin-right: 10px;
}
.size-hui{
font-size: 14px;
margin-bottom: 10px;
margin-top: 10px;
}
.size-bole{
font-weight: bold;
}
.wgang{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.table-box{
width: 100%;
}
.pagination-box{
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
}
.top-app-sou{
width: 20%;
}
.tk{
text-align: center;
color: grey;
margin: 10px 0;
}
</style>