马宇豪
2025-03-04 509f1d71c91242b11fd287cfcdeafe3d19b2d807
src/views/specialOperationsPay/singlePage/index.vue
@@ -65,7 +65,7 @@
            </div>
            <div>总计应缴:<span class="cardCont">{{ item.amount }}元</span></div>
            <el-button style="margin-top: 5px" type="primary" size="small" v-if="item.payStatus == 0" @click="goPay(item)">去缴费</el-button>
            <el-button style="margin-top: 5px" type="success" size="small" v-if="item.payStatus == 1" @click="checkTicket(item)">查看票据</el-button>
            <el-button style="margin-top: 5px" type="success" size="small" v-if="item.payStatus == 1" @click="checkTicket()">查看票据</el-button>
          </div>
        </div>
        <div v-else class="feeList">
@@ -87,7 +87,7 @@
            </div>
            <div>总计应缴:<span class="cardCont" v-if="item.coalPays">{{ item.coalPays.amount }}元</span></div>
            <el-button style="margin-top: 5px" type="primary" size="small" v-if="item.payStatus == 0" @click="goPay(item)">去缴费</el-button>
            <el-button style="margin-top: 5px" type="success" size="small" v-if="item.payStatus == 1" @click="checkTicket(item)">查看票据</el-button>
            <el-button style="margin-top: 5px" type="success" size="small" v-if="item.payStatus == 1" @click="checkTicket()">查看票据</el-button>
          </div>
        </div>
      </div>
@@ -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 {
@@ -197,8 +203,8 @@
    }
    return {
      dataForm: {
        idCard: '320322199509262810',
        phone: '15261806176',
        idCard: '',
        phone: '',
        type: 1
      },
      rules: {
@@ -211,7 +217,8 @@
      hasInfo: true,
      detailVisible: false,
      detailInfo: {},
      noData
      noData,
      payLoading: false
    }
  },
  created() {
@@ -268,10 +275,60 @@
    },
    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
      let device = 1
      const userAgent = window.navigator.userAgent
      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
        device = 2
      } else {
        device = 1
      }
      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
          window.open(`http://finpt.xjcz.gov.cn/fs-public/billQuery/findByOrderId.do?orderId=${res.msg}&deviceType=${device}`)
        }else{
          this.payLoading = false
          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
          window.open(`http://finpt.xjcz.gov.cn/fs-public/billQuery/findByOrderId.do?orderId=${res.msg}&deviceType=${device}`)
        }else{
          this.payLoading = false
          this.$message({
            type:'warning',
            message: res.msg
          })
        }
      }
    },
    checkTicket(){
      window.open('http://finpt.xjcz.gov.cn/fs-public/index.do')
    },
    resetDataForm() {
      this.dataForm = {
@@ -280,6 +337,10 @@
    handleClose(){
      this.info = {}
      this.listVisible = false
    },
    closePay(){
      this.detailVisible = false
      this.payLoading = false
    }
  }
}
@@ -289,6 +350,8 @@
  .container{
    width: 100%;
    height: 100%;
    max-width: 960px;
    margin: 0 auto;
  }
  .loginTop{
@@ -355,6 +418,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;