Selaa lähdekoodia

第二种支付方式,自动填充剩余支付金额

gqx 2 vuotta sitten
vanhempi
commit
dd9fca99df
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      src/views/room/modules/checkIn/Payment.vue

+ 9 - 2
src/views/room/modules/checkIn/Payment.vue

@@ -185,7 +185,7 @@
               {{ sumAmount.toFixed(2) }}元
             </a-form-model-item>
           </a-col>
-          <a-col :span="24" style="text-align: end;">
+          <a-col :span="24" style="text-align: end">
             <a-checkbox default-checked>打印结账单</a-checkbox>
             <a-checkbox default-checked>打印发票二维码</a-checkbox>
           </a-col>
@@ -375,8 +375,15 @@ export default {
       });
     },
     puls() {
+      var sum = this.payList.reduce(function (total, item) {
+        return total + item.money;
+      }, 0);
+      var money = this.realityAmount - sum;
+      if (money < 0) {
+        money = 0;
+      }
       this.payList.push({
-        money: 0,
+        money: money,
         payType: this.payTypeList[0].id,
         isVipMemmber: false,
         isDanwei: false,