Browse Source

结算单上传

xiaochan 3 years ago
parent
commit
384becaf12

+ 0 - 1
src/components/inpatient/WeiGuiFeiYongFenXi.vue

@@ -387,7 +387,6 @@ export default {
         deptCode = huanZheXinXi.value.deptCode
       }
       weiGuiFeiYongFenXi(huanZheXinXi.value.inpatientNo, deptCode).then((res) => {
-        console.log(res)
         huanZheXinXi.value.inpatientNo = res.inpatientNo
         huanZheXinXi.value.admissTimes = res.admissTimes
         huanZheXinXi.value.name = res.name

+ 78 - 75
src/utils/websocket.js

@@ -1,98 +1,101 @@
-import { ElMessageBox, ElNotification } from 'element-plus'
+import {ElMessageBox, ElNotification} from 'element-plus'
 import Cookies from 'js-cookie'
 import router from '@/router'
 import store from '@/store'
+
 const socketUrl = import.meta.env.VITE_SOCKET_URL
 
 let webSocket = null
 let globalCallback = null
 
 export function closeWebSocket() {
-  Cookies.remove('sid')
-  if (webSocket !== null) {
-    webSocket.close()
-    webSocket = null
-  }
+    Cookies.remove('sid')
+    if (webSocket !== null) {
+        webSocket.close()
+        webSocket = null
+    }
 }
 
 export function setCallback(callback) {
-  if (callback !== null) {
-    globalCallback = callback
-    console.log('global callback settled.')
-  }
+    if (callback !== null) {
+        globalCallback = callback
+        console.log('global callback settled.')
+    }
 }
 
 export function initWebSocket(sid) {
-  if ('WebSocket' in window) {
-    if (webSocket === null) {
-      const url = socketUrl + sid
-      webSocket = new WebSocket(url)
+    if ('WebSocket' in window) {
+        if (webSocket === null) {
+            const url = socketUrl + sid
+            webSocket = new WebSocket(url)
+        }
+    } else {
+        alert('该浏览器不支持websocket!')
+        webSocket = 'unsupport'
     }
-  } else {
-    alert('该浏览器不支持websocket!')
-    webSocket = 'unsupport'
-  }
-
-  webSocket.onopen = function () {
-    console.log('WebSocket连接成功')
-  }
 
-  webSocket.onmessage = function (e) {
-    let data = JSON.parse(e.data)
-    if (data.name === 'refreshToken') {
-      store.commit('user/tokenChange', data.token)
-    } else if (data.name === 'systemNotification') {
-      ElNotification({
-        title: typeof data.title === 'undefined' ? '新消息' : data.title,
-        message: data.message,
-        dangerouslyUseHTMLString: true,
-        type: typeof data.type === 'undefined' ? 'warning' : data.type,
-        duration: 0,
-      })
-      if (data.refreshDelay) {
-        setTimeout(() => {
-          location.reload()
-        }, data.refreshDelay)
-      }
-      if (null !== globalCallback) {
-        globalCallback(data)
-      }
-    } else {
-      if (null !== globalCallback) {
-        globalCallback(data)
-      }
+    webSocket.onopen = function () {
+        console.log('WebSocket连接成功')
     }
-  }
 
-  webSocket.onclose = function () {
-    webSocket = null
-    let sid
-    if (router.currentRoute.value.path === '/triageRoomScreen') {
-      sid = Cookies.get('room-screen-sid')
-    } else {
-      sid = store.getters['user/sid']
+    webSocket.onmessage = function (e) {
+        let data = JSON.parse(e.data)
+        if (data.name === 'refreshToken') {
+            store.commit('user/tokenChange', data.token)
+        } else if (data.name === 'systemNotification') {
+            ElNotification({
+                title: typeof data.title === 'undefined' ? '新消息' : data.title,
+                message: data.message,
+                dangerouslyUseHTMLString: true,
+                type: typeof data.type === 'undefined' ? 'warning' : data.type,
+                duration: 0,
+            })
+            if (data.refreshDelay) {
+                setTimeout(() => {
+                    location.reload()
+                }, data.refreshDelay)
+            }
+            if (null !== globalCallback) {
+                globalCallback(data)
+            }
+        } else if (data.name === 'upldSetlListMessage') {
+            console.log("医保结算单上传的错误信息", data)
+        } else {
+            if (null !== globalCallback) {
+                globalCallback(data)
+            }
+        }
     }
-    if (!sid) {
-      if (router.currentRoute.value.path === '/login') {
-        return
-      }
-      ElMessageBox.confirm('未检测到WebSocket连接的sid,请重新登录。', '提示', {
-        showCancelButton: false,
-        type: 'warning',
-      }).then(() => {
-        router.push('/login')
-      })
-    } else {
-      if (router.currentRoute.value.path === '/triageFloorScreen') {
-        sid += '-triageFloorScreen'
-      }
-      setTimeout(() => {
-        initWebSocket(sid)
-      }, 3000)
+
+    webSocket.onclose = function () {
+        webSocket = null
+        let sid
+        if (router.currentRoute.value.path === '/triageRoomScreen') {
+            sid = Cookies.get('room-screen-sid')
+        } else {
+            sid = store.getters['user/sid']
+        }
+        if (!sid) {
+            if (router.currentRoute.value.path === '/login') {
+                return
+            }
+            ElMessageBox.confirm('未检测到WebSocket连接的sid,请重新登录。', '提示', {
+                showCancelButton: false,
+                type: 'warning',
+            }).then(() => {
+                router.push('/login')
+            })
+        } else {
+            if (router.currentRoute.value.path === '/triageFloorScreen') {
+                sid += '-triageFloorScreen'
+            }
+            setTimeout(() => {
+                initWebSocket(sid)
+            }, 3000)
+        }
     }
-  }
 
-  webSocket.onerror = function () {
-    console.error('WebSocket连接发生错误')
-  }
+    webSocket.onerror = function () {
+        console.error('WebSocket连接发生错误')
+    }
 }

+ 29 - 23
src/views/medical-insurance/allpatient/SetlInfo.vue

@@ -5,18 +5,19 @@
         <el-option v-for="item in clrTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
       </el-select>
       <el-date-picker
-        v-model="dateRange"
-        type="daterange"
-        :shortcuts="setlShtcuts"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        style="width: 220px"
+          v-model="dateRange"
+          type="daterange"
+          :shortcuts="setlShtcuts"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          style="width: 220px"
       ></el-date-picker>
       <el-select v-model="slctSetlPrm.insutype" placeholder="险种类型" filterable clearable>
         <el-option v-for="item in insutypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
       </el-select>
-      <el-select v-model="slctSetlPrm.clrOptins" placeholder="清算机构" filterable clearable :disabled="setlinfos.length === 0">
+      <el-select v-model="slctSetlPrm.clrOptins" placeholder="清算机构" filterable clearable
+                 :disabled="setlinfos.length === 0">
         <el-option v-for="item in optins" :key="item.code" :value="item.code" :label="item.name"></el-option>
       </el-select>
       <el-divider direction="vertical"></el-divider>
@@ -61,13 +62,18 @@
 </template>
 
 <script>
-import { computed, onMounted, reactive, ref } from '@vue/runtime-core'
+import {computed, onMounted, reactive, ref} from '@vue/runtime-core'
 import store from '@/store'
-import { getClrTypes, getInsutypes } from '@/api/medical-insurance/si-dict'
-import { setlShtcuts } from '@/data/shortcuts'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { institutionSettlementDetailCheck, institutionSettlementLedgerCheck, selectSetlinfos } from '@/api/medical-insurance/si-manage'
-import { formatDate } from '@/utils/date'
+import {getClrTypes, getInsutypes} from '@/api/medical-insurance/si-dict'
+import {setlShtcuts} from '@/data/shortcuts'
+import {ElMessage, ElMessageBox} from 'element-plus'
+import {
+  institutionSettlementDetailCheck,
+  institutionSettlementLedgerCheck,
+  selectSetlinfos
+} from '@/api/medical-insurance/si-manage'
+import {formatDate} from '@/utils/date'
+
 export default {
   setup() {
     const windowSize = store.state.app.windowSize
@@ -121,14 +127,14 @@ export default {
       slctSetlPrm.begndate = formatDate(dateRange.value[0])
       slctSetlPrm.enddate = formatDate(dateRange.value[1])
       selectSetlinfos(slctSetlPrm)
-        .then((res) => {
-          setlinfos.value = res.list
-          optins.value = res.optins
-        })
-        .catch(() => {
-          setlinfos.value = []
-          optins.value = []
-        })
+          .then((res) => {
+            setlinfos.value = res.list
+            optins.value = res.optins
+          })
+          .catch(() => {
+            setlinfos.value = []
+            optins.value = []
+          })
     }
 
     const bfrChkSetl = () => {
@@ -266,6 +272,6 @@ function calSumamt(list) {
   fundSum = fundSum.toFixed(2)
   acctSum = acctSum.toFixed(2)
   psnCashPay = psnCashPay.toFixed(2)
-  return { medSum, fundSum, acctSum, psnCashPay }
+  return {medSum, fundSum, acctSum, psnCashPay}
 }
 </script>