xiaochan 5 mesiacov pred
rodič
commit
992fa86957

+ 28 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/clinical-pathway/components/RenderPatientClinicalPathway.vue

@@ -92,6 +92,28 @@ const RenderTask = defineComponent({
     };
   },
 });
+
+function handleTdBind(currentIndex, value) {
+  if (currentIndex === 0) {
+    return {};
+  }
+
+  const thePrevious = props.data[currentIndex - 1];
+  if (thePrevious.execDate === value.execDate) {
+    return {
+      style: {
+        display: "none",
+      },
+    };
+  }
+
+  const filter = props.data.filter(item => {
+    return item.execDate === value.execDate;
+  });
+  return {
+    colspan: filter.length,
+  };
+}
 </script>
 
 <template>
@@ -108,8 +130,12 @@ const RenderTask = defineComponent({
         </td>
 
         <template v-for="(task, taskIndex) in props.data.length">
-          <td v-if="trLine === 1" style="text-align: center">
-            {{ taskIndex + 1 }} 天
+          <td
+            v-if="trLine === 1"
+            style="text-align: center"
+            v-bind="handleTdBind(task - 1, props.data[task - 1])"
+          >
+            {{ props.data[task - 1].execDate }} 第{{ taskIndex + 1 }}天
           </td>
           <td v-else-if="trLine === 6" style="padding: 10px 5px">
             <el-button

+ 594 - 388
src/views/medical-advice/patient-info/AdjustBed.vue

@@ -1,423 +1,629 @@
 <template>
-    <el-container>
-        <el-header>
-            <el-select v-if="wardSelectFlag()"  filterable v-model="queryParam.wardCode" clearable style="width: 150px;" size="small" @change="selectHlType">
-                <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>
-                </el-option>
-            </el-select>
-            <el-button v-if="wardSelectFlag()" type="primary" @click="queryBedMiInfo">查询</el-button>
-            <el-button v-if="wardSelectFlag()" type="primary" @click="refBedMiInfo">重置</el-button>
-            <el-button size="small" type="success" @click="saveBedInfo">保存</el-button>
-            <el-button type="primary" @click="clearBedInfo">清除床位信息</el-button>
-            <el-button type="primary" @click="addBedInfo">添加床位信息</el-button>
-            <el-button type="primary" @click="openPrebedDialog">床位预分配确认</el-button>
-            <div style="float: left;width: 300px;height: 20px;border: 1px solid #66b1ff;border-radius: 5px;margin-left: 20px;color: #1294fb;text-align: center;line-height: 20px">
-                <span style="font-weight:bold;">{{headerPatientInfo.bedNo?headerPatientInfo.bedNo+'床':''}} </span>
-                <span>&nbsp;{{headerPatientInfo.inpatientNo}}</span>
-                <span>&nbsp;&nbsp;{{headerPatientInfo.name}}&nbsp;&nbsp;&nbsp;&nbsp;</span>
-                <span>{{headerPatientInfo.sexName}}&nbsp;&nbsp;</span>
-                <span>{{headerPatientInfo.responceTypeName}}</span>
-            </div>
-        </el-header>
-        <el-main>
-            <div style="width: 100%">
-                <el-row :gutter="24">
-                    <el-col :span="6">
-                        <span style="font-size: 14px;font-weight:bold">床位:</span>&nbsp;&nbsp;<span style="color: red">{{bedData.bedTotal}}</span>
-                    </el-col>
-                    <el-col :span="6">
-                        <span style="font-size: 14px;font-weight:bold">总人数:</span>&nbsp;&nbsp;<span style="color: red">{{bedData.yzBedTotal}}</span>
-                    </el-col>
-                    <el-col :span="6">
-                        <span style="font-size: 14px;font-weight:bold">医保人数:</span>&nbsp;&nbsp;<span style="color: red">{{bedData.ybTotal}}</span>
-                    </el-col>
-                </el-row>
-            </div>
-            <el-scrollbar :max-height="scrollbarHeight">
-                <div style="width: 100%">
-                        <el-space wrap :size="spaceSize">
-                            <el-card @click="selectPatientClick(index)" v-for="(item,index) in bedData.data" :key="index" style="padding:0;width: 150px;height: 150px;border: 1px solid #66b1ff">
-                                    <div v-if="item.sex=='1'" style="margin-top: -15px;margin-left:-15px;border: 1px solid black;width: 50px;height: 15px;font-weight:bold;background-color: #1294fb ">
-                                        {{item.bedNo }}
-                                    </div>
-                                    <div v-else-if="item.sex=='2'" style="margin-top: -15px;margin-left:-15px;border: 1px solid black;width: 50px;height: 15px;font-weight:bold;background-color: #F56C6C">
-                                        {{item.bedNo }}
-                                    </div>
-                                    <div v-else style="margin-top: -15px;margin-left:-15px;border: 1px solid black;width: 50px;height: 15px;font-weight:bold;">
-                                        {{item.bedNo }}
-                                    </div>
-                                    <div style="margin-left:-15px;width: 130px;height: 20px">
-                                        {{item.inpatientNo }}
-                                    </div>
-                                    <div style="margin-left:-15px; margin-top: 5px;margin-bottom: 8px;width: 130px;height: 20px">
-                                        {{item.name }}
-                                    </div>
-                                    <div style="margin-left:-15px;margin-bottom: 5px;width: 130px;height: 20px">
-                                        {{item.admissDate }}
-                                    </div>
-                                    <div style="margin-left:-15px;margin-bottom: 5px;width: 130px;height: 20px">
-                                        管床医生: {{item.referPhysicianName }}
-                                    </div>
-                                    <div style="margin-left:-15px;width: 130px;height: 20px;display: flex">
-                                       <div style="width: 40%;border: 1px solid black"></div>
-                                       <div v-if="item.responceType=='01'" style="width: 49%;border: 1px solid black;font-weight:bold">{{item.responceTypeName }}</div>
-                                        <div v-else style="width: 49%;border: 1px solid black;font-weight:bold;color: red">{{item.responceTypeName }}</div>
-                                    </div>
-                            </el-card>
-                        </el-space>
+  <el-container>
+    <el-header>
+      <el-select
+        v-if="wardSelectFlag()"
+        filterable
+        v-model="queryParam.wardCode"
+        clearable
+        style="width: 150px"
+        size="small"
+        @change="selectHlType"
+      >
+        <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>
+        </el-option>
+      </el-select>
+      <el-button v-if="wardSelectFlag()" type="primary" @click="queryBedMiInfo"
+        >查询
+      </el-button>
+      <el-button v-if="wardSelectFlag()" type="primary" @click="refBedMiInfo"
+        >重置
+      </el-button>
+      <el-button size="small" type="success" @click="saveBedInfo"
+        >保存
+      </el-button>
+      <el-button type="primary" @click="clearBedInfo">清除床位信息</el-button>
+      <el-button type="primary" @click="addBedInfo">添加床位信息</el-button>
+      <el-button type="primary" @click="openPrebedDialog"
+        >床位预分配确认
+      </el-button>
+      <div
+        style="
+          float: left;
+          width: 300px;
+          height: 20px;
+          border: 1px solid #66b1ff;
+          border-radius: 5px;
+          margin-left: 20px;
+          color: #1294fb;
+          text-align: center;
+          line-height: 20px;
+        "
+      >
+        <span style="font-weight: bold"
+          >{{ headerPatientInfo.bedNo ? headerPatientInfo.bedNo + "床" : "" }}
+        </span>
+        <span>&nbsp;{{ headerPatientInfo.inpatientNo }}</span>
+        <span
+          >&nbsp;&nbsp;{{
+            headerPatientInfo.name
+          }}&nbsp;&nbsp;&nbsp;&nbsp;</span
+        >
+        <span>{{ headerPatientInfo.sexName }}&nbsp;&nbsp;</span>
+        <span>{{ headerPatientInfo.responceTypeName }}</span>
+      </div>
+    </el-header>
+    <el-main>
+      <div style="width: 100%">
+        <el-row :gutter="24">
+          <el-col :span="6">
+            <span style="font-size: 14px; font-weight: bold">床位:</span
+            >&nbsp;&nbsp;<span style="color: red">{{ bedData.bedTotal }}</span>
+          </el-col>
+          <el-col :span="6">
+            <span style="font-size: 14px; font-weight: bold">总人数:</span
+            >&nbsp;&nbsp;<span style="color: red">{{
+              bedData.yzBedTotal
+            }}</span>
+          </el-col>
+          <el-col :span="6">
+            <span style="font-size: 14px; font-weight: bold">医保人数:</span
+            >&nbsp;&nbsp;<span style="color: red">{{ bedData.ybTotal }}</span>
+          </el-col>
+        </el-row>
+      </div>
+      <el-scrollbar :max-height="scrollbarHeight">
+        <div style="width: 100%">
+          <el-space wrap :size="spaceSize">
+            <el-card
+              @click="selectPatientClick(index)"
+              v-for="(item, index) in bedData.data"
+              :key="index"
+              style="
+                padding: 0;
+                width: 150px;
+                height: 150px;
+                border: 1px solid #66b1ff;
+              "
+            >
+              <div
+                v-if="item.sex == '1'"
+                style="
+                  margin-top: -15px;
+                  margin-left: -15px;
+                  border: 1px solid black;
+                  width: 50px;
+                  height: 15px;
+                  font-weight: bold;
+                  background-color: #1294fb;
+                "
+              >
+                {{ item.bedNo }}
+              </div>
+              <div
+                v-else-if="item.sex == '2'"
+                style="
+                  margin-top: -15px;
+                  margin-left: -15px;
+                  border: 1px solid black;
+                  width: 50px;
+                  height: 15px;
+                  font-weight: bold;
+                  background-color: #f56c6c;
+                "
+              >
+                {{ item.bedNo }}
+              </div>
+              <div
+                v-else
+                style="
+                  margin-top: -15px;
+                  margin-left: -15px;
+                  border: 1px solid black;
+                  width: 50px;
+                  height: 15px;
+                  font-weight: bold;
+                "
+              >
+                {{ item.bedNo }}
+              </div>
+              <div style="margin-left: -15px; width: 130px; height: 20px">
+                {{ item.inpatientNo }}
+              </div>
+              <div
+                style="
+                  margin-left: -15px;
+                  margin-top: 5px;
+                  margin-bottom: 8px;
+                  width: 130px;
+                  height: 20px;
+                "
+              >
+                {{ item.name }}
+              </div>
+              <div
+                style="
+                  margin-left: -15px;
+                  margin-bottom: 5px;
+                  width: 130px;
+                  height: 20px;
+                "
+              >
+                {{ item.admissDate }}
+              </div>
+              <div
+                style="
+                  margin-left: -15px;
+                  margin-bottom: 5px;
+                  width: 130px;
+                  height: 20px;
+                "
+              >
+                管床医生: {{ item.referPhysicianName }}
+              </div>
+              <div
+                style="
+                  margin-left: -15px;
+                  width: 130px;
+                  height: 20px;
+                  display: flex;
+                "
+              >
+                <div style="width: 40%; border: 1px solid black"></div>
+                <div
+                  v-if="item.responceType == '01'"
+                  style="width: 49%; border: 1px solid black; font-weight: bold"
+                >
+                  {{ item.responceTypeName }}
                 </div>
-            </el-scrollbar>
-        </el-main>
+                <div
+                  v-else
+                  style="
+                    width: 49%;
+                    border: 1px solid black;
+                    font-weight: bold;
+                    color: red;
+                  "
+                >
+                  {{ item.responceTypeName }}
+                </div>
+              </div>
+            </el-card>
+          </el-space>
+        </div>
+      </el-scrollbar>
+    </el-main>
+  </el-container>
+  <el-dialog
+    v-model="centerDialogVisible"
+    title="床位预分配确认"
+    width="70%"
+    align-center
+  >
+    <div style="width: 100%">
+      <el-input
+        v-model="queryPreBedParam.name"
+        style="width: 110px"
+        placeholder="病人姓名"
+        clearable
+      ></el-input>
+      <el-select
+        v-model="queryPreBedParam.msgStatus"
+        style="width: 110px"
+        @change="queryPreBedInfo"
+      >
+        <el-option value="0" label="待办" />
+        <el-option value="1" label="已办" />
+      </el-select>
+      <el-button type="primary" @click="queryPreBedInfo">查询</el-button>
+    </div>
+    <el-table :data="tableData" stripe height="500">
+      <el-table-column label="病室" prop="wardName"></el-table-column>
+      <el-table-column label="门诊号" prop="patientId"></el-table-column>
+      <el-table-column label="姓名" prop="name"></el-table-column>
+      <el-table-column
+        label="就诊时间"
+        prop="visitDate"
+        min-width="100"
+      ></el-table-column>
+      <el-table-column
+        label="申请时间"
+        prop="reqDate"
+        min-width="100"
+      ></el-table-column>
+      <el-table-column label="状态" prop="preBedStatus">
+        <template #default="scope">
+          {{
+            scope.row.preBedStatus == "1"
+              ? "已确认"
+              : scope.row.preBedStatus == "2"
+                ? "已驳回"
+                : "未确认"
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="确认人" prop="confirmId"></el-table-column>
+      <el-table-column
+        label="确认时间"
+        prop="confirmDate"
+        min-width="100"
+      ></el-table-column>
+      <el-table-column label="床号" prop="bedNo"></el-table-column>
+      <el-table-column
+        label="备注"
+        prop="preBedConfirmRemark"
+      ></el-table-column>
+      <el-table-column v-if="queryPreBedParam.msgStatus == '0'" label="操作">
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            size="small"
+            @click="handlePreBedClick(scope.row)"
+            >确认
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      :current-page="queryPreBedParam.currentPage"
+      :page-size="queryPreBedParam.pageSize"
+      :page-sizes="[10, 20, 30, 40, 50, 100]"
+      :total="queryPreBedParam.total"
+      layout="total, sizes, prev, pager, next, jumper"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    >
+    </el-pagination>
 
-    </el-container>
     <el-dialog
-            v-model="centerDialogVisible"
-            title="床位预分配确认"
-            width="70%"
-            align-center
+      v-model="innerVisible"
+      width="65%"
+      title="确认"
+      append-to-body
+      @closed="clearBedConfirmData"
     >
-        <div style="width: 100%">
-            <el-input v-model="queryPreBedParam.name" style="width: 110px" placeholder="病人姓名" clearable></el-input>
-            <el-select v-model="queryPreBedParam.msgStatus" style="width: 110px" @change="queryPreBedInfo">
-                <el-option value="0" label="待办"/>
-                <el-option value="1" label="已办"/>
-            </el-select>
-            <el-button type="primary" @click="queryPreBedInfo">查询</el-button>
-        </div>
-        <el-table :data="tableData" stripe height="500">
-            <el-table-column label="病室" prop="wardName"></el-table-column>
-            <el-table-column label="门诊号" prop="patientId"></el-table-column>
-            <el-table-column label="姓名" prop="name"></el-table-column>
-            <el-table-column label="就诊时间" prop="visitDate" min-width="100"></el-table-column>
-            <el-table-column label="申请时间" prop="reqDate" min-width="100"></el-table-column>
-            <el-table-column label="状态" prop="preBedStatus">
-                <template  #default="scope">
-                    {{scope.row.preBedStatus=='1' ? '已确认' : scope.row.preBedStatus=='2' ? '已驳回' : '未确认'}}
-                </template>
-            </el-table-column>
-            <el-table-column label="确认人" prop="confirmId"></el-table-column>
-            <el-table-column label="确认时间" prop="confirmDate" min-width="100"></el-table-column>
-            <el-table-column label="床号" prop="bedNo"></el-table-column>
-            <el-table-column label="备注" prop="preBedConfirmRemark"></el-table-column>
-            <el-table-column v-if="queryPreBedParam.msgStatus=='0'" label="操作">
-                <template  #default="scope">
-                    <el-button link type="primary" size="small" @click="handlePreBedClick(scope.row)">确认</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-        <el-pagination
-                :current-page="queryPreBedParam.currentPage"
-                :page-size="queryPreBedParam.pageSize"
-                :page-sizes="[10, 20, 30, 40, 50, 100]"
-                :total="queryPreBedParam.total"
-                layout="total, sizes, prev, pager, next, jumper"
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-        >
-        </el-pagination>
-
-            <el-dialog
-                    v-model="innerVisible"
-                    width="65%"
-                    title="确认"
-                    append-to-body
-                    @closed="clearBedConfirmData"
+      <div style="width: 100%">
+        <el-row :gutter="20">
+          <el-col :span="10">
+            空闲床号:
+            <el-select
+              clearable
+              placeholder="请选择床号"
+              @change="selectBedNo"
+              v-model="bedConfirmData.bedNo"
+              style="width: 100px"
+              size="small"
             >
-            <div style="width: 100%">
-                <el-row :gutter="20">
-                    <el-col :span="10">
-                        空闲床号:
-                        <el-select  clearable placeholder="请选择床号"  @change="selectBedNo"  v-model="bedConfirmData.bedNo" style="width: 100px;" size="small">
-                            <el-option v-for="item in bedNoList" :key="item.code" :label="item.name" :value="item.code">
-                            </el-option>
-                        </el-select>
-                    </el-col>
-                    <el-col :span="10">
-                        <el-radio-group v-model="bedConfirmData.preBedStatus">
-                            <el-radio :label="1">确认</el-radio>
-                            <el-radio :label="2">驳回</el-radio>
-                        </el-radio-group>
-                    </el-col>
-                </el-row>
-                <el-row>
-                    <el-input :rows="2"  type="textarea" v-model="bedConfirmData.preBedConfirmRemark" placeholder="备注" clearable style="width: 98%"></el-input>
-                </el-row>
-            </div>
-                <template #footer>
-                  <span class="dialog-footer">
-                    <el-button type="primary" @click="confirmPreBedClick">确定</el-button>
-                    <el-button type="primary" @click="innerVisible = false">
-                      取消
-                    </el-button>
-                  </span>
-                </template>
-            </el-dialog>
+              <el-option
+                v-for="item in bedNoList"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              >
+              </el-option>
+            </el-select>
+          </el-col>
+          <el-col :span="10">
+            <el-radio-group v-model="bedConfirmData.preBedStatus">
+              <el-radio :label="1">确认</el-radio>
+              <el-radio :label="2">驳回</el-radio>
+            </el-radio-group>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-input
+            :rows="2"
+            type="textarea"
+            v-model="bedConfirmData.preBedConfirmRemark"
+            placeholder="备注"
+            clearable
+            style="width: 98%"
+          ></el-input>
+        </el-row>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button type="primary" @click="confirmPreBedClick">确定</el-button>
+          <el-button type="primary" @click="innerVisible = false">
+            取消
+          </el-button>
+        </span>
+      </template>
     </el-dialog>
+  </el-dialog>
 </template>
 
-<script setup name='AdjustBed'>
-import {onMounted} from "vue";
-import {stringNotBlank,stringIsBlank} from "@/utils/blank-utils";
-import {ElMessage, ElMessageBox} from 'element-plus'
-import {confirmPreBed,queryZyBedPreMsg,getIdleBedNoList,queryZybedMi,clearBed,addBed,saveBed,queryIsPreBed} from "@/api/medical-advice/patient-info";
-import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
-import {clone} from '@/utils/clone'
-import {useUserStore} from "@/pinia/user-store";
-const getRoles = useUserStore().userInfo.roles
-const centerDialogVisible = ref(false)
-const innerVisible = ref(false)
-const openPrebedDialog = ()=>{
-    centerDialogVisible.value = true
-    queryPreBedInfo()
-}
+<script setup name="AdjustBed">
+import { onMounted } from "vue";
+import { stringNotBlank, stringIsBlank } from "@/utils/blank-utils";
+import { ElMessage, ElMessageBox } from "element-plus";
+import {
+  confirmPreBed,
+  queryZyBedPreMsg,
+  getIdleBedNoList,
+  queryZybedMi,
+  clearBed,
+  addBed,
+  saveBed,
+  queryIsPreBed,
+} from "@/api/medical-advice/patient-info";
+import { getAllWards } from "@/api/zhu-yuan-yi-sheng/resident-doctor";
+import { clone } from "@/utils/clone";
+import { useUserStore } from "@/pinia/user-store";
+import { BizException, ExceptionEnum } from "@/utils/BizException";
+
+const getRoles = useUserStore().userInfo.roles;
+const centerDialogVisible = ref(false);
+const innerVisible = ref(false);
+const openPrebedDialog = () => {
+  centerDialogVisible.value = true;
+  queryPreBedInfo();
+};
 //清除床位信息
-const clearBedInfo=()=>{
-    let param = {wardCode:queryParam.value.wardCode,bedNo:selectPatient.value.bedNo}
-    clearBed(param).then((res)=>{
-        refBedMiInfo()
-    })
-}
+const clearBedInfo = () => {
+  let param = {
+    wardCode: queryParam.value.wardCode,
+    bedNo: selectPatient.value.bedNo,
+  };
+  clearBed(param).then(res => {
+    refBedMiInfo();
+  });
+};
 //添加
-const addBedInfo=()=>{
-    let param = {wardCode:queryParam.value.wardCode,bedNo:selectPatient.value.bedNo}
-    addBed(param).then((res)=>{
-        refBedMiInfo()
-    })
-}
+const addBedInfo = () => {
+  let param = {
+    wardCode: queryParam.value.wardCode,
+    bedNo: selectPatient.value.bedNo,
+  };
+  addBed(param).then(res => {
+    refBedMiInfo();
+  });
+};
 
 //保存床位信息
-const saveBedInfo=()=>{
-    ElMessageBox.confirm('确认是否保存', '提示', {
-        type: 'warning',
-    }).then(() => {
-        let params = {
-            param:bedData.value.data,
-            wardCode:queryParam.value.wardCode
-        }
-        saveBed(params).then((res)=>{
-            refBedMiInfo()
-        })
-    })
-
-}
-
+const saveBedInfo = () => {
+  if (stringNotBlank(headerPatientInfo.value.inpatientNo)) {
+    BizException(ExceptionEnum.MESSAGE_ERROR, "有患者没有分配床位无法保存");
+  }
+
+  ElMessageBox.confirm("确认是否保存", "提示", {
+    type: "warning",
+  }).then(() => {
+    let params = {
+      param: bedData.value.data,
+      wardCode: queryParam.value.wardCode,
+    };
+    saveBed(params).then(res => {
+      refBedMiInfo();
+    });
+  });
+};
 
 //点击病人
-const selectPatient = ref({})
+const selectPatient = ref({});
 
 const headerPatientInfo = ref({
-    name: '',
-    bedNo: '',
-    inpatientNo: '',
-    sexName:'',
-    sex:'',
-    responceType: '',
-    admissTimes: null,
-    responceTypeName: '',
-    admissDate: '',
-})
-
-
-const clearPatientInfo =(data,isBedNo)=>{
-    data.name=''
-    data.inpatientNo=''
-    data.sexName=''
-    data.sex=''
-    data.responceType=''
-    data.admissTimes=null
-    data.responceTypeName=''
-    data.admissDate=''
-    data.referPhysicianName=''
-    data.referPhysician=''
-    if(isBedNo){
-        data.bedNo=''
-    }
-}
-
-const setPatientInfo =(targetData,sourceData,isBedNo)=>{
-    targetData.name=sourceData.name
-    targetData.inpatientNo=sourceData.inpatientNo
-    targetData.sexName=sourceData.inpatientNo
-    targetData.sex=sourceData.sex
-    targetData.responceType=sourceData.responceType
-    targetData.admissTimes=sourceData.admissTimes
-    targetData.responceTypeName=sourceData.responceTypeName
-    targetData.admissDate=sourceData.admissDate
-    targetData.referPhysicianName=sourceData.referPhysicianName
-    targetData.referPhysician=sourceData.referPhysician
-    if(isBedNo){
-        targetData.bedNo=sourceData.bedNo
-    }
-}
-
-
-const selectBedNo=(val)=>{
-    if(stringNotBlank(val)){
-        let param = {bedNo:val,wardCode:queryParam.value.wardCode}
-        queryIsPreBed(param).then((res)=>{
-
-        })
-    }
-}
-
-const selectPatientClick=(index)=>{
-    selectPatient.value = clone(bedData.value.data[index])
-    if( stringNotBlank(headerPatientInfo.value.inpatientNo)&& stringNotBlank(bedData.value.data[index].inpatientNo)){
-        //交换
-        setPatientInfo(bedData.value.data[index],headerPatientInfo.value)
-        setPatientInfo(headerPatientInfo.value,selectPatient.value,true)
-    }else if(stringNotBlank(headerPatientInfo.value.inpatientNo) && stringIsBlank(bedData.value.data[index].inpatientNo)){
-        setPatientInfo(bedData.value.data[index],headerPatientInfo.value)
-        clearPatientInfo(headerPatientInfo.value,true)
-    }else if(stringIsBlank(headerPatientInfo.value.inpatientNo) && stringNotBlank(bedData.value.data[index].inpatientNo)){
-        setPatientInfo(headerPatientInfo.value,selectPatient.value,true)
-        clearPatientInfo(bedData.value.data[index])
-    }
-}
+  name: "",
+  bedNo: "",
+  inpatientNo: "",
+  sexName: "",
+  sex: "",
+  responceType: "",
+  admissTimes: null,
+  responceTypeName: "",
+  admissDate: "",
+});
+
+const clearPatientInfo = (data, isBedNo) => {
+  data.name = "";
+  data.inpatientNo = "";
+  data.sexName = "";
+  data.sex = "";
+  data.responceType = "";
+  data.admissTimes = null;
+  data.responceTypeName = "";
+  data.admissDate = "";
+  data.referPhysicianName = "";
+  data.referPhysician = "";
+  if (isBedNo) {
+    data.bedNo = "";
+  }
+};
+
+const setPatientInfo = (targetData, sourceData, isBedNo) => {
+  targetData.name = sourceData.name;
+  targetData.inpatientNo = sourceData.inpatientNo;
+  targetData.sexName = sourceData.inpatientNo;
+  targetData.sex = sourceData.sex;
+  targetData.responceType = sourceData.responceType;
+  targetData.admissTimes = sourceData.admissTimes;
+  targetData.responceTypeName = sourceData.responceTypeName;
+  targetData.admissDate = sourceData.admissDate;
+  targetData.referPhysicianName = sourceData.referPhysicianName;
+  targetData.referPhysician = sourceData.referPhysician;
+  if (isBedNo) {
+    targetData.bedNo = sourceData.bedNo;
+  }
+};
+
+const selectBedNo = val => {
+  if (stringNotBlank(val)) {
+    let param = { bedNo: val, wardCode: queryParam.value.wardCode };
+    queryIsPreBed(param).then(res => {});
+  }
+};
+
+const selectPatientClick = index => {
+  selectPatient.value = clone(bedData.value.data[index]);
+  if (
+    stringNotBlank(headerPatientInfo.value.inpatientNo) &&
+    stringNotBlank(bedData.value.data[index].inpatientNo)
+  ) {
+    //交换
+    setPatientInfo(bedData.value.data[index], headerPatientInfo.value);
+    setPatientInfo(headerPatientInfo.value, selectPatient.value, true);
+  } else if (
+    stringNotBlank(headerPatientInfo.value.inpatientNo) &&
+    stringIsBlank(bedData.value.data[index].inpatientNo)
+  ) {
+    setPatientInfo(bedData.value.data[index], headerPatientInfo.value);
+    clearPatientInfo(headerPatientInfo.value, true);
+  } else if (
+    stringIsBlank(headerPatientInfo.value.inpatientNo) &&
+    stringNotBlank(bedData.value.data[index].inpatientNo)
+  ) {
+    setPatientInfo(headerPatientInfo.value, selectPatient.value, true);
+    clearPatientInfo(bedData.value.data[index]);
+  }
+};
 
 const queryParam = ref({
-    wardCode:'',
-})
-const ward = ref([])
-const wardSelectFlag = ()=>{
-    return getRoles.indexOf(1) > -1
-}
-
-const tableData = ref([])
-const spaceSize = ref(5)
-const scrollbarHeight = ref(0)
-const queryPreBedParam = ref(
-    {
-        name:'',
-        msgStatus:'0',
-        pageSize:40,
-        currentPage:1,
-        total:0,
-    }
-)
-
-
-const queryPreBedInfo=()=>{
-    queryZyBedPreMsg(queryPreBedParam.value).then((res)=>{
-        tableData.value = res.records
-        queryPreBedParam.value.total = res.total
-    })
-}
-
-const bedNoList = ref([])
-const clearBedConfirmData =()=>{
-    bedConfirmData.value.bedNo='';
-    bedConfirmData.value.preBedConfirmRemark='';
-    bedConfirmData.value.preBedStatus=null;
-}
-
-
-const bedData= ref({
-    data:[],
-    bedTotal:0,
-    yzBedTotal:0,
-    ybTotal:0,
-})
+  wardCode: "",
+});
+const ward = ref([]);
+const wardSelectFlag = () => {
+  return getRoles.indexOf(1) > -1;
+};
+
+const tableData = ref([]);
+const spaceSize = ref(5);
+const scrollbarHeight = ref(0);
+const queryPreBedParam = ref({
+  name: "",
+  msgStatus: "0",
+  pageSize: 40,
+  currentPage: 1,
+  total: 0,
+});
+
+const queryPreBedInfo = () => {
+  queryZyBedPreMsg(queryPreBedParam.value).then(res => {
+    tableData.value = res.records;
+    queryPreBedParam.value.total = res.total;
+  });
+};
+
+const bedNoList = ref([]);
+const clearBedConfirmData = () => {
+  bedConfirmData.value.bedNo = "";
+  bedConfirmData.value.preBedConfirmRemark = "";
+  bedConfirmData.value.preBedStatus = null;
+};
+
+const bedData = ref({
+  data: [],
+  bedTotal: 0,
+  yzBedTotal: 0,
+  ybTotal: 0,
+});
 //重置
-const refBedMiInfo=()=>{
-    clearPatientInfo(headerPatientInfo.value,true)
-    queryBedMiInfo()
-}
-
-const queryBedMiInfo=()=>{
-    queryZybedMi(queryParam.value).then((res)=>{
-        bedData.value.data=res.data
-        bedData.value.bedTotal=res.bedTotal
-        bedData.value.yzBedTotal=res.yzBedTotal
-        bedData.value.ybTotal=res.ybTotal
-    })
-}
-
+const refBedMiInfo = () => {
+  clearPatientInfo(headerPatientInfo.value, true);
+  queryBedMiInfo();
+};
+
+const queryBedMiInfo = () => {
+  queryZybedMi(queryParam.value).then(res => {
+    bedData.value.data = res.data;
+    bedData.value.bedTotal = res.bedTotal;
+    bedData.value.yzBedTotal = res.yzBedTotal;
+    bedData.value.ybTotal = res.ybTotal;
+  });
+};
 
 const bedConfirmData = ref({
-    bedNo:'',
-    preBedConfirmRemark:'',
-    preBedStatus:null,
-})
+  bedNo: "",
+  preBedConfirmRemark: "",
+  preBedStatus: null,
+});
 //确认分配床位
-const confirmPreBedClick = ()=>{
-    if(bedConfirmData.value.preBedStatus){
-        if(bedConfirmData.value.preBedStatus ==1 && stringIsBlank(bedConfirmData.value.bedNo)){
-            return  ElMessage.error('选择确认,床号不能为空')
-        }
-        if(bedConfirmData.value.preBedStatus ==2 && stringIsBlank(bedConfirmData.value.preBedConfirmRemark)){
-            return  ElMessage.error('选择驳回,备注不能为空')
-        }
-        if(bedConfirmData.value.preBedStatus ==2 && stringNotBlank(bedConfirmData.value.bedNo)){
-            return  ElMessage.error('选择驳回,不用填床号')
-        }
-
-        let params = selectPreBedRow.value
-        params['bedNo'] = bedConfirmData.value.bedNo
-        params['preBedConfirmRemark'] = bedConfirmData.value.preBedConfirmRemark
-        params['preBedStatus'] = bedConfirmData.value.preBedStatus
-        confirmPreBed(params).then((res)=>{
-            innerVisible.value = false
-            queryPreBedInfo()
-        })
-
-    }else {
-        return  ElMessage.error('请选择[确认]或[驳回]')
+const confirmPreBedClick = () => {
+  if (bedConfirmData.value.preBedStatus) {
+    if (
+      bedConfirmData.value.preBedStatus == 1 &&
+      stringIsBlank(bedConfirmData.value.bedNo)
+    ) {
+      return ElMessage.error("选择确认,床号不能为空");
+    }
+    if (
+      bedConfirmData.value.preBedStatus == 2 &&
+      stringIsBlank(bedConfirmData.value.preBedConfirmRemark)
+    ) {
+      return ElMessage.error("选择驳回,备注不能为空");
+    }
+    if (
+      bedConfirmData.value.preBedStatus == 2 &&
+      stringNotBlank(bedConfirmData.value.bedNo)
+    ) {
+      return ElMessage.error("选择驳回,不用填床号");
     }
 
-
-}
-
-const selectPreBedRow = ref({})
-
-const handlePreBedClick=(row)=>{
-    selectPreBedRow.value = row
-    innerVisible.value = true
-    getIdleBedNoList({ward:row.ward}).then((res)=>{
-        bedNoList.value = res
-        if(res.length === 0){
-            ElMessage.error('没有空闲床位')
-        }
-    })
-
-}
-
-const handleSizeChange = (val) => {
-    queryPreBedParam.value.pageSize = val
-    queryPreBedInfo()
-}
-const handleCurrentChange = (val) => {
-    queryPreBedParam.value.currentPage = val
-    queryPreBedInfo()
-}
+    let params = selectPreBedRow.value;
+    params["bedNo"] = bedConfirmData.value.bedNo;
+    params["preBedConfirmRemark"] = bedConfirmData.value.preBedConfirmRemark;
+    params["preBedStatus"] = bedConfirmData.value.preBedStatus;
+    confirmPreBed(params).then(res => {
+      innerVisible.value = false;
+      queryPreBedInfo();
+    });
+  } else {
+    return ElMessage.error("请选择[确认]或[驳回]");
+  }
+};
+
+const selectPreBedRow = ref({});
+
+const handlePreBedClick = row => {
+  selectPreBedRow.value = row;
+  innerVisible.value = true;
+  getIdleBedNoList({ ward: row.ward }).then(res => {
+    bedNoList.value = res;
+    if (res.length === 0) {
+      ElMessage.error("没有空闲床位");
+    }
+  });
+};
+
+const handleSizeChange = val => {
+  queryPreBedParam.value.pageSize = val;
+  queryPreBedInfo();
+};
+const handleCurrentChange = val => {
+  queryPreBedParam.value.currentPage = val;
+  queryPreBedInfo();
+};
 
 function selectHlType(val) {
-
+  queryBedMiInfo();
 }
 
-onMounted(()=>{
-    scrollbarHeight.value = window.innerHeight-70
-    getAllWards().then((res)=>{
-        ward.value =res
-    })
-
-    if(!wardSelectFlag()){
-        queryBedMiInfo()
-    }
+onMounted(() => {
+  scrollbarHeight.value = window.innerHeight - 70;
+  getAllWards().then(res => {
+    ward.value = res;
+  });
 
-})
+  if (!wardSelectFlag()) {
+    queryBedMiInfo();
+  }
+});
 </script>
 
 <style scoped>
-.el-row{
-    margin-bottom: 5px;
-}
-.el-col{
-    margin-left: 10px;
+.el-row {
+  margin-bottom: 5px;
 }
 
-
-</style>
+.el-col {
+  margin-left: 10px;
+}
+</style>