Browse Source

打印机配置

lihong 1 month ago
parent
commit
f5c2e7db78

+ 15 - 0
src/api/zy-gl/admission-registration.js

@@ -44,6 +44,21 @@ export function queryLastWindowsIpAddress() {
   });
 }
 
+export function getMzZdDeptNos() {
+  return request({
+    url: url + "getMzZdDeptNos",
+    method: "get",
+  });
+}
+
+export function saveWindowPrint(data) {
+  return request({
+    url: url + "saveWindowPrint",
+    method: "post",
+    data,
+  });
+}
+
 export function queryPatientInfoByKeyWard(keyWard) {
   return request({
     url: url + "queryPatientInfoByKeyWard",

+ 13 - 16
src/views/hospitalization/zfsf/CashierProcessInfo.vue

@@ -7,7 +7,6 @@
         <el-button :disabled="qxFlag"   icon="Minus" type="danger"  @click="cancelCash">取消出纳</el-button>
         <el-button  type="primary"   icon="RefreshLeft"  @click="chongZhiData" >清空</el-button>
         <el-button  type="warning"    icon="Money"  @click="openPos" >智能POS工具包</el-button>
-        <PrintSelect @getPrintCode="selectPrintCode"></PrintSelect>
       </div>
       <PatientBaseList ref="patientBaseListRef" :inOutFlag="1" @selectPatientInfo="selectPatient"></PatientBaseList>
     </header>
@@ -447,7 +446,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
 import {getDateDiffToDay, getFormatDatetime} from "@/utils/date";
 import router from "@/router";
 import {queryHospitalName} from "@/api/zy-gl/zy-daily.js";
-import PrintSelect from "@/components/zfsf/PrintSelect.vue";
+import {queryLastWindowsIpAddress} from "@/api/zy-gl/admission-registration.js";
 
 const hospitalName = ref('')
 const zyFpPrintVisible = ref(false)
@@ -462,10 +461,7 @@ const patientInfo = ref({
   wardName : ''
 }
 )
-const printCode = ref(null)
-const selectPrintCode = (val)=>{
-  printCode.value = val
-}
+const printCode = ref(-1)
 const dzfpVisible = ref(false)
 const setShowFlag = ref(false)
 const patientBaseListRef = ref(null)
@@ -722,6 +718,10 @@ onMounted(()=>{
   queryZdChequeType().then(res=>{
     zdChequeTypes.value = res
   })
+
+  queryLastWindowsIpAddress().then(res=>{
+    printCode.value = res.zyPrintIndex
+  })
 })
 
 
@@ -996,9 +996,6 @@ const selectPrintZyFp = (row)=>{
 const selectDzfpRow = ref({})
 const selectDzfpTypeFlag = ref(null)
 const openDzfp = (row,typeFlag)=>{
-  queryPrintZyFpData(row).then(res=>{
-    printZyFpInfo.value = res
-  })
   selectDzfpRow.value = row
   selectDzfpTypeFlag.value = typeFlag
   dzfpVisible.value = true
@@ -1032,7 +1029,7 @@ const downDzFp = (row,typeFlag,type)=>{
     if(stringIsBlank(type) || type === '0'){
       const link = document.createElement("a");
       // 获取数据量
-      const blob = new Blob([base64ToArrayBuffer(res.pdfFileStr)]);
+      const blob = new Blob([base64ToArrayBuffer(res.fpInfo.pdfFileStr)]);
       // 下载文件
       const objectUrl = URL.createObjectURL(blob);
       link.href = objectUrl;
@@ -1053,13 +1050,14 @@ const downDzFp = (row,typeFlag,type)=>{
       LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "住院电子发票二维码");//对新建的纸张重命名
       LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
       LODOP.ADD_PRINT_TEXT("1mm", "6mm", "80mm", "3mm", hospitalName.value+"住院电子发票凭证");
-      LODOP.ADD_PRINT_TEXT("7mm", "3mm", "35mm", "3mm", "姓名:"+printZyFpInfo.value.name);
-      LODOP.ADD_PRINT_TEXT("7mm", "37mm", "40mm", "3mm", "住院号:"+printZyFpInfo.value.inpatientNo);
-      LODOP.ADD_PRINT_TEXT("13mm", "3mm", "75mm", "3mm", "科别:"+printZyFpInfo.value.wardName);
-      LODOP.ADD_PRINT_TEXT("19mm", "3mm", "75mm", "3mm", "住院总费用:"+printZyFpInfo.value.totalCharge);
+      LODOP.ADD_PRINT_TEXT("7mm", "3mm", "35mm", "3mm", "姓名:"+res.zyReceipt.name);
+      LODOP.ADD_PRINT_TEXT("7mm", "37mm", "40mm", "3mm", "住院号:"+res.zyReceipt.inpatientNo);
+      LODOP.ADD_PRINT_TEXT("13mm", "3mm", "75mm", "3mm", "科别:"+res.zyReceipt.wardName);
+      LODOP.ADD_PRINT_TEXT("19mm", "3mm", "75mm", "3mm", "住院总费用:"+res.zyReceipt.totalCharge);
       LODOP.ADD_PRINT_TEXT("25mm", "3mm", "80mm", "3mm", hospitalName.value+"住院发票二维码");
-      LODOP.ADD_PRINT_IMAGE("31mm", "3mm", "60mm", "60mm", "data:image/png;base64,"+res.qrcode);
+      LODOP.ADD_PRINT_IMAGE("31mm", "3mm", "60mm", "60mm", "data:image/png;base64,"+res.fpInfo.qrcode);
       LODOP.PRINT();
+      // LODOP.PREVIEW();
     }
     dzfpVisible.value = false
   })
@@ -1089,7 +1087,6 @@ const printFlag = ref(true)
 
 
 const getZySettType= (row)=>{
-  console.log('row',row)
   if(stringIsBlank(row.accountDate)){
     return '未结算'
   }else {

+ 4 - 6
src/views/hospitalization/zy-gl/AdmissionRegistration.vue

@@ -31,7 +31,6 @@
       >
       <el-button type="primary" icon="Refresh" @click="clearPatient"
         >清空</el-button>
-      <PrintSelect @getPrintCode="selectPrintCode"></PrintSelect>
     </header>
     <div class="layout_main">
       <div class="demo-collapse">
@@ -917,7 +916,6 @@ import env from "@/utils/setting.ts";
 import router from "@/router";
 import { useUserStore } from "@/pinia/user-store";
 import ReadCard from "@/components/medical-insurance/readcard/Index.vue";
-import PrintSelect from "@/components/zfsf/PrintSelect.vue";
 const updatePatientIdVisible = ref(false);
 const normalWristStrapPrintIndex = ref(-1);
 const childWristStrapPrintIndex = ref(-1);
@@ -1060,10 +1058,6 @@ const queryPatientByZyh = () => {
   );
 };
 
-const selectPrintCode = (val)=>{
-  normalWristStrapPrintIndex.value = val
-  childWristStrapPrintIndex.value = val
-}
 
 
 const fetchPatient = row => {
@@ -1828,6 +1822,10 @@ onMounted(() => {
   queryZyResponceType().then(res => {
     zyResponceTypeList.value = res;
   });
+  queryLastWindowsIpAddress().then(res=>{
+    childWristStrapPrintIndex.value = res.childWristStrapPrintIndex
+    normalWristStrapPrintIndex.value = res.normalWristStrapPrintIndex
+  })
 });
 </script>
 <style scoped lang="scss"></style>

+ 7 - 5
src/views/hospitalization/zy-gl/AdvancePaymentDeal.vue

@@ -5,7 +5,6 @@
       <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>
-      <PrintSelect @getPrintCode="selectPrintCode"></PrintSelect>
     </header>
     <div class="layout_main">
       <div class="demo-collapse">
@@ -295,7 +294,7 @@ 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 PrintSelect from "@/components/zfsf/PrintSelect.vue"
+import {queryLastWindowsIpAddress} from "@/api/zy-gl/admission-registration.js";
 const sjhVisible = ref(false)
 const currentNo = ref(null)
 const openSjh = ()=>{
@@ -467,9 +466,7 @@ const printReal =(inpatientNo,receiptNo,flag)=>{
   })
 }
 const printCode = ref(null)
-const selectPrintCode = (val)=>{
-  printCode.value = val
-}
+
 function printSjNew(){
   let LODOP = getLodop();
   //设置默认打印机
@@ -490,6 +487,8 @@ function printSjNew(){
   clearPrintData()
 }
 
+
+
 const clearShouFeeForm =()=>{
   shouFeeForm.value = {
     depoType : 'O',
@@ -590,6 +589,9 @@ onMounted(()=>{
     zdChequeTypes.value = res
   })
   queryHospitalName().then(res=>hospitalName.value = res)
+  queryLastWindowsIpAddress().then(res=>{
+    printCode.value = res.zyYjjPrintIndex
+  })
 })
 
 

+ 114 - 0
src/views/hospitalization/zy-gl/PrinterConfig.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="layout_container">
+    <div class="layout_main" style="background-color: white;margin-top: 2px;margin-left: 5px;padding-top: 5px;padding-left: 20px">
+      <el-form :model="formWindow" label-width="auto" style="max-width: 600px"  :size="formSize">
+        <el-form-item label="院区*">
+          <el-select style="width: 130px" v-model="formWindow.deptNo" filterable >
+            <el-option v-for="item in deptNoList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="收费窗口*">
+          <el-input v-model="formWindow.windowsNo"/>
+        </el-form-item>
+        <el-form-item label="门诊发票打印机名称">
+          <el-select style="width: 200px" v-model="formWindow.printIndex" filterable  >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="住院发票打印机名称">
+          <el-select style="width: 200px" v-model="formWindow.zyPrintIndex" filterable >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="住院预交金收据打印机名称">
+          <el-select style="width: 200px" v-model="formWindow.zyYjjPrintIndex" filterable >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="常规打印机">
+          <el-select style="width: 200px" v-model="formWindow.cgPrintIndex" filterable >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="普通住院腕带打印机名称">
+          <el-select style="width: 200px" v-model="formWindow.normalWristStrapPrintIndex" filterable >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="儿童住院腕带打印机名称">
+          <el-select style="width: 200px" v-model="formWindow.childWristStrapPrintIndex" filterable >
+            <el-option v-for="item in printList" :key="item.code" :label="item.name" :value="item.code"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="POS路由识别码">
+          <el-input v-model="formWindow.misPosRouterCode"/>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="saveWindow">保存</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+<script setup lang="ts">
+import {getLodop, initLodop} from "@/utils/c-lodop";
+import {ref} from "vue";
+import {
+  queryLastWindowsIpAddress,
+  saveWindowPrint,
+  getMzZdDeptNos
+}from "@/api/zy-gl/admission-registration";
+const formSize = ref("default");
+const formWindow = ref({
+  deptNo:'',
+  windowsNo:'',
+  printIndex:null,
+  zyPrintIndex:null,
+  cgPrintIndex:null,
+  zyYjjPrintIndex:null,
+  normalWristStrapPrintIndex:null,
+  childWristStrapPrintIndex:null,
+  misPosRouterCode:'',
+})
+
+const deptNoList = ref([])
+const printList= ref([])
+
+const saveWindow = ()=>{
+  saveWindowPrint(formWindow.value).then(res=>{})
+}
+
+const getPrinters = () => {
+  const LODOP = getLodop()
+  const count = LODOP.GET_PRINTER_COUNT();
+  for (let i = 0; i < count; i++) {
+    //根据设备序号获取设备名
+    const printerName = LODOP.GET_PRINTER_NAME(i);
+    printList.value.push({code: i, name: printerName})
+  }
+}
+onMounted(() => {
+  initLodop();
+  setTimeout(() => {
+    getPrinters()
+  }, 500)
+  queryLastWindowsIpAddress().then(res=>{
+    formWindow.value.deptNo = res.deptNo
+    formWindow.value.windowsNo = res.windowsNo
+    formWindow.value.printIndex = res.printIndex
+    formWindow.value.zyPrintIndex = res.zyPrintIndex
+    formWindow.value.cgPrintIndex = res.cgPrintIndex
+    formWindow.value.normalWristStrapPrintIndex = res.normalWristStrapPrintIndex
+    formWindow.value.childWristStrapPrintIndex = res.childWristStrapPrintIndex
+    formWindow.value.zyYjjPrintIndex = res.zyYjjPrintIndex
+    formWindow.value.misPosRouterCode = res.misPosRouterCode
+  })
+  getMzZdDeptNos().then(res=>{
+    deptNoList.value = res
+  })
+})
+
+</script>
+<style scoped lang="scss">
+
+</style>

+ 5 - 6
src/views/hospitalization/zy-gl/ZyDaily.vue

@@ -43,7 +43,6 @@
           <el-button type="danger" icon="Delete" @click="clearAllData">清空</el-button>
           <el-button type="success" icon="Printer" @click="printData(false)">打印</el-button>
           <el-button v-if="queryParam.type==='1'" type="success" icon="Check" @click="dcountCharge">结账处理</el-button>
-          <PrintSelect @getPrintCode="selectPrintCode"></PrintSelect>
         </el-col>
       </el-row>
     </header>
@@ -448,7 +447,7 @@ import {getLodop,initLodop} from "@/utils/c-lodop.js";
 import { getFormatDatetime } from "@/utils/date"
 import {shortcuts} from "@/data/shortcuts.js";
 import {ElMessage} from "element-plus";
-import PrintSelect from "@/components/zfsf/PrintSelect.vue";
+import {queryLastWindowsIpAddress} from "@/api/zy-gl/admission-registration.js";
 const printNum = ref(1)
 const hosName = ref('')
 const dateRange = ref([])
@@ -524,6 +523,9 @@ onMounted(()=>{
   })
   dateRange.value=[getFormatDatetime(new Date(),'YYYY-MM-DD'),getFormatDatetime(new Date(),'YYYY-MM-DD')]
   initAllData()
+  queryLastWindowsIpAddress().then(res=>{
+    printCode.value = res.cgPrintIndex
+  })
 })
 
 const dcountCharge = ()=>{
@@ -550,10 +552,7 @@ const printData = (clearFlag)=>{
     //LODOP.PRINT();
   }
 }
-const printCode = ref(null)
-const selectPrintCode = (val)=>{
-  printCode.value = val
-}
+const printCode = ref(-1)
 const activeName = ref('one')
 const style = ref({
   width: '920px',