634 lines
20 KiB
Vue
634 lines
20 KiB
Vue
<!--会员充值订单-->
|
|
<template>
|
|
<div class="app-container"> <!-- 条件查询-->
|
|
<el-card class="box-card">
|
|
<!-- <div style="display: flex;">-->
|
|
<!-- <div class="top-app-sou">-->
|
|
<!-- <el-form :label-position="labelPosition" label-width="40px" :model="formLabelAlign">-->
|
|
<!-- <el-form-item label="名称">-->
|
|
<!-- <el-input v-model="formLabelAlign.name" placeholder="请输入要搜索的内容"></el-input>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-form>-->
|
|
<!-- </div>-->
|
|
<!-- <div style="margin-left: 10px">-->
|
|
<!-- <el-button type="primary" icon="el-icon-search">搜索</el-button>-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
|
<el-form-item label="" prop="staffId">
|
|
<el-select
|
|
v-model="queryParams.mtStaffId"
|
|
clearable
|
|
placeholder="交易员工"
|
|
>
|
|
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
|
|
<span style="float: left">{{ item.realName }}</span>
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="" prop="paymentType">
|
|
<el-select
|
|
v-model="queryParams.paymentType"
|
|
clearable
|
|
placeholder="支付类型"
|
|
>
|
|
<el-option v-for="item in payList"
|
|
:key="item.id"
|
|
:label="item.dictLabel"
|
|
:value="item.dictValue">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="">
|
|
<el-input v-model="queryParams.mobile" placeholder="手机号"></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: 160px"
|
|
type="date"
|
|
placeholder="交易开始日期">
|
|
</el-date-picker>
|
|
至
|
|
<el-date-picker
|
|
v-model="endTime"
|
|
style="width: 160px"
|
|
type="date"
|
|
placeholder="交易结束日期">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item style="float: right">
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</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-bole">{{orderStatistics.numberOfTopUps?orderStatistics.numberOfTopUps:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">充值笔数</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 4666@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box">
|
|
<div class="size-bole">{{orderStatistics.theTotalAmountOfTopUp?orderStatistics.theTotalAmountOfTopUp:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">充值总金额</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 4666@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box">
|
|
<div class="size-bole">{{orderStatistics.theTotalAmountOfTheCredit?orderStatistics.theTotalAmountOfTheCredit:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">赠送总额</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 4666@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box">
|
|
<div class="size-bole">{{orderStatistics.totalAmountReceived?orderStatistics.totalAmountReceived:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">实收总额</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 4666@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box1">
|
|
<div class="size-bole">{{orderStatistics.wechat?orderStatistics.wechat:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">微信</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 5017@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box1">
|
|
<div class="size-bole">{{orderStatistics.alipay?orderStatistics.alipay:0}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">支付宝</div>
|
|
<div class="icon-img">
|
|
<img src="../../assets/images/cut/组 5017@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box1">
|
|
<div class="size-bole">{{orderStatistics.cash}}</div>
|
|
<div class="size-hui">
|
|
<div class="nei">现金</div>
|
|
<div class="icon-img">
|
|
<img style="width: 20px;height: 20px " src="../../assets/images/cut/组 5017@2x.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
<!-- 表格-->
|
|
<el-card class="box-card">
|
|
<div class="wgang">
|
|
<!-- 会员充值列表-->
|
|
<div></div>
|
|
<div style="display: flex ">
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="exportExcelVip()">导出订单</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="table-box">
|
|
<el-table
|
|
:data="list"
|
|
style="width: 100%">
|
|
<!-- <el-table-column type="expand">-->
|
|
<!-- <template slot-scope="props">-->
|
|
<!-- <el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">-->
|
|
<!-- <el-form-item label="会员名称">-->
|
|
<!-- <span>{{ props.row.name }}</span>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item label="会员手机号">-->
|
|
<!-- <span>{{ props.row.mobile }}</span>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item label="操作人">-->
|
|
<!-- <span>{{ props.row.realName }}</span>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item label="操作人手机号">-->
|
|
<!-- <span>{{ props.row.staffMobile }}</span>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item label="储值优惠">-->
|
|
<!-- <span>充值满{{ props.row.rechargeBalance }}元赠送{{ props.row.giftBalance }}元</span>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-form>-->
|
|
<!-- </template>-->
|
|
<!-- </el-table-column>-->
|
|
<el-table-column type="index" width="50" align="center" label="序号"/>
|
|
<el-table-column prop="name" label="会员名称" align="center"> </el-table-column>
|
|
<el-table-column prop="mobile" label="会员手机号" align="center"> </el-table-column>
|
|
<el-table-column prop="bidBalance" label="到账金额" align="center"> </el-table-column>
|
|
<el-table-column prop="rechargeBalance" label="储值卡实售金额" align="center"> </el-table-column>
|
|
<el-table-column prop="giftBalance" label="储值卡赠送金额" align="center"></el-table-column>
|
|
<el-table-column prop="paymentType" label="支付方式" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{getType(payList,scope.row.paymentType)}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="payStatus" label="支付状态" align="center">
|
|
<template slot-scope="scope">
|
|
<el-tag v-if="scope.row.payStatus == 'unpaid'">未支付</el-tag>
|
|
<el-tag type="success" v-else-if="scope.row.payStatus == 'paid'">已支付</el-tag>
|
|
<el-tag type="danger" v-else>支付失败</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="realName" label="交易员工" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{scope.row.realName || getStaffName(staffList,scope.row.mtStaffId)}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="remark" label="充值备注" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.remark ? scope.row.remark:"--" }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="fringeBenefit" label="储值优惠" width="180" align="center">
|
|
<template slot-scope="scope">
|
|
<span>充值满{{ scope.row.rechargeBalance }}元赠送{{ scope.row.giftBalance }}元</span>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
|
<!-- <template slot-scope="scope">-->
|
|
<!-- <!– <el-button size="mini" type="text" icon="el-icon-edit">更多操作</el-button>–>-->
|
|
<!-- <el-button style="width: 60px" size="mini"-->
|
|
<!-- @click="patchwork(scope.row)"-->
|
|
<!-- type="primary" plain round>补打</el-button>-->
|
|
<!-- <el-button style="width: 60px" size="mini"-->
|
|
<!-- @click="handleRefund(scope.row.id)"-->
|
|
<!-- type="danger" 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.pageNo"
|
|
:limit.sync="queryParams.pageSize"
|
|
@current-change="getList">
|
|
</el-pagination>
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
<!-- 订单退款-->
|
|
<el-dialog
|
|
title="订单退款"
|
|
width="25%"
|
|
:visible.sync="dialogRefund">
|
|
<div style="text-align: center;font-weight: bold">
|
|
¥<span style="font-size: 35px">{{ oilOrder.rechargeBalance }}</span>
|
|
</div>
|
|
<div class="tk">退款金额</div>
|
|
<div class="tk">会员手机号:{{ oilOrder.mobile }}</div>
|
|
<div style="margin: 10px 0">
|
|
退款原因<br/>
|
|
<el-radio-group v-model="radio1" style="margin: 10px 0">
|
|
<el-radio-button label="充值类型选错"></el-radio-button>
|
|
<el-radio-button label="充值金额错误"></el-radio-button>
|
|
<el-radio-button label="其他原因"></el-radio-button>
|
|
</el-radio-group>
|
|
</div>
|
|
<div>
|
|
<el-input placeholder="请输入密码" v-model="password" show-password></el-input>
|
|
<br/>
|
|
<span style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回、优惠券、储值卡等原路退回处理</span>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogRefund = false">取 消</el-button>
|
|
<el-button type="primary" @click="refundConfirmed()">确 定</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
<!-- 支付成功后小票打印内容-->
|
|
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
|
|
<div class="box-title">订单统计</div>
|
|
<div class="input-box">
|
|
<div>支付方式</div>
|
|
<div v-if="oilOrder.paymentType == 'CASH'">现金</div>
|
|
<div v-else-if="oilOrder.paymentType == 'WECHAT'">微信</div>
|
|
<div v-else-if="oilOrder.paymentType == 'ALIPAY'">支付宝</div>
|
|
<div v-else-if="oilOrder.paymentType == 'UNIONPAY'">银联二维码</div>
|
|
</div>
|
|
<div class="input-box">
|
|
<div>储值卡面值</div>
|
|
<div>¥{{ oilOrder.bidBalance }}</div>
|
|
</div>
|
|
<div class="input-box">
|
|
<div>赠送金额</div>
|
|
<div>¥{{ oilOrder.giftBalance }}</div>
|
|
</div>
|
|
<div class="input-box">
|
|
<div>实付金额</div>
|
|
<div>¥{{ oilOrder.rechargeBalance }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
cardValueRecordInfo,
|
|
listCardValueRecord,
|
|
listCardValueRecords,
|
|
orderStatisticsApi
|
|
} from "@/api/order/cardvaluerecord";
|
|
import {getDicts} from "@/api/order/data";
|
|
import {queryStaffs} from "@/api/order/staff";
|
|
import { exportExcelVipApi } from "@/api/order/exportExcel";
|
|
import {refundApi} from "@/api/order/refund";
|
|
|
|
|
|
export default {
|
|
name: "order_Cashier",
|
|
data(){
|
|
return{
|
|
// 员工列表
|
|
staffList:[],
|
|
// 日期范围
|
|
dateRange: [],
|
|
beginTime:"",
|
|
endTime:"",
|
|
oilOrder:{},
|
|
// 退款密码
|
|
password:"",
|
|
radio1:"充值类型选错",
|
|
dialogRefund:false,
|
|
// 支付方式列表
|
|
payList:[],
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
},
|
|
// 列表信息
|
|
list:[],
|
|
// 总条数
|
|
total:0,
|
|
|
|
labelPosition: 'right',
|
|
formLabelAlign: {
|
|
name: '',
|
|
},
|
|
|
|
orderStatistics: {
|
|
numberOfTopUps:'',
|
|
theTotalAmountOfTopUp:'',
|
|
theTotalAmountOfTheCredit:'',
|
|
totalAmountReceived:'',
|
|
wechat:'',
|
|
alipay:'',
|
|
cash:'',
|
|
},
|
|
// 是否为当天时间
|
|
isSysDate:false,
|
|
}
|
|
},
|
|
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.getPayList();
|
|
this.getOrderStatistics()
|
|
},
|
|
methods:{
|
|
// 获取员工名称
|
|
getStaffName(list,id){
|
|
let name = "--"
|
|
if (id){
|
|
list.forEach(item => {
|
|
if (item.id == id){
|
|
name = item.realName
|
|
}
|
|
})
|
|
}
|
|
return name;
|
|
},
|
|
exportExcelVip() {
|
|
let dateRange = []
|
|
if (this.beginTime && this.endTime) {
|
|
dateRange.push(this.beginTime.toLocaleDateString())
|
|
dateRange.push(this.endTime.toLocaleDateString())
|
|
}
|
|
exportExcelVipApi(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())
|
|
}
|
|
orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
|
|
this.orderStatistics = res.data
|
|
})
|
|
|
|
},
|
|
|
|
// 补打
|
|
patchwork(data){
|
|
const orderNo = data.name
|
|
this.$modal.confirm('确定您要补打当前订单吗?当前会员[' + orderNo + '],请确保云打印机正在运行中').then(function() {
|
|
// return delUser(row.id);
|
|
}).then(() => {
|
|
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
|
|
}).catch(() => {});
|
|
},
|
|
// 退款
|
|
handleRefund(id){
|
|
this.dialogRefund = true;
|
|
cardValueRecordInfo(id).then( response => {
|
|
this.oilOrder = response.data
|
|
})
|
|
},
|
|
|
|
refundConfirmed() {
|
|
this.dialogRefund = false;
|
|
// 退款确定
|
|
// cashierOrder
|
|
console.log("oilOrder",this.oilOrder)
|
|
let map={
|
|
orderNo: this.oilOrder.paymentNo,
|
|
// refundAmt: this.oilOrder.paymentNo,
|
|
storeId: this.oilOrder.storeId,
|
|
type: "oilOrder"
|
|
}
|
|
refundApi(map).then(res=>{
|
|
|
|
})
|
|
},
|
|
getType(list,val){
|
|
let name = "";
|
|
list.forEach(item => {
|
|
if (item.dictValue == val){
|
|
name = item.dictLabel
|
|
}
|
|
})
|
|
return name;
|
|
},
|
|
// 获取支付列表信息
|
|
getPayList(){
|
|
getDicts("payment_type").then( response => {
|
|
this.payList = response.data;
|
|
})
|
|
queryStaffs().then( response => {
|
|
this.staffList = response.data;
|
|
})
|
|
},
|
|
// 搜索按钮操作
|
|
handleQuery() {
|
|
this.queryParams.pageNo = 1;
|
|
this.getList();
|
|
this.getOrderStatistics();
|
|
},
|
|
// 重置按钮操作
|
|
resetQuery() {
|
|
this.dateRange = [];
|
|
this.queryParams = {
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
}
|
|
this.beginTime = ""
|
|
this.endTime = ""
|
|
// this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
},
|
|
// 获取列表信息
|
|
getList(val){
|
|
if (val!=undefined){
|
|
this.queryParams.pageNo = val
|
|
}
|
|
|
|
let dateRange1 = this.dateRange
|
|
// let dateRange = []
|
|
// if (this.isSysDate){
|
|
// dateRange.push(dateRange1[0].toLocaleDateString())
|
|
// dateRange.push(dateRange1[1].toLocaleDateString())
|
|
// }else {
|
|
// dateRange = this.dateRange
|
|
// }
|
|
let dateRange = []
|
|
if (this.beginTime && this.endTime) {
|
|
dateRange.push(this.beginTime.toLocaleDateString())
|
|
dateRange.push(this.endTime.toLocaleDateString())
|
|
}
|
|
|
|
listCardValueRecords(this.addDateRange(this.queryParams, dateRange)).then( response => {
|
|
this.list = response.data.records;
|
|
this.total = response.data.total;
|
|
this.isSysDate = false
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
.app-container{
|
|
width: 100%;
|
|
height: 100%;
|
|
background: #f6f8f9;
|
|
}
|
|
.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{
|
|
padding: 5px;
|
|
margin-right: 20px;
|
|
padding-left: 20px;
|
|
margin-bottom: 20px;
|
|
|
|
width: 211px;
|
|
height: 60px;
|
|
background: rgba(64,158,255,0.05);
|
|
border-radius: 6px 6px 6px 6px;
|
|
border: 1px solid #409EFF;
|
|
}
|
|
.el-form--inline .el-form-item {
|
|
margin-right: 44px;
|
|
}
|
|
.size-hui{
|
|
display: flex;
|
|
align-items: center;
|
|
//width: 200px;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 13px;
|
|
color: #888888;
|
|
//line-height: 0px;
|
|
text-align: left;
|
|
font-style: normal;
|
|
text-transform: none;
|
|
.nei {
|
|
width: 150px;
|
|
}
|
|
}
|
|
.size-bole{
|
|
//font-weight: bold;
|
|
|
|
//width: 53px;
|
|
height: 31px;
|
|
font-family: YouSheBiaoTiHei;
|
|
font-weight: 400;
|
|
font-size: 24px;
|
|
color: #555555;
|
|
//line-height: 0px;
|
|
text-align: left;
|
|
font-style: normal;
|
|
text-transform: none;
|
|
}
|
|
.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;
|
|
}
|
|
|
|
.icon-img{
|
|
|
|
width: 100%;
|
|
height: 20px;
|
|
margin-right: 5px;
|
|
img{
|
|
float: right;
|
|
//width: 100%;
|
|
width: 20px;
|
|
height: 100%;
|
|
}
|
|
}
|
|
.box1{
|
|
//box-sizing: border-box;
|
|
padding: 5px;
|
|
//background: #f9f9f9;
|
|
margin-right: 20px;
|
|
margin-bottom: 20px;
|
|
padding-left: 20px;
|
|
|
|
width: 211px;
|
|
height: 60px;
|
|
background: rgba(255,150,85,0.05);
|
|
border-radius: 6px 6px 6px 6px;
|
|
border: 1px solid #FF9655;
|
|
}
|
|
</style>
|