QRCodeDetailDialog.vue
5.68 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
216
217
218
219
220
221
222
223
224
225
226
<template>
<div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="detail-content-warn">
<div v-loading="loading">
<div class="form_div">
<el-form label-width="450px"
:inline="true">
<el-form-item label="销售方名称:">
{{ detailInfo.enterpriseName ? detailInfo.enterpriseName : "-" }}
</el-form-item>
<!-- <el-form-item label="企业联系电话:">
{{ "-" }}
</el-form-item> -->
<el-form-item label="开票金额:">
{{ detailInfo.invoiceAmount ? detailInfo.invoiceAmount : "-" }}
</el-form-item>
<el-form-item label="票通订单号:">
{{ detailInfo.tradeNo ? detailInfo.tradeNo : "-" }}
</el-form-item>
<el-form-item label="生成时间:">
{{ detailInfo.createdDate ? detailInfo.createdDate : "-" }}
</el-form-item>
<el-form-item label="二维码有效期:">
{{ detailInfo.expireDay ? detailInfo.expireDay + '天' : "-" }}
</el-form-item>
</el-form>
<div class="imgCon">
<el-image id="printImage"
:src="detailInfo.invoiceQrCode"
class="imgSize"></el-image>
</div>
<div class="tips">
您可以使用微信或支付宝,扫码开票
</div>
</div>
<div class="footer">
<el-button @click="dialogInnerShow = true"
type="primary">发送邮箱</el-button>
<el-button @click="handlePrint">打印</el-button>
</div>
</div>
<baseDialog :is-show.sync="dialogInnerShow"
:config="dialogInnerConfig.setting"
:dialog-config="dialogInnerConfig.config"
@handleClick="handleSendEmail">
<el-form ref="sendFormRef"
:model="sendForm"
label-width="100px">
<el-form-item prop="email"
label="邮箱"
:rules="[
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
]">
<el-input v-model="sendForm.email"
style="width: 300px;"></el-input>
</el-form-item>
</el-form>
</baseDialog>
</basedialog>
</div>
</template>
<script>
import { getByQrcodeNo, sendEmail } from '@api/invoiceManage'
import { Util, deepClone } from "@/common/util"
export default {
name: "InvoiceCodeDetailDialog",
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose')
}
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
btnList: []
},
config: {
title: "查看二维码",
width: "1080px"
}
},
detailInfo: {},
loading: true,
dialogInnerShow: false,
dialogInnerConfig: {
setting: {
showClose: true,
appendToBody: true,
isShowFooter: true,
confirm_name: '发送',
cancel_name: '取消'
},
config: {
title: "发送邮箱",
width: "500px"
}
},
sendForm: {
email: ''
}
}
},
methods: {
getDetail() {
var params = { qrcodeNo: this.paramsObj.qrcodeNo }
getByQrcodeNo(params).then(res => {
this.detailInfo = res
this.loading = false
})
},
handlePrint() {
if (this.detailInfo.invoiceQrCode) {
window.open(this.detailInfo.invoiceQrCode)
}
},
handleSendEmail() {
this.$refs.sendFormRef.validate(valid => {
if (valid) {
var params = deepClone(this.sendForm)
params.qrcodeNo = this.detailInfo.qrcodeNo
sendEmail(params).then(res => {
this.notice.okTips('发送成功')
this.dialogInnerShow = false
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.form_div {
color: #333333;
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.imgCon {
text-align: center;
.imgSize {
width: 120px;
height: 120px;
}
}
.tips {
text-align: center;
margin-top: 10px;
}
}
.footer {
text-align: center;
margin-top: 50px;
}
}
</style>