|
@@ -78,49 +78,49 @@
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
-<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, ElMessageBox } from 'element-plus'
|
|
|
-const store = useStore()
|
|
|
-const windowSize = store.state.app.windowSize
|
|
|
-const tableHeight = windowSize.h - 85
|
|
|
-const dateRange = ref(null)
|
|
|
+<script setup name="LogAnalyse">
|
|
|
+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, 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 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 leftPreCopyStyle = {
|
|
|
position: 'absolute',
|
|
|
top: '20px',
|
|
|
left: drawerWidth / 2 - 100 + 'px',
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const currentInfnos = computed(() => {
|
|
|
- return infnos[headerParam.logType]
|
|
|
-})
|
|
|
+ return infnos[headerParam.logType];
|
|
|
+});
|
|
|
|
|
|
const headerParam = reactive({
|
|
|
begntime: null,
|
|
@@ -131,93 +131,93 @@ const headerParam = reactive({
|
|
|
needCalTips: null,
|
|
|
pageSize: 30,
|
|
|
currentPage: 1,
|
|
|
-})
|
|
|
-const tipMessage = ref(null)
|
|
|
-const logs = ref([])
|
|
|
+});
|
|
|
+const tipMessage = ref(null);
|
|
|
+const logs = ref([]);
|
|
|
const handleSizeChange = (val) => {
|
|
|
- headerParam.pageSize = val
|
|
|
- fetchSiLogs(false)
|
|
|
-}
|
|
|
+ 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)
|
|
|
+ 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
|
|
|
- })
|
|
|
-}
|
|
|
+ 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
|
|
|
+ headerParam.needCalTips = needCalTips;
|
|
|
if (dateRange.value) {
|
|
|
- const dtrge = getDateRangeFormatDate(dateRange.value)
|
|
|
- headerParam.begntime = dtrge.startTime
|
|
|
- headerParam.endtime = dtrge.endTime
|
|
|
+ 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
|
|
|
+ logs.value = res.list;
|
|
|
+ totalSize.value = res.total;
|
|
|
if (needCalTips) {
|
|
|
- tipMessage.value = res.tipMessage
|
|
|
+ tipMessage.value = res.tipMessage;
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- logs.value = []
|
|
|
- totalSize.value = 0
|
|
|
- tipMessage.value = null
|
|
|
- })
|
|
|
-}
|
|
|
+ logs.value = [];
|
|
|
+ totalSize.value = 0;
|
|
|
+ tipMessage.value = null;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const tableRowClassName = ({ row }) => {
|
|
|
if (row.infcode === 0) {
|
|
|
- return 'success-row'
|
|
|
+ return 'success-row';
|
|
|
}
|
|
|
- return 'danger-row'
|
|
|
-}
|
|
|
+ return 'danger-row';
|
|
|
+};
|
|
|
|
|
|
const coloredResult = (infcode) => {
|
|
|
- return infcode === 0 ? '<span style="color: green">成功</span>' : '<span style="color: red">失败</span>'
|
|
|
-}
|
|
|
+ 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')
|
|
|
+ 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)
|
|
|
- })
|
|
|
-}
|
|
|
+ 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 recoveriableInfnos = ['2207', '2208', '2401', '2304', '2305']
|
|
|
+const recoveriableInfnos = ['2207', '2208', '2401', '2304', '2305'];
|
|
|
const showRecoveryTrade = (infno) => {
|
|
|
- return recoveryTradePermission() && recoveriableInfnos.indexOf(infno) !== -1
|
|
|
-}
|
|
|
+ return recoveryTradePermission() && recoveriableInfnos.indexOf(infno) !== -1;
|
|
|
+};
|
|
|
|
|
|
const recoveryTrade = (row) => {
|
|
|
ElMessageBox.confirm('冲正将取消医保中心接收到的本次交易,请慎重使用!', '警告', {
|
|
@@ -227,17 +227,17 @@ const recoveryTrade = (row) => {
|
|
|
psnNo: row.psnNo,
|
|
|
omsgid: row.msgid,
|
|
|
oinfno: row.infno,
|
|
|
- }
|
|
|
+ };
|
|
|
autoRecoveryTrade(params).then((res) => {
|
|
|
ElMessage({
|
|
|
type: 'success',
|
|
|
message: res,
|
|
|
duration: 2500,
|
|
|
showClose: true,
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|