Browse Source

优化手术

xiaochan 2 years ago
parent
commit
a5550455e5

+ 18 - 9
src/components/xiao-chan/combo-grid/XcComboGridV2.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
-import {computed, defineProps, nextTick, onMounted, ref, watch} from "vue";
+import {computed, defineProps, onMounted, ref, watch} from "vue";
 import XEUtils from 'xe-utils'
-import {onClickOutside} from '@vueuse/core'
+import {PulldownMethods} from "vxe-table/types/pulldown";
 
 
 const props = defineProps({
@@ -44,7 +44,7 @@ const props = defineProps({
   },
   keyName: {
     type: Array<string>,
-    default: ['code', 'name', 'pyCode', 'wCode']
+    default: ['code', 'name', 'pyCode', 'wCode', 'dCode']
   }
 });
 
@@ -52,7 +52,7 @@ const emits = defineEmits(['input', 'rowClick', 'clear', 'focus', 'blur', 'updat
 
 const isObj = typeof props.modelValue === 'object'
 const tempData = ref([])
-const pulldownRef = ref()
+const pulldownRef = ref<PulldownMethods>()
 const inputData = ref('')
 const placeholder = ref(props.placeholder)
 const vxeTableRef = ref()
@@ -70,7 +70,7 @@ const computedData = computed(() => {
     if (XEUtils.isEmpty(inputData.value)) {
       return props.data
     } else {
-      XEUtils.filter(props.data, (item) => {
+      return XEUtils.filter(props.data, (item) => {
         return notNullAndLike(item, props.keyName, inputData.value)
       });
     }
@@ -79,10 +79,17 @@ const computedData = computed(() => {
   }
 })
 
+const isEnglish = (str) => {
+  return /^[a-zA-Z]+$/.test(str);
+}
+
 const notNullAndLike = (data: any, keyName: Array<string>, likeValue: string) => {
   for (let i = 0; i < keyName.length; i++) {
     let itemKey = keyName[i];
     let tempVal = data[itemKey]
+    if (isEnglish(likeValue)) {
+      likeValue = likeValue.toUpperCase();
+    }
     if (tempVal) {
       try {
         // 去除前后空格
@@ -91,15 +98,16 @@ const notNullAndLike = (data: any, keyName: Array<string>, likeValue: string) =>
           return true
         }
       } catch {
-        return false
       }
     }
   }
+  return false
 }
 
 const change = XEUtils.debounce(async (value) => {
   if (props.disabled) return
   emits('input', value)
+  await pulldownRef.value.showPanel()
   if (XEUtils.isEmpty(value)) return
   if (props.filterable) {
     return
@@ -193,6 +201,7 @@ const keyDown = () => {
 }
 
 const enterToSelect = () => {
+  if (currentIndex.value === -1) return
   if (pulldownRef.value.isPanelVisible()) {
     let temp = vxeTableRef.value.getCurrentRecord()
     if (!temp) {
@@ -257,7 +266,7 @@ onMounted(async () => {
                 @clear="handleClear"
                 :disabled="props.disabled"
                 ref="inputRef"
-                style="width: 120px;"
+                style="width: 172px;"
                 @keydown.up.prevent="keyUp"
                 @keydown.down.prevent="keyDown"
                 @keydown.enter.prevent="enterToSelect"
@@ -284,8 +293,8 @@ onMounted(async () => {
           show-overflow
           :data="computedData">
         <vxe-column v-for="item in tableHeader"
-                    :title="item.title"
-                    :field="item.field"
+                    :title="item.title ? item.title : item.label "
+                    :field="item.field ? item.field : item.prop"
                     :width="item.width"/>
         <slot/>
       </vxe-table>

+ 1 - 1
src/components/xiao-chan/select-v3/XcTableColumn.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>asdasd</div>
+  <div></div>
 </template>
 
 <script setup name='XcTableColumn'>

+ 65 - 102
src/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/BianJiShouShu.vue

@@ -3,14 +3,13 @@
     <el-row>
       <el-col :span="12">
         <el-form-item label="手术" prop="opCode">
-          <xc-combo-grid v-model="props.data"
-                         code="opCode"
-                         @row-click="clickToSelectSurgery"
-                         :table-header="tableHeader"
-                         name="opName"
-                         :query-data-func="queryOperation">
-            <el-table-column prop="opScale" label="手术等级"/>
-          </xc-combo-grid>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="opCode"
+                            @row-click="clickToSelectSurgery"
+                            :table-header="tableHeader"
+                            name="opName"
+                            :query-data-func="queryOperation">
+          </xc-combo-grid-v2>
         </el-form-item>
       </el-col>
       <el-col :span="12">
@@ -56,11 +55,12 @@
       </el-col>
       <el-col :span="12">
         <el-form-item label="术前诊断" prop="diagBeforeCode">
-          <xc-select-v3 v-model="props.data"
-                        :data="shouShuZhenDuan"
-                        code="diagBeforeCode"
-                        name="diagBeforeOp"
-                        :remote-method="souSuoZhenDuan"/>
+          <xc-combo-grid-v2
+              v-model="props.data"
+              code="diagBeforeCode"
+              name="diagBeforeOp"
+              :query-data-func="diagnosisInOurHospital"
+          />
         </el-form-item>
       </el-col>
       <el-col :span="12">
@@ -78,10 +78,9 @@
       </el-col>
       <el-col :span="12">
         <el-form-item label="手术部位" prop="partCode">
-          <xc-select-v3 v-model="props.data"
-                        code="partCode" name="partCodeName"
-                        :data="shouShuBuWeiShuJu"
-                        :remote-method="souSuoBuWei" clearable/>
+          <xc-combo-grid-v2 v-model="props.data" code="partCode" name="partCodeName"
+                            :data="props.surgicalSiteList"
+                            filterable/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
@@ -104,89 +103,66 @@
       </el-col>
       <el-col :span="12">
         <el-form-item label="主刀医生" prop="doctorZd">
-          <xc-select-v3 v-model="props.data"
-                        code="doctorZd"
-                        name="doctorZdName"
-                        :remote-method="suoSouYiShen"
-                        clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="doctorZd"
+                            name="doctorZdName"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="第一助手">
-          <xc-select-v3 v-model="props.data" code="doctor1" name="doctor1Name"
-                        :remote-method="suoSouYiShen" clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="doctor1" name="doctor1Name"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="第二助手">
-          <xc-select-v3 v-model="data" code="doctor2" name="doctor2Name"
-                        :remote-method="suoSouYiShen" clearable
-                        :props.data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="doctor2" name="doctor2Name"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="第三助手">
-          <xc-select-v3 v-model="props.data" code="doctor3" name="doctor3Name"
-                        :remote-method="suoSouYiShen" clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="doctor3" name="doctor3Name"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="麻醉医生">
-          <xc-select-v3 v-model="props.data" code="doctorMz" name="doctorMzName"
-                        :remote-method="suoSouYiShen" clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="doctorMz" name="doctorMzName"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="器械护士">
-          <xc-select-v3 v-model="props.data" code="nurseQx" name="nurseQxName"
-                        :remote-method="suoSouYiShen" clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="nurseQx" name="nurseQxName"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="巡回护士">
-          <xc-select-v3 v-model="props.data" code="nurseXh" name="nurseXhName"
-                        :remote-method="suoSouYiShen" clearable
-                        :data="yiShengShuJu">
-            <xc-table-column label="编码" prop="code"/>
-            <xc-table-column label="姓名" prop="name"/>
-            <xc-table-column label="科室" prop="deptName"/>
-            <xc-table-column label="级别" prop="empTitName"/>
-          </xc-select-v3>
+          <xc-combo-grid-v2 v-model="props.data"
+                            code="nurseXh" name="nurseXhName"
+                            filterable
+                            :table-header="personnel"
+                            :data="props.personnelList"/>
         </el-form-item>
       </el-col>
       <el-col :span="24">
@@ -224,19 +200,23 @@ import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
 import XEUtils from 'xe-utils'
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import {isDev} from "@/utils/public";
+import XcComboGridV2 from "@/components/xiao-chan/combo-grid/XcComboGridV2.vue";
 
 const props = defineProps({
   anestheticMode: {
     type: Array,
   },
   data: Object,
-  index: Number
+  index: Number,
+  personnelList: Array,
+  surgicalSiteList: Array,
 })
 
 const tableHeader = [
   {label: '编码', prop: 'code', width: 120},
-  {label: '名称', prop: 'name', width: 240},
-  {label: '类型', prop: 'opTypeName', width: 140},
+  {label: '名称', prop: 'name', width: 200},
+  {label: '类型', prop: 'opTypeName', width: 100},
+  {label: '等级', prop: 'opScale', width: 40},
 ]
 
 const emit = defineEmits(['qu-xiao'])
@@ -266,11 +246,8 @@ const clickToSelectSurgery = async (val) => {
 
 const disabledOpScale = ref(false)
 
-
 // 手术部位
 const shouShuBuWeiShuJu = ref([])
-// 手术诊断
-const shouShuZhenDuan = ref([])
 
 // 医生信息
 const yiShengShuJu = ref([])
@@ -282,27 +259,13 @@ const souSuoBuWei = (val) => {
   })
 }
 
-// 搜索诊断
-const souSuoZhenDuan = (val) => {
-  diagnosisInOurHospital(val).then(res => {
-    shouShuZhenDuan.value = res
-  })
-}
-
-
-// 搜索医生
-const suoSouYiShen = (val) => {
-
-  if (designateASurgeonInChief.value.length > 0) {
-    return
-  }
-
-  getRenYuan(val).then(res => {
-    yiShengShuJu.value = res
-  });
-
-}
 
+const personnel = [
+  {label: '编码', prop: 'code', width: 46},
+  {label: '名称', prop: 'name', width: 56},
+  {label: '科室', prop: 'deptName', width: 92},
+  {label: '级别', prop: 'empTitName', width: 105},
+]
 
 const shouShuBiaoGe = ref()
 

+ 9 - 0
src/utils/public.js

@@ -103,3 +103,12 @@ export const copyStrFunc = (val) => {
     document.body.removeChild(input);
     xcMessage.success("复制成功。")
 }
+
+// 判断字符串是否包含中文
+export const isChinese = (str) => {
+    return /[\u4e00-\u9fa5]/.test(str);
+}
+// 判断字符串是否为纯英文
+export const isEnglish = (str) => {
+    return /^[a-zA-Z]+$/.test(str);
+}

+ 19 - 4
src/views/hospitalization/zhu-yuan-yi-sheng/shou-shu-shen-qing/ShouShuShenQing.vue

@@ -52,6 +52,8 @@
                      :label="tabsName(item.opName,index)"
                      :name="index + 1">
           <bian-ji-shou-shu
+              :surgicalSiteList="surgicalSiteList"
+              :personnelList="personnelList"
               :anesthetic-mode="anestheticMode"
               :data="item"
               :item="index"/>
@@ -71,7 +73,7 @@
 <script setup>
 import {computed, ref, watch} from 'vue'
 import {
-  huoQuShouShu,
+  huoQuShouShu, huoQuShouShuBuWei,
   huoQuShouShuShenQingDaYing, preoperativeDiscussion,
   shanChuShouShu,
   xinZengShouShuShenQing
@@ -87,7 +89,7 @@ import DaYingShouShuShengQingDan from '@/components/zhu-yuan-yi-sheng/shou-shu-s
 import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
 import {ElMessageBox} from 'element-plus'
 import BianJiShouShu from "@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/BianJiShouShu";
-import {getServerDateApi, maZuiFangShi} from "@/api/public-api";
+import {getRenYuan, getServerDateApi, maZuiFangShi} from "@/api/public-api";
 import SurgicalErrorInfo from "@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/SurgicalErrorInfo";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import {getWindowSize} from "@/utils/window-size";
@@ -210,7 +212,6 @@ const removeTab = (targetName) => {
 const dianJiChaKanShouShu = (row) => {
   huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
     daYing.value.data = res
-    console.log(res)
     if (stringNotBlank(res.applyDate)) {
       res.applyDate = res.applyDate.split(' ')[0]
     }
@@ -267,7 +268,11 @@ const dianJiXinZhenShouShu = async () => {
 }
 
 // 麻醉方式
-const anestheticMode = ref()
+const anestheticMode = ref([])
+// 人员
+const personnelList = ref([])
+// 手术部位
+const surgicalSiteList = ref([])
 
 onMounted(() => {
   maZuiFangShi().then(res => {
@@ -276,6 +281,16 @@ onMounted(() => {
   if (isDev) {
     dianJiXinZhenShouShu()
   }
+  getRenYuan('').then(res => {
+    personnelList.value = res
+  })
+
+  huoQuShouShuBuWei('').then(res => {
+    surgicalSiteList.value = res
+    console.log(res)
+  })
+
+
 })
 
 </script>

+ 2 - 2
src/views/settings/Test.vue

@@ -8,7 +8,7 @@
       :data="data"/>
 </template>
 
-<script setup lang="ts">
+<script setup>
 import XcComboGridV2 from "../../components/xiao-chan/combo-grid/XcComboGridV2.vue";
 import {obtainSurgicalItems} from "../../api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
 
@@ -20,7 +20,7 @@ const obj = ref({
   namead: ''
 })
 
-const data = ref<any[]>([])
+const data = ref ([])
 
 const queryOperation = (val) => {
   return obtainSurgicalItems(val, 0)