MONSTER-ygh пре 11 месеци
родитељ
комит
29dbacfe16

+ 27 - 0
src/api/windowTicketSales/ticketingSales.js

@@ -55,6 +55,24 @@ export const gotoMicroPay = (query) => {
     })
   }
 
+   // 授信额度支付
+   export const gotoQuotaPay = (query) => {
+    return request({
+      url: '/order/orderInfo/gotoQuotaPay',
+      method: 'post',
+      data: query
+    })
+  }
+
+   // 余额支付
+   export const gotoBalancePay = (query) => {
+    return request({
+      url: '/order/orderInfo/gotoBalancePay',
+      method: 'post',
+      data: query
+    })
+  }
+
   // 支付查询
 
   export const payQuery = (query) => {
@@ -131,4 +149,13 @@ export const getGoodsPerformApi = (query) => {
     method: 'get',
     params: query
   })
+}
+
+// 根据OTA来源查询剩余金额
+export const selectMarketTeamBySourceApi = (query) => {
+  return request({
+    url: '/member/marketTeam/selectMarketTeamBySource',
+    method: 'get',
+    params: query
+  })
 }

+ 86 - 5
src/views/windowTicketSales/model/increaseViewers.vue

@@ -152,7 +152,7 @@
                 
                 <div style="display: flex;">
                     <el-form-item label="用户来源 :" prop="source">
-                        <el-radio-group v-model="ruleForm.source">
+                        <el-radio-group @input="selectMarketTeamBySourceFun" v-model="ruleForm.source">
                             <el-radio label="7">窗口</el-radio>
                             <el-radio label="10">美团</el-radio>
                             <el-radio label="11">携程</el-radio>
@@ -175,7 +175,9 @@
                     <el-radio-group v-model="ruleForm.paymentType">
                         <el-radio label="1">扫码</el-radio>
                         <el-radio label="2">现金</el-radio>
-                        <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="3">对公支付</el-radio>
+                        <!-- <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="3">对公支付</el-radio> -->
+                        <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="4">账户余额({{ balance }})</el-radio>
+                        <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="5">授信余额({{ grantQuota }})</el-radio>
                     </el-radio-group>
                 </el-form-item>
                 <el-form-item label="应收金额 :">
@@ -255,10 +257,13 @@ import {
   gotoMicroPay,
   gotoCashPay,
   gotoCorporatePay,
+  gotoBalancePay,
+  gotoQuotaPay,
   payQuery,
   selectRegion,
   orderInfoCancel,
-  factorAuth
+  factorAuth,
+  selectMarketTeamBySourceApi
  } from '@/api/windowTicketSales/ticketingSales'
  import { pageList as getPrintListApi } from "@/api/device/pda";
  import { printApi } from '@/api/windowTicketSales/ticketingCollection'
@@ -339,7 +344,11 @@ import {
         ifRealTeam: 0,   // 团购是否实名:0否 1-是
         oneMany: 1,   // 证件要求: 1一证一票,2一证多票
         personnelNum: 0,   // 人员要求:0-表示不限制 其他数字表示限制人数
-      };
+      
+    
+        balance: null, // 授信额度
+        grantQuota: null, // 授信使用额度
+    };
       
     },
     methods: {
@@ -670,6 +679,10 @@ import {
                         this.gotoCashPayFun(this.orderId)
                     }else if(this.ruleForm.paymentType == 3) { // 对公支付
                         this.gotoCorporatePayFun(this.orderId)
+                    }else if(this.ruleForm.paymentType == 4){ // 账户余额
+                        this.gotoBalancePayFun(this.orderId)
+                    }else if(this.ruleForm.paymentType == 5){ // 授信余额
+                        this.gotoQuotaPayFun(this.orderId)
                     }else {
                         // 扫码支付
                         this.loading = false
@@ -745,6 +758,60 @@ import {
                 this.loading = false
                 this.payStatus = 3
             }
+        },
+        /**  授信额度支付  */
+        async gotoQuotaPayFun(orderId) {
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoQuotaPay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
+        },
+        /**  余额支付  */
+        async gotoBalancePayFun(orderId) {
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoBalancePay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
         },
          /**  订单现金支付  */
          async gotoCashPayFun(orderId){
@@ -1064,7 +1131,21 @@ import {
           //   this.loading = false
           // })
         },
-        
+        /** 获取授信余额和账户余额  */
+        async selectMarketTeamBySourceFun(value) {
+            console.log("value===",value)
+            try {
+                if(!['10','11','13','14','18','19'].includes(value)) return
+                let res = await selectMarketTeamBySourceApi({
+                    source: value
+                })
+                this.balance = res.data.balance
+                this.grantQuota = res.data.grantQuota
+            } catch (error) {
+                this.balance = null
+                this.grantQuota = null
+            }
+        }
     }
 }
 </script>