Browse Source

工伤门诊

lighter 2 years ago
parent
commit
ddb87db171

+ 72 - 8
src/api/medical-insurance/si-injury.js

@@ -1,6 +1,6 @@
 import request from '../../utils/request'
 
-export function getPersonBaseinfo(data) {
+export function employeeInfoInquiry(data) {
   return request({
     url: '/siInjury/employeeInfoInquiry',
     method: 'post',
@@ -8,7 +8,15 @@ export function getPersonBaseinfo(data) {
   })
 }
 
-export function admissRegistration(data) {
+export function employeeInfoInquiry2(data) {
+  return request({
+    url: '/siInjury/employeeInfoInquiry2',
+    method: 'post',
+    data,
+  })
+}
+
+export function inpatientRegister(data) {
   return request({
     url: '/siInjury/inpatientRegister',
     method: 'post',
@@ -16,7 +24,7 @@ export function admissRegistration(data) {
   })
 }
 
-export function uploadInjuryFees(data) {
+export function inpatientCostUpload(data) {
   return request({
     url: '/siInjury/inpatientCostUpload',
     method: 'post',
@@ -24,7 +32,7 @@ export function uploadInjuryFees(data) {
   })
 }
 
-export function cancelInjuryRegister(data) {
+export function revokeInpatientRegister(data) {
   return request({
     url: '/siInjury/revokeInpatientRegister',
     method: 'post',
@@ -32,7 +40,7 @@ export function cancelInjuryRegister(data) {
   })
 }
 
-export function cancelInjuryFee(data) {
+export function revokeInpatientCost(data) {
   return request({
     url: '/siInjury/revokeInpatientCost',
     method: 'post',
@@ -40,7 +48,7 @@ export function cancelInjuryFee(data) {
   })
 }
 
-export function injuryPrecal(data) {
+export function inpatientSettlement(data) {
   return request({
     url: '/siInjury/inpatientSettlement',
     method: 'post',
@@ -48,7 +56,7 @@ export function injuryPrecal(data) {
   })
 }
 
-export function injurySettlement(data) {
+export function inpatientDischargeProcess(data) {
   return request({
     url: '/siInjury/inpatientDischargeProcess',
     method: 'post',
@@ -56,10 +64,66 @@ export function injurySettlement(data) {
   })
 }
 
-export function revokeInjurySettlement(data) {
+export function revokeInpatientSettlement(data) {
   return request({
     url: '/siInjury/revokeInpatientSettlement',
     method: 'post',
     data,
   })
 }
+
+export function injuryOutpatientRegister(data) {
+  return request({
+    url: '/siInjury/outpatientRegister',
+    method: 'post',
+    data,
+  })
+}
+
+export function injuryOutpatientFeeUpload(data) {
+  return request({
+    url: '/siInjury/outpatientFeeUpload',
+    method: 'post',
+    data,
+  })
+}
+
+export function injuryOutpatientSettlement(data) {
+  return request({
+    url: '/siInjury/outpatientSettlement',
+    method: 'post',
+    data,
+  })
+}
+
+export function revokeInjuryOutpatientFee(data) {
+  return request({
+    url: '/siInjury/revokeOutpatientFee',
+    method: 'post',
+    data,
+  })
+}
+
+export function injuryOutpatientFeeInquiry(data) {
+  return request({
+    url: '/siInjury/outpatientFeeInquiry',
+    method: 'post',
+    data,
+  })
+}
+
+export function revokeInjuryOutpatientSettlement(data) {
+  return request({
+    url: '/siInjury/revokeOutpatientSettlement',
+    method: 'post',
+    data,
+  })
+}
+
+export function revokeInjuryOutpatientRegistration(data) {
+  return request({
+    url: '/siInjury/revokeOutpatientRegistration',
+    method: 'post',
+    data,
+  })
+}

+ 2 - 2
src/components/medical-insurance/insuinfo/Index.vue

@@ -50,7 +50,7 @@
 import store from '@/store'
 import { onMounted, ref, computed } from 'vue'
 import { obtainBasicPersonInfo } from '@/api/medical-insurance/si-query'
-import { getPersonBaseinfo } from '@/api/medical-insurance/si-injury'
+import { employeeInfoInquiry } from '@/api/medical-insurance/si-injury'
 export default {
   props: {
     params: {
@@ -81,7 +81,7 @@ export default {
 
     const fetchInsuinfo = () => {
       if (injuryMode.value) {
-        getPersonBaseinfo(props.params)
+        employeeInfoInquiry(props.params)
           .then((res) => {
             injuryinfo.value = res
           })

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

@@ -359,7 +359,7 @@ import {formatDatetime, getDatetime} from '@/utils/date'
 import {clone} from '@/utils/clone'
 import {getMatnTypes, getMedTypesByFlag, getPsnCertTypes} from '@/api/medical-insurance/si-dict'
 import {checkRegisterDate, obtainBasicPersonInfo} from '@/api/medical-insurance/si-query'
-import {admissRegistration, cancelInjuryRegister, getPersonBaseinfo} from '@/api/medical-insurance/si-injury'
+import {inpatientRegister, revokeInpatientRegister, employeeInfoInquiry} from '@/api/medical-insurance/si-injury'
 import {selectAdmissApply, submitAdmissApply} from '@/api/medical-insurance/si-admiss-apply'
 import {baseinfo} from '@/data/inpatient'
 import Xmlr from '@/components/inpatient/XiangMuLuRu.vue'
@@ -734,7 +734,7 @@ const getPsnInsuinfo = () => {
     return
   }
   if (injuryMode.value) {
-    getPersonBaseinfo(patient.value).then((res) => {
+    employeeInfoInquiry(patient.value).then((res) => {
       injuryinfo.value = res
       showPsnInsuinfo.value = true
     })
@@ -768,12 +768,7 @@ const handleClickInjuryinfo = (row) => {
     row.ledgerSn = patient.value.ledgerSn
     row.aka130 = '42'
     row.bka003 = '420'
-    admissRegistration(row).then((res) => {
-    // const param = {
-    //   baseinfo: patient.value,
-    //   injuryinfo: row,
-    // }
-    // admissRegistration(param).then((res) => {
+    inpatientRegister(row).then((res) => {
       ElMessage({
         message: '审核已通过,医保入院登记成功。',
         type: 'success',
@@ -830,7 +825,7 @@ const beforeCancelRegister = () => {
     }).then(() => {
       patient.value.revokeRemark = value
       if (injuryMode.value) {
-        cancelInjuryRegister(patient.value).then(() => {
+        revokeInpatientRegister(patient.value).then(() => {
           ElMessageBox.alert('撤销入院登记成功。', '提示', {
             type: 'success',
           })

+ 2 - 2
src/views/medical-insurance/inpatient/AdmissVerification.vue

@@ -154,7 +154,7 @@ import femaleIcon from '@/assets/female-icon.png'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { getDiagTypes } from '@/api/medical-insurance/si-dict'
 import { checkRegisterDate } from '@/api/medical-insurance/si-query'
-import { admissRegistration } from '@/api/medical-insurance/si-injury'
+import { inpatientRegister } from '@/api/medical-insurance/si-injury'
 import { admissRegister } from '@/api/medical-insurance/si-inpatient'
 import { statusFlags, needVerifyMedTypes } from '../../../data/index'
 import { selectUnhandledApplies, selectPatientInfo, handleApply } from '@/api/medical-insurance/si-admiss-apply'
@@ -290,7 +290,7 @@ export default {
         row.ledgerSn = patient.value.ledgerSn
         row.aka130 = '42'
         row.bka003 = '420'
-        admissRegistration(row).then((res) => {
+        inpatientRegister(row).then((res) => {
           currentApply.value.status = 1
           currentApply.value.handleComment = '同意办理'
           handleApply(currentApply.value).then((res) => {

+ 3 - 3
src/views/medical-insurance/inpatient/DiscSettlement.vue

@@ -265,7 +265,7 @@ import {dischargeProcessing, revokeSettlement} from '@/api/medical-insurance/si-
 import {getSiPatInfo} from '@/api/medical-insurance/si-query'
 import {getDetailConventions, getRoughConventions, retractConventions} from '@/api/inpatient/conventions'
 import {getGreatestRole} from '@/utils/permission'
-import {injurySettlement, revokeInjurySettlement} from '@/api/medical-insurance/si-injury'
+import {inpatientDischargeProcess, revokeInpatientSettlement} from '@/api/medical-insurance/si-injury'
 import {selectSettleApply, submitSettleApply} from '@/api/medical-insurance/si-settle-apply'
 import {baseinfo,setBaseinfo} from '@/data/inpatient'
 import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
@@ -596,7 +596,7 @@ const excuteDismiss = () => {
 }
 
 const injuryDismiss = () => {
-  injurySettlement(patient.value).then((res) => {
+  inpatientDischargeProcess(patient.value).then((res) => {
     ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
       type: 'success',
     })
@@ -716,7 +716,7 @@ const cancelDismiss = () => {
     type: 'warning',
   }).then(() => {
     if (injuryMode.value) {
-      revokeInjurySettlement(patient.value).then(() => {
+      revokeInpatientSettlement(patient.value).then(() => {
         ElMessage({
           message: '取消医保结算成功。',
           type: 'success',

+ 4 - 4
src/views/medical-insurance/inpatient/InHospFeeUpload.vue

@@ -125,7 +125,7 @@ import {
   revokeUploadFees,
   uploadFeeDetail
 } from '@/api/medical-insurance/si-inpatient'
-import {cancelInjuryFee, injuryPrecal, uploadInjuryFees} from '@/api/medical-insurance/si-injury'
+import {revokeInpatientCost, inpatientSettlement, inpatientCostUpload} from '@/api/medical-insurance/si-injury'
 import {setCallback} from '@/utils/websocket'
 import {getGreatestRole} from '@/utils/permission'
 import {baseinfo, setBaseinfo} from '@/data/inpatient'
@@ -258,7 +258,7 @@ export default {
     const excutePreCal = () => {
       return new Promise((resolve, reject) => {
         if (injuryMode.value) {
-          injuryPrecal(patient.value).then((res) => {
+          inpatientSettlement(patient.value).then((res) => {
             patient.value.chargeYb = res.fundPay
             ElMessageBox.alert(res, {
               type: 'success',
@@ -305,7 +305,7 @@ export default {
 
     const doSingleInjuryUpload = () => {
       patient.value.sid = store.getters['user/sid']
-      uploadInjuryFees(patient.value).then((res) => {
+      inpatientCostUpload(patient.value).then((res) => {
         fetchProjectFees()
         fetchMedicineFees()
         showProgress.value = false
@@ -409,7 +409,7 @@ export default {
       })
           .then(() => {
             if (injuryMode.value) {
-              cancelInjuryFee(patient.value).then(() => {
+              revokeInpatientCost(patient.value).then(() => {
                 ElMessage({
                   message: '操作成功。',
                   type: 'success',

+ 274 - 112
src/views/medical-insurance/outpatient/MzRegister.vue

@@ -3,13 +3,17 @@
     <template #header>
       <el-input v-model="patientId" style="width: 100px" clearable placeholder="门诊ID">
       </el-input>
-      <el-select v-model="medType" style="width: 120px" placeholder="医疗类别">
+      <el-select v-model="medType" style="width: 120px" placeholder="医疗类别" @change="handleMedTypeChange">
         <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
       </el-select>
-      <el-cascader clearable filterable placeholder="参保地区" :options="allAdmdvses" @change="handleAdmdvsChange" style="width: 160px"></el-cascader>
+      <el-cascader v-model="admdvsCascader" clearable filterable placeholder="参保地区"
+                   :options="allAdmdvses" @change="handleAdmdvsChange"
+                   style="width: 160px" :disabled="injuryMode === true"></el-cascader>
       <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
         <el-button type="primary">
-          处方&nbsp;<el-icon><ArrowDown /></el-icon>
+          处方&nbsp;<el-icon>
+          <ArrowDown/>
+        </el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -18,10 +22,12 @@
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      <ReadCard :pat-no="patientId" @success="afterReadCard" />
-      <el-dropdown trigger="click" @command="registor">
+      <ReadCard :pat-no="patientId" @success="afterReadCard"/>
+      <el-dropdown trigger="click" @command="register">
         <el-button type="primary">
-          登记&nbsp;<el-icon><ArrowDown /></el-icon>
+          登记&nbsp;<el-icon>
+          <ArrowDown/>
+        </el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -32,7 +38,9 @@
       </el-dropdown>
       <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
         <el-button type="primary">
-          上传&nbsp;<el-icon><ArrowDown /></el-icon>
+          上传&nbsp;<el-icon>
+          <ArrowDown/>
+        </el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -44,7 +52,9 @@
       </el-dropdown>
       <el-dropdown trigger="click" @command="settlement" style="margin-left: 8px">
         <el-button type="primary">
-          结算&nbsp;<el-icon><ArrowDown /></el-icon>
+          结算&nbsp;<el-icon>
+          <ArrowDown/>
+        </el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
@@ -54,17 +64,18 @@
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      <el-button type="danger" icon="Refresh" @click="clearinfo" style="margin-left: 8px"> 重置 </el-button>
+      <el-button type="danger" icon="Refresh" @click="clearinfo" style="margin-left: 8px"> 重置</el-button>
     </template>
     <template #aside>
       <div style="display: flex">
         <div style="width: 80px">
-          <el-table ref="timesTable" :data="unPaidReceipts" highlight-current-row @row-click="clickTimes" empty-text="无">
+          <el-table ref="timesTable" :data="unPaidReceipts" highlight-current-row @row-click="clickTimes"
+                    empty-text="无">
             <el-table-column label="次数" prop="times" width="40"></el-table-column>
             <el-table-column label="诊间" width="40">
-                <template #default="scope">
-                    <span v-html="isMztczf(scope.row)"></span>
-                </template>
+              <template #default="scope">
+                <span v-html="isMztczf(scope.row)"></span>
+              </template>
             </el-table-column>
           </el-table>
         </div>
@@ -133,40 +144,57 @@
               <span v-if="item.supplyCode"> {{ item.supplyCode }} </span>
               <span v-if="item.instructionText"> 备注:{{ item.instructionText }} </span>
             </div>
-            <div :style="{ color: item.nationalCode ? 'green' : 'red', fontWeight: 'bold', padding: '0 0 12px 64px' }">医保码:{{ item.nationalCode || '未匹配' }}</div>
+            <div :style="{ color: item.nationalCode ? 'green' : 'red', fontWeight: 'bold', padding: '0 0 12px 64px' }">
+              医保码:{{ item.nationalCode || '未匹配' }}
+            </div>
           </div>
         </div>
         <el-divider></el-divider>
         <div class="receipt-head">
-          <div style="font-size: 15px; width: 70%">医师:{{ mzVisit.doctorName }} / {{ mzVisit.doctorCode }} / <span v-html="highlightYbCode(mzVisit.doctorCode,mzVisit.doctorYbCode)"></span></div>
+          <div style="font-size: 15px; width: 70%">医师:{{ mzVisit.doctorName }} / {{ mzVisit.doctorCode }} / <span
+              v-html="highlightYbCode(mzVisit.doctorCode,mzVisit.doctorYbCode)"></span></div>
           <div style="font-size: 15px">
             总金额:<span style="font-size: 18px; font-weight: bold">¥{{ totalFee }}</span>
           </div>
         </div>
       </div>
       <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
-        <el-tag>参保信息</el-tag>
-        <el-table :data="psnBaseinfo.insuinfo" @row-click="handleClickInsuinfo">
-          <el-table-column property="balc" label="余额"></el-table-column>
-          <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
-          <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
-          <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
-          <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
-          <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
-          <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
-          <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
-          <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
-          <el-table-column property="empName" label="单位名称"></el-table-column>
-        </el-table>
-        <div style="height: 16px"></div>
-        <el-tag>身份信息</el-tag>
-        <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
-          <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
-          <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
-          <el-table-column label="备注" prop="memo"></el-table-column>
-          <el-table-column label="开始时间" prop="begntime"></el-table-column>
-          <el-table-column label="结束时间" prop="endtime"></el-table-column>
-        </el-table>
+        <el-tag>{{ injuryMode ? '工伤信息' : '参保信息' }}</el-tag>
+        <div v-if="injuryMode">
+          <el-table :data="injuryinfo" height="180" stripe @row-click="handleClickInjuryinfo">
+            <el-table-column label="证件号码" prop="aac002"></el-table-column>
+            <el-table-column label="姓名" prop="aac003"></el-table-column>
+            <el-table-column label="单位名称" prop="aab004"></el-table-column>
+            <el-table-column label="受伤时间" prop="alc020"></el-table-column>
+            <el-table-column label="认定申请时间" prop="alc017"></el-table-column>
+            <el-table-column label="认定ID" prop="aaz127"></el-table-column>
+            <el-table-column label="个人编号" prop="aac001"></el-table-column>
+            <el-table-column label="参保统筹区" prop="baa027Name"></el-table-column>
+          </el-table>
+        </div>
+        <div v-else>
+          <el-table :data="psnBaseinfo.insuinfo" @row-click="handleClickInsuinfo">
+            <el-table-column property="balc" label="余额"></el-table-column>
+            <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
+            <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
+            <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
+            <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
+            <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
+            <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
+            <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
+            <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
+            <el-table-column property="empName" label="单位名称"></el-table-column>
+          </el-table>
+          <div style="height: 16px"></div>
+          <el-tag>身份信息</el-tag>
+          <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
+            <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
+            <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
+            <el-table-column label="备注" prop="memo"></el-table-column>
+            <el-table-column label="开始时间" prop="begntime"></el-table-column>
+            <el-table-column label="结束时间" prop="endtime"></el-table-column>
+          </el-table>
+        </div>
       </el-dialog>
       <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
         <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
@@ -184,8 +212,10 @@
           <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
         </el-table>
       </el-dialog>
-      <el-dialog title="普门诊断补录" v-model="showInputDiags" width="60%" :close-on-click-modal="false" :close-on-press-escape="false">
-        <outpatient-diagnose-supply :med-type="medType" :mz-visit="mzVisit" @close="showInputDiags = false"></outpatient-diagnose-supply>
+      <el-dialog title="普门诊断补录" v-model="showInputDiags" width="60%" :close-on-click-modal="false"
+                 :close-on-press-escape="false">
+        <outpatient-diagnose-supply :med-type="medType" :mz-visit="mzVisit"
+                                    @close="showInputDiags = false"></outpatient-diagnose-supply>
       </el-dialog>
       <el-dialog v-model="showMdtrtGrpType" title="跨省患者请选择" width="360px">
         <div>
@@ -228,8 +258,8 @@
 </template>
 
 <script setup>
-import { onMounted, reactive, ref } from 'vue'
-import { allAdmdvses } from '@/data/admdvs'
+import {onMounted, reactive, ref} from 'vue'
+import {allAdmdvses} from '@/data/admdvs'
 import {
   deleteAllMzReceipts,
   deleteMzReceipt,
@@ -245,12 +275,21 @@ import {
 } from '@/api/medical-insurance/si-outpatient'
 import {ElMessage, ElMessageBox, ElSelect} from 'element-plus'
 import store from '@/store'
-import { obtainBasicPersonInfo, querySpecialChronicDiseasesAccreditation, queryMzMatnDises } from '@/api/medical-insurance/si-query'
-import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
+import {
+  obtainBasicPersonInfo,
+  querySpecialChronicDiseasesAccreditation,
+  queryMzMatnDises
+} from '@/api/medical-insurance/si-query'
+import {getMedTypesByFlag} from '@/api/medical-insurance/si-dict'
 import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 import mzSettled from '@/assets/mz-settled.png'
 import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-diagnose-supply/Index.vue'
 import PageLayer from "@/layout/PageLayer";
+import {
+  employeeInfoInquiry2, injuryOutpatientFeeUpload,
+  injuryOutpatientRegister, injuryOutpatientSettlement, revokeInjuryOutpatientFee,
+  revokeInjuryOutpatientRegistration, revokeInjuryOutpatientSettlement
+} from "@/api/medical-insurance/si-injury";
 
 const medType = ref(null)
 const admdvs = ref(null)
@@ -295,6 +334,30 @@ const mdtrtGrpTypes = [
   {code: '4', name: '无症状感染者', key: 'mdtrtGrpTypes-4'},
 ]
 
+const injuryMode = computed(() => {
+  return medType.value === '41'
+})
+
+const injuryinfo = ref([])
+
+const handleClickInjuryinfo = (row) => {
+  row.patNo = patientId.value
+  row.times = times.value
+  row.ledgerSn = 0
+  row.aka130 = '41'
+  row.bka003 = '410'
+  injuryOutpatientRegister(row).then(() => {
+    showInsuinfo.value = false
+    clearReadCardData()
+    ElMessage({
+      message: '登记成功',
+      type: 'success',
+      duration: 2000,
+      showClose: true,
+    })
+  })
+}
+
 const nullPatientId = () => {
   if (!patientId.value) {
     ElMessage({
@@ -315,11 +378,33 @@ const clearExpContent = () => {
   expContent.OTP_ER_REFL_FLAG = ''
 }
 
-const registor = (command) => {
-  if (nullPatientId()) {
-    return
+const nullMedType = () => {
+  if (!medType.value) {
+    ElMessage({
+      message: '请先选择医疗类别!',
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return true
+  }
+  return false
+}
+
+const admdvsCascader = ref([])
+const handleMedTypeChange = (val) => {
+  if (val === '41') {
+    admdvsCascader.value = []
+    admdvs.value = null
   }
-  if (nullTimes()) {
+}
+
+const invalidateTips = () => {
+  return nullPatientId() || nullTimes() || nullMedType()
+}
+
+const register = (command) => {
+  if (invalidateTips()) {
     return
   }
   clearExpContent()
@@ -328,32 +413,42 @@ const registor = (command) => {
     medType: medType.value,
     admdvs: admdvs.value,
     times: times.value,
+    legderSn: 0,
     needSaving: 1,
   }
   if (command === 'execute') {
-    if (!medType.value) {
-      ElMessage({
-        message: '请先选择医疗类别!',
-        type: 'warning',
-        duration: 2500,
-        showClose: true,
+    if (injuryMode.value) {
+      employeeInfoInquiry2(param).then((res) => {
+        injuryinfo.value = res
+        showInsuinfo.value = true
       })
-      return
+    } else {
+      obtainBasicPersonInfo(param).then((res) => {
+        times.value = res.times
+        psnBaseinfo.value = res
+        showInsuinfo.value = true
+      });
     }
-    obtainBasicPersonInfo(param).then((res) => {
-      times.value = res.times
-      psnBaseinfo.value = res
-      showInsuinfo.value = true
-    })
   } else {
-    revokeOutpatientRegistration(param).then((res) => {
-      ElMessage({
-        message: res,
-        type: 'success',
-        duration: 2000,
-        showClose: true,
+    if (injuryMode.value) {
+      revokeInjuryOutpatientRegistration(param).then(res => {
+        ElMessage({
+          message: res,
+          type: 'success',
+          duration: 2000,
+          showClose: true,
+        })
       })
-    })
+    } else {
+      revokeOutpatientRegistration(param).then((res) => {
+        ElMessage({
+          message: res,
+          type: 'success',
+          duration: 2000,
+          showClose: true,
+        })
+      })
+    }
   }
 }
 
@@ -399,17 +494,51 @@ const receiptsOpts = (command) => {
       })
       break
     case 'upload':
-      qrySpcChrDiseAcct(param)
-      break
+      if (injuryMode.value) {
+        const param = {
+          patNo: patientId.value,
+          times: times.value,
+          ledgerSn: 0,
+          calType: 0
+        }
+        injuryOutpatientFeeUpload(param).then(() => {
+          injuryOutpatientSettlement(param).then(res => {
+            const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
+            ElMessageBox.alert(message, '提示', {
+              type: 'success',
+              showCancelButton: false,
+            }).then(() => {})
+          })
+        })
+      } else {
+        qrySpcChrDiseAcct(param)
+      }
+      break;
     case 'retract':
-      revokeOutpatientFeeDetails(param).then((res) => {
-        ElMessage({
-          message: res,
-          type: 'success',
-          duration: 2000,
-          showClose: true,
+      if (injuryMode.value) {
+        const param = {
+          patNo: patientId.value,
+          times: times.value,
+          ledgerSn: 0,
+        }
+        revokeInjuryOutpatientFee(param).then(res => {
+          ElMessage({
+            message: res,
+            type: 'success',
+            duration: 2000,
+            showClose: true,
+          })
         })
-      })
+      } else {
+        revokeOutpatientFeeDetails(param).then((res) => {
+          ElMessage({
+            message: res,
+            type: 'success',
+            duration: 2000,
+            showClose: true,
+          })
+        });
+      }
       break
     case 'diags':
       showInputDiags.value = true
@@ -419,19 +548,16 @@ const receiptsOpts = (command) => {
 
 const fetchReceipts = (param) => {
   clearReadCardData()
-  getMzReceipts(param)
-      .then((res) => {
-        unPaidReceipts.value = res
-        setTimeout(() => {
-          timesTable.value.setCurrentRow(res[0])
-          clickTimes(res[0])
-        }, 100)
-      })
-      .catch(() => {
-        unPaidReceipts.value = []
-        orderNos.value = []
-        currentReceipts.value = []
-      })
+  getMzReceipts(param).then((res) => {
+    unPaidReceipts.value = res
+    setTimeout(() => {
+      timesTable.value.setCurrentRow(res[0])
+      clickTimes(res[0])
+    }, 100)
+  }).catch(() => {
+    unPaidReceipts.value = []
+    orderNos.value = []
+    currentReceipts.value = []})
 }
 
 const markMzFees = () => {
@@ -448,19 +574,18 @@ const markMzFees = () => {
     type: 'warning',
     confirmButtonText: '生成',
     cancelButtonText: '取消',
-  })
-      .then(() => {
-        insertSiMzFees(currentReceipts.value).then(() => {
-          currentOrder.value.status = true
-          ElMessage({
-            message: '已成功生成医保处方。',
-            type: 'success',
-            duration: 2500,
-            showClose: true,
-          })
-        })
+  }).then(() => {
+    insertSiMzFees(currentReceipts.value).then(() => {
+      currentOrder.value.status = true
+      ElMessage({
+        message: '已成功生成医保处方。',
+        type: 'success',
+        duration: 2500,
+        showClose: true,
       })
-      .catch(() => {})
+    })
+  }).catch(() => {
+  })
 }
 
 const qrySpcChrDiseAcct = (param) => {
@@ -577,7 +702,8 @@ const unmarkMzFees = (row) => {
         showClose: true,
       })
     })
-  }).catch(() => {})
+  }).catch(() => {
+  })
 }
 
 const currentCommand = ref(null)
@@ -588,11 +714,28 @@ const settlement = (command) => {
   if (command === 'cancelSettlement') {
     revokeMzSettle()
   } else {
-    if (certainAdmdvs.value.startsWith('43')) {
-      command === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag()
+    if (injuryMode.value) {
+      const param = {
+        patNo: patientId.value,
+        times: times.value,
+        ledgerSn: 0,
+        calType: command === 'preSettlement' ? 0 : 1
+      }
+      injuryOutpatientSettlement(param).then(res => {
+        const title = command === 'preSettlement' ? '试算成功' : '结算成功'
+        const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
+        ElMessageBox.alert(message, title, {
+          type: 'success',
+          showCancelButton: false,
+        }).then(() => {})
+      })
     } else {
-      currentCommand.value = command
-      showMdtrtGrpType.value = true
+      if (certainAdmdvs.value.startsWith('43')) {
+        command === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag();
+      } else {
+        currentCommand.value = command;
+        showMdtrtGrpType.value = true;
+      }
     }
   }
 }
@@ -619,7 +762,8 @@ const mzPreSetl = () => {
     ElMessageBox.alert(message, '试算成功', {
       type: 'success',
       showCancelButton: false,
-    }).then(() => {})
+    }).then(() => {
+    })
   })
 }
 
@@ -664,17 +808,27 @@ const revokeMzSettle = () => {
   const param = {
     patNo: patientId.value,
     times: times.value,
+    ledgerSn: 0,
   }
-  revokeOutpatientSettlement(param).then((res) => {
-    ElMessageBox.alert('撤销门诊结算成功', '提示', {
-      type: 'success',
-      showCancelButton: false,
+  if (injuryMode.value) {
+    revokeInjuryOutpatientSettlement(param).then(res => {
+      ElMessageBox.alert(res, '提示', {
+        type: 'success',
+        showCancelButton: false,
+      })
     })
-  })
+  } else {
+    revokeOutpatientSettlement(param).then((res) => {
+      ElMessageBox.alert('撤销门诊结算成功', '提示', {
+        type: 'success',
+        showCancelButton: false,
+      })
+    })
+  }
 }
 
 const isMztczf = (row) => {
-    return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
+  return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
 }
 
 const clearinfo = () => {
@@ -720,31 +874,39 @@ onMounted(() => {
   height: 32px;
   line-height: 32px;
 }
+
 .receipt-head {
   display: flex;
   height: 22px;
   line-height: 22px;
 }
+
 .receipt-head > div {
   width: 33%;
   padding-right: 20px;
 }
+
 .receipt-item {
   display: flex;
 }
+
 .receipt-tips {
   margin: 0 0 0 64px;
 }
+
 .receipt-tips > span {
   margin-right: 15px;
 }
+
 .w75 {
   width: 70%;
   font-size: 15px;
 }
+
 .w75 * {
   font-size: 15px;
 }
+
 .w25 {
   width: 25%;
   font-size: 15px;

+ 515 - 427
src/views/medical-insurance/outpatient/MzSpltryRcrd.vue

@@ -17,7 +17,7 @@
       <el-divider direction="vertical"></el-divider>
       <el-button type="primary" @click="fetchHistoryReceipts">历史处方</el-button>
       <ReadCard :pat-no="patNo" @success="afterReadCard"/>
-      <el-dropdown trigger="click" @command="registor">
+      <el-dropdown trigger="click" @command="register">
         <el-button type="primary">
           登记&nbsp;<el-icon>
           <ArrowDown/>
@@ -123,19 +123,43 @@
           总金额:<span style="font-size: 18px; font-weight: bold">¥{{ currentRow.chargeFee }}</span>
         </div>
       </div>
-      <el-dialog title="个人参保信息" v-model="showInsuinfo" width="65%">
-        <el-table :data="insuinfo" @row-click="handleClickInsuinfo">
-          <el-table-column property="balc" label="余额"></el-table-column>
-          <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
-          <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
-          <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
-          <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
-          <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
-          <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
-          <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
-          <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
-          <el-table-column property="empName" label="单位名称"></el-table-column>
-        </el-table>
+      <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
+        <el-tag>{{ injuryMode ? '工伤信息' : '参保信息' }}</el-tag>
+        <div v-if="injuryMode">
+          <el-table :data="injuryinfo" height="180" stripe @row-click="handleClickInjuryinfo">
+            <el-table-column label="证件号码" prop="aac002"></el-table-column>
+            <el-table-column label="姓名" prop="aac003"></el-table-column>
+            <el-table-column label="单位名称" prop="aab004"></el-table-column>
+            <el-table-column label="受伤时间" prop="alc020"></el-table-column>
+            <el-table-column label="认定申请时间" prop="alc017"></el-table-column>
+            <el-table-column label="认定ID" prop="aaz127"></el-table-column>
+            <el-table-column label="个人编号" prop="aac001"></el-table-column>
+            <el-table-column label="参保统筹区" prop="baa027Name"></el-table-column>
+          </el-table>
+        </div>
+        <div v-else>
+          <el-table :data="insuinfo" @row-click="handleClickInsuinfo">
+            <el-table-column property="balc" label="余额"></el-table-column>
+            <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
+            <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
+            <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
+            <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
+            <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
+            <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
+            <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
+            <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
+            <el-table-column property="empName" label="单位名称"></el-table-column>
+          </el-table>
+          <div style="height: 16px"></div>
+          <el-tag>身份信息</el-tag>
+          <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
+            <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
+            <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
+            <el-table-column label="备注" prop="memo"></el-table-column>
+            <el-table-column label="开始时间" prop="begntime"></el-table-column>
+            <el-table-column label="结束时间" prop="endtime"></el-table-column>
+          </el-table>
+        </div>
       </el-dialog>
       <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
         <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
@@ -162,7 +186,7 @@
   </page-layer>
 </template>
 
-<script>
+<script setup>
 import {
   deleteAllMzReceipts,
   getHistoryMzReceipts,
@@ -176,6 +200,11 @@ import {
   outpatientSettlement,
   revokeOutpatientSettlement,
 } from '@/api/medical-insurance/si-outpatient'
+import {
+  employeeInfoInquiry2, injuryOutpatientFeeUpload,
+  injuryOutpatientRegister, injuryOutpatientSettlement, revokeInjuryOutpatientFee,
+  revokeInjuryOutpatientRegistration, revokeInjuryOutpatientSettlement
+} from "@/api/medical-insurance/si-injury";
 import {
   obtainBasicPersonInfo,
   querySpecialChronicDiseasesAccreditation,
@@ -192,162 +221,140 @@ import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-
 import mzSettled from '@/assets/mz-settled.png'
 import PageLayer from "@/layout/PageLayer";
 
-export default {
-  components: {
-    PageLayer,
-    ReadCard,
-    OutpatientDiagnoseSupply,
-  },
-  setup() {
-    const windowSize = store.state.app.windowSize
-    const receiptBoxStyle = {
-      height: windowSize.h - 335 + 'px',
-      overflowY: 'auto',
-    }
-    const patNo = ref('')
-    const medType = ref('')
-    const medTypes = ref([])
-    const historyReceipts = ref([])
-    const currentRow = ref({})
-    const mzVisit = ref({})
-    const currentReceipts = ref([])
-    const showInputDiags = ref(false)
-    const dateRange = ref(shortcuts[2].value)
-    const colorStatus = (row) => {
-      return row.status > 0 ? `<span style="color: green">${row.patNo}_${row.times}</span>` : `<span style="color: red">${row.patNo}_${row.times}</span>`
-    }
-    const isMztczf = (row) => {
-      return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
-    }
-    const nullPatNo = () => {
-      if (patNo.value) {
-        return false
-      }
-      ElMessage({
-        message: '请输入门诊ID!',
-        type: 'warning',
-        duration: 2500,
-        showClose: true,
-      })
-      return true
-    }
-    const nullMedtype = () => {
-      if (medType.value) {
-        return false
-      }
-      ElMessage({
-        message: '请选择医疗类别!',
-        type: 'warning',
-        duration: 2500,
-        showClose: true,
-      })
-      return true
-    }
+const windowSize = store.state.app.windowSize
+const receiptBoxStyle = {
+  height: windowSize.h - 335 + 'px',
+  overflowY: 'auto',
+}
+const patNo = ref('')
+const medType = ref('')
+const medTypes = ref([])
+const historyReceipts = ref([])
+const currentRow = ref({})
+const mzVisit = ref({})
+const currentReceipts = ref([])
+const showInputDiags = ref(false)
+const dateRange = ref(shortcuts[2].value)
+const injuryinfo = ref([])
+const injuryMode = computed(() => {
+  return medType.value === '41'
+})
+const colorStatus = (row) => {
+  return row.status > 0 ? `<span style="color: green">${row.patNo}_${row.times}</span>` : `<span style="color: red">${row.patNo}_${row.times}</span>`
+}
+const isMztczf = (row) => {
+  return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
+}
+const nullPatNo = () => {
+  if (patNo.value) {
+    return false
+  }
+  ElMessage({
+    message: '请输入门诊ID!',
+    type: 'warning',
+    duration: 2500,
+    showClose: true,
+  })
+  return true
+}
+const nullMedtype = () => {
+  if (medType.value) {
+    return false
+  }
+  ElMessage({
+    message: '请选择医疗类别!',
+    type: 'warning',
+    duration: 2500,
+    showClose: true,
+  })
+  return true
+}
 
-    const fetchHistoryReceipts = () => {
-      if (nullPatNo()) {
-        return
-      }
-      if (nullMedtype()) {
-        return
-      }
-      if (!dateRange.value) {
-        ElMessage({
-          message: '请选择日期范围!',
-          type: 'warning',
-          duration: 2500,
-          showClose: true,
-        })
-        return
-      }
-      clearReadCardData()
-      historyReceipts.value = []
-      currentRow.value = {}
-      const dates = getDateRangeFormatDate(dateRange.value)
-      getHistoryMzReceipts(patNo.value, dates.startTime, dates.endTime).then((res) => {
-        historyReceipts.value = res
-      })
-    }
-    const fetchHistoryReceiptDetail = (row) => {
-      currentRow.value = row
-      getHistoryReceiptDetail(row).then((res) => {
-        mzVisit.value = res.mzVisit
-        currentReceipts.value = res.mzReceipts
-      })
-    }
+const fetchHistoryReceipts = () => {
+  if (nullPatNo()) {
+    return
+  }
+  if (nullMedtype()) {
+    return
+  }
+  if (!dateRange.value) {
+    ElMessage({
+      message: '请选择日期范围!',
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return
+  }
+  clearReadCardData()
+  historyReceipts.value = []
+  currentRow.value = {}
+  const dates = getDateRangeFormatDate(dateRange.value)
+  getHistoryMzReceipts(patNo.value, dates.startTime, dates.endTime).then((res) => {
+    historyReceipts.value = res
+  })
+}
+const fetchHistoryReceiptDetail = (row) => {
+  currentRow.value = row
+  getHistoryReceiptDetail(row).then((res) => {
+    mzVisit.value = res.mzVisit
+    currentReceipts.value = res.mzReceipts
+  })
+}
 
-    const insuinfo = ref([])
-    const showInsuinfo = ref(false)
-    const registor = (command) => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        medType: medType.value,
-        times: currentRow.value.times,
-        needSaving: 1,
-      }
-      if (command === 'execute') {
-        obtainBasicPersonInfo(param).then((res) => {
-          insuinfo.value = res.insuinfo
-          showInsuinfo.value = true
-        })
-      } else if (command === 'revoke') {
-        revokeOutpatientRegistration(param).then((res) => {
-          ElMessage({
-            message: res,
-            type: 'success',
-            duration: 2000,
-            showClose: true,
-          })
-        })
-      } else {
-        showInputDiags.value = true
-      }
-    }
+const insuinfo = ref([])
+const showInsuinfo = ref(false)
 
-    const readCardData = reactive({
-      mdtrtCertType: null,
-      readCardResult: null,
-      readCardBizType: null,
+const handleClickInjuryinfo = (row) => {
+  row.patNo = patNo.value
+  row.times = currentRow.value.times
+  row.ledgerSn = 0
+  row.aka130 = '41'
+  row.bka003 = '410'
+  injuryOutpatientRegister(row).then(() => {
+    showInsuinfo.value = false
+    clearReadCardData()
+    ElMessage({
+      message: '登记成功',
+      type: 'success',
+      duration: 2000,
+      showClose: true,
     })
+  })
+}
 
-    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 register = (command) => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    medType: medType.value,
+    times: currentRow.value.times,
+    legderSn: 0,
+    needSaving: 1,
+  }
+  if (command === 'execute') {
+    if (injuryMode.value) {
+      employeeInfoInquiry2(param).then((res) => {
+        injuryinfo.value = res
+        showInsuinfo.value = true
+      })
+    } else {
+      obtainBasicPersonInfo(param).then((res) => {
+        insuinfo.value = res.insuinfo
+        showInsuinfo.value = true
+      });
     }
-
-    const handleClickInsuinfo = (row) => {
-      const param = {
-        patNo: patNo.value,
-        times: currentRow.value.times,
-        insutype: row.insutype,
-        psnType: row.psnType,
-        medType: medType.value,
-        balc: row.balc,
-        insuplcAdmdvs: row.insuplcAdmdvs,
-        empName: row.empName,
-        mdtrtCertType: readCardData.mdtrtCertType,
-        readCardResult: readCardData.readCardResult,
-        readCardBizType: readCardData.readCardBizType,
-      }
-      outpatientRegistration(param).then((res) => {
-        clearReadCardData()
-        showInsuinfo.value = false
+  } else if (command === 'revoke') {
+    if (injuryMode.value) {
+      revokeInjuryOutpatientRegistration(param).then(res => {
         ElMessage({
           message: res,
           type: 'success',
@@ -355,294 +362,375 @@ export default {
           showClose: true,
         })
       })
-    }
-
-    const receiptsOpts = (command) => {
-      switch (command) {
-        case 'insert':
-          markMzFees()
-          break
-        case 'delete':
-          deleteMtFees()
-          break
-        case 'upload':
-          qrySpcChrDiseAcct()
-          break
-        case 'retract':
-          revokeFees()
-          break
-      }
-    }
-
-    const markMzFees = () => {
-      if (currentReceipts.value.length === 0) {
+    } else {
+      revokeOutpatientRegistration(param).then((res) => {
         ElMessage({
-          message: '请先选择要保存的处方!',
-          type: 'warning',
-          duration: 2500,
-          showClose: true,
-        })
-        return
-      }
-      ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
-        type: 'warning',
-        confirmButtonText: '生成',
-        cancelButtonText: '取消',
-      }).then(() => {
-        insertSiMzFeesForSupplement(currentReceipts.value).then(() => {
-          currentRow.value.status = '1'
-          ElMessage({
-            message: '已成功生成医保处方。',
-            type: 'success',
-            duration: 2500,
-            showClose: true,
-          })
-        })
-      }).catch(() => {})
-    }
-
-    const matnDises = ref([])
-    const showMatnDises = ref(false)
-    const spcChrDiseAccts = ref([])
-    const showSpcChrAccts = ref(false)
-    const qrySpcChrDiseAcct = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
+          message: res,
+          type: 'success',
           duration: 2000,
           showClose: true,
         })
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        times: currentRow.value.times,
-      }
-      if (medType.value === '51') {
-        queryMzMatnDises().then((res) => {
-          matnDises.value = res
-          showMatnDises.value = true
-        })
-      } else if (medType.value === '14') {
-        querySpecialChronicDiseasesAccreditation(param).then((res) => {
-          spcChrDiseAccts.value = res
-          showSpcChrAccts.value = true
-        })
-      } else {
-        uploadFees(param)
-      }
+      })
     }
+  } else {
+    showInputDiags.value = true
+  }
+}
+
+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,
+    times: currentRow.value.times,
+    insutype: row.insutype,
+    psnType: row.psnType,
+    medType: medType.value,
+    balc: row.balc,
+    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,
+      type: 'success',
+      duration: 2000,
+      showClose: true,
+    })
+  })
+}
+
+const receiptsOpts = (command) => {
+  switch (command) {
+    case 'insert':
+      markMzFees()
+      break
+    case 'delete':
+      deleteMtFees()
+      break
+    case 'upload':
+      qrySpcChrDiseAcct()
+      break
+    case 'retract':
+      revokeFees()
+      break
+  }
+}
 
-    const uploadFees = (row) => {
-      if (medType.value === '51') {
-        row.patNo = patNo.value
-        row.times = currentRow.value.times
-        row.opspDiseCode = row.code
-        row.opspDiseName = row.name
-      }
-      uploadOutpatientFeeDetails(row).then((res) => {
-        showMatnDises.value = false
-        showSpcChrAccts.value = false
-        mzPreSetl()
+const markMzFees = () => {
+  if (currentReceipts.value.length === 0) {
+    ElMessage({
+      message: '请先选择要保存的处方!',
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return
+  }
+  ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
+    type: 'warning',
+    confirmButtonText: '生成',
+    cancelButtonText: '取消',
+  }).then(() => {
+    insertSiMzFeesForSupplement(currentReceipts.value).then(() => {
+      currentRow.value.status = '1'
+      ElMessage({
+        message: '已成功生成医保处方。',
+        type: 'success',
+        duration: 2500,
+        showClose: true,
       })
-    }
+    })
+  }).catch(() => {})
+}
 
-    const mzPreSetl = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        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 + '。'
+const matnDises = ref([])
+const showMatnDises = ref(false)
+const spcChrDiseAccts = ref([])
+const showSpcChrAccts = ref(false)
+const qrySpcChrDiseAcct = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    times: currentRow.value.times,
+    ledgerSn: 0,
+    calType: 0
+  }
+  if (injuryMode.value) {
+    injuryOutpatientFeeUpload(param).then(() => {
+      injuryOutpatientSettlement(param).then(res => {
+        const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
         ElMessageBox.alert(message, '试算成功', {
           type: 'success',
           showCancelButton: false,
-        }).then(() => {
-        })
+        }).then(() => {})
       })
-    }
-
-    const revokeFees = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        times: currentRow.value.times,
-      }
-      revokeOutpatientFeeDetails(param).then((res) => {
-        ElMessage({
-          message: res,
-          type: 'success',
-          duration: 2000,
-          showClose: true,
-        })
+    });
+  } else {
+    if (medType.value === '51') {
+      queryMzMatnDises().then((res) => {
+        matnDises.value = res
+        showMatnDises.value = true
       })
-    }
-
-    const deleteMtFees = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        times: currentRow.value.times,
-      }
-      deleteAllMzReceipts(param).then((res) => {
-        ElMessage({
-          message: res,
-          type: 'success',
-          duration: 2000,
-          showClose: true,
-        })
-        currentReceipts.value = []
-        fetchHistoryReceipts()
+    } else if (medType.value === '14') {
+      querySpecialChronicDiseasesAccreditation(param).then((res) => {
+        spcChrDiseAccts.value = res
+        showSpcChrAccts.value = true
       })
+    } else {
+      uploadFees(param)
     }
+  }
+}
 
-    const mzSettle = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        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',
-          showCancelButton: false,
-        }).then(() => {
-        })
-      })
-    }
+const uploadFees = (row) => {
+  if (medType.value === '51') {
+    row.patNo = patNo.value
+    row.times = currentRow.value.times
+    row.opspDiseCode = row.code
+    row.opspDiseName = row.name
+  }
+  uploadOutpatientFeeDetails(row).then((res) => {
+    showMatnDises.value = false
+    showSpcChrAccts.value = false
+    mzPreSetl()
+  })
+}
 
-    const revokeMzSettle = () => {
-      if (!currentRow.value.times) {
-        ElMessage({
-          message: '请先选择历史处方。',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        times: currentRow.value.times,
-      }
-      revokeOutpatientSettlement(param).then((res) => {
-        ElMessageBox.alert('撤销门诊结算成功', '提示', {
-          type: 'success',
-          showCancelButton: false,
-        })
+const mzPreSetl = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    staffId: store.state.user.info.code,
+    patNo: patNo.value,
+    times: currentRow.value.times,
+    mdtrtCertType: readCardData.mdtrtCertType,
+    readCardResult: readCardData.readCardResult,
+    readCardBizType: readCardData.readCardBizType,
+    ledgerSn: 0,
+    calType: 0
+  }
+  if (injuryMode.value) {
+    injuryOutpatientSettlement(param).then(res => {
+      const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
+      ElMessageBox.alert(message, '试算成功', {
+        type: 'success',
+        showCancelButton: false,
+      }).then(() => {})
+    });
+  } else {
+    outpatientPreSettlement(param).then((res) => {
+      const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
+      ElMessageBox.alert(message, '试算成功', {
+        type: 'success',
+        showCancelButton: false,
+      }).then(() => {
       })
-    }
+    })
+  }
+}
 
-    const settlement = (command) => {
-      if (command === 'pre') {
-        mzPreSetl()
-      } else if (command === 'fin') {
-        mzSettle()
-      } else {
-        revokeMzSettle()
-      }
-    }
+const revokeFees = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    times: currentRow.value.times,
+    ledgerSn: 0,
+  }
+  if (injuryMode.value) {
+    revokeInjuryOutpatientFee(param).then(res => {
+      ElMessage({
+        message: res,
+        type: 'success',
+        duration: 2000,
+        showClose: true,
+      })
+    })
+  } else {
+    revokeOutpatientFeeDetails(param).then((res) => {
+      ElMessage({
+        message: res,
+        type: 'success',
+        duration: 2000,
+        showClose: true,
+      })
+    });
+  }
+}
 
-    const clearinfo = () => {
-      patNo.value = ''
-      medType.value = ''
-      historyReceipts.value = []
-      currentRow.value = {}
-      currentReceipts.value = []
-    }
+const deleteMtFees = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    times: currentRow.value.times,
+  }
+  deleteAllMzReceipts(param).then((res) => {
+    ElMessage({
+      message: res,
+      type: 'success',
+      duration: 2000,
+      showClose: true,
+    })
+    currentReceipts.value = []
+    fetchHistoryReceipts()
+  })
+}
 
-    const highlightYbCode = (hisCode, ybCode) => {
-      if (!hisCode) {
-        return ''
-      }
-      return ybCode ? `<span>${ybCode}</span>` : '<span style="color: red">医师无医保编码</span>'
-    }
+const mzSettle = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    times: currentRow.value.times,
+    saved: 1,
+    mdtrtCertType: readCardData.mdtrtCertType,
+    readCardResult: readCardData.readCardResult,
+    readCardBizType: readCardData.readCardBizType,
+    ledgerSn: 0,
+    calType: 1
+  }
+  if (injuryMode.value) {
+    injuryOutpatientSettlement(param).then(res => {
+      const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
+      ElMessageBox.alert(message, '结算成功', {
+        type: 'success',
+        showCancelButton: false,
+      }).then(() => {})
+    });
+  } else {
+    outpatientSettlement(param).then((res) => {
+      clearReadCardData()
+      const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
+      ElMessageBox.alert(message, '结算成功', {
+        type: 'success',
+        showCancelButton: false,
+      }).then(() => {
+      })
+    })
+  }
+}
 
-    onMounted(() => {
-      getMedTypesByFlag('clinic').then((res) => {
-        medTypes.value = res
+const revokeMzSettle = () => {
+  if (!currentRow.value.times) {
+    ElMessage({
+      message: '请先选择历史处方。',
+      type: 'warning',
+      duration: 2000,
+      showClose: true,
+    })
+    return
+  }
+  const param = {
+    patNo: patNo.value,
+    times: currentRow.value.times,
+    ledgerSn: 0
+  }
+  if (injuryMode.value) {
+    revokeInjuryOutpatientSettlement(param).then(res => {
+      ElMessageBox.alert(res, '提示', {
+        type: 'success',
+        showCancelButton: false,
+      })
+    });
+  } else {
+    revokeOutpatientSettlement(param).then((res) => {
+      ElMessageBox.alert('撤销门诊结算成功', '提示', {
+        type: 'success',
+        showCancelButton: false,
       })
     })
+  }
+}
 
-    return {
-      patNo,
-      medType,
-      medTypes,
-      receiptBoxStyle,
-      historyReceipts,
-      currentRow,
-      currentReceipts,
-      matnDises,
-      showMatnDises,
-      insuinfo,
-      showInsuinfo,
-      spcChrDiseAccts,
-      showSpcChrAccts,
-      shortcuts,
-      dateRange,
-      mzVisit,
-      showInputDiags,
-      mzSettled,
-      isMztczf,
-      afterReadCard,
-      colorStatus,
-      fetchHistoryReceipts,
-      fetchHistoryReceiptDetail,
-      registor,
-      handleClickInsuinfo,
-      receiptsOpts,
-      uploadFees,
-      settlement,
-      revokeMzSettle,
-      clearinfo,
-      highlightYbCode,
-    }
-  },
+const settlement = (command) => {
+  if (command === 'pre') {
+    mzPreSetl()
+  } else if (command === 'fin') {
+    mzSettle()
+  } else {
+    revokeMzSettle()
+  }
 }
+
+const clearinfo = () => {
+  patNo.value = ''
+  medType.value = ''
+  historyReceipts.value = []
+  currentRow.value = {}
+  currentReceipts.value = []
+}
+
+const highlightYbCode = (hisCode, ybCode) => {
+  if (!hisCode) {
+    return ''
+  }
+  return ybCode ? `<span>${ybCode}</span>` : '<span style="color: red">医师无医保编码</span>'
+}
+
+onMounted(() => {
+  getMedTypesByFlag('clinic').then((res) => {
+    medTypes.value = res
+  })
+})
 </script>
 
 <style scoped>