营销活动
This commit is contained in:
parent
963153f603
commit
fc39df7628
@ -113,7 +113,7 @@
|
||||
|
||||
<div class="er-box"></div>
|
||||
<div class="wrap-box" style="position: absolute;bottom: 0;">
|
||||
<div class="f-box" v-for="(item,index) in payList" :class="{'f-acvite' : item.dictValue == payWay }"
|
||||
<div class="f-box" v-for="(item,index) in payList" :class="{'f-acvite' : item.dictValue == payType }"
|
||||
@click="setindex(item.dictValue)" :key="item.dictValue"
|
||||
>{{ item.dictLabel }}
|
||||
</div>
|
||||
@ -552,6 +552,7 @@ import {
|
||||
rechargeCard
|
||||
} from "@/api/cashier/cardSet";
|
||||
import {getReturnCode} from "@/api/print";
|
||||
import {addLJGoods, scanAppletQrCode} from "@/api/cashier/oilorder";
|
||||
|
||||
export default {
|
||||
dicts: ['CardCoupon_type'],
|
||||
@ -577,7 +578,7 @@ export default {
|
||||
//选中的优惠券对象
|
||||
chooseCoupon:{},
|
||||
//支付方式--默认支付宝
|
||||
payWay: "ALIPAY",
|
||||
payType: "ALIPAY",
|
||||
//订单总金额
|
||||
orderAmount:0.00,
|
||||
//加油升数
|
||||
@ -1006,10 +1007,129 @@ export default {
|
||||
this.isPay = true
|
||||
//this.getCode(this.realyPayBills, this.flag)
|
||||
},
|
||||
// 确定收款
|
||||
async collection(){
|
||||
if (this.payForm.payType=="CASH"){
|
||||
if (this.payForm.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){
|
||||
this.$modal.msgError("请输入正确的金额");
|
||||
return;
|
||||
}
|
||||
if (!this.payForm.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){
|
||||
this.$modal.msgError("请输入正确的金额");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!this.payForm.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){
|
||||
this.$modal.msgError("请先扫码");
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
//小程序码付款
|
||||
if (this.payForm.payType=="APPLET_CODE"){
|
||||
if (this.goodsList.length>0){
|
||||
this.$modal.msgError("非油商品不可使用小程序码支付")
|
||||
return;
|
||||
}
|
||||
await scanAppletQrCode(_this.payForm).then( resp => {
|
||||
if (resp.data.success=='success'){
|
||||
setTimeout(function (){
|
||||
_this.loading = false;
|
||||
_this.isPaySuccess = true;
|
||||
_this.isPay = true;
|
||||
// _this.printLocally()
|
||||
_this.oilOrderReport()
|
||||
_this.resetting1();
|
||||
},3000)
|
||||
}else {
|
||||
setTimeout(function (){
|
||||
_this.loading = false;
|
||||
_this.isPaySuccess = false;
|
||||
_this.isPay = true;
|
||||
_this.resetting1();
|
||||
this.$modal.msgError(resp.data.error)
|
||||
},3000)
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
let isPaySuccess = false;
|
||||
|
||||
await addLJGoods(_this.map).then( async response => {
|
||||
_this.orderNo = response.data.orderNo;
|
||||
if (response.data.oilOrder != null) {
|
||||
if (response.data.oilOrder.orderStatus == "paid") {
|
||||
|
||||
_this.isPaySuccess = true;
|
||||
isPaySuccess = true
|
||||
_this.isPay = true;
|
||||
_this.loading = false;
|
||||
|
||||
_this.printLocally()
|
||||
_this.oilOrderReport()
|
||||
|
||||
_this.resetting1()
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (response.data.goodsOrder != null) {
|
||||
if (response.data.goodsOrder.status == "paid") {
|
||||
_this.isPaySuccess = true;
|
||||
isPaySuccess = true
|
||||
_this.isPay = true;
|
||||
_this.loading = false;
|
||||
_this.printLocally()
|
||||
_this.oilOrderReport()
|
||||
|
||||
_this.resetting1()
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (response.data.error == 1) {
|
||||
this.$modal.msgError("商品库存不足,请重新选择商品")
|
||||
this.loading = false;
|
||||
this.autofocus = false
|
||||
this.dialogVisiblej = false;
|
||||
return;
|
||||
}
|
||||
if (response.data.error == "请先配置支付通道") {
|
||||
this.$modal.msgError(response.data.error)
|
||||
this.loading = false;
|
||||
// this.dialogVisiblej = false;
|
||||
return;
|
||||
}
|
||||
})
|
||||
this.loading = true;
|
||||
if ( !isPaySuccess ){
|
||||
await _this.queryPayStatus();
|
||||
|
||||
_this.resetting1();
|
||||
}
|
||||
},
|
||||
// 立即结算
|
||||
async settlement(){
|
||||
this.payForm.oilOrder = this.oilGunClearing
|
||||
this.payForm.goodsOrder = this.goodsList
|
||||
//油品订单金额
|
||||
this.payForm.oilAmount = this.oilGunClearing.amount
|
||||
//商品订单金额
|
||||
this.payForm.goodsAmount = this.getGoodsNum
|
||||
//油品实付金额
|
||||
this.payForm.oilActualPay = this.oilGunClearing.amount
|
||||
//商品实付金额
|
||||
this.payForm.goodsActualPay = this.getGoodsNum
|
||||
//油枪Id
|
||||
this.payForm.oilGunId
|
||||
this.payForm.oilOrder = this.oilGunClearing
|
||||
this.payForm.oilOrder = this.oilGunClearing
|
||||
this.payForm.oilOrder = this.oilGunClearing
|
||||
this.payForm.oilOrder = this.oilGunClearing
|
||||
|
||||
this.payForm.realyPayBills = this.realAmount
|
||||
this.payForm.paymentType = this.payWay
|
||||
this.payForm.payType = this.payType
|
||||
//找零金额
|
||||
this.payForm.seekZero = this.seekZero;
|
||||
this.flag = 3
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
@ -1054,7 +1174,7 @@ export default {
|
||||
oilPrice:this.oilGunClearing.oilPrice,
|
||||
oilAmount: this.oilGunClearing.amount,
|
||||
orderAmount: this.orderAmount,
|
||||
payWay: this.payWay,
|
||||
payWay: this.payType,
|
||||
oilLiter: this.oilLiter
|
||||
}
|
||||
getActivityList(dataObj).then(res => {
|
||||
@ -1079,7 +1199,7 @@ export default {
|
||||
//已选择会员且(选了商品或者加了油)
|
||||
let dataObj = {
|
||||
userId: this.chooseVipUser.id,
|
||||
payWay: this.payWay
|
||||
payWay: this.payType
|
||||
}
|
||||
if(this.oilGunClearing!='' && this.oilGunClearing.hasOwnProperty("oilNameId")){
|
||||
//加油油枪有值
|
||||
@ -1435,7 +1555,7 @@ export default {
|
||||
* @param value
|
||||
*/
|
||||
setindex(value) {
|
||||
this.payWay = value
|
||||
this.payType = value
|
||||
//支付方式发生变化,查询可用优惠券和优惠活动
|
||||
this.getActivity()
|
||||
this.getCoupon()
|
||||
|
Loading…
Reference in New Issue
Block a user