From 02bd5982028af6e791dd0857f535a41aaf74679e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期一, 10 二月 2025 13:14:32 +0800
Subject: [PATCH] 修改

---
 src/views/specialOperationsPay/singlePage/index.vue |   81 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 75 insertions(+), 6 deletions(-)

diff --git a/src/views/specialOperationsPay/singlePage/index.vue b/src/views/specialOperationsPay/singlePage/index.vue
index 18a3b4c..73c25da 100644
--- a/src/views/specialOperationsPay/singlePage/index.vue
+++ b/src/views/specialOperationsPay/singlePage/index.vue
@@ -102,6 +102,12 @@
       :modal-append-to-body="false"
       fullscreen
       class="myCustomDialog"
+      v-loading="payLoading"
+      element-loading-spinner="el-icon-loading"
+      element-loading-background="rgba(255, 255, 255, 0.8)"
+      element-loading-text="等待财政接口加解密返回结果,正在生成支付订单"
+      element-loading-customClass="payLoading"
+      @close="closePay"
     >
       <div class="topInfo">
         <el-row style="margin-bottom: 0">
@@ -164,8 +170,8 @@
 
 <script >
 import {verifyIdCard, verifySimplePhone} from "@/utils/validate";
-import {nonCoalSelectH5} from "@/api/specialOperationsPay/notCoalPay";
-import {findStudent} from "@/api/specialOperationsPay/coalPay";
+import {nonCoalPersonPay, nonCoalSelectH5} from "@/api/specialOperationsPay/notCoalPay";
+import {coalPersonPay, findStudent} from "@/api/specialOperationsPay/coalPay";
 import noData from '@/assets/images/noData.png'
 
 export default {
@@ -211,7 +217,8 @@
       hasInfo: true,
       detailVisible: false,
       detailInfo: {},
-      noData
+      noData,
+      payLoading: false
     }
   },
   created() {
@@ -268,10 +275,46 @@
     },
     goPay(item){
       this.detailInfo = item
-      this.detailVisible = true
+      if((this.dataForm.type == 1 && this.detailInfo.payPersonType == 2) || (this.dataForm.type == 2 &&this.detailInfo.payType == 2)){
+        this.$message({
+          type:'warning',
+          message: '团体缴费类型无法生成缴费订单'
+        })
+      }else{
+        this.detailVisible = true
+      }
     },
-    payBill(){
-      console.log('立即付款')
+    async payBill(){
+      this.payLoading = true
+      if(this.dataForm.type == 1){
+        const query = {
+          id: this.detailInfo.nonCoalStudentId,
+          payType: 1
+        }
+        const res = await nonCoalPersonPay(query)
+        if(res.code == 200) {
+          this.payLoading = false
+        }else{
+          this.$message({
+            type:'warning',
+            message: res.msg
+          })
+        }
+      }else{
+        const query = {
+          coalPayId: this.detailInfo.coalPays.id,
+          studentId: this.detailInfo.id
+        }
+        const res = await coalPersonPay(query)
+        if(res.code == 200) {
+          this.payLoading = false
+        }else{
+          this.$message({
+            type:'warning',
+            message: res.msg
+          })
+        }
+      }
     },
     resetDataForm() {
       this.dataForm = {
@@ -280,6 +323,10 @@
     handleClose(){
       this.info = {}
       this.listVisible = false
+    },
+    closePay(){
+      this.detailVisible = false
+      this.payLoading = false
     }
   }
 }
@@ -289,6 +336,8 @@
   .container{
     width: 100%;
     height: 100%;
+    max-width: 960px;
+    margin: 0 auto;
   }
 
   .loginTop{
@@ -355,6 +404,26 @@
 </style>
 <style lang="scss">
   .myCustomDialog{
+    width: 100%;
+    max-width: 960px;
+    margin: 0 auto;
+    .el-loading-mask{
+      width: 60%;
+      height: 20%;
+      margin: 30vh auto;
+      border-radius: 20px;
+      padding: 10px;
+      .el-loading-spinner{
+        width: calc(100% - 20px);
+        top: 40%;
+        .el-icon-loading,.el-loading-text{
+          color: #000;
+        }
+        .el-icon-loading{
+          font-size: 24px;
+        }
+      }
+    }
     .el-dialog .el-dialog__header{
       height: 60px;
       padding: 0;

--
Gitblit v1.9.2