فهرست منبع

门诊输液瓶贴打印

hsh 1 ماه پیش
والد
کامیت
2b70edfc74
3فایلهای تغییر یافته به همراه323 افزوده شده و 0 حذف شده
  1. 20 0
      src/api/outpatient/outpatient-infusion-label.js
  2. 73 0
      src/views/clinic/MzBottleCard.vue
  3. 230 0
      src/views/clinic/OutpatientInfusionLabel.vue

+ 20 - 0
src/api/outpatient/outpatient-infusion-label.js

@@ -0,0 +1,20 @@
+import request from '../../utils/request'
+
+
+// 查询门诊已发药处方数据
+export function selectMzChargePrescription(data) {
+    return request({
+        url: '/infusionLabel/selectMzChargePrescription',
+        method: 'post',
+        data
+    })
+}
+
+//查询大输液瓶贴数据
+export function selectMzInfusionPrescription(data) {
+    return request({
+        url: '/infusionLabel/selectMzInfusionPrescription',
+        method: 'post',
+        data
+    })
+}

+ 73 - 0
src/views/clinic/MzBottleCard.vue

@@ -0,0 +1,73 @@
+<template>
+  <div style="width: 260px;padding: 4px;border: 1px solid black;border-radius: 4px">
+    <table style="width: 100%;border-spacing: 0; border-collapse: collapse;table-layout: fixed">
+      <thead>
+      <tr>
+        <th colspan="14" style="text-align: left">
+          {{drugs[0].deptName}}&nbsp;
+          {{drugs[0].patName}}
+        </th>
+        <th colspan="10" style="text-align: right">
+          {{drugs[0].gender}}&nbsp;
+          {{drugs[0].age + '岁'}}&nbsp;
+          {{drugs[0].days}}
+        </th>
+      </tr>
+      </thead>
+      <tbody>
+      <tr>
+        <td colspan="17">药品名称/规格/一次剂量</td>
+        <td colspan="4">频率</td>
+        <td colspan="3">数量</td>
+      </tr>
+      <tr v-for="(item,index) in drugs">
+        <td colspan="17" style="width: 100%;height: 100%;position: relative">
+          <div style="position: absolute;left: 2px;top: 2px;">
+            <span v-if="index !== 0" style="font-size: 13px">▲</span>{{item.drugName}}
+          </div>
+          <div v-if="index === 0" style="position: absolute;left: 2px;bottom: 0; font-weight: bolder">
+            {{item.specification}}
+          </div>
+          <div style="position: absolute;right: 2px;bottom: 0; font-weight: bolder">
+            {{item.drugQuan + item.unitName}}
+          </div>
+        </td>
+        <td colspan="4" style="text-align: right">
+          <div>{{item.frequency}}</div>
+          <div>{{item.hours}}</div>
+        </td>
+        <td colspan="3" style="text-align: center">
+          {{item.quantity}}
+        </td>
+      </tr>
+      </tbody>
+    </table>
+  </div>
+</template>
+
+<script setup>
+import {CaretTop} from "@element-plus/icons-vue";
+
+const props = defineProps({
+  drugs: {
+    type: Array,
+    required: true
+  },
+  infusionData: {
+    type: Array,
+    required: true
+  }
+})
+
+const emit = defineEmits(['close', 'closeBottleCard'])
+emit('closeBottleCard', props.infusionData)
+
+</script>
+
+<style scoped>
+td {
+  border: 1px solid black;
+  font-size: 12px;
+  padding: 2px;
+}
+</style>

+ 230 - 0
src/views/clinic/OutpatientInfusionLabel.vue

@@ -0,0 +1,230 @@
+<template>
+  <div class="layout_container">
+    <header>
+      <el-input v-model.trim="patientId" class="w-50 m-2" style="width: 220px" placeholder="请输入门诊号" clearable>
+        <template #prepend>门诊号</template>
+      </el-input>
+      <el-input v-model.trim="xm" class="w-50 m-2" style="width: 220px; margin-left: 3px" placeholder="请输入病人姓名" clearable>
+        <template #prepend>病人姓名</template>
+      </el-input>
+      <el-autocomplete v-model="dept" value-key="name" :fetch-suggestions="querySearchDept"
+                       clearable class="inline-input w-50 m-2" style="width: 240px"
+                       @select="handleSelect" placeholder="请输入关键字">
+        <template #prepend>科室</template>
+      </el-autocomplete>
+      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" :clearable="false"
+                      end-placeholder="结束日期" :shortcuts="shortcuts" style="width: 300px; margin-left: 3px">
+      </el-date-picker>
+      <el-divider direction="vertical" />
+      <el-button type="primary" icon="Search" @click="queryMzChargePrescription" style="margin-left: 5px">查询
+      </el-button>
+    </header>
+    <div class="layout_main">
+      <div class="layout_container">
+        <div class="layout_main layout_el-table">
+          <el-row>
+            <el-col :span="16">
+              <el-table :data="mzCfData.slice(pageSize * (currentPage - 1), pageSize * currentPage)"
+                        border stripe highlight-current-row>
+                <el-table-column type="index" label="序号" width="60" />
+                <el-table-column prop="patientId" label="病人ID" width="100" />
+                <el-table-column prop="name" label="病人姓名" width="100" />
+                <el-table-column prop="times" label="病人就诊次数" width="100" />
+                <el-table-column prop="serialNo" label="流水号" width="100"/>
+                <el-table-column prop="deptName" label="科室" width="180"/>
+                <el-table-column prop="chargeDate" label="缴费时间" width="150"/>
+                <el-table-column fixed="right" label="操作" min-width="100" width="100" header-align="center" align="center">
+                  <template #default="scope">
+                    <el-button type="primary" size="small" @click="cfMxCx(scope.row)">输液明细
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-col>
+            <el-col :span="6">
+              <div style="display: flex; flex-wrap: wrap">
+                <div v-for="(item,index) in mzCfDetail" :id="item[0].patientId+'-'+index" style="margin: 8px 12px">
+                  <div style="width: 260px;padding: 4px;border: 1px solid black;border-radius: 4px">
+                    <table style="width: 100%;border-spacing: 0; border-collapse: collapse;table-layout: fixed">
+                      <thead>
+                      <tr>
+                        <th colspan="14" style="text-align: left">
+                          {{item[0].deptName}}&nbsp;
+                          {{item[0].patName}}
+                        </th>
+                        <th colspan="10" style="text-align: right">
+                          {{item[0].gender}}&nbsp;
+                          {{item[0].age + '岁'}}&nbsp;
+                          {{item[0].days}}
+                        </th>
+                      </tr>
+                      </thead>
+                      <tbody>
+                      <tr>
+                        <td colspan="17">药品名称/规格/一次剂量</td>
+                        <td colspan="4">频率</td>
+                        <td colspan="3">数量</td>
+                      </tr>
+                      <tr v-for="(item,index) in item">
+                        <td colspan="17" style="width: 100%;height: 100%;position: relative">
+                          <div style="position: absolute;left: 2px;top: 2px;">
+                            <span v-if="index !== 0" style="font-size: 13px">▲</span>{{item.drugName}}
+                          </div>
+                          <div v-if="index === 0" style="position: absolute;left: 2px;bottom: 0; font-weight: bolder">
+                            {{item.specification}}
+                          </div>
+                          <div style="position: absolute;right: 2px;bottom: 0; font-weight: bolder">
+                            {{item.drugQuan + item.unitName}}
+                          </div>
+                        </td>
+                        <td colspan="4" style="text-align: right">
+                          <div>{{item.frequency}}</div>
+                          <div>{{item.hours}}</div>
+                        </td>
+                        <td colspan="3" style="text-align: center">
+                          {{item.quantity}}
+                        </td>
+                      </tr>
+                      </tbody>
+                    </table>
+                  </div>
+                </div>
+              </div>
+            </el-col>
+            <el-button type="primary" @click="printInfusionLabel(mzCfDetail)">
+              打印
+            </el-button>
+          </el-row>
+        </div>
+        <div>
+          <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[20, 25, 30, 35]"
+                         :total="mzCfData.length" layout="total, sizes, prev, pager, next, jumper"
+                         style="margin-top: 5px" @size-change="handleSizeChange"
+                         @current-change="handleCurrentChange">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script setup name="OutpatientInfusionLabel">
+import { nextTick, onMounted, ref } from "vue";
+import {shortcuts} from "@/data/shortcuts.js";
+import {formatDatetime, getDateRangeFormatDate} from "@/utils/date.js";
+import {selectSmallDept} from "@/api/medical-insurance/si-yb-util.js";
+import {getLodop, initLodop} from "@/utils/c-lodop.js";
+import {selectMzChargePrescription,selectMzInfusionPrescription} from "@/api/outpatient/outpatient-infusion-label.js";
+
+const patientId = ref('')
+const xm = ref('')
+const dateRange = ref([])
+const mzCfData = ref([])
+const dept = ref('')
+const start = formatDatetime(shortcuts[0].value[0])
+const end = formatDatetime(shortcuts[0].value[0])
+
+const pageSize = ref(25)
+const currentPage = ref(1)
+const handleSizeChange = (val) => {
+  pageSize.value = val
+}
+const handleCurrentChange = (val) => {
+  currentPage.value = val
+}
+
+const queryData = ref({
+  patNo: '',
+  patName: '',
+  dept: '',
+  startTime: '',
+  endTime: '',
+  groupNo: '71', // 西药房
+  confirmFlag: '1', // 已经发药的处方
+})
+
+onMounted(() => {
+  initLodop()
+  nextTick(() => {
+    queryData.value.startTime = start;
+    queryData.value.endTime = end + " 23:59:59";
+    dateRange.value = [start, end];
+    queryMzChargePrescription()
+  })
+})
+
+const queryMzChargePrescription = () => {
+  if (dateRange.value) {
+    let dateS = getDateRangeFormatDate(dateRange.value)
+    queryData.value.startTime = dateS.startTime
+    queryData.value.endTime = dateS.endTime
+  }
+  queryData.value.patNo = patientId.value
+  queryData.value.patName = xm.value
+  if(!dept.value){
+    queryData.value.dept = ''
+  }
+  selectMzChargePrescription(queryData.value).then((res) => {
+    mzCfData.value = res
+  })
+}
+
+// 处方输液明细查询
+const ypMzCfData = ref({})
+const mzCfDetail = ref([])
+const cfMxCx = (row) => {
+  ypMzCfData.value = {
+    patNo: row.patientId,
+    times: row.times,
+    groupNo: '71', // 西药房
+    confirmFlag: '1', // 已经发药的处方
+  }
+  selectMzInfusionPrescription(ypMzCfData.value).then(res => {
+    if(res){
+      mzCfDetail.value = res
+    } else {
+      mzCfDetail.value = []
+    }
+  })
+}
+
+// 打印处方大输液瓶贴
+const printInfusionLabel = (data) => {
+  let infusionData = Object.values(data)
+  let LODOP = getLodop();
+  const printStyle = `<style>td{border: 1px solid black;font-size: 12px;padding: 2px;}</style>`
+  for (let i = 0; i < infusionData.length; i++) {
+    let info = infusionData[i]
+    let id = info[0].patientId + '-' + (i+1)
+    const printContent = document.getElementById(id).innerHTML
+    let pagePrint = printStyle + '<body>' + printContent + '</body>'
+    LODOP.PRINT_INIT('门诊输液瓶贴')
+    LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
+    LODOP.ADD_PRINT_TABLE('0mm', '0mm', '210mm', '230mm', pagePrint)
+    LODOP.SET_PRINT_STYLE('ItemType', 3)
+    LODOP.PRINT()
+  }
+}
+
+const querySearchDept = async (str, cb) => {
+  let results = await selectSmallDept({ str })
+  if (results) {
+    // 调用 callback 返回建议列表的数据
+    cb(results)
+  }
+}
+
+const handleSelect = (item) => {
+  queryData.value.dept = item.code
+}
+
+const closeBottleCard = (data) => {
+  printInfusionLabel(data)
+}
+</script>
+<style scoped>
+td {
+  border: 1px solid black;
+  font-size: 12px;
+  padding: 2px;
+}
+</style>