瀏覽代碼

优化住院医生

DESKTOP-MINPJAU\Administrator 3 年之前
父節點
當前提交
57c4b5628b

+ 19 - 3
src/components/zhu-yuan-yi-sheng/hui-zhen-shen-qing/TianJiaHuiZhenShenQing.vue

@@ -1,5 +1,6 @@
 <template>
   <el-dialog v-model="huiZhenShenQingDialog" title="会诊申请" @close="guanBi">
+    <xc-code code="ctrl+s" description="保存"/>
     <el-form ref="huiZhenShenQingForm" :model="huiZhenShenQing" :rules="huiZhenShenQingRules" label-width="100px">
       <el-form-item label="会诊科室:" prop="reqDept1">
         <el-select
@@ -96,18 +97,23 @@
                       :times="huanZheXinXi.admissTimes"
                       :zhen-duan-lei-xing="huanZheZhenDuan.zhenDuanLeiXing"
                       @close="huanZheZhenDuan.dialog = false"
-                      @zhenDuanMing="dianJiTianJiaZhuYaoZhenDuan"></huan-zhe-zhen-duan>
+                      @zhenDuanMing="dianJiTianJiaZhuYaoZhenDuan"/>
 </template>
 
 <script>
 import {cptSex} from "@/utils/computed";
-import {computed, onMounted, ref, unref} from "vue";
-import {gethuiZhenLeiBie, huiZhenYiSheng, queryDept, submitHuiZhenShenQing} from "@/api/case-front-sheet";
+import {
+  gethuiZhenLeiBie,
+  huiZhenYiSheng,
+  queryDept,
+  submitHuiZhenShenQing
+} from "@/api/case-front-sheet";
 import {ElMessage, ElMessageBox} from "element-plus";
 import {huanZheXinXi, youWuXuanZheHuanZhe} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import store from "@/store"
 import {getServerDateApi} from "@/api/public-api";
 import HuanZheZhenDuan from "@/components/zhu-yuan-yi-sheng/hui-zhen-shen-qing/HuanZheZhenDuan.vue";
+import {logoutShortcut, xcHotKey} from "@/utils/xckeydown";
 
 export default {
   name: "TianJiaHuiZhenShenQing",
@@ -253,7 +259,12 @@ export default {
       ctx.emit('close')
     }
 
+    const hotKey = {
+      ctrl: {'s': huiZhenShenQingClick}
+    }
+
     onMounted(() => {
+      xcHotKey(hotKey)
       huiZhenShenQing.value.name = userInfo.name
       getServerDateApi().then((res) => {
         huiZhenShenQing.value.inputDate = res
@@ -263,6 +274,11 @@ export default {
       })
     })
 
+    onUnmounted(() => {
+      logoutShortcut()
+    })
+
+
     return {
       cptSex,
       huiZhenShenQing,

+ 8 - 2
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/SouSuoYiZhu.vue

@@ -1,8 +1,9 @@
 <template>
   <el-dialog v-model="dialog" title="搜索医嘱" width="95%" @close="emit('close')">
     <el-input ref="searchInput" v-model="orderName" autofocus clearable
-              style="width: 220px" @keyup.enter="dianJiChaXunYiZhu" @blur="searchInput.focus()"></el-input>
+              style="width: 220px" @keyup.enter="dianJiChaXunYiZhu"></el-input>
     <el-button icon="el-icon-search" type="primary" @click="dianJiChaXunYiZhu">搜索</el-button>
+    <xc-code code="ctrl+1" description="重新获取焦点"/>
     <xc-code code="Alt+↓/↑" description="上下选择"></xc-code>
     <xc-code code="Alt+←/→" description="左右翻页"></xc-code>
     <xc-code code="Alt+Enter" description="选中"></xc-code>
@@ -162,8 +163,13 @@ const viewDrugUsage = () => {
   }
 }
 
+const regainFocus = () => {
+  searchInput.focus()
+}
+
 let registerShortcuts = {
-  alt: {'direction': direction, 'Enter': enter, 'q': viewDrugUsage}
+  alt: {'direction': direction, 'Enter': enter, 'q': viewDrugUsage},
+  ctrl: {'1': regainFocus}
 }
 
 const hotKey = () => {

+ 12 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

@@ -229,6 +229,7 @@
   <el-button icon="el-icon-plus" type="primary" @click="tianJiaYiZhu">添加</el-button>
   <xc-code code="Ctrl+S" description="键盘添加"></xc-code>
   <xc-code code="Ctrl+f" description="打开搜索框"></xc-code>
+  <xc-code code="Ctrl+1" description="回到第一个输入框"></xc-code>
   <el-button @click="dianJiXiuGaiZhiXingKeShi">修改执行科室</el-button>
   <el-table :data="yiZhuList" :height="windowSize.h / 2.4" @selection-change="dianJiXuanZhongShuJu">
     <el-table-column type="selection"></el-table-column>
@@ -489,7 +490,12 @@ const xuanZhongFeiYong = async (row) => {
   if (stringIsBlank(row.id)) {
     yiZhuData.value.id = uuid(8, 10)
   }
-  pingLv.focus()
+  try {
+    pingLv.focus()
+  } catch (e) {
+    console.log(e)
+  }
+
 }
 
 const closeTheDoctorSOrderSearchBox = () => {
@@ -889,8 +895,12 @@ const openSearchBox = () => {
   yiZhuMingDialog = true
 }
 
+const regainFocus = () => {
+  pingLv.focus()
+}
+
 let shortcutKeyRegistration = {
-  ctrl: {'s': saveOrAddADoctorSOrder, 'f': openSearchBox}
+  ctrl: {'s': saveOrAddADoctorSOrder, 'f': openSearchBox, '1': regainFocus}
 }
 
 onMounted(() => {