@@ -374,6 +374,7 @@
import {printLocallyApi,addHandoverApis} from "@/api/cashier/handover";
import BigNumber from "bignumber.js";
import {getLodop} from "@/api/LodopFuncs";
+import {printGetHandoverReport} from "@/api/print";
export default {
name: "HandoverOnly",
@@ -392,7 +393,11 @@ import {getLodop} from "@/api/LodopFuncs";
// this.getHandover();
},
methods: {
+ oilOrderReport () {
+ printGetHandoverReport(this.handoverList).then(res=>{
+ })
+ },
printLocally() {
// const printHTML = document.querySelector('#report').innerHTML
// // 将打印的区域赋值,进行打印
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
index b9c670b6a..25efbcb13 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue
@@ -466,6 +466,7 @@ import {getUserGrade, listUserGrade} from "@/api/cashier/usergrade";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
+import {getReturnCode, printIntegralReport, sendPrintIndex} from "@/api/print";
export default {
name: "Integral",
@@ -987,7 +988,7 @@ import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
this.openOrderHistory = true
},
// 立即结算
- settlement(){
+ async settlement(){
if (this.shoppingCart.length <1){
this.$message.error('请先选择商品');
return
@@ -997,7 +998,76 @@ import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
}
this.isPay = true;
this.dialogVisiblej = true
+ if (this.paymentType !== 'CASH') {
+ if (this.allAmout != 0) {
+ // 发送扫码机请求(易联云网络下发)
+ await this.getSendPrintIndex(this.allAmout);
+ this.getCode(this.allAmout)
+
+ }
+
+ }
},
+ // 网络下发之后获取条码
+ getCode(amount) {
+ this.jishuqi++;
+ if (this.jishuqi == 30) {
+ this.jishuqi = 0
+ return
+ }
+ getReturnCode ({payAmount:amount}).then(res=>{
+ if (res.data === "300") {
+ setTimeout(() => {
+ this.getCode(amount); // 重新发起请求
+ }, 1000); // 停顿一秒
+ }else {
+ this.authCode = res.data
+ }
+ })
+ },
+ getSendPrintIndex(amount) {
+ sendPrintIndex({payAmount:amount}).then(ress=>{
+ if (ress.data != "success") {
+ this.$modal.msgError("扫码机发起付款失败!")
+ return;
+ }
+ })
+ },
+ integralReport() {
+ let shoppingCart = []
+ this.shoppingCart.forEach(res=>{
+ let price = ''
+ if (res.exchangeMethod == '积分' || res.exchangeMethod == '积分+金额' || res.exchangeMethod == '积分+加钱购') {
+ price = res.exchangePoints+"积分"
+ }
+ if (res.exchangeMethod == '积分+金额'){
+ price = price+"+"
+ }
+ if (res.exchangeMethod == '金额' || res.exchangeMethod == '积分+金额'){
+ price = price+"¥"+res.exchangeAmount
+ }
+ if (res.exchangeMethod == '积分+加钱购'){
+ price = price +"+"+res.moneyRatio+"加钱比例"
+ }
+ let a = {
+ giftName:res.giftName,
+ markPurchases:res.markPurchases,
+ price:price
+ }
+ shoppingCart.push(a)
+ })
+ let f = {
+ shoppingCart:shoppingCart,
+ allPoints:this.allPoints,
+ allAmout:this.allAmout
+ }
+ printIntegralReport(f).then(res=>{
+
+ })
+
+ },
+
+
// 确定收款
async collection() {
let isPayFlag = false
@@ -1078,7 +1148,8 @@ import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
this_.isPay = false;
console.log("isPayFlag",isPayFlag)
if (isPayFlag) {
- this_.printLocally()
+ // this_.printLocally()
+ this_.integralReport()
isPayFlag = false
}
clearInterval(timer);
@@ -1154,7 +1225,6 @@ import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
this.authCode = '';
},
async printLocally(data) {
- console.log("111111111111111111111111111111111111111111111")
if (!connectFlag){
return
}
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
index e3d46bd71..782792e16 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
@@ -1264,6 +1264,13 @@
getPrepaidCardTopUpApi, getPrepaidFuelTopUpApi
} from "@/api/cashier/cardSet";
import SelectStaff from "@/components/local/selectStaff.vue";
+ import {
+ getReturnCode,
+ printCardValueReport,
+ printFuelDieselReport,
+ printOilOrderReport,
+ sendPrintIndex
+ } from "@/api/print";
const cityOptions = ['上海', '北京'];
export default {
@@ -1600,6 +1607,7 @@
oilPrice:"",
oilLiters:"",
},
+ jishuqi:0,
preferentialData1:{},
oilPreferentialData:[],
// 挂账单位信息
@@ -1907,7 +1915,8 @@
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeBalCard = true
- await this_.printLocally1()
+ // await this_.printLocally1()
+ await this_.cardValueReport()
await this_.getMemberAfter();
clearInterval(timer);
} else if (payStatus === "payFail") {
@@ -1982,7 +1991,8 @@
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeOilCard = true
- await this.printLocally2()
+ // await this.printLocally2()
+ await this.fuelDieselReport()
await this.getMemberAfter();
clearInterval(timer);
}
@@ -2156,7 +2166,10 @@
},
// 确认充值
- confirm(flag) {
+ async confirm(flag) {
+
+
+
this.flag = flag
if (flag === 1) {
@@ -2183,9 +2196,15 @@
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
}
+
+ // 发送扫码机请求(易联云网络下发)
+ await this.getSendPrintIndex(this.realyPayBills);
+
this.openConfirm = true;
this.isPay = true
+ this.getCode(this.realyPayBills)
+
},
printLocally() {
if (!connectFlag){
@@ -2547,6 +2566,8 @@
this.$modal.msgSuccess("挂账记录添加成功");
this.dialogVisibleCredit = false;
this.printLocally()
+ this.oilOrderReport()
+
this.form1.unitName = ""
this.payType = "WECHAT"
this.resetMember();
@@ -3584,7 +3605,9 @@
this.goods = ""
},
// 立即结算
- settlement(){
+ async settlement(){
+ // 发送扫码机请求(易联云网络下发)this.realyPayBills
+ await this.getSendPrintIndex(((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2));
// this.autofocus = true
if (this.payType=="APPLET_CODE") {
if (this.goodsOrder.length > 0) {
@@ -3603,10 +3626,161 @@
}
this.dialogVisiblej = true
-
+ this.getCode(((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2));
// this.getStaff()
},
- // 重置油品订单
+ // 网络下发之后获取条码
+ getCode(amount) {
+ this.jishuqi++;
+ if (this.jishuqi == 30) {
+ this.jishuqi = 0
+ return
+ }
+ getReturnCode ({payAmount:amount}).then(res=>{
+ if (res.data === "300") {
+ setTimeout(() => {
+ this.getCode(amount); // 重新发起请求
+ }, 1000); // 停顿一秒
+ }else {
+ this.authCode = res.data
+ }
+ })
+ },
+ getSendPrintIndex(amount) {
+ sendPrintIndex({payAmount:amount}).then(ress=>{
+ if (ress.data != "success") {
+ this.$modal.msgError("扫码机发起付款失败!")
+ return;
+ }
+ })
+ },
+
+
+ // 打印商品支付后的订单
+ oilOrderReport () {
+ let oilOrderR = []
+ this.oilOrder.forEach(order=>{
+ let o = {
+ oilName : this.getName(this.oilNameList, order.oilName) + "-" + this.getName1(this.gunList, order.gunName),
+ amount : order.amount.toString()
+ }
+ oilOrderR.push(o)
+ })
+
+ let goodsOrderR = []
+ this.goodsOrder.forEach(order=>{
+ let o = {
+ oilName : order.name,
+ amount : order.memberPrice.toString()
+ }
+ goodsOrderR.push(o)
+ })
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.payType] || '小程序码';
+
+ let f ={
+ oilOrder:oilOrderR,
+ goodsOrder:goodsOrderR,
+ payType:payTypeText,
+ unitName:this.form1.unitName, // 挂账单位
+
+ // consumeAmount:this.consumeAmount,
+ creditAmount: (this.oilAmount+(+this.goodsAmount)).toFixed(2),//挂账金额
+ // 优惠合计
+ discount:(this.oilDiscount + this.goodsDiscount + this.fullReduction + this.couponAmount).toFixed(2), // 油惠合计
+ // 储值卡付款
+ consumeAmount:this.consumeAmount,
+ // 屯油卡付款
+ consumeRefuelMoney:this.consumeRefuelMoney.toFixed(2),
+ // 实付款
+ actualPay : ((+this.oilActualPay)+(+this.goodsActualPay)).toFixed(2),
+ // 找零
+ seekZero:this.seekZero.toFixed(2),
+ }
+ printOilOrderReport(f).then(res=>{
+
+ })
+ },
+
+ cardValueReport() {
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.cardValueForm.paymentType]
+ let actualPay = this.cardValueForm.paymentType == 'CASH' ? this.authCode:this.realyPayBills
+
+ let a = {
+ // 充值金额
+ realyPayBills:this.realyPayBills,
+ //赠送金额
+ giftBalance:this.cardValueForm.giftBalance,
+ // 到账金额
+ getAmount:this.cardValueForm.giftBalance + this.realyPayBills,
+ payType:payTypeText,
+
+ // 实付款
+ actualPay: actualPay,
+ // 找零
+ seekZero:this.seekZero.toFixed(2),
+ }
+
+ printCardValueReport(a).then(res=>{
+
+ })
+
+ },
+ fuelDieselReport() {
+
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.cardFuelDieselForm.paymentType]
+
+ let a = {
+ // 充值油品
+ oilType:this.cardFuelDieselForm.type,
+ // 充值升数
+ incomeLitres:this.cardFuelDieselForm.incomeLitres,
+ // 订单金额
+ realyPayBills:this.realyPayBills,
+ // 锁价金额
+ lockupPrice:cardFuelDieselForm.lockupPrice,
+ // 支付方式
+ payType:payTypeText,
+ // 实付款
+
+ // 找零
+ seekZero:this.seekZero.toFixed(2),
+ }
+
+ printFuelDieselReport(a).then(res=>{
+
+ })
+ },
+ // 重置油品订单
resetting(){
this.seekZero = 0;
this.oilOrder = [];
@@ -3947,7 +4121,8 @@
_this.loading = false;
_this.isPaySuccess = true;
_this.isPay = true;
- _this.printLocally()
+ // _this.printLocally()
+ _this.oilOrderReport()
_this.resetting1();
},3000)
}else {
@@ -3975,6 +4150,8 @@
_this.isPay = true;
_this.loading = false;
_this.printLocally()
+ _this.oilOrderReport()
+
_this.resetting1()
return;
}
@@ -3986,6 +4163,8 @@
_this.isPay = true;
_this.loading = false;
_this.printLocally()
+ _this.oilOrderReport()
+
_this.resetting1()
return;
}
@@ -4116,6 +4295,8 @@
_this.loading = false;
_this.printLocally()
+ _this.oilOrderReport()
+
_this.resetting1();
if (response.data.oilOrderAmount>0){
diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue
index 37fde0817..7fa32a218 100644
--- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue
+++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue
@@ -523,6 +523,7 @@ import {connectFlag, getLodop} from "@/api/LodopFuncs";
import {getOilNumberGun} from "@/api/cashier/oilGuns";
import {formatDate} from "@/utils";
import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue";
+import {rePrintOilOrderReport} from "@/api/print";
export default {
name: "order_Cashier",
@@ -731,6 +732,62 @@ import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue"
LODOP.PRINT();
},
+
+ // 打印商品支付后的订单
+ oilOrderReport () {
+ let oilOrderR = []
+ this.oilInfo.forEach(order=>{
+ let o = {
+ oilName : this.getName(this.oilNameList, order.oils) + "-" + this.getName1(this.oilGunList, order.oilGunNum),
+ amount : order.orderAmount.toString(),
+ oilNum : order.oilNum.toString()
+ }
+ oilOrderR.push(o)
+ })
+ console.log("111111111111111111111111111")
+
+ let goodsOrderR = []
+ if (this.goodsInfo) {
+ this.goodsInfo.forEach(order=>{
+ console.log("111111111111111111111111111")
+
+ let o = {
+ oilName : order.name,
+ unit : order.num+""+order.unit,
+ amount : order.memberPrice.toString()
+ }
+ goodsOrderR.push(o)
+ })
+ }
+
+ console.log("111111111111111111111111112")
+
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.payType] || '小程序码';
+ console.log("111111111111111111111111113")
+
+ let f ={
+ oilOrder:oilOrderR,
+ goodsOrder:goodsOrderR,
+ payType:payTypeText,
+ amount:this.cashierOrder.amount,
+ payAmount:this.cashierOrder.amount,
+ seekZero:this.cashierOrder.payAmount
+ }
+ rePrintOilOrderReport(f).then(res=>{
+
+ })
+ },
+
// 补打
patchwork(data){
const orderNo = data.orderNo
@@ -743,7 +800,8 @@ import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue"
})
await this.getOilList(this.cashierOrder.orderNo)
await this.getGoodsLists(this.cashierOrder.goodsOrderId)
- this.printLocally('report')
+ // this.printLocally('report')
+ this.oilOrderReport()
}).catch(() => {});
},
// 退款
@@ -847,7 +905,8 @@ import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue"
type: 'info',
message: '退款成功'
});
- this.printLocally()
+ // this.printLocally()
+ this.oilOrderReport()
}
})
diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue
index e8dea0393..4d8c57100 100644
--- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue
+++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue
@@ -312,6 +312,7 @@ import { exportExcelGoodsOrderApi } from "@/api/order/exportExcel";
import {cashierOrder} from "@/api/cashier/cashierorder";
import {refundApi, getOrderInfoApi} from "@/api/cashier/refund";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
+import {rePrintOilOrderReport} from "@/api/print";
export default {
name: "order_Cashier",
@@ -491,6 +492,48 @@ export default {
LODOP.PRINT();
},
+
+ // 打印商品支付后的订单
+ oilOrderReport () {
+ let oilOrderR = []
+
+ let goodsOrderR = []
+ if (this.goodsList) {
+ this.goodsList.forEach(order=>{
+ let o = {
+ oilName : order.name,
+ unit : order.num+""+order.unit,
+ amount : order.memberPrice.toString()
+ }
+ goodsOrderR.push(o)
+ })
+ }
+
+
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.goods.payType] || '小程序码';
+
+ let f ={
+ oilOrder:oilOrderR,
+ goodsOrder:goodsOrderR,
+ payType:payTypeText,
+ amount:this.goods.amount,
+ discount:this.goods.discount,
+ // seekZero:""
+ }
+ rePrintOilOrderReport(f).then(res=>{
+
+ })
+ },
// 补打
patchwork(data){
const orderNo = data.orderNo
@@ -504,7 +547,8 @@ export default {
this.goodsList = response.data
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
})
- this.printLocally()
+ // this.printLocally()
+ this.oilOrderReport()
}).catch(() => {});
},
diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue
index e045f12af..dd3913a7b 100644
--- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue
+++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue
@@ -352,6 +352,7 @@
import {exportExcelOilOrderApi} from "@/api/order/exportExcel";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
import {getInfoByIdApi} from "@/api/cashier/cardfavorablerecord";
+ import {printOilOrderReport} from "@/api/print";
export default {
name: "order_Cashier",
@@ -512,6 +513,55 @@
LODOP.PRINT();
},
+
+ // 打印商品支付后的订单
+ oilOrderReport () {
+ console.log("22222222222222222")
+ let oilOrderR = []
+ let o = {
+ oilName : this.getName(this.oilNameList, this.oilOrder.oils) + "-" + this.getName1(this.oilGunList, this.oilOrder.oilGunNum),
+ amount : this.oilOrder.orderAmount.toString()
+ }
+ oilOrderR.push(o)
+
+ let goodsOrderR = []
+
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.payType] || '小程序码';
+
+ let f ={
+ oilOrder:oilOrderR,
+ goodsOrder:goodsOrderR,
+ payType:payTypeText,
+ unitName:"", // 挂账单位
+
+ // 订单总额
+
+ // consumeAmount:this.consumeAmount,
+ creditAmount: "",//挂账金额
+ // 优惠合计
+ discount:this.oilOrder.discountAmount, // 油惠合计
+ // 储值卡付款
+ consumeAmount:this.oilOrder.balanceAmount,
+ // 屯油卡付款
+ consumeRefuelMoney:this.oilOrder.oilCardAmount,
+ // 实付款
+ actualPay : this.oilOrder.payAmount,
+ }
+ printOilOrderReport(f).then(res=>{
+
+ })
+ },
+
exportExcelOilOrder() {
let dateRange = []
if (this.beginTime && this.endTime) {
@@ -574,7 +624,8 @@
this.oilOrder = response.data
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
})
- this.printLocally()
+ // this.printLocally()
+ this.oilOrderReport()
}).catch(() => {});
},
// 退款
diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue
index 60fc0fed9..c9468a3cd 100644
--- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue
+++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue
@@ -282,6 +282,7 @@ import {queryStaffs} from "@/api/cashier/staff";
import {refundApi} from "@/api/cashier/refund";
import {exportExcelVipApi} from "@/api/order/exportExcel";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
+import {printCardValueReport} from "@/api/print";
export default {
name: "order_Cashier",
@@ -460,6 +461,41 @@ export default {
// console.log("preview",preview);
LODOP.PRINT();
+ },
+
+ cardValueReport() {
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.oilOrder.paymentType]
+ // let actualPay = this.cardValueForm.paymentType == 'CASH' ? this.authCode:this.realyPayBills
+
+ let a = {
+ // 充值金额
+ realyPayBills:this.oilOrder.amount ? this.oilOrder.amount : this.oilOrder.rechargeBalance,
+ //赠送金额
+ giftBalance:this.oilOrder.giftBalance,
+ // 到账金额
+ getAmount:this.oilOrder.amount ? this.oilOrder.giftBalance + this.oilOrder.amount : this.oilOrder.giftBalance + this.oilOrder.rechargeBalance,
+ payType:payTypeText,
+
+ // 实付款
+ actualPay: this.oilOrder.amount ? this.oilOrder.amount : this.oilOrder.rechargeBalance,
+ // 找零
+ // seekZero:this.seekZero.toFixed(2),
+ }
+
+ printCardValueReport(a).then(res=>{
+
+ })
+
},
// 补打
patchwork(data){
@@ -470,7 +506,8 @@ export default {
await cardValueRecordInfo(data.id).then( response => {
this.oilOrder = response.data
})
- this.printLocally()
+ // this.printLocally()
+ this.cardValueReport()
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
}).catch(() => {});
},
diff --git a/fuintCashierWeb/src/views/details/index.vue b/fuintCashierWeb/src/views/details/index.vue
index 0e4082901..6969bfa26 100644
--- a/fuintCashierWeb/src/views/details/index.vue
+++ b/fuintCashierWeb/src/views/details/index.vue
@@ -929,6 +929,7 @@ import {getDicts} from "@/api/dict/data";
import {getSysConfig} from "@/api/cashier/user/sysconfig";
import {giftCardExchange} from "@/api/cashier/giftCard/giftcard";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
+import {getReturnCode, printCardValueReport, printFuelDieselReport, sendPrintIndex} from "@/api/print";
export default {
components: {
@@ -1476,7 +1477,7 @@ export default {
// 存油卡列表
},
// 确认充值
- confirm(flag) {
+ async confirm(flag) {
this.flag = flag
if (flag === 1) {
@@ -1503,8 +1504,11 @@ export default {
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
}
+ // 发送扫码机请求(易联云网络下发)
+ await this.getSendPrintIndex(this.realyPayBills);
this.openConfirm = true;
this.isPay = true
+ this.getCode(this.realyPayBills)
this.title = this.payment
},
@@ -1867,7 +1871,9 @@ export default {
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeBalCard = true
- await this_.printLocally1()
+ // await this_.printLocally1()
+ this_.cardValueReport()
+
await this_.getUserInfo()
clearInterval(timer);
} else if (payStatus === "payFail") {
@@ -1944,7 +1950,9 @@ export default {
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeOilCard = true
- await this_.printLocally2()
+ // await this_.printLocally2()
+ await this.fuelDieselReport()
+
await this_.getUserInfo()
clearInterval(timer);
}
@@ -2108,8 +2116,105 @@ export default {
// 返回
goBack() {
this.$router.back(-1);
- }
+ },
// 积分表、储值卡详情表、积分详情表、储值卡表、储值卡模板表、用户储值卡关联表、
+
+ cardValueReport() {
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.cardValueForm.paymentType]
+ let actualPay = this.cardValueForm.paymentType == 'CASH' ? this.authCode:this.realyPayBills
+
+ let a = {
+ // 充值金额
+ realyPayBills:this.realyPayBills,
+ //赠送金额
+ giftBalance:this.cardValueForm.giftBalance,
+ // 到账金额
+ getAmount:this.cardValueForm.giftBalance + this.realyPayBills,
+ payType:payTypeText,
+
+ // 实付款
+ actualPay: actualPay,
+ // 找零
+ seekZero:this.seekZero.toFixed(2),
+ }
+
+ printCardValueReport(a).then(res=>{
+
+ })
+
+ },
+
+ // 网络下发之后获取条码
+ getCode(amount) {
+ this.jishuqi++;
+ if (this.jishuqi == 30) {
+ this.jishuqi = 0
+ return
+ }
+ getReturnCode ({payAmount:amount}).then(res=>{
+ if (res.data === "300") {
+ setTimeout(() => {
+ this.getCode(amount); // 重新发起请求
+ }, 1000); // 停顿一秒
+ }else {
+ this.authCode = res.data
+ }
+ })
+ },
+ getSendPrintIndex(amount) {
+ sendPrintIndex({payAmount:amount}).then(ress=>{
+ if (ress.data != "success") {
+ this.$modal.msgError("扫码机发起付款失败!")
+ return;
+ }
+ })
+ },
+
+ fuelDieselReport() {
+
+ // 支付方式
+ const payTypeMap = {
+ 'CASH': '现金',
+ 'WECHAT': '微信',
+ 'ALIPAY': '支付宝',
+ 'UNIONPAY': '银联二维码',
+ 'credit': '挂账',
+ 'oilCard': '囤油卡',
+ 'balance': '储值卡'
+ };
+ let payTypeText = payTypeMap[this.cardFuelDieselForm.paymentType]
+
+ let a = {
+ // 充值油品
+ oilType:this.cardFuelDieselForm.type,
+ // 充值升数
+ incomeLitres:this.cardFuelDieselForm.incomeLitres,
+ // 订单金额
+ realyPayBills:this.realyPayBills,
+ // 锁价金额
+ lockupPrice:cardFuelDieselForm.lockupPrice,
+ // 支付方式
+ payType:payTypeText,
+ // 实付款
+
+ // 找零
+ seekZero:this.seekZero.toFixed(2),
+ }
+
+ printFuelDieselReport(a).then(res=>{
+
+ })
+ },
},
watch: {
openConfirm(newValue) {