Invoicing.vue
2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
<div>
<div class="box">
<div class="indexTitle">
<h3 class="leftboderTT">{{ language==0?'我的发票':'My invoice' }}
<el-button @click="goAdd" type="primary" class="btn-lineG fr">开发票</el-button>
</h3>
</div>
<el-card class="mt30 mb60">
<div class="billItem" v-for="b in list" :key="b.id">
<!-- parentType -->
<div>
申请日期:
{{ b.createTime }}
</div>
<div style="display: flex;justify-content: space-between;">
<div> 发票形式 -
<span v-if="b.invoiceForm=='1'">电子发票</span>
<span v-if="b.invoiceForm=='2'">纸质普票</span>
<span v-if="b.invoiceForm=='3'">纸质专票</span>
</div>
<div>¥ <span>{{b.total}}</span></div>
</div>
<div style="margin: 20px 0 0;display: flex;justify-content: space-between;">
<div class="status">
<div class="success" v-if="b.isInvoice == '1'"> 已开票</div>
<div class="warning" v-if="b.isInvoice == '0'">未开票</div>
<div class="success" v-if="b.isInvoice == '3'"> 已寄出</div>
<div class="warning" v-if="b.isInvoice == '2'"> 已取消</div>
</div>
<div>
<button class="billbtn" v-if="b.isInvoice == '0'" @click.stop="editDetail(b)"> 修改发票</button>
<button class="billbtn rbtn-m-kx"
@click.stop="showDetail(b)">详情</button>
</div>
</div>
</div>
<el-empty :image="`/img/order_no.png`" :image-size="228" v-if="list?.length == 0"/>
</el-card>
</div>
</div>
<chose-bills ref="dialogChoseBillsRef"/>
</template>
<script setup>
import ChoseBills from './component/choseBills'
import { ref } from 'vue'
import {getInvoiceByActiveId} from "@/apiPc/booking"
import {getCurrentInstance} from "@vue/runtime-core"
import {useStorage} from "@vueuse/core/index";
import useUserStore from "@/store/modules/user";
const language= useStorage('language',0)
const {proxy} = getCurrentInstance()
const list = ref([])
const user = useUserStore().user
const query = ref({
createById: user.userId
})
getList()
function getList() {
if(!user){
useUserStore().setReLogin()
return
}
getInvoiceByActiveId(query.value).then(res=>{
list.value = res.rows
})
}
function goAdd() {
//选择开票订单
var obj = {
title: '选择开票订单',
show: true,
choosedList:[]
}
proxy.$refs['dialogChoseBillsRef'].open(obj)
}
</script>
<style scoped lang="scss">
.leftboderTT{
font-size: 20px;}
</style>