Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

xiaochan 3 years ago
parent
commit
92ba4c5d97

+ 102 - 0
src/components/medical-insurance/readcard/Index.vue

@@ -0,0 +1,102 @@
+<template>
+  <el-dropdown style="margin: 0 10px" trigger="click" @command="beforeReadCard">
+    <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-bank-card" command="sicard">社保卡</el-dropdown-item>
+        <el-dropdown-item icon="el-icon-s-grid" command="qrcode">二维码</el-dropdown-item>
+        <el-dropdown-item icon="el-icon-user" command="idcard">身份证</el-dropdown-item>
+      </el-dropdown-menu>
+    </template>
+  </el-dropdown>
+  <span class="readcard">
+    <el-dialog v-model="showSelectBiztype" title="请选择读卡业务" width="300px">
+      <el-radio-group v-model="currentBiztype">
+        <el-radio label="01101">门诊挂号</el-radio>
+        <el-radio label="01301">门诊结算</el-radio>
+      </el-radio-group>
+      <template #footer>
+        <el-button type="primary" @click="handleConfirmBiztype">确定</el-button>
+      </template>
+    </el-dialog>
+  </span>
+</template>
+
+<script>
+import { readCardCallback } from '@/api/medical-insurance/si-inpatient'
+import { ElMessage, ElMessageBox } from 'element-plus'
+export default {
+  props: {
+    patNo: {
+      type: String,
+      default: null,
+    },
+    biztype: {
+      type: String,
+      default: null,
+    },
+  },
+  emits: ['success'],
+  setup(props, ctx) {
+    const showSelectBiztype = ref(false)
+    const currentCardtype = ref(null)
+    const currentBiztype = ref(null)
+    const beforeReadCard = (cardtype) => {
+      if (!props.patNo) {
+        ElMessage({
+          message: '请先选择患者',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+      if (props.biztype) {
+        executeReadCard(cardtype)
+      } else {
+        currentCardtype.value = cardtype
+        showSelectBiztype.value = true
+      }
+    }
+
+    const handleConfirmBiztype = () => {
+      if (!currentBiztype.value) {
+        ElMessage({
+          message: '请选择读卡业务!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+      showSelectBiztype.value = false
+      executeReadCard(currentCardtype.value)
+    }
+
+    const executeReadCard = (cardtype) => {
+      const nowbiztype = props.biztype || currentBiztype.value
+      const param = `${cardtype}_${props.patNo}_${nowbiztype}`
+      window.open(`ReadCard://${param}`, '_self')
+      readCardCallback(param).then((res) => {
+        const result = {
+          mdtrtCertType: cardtype,
+          readCardResult: res.data,
+          readCardBizType: nowbiztype,
+        }
+        ctx.emit('success', result)
+        ElMessageBox.alert(res.message, '提示', {
+          type: 'success',
+          showCancelButton: false,
+        }).then(() => {})
+      })
+    }
+
+    return {
+      currentBiztype,
+      showSelectBiztype,
+      beforeReadCard,
+      handleConfirmBiztype,
+    }
+  },
+}
+</script>

+ 0 - 13
src/utils/readcard.js

@@ -1,13 +0,0 @@
-import { ElMessageBox } from 'element-plus'
-import { readCardCallback } from '../api/medical-insurance/si-inpatient'
-
-export function prepareReadCard(type, inpatientNo, biztype) {
-  const param = type + '_' + inpatientNo + '_' + biztype
-  window.open(`ReadCard://${param}`, '_self')
-  readCardCallback(param).then((res) => {
-    ElMessageBox.alert(res.message, '提示', {
-      type: 'success',
-      showCancelButton: false,
-    }).then(() => {})
-  })
-}

+ 8 - 8
src/views/examination/MixLabelPrinter.vue

@@ -203,14 +203,14 @@ const drawQrcoce = (label) => {
 }
 
 const lodopPrint = (label) => {
-  // const LODOP = getLodop()
-  // LODOP.PRINT_INIT('labels')
-  // LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', 'CreateCustomPage')
-  // LODOP.SET_PRINT_STYLE('Bold', 1)
-  // LODOP.ADD_PRINT_TEXT('8mm', '3mm', '32mm', '5mm', '泰和医院20人混采')
-  // LODOP.ADD_PRINT_BARCODE('14mm', '3mm', '32mm', '10mm', '128Auto', label)
-  // LODOP.ADD_PRINT_BARCODE('10mm', '35mm', '17mm', '17mm', 'QRCode', label)
-  // LODOP.PRINT()
+  const LODOP = getLodop()
+  LODOP.PRINT_INIT('labels')
+  LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', 'CreateCustomPage')
+  LODOP.SET_PRINT_STYLE('Bold', 1)
+  LODOP.ADD_PRINT_TEXT('8mm', '3mm', '32mm', '5mm', '泰和医院20人混采')
+  LODOP.ADD_PRINT_BARCODE('14mm', '3mm', '32mm', '10mm', '128Auto', label)
+  LODOP.ADD_PRINT_BARCODE('10mm', '35mm', '17mm', '17mm', 'QRCode', label)
+  LODOP.PRINT()
 }
 
 onMounted(() => {

+ 35 - 15
src/views/hospitalization/case-front-sheet/AllCaseFrontSheet.vue

@@ -7,7 +7,7 @@
         range-separator="至"
         start-placeholder="开始日期"
         end-placeholder="结束日期"
-        :shortcuts="shortcuts"
+        :shortcuts="maxHalfYear"
         style="width: 260px"
       ></el-date-picker>
       <el-select v-model="overviewParam.ward" style="width: 130px" placeholder="请选择科室" filterable clearable>
@@ -35,6 +35,7 @@
             <el-dropdown-item icon="el-icon-printer" command="unSign">解除签收</el-dropdown-item>
             <el-dropdown-item icon="el-icon-printer" command="dismissCount" divided>出院患者统计</el-dropdown-item>
             <el-dropdown-item icon="el-icon-printer" command="exportLateData">导出迟交病案</el-dropdown-item>
+            <el-dropdown-item icon="el-icon-printer" command="exportUnsignedData">导出未签收病案</el-dropdown-item>
             <el-dropdown-item icon="el-icon-printer" command="print1" divided>打印正面</el-dropdown-item>
             <el-dropdown-item icon="el-icon-printer" command="print2">打印反面</el-dropdown-item>
           </el-dropdown-menu>
@@ -232,7 +233,7 @@ import {
 import maleIcon from '@/assets/male-icon.png'
 import femaleIcon from '@/assets/female-icon.png'
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { shortcuts } from '@/data/shortcuts'
+import { maxHalfYear } from '@/data/shortcuts'
 import { formatDate, getOneMonthOffset } from '@/utils/date'
 import { initLodop, getLodop } from '@/utils/c-lodop'
 import { formatMonth } from '@/utils/date'
@@ -267,11 +268,13 @@ const overviewParam = reactive({
   bah: '',
 })
 const isLateDataMode = $ref(false)
+const isUnsignedMode = $ref(false)
 const searchPatient = () => {
   overviewParam.start = formatDate(dateRange[0])
   overviewParam.end = formatDate(dateRange[1])
   basOutPatients(overviewParam).then((res) => {
     isLateDataMode = overviewParam.lateFlag === '1'
+    isUnsignedMode = overviewParam.fileStatus === '0'
     overview = res.list
     if (res.list.length === 1) {
       fetchSheetInfo(res.list[0])
@@ -407,7 +410,10 @@ const handleCommand = (val) => {
       showDismissCount = true
       break
     case 'exportLateData':
-      exportLateDataExel()
+      exportSpecialDataExel(1)
+      break
+    case 'exportUnsignedData':
+      exportSpecialDataExel(2)
       break
     case 'print1':
       beforePrint(1)
@@ -421,15 +427,27 @@ const handleCommand = (val) => {
   }
 }
 
-const exportLateDataExel = () => {
-  if (!isLateDataMode) {
-    ElMessage({
-      message: '请先查询迟交病案。',
-      type: 'warning',
-      duration: 2500,
-      showClose: true,
-    })
-    return
+const exportSpecialDataExel = (flag) => {
+  if (flag === 1) {
+    if (!isLateDataMode) {
+      ElMessage({
+        message: '请先查询迟交病案。',
+        type: 'warning',
+        duration: 2500,
+        showClose: true,
+      })
+      return
+    }
+  } else {
+    if (!isUnsignedMode) {
+      ElMessage({
+        message: '请先查询未签收病案。',
+        type: 'warning',
+        duration: 2500,
+        showClose: true,
+      })
+      return
+    }
   }
   if (overview.length === 0) {
     ElMessage({
@@ -450,10 +468,12 @@ const exportLateDataExel = () => {
     disDate: '出院时间',
     deptName: '出院科室',
     doctorName: '管床医生',
-    lateDays: '迟交天数',
-    signDate: '签收日期',
   }
-  Export(overview, fields, '迟交病案')
+  if (flag === 1) {
+    fields.lateDays = '迟交天数'
+    fields.signDate = '签收日期'
+  }
+  Export(overview, fields, flag === 1 ? '迟交病案' : '未签收病案')
 }
 
 const searchMethod = $ref('alpha')

+ 9 - 28
src/views/medical-insurance/inpatient/AdmRegistration.vue

@@ -3,17 +3,7 @@
     <el-header height="35px">
       <el-button type="primary" icon="el-icon-location" @click="beforeFetchAssigninfo">定点信息</el-button>
       <el-button type="primary" icon="el-icon-check" @click="submitPatientInfo"> 保存 </el-button>
-      <el-dropdown style="margin-left: 10px" trigger="click" @command="beforeReadCard">
-        <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-bank-card" command="sicard">社保卡</el-dropdown-item>
-            <el-dropdown-item icon="el-icon-s-grid" command="qrcode">二维码</el-dropdown-item>
-            <el-dropdown-item icon="el-icon-user" command="idcard">身份证</el-dropdown-item>
-          </el-dropdown-menu>
-        </template>
-      </el-dropdown>
-      &nbsp;
+      <ReadCard :pat-no="patient.inpatientNo" biztype="01103" @success="afterReadCard" />
       <el-button type="success" icon="el-icon-top" @click="checkRegisterDatetime">医保入院登记</el-button>
       <el-button type="danger" icon="el-icon-bottom" @click="beforeCancelRegister">撤销入院登记</el-button>
       <el-button type="success" icon="el-icon-s-claim" @click="xiangMuLuRuRouter">项目录入</el-button>
@@ -252,7 +242,7 @@ import { cptSex } from '@/utils/computed'
 import { sexes, admdvs, diagTypes } from '@/data/index'
 import { nullPatient } from '@/utils/validate'
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { admissRegister, revokeAdmission, readCardCallback } from '@/api/medical-insurance/si-inpatient'
+import { admissRegister, revokeAdmission } from '@/api/medical-insurance/si-inpatient'
 import { formatDatetime, getDatetime } from '@/utils/date'
 import { getGreatestRole } from '@/utils/permission'
 import { clone } from '@/utils/clone'
@@ -265,12 +255,14 @@ import Xmlr from '@/components/inpatient/XiangMuLuRu.vue'
 import YiZhuTuiFei from '@/components/inpatient/YiZhuTuiFei.vue'
 import Assignmentinfo from '@/components/medical-insurance/assigninfo/Index.vue'
 import Search from '@/components/search/Index.vue'
+import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 export default {
   components: {
     Search,
     Xmlr,
     YiZhuTuiFei,
     Assignmentinfo,
+    ReadCard,
   },
   setup() {
     const greatestRole = getGreatestRole()
@@ -489,21 +481,10 @@ export default {
       return store.state.ptnt.injuryMode
     })
 
-    const beforeReadCard = (val) => {
-      if (nullPatient()) {
-        return
-      }
-      const param = val + '_' + patient.value.inpatientNo + '_01103'
-      window.open(`ReadCard://${param}`, '_self')
-      readCardCallback(param).then((res) => {
-        patient.value.mdtrtCertType = val
-        patient.value.readCardResult = res.data
-        patient.value.readCardBizType = '01103'
-        ElMessageBox.alert(res.message, '提示', {
-          type: 'success',
-          showCancelButton: false,
-        }).then(() => {})
-      })
+    const afterReadCard = (result) => {
+      patient.value.mdtrtCertType = result.mdtrtCertType
+      patient.value.readCardResult = result.readCardResult
+      patient.value.readCardBizType = result.readCardBizType
     }
 
     const formatYbRegisterDate = () => {
@@ -813,7 +794,7 @@ export default {
       handleClickSearchItem,
       getDiagTypeName,
       submitPatientInfo,
-      beforeReadCard,
+      afterReadCard,
       checkRegisterDatetime,
       handleClickInjuryinfo,
       handleClickInsuinfo,

+ 10 - 0
src/views/medical-insurance/inpatient/AdmissVerification.vue

@@ -12,6 +12,7 @@
       </el-select>
       <el-button style="margin-left: 10px" type="primary" icon="el-icon-tickets" @click="getPsnInsuinfo(1)">待遇检查</el-button>
       <el-button type="primary" icon="el-icon-user" @click="checkIdCard">身份信息</el-button>
+      <ReadCard :pat-no="patient.inpatientNo" biztype="01103" @success="afterReadCard" />
       <el-button type="success" icon="el-icon-check" @click="beforeHandleApply(true)">审核通过</el-button>
       <el-button type="danger" icon="el-icon-close" @click="beforeHandleApply(false)">审核不通过</el-button>
       <el-button type="primary" icon="el-icon-document" @click="getRegInfo">登记信息</el-button>
@@ -165,12 +166,14 @@ import Insuinfo from '../../../components/medical-insurance/insuinfo/Index.vue'
 import Treatmentinfo from '../../../components/medical-insurance/treatmentinfo/Index.vue'
 import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
 import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
+import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 export default {
   components: {
     Insuinfo,
     Treatmentinfo,
     IdentifyImage,
     Registinfo,
+    ReadCard,
   },
   setup() {
     const patient = ref({})
@@ -345,6 +348,12 @@ export default {
       showTreatmentinfos.value = true
     }
 
+    const afterReadCard = (result) => {
+      patient.value.mdtrtCertType = result.mdtrtCertType
+      patient.value.readCardResult = result.readCardResult
+      patient.value.readCardBizType = result.readCardBizType
+    }
+
     const admRgstn = (row) => {
       ElMessageBox.confirm('审核通过将直接进行医保入院登记,确定审核通过?', '提示', {
         type: 'warning',
@@ -452,6 +461,7 @@ export default {
       beforeHandleApply,
       getRegInfo,
       showRegisterInfo,
+      afterReadCard,
     }
   },
 }

+ 11 - 27
src/views/medical-insurance/inpatient/DiscSettlement.vue

@@ -151,16 +151,7 @@
           <span style="background: orange" class="color-span"></span>&nbsp;未接收
         </el-tag>
         <div style="float: right; margin-top: 5px" v-cloak>
-          <el-dropdown trigger="click" style="margin-right: 10px" @command="beforeReadCard">
-            <el-button type="info"> 读卡<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
-            <template #dropdown>
-              <el-dropdown-menu>
-                <el-dropdown-item icon="el-icon-bank-card" command="sicard">社保卡</el-dropdown-item>
-                <el-dropdown-item icon="el-icon-s-grid" command="qrcode">二维码</el-dropdown-item>
-                <el-dropdown-item icon="el-icon-user" command="idcard">身份证</el-dropdown-item>
-              </el-dropdown-menu>
-            </template>
-          </el-dropdown>
+          <ReadCard :pat-no="patient.inpatientNo" biztype="01301" @success="afterReadCard" />
           <el-button type="primary" icon="el-icon-data-analysis" @click="doCalFee">费用计算</el-button>
           <el-button type="success" icon="el-icon-time" @click="excuteDismiss">{{ dismissBtnText }}</el-button>
           <el-button type="warning" icon="el-icon-close" @click="closeActOrder">关闭</el-button>
@@ -237,14 +228,18 @@ import { dismissCalculate, getActOrders, selfPayDismiss } from '@/api/yibao/dism
 import { getDatetime, formatDatetime } from '@/utils/date'
 import { nullPatient } from '@/utils/validate'
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { dischargeProcessing, revokeSettlement, readCardCallback } from '@/api/medical-insurance/si-inpatient'
+import { dischargeProcessing, revokeSettlement } from '@/api/medical-insurance/si-inpatient'
 import { getSiPatInfo } from '@/api/medical-insurance/si-query'
 import { getDetailConventions, getRoughConventions, retractConventions } from '@/api/yibao/conventions'
 import { getGreatestRole } from '@/utils/permission'
 import { injurySettlement, revokeInjurySettlement } from '@/api/medical-insurance/si-injury'
 import { selectSettleApply, submitSettleApply } from '@/api/medical-insurance/si-settle-apply'
 import { baseinfo } from '@/data/inpatient'
+import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 export default {
+  components: {
+    ReadCard,
+  },
   setup() {
     const isAdmin = getGreatestRole() < 10
     const actOrderHeight = (store.state.app.windowSize.h - 160) / 2
@@ -624,21 +619,10 @@ export default {
       conventionsVisible.value = false
     }
 
-    const beforeReadCard = (val) => {
-      if (nullPatient()) {
-        return
-      }
-      const param = val + '_' + patient.value.inpatientNo + '_01301'
-      window.open(`ReadCard://${param}`, '_self')
-      readCardCallback(param).then((res) => {
-        patient.value.mdtrtCertType = val
-        patient.value.readCardResult = res.data
-        patient.value.readCardBizType = '01301'
-        ElMessageBox.alert(res.message, '提示', {
-          type: 'success',
-          showCancelButton: false,
-        }).then(() => {})
-      })
+    const afterReadCard = (result) => {
+      patient.value.mdtrtCertType = result.mdtrtCertType
+      patient.value.readCardResult = result.readCardResult
+      patient.value.readCardBizType = result.readCardBizType
     }
 
     const cancelDismiss = () => {
@@ -766,7 +750,7 @@ export default {
       handleSelectConvention,
       confirmRetractConventions,
       closeThreeConventions,
-      beforeReadCard,
+      afterReadCard,
       cancelDismiss,
       showDismissOrderDate,
       cancelSelectDismissOrderDate,

+ 1 - 1
src/views/medical-insurance/inpatient/Home.vue

@@ -153,6 +153,6 @@ function makeOverview(val) {
 }
 
 function downloadReadCard() {
-  window.open('http://172.16.32.160:8888/readcard/ReadCard.exe', '_blank')
+  window.open('http://172.16.32.160:8888/readcard/ReadCard(解压到D盘根目录).zip', '_blank')
 }
 </script>

+ 43 - 3
src/views/medical-insurance/outpatient/MzRegister.vue

@@ -16,7 +16,8 @@
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      <el-dropdown trigger="click" @command="registor" style="margin-left: 8px">
+      <ReadCard :pat-no="patientId" @success="afterReadCard" />
+      <el-dropdown trigger="click" @command="registor">
         <el-button type="primary">登记<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -237,16 +238,23 @@ import { obtainBasicPersonInfo, querySpecialChronicDiseasesAccreditation, queryM
 import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
 import { searchData } from '@/api/yibao/dictionary'
 import { clone } from '../../../utils/clone'
+import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
+
 export default {
+  components: {
+    ReadCard,
+  },
   setup() {
+    //todo 完成业务后清除原读卡数据
     const medType = ref(null)
     const medTypes = ref([])
     const patientId = ref('')
+    const readCardBizType = ref('')
     const times = ref(null)
     const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h - 45
+    const tableHeight = windowSize.h - 55
     const receiptBoxStyle = {
-      height: tableHeight - 200 + 'px',
+      height: tableHeight - 280 + 'px',
       overflowY: 'auto',
     }
 
@@ -470,6 +478,7 @@ export default {
     }
 
     const fetchReceipts = (param) => {
+      clearReadCardData()
       getMzReceipts(param)
         .then((res) => {
           unPaidReceipts.value = res
@@ -545,6 +554,24 @@ export default {
       })
     }
 
+    const readCardData = reactive({
+      mdtrtCertType: null,
+      readCardResult: null,
+      readCardBizType: null,
+    })
+
+    const clearReadCardData = () => {
+      readCardData.mdtrtCertType = null
+      readCardData.readCardResult = null
+      readCardData.readCardBizType = null
+    }
+
+    const afterReadCard = (result) => {
+      readCardData.mdtrtCertType = result.mdtrtCertType
+      readCardData.readCardResult = result.readCardResult
+      readCardData.readCardBizType = result.readCardBizType
+    }
+
     const handleClickInsuinfo = (row) => {
       const param = {
         patNo: patientId.value,
@@ -553,9 +580,13 @@ export default {
         psnType: row.psnType,
         insuplcAdmdvs: row.insuplcAdmdvs,
         empName: row.empName,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientRegistration(param).then((res) => {
         showInsuinfo.value = false
+        clearReadCardData()
         ElMessage({
           message: res,
           type: 'success',
@@ -629,6 +660,9 @@ export default {
         staffId: store.state.user.info.code,
         patNo: patientId.value,
         times: times.value,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientPreSettlement(param).then((res) => {
         const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
@@ -643,8 +677,12 @@ export default {
       const param = {
         patNo: patientId.value,
         times: times.value,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientSettlement(param).then((res) => {
+        clearReadCardData()
         const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
         ElMessageBox.alert(message, '结算成功', {
           type: 'success',
@@ -692,6 +730,7 @@ export default {
       medType,
       medTypes,
       patientId,
+      readCardBizType,
       cptYbState,
       cptInsutype,
       cptPersType,
@@ -717,6 +756,7 @@ export default {
       diagTypes,
       diagItem,
       diags,
+      afterReadCard,
       addDiag,
       deleteDiag,
       saveDiag,

+ 38 - 1
src/views/medical-insurance/outpatient/MzSpltryRcrd.vue

@@ -17,7 +17,9 @@
       <el-divider direction="vertical"></el-divider>
       <el-button type="primary" @click="fetchHistoryReceipts">历史处方</el-button>
 
-      <el-dropdown trigger="click" @command="registor" style="margin-left: 8px">
+      <ReadCard :pat-no="patNo" @success="afterReadCard" />
+
+      <el-dropdown trigger="click" @command="registor">
         <el-button type="primary">登记<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -133,7 +135,11 @@ import { ElMessage, ElMessageBox } from 'element-plus'
 import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
 import { shortcuts } from '@/data/shortcuts'
 import { getDateRangeFormatDate } from '@/utils/date'
+import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 export default {
+  components: {
+    ReadCard,
+  },
   setup() {
     const windowSize = store.state.app.windowSize
     const tableHeight = windowSize.h - 70
@@ -193,6 +199,7 @@ export default {
         })
         return
       }
+      clearReadCardData()
       historyReceipts.value = []
       currentRow.value = {}
       const dates = getDateRangeFormatDate(dateRange.value)
@@ -242,6 +249,24 @@ export default {
       }
     }
 
+    const readCardData = reactive({
+      mdtrtCertType: null,
+      readCardResult: null,
+      readCardBizType: null,
+    })
+
+    const clearReadCardData = () => {
+      readCardData.mdtrtCertType = null
+      readCardData.readCardResult = null
+      readCardData.readCardBizType = null
+    }
+
+    const afterReadCard = (result) => {
+      readCardData.mdtrtCertType = result.mdtrtCertType
+      readCardData.readCardResult = result.readCardResult
+      readCardData.readCardBizType = result.readCardBizType
+    }
+
     const handleClickInsuinfo = (row) => {
       const param = {
         patNo: patNo.value,
@@ -250,8 +275,12 @@ export default {
         psnType: row.psnType,
         insuplcAdmdvs: row.insuplcAdmdvs,
         empName: row.empName,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientRegistration(param).then((res) => {
+        clearReadCardData()
         showInsuinfo.value = false
         ElMessage({
           message: res,
@@ -367,6 +396,9 @@ export default {
         staffId: store.state.user.info.code,
         patNo: patNo.value,
         times: currentRow.value.times,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientPreSettlement(param).then((res) => {
         const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
@@ -441,8 +473,12 @@ export default {
         patNo: patNo.value,
         times: currentRow.value.times,
         saved: 1,
+        mdtrtCertType: readCardData.mdtrtCertType,
+        readCardResult: readCardData.readCardResult,
+        readCardBizType: readCardData.readCardBizType,
       }
       outpatientSettlement(param).then((res) => {
+        clearReadCardData()
         const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
         ElMessageBox.alert(message, '结算成功', {
           type: 'success',
@@ -514,6 +550,7 @@ export default {
       showSpcChrAccts,
       shortcuts,
       dateRange,
+      afterReadCard,
       colorStatus,
       fetchHistoryReceipts,
       fetchHistoryReceiptDetail,