|
@@ -0,0 +1,424 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import { DrugData, PrintOrderVo } from "@/ts-type/print-poisonous-hemp";
|
|
|
+import JsBarcode from "jsbarcode";
|
|
|
+import env from "@/utils/setting";
|
|
|
+import { cptSex } from "@/utils/computed";
|
|
|
+import Pr from "@/assets/prescription.png";
|
|
|
+import { useVuePrint } from "@/utils/cy-use/useVuePrint";
|
|
|
+
|
|
|
+const props = defineProps<{
|
|
|
+ data: PrintOrderVo;
|
|
|
+}>();
|
|
|
+
|
|
|
+const drugFlag = [
|
|
|
+ { code: "1", name: "毒", color: "red" },
|
|
|
+ { code: "2", name: "麻", color: "red" },
|
|
|
+ { code: "3", name: "精一", color: "red" },
|
|
|
+ { code: "4", name: "精二" },
|
|
|
+ { code: "6", name: "终止妊娠" },
|
|
|
+];
|
|
|
+
|
|
|
+const state = reactive({
|
|
|
+ data: {} as PrintOrderVo,
|
|
|
+ // 重新整理一下数据
|
|
|
+ tempData: {},
|
|
|
+ qrCodeImage: "",
|
|
|
+ tagName: "",
|
|
|
+ printTime: "",
|
|
|
+ currentDrugData: [] as DrugData[],
|
|
|
+ pageBackground: "#fff",
|
|
|
+ collapses: drugFlag.map(i => {
|
|
|
+ return `print-poisonous-hemp-${i.code}`;
|
|
|
+ }),
|
|
|
+});
|
|
|
+
|
|
|
+const [PrintTemplate, printFunc] = useVuePrint({
|
|
|
+ hidden: false,
|
|
|
+ extraPageCss: `
|
|
|
+
|
|
|
+ @media print {
|
|
|
+ @page {
|
|
|
+ size: A5;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ body,
|
|
|
+ html {
|
|
|
+ height: max-content;
|
|
|
+ }
|
|
|
+
|
|
|
+ * {
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+ `,
|
|
|
+});
|
|
|
+
|
|
|
+async function printPrescription(red: boolean) {
|
|
|
+ const tmp = [];
|
|
|
+ state.currentDrugData = [];
|
|
|
+ const canvas = document.createElement("canvas");
|
|
|
+
|
|
|
+ drugFlag.forEach(item => {
|
|
|
+ let tmpDrug = [];
|
|
|
+ if (red && item.code !== "6") {
|
|
|
+ tmpDrug = state.data?.data?.["drug" + item.code]?.data || [];
|
|
|
+ } else if (!red && item.code === "6") {
|
|
|
+ tmpDrug = state.data?.data?.["drug" + item.code]?.data || [];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (tmpDrug.length > 0) {
|
|
|
+ tmpDrug.forEach(i => {
|
|
|
+ JsBarcode(canvas, i.id, {
|
|
|
+ lineColor: "#333",
|
|
|
+ width: 1,
|
|
|
+ height: 12,
|
|
|
+ margin: 0,
|
|
|
+ fontSize: 10,
|
|
|
+ displayValue: false,
|
|
|
+ });
|
|
|
+ i.qrCode = canvas.toDataURL("image/png");
|
|
|
+ });
|
|
|
+ tmp.push(...tmpDrug);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (tmp.length > 0) {
|
|
|
+ state.currentDrugData = tmp;
|
|
|
+ await nextTick();
|
|
|
+ printFunc();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ state.data = props.data;
|
|
|
+});
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ print,
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="layout_container layout-horizontal print-poisonous-hemp">
|
|
|
+ <aside style="width: 220px">
|
|
|
+ <el-collapse v-model="state.collapses">
|
|
|
+ <el-collapse-item
|
|
|
+ v-for="item in drugFlag"
|
|
|
+ :title="item.name"
|
|
|
+ :name="`print-poisonous-hemp-${item.code}`"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="print-poisonous-hemp__tag"
|
|
|
+ v-for="drugItem in state.data?.data?.['drug' + item.code]?.data ||
|
|
|
+ []"
|
|
|
+ >
|
|
|
+ {{ drugItem.orderName }}
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </aside>
|
|
|
+ <div class="layout_main">
|
|
|
+ <el-button @click="printPrescription(true)">打印红色处方</el-button>
|
|
|
+ <el-button @click="printPrescription(false)">打印终止妊娠</el-button>
|
|
|
+ <PrintTemplate>
|
|
|
+ <template v-for="(item, index) in state.currentDrugData">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ height: 210mm;
|
|
|
+ width: 148mm;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div style="display: flex; justify-content: space-between">
|
|
|
+ <div>
|
|
|
+ <img :src="item.qrCode" style="width: 190px" :alt="item.id" />
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center">
|
|
|
+ <div>
|
|
|
+ {{ env.VITE_HOSPITAL_NAME }}
|
|
|
+ </div>
|
|
|
+ <div>处方笺</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div style="border: 1px solid red; color: red">
|
|
|
+ {{ item.printName }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="print-poisonous-hemp__header-table">
|
|
|
+ <table>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 姓名:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-left">
|
|
|
+ {{ state.data.name }}
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 性别:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-left">
|
|
|
+ {{ cptSex(state.data.gender) }}
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 年龄:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-left">
|
|
|
+ {{ state.data.age }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 住院号:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-left">
|
|
|
+ {{ state.data.inpatientNo }}
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 科室:
|
|
|
+ </td>
|
|
|
+ <td
|
|
|
+ colspan="3"
|
|
|
+ class="print-poisonous-hemp__tag--text-left"
|
|
|
+ >
|
|
|
+ {{ state.data.wardName }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 处方类型:
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ state.tagName }}
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 打印时间:
|
|
|
+ </td>
|
|
|
+ <td colspan="3">
|
|
|
+ {{ state.printTime }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 身份证:
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ state.data.socialNo }}
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 病人类别:
|
|
|
+ </td>
|
|
|
+ <td colspan="3">
|
|
|
+ {{ state.data.responceName }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 代办人:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 代办人身份证:
|
|
|
+ </td>
|
|
|
+ <td
|
|
|
+ class="print-poisonous-hemp__tag--underline"
|
|
|
+ colspan="3"
|
|
|
+ ></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 诊断:
|
|
|
+ </td>
|
|
|
+ <td colspan="5">
|
|
|
+ {{ state.data.diagnose }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="flex: 1; height: 0; display: flex; flex-direction: column"
|
|
|
+ >
|
|
|
+ <div style="padding-top: 6pt">
|
|
|
+ <img :src="Pr" />
|
|
|
+ </div>
|
|
|
+ <div class="print-poisonous-hemp__body-table">
|
|
|
+ <table>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td colspan="3">
|
|
|
+ 1 {{ item.orderName }}({{
|
|
|
+ item.drugSpecification
|
|
|
+ }})
|
|
|
+ </td>
|
|
|
+ <td style="text-align: center">X</td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ {{ item.drugQuan }}{{ item.packUnitName }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="2"></td>
|
|
|
+ <td>用法:{{ item.dose }}{{ item.doseUnitName }}</td>
|
|
|
+ <td style="text-align: center">{{ item.frequName }}</td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ {{ item.supplyName }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td
|
|
|
+ colspan="5"
|
|
|
+ style="padding: 5pt 0"
|
|
|
+ class="print-poisonous-hemp__tag--text-right"
|
|
|
+ >
|
|
|
+ <div style="display: flex">
|
|
|
+ <div style="flex: 1">使用批号:</div>
|
|
|
+ <div
|
|
|
+ style="width: 20%"
|
|
|
+ class="print-poisonous-hemp__tag--underline"
|
|
|
+ ></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td
|
|
|
+ colspan="5"
|
|
|
+ style="padding: 5pt 0"
|
|
|
+ class="print-poisonous-hemp__tag--text-right"
|
|
|
+ >
|
|
|
+ <div style="display: flex">
|
|
|
+ <div style="flex: 1">余液丢弃</div>
|
|
|
+ <div
|
|
|
+ style="width: 20%"
|
|
|
+ class="print-poisonous-hemp__tag--underline"
|
|
|
+ ></div>
|
|
|
+ <div>mg按医疗垃圾处理</div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td
|
|
|
+ colspan="5"
|
|
|
+ style="padding: 5pt 0"
|
|
|
+ class="print-poisonous-hemp__tag--text-right"
|
|
|
+ >
|
|
|
+ <div style="display: flex">
|
|
|
+ <div style="flex: 1"></div>
|
|
|
+ <div
|
|
|
+ style="width: 20%"
|
|
|
+ class="print-poisonous-hemp__tag--underline"
|
|
|
+ ></div>
|
|
|
+ <div>处理人</div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td
|
|
|
+ colspan="5"
|
|
|
+ style="padding: 5pt 0"
|
|
|
+ class="print-poisonous-hemp__tag--text-right"
|
|
|
+ >
|
|
|
+ <div style="display: flex">
|
|
|
+ <div style="flex: 1"></div>
|
|
|
+ <div
|
|
|
+ style="width: 20%"
|
|
|
+ class="print-poisonous-hemp__tag--underline"
|
|
|
+ ></div>
|
|
|
+ <div>核对人</div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="5">----(以下空白)----</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="print-poisonous-hemp__foot">
|
|
|
+ <table>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">医师:</td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 发出批号:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 审核药师:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 核对药师:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 调配药师:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ <td class="print-poisonous-hemp__tag--text-right">
|
|
|
+ 发药药师:
|
|
|
+ </td>
|
|
|
+ <td class="print-poisonous-hemp__tag--underline"></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </PrintTemplate>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.print-poisonous-hemp__tag {
|
|
|
+ padding: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ border: 1px solid var(--el-border-primary-light-9);
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__body-table {
|
|
|
+ flex: 1;
|
|
|
+ height: 0;
|
|
|
+
|
|
|
+ table {
|
|
|
+ table-layout: fixed;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__tag--text-right {
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__tag--underline {
|
|
|
+ border-bottom: 1px solid #000;
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__tag--text-left {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__header-table {
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ border-bottom: 1px solid #000;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.print-poisonous-hemp__foot {
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ table-layout: fixed;
|
|
|
+ }
|
|
|
+
|
|
|
+ border-top: 1px solid #000;
|
|
|
+}
|
|
|
+</style>
|