invoice.vue
5.83 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<template>
<view>
<view>
<view class="box">
<!-- 开票 根据活动获取的订单-->
<view class="billItem" v-for="b in list" :key="b.id">
<!-- parentType -->
<view>
申请日期:
{{ b.createTime }}
</view>
<view>
发票抬头:{{b.invoiceTitle}}
</view>
<view>
邮箱:{{b.invoiceAddress}}
</view>
<!-- <view style="display: flex;justify-content: space-between;">
<view> 发票形式 -
<text v-if="b.invoiceForm=='1'">电子发票</text>
<text v-if="b.invoiceForm=='2'">纸质普票</text>
<text v-if="b.invoiceForm=='3'">纸质专票</text>
</view>
<view>¥ <text>{{b.total}}</text></view>
</view> -->
<view style="margin: 20rpx 0 0;display: flex;justify-content: space-between;">
<view class="status">
<view class="success" v-if="b.isInvoice == '1'"> 已开票</view>
<view class="warning" v-if="b.isInvoice == '0'">未开票</view>
<view class="success" v-if="b.isInvoice == '3'"> 已寄出</view>
<view class="warning" v-if="b.isInvoice == '2'"> 已取消</view>
</view>
<view>
<button class="billbtn" v-if="b.isInvoice == '0'" @click.stop="editDetail(b)"> 修改发票</button>
<button class="billbtn rbtn-m-kx"
@click.stop="showDetail(b)">详情</button>
</view>
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="@/static/nodata.png"></image>
<text> 还没有开票记录 </text>
</view>
</view>
</view>
</view>
<view class="fixedBtn" @click="goAdd" v-if="list.length==0">
<image class="iconkp" src="./img/kp.png"/>
开发票
</view>
<!-- <view class="popContent" v-if="showFirst">
<view class="textbody">
<view class="h3"> 发票开具说明</view>
<view class="texts">{{remarks}}</view>
<view class="button" @click="closeFirst"> 我同意,进入开票</view>
</view>
</view> -->
</template>
<script setup>
import { ref } from 'vue';
import { onShow,onPullDownRefresh,onReachBottom,onLoad} from '@dcloudio/uni-app';
import * as hotel from '@/common/hotel.js';
const list = ref([]);
const alertDialog = ref(null);
const isLoadMore = ref(false);
const remarks = ref('');
const showFirst = ref(true);
const loadStatus = ref('loading');
const contentText = ref({
contentdown: '点击查看更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
})
const queryparam = ref({
})
const currUser = uni.getStorageSync('currUser');
const app = getApp();
onShow(() => {
list.value = []
getList()
});
let trainId
let kpType
onLoad((option) => {
trainId = option.trainId
remarks.value = JSON.parse(decodeURIComponent(option.remarks))
kpType = option.kpType
});
function getList() {
// 开票记录
hotel.getInvoiceByActiveId(trainId).then(res => {
list.value = res.rows;
});
}
function showDetail(b) {
let path = `/pages_hotel/hotel/invoiceDetail?invoiceId=${b.id}`;
uni.navigateTo({
url: path
});
}
function editDetail(b) {
let path = `/pages_hotel/hotel/addInvoice?invoiceId=${b.id}&isEdit=true&kpType=${kpType}`;
uni.navigateTo({
url: path
});
}
function closeFirst(){
showFirst.value = false
app.globalData.showFirst = false
}
function goAdd(){
const obj = encodeURIComponent(JSON.stringify(remarks.value))
// let path = `/pages_hotel/hotel/canInvoiceBills?trainId=${trainId}&remarks=${obj}&kpType=${kpType}`;
let path =`/pages_hotel/hotel/addInvoice?trainId=${trainId}&remarks=${obj}`;
uni.navigateTo({
url: path
});
}
</script>
<style lang="scss" scoped>
.fixedBtn{position: fixed;right: 30rpx;bottom: 10%;width: 100rpx;height: 100rpx;color: #fff;
background: linear-gradient(270deg, #54e1b9, #00caa6);border-radius: 50%;
box-shadow: 0 0 15rpx #666;font-size: 24rpx;
text-align: center;}
.pads{padding:0 25rpx 70rpx;}
.billItem {
width: auto; padding: 40rpx 0;margin: 30rpx 0 0;
.uni-input {
padding: 15rpx 0;
color: #000;
}
.billFoot{ margin-bottom: 20rpx;}
}
.rrcard .box {
padding: 0 0 1px;
margin: 20rpx 0 0;
}
.graybg {
background: #f7f8fa;
height: 100vh;
width: 100vw;
overflow: auto;
}
.whitebg {
background: #fff;
margin-top: 15rpx;
border-radius: 20rpx;
margin-bottom: 180rpx;
}
.name{font-size: 34rpx;color: #000;}
.padh20 {
padding: 0 25rpx;
}
.price{width: 100%;overflow: hidden;}
.billbtn{color: #1EC886;border: 1px solid #1EC886; margin: initial;line-height: 2; display: inline-block;
border-radius: 0;background-color: transparent; font-size: 28rpx;
&::after{border: none;}
}
.rbtn-m-kx{margin: 0 0 0 10rpx;background:#1EC886;color: #fff;}
.billFoot .tip {
font-size: 24rpx;
font-size: 24rpx;
color: #999;
font-weight: 500;
margin: 0 20rpx;
}
.billItem > view{margin-bottom: 10rpx;}
.billFoot text{white-space: nowrap;}
.billFoot text.danger{color: #da2a2a;}
.blueTag{color: #fff;background-color: #1EC886; padding: 10rpx 10rpx;}
.status{
.warning{color: #ff8124;}
.danger{color: #da2a2a;}
.gary{color: #666;}
.success{color: #1EC886;}
}
.popContent{background:#fff; height: auto; position: fixed; width: 80vw; max-height: 50vh; top: 20%; left: 0; right: 0; border-radius: 10rpx;margin: auto;z-index: 99; box-shadow: 0 0 0 100vh rgba(0,0,0,0.4);
.button{ width: 230rpx; margin: 20rpx auto; font-size: 26rpx; color: #fff; background: linear-gradient(90deg, #00C176, #3ed89b); padding: 6rpx 15rpx;text-align: center; border-radius: 6rpx;}
}
.textbody{padding: 40rpx;}
.textbody .h3{ text-align: center;font-size: 32rpx;}
.textbody .texts{ overflow: auto; line-height: 1.6; text-indent: 2em; color: #666; max-height: 30vh; text-align: justify; margin: 20rpx 0 0; font-size: 28rpx;}
.billItem > view{box-sizing: border-box;}
.iconkp{width: 50rpx;
height: 50rpx;
display: block;
margin:10rpx auto 0;}
</style>