index.vue
13.5 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
<template>
<div class="reportLog from-clues">
<div class="from-clues-header">
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="5">
<el-form-item label="业务号">
<el-input v-model="form.ywh" placeholder="业务号"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="接入业务名称" label-width="120px">
<el-select filterable v-model="form.rectype" ref="selectref" @visible-change="isShowSelectOptions"
clearable placeholder="请选择">
<el-option v-for="item in $store.getters.businessInfo" :key="item.jrywbm" :label="item.jrywmc"
:value="item.jrywbm">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="上报状态">
<el-select v-model="form.status" ref="selectReporting" @visible-change="isShowSelectOptions" clearable
placeholder="上报状态">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="行政区">
<el-select v-model="form.pcode" clearable placeholder="行政区">
<el-option v-for="item in xzqOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="btnColRight">
<el-button type="primary" @click="handleSubmit">查询结果</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table ref="table" :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
</div>
<!-- 相应日志 -->
<response-dialog ref="responseLog" :journalData="journalData" />
<!-- 错误日志 -->
<errorLog-dialog ref="errorLog" :errorData="errorData" />
<!-- 预览 -->
<preview-dialog :content="XMLData" ref="previewLog" />
<!-- 编辑 -->
<edit-dialog ref="editLog" :bsmSjsb="bsmSjsb" :diaData="diaData" />
<!-- 重新发报 -->
<resend-dialog ref="resendLog" :msgid="msgid" />
<!-- 重新转换 -->
<retransfer-dialog ref="retransfer" />
</div>
</template>
<script>
// 上报日志
import data from "./data"
import journal from '@/api/journal.js'
import tableMixin from '@/mixins/tableMixin.js'
import dataReporting from '@/api/dataReporting'
import responseDialog from './components/response-dialog.vue'
import errorLogDialog from './components/errorLog-dialog.vue'
import previewDialog from './components/preview-dialog.vue'
import resendDialog from './components/resend-dialog.vue'
import retransferDialog from './components/retransfer-dialog.vue'
import editDialog from '@/components/dataDetails/edit-dialog.vue'
export default {
name: "reportLog",
mixins: [tableMixin],
components: {
responseDialog,
previewDialog,
resendDialog,
editDialog,
errorLogDialog,
retransferDialog
},
data () {
return {
msgid: '',
// 响应日志
journalData: '',
errorData: '',
XMLData: '',
form: {
ywh: '',
rectype: '',
status: '',
pcode: '',
currentPage: 1
},
tableData: {
columns: [{
label: '序号',
type: 'index',
width: '50',
index: this.indexMethod,
}].concat(data.columns()).concat([
{
width: 135,
label: "XML报文",
headerAlign: 'center',
align: 'left',
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
style="color:#67C23A"
icon="el-icon-view"
v-show={['1', '4', '5', '6', '7', '8'].includes(scope.row.status)}
onClick={() => { this.handlePreview(scope.$index, scope.row) }}
>
预览
</el-button>
<el-button
type="text"
style="margin-bottom:5px"
size="mini"
icon="el-icon-folder"
onClick={() => { this.handleResponseLog(scope.row) }}
v-show={['5', '7'].includes(scope.row.status)}
>
响应日志
</el-button>
</div>
);
},
},
{
label: "操作",
width: 170,
headerAlign: 'center',
align: 'right',
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
style="margin-left: 10px"
onClick={() => { this.handleEdit(scope.$index, scope.row) }}
v-show={scope.row.status == 3}
>
编辑
</el-button>
<el-button
type="text"
size="mini"
style="color:#67C23A"
icon="el-icon-folder-opened"
onClick={() => { this.handleReissue(scope.row) }}
v-show={scope.row.status == 1 || scope.row.status == 5}
>
重新上报
</el-button>
<el-button
type="text"
icon="el-icon-folder-checked"
v-show={scope.row.status == 3 || scope.row.status == 9}
onClick={() => { this.handleInspection(scope.row) }}
>
数据校验
</el-button>
<el-button
v-show={scope.row.status == 2 || scope.row.status == 3}
type="text"
size="mini"
style="margin-left:0;color:#F56C6C"
icon="el-icon-s-order"
onClick={() => { this.handleErrorLog(scope.row) }}
>
错误日志
</el-button>
<el-button
v-show={scope.row.status == 9}
type="text"
size="mini"
icon="el-icon-view"
onClick={() => { this.handleDatapreview(scope.row) }}
>
数据预览
</el-button>
<el-button
v-show={scope.row.status == 2 || scope.row.status == 0}
type="text"
icon="el-icon-copy-document"
size="mini"
onClick={() => { this.handleRetransfer(scope.row) }}
>
重新抽取
</el-button>
</div>
);
},
},
]),
data: []
},
pageData: {
total: 0,
pageSize: 15,
current: 1,
},
diaData: null,
bsmSjsb: '',
// 上报状态
statusOptions: [
{
value: '0',
label: '待抽取'
},
{
value: '2',
label: '内部错误'
},
{
value: '9',
label: '待校验'
},
{
value: '3',
label: '本地校验失败'
},
{
value: '1',
label: '待上报'
},
{
value: '4',
label: '上报成功等待响应'
},
{
value: '5',
label: '上报时发生错误'
},
{
value: '6',
label: '本地上报成功,查询上报结果错误'
},
{
value: '7',
label: '本地上报成功,上级也上报成功'
},
{
value: '8',
label: '本地上报成功,上级上报失败'
}
],
// 行政区
xzqOptions: [
{
value: '632321',
label: '同仁县'
},
{
value: '632322',
label: '尖扎县'
},
{
value: '632323',
label: '泽库县'
},
{
value: '632324',
label: '河南县'
}
]
}
},
watch: {
'tableData.data' (val) {
this.doLayout();
}
},
methods: {
doLayout () {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
// 是否显示下拉框
isShowSelectOptions (e) {
if (!e) this.$refs.selectref.blur()
if (!e) this.$refs.selectReporting.blur()
},
async featchData () {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await journal.querySjsbTask(this.form)
if (this.$store.state.dictionaries.addDic) {
this.tableData.data = list
this.pageData = {
pageSize,
current,
total
}
} else {
this.featchData()
}
} catch (error) {
this.message = error
}
},
async handleResponseLog (row) {
try {
let { result: res } = await journal.queryResponseLog(row.msgid)
if (res != null) {
this.$refs.responseLog.$refs.response.isShow()
this.journalData = res
} else {
this.$message('响应日志为空')
}
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
async handlePreview (index, row) {
try {
let res = await journal.queryXML(row.msgid)
if (res != null) {
this.XMLData = res.result
this.$refs.previewLog.$refs.preview.isShow()
} else {
this.$message('报文为空')
}
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
async handleEdit (index, row) {
try {
let { result: res, message } = await dataReporting.getQltFwFdcqYzByCondition(row.msgid)
if (res != null) {
this.diaData = res
this.bsmSjsb = row.msgid
this.$store.dispatch('business/setReportLogEdit')
this.$refs.editLog.isShow()
} else {
this.$message(message)
}
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
handleReissue (row) {
this.msgid = row.msgid
this.$refs.resendLog.$refs.resend.isShow()
},
// 错误日志
async handleErrorLog (row) {
try {
let res = await journal.queryErrorLog(row.msgid)
this.errorData = res.message
this.$refs.errorLog.$refs.error.isShow()
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
// 重新抽取
handleRetransfer (row) {
let _this = this
this.$confirm('此操作将重新抽取该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.extractLoading = true
try {
let res = await journal.extractionAndInsertData(row.msgid)
if (res.code == 200) {
_this.$message({
message: res.result,
type: 'success'
});
_this.featchData()
}
} catch (error) {
_this.$confirm(error, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
_this.featchData()
})
}
this.extractLoading = false
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
// 检验报文
async handleInspection (row) {
try {
let res = await journal.checkSjsbXmlDatas(row.msgid)
if (res.code == 200) {
this.$message({
message: '校验成功',
type: 'success'
});
}
this.featchData()
} catch (error) {
this.$confirm(error, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.featchData()
}).catch(() => {
});
}
},
// 数据预览
async handleDatapreview (row) {
let { result: res, message } = await dataReporting.getQltFwFdcqYzByCondition(row.msgid)
if (res != null) {
this.diaData = res
this.bsmSjsb = row.BSM_SJSB
this.$store.dispatch('business/setEdit')
this.$refs.editLog.isShow()
} else {
this.$message(message)
}
}
}
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
@import "./index.scss";
</style>