Browse Source

医保科可以做结算和取消结算

lighter 3 years ago
parent
commit
6c8220bf72
1 changed files with 64 additions and 9 deletions
  1. 64 9
      src/views/medical-insurance/outpatient/MzRegister.vue

+ 64 - 9
src/views/medical-insurance/outpatient/MzRegister.vue

@@ -35,13 +35,23 @@
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      <el-button type="primary" icon="el-icon-edit-outline" @click="mzPreSetl" style="margin-left: 8px"> 试算 </el-button>
+
+      <el-dropdown trigger="click" @command="settlement" style="margin-left: 8px">
+        <el-button type="primary">结算<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
+        <template #dropdown>
+          <el-dropdown-menu>
+            <el-dropdown-item icon="el-icon-edit-outline" command="preSettlement">试算</el-dropdown-item>
+            <el-dropdown-item icon="el-icon-edit-outline" command="realSettlement">结算</el-dropdown-item>
+            <el-dropdown-item divided icon="el-icon-refresh-left" command="cancelSettlement">取消结算</el-dropdown-item>
+          </el-dropdown-menu>
+        </template>
+      </el-dropdown>
       <el-button type="danger" icon="el-icon-refresh" @click="clearinfo" style="margin-left: 8px"> 重置 </el-button>
     </el-header>
     <el-main>
       <el-row :gutter="5">
         <el-col :span="2">
-          <el-table ref="timesTable" :data="data" highlight-current-row :height="tableHeight" @row-click="clickTimes">
+          <el-table ref="timesTable" :data="unPaidReceipts" highlight-current-row :height="tableHeight" @row-click="clickTimes">
             <el-table-column label="就诊次数">
               <template #default="scope"> 第 {{ scope.row.times }} 次 </template>
             </el-table-column>
@@ -217,6 +227,8 @@ import {
   revokeOutpatientRegistration,
   uploadOutpatientFeeDetails,
   saveSiMzDiags,
+  outpatientSettlement,
+  revokeOutpatientSettlement,
 } from '@/api/medical-insurance/si-outpatient'
 import { cptInsutype, cptPersType, cptYbState } from '@/utils/computed'
 import { ElMessage, ElMessageBox } from 'element-plus'
@@ -238,7 +250,7 @@ export default {
       overflowY: 'auto',
     }
 
-    const data = ref([])
+    const unPaidReceipts = ref([])
     const showInsuinfo = ref(false)
     const psnBaseinfo = ref({})
     const mzVisit = ref({})
@@ -460,15 +472,14 @@ export default {
     const fetchReceipts = (param) => {
       getMzReceipts(param)
         .then((res) => {
-          console.log(res)
-          data.value = res
+          unPaidReceipts.value = res
           setTimeout(() => {
             timesTable.value.setCurrentRow(res[0])
             clickTimes(res[0])
           }, 100)
         })
         .catch(() => {
-          data.value = []
+          unPaidReceipts.value = []
           orderNos.value = []
           currentReceipts.value = []
         })
@@ -596,6 +607,23 @@ export default {
         .catch(() => {})
     }
 
+    const settlement = (command) => {
+      if (nullPatientId() || nullTimes()) {
+        return
+      }
+      switch (command) {
+        case 'preSettlement':
+          mzPreSetl()
+          break
+        case 'realSettlement':
+          mzSettle()
+          break
+        case 'cancelSettlement':
+          revokeMzSettle()
+          break
+      }
+    }
+
     const mzPreSetl = () => {
       const param = {
         staffId: store.state.user.info.code,
@@ -611,10 +639,37 @@ export default {
       })
     }
 
+    const mzSettle = () => {
+      const param = {
+        patNo: patientId.value,
+        times: times.value,
+      }
+      outpatientSettlement(param).then((res) => {
+        const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
+        ElMessageBox.alert(message, '结算成功', {
+          type: 'success',
+          showCancelButton: false,
+        }).then(() => {})
+      })
+    }
+
+    const revokeMzSettle = () => {
+      const param = {
+        patNo: patientId.value,
+        times: times.value,
+      }
+      revokeOutpatientSettlement(param).then((res) => {
+        ElMessageBox.alert(res, '取消结算成功', {
+          type: 'success',
+          showCancelButton: false,
+        })
+      })
+    }
+
     const clearinfo = () => {
       patientId.value = ''
       times.value = null
-      data.value = []
+      unPaidReceipts.value = []
       psnBaseinfo.value = {}
       mzVisit.value = {}
       receipts.value = {}
@@ -651,7 +706,7 @@ export default {
       totalFee,
       ordersTable,
       timesTable,
-      data,
+      unPaidReceipts,
       spcChrDiseAccts,
       showSpcChrAccts,
       matnDises,
@@ -667,7 +722,6 @@ export default {
       saveDiag,
       searchDiag,
       handleSelectDiag,
-      mzPreSetl,
       clickTimes,
       colorStatus,
       clickOrderNo,
@@ -678,6 +732,7 @@ export default {
       unmarkMzFees,
       registor,
       receiptsOpts,
+      settlement,
     }
   },
 }