|
|
@@ -961,6 +961,9 @@ export default {
|
|
|
}
|
|
|
this.pushHistorySnapshot(total, { source: 'stash', orderOnly })
|
|
|
this.$msg('已暂存')
|
|
|
+ this.clearStack()
|
|
|
+ this.keyboardTarget = 'calc'
|
|
|
+ this.checkType = 3
|
|
|
},
|
|
|
clearStack() {
|
|
|
this.tokens = []
|
|
|
@@ -1050,10 +1053,9 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
if (action === 'calc-clear') {
|
|
|
- if (!this.ensureCalcModeForOps()) {
|
|
|
- return
|
|
|
- }
|
|
|
this.clearStack()
|
|
|
+ this.keyboardTarget = 'calc'
|
|
|
+ this.checkType = 3
|
|
|
return
|
|
|
}
|
|
|
if (action === 'backspace') {
|
|
|
@@ -1131,7 +1133,17 @@ export default {
|
|
|
this.checkType = 0
|
|
|
},
|
|
|
submitCashierPay() {
|
|
|
+ this._submitCashierPayCore(false)
|
|
|
+ },
|
|
|
+ /** 父级确认「使用余额支付」后调用,跳过余额引导弹框 */
|
|
|
+ submitWithForcedBalancePay() {
|
|
|
this.tapVoice()
|
|
|
+ this._submitCashierPayCore(true)
|
|
|
+ },
|
|
|
+ _submitCashierPayCore(forceBalancePay) {
|
|
|
+ if (!forceBalancePay) {
|
|
|
+ this.tapVoice()
|
|
|
+ }
|
|
|
if (this.keyboardTarget === 'calc') {
|
|
|
const st = this.stackTotal
|
|
|
if (!Number.isFinite(st) || isNaN(st)) {
|
|
|
@@ -1163,7 +1175,7 @@ export default {
|
|
|
const hasCalc =
|
|
|
this.tokens.length > 0 ||
|
|
|
(this.calcInput != null && !this.$util.isEmpty(this.calcInput))
|
|
|
- const cashSubmit = this.showCashPayCols ? (Number(this.cash) || 0) : 0
|
|
|
+ let cashSubmit = this.showCashPayCols ? (Number(this.cash) || 0) : 0
|
|
|
/** 现金不足:与结算选「扫码」一致,走后端 pending 收款并打开扫码付款页(mainPay/status) */
|
|
|
const cashShortToScan = this.showCashPayCols && Number(this.zl) < 0
|
|
|
let emitHasPay = this.selHasPay
|
|
|
@@ -1172,6 +1184,19 @@ export default {
|
|
|
emitHasPay = 0
|
|
|
emitPayWay = 0
|
|
|
}
|
|
|
+ if (forceBalancePay) {
|
|
|
+ emitHasPay = 4
|
|
|
+ emitPayWay = 0
|
|
|
+ cashSubmit = 0
|
|
|
+ } else if (
|
|
|
+ !cashShortToScan &&
|
|
|
+ Number(this.customId) > 0 &&
|
|
|
+ Number(this.balance) >= Number(p) &&
|
|
|
+ emitHasPay !== 4
|
|
|
+ ) {
|
|
|
+ this.$emit('suggestBalancePay')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.pushHistorySnapshot(p, {
|
|
|
source: 'submit',
|
|
|
orderOnly: !hasCalc,
|