| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <template>
- <div class="invoice">
- <div class="gap10 invoice-title">
- <div class="line_vertical"></div>
- <div class="">{{ $t('personalCenter.myInvoice') }}</div>
- </div>
- <div class="invoice-list">
- <div v-for="(item, index) in list" :key="index" class="li">
- <div class="">
- <div class="btn" :class="{'btn-active':item.invoiceStatus == 2}">{{ item.invoiceStatusName }}</div>
- </div>
- <div class="invoice-list-t flex-center-between">
- <div class="">{{ item.content.name }}</div>
- <div class="">¥{{ item.content.price }}</div>
- </div>
- <div class="flex-center-between invoice-list-c">
- <div class="">{{ $t('personalCenter.orderNumber') }}:</div>
- <div class="">{{ item.orderNo }}</div>
- </div>
- <div class="flex-center-between invoice-list-time">
- <div class="">{{ $t('common.orderCreateTime') }}:</div>
- <div class="">{{ item.createTime }}</div>
- </div>
- <div v-if="item.invoiceStatus == 2" class="flex-center-between invoice-list-b">
- <div class=""></div>
- <div class="" @click="lookItem(item)">
- <img src="/src/assets/imgs/my/jilu@2x.png" alt="">
- <span>{{ $t('common.viewDetails') }}</span>
- </div>
- </div>
- </div>
- </div>
- <template v-if="list.length">
- <Pagination :total="form.total" :page-size="form.pageSize" :current-page="form.pageNum"
- @page-change="handlePageChange" />
- </template>
- <el-empty v-else :description="$t('common.empty')" />
- <el-dialog v-model="dialogVisible" :title="$t('common.Detail')" width="700">
- <el-form :model="invoiceData" label-position="top">
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item :label="$t('personalCenter.gfmc')">
- <el-input v-model="invoiceData.invoiceTitle" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12" v-if="invoiceData.invoiceType">
- <el-form-item :label="$t('personalCenter.code')">
- <el-input v-model="invoiceData.taxNumber" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <template v-if="invoiceData.invoiceType">
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item :label="$t('personalCenter.companyAddress')">
- <el-input v-model="invoiceData.otherInfo.address" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item :label="$t('personalCenter.companyPhone')">
- <el-input v-model="invoiceData.otherInfo.mobile" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item :label="$t('personalCenter.companyBank')">
- <el-input v-model="invoiceData.otherInfo.bank" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item :label="$t('personalCenter.bankAccount')">
- <el-input v-model="invoiceData.otherInfo.account" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- </template>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <!-- <el-button @click="dialogVisible = false">Cancel</el-button> -->
- <el-button type="primary" @click="handleClick">{{ $t('personalCenter.downloadInvoice') }}</el-button>
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup lang="ts">
- import Pagination from '@/components/Pagination.vue'
- import { invoiceList } from '@/api/my.js'
- import { ref, onMounted } from 'vue'
- const list = ref([])
- const form = ref({
- pageNum: 1,
- pageSize: 10,
- total: 0,
- orderByColumn: 'id',
- isAsc: 'desc'
- })
- const dialogVisible = ref(false);
- const invoiceData = ref({})
- const lookItem = (item) => {
- invoiceData.value = item;
- dialogVisible.value = true;
- }
- // 查看发票
- const handleClick = () => {
- location.href = invoiceData.value.invoiceUrl;
- }
- // 获取列表
- const getList = async () => {
- let res = await invoiceList(form.value)
- res.rows.forEach(element => {
- element.content = JSON.parse(element.content)
- element.otherInfo = JSON.parse(element.otherInfo)
- });
- list.value = res.rows || [];
- form.value.total = res.total;
- }
- const handlePageChange = (page) => {
- list.value = []
- form.value.pageNum = page;
- getList()
- }
- onMounted(() => {
- getList()
- })
- </script>
- <style scoped lang="scss">
- .invoice {
- padding-bottom: 20px;
- .invoice-title {
- height: 60px;
- font-size: 20px;
- font-weight: bold;
- color: #333333;
- }
- .invoice-list {
- .li {
- padding: 16px;
- margin-bottom: 16px;
- background: #F5F7FA;
- border-radius: 16px;
- .btn {
- color: #FFFFFF;
- width: 66px;
- line-height: 30px;
- font-size: 14px;
- text-align: center;
- background: #2D71FF;
- border-radius: 4px;
- margin-bottom: 8px;
- }
- .btn-active {
- background: #1FB362;
- }
- &:last-child {
- margin-bottom: 0;
- }
- .invoice-list-t {
- div {
- font-size: 18px;
- font-weight: bold;
- color: #3D3D3D;
- &:last-child {
- color: #FD5F3C;
- }
- }
- }
- .invoice-list-c,
- .invoice-list-time,
- .invoice-list-b {
- margin-top: 8px;
- div {
- font-size: 16px;
- &:first-child {
- color: #666666;
- }
- }
- }
- .invoice-list-b {
- div:last-child {
- display: flex;
- align-items: center;
- cursor: pointer;
- justify-content: center;
- width: 106px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 4px;
- color: #2D71FF;
- font-size: 14px;
- img {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- }
- }
- }
- }
- }
- </style>
|