lighter 3 years ago
parent
commit
929ffdee0a

+ 32 - 26
src/api/medical-insurance/si-manage.js

@@ -1,43 +1,49 @@
 import request from '../../utils/request'
 
 export function selectSetlinfos(data) {
-    return request({
-        url: '/siManage/selectSetlinfos',
-        method: 'post',
-        data,
-    })
+  return request({
+    url: '/siManage/selectSetlinfos',
+    method: 'post',
+    data,
+  })
 }
 
 export function institutionSettlementLedgerCheck(data) {
-    return request({
-        url: '/siManage/institutionSettlementLedgerCheck',
-        method: 'post',
-        data,
-    })
+  return request({
+    url: '/siManage/institutionSettlementLedgerCheck',
+    method: 'post',
+    data,
+  })
 }
 
 export function institutionSettlementDetailCheck(data) {
-    return request({
-        url: '/siManage/institutionSettlementDetailCheck',
-        method: 'post',
-        data,
-    })
+  return request({
+    url: '/siManage/institutionSettlementDetailCheck',
+    method: 'post',
+    data,
+  })
 }
 
 export function uploadCatalogueContrast(data) {
-    return request({
-        url: '/siManage/uploadCatalogueContrast',
-        method: 'post',
-        data,
-    })
+  return request({
+    url: '/siManage/uploadCatalogueContrast',
+    method: 'post',
+    data,
+  })
 }
 
 export function revokeCatalogueContrast(data) {
-    return request({
-        url: '/siManage/revokeCatalogueContrast',
-        method: 'post',
-        data,
-    })
+  return request({
+    url: '/siManage/revokeCatalogueContrast',
+    method: 'post',
+    data,
+  })
 }
 
-
+export function autoRecoveryTrade(data) {
+  return request({
+    url: '/siManage/autoRecoveryTrade',
+    method: 'post',
+    data,
+  })
+}

+ 8 - 0
src/utils/permission.js

@@ -37,3 +37,11 @@ export function isInpatientStaff() {
   }
   return false
 }
+
+export function recoveryTradePermission() {
+  const roles = store.state.user.info.roles
+  if (roles) {
+    return roles.indexOf(41) > -1
+  }
+  return false
+}

+ 139 - 143
src/views/medical-insurance/allpatient/LogAnalyse.vue

@@ -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>
 

+ 40 - 40
src/views/medical-insurance/inpatient/AdmRegistration.vue

@@ -459,8 +459,6 @@ export default {
             duration: 2500,
             showClose: true,
           })
-          const overview = clone(store.state.ptnt.overview)
-          patient.value.statusFlag = overview.status = '1'
         })
       })
     }
@@ -518,45 +516,47 @@ export default {
       if (nullPatient()) {
         return
       }
-      submitPatientInfo()
-      checkRegisterDate(patient.value.inpatientNo, patient.value.admissTimes).then(() => {
-        selectAdmissApply(patient.value).then((res) => {
-          if (null === res.status) {
-            admissApply.value.patNo = patient.value.inpatientNo
-            admissApply.value.times = patient.value.admissTimes
-            admissApply.value.ledgerSn = patient.value.ledgerSn
-            admissApply.value.admissDatetime = patient.value.ybRegisterDate
-            admissApply.value.inputComment = '人证相符。'
-            showAdmissApplyForm.value = true
-          } else {
-            switch (res.status) {
-              case 0:
-                ElMessageBox.alert('医保科尚未处理此患者的医保入院申请,请耐心等候或者致电医保科(内线电话:2102)。', '提示', {
-                  type: 'warning',
-                })
-                break
-              case 1:
-                getPsnInsuinfo()
-                break
-              case 2:
-                ElMessageBox.confirm('医保科驳回了此患者的医保入院申请,驳回意见为【' + res.handleComment + '】', '提示', {
-                  type: 'error',
-                  distinguishCancelAndClose: true,
-                  confirmButtonText: '我知道了',
-                  cancelButtonText: '重新提交',
-                  showCancelButton: true,
-                }).catch((action) => {
-                  if (action === 'cancel') {
-                    admissApply.value.patNo = patient.value.inpatientNo
-                    admissApply.value.times = patient.value.admissTimes
-                    admissApply.value.ledgerSn = patient.value.ledgerSn
-                    admissApply.value.admissDatetime = patient.value.ybRegisterDate
-                    showAdmissApplyForm.value = true
-                  }
-                })
-                break
+
+      submitSiPatientInfo({ patient: patient.value, diags: zyInYbDiags.value }).then(() => {
+        checkRegisterDate(patient.value.inpatientNo, patient.value.admissTimes).then(() => {
+          selectAdmissApply(patient.value).then((res) => {
+            if (null === res.status) {
+              admissApply.value.patNo = patient.value.inpatientNo
+              admissApply.value.times = patient.value.admissTimes
+              admissApply.value.ledgerSn = patient.value.ledgerSn
+              admissApply.value.admissDatetime = patient.value.ybRegisterDate
+              admissApply.value.inputComment = '人证相符。'
+              showAdmissApplyForm.value = true
+            } else {
+              switch (res.status) {
+                case 0:
+                  ElMessageBox.alert('医保科尚未处理此患者的医保入院申请,请耐心等候或者致电医保科(内线电话:2102)。', '提示', {
+                    type: 'warning',
+                  })
+                  break
+                case 1:
+                  getPsnInsuinfo()
+                  break
+                case 2:
+                  ElMessageBox.confirm('医保科驳回了此患者的医保入院申请,驳回意见为【' + res.handleComment + '】', '提示', {
+                    type: 'error',
+                    distinguishCancelAndClose: true,
+                    confirmButtonText: '我知道了',
+                    cancelButtonText: '重新提交',
+                    showCancelButton: true,
+                  }).catch((action) => {
+                    if (action === 'cancel') {
+                      admissApply.value.patNo = patient.value.inpatientNo
+                      admissApply.value.times = patient.value.admissTimes
+                      admissApply.value.ledgerSn = patient.value.ledgerSn
+                      admissApply.value.admissDatetime = patient.value.ybRegisterDate
+                      showAdmissApplyForm.value = true
+                    }
+                  })
+                  break
+              }
             }
-          }
+          })
         })
       })
     }