|
|
@@ -5,20 +5,40 @@
|
|
|
<div class="search-item-area">
|
|
|
<div class="search-item">
|
|
|
<div class="ml12">病区:</div>
|
|
|
- <el-select v-model="queryParams.wardCode" style="width:88px" @change="handleWardChange">
|
|
|
- <el-option v-for="item in userWards" :value="item.value" :label="item.label"></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.wardCode"
|
|
|
+ style="width: 88px"
|
|
|
+ @change="handleWardChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in userWards"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<div class="ml12">执行日期:</div>
|
|
|
- <el-date-picker v-model="queryParams.executeDate" :clearable="false" style="width: 102px"
|
|
|
- @change="datePickChange"></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.executeDate"
|
|
|
+ :clearable="false"
|
|
|
+ style="width: 102px"
|
|
|
+ @change="datePickChange"
|
|
|
+ ></el-date-picker>
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<div class="ml12">床位范围:</div>
|
|
|
- <el-select v-model="queryParams.bedNoStart" style="width: 70px" value-key="bedNo"
|
|
|
- @change="handleStartBedChange">
|
|
|
- <el-option v-for="item in patientBedList" :key="item.bedNo" :value="item">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.bedNoStart"
|
|
|
+ style="width: 70px"
|
|
|
+ value-key="bedNo"
|
|
|
+ @change="handleStartBedChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in patientBedList"
|
|
|
+ :key="item.bedNo"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
{{ item.bedNoLabel }}
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<span class="green-text">{{ item.patNo }}</span>
|
|
|
@@ -27,20 +47,39 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<span style="margin: 0 4px; font-size: 11px">至</span>
|
|
|
- <el-select v-model="queryParams.bedNoEnd" style="width: 70px" value-key="bedNo"
|
|
|
- @change="handleEndBedChange">
|
|
|
- <el-option v-for="item in patientBedList" :key="item.bedNo" :value="item"
|
|
|
- :disabled="item.sortNo < queryParams.sortNoStart">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.bedNoEnd"
|
|
|
+ style="width: 70px"
|
|
|
+ value-key="bedNo"
|
|
|
+ @change="handleEndBedChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in patientBedList"
|
|
|
+ :key="item.bedNo"
|
|
|
+ :value="item"
|
|
|
+ :disabled="item.sortNo < queryParams.sortNoStart"
|
|
|
+ >
|
|
|
{{ item.bedNoLabel }}
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <span :class="item.sortNo < queryParams.sortNoStart ? 'is-disabled' : 'green-text'">{{ item.patNo
|
|
|
- }}</span>
|
|
|
+ <span
|
|
|
+ :class="
|
|
|
+ item.sortNo < queryParams.sortNoStart
|
|
|
+ ? 'is-disabled'
|
|
|
+ : 'green-text'
|
|
|
+ "
|
|
|
+ >{{ item.patNo }}</span
|
|
|
+ >
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <span :class="item.sortNo < queryParams.sortNoStart ? 'is-disabled' : 'blue-text'">{{ item.patName
|
|
|
- }}</span>
|
|
|
+ <span
|
|
|
+ :class="
|
|
|
+ item.sortNo < queryParams.sortNoStart
|
|
|
+ ? 'is-disabled'
|
|
|
+ : 'blue-text'
|
|
|
+ "
|
|
|
+ >{{ item.patName }}</span
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
-
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<div class="ml12">频率:</div>
|
|
|
@@ -60,7 +99,11 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<div class="ml12">类型:</div>
|
|
|
- <el-select v-model="queryParams.cardType" @change="handleTypeChange" style="width: 76px">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.cardType"
|
|
|
+ @change="handleTypeChange"
|
|
|
+ style="width: 76px"
|
|
|
+ >
|
|
|
<el-option value="INFUSION_CARD" label="巡回单"></el-option>
|
|
|
<el-option value="BOTTLE_CARD" label="瓶贴"></el-option>
|
|
|
</el-select>
|
|
|
@@ -78,42 +121,80 @@
|
|
|
<el-option :value="10" label="雾化"></el-option>
|
|
|
<el-option :value="11" label="皮试"></el-option>
|
|
|
<el-option :value="12" label="鼻饲"></el-option>
|
|
|
-
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<div class="search-btn">
|
|
|
- <el-button type="primary" icon="Search" @click="executeQuery">检索</el-button>
|
|
|
- <el-button type="primary" icon="Printer" @click="execPrint">打印</el-button>
|
|
|
+ <el-button type="primary" icon="Search" @click="executeQuery"
|
|
|
+ >检索</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" icon="Printer" @click="execPrint"
|
|
|
+ >打印</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #main>
|
|
|
<div style="display: flex; flex-wrap: wrap" id="infusion_list">
|
|
|
<div v-if="queryParams.cardType === 'INFUSION_CARD'">
|
|
|
- <div v-for="(item, index) in patientInfusionInfos" :id="item.patInfo.patNo">
|
|
|
- <div class="crad-area"
|
|
|
- style="width: 90%; margin: 8px 12px; padding: 4px; border: 1px solid red ;display: flex;justify-content: center; align-items: center;">
|
|
|
- <infusion-card :drug-groups="item.drugGroups" :pat-info="item.patInfo" :yz-date="queryParams.executeDate"
|
|
|
- :print-date="printDate">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in patientInfusionInfos"
|
|
|
+ :id="item.patInfo.patNo"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="crad-area"
|
|
|
+ style="
|
|
|
+ width: 90%;
|
|
|
+ margin: 8px 12px;
|
|
|
+ padding: 4px;
|
|
|
+ border: 1px solid red;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <infusion-card
|
|
|
+ :drug-groups="item.drugGroups"
|
|
|
+ :pat-info="item.patInfo"
|
|
|
+ :yz-date="queryParams.executeDate"
|
|
|
+ :print-date="printDate"
|
|
|
+ >
|
|
|
</infusion-card>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else id="print-test">
|
|
|
- <div v-for="(item, index) in patientInfusionInfos" :id="item.patInfo.patNo + '-' + index"
|
|
|
- style="width: 230px;display: inline-block;margin-right: 20px">
|
|
|
- <bottle-card :drugs="item.bottleCardDrugs" :pat-info="item.patInfo" :yz-date="queryParams.executeDate"
|
|
|
- :bottle-group="item.bottleGroup" style="margin-bottom: 10px;">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in patientInfusionInfos"
|
|
|
+ :id="item.patInfo.patNo + '-' + index"
|
|
|
+ style="width: 230px; display: inline-block; margin-right: 20px"
|
|
|
+ >
|
|
|
+ <bottle-card
|
|
|
+ :drugs="item.bottleCardDrugs"
|
|
|
+ :pat-info="item.patInfo"
|
|
|
+ :yz-date="queryParams.executeDate"
|
|
|
+ :bottle-group="item.bottleGroup"
|
|
|
+ :qr-content="item.qrContent"
|
|
|
+ style="margin-bottom: 10px"
|
|
|
+ >
|
|
|
</bottle-card>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="print-hiden-area" style="margin: 0px 12px">
|
|
|
- <div v-for="(item, index) in printPatientBottleInfos" :id="item.patInfo.patNo + '-' + index + '_print'"
|
|
|
- style="width: 230px;display: inline-block;margin-right: 20px">
|
|
|
- <bottle-card :drugs="item.bottleCardDrugs" :pat-info="item.patInfo" :yz-date="queryParams.executeDate"
|
|
|
- :bottle-group="item.bottleGroup" style="margin-bottom: 10px;">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in printPatientBottleInfos"
|
|
|
+ :id="item.patInfo.patNo + '-' + index + '_print'"
|
|
|
+ style="width: 230px; display: inline-block; margin-right: 20px"
|
|
|
+ >
|
|
|
+ <bottle-card
|
|
|
+ :drugs="item.bottleCardDrugs"
|
|
|
+ :pat-info="item.patInfo"
|
|
|
+ :yz-date="queryParams.executeDate"
|
|
|
+ :bottle-group="item.bottleGroup"
|
|
|
+ :qr-content="item.qrContent"
|
|
|
+ style="margin-bottom: 10px"
|
|
|
+ >
|
|
|
</bottle-card>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -128,8 +209,8 @@ import { formatDate, getDatetime, getDate } from "@/utils/date";
|
|
|
import {
|
|
|
getPatientBeds,
|
|
|
queryInfusionCardOrBottleCard,
|
|
|
- updatePrintStatus
|
|
|
-} from '@/api/inpatient/nurse-module/print-infusion-card'
|
|
|
+ updatePrintStatus,
|
|
|
+} from "@/api/inpatient/nurse-module/print-infusion-card";
|
|
|
import InfusionCard from "@/components/inpatient/nurse-module/InfusionCard.vue";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { getLodop, initLodop } from "@/utils/c-lodop";
|
|
|
@@ -137,27 +218,27 @@ import BottleCard from "@/components/inpatient/nurse-module/BottleCard.vue";
|
|
|
import { getWardsApi } from "@/api/login";
|
|
|
import { query } from "@/api/zfsf/pos-transaction";
|
|
|
|
|
|
-const userWards = ref([])
|
|
|
+const userWards = ref([]);
|
|
|
|
|
|
-const patientBedList = ref([])
|
|
|
-const printDate = ref(null)
|
|
|
+const patientBedList = ref([]);
|
|
|
+const printDate = ref(null);
|
|
|
|
|
|
-const handleWardChange = (wardCode) => {
|
|
|
+const handleWardChange = wardCode => {
|
|
|
getPatientBeds(wardCode).then(res => {
|
|
|
- patientBedList.value = res
|
|
|
+ patientBedList.value = res;
|
|
|
if (res.length > 0) {
|
|
|
- queryParams.bedNoStart = res[0].bedNoLabel
|
|
|
- queryParams.sortNoStart = res[0].sortNo
|
|
|
- queryParams.bedNoEnd = res[res.length - 1].bedNoLabel
|
|
|
- queryParams.sortNoEnd = res[res.length - 1].sortNo
|
|
|
+ queryParams.bedNoStart = res[0].bedNoLabel;
|
|
|
+ queryParams.sortNoStart = res[0].sortNo;
|
|
|
+ queryParams.bedNoEnd = res[res.length - 1].bedNoLabel;
|
|
|
+ queryParams.sortNoEnd = res[res.length - 1].sortNo;
|
|
|
} else {
|
|
|
- queryParams.bedNoStart = null
|
|
|
- queryParams.sortNoStart = null
|
|
|
- queryParams.bedNoEnd = null
|
|
|
- queryParams.sortNoEnd = null
|
|
|
+ queryParams.bedNoStart = null;
|
|
|
+ queryParams.sortNoStart = null;
|
|
|
+ queryParams.bedNoEnd = null;
|
|
|
+ queryParams.sortNoEnd = null;
|
|
|
}
|
|
|
- })
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
executeDate: getDate(),
|
|
|
@@ -166,169 +247,274 @@ const queryParams = reactive({
|
|
|
bedNoEnd: null,
|
|
|
sortNoStart: null,
|
|
|
sortNoEnd: null,
|
|
|
- frequency: 'ALWAYS',
|
|
|
- printRange: 'UNPRINTED',
|
|
|
- cardType: 'INFUSION_CARD',
|
|
|
+ frequency: "ALWAYS",
|
|
|
+ printRange: "UNPRINTED",
|
|
|
+ cardType: "INFUSION_CARD",
|
|
|
// bedNos: [] ,
|
|
|
patNos: [],
|
|
|
- drugSupplyType: 2
|
|
|
-})
|
|
|
+ drugSupplyType: 2,
|
|
|
+});
|
|
|
|
|
|
-const patientInfusionInfos = ref([])
|
|
|
-const printPatientBottleInfos = ref([])
|
|
|
+const patientInfusionInfos = ref([]);
|
|
|
+const printPatientBottleInfos = ref([]);
|
|
|
|
|
|
-const handleStartBedChange = (bed) => {
|
|
|
- queryParams.bedNoStart = bed.bedNoLabel
|
|
|
- queryParams.sortNoStart = bed.sortNo
|
|
|
-}
|
|
|
+const handleStartBedChange = bed => {
|
|
|
+ queryParams.bedNoStart = bed.bedNoLabel;
|
|
|
+ queryParams.sortNoStart = bed.sortNo;
|
|
|
+};
|
|
|
|
|
|
-const handleEndBedChange = (bed) => {
|
|
|
- queryParams.bedNoEnd = bed.bedNoLabel
|
|
|
- queryParams.sortNoEnd = bed.sortNo
|
|
|
-}
|
|
|
+const handleEndBedChange = bed => {
|
|
|
+ queryParams.bedNoEnd = bed.bedNoLabel;
|
|
|
+ queryParams.sortNoEnd = bed.sortNo;
|
|
|
+};
|
|
|
|
|
|
-const handleTypeChange = (val) => {
|
|
|
+const handleTypeChange = val => {
|
|
|
// console.log("val",val)
|
|
|
- patientInfusionInfos.value = []
|
|
|
+ patientInfusionInfos.value = [];
|
|
|
// queryParams.drugSupplyType = val == "INFUSION_CARD" ? "" : 2
|
|
|
// console.log("queryParams",queryParams)
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const datePickChange = () => {
|
|
|
- patientInfusionInfos.value = []
|
|
|
- queryParams.executeDate = formatDate(queryParams.executeDate)
|
|
|
- console.log("patientInfusionInfos", patientInfusionInfos.value)
|
|
|
-}
|
|
|
+ patientInfusionInfos.value = [];
|
|
|
+ queryParams.executeDate = formatDate(queryParams.executeDate);
|
|
|
+ console.log("patientInfusionInfos", patientInfusionInfos.value);
|
|
|
+};
|
|
|
|
|
|
const executeQuery = () => {
|
|
|
- patientInfusionInfos.value = []
|
|
|
- queryParams.executeDate = formatDate(queryParams.executeDate)
|
|
|
+ patientInfusionInfos.value = [];
|
|
|
+ queryParams.executeDate = formatDate(queryParams.executeDate);
|
|
|
// queryParams.bedNos = []
|
|
|
- queryParams.patNos = []
|
|
|
+ queryParams.patNos = [];
|
|
|
// console.log("patientBedList", patientBedList)
|
|
|
patientBedList.value.forEach(bed => {
|
|
|
- if (bed.sortNo >= queryParams.sortNoStart && bed.sortNo <= queryParams.sortNoEnd) {
|
|
|
+ if (
|
|
|
+ bed.sortNo >= queryParams.sortNoStart &&
|
|
|
+ bed.sortNo <= queryParams.sortNoEnd
|
|
|
+ ) {
|
|
|
// console.log("bed", bed)
|
|
|
// queryParams.bedNos.push(bed.bedNo)
|
|
|
- queryParams.patNos.push(bed.patNo)
|
|
|
+ queryParams.patNos.push(bed.patNo);
|
|
|
}
|
|
|
- })
|
|
|
- queryInfusionCardOrBottleCard(queryParams).then(res => {
|
|
|
- nextTick(() => {
|
|
|
- patientInfusionInfos.value = res
|
|
|
- if (queryParams.cardType !== 'INFUSION_CARD' && patientInfusionInfos.value.length > 0) {
|
|
|
- //瓶贴分配药品组号
|
|
|
- patientInfusionInfos.value.forEach(item => {
|
|
|
- let group = patientInfusionInfos.value.filter(citem => citem.patInfo.patNo === item.patInfo.patNo)
|
|
|
- group.forEach((v, vindex) => {
|
|
|
- let target = patientInfusionInfos.value.find(citem => citem.bottleCardDrugs[0].actOrderNo === v.bottleCardDrugs[0].actOrderNo)
|
|
|
- target.bottleGroup = vindex + 1 + "/" + group.length
|
|
|
- // console.log("target",target)
|
|
|
- })
|
|
|
- // console.log("group",group)
|
|
|
- // console.log("index")
|
|
|
- })
|
|
|
- // console.log("patientInfusionInfo s",patientInfusionInfos.value)
|
|
|
- }
|
|
|
- // for (let i = 0; i < 2; i++) {
|
|
|
- // patientInfusionInfos.value = [...patientInfusionInfos.value, ...res]
|
|
|
- // }
|
|
|
- // printPatientBottleInfos.value = res
|
|
|
- printDate.value = getDatetime()
|
|
|
+ });
|
|
|
+ queryInfusionCardOrBottleCard(queryParams)
|
|
|
+ .then(res => {
|
|
|
+ nextTick(() => {
|
|
|
+ patientInfusionInfos.value = res;
|
|
|
+ if (
|
|
|
+ queryParams.cardType !== "INFUSION_CARD" &&
|
|
|
+ patientInfusionInfos.value.length > 0
|
|
|
+ ) {
|
|
|
+ //瓶贴分配药品组号
|
|
|
+ patientInfusionInfos.value.forEach(item => {
|
|
|
+ let group = patientInfusionInfos.value.filter(
|
|
|
+ citem => citem.patInfo.patNo === item.patInfo.patNo
|
|
|
+ );
|
|
|
+ let groupByActOrderNo = {};
|
|
|
+ group.forEach(item => {
|
|
|
+ if (!groupByActOrderNo[item.bottleCardDrugs[0].actOrderNo]) {
|
|
|
+ groupByActOrderNo[item.bottleCardDrugs[0].actOrderNo] = [];
|
|
|
+ groupByActOrderNo[item.bottleCardDrugs[0].actOrderNo].push(
|
|
|
+ item
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ groupByActOrderNo[item.bottleCardDrugs[0].actOrderNo].push(
|
|
|
+ item
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // console.log("groupByActOrderNo", groupByActOrderNo);
|
|
|
+ // console.log("group", group);
|
|
|
+ let groupByActOrderNoKeys = Object.keys(groupByActOrderNo);
|
|
|
+ groupByActOrderNoKeys.forEach((key, index) => {
|
|
|
+ groupByActOrderNo[key].forEach(item => {
|
|
|
+ // console.log("item", item);
|
|
|
+ // console.log("index", index);
|
|
|
+ item.bottleGroup =
|
|
|
+ index + 1 + "/" + groupByActOrderNoKeys.length;
|
|
|
+ let target = patientInfusionInfos.value.find(
|
|
|
+ citem =>
|
|
|
+ citem.bottleCardDrugs[0].actOrderNo ===
|
|
|
+ item.bottleCardDrugs[0].actOrderNo &&
|
|
|
+ citem.bottleCardDrugs[0].occTime ===
|
|
|
+ item.bottleCardDrugs[0].occTime
|
|
|
+ );
|
|
|
+ target.bottleGroup = item.bottleGroup;
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // group.forEach((v, vindex) => {
|
|
|
+ // let target = patientInfusionInfos.value.find(
|
|
|
+ // citem =>
|
|
|
+ // citem.bottleCardDrugs[0].actOrderNo ===
|
|
|
+ // v.bottleCardDrugs[0].actOrderNo &&
|
|
|
+ // citem.bottleCardDrugs[0].occTime ===
|
|
|
+ // v.bottleCardDrugs[0].occTime
|
|
|
+ // );
|
|
|
+ // target.bottleGroup = vindex + 1 + "/" + group.length;
|
|
|
+ // // console.log("target",target)
|
|
|
+ // });
|
|
|
+ let drugsStr = "";
|
|
|
+ item.bottleCardDrugs.forEach((drug, dindex) => {
|
|
|
+ drugsStr += `${drug.orderCode}^${drug.drugOcc}${dindex === item.bottleCardDrugs.length - 1 ? "" : "_"}`;
|
|
|
+ });
|
|
|
+ let qrContent = `
|
|
|
+ ${item.patInfo.patNo}|${item.bottleCardDrugs[0].actOrderNo}|${formatOccTime(item.bottleCardDrugs[0].occTime)}|${drugsStr}`;
|
|
|
+ // {
|
|
|
+ // inpatientNo: item.patInfo.patNo,
|
|
|
+ // actOrderNo: item.bottleCardDrugs[0].actOrderNo,
|
|
|
+ // occTime: formatOccTime(item.bottleCardDrugs[0].occTime),
|
|
|
+ // drugs: [],
|
|
|
+ // };
|
|
|
+ item.qrContent = qrContent;
|
|
|
+ // item.qrContent = JSON.stringify(qrContent).replace(/\s/g, "");
|
|
|
+ // console.log("qrContent", item.qrContent);
|
|
|
+ // console.log("group",group)
|
|
|
+ // console.log("index")
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // for (let i = 0; i < 2; i++) {
|
|
|
+ // patientInfusionInfos.value = [...patientInfusionInfos.value, ...res]
|
|
|
+ // }
|
|
|
+ // printPatientBottleInfos.value = res
|
|
|
+ printDate.value = getDatetime();
|
|
|
+ });
|
|
|
})
|
|
|
- }).catch(() => {
|
|
|
- patientInfusionInfos.value = []
|
|
|
- })
|
|
|
-}
|
|
|
+ .catch(() => {
|
|
|
+ patientInfusionInfos.value = [];
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const formatOccTime = timeStr => {
|
|
|
+ const timestamp = new Date(timeStr).getTime();
|
|
|
+ if (!timestamp || isNaN(timestamp)) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ const date = new Date(timestamp);
|
|
|
+
|
|
|
+ // 获取年、月、日、时、分、秒(注意月份从0开始,需+1)
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, "0"); // 补零(如 9 → "09")
|
|
|
+ const day = String(date.getDate()).padStart(2, "0");
|
|
|
+ const hours = String(date.getHours()).padStart(2, "0");
|
|
|
+ const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
|
+ const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
|
+
|
|
|
+ // 拼接为 yyyyMMddHHmmss 格式
|
|
|
+ return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
|
|
+};
|
|
|
+
|
|
|
+const handleQrCodeContent = () => {};
|
|
|
|
|
|
const frequencyOptions = [
|
|
|
{
|
|
|
//每天两次
|
|
|
- arr: ['Bid', 'Q12H', 'Q12H/单日', 'Q12H/双日', 'bod'
|
|
|
- ],
|
|
|
- add: 1
|
|
|
+ arr: ["Bid", "Q12H", "Q12H/单日", "Q12H/双日", "bod"],
|
|
|
+ add: 1,
|
|
|
},
|
|
|
{
|
|
|
//每天三次
|
|
|
- arr: ['Tid', 'Tod', 'Q8h'],
|
|
|
- add: 2
|
|
|
+ arr: ["Tid", "Tod", "Q8h"],
|
|
|
+ add: 2,
|
|
|
},
|
|
|
{
|
|
|
//每天四次
|
|
|
- arr: ['Qid', 'Q6h'],
|
|
|
- add: 3
|
|
|
+ arr: ["Qid", "Q6h"],
|
|
|
+ add: 3,
|
|
|
},
|
|
|
-]
|
|
|
+];
|
|
|
|
|
|
const handlePrintByFrequency = () => {
|
|
|
- let result = [...printPatientBottleInfos.value]
|
|
|
+ let result = [...printPatientBottleInfos.value];
|
|
|
printPatientBottleInfos.value.forEach(item => {
|
|
|
- let frequency = item.bottleCardDrugs[0].frequCode
|
|
|
+ let frequency = item.bottleCardDrugs[0].frequCode;
|
|
|
let add = 0;
|
|
|
for (let i = 0; i < frequencyOptions.length; i++) {
|
|
|
if (frequencyOptions[i].arr.includes(frequency)) {
|
|
|
- add = frequencyOptions[i].add
|
|
|
+ add = frequencyOptions[i].add;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (add > 0) {
|
|
|
- let index = result.findIndex(citem => citem.bottleCardDrugs[0].actOrderNo === item.bottleCardDrugs[0].actOrderNo);
|
|
|
+ let index = result.findIndex(
|
|
|
+ citem =>
|
|
|
+ citem.bottleCardDrugs[0].actOrderNo ===
|
|
|
+ item.bottleCardDrugs[0].actOrderNo
|
|
|
+ );
|
|
|
for (let i = 0; i < add; i++) {
|
|
|
- let target = { ...item }
|
|
|
- target.patInfo.patNo = target.patInfo.patNo + '_' + i
|
|
|
+ let target = { ...item };
|
|
|
+ target.patInfo.patNo = target.patInfo.patNo + "_" + i;
|
|
|
result.splice(index, 0, target);
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- return result
|
|
|
-}
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+};
|
|
|
|
|
|
const execPrint = () => {
|
|
|
- const type = queryParams.cardType === 'INFUSION_CARD' ? '巡回单' : '瓶贴卡'
|
|
|
+ const type = queryParams.cardType === "INFUSION_CARD" ? "巡回单" : "瓶贴卡";
|
|
|
if (patientInfusionInfos.value.length === 0) {
|
|
|
ElMessage({
|
|
|
message: `请先检索${type}。`,
|
|
|
- type: 'warning',
|
|
|
+ type: "warning",
|
|
|
duration: 2500,
|
|
|
- showClose: true
|
|
|
- })
|
|
|
- return
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
let LODOP = getLodop();
|
|
|
- if (queryParams.cardType == 'INFUSION_CARD') {
|
|
|
- let prntContent = document.getElementById("infusion_list").innerHTML
|
|
|
+ if (queryParams.cardType == "INFUSION_CARD") {
|
|
|
+ let prntContent = document.getElementById("infusion_list").innerHTML;
|
|
|
// console.log("prntContent",prntContent)
|
|
|
- let printHTML = ""
|
|
|
+ let printHTML = "";
|
|
|
const printStyle = `<style>td{border: 1px solid black;
|
|
|
- font-size: 12px;padding: 2px;}</style>`
|
|
|
+ font-size: 12px;padding: 2px;}</style>`;
|
|
|
if (patientInfusionInfos.value.length == 1) {
|
|
|
- let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
- ? patientInfusionInfos.value[0].patInfo.patNo : patientInfusionInfos.value[0].patInfo.patNo + '-' + i
|
|
|
- printHTML = document.getElementById(id).innerHTML
|
|
|
- LODOP.PRINT_INIT('infusionCard')
|
|
|
- LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', printStyle + '<body style:"display: flex;justify-content: center;align-items: center;">' + printHTML + '</body>')
|
|
|
- LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
+ let id =
|
|
|
+ queryParams.cardType === "INFUSION_CARD"
|
|
|
+ ? patientInfusionInfos.value[0].patInfo.patNo
|
|
|
+ : patientInfusionInfos.value[0].patInfo.patNo + "-" + i;
|
|
|
+ printHTML = document.getElementById(id).innerHTML;
|
|
|
+ LODOP.PRINT_INIT("infusionCard");
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, "210mm", "297mm", "");
|
|
|
+ LODOP.ADD_PRINT_HTML(
|
|
|
+ "0mm",
|
|
|
+ "0mm",
|
|
|
+ "210mm",
|
|
|
+ "297mm",
|
|
|
+ printStyle +
|
|
|
+ '<body style:"display: flex;justify-content: center;align-items: center;">' +
|
|
|
+ printHTML +
|
|
|
+ "</body>"
|
|
|
+ );
|
|
|
+ LODOP.SET_PRINT_STYLE("ItemType", 3);
|
|
|
LODOP.PREVIEW();
|
|
|
} else {
|
|
|
- LODOP.PRINT_INIT('infusionCard')
|
|
|
- LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
- let PAGE_MAX_HEIGHT = 970 //页面最大阈值
|
|
|
- let pageHeightNow = 0
|
|
|
- let currentPageHTML = '';
|
|
|
+ LODOP.PRINT_INIT("infusionCard");
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, "210mm", "297mm", "");
|
|
|
+ let PAGE_MAX_HEIGHT = 970; //页面最大阈值
|
|
|
+ let pageHeightNow = 0;
|
|
|
+ let currentPageHTML = "";
|
|
|
for (let i = 0; i < patientInfusionInfos.value.length; i++) {
|
|
|
- let info = patientInfusionInfos.value[i]
|
|
|
- let printTarget = document.getElementById(info.patInfo.patNo)
|
|
|
- console.log('printTarget', printTarget)
|
|
|
+ let info = patientInfusionInfos.value[i];
|
|
|
+ let printTarget = document.getElementById(info.patInfo.patNo);
|
|
|
+ console.log("printTarget", printTarget);
|
|
|
if (pageHeightNow + printTarget.offsetHeight > PAGE_MAX_HEIGHT) {
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', printStyle + currentPageHTML);
|
|
|
+ LODOP.ADD_PRINT_HTML(
|
|
|
+ "0mm",
|
|
|
+ "0mm",
|
|
|
+ "210mm",
|
|
|
+ "297mm",
|
|
|
+ printStyle + currentPageHTML
|
|
|
+ );
|
|
|
LODOP.NewPage(); // 开启新页
|
|
|
// 新页初始化:当前行作为新页的第一行
|
|
|
currentPageHTML = printTarget.innerHTML;
|
|
|
pageHeightNow = printTarget.offsetHeight;
|
|
|
} else {
|
|
|
- pageHeightNow += printTarget.offsetHeight
|
|
|
- currentPageHTML += printTarget.innerHTML
|
|
|
+ pageHeightNow += printTarget.offsetHeight;
|
|
|
+ currentPageHTML += printTarget.innerHTML;
|
|
|
}
|
|
|
// let info = patientInfusionInfos.value[i]
|
|
|
// let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
@@ -352,13 +538,19 @@ const execPrint = () => {
|
|
|
// printHTML += document.getElementById(id).innerHTML
|
|
|
// }
|
|
|
}
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', printStyle + currentPageHTML);
|
|
|
- LODOP.PREVIEW()
|
|
|
+ LODOP.ADD_PRINT_HTML(
|
|
|
+ "0mm",
|
|
|
+ "0mm",
|
|
|
+ "210mm",
|
|
|
+ "297mm",
|
|
|
+ printStyle + currentPageHTML
|
|
|
+ );
|
|
|
+ LODOP.PREVIEW();
|
|
|
}
|
|
|
- updatePrintState()
|
|
|
+ updatePrintState();
|
|
|
} else {
|
|
|
- printPatientBottleInfos.value = [...patientInfusionInfos.value]
|
|
|
- printPatientBottleInfos.value = handlePrintByFrequency()
|
|
|
+ printPatientBottleInfos.value = [...patientInfusionInfos.value];
|
|
|
+ // printPatientBottleInfos.value = handlePrintByFrequency();
|
|
|
// console.log("patientInfusionInfos",patientInfusionInfos.value)
|
|
|
// console.log("printPatientBottleInfos",printPatientBottleInfos.value)
|
|
|
nextTick(() => {
|
|
|
@@ -367,7 +559,7 @@ const execPrint = () => {
|
|
|
// /* 一行3个,预留间距 */
|
|
|
|
|
|
// const printStyle = `<style>
|
|
|
- // .card-container { display: inline; }
|
|
|
+ // .card-container { display: inline; }
|
|
|
// td { border: 1px solid black; font-size: 12px; padding: 2px; }
|
|
|
// </style>`;
|
|
|
// const PAGE_MAX_HEIGHT = 1100; // 页面最大高度阈值(px)
|
|
|
@@ -445,18 +637,18 @@ const execPrint = () => {
|
|
|
|
|
|
// LODOP.PREVIEW();
|
|
|
|
|
|
- LODOP.PRINT_INIT('infusionCard');
|
|
|
- LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '');
|
|
|
+ LODOP.PRINT_INIT("infusionCard");
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, "210mm", "297mm", "");
|
|
|
/* 一行3个,使用float布局确保兼容性 */
|
|
|
|
|
|
const printStyle = `<style>
|
|
|
.card-row { overflow: hidden; margin-bottom: 10px; } /* 清除浮动并添加行间距 */
|
|
|
- .card-container {
|
|
|
- float: left;
|
|
|
- width: 31.5%;
|
|
|
- box-sizing: border-box;
|
|
|
+ .card-container {
|
|
|
+ float: left;
|
|
|
+ width: 31.5%;
|
|
|
+ box-sizing: border-box;
|
|
|
padding: 0 5px; /* 预留间距 */
|
|
|
- }
|
|
|
+ }
|
|
|
td { border: 1px solid black; font-size: 12px; padding: 2px; }
|
|
|
/* 最后一个元素清除右侧内边距 */
|
|
|
.card-container:nth-child(3n) { padding-right: 0; }
|
|
|
@@ -467,12 +659,14 @@ const execPrint = () => {
|
|
|
const PAGE_MAX_HEIGHT = 1020; // 页面最大高度阈值(px)
|
|
|
let currentPageHTML = printStyle; // 当前页内容
|
|
|
let currentPageTotalHeight = 0; // 当前页累计高度(px)
|
|
|
- let currentRowHTML = ''; // 当前行的HTML内容
|
|
|
+ let currentRowHTML = ""; // 当前行的HTML内容
|
|
|
let currentRowElements = []; // 当前行的元素
|
|
|
let currentRowMaxHeight = 0; // 当前行最高元素高度(px)
|
|
|
|
|
|
printPatientBottleInfos.value.forEach((item, index) => {
|
|
|
- const printTarget = document.getElementById(`${item.patInfo.patNo}-${index}_print`);
|
|
|
+ const printTarget = document.getElementById(
|
|
|
+ `${item.patInfo.patNo}-${index}`
|
|
|
+ );
|
|
|
if (!printTarget) return;
|
|
|
|
|
|
// 获取当前元素高度(px)
|
|
|
@@ -489,12 +683,19 @@ const execPrint = () => {
|
|
|
const rowWithClearfix = `<div class="card-row">${currentRowHTML}</div>`;
|
|
|
|
|
|
// 计算当前行加入后,页面的总高度
|
|
|
- const totalHeightAfterAdd = currentPageTotalHeight + currentRowMaxHeight;
|
|
|
+ const totalHeightAfterAdd =
|
|
|
+ currentPageTotalHeight + currentRowMaxHeight;
|
|
|
|
|
|
// 3. 判断是否需要分页
|
|
|
if (totalHeightAfterAdd > PAGE_MAX_HEIGHT) {
|
|
|
// 先打印当前页已有的内容
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', currentPageHTML);
|
|
|
+ LODOP.ADD_PRINT_HTML(
|
|
|
+ "0mm",
|
|
|
+ "0mm",
|
|
|
+ "210mm",
|
|
|
+ "297mm",
|
|
|
+ currentPageHTML
|
|
|
+ );
|
|
|
LODOP.NewPage(); // 开启新页
|
|
|
|
|
|
// 新页初始化:当前行作为新页的第一行
|
|
|
@@ -509,7 +710,7 @@ const execPrint = () => {
|
|
|
// 5. 重置行状态,准备下一行
|
|
|
currentRowElements = [];
|
|
|
currentRowMaxHeight = 0;
|
|
|
- currentRowHTML = '';
|
|
|
+ currentRowHTML = "";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -519,11 +720,12 @@ const execPrint = () => {
|
|
|
const rowWithClearfix = `<div class="card-row">${currentRowHTML}</div>`;
|
|
|
|
|
|
// 计算剩余行加入后的总高度
|
|
|
- const totalHeightAfterAdd = currentPageTotalHeight + currentRowMaxHeight;
|
|
|
+ const totalHeightAfterAdd =
|
|
|
+ currentPageTotalHeight + currentRowMaxHeight;
|
|
|
|
|
|
// 如果超出页面高度,单独分页
|
|
|
if (totalHeightAfterAdd > PAGE_MAX_HEIGHT) {
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', currentPageHTML);
|
|
|
+ LODOP.ADD_PRINT_HTML("0mm", "0mm", "210mm", "297mm", currentPageHTML);
|
|
|
LODOP.NewPage();
|
|
|
currentPageHTML = printStyle + rowWithClearfix;
|
|
|
currentPageTotalHeight = currentRowMaxHeight;
|
|
|
@@ -535,11 +737,11 @@ const execPrint = () => {
|
|
|
|
|
|
// 7. 添加最后一页内容
|
|
|
if (currentPageHTML) {
|
|
|
- LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', currentPageHTML);
|
|
|
+ LODOP.ADD_PRINT_HTML("0mm", "0mm", "210mm", "297mm", currentPageHTML);
|
|
|
}
|
|
|
|
|
|
LODOP.PREVIEW();
|
|
|
- printPatientBottleInfos.value = []
|
|
|
+ printPatientBottleInfos.value = [];
|
|
|
// LODOP.PRINT_INIT('infusionCard')
|
|
|
// LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
// let printHTML = "";
|
|
|
@@ -605,51 +807,55 @@ const execPrint = () => {
|
|
|
// // LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm', printFinal)
|
|
|
// // LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
// LODOP.PREVIEW();
|
|
|
- updatePrintState()
|
|
|
+ updatePrintState();
|
|
|
});
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
function updatePrintState() {
|
|
|
const params = {
|
|
|
cardType: queryParams.cardType,
|
|
|
- orderNos: []
|
|
|
- }
|
|
|
+ orderNos: [],
|
|
|
+ };
|
|
|
|
|
|
patientInfusionInfos.value.forEach(info => {
|
|
|
- if (params.cardType === 'INFUSION_CARD') {
|
|
|
+ if (params.cardType === "INFUSION_CARD") {
|
|
|
info.drugGroups.forEach(group => {
|
|
|
- params.orderNos.push(group.mainDrug.actOrderNo)
|
|
|
- })
|
|
|
+ params.orderNos.push(group.mainDrug.actOrderNo);
|
|
|
+ });
|
|
|
} else {
|
|
|
info.bottleCardDrugs.forEach(group => {
|
|
|
- params.orderNos.push(group.actOrderNo)
|
|
|
- })
|
|
|
+ params.orderNos.push(group.actOrderNo);
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
nextTick(() => {
|
|
|
updatePrintStatus(params).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
function getStyleText(selector) {
|
|
|
var sheets = document.styleSheets;
|
|
|
- var styleText = '';
|
|
|
+ var styleText = "";
|
|
|
for (var i = 0; i < sheets.length; i++) {
|
|
|
try {
|
|
|
var rules = sheets[i].cssRules || sheets[i].rules;
|
|
|
if (rules) {
|
|
|
for (var j = 0; j < rules.length; j++) {
|
|
|
- if (rules[j].selectorText && rules[j].selectorText.includes(selector)) {
|
|
|
- styleText += rules[j].cssText + '\n';
|
|
|
+ if (
|
|
|
+ rules[j].selectorText &&
|
|
|
+ rules[j].selectorText.includes(selector)
|
|
|
+ ) {
|
|
|
+ styleText += rules[j].cssText + "\n";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } catch (e) { /* 可能跨域安全错误 */ }
|
|
|
+ } catch (e) {
|
|
|
+ /* 可能跨域安全错误 */
|
|
|
+ }
|
|
|
}
|
|
|
return styleText;
|
|
|
}
|
|
|
@@ -662,15 +868,15 @@ function getStyleText(selector) {
|
|
|
// -- 已打印:print_comment like '%J%'
|
|
|
// -- 未打印:isnull(print_comment,'') not like '%J%'
|
|
|
onMounted(() => {
|
|
|
- initLodop()
|
|
|
+ initLodop();
|
|
|
getWardsApi().then(res => {
|
|
|
- userWards.value = res
|
|
|
+ userWards.value = res;
|
|
|
if (!queryParams.wardCode) {
|
|
|
- queryParams.wardCode = userWards.value[0].value
|
|
|
+ queryParams.wardCode = userWards.value[0].value;
|
|
|
}
|
|
|
- handleWardChange(queryParams.wardCode)
|
|
|
- })
|
|
|
-})
|
|
|
+ handleWardChange(queryParams.wardCode);
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
@@ -717,7 +923,7 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
.blue-text {
|
|
|
- color: #1146f3
|
|
|
+ color: #1146f3;
|
|
|
}
|
|
|
|
|
|
.is-disabled {
|
|
|
@@ -764,4 +970,4 @@ onMounted(() => {
|
|
|
flex-wrap: wrap;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|