Explorar el Código

电子病历保存提示

xiaochan hace 1 año
padre
commit
4276f8287d

+ 3 - 6
src/utils/cy-use/useTsxUtils.ts

@@ -27,16 +27,14 @@ export const tsxTemplate: TsxRenderTemplate = new Proxy(tsxRenderTemplate, {
 })
 
 
-function tsxVModelFunc<D>(modelValue: D, name: keyof D, watch: Function) {
+function tsxVModelFunc<D>(modelValue: D, name: keyof D) {
     const updateName = 'onUpdate:' + name.toString()
-
     if (isRef(modelValue)) {
         const value = 'value'
         return {
             [name]: modelValue[value],
             [updateName]: (val: any) => {
                 modelValue[value] = val
-                watch && watch(val)
             }
         }
     }
@@ -45,7 +43,6 @@ function tsxVModelFunc<D>(modelValue: D, name: keyof D, watch: Function) {
         [name]: modelValue[name],
         [updateName]: (val: any) => {
             modelValue[name] = val
-            watch && watch(val)
         }
     }
 }
@@ -59,8 +56,8 @@ export interface tsxVModel {
 
 // @ts-ignore
 export const tsxVModel: tsxVModel = new Proxy(tsxVModelFunc, {
-    get(target: <D>(modelValue: D, name: keyof D, watch: Function) => { [p: string]: (el: any) => void }, p: string | symbol, receiver: any): any {
-        return (value: any, watch: Function) => target(value, p, watch)
+    get(target: <D>(modelValue: D, name: keyof D) => { [p: string]: (el: any) => void }, p: string | symbol, receiver: any): any {
+        return (value: any) => target(value, p)
     },
     apply(target: any, thisArg: any, argArray: any[]): any {
         return target(argArray[0], argArray[1] ?? 'modelValue')

+ 7 - 17
src/utils/cy-use/useVxeTable.tsx

@@ -148,14 +148,7 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
             return slots[name] ? slots[name]() : null
         }
 
-
-        mutation.getTableDefaultSlots = () => {
-            return getSlotsByName('default')
-        }
-
-        mutation.getDialogHeaderSlots = () => {
-            return getSlotsByName('dialogHeader')
-        }
+        mutation.getTableSlotsByName = getSlotsByName
 
         const TempVxeTable = () => {
             return <VxeTable
@@ -166,7 +159,6 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
                 // @ts-ignore
                 style={{...simplifiedConfiguration.tableCss}}
             >
-
                 {{
                     default: () => {
                         function renderIcon(checked: boolean, indeterminate: boolean) {
@@ -416,8 +408,8 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
                                 header: () => {
                                     try {
                                         let HeaderSlots = null
-                                        if (mutation.getDialogHeaderSlots() != null) {
-                                            HeaderSlots = mutation.getDialogHeaderSlots()
+                                        if (mutation.getTableSlotsByName('dialogHeader') != null) {
+                                            HeaderSlots = mutation.getTableSlotsByName('dialogHeader')
                                         } else if (simplifiedConfiguration.dialogHeader) {
                                             HeaderSlots = simplifiedConfiguration?.dialogHeader();
                                         }
@@ -457,7 +449,7 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
                                                             }
                                                         }}
                                                     </VxeColumn>,
-                                                    mutation.getTableDefaultSlots()
+                                                    mutation.getTableSlotsByName('default')
                                                 ]
                                             }
                                         }}
@@ -499,12 +491,10 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
             tableRef.value?.clearCheckboxRow()
             pageMemory.clear()
         },
-        getTableDefaultSlots(): any {
-
+        getTableSlotsByName(name: string): any {
+            return null
         },
-        getDialogHeaderSlots(): any {
 
-        }
     }
 
     onMounted(() => {
@@ -518,7 +508,7 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
 
     return {
         tableRef,
-        CyVxeTable: CyVxeTable,
+        CyVxeTable,
         tableProps: props,
         exportExcel,
         mutation,

+ 1 - 1
src/utils/emr/edit.ts

@@ -110,7 +110,7 @@ export declare type EditType = {
      * {Boolean} includeEmptyValue 是否获取非必填并且不是数据元 值为空的元素 默认 false
      * @param val type 要获取的编码类型 默认 code。  code|business|internal|dataElement, 一般不用dataElement,当指定的编码类型不存在时返回 code
      */
-    getDataElements: (val: 'code' | 'business' | 'internal' | 'dataElement') => DataElements;
+    getDataElements: (val: 'code' | 'business' | 'internal' | 'dataElement', a?: boolean, b?: boolean) => DataElements;
 
     /**
      * 批量设置组件值

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

@@ -348,7 +348,7 @@ import ChooseToFillInData
 import emrStore from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/useEmrStore";
 import HuanZheXinXi from "@/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue";
 import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
-
+import {magicApi} from "@/utils/database/magic-api-request";
 
 const props = defineProps({
   maxHeight: {
@@ -765,7 +765,6 @@ const clickSaveData = async () => {
     emrSaveRulesRef.value.close()
     const validator = editor.getValidator();
     const valid = validator.valid(true);
-
     if (valid) {
       emrSaveRulesRef.value.validData(valid)
       return
@@ -776,7 +775,9 @@ const clickSaveData = async () => {
   await handleCrb()
 
   // 解析 id
-  let id = await analysisIframeSrcSearch()
+  let id = await analysisIframeSrcSearch();
+
+  // @ts-ignore
   let data: saveType = {
     name: '',
     emrDocumentId: id,
@@ -792,6 +793,22 @@ const clickSaveData = async () => {
 
   data.emrDataElement = editor.getDataElements('business', false, true)
 
+  const saveErrorMsg = await magicApi({
+    method: 'post',
+    url: '/intergration/cyEmr/save',
+    data: {
+      patientInfo: patientInfo.value,
+      dataElement: data.emrDataElement,
+      categoryCode: categoryCode.value
+    }
+  }).catch(() => {
+    return []
+  })
+
+  if (XEUtils.isArray(saveErrorMsg) && saveErrorMsg.length > 0) {
+    emrSaveRulesRef.value.validData(saveErrorMsg)
+  }
+
   objectValuesCannotBeNull(data);
   if (categoryCode.value === emrCodeEnum.courseRecord) {
     templateName.value = '病程记录'

+ 8 - 4
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrSaveRules.vue

@@ -4,6 +4,7 @@ import {useDraggable} from '@vueuse/core'
 import {
   emrMitt,
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
+import {Close} from "@element-plus/icons-vue";
 
 interface Item {
   name: string;
@@ -29,6 +30,7 @@ interface Data {
   id: string;
   code: string;
   element: Element;
+  label: string
 }
 
 const rulesData = ref<Data[]>([])
@@ -49,10 +51,7 @@ const liClick = (data: Data) => {
 }
 
 const getName = (val: Data) => {
-  if (val.element && val.element.name) {
-    return '数据元:' + val.element.name
-  }
-  return ''
+  return val.label || ''
 }
 
 const close = () => {
@@ -151,6 +150,11 @@ defineExpose({
       background: var(--el-color-warning-light-9);
       color: var(--el-color-warning);
     }
+
+    .error {
+      background: var(--el-color-error-light-9);
+      color: var(--el-color-error);
+    }
   }
 
   .rules_main {