apply-clients 3.4.24 → 3.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +33 -33
- package/package.json +1 -1
- package/src/components/android/Process/AppExplorationUser.vue +9 -9
- package/src/filiale/guangxi/pc/ApplyCharge/chargeManagement.vue +28 -0
- package/src/filiale/guangxi/pc/Process/Service/EticketPrint.vue +393 -0
- package/src/filiale/guangxi/pc/Process/Service/addMaterialScience.vue +462 -459
- package/src/filiale/guangxi/pc.js +2 -1
- package/src/main.js +2 -2
package/index.html
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
6
|
-
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
|
|
7
|
-
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
|
|
8
|
-
<META HTTP-EQUIV="expires" CONTENT="0">
|
|
9
|
-
<title>报建系统</title>
|
|
10
|
-
<script src="https://webapi.amap.com/maps?v=1.4.2&key=4889f1e58df01cb40415536c8907bf64"></script>
|
|
11
|
-
<!--引入UI组件库(1.1版本) -->
|
|
12
|
-
<script src="https://webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script>
|
|
13
|
-
<style media="screen">
|
|
14
|
-
/*url(./static/newmainbg.jpg)*/
|
|
15
|
-
|
|
16
|
-
body {
|
|
17
|
-
font-size:16px !important;
|
|
18
|
-
width: 100%;
|
|
19
|
-
background: #7f8eaf no-repeat center bottom;
|
|
20
|
-
background-size: cover;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
body .loginbg {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
background: url(./static/loginbg.jpg) no-repeat center top;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
</head>
|
|
30
|
-
<body id="bodymain" class="themeOne">
|
|
31
|
-
<
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
6
|
+
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
|
|
7
|
+
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
|
|
8
|
+
<META HTTP-EQUIV="expires" CONTENT="0">
|
|
9
|
+
<title>报建系统</title>
|
|
10
|
+
<script src="https://webapi.amap.com/maps?v=1.4.2&key=4889f1e58df01cb40415536c8907bf64"></script>
|
|
11
|
+
<!--引入UI组件库(1.1版本) -->
|
|
12
|
+
<script src="https://webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script>
|
|
13
|
+
<style media="screen">
|
|
14
|
+
/*url(./static/newmainbg.jpg)*/
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
font-size:16px !important;
|
|
18
|
+
width: 100%;
|
|
19
|
+
background: #7f8eaf no-repeat center bottom;
|
|
20
|
+
background-size: cover;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body .loginbg {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
background: url(./static/loginbg.jpg) no-repeat center top;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
29
|
+
</head>
|
|
30
|
+
<body id="bodymain" class="themeOne">
|
|
31
|
+
<app></app>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
package/package.json
CHANGED
|
@@ -270,13 +270,13 @@ export default {
|
|
|
270
270
|
orgid: Vue.user.orgid
|
|
271
271
|
},
|
|
272
272
|
}),
|
|
273
|
-
|
|
273
|
+
applytype:[],
|
|
274
274
|
showModal: false,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
applyTypes:[{label:'散户报建',value:'散户报建'},{label:'工商户报建',value:'工商户报建'}],
|
|
275
|
+
applyType: '', // 报建类型
|
|
276
|
+
applyTypes:[],
|
|
277
|
+
// applyTypes:[{label:'散户报建',value:'散户报建'},{label:'工商户报建',value:'工商户报建'}],
|
|
278
278
|
criteriaShow: false,
|
|
279
|
-
|
|
279
|
+
// applytype: [{label: '全部', value: ''}, {label:'团购转散户',value:'团购转散户'} ], // 所有报建类型
|
|
280
280
|
defnames: [{label: '全部', value: ''}],
|
|
281
281
|
applyNatures: [{label: '全部', value: ''}], // 报建性质
|
|
282
282
|
laterList: [
|
|
@@ -290,8 +290,8 @@ export default {
|
|
|
290
290
|
this.search()
|
|
291
291
|
//this.$refs.cp.$refs.cri.model.defname='报装缴费'
|
|
292
292
|
//this.$refs.cp.$refs.cri.model.defname='合同签订'
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
this.applytype =[{label: '全部', value: ''}, ...this.$appdata.getParam('报建类型')]// 所有报建类型
|
|
294
|
+
this.applyTypes=this.$appdata.getParam("手机报建类型")
|
|
295
295
|
|
|
296
296
|
},
|
|
297
297
|
methods: {
|
|
@@ -437,8 +437,8 @@ export default {
|
|
|
437
437
|
},
|
|
438
438
|
computed: {
|
|
439
439
|
appDefnames () {
|
|
440
|
-
let list = [{label: '报装缴费', value: '报装缴费'}, {label: '通气点火', value: '通气点火'},{label: '工程施工', value: '工程施工'},{label: '工程派工', value: '工程派工'},{label: '点火派单', value: '点火派单'}]
|
|
441
|
-
|
|
440
|
+
// let list = [{label: '报装缴费', value: '报装缴费'}, {label: '通气点火', value: '通气点火'},{label: '工程施工', value: '工程施工'},{label: '工程派工', value: '工程派工'},{label: '点火派单', value: '点火派单'}]
|
|
441
|
+
let list = this.$appdata.getParam('手机节点')
|
|
442
442
|
return `(${list.map(item => `'${item.value}'`).toString()})`
|
|
443
443
|
}
|
|
444
444
|
}
|
|
@@ -403,6 +403,7 @@
|
|
|
403
403
|
<button type="button" class="btn btn-primary" @click="print()">打印</button>
|
|
404
404
|
</footer>
|
|
405
405
|
</modal>
|
|
406
|
+
<apply-eticke-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></apply-eticke-print>
|
|
406
407
|
</div>
|
|
407
408
|
</template>
|
|
408
409
|
<script>
|
|
@@ -426,6 +427,7 @@ export default {
|
|
|
426
427
|
return {
|
|
427
428
|
showCharge: false, // 收费明细
|
|
428
429
|
showInvalid: false, // 作废
|
|
430
|
+
eticket_show:false, //开票
|
|
429
431
|
showPrint: false, // 打印
|
|
430
432
|
model: {
|
|
431
433
|
data: null
|
|
@@ -509,6 +511,32 @@ export default {
|
|
|
509
511
|
resolveMsg: null,
|
|
510
512
|
rejectMsg: '缴费失败!!!'
|
|
511
513
|
})
|
|
514
|
+
if(this.charge.f_is_invoice=='是' && res.data.recordid !=null && res.data.recordid !=''){
|
|
515
|
+
let data1 = {
|
|
516
|
+
id : [
|
|
517
|
+
res.data.recordid
|
|
518
|
+
],
|
|
519
|
+
f_charge_type : '报建收费',
|
|
520
|
+
f_operatorid : data.user.id,
|
|
521
|
+
f_operator : data.user.name,
|
|
522
|
+
f_depid : data.user.depids,
|
|
523
|
+
f_depname : data.user.deps,
|
|
524
|
+
f_orgname : data.user.orgs,
|
|
525
|
+
f_orgid : data.user.orgid
|
|
526
|
+
}
|
|
527
|
+
let res1 = await http.load('POST', 'rs/gxinvoice/OpenEticket', {data:data1}, {
|
|
528
|
+
resolveMsg: null,
|
|
529
|
+
rejectMsg: '开票失败!!!'
|
|
530
|
+
})
|
|
531
|
+
console.log('打印 res1',res1)
|
|
532
|
+
if(res1.data.code=='0000'){
|
|
533
|
+
this.$showMessage("开票成功,请前往发票管理查看!")
|
|
534
|
+
}else if(res1.data.code=='0011'){
|
|
535
|
+
this.$showMessage("开票超时,请前往发票记录页面重新查询!")
|
|
536
|
+
}else{
|
|
537
|
+
this.$showMessage("开票失败,请联系管理人员查看!")
|
|
538
|
+
}
|
|
539
|
+
}
|
|
512
540
|
this.selectdata = res.data
|
|
513
541
|
|
|
514
542
|
this.$dispatch('breakControl', this.selectdata)
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="auto form-horizontal">
|
|
3
|
+
<modal :show.sync="show" v-ref:modal large backdrop="false">
|
|
4
|
+
<header slot="modal-header" class="modal-header">
|
|
5
|
+
<h3 style="color:black" class="modal-title">收费电子发票</h3>
|
|
6
|
+
</header>
|
|
7
|
+
<article slot="modal-body" class="modal-body">
|
|
8
|
+
<div class="row" style="display: flex;justify-content: center;" v-if="!eticket_src">
|
|
9
|
+
{{ return_msg }}
|
|
10
|
+
</div>
|
|
11
|
+
<iframe :src="eticket_src" v-if="eticket_src" width="100%" height="500px">
|
|
12
|
+
</iframe>
|
|
13
|
+
</article>
|
|
14
|
+
<footer slot="modal-footer" class="modal-footer">
|
|
15
|
+
<button type="button" class="btn btn-default" @click="cancel">{{ '关闭' }}</button>
|
|
16
|
+
</footer>
|
|
17
|
+
</modal>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import {HttpResetClass} from 'vue-client'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: '电子发票',
|
|
25
|
+
data () {
|
|
26
|
+
return {
|
|
27
|
+
eticket_src: '',
|
|
28
|
+
return_msg: '收到开票请求,正在查询开票状态,请稍后',
|
|
29
|
+
show: true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
props: ['show'],
|
|
33
|
+
ready () {
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
cancel () {
|
|
37
|
+
console.log('电子哈哈哈,你走了没')
|
|
38
|
+
this.eticket_src = ''
|
|
39
|
+
this.return_msg = '正在查询中,请稍后'
|
|
40
|
+
this.$dispatch('toggle')
|
|
41
|
+
},
|
|
42
|
+
//* 公用保存信息接口
|
|
43
|
+
async save_msg (obj) {
|
|
44
|
+
let model = {
|
|
45
|
+
id: obj.f_eticket_id,
|
|
46
|
+
f_bill_code: obj.f_bill_code ? obj.f_bill_code : undefined,
|
|
47
|
+
f_bill_number: obj.f_bill_number ? obj.f_bill_number : undefined,
|
|
48
|
+
f_jym: obj.f_jym ? obj.f_jym : undefined,
|
|
49
|
+
f_bill_url: obj.f_bill_url ? obj.f_bill_url : undefined,
|
|
50
|
+
f_red_url: obj.f_red_url ? obj.f_red_url : undefined,
|
|
51
|
+
f_bill_state: obj.f_bill_state,
|
|
52
|
+
f_sign_result: obj.f_sign_result ? obj.f_sign_result : undefined,
|
|
53
|
+
f_sign_time: obj.f_sign_time ? obj.f_sign_time : undefined
|
|
54
|
+
}
|
|
55
|
+
await this.$resetpost('rs/entity/t_eticket', model, {resolveMsg: null, rejectMsg: '保存发票记录失败'})
|
|
56
|
+
},
|
|
57
|
+
async openETicket (sellId, row, show_gas, is_pax, type) {
|
|
58
|
+
try {
|
|
59
|
+
let model = {
|
|
60
|
+
id: sellId,
|
|
61
|
+
f_charge_type: type,
|
|
62
|
+
f_dept_id: this.$login.f.depids,
|
|
63
|
+
f_operator: this.$login.f.name,
|
|
64
|
+
f_orgid: this.$login.f.orgid,
|
|
65
|
+
f_orgname: this.$login.f.orgs,
|
|
66
|
+
f_depname: this.$login.f.deps,
|
|
67
|
+
f_operatorid: this.$login.f.id,
|
|
68
|
+
f_filialeids: this.$login.f.f_orgids,
|
|
69
|
+
f_buy_name: row.f_paper_name,
|
|
70
|
+
f_pay_id: row.f_taxpayer_id,
|
|
71
|
+
f_buy_address: row.f_address_phone,
|
|
72
|
+
f_mail_push: row.f_email,
|
|
73
|
+
f_buy_openbank: row.f_paper_account,
|
|
74
|
+
invoice_show_gas: show_gas === '是',
|
|
75
|
+
is_pax: is_pax === '征税'
|
|
76
|
+
}
|
|
77
|
+
console.log('组织开票数据并保存', model)
|
|
78
|
+
// TODO 组织开票数据并保存
|
|
79
|
+
let ticket_id = await this.$resetpost('rs/logic/combineData_new', model, {resolveMsg: null, rejectMsg: '保存开票信息失败'})
|
|
80
|
+
return this.openEticketGen(ticket_id.data)
|
|
81
|
+
} catch (error) {
|
|
82
|
+
this.$showAlert(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`, 'danger', 0)
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
async openCustETicket (custModel, invoice_is_pax) {
|
|
86
|
+
try {
|
|
87
|
+
let model = Object.assign({
|
|
88
|
+
f_dept_id: this.$login.f.depids,
|
|
89
|
+
f_operator: this.$login.f.name,
|
|
90
|
+
f_orgid: this.$login.f.orgid,
|
|
91
|
+
f_orgname: this.$login.f.orgs,
|
|
92
|
+
f_depname: this.$login.f.deps,
|
|
93
|
+
f_operatorid: this.$login.f.id,
|
|
94
|
+
f_filialeids: this.$login.f.f_orgids,
|
|
95
|
+
f_buy_name: custModel.f_paper_name,
|
|
96
|
+
f_pay_id: custModel.f_taxpayer_id,
|
|
97
|
+
f_buy_address: custModel.f_address_phone,
|
|
98
|
+
f_mail_push: custModel.f_email,
|
|
99
|
+
f_buy_openbank: custModel.f_paper_account,
|
|
100
|
+
invoice_show_gas: !!(custModel.amount && custModel.price),
|
|
101
|
+
detail_price: {amount: custModel.amount, price: custModel.price, name: custModel.name, money: custModel.money},
|
|
102
|
+
is_pax: invoice_is_pax === '征税'
|
|
103
|
+
}, custModel)
|
|
104
|
+
// TODO 组织开票数据并保存
|
|
105
|
+
let ticket_id = await this.$resetpost('rs/logic/TCcombineCustData', model, {resolveMsg: null, rejectMsg: '保存开票信息失败'})
|
|
106
|
+
return this.openEticketGen(ticket_id.data)
|
|
107
|
+
} catch (error) {
|
|
108
|
+
this.$showAlert(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`, 'danger', 0)
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* src赋值 外部调用
|
|
113
|
+
* */
|
|
114
|
+
watch_ch (src) {
|
|
115
|
+
this.eticket_src = src
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* 电票查询 外部调用
|
|
119
|
+
* */
|
|
120
|
+
fp_search (row, ticket_id) {
|
|
121
|
+
// 通过收费记录id查询
|
|
122
|
+
let http = new HttpResetClass()
|
|
123
|
+
http.load('POST', '/invoice/rs/tongchuan/queryInvoice', {eticket_id: ticket_id}, {
|
|
124
|
+
resolveMsg: null,
|
|
125
|
+
rejectMsg: null
|
|
126
|
+
}).then((req) => {
|
|
127
|
+
if (!req.data.RESPONSE_FPXXXZ) {
|
|
128
|
+
this.$showAlert('电子票查询出错,暂无错误信息.请联系管理员', 'danger', 5000)
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
req = req.data.RESPONSE_FPXXXZ
|
|
132
|
+
let model
|
|
133
|
+
if (req.RETURN_CODE === '0000') {
|
|
134
|
+
if (req.PDF_URL) {
|
|
135
|
+
model = {
|
|
136
|
+
id: ticket_id,
|
|
137
|
+
f_bill_code: req.FPDM,
|
|
138
|
+
f_bill_number: req.FPHM,
|
|
139
|
+
f_jym: req.INVOICE_CHECK_CODE,
|
|
140
|
+
f_bill_url: req.PDF_URL,
|
|
141
|
+
f_bill_state: '开票成功',
|
|
142
|
+
f_sign_result: req.RETURN_MESSAGE
|
|
143
|
+
}
|
|
144
|
+
this.eticket_src = req.PDF_URL
|
|
145
|
+
} else if (req.PDF_RED_URL) {
|
|
146
|
+
model = {
|
|
147
|
+
id: ticket_id,
|
|
148
|
+
f_bill_code: req.FPDM,
|
|
149
|
+
f_bill_number: req.FPHM,
|
|
150
|
+
f_jym: req.INVOICE_CHECK_CODE,
|
|
151
|
+
f_red_url: req.PDF_RED_URL,
|
|
152
|
+
f_bill_state: '冲红',
|
|
153
|
+
f_sign_result: req.RETURN_MESSAGE
|
|
154
|
+
}
|
|
155
|
+
this.eticket_src = req.PDF_RED_URL
|
|
156
|
+
}
|
|
157
|
+
} else if (req.RETURN_CODE === '0011') {
|
|
158
|
+
model = {
|
|
159
|
+
id: ticket_id,
|
|
160
|
+
f_bill_state: '等待查询',
|
|
161
|
+
f_sign_result: req.RETURN_MESSAGE
|
|
162
|
+
}
|
|
163
|
+
this.return_msg = '请稍后再试。' + req.RETURN_MESSAGE
|
|
164
|
+
} else {
|
|
165
|
+
model = {
|
|
166
|
+
id: row.id,
|
|
167
|
+
f_bill_state: '开票失败',
|
|
168
|
+
f_sign_result: req.RETURN_MESSAGE
|
|
169
|
+
}
|
|
170
|
+
this.return_msg = ' 开票失败。' + req.RETURN_MESSAGE
|
|
171
|
+
}
|
|
172
|
+
this.$resetpost('rs/entity/t_eticket', model, {resolveMsg: null, rejectMsg: '保存发票记录失败'}).then(
|
|
173
|
+
res => this.$dispatch('search')
|
|
174
|
+
)
|
|
175
|
+
})
|
|
176
|
+
},
|
|
177
|
+
/** 冲红
|
|
178
|
+
* */
|
|
179
|
+
async rushRedInvoice (ticket_id) {
|
|
180
|
+
try {
|
|
181
|
+
// 否则正常打票
|
|
182
|
+
let time = 0
|
|
183
|
+
let result = await this.$resetpost('/invoice/rs/tongchuan/rushRed', {eticket_id: ticket_id}, {
|
|
184
|
+
resolveMsg: null,
|
|
185
|
+
rejectMsg: '发票冲红失败!!'
|
|
186
|
+
})
|
|
187
|
+
result = result.data.RESPONSE_FPXX
|
|
188
|
+
if (result && result.RETURN_CODE === '0000') {
|
|
189
|
+
// TODO 开票成功 保存发票详情
|
|
190
|
+
await this.save_msg({
|
|
191
|
+
f_eticket_id: ticket_id,
|
|
192
|
+
f_bill_state: '等待查询'
|
|
193
|
+
})
|
|
194
|
+
// TODO 开票成功 进行查询
|
|
195
|
+
let interval = await setInterval(() => {
|
|
196
|
+
// 2秒一轮回
|
|
197
|
+
let http = new HttpResetClass()
|
|
198
|
+
http.load('POST', '/invoice/rs/tongchuan/queryInvoice', {eticket_id: ticket_id}, {
|
|
199
|
+
resolveMsg: null,
|
|
200
|
+
rejectMsg: null
|
|
201
|
+
}).then(req => {
|
|
202
|
+
if (!req.data.RESPONSE_FPXXXZ) {
|
|
203
|
+
clearInterval(interval)
|
|
204
|
+
this.save_msg({
|
|
205
|
+
f_eticket_id: ticket_id,
|
|
206
|
+
f_sign_result: '查询超时请再次尝试。',
|
|
207
|
+
f_bill_state: '查询失败'
|
|
208
|
+
})
|
|
209
|
+
this.$showAlert('电子票查询出错,暂无错误信息,请前往发票管理重新尝试', 'danger', 5000)
|
|
210
|
+
return
|
|
211
|
+
}
|
|
212
|
+
req = req.data.RESPONSE_FPXXXZ
|
|
213
|
+
console.log(req, '查出什么玩意了', time, req.DDBH + '')
|
|
214
|
+
if (req && req.RETURN_CODE === '0000') {
|
|
215
|
+
// 组织数据
|
|
216
|
+
clearInterval(interval)
|
|
217
|
+
// TODO 成功后保存发票详情
|
|
218
|
+
this.save_msg({
|
|
219
|
+
f_eticket_id: ticket_id,
|
|
220
|
+
f_bill_code: req.FPDM,
|
|
221
|
+
f_bill_number: req.FPHM,
|
|
222
|
+
f_jym: req.INVOICE_CHECK_CODE,
|
|
223
|
+
f_bill_url: req.PDF_RED_URL,
|
|
224
|
+
f_sign_result: req.RETURN_MESSAGE,
|
|
225
|
+
f_bill_state: '冲红'
|
|
226
|
+
})
|
|
227
|
+
this.eticket_src = req.PDF_RED_URL
|
|
228
|
+
} else if (req && req.RETURN_CODE !== '0011') {
|
|
229
|
+
clearInterval(interval)
|
|
230
|
+
// TODO 失败后保存发票详情
|
|
231
|
+
this.save_msg({
|
|
232
|
+
f_eticket_id: ticket_id,
|
|
233
|
+
f_sign_result: req.RETURN_MESSAGE,
|
|
234
|
+
f_bill_state: '开票成功'
|
|
235
|
+
})
|
|
236
|
+
this.return_msg = '电子票查询出错,错误【' + req.RETURN_MESSAGE + '】,错误代码【' + req.RETURN_CODE + '】,请前往发票管理重新尝试'
|
|
237
|
+
} else {
|
|
238
|
+
if (time == 80) {
|
|
239
|
+
// 三十秒后无效
|
|
240
|
+
// TODO 查询失败后保存发票详情
|
|
241
|
+
this.save_msg({
|
|
242
|
+
f_eticket_id: ticket_id,
|
|
243
|
+
f_sign_result: '查询超时请再次尝试。',
|
|
244
|
+
f_bill_state: '等待查询'
|
|
245
|
+
})
|
|
246
|
+
this.return_msg = '发票已经开具,查询发票状态超时,请前往发票管理重新尝试'
|
|
247
|
+
clearInterval(interval)
|
|
248
|
+
}
|
|
249
|
+
time = time + 1
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
}, 1 * 2000)
|
|
253
|
+
} else if (result) {
|
|
254
|
+
// TODO 查询失败后保存发票详情
|
|
255
|
+
await this.save_msg({
|
|
256
|
+
f_eticket_id: ticket_id,
|
|
257
|
+
f_sign_result: result.RETURN_MESSAGE,
|
|
258
|
+
f_bill_state: '冲红失败'
|
|
259
|
+
})
|
|
260
|
+
this.return_msg = '电子票冲红出错,错误【' + result.RETURN_MESSAGE + '】,错误代码【' + result.RETURN_CODE + '】,请前往发票管理重新尝试'
|
|
261
|
+
} else {
|
|
262
|
+
await this.save_msg({
|
|
263
|
+
f_eticket_id: ticket_id,
|
|
264
|
+
f_sign_result: '电子票冲红出错,需要查询日志。',
|
|
265
|
+
f_bill_state: '冲红失败'
|
|
266
|
+
})
|
|
267
|
+
this.$showAlert('电子票冲红出错,暂无错误信息,请前往发票管理重新尝试', 'danger', 5000)
|
|
268
|
+
}
|
|
269
|
+
} catch (error) {
|
|
270
|
+
await this.save_msg({
|
|
271
|
+
f_eticket_id: ticket_id,
|
|
272
|
+
f_return_msg: '冲红失败,需要查询日志。',
|
|
273
|
+
f_bill_state: '冲红失败'
|
|
274
|
+
})
|
|
275
|
+
this.$showAlert('电子票冲红出现异常,请联系管理员!!!', 'warning', 5000)
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
* @param id 收费id
|
|
281
|
+
* @param ticket_id 票据信息 id
|
|
282
|
+
* @returns {Promise<void>} 如果查到返回url
|
|
283
|
+
*/
|
|
284
|
+
async openEticketGen (ticket_id) {
|
|
285
|
+
try {
|
|
286
|
+
// 否则正常打票
|
|
287
|
+
// await this.$resetpost('/rs/logic/updateSearil', {id: ticket_id}, {
|
|
288
|
+
// resolveMsg: null,
|
|
289
|
+
// rejectMsg: '更新流水号失败!!'
|
|
290
|
+
// })
|
|
291
|
+
let time = 0
|
|
292
|
+
let result = await this.$resetpost('/invoice/rs/logic/GXGetInvoice', {eticket_id: ticket_id}, {
|
|
293
|
+
resolveMsg: null,
|
|
294
|
+
rejectMsg: '发票打印失败!!'
|
|
295
|
+
})
|
|
296
|
+
result = result.data
|
|
297
|
+
if (result && result.code === 'E0000') {
|
|
298
|
+
// TODO 开票成功 保存发票详情
|
|
299
|
+
await this.save_msg({
|
|
300
|
+
f_eticket_id: ticket_id,
|
|
301
|
+
f_bill_state: '等待查询'
|
|
302
|
+
})
|
|
303
|
+
// TODO 开票成功 进行查询
|
|
304
|
+
let interval = await setInterval(() => {
|
|
305
|
+
// 2秒一轮回
|
|
306
|
+
let http = new HttpResetClass()
|
|
307
|
+
http.load('POST', '/invoice/rs/logic/GXQueryInvoice', {eticket_id: ticket_id}, {
|
|
308
|
+
resolveMsg: null,
|
|
309
|
+
rejectMsg: null
|
|
310
|
+
}).then(req => {
|
|
311
|
+
if (!req.data.code !== 'E0000') {
|
|
312
|
+
clearInterval(interval)
|
|
313
|
+
this.save_msg({
|
|
314
|
+
f_eticket_id: ticket_id,
|
|
315
|
+
f_sign_result: '查询超时请再次尝试。',
|
|
316
|
+
f_bill_state: '查询失败'
|
|
317
|
+
})
|
|
318
|
+
this.$showAlert('电子票查询出错,暂无错误信息,请前往发票管理重新尝试', 'danger', 5000)
|
|
319
|
+
return
|
|
320
|
+
}
|
|
321
|
+
req = req.data
|
|
322
|
+
console.log(req, '查出什么玩意了', time)
|
|
323
|
+
if (req && req.code === 'E0000' && req.status === '2') {
|
|
324
|
+
// 组织数据
|
|
325
|
+
clearInterval(interval)
|
|
326
|
+
// TODO 成功后保存发票详情
|
|
327
|
+
this.save_msg({
|
|
328
|
+
f_eticket_id: ticket_id,
|
|
329
|
+
f_bill_code: req.invoiceCode,
|
|
330
|
+
f_bill_number: req.invoiceNo,
|
|
331
|
+
f_jym: req.checkCode,
|
|
332
|
+
f_bill_url: req.pdfUrl,
|
|
333
|
+
f_sign_result: req.statusMsg,
|
|
334
|
+
f_bill_state: '开票成功'
|
|
335
|
+
})
|
|
336
|
+
this.eticket_src = req.pdfUrl
|
|
337
|
+
} else if (req && req.code !== 'E0000') {
|
|
338
|
+
clearInterval(interval)
|
|
339
|
+
// TODO 失败后保存发票详情
|
|
340
|
+
this.save_msg({
|
|
341
|
+
f_eticket_id: ticket_id,
|
|
342
|
+
f_sign_result: req.statusMsg,
|
|
343
|
+
f_bill_state: '开票失败'
|
|
344
|
+
})
|
|
345
|
+
this.return_msg = '电子票查询出错,错误【' + req.statusMsg + '】,错误代码【' + req.code + '】,请前往发票管理重新尝试'
|
|
346
|
+
} else {
|
|
347
|
+
if (time == 50) {
|
|
348
|
+
// 三十秒后无效
|
|
349
|
+
// TODO 查询失败后保存发票详情
|
|
350
|
+
this.save_msg({
|
|
351
|
+
f_eticket_id: ticket_id,
|
|
352
|
+
f_sign_result: '查询超时请再次尝试。',
|
|
353
|
+
f_bill_state: '查询失败'
|
|
354
|
+
})
|
|
355
|
+
this.return_msg = '发票已经开具,查询发票状态超时,请前往发票管理重新尝试'
|
|
356
|
+
clearInterval(interval)
|
|
357
|
+
}
|
|
358
|
+
time = time + 1
|
|
359
|
+
}
|
|
360
|
+
})
|
|
361
|
+
}, 1 * 2000)
|
|
362
|
+
} else if (result) {
|
|
363
|
+
// TODO 查询失败后保存发票详情
|
|
364
|
+
await this.save_msg({
|
|
365
|
+
f_eticket_id: ticket_id,
|
|
366
|
+
f_sign_result: result.statusMsg,
|
|
367
|
+
f_bill_state: '开票失败'
|
|
368
|
+
})
|
|
369
|
+
this.return_msg = '电子票开票出错,错误【' + result.statusMsg + '】,错误代码【' + result.cdeo + '】,请前往发票管理重新尝试'
|
|
370
|
+
} else {
|
|
371
|
+
await this.save_msg({
|
|
372
|
+
f_eticket_id: ticket_id,
|
|
373
|
+
f_sign_result: '开票失败,需要查询日志。',
|
|
374
|
+
f_bill_state: '开票失败'
|
|
375
|
+
})
|
|
376
|
+
this.$showAlert('电子票开票出错,暂无错误信息,请前往发票管理重新尝试', 'danger', 5000)
|
|
377
|
+
}
|
|
378
|
+
} catch (error) {
|
|
379
|
+
await this.save_msg({
|
|
380
|
+
f_eticket_id: ticket_id,
|
|
381
|
+
f_return_msg: '开票失败,需要查询日志。',
|
|
382
|
+
f_bill_state: '开票失败'
|
|
383
|
+
})
|
|
384
|
+
this.$showAlert('电子发票打印出现异常,请联系管理员!!!', 'warning', 5000)
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
watch: {},
|
|
389
|
+
events: {}
|
|
390
|
+
}
|
|
391
|
+
</script>
|
|
392
|
+
<style>
|
|
393
|
+
</style>
|