Browse Source

优化填写生命体征功能

lighter 7 months ago
parent
commit
c9687a4b58

+ 2 - 2
src/api/triage/triage.js

@@ -31,11 +31,11 @@ export function confirmFuZhen(serialNo) {
   })
 }
 
-export function fetchVitalSign(patientId) {
+export function fetchVitalSign(patientId, times) {
   return request({
     url: '/triage/getMzVitalSigns',
     method: 'get',
-    params: { patientId },
+    params: { patientId, times },
   })
 }
 

+ 17 - 4
src/views/clinic/triage/Treated.vue

@@ -21,8 +21,9 @@
             {{ statusFlagFilter(scope.row.statusFlag) }}
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="操作">
+        <el-table-column fixed="right" label="操作" width="200">
           <template #default="scope">
+            <el-button type="primary" @click="showMzVitals(scope.row)">生命体征</el-button>
             <el-button type="primary" @click="getDepts(scope.row)">复诊</el-button>
           </template>
         </el-table-column>
@@ -38,6 +39,7 @@
       ></el-pagination>
     </div>
   </div>
+  <VitalSign ref="vitalRef" :times="times" :patient-id="patientId" />
   <el-dialog v-model="showTriageDialog" title="选择诊室" width="50%">
     <div style="background-color: lightblue; padding: 4px 8px; margin-top: -16px; border-radius: 4px; color: red">
       <div class="dialog-head">
@@ -83,6 +85,7 @@ import { watch } from 'vue'
 import { fenZhen, getTreatedPatients, getChosenDept, getRooms } from '@/api/triage/triage'
 import { onActivated } from 'vue'
 import { ElMessage } from 'element-plus'
+import VitalSign from "@/views/clinic/triage/components/VitalSign.vue";
 
 const patients = ref([])
 const searchContent = ref('')
@@ -169,6 +172,19 @@ onActivated(() => {
   fetchTreatedPatients()
 })
 
+
+const vitalRef = ref()
+const patientId = ref('')
+const times = ref(0)
+const showMzVitals = (row) => {
+  patientId.value = row.patientId
+  times.value = row.times
+  vitalRef.value.switchVisibility()
+}
+
+
+
+
 function statusFlagFilter(val) {
   switch (val) {
     case '0':
@@ -185,9 +201,6 @@ function statusFlagFilter(val) {
       return '就诊'
   }
 }
-function roomStatusFilter(val) {
-  return val === 0 ? '在线' : '离线'
-}
 </script>
 
 <style scoped>

+ 25 - 15
src/views/clinic/triage/Triaged.vue

@@ -15,8 +15,9 @@
           {{ statusFlagFilter(scope.row.statusFlag) }}
         </template>
       </el-table-column>
-      <el-table-column fixed="right" label="操作">
+      <el-table-column fixed="right" label="操作" width="200">
         <template #default="scope">
+          <el-button type="primary" @click="showMzVitals(scope.row)">生命体征</el-button>
           <el-button type="primary" @click="beforeCancelTriage(scope.row)">取消分诊</el-button>
         </template>
       </el-table-column>
@@ -30,6 +31,7 @@
         layout="total, sizes, prev, pager, next, jumper"
         :total="patients.length"
     ></el-pagination>
+    <VitalSign ref="vitalRef" :times="times" :patient-id="patientId" />
   </div>
 </template>
 
@@ -38,6 +40,7 @@ import { ref } from 'vue'
 import { cancelTriage, getTriagedPatients } from '@/api/triage/triage'
 import { onActivated } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
+import VitalSign from "@/views/clinic/triage/components/VitalSign.vue";
 
 const patients = ref([])
 
@@ -61,24 +64,33 @@ const beforeCancelTriage = (row) => {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
     type: 'warning',
-  })
-      .then(() => {
-        cancelTriage(row.serialNo).then(() => {
-          ElMessage({
-            message: '操作成功',
-            type: 'success',
-            duration: 2000,
-            showClose: true,
-          })
-        })
+  }).then(() => {
+    cancelTriage(row.serialNo).then(() => {
+      ElMessage({
+        message: '操作成功',
+        type: 'success',
+        duration: 2000,
+        showClose: true,
       })
-      .catch(() => {})
+    })
+  }).catch(() => {})
 }
 
 onActivated(() => {
   fetchTriagedPatients()
 })
 
+
+const vitalRef = ref()
+const patientId = ref('')
+const times = ref(0)
+const showMzVitals = (row) => {
+  patientId.value = row.patientId
+  times.value = row.times
+  vitalRef.value.switchVisibility()
+}
+
+
 function statusFlagFilter(val) {
   switch (val) {
     case '0':
@@ -97,7 +109,5 @@ function statusFlagFilter(val) {
       return '已就诊'
   }
 }
-function roomStatusFilter(val) {
-  return val === 0 ? '在线' : '离线'
-}
+
 </script>

+ 11 - 97
src/views/clinic/triage/Untriaged.vue

@@ -24,7 +24,7 @@
         <el-table-column fixed="right" label="操作" width="250">
           <template #default="scope">
             <el-button type="warning" @click="getDepts(scope.row, 1)">复诊</el-button>
-            <el-button type="primary" @click="getMzVitalSigns(scope.row)">生命体征</el-button>
+            <el-button type="primary" @click="showMzVitals(scope.row)">生命体征</el-button>
             <el-button type="success" @click="getDepts(scope.row, 0)">分诊</el-button>
           </template>
         </el-table-column>
@@ -45,65 +45,7 @@
     <a href="http://webhis.thyy.cn:8080/download/候诊信息-Setup.exe">下载候诊展示软件</a>
   </div>
 
-  <el-drawer title="生命体征录入" v-model="showVital" :with-header="false" direction="ltr" size="30%">
-    <div style="height: 15px"></div>
-    <h3 style="margin-left: 15px; font-size: 16px">生命体征录入</h3>
-    <div class="vital-sign-box">
-      <div>
-        <el-input size="small" readonly v-model="vitalSigns.patientId">
-          <template #prepend>患者ID</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" readonly v-model="vitalSigns.visitDate">
-          <template #prepend>录入日期</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueSg">
-          <template #prepend>身高 (cm)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueTz">
-          <template #prepend>体重 (kg)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueTw">
-          <template #prepend>体温 (℃)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueMb">
-          <template #prepend>脉搏 (次/分)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueHx">
-          <template #prepend>呼吸 (次/分)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueSsy">
-          <template #prepend>血压上限 (mmHg)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" type="number" v-model="vitalSigns.valueSzy">
-          <template #prepend>血压下限 (mmHg)</template>
-        </el-input>
-      </div>
-      <div>
-        <el-input size="small" text v-model="vitalSigns.visitRemark">
-          <template #prepend>备注</template>
-        </el-input>
-      </div>
-    </div>
-    <el-button type="primary" size="small" :loading="drawSaving" @click="saveVitals"
-               style="width: 200px; margin-left: 120px; margin-top: 20px"> 保存
-    </el-button>
-  </el-drawer>
+  <VitalSign ref="vitalRef" :times="times" :patient-id="patientId" />
 
   <el-dialog v-model="showTriageDialog" :title="triageDialogTitle" width="50%">
     <div style="background-color: lightblue; padding: 4px 8px; margin-top: -16px; border-radius: 4px; color: red">
@@ -169,21 +111,20 @@ import {ref} from 'vue'
 import {
   fenZhen,
   getPatientIdByIdNo,
-  fetchVitalSign,
   getChosenDept,
   getRooms,
   getUnTriagedPatient,
   saveNewCard,
   queryCardInfo,
-  saveMzVitalSigns, refreshBigScreenData
+  refreshBigScreenData
 } from '@/api/triage/triage'
 import {ElMessage, ElMessageBox} from 'element-plus'
 import ReadElectronicSiCard from '@/components/medical-insurance/read-electronic-si-card/index.vue'
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import VitalSign from "@/views/clinic/triage/components/VitalSign.vue";
 
 const patients = ref([])
 const totalSize = ref(0)
-const showVital = ref(false)
 
 const pageSize = ref(30)
 const currentPage = ref(1)
@@ -245,11 +186,13 @@ const findSiCardReader = (patId) => {
   return target
 }
 
-const getMzVitalSigns = (row) => {
-  fetchVitalSign(row.patientId).then((res) => {
-    vitalSigns.value = res
-    showVital.value = true
-  })
+const vitalRef = ref()
+const patientId = ref('')
+const times = ref(0)
+const showMzVitals = (row) => {
+  patientId.value = row.patientId
+  times.value = row.times
+  vitalRef.value.switchVisibility()
 }
 const chosenDeptsTable = ref(null)
 const roomTable = ref(null)
@@ -302,23 +245,6 @@ const executeTriage = (row) => {
   })
 }
 
-const vitalSigns = ref({})
-const drawSaving = ref(false)
-const saveVitals = () => {
-  drawSaving.value = true
-  saveMzVitalSigns(vitalSigns.value).then((res) => {
-    ElMessage({
-      message: res,
-      type: 'success',
-      duration: 2000,
-      showClose: true,
-    })
-    drawSaving.value = false
-  }).catch(() => {
-    drawSaving.value = false
-  })
-}
-
 const showTriageDialog = ref(false)
 
 const fetchInteval = ref(null)
@@ -386,21 +312,9 @@ function statusFlagFilter(val) {
   }
 }
 
-function roomStatusFilter(val) {
-  return val === 0 ? '在线' : '离线'
-}
 </script>
 
 <style scoped>
-.vital-sign-box {
-  padding: 0 20px;
-  margin-top: 15px;
-}
-
-.vital-sign-box > div {
-  margin-top: 15px;
-}
-
 .dialog-head {
   display: flex;
   height: 26px;

+ 139 - 0
src/views/clinic/triage/components/VitalSign.vue

@@ -0,0 +1,139 @@
+<template>
+  <el-drawer title="生命体征录入" v-model="visible" :with-header="false" direction="ltr" size="30%">
+    <div style="height: 15px"></div>
+    <h3 style="margin-left: 15px; font-size: 16px">生命体征录入</h3>
+    <div class="vital-sign-box">
+      <div>
+        <el-input size="small" readonly v-model="vitalSigns.patientId">
+          <template #prepend>患者ID</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" readonly v-model="vitalSigns.visitDate">
+          <template #prepend>录入日期</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueSg">
+          <template #prepend>身高 (cm)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueTz">
+          <template #prepend>体重 (kg)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueTw">
+          <template #prepend>体温 (℃)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueMb">
+          <template #prepend>脉搏 (次/分)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueHx">
+          <template #prepend>呼吸 (次/分)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueSsy">
+          <template #prepend>血压上限 (mmHg)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" type="number" v-model="vitalSigns.valueSzy">
+          <template #prepend>血压下限 (mmHg)</template>
+        </el-input>
+      </div>
+      <div>
+        <el-input size="small" text v-model="vitalSigns.visitRemark">
+          <template #prepend>备注</template>
+        </el-input>
+      </div>
+    </div>
+    <el-button
+        type="primary"
+        size="small"
+        :loading="drawSaving"
+        @click="saveVitals"
+        style="width: 200px; margin-left: 120px; margin-top: 20px"
+    >
+      保存
+    </el-button>
+  </el-drawer>
+</template>
+
+<script setup>
+import {fetchVitalSign, saveMzVitalSigns} from "@/api/triage/triage.js";
+import {ElMessage} from "element-plus";
+
+const props = defineProps({
+  patientId: {
+    type: String,
+    required: true,
+  },
+  times: {
+    type: Number,
+    required: true,
+  }
+})
+
+const visible = ref(false)
+const vitalSigns = ref({})
+const drawSaving = ref(false)
+
+function getVitalSignData() {
+  if (visible.value) {
+    fetchVitalSign(props.patientId, props.times).then((res) => {
+      vitalSigns.value = res
+    })
+  }
+}
+
+function saveVitals() {
+  drawSaving.value = true
+  saveMzVitalSigns(vitalSigns.value).then((res) => {
+    ElMessage({
+      message: res,
+      type: 'success',
+      duration: 2000,
+      showClose: true,
+    })
+    drawSaving.value = false
+    visible.value = false
+  }).catch(() => {
+    drawSaving.value = false
+  })
+}
+
+function switchVisibility() {
+  visible.value = !visible.value
+}
+
+onUpdated(() => {
+  getVitalSignData()
+})
+
+defineExpose({switchVisibility})
+
+</script>
+
+<style scoped>
+.vital-sign-box {
+  padding: 0 20px;
+  margin-top: 15px;
+}
+
+.vital-sign-box > div {
+  margin-top: 15px;
+}
+
+.dialog-head {
+  display: flex;
+  height: 26px;
+  line-height: 26px;
+}
+</style>