Browse Source

1.进电子病历显示弹窗100%是因为页面/系统需要设置成100%,打印才会不出错,页面和系统同时是100%就不会弹出: 换成点击打印时提示
2.需要整改的病历已整改不进入到审核界面:如审核全部处理,不再弹出。
3.确认医嘱加快捷键:alt + q
4.检验检查明细里面有价格,但你想有总价格的话,可以做但是系统每次请求的时候会卡个5-10秒,我的建议是不加(要加也可以)

xiaochan 2 years ago
parent
commit
fb37bedb25

+ 111 - 27
src/components/xiao-chan/combo-grid/XcComboGridV2.vue

@@ -1,8 +1,9 @@
 <script setup lang="ts">
-import {computed, defineProps, onMounted, ref, watch} from "vue";
+import {computed, defineProps, nextTick, onMounted, ref, watch} from "vue";
 import XEUtils from 'xe-utils'
 import {PulldownMethods} from "vxe-table/types/pulldown";
-
+import {useVModel} from "@vueuse/core";
+import {VxeTableInstance} from "vxe-table";
 
 const props = defineProps({
   modelValue: {
@@ -12,9 +13,12 @@ const props = defineProps({
     type: Function,
     default: null
   },
+  select: {
+    type: Boolean,
+    default: false
+  },
   data: {
     type: Array,
-    twoWayBinding: true,
     default: null
   },
   filterable: {
@@ -23,6 +27,8 @@ const props = defineProps({
   },
   code: String,
   name: String,
+  // 绑定对象的 code 自动在拼接name在字段的后面
+  codeName: String,
   clearable: {
     type: Boolean,
     default: false
@@ -48,14 +54,31 @@ const props = defineProps({
   }
 });
 
-const emits = defineEmits(['input', 'rowClick', 'clear', 'focus', 'blur', 'update:modelValue', 'update:data'])
+const emits = defineEmits([
+  'input',
+  'rowClick',
+  'clear',
+  'focus',
+  'blur',
+  'update:modelValue',
+  'update:data'
+])
+
+// 数据绑定的 modelValue
+const modVal = useVModel(props, 'modelValue', emits)
+const modData = useVModel(props, 'data', emits)
+
+let modCode = ''
+let modName = ''
+
+let selectName = ''
 
 const isObj = typeof props.modelValue === 'object'
 const tempData = ref([])
 const pulldownRef = ref<PulldownMethods>()
 const inputData = ref('')
 const placeholder = ref(props.placeholder)
-const vxeTableRef = ref()
+const vxeTableRef = ref<VxeTableInstance>()
 const theRowIsCurrentlySelected = ref({
   row: {},
   index: -1
@@ -114,27 +137,39 @@ const change = XEUtils.debounce(async (value) => {
   }
   if (props.queryDataFunc === null) return
   try {
-    let res = await props.queryDataFunc(value)
+    let res = await props.queryDataFunc(value) as Array<any>
     if (typeof res === 'undefined') {
       return
     }
     if (props.data === null) {
       tempData.value = res
+    } else {
+      modData.value = res
+      await nextTick()
+      if (res.length !== modData.value.length) {
+        console.error('请使用 v-model:data 绑定data')
+      }
     }
   } catch {
   }
-  pulldownRef.value.showPanel()
+  await pulldownRef.value.showPanel()
   currentIndex.value = -1
 }, 500)
 
 const rowClick = (val) => {
   let {row, rowIndex} = val
   pulldownRef.value?.hidePanel()
-  if (isObj) {
-    props.modelValue[props.code] = row.code
-    props.modelValue[props.name] = row.name
+
+  if (props.select) {
+    modVal.value = row.code
+    selectName = row.name
   } else {
-    emits('update:modelValue', row.name)
+    if (isObj) {
+      props.modelValue[modCode] = row.code
+      props.modelValue[modName] = row.name
+    } else {
+      modVal.value = row.name
+    }
   }
 
   emits('rowClick', row, rowIndex)
@@ -149,15 +184,27 @@ const rowClick = (val) => {
 
 const inputClick = async () => {
   await pulldownRef.value.togglePanel()
+  if (props.select) {
+    await vxeTableRef.value.setCurrentRow(theRowIsCurrentlySelected.value.row)
+    await vxeTableRef.value.scrollToRow(theRowIsCurrentlySelected.value.row)
+  }
 }
 
 const handleFocus = () => {
-  if (isObj) {
-    placeholder.value = props.modelValue[props.name]
+  if (props.select) {
+    placeholder.value = selectName
   } else {
-    placeholder.value = <string>props.modelValue;
+    if (isObj) {
+      placeholder.value = props.modelValue[modName]
+    } else {
+      placeholder.value = <string>props.modelValue;
+    }
   }
+
   inputData.value = ''
+  if (!placeholder.value) {
+    placeholder.value = props.placeholder
+  }
 }
 
 const handleBlur = () => {
@@ -165,11 +212,16 @@ const handleBlur = () => {
   if (pulldownRef.value.isPanelVisible()) {
     return
   }
-  if (isObj) {
-    inputData.value = props.modelValue[props.name]
+  if (props.select) {
+    inputData.value = selectName
   } else {
-    inputData.value = <string>props.modelValue;
+    if (isObj) {
+      inputData.value = props.modelValue[modName];
+    } else {
+      inputData.value = <string>props.modelValue;
+    }
   }
+
 }
 
 const keyUp = () => {
@@ -220,27 +272,59 @@ const enterToSelect = () => {
 }
 
 const handleClear = () => {
-  if (isObj) {
-    props.modelValue[props.code] = ''
-    props.modelValue[props.name] = ''
+  if (props.select) {
+    modVal.value = ''
   } else {
-    emits('update:modelValue', '')
+    if (isObj) {
+      props.modelValue[modCode] = ''
+      props.modelValue[modName] = ''
+    } else {
+      modVal.value = ''
+    }
   }
-  placeholder.value = ''
+  placeholder.value = props.placeholder
 }
 
 onMounted(async () => {
   if (isObj) {
-    if (!props.code || !props.name) {
-      console.error('绑定是对象,要填写 code 和 name')
+    if (props.select) {
+      console.error('绑定是对象,无法使用select')
+    }
+    if (props.codeName) {
+      modCode = props.codeName;
+      modName = props.codeName + 'Name';
+    } else {
+      if (!props.code || !props.name) {
+        console.error('绑定是对象,要填写 code 和 name');
+      }
     }
 
-    watch(() => props.modelValue[props.code], () => {
-      inputData.value = props.modelValue[props.name]
+    watch(() => props.modelValue[modCode], () => {
+      inputData.value = props.modelValue[modName]
     }, {immediate: true, deep: true});
+
   } else {
     watch(() => props.modelValue, () => {
-      inputData.value = <string>props.modelValue
+      if (props.select) {
+        let data = XEUtils.find(computedData.value, (item, key) => {
+          if (item.code === props.modelValue) {
+            theRowIsCurrentlySelected.value = {
+              row: item,
+              index: key
+            }
+            return true
+          }
+        })
+
+        if (data) {
+          inputData.value = data.name
+        } else {
+          inputData.value = <string>modVal.value
+        }
+
+      } else {
+        inputData.value = <string>props.modelValue;
+      }
     }, {immediate: true, deep: true})
   }
 

+ 8 - 0
src/components/xiao-chan/xc-table-v2/XcTableV2.vue

@@ -58,6 +58,7 @@
 import {useIntersectionObserver, useVirtualList} from "@vueuse/core";
 import {computed, nextTick, onMounted, ref, Ref, h} from 'vue'
 import {ElCheckbox} from "element-plus";
+import {watch} from "@vue/runtime-core";
 
 const props = defineProps({
   data: Array,
@@ -87,6 +88,7 @@ const props = defineProps({
   },
 })
 
+
 const tempData = computed(() => {
   return props.data
 })
@@ -299,6 +301,7 @@ onMounted(async () => {
   fixedRight()
   isShow.value = true
   await nextTick()
+
   useIntersectionObserver(
       tableRef,
       ([{isIntersecting}], observerElement) => {
@@ -308,6 +311,11 @@ onMounted(async () => {
       },
   )
 
+  watch(() => props.data.length, () => {
+    // 如果数组的长度有变化就要回到上一级
+    scrollTo(0)
+  })
+
   containerProps.ref.value.addEventListener('scroll', () => {
     tempScrollTop = containerProps.ref.value.scrollTop
     headerRef.value.scrollLeft = containerProps.ref.value.scrollLeft

+ 1 - 1
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/DialogDiseases.vue

@@ -14,7 +14,7 @@
         <vxe-column title="日期"
                     field="reportDate"
                     width="120"
-                    :formatter="vxeFormatTime"/>
+                    formatter="formatDate"/>
         <vxe-column>
           <template #default="{row}">
             <el-button v-el-btn="{func: deleteClick, value: row}" type="danger">删除</el-button>

+ 5 - 1
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-edit/YzEditor.vue

@@ -831,12 +831,16 @@ const duplicateAndPaste = () => {
   copyFuncApi()
 }
 
+const confirmMedicalAdvice = () => {
+  yzMitt.emit('confirmMedicalAdvice')
+}
 
 let shortcutKeyRegistration = {
   ctrl: {s: toAddAnOrder},
-  alt: {a: toAddAnOrder}
+  alt: {a: toAddAnOrder, q: confirmMedicalAdvice}
 }
 
+
 /**
  * 给药方式是否可以用
  */

+ 8 - 0
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-header/YzQueryCondition.vue

@@ -455,6 +455,14 @@ onMounted(async () => {
   yzMitt.on('queryYz', (val) => {
     return queryYz(val)
   })
+
+  yzMitt.on('confirmMedicalAdvice', (val) => {
+    if (isCydy()) {
+      confirmTheDoctorSOrderWithMedicineClick()
+    } else {
+      currentConfirmOrdersClick()
+    }
+  })
 })
 
 </script>

+ 6 - 1
src/utils/mitt.ts

@@ -16,7 +16,12 @@ class EventBus {
     emit(name: string, ...arg: any[]) {
         if (this.emits.has(name)) {
             let cb = this.emits.get(name)
-            return cb!(...arg)
+            let result = null
+            try {
+                result = cb!(...arg)
+            } catch {
+            }
+            return result
         }
     };
 }

+ 19 - 0
src/utils/vxe-formatter.ts

@@ -1,6 +1,25 @@
 import {VxeColumnPropTypes} from "vxe-table";
+import {VXETable} from 'vxe-table'
 import XEUtils from "xe-utils";
 
+VXETable.formats.mixin({
+    formatDate({cellValue}, format: string = 'yy-MM-dd HH:mm') {
+        return XEUtils.toDateString(cellValue, format)
+    },
+    formatSex({cellValue}) {
+        if (cellValue) {
+            if (cellValue == 1) {
+                return '男'
+            }
+            if (cellValue == 2) {
+                return '女'
+            }
+            return '其他'
+        }
+        return ''
+    },
+})
+
 export const vxeFormatTime: VxeColumnPropTypes.Formatter = ({cellValue}) => {
     return XEUtils.toDateString(cellValue, 'yy-MM-dd HH:mm')
 }

+ 2 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -152,7 +152,7 @@
         </div>
         <div style="display: flex;width: 100%">
           <div :style="emrMainWidth()"
-               v-show="showIframe === 1 || showIframe === 3 ||showIframe === 5">
+               v-show="showIframe === 1 || showIframe === 3 || showIframe === 5">
             <div style="position: relative">
               <emr-popup ref="popupRef"
                          @fill-data="popupFunc.fillData"/>
@@ -237,6 +237,7 @@
                 maxlength="20"
                 minlength="1"
                 show-word-limit/>
+
       <br> <br>
 
       <el-alert type="warning" title="正在解析病程记录,请稍等。" v-if="解析病程提示"/>
@@ -1315,7 +1316,6 @@ const visibility = useDocumentVisibility()
 let emrEditCreateLimit = new EmrEditCreateLimit(props.huanZheXinXi, userData)
 
 onMounted(async () => {
-  pageIsZoom()
   autoSave = store.state.app.emrAutosave;
   extractData = await getExtractDataElement(props.huanZheXinXi.inpatientNo, props.huanZheXinXi.admissTimes)
   await nextTick()

+ 10 - 11
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrAudit.vue

@@ -235,17 +235,17 @@ const rowContextmenu = (row, column, event) => {
 const queryAudit = (val) => {
   emrInfo.value = val
   getAuditMessages(emrInfo.value.id, emrInfo.value.code, patInfo.value.finalControl).then(async res => {
-    expandRow.value = []
-    data.value = res.data
-    historyCount.value = res.historyCount
-    elTableRef.value.clearSelection()
-    await nextTick()
-    let tempList = []
-    console.log('质控数据', res)
+    expandRow.value = [];
+    data.value = res.data;
+    historyCount.value = res.historyCount;
+    elTableRef.value.clearSelection();
+    await nextTick();
+    let tempList = [];
+
     for (let i = 0, len = data.value.length; i < len; i++) {
-      let item = data.value[i]
+      let item = data.value[i];
       item.rowId = i;
-      if (stringNotBlank(item.approver)) {
+      if (stringNotBlank(item.approver) && item.remediationStatus === null) {
         expandRow.value.push(i);
         elTableRef.value.toggleRowSelection(item);
         tempList.push(item);
@@ -253,7 +253,7 @@ const queryAudit = (val) => {
     }
 
     if (tempList.length > 0) {
-      emrMitt.emit('setShowIframe', 5, null)
+      emrMitt.emit('setShowIframe', 5, null);
     }
 
     if (!permissions()) {
@@ -261,7 +261,6 @@ const queryAudit = (val) => {
     }
 
   })
-
 }
 
 const addAudit = async () => {

+ 5 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -166,7 +166,11 @@ const orderQuash = async (val) => {
     BizException(ExceptionEnum.LOGICAL_ERROR, "录入医嘱无需撤销删除即可。");
   }
 
-  ElMessageBox.prompt(`申请撤销<span style="color: red">【${val.orderName}】</span>医嘱,医务部通过审核后医嘱自动撤销。`, '提示', {
+  ElMessageBox.prompt(`
+申请撤销<span style="color: red">【${val.orderName}】</span>医嘱,
+医务部通过审核后医嘱自动撤销,
+可在数据修改 》 医嘱撤销审核
+页面中查看到自己的申请信息。`, '提示', {
     type: 'warning',
     confirmButtonText: '确定',
     cancelButtonText: '取消',

+ 26 - 20
src/views/settings/Test.vue

@@ -1,36 +1,42 @@
 <template>
 
-  <el-button v-el-btn="el1">不传参数</el-button>
-  <el-button v-el-btn="{func:el1, value: 23}">单个传参</el-button>
-  <el-button v-el-btn="{func:el1, value: {a: 1 ,b: 2}}" type="danger">多个传参</el-button>
+  <xc-combo-grid-v2
+      v-model="obj.code"
+      clearable
+      select
+      filterable
+      code-name="code"
+      v-model:data="data"/>
 
-  <div style="border: 1px solid; height: 200px; width: 200px"
-       v-loading="loading"/>
-
-  <el-button :loading="lo" @click="te1">123</el-button>
+  <el-button @click="测试('04.0412')">测试1</el-button>
+  <el-button @click="测试('11')">测试2</el-button>
 
 </template>
 
 <script setup>
-import sleep from "@/utils/sleep";
+import XcComboGridV2 from "@/components/xiao-chan/combo-grid/XcComboGridV2.vue";
+import {obtainSurgicalItems} from "@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
 
+const model = ref('')
 
-const lo = ref(false)
-const te1 = async () => {
-  lo.value = true
-  await sleep(3000)
-  lo.value = false
-}
+const obj = ref({
+  code: '',
+  codeName: '',
+})
 
+const data = ref([])
 
-const loading = ref(false)
+const queryOperation = (val) => {
+  return obtainSurgicalItems(val, 0)
+}
 
-const el1 = async (val) => {
-  console.log(val)
-  loading.value = true
-  await sleep(3000)
-  loading.value = false
+const 测试 = (val) => {
+  obj.value.code = val
 }
+
+onMounted(async () => {
+  data.value = await obtainSurgicalItems('12', 0)
+})
 </script>
 
 <style lang="scss">