587 lines
17 KiB
Vue
587 lines
17 KiB
Vue
<!--增值交易订单-->
|
||
<template>
|
||
<div class="contenr_new">
|
||
<!-- 表单查询-->
|
||
<div class="top_new">
|
||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||
<el-form-item label="" prop="returnType">
|
||
<el-select
|
||
v-model="queryParams.returnType"
|
||
clearable
|
||
placeholder="归还状态"
|
||
>
|
||
<el-option label="挂账" value="0"></el-option>
|
||
<el-option label="归还" value="1"></el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="" prop="unitName">
|
||
<el-input
|
||
v-model="queryParams.unitName"
|
||
placeholder="单位名称"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="" prop="personCredit">
|
||
<el-input
|
||
v-model="queryParams.personCredit"
|
||
placeholder="挂账人"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="" prop="contactMobile">
|
||
<el-input
|
||
v-model="queryParams.contactMobile"
|
||
placeholder="联系电话"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="">
|
||
<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>
|
||
<div style="display: flex;align-items: center;height: 32px">
|
||
<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" @click = "exportExcelCashier()">导出</el-button>
|
||
</div>
|
||
</div>
|
||
<!-- 统计-->
|
||
|
||
<!-- 列表-->
|
||
<div class="bottom_new">
|
||
<div class="box-gang">
|
||
<div class="box">
|
||
<div style="font-size: 26px;color: #0DC291;font-weight: bold;margin-top: 5px">
|
||
{{ total || 0 }}
|
||
</div>
|
||
<div class="size-hui">
|
||
<div style="width: 8px;height: 8px;border-radius: 4px;background: #0DC291"></div>
|
||
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">挂账总金额(元)/笔数</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="box">
|
||
<div style="font-size: 26px;color: #00CAFF;font-weight: bold;margin-top: 5px">
|
||
{{ returnTotal || 0 }}
|
||
</div>
|
||
<div class="size-hui">
|
||
<div style="width: 8px;height: 8px;border-radius: 4px;background: #00CAFF"></div>
|
||
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">归还总金额(元)/笔数</div>
|
||
</div>
|
||
</div>
|
||
<div class="box">
|
||
<div style="font-size: 26px;color: #F44522;font-weight: bold;margin-top: 5px">
|
||
{{ allAmount || 0 }}
|
||
</div>
|
||
<div class="size-hui">
|
||
<div style="width: 8px;height: 8px;border-radius: 4px;background: #F44522"></div>
|
||
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">未归还金额(元))</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="table-box">
|
||
<el-table
|
||
:data="hangBillList"
|
||
style="width: 100%">
|
||
<el-table-column type="index" width="50" align="center" label="序号"/>
|
||
<el-table-column prop="orderNo" align="center" label="单据号" width="220"></el-table-column>
|
||
<el-table-column align="center" label="挂账单位">
|
||
<el-table-column prop="unitName" align="center" label="单位名称"> </el-table-column>
|
||
<el-table-column prop="personCredit" align="center" label="挂账人"> </el-table-column>
|
||
<el-table-column prop="contactMobile" align="center" label="联系电话"> </el-table-column>
|
||
</el-table-column>
|
||
<el-table-column label="记录明细" align="center">
|
||
<el-table-column prop="returnType" align="center" label="类型">
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.returnType == 0">挂账</el-tag>
|
||
<el-tag v-else type="success">归还</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="amount" align="center" label="金额"> </el-table-column>
|
||
<el-table-column prop="status" align="center" label="状态">
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.status == 0">未归还</span>
|
||
<span v-else-if="scope.row.status == 1" type="success">已归还</span>
|
||
<span v-else type="success">部分归还</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="repaidAmount" align="center" label="已归还金额"> </el-table-column>
|
||
<el-table-column prop="outstandAmount" align="center" label="未归还金额"> </el-table-column>
|
||
</el-table-column>
|
||
<el-table-column prop="realName" align="center" label="操作人"> </el-table-column>
|
||
<el-table-column prop="createTime" align="center" label="创建时间" width="220">
|
||
<template slot-scope="scope">
|
||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
v-if="scope.row.status != 0"
|
||
size="mini"
|
||
type="text"
|
||
@click="returnRecord(scope.row.id)"
|
||
>归还详情</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
</div>
|
||
<div class="pagination-box">
|
||
|
||
<pagination
|
||
v-show="total>0"
|
||
:total="total"
|
||
:page.sync="queryParams.page"
|
||
:limit.sync="queryParams.pageSize"
|
||
@pagination="getList"
|
||
/>
|
||
|
||
</div>
|
||
</div>
|
||
<!-- 归还记录信息-->
|
||
<el-drawer
|
||
title="归还详情"
|
||
:visible.sync="drawer"
|
||
direction="rtl"
|
||
size="55%"
|
||
:before-close="handleClose">
|
||
<div style="display: grid; place-items: center;">
|
||
<div class="top_pop">
|
||
<div class="wrap_box">
|
||
<div class="three_box">
|
||
<div class="or_num">订单号:{{record.orderNo}}</div>
|
||
<div class="or_num">联系电话:{{record.contactMobile}}</div>
|
||
</div>
|
||
<div class="three_box">
|
||
<div class="or_num">挂账单位:{{record.unitName}}</div>
|
||
<div class="or_num">操作人:{{ record.realName }}</div>
|
||
</div>
|
||
<div class="three_box">
|
||
<div class="or_num">挂账人:{{record.personCredit}}</div>
|
||
<div class="or_num">操作账号:xxxx-xx-xx xx:x</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div style="margin-top: 15px;width: 96%">
|
||
<el-table ref="tables"
|
||
border
|
||
v-loading="loading"
|
||
:data="returnRecordList">
|
||
<el-table-column label="单据号" align="center" prop="orderNo" width="200"></el-table-column>
|
||
<el-table-column label="类型" align="center" prop="returnType">
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.returnType == 0">挂账</el-tag>
|
||
<el-tag v-else type="success">归还</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="归还金额" align="center" prop="amount" />
|
||
<el-table-column label="找零金额" align="center" prop="seekZero" />
|
||
<el-table-column label="归还方式" align="center" prop="status">
|
||
<template slot-scope="scope">
|
||
<span>{{ getPayMeth(payList,scope.row.status) }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="支付状态" align="center" prop="payStatus">
|
||
<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 label="操作人" align="center" prop="realName" />
|
||
<el-table-column label="支付时间" align="center" prop="payTime" width="200">
|
||
<template slot-scope="scope">
|
||
<span>{{ parseTime(scope.row.payTime) }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
|
||
<div class="pagination-box">
|
||
|
||
<pagination
|
||
v-show="total2>0"
|
||
:total="total2"
|
||
:page.sync="queryParams1.page"
|
||
:limit.sync="queryParams1.pageSize"
|
||
@pagination="getRecordList"
|
||
/>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</el-drawer>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import {
|
||
hangBillAllAmount,
|
||
hangBillAllNoReturnAmount,
|
||
hangBillAllReturnAmount, hangBillInfo, hangBillReturnTotal,
|
||
listHangBill
|
||
} from "@/api/cashier/hangbill";
|
||
import {getDicts} from "@/api/dict/data";
|
||
import {listReturnRecord} from "@/api/cashier/returnrecord";
|
||
import {exportExcelCashierApi, exportExcelHangBillApi} from "@/api/order/exportExcel";
|
||
|
||
export default {
|
||
name: "order_Cashier",
|
||
data(){
|
||
return{
|
||
queryParams1: {
|
||
page: 1,
|
||
pageSize: 10,
|
||
hangBillId:"",
|
||
},
|
||
hangBillList:[],
|
||
total:0,
|
||
total2:0,
|
||
loading:false,
|
||
queryParams:{
|
||
page:1,
|
||
pageSize:10,
|
||
returnType:"",
|
||
status:"",
|
||
unitName:"",
|
||
personCredit:"",
|
||
contactMobile:"",
|
||
mobile:"",
|
||
},
|
||
dateRange:[],
|
||
beginTime:"",
|
||
endTime:"",
|
||
returnRecordList:[],
|
||
payList:[],
|
||
// 归还账单总数
|
||
returnTotal:0,
|
||
// 挂账总额
|
||
allAmount:0,
|
||
// 归还总额
|
||
returnAllAmount:0,
|
||
// 未归还总额
|
||
noReturnAllAmount:0,
|
||
drawer:false,
|
||
// 挂账信息
|
||
record:{},
|
||
// 是否为当天时间
|
||
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()
|
||
},
|
||
methods: {
|
||
|
||
exportExcelCashier() {
|
||
// this.dateRange.push(this.beginTime)
|
||
// this.dateRange.push(this.endTime)
|
||
let dateRange = []
|
||
if (this.beginTime && this.endTime) {
|
||
dateRange.push(this.beginTime.toLocaleDateString())
|
||
dateRange.push(this.endTime.toLocaleDateString())
|
||
}
|
||
exportExcelHangBillApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
|
||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||
this.$download.saveAs(blob,'挂账订单统计.xLsx')
|
||
})
|
||
},
|
||
// 归还记录详情弹框
|
||
returnRecord(id){
|
||
this.record = {}
|
||
this.drawer = true
|
||
hangBillInfo(id).then(response => {
|
||
this.record = response.data
|
||
})
|
||
this.getRecordList(id,1);
|
||
},
|
||
getRecordList(id,val){
|
||
if (val!=1){
|
||
this.queryParams1.page = id
|
||
this.queryParams1.hangBillId = this.record.id
|
||
}else {
|
||
this.queryParams1.hangBillId = id
|
||
}
|
||
listReturnRecord(this.queryParams1).then(response => {
|
||
this.returnRecordList = response.data.records
|
||
this.total2 = response.data.total
|
||
})
|
||
},
|
||
// 获取支付方式
|
||
getPayList() {
|
||
getDicts("payment_type").then(response => {
|
||
this.payList = response.data;
|
||
})
|
||
},
|
||
getPayMeth(list,val){
|
||
let name = "";
|
||
if (list!=null && list!=""){
|
||
list.forEach(item => {
|
||
if (item.dictValue == val){
|
||
name = item.dictLabel
|
||
}
|
||
})
|
||
}
|
||
return name;
|
||
},
|
||
// 是否关闭弹框
|
||
handleClose(done) {
|
||
done();
|
||
},
|
||
getList(val){
|
||
if (val!=undefined){
|
||
this.queryParams.page = 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())
|
||
}
|
||
|
||
listHangBill(this.addDateRange(this.queryParams, dateRange)).then( response => {
|
||
this.hangBillList = response.data.records
|
||
this.total = response.data.total;
|
||
this.queryParams.page = response.data.current;
|
||
this.isSysDate = false
|
||
})
|
||
this.getStatistic();
|
||
},
|
||
// 获取挂账统计信息
|
||
getStatistic(){
|
||
let dateRange = []
|
||
if (this.beginTime && this.endTime) {
|
||
dateRange.push(this.beginTime.toLocaleDateString())
|
||
dateRange.push(this.endTime.toLocaleDateString())
|
||
}
|
||
hangBillReturnTotal(this.addDateRange(this.queryParams, dateRange)).then(res => {
|
||
this.returnTotal = res.data
|
||
})
|
||
hangBillAllAmount(this.addDateRange(this.queryParams, dateRange)).then(res => {
|
||
if (res.data) {
|
||
this.allAmount = res.data
|
||
}
|
||
})
|
||
hangBillAllReturnAmount(this.addDateRange(this.queryParams, dateRange)).then(res => {
|
||
if (res.data) {
|
||
this.returnAllAmount = res.data
|
||
}
|
||
})
|
||
hangBillAllNoReturnAmount(this.addDateRange(this.queryParams, dateRange)).then(res => {
|
||
if (res.data) {
|
||
this.noReturnAllAmount = res.data
|
||
}
|
||
})
|
||
},
|
||
// 搜索按钮操作
|
||
handleQuery() {
|
||
this.queryParams.page = 1;
|
||
this.getList();
|
||
},
|
||
// 重置按钮操作
|
||
resetQuery() {
|
||
this.dateRange = [];
|
||
this.queryParams.page = 1;
|
||
this.beginTime = ""
|
||
this.endTime = ""
|
||
this.resetForm("queryForm");
|
||
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;
|
||
flex-wrap: wrap;
|
||
}
|
||
.contenr_new{
|
||
box-sizing: border-box;
|
||
//padding: 10px;
|
||
}
|
||
.box{
|
||
padding: 5px;
|
||
margin-right: 20px;
|
||
margin-bottom: 20px;
|
||
padding-left: 20px;
|
||
width: 211px;
|
||
height: 70px;
|
||
border-radius: 6px 6px 6px 6px;
|
||
border: 1px solid #FF9655;
|
||
}
|
||
.el-form--inline .el-form-item {
|
||
}
|
||
.size-hui{
|
||
display: flex;
|
||
align-items: center;
|
||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||
font-weight: 400;
|
||
font-size: 13px;
|
||
color: #888888;
|
||
text-align: left;
|
||
font-style: normal;
|
||
text-transform: none;
|
||
|
||
.nei {
|
||
width: 150px;
|
||
}
|
||
}
|
||
.size-bole{
|
||
height: 31px;
|
||
font-family: YouSheBiaoTiHei;
|
||
font-weight: 400;
|
||
font-size: 24px;
|
||
color: #555555;
|
||
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%;
|
||
height: 65vh;
|
||
overflow: auto;
|
||
}
|
||
.pagination-box{
|
||
width: 100%;
|
||
margin: 10px auto;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
}
|
||
.top-app-sou{
|
||
width: 20%;
|
||
}
|
||
.icon-img{
|
||
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 5px;
|
||
img{
|
||
float: right;
|
||
//width: 100%;
|
||
width: 20px;
|
||
height: 20px;
|
||
}
|
||
}
|
||
.box1{
|
||
padding: 5px;
|
||
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;
|
||
}
|
||
.top_new{
|
||
display: flex;
|
||
justify-content: space-between;
|
||
background: #fff;
|
||
width: 98%;
|
||
margin: 5px auto;
|
||
border-radius: 8px;
|
||
box-sizing: border-box;
|
||
padding: 15px;
|
||
height: 64px;
|
||
}
|
||
.cont_new{
|
||
background: #fff;
|
||
width: 98%;
|
||
margin: 10px auto;
|
||
border-radius: 8px;
|
||
box-sizing: border-box;
|
||
padding: 15px
|
||
}
|
||
.bottom_new{
|
||
background: #fff;
|
||
width: 98%;
|
||
margin: 5px auto;
|
||
border-radius: 8px;
|
||
box-sizing: border-box;
|
||
padding: 15px;
|
||
height: 85vh;
|
||
}
|
||
.top_pop{
|
||
width: 96%;
|
||
}
|
||
.wrap_box{
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
}
|
||
.three_box{
|
||
width: 33%;
|
||
}
|
||
.or_num{
|
||
font-size: 14px;
|
||
margin-bottom: 15px;
|
||
}
|
||
</style>
|