Przeglądaj źródła

优化医嘱提示错误信息

xiaochan 1 rok temu
rodzic
commit
5a94d9682d

+ 10 - 3
src/components/cy/floating-frame/FloatingFrame.vue

@@ -2,7 +2,6 @@
 import {useDraggable, useZIndex} from "element-plus";
 import XEUtils from "xe-utils";
 import {Close} from "@element-plus/icons-vue";
-import {onDeactivated} from "@vue/runtime-core";
 
 const props = withDefaults(defineProps<{
   width?: string | number,
@@ -21,6 +20,7 @@ const props = withDefaults(defineProps<{
 
 const emits = defineEmits<{
   (e: "update:modelValue", value: boolean): void,
+  (e: 'closed'): void
 }>()
 
 const vodyRef = ref()
@@ -42,11 +42,18 @@ const boxStyle = computed(() => {
   }
 })
 
-watch(() => props.modelValue, (value, oldValue, onCleanup) => {
+watch(() => props.modelValue, (value) => {
   if (value)
     zIndex.value = useZIndex().nextZIndex()
 })
 
+function closed() {
+  emits('update:modelValue', false)
+  setTimeout(() => {
+    emits('closed')
+  }, 200)
+}
+
 useDraggable(vodyRef, vRef, draggable)
 
 onDeactivated(() => {
@@ -70,7 +77,7 @@ onUnmounted(() => {
           {{ props.title }}
         </div>
         <div class="floating_frame-close_icon">
-          <el-icon :size="16" @click="emits('update:modelValue' , false)">
+          <el-icon :size="16" @click="closed">
             <Close/>
           </el-icon>
         </div>

+ 29 - 25
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunXinXi.vue → src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCuoXinXi.vue

@@ -4,16 +4,16 @@
                  :x="77"
                  :y="494"
                  width="420px">
-    <div class="box">
-      <div v-if="errorMsg.type === YzErrTypeEnum.确认错误"
-           v-for="(value, key) in  errorMsg.data "
-           class="message"
-           :class="props.currentKey == key ? 'current_selected' : '' "
-           @click="clickToModify(key)">
+    <transition-group name="list" tag="div" class="box">
+      <div
+          v-for="(value, key) in  errorMsg.data "
+          class="message"
+          :key="`error-${key}`"
+          :class="yiZhuData.actOrderNo == key ? 'current_selected' : '' "
+          @click="divClick(key,value)">
         <div class="name">
           医嘱号: {{ key }}
           序号:{{ getYzIndex(key) + 1 }}
-          {{ value?.data?.orderName }}
         </div>
         <div v-if="value?.error" class="error">
           <div>
@@ -33,41 +33,34 @@
           </div>
         </div>
       </div>
-      <div v-if="errorMsg.type === YzErrTypeEnum.删除错误">
-        <div v-for="item in errorMsg.data"
-             class="delete__box">
-          <div>
-            {{ item.actOrderNo }} 名称: {{ item.orderName }}
-          </div>
-          <div style="color: red">
-            {{ item.errorMessage }}
-          </div>
-        </div>
-      </div>
-    </div>
+    </transition-group>
   </FloatingFrame>
 </template>
 
 <script setup lang="ts">
 import {
-  errorMsg,
+  errorMsg, errorMsgFunc,
   getYzIndex,
-  YzErrTypeEnum
+  yiZhuData
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import XEUtils from 'xe-utils'
 import FloatingFrame from "@/components/cy/floating-frame/FloatingFrame.vue";
 
-const props = defineProps({
-  currentKey: [String, Number]
-})
 
 const emit = defineEmits<{
   (e: "clickError", orderNo: number): void
 }>()
 
+function divClick(key: any, data: any) {
+  if (data?.isDel) {
+    errorMsgFunc.delByOrder(key)
+  } else {
+    clickToModify(key)
+  }
+}
 
 const clickToModify = (key: any) => {
-  if (props.currentKey === key) return
+  if (yiZhuData.value.actOrderNo === key) return
   emit('clickError', XEUtils.toNumber(key))
 }
 </script>
@@ -129,5 +122,16 @@ const clickToModify = (key: any) => {
   cursor: default;
 }
 
+.list-enter-active,
+.list-leave-active {
+  transition: all 0.5s ease;
+}
+
+.list-enter-from,
+.list-leave-to {
+  opacity: 0;
+  transform: translateX(30px);
+}
+
 
 </style>

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

@@ -232,9 +232,8 @@
         </div>
       </div>
     </div>
-    <!--  报错信息  -->
-    <bao-cun-xin-xi @clickError="clickError"
-                    :currentKey="yiZhuData.actOrderNo"/>
+    <BaoCuoXinXi v-if="errorMsg.dialog"
+                 @click-error="clickError"/>
     <!--  弹窗医嘱  -->
     <yz-dialog :yz-data="yiZhuData" v-if="yzDialogRef" @closed="yzDialogRef = false"/>
   </div>
@@ -255,7 +254,6 @@ import XcOption from "@/components/xiao-chan/select/XcOption";
 import XcSelect from "@/components/xiao-chan/select/XcSelect";
 import XcCheckbox from "@/components/xiao-chan/checkbox/XcCheckbox";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
-import BaoCunXinXi from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunXinXi";
 import {
   queryParam,
   yiZhuData,
@@ -270,7 +268,13 @@ import {
   frequencyConfig,
   addTempOrderNo,
   yiZhuDataInit,
-  setOrderDataAndTwinkle, feeKey, YzType, SearchOrdersType, RefFillingValue, errorMsg, YzErrTypeEnum
+  setOrderDataAndTwinkle,
+  feeKey,
+  YzType,
+  SearchOrdersType,
+  RefFillingValue,
+  YzErrTypeEnum,
+  errorMsgFunc, errorMsg
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {ElMessageBox} from "element-plus";
 import YzDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog";
@@ -296,6 +300,8 @@ import {getServerDate} from "@/utils/moment-utils";
 import {CyMessageBox} from "@/components/cy/message-box";
 import setDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
 import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
+import BaoCuoXinXi from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCuoXinXi.vue";
+import {log} from "echarts/types/src/util/log";
 
 const props = withDefaults(defineProps<{
   patientInfo: {
@@ -367,7 +373,7 @@ const searchClickFunc = async (row: SearchOrdersType): Promise<void> => {
   if (row.serial !== '00') {
     await drugDefaultValue(true, row)
   } else {
-    await itemDefaultValue(true, row)
+    itemDefaultValue(true, row)
   }
   await defaultAll(true, row)
 }
@@ -662,9 +668,8 @@ const clearDoctorSOrder = () => {
 /**
  * 设置医嘱为临时变量,可以新增医嘱,关闭医嘱错误信息的弹窗。
  */
-const setTheTemporaryVariableMedicalOrder = () => {
+const setTheTemporaryVariableMedicalOrder = (clearMsg = true) => {
   qingKong()
-  errorMsg.value.dialog = false
   yiZhuData.value.actOrderNo = addTempOrderNo
   openSearch()
 }
@@ -707,15 +712,13 @@ const toAddAnOrder = async () => {
   try {
     let res = await enterOrders(param)
     if (res && res.error) {
-      errorMsg.value.type = YzErrTypeEnum.确认错误
-      errorMsg.value.dialog = true
-      errorMsg.value.data = res.data
+      errorMsgFunc.add(res.data)
       return false
     }
     // 数据完全没问题
     if (res != null && res.code && res.code === 200) {
-      errorMsg.value.data = {}
       let orderNo = yiZhuData.value.actOrderNo
+      errorMsgFunc.delByOrder(orderNo)
       await setOrderDataAndTwinkle(orderNo, res.data)
     }
     setTheTemporaryVariableMedicalOrder()
@@ -749,9 +752,7 @@ const confirmOrdersClick = async () => {
     }
     let res = await confirmOrders(props.patientInfo)
     if (res !== null && res.error) {
-      errorMsg.value.type = YzErrTypeEnum.确认错误
-      errorMsg.value.dialog = true
-      errorMsg.value.data = res.data
+      errorMsgFunc.add(res.data)
     }
   } catch (e) {
 
@@ -930,6 +931,7 @@ onMounted(() => {
         if (clearOrNot) {
           qingKong()
         }
+        errorMsgFunc.delByOrder(actOrderNo)
       })
     }).catch(() => {
 

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

@@ -248,13 +248,13 @@
 import {
   associateOrdersApi,
   confirmTheDoctorSOrderWithMedicine,
-  huoQuYiZhuShuJu, stopOrder
+  huoQuYiZhuShuJu,
+  stopOrder
 } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import {
   associateOrders,
   clearAssociate,
   confirmLoading,
-  errorMsg,
   huanZheXinXi,
   isCydy,
   queryParam,
@@ -264,7 +264,8 @@ import {
   youWuXuanZheHuanZhe,
   yzData,
   yzMitt,
-  clickTimeLimitReminder
+  clickTimeLimitReminder,
+  errorMsgFunc
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import router from "@/router";
@@ -344,10 +345,8 @@ const confirmTheDoctorSOrderWithMedicineClick = () => {
   }
   confirmLoading.value = true
   confirmTheDoctorSOrderWithMedicine(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then((res) => {
-    if (res?.error) {
-      errorMsg.value.type = YzErrTypeEnum.确认错误
-      errorMsg.value.dialog = true
-      errorMsg.value.data = res.data
+    if (res && res?.error) {
+      errorMsgFunc.add(res.data)
     } else {
       queryYz()
       confirmLoading.value = false

+ 23 - 9
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.ts

@@ -663,24 +663,36 @@ export const getYzIndex = (key: string | number) => {
     }))
 }
 
-interface yZErrorType {
+interface YzErrorType {
     dialog: boolean
-    type: YzErrTypeEnum
     data: any
 }
 
-export enum YzErrTypeEnum {
-    确认错误,
-    删除错误
-}
-
 // 错误信息
-export const errorMsg: Ref<yZErrorType> = ref({
+export const errorMsg: Ref<YzErrorType> = ref({
     dialog: false,
-    type: 1,
     data: {}
 })
 
+export const errorMsgFunc = {
+    closed() {
+        errorMsg.value.dialog = false
+    },
+    delByOrder(order: any) {
+        delete errorMsg.value.data[XEUtils.toString(order)]
+        if (Object.keys(errorMsg.value.data).length === 0) {
+            errorMsgFunc.closed()
+        }
+    },
+    add: (value: object) => {
+        errorMsg.value.dialog = true
+        for (let key in value) {
+            errorMsg.value.data[key] = value[key]
+        }
+    }
+}
+
+
 // 添加新地会诊申请
 export const consultationApplication = ref(false)
 // 添加手术申请
@@ -984,6 +996,8 @@ export interface YzMitt {
     ssNotSave: () => boolean
     getCurrentWard: () => string
 
+    errorClick: (orderNo: any) => void;
+
     [key: string]: (...args: any[]) => any
 }
 

+ 7 - 13
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -45,7 +45,7 @@ import {
   associateOrders,
   clickOnThePatient,
   confirmLoading,
-  errorMsg,
+  errorMsgFunc,
   getYzIndex,
   huanZheXinXi,
   queryParam,
@@ -313,20 +313,14 @@ const batchDeleteOrdersClick = () => {
     }
     deleteMultipleOrders(param).then((res) => {
       if (res !== null && res.error) {
-        let errData = []
+        let errData = {}
         for (const key in res.data) {
-          let index = getYzIndex(key)
-          let tempYzData = yzData.value[index]
-          yzData.value[index].error = true
-          errData.push({
-            actOrderNo: key,
-            orderName: tempYzData.orderName,
-            errorMessage: res.data[key]
-          })
+          errData[key] = {
+            warning: [res.data[key]],
+            isDel: true
+          }
         }
-        errorMsg.value.dialog = true
-        errorMsg.value.type = YzErrTypeEnum.删除错误
-        errorMsg.value.data = errData
+        errorMsgFunc.add(errData)
       } else {
         yzMitt.emit('queryYz', false)
       }

+ 0 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/FeeTable.vue

@@ -53,7 +53,6 @@ onMounted(() => {
 </script>
 
 <template>
-  <!--               :checkbox-config="tableCheckboxConfig"-->
   <el-dialog v-model="dialog" title="费用详情" width="80%" top="3%">
     <vxe-table :data="feeList"
                border