|
@@ -19,24 +19,32 @@
|
|
|
></el-date-picker>
|
|
|
<el-input v-model="headerParam.patNo" clearable placeholder="住院号/门诊ID" style="width: 130px"></el-input>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="fetchSiLogs">检索</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="fetchSiLogs(true)">检索</el-button>
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-tag type="info" effect="dark" size="small" v-show="tipMessage">{{ tipMessage }}</el-tag>
|
|
|
</el-header>
|
|
|
<el-main>
|
|
|
- <el-table :data="logs" :height="tableHeight" stripe highlight-current-row @row-dblclick="formatBodyResult">
|
|
|
- <el-table-column prop="msgid" label="报文ID" width="230"></el-table-column>
|
|
|
- <el-table-column prop="insuplcAdmdvs" label="参保区划"></el-table-column>
|
|
|
- <el-table-column prop="infno" label="功能号"></el-table-column>
|
|
|
- <el-table-column prop="infname" label="功能号名称"></el-table-column>
|
|
|
- <el-table-column prop="opter" label="操作员"></el-table-column>
|
|
|
- <el-table-column prop="opterName" label="操作员姓名"></el-table-column>
|
|
|
- <el-table-column prop="createDatetime" label="操作时间" width="130"></el-table-column>
|
|
|
- <el-table-column prop="patNo" label="患者ID"></el-table-column>
|
|
|
- <el-table-column prop="times" label="次数"></el-table-column>
|
|
|
- <el-table-column label="结果">
|
|
|
+ <el-table :data="logs" :height="tableHeight" border highlight-current-row :row-class-name="tableRowClassName">
|
|
|
+ <el-table-column prop="msgid" label="报文ID" width="260"></el-table-column>
|
|
|
+ <el-table-column prop="insuplcAdmdvs" label="参保区划" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="infno" label="功能号" width="60"></el-table-column>
|
|
|
+ <el-table-column prop="infname" label="功能号名称" width="120"></el-table-column>
|
|
|
+ <el-table-column prop="opter" label="操作员" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="opterName" label="操作员姓名" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="createDatetime" label="操作时间" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="patNo" label="患者ID" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="times" label="次数" width="60"></el-table-column>
|
|
|
+ <el-table-column label="结果" width="60">
|
|
|
<template #default="scope">
|
|
|
<span v-html="coloredResult(scope.row.infcode)"></span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="操作" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="info" circle icon="el-icon-view" @click="formatBodyResult(scope.row.msgid)"></el-button>
|
|
|
+ <el-button type="primary" circle icon="el-icon-download" @click="exportBodyResultTxt(scope.row)"></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
@@ -51,13 +59,20 @@
|
|
|
<el-drawer v-model="showFormatModal" :with-header="false" :size="drawerWidth">
|
|
|
<div :style="formattedStyle">
|
|
|
<div :style="formattedChildStyle">
|
|
|
+ <div :style="leftPreCopyStyle">
|
|
|
+ <el-button icon="el-icon-document" type="text" @click="copyLogBodyResult(1)">复制</el-button>
|
|
|
+ </div>
|
|
|
<pre :style="preStyle" class="formatted-body">{{ formattedBody }}</pre>
|
|
|
</div>
|
|
|
<div :style="formattedChildStyle">
|
|
|
+ <div style="position: absolute; top: 20px; right: 50px">
|
|
|
+ <el-button icon="el-icon-document" type="text" @click="copyLogBodyResult(2)">复制</el-button>
|
|
|
+ </div>
|
|
|
<pre :style="preStyle" class="formatted-result">{{ formattedResult }}</pre>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
+ <textarea style="opacity: 0; position: fixed" id="copyArea"></textarea>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</template>
|
|
@@ -69,6 +84,7 @@ import { setlShtcuts } from '@/data/shortcuts'
|
|
|
import { infnos } from '@/data/index'
|
|
|
import { selectSiLogs, selectSiLogBody } from '../../../api/medical-insurance/si-log'
|
|
|
import { getDateRangeFormatDate } from '../../../utils/date'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
export default {
|
|
|
setup() {
|
|
|
const store = useStore()
|
|
@@ -95,6 +111,12 @@ export default {
|
|
|
overflowY: 'auto',
|
|
|
}
|
|
|
|
|
|
+ const leftPreCopyStyle = {
|
|
|
+ position: 'absolute',
|
|
|
+ top: '20px',
|
|
|
+ left: drawerWidth / 2 - 100 + 'px',
|
|
|
+ }
|
|
|
+
|
|
|
const currentInfnos = computed(() => {
|
|
|
return infnos[headerParam.logType]
|
|
|
})
|
|
@@ -105,23 +127,25 @@ export default {
|
|
|
logType: 1,
|
|
|
infno: null,
|
|
|
patNo: null,
|
|
|
+ needCalTips: null,
|
|
|
pageSize: 30,
|
|
|
currentPage: 1,
|
|
|
})
|
|
|
+ const tipMessage = ref(null)
|
|
|
const logs = ref([])
|
|
|
const handleSizeChange = (val) => {
|
|
|
headerParam.pageSize = val
|
|
|
- fetchSiLogs()
|
|
|
+ fetchSiLogs(false)
|
|
|
}
|
|
|
const handleCurrentChange = (val) => {
|
|
|
headerParam.currentPage = val
|
|
|
- fetchSiLogs()
|
|
|
+ fetchSiLogs(false)
|
|
|
}
|
|
|
const showFormatModal = ref(false)
|
|
|
const formattedBody = ref(null)
|
|
|
const formattedResult = ref(null)
|
|
|
- const formatBodyResult = (row) => {
|
|
|
- selectSiLogBody(row.msgid).then((res) => {
|
|
|
+ const formatBodyResult = (msgid) => {
|
|
|
+ selectSiLogBody(msgid).then((res) => {
|
|
|
formattedBody.value = JSON.stringify(JSON.parse(res.body), null, 2)
|
|
|
formattedResult.value = JSON.stringify(JSON.parse(res.result), null, 2)
|
|
|
showFormatModal.value = true
|
|
@@ -130,22 +154,65 @@ export default {
|
|
|
|
|
|
const totalSize = ref(0)
|
|
|
|
|
|
- const fetchSiLogs = () => {
|
|
|
+ const fetchSiLogs = (needCalTips) => {
|
|
|
+ headerParam.needCalTips = needCalTips
|
|
|
if (dateRange.value) {
|
|
|
const dtrge = getDateRangeFormatDate(dateRange.value)
|
|
|
headerParam.begntime = dtrge.startTime
|
|
|
headerParam.endtime = dtrge.endTime
|
|
|
}
|
|
|
- selectSiLogs(headerParam).then((res) => {
|
|
|
- logs.value = res.list
|
|
|
- totalSize.value = res.total
|
|
|
- })
|
|
|
+ selectSiLogs(headerParam)
|
|
|
+ .then((res) => {
|
|
|
+ logs.value = res.list
|
|
|
+ totalSize.value = res.total
|
|
|
+ if (needCalTips) {
|
|
|
+ tipMessage.value = res.tipMessage
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ logs.value = []
|
|
|
+ totalSize.value = 0
|
|
|
+ tipMessage.value = null
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const tableRowClassName = ({ row }) => {
|
|
|
+ if (row.infcode === 0) {
|
|
|
+ return 'success-row'
|
|
|
+ }
|
|
|
+ return 'danger-row'
|
|
|
}
|
|
|
|
|
|
const coloredResult = (infcode) => {
|
|
|
return infcode === 0 ? '<span style="color: green">成功</span>' : '<span style="color: red">失败</span>'
|
|
|
}
|
|
|
|
|
|
+ const copyLogBodyResult = (flag) => {
|
|
|
+ const copyArea = document.getElementById('copyArea')
|
|
|
+ copyArea.value = flag === 1 ? formattedBody.value : formattedResult.value
|
|
|
+ copyArea.select()
|
|
|
+ document.execCommand('Copy')
|
|
|
+ ElMessage({
|
|
|
+ message: '复制成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const exportBodyResultTxt = (row) => {
|
|
|
+ selectSiLogBody(row.msgid).then((res) => {
|
|
|
+ let str = '参数:\r\n' + res.body + '\r\n\r\n' + '返回:\r\n' + res.result
|
|
|
+ let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str)
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.href = uri
|
|
|
+ link.download = `【功能号:${res.infno},${row.infname}】报文详细.txt`
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
tableHeight,
|
|
|
drawerWidth,
|
|
@@ -153,10 +220,12 @@ export default {
|
|
|
formattedStyle,
|
|
|
formattedChildStyle,
|
|
|
preStyle,
|
|
|
+ leftPreCopyStyle,
|
|
|
infnos,
|
|
|
currentInfnos,
|
|
|
headerParam,
|
|
|
setlShtcuts,
|
|
|
+ tipMessage,
|
|
|
logs,
|
|
|
showFormatModal,
|
|
|
formattedBody,
|
|
@@ -167,6 +236,9 @@ export default {
|
|
|
handleCurrentChange,
|
|
|
handleSizeChange,
|
|
|
coloredResult,
|
|
|
+ tableRowClassName,
|
|
|
+ exportBodyResultTxt,
|
|
|
+ copyLogBodyResult,
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@@ -178,13 +250,19 @@ pre {
|
|
|
word-wrap: break-word;
|
|
|
}
|
|
|
.formatted-body {
|
|
|
- background: #60a6ec8a;
|
|
|
+ background: #9acbfc7a;
|
|
|
border-radius: 8px;
|
|
|
padding: 10px;
|
|
|
}
|
|
|
.formatted-result {
|
|
|
- background: #90da6b7a;
|
|
|
+ background: #c8ffad7a;
|
|
|
border-radius: 8px;
|
|
|
padding: 10px;
|
|
|
}
|
|
|
+:deep(.el-table .success-row) {
|
|
|
+ background: #e7ffdb7a;
|
|
|
+}
|
|
|
+:deep(.el-table .danger-row) {
|
|
|
+ background: #fdd5d586;
|
|
|
+}
|
|
|
</style>
|