pengjingzhao 1 week ago
parent
commit
994a9b7b7d
1 changed files with 530 additions and 389 deletions
  1. 530 389
      src/views/hospitalization/zy-gl/AdvancePaymentDeal.vue

+ 530 - 389
src/views/hospitalization/zy-gl/AdvancePaymentDeal.vue

@@ -1,41 +1,75 @@
 <template>
   <div class="layout_container">
     <header>
-      <el-button  type="success" icon="Plus"  @click="openShouFee" >收费</el-button>
-      <el-button  type="primary" icon="Delete"  @click="clearData" >清空</el-button>
-      <el-button  type="success" icon="Plus"  @click="openSjh" >设置收据号</el-button>
-      <el-button  type="danger" icon="Money"  @click="openPos" >智能POS工具包</el-button>
+      <el-button type="success" icon="Plus" @click="openShouFee"
+        >收费</el-button
+      >
+      <el-button type="primary" icon="Delete" @click="clearData"
+        >清空</el-button
+      >
+      <el-button type="success" icon="Plus" @click="openSjh"
+        >设置收据号</el-button
+      >
+      <el-button type="danger" icon="Money" @click="openPos"
+        >智能POS工具包</el-button
+      >
     </header>
     <div class="layout_main">
       <div class="demo-collapse">
-        <el-form ref="ruleFormRef"  label-width="127px" :model="formData"   class="demo-ruleForm"
-                 :size="formSize">
+        <el-form
+          ref="ruleFormRef"
+          label-width="127px"
+          :model="formData"
+          class="demo-ruleForm"
+          :size="formSize"
+        >
           <el-collapse v-model="activeName">
             <el-collapse-item title="基本信息" name="1" disabled>
               <el-row>
                 <el-col :span="6">
                   <el-form-item label="住院号" prop="inpatientNo">
-                    <el-input v-model="formData.inpatientNo" clearable  @keyup.enter="queryPatientList(formData.inpatientNo)">
+                    <el-input
+                      v-model="formData.inpatientNo"
+                      clearable
+                      @keyup.enter="queryPatientList(formData.inpatientNo)"
+                    >
                       <template #append>
-                        <el-button  icon="Search"  @click="queryPatientList(formData.inpatientNo)"/>
+                        <el-button
+                          icon="Search"
+                          @click="queryPatientList(formData.inpatientNo)"
+                        />
                       </template>
                     </el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="6">
                   <el-form-item label="门诊号" prop="patientId">
-                    <el-input v-model="formData.patientId" clearable  @keyup.enter="queryPatientList(formData.patientId)">
+                    <el-input
+                      v-model="formData.patientId"
+                      clearable
+                      @keyup.enter="queryPatientList(formData.patientId)"
+                    >
                       <template #append>
-                        <el-button  icon="Search" @click="queryPatientList(formData.patientId)"/>
+                        <el-button
+                          icon="Search"
+                          @click="queryPatientList(formData.patientId)"
+                        />
                       </template>
                     </el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="6">
                   <el-form-item label="姓名" prop="name">
-                    <el-input v-model="formData.name" clearable  @keyup.enter="queryPatientList(formData.name)" >
+                    <el-input
+                      v-model="formData.name"
+                      clearable
+                      @keyup.enter="queryPatientList(formData.name)"
+                    >
                       <template #append>
-                        <el-button  icon="Search"  @click="queryPatientList(formData.name)"/>
+                        <el-button
+                          icon="Search"
+                          @click="queryPatientList(formData.name)"
+                        />
                       </template>
                     </el-input>
                   </el-form-item>
@@ -81,7 +115,7 @@
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="" prop="inpatientNoType">
-                    <el-radio-group v-model="formData.inOutFlag" >
+                    <el-radio-group v-model="formData.inOutFlag">
                       <el-radio-button label="在院病人" :value="0" />
                       <el-radio-button label="出院病人" :value="1" />
                     </el-radio-group>
@@ -99,39 +133,107 @@
       </div>
       <div class="layout_el-table">
         <el-table :data="tableData" stripe style="width: 100%">
-          <el-table-column align="center"  property="admissTimes" label="住院次数" />
-          <el-table-column align="center"  property="ledgerSn" label="账页号" />
-          <el-table-column align="center" width="150" property="depoDate" label="时间" />
-          <el-table-column align="center"  property="statusName" label="事务" />
-          <el-table-column align="center"  property="depoAmount"  label="金额" />
-          <el-table-column align="center"  property="receiptNo" label="收据号" />
-          <el-table-column align="center"  property="depoTypeName" label="收费方式" >
+          <el-table-column
+            align="center"
+            property="admissTimes"
+            label="住院次数"
+          />
+          <el-table-column align="center" property="ledgerSn" label="账页号" />
+          <el-table-column
+            align="center"
+            width="150"
+            property="depoDate"
+            label="时间"
+          />
+          <el-table-column align="center" property="statusName" label="事务" />
+          <el-table-column align="center" property="depoAmount" label="金额" />
+          <el-table-column align="center" property="receiptNo" label="收据号" />
+          <el-table-column
+            align="center"
+            property="depoTypeName"
+            label="收费方式"
+          >
           </el-table-column>
           <el-table-column align="center" property="chequeNo" label="凭证号" />
-          <el-table-column align="center"  property="opIdName" label="操作员" />
+          <el-table-column align="center" property="opIdName" label="操作员" />
           <el-table-column label="操作" width="200">
-            <template #default="scope" >
-              <el-button v-if="formData.inOutFlag ===0 && scope.row.settleType === '0' && scope.row.status === '1' && scope.row.reportFlag !== '1'" size="small" type="danger" icon="Back"  @click="openRefund(scope.row)" >退费</el-button>
-              <el-button v-if="formData.inOutFlag ===0 && scope.row.printed !==1 && scope.row.status ==='1' && scope.row.reportFlag !=='1' " size="small" type="primary" icon="Printer" @click="printShouJu(scope.row.inpatientNo,scope.row.receiptNo,false)">打印收据</el-button>
-              <el-button v-if="formData.inOutFlag ===0 && scope.row.status ==='1' && scope.row.printed === 1 && scope.row.reportFlag !=='1' " size="small" type="primary" icon="Printer" @click="printShouJu(scope.row.inpatientNo,scope.row.receiptNo,true)" >重打收据</el-button>
+            <template #default="scope">
+              <el-button
+                v-if="
+                  formData.inOutFlag === 0 &&
+                  scope.row.settleType === '0' &&
+                  scope.row.status === '1' &&
+                  scope.row.reportFlag !== '1'
+                "
+                size="small"
+                type="danger"
+                icon="Back"
+                @click="openRefund(scope.row)"
+                >退费</el-button
+              >
+              <el-button
+                v-if="
+                  formData.inOutFlag === 0 &&
+                  scope.row.printed !== 1 &&
+                  scope.row.status === '1' &&
+                  scope.row.reportFlag !== '1'
+                "
+                size="small"
+                type="primary"
+                icon="Printer"
+                @click="
+                  printShouJu(scope.row.inpatientNo, scope.row.receiptNo, false)
+                "
+                >打印收据</el-button
+              >
+              <el-button
+                v-if="
+                  formData.inOutFlag === 0 &&
+                  scope.row.status === '1' &&
+                  scope.row.printed === 1 &&
+                  scope.row.reportFlag !== '1'
+                "
+                size="small"
+                type="primary"
+                icon="Printer"
+                @click="
+                  printShouJu(scope.row.inpatientNo, scope.row.receiptNo, true)
+                "
+                >重打收据</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
-        <div style="width: 100%;height: 50px;margin-top: 10px;margin-left: 20px;font-size: 18px">
-           <el-row>
-             <el-col :span="12">预交金合计: {{formData.yjjHj}}</el-col>
-             <el-col :span="12">直退押金合计: {{formData.ztYjjHj}}</el-col>
-           </el-row>
+        <div
+          style="
+            width: 100%;
+            height: 50px;
+            margin-top: 10px;
+            margin-left: 20px;
+            font-size: 18px;
+          "
+        >
+          <el-row>
+            <el-col :span="12">预交金合计: {{ formData.yjjHj }}</el-col>
+            <el-col :span="12">直退押金合计: {{ formData.ztYjjHj }}</el-col>
+          </el-row>
         </div>
       </div>
     </div>
   </div>
-  <el-dialog v-model="patientVisible" title="病人信息" width="500"  draggable>
-    <el-table :data="patientTableData" style="width: 100%" height="300" stripe  border @row-click="fetchPatient" >
-      <el-table-column align="center" prop="name" label="姓名"  />
-      <el-table-column align="center"  prop="inpatientNo" label="住院号"  />
-      <el-table-column align="center"  prop="admissTimes" label="住院次数"  />
-      <el-table-column align="center"  prop="sexName" label="性别"  />
+  <el-dialog v-model="patientVisible" title="病人信息" width="500" draggable>
+    <el-table
+      :data="patientTableData"
+      style="width: 100%"
+      height="300"
+      stripe
+      border
+      @row-click="fetchPatient"
+    >
+      <el-table-column align="center" prop="name" label="姓名" />
+      <el-table-column align="center" prop="inpatientNo" label="住院号" />
+      <el-table-column align="center" prop="admissTimes" label="住院次数" />
+      <el-table-column align="center" prop="sexName" label="性别" />
     </el-table>
     <template #footer>
       <div class="dialog-footer">
@@ -139,14 +241,24 @@
       </div>
     </template>
   </el-dialog>
-  <el-dialog v-model="shouFeeVisible" title="缴费" width="400"  @closed="clearShouFeeForm"  draggable>
-    <el-form   class="demo-ruleForm" label-width="127px"
-              :size="formSize" >
+  <el-dialog
+    v-model="shouFeeVisible"
+    title="缴费"
+    width="400"
+    @closed="clearShouFeeForm"
+    draggable
+  >
+    <el-form class="demo-ruleForm" label-width="127px" :size="formSize">
       <el-row>
         <el-col :span="24">
           <el-form-item label="收费方式*">
             <el-select v-model="shouFeeForm.depoType">
-              <el-option v-for="item in zdChequeTypes" :key="item.code" :label="item.name" :value="item.code"></el-option>
+              <el-option
+                v-for="item in zdChequeTypes"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              ></el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -154,7 +266,12 @@
       <el-row>
         <el-col :span="24">
           <el-form-item label="金额">
-            <el-input-number v-model="shouFeeForm.depoAmount"  :controls="false" :precision="2" :min="0"/>
+            <el-input-number
+              v-model="shouFeeForm.depoAmount"
+              :controls="false"
+              :precision="2"
+              :min="0"
+            />
           </el-form-item>
         </el-col>
       </el-row>
@@ -169,19 +286,25 @@
     <template #footer>
       <div class="dialog-footer">
         <el-button type="primary" @click="shuaKa">刷卡/扫码</el-button>
-        <el-button type="success" icon="Check" @click="saveShouFee">保存</el-button>
+        <el-button type="success" icon="Check" @click="saveShouFee"
+          >保存</el-button
+        >
         <el-button @click="shouFeeVisible = false">关闭</el-button>
       </div>
     </template>
   </el-dialog>
-  <el-dialog v-model="refundVisible" title="退费" width="400"   draggable>
-    <el-form   class="demo-ruleForm" label-width="127px"
-                >
+  <el-dialog v-model="refundVisible" title="退费" width="400" draggable>
+    <el-form class="demo-ruleForm" label-width="127px">
       <el-row>
         <el-col :span="24">
           <el-form-item label="支付方式*">
             <el-select v-model="refundForm.depoType">
-              <el-option v-for="item in zdChequeTypes" :key="item.code" :label="item.name" :value="item.code"></el-option>
+              <el-option
+                v-for="item in zdChequeTypes"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              ></el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -189,14 +312,14 @@
       <el-row>
         <el-col :span="24">
           <el-form-item label="金额">
-            <el-input v-model="refundForm.depoAmount"  disabled/>
+            <el-input v-model="refundForm.depoAmount" disabled />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="24">
           <el-form-item label="收据号">
-            <el-input v-model="refundForm.receiptNo"  disabled/>
+            <el-input v-model="refundForm.receiptNo" disabled />
           </el-form-item>
         </el-col>
       </el-row>
@@ -209,13 +332,12 @@
       </div>
     </template>
   </el-dialog>
-  <el-dialog v-model="sjhVisible" title="设置收据号" width="400"   draggable>
-    <el-form   class="demo-ruleForm" label-width="127px"
-    >
+  <el-dialog v-model="sjhVisible" title="设置收据号" width="400" draggable>
+    <el-form class="demo-ruleForm" label-width="127px">
       <el-row>
         <el-col :span="24">
           <el-form-item label="当前收据号:">
-            <el-input-number v-model="currentNo" :min="1"/>
+            <el-input-number v-model="currentNo" :min="1" />
           </el-form-item>
         </el-col>
       </el-row>
@@ -227,62 +349,81 @@
       </div>
     </template>
   </el-dialog>
-    <div id="report_table" v-show="false"
-         style="width:192mm;height:97mm;margin:0 auto;border: 1px solid #337ab7;font-size: 10px;padding-top: 5mm;overflow-y: auto; overflow-x:hidden;">
-      <div id="report_table_1">
-        <div style="text-align:center;font-weight: 700;padding-top: -8mm">{{hospitalName}}</div>
-        <div style="text-align:center;font-weight: 700;margin-top: 5px;">预交金收据</div>
-        <div>
-          <span>收据日期:</span><span style="margin-left: 7mm;" id="printDate">{{getFormatDatetime(new Date,'YYYY年MM月DD日 HH时mm分ss秒')}}</span>
-        </div>
-        <div>
-          <span style="">收据号:</span><span style="margin-left: 4mm;">{{printData.receiptNo}}</span><span style="margin-left: 2mm;">{{printData.cdFlag}}</span>
-        </div>
-        <table class="pageTable" style="width: 170mm;">
-          <tbody>
+  <div
+    id="report_table"
+    v-show="false"
+    style="
+      width: 192mm;
+      height: 97mm;
+      margin: 0 auto;
+      border: 1px solid #337ab7;
+      font-size: 10px;
+      padding-top: 5mm;
+      overflow-y: auto;
+      overflow-x: hidden;
+    "
+  >
+    <div id="report_table_1">
+      <div style="text-align: center; font-weight: 700; padding-top: -8mm">
+        {{ hospitalName }}
+      </div>
+      <div style="text-align: center; font-weight: 700; margin-top: 5px">
+        预交金收据
+      </div>
+      <div>
+        <span>收据日期:</span
+        ><span style="margin-left: 4mm" id="printDate">{{
+          getFormatDatetime(new Date(), "YYYY-MM-DD HH:mm:ss")
+        }}</span>
+        <span style="margin-left: 40mm">收据号:</span
+        ><span style="margin-left: 4mm">{{ printData.receiptNo }}</span
+        ><span style="margin-left: 2mm">{{ printData.cdFlag }}</span>
+      </div>
+      <table class="pageTable" style="width: 170mm">
+        <tbody>
           <tr>
-            <td style="width: 15mm;">病人ID</td>
-            <td style="width: 20mm;" >{{printData.patientId}}</td>
+            <td style="width: 15mm">病人ID</td>
+            <td style="width: 20mm">{{ printData.patientId }}</td>
             <td>住院号</td>
-            <td style="width: 20mm;" >{{printData.inpatientNo}}</td>
+            <td style="width: 20mm">{{ printData.inpatientNo }}</td>
             <td colspan="3">姓名</td>
-            <td colspan="2">{{printData.name}}</td>
+            <td colspan="2">{{ printData.name }}</td>
           </tr>
           <tr>
             <td>住院科室</td>
-            <td colspan="2">{{printData.admissDeptName}}</td>
+            <td colspan="2">{{ printData.admissDeptName }}</td>
             <td>支付方式</td>
-            <td colspan="2" >{{printData.depoTypeName}}</td>
+            <td colspan="2">{{ printData.depoTypeName }}</td>
             <td colspan="2">操作类型</td>
             <td>交款</td>
           </tr>
           <tr>
             <td>金额</td>
-            <td >{{printData.depoAmount}}</td>
+            <td>{{ printData.depoAmount }}</td>
             <td>支票号</td>
-            <td colspan="6">{{printData.chequeNo}}</td>
+            <td colspan="6">{{ printData.chequeNo }}</td>
           </tr>
           <tr>
             <td>大写金额</td>
-            <td colspan="5">{{printData.depoAmountDx}}</td>
+            <td colspan="5">{{ printData.depoAmountDx }}</td>
             <td colspan="2">收费员</td>
-            <td >{{printData.opIdCodeName}}</td>
+            <td>{{ printData.opIdCodeName }}</td>
           </tr>
           <tr>
             <td colspan="9" rowspan="3" style="height: 26mm">
-              1、此系临时收据,请妥善保管。出院时凭此收据按实用医疗费用换取住院发票。<br/>
-              2、此收据遗失,请及时携带病人身份证和挂失人身份证到出院结算处办理挂失手续。如存在第三方肇事者预缴医疗费用,挂失时另需公安机关出示证明。<br/>
+              1、此系临时收据,请妥善保管。出院时凭此收据按实用医疗费用换取住院发票。<br />
+              2、此收据遗失,请及时携带病人身份证和挂失人身份证到出院结算处办理挂失手续。如存在第三方肇事者预缴医疗费用,挂失时另需公安机关出示证明。<br />
               3、如果您的缴费方式为银行卡支付,请您妥善保管好缴费的刷卡单,并于办理出院退费时带上缴费时所用银行卡。
             </td>
           </tr>
-          </tbody>
-        </table>
-      </div>
+        </tbody>
+      </table>
     </div>
+  </div>
   <PosTransaction ref="posTransactionRef"></PosTransaction>
 </template>
 <script setup>
-import {onMounted, ref} from "vue";
+import { onMounted, ref } from "vue";
 import router from "@/router";
 import sleep from "@/utils/sleep";
 import {
@@ -291,193 +432,192 @@ import {
   printZyDepositFile,
   queryPrintAdvancePayment,
   queryLastMzZyReq,
-  queryAdvancePaymentPatientList
-} from '@/api/zy-gl/advance-paymentDeal'
-import {
-  queryHospitalName
-} from '@/api/zy-gl/zy-daily'
-import {getLodop,initLodop} from "@/utils/c-lodop.js";
-import {ElMessage, ElMessageBox} from "element-plus";
-import PosTransaction from "@/components/zfsf/PosTransaction.vue"
-import {queryZdChequeType} from "@/api/zfsf/cashier-process.js";
-import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils.js";
-import {consume} from "@/api/zfsf/pos-transaction.js";
-import {getFormatDatetime} from "../../../utils/date.js";
-import {saveYjjSjh,queryYjjSjh} from '@/api/zfsf/sfbillno'
-import {queryLastWindowsIpAddress} from "@/api/zy-gl/admission-registration.js";
-const sjhVisible = ref(false)
-const currentNo = ref(null)
-const openSjh = ()=>{
-  sjhVisible.value = true
-  queryYjjSjh({}).then(res=>{
-    currentNo.value = res.currentNo
-  })
-}
+  queryAdvancePaymentPatientList,
+} from "@/api/zy-gl/advance-paymentDeal";
+import { queryHospitalName } from "@/api/zy-gl/zy-daily";
+import { getLodop, initLodop } from "@/utils/c-lodop.js";
+import { ElMessage, ElMessageBox } from "element-plus";
+import PosTransaction from "@/components/zfsf/PosTransaction.vue";
+import { queryZdChequeType } from "@/api/zfsf/cashier-process.js";
+import { stringIsBlank, stringNotBlank } from "@/utils/blank-utils.js";
+import { consume } from "@/api/zfsf/pos-transaction.js";
+import { getFormatDatetime } from "../../../utils/date.js";
+import { saveYjjSjh, queryYjjSjh } from "@/api/zfsf/sfbillno";
+import { queryLastWindowsIpAddress } from "@/api/zy-gl/admission-registration.js";
+const sjhVisible = ref(false);
+const currentNo = ref(null);
+const openSjh = () => {
+  sjhVisible.value = true;
+  queryYjjSjh({}).then(res => {
+    currentNo.value = res.currentNo;
+  });
+};
 
-const saveSjh =()=>{
+const saveSjh = () => {
   saveYjjSjh({
-    currentNo :currentNo.value
-  }).then(res=>{
-    sjhVisible.value = false
-  })
-}
+    currentNo: currentNo.value,
+  }).then(res => {
+    sjhVisible.value = false;
+  });
+};
 
-const hospitalName = ref('')
-const posTransactionRef = ref(null)
+const hospitalName = ref("");
+const posTransactionRef = ref(null);
 const printData = ref({
-  patientId:'',
-  receiptNo:'',
-  inpatientNo:'',
-  name:'',
-  admissDeptName:'',
-  depoTypeName:'',
-  depoAmount:'',
-  depoAmountDx:'',
-  opIdCodeName:'',
-  cdFlag:'',
-  depoDate:'',
-})
+  patientId: "",
+  receiptNo: "",
+  inpatientNo: "",
+  name: "",
+  admissDeptName: "",
+  depoTypeName: "",
+  depoAmount: "",
+  depoAmountDx: "",
+  opIdCodeName: "",
+  cdFlag: "",
+  depoDate: "",
+});
 
-onActivated(async ()=>{
+onActivated(async () => {
   const params = router.currentRoute.value.query;
-  if(params && params.patNo){
+  if (params && params.patNo) {
     await sleep(300);
-    formData.value.inpatientNo =params.patNo
-    queryPatientList(params.patNo)
+    formData.value.inpatientNo = params.patNo;
+    queryPatientList(params.patNo);
   }
-})
-const clearPrintData=()=>{
+});
+const clearPrintData = () => {
   printData.value = {
-    patientId:'',
-    inpatientNo:'',
-    name:'',
-    admissDeptName:'',
-    depoTypeName:'',
-    depoAmount:'',
-    depoAmountDx:'',
-    opIdCodeName:'',
-    cdFlag:'',
-  }
-}
+    patientId: "",
+    inpatientNo: "",
+    name: "",
+    admissDeptName: "",
+    depoTypeName: "",
+    depoAmount: "",
+    depoAmountDx: "",
+    opIdCodeName: "",
+    cdFlag: "",
+  };
+};
 
 const formData = ref({
-  inpatientNo:'',
-  patientId:'',
-  name:'',
-  sexName:'',
-  bedNo:'',
-  wardName:'',
-  admissDate:'',
-  responceTypeName:'',
-  totalCharge:null,
-  balance:null,
-  inOutFlag:0,
-  yjjHj:0,
-  ztYjjHj:0,
-})
-const shouFeeVisible = ref(false)
+  inpatientNo: "",
+  patientId: "",
+  name: "",
+  sexName: "",
+  bedNo: "",
+  wardName: "",
+  admissDate: "",
+  responceTypeName: "",
+  totalCharge: null,
+  balance: null,
+  inOutFlag: 0,
+  yjjHj: 0,
+  ztYjjHj: 0,
+});
+const shouFeeVisible = ref(false);
 const shouFeeForm = ref({
-  depoType : 'O',
-  status : '',
-  autoFlag : 0,
-  inpatientNo : '',
-  depoAmount : null,
-  chequeNo : '',
-  psordnum : '',
-  agtordnum : '',
-  transDate : '',
-  parChannel : '',
-  traceNo : '',
-  receiptNo : '',
-})
+  depoType: "O",
+  status: "",
+  autoFlag: 0,
+  inpatientNo: "",
+  depoAmount: null,
+  chequeNo: "",
+  psordnum: "",
+  agtordnum: "",
+  transDate: "",
+  parChannel: "",
+  traceNo: "",
+  receiptNo: "",
+});
 // 保存收费
-const saveShouFee =()=>{
-    shouFeeForm.value.inpatientNo = formData.value.inpatientNo
-    shouFeeForm.value.status = "1"
-    saveAdvancePayment(shouFeeForm.value).then(res=>{
-       shouFeeVisible.value = false
-      ElMessage.success('收费成功')
-      ElMessageBox.confirm('请确认是否打印收据?', {
-        cancelButtonText: '取消',
-        confirmButtonText: '确定',
-      })
-          .then(() => {
-            printShouJu(res.inpatientNo,res.receiptNo,false)
-          })
-    })
-
-}
+const saveShouFee = () => {
+  shouFeeForm.value.inpatientNo = formData.value.inpatientNo;
+  shouFeeForm.value.status = "1";
+  saveAdvancePayment(shouFeeForm.value).then(res => {
+    shouFeeVisible.value = false;
+    ElMessage.success("收费成功");
+    ElMessageBox.confirm("请确认是否打印收据?", {
+      cancelButtonText: "取消",
+      confirmButtonText: "确定",
+    }).then(() => {
+      printShouJu(res.inpatientNo, res.receiptNo, false);
+    });
+  });
+};
 
-const refundVisible = ref(false)
+const refundVisible = ref(false);
 
-const openRefund = (row)=>{
-  refundForm.value.inpatientNo = row.inpatientNo
-  refundForm.value.receiptNo = row.receiptNo
-  refundForm.value.depoType = row.depoType
-  refundForm.value.status = 2
-  refundForm.value.depoAmount = row.depoAmount
-  refundVisible.value = true
-}
+const openRefund = row => {
+  refundForm.value.inpatientNo = row.inpatientNo;
+  refundForm.value.receiptNo = row.receiptNo;
+  refundForm.value.depoType = row.depoType;
+  refundForm.value.status = 2;
+  refundForm.value.depoAmount = row.depoAmount;
+  refundVisible.value = true;
+};
 
-const refundForm =ref({
-  depoType:'',
-  inpatientNo:'',
-  depoAmount:'',
-  receiptNo:'',
-  status:2,
-  refundType:0,
-})
+const refundForm = ref({
+  depoType: "",
+  inpatientNo: "",
+  depoAmount: "",
+  receiptNo: "",
+  status: 2,
+  refundType: 0,
+});
 
 // 退费
-const refundYjj = (refundType)=>{
-  refundForm.value.refundType = refundType
-  saveAdvancePayment(refundForm.value).then(res=>{
-    ElMessage.success('退费成功')
-    if(stringNotBlank(res.warMessage)){
-      ElMessage.warning(warMessage)
+const refundYjj = refundType => {
+  refundForm.value.refundType = refundType;
+  saveAdvancePayment(refundForm.value).then(res => {
+    ElMessage.success("退费成功");
+    if (stringNotBlank(res.warMessage)) {
+      ElMessage.warning(warMessage);
     }
-    refundVisible.value = false
-    queryPatientList(res.inpatientNo)
-  })
-}
+    refundVisible.value = false;
+    queryPatientList(res.inpatientNo);
+  });
+};
 
 // 打印收据 flag true 重打  false 首次打印
-const printShouJu = (inpatientNo,receiptNo,flag)=>{
-    // 重打
-    if(flag){
-      printReal(inpatientNo,receiptNo,flag)
-    }else {
-      printZyDepositFile(receiptNo).then(res=>{
-        printReal(inpatientNo,receiptNo,flag)
-        queryPatientList(inpatientNo)
-      })
-    }
-}
+const printShouJu = (inpatientNo, receiptNo, flag) => {
+  // 重打
+  if (flag) {
+    printReal(inpatientNo, receiptNo, flag);
+  } else {
+    printZyDepositFile(receiptNo).then(res => {
+      printReal(inpatientNo, receiptNo, flag);
+      queryPatientList(inpatientNo);
+    });
+  }
+};
 
-const printReal =(inpatientNo,receiptNo,flag)=>{
+const printReal = (inpatientNo, receiptNo, flag) => {
   queryPrintAdvancePayment({
-    inpatientNo:inpatientNo,
-    receiptNo:receiptNo,
-  }).then(res=>{
-    printData.value.inpatientNo =res.inpatientNo
-    printData.value.patientId = res.patientId
-    printData.value.name = res.name
-    printData.value.admissDeptName = res.admissDeptName
-    printData.value.depoAmount = res.depoAmount
-    printData.value.depoTypeName = res.depoTypeName
-    printData.value.depoAmountDx = res.depoAmountDx
-    printData.value.opIdCodeName = res.opIdCodeName
-    printData.value.receiptNo = res.receiptNo
-    printData.value.depoDate = getFormatDatetime(res.depoDate,'YYYY年MM月DD日')
-    if(flag){
-      printData.value.cdFlag = '重打'
+    inpatientNo: inpatientNo,
+    receiptNo: receiptNo,
+  }).then(res => {
+    printData.value.inpatientNo = res.inpatientNo;
+    printData.value.patientId = res.patientId;
+    printData.value.name = res.name;
+    printData.value.admissDeptName = res.admissDeptName;
+    printData.value.depoAmount = res.depoAmount;
+    printData.value.depoTypeName = res.depoTypeName;
+    printData.value.depoAmountDx = res.depoAmountDx;
+    printData.value.opIdCodeName = res.opIdCodeName;
+    printData.value.receiptNo = res.receiptNo;
+    printData.value.depoDate = getFormatDatetime(
+      res.depoDate,
+      "YYYY年MM月DD日"
+    );
+    if (flag) {
+      printData.value.cdFlag = "重打";
     }
-    setTimeout(printSjNew,1000)
-  })
-}
-const printCode = ref(null)
+    setTimeout(printSjNew, 1000);
+  });
+};
+const printCode = ref(null);
 
-function printSjNew(){
+function printSjNew() {
   let LODOP = getLodop();
   //设置默认打印机
   // if(stringIsBlank(printCode.value)){
@@ -497,8 +637,9 @@ function printSjNew(){
   LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
   LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "290mm");
   LODOP.SET_PRINT_PAGESIZE(1, "210mm", "290mm", "CreateCustomPage");
-  LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "住院预交金");//对新建的纸张重命名
-  let strStyle = "<style>table{width: 180mm;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse;padding: 8px;}</style>"
+  LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "住院预交金"); //对新建的纸张重命名
+  let strStyle =
+    "<style>table{width: 180mm;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse;padding: 8px;}</style>";
   let printContent = document.getElementById("report_table_1").innerHTML;
   // + `<div style="margin-bottom:30px"></div>` + document.getElementById("report_table_1").innerHTML
   LODOP.ADD_PRINT_HTM("0mm", "8mm", "130mm", "280mm", strStyle + printContent);
@@ -509,180 +650,180 @@ function printSjNew(){
   // }, 200);
 }
 
-const printAgain = (row)=>{
+const printAgain = row => {
   let LODOP = getLodop();
   LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
   LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
   LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "290mm");
   LODOP.SET_PRINT_PAGESIZE(1, "210mm", "290mm", "CreateCustomPage");
-  LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "住院预交金");//对新建的纸张重命名
-  let strStyle = "<style>table{width: 180mm;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse;padding: 8px;}</style>"
-  LODOP.ADD_PRINT_HTM("0mm", "8mm", "130mm", "280mm", strStyle + document.getElementById("report_table_1").innerHTML);
+  LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "住院预交金"); //对新建的纸张重命名
+  let strStyle =
+    "<style>table{width: 180mm;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse;padding: 8px;}</style>";
+  LODOP.ADD_PRINT_HTM(
+    "0mm",
+    "8mm",
+    "130mm",
+    "280mm",
+    strStyle + document.getElementById("report_table_1").innerHTML
+  );
   // LODOP.PRINT();
   LODOP.PREVIEW();
-  clearPrintData()
-}
-
+  clearPrintData();
+};
 
-
-const clearShouFeeForm =()=>{
+const clearShouFeeForm = () => {
   shouFeeForm.value = {
-    depoType : 'O',
-    status : '',
-    autoFlag : 0,
-    inpatientNo : '',
-    depoAmount : '',
-    chequeNo : '',
-    psordnum : '',
-    agtordnum : '',
-    transDate : '',
-    parChannel : '',
-    traceNo : '',
-    receiptNo : '',
-  }
-}
+    depoType: "O",
+    status: "",
+    autoFlag: 0,
+    inpatientNo: "",
+    depoAmount: "",
+    chequeNo: "",
+    psordnum: "",
+    agtordnum: "",
+    transDate: "",
+    parChannel: "",
+    traceNo: "",
+    receiptNo: "",
+  };
+};
 
 // 刷卡
-const shuaKa =()=>{
-  if(stringIsBlank(shouFeeForm.value.depoAmount)){
-    ElMessage.error('输入收费金额')
-    return
+const shuaKa = () => {
+  if (stringIsBlank(shouFeeForm.value.depoAmount)) {
+    ElMessage.error("输入收费金额");
+    return;
   }
   let obj = {
-    chequeType : shouFeeForm.value.depoType,
-    amt : shouFeeForm.value.depoAmount,
-    type : 1
-  }
-  consume(obj).then(res=>{
+    chequeType: shouFeeForm.value.depoType,
+    amt: shouFeeForm.value.depoAmount,
+    type: 1,
+  };
+  consume(obj).then(res => {
     // 1 联机刷卡 0 不联机 直接输凭证号
-    shouFeeForm.value.autoFlag = 1
-    shouFeeForm.value.psordnum = res.refNo
-    shouFeeForm.value.agtordnum = res.wxAliPayOrderNo
-    shouFeeForm.value.transDate = res.transDate
-    shouFeeForm.value.parChannel = res.payChannel
-    shouFeeForm.value.traceNo = res.traceNo
-    shouFeeForm.value.receiptNo = res.lsOrderNo
-  })
-}
+    shouFeeForm.value.autoFlag = 1;
+    shouFeeForm.value.psordnum = res.refNo;
+    shouFeeForm.value.agtordnum = res.wxAliPayOrderNo;
+    shouFeeForm.value.transDate = res.transDate;
+    shouFeeForm.value.parChannel = res.payChannel;
+    shouFeeForm.value.traceNo = res.traceNo;
+    shouFeeForm.value.receiptNo = res.lsOrderNo;
+  });
+};
 
-const openShouFee = ()=>{
-  if(stringIsBlank(formData.value.name)){
-    ElMessage.error('请先查询出要缴费的病人信息')
-    return
+const openShouFee = () => {
+  if (stringIsBlank(formData.value.name)) {
+    ElMessage.error("请先查询出要缴费的病人信息");
+    return;
   }
-  queryLastMzZyReq({inpatientNo:formData.value.patientId}).then(res=>{
-    if(res.deposit != null && res.deposit > 0){
-      shouFeeForm.value.depoAmount = res.deposit
+  queryLastMzZyReq({ inpatientNo: formData.value.patientId }).then(res => {
+    if (res.deposit != null && res.deposit > 0) {
+      shouFeeForm.value.depoAmount = res.deposit;
     }
-  })
-  shouFeeVisible.value = true
-
-}
-const zdChequeTypes = ref([])
+  });
+  shouFeeVisible.value = true;
+};
+const zdChequeTypes = ref([]);
 
-const openPos = ()=>{
-  posTransactionRef.value.openOuter()
-}
-const patientVisible = ref(false)
-const patientTableData = ref([])
-const clearData = ()=>{
+const openPos = () => {
+  posTransactionRef.value.openOuter();
+};
+const patientVisible = ref(false);
+const patientTableData = ref([]);
+const clearData = () => {
   formData.value = {
-    inpatientNo:'',
-    patientId:'',
-    name:'',
-    sexName:'',
-    bedNo:'',
-    wardName:'',
-    admissDate:'',
-    responceTypeName:'',
-    totalCharge:null,
-    balance:null,
-    inOutFlag:0,
-    yjjHj:0,
-    ztYjjHj:0,
-  }
-  tableData.value = []
-}
+    inpatientNo: "",
+    patientId: "",
+    name: "",
+    sexName: "",
+    bedNo: "",
+    wardName: "",
+    admissDate: "",
+    responceTypeName: "",
+    totalCharge: null,
+    balance: null,
+    inOutFlag: 0,
+    yjjHj: 0,
+    ztYjjHj: 0,
+  };
+  tableData.value = [];
+};
 
-function setformData(data){
-  formData.value.inpatientNo = data.inpatientNo
-  formData.value.patientId = data.patientId
-  formData.value.name = data.name
-  formData.value.sexName = data.sexName
-  formData.value.bedNo = data.bedNo
-  formData.value.wardName = data.wardName
-  formData.value.admissDate = data.admissDate
-  formData.value.responceTypeName = data.responceTypeName
-  formData.value.totalCharge = data.totalCharge
-  formData.value.balance = data.balance
-  formData.value.yjjHj = data.yjjHj
-  formData.value.ztYjjHj = data.ztYjjHj
+function setformData(data) {
+  formData.value.inpatientNo = data.inpatientNo;
+  formData.value.patientId = data.patientId;
+  formData.value.name = data.name;
+  formData.value.sexName = data.sexName;
+  formData.value.bedNo = data.bedNo;
+  formData.value.wardName = data.wardName;
+  formData.value.admissDate = data.admissDate;
+  formData.value.responceTypeName = data.responceTypeName;
+  formData.value.totalCharge = data.totalCharge;
+  formData.value.balance = data.balance;
+  formData.value.yjjHj = data.yjjHj;
+  formData.value.ztYjjHj = data.ztYjjHj;
 }
 
-onMounted(()=>{
-  initLodop()
-  queryZdChequeType().then(res=>{
-    zdChequeTypes.value = res
-  })
-  queryHospitalName().then(res=>hospitalName.value = res)
-  queryLastWindowsIpAddress().then(res=>{
-    printCode.value = res.zyYjjPrintIndex
-  })
-})
-
-
-const fetchPatient =(row)=>{
-    queryAdvancePayment({
-      inpatientNo:row.inpatientNo,
-      inOutFlag:formData.value.inOutFlag,
-      admissTimes:row.admissTimes,
-    }).then(res=>{
-      patientVisible.value = false
-      if(res == null || res.length === 0){
-        ElMessage.error('没有查询到数据')
-        clearData()
-      }else {
-        setformData(res)
-        tableData.value = res.zyDepositFiles
-      }
-    })
-}
-const queryPatientList = (code)=>{
-    queryAdvancePaymentPatientList({
-      inpatientNo : code,
-      inOutFlag : formData.value.inOutFlag
-    }).then(res=>{
-       if(res == null || res.length === 0){
-         ElMessage.error('没有查询到数据')
-         clearData()
-       }
-       else if(res.length ===1){
-          let row = {
-            inpatientNo:res[0].inpatientNo,
-            admissTimes:res[0].admissTimes,
-          }
-          fetchPatient(row)
-        }
-        else if(res.length > 1){
-          patientVisible.value = true
-          patientTableData.value = res
-        }
+onMounted(() => {
+  initLodop();
+  queryZdChequeType().then(res => {
+    zdChequeTypes.value = res;
+  });
+  queryHospitalName().then(res => (hospitalName.value = res));
+  queryLastWindowsIpAddress().then(res => {
+    printCode.value = res.zyYjjPrintIndex;
+  });
+});
 
-    })
-}
-const tableData = ref([])
-const activeName = ref(['1', '2'])
-const formSize = ref('default')
+const fetchPatient = row => {
+  queryAdvancePayment({
+    inpatientNo: row.inpatientNo,
+    inOutFlag: formData.value.inOutFlag,
+    admissTimes: row.admissTimes,
+  }).then(res => {
+    patientVisible.value = false;
+    if (res == null || res.length === 0) {
+      ElMessage.error("没有查询到数据");
+      clearData();
+    } else {
+      setformData(res);
+      tableData.value = res.zyDepositFiles;
+    }
+  });
+};
+const queryPatientList = code => {
+  queryAdvancePaymentPatientList({
+    inpatientNo: code,
+    inOutFlag: formData.value.inOutFlag,
+  }).then(res => {
+    if (res == null || res.length === 0) {
+      ElMessage.error("没有查询到数据");
+      clearData();
+    } else if (res.length === 1) {
+      let row = {
+        inpatientNo: res[0].inpatientNo,
+        admissTimes: res[0].admissTimes,
+      };
+      fetchPatient(row);
+    } else if (res.length > 1) {
+      patientVisible.value = true;
+      patientTableData.value = res;
+    }
+  });
+};
+const tableData = ref([]);
+const activeName = ref(["1", "2"]);
+const formSize = ref("default");
 </script>
 <style scoped lang="scss">
-.pageTable tr td, .pageTable tr th {
+.pageTable tr td,
+.pageTable tr th {
   border: 1px solid black;
   text-align: center;
   font-size: 12px;
   padding: 0 0;
-
 }
 .pageTable {
   border-collapse: collapse;
 }
-</style>
+</style>