Browse Source

医嘱录入,选择医嘱名称增加弹窗按钮选择

梁欢 2 tháng trước cách đây
mục cha
commit
96d7c86091

+ 48 - 0
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/showDialog/ShowDialog.vue

@@ -0,0 +1,48 @@
+<template>
+  <el-dialog
+    v-model="ShowDialog"
+    title="请选择支付类型"
+    :width="200"
+    :close-on-click-modal="false"
+    @closed="emits('closed')"
+  >
+    <div class="flex justify-center items-center w-full p-6">
+      <!-- 自费按钮 -->
+      <el-button
+        type="primary"
+        size="large"
+        class="w-24"
+        @click="handleSelfPay"
+      >
+        自费
+      </el-button>
+
+      <!-- 医保按钮 -->
+      <el-button
+        type="success"
+        size="large"
+        class="w-24"
+        @click="cancel"
+      >
+        医保
+      </el-button>
+    </div>
+  </el-dialog>
+</template>
+<script setup>
+
+const emits = defineEmits(["closed","select"]);
+
+const ShowDialog = ref(true);
+
+// 点击自费按钮:传递选择结果并关闭对话框
+const handleSelfPay = () => {
+  emits('select', 'self'); // 自费标识
+  ShowDialog.value = false;   // 关闭对话框
+};
+
+const cancel = () => {
+  emits('select', 'medical'); // 医保标识
+   ShowDialog.value = false;
+};
+</script>

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

@@ -253,6 +253,13 @@
       v-if="yzDialogRef"
       @closed="yzDialogRef = false"
     />
+      <!--  选择医嘱后弹窗  -->
+      <showDialog
+        v-if="showDialogRef"
+        :yz-data="yiZhuData"
+        @select="handlePaymentSelect"
+        @closed="showDialogRef = false"
+      />
   </div>
 </template>
 
@@ -306,6 +313,7 @@ import {
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import { dayjs, ElMessageBox } from "element-plus";
 import YzDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog";
+import ShowDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/showDialog/ShowDialog";
 import Dig from "@/utils/math";
 import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
 import { shortcutTrigger, xcEvent } from "@/utils/xckeydown";
@@ -1012,7 +1020,20 @@ const confirmOrdersClick = async () => {
 };
 
 const yzDialogRef = ref(false);
+const showDialogRef = ref(false);
 const openTheOrderPopUpWindow = () => {
+  showDialogRef.value=true;
+      //让CyComboGrid 失焦,否则医嘱名称会2次弹窗
+     if (orderCodeRef.value && typeof orderCodeRef.value.blur === 'function') {
+       orderCodeRef.value.blur();
+     } else {
+       const comboGridEl = orderCodeRef.value?.$el;
+       if (comboGridEl) {
+         const inputEl = comboGridEl.querySelector('input'); // 找到内部输入框
+         if (inputEl) inputEl.blur();
+       }
+    }
+    //如果下面也会弹窗的话,那么我们就要下面就要做判断了,因为我没有碰到所以我暂时就没写了
   if (!isEdit.value) {
     if (yiZhuData.value.statusFlag !== "1") {
       return;
@@ -1237,6 +1258,16 @@ defineExpose({
   confirmOrdersClick,
   isEdit,
 });
+
+// showDialog
+const handlePaymentSelect = (type) => {
+  if (type === 'self') {
+    // 选择自费时,勾选复选框
+    yiZhuData.value.ybSelfFlag = "1";
+  }else{
+     yiZhuData.value.ybSelfFlag = "0";
+  }
+};
 </script>
 
 <style scoped lang="scss">