This commit is contained in:
zhaohengkun 2024-10-25 11:48:41 +08:00
parent 6163dec554
commit 2aa71233f3
11 changed files with 451 additions and 337 deletions

View File

@ -82,7 +82,11 @@
<el-table-column prop="mobile" label="手机号" align="center"></el-table-column> <el-table-column prop="mobile" label="手机号" align="center"></el-table-column>
<el-table-column prop="rechargeBalance" 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="giftBalance" label="赠送金额(元)" align="center"></el-table-column>
<el-table-column prop="giftBalance" label="会员总余额(元)" align="center"></el-table-column> <el-table-column prop="giftBalance" label="会员总余额(元)" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rechargeBalance + scope.row.giftBalance }}</span>
</template>
</el-table-column>
<el-table-column prop="paymentType" label="支付方式" align="center"> <el-table-column prop="paymentType" label="支付方式" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getType(payList, scope.row.paymentType) }}</span> <span>{{ getType(payList, scope.row.paymentType) }}</span>

View File

@ -261,14 +261,17 @@
date_range.date date_range.date
</select> </select>
<select id="orderStatistics" resultType="java.util.Map"> <select id="orderStatistics" resultType="java.util.Map">
select count(*) numberOfTopUps, -- 充值笔数 SELECT
sum(bid_balance) theTotalAmountOfTopUp, -- 充值总金额 count(*) numberOfTopUps,-- 充值笔数
sum(gift_balance) theTotalAmountOfTheCredit, -- 赠送总额 sum( bid_balance + gift_balance ) theTotalAmountOfTopUp,-- 到账总金额
sum(recharge_balance) totalAmountReceived, -- 实收总额 sum( gift_balance ) theTotalAmountOfTheCredit,-- 赠送总额
COUNT(CASE WHEN payment_type = 'WECHAT' THEN 0 END) AS wechat, -- 微信 sum( bid_balance ) totalAmountReceived,-- 实收总额
COUNT(CASE WHEN payment_type = 'ALIPAY' THEN 0 END) AS alipay, -- 支付宝 SUM( CASE WHEN payment_type = 'WECHAT' THEN bid_balance ELSE 0 END ) AS wechat, -- 微信
COUNT(CASE WHEN payment_type = 'CASH' THEN 0 END) AS cash -- 现金 SUM( CASE WHEN payment_type = 'ALIPAY' THEN bid_balance ELSE 0 END ) AS alipay, -- 支付宝
from card_value_record sum( CASE WHEN payment_type = 'CASH' THEN bid_balance ELSE 0 END ) AS cash, -- 现金
sum( CASE WHEN payment_type = 'UNIONPAY' THEN bid_balance ELSE 0 END ) AS UNIONPAY -- 银联二维码
FROM
card_value_record
<where> <where>
store_id = #{cardValueRecord.storeId} store_id = #{cardValueRecord.storeId}
<if test="cardValueRecord.mtStaffId != null and cardValueRecord.mtStaffId != ''"> <if test="cardValueRecord.mtStaffId != null and cardValueRecord.mtStaffId != ''">
@ -286,6 +289,9 @@
<if test="cardValueRecord.params.endTime != null and cardValueRecord.params.endTime != ''"><!-- 结束时间检索 --> <if test="cardValueRecord.params.endTime != null and cardValueRecord.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{cardValueRecord.params.endTime},'%y%m%d') and date_format(create_time,'%y%m%d') &lt;= date_format(#{cardValueRecord.params.endTime},'%y%m%d')
</if> </if>
<if test="cardValueRecord.payChannel != null and cardValueRecord.payChannel != ''">
and pay_channel = #{cardValueRecord.payChannel}
</if>
</where> </where>
</select> </select>
<select id="selectCardValueRecordList" <select id="selectCardValueRecordList"

View File

@ -150,6 +150,15 @@ public class HangBillController extends BaseController {
return getSuccessResult(hangBillService.selectNoReturnAmount(hangBill)); return getSuccessResult(hangBillService.selectNoReturnAmount(hangBill));
} }
/**
* 查询挂账统计数据
*/
@GetMapping("selectStatistics")
public ResponseObject selectStatistics(HangBillVo hangBill){
return getSuccessResult(hangBillService.selectStatistics(hangBill));
}
/** /**
* 查询当前店铺归还账单的数量 * 查询当前店铺归还账单的数量
* @return * @return

View File

@ -9,6 +9,7 @@ import com.fuint.business.order.vo.HangBillVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 挂账记录表 mapper层 * 挂账记录表 mapper层
@ -67,4 +68,6 @@ public interface HangBillMapper extends BaseMapper<HangBill> {
* @return * @return
*/ */
int selectCountReturn(@Param("hangBill") HangBillVo hangBill); int selectCountReturn(@Param("hangBill") HangBillVo hangBill);
Map<String, Object> selectStatistics(@Param("hangBill") HangBillVo hangBill);
} }

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.order.mapper.HangBillMapper"> <mapper namespace="com.fuint.business.order.mapper.HangBillMapper">
<sql id="selectHangBill"> <sql id="selectHangBill">
select hb.*,ms.real_name,ms.mobile,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit select hb.*, ms.real_name, ms.mobile, cu.unit_name, cu.person_credit, cu.contact_mobile, cu.credit_limit
from hang_bill hb from hang_bill hb
left join mt_staff ms on hb.staff_id = ms.id left join mt_staff ms on hb.staff_id = ms.id
left join credit_unit cu on hb.credit_unit_id = cu.id left join credit_unit cu on hb.credit_unit_id = cu.id
@ -270,4 +270,33 @@
</if> </if>
</where> </where>
</select> </select>
<select id="selectStatistics" resultType="java.util.Map">
select
sum(ha.amount) as s1, -- 挂账总金额
count(*) as s2, -- 总条数
SUM(CASE WHEN ha.return_type = 1 THEN ha.amount ELSE 0 END) AS s3, -- 归还总金额
count(CASE WHEN ha.return_type = 1 THEN ha.amount ELSE null END) AS s4, -- 归还总条数
SUM(CASE WHEN ha.return_type = 0 THEN ha.amount ELSE 0 END) AS s5 -- 未归还总金额
from hang_bill ha inner join credit_unit cr on cr.id = ha.credit_unit_id
<where>
<if test="hangBill.returnType != null and hangBill.returnType != ''">
and ha.return_type = #{hangBill.returnType}
</if>
<if test="hangBill.params.beginTime != null and hangBill.params.beginTime != ''"><!-- 开始时间检索 -->
and ha.create_time &gt;= STR_TO_DATE(#{hangBill.params.beginTime}, '%Y/%m/%d')
</if>
<if test="hangBill.params.endTime != null and hangBill.params.endTime != ''"><!-- 结束时间检索 -->
and ha.create_time &lt;= STR_TO_DATE(concat(#{hangBill.params.endTime},'23:59:59'), '%Y/%m/%d %H:%i:%s')
</if>
<if test="hangBill.unitName != null and hangBill.unitName != ''"><!-- 结束时间检索 -->
and cr.unit_name like concat('%', #{hangBill.unitName}, '%')
</if>
<if test="hangBill.personCredit != null and hangBill.personCredit != ''"><!-- 结束时间检索 -->
and cr.person_credit like concat('%', #{hangBill.personCredit}, '%')
</if>
<if test="hangBill.contactMobile != null and hangBill.contactMobile != ''"><!-- 结束时间检索 -->
and cr.contact_mobile like concat('%', #{hangBill.contactMobile}, '%')
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -112,4 +112,6 @@ public interface HangBillService extends IService<HangBill> {
Double selectNoReturnAmount(HangBillVo hangBill); Double selectNoReturnAmount(HangBillVo hangBill);
void export(HttpServletResponse response, HangBillVo hangBill); void export(HttpServletResponse response, HangBillVo hangBill);
Map<String,Object> selectStatistics(HangBillVo hangBill);
} }

View File

@ -334,6 +334,11 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
} }
} }
@Override
public Map<String, Object> selectStatistics(HangBillVo hangBill) {
return baseMapper.selectStatistics(hangBill);
}
/** /**
* 调用支付接口 * 调用支付接口
* @param map * @param map

View File

@ -71,6 +71,15 @@ export function hangBillReturnTotal(query) {
}) })
} }
// 挂账统计
export function selectStatistics(query) {
return request({
url: '/business/hangBill/selectStatistics',
method: 'get',
params: query
})
}
// 当前店铺归还账单的数量 // 当前店铺归还账单的数量
export function hangBillAllAmount(query) { export function hangBillAllAmount(query) {
return request({ return request({

View File

@ -1,7 +1,7 @@
<!--增值交易订单--> <!--增值交易订单-->
<template> <template>
<div class="contenr_new"> <div class="contenr_new">
<!-- 表单查询--> <!-- 表单查询-->
<div class="top_new"> <div class="top_new">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="" prop="returnType"> <el-form-item label="" prop="returnType">
@ -45,14 +45,16 @@
v-model="beginTime" v-model="beginTime"
style="width: 160px" style="width: 160px"
type="date" type="date"
placeholder="开始日期"> placeholder="开始日期"
>
</el-date-picker> </el-date-picker>
<el-date-picker <el-date-picker
v-model="endTime" v-model="endTime"
style="width: 160px" style="width: 160px"
type="date" type="date"
placeholder="结束日期"> placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -60,17 +62,17 @@
<div style="display: flex;align-items: center;height: 32px"> <div style="display: flex;align-items: center;height: 32px">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" @click = "exportExcelCashier()">导出</el-button> <el-button type="primary" @click="exportExcelCashier()">导出</el-button>
</div> </div>
</div> </div>
<!-- 统计--> <!-- 统计-->
<!-- 列表--> <!-- 列表-->
<div class="bottom_new"> <div class="bottom_new">
<div class="box-gang"> <div class="box-gang">
<div class="box"> <div class="box">
<div style="font-size: 26px;color: #0DC291;font-weight: bold;margin-top: 5px"> <div style="font-size: 26px;color: #0DC291;font-weight: bold;margin-top: 5px">
{{ total || 0 }} {{ map.s1 || 0 }} / {{ map.s2 || 0 }}
</div> </div>
<div class="size-hui"> <div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #0DC291"></div> <div style="width: 8px;height: 8px;border-radius: 4px;background: #0DC291"></div>
@ -81,7 +83,7 @@
<div class="box"> <div class="box">
<div style="font-size: 26px;color: #00CAFF;font-weight: bold;margin-top: 5px"> <div style="font-size: 26px;color: #00CAFF;font-weight: bold;margin-top: 5px">
{{ returnTotal || 0 }} {{ map.s3 || 0}} / {{ map.s4 || 0 }}
</div> </div>
<div class="size-hui"> <div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #00CAFF"></div> <div style="width: 8px;height: 8px;border-radius: 4px;background: #00CAFF"></div>
@ -90,7 +92,7 @@
</div> </div>
<div class="box"> <div class="box">
<div style="font-size: 26px;color: #F44522;font-weight: bold;margin-top: 5px"> <div style="font-size: 26px;color: #F44522;font-weight: bold;margin-top: 5px">
{{ allAmount || 0 }} {{ map.s5 || 0 }}
</div> </div>
<div class="size-hui"> <div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #F44522"></div> <div style="width: 8px;height: 8px;border-radius: 4px;background: #F44522"></div>
@ -102,13 +104,14 @@
<div class="table-box"> <div class="table-box">
<el-table <el-table
:data="hangBillList" :data="hangBillList"
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 prop="orderNo" align="center" label="单据号" width="220"></el-table-column> <el-table-column prop="orderNo" align="center" label="单据号" width="220"></el-table-column>
<el-table-column align="center" label="挂账单位"> <el-table-column align="center" label="挂账单位">
<el-table-column prop="unitName" align="center" label="单位名称"> </el-table-column> <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="personCredit" align="center" label="挂账人"></el-table-column>
<el-table-column prop="contactMobile" align="center" label="联系电话"> </el-table-column> <el-table-column prop="contactMobile" align="center" label="联系电话"></el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="记录明细" align="center"> <el-table-column label="记录明细" align="center">
<el-table-column prop="returnType" align="center" label="类型"> <el-table-column prop="returnType" align="center" label="类型">
@ -117,7 +120,7 @@
<el-tag v-else type="success">归还</el-tag> <el-tag v-else type="success">归还</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" align="center" label="金额"> </el-table-column> <el-table-column prop="amount" align="center" label="金额"></el-table-column>
<el-table-column prop="status" align="center" label="状态"> <el-table-column prop="status" align="center" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 0">未归还</span> <span v-if="scope.row.status == 0">未归还</span>
@ -125,10 +128,10 @@
<span v-else type="success">部分归还</span> <span v-else type="success">部分归还</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="repaidAmount" align="center" label="已归还金额"> </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 prop="outstandAmount" align="center" label="未归还金额"></el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="realName" align="center" label="操作人"> </el-table-column> <el-table-column prop="realName" align="center" label="操作人"></el-table-column>
<el-table-column prop="createTime" align="center" label="创建时间" width="220"> <el-table-column prop="createTime" align="center" label="创建时间" width="220">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
@ -142,7 +145,8 @@
size="mini" size="mini"
type="text" type="text"
@click="returnRecord(scope.row.id)" @click="returnRecord(scope.row.id)"
>归还详情</el-button> >归还详情
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -165,20 +169,21 @@
:visible.sync="drawer" :visible.sync="drawer"
direction="rtl" direction="rtl"
size="55%" size="55%"
:before-close="handleClose"> :before-close="handleClose"
>
<div style="display: grid; place-items: center;"> <div style="display: grid; place-items: center;">
<div class="top_pop"> <div class="top_pop">
<div class="wrap_box"> <div class="wrap_box">
<div class="three_box"> <div class="three_box">
<div class="or_num">订单号{{record.orderNo}}</div> <div class="or_num">订单号{{ record.orderNo }}</div>
<div class="or_num">联系电话{{record.contactMobile}}</div> <div class="or_num">联系电话{{ record.contactMobile }}</div>
</div> </div>
<div class="three_box"> <div class="three_box">
<div class="or_num">挂账单位{{record.unitName}}</div> <div class="or_num">挂账单位{{ record.unitName }}</div>
<div class="or_num">操作人{{ record.realName }}</div> <div class="or_num">操作人{{ record.realName }}</div>
</div> </div>
<div class="three_box"> <div class="three_box">
<div class="or_num">挂账人{{record.personCredit}}</div> <div class="or_num">挂账人{{ record.personCredit }}</div>
<div class="or_num">操作账号xxxx-xx-xx xx:x</div> <div class="or_num">操作账号xxxx-xx-xx xx:x</div>
</div> </div>
</div> </div>
@ -189,7 +194,8 @@
<el-table ref="tables" <el-table ref="tables"
border border
v-loading="loading" v-loading="loading"
:data="returnRecordList"> :data="returnRecordList"
>
<el-table-column label="单据号" align="center" prop="orderNo" width="200"></el-table-column> <el-table-column label="单据号" align="center" prop="orderNo" width="200"></el-table-column>
<el-table-column label="类型" align="center" prop="returnType"> <el-table-column label="类型" align="center" prop="returnType">
<template slot-scope="scope"> <template slot-scope="scope">
@ -197,11 +203,11 @@
<el-tag v-else type="success">归还</el-tag> <el-tag v-else type="success">归还</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="归还金额" align="center" prop="amount" /> <el-table-column label="归还金额" align="center" prop="amount"/>
<el-table-column label="找零金额" align="center" prop="seekZero" /> <el-table-column label="找零金额" align="center" prop="seekZero"/>
<el-table-column label="归还方式" align="center" prop="status"> <el-table-column label="归还方式" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getPayMeth(payList,scope.row.status) }}</span> <span>{{ getPayMeth(payList, scope.row.status) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="支付状态" align="center" prop="payStatus"> <el-table-column label="支付状态" align="center" prop="payStatus">
@ -211,7 +217,7 @@
<el-tag type="danger" v-else>支付失败</el-tag> <el-tag type="danger" v-else>支付失败</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作人" align="center" prop="realName" /> <el-table-column label="操作人" align="center" prop="realName"/>
<el-table-column label="支付时间" align="center" prop="payTime" width="200"> <el-table-column label="支付时间" align="center" prop="payTime" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span> <span>{{ parseTime(scope.row.payTime) }}</span>
@ -239,65 +245,65 @@
<script> <script>
import { import {
hangBillAllAmount, hangBillInfo,
hangBillAllNoReturnAmount, selectStatistics,
hangBillAllReturnAmount, hangBillInfo, hangBillReturnTotal,
listHangBill listHangBill
} from "@/api/cashier/hangbill"; } from '@/api/cashier/hangbill'
import {getDicts} from "@/api/dict/data"; import { getDicts } from '@/api/dict/data'
import {listReturnRecord} from "@/api/cashier/returnrecord"; import { listReturnRecord } from '@/api/cashier/returnrecord'
import {exportExcelCashierApi, exportExcelHangBillApi} from "@/api/order/exportExcel"; import { exportExcelCashierApi, exportExcelHangBillApi } from '@/api/order/exportExcel'
export default { export default {
name: "order_Cashier", name: 'order_Cashier',
data(){ data() {
return{ return {
map:{},
queryParams1: { queryParams1: {
page: 1, page: 1,
pageSize: 10, pageSize: 10,
hangBillId:"", hangBillId: ''
}, },
hangBillList:[], hangBillList: [],
total:0, total: 0,
total2:0, total2: 0,
loading:false, loading: false,
queryParams:{ queryParams: {
page:1, page: 1,
pageSize:10, pageSize: 10,
returnType:"", returnType: '',
status:"", status: '',
unitName:"", unitName: '',
personCredit:"", personCredit: '',
contactMobile:"", contactMobile: '',
mobile:"", mobile: ''
}, },
dateRange:[], dateRange: [],
beginTime:"", beginTime: '',
endTime:"", endTime: '',
returnRecordList:[], returnRecordList: [],
payList:[], payList: [],
// //
returnTotal:0, returnTotal: 0,
// //
allAmount:0, allAmount: 0,
// //
returnAllAmount:0, returnAllAmount: 0,
// //
noReturnAllAmount:0, noReturnAllAmount: 0,
drawer:false, drawer: false,
// //
record:{}, record: {},
// //
isSysDate:false, isSysDate: false
} }
}, },
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
@ -314,25 +320,25 @@ import {exportExcelCashierApi, exportExcelHangBillApi} from "@/api/order/exportE
dateRange.push(this.beginTime.toLocaleDateString()) dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
exportExcelHangBillApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{ exportExcelHangBillApi(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')
}) })
}, },
// //
returnRecord(id){ returnRecord(id) {
this.record = {} this.record = {}
this.drawer = true this.drawer = true
hangBillInfo(id).then(response => { hangBillInfo(id).then(response => {
this.record = response.data this.record = response.data
}) })
this.getRecordList(id,1); this.getRecordList(id, 1)
}, },
getRecordList(id,val){ getRecordList(id, val) {
if (val!=1){ if (val != 1) {
this.queryParams1.page = id this.queryParams1.page = id
this.queryParams1.hangBillId = this.record.id this.queryParams1.hangBillId = this.record.id
}else { } else {
this.queryParams1.hangBillId = id this.queryParams1.hangBillId = id
} }
listReturnRecord(this.queryParams1).then(response => { listReturnRecord(this.queryParams1).then(response => {
@ -342,27 +348,27 @@ import {exportExcelCashierApi, exportExcelHangBillApi} from "@/api/order/exportE
}, },
// //
getPayList() { getPayList() {
getDicts("payment_type").then(response => { getDicts('payment_type').then(response => {
this.payList = response.data; this.payList = response.data
}) })
}, },
getPayMeth(list,val){ getPayMeth(list, val) {
let name = ""; let name = ''
if (list!=null && list!=""){ if (list != null && list != '') {
list.forEach(item => { list.forEach(item => {
if (item.dictValue == val){ if (item.dictValue == val) {
name = item.dictLabel name = item.dictLabel
} }
}) })
} }
return name; return name
}, },
// //
handleClose(done) { handleClose(done) {
done(); done()
}, },
getList(val){ getList(val) {
if (val!=undefined){ if (val != undefined) {
this.queryParams.page = val this.queryParams.page = val
} }
@ -380,56 +386,64 @@ import {exportExcelCashierApi, exportExcelHangBillApi} from "@/api/order/exportE
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
listHangBill(this.addDateRange(this.queryParams, dateRange)).then( response => { listHangBill(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.hangBillList = response.data.records this.hangBillList = response.data.records
this.total = response.data.total; this.total = response.data.total
this.queryParams.page = response.data.current; this.queryParams.page = response.data.current
this.isSysDate = false this.isSysDate = false
}) })
this.getStatistic(); this.getStatistic()
}, },
// //
getStatistic(){ getStatistic() {
let dateRange = [] let dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString()) dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
hangBillReturnTotal(this.addDateRange(this.queryParams, dateRange)).then(res => {
this.returnTotal = res.data selectStatistics(this.addDateRange(this.queryParams, dateRange)).then(
}) res => {
hangBillAllAmount(this.addDateRange(this.queryParams, dateRange)).then(res => { this.map = res.data
if (res.data) {
this.allAmount = res.data
} }
}) )
hangBillAllReturnAmount(this.addDateRange(this.queryParams, dateRange)).then(res => {
if (res.data) { // this.mapStatistics
this.returnAllAmount = res.data // hangBillReturnTotal(this.addDateRange(this.queryParams, dateRange)).then(res => {
} // this.returnTotal = res.data
}) // })
hangBillAllNoReturnAmount(this.addDateRange(this.queryParams, dateRange)).then(res => { // hangBillAllAmount(this.addDateRange(this.queryParams, dateRange)).then(res => {
if (res.data) { // if (res.data) {
this.noReturnAllAmount = 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() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1
this.getList(); this.getList()
}, },
// //
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.queryParams.page = 1; this.queryParams.page = 1
this.beginTime = "" this.beginTime = ''
this.endTime = "" this.endTime = ''
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
},
} }
} }
}
</script> </script>
<style scoped> <style scoped>

View File

@ -23,6 +23,19 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="" prop="terminal">
<el-select
v-model="queryParams.terminal"
clearable
placeholder="请选择订单类型"
>
<el-option v-for="item in terminalList"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="payType"> <el-form-item label="" prop="payType">
<el-select <el-select
v-model="queryParams.payType" v-model="queryParams.payType"

View File

@ -15,17 +15,14 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="paymentType"> <el-form-item label="" prop="payChannel">
<el-select <el-select
v-model="queryParams.paymentType" v-model="queryParams.payChannel"
clearable clearable
placeholder="请选择订单类型" placeholder="请选择订单类型"
> >
<el-option v-for="item in payList" <el-option label="收银台" value="cashier"></el-option>
:key="item.id" <el-option label="小程序" value="applet"></el-option>
:label="item.dictLabel"
:value="item.dictValue">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="paymentType"> <el-form-item label="" prop="paymentType">
@ -110,11 +107,11 @@
</div> </div>
<div class="box2"> <div class="box2">
<div style="font-size: 26px;color: #2B63F4;font-weight: bold;margin-top: 5px"> <div style="font-size: 26px;color: #2B63F4;font-weight: bold;margin-top: 5px">
{{ orderStatistics.wechat || 0 }}/{{ orderStatistics.alipay || 0 }} {{ orderStatistics.UNIONPAY || 0 }}
</div> </div>
<div class="size-hui"> <div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #2B63F4"></div> <div style="width: 8px;height: 8px;border-radius: 4px;background: #2B63F4"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">云闪付/pos刷卡</div> <div style="font-weight: bold;font-size: 13px;margin-left: 5px">银联二维码</div>
</div> </div>
</div> </div>
<div class="box2"> <div class="box2">
@ -136,31 +133,37 @@
border border
:data="list" :data="list"
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 prop="paymentNo" label="订单号" align="center"></el-table-column>
<el-table-column prop="payChannel" label="订单类型" align="center">
<template slot-scope="scope">
<span v-if="scope.row.payChannel=='cashier'">收银台</span>
<span v-else>小程序</span>
</template>
</el-table-column>
<el-table-column prop="name" label="会员名称" align="center"></el-table-column> <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="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="amount" label="自定义充值金额" align="center"></el-table-column> <el-table-column prop="giftBalance" 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 prop="giftBalance" label="电子储值卡赠送金额" align="center"></el-table-column> <template slot-scope="scope">
<span>{{ scope.row.rechargeBalance + scope.row.giftBalance }}</span>
</template>
</el-table-column>
<el-table-column prop="paymentType" label="支付方式" align="center"> <el-table-column prop="paymentType" label="支付方式" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getType(payList, scope.row.paymentType) }}</span> <span>{{ getType(payList, scope.row.paymentType) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="payStatus" label="支付状态" align="center"> <el-table-column prop="payStatus" label="订单状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.payStatus == 'unpaid'">未支付</el-tag> <div v-if="scope.row.payStatus == 'unpaid'" style="color: #F44522">未支付</div>
<el-tag type="success" v-else-if="scope.row.payStatus == 'paid'">已支付</el-tag> <div v-else-if="scope.row.payStatus == 'paid'" style="color: #0DC291">支付成功</div>
<el-tag type="danger" v-else>支付失败</el-tag> <div v-else style="color: #F44522">支付失败</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="realName" label="交易员工" align="center"> <el-table-column prop="remark" 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"> <template slot-scope="scope">
<span>{{ scope.row.remark ? scope.row.remark : "--" }}</span> <span>{{ scope.row.remark ? scope.row.remark : "--" }}</span>
</template> </template>
@ -170,6 +173,18 @@
<span>充值满{{ scope.row.rechargeBalance }}元赠送{{ scope.row.giftBalance }}</span> <span>充值满{{ scope.row.rechargeBalance }}元赠送{{ scope.row.giftBalance }}</span>
</template> </template>
</el-table-column> </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 label="订单完成时间" align="center" width="150" prop="payTime">
<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"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit">更多操作</el-button>--> <!-- <el-button size="mini" type="text" icon="el-icon-edit">更多操作</el-button>-->
@ -530,6 +545,8 @@ export default {
}) })
}, },
getType(list, val) { getType(list, val) {
console.log("支付方式", list)
console.log("支付方式", val)
let name = ""; let name = "";
list.forEach(item => { list.forEach(item => {
if (item.dictValue == val) { if (item.dictValue == val) {
@ -543,6 +560,9 @@ export default {
getDicts("payment_type").then(response => { getDicts("payment_type").then(response => {
this.payList = response.data; this.payList = response.data;
}) })
getDicts("terminal").then(response => {
this.terminalList = response.data;
})
queryStaffs().then(response => { queryStaffs().then(response => {
this.staffList = response.data; this.staffList = response.data;
}) })