myVisa.vue 6.77 KB
<template>
  <div>
    <el-card :body-style="{'padding':'0'}">
      <div class="indexTitle">
        <h3 class="leftboderTT">{{ language == 0 ? '我的签证' : 'My visa' }}
        </h3>

        <!--        <el-button class="fr" type="primary" plain @click="toInvoice">{{ language==0?'发票开具':'Invoice' }}</el-button>-->
        <!--        <el-button class="fr" type="primary" plain @click="toInvoice">{{ language==0?'我的发票':'My Invoice' }}</el-button>-->
      </div>
      <el-empty v-if="list?.length == 0" :image="`/img/order_no.png`" :image-size="228"/>

      <div class="pd20">
        <div v-for="b in list" class="item">
          <div class="title">
            <label class="orangeTag"> {{ b.applicatTypeName }} </label>
            <span>{{ language == 0 ? '订单编号:' : 'No.' }} {{ b.id }}</span>
          </div>

          <div class="status-po">
            <span v-if="b.status == '0'" class="bg-gary">{{ 'Under Review' }}</span>
            <span v-if="b.status == '1'" class="bg-blue">{{ 'Approved' }}</span>
            <span v-if="b.status == '2'" class="bg-danger">{{ 'Rejected' }}</span>
          </div>

          <el-row align="middle" class="pd20 mt10" justify="space-between">
            <el-col :lg="9" :md="12" :sm="12" :xs="24">
              <div>
                <h3 class="name">{{ b.fullName }}</h3>
                <p>{{ b.email }}</p>
                <p>{{ b.createTime }}</p>
              </div>
            </el-col>
            <el-col :lg="3" :md="6" :sm="6" :xs="6" class="text-center">
              <span class="text-warning"> {{ b.invitationTypeName }} </span>
            </el-col>
            <el-col :lg="6" :md="16" :sm="16" :xs="16">
              <div class="text-right">
                <el-button class="mb10" :disabled="b.emailFlag!='1'" plain round size="small" type="primary"
                           @click="handleDownload(b)">
                  {{ language == 0 ? '下载邀请函' : 'Download Invitation' }}
                </el-button>
                <el-button class="mb10" plain round size="small" type="primary" @click="goDetail(b)">
                  {{ language == 0 ? '详情' : 'Detail' }}
                </el-button>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-card>
    <affix-invitation-view ref="affixInvitationRef"></affix-invitation-view>
  </div>
</template>

<script setup>
import {onMounted, getCurrentInstance} from "@vue/runtime-core";
import {useStorage} from "@vueuse/core/index";
// import {newbilllist} from "@/apiPc/common";
import useUserStore from "@/store/modules/user";
// import dayjs from 'dayjs'
import {cancelOrder2, cancelOrder} from "/@/apiPc/booking";

import {ElMessage} from "element-plus";
import {downInvite, getUplaodFile, getVisaInfo} from "/@/apiPc/match";
import AffixInvitationView from "/@/viewsPc/match/components/affix-invitation-view.vue";
import {ref} from "vue";
import {useRouter} from "vue-router";
import {fillImgUrl} from "/@/utils/ruoyi";

const router = useRouter()
const language = useStorage('language', 0)
const list = ref([])
const user = useUserStore().user
const {proxy} = getCurrentInstance()

const affixInvitationRef = ref(null)

onMounted(() => {
  getList()
})

function finish(bill) {
  bill.status = '2'
  // getList()
}

function getList() {
  getVisaInfo({userId: user.userId}).then(res => {
    list.value = res.rows || []
  })
}

function goDetail(b) {
  affixInvitationRef.value.open(b)
  // router.push({
  //   name: 'bookingPay',
  //   query: {
  //     orderId: b.id,
  //     orderType: b.orderType
  //   }
  // })
}

function handleDownload(b) {
  getUplaodFile({id: b.id}).then(res => {
    window.open(fillImgUrl(res.msg), '_blank')
  })
}

function Rebook(row) {
  console.log(row)
  if (row.orderType == 0) {
    router.push({
      name: 'hotelDetail',
      params: {
        cptId: row.activeId,
        hotelId: row.hotelId
      },
      query: {
        id: row.extId
      }
    })
  } else {
    router.push({
      name: 'ticket',
      params: {
        activeId: row.activeId,
      }
    })
  }
}

const cancel = (row) => {
//取消订单
  proxy.$modal.confirm(language.value == 0 ? '确定取消订单吗 ?' : `Are you sure to cancel the order?`).then(() => {
    return cancelOrder2(row.id).then(res => {
      getList()
      ElMessage({
        message: language.value == 0 ? '操作成功' : 'Successful operation!',
        type: 'success'
      })
    })
  })
}

const unsubscribe = (row) => {
  proxy.$modal.confirm(language.value == 0 ? `确定退款吗 ?` : 'Are you sure to refund?').then(() => {
    return cancelOrder(row.id).then(res => {
      getList()
      ElMessage({
        message: language.value == 0 ? '已提交退款,请等待审核!' : 'Refund has been submitted, please wait for review!',
        type: 'success'
      })
    })
  })
}


function toInvoice() {
  router.push({
    name: 'invoice'
  })
}
</script>

<style lang="scss" scoped>
.bigMoney {
  font-size: 24px;
  font-family: "DIN Alternate";
}

.name {
  font-size: 18px;
  margin: 0;
}

.status-po {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 12px;
  color: #FFFFFF;

  span {
    border-radius: 0px 10px 0px 10px;
    padding: 4px 10px;
  }

  .bg-danger {
    background: #E60012;
  }

  .bg-warning {
    background: #e89f39;
  }

  .bg-pink {
    background: #F740A6;
  }

  .bg-primary {
    background: var(--el-color-primary)
  }

  .bg-blue {
    background: #00a0e9
  }
}

.indexTitle {
  margin: 20px 0 12px;
  overflow: visible;
  padding: 0 20px 15px;
  border-bottom: 1px solid #e5e5e5;

  .fr {
    margin: -8px 0 0
  }

  h3 {
    display: inline-block;
    font-size: 16px;
    color: var(--el-color-primary);
  }
}

.item {
  .name {
    font-size: 18px;
    color: #000000;
    margin: 0 0 10px;
  }

  p {
    margin: 8px 0 0;
    color: #707070;
    font-size: 14px;
  }

  margin: 0 0 20px;
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  position: relative;

  .bbody {
    padding: 0 15px 20px;
  }

  .title {
    background: #F7F7F7;
    border-bottom: 1px solid #E5E5E5;

    span {
      font-size: 14px;
      color: #4C5359;
    }
  }

  .title label {
    border-radius: 5px 0 5px 0;
    font-size: 12px;
    color: #fff;
    padding: 4px 10px;
    margin-right: 10px;
  }

  .blueTag {
    background-color: #1EC886;
  }

  .purpleTag {
    background-color: #717bef;
  }

  .orangeTag {
    background-color: #ff8124;
  }
}

.billFoot {
  .price {
    width: 100%;
    justify-content: space-between;
  }
}

.billFoot .tip {
  font-size: 24px;
  color: #999;
  font-weight: 500;
  margin: 0 20px;
}

.status {
  position: absolute;
  right: 10px;
  bottom: 60px;
  white-space: nowrap;

  .warning {
    color: #ff8124;
  }

  .danger {
    color: #da2a2a;
  }

  .gary {
    color: #666;
  }

  .success {
    color: #1EC886;
  }
}

</style>