oil-station/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue

601 lines
18 KiB
Vue
Raw Normal View History

2024-08-16 18:26:19 +08:00
<!--增值交易订单-->
<template>
2024-09-27 09:23:47 +08:00
<div class="contenr_new">
2024-10-25 11:48:41 +08:00
<!-- 表单查询-->
2024-09-27 09:23:47 +08:00
<div class="top_new">
2024-08-16 18:26:19 +08:00
<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>
2024-10-08 13:57:18 +08:00
2024-08-16 18:26:19 +08:00
<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>
2024-10-08 13:57:18 +08:00
2024-08-16 18:26:19 +08:00
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 160px"
type="date"
2024-10-25 11:48:41 +08:00
placeholder="开始日期"
>
2024-08-16 18:26:19 +08:00
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
2024-10-25 11:48:41 +08:00
placeholder="结束日期"
>
2024-08-16 18:26:19 +08:00
</el-date-picker>
</el-form-item>
2024-10-08 13:57:18 +08:00
2024-08-16 18:26:19 +08:00
</el-form>
2024-10-08 13:57:18 +08:00
<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>
2024-10-25 11:48:41 +08:00
<el-button type="primary" @click="exportExcelCashier()">导出</el-button>
2024-10-08 13:57:18 +08:00
</div>
2024-09-27 09:23:47 +08:00
</div>
2024-10-25 11:48:41 +08:00
<!-- 统计-->
2024-08-16 18:26:19 +08:00
2024-10-25 11:48:41 +08:00
<!-- 列表-->
<div class="bottom_new">
<div class="box-gang">
<div class="box">
<div style="font-size: 26px;color: #0DC291;font-weight: bold;margin-top: 5px">
{{ map.s1 || 0 }} / {{ map.s2 || 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>
2024-09-27 14:10:40 +08:00
2024-08-16 18:26:19 +08:00
</div>
2024-10-25 11:48:41 +08:00
<div class="box">
<div style="font-size: 26px;color: #00CAFF;font-weight: bold;margin-top: 5px">
{{ map.s3 || 0}} / {{ map.s4 || 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>
2024-08-16 18:26:19 +08:00
</div>
2024-10-25 11:48:41 +08:00
<div class="box">
<div style="font-size: 26px;color: #F44522;font-weight: bold;margin-top: 5px">
{{ map.s5 || 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>
2024-08-16 18:26:19 +08:00
</div>
2024-10-25 11:48:41 +08:00
</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">
2024-08-16 18:26:19 +08:00
<template slot-scope="scope">
2024-10-25 11:48:41 +08:00
<span>{{ parseTime(scope.row.createTime) }}</span>
2024-08-16 18:26:19 +08:00
</template>
</el-table-column>
2024-10-25 11:48:41 +08:00
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
2024-08-16 18:26:19 +08:00
<template slot-scope="scope">
2024-10-25 11:48:41 +08:00
<el-button
v-if="scope.row.status != 0"
size="mini"
type="text"
@click="returnRecord(scope.row.id)"
>归还详情
</el-button>
2024-08-16 18:26:19 +08:00
</template>
</el-table-column>
2024-10-25 11:48:41 +08:00
</el-table>
</div>
<div class="pagination-box">
2024-10-08 13:57:18 +08:00
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2024-10-25 11:48:41 +08:00
</div>
2024-09-27 09:23:47 +08:00
</div>
2024-08-16 18:26:19 +08:00
<!-- 归还记录信息-->
<el-drawer
title="归还详情"
:visible.sync="drawer"
direction="rtl"
size="55%"
2024-10-25 11:48:41 +08:00
:before-close="handleClose"
>
2024-08-16 18:26:19 +08:00
<div style="display: grid; place-items: center;">
2024-10-12 14:51:25 +08:00
<div class="top_pop">
<div class="wrap_box">
<div class="three_box">
2024-10-25 11:48:41 +08:00
<div class="or_num">订单号{{ record.orderNo }}</div>
<div class="or_num">联系电话{{ record.contactMobile }}</div>
2024-08-16 18:26:19 +08:00
</div>
2024-10-12 14:51:25 +08:00
<div class="three_box">
2024-10-25 11:48:41 +08:00
<div class="or_num">挂账单位{{ record.unitName }}</div>
<div class="or_num">操作人{{ record.realName }}</div>
2024-08-16 18:26:19 +08:00
</div>
2024-10-12 14:51:25 +08:00
<div class="three_box">
2024-10-25 11:48:41 +08:00
<div class="or_num">挂账人{{ record.personCredit }}</div>
2024-10-12 14:51:25 +08:00
<div class="or_num">操作账号xxxx-xx-xx xx:x</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-10-12 14:51:25 +08:00
</div>
<div style="margin-top: 15px;width: 96%">
2024-08-16 18:26:19 +08:00
<el-table ref="tables"
2024-10-12 14:51:25 +08:00
border
2024-08-16 18:26:19 +08:00
v-loading="loading"
2024-10-25 11:48:41 +08:00
:data="returnRecordList"
>
2024-08-16 18:26:19 +08:00
<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>
2024-10-25 11:48:41 +08:00
<el-table-column label="归还金额" align="center" prop="amount"/>
<el-table-column label="找零金额" align="center" prop="seekZero"/>
2024-08-16 18:26:19 +08:00
<el-table-column label="归还方式" align="center" prop="status">
<template slot-scope="scope">
2024-10-25 11:48:41 +08:00
<span>{{ getPayMeth(payList, scope.row.status) }}</span>
2024-08-16 18:26:19 +08:00
</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>
2024-10-25 11:48:41 +08:00
<el-table-column label="操作人" align="center" prop="realName"/>
2024-08-16 18:26:19 +08:00
<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">
2024-10-08 13:57:18 +08:00
2024-10-25 11:48:41 +08:00
<pagination
v-show="total2>0"
:total="total2"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.pageSize"
@pagination="getRecordList"
/>
2024-10-08 13:57:18 +08:00
2024-08-16 18:26:19 +08:00
</div>
2024-10-12 14:51:25 +08:00
</div>
2024-08-16 18:26:19 +08:00
</div>
</el-drawer>
</div>
</template>
<script>
import {
2024-10-25 11:48:41 +08:00
hangBillInfo,
selectStatistics,
2024-08-16 18:26:19 +08:00
listHangBill
2024-10-25 11:48:41 +08:00
} 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 {
map:{},
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: {
2024-08-16 18:26:19 +08:00
2024-10-25 11:48:41 +08:00
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())
2024-08-16 18:26:19 +08:00
}
2024-10-25 11:48:41 +08:00
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')
})
2024-08-16 18:26:19 +08:00
},
2024-10-25 11:48:41 +08:00
// 归还记录详情弹框
returnRecord(id) {
this.record = {}
this.drawer = true
hangBillInfo(id).then(response => {
this.record = response.data
})
this.getRecordList(id, 1)
2024-08-16 18:26:19 +08:00
},
2024-10-25 11:48:41 +08:00
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
}
2024-08-16 18:26:19 +08:00
})
2024-10-25 11:48:41 +08:00
}
return name
},
// 是否关闭弹框
handleClose(done) {
done()
},
getList(val) {
if (val != undefined) {
this.queryParams.page = val
}
2024-08-16 18:26:19 +08:00
2024-10-25 11:48:41 +08:00
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())
}
2024-08-16 18:26:19 +08:00
2024-10-25 11:48:41 +08:00
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())
}
selectStatistics(this.addDateRange(this.queryParams, dateRange)).then(
res => {
this.map = res.data
2024-08-16 18:26:19 +08:00
}
2024-10-25 11:48:41 +08:00
)
// this.mapStatistics
// 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()
2024-08-16 18:26:19 +08:00
}
}
2024-10-25 11:48:41 +08:00
}
2024-08-16 18:26:19 +08:00
</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;
}
2024-09-27 09:23:47 +08:00
.contenr_new{
box-sizing: border-box;
//padding: 10px;
}
2024-08-16 18:26:19 +08:00
.box{
padding: 5px;
margin-right: 20px;
margin-bottom: 20px;
2024-09-27 14:10:40 +08:00
padding-left: 20px;
2024-08-16 18:26:19 +08:00
width: 211px;
2024-09-27 14:10:40 +08:00
height: 70px;
2024-08-16 18:26:19 +08:00
border-radius: 6px 6px 6px 6px;
2024-09-27 14:10:40 +08:00
border: 1px solid #FF9655;
2024-08-16 18:26:19 +08:00
}
.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;
2024-09-27 14:10:40 +08:00
2024-08-16 18:26:19 +08:00
.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;
}
2024-10-08 13:57:18 +08:00
.table-box {
2024-08-16 18:26:19 +08:00
width: 100%;
2024-10-08 13:57:18 +08:00
height: 65vh;
overflow: auto;
2024-08-16 18:26:19 +08:00
}
.pagination-box{
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
2024-10-08 13:57:18 +08:00
justify-content: flex-end;
2024-08-16 18:26:19 +08:00
}
.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;
}
2024-09-27 09:23:47 +08:00
.top_new{
display: flex;
justify-content: space-between;
background: #fff;
width: 98%;
2024-10-08 13:57:18 +08:00
margin: 5px auto;
2024-09-27 09:23:47 +08:00
border-radius: 8px;
box-sizing: border-box;
2024-10-08 13:57:18 +08:00
padding: 15px;
height: 64px;
2024-09-27 09:23:47 +08:00
}
.cont_new{
background: #fff;
width: 98%;
margin: 10px auto;
border-radius: 8px;
box-sizing: border-box;
padding: 15px
}
.bottom_new{
background: #fff;
width: 98%;
2024-10-08 13:57:18 +08:00
margin: 5px auto;
2024-09-27 09:23:47 +08:00
border-radius: 8px;
box-sizing: border-box;
2024-10-08 13:57:18 +08:00
padding: 15px;
height: 85vh;
2024-09-27 09:23:47 +08:00
}
2024-10-12 14:51:25 +08:00
.top_pop{
width: 96%;
}
.wrap_box{
display: flex;
flex-wrap: wrap;
}
.three_box{
width: 33%;
}
.or_num{
font-size: 14px;
margin-bottom: 15px;
}
2024-08-16 18:26:19 +08:00
</style>