This commit is contained in:
zhaohengkun 2024-10-24 16:36:30 +08:00
parent 846ce4c33f
commit d0c8769c5d
8 changed files with 193 additions and 155 deletions

View File

@ -9,9 +9,15 @@
<include refid="selectOrders"></include>
<where>
store_id = #{order.storeId}
<if test="order.payUser != null and order.payUser != ''">
and pay_user like concat('%', #{order.payUser}, '%')
</if>
<if test="order.staffId != null and order.staffId != ''">
and staff_id = #{order.staffId}
</if>
<if test="order.payType != null and order.payType != ''">
and pay_type = #{order.payType}
</if>
<if test="order.orderNo != null and order.orderNo != ''">
and order_no like concat('%', #{order.orderNo}, '%')
</if>

View File

@ -206,13 +206,16 @@
</select>
<select id="orderStatistics" resultType="java.util.Map">
select count(*) numberOfProducts, -- 商品笔数
sum(pay_amount) theTotalAmount, -- 总金额
sum(goods_num) theTotalNumberOfUnits, -- 商品总数量
sum(discount) discountAmount, -- 优惠金额
COUNT(CASE WHEN pay_type = 'WECHAT' THEN 0 END) AS wechat, -- 微信
COUNT(CASE WHEN pay_type = 'ALIPAY' THEN 0 END) AS alipay, -- 支付宝
COUNT(CASE WHEN pay_type = 'CASH' THEN 0 END) AS cash -- 现金
SELECT
count(*) numberOfProducts,-- 商品笔数
sum( pay_amount ) theTotalAmount,-- 总金额
sum( goods_num ) theTotalNumberOfUnits,-- 商品总数量
sum( discount ) discountAmount,-- 优惠金额
sum( CASE WHEN pay_type = 'WECHAT' THEN pay_amount END ) AS wechat,-- 微信
sum( CASE WHEN pay_type = 'ALIPAY' THEN pay_amount END ) AS alipay,-- 支付宝
sum( CASE WHEN pay_type = 'CASH' THEN pay_amount END ) AS cash, -- 现金
sum( CASE WHEN pay_type = 'UNIONPAY' THEN pay_amount END ) AS UNIONPAY -- 银联二维码
from mt_order
<where>
store_id = #{order.storeId}

View File

@ -536,13 +536,14 @@
</select>
<select id="orderStatistics" resultType="java.util.Map">
select count(*) numberOfOilPens,
sum(order_amount) theTotalAmountOfOil,
sum(discount_amount) theTotalAmountOfTheOffer,
sum(oil_num) numberOfTransactions,
sum(pay_amount) totalAmountReceived,
COUNT(CASE WHEN pay_type = 'WECHAT' THEN 0 END) AS wechat,
COUNT(CASE WHEN pay_type = 'ALIPAY' THEN 0 END) AS alipay,
COUNT(CASE WHEN pay_type = 'CASH' THEN 0 END) AS cash
sum(order_amount) theTotalAmountOfOil,
sum(discount_amount) theTotalAmountOfTheOffer,
sum(oil_num) numberOfTransactions,
sum(pay_amount) totalAmountReceived,
sum(CASE WHEN pay_type = 'WECHAT' THEN pay_amount END) AS wechat,
sum(CASE WHEN pay_type = 'ALIPAY' THEN pay_amount END) AS alipay,
sum(CASE WHEN pay_type = 'CASH' THEN pay_amount END) AS cash,
sum( CASE WHEN pay_type = 'UNIONPAY' THEN pay_amount END ) AS UNIONPAY
from oil_order
<where>
store_id = #{order.storeId}

View File

@ -490,7 +490,7 @@
<el-form-item label="归还方式" prop="payType">
<el-radio style="margin-left: 0px;margin-bottom: 10px" v-model="payType" v-for="item in payList"
:key="item.dictValue" :value="item.dictValue"
v-if="item.dictValue!='APPLET_CODE'"
v-if="item.dictValue=='ALIPAY' || item.dictValue=='WECHAT' || item.dictValue=='UNIONPAY' || item.dictValue=='CASH'"
:label="item.dictValue"
@input="returnMethod"
border>{{ item.dictLabel }}</el-radio>
@ -672,7 +672,7 @@
@input="changePayType">
<el-radio v-for="item in payList"
:key="item.dictValue"
v-if="item.dictValue!='APPLET_CODE'"
v-if="item.dictValue=='ALIPAY' || item.dictValue=='WECHAT' || item.dictValue=='UNIONPAY' || item.dictValue=='CASH'"
:value="item.dictValue"
:label="item.dictValue" border>{{ item.dictLabel }}</el-radio>
</el-radio-group>
@ -928,83 +928,83 @@ import {getLodop} from "@/api/LodopFuncs";
},
methods:{
async printLocally() {
//
let LODOP = getLodop(); //
LODOP.PRINT_INIT();
var bodyStyle = `<style>
.input-box{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
}
.box-ge{
border-bottom: 1px solid #000000 ;
box-sizing: border-box;
padding: 10px;
}
.box-title{
font-size: 18px;
text-align: center;
align-items: center;
margin-top: 15px;
}
.input-hui{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 15px 0px;
background: #b2b2b2;
box-sizing: border-box;
padding: 5px 0px;
}
.input-hui-frou{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 15px 0px;
background: #b2b2b2;
box-sizing: border-box;
padding: 5px 0px;
div{
width: 25%;
text-align: left;
}
}
.input-box-frou{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
div{
width: 25%;
text-align: left;
}
}
.box-center{
height: 500px;
}
</style>
`
var fromHtml = bodyStyle+this.$refs.report.innerHTML
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml);
LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
// LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789');
// let preview = LODOP.PREVIEW();
// console.log("preview",preview);
LODOP.PRINT();
// //
// let LODOP = getLodop(); //
// LODOP.PRINT_INIT();
// var bodyStyle = `<style>
// .input-box{
// width: 100%;
// display: flex;
// align-items: center;
// justify-content: space-between;
// font-size: 14px;
// margin: 5px 0px;
// }
// .box-ge{
// border-bottom: 1px solid #000000 ;
// box-sizing: border-box;
// padding: 10px;
// }
// .box-title{
// font-size: 18px;
// text-align: center;
// align-items: center;
// margin-top: 15px;
// }
// .input-hui{
// width: 100%;
// display: flex;
// align-items: center;
// justify-content: space-between;
// font-size: 14px;
// margin: 15px 0px;
// background: #b2b2b2;
// box-sizing: border-box;
// padding: 5px 0px;
// }
// .input-hui-frou{
// width: 100%;
// display: flex;
// align-items: center;
// justify-content: space-between;
// font-size: 14px;
// margin: 15px 0px;
// background: #b2b2b2;
// box-sizing: border-box;
// padding: 5px 0px;
// div{
// width: 25%;
// text-align: left;
// }
// }
// .input-box-frou{
// width: 100%;
// display: flex;
// align-items: center;
// justify-content: space-between;
// font-size: 14px;
// margin: 5px 0px;
// div{
// width: 25%;
// text-align: left;
// }
// }
// .box-center{
// height: 500px;
// }
// </style>
// `
// var fromHtml = bodyStyle+this.$refs.report.innerHTML
//
//
// LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml);
//
// LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
//
// // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789');
// // let preview = LODOP.PREVIEW();
// // console.log("preview",preview);
// LODOP.PRINT();
},
getStaffList(){
@ -1242,7 +1242,7 @@ import {getLodop} from "@/api/LodopFuncs";
this.open4 = false;
this.getList();
},
//
//
async collection(){
if (this.payType=="CASH"){
if (this.authCode==undefined || this.authCode=="" || this.seekZero<0){
@ -1374,6 +1374,7 @@ import {getLodop} from "@/api/LodopFuncs";
getPayList() {
getDicts("payment_type").then(response => {
this.payList = response.data;
console.log(this.payList)
})
},
//

View File

@ -322,30 +322,8 @@
<el-button type="primary" @click="ScanCodePayment = false">关闭</el-button>
</span>
</el-dialog>
<!-- <el-dialog-->
<!-- title="现金支付"-->
<!-- :visible.sync="cashPayment"-->
<!-- width="439px"-->
<!-- center-->
<!-- >-->
<!-- <div class="tc-box">-->
<!-- <div class="title_">应收款 <span style="color: #F44522">¥{{realAmount}}</span></div>-->
<!-- <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">-->
<!-- <el-form-item label="收款金额" prop="number">-->
<!-- <el-input v-model="ruleForm2.number">-->
<!-- <template slot="append"></template>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <div class="t-size">-->
<!-- 应找零<span style="color: #F44522">¥{{getChangeShould}}</span>-->
<!-- </div>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="cashPaymentClick()">确定收款</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<el-dialog :close-on-click-modal="false"
<el-dialog
title="挂单"
:visible.sync="hangingAnOrder"
width="542px"
@ -1404,6 +1382,10 @@ export default {
this.$modal.msgError("请先扫码");
return;
}
//
this.payForm.seekZero = this.getChangeShould
this.loading = true;
let _this = this;
//
@ -1521,7 +1503,7 @@ export default {
//
this.payForm.goodsAmount = this.getGoodsNum || 0
//
this.payForm.oilActualPay = (this.oilGunClearing.getAmount || 0)-(this.disOil || 0)
this.payForm.oilActualPay = (this.oilGunClearing.amount || 0)-(this.disOil || 0)
//
this.payForm.goodsActualPay = (this.getGoodsNum || 0) - (this.disGoods || 0)
//id
@ -1542,7 +1524,13 @@ export default {
this.payForm.goodsDiscount = this.disGoods;
// ()
this.payForm.consumeAmount = this.realAmount;
if (this.payForm.payType == "card_value"){
this.payForm.consumeAmount = this.realAmount;
}
else {
this.payForm.consumeAmount = 0
}
//id
this.payForm.userId = this.chooseVipUser.id
// PC
@ -1555,10 +1543,8 @@ export default {
// +
this.payForm.allAmount = this.realAmount
this.payForm.paymentType = this.payType
console.log('支付类型', this.payForm.paymentType)
//
this.payForm.realyPayBills = this.realAmount

View File

@ -120,7 +120,11 @@
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="orderNo" align="center" label="订单号" ></el-table-column>
<el-table-column prop="amount" align="center" label="订单金额(元)"></el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠金额(元)"></el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠金额(元)">
<template slot-scope="scope">
<span>{{ scope.row.oilDiscountAmount + scope.row.goodsDiscountAmount }}</span>
</template>
</el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="应收金额(元)"></el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额(元)"></el-table-column>
<el-table-column prop="payAmount" align="center" label="已收金额(元)"></el-table-column>
@ -151,12 +155,9 @@
</el-table-column>
<el-table-column prop="payUser" align="center" label="付款用户" ></el-table-column>
<el-table-column prop="status" align="center" label="支付方式">
<el-table-column prop="payType" 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>
{{getPayTypeStr(scope.row.payType)}}
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="订单状态">
@ -167,7 +168,7 @@
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column prop="payUser" align="center" label="关联员工" ></el-table-column>
<!-- <el-table-column prop="payUser" align="center" label="关联员工" ></el-table-column>-->
<el-table-column label="操作人" align="center" prop="staffId">
<template slot-scope="scope">
<span>{{ getRealName(staffList, scope.row.staffId) || '--' }}</span>
@ -209,8 +210,8 @@
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
@pagination="pageList"
/>
</div>
</div>
@ -1059,6 +1060,12 @@ export default {
},
//
getPayTypeStr(payType){
const item = this.payList.find(item => item.dictValue === payType);
return item ? item.dictLabel : '';
},
//
reoilOrderReport() {
let oilOrderR = []
@ -1107,7 +1114,6 @@ export default {
};
let payTypeText = payTypeMap[this.cashierOrder.payType] || '小程序码';
let f = {
oilOrder: oilOrderR,
goodsOrder: goodsOrderR,
@ -1356,11 +1362,8 @@ export default {
// return new Date(y , mon , d , h , m , s);
return y + mon + d + h + m + s;
},
//
getList(val) {
if (val != undefined) {
this.queryParams.page = val
}
//
pageList(val) {
let dateRange1 = this.dateRange
let dateRange = []
@ -1380,13 +1383,38 @@ export default {
this.total = response.data.total;
this.isSysDate = false
})
this.getSeekZero(val)
this.getSeekZero()
this.getOrderStatistics()
},
getSeekZero(val) {
if (val != undefined) {
this.queryParams.page = val
//
getList() {
//
this.queryParams.page = 1
let dateRange1 = this.dateRange
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// if (this.isSysDate){
// dateRange.push(dateRange1[0].toLocaleDateString())
// dateRange.push(dateRange1[1].toLocaleDateString())
// }else {
// dateRange = this.dateRange
// }
listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getSeekZero()
this.getOrderStatistics()
},
getSeekZero() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())

View File

@ -26,7 +26,7 @@
<el-form-item label="" prop="payType">
<el-select
v-model="queryParams.payType"
placeholder="请选择订单类型"
placeholder="请选择支付方式"
clearable
style="width: 240px"
>
@ -113,11 +113,11 @@
</div>
<div class="box2">
<div class="x_size" style="font-size: 26px;color: #2B63F4;font-weight: bold;margin-top: 5px">
{{ orderStatistics.wechat || 0 }}/{{ orderStatistics.alipay || 0 }}
{{ orderStatistics.UNIONPAY || 0 }}
</div>
<div class="size-hui">
<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 class="box2">
@ -169,16 +169,16 @@
</template>
</el-table-column>
<!-- <el-table-column label="订单类型" align="center" prop="type"/>-->
<el-table-column label="关联员工" align="center" prop="staffId">
<!-- <el-table-column label="关联员工" align="center" prop="staffId">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ getRealName(staffList, scope.row.staffId) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作人" align="center" width="150" prop="staffId">
<template slot-scope="scope">
<span>{{ getRealName(staffList, scope.row.staffId) }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" width="150" prop="payTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="订单完成时间" align="center" width="150" prop="payTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>

View File

@ -151,11 +151,11 @@
</div>
<div class="box2">
<div style="font-size: 26px;color: #2B63F4;font-weight: bold;margin-top: 5px">
{{ orderStatistics.wechat || 0 }}/{{ orderStatistics.alipay || 0 }}
{{ orderStatistics.UNIONPAY || 0 }}
</div>
<div class="size-hui">
<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 class="box2">
@ -231,8 +231,12 @@
<span>{{ scope.row.remark || "--" }}</span>
</template>
</el-table-column>
<el-table-column prop="orderType" label="关联员工" align="center"></el-table-column>
<el-table-column prop="orderType" label="操作人" align="center"></el-table-column>
<!-- <el-table-column prop="orderType" label="关联员工" align="center"></el-table-column>-->
<el-table-column label="操作人" align="center" width="150" prop="staffId">
<template slot-scope="scope">
<span>{{ getRealName(staffList, scope.row.staffId) }}</span>
</template>
</el-table-column>
<el-table-column label="订单完成时间" align="center" prop="payTime">
<template slot-scope="scope">
<span>{{ scope.row.payTime ? parseTime(scope.row.payTime) : "--" }}</span>
@ -753,7 +757,16 @@ export default {
this.getList();
},
//
getRealName(list, id) {
var name = "";
list.forEach(item => {
if (item.id == id) {
name = item.realName;
}
})
return name;
},
//
getInfoById() {