Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
4396364905
17
fuintCashierWeb/.env.development
Normal file
17
fuintCashierWeb/.env.development
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 页面标题
|
||||||
|
VUE_APP_TITLE = 百业兴智慧油站系统
|
||||||
|
|
||||||
|
# 开发环境配置
|
||||||
|
ENV = 'development'
|
||||||
|
|
||||||
|
# fuint会员营销系统/开发环境
|
||||||
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
|
# 发布目录
|
||||||
|
VUE_APP_PUBLIC_PATH = '/'
|
||||||
|
|
||||||
|
# 后端接口地址
|
||||||
|
VUE_APP_SERVER_URL = 'http://127.0.0.1:8080/'
|
||||||
|
|
||||||
|
|
||||||
|
# http://192.168.0.121:8080/
|
@ -3624,11 +3624,10 @@
|
|||||||
|
|
||||||
this.dialogVisiblej = true
|
this.dialogVisiblej = true
|
||||||
this.getCode(((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2),2);
|
this.getCode(((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2),2);
|
||||||
// this.getStaff()
|
|
||||||
},
|
},
|
||||||
// 网络下发之后获取条码
|
// 网络下发之后获取条码
|
||||||
getCode(amount,flag) {
|
getCode(amount,flag) {
|
||||||
console.log("this.payType",this.payType) // 现金不参与
|
|
||||||
if (this.payType == "CASH" && flag == 1) {
|
if (this.payType == "CASH" && flag == 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@
|
|||||||
¥{{ payForm.realyPayBills }}
|
¥{{ payForm.realyPayBills }}
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="text-align: center;margin-bottom: 10px">赠送金额</div> -->
|
<!-- <div style="text-align: center;margin-bottom: 10px">赠送金额</div> -->
|
||||||
<div v-if="(payForm.paymentType !== 'CASH' && flag === 1) || (payForm.paymentType !== 'CASH' && flag ===2) ">
|
<div v-if="payForm.paymentType !== 'CASH' ">
|
||||||
<div>
|
<div>
|
||||||
<el-input v-model="payForm.authCode"
|
<el-input v-model="payForm.authCode"
|
||||||
v-focus ref="getFocus"
|
v-focus ref="getFocus"
|
||||||
@ -525,6 +525,13 @@ import {userListByPhone} from "@/api/cashier/user";
|
|||||||
|
|
||||||
import { VueClipboard } from 'vue-clipboard2';
|
import { VueClipboard } from 'vue-clipboard2';
|
||||||
import {getDicts} from "@/api/dict/data";
|
import {getDicts} from "@/api/dict/data";
|
||||||
|
import {
|
||||||
|
getCheckTheStatusOfYourPaymentApi,
|
||||||
|
getCheckTheStatusOfYourPaymentByFuelApi,
|
||||||
|
getPrepaidCardTopUpApi,
|
||||||
|
getPrepaidFuelTopUpApi
|
||||||
|
} from "@/api/cashier/cardSet";
|
||||||
|
import {getReturnCode} from "@/api/print";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -639,7 +646,11 @@ export default {
|
|||||||
memberRecharge: false,
|
memberRecharge: false,
|
||||||
//会员搜索列表
|
//会员搜索列表
|
||||||
vipUserList:[],
|
vipUserList:[],
|
||||||
chooseVipUser:{}
|
chooseVipUser:{},
|
||||||
|
cardValueForm:{},
|
||||||
|
flag:1,
|
||||||
|
jishuqi:0,
|
||||||
|
continuePolling: true, // 控制轮询的变量
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -718,6 +729,177 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async collection1() {
|
||||||
|
let actualPayment = 0
|
||||||
|
let makeChange = 0
|
||||||
|
|
||||||
|
let userForm = this.chooseVipUser
|
||||||
|
|
||||||
|
if (this.flag === 1) {
|
||||||
|
if (!this.payForm.authCode && this.payForm.paymentType !== "CASH") {
|
||||||
|
this.$message.error('请先扫码');
|
||||||
|
return
|
||||||
|
}else {
|
||||||
|
if (this.payForm.authCode<this.payForm.amount || this.seekZero<0){
|
||||||
|
this.$modal.msgError("请输入正确的金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.payForm.authCode){
|
||||||
|
this.$modal.msgError("请输入正确的金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
actualPayment = this.payForm.authCode
|
||||||
|
makeChange = this.seekZero
|
||||||
|
}
|
||||||
|
// 会员id 会员名字会员手机号码
|
||||||
|
this.cardValueForm.mtUserId = userForm.id
|
||||||
|
this.cardValueForm.name = userForm.name
|
||||||
|
this.cardValueForm.mobile = userForm.mobile
|
||||||
|
// 支付码
|
||||||
|
this.cardValueForm.authCode = this.payForm.authCode
|
||||||
|
this.cardValueForm.realyPayBills = this.realyPayBills
|
||||||
|
this.cardValueForm.actualPayment = actualPayment
|
||||||
|
this.cardValueForm.makeChange = makeChange
|
||||||
|
|
||||||
|
|
||||||
|
let id;
|
||||||
|
await getPrepaidCardTopUpApi(this.cardValueForm).then(response => {
|
||||||
|
if (response.data != null) {
|
||||||
|
this.loading = true;
|
||||||
|
id = response.data.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let this_ = this
|
||||||
|
//
|
||||||
|
let timer = setInterval(async () => {
|
||||||
|
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
|
||||||
|
if (response.data != null) {
|
||||||
|
const payStatus = response.data.payStatus
|
||||||
|
if (payStatus === "unpaid") {
|
||||||
|
this_.isQuery = true;
|
||||||
|
} else if (payStatus === "paid") {
|
||||||
|
// 当支付成功时
|
||||||
|
this_.isPaySuccess = true;
|
||||||
|
this_.isQuery = false;
|
||||||
|
this_.rechargeBalCard = true
|
||||||
|
// await this_.printLocally1()
|
||||||
|
await this_.cardValueReport()
|
||||||
|
await this_.getMemberAfter();
|
||||||
|
clearInterval(timer);
|
||||||
|
} else if (payStatus === "payFail") {
|
||||||
|
this_.isPaySuccess = false;
|
||||||
|
this_.isQuery = false;
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await this_.getMemberAfter();
|
||||||
|
})
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
let timer2 = setInterval(function () {
|
||||||
|
if (!this_.isQuery || !this_.openConfirm) {
|
||||||
|
this_.loading = false;
|
||||||
|
this_.isPay = false;
|
||||||
|
clearInterval(timer);
|
||||||
|
clearTimeout(timer3);
|
||||||
|
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
var timer3 = setTimeout(function () {
|
||||||
|
clearInterval(timer2);
|
||||||
|
clearInterval(timer);
|
||||||
|
this_.loading = false;
|
||||||
|
this_.isPay = false;
|
||||||
|
this_.isPaySuccess = false;
|
||||||
|
this_.isAwait = true;
|
||||||
|
}, 15000)
|
||||||
|
|
||||||
|
} else if (this.flag === 2) {
|
||||||
|
if (!this.payForm.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
|
||||||
|
this.$message.error('请先扫码');
|
||||||
|
return
|
||||||
|
}else {
|
||||||
|
if (this.payForm.authCode<this.cardValueForm.amount || this.seekZero<0){
|
||||||
|
this.$modal.msgError("请输入正确的金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.payForm.authCode){
|
||||||
|
this.$modal.msgError("请输入正确的金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
actualPayment = this.payForm.authCode
|
||||||
|
makeChange = this.seekZero
|
||||||
|
}
|
||||||
|
this.cardFuelDieselForm.mtUserId = userForm.id
|
||||||
|
this.cardFuelDieselForm.name = userForm.name
|
||||||
|
this.cardFuelDieselForm.mobile = userForm.mobile
|
||||||
|
this.cardFuelDieselForm.authCode = this.payForm.authCode
|
||||||
|
this.cardFuelDieselForm.actualPayment = actualPayment
|
||||||
|
this.cardFuelDieselForm.makeChange = makeChange
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let id;
|
||||||
|
await getPrepaidFuelTopUpApi(this.cardFuelDieselForm).then(response => {
|
||||||
|
if (response.data != null) {
|
||||||
|
this.loading = true;
|
||||||
|
id = response.data.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let timer = setInterval(async () => {
|
||||||
|
getCheckTheStatusOfYourPaymentByFuelApi(id).then(async response => {
|
||||||
|
if (response.data != null) {
|
||||||
|
if (response.data.payStatus == "unpaid") {
|
||||||
|
this_.isQuery = true;
|
||||||
|
}
|
||||||
|
if (response.data.payStatus == "paid") {
|
||||||
|
this_.isPaySuccess = true;
|
||||||
|
this_.isQuery = false;
|
||||||
|
this_.rechargeOilCard = true
|
||||||
|
// await this.printLocally2()
|
||||||
|
await this.fuelDieselReport()
|
||||||
|
await this.getMemberAfter();
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
|
if (response.data.payStatus == "payFail") {
|
||||||
|
this_.isPaySuccess = false;
|
||||||
|
this_.isQuery = false;
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
let timer2 = setInterval(function () {
|
||||||
|
if (this_.isQuery == false || !this_.openConfirm) {
|
||||||
|
this_.loading = false;
|
||||||
|
this_.isPay = false;
|
||||||
|
clearInterval(timer);
|
||||||
|
clearInterval(timer2);
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
clearInterval(timer2);
|
||||||
|
clearInterval(timer);
|
||||||
|
this_.loading = false;
|
||||||
|
this_.isPay = false;
|
||||||
|
this_.isPaySuccess = false;
|
||||||
|
this_.isAwait = true;
|
||||||
|
|
||||||
|
}, 15000)
|
||||||
|
|
||||||
|
let this_ = this
|
||||||
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
|
|
||||||
|
},
|
||||||
|
cancelCollection(){
|
||||||
|
this.openConfirm = false
|
||||||
|
},
|
||||||
// 获取支付方式
|
// 获取支付方式
|
||||||
getPayList(){
|
getPayList(){
|
||||||
getDicts("payment_type").then( response => {
|
getDicts("payment_type").then( response => {
|
||||||
@ -741,14 +923,41 @@ export default {
|
|||||||
}
|
}
|
||||||
this.payForm.realyPayBills = selectCard.rechargeBalance
|
this.payForm.realyPayBills = selectCard.rechargeBalance
|
||||||
this.payForm.paymentType = selectCard.paymentType
|
this.payForm.paymentType = selectCard.paymentType
|
||||||
|
if (selectCard.cardType == 0){
|
||||||
|
this.flag = 1
|
||||||
|
}else if(selectCard.cardType == 1){
|
||||||
|
this.flag = 2
|
||||||
|
}
|
||||||
// // 发送扫码机请求(易联云网络下发)
|
// // 发送扫码机请求(易联云网络下发)
|
||||||
// await this.getSendPrintIndex(this.realyPayBills);
|
// await this.getSendPrintIndex(this.realyPayBills);
|
||||||
|
this.memberRecharge = false
|
||||||
this.openConfirm = true;
|
this.openConfirm = true;
|
||||||
this.isPay = true
|
this.isPay = true
|
||||||
this.getCode(this.realyPayBills,1)
|
//this.getCode(this.realyPayBills, this.flag)
|
||||||
|
},
|
||||||
|
// 网络下发之后获取条码
|
||||||
|
getCode(amount,flag) {
|
||||||
|
console.log("payType",this.payForm.payType) // 现金不参与
|
||||||
|
if (this.payForm.payType == "CASH" && flag == 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// if (this.cardValueForm.paymentType == "CASH" && flag == 1)
|
||||||
|
// this.jishuqi++;
|
||||||
|
if (this.jishuqi == 30) {
|
||||||
|
this.jishuqi = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.continuePolling = true;
|
||||||
|
getReturnCode ({payAmount:amount}).then(res=>{
|
||||||
|
if (res.data === "300" && this.continuePolling) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getCode(amount); // 重新发起请求
|
||||||
|
}, 1000); // 停顿一秒
|
||||||
|
}else {
|
||||||
|
this.payForm.authCode = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 油枪金额和商品金额发生变化,请求后端查询可用优惠活动
|
* @description 油枪金额和商品金额发生变化,请求后端查询可用优惠活动
|
||||||
* 传入后台的参数,会员的用户id、加油油号、加油订单金额(不包括商品金额)、加油订单总金额(包括商品金额)、加油总升数
|
* 传入后台的参数,会员的用户id、加油油号、加油订单金额(不包括商品金额)、加油订单总金额(包括商品金额)、加油总升数
|
||||||
|
Loading…
Reference in New Issue
Block a user