shish 2 месяцев назад
Родитель
Сommit
b2107c5749
1 измененных файлов с 10 добавлено и 6 удалено
  1. 10 6
      hdPad/src/pages/home/components/selectPrice.vue

+ 10 - 6
hdPad/src/pages/home/components/selectPrice.vue

@@ -1121,15 +1121,19 @@ export default {
                     this.$msg('请输入收到的现金金额')
                     return
                 }
-                if (Number(this.zl) < 0) {
-                    this.$msg('收现金不足,还差 ' + this.formatChangeAmount(-Number(this.zl)))
-                    return
-                }
             }
             const hasCalc =
                 this.tokens.length > 0 ||
                 (this.calcInput != null && !this.$util.isEmpty(this.calcInput))
             const cashSubmit = this.showCashPayCols ? (Number(this.cash) || 0) : 0
+            /** 现金不足:与结算选「扫码」一致,走后端 pending 收款并打开扫码付款页(mainPay/status) */
+            const cashShortToScan = this.showCashPayCols && Number(this.zl) < 0
+            let emitHasPay = this.selHasPay
+            let emitPayWay = this.selHasPay === 1 ? this.selPayWay : 0
+            if (cashShortToScan) {
+                emitHasPay = 0
+                emitPayWay = 0
+            }
             this.pushHistorySnapshot(p, {
                 source: 'submit',
                 orderOnly: !hasCalc,
@@ -1138,8 +1142,8 @@ export default {
                 price: p,
                 name: this.name,
                 cash: cashSubmit,
-                hasPay: this.selHasPay,
-                payWay: this.selHasPay === 1 ? this.selPayWay : 0
+                hasPay: emitHasPay,
+                payWay: emitPayWay
             })
             this.price = 0
             this.checkType = 3