|
@@ -39,10 +39,11 @@
|
|
|
<span v-html="coloredResult(scope.row.infcode)"></span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="100">
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
<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>
|
|
|
+ <el-button type="info" circle icon="el-icon-view" @click="formatBodyResult(scope.row.msgid)" title="查看"></el-button>
|
|
|
+ <el-button type="primary" circle icon="el-icon-download" @click="exportBodyResultTxt(scope.row)" title="下载"></el-button>
|
|
|
+ <el-button v-if="showRecoveryTrade(scope.row.infno)" type="danger" circle icon="el-icon-refresh" @click="recoveryTrade(scope.row)" title="冲正"></el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -77,170 +78,165 @@
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script setup>
|
|
|
import { computed, reactive, ref } from 'vue'
|
|
|
import { useStore } from 'vuex'
|
|
|
import { setlShtcuts } from '@/data/shortcuts'
|
|
|
import { infnos } from '@/data/index'
|
|
|
import { selectSiLogs, selectSiLogBody } from '../../../api/medical-insurance/si-log'
|
|
|
+import { recoveryTradePermission } from '../../../utils/permission'
|
|
|
+import { autoRecoveryTrade } from '../../../api/medical-insurance/si-manage'
|
|
|
import { getDateRangeFormatDate } from '../../../utils/date'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
-export default {
|
|
|
- setup() {
|
|
|
- const store = useStore()
|
|
|
- const windowSize = store.state.app.windowSize
|
|
|
- const tableHeight = windowSize.h - 85
|
|
|
- const dateRange = ref(null)
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+const store = useStore()
|
|
|
+const windowSize = store.state.app.windowSize
|
|
|
+const tableHeight = windowSize.h - 85
|
|
|
+const dateRange = ref(null)
|
|
|
|
|
|
- const fullWidth = window.innerWidth
|
|
|
- const drawerWidth = fullWidth * 0.66
|
|
|
+const fullWidth = window.innerWidth
|
|
|
+const drawerWidth = fullWidth * 0.66
|
|
|
|
|
|
- const formattedStyle = {
|
|
|
- display: 'flex',
|
|
|
- height: window.innerHeight + 'px',
|
|
|
- }
|
|
|
+const formattedStyle = {
|
|
|
+ display: 'flex',
|
|
|
+ height: window.innerHeight + 'px',
|
|
|
+}
|
|
|
|
|
|
- const formattedChildStyle = {
|
|
|
- width: drawerWidth / 2 - 10 + 'px',
|
|
|
- padding: '0 10px 0 10px',
|
|
|
- }
|
|
|
+const formattedChildStyle = {
|
|
|
+ width: drawerWidth / 2 - 10 + 'px',
|
|
|
+ padding: '0 10px 0 10px',
|
|
|
+}
|
|
|
|
|
|
- const preStyle = {
|
|
|
- width: drawerWidth / 2 - 60 + 'px',
|
|
|
- height: window.innerHeight - 50 + 'px',
|
|
|
- overflowY: 'auto',
|
|
|
- }
|
|
|
+const preStyle = {
|
|
|
+ width: drawerWidth / 2 - 60 + 'px',
|
|
|
+ height: window.innerHeight - 50 + 'px',
|
|
|
+ overflowY: 'auto',
|
|
|
+}
|
|
|
|
|
|
- const leftPreCopyStyle = {
|
|
|
- position: 'absolute',
|
|
|
- top: '20px',
|
|
|
- left: drawerWidth / 2 - 100 + 'px',
|
|
|
- }
|
|
|
+const leftPreCopyStyle = {
|
|
|
+ position: 'absolute',
|
|
|
+ top: '20px',
|
|
|
+ left: drawerWidth / 2 - 100 + 'px',
|
|
|
+}
|
|
|
|
|
|
- const currentInfnos = computed(() => {
|
|
|
- return infnos[headerParam.logType]
|
|
|
- })
|
|
|
+const currentInfnos = computed(() => {
|
|
|
+ return infnos[headerParam.logType]
|
|
|
+})
|
|
|
|
|
|
- const headerParam = reactive({
|
|
|
- begntime: null,
|
|
|
- endtime: null,
|
|
|
- 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(false)
|
|
|
- }
|
|
|
- const handleCurrentChange = (val) => {
|
|
|
- headerParam.currentPage = val
|
|
|
- fetchSiLogs(false)
|
|
|
- }
|
|
|
- const showFormatModal = ref(false)
|
|
|
- const formattedBody = ref(null)
|
|
|
- const formattedResult = ref(null)
|
|
|
- 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
|
|
|
- })
|
|
|
- }
|
|
|
+const headerParam = reactive({
|
|
|
+ begntime: null,
|
|
|
+ endtime: null,
|
|
|
+ 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(false)
|
|
|
+}
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ headerParam.currentPage = val
|
|
|
+ fetchSiLogs(false)
|
|
|
+}
|
|
|
+const showFormatModal = ref(false)
|
|
|
+const formattedBody = ref(null)
|
|
|
+const formattedResult = ref(null)
|
|
|
+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
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- const totalSize = ref(0)
|
|
|
+const totalSize = ref(0)
|
|
|
|
|
|
- const fetchSiLogs = (needCalTips) => {
|
|
|
- headerParam.needCalTips = needCalTips
|
|
|
- if (dateRange.value) {
|
|
|
- const dtrge = getDateRangeFormatDate(dateRange.value)
|
|
|
- headerParam.begntime = dtrge.startTime
|
|
|
- headerParam.endtime = dtrge.endTime
|
|
|
+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
|
|
|
+ if (needCalTips) {
|
|
|
+ tipMessage.value = res.tipMessage
|
|
|
}
|
|
|
- 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
|
|
|
- })
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ logs.value = []
|
|
|
+ totalSize.value = 0
|
|
|
+ tipMessage.value = null
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- const tableRowClassName = ({ row }) => {
|
|
|
- if (row.infcode === 0) {
|
|
|
- return 'success-row'
|
|
|
- }
|
|
|
- return 'danger-row'
|
|
|
- }
|
|
|
+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 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)
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- const copyLogBodyResult = (flag) => {
|
|
|
- const copyArea = document.getElementById('copyArea')
|
|
|
- copyArea.value = flag === 1 ? formattedBody.value : formattedResult.value
|
|
|
- copyArea.select()
|
|
|
- document.execCommand('Copy')
|
|
|
+const recoveriableInfnos = ['2207', '2208', '2401', '2304', '2305']
|
|
|
+const showRecoveryTrade = (infno) => {
|
|
|
+ return recoveryTradePermission() && recoveriableInfnos.indexOf(infno) !== -1
|
|
|
+}
|
|
|
+
|
|
|
+const recoveryTrade = (row) => {
|
|
|
+ ElMessageBox.confirm('冲正将取消医保中心接收到的本次交易,请慎重使用!', '警告', {
|
|
|
+ type: 'warning',
|
|
|
+ }).then(() => {
|
|
|
+ const params = {
|
|
|
+ psnNo: row.psnNo,
|
|
|
+ omsgid: row.msgid,
|
|
|
+ oinfno: row.infno,
|
|
|
+ }
|
|
|
+ autoRecoveryTrade(params).then((res) => {
|
|
|
ElMessage({
|
|
|
- message: '复制成功',
|
|
|
type: 'success',
|
|
|
+ message: res,
|
|
|
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,
|
|
|
- dateRange,
|
|
|
- formattedStyle,
|
|
|
- formattedChildStyle,
|
|
|
- preStyle,
|
|
|
- leftPreCopyStyle,
|
|
|
- infnos,
|
|
|
- currentInfnos,
|
|
|
- headerParam,
|
|
|
- setlShtcuts,
|
|
|
- tipMessage,
|
|
|
- logs,
|
|
|
- showFormatModal,
|
|
|
- formattedBody,
|
|
|
- formattedResult,
|
|
|
- fetchSiLogs,
|
|
|
- totalSize,
|
|
|
- formatBodyResult,
|
|
|
- handleCurrentChange,
|
|
|
- handleSizeChange,
|
|
|
- coloredResult,
|
|
|
- tableRowClassName,
|
|
|
- exportBodyResultTxt,
|
|
|
- copyLogBodyResult,
|
|
|
- }
|
|
|
- },
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|