浏览代码

Merge branch 'master' into 淮海科技

xiaochan 3 周之前
父节点
当前提交
f97c5c81ad

+ 49 - 11
src/components/xmlr/components/PrintPrescriptionSign.vue

@@ -11,6 +11,7 @@ const props = defineProps<{
   data: any[];
   frequency: any[];
   patientInfo: any;
+  supplyType: any[];
 }>();
 
 const now = dayjs().format("YYYY年MM月DD日");
@@ -20,12 +21,23 @@ const doctor = reactive({
 });
 
 const [TemplateDefault, print] = useVuePrint({
-  hidden: false,
-  extraPageCss: `table {
+  extraPageCss: `
+    @page {
+        size: A5;
+        margin: 0;
+        padding: 0 ;
+    }
+
+    * {
+        box-sizing: border-box;
+    }
+
+  table {
   border-collapse: collapse;
-  height: 210mm;
+  height: 200mm;
   width: 148mm;
   table-layout: fixed;
+  overflow: hidden;
 }
 
 th {
@@ -48,12 +60,6 @@ th {
 }`,
 });
 const colspan = 6;
-
-defineExpose<UseDialogType.Expose>({
-  confirm() {
-    return print();
-  },
-});
 </script>
 
 <template>
@@ -109,16 +115,30 @@ defineExpose<UseDialogType.Expose>({
             <td colspan="6">
               <div style="height: 12pt"></div>
               <div
-                style="display: flex; font-size: 13pt; padding-left: 15pt"
+                style="
+                  display: grid;
+                  font-size: 13pt;
+                  padding-left: 15pt;
+                  padding-top: 2pt;
+                  grid-template-columns:
+                    2fr 1fr 1fr
+                    1fr;
+                "
                 v-for="item in props.data"
               >
                 <div>
                   {{ item.chargeName }}
                 </div>
-                <div style="width: 2mm"></div>
+                <div>{{ item.chargeAmount }}</div>
+                <div>
+                  {{ item.descriptions }}
+                </div>
                 <div>
                   {{ item.frequencyName }}
                 </div>
+                <div>
+                  {{ item.supplyTypeName }}
+                </div>
               </div>
             </td>
           </tr>
@@ -155,6 +175,7 @@ defineExpose<UseDialogType.Expose>({
     <header>
       医师:
       <SystemStaffSelect v-model="doctor" value="code" label="name" />
+      <el-button @click="print">打印</el-button>
     </header>
     <div class="layout_main">
       <el-table :data="props.data" height="100%">
@@ -180,6 +201,23 @@ defineExpose<UseDialogType.Expose>({
             </el-select>
           </template>
         </el-table-column>
+        <el-table-column label="给药方式">
+          <template #default="{ row }">
+            <el-select
+              v-model="row.supplyType"
+              filterable
+              @change="
+                value => {
+                  row.supplyTypeName = XEUtils.find(props.supplyType, item => {
+                    return item.code === value;
+                  }).name;
+                }
+              "
+            >
+              <xc-el-option :data="props.supplyType" />
+            </el-select>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
   </div>

+ 9 - 2
src/components/xmlr/index.ts

@@ -11,7 +11,10 @@ import { useDialog, UseDialogType } from "@/components/cy/CyDialog/index";
 import { useUserStore } from "@/pinia/user-store";
 import { getServerDateApi } from "@/api/public-api";
 import PrintPrescriptionSign from "@/components/xmlr/components/PrintPrescriptionSign.vue";
-import { getFrequency } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import {
+  getFrequency,
+  getSupplyType,
+} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 
 type PatInfo = {
   name?: string;
@@ -168,8 +171,8 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
       if (filter.length === 0) {
         return;
       }
-      console.log(data);
       const frequency = await mutation.getExecutionFrequency();
+      const supplyType = await mutation.getSupplyType();
 
       useDialog(PrintPrescriptionSign, {
         dialogProps: {
@@ -180,6 +183,7 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
         params: {
           data: XEUtils.cloneDeep(filter),
           frequency,
+          supplyType,
           patientInfo: store.patInfo,
         },
       });
@@ -187,6 +191,9 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
     getExecutionFrequency: XEUtils.once(async () => {
       return await getFrequency();
     }),
+    getSupplyType: XEUtils.once(async () => {
+      return await getSupplyType();
+    }),
   };
 
   onActivated(() => {

+ 17 - 0
src/data/yz-selfbuy.ts

@@ -0,0 +1,17 @@
+export const selfBuys = [
+  { code: "1", name: "自备" },
+  { code: "2", name: "嘱托" },
+  { code: "3", name: "基数药" },
+  {
+    code: "4",
+    name: "出院带药",
+  },
+];
+
+export function findSelfBuysName(code: string) {
+  return (
+    selfBuys.find(item => {
+      return item.code === code;
+    })?.name ?? ""
+  );
+}

+ 1 - 0
src/utils/cy-use/useVuePrint.tsx

@@ -19,6 +19,7 @@ export function useVuePrint(
     id?: string;
     extraCss?: string[];
     hidden?: boolean;
+    // div 的样式
     contentStyle?: string;
     // css 样式
     extraPageCss?: string;

+ 419 - 236
src/views/medical-advice/execute-item/PrintExecuteItem.vue

@@ -1,10 +1,19 @@
 <template>
-
   <div class="layout_container">
     <header>
-      <el-select filterable v-model="queryParam.wardCode" @change="initPatintBedNo"
-                 style="width: 130px;margin-right: 10px" size="small">
-        <el-option v-for="item in ward" :key="item.code" :label="item.name" :value="item.code">
+      <el-select
+        filterable
+        v-model="queryParam.wardCode"
+        @change="initPatintBedNo"
+        style="width: 130px; margin-right: 10px"
+        size="small"
+      >
+        <el-option
+          v-for="item in ward"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
           <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.name }}</span>
@@ -12,20 +21,22 @@
       </el-select>
       执行时间:
       <el-date-picker
-          v-model="queryParam.executeTime"
-          type="datetime"
-          size="small"
-          :clearable="false"
-          format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
-          style="width: 150px;margin-right: 10px"/>
+        v-model="queryParam.executeTime"
+        type="datetime"
+        size="small"
+        :clearable="false"
+        format="YYYY-MM-DD HH:mm:ss"
+        value-format="YYYY-MM-DD HH:mm:ss"
+        style="width: 150px; margin-right: 10px"
+      />
       床位范围:
-      <el-select v-model="queryParam.startBedNo"
-                 clearable
-                 style="width: 70px">
-        <el-option v-for="item in patintList"
-                   :key="item.bedNo"
-                   :label="item.bedNo"
-                   :value="item.bedNo">
+      <el-select v-model="queryParam.startBedNo" clearable style="width: 70px">
+        <el-option
+          v-for="item in patintList"
+          :key="item.bedNo"
+          :label="item.bedNo"
+          :value="item.bedNo"
+        >
           <span>{{ item.bedNo }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.inpatientNo }}</span>
@@ -34,13 +45,17 @@
         </el-option>
       </el-select>
-      <el-select v-model="queryParam.endBedNo"
-                 style="width: 70px;margin-right: 10px"
-                 clearable>
-        <el-option v-for="item in reverPatintList"
-                   :key="item.bedNo"
-                   :label="item.bedNo"
-                   :value="item.bedNo">
+      <el-select
+        v-model="queryParam.endBedNo"
+        style="width: 70px; margin-right: 10px"
+        clearable
+      >
+        <el-option
+          v-for="item in reverPatintList"
+          :key="item.bedNo"
+          :label="item.bedNo"
+          :value="item.bedNo"
+        >
           <span>{{ item.bedNo }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.inpatientNo }}</span>
@@ -49,213 +64,357 @@
         </el-option>
       </el-select>
       频率:
-      <el-select v-model="queryParam.frequCodeFlag"
-                 style="width: 70px;margin-right: 10px"
+      <el-select
+        v-model="queryParam.frequCodeFlag"
+        style="width: 70px; margin-right: 10px"
       >
         <el-option label="全部" value="0"></el-option>
         <el-option label="临时" value="1"></el-option>
         <el-option label="长期" value="2"></el-option>
       </el-select>
       打印范围:
-      <el-select v-model="queryParam.printFlag"
-                 style="width: 70px;margin-right: 10px"
+      <el-select
+        v-model="queryParam.printFlag"
+        style="width: 70px; margin-right: 10px"
       >
         <el-option label="全部" value="0"></el-option>
         <el-option label="新增" value="1"></el-option>
         <el-option label="已打印" value="2"></el-option>
       </el-select>
-      <el-radio-group v-model="queryParam.pageClass" size="small" @change="pageClassChange" style="margin-right: 20px">
-        <el-radio @click="pageClassChange"  value="0" >选择分类</el-radio>
-        <el-radio  value="1" >全部分类</el-radio>
+      <el-radio-group
+        v-model="queryParam.pageClass"
+        size="small"
+        @change="pageClassChange"
+        style="margin-right: 20px"
+      >
+        <el-radio @click="pageClassChange" value="0">选择分类</el-radio>
+        <el-radio value="1">全部分类</el-radio>
       </el-radio-group>
-      <el-radio-group v-model="queryParam.executeFlag" size="small"  style="margin-right: 10px">
-        <el-radio  value="0" >大执行单</el-radio>
-        <el-radio  value="1" >小执行单</el-radio>
+      <el-radio-group
+        v-model="queryParam.executeFlag"
+        size="small"
+        style="margin-right: 10px"
+      >
+        <el-radio value="0">大执行单</el-radio>
+        <el-radio value="1">小执行单</el-radio>
       </el-radio-group>
-      <el-button icon="Search" type="primary" @click="queryInfo">查询</el-button>
-      <el-button icon="Printer" type="success" @click="printInfo">打印</el-button>
+      <el-button icon="Search" type="primary" @click="queryInfo"
+        >查询</el-button
+      >
+      <el-button icon="Printer" type="success" @click="printInfo"
+        >打印</el-button
+      >
     </header>
     <div class="layout_main">
-      <el-scrollbar class="scrollbar" :max-height="(getWindowSize.h/1.2-100)+'px'" :noresize="true">
-        <div v-if="queryParam.executeFlag=='0'"  id="printId">
+      <el-scrollbar
+        class="scrollbar"
+        :max-height="getWindowSize.h / 1.2 - 100 + 'px'"
+        :noresize="true"
+      >
+        <div v-if="queryParam.executeFlag == '0'" id="printId">
           <table class="pageTable">
             <thead>
-            <tr>
-              <td colspan="9" style="width: 100%;border: none;text-align: center;font-size: 25px;font-weight:bold">
-                执行项目表
-              </td>
-            </tr>
-            <tr>
-              <td colspan="9" style="width: 753px;border: none;">
-                <div style="float: left;width: 25%">
-                  病房:{{getWardName(queryParam.wardCode)}}
-                </div>
-                <div style="float: left;width: 50%">
-                  日期:{{queryParam.executeTime}}至 {{getDiffDays(queryParam.executeTime.split(" ")[0],1)+" "+queryParam.executeTime.split(" ")[1]}}
-                </div>
-                <div style="float: left;width: 25%">
-                  打印日期:{{getFormatDatetime(new Date(),'YYYY-MM-DD')}}
-                </div>
-              </td>
-            </tr>
-            <tr>
-              <th style="width: 10%;height: 27px">医嘱名称</th>
-              <th >剂量</th>
-              <th >总量</th>
-              <th >给药方式</th>
-              <th >频率</th>
-              <th >执行时间</th>
-              <th >执行者</th>
-              <th >审核者</th>
-              <th >医生嘱托</th>
-            </tr>
+              <tr>
+                <td
+                  colspan="9"
+                  style="
+                    width: 100%;
+                    border: none;
+                    text-align: center;
+                    font-size: 25px;
+                    font-weight: bold;
+                  "
+                >
+                  执行项目表
+                </td>
+              </tr>
+              <tr>
+                <td colspan="9" style="width: 753px; border: none">
+                  <div style="float: left; width: 25%">
+                    病房:{{ getWardName(queryParam.wardCode) }}
+                  </div>
+                  <div style="float: left; width: 50%">
+                    日期:{{ queryParam.executeTime }}至
+                    {{
+                      getDiffDays(queryParam.executeTime.split(" ")[0], 1) +
+                      " " +
+                      queryParam.executeTime.split(" ")[1]
+                    }}
+                  </div>
+                  <div style="float: left; width: 25%">
+                    打印日期:{{ getFormatDatetime(new Date(), "YYYY-MM-DD") }}
+                  </div>
+                </td>
+              </tr>
+              <tr>
+                <th style="width: 10%; height: 27px">医嘱名称</th>
+                <th>剂量</th>
+                <th>总量</th>
+                <th>给药方式</th>
+                <th>频率</th>
+                <th>执行时间</th>
+                <th>执行者</th>
+                <th>审核者</th>
+                <th>医生嘱托</th>
+              </tr>
             </thead>
             <tbody>
-            <tr v-for="(item,index) in resData">
-              <td colspan="9" v-if="item.showFlag==0" style="font-weight: bold;font-size: 13px;border-bottom: 1px black solid;border-top: 1px black solid;">{{item.bedNo}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {{item.name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{item.inpatientNo}}</td>
-              <td v-if="item.showFlag==1" style="width: 20%">{{item.orderName}}</td>
-              <td  v-if="item.showFlag==1"  style="width: 8%">{{item.dose ?item.dose:''}}</td>
-              <td  v-if="item.showFlag==1" style="width: 8%">{{item.drugQuanStr}}</td>
-              <td  v-if="item.showFlag==1" style="width: 8%">{{item.supplyName}}</td>
-              <td  v-if="item.showFlag==1" style="width: 8%">{{item.frequCode}}</td>
-              <td  v-if="item.showFlag==1" style="width: 25%">{{item.occTimeStr}}</td>
-              <td  v-if="item.showFlag==1"  style="width: 8%"></td>
-              <td  v-if="item.showFlag==1" style="width: 8%"></td>
-              <td  v-if="item.showFlag==1" style="width: 8%">{{item.instruction}}</td>
-            </tr>
+              <tr v-for="(item, index) in resData">
+                <td
+                  colspan="9"
+                  v-if="item.showFlag == 0"
+                  style="
+                    font-weight: bold;
+                    font-size: 13px;
+                    border-bottom: 1px black solid;
+                    border-top: 1px black solid;
+                  "
+                >
+                  {{ item.bedNo }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                  {{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                  {{ item.inpatientNo }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 20%">
+                  {{ item.orderName }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 8%">
+                  {{ item.dose ? item.dose : "" }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 8%">
+                  {{ item.drugQuanStr }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 8%">
+                  {{ item.supplyName }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 8%">
+                  {{ item.frequCode }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 25%">
+                  {{ item.occTimeStr }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 8%"></td>
+                <td v-if="item.showFlag == 1" style="width: 8%"></td>
+                <td v-if="item.showFlag == 1" style="width: 8%">
+                  {{ item.instruction }}{{ findSelfBuysName(item.selfBuy) }}
+                </td>
+              </tr>
             </tbody>
           </table>
         </div>
-        <div v-if="queryParam.executeFlag=='1'" id="smalPrintId">
+        <div v-if="queryParam.executeFlag == '1'" id="smalPrintId">
           <table class="pageTable">
             <thead>
-            <tr>
-              <td colspan="6" style="width: 65%;border: none;">
-                <div style="font-size: 25px;text-align:center;font-weight:bold">
-                  执行项目表
-                </div>
-                <div style="float: right">
-                  打印日期:{{getFormatDatetime(new Date(),'YYYY-MM-DD')}}
-                </div>
-              </td>
-            </tr>
-            <tr>
-              <td colspan="6" style="width: 753px;border: none;">
-                <div style="float: left;width: 25%">
-                  病房:{{getWardName(queryParam.wardCode)}}
-                </div>
-                <div style="float: left;width: 75%">
-                  日期:{{queryParam.executeTime}}至 {{getDiffDays(queryParam.executeTime.split(" ")[0],1)+" "+queryParam.executeTime.split(" ")[1]}}
-                </div>
-              </td>
-            </tr>
-            <tr>
-              <th  style="height: 27px;border-left: 1px solid black">医嘱名称</th>
-              <th >剂量</th>
-              <th  >给药方式</th>
-              <th  >频率</th>
-              <th colspan="2" style="text-align: center;border: 1px black solid">执行签名</th>
-            </tr>
+              <tr>
+                <td colspan="6" style="width: 65%; border: none">
+                  <div
+                    style="
+                      font-size: 25px;
+                      text-align: center;
+                      font-weight: bold;
+                    "
+                  >
+                    执行项目表
+                  </div>
+                  <div style="float: right">
+                    打印日期:{{ getFormatDatetime(new Date(), "YYYY-MM-DD") }}
+                  </div>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="6" style="width: 753px; border: none">
+                  <div style="float: left; width: 25%">
+                    病房:{{ getWardName(queryParam.wardCode) }}
+                  </div>
+                  <div style="float: left; width: 75%">
+                    日期:{{ queryParam.executeTime }}至
+                    {{
+                      getDiffDays(queryParam.executeTime.split(" ")[0], 1) +
+                      " " +
+                      queryParam.executeTime.split(" ")[1]
+                    }}
+                  </div>
+                </td>
+              </tr>
+              <tr>
+                <th style="height: 27px; border-left: 1px solid black">
+                  医嘱名称
+                </th>
+                <th>剂量</th>
+                <th>给药方式</th>
+                <th>频率</th>
+                <th
+                  colspan="2"
+                  style="text-align: center; border: 1px black solid"
+                >
+                  执行签名
+                </th>
+              </tr>
             </thead>
             <tbody>
-            <tr v-for="(item,index) in resData">
-              <td colspan="4" v-if="item.showFlag==0" style="font-weight: bold;font-size: 13px;border: 1px black solid ; ">{{item.bedNo}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {{item.name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{item.inpatientNo}}</td>
-              <td v-if="item.showFlag==1" style="width: 45%;border-left: 1px black solid">{{item.orderName}}</td>
-              <td  v-if="item.showFlag==1"  style="width: 10%">{{item.dose ?item.dose:''}}</td>
-              <td  v-if="item.showFlag==1" style="width: 15%">{{item.supplyName}}</td>
-              <td  v-if="item.showFlag==1" style="width: 10%">{{item.frequCode}}</td>
-              <td  v-if="item.showFlag==0"  style="width: 10%;border-left:  1px black solid;border-bottom:  none;border-right:  1px black solid;border-top: 1px black solid"></td>
-              <td  v-if="item.showFlag==0"  style="width: 10%;border-left:  1px black solid;border-bottom:  none;border-right:  1px black solid;border-top: 1px black solid"></td>
-              <td   v-if="item.showFlag==1"  style="width: 10%;border-left:  1px black solid;border-bottom: none;border-right:  1px black solid;border-top: none"></td>
-              <td  v-if="item.showFlag==1"  style="width: 10%;border-left:  1px black solid;border-bottom: none;border-right:  1px black solid;border-top: none"></td>
-            </tr>
-            <tr>
-              <td colspan="6"  style="border: 1px solid black;height: 0px"></td>
-            </tr>
+              <tr v-for="(item, index) in resData">
+                <td
+                  colspan="4"
+                  v-if="item.showFlag == 0"
+                  style="
+                    font-weight: bold;
+                    font-size: 13px;
+                    border: 1px black solid;
+                  "
+                >
+                  {{ item.bedNo }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                  {{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                  {{ item.inpatientNo }}
+                </td>
+                <td
+                  v-if="item.showFlag == 1"
+                  style="width: 45%; border-left: 1px black solid"
+                >
+                  {{ item.orderName }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 10%">
+                  {{ item.dose ? item.dose : "" }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 15%">
+                  {{ item.supplyName }}
+                </td>
+                <td v-if="item.showFlag == 1" style="width: 10%">
+                  {{ item.frequCode }}
+                </td>
+                <td
+                  v-if="item.showFlag == 0"
+                  style="
+                    width: 10%;
+                    border-left: 1px black solid;
+                    border-bottom: none;
+                    border-right: 1px black solid;
+                    border-top: 1px black solid;
+                  "
+                ></td>
+                <td
+                  v-if="item.showFlag == 0"
+                  style="
+                    width: 10%;
+                    border-left: 1px black solid;
+                    border-bottom: none;
+                    border-right: 1px black solid;
+                    border-top: 1px black solid;
+                  "
+                ></td>
+                <td
+                  v-if="item.showFlag == 1"
+                  style="
+                    width: 10%;
+                    border-left: 1px black solid;
+                    border-bottom: none;
+                    border-right: 1px black solid;
+                    border-top: none;
+                  "
+                ></td>
+                <td
+                  v-if="item.showFlag == 1"
+                  style="
+                    width: 10%;
+                    border-left: 1px black solid;
+                    border-bottom: none;
+                    border-right: 1px black solid;
+                    border-top: none;
+                  "
+                ></td>
+              </tr>
+              <tr>
+                <td
+                  colspan="6"
+                  style="border: 1px solid black; height: 0px"
+                ></td>
+              </tr>
             </tbody>
           </table>
         </div>
-
       </el-scrollbar>
     </div>
   </div>
-  <el-dialog
-      v-model="dialogVisible"
-      title="选择分类"
-      width="50%"
-  >
-    <ItemClass ref="itemClassRef"  :wardCode="queryParam.wardCode"  @closeDiag="closeDiag" @selectionPageClass="selectionPageClass" ></ItemClass>
+  <el-dialog v-model="dialogVisible" title="选择分类" width="50%">
+    <ItemClass
+      ref="itemClassRef"
+      :wardCode="queryParam.wardCode"
+      @closeDiag="closeDiag"
+      @selectionPageClass="selectionPageClass"
+    ></ItemClass>
   </el-dialog>
 </template>
 
-<script setup lang="ts" name='PrintExecuteItem'>
-import { computed, onMounted, ref } from 'vue'
-import { getFormatDatetime,getDiffDays } from "@/utils/date"
-import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
-import {queryPatientInfo} from "@/api/medical-advice/medical-advice-management";
-import {queryExecuteItem,updateExecuteItemPrintFlag} from "@/api/medical-advice/excute-item";
+<script setup lang="ts" name="PrintExecuteItem">
+import { computed, onMounted, ref } from "vue";
+import { getFormatDatetime, getDiffDays } from "@/utils/date";
+import { getAllWards } from "@/api/zhu-yuan-yi-sheng/resident-doctor";
+import { queryPatientInfo } from "@/api/medical-advice/medical-advice-management";
+import {
+  queryExecuteItem,
+  updateExecuteItemPrintFlag,
+} from "@/api/medical-advice/excute-item";
 import ItemClass from "@/components/medical-advice/ItemClass";
-import {getLodop, initLodop} from '@/utils/c-lodop'
-import {getWindowSize} from "@/utils/window-size";
+import { getLodop, initLodop } from "@/utils/c-lodop";
+import { getWindowSize } from "@/utils/window-size";
+import { findSelfBuysName } from "@/data/yz-selfbuy";
 
 const queryParam = ref({
-  wardCode:'',
-  startBedNo:'',
-  endBedNo:'',
-  executeTime:getFormatDatetime(new Date(), 'YYYY-MM-DD' + ' 00:00:00'),
-  frequCodeFlag:'0',
-  printFlag:'1',
-  executeFlag:'0',
-  pageClass:'1',
-  classCode:'',
-  codes:[],
-  itemCode:'',
-})
+  wardCode: "",
+  startBedNo: "",
+  endBedNo: "",
+  executeTime: getFormatDatetime(new Date(), "YYYY-MM-DD" + " 00:00:00"),
+  frequCodeFlag: "0",
+  printFlag: "1",
+  executeFlag: "0",
+  pageClass: "1",
+  classCode: "",
+  codes: [],
+  itemCode: "",
+});
 
 //选择分类切换
-const pageClassChange = () =>{
-   if(queryParam.value.pageClass === '0'){
-     dialogVisible.value = true
-   }else {
-     dialogVisible.value = false
-   }
-}
+const pageClassChange = () => {
+  if (queryParam.value.pageClass === "0") {
+    dialogVisible.value = true;
+  } else {
+    dialogVisible.value = false;
+  }
+};
 
-const selectionPageClass = (val)=>{
-  queryParam.value.codes = val.codes
-  queryParam.value.classCode = val.classCode
-  queryParam.value.itemCode = val.itemCode
-}
+const selectionPageClass = val => {
+  queryParam.value.codes = val.codes;
+  queryParam.value.classCode = val.classCode;
+  queryParam.value.itemCode = val.itemCode;
+};
 
-const closeDiag = ()=>{
-  dialogVisible.value = false
-}
+const closeDiag = () => {
+  dialogVisible.value = false;
+};
 
-const dialogVisible = ref(false)
+const dialogVisible = ref(false);
 
-const ward = ref([])
+const ward = ref([]);
 
-const  getWardName = (code)=>{
+const getWardName = code => {
   for (let i = 0; i < ward.value.length; i++) {
-    if(code === ward.value[i].code ){
-      return ward.value[i].name
+    if (code === ward.value[i].code) {
+      return ward.value[i].name;
     }
   }
-}
-
-onMounted(()=>{
-  initLodop()
-  getAllWards().then((res:any)=>{
-    if(res){
-      ward.value = res
-      queryParam.value.wardCode = res[0].code
-      initPatintBedNo()
+};
+
+onMounted(() => {
+  initLodop();
+  getAllWards().then((res: any) => {
+    if (res) {
+      ward.value = res;
+      queryParam.value.wardCode = res[0].code;
+      initPatintBedNo();
     }
-  })
+  });
+});
+const patintList = ref([]);
+const reverPatintList = computed(() => reverseArray(patintList.value));
 
-})
-const patintList = ref([])
-const reverPatintList = computed(() => reverseArray(patintList.value))
 function reverseArray(arr) {
   let newArr = [];
   arr.forEach(element => {
@@ -265,15 +424,15 @@ function reverseArray(arr) {
   return newArr;
 }
 
-const itemClassRef =ref(null)
-const resData = ref([])
-const queryInfo = ()=>{
- queryExecuteItem(queryParam.value).then((res:any)=>{
-   resData.value = res
- })
-}
+const itemClassRef = ref(null);
+const resData = ref([]);
+const queryInfo = () => {
+  queryExecuteItem(queryParam.value).then((res: any) => {
+    resData.value = res;
+  });
+};
 
-const printCss =`
+const printCss = `
 .pageTable tr th {
   border-bottom: 1px solid black;
   border-top: 1px solid black;
@@ -305,9 +464,9 @@ const printCss =`
 }
 
 
-`
+`;
 
-const smallPrintCss =`
+const smallPrintCss = `
 .pageTable tr th {
   border-bottom: 1px solid black;
   border-top: 1px solid black;
@@ -335,57 +494,80 @@ const smallPrintCss =`
 }
 
 
-`
-
+`;
 
-const printInfo = ()=>{
-  updateExecuteItemPrintFlag(resData.value).then((res:any)=>{
-    let LODOP = getLodop()
-    LODOP.PRINT_INIT('执行项目表') // 初始化打印机 名字
-    if(queryParam.value.executeFlag=='0'){
-      LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '') // 设置纸张大小  A4
-    }else {
-      LODOP.SET_PRINT_PAGESIZE(1, '148mm', '210mm', '') // 设置纸张大小  A5
+const printInfo = () => {
+  updateExecuteItemPrintFlag(resData.value).then((res: any) => {
+    let LODOP = getLodop();
+    LODOP.PRINT_INIT("执行项目表"); // 初始化打印机 名字
+    if (queryParam.value.executeFlag == "0") {
+      LODOP.SET_PRINT_PAGESIZE(1, "210mm", "297mm", ""); // 设置纸张大小  A4
+    } else {
+      LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", ""); // 设置纸张大小  A5
     }
-    LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) // 整宽不变形
-    if(queryParam.value.executeFlag=='0'){
-      LODOP.ADD_PRINT_TABLE('2mm', '5mm', '205mm', '220mm', '<style>' + printCss + '</style>' + '<body>' + document.getElementById('printId').innerHTML + '</body>') //要打印的内容
-      LODOP.SET_PRINT_STYLE('ItemType', 3)
-      LODOP.ADD_PRINT_TEXT('250mm', '100mm', '25mm', '10mm', '第#页/共&页')
-    }else {
-      LODOP.ADD_PRINT_TABLE('2mm', '5mm', '143mm', '165mm', '<style>' + smallPrintCss + '</style>' + '<body>' + document.getElementById('smalPrintId').innerHTML + '</body>') //要打印的内容
-      LODOP.SET_PRINT_STYLE('ItemType', 3)
-      LODOP.ADD_PRINT_TEXT('200mm', '70mm', '25mm', '10mm', '第#页/共&页')
+    LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); // 整宽不变形
+    if (queryParam.value.executeFlag == "0") {
+      LODOP.ADD_PRINT_TABLE(
+        "2mm",
+        "5mm",
+        "205mm",
+        "220mm",
+        "<style>" +
+          printCss +
+          "</style>" +
+          "<body>" +
+          document.getElementById("printId").innerHTML +
+          "</body>"
+      ); //要打印的内容
+      LODOP.SET_PRINT_STYLE("ItemType", 3);
+      LODOP.ADD_PRINT_TEXT("250mm", "100mm", "25mm", "10mm", "第#页/共&页");
+    } else {
+      LODOP.ADD_PRINT_TABLE(
+        "2mm",
+        "5mm",
+        "143mm",
+        "165mm",
+        "<style>" +
+          smallPrintCss +
+          "</style>" +
+          "<body>" +
+          document.getElementById("smalPrintId").innerHTML +
+          "</body>"
+      ); //要打印的内容
+      LODOP.SET_PRINT_STYLE("ItemType", 3);
+      LODOP.ADD_PRINT_TEXT("200mm", "70mm", "25mm", "10mm", "第#页/共&页");
     }
-    LODOP.PREVIEW() // 关闭
-  })
-}
-
-const initPatintBedNo=()=>{
-  itemClassRef.value ? itemClassRef.value.setWardCode(queryParam.value.wardCode) : ''
-  queryPatientInfo('',queryParam.value.wardCode,'').then((res:any)=>{
-    patintList.value = res
-  })
-}
+    LODOP.PREVIEW(); // 关闭
+  });
+};
+
+const initPatintBedNo = () => {
+  itemClassRef.value
+    ? itemClassRef.value.setWardCode(queryParam.value.wardCode)
+    : "";
+  queryPatientInfo("", queryParam.value.wardCode, "").then((res: any) => {
+    patintList.value = res;
+  });
+};
 </script>
 <style scoped lang="scss">
- .pageTable tr th {
+.pageTable tr th {
   border-bottom: 1px solid black;
   border-top: 1px solid black;
   text-align: left;
   font-size: 12px;
   padding: 0 0;
+}
 
+#printId .pageTable tr td {
+  border-bottom: 1px dashed black;
+  border-top: 1px dashed black;
+  text-align: left;
+  font-size: 12px;
+  padding: 0 0;
 }
-#printId .pageTable tr td{
-   border-bottom:1px dashed black;
-   border-top:1px dashed black;
-   text-align: left;
-   font-size: 12px;
-   padding: 0 0;
- }
 
-#smalPrintId .pageTable tr td{
+#smalPrintId .pageTable tr td {
   border-bottom: 1px solid black;
   border-top: 1px solid black;
   text-align: left;
@@ -393,15 +575,16 @@ const initPatintBedNo=()=>{
   padding: 0 0;
 }
 
-
-.pageTable tr td{
+.pageTable tr td {
   height: 27px;
 }
- #smalPrintId{
-   padding: 0 0;
-   width: 470px;
- }
-#printId{
+
+#smalPrintId {
+  padding: 0 0;
+  width: 470px;
+}
+
+#printId {
   padding: 0 0;
   width: 753px;
 }