Ver código fonte

升舱金额计算

shipeng 2 dias atrás
pai
commit
2d5c204675
1 arquivos alterados com 19 adições e 6 exclusões
  1. 19 6
      src/views/windowTicketSales/model/upgradeBox.vue

+ 19 - 6
src/views/windowTicketSales/model/upgradeBox.vue

@@ -25,7 +25,7 @@
                             <span>{{ rebookForm.touristNum }}个</span>
                         </el-form-item>
                         <el-form-item label="原订单总额:">
-                            <span>{{ rebookForm.realPrice || 0 }}元</span>
+                            <span>{{ rebookForm.orderPrice || 0 }}元</span>
                         </el-form-item>
                         <el-form-item label="升舱票档:" prop="seatTypeId">
                             <el-select v-model="rebookForm.seatTypeId" placeholder="请选择票档" style="width: 100%"
@@ -46,7 +46,7 @@
                             <span>元/人</span>
                         </el-form-item>
                         <el-form-item label="升舱应付金额:">
-                            <span>{{  calTotalPrice(rebookForm.goodsDiffAmount,rebookForm.touristNum) }}元</span>
+                            <span>{{  payPrice }}元</span>
                         </el-form-item>
                         <el-form-item v-if="rebookForm.diffPrice > 0 && !rebookForm.channelType != 'group'" label="支付方式 :"
                             prop="paymentType">
@@ -272,6 +272,7 @@ export default {
                 Headers: { Authorization: "Bearer " + getToken() },
             },
             actionUrlLoading: false,
+            payPrice: 0, // 升舱金额
         }
     },
     created(){
@@ -297,6 +298,7 @@ export default {
                 auditoriumId: row.auditoriumId,
                 paymentType: "1", // 支付方式'
                 realPrice: row.realPrice,
+                orderPrice: row.orderPrice,
                 touristNum: row.touristNum,
                 seatList: [],
                 performTimeEnd: row.performTimeEnd,
@@ -387,6 +389,7 @@ export default {
             if(unitPrice && quantity ) {
                 totalPrice = mathM.multiply(unitPrice, quantity);
             }
+            this.payPrice = totalPrice;
             return totalPrice
         },
         /** 退出窗口 */
@@ -525,14 +528,24 @@ export default {
             this.rebookForm.seatList = list1
             console.log("已选择的====",list)
         },
+        // 收取现金
         setRealPrice_1(value) {
-            if(this.rebookForm.goodsDiffAmount && !isNaN(this.rebookForm.goodsDiffAmount) && value && !isNaN(value)) {
-                this.$set(this.rebookForm,'small',mathM.format(Number(value) - Number(this.rebookForm.goodsDiffAmount),10) )
+            // if(this.rebookForm.goodsDiffAmount && !isNaN(this.rebookForm.goodsDiffAmount) && value && !isNaN(value)) {
+            //     this.$set(this.rebookForm,'small',mathM.format(Number(value) - Number(this.rebookForm.goodsDiffAmount),10) )
+            // }
+            // 计算找零金额:现金金额-升舱应付
+            if(this.payPrice && !isNaN(this.payPrice) && value && !isNaN(value)) {
+                this.$set(this.rebookForm,'small',mathM.format(Number(value) - Number(this.payPrice),10) )
             }
         },
+        // 票价补差(人/元)
         setRealPrice_2(value) {
-            if(this.rebookForm.realPrice_1 && !isNaN(this.rebookForm.realPrice_1) && value && !isNaN(value)) {
-                this.$set(this.rebookForm,'small',mathM.format(Number(this.rebookForm.realPrice_1) - Number(value),10) )
+            // if(this.rebookForm.realPrice_1 && !isNaN(this.rebookForm.realPrice_1) && value && !isNaN(value)) {
+            //     this.$set(this.rebookForm,'small',mathM.format(Number(this.rebookForm.realPrice_1) - Number(value),10) )
+            // }
+            // 计算升舱应付金额
+            if(this.rebookForm.goodsDiffAmount && !isNaN(this.rebookForm.goodsDiffAmount) && value && !isNaN(value)) {
+                this.calTotalPrice(this.rebookForm.goodsDiffAmount, this.rebookForm.touristNum);
             }
         },
          /**  上传图片 单张  */