765e2449 by 任超

feat:上报日志

1 parent d19af6ad
......@@ -10,6 +10,7 @@
"dependencies": {
"@jiaminghi/data-view": "^2.10.0",
"axios": "^0.21.1",
"clipboard": "^2.0.11",
"core-js": "^3.6.5",
"echarts": "^4.6.0",
"js-cookie": "2.2.0",
......
......@@ -59,6 +59,19 @@ export const asyncRoutes = [
}
]
},
// 上报日志
{
path: '/reportLog',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/reportLog/index'),
name: 'reportLog',
meta: { title: '上报日志', icon: 'zsgl' }
}
]
},
// 接入业务信息
{
path: '/busineInfo',
......
<template>
<!-- 错误日志 -->
<dialogBox ref="error" isReset saveButton="关闭" divider width="50%" @submitForm="handleResclose" multiple title="错误日志">
<div class="xmlMessage">
{{ errorData }}
</div>
</dialogBox>
</template>
<script>
export default {
props: {
errorData: {
type: String,
default: ''
}
},
data () {
return {
}
},
methods: {
handleResclose () {
this.$refs.error.isHide();
}
}
}
</script>
\ No newline at end of file
<template>
<!-- 预览 -->
<dialogBox ref="preview" :isReset="false" divider :isButton="false" multiple title="XML报文">
<div class="xmlMessage">
{{ content }}
</div>
<div class="preview-dialog-button">
<el-button id="copy_text" type="primary" plain @click="handleSubmit"
:data-clipboard-text="content">复制报文</el-button>
<el-button @click="handleclose">关闭</el-button>
</div>
</dialogBox>
</template>
<script>
import Clipboard from 'clipboard'
export default {
props: {
content: {
type: String,
default: ''
},
},
data () {
return {
}
},
methods: {
handleSubmit () {
var _this = this;
var clipboard = new Clipboard('#copy_text');
clipboard.on('success', e => {
// 释放内存
this.$message({
message: '复制成功!',
type: 'success'
})
clipboard.destroy()
_this.$refs.preview.isHide()
})
clipboard.on('error', e => {
// 不支持复制
this.$message({
message: '该浏览器不支持自动复制',
type: 'warning'
});
// 释放内存
clipboard.destroy()
})
},
handleclose () {
this.$refs.preview.isHide();
}
}
}
</script>
<style scoped lang="scss">
.preview-dialog-button {
text-align: center;
margin: 20px 0;
}
</style>
\ No newline at end of file
<template>
<!-- 重新发报 -->
<dialogBox ref="resend" saveButton="确定" width="500px" divider @submitForm="handleResclose" multiple title="提示">
<div class="confirmDialog">您确定重新发送报文吗?</div>
</dialogBox>
</template>
<script>
import journal from '@/api/journal.js'
export default {
props: {
msgid: {
type: String,
default: ''
}
},
data () {
return {
}
},
methods: {
async handleResclose () {
try {
let res = await journal.sendXmlForPlat(this.msgid)
if (res.code == 200) {
this.$message({
message: res.message,
type: 'success'
})
this.$parent.featchData();
this.$refs.resend.isHide()
}
} catch (error) {
this.$message({
showClose: true,
message: '服务器出错,请稍后重试',
type: 'error'
})
this.$refs.resend.isHide()
}
}
}
}
</script>
\ No newline at end of file
<template>
<!-- 相应日志 -->
<dialogBox ref="response" isReset saveButton="关闭" divider @submitForm="handleResclose" multiple title="相应日志">
<div class="xmlMessage">
{{ journalData }}
</div>
</dialogBox>
</template>
<script>
export default {
props: {
journalData: {
type: String,
default: ''
}
},
data () {
return {
}
},
methods: {
handleResclose () {
this.$refs.response.isHide();
}
}
}
</script>
\ No newline at end of file
<template>
<!-- 重新转换 -->
<dialogBox ref="resend" saveButton="确定" width="500px" divider @submitForm="handleResclose" multiple title="提示">
<div class="confirmDialog">您确定重新抽取业务转换报文吗?</div>
</dialogBox>
</template>
<script>
import journal from '@/api/journal.js'
export default {
props: {
msgid: {
type: String,
default: ''
}
},
data () {
return {
}
},
methods: {
async handleResclose () {
try {
let res = await journal.sendXmlForPlat(this.msgid)
if (res.code == 200) {
this.$message({
message: res.message,
type: 'success'
})
this.$parent.featchData();
this.$refs.resend.isHide()
}
} catch (error) {
this.$message({
showClose: true,
message: '服务器出错,请稍后重试',
type: 'error'
})
}
}
}
}
</script>
\ No newline at end of file
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
super()
}
columns () {
return [
{
label: "行政区",
width: 120,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.regorgid || '暂无'}</span>
</div>
)
},
},
{
label: "创建时间",
width: 135,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.cjsj}</span>
</div>
)
},
},
{
label: "业务号",
width: 150,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.ywh}</span>
</div>
)
},
},
{
label: "接入业务编码",
width: 100,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.rectype}</span>
</div>
)
}
},
{
label: "接入业务名称",
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{this.busNameStatus(scope.row.rectype)}</span>
</div>
)
}
},
{
label: "上报时间",
width: 135,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.sbsj}</span>
</div>
)
}
},
{
label: "上报状态",
width: 120,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{this.reportingStatus(scope.row.status)}</span>
</div>
)
}
},
{
label: "响应时间",
width: 135,
render: (h, scope) => {
return (
<div class={{ 'warning': scope.row.status == 6, 'bad': (scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 5) }}>
<span>{scope.row.xysj}</span>
</div>
)
}
}
]
}
}
export default new data()
.reportLog {
.progress {
position: absolute;
width: 200px;
z-index: 99999;
top: 50%;
left: 50%;
transform: translateX(-50%);
}
}
\ No newline at end of file
<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>