Quellcode durchsuchen

医嘱提示问题

xiaochan vor 1 Jahr
Ursprung
Commit
f7d1ace0ba

+ 2 - 2
src/components/cy/combo-grid/src/CyComboGrid.vue

@@ -40,7 +40,7 @@ export declare type CyComboGridOptions = {
 }
 
 const props = withDefaults(defineProps<CyComboGridOptions>(), {
-  placement: 'bottom-start',
+  placement: 'bottom',
   teleported: true,
   select: true,
   effect: 'light',
@@ -141,7 +141,7 @@ defineExpose({
         ref="tooltipRef"
         :placement="placement"
         :teleported="teleported"
-        :fallback-placements="['bottom-start', 'top-start', 'right', 'left']"
+        :fallback-placements="['bottom', 'top']"
         :effect="effect"
         trigger="click"
         :visible="dropdownMenuVisible"

+ 1 - 0
src/components/js-dialog-comp/useDialogToJs.ts

@@ -16,6 +16,7 @@ export const compList = ref<{
     }
 }>({})
 
+
 function setDialogToJs<P extends Component>(comp: P, data: any) {
     return new Promise<any>((resolve, reject) => {
         const id = "cy-dialog_js__" + generateRandomString(5)

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

@@ -54,7 +54,7 @@
   </div>
 </template>
 
-<script setup name='XcTableV2' lang="tsx">
+<script setup lang="tsx">
 import {useIntersectionObserver, useVirtualList} from "@vueuse/core";
 import {computed, nextTick, onMounted, ref, Ref, h} from 'vue'
 import {ElCheckbox} from "element-plus";

+ 2 - 2
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/YzTableV2.vue

@@ -37,12 +37,13 @@ import {DocumentCopy} from "@element-plus/icons-vue";
 import {updateOrderInstruction} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import XEUtils from 'xe-utils'
 
-const emits = defineEmits(['rowClick', 'clickAssociate', 'voidOrders'])
 
 const {height} = defineProps({
   height: [Number, null]
 })
 
+const emits = defineEmits(['rowClick', 'clickAssociate', 'voidOrders'])
+
 const tableRef = ref(null)
 
 const header = [
@@ -165,7 +166,6 @@ const header = [
         onclick: (e) => {
           e.preventDefault();
           e.stopImmediatePropagation();
-          emits('voidOrders', data)
         }
       }, [hToVoidNode(data), hDeleteNode(data)])
     }

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

@@ -749,8 +749,9 @@ const confirmOrdersClick = async () => {
     }
     let res = await confirmOrders(props.patientInfo)
     if (res !== null && res.error) {
-      errorMsg.value.dialog = false
-      errorMessageData.value = res.data
+      errorMsg.value.type = YzErrTypeEnum.确认错误
+      errorMsg.value.dialog = true
+      errorMsg.value.data = res.data
     }
   } catch (e) {
 
@@ -773,8 +774,6 @@ const openTheOrderPopUpWindow = () => {
   }
 }
 
-// 错误信息
-const errorMessageData = ref({})
 /**
  * 点击了查看错误信息
  * @param orderNo 医嘱号

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

@@ -55,7 +55,6 @@
           确认带药
         </el-button>
 
-
       </el-button-group>
       <el-divider direction="vertical"/>
       <el-dropdown split-button

+ 4 - 8
src/directives/v-el-btn.ts

@@ -33,14 +33,10 @@ const VElBtn = {
 
             vnode.ref.i.props.loading = true
             el.setAttribute(loadingName, 'true')
-            if (binding.value.func) {
-                await (binding.value.func(binding.value.value) as Promise<any>).finally(() => {
-                    finallyFunc()
-                })
-            } else {
-                await (binding.value() as Promise<any>).finally(() => {
-                    finallyFunc()
-                })
+            try {
+                await binding.value.func ? binding.value.func(binding.value.value) : binding.value()
+            } finally {
+                await finallyFunc()
             }
         });
     },

+ 3 - 1
src/directives/v-title.ts

@@ -59,7 +59,9 @@ const VTitle = {
             div.style.display = 'none';
         });
     },
-    unmounted() {
+    unmounted(el: HTMLHtmlElement) {
+        el.removeEventListener('mousemove')
+        el.removeEventListener('mouseleave')
         div.style.display = 'none';
     }
 

+ 9 - 22
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -11,11 +11,11 @@
                  :open-group-order-template="openGroupOrderTemplate"/>
     </div>
 
-    <yz-table-v2
+    <YzTableV3
         :height="editSizeRef?.clientHeight"
         @void-orders="voidOrdersClick"
-        @clickAssociate="clickAssociate"
-        @rowClick="rowClick"/>
+        @rowClick="rowClick"
+    />
 
     <doctor-s-order-fee :data="chargeDetails.data"
                         v-if="chargeDetails.dialog"
@@ -76,6 +76,8 @@ import XEUtils from 'xe-utils'
 import {nextTick, onActivated, onMounted, ref} from 'vue'
 import {CyMessageBox} from "@/components/cy/message-box";
 import DoctorSOrderFee from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/DoctorSOrderFee.vue";
+import YzTableV3 from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/YzTableV3.vue";
+import {isDev} from "@/utils/public";
 
 let allergen = ref({
   dialog: false,
@@ -95,6 +97,10 @@ const reasonableRef = ref(null)
  * 确认医嘱 , 已经做过无患者的判断了
  */
 const confirmOrdersClick = async () => {
+  if (isDev) {
+    await confirmOrder()
+    return
+  }
   // 如果没有问题就可以直接确认医嘱了。
   let temp = await reasonableRef.value.check(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes);
   if (temp) {
@@ -286,24 +292,6 @@ const openGroupOrderTemplate = async (code) => {
   mubanRef.value.openTemplateByCode(code)
 }
 
-// 点击关联
-const clickAssociate = async (data: YzType) => {
-  if (stringNotBlank(data.parentNo)) {
-    xcMessage.error('该医嘱已经有父医嘱了。');
-  } else if (data.statusFlag !== '1') {
-    xcMessage.error('不是录入状态的医嘱无法关联。');
-  } else if (data.serial === '00') {
-    xcMessage.error('项目无法关联。');
-  } else {
-    if (associateOrders.value.actOrderNo === null) {
-      await yzMitt.emit('queryYz')
-      associateOrders.value.actOrderNo = data.actOrderNo
-    } else {
-      xcMessage.error('请先确认当前关联医嘱。')
-    }
-  }
-}
-
 /**
  * 点击批量删除数据
  */
@@ -353,7 +341,6 @@ onMounted(async () => {
 
   yzMitt.on("allergen", allergen.value.open)
   yzMitt.on('clickOnTheOrderTemplate', clickOnTheOrderTemplate)
-  yzMitt.on('clickAssociate', clickAssociate)
   yzMitt.on('rowClick', rowClick)
 
   await sleep(200)

+ 107 - 63
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/YzTableV3.vue

@@ -1,25 +1,32 @@
 <script setup lang="ts">
-import {stringIsBlank} from "../../../../../../utils/blank-utils";
+import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
 import {
   associateOrders,
-  clearAssociate,  openDrugManual,
+  clearAssociate, openDrugManual,
   tempYzData, yiZhuData, yzMitt,
   yzSize,
   YzType
-} from "../../../../../../views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {ref, h, reactive, onMounted, nextTick} from 'vue'
 import {VxeTableInstance, VxeTablePropTypes} from 'vxe-table'
-import {nullToEmpty} from '../../../../../../utils/public'
-import {getFormatDatetime} from '../../../../../../utils/date'
-import {getServerDateApi} from '../../../../../../api/public-api'
+import {nullToEmpty} from '@/utils/public'
+import {getFormatDatetime} from '@/utils/date'
+import {getServerDateApi} from '@/api/public-api'
 import XEUtils from "xe-utils";
-import {updateOrderInstruction} from '../../../../../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
+import {updateOrderInstruction} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
 import sleep from "../../../../../../utils/sleep";
+import {
+  ElButton,
+  ElButtonGroup
+} from "element-plus";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
 
 const {height} = defineProps({
   height: [Number, null]
 })
 
+const emits = defineEmits(['rowClick', 'voidOrders'])
+
 const tableRef = ref<VxeTableInstance>(null)
 
 const toggleAllCheckboxEvent = () => {
@@ -54,7 +61,11 @@ const menuConfig = reactive<VxeTablePropTypes.MenuConfig>({
         {code: 'copy', name: '复制', prefixIcon: 'vxe-icon-copy'}
       ],
       [
-        {code: 'paste', name: '粘贴', prefixIcon: 'vxe-icon-paste'}
+        {
+          code: 'paste',
+          name: '粘贴',
+          prefixIcon: 'vxe-icon-paste'
+        }
       ],
       [
         {code: 'relevancy', name: '关联'}
@@ -63,17 +74,42 @@ const menuConfig = reactive<VxeTablePropTypes.MenuConfig>({
         {code: 'exitTheAssociation', name: '退出关联'}
       ],
       [
-        {code: 'instructions', name: '说明书'}
+        {
+          code: 'instructions',
+          name: '说明书'
+        }
       ],
+      [
+        {
+          code: 'stopTime',
+          name: '停止医嘱'
+        }
+      ]
     ],
   },
-  visibleMethod({options, column}) {
+  visibleMethod({options, column, row}) {
     options.forEach(list => {
       list.forEach((item) => {
-        item.disabled = !column;
+        item.disabled = true
+
         if (item.code === 'paste') {
           item.disabled = !yzMitt.emit('allowReplication')
         }
+
+        if (row) {
+          if (['copy', 'relevancy', 'exitTheAssociation'].includes(item.code)) {
+            item.disabled = false
+          }
+
+          if (['relevancy', 'instructions'].includes(item.code)) {
+            item.disabled = row.serial == '00'
+          }
+
+          if (item.code === 'stopTime') {
+            item.disabled = !showEndTime(row)
+          }
+        }
+
       })
     })
     return true
@@ -90,19 +126,31 @@ const rightFunc = {
   "paste": (data: YzType) => {
     yzMitt.emit('paste')
   },
-  "relevancy": (data: YzType) => {
-    yzMitt.emit('clickAssociate', data)
+  "relevancy": async (data: YzType) => {
+    if (canBeAssociated(data, true)) {
+      if (associateOrders.value.actOrderNo === null) {
+        await yzMitt.emit('queryYz')
+        associateOrders.value.actOrderNo = data.actOrderNo
+      } else {
+        xcMessage.error('请先确认当前关联医嘱。')
+      }
+    }
   },
   "exitTheAssociation": (data: YzType) => {
     clearAssociate()
   },
   "instructions": (data: YzType) => {
-    if (data.groupNo !== '00') {
-      openDrugManual(data.orderCode, data.serial)
-    }
+    openDrugManual(data.orderCode, data.serial)
   },
+  "stopTime": (data) => {
+    if (tableRef.value.isCheckedByCheckboxRow(data)) {
+      cancelStopTime(data)
+    } else {
+      setDefaultStopTime({row: data})
+    }
+  }
 }
-// 触发鼠标右键的时间
+// 触发鼠标右键的事件
 const tableRightClick = (val: MenuClick) => {
   let {row, menu} = val
   try {
@@ -111,6 +159,25 @@ const tableRightClick = (val: MenuClick) => {
   }
 }
 
+function canBeAssociated(data: YzType, showMessage = false) {
+
+  function message(message) {
+    showMessage && xcMessage.error(message);
+  }
+
+  if (stringNotBlank(data.parentNo)) {
+    message('该医嘱已经有父医嘱了。');
+    return false
+  } else if (data.statusFlag !== '1') {
+    message('不是录入状态的医嘱无法关联。');
+    return false
+  } else if (data.serial === '00') {
+    message('项目无法关联。');
+    return false
+  }
+  return true
+}
+
 const twinkleList = ref({})
 const rowClassName = ({row, rowIndex}) => {
   let data = row as YzType
@@ -192,11 +259,14 @@ const timeFomat = (val) => {
 }
 
 const showEndTime = (data: YzType) => {
+  if (!data) {
+    return false
+  }
   return stringIsBlank(data.endTime) && stringIsBlank(data.parentNo) && data.frequCode !== 'ONCE';
 }
 
 const rowClick = ({row}) => {
-  yzMitt.emit('rowClick', row)
+  emits('rowClick', row)
 }
 
 const endDateStyle = (item) => {
@@ -304,7 +374,7 @@ onMounted(() => {
           {{ timeFomat(row.startTime) }}
         </template>
       </vxe-column>
-      <vxe-column field="endTime" title="结束时间" width="140">
+      <vxe-column field="endTime" title="结束时间" width="150">
         <template #default="scope">
           <input v-if="showEndTime(scope.row)"
                  type='datetime-local'
@@ -353,35 +423,32 @@ onMounted(() => {
         </template>
       </vxe-column>
 
-      <vxe-column field="right" title="操作" width="100" fixed="right">
-        <template #default="scope">
-          <div class="yz_button">
-            <div class="toVoid">作废</div>
-            <div class="delete">删除</div>
-          </div>
+      <vxe-column field="right" title="操作" width="95" fixed="right">
+        <template #default="{row}">
+          <el-button-group
+          >
+            <el-button text
+                       type="warning"
+                       @click.stop.prevent="emits('voidOrders', row)"
+            >
+              作废
+            </el-button>
+            <el-button text
+                       type="danger"
+                       @click.stop.prevent="yzMitt.emit('deleteAnOrderByOrderNo', row, false)"
+            >
+              删除
+            </el-button>
+          </el-button-group>
+
         </template>
       </vxe-column>
-
-
     </vxe-table>
   </div>
 </template>
 
 <style lang="scss">
 
-.new_order {
-  position: relative;
-
-  &:before {
-    position: absolute;
-    right: -6px;
-    font-size: 15px;
-    top: -5px;
-    content: "*";
-    color: red;
-  }
-}
-
 @keyframes hzfirst {
   from {
     background-color: #95d475
@@ -391,29 +458,6 @@ onMounted(() => {
   }
 }
 
-.yz_button {
-  width: 100%;
-  cursor: pointer;
-  padding: 0 5px;
-  display: flex;
-  justify-content: space-between;
-
-  div {
-    width: max-content;
-    margin: 0 5px;
-  }
-
-  .toVoid {
-    color: #E6A23C;
-    background-color: inherit;
-  }
-
-  .delete {
-    color: #F56C6C;
-    background-color: inherit;
-  }
-}
-
 .animation_hzfirst {
   td {
     animation: hzfirst 1s linear infinite