Explorar el Código

医嘱录入界面和会诊申请界面

xiao hace 2 años
padre
commit
3fb02cf1ed

+ 9 - 0
src/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru.js

@@ -43,6 +43,15 @@ export function toDeleteAnOrder(orderNo) {
     })
 }
 
+export function deleteMultipleOrders(data) {
+    return request({
+        url: url + '/deleteMultipleOrders',
+        method: 'post',
+        data
+    })
+}
+
+
 export function confirmOrders(data) {
     return request({
         url: url + '/confirmOrders',

+ 2 - 1
src/components/hui-zhen-da-ying/DaYingHuiZhen.vue

@@ -1,5 +1,6 @@
 <template>
-  <el-main :style="{ maxHeight: windowSize.h - 55 + 'px', overflowY: 'auto' }">
+  <el-main>
+    <el-button @click="daYing">打印</el-button>
     <div class="main-info-parent" style="padding: 0 20px; overflow: hidden">
       <div id="huiZhenXinXiDaYin">
         <h1 style="text-align: center; font-size: 30px">长沙泰和医院</h1>

+ 1 - 1
src/components/xiao-chan/combo-grid/XcComboGrid.vue

@@ -141,7 +141,7 @@ const keyDown = () => {
 }
 
 const keyEnter = () => {
-  if (tableConfig.value.isShow) {
+  if (tableConfig.value.isShow && tempTableList.value.length > 0) {
     clickRow(tempTableList.value[currentIndex])
   } else {
     clickInput()

+ 9 - 2
src/components/xiao-chan/select/XcSelect.vue

@@ -5,9 +5,12 @@
              :id="props.id"
              :remote-method="xcMethod"
              :style="{width: props.width + 'px'}"
-             ref="xcselect" filterable
+             ref="xcselect"
+             filterable
+             @blur="getBlur"
              @change="changeStaff"
-             @clear="clear" @focus="getFocus">
+             @clear="clear"
+             @focus="getFocus">
     <el-option v-for="(item,index) in props.data"
                :key="item.index"
                :label="item.name"
@@ -96,6 +99,10 @@ const getFocus = () => {
   emit('focus')
 }
 
+const getBlur = () => {
+  xcselect.blur()
+}
+
 /**
  * 监听父组件的值是否改变
  * 如果改变了那么就,要执行查询动作

+ 1 - 0
src/components/zhu-yuan-yi-sheng/hui-zhen-shen-qing/TianJiaHuiZhenShenQing.vue

@@ -120,6 +120,7 @@ import store from "@/store"
 import {getServerDateApi} from "@/api/public-api";
 import HuanZheZhenDuan from "@/components/zhu-yuan-yi-sheng/hui-zhen-shen-qing/HuanZheZhenDuan.vue";
 import {logoutShortcut, xcHotKey} from "@/utils/xckeydown";
+import XcCode from "@/components/xiao-chan/code/XcCode";
 
 
 const emit = defineEmits(['close'])

+ 27 - 6
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunXinXi.vue

@@ -1,11 +1,12 @@
 <template>
-  <xc-dialog v-model="dialog"
+  <xc-dialog v-model="errorMsg.dialog"
              title="错误信息"
              :x="77"
              :y="494"
              width="420px">
     <div class="box">
       <div
+          v-if="errorMsg.type === 1"
           v-for="(value, key) in props.data"
           class="message"
           :class="props.currentKey == key ? 'current_selected' : '' "
@@ -32,13 +33,25 @@
           </div>
         </div>
       </div>
+      <div v-if="errorMsg.type === 2">
+        <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>
   </xc-dialog>
 </template>
 
-<script setup name='BaoCunXinXi' lang="ts">
-import {$ref} from "vue/macros";
+<script setup name='BaoCunXinXi'>
 import XcDialog from "../../xiao-chan/dialog/XcDialog.vue";
+import {errorMsg} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+
 
 const props = defineProps({
   data: {
@@ -49,16 +62,15 @@ const props = defineProps({
 
 const emit = defineEmits(['clickError'])
 
-let dialog = $ref(false)
 
 const clickToModify = (key, value) => {
-  console.log(props.currentKey, key)
   if (props.currentKey === key) return
   emit('clickError', value)
 }
 
 const openOrClose = (val = true) => {
-  dialog = val
+  errorMsg.value.dialog = val
+  errorMsg.value.type = 1
 }
 
 defineExpose({
@@ -115,5 +127,14 @@ defineExpose({
   }
 }
 
+.delete__box {
+  border: 1px solid;
+  border-radius: 5px;
+  padding: 5px;
+  font-size: 15px;
+  margin: 1px;
+  cursor: default;
+}
+
 
 </style>

+ 0 - 20
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/TableTd.vue

@@ -1,20 +0,0 @@
-<template>
-  <td v-for="he in header">
-    <div v-if="he.func" v-html="he.func(item)"/>
-    <div v-else>
-      {{ item[he.code] }}
-    </div>
-  </td>
-</template>
-
-<script setup name='TableTd'>
-const props = defineProps({
-  data: Object,
-  header: Object,
-  item: Object
-})
-</script>
-
-<style scoped lang="scss">
-
-</style>

+ 33 - 19
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/YzTable.vue

@@ -12,10 +12,13 @@
     </tr>
     </thead>
     <tbody>
-    <template v-for="(item,index) in temp">
-      <tr @click="rowClick(item,index)" :style="setBackgroundColor(index)">
+    <template v-for="(item,index) in tempYzData">
+      <tr @click="rowClick(item,index)" :style="setBackgroundColor(item)">
         <td>
-          {{ index + 1 }}
+          {{ index }}
+          <input type="checkbox"
+                 v-model="item['tempCheckbox']"
+                 @click.stop="selectedRow(item,index)">
         </td>
         <td v-for="he in header">
           <div v-if="he.func" v-html="he.func(item)"/>
@@ -32,6 +35,11 @@
 
 <script setup name='YzTable'>
 import {stringIsBlank} from "@/utils/blank-utils";
+import {
+  selectedData,
+  yiZhuData,
+  tempYzData
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 
 const props = defineProps({
   data: {
@@ -50,7 +58,15 @@ const header = [
     },
     width: 20
   },
-  {code: 'actOrderNo', name: '医嘱号'},
+  {
+    code: 'actOrderNo', name: '医嘱号', func: (val) => {
+      if (val.error) {
+        return `<span style="color: red">${nu(val.actOrderNo)}</span>`
+      } else {
+        return nu(val.actOrderNo)
+      }
+    }
+  },
   {code: 'orderName', name: '医嘱名称'},
   {
     code: 'dose', name: '剂量', func: (val) => {
@@ -80,9 +96,8 @@ const header = [
 
 const tableRef = ref()
 
-let currentIndex = $ref(-1)
-const setBackgroundColor = (index) => {
-  if (currentIndex === index) {
+const setBackgroundColor = (item) => {
+  if (yiZhuData.value.actOrderNo == item.actOrderNo) {
     return {
       'backgroundColor': 'rgba(0,58,241,0.68)',
       'color': '#fff'
@@ -98,7 +113,6 @@ const setWidth = (val) => {
 }
 
 const rowClick = (val, index) => {
-  currentIndex = index
   emit('rowClick', val)
 }
 
@@ -112,18 +126,18 @@ const nu = (val) => {
   }
 }
 
-let temp = $ref([])
-watch(() => props.data, () => {
-  temp = []
-  props.data.forEach(item => {
-    temp.push(item)
-    if (item.children) {
-      item.children.forEach(chitem => {
-        temp.push(chitem)
-      })
+const selectedRow = (row, index) => {
+  row.tempCheckbox = !row.tempCheckbox
+  if (row['tempCheckbox']) {
+    selectedData.value.push(row)
+  } else {
+    let tempIndex = selectedData.value.indexOf(row)
+    if (tempIndex > -1) {
+      selectedData.value.splice(tempIndex, 1)
     }
-  })
-}, {deep: true})
+  }
+}
+
 
 function getYiZhuFlag(val) {
   if (stringIsBlank(val)) {

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

@@ -1,12 +1,11 @@
 <template>
-  <div class="yz_editor__main">
+  <div class="yz_editor__main" ref="editorMainRef">
     <div class="editing_area">
       <div class="yz_editor__disable" v-if="isEdit"></div>
       <div class="yz_input__box">
         <div>
           医嘱名称:
           <xc-combo-grid
-              @change=" "
               style="width: 240px"
               ref="searchRef"
               v-model="yiZhuData.orderName"
@@ -42,8 +41,10 @@
                            @change="jiSuanLingLiang"/>
           <XcSelect v-model="yiZhuData"
                     id="yz_doseUnit"
+                    ref="doseUnitRef"
                     :data="yaoPinJiLiangData"
-                    :name="['doseUnit', 'doseUnitName']" :width="80"
+                    :name="['doseUnit', 'doseUnitName']"
+                    :width="80"
                     @change="xuanZheJiLiang">
             <XcOption label="value"></XcOption>
             <XcOption label="name"></XcOption>
@@ -74,6 +75,8 @@
         </div>
         <div>
           开始时间:
+          <!--          <input v-model="yiZhuData.startTime"-->
+          <!--                 type="datetime-local">-->
           <el-date-picker
               style="width: 160px"
               v-model="yiZhuData.startTime"
@@ -119,12 +122,16 @@
         </div>
         <div>
           父医嘱:
-          <el-select v-model="yiZhuData.parentNo"
-                     :disabled="yiZhuData.serial === '00'"
-                     id="yz_parentNo"
-                     @change="modifyDosingMethod"
-                     clearable
-                     @clear="yiZhuData.parentNo = null">
+          <el-select
+              ref="parentNoRef"
+              v-model="yiZhuData.parentNo"
+              :disabled="yiZhuData.serial === '00'"
+              id="yz_parentNo"
+              @change="modifyDosingMethod"
+              clearable
+              @focus="elSelectFocus(parentNoRef)"
+              @blur="elSelectBlur(parentNoRef)"
+              @clear="yiZhuData.parentNo = null">
             <el-option v-for="item in fuYiZhuData"
                        :key="item.actOrderNo"
                        :label="item.orderName"
@@ -143,7 +150,6 @@
         </div>
         <div>
           <!--  皮试药品    -->
-          <el-select></el-select>
         </div>
       </div>
       <div class="yz_input__box">
@@ -158,9 +164,15 @@
                     show-word-limit></el-input>
         </div>
         <div class="div_center__box">
-          <el-select v-model="yiZhuData.kfFlag"
-                     id="yz_kfFlag"
-                     clearable style="width: 80px" @clear="yiZhuData.kfFlag = null">
+          <el-select
+              ref="kfFlagRef"
+              @focus="elSelectFocus(kfFlagRef)"
+              @blur="elSelectBlur(kfFlagRef)"
+              v-model="yiZhuData.kfFlag"
+              id="yz_kfFlag"
+              clearable
+              style="width: 80px"
+              @clear="yiZhuData.kfFlag = null">
             <el-option key="1" label="饭前" value="1"></el-option>
             <el-option key="2" label="饭后" value="2"></el-option>
           </el-select>
@@ -169,6 +181,9 @@
           费用标志:
           <el-select v-model="yiZhuData.selfBuy"
                      id="yz_selfBuy"
+                     ref="selfBuyRef"
+                     @focus="elSelectFocus(selfBuyRef)"
+                     @blur="elSelectBlur(selfBuyRef)"
                      clearable style="width: 120px"
                      @clear="yiZhuData.selfBuy = null">
             <el-option key="1" label="自备" value="1"></el-option>
@@ -211,7 +226,6 @@
       <button @click="toAddAnOrder">录入医嘱</button>
       <button @click="duplicateAndPaste">复制并粘贴</button>
       <button @click="openTheOrderPopUpWindow">打开医嘱弹窗</button>
-
     </div>
     <!--  报错信息  -->
     <bao-cun-xin-xi @clickError="clickError"
@@ -251,9 +265,15 @@ 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 {clone} from "@/utils/clone";
-import {queryParam, yzData} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+import {
+  queryParam,
+  yzData,
+  yiZhuData,
+  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";
+import {xcHotKey} from "@/utils/xckeydown";
 
 
 const props = defineProps({
@@ -265,53 +285,6 @@ const props = defineProps({
   openGroupOrderTemplate: Function
 })
 
-const yiZhuData = ref({
-  id: '',
-  actOrderNo: null,
-  orderName: '',
-  orderCode: '',
-  // 频率
-  frequCode: '',
-  frequCodeName: '',
-  drugSpecification: '',
-  dose: 0,
-  // 领量
-  doseUnit: '',
-  doseUnitName: '',
-  supplyCode: '',
-  supplyCodeName: '',
-  startTime: '',
-  endTime: '',
-  orderTime: '',
-  doctorName: '',
-  drugFlag: '',
-  execUnit: '',
-  execUnitName: '',
-  parentNo: '',
-  parentNoName: '',
-  physicianName: '',
-  discription: '',
-  instruction: null,
-  kfFlag: null,
-  selfBuy: null,
-  ybSelfFlag: '0',
-  ybSelfFlagBoolean: false,
-  emergencyFlag: '0',
-  drugQuan: 0,
-  miniUnitName: '',
-  serial: '',
-  miniUnit: '',
-  psFlag: false,
-  kjywFlag: 0,
-  yyfs: null,
-  ssqk: null,
-  yysj: null,
-  zkObj: '',
-  zkWardCode: '',
-  zkDeptCode: '',
-  statusFlag: '1'
-});
-
 let tableHeader = [
   {label: '编码', prop: 'orderCode'},
   {label: '名称', prop: 'orderName'},
@@ -333,7 +306,8 @@ let tableHeader = [
 const tiShiBiaoTi = ref([])
 
 // 搜索医嘱
-const xuanZhongFeiYong = async (row) => {
+const xuanZhongFeiYong = async (row, laiyuan = 1) => {
+
   if (row.serial === '0000' && row.groupNo === '0000') {
     props.openGroupOrderTemplate(row.orderCode)
     return
@@ -342,88 +316,94 @@ const xuanZhongFeiYong = async (row) => {
   if (yiZhuData.value.actOrderNo === 'tempOrderNo') {
     yiZhuData.value.actOrderNo = await getOrderNo()
   }
-  let tempOrderNo = yiZhuData.value.actOrderNo
+  let tempOrderNo = null
+
+  // 在使用 查询医嘱搜索的时候 row 是不会有 actOrderNo 的所以要保留一下
+  if (laiyuan === 1) {
+    tempOrderNo = yiZhuData.value.actOrderNo
+  }
   // 记得处置医嘱
-  fuYiZhuClick()
+  await fuYiZhuClick()
   qingKong()
   await Sleep(200)
   yiZhuData.value = row
-  yiZhuData.value.actOrderNo = tempOrderNo
+  if (tempOrderNo !== null) {
+    yiZhuData.value.actOrderNo = tempOrderNo;
+  }
   yiZhuData.value.statusFlag = '1'
 
-
-  if (row.serial !== '00') {
-    huoQuFeiYongXinXi(row.orderCode, row.serial, props.patientInfo.smallDept)
-        .then((res) => {
-          yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
-          // 判断是否 是皮试的药 如果是就只能有这些 给药方式
-          geiYaoFangShiData.value = res.piShi
-          // 是否是 抗菌药物
-          yiZhuData.value.kjywFlag = res.data.kjywFlag
-          // 提示信息
-          tiShiBiaoTi.value = res.prompt
-          // 最小单位名称
-          yiZhuData.value.miniUnit = res.data.miniUnit
-          yiZhuData.value.miniUnitName = res.data.miniUnitName
-          yiZhuData.value.drugVolume = res.data.volum
-          yiZhuData.value.drugVolUnit = res.data.volUnit
-          // 加载药品计量
-          yaoPinJiLiangData.value = res.yaoPingJiLiang
-          // 加载 剂量单位
-          if (stringNotBlank(yiZhuData.value.doseUnit)) {
-            yaoPinJiLiangData.value.forEach((item) => {
-              if (item.code === yiZhuData.value.doseUnit) {
-                jiLiangValue.value = item.value
-              }
-            })
-          } else if (listNotBlank(yaoPinJiLiangData.value)) {
-            // 没有剂量单位的时候默认加载第一个计量单位 并且计算
-            yiZhuData.value.doseUnit = yaoPinJiLiangData.value[0].code
-            yiZhuData.value.dose = yaoPinJiLiangData.value[0].value
-            jiLiangValue.value = yaoPinJiLiangData.value[0].value
-          }
-          jiSuanLingLiang(yiZhuData.value.dose)
-          // 加载默认频率 如果已经填写了 就用有的
-          if (stringIsBlank(row.frequCode)) {
-            if (stringNotBlank(res.data.frequCode)) {
-              yiZhuData.value.frequCode = res.data.frequCode
-              yiZhuData.value.frequCodeName = res.data.frequCodeName
-            } else {
-              yiZhuData.value.frequCode = 'ONCE'
-              yiZhuData.value.frequCodeName = '一次'
-            }
-          }
-          // 加载给药方式 如果已经有了就没事了
-          if (stringIsBlank(yiZhuData.value.supplyCode)) {
-            if (stringNotBlank(res.data.supplyCode)) {
-              yiZhuData.value.supplyCode = res.data.supplyCode
-              yiZhuData.value.supplyCodeName = res.data.supplyCodeName
-            }
+  if (row.serial === '01' || row.serial === '99') {
+    try {
+      let res = await huoQuFeiYongXinXi(row.orderCode, row.serial, props.patientInfo.smallDept)
+      yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
+      // 判断是否 是皮试的药 如果是就只能有这些 给药方式
+      geiYaoFangShiData.value = res.piShi
+      // 是否是 抗菌药物
+      yiZhuData.value.kjywFlag = res.data.kjywFlag
+      // 提示信息
+      tiShiBiaoTi.value = res.prompt
+      // 最小单位名称
+      yiZhuData.value.miniUnit = res.data.miniUnit
+      yiZhuData.value.miniUnitName = res.data.miniUnitName
+      yiZhuData.value.drugVolume = res.data.volum
+      yiZhuData.value.drugVolUnit = res.data.volUnit
+      // 加载药品计量
+      yaoPinJiLiangData.value = res.yaoPingJiLiang
+      // 加载 剂量单位
+      if (stringNotBlank(yiZhuData.value.doseUnit)) {
+        yaoPinJiLiangData.value.forEach((item) => {
+          if (item.code === yiZhuData.value.doseUnit) {
+            jiLiangValue.value = item.value
           }
-
-
-        })
-        .catch(async () => {
-          await Sleep(500)
-          qingKong()
         })
+      } else if (listNotBlank(yaoPinJiLiangData.value)) {
+        // 没有剂量单位的时候默认加载第一个计量单位 并且计算
+        yiZhuData.value.doseUnit = yaoPinJiLiangData.value[0].code
+        yiZhuData.value.dose = yaoPinJiLiangData.value[0].value
+        jiLiangValue.value = yaoPinJiLiangData.value[0].value
+      }
+      jiSuanLingLiang(yiZhuData.value.dose)
+      // 加载默认频率 如果已经填写了 就用有的
+      if (stringIsBlank(row.frequCode)) {
+        if (stringNotBlank(res.data.frequCode)) {
+          yiZhuData.value.frequCode = res.data.frequCode
+          yiZhuData.value.frequCodeName = res.data.frequCodeName
+        } else {
+          yiZhuData.value.frequCode = 'ONCE'
+          yiZhuData.value.frequCodeName = '一次'
+        }
+      }
+      // 加载给药方式 如果已经有了就没事了
+      if (stringIsBlank(yiZhuData.value.supplyCode)) {
+        if (stringNotBlank(res.data.supplyCode)) {
+          yiZhuData.value.supplyCode = res.data.supplyCode
+          yiZhuData.value.supplyCodeName = res.data.supplyCodeName
+        }
+      }
+    } catch (e) {
+      await Sleep(200)
+      qingKong()
+    }
+
   } else {
     yiZhuData.value.kjywFlag = 0
-    huoQuFeiYongXinXi(row.orderCode, '00', props.patientInfo.smallDept)
-        .then((res) => {
-          openTheOrderPopUpWindow('请输入处置医嘱名')
-          yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
-          if (stringNotBlank(res.prompt)) {
-            tiShiBiaoTi.value = res.prompt
-          }
-          if (!res.dose) {
-            yiZhuData.value.dose = 1
-          }
-        })
-        .catch(async () => {
-          await Sleep(500)
-          qingKong()
-        })
+    try {
+      let res = await huoQuFeiYongXinXi(row.orderCode, '00', props.patientInfo.smallDept)
+      openTheOrderPopUpWindow('请输入处置医嘱名')
+      yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
+      if (stringNotBlank(res.prompt)) {
+        tiShiBiaoTi.value = res.prompt
+      }
+      if (!res.dose) {
+        yiZhuData.value.dose = 1
+      }
+    } catch (e) {
+      await Sleep(200)
+      qingKong()
+    }
+  }
+  if (stringIsBlank(yiZhuData.value.actOrderNo)) {
+    return
   }
   // 判断这个是不是 新添加的数据 如果是空的就是 新数据
   let serverDate = await getServerDateApi()
@@ -452,20 +432,21 @@ const xuanZhongFeiYong = async (row) => {
   } catch (e) {
     console.log(e)
   }
-  for (let i = 0, len = yzData.value.length; i < len; i++) {
-    let item = yzData.value[i]
-    if (yiZhuData.value.actOrderNo === item.actOrderNo) {
-      delete yzData.value[i]
-      break
-    }
-  }
   if (queryParam.frequCode === 1) {
     yiZhuData.value.frequCode = 'ONCE'
     yiZhuData.value.frequCodeName = '一次'
   }
-  yzData.value.push(yiZhuData.value)
+  // 如果搜索了医嘱那么 这里就需要 重新赋值,不认表格就没办法变化了,把原来的换掉
+  for (let i = 0, len = yzData.value.length; i < len; i++) {
+    let item = yzData.value[i]
+    if (yiZhuData.value.actOrderNo == item.actOrderNo) {
+      yzData.value[i] = yiZhuData.value
+      return
+    }
+  }
 }
 
+
 /* 频率 */
 const pingLv = ref()
 const yaoPinPingLvData = ref([])
@@ -557,8 +538,15 @@ const addOrderNo = async () => {
       data: yiZhuData.value
     }
     try {
-      await enterOrders(param)
+      let res = await enterOrders(param)
+      // 如果有错误信息 就 提示
+      if (res !== null && res.error) {
+        baoCunXinXiRef.value.openOrClose()
+        errorMessageData.value = res.data
+        return
+      }
       props.successfullyEntered(yiZhuData.value)
+      // 医嘱保存超过了 就删除错误提示
       if (errorMessageData.value) {
         for (let key in errorMessageData.value) {
           if (key === yiZhuData.value.actOrderNo.toString()) {
@@ -567,19 +555,20 @@ const addOrderNo = async () => {
           }
         }
       }
+      // 如果没有了错误信息 就关闭
       if (!!errorMessageData.value) {
         baoCunXinXiRef.value.openOrClose(false)
       }
       qingKong()
       yiZhuData.value.actOrderNo = 'tempOrderNo'
+      openSearch()
     } catch (e) {
-      if (e === null) return
-      baoCunXinXiRef.value.openOrClose()
-      errorMessageData.value = e
+      console.log(e)
     }
   } else {
     qingKong()
     yiZhuData.value.actOrderNo = 'tempOrderNo'
+    openSearch()
   }
 
 
@@ -648,12 +637,14 @@ const isEdit = computed(() => {
 
 let baoCunXinXiRef = ref(null)
 const toAddAnOrder = async () => {
-  if (stringIsBlank(yiZhuData.value.actOrderNo)) {
-    return
-  }
   if (stringIsBlank(props.patientInfo.inpatientNo)) {
     BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
   }
+
+  if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === 'tempOrderNo') {
+    BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择一个医嘱')
+  }
+  // 有 医嘱 不是 录入就说明在看医嘱 直接清空就可以了
   if (stringNotBlank(yiZhuData.value.orderCode) && yiZhuData.value.statusFlag !== '1') {
     qingKong()
     return
@@ -665,7 +656,14 @@ const toAddAnOrder = async () => {
     data: yiZhuData.value
   }
   try {
-    await enterOrders(param)
+    let res = await enterOrders(param)
+
+    if (res !== null && res.error) {
+      baoCunXinXiRef.value.openOrClose()
+      errorMessageData.value = res.data
+      return
+    }
+
     props.successfullyEntered(yiZhuData.value)
     if (errorMessageData.value) {
       for (let key in errorMessageData.value) {
@@ -680,9 +678,7 @@ const toAddAnOrder = async () => {
     }
     qingKong()
   } catch (e) {
-    if (e === null) return
-    baoCunXinXiRef.value.openOrClose()
-    errorMessageData.value = e
+    console.log(e)
   }
 }
 
@@ -691,11 +687,10 @@ const toAddAnOrder = async () => {
  */
 const confirmOrdersClick = () => {
   confirmOrders(props.patientInfo).then((res) => {
-
-  }).catch(e => {
-    if (e === null) return
-    baoCunXinXiRef.value.openOrClose()
-    errorMessageData.value = e
+    if (res !== null && res.error) {
+      baoCunXinXiRef.value.openOrClose()
+      errorMessageData.value = res.data
+    }
   })
 }
 
@@ -721,14 +716,16 @@ const clickError = (val) => {
       data: yiZhuData.value
     }
     enterOrders(param).then((res) => {
+      if (res !== null && res.error) {
+        errorMessageData.value[yiZhuData.value.actOrderNo] = res.data[yiZhuData.value.actOrderNo]
+        return
+      }
       delete errorMessageData.value[yiZhuData.value.actOrderNo]
-      yiZhuData.value = val.data
+      xuanZhongFeiYong(val.data, 2)
     }).catch(e => {
-      if (e === null) return
-      errorMessageData.value[yiZhuData.value.actOrderNo] = e[yiZhuData.value.actOrderNo]
     })
   } else {
-    yiZhuData.value = val.data
+    xuanZhongFeiYong(val.data, 2)
   }
 }
 
@@ -739,8 +736,8 @@ const clickError = (val) => {
 let tempData = null
 const fillData = async (data) => {
   await fuYiZhuClick()
-  yiZhuData.value = data
-  yiZhuData.value.miniUnitName = data.drugQuanName
+  await xuanZhongFeiYong(data, 2)
+  // yiZhuData.value = data
   tempData = JSON.stringify(yiZhuData.value)
 }
 
@@ -767,7 +764,8 @@ const duplicateAndPaste = async () => {
   temp.modifierName = ''
   temp.modifier = ''
 
-  yiZhuData.value = temp
+  await xuanZhongFeiYong(temp)
+  // yiZhuData.value = temp
   await toAddAnOrder()
 }
 
@@ -789,6 +787,57 @@ const toDeleteAnOrderClick = () => {
 
 }
 
+const editorMainRef = ref()
+
+const parentNoRef = ref(null)
+const kfFlagRef = ref(null)
+const selfBuyRef = ref(null)
+const searchRef = ref(null)
+const elSelectFocus = (val) => {
+  val.toggleMenu()
+}
+const elSelectBlur = (val) => {
+  val.blur()
+}
+
+const openSearch = () => {
+  if (isEdit.value) return
+  searchRef.value.focus()
+}
+
+let shortcutKeyRegistration = {
+  ctrl: {s: toAddAnOrder, f: openSearch},
+  alt: {a: addOrderNo}
+}
+
+onActivated(() => {
+  xcHotKey(shortcutKeyRegistration)
+})
+
+onMounted(async () => {
+  await nextTick();
+  let inputs = editorMainRef.value.querySelectorAll('input')
+
+  for (let i = 1, len = inputs.length - 2; i < len; i++) {
+    let item = inputs[i]
+    item.addEventListener('keydown', async function (event) {
+      if (event.keyCode === 13) {
+        let tempIndex = 1
+        if (inputs[i + 1].disabled) {
+          tempIndex++
+        }
+        await Sleep(300)
+        if (i === len - 1) {
+          await toAddAnOrder()
+        }
+        item.blur()
+        inputs[i + tempIndex].focus()
+      }
+    })
+  }
+})
+
+
 defineExpose({
   addOrderNo,
   fillData,
@@ -805,11 +854,16 @@ defineExpose({
 
   .editing_area {
     position: relative;
-    width: max-content;
+    width: 90%;
   }
 
   .ribbon {
     flex: 1;
+
+    button {
+      display: block;
+      margin-top: 10px;
+    }
   }
 
   .yz_editor__disable {

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

@@ -31,6 +31,7 @@
 
     <button style="margin-left: 5px" @click="props.addYiZhuClick">添加医嘱</button>
     <button style="margin-left: 5px" @click="props.toDeleteAnOrder">删除医嘱</button>
+    <button style="margin-left: 5px" @click="batchDeleteOrdersClick">批量删除医嘱</button>
     <button style="margin-left: 5px" @click="currentConfirmOrdersClick">确认医嘱</button>
     <button style="margin-left: 5px" @click="props.clickOnTheOrderTemplate">医嘱模板</button>
 
@@ -40,19 +41,26 @@
       <status-color color="#ff07f3" label="Z:执行"/>
       <status-color color="red" label="T:停止"/>
 
-      <span style="color: red">
-        修改数据后请点击,录入医嘱按钮,否则会导致数据丢失
-      </span>
+      <!--      <span style="color: red">-->
+      <!--        修改数据后请点击,录入医嘱按钮,否则会导致数据丢失-->
+      <!--      </span>-->
     </div>
   </div>
 
 </template>
 
 <script setup name='YzQueryCondition'>
-import {huoQuYiZhuShuJu} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import {deleteMultipleOrders, huoQuYiZhuShuJu} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import StatusColor from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-header/StatusColor";
-import {queryParam, yzData} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+import {
+  errorMsg,
+  queryParam,
+  selectedData,
+  yzData,
+  yzDataKeyAndIndex
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
+import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2";
 
 const props = defineProps({
   patientInfo: {
@@ -98,8 +106,40 @@ const currentConfirmOrdersClick = () => {
   })
 }
 
+/**
+ * 点击批量删除数据
+ */
+const batchDeleteOrdersClick = () => {
+  if (selectedData.value.length === 0) {
+    BizException(ExceptionEnum.LOGICAL_ERROR, "请先选择要删除的数据");
+  }
+  let param = {
+    inpatientNo: props.patientInfo.inpatientNo,
+    admissTimes: props.patientInfo.admissTimes,
+    list: selectedData.value
+  }
+  deleteMultipleOrders(param).then((res) => {
+    if (res !== null && res.error) {
+      let errData = []
+      for (const key in res.data) {
+        let index = yzDataKeyAndIndex.value[key]
+        let tempYzData = yzData.value[index]
+        yzData.value[index].error = true
+        errData.push({
+          actOrderNo: key,
+          orderName: tempYzData.orderName,
+          errorMessage: res.data[key]
+        })
+      }
+      errorMsg.value.dialog = true
+      errorMsg.value.type = 2
+      errorMsg.value.data = errData
+    } else {
+      queryYz();
+    }
+  })
+}
 
-const disable = ref(true)
 watch(() => props.patientInfo, () => {
   queryYz()
 })

+ 4 - 1
src/utils/request.js

@@ -116,7 +116,10 @@ service.interceptors.response.use(
                 showClose: true,
                 grouping: true,
             })
-            return Promise.reject(response.data.data)
+            return {
+                error: true,
+                data: response.data.data
+            }
         } else if (response.data.code === 6002) {
             ElMessageBox.alert(response.data.message, '提示', {
                 type: 'error',

+ 4 - 1
src/views/hospitalization/case-front-sheet/JieShouHuiZhen.vue

@@ -44,7 +44,10 @@
           ></el-pagination>
         </el-aside>
         <el-main>
-          <DaYingHuiZhen ref="daYingHuiZhenRef" @fanHuiXinXi="huiZhenFanHuiXinXi"></DaYingHuiZhen>
+          <div style="overflow: auto;" :style="{height: windowSize.h - 30 + 'px'}">
+            <DaYingHuiZhen ref="daYingHuiZhenRef" @fanHuiXinXi="huiZhenFanHuiXinXi"></DaYingHuiZhen>
+          </div>
+
         </el-main>
       </el-container>
     </template>

+ 53 - 39
src/views/hospitalization/zhu-yuan-yi-sheng/HuiZhenShenQing.vue

@@ -5,45 +5,59 @@
       <el-button icon="Plus" type="success" @click="dianJiHuiZhenShenQing">会诊申请</el-button>
     </el-header>
     <el-main>
-      <xc-table :data="chaKanHuiZhenList" local-paging :height="215">
-        <el-table-column label="住院号" prop="inpatientNo" width="90"></el-table-column>
-        <el-table-column label="住院次数" prop="admissTimes" width="70"></el-table-column>
-        <el-table-column label="申请人" prop="inputName" width="60"></el-table-column>
-        <el-table-column label="申请时间" prop="inputDate" width="70"></el-table-column>
-        <el-table-column label="申请次数" prop="reqTimes"></el-table-column>
-        <el-table-column label="科室" prop="deptName"></el-table-column>
-        <el-table-column label="申请会诊科室" prop="reqDeptName"></el-table-column>
-        <el-table-column label="会诊类别" prop="hzLevelName"></el-table-column>
-        <el-table-column label="会诊医生" prop="hzDoctor1Name"></el-table-column>
-        <el-table-column label="会诊级别" prop="hzType">
-          <template #default="scope">
-            <span>{{ hzTypeName(scope.row.hzType) }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="接受会诊日期" prop="hzDate" show-overflow-tooltip></el-table-column>
-        <el-table-column label="接受会诊医生" prop="hzDoctor2Name"></el-table-column>
-        <el-table-column label="接受会诊意见" prop="hzComment" show-overflow-tooltip></el-table-column>
-        <el-table-column fixed="right" label="操作" width="150">
-          <template #default="scope">
-            <el-popconfirm
-                cancel-button-text="取消"
-                confirm-button-text="确定"
-                icon="InfoFilled"
-                icon-color="red"
-                title="确定要删除吗?"
-                @confirm="shanChuHuiZhenShenQingClick(scope.$index, scope.row)"
-            >
-              <template #reference>
-                <el-button :disabled="scope.row.statusFlag === '2'" title="删除" circle icon="Delete"
-                           type="danger"></el-button>
+      <div style="display: flex;overflow: auto;width: 100%">
+        <div style="flex: 1">
+          <xc-table :data="chaKanHuiZhenList"
+                    local-paging
+                    :height="300" @rowClick="chaKanHuiZhenDan"
+                    layout='total, prev,  next'
+          >
+
+            <el-table-column label="申请时间" prop="inputDate" width="70">
+              <template #default="scope">
+                {{ scope.row.inputDate + '_' + scope.row.reqTimes }}
+              </template>
+            </el-table-column>
+            <el-table-column label="科室" prop="deptName"></el-table-column>
+            <el-table-column label="接受日期" prop="hzDate" show-overflow-tooltip></el-table-column>
+            <el-table-column label="接受医生" prop="hzDoctor2Name"></el-table-column>
+            <el-table-column label="申请人" prop="inputName" width="60"></el-table-column>
+            <el-table-column label="申请科室" prop="reqDeptName"></el-table-column>
+            <el-table-column label="类别" prop="hzLevelName"></el-table-column>
+            <el-table-column label="医生" prop="hzDoctor1Name"></el-table-column>
+            <el-table-column label="级别" prop="hzType">
+              <template #default="scope">
+                <span>{{ hzTypeName(scope.row.hzType) }}</span>
               </template>
-            </el-popconfirm>
-            <el-button circle icon="View" @click="chaKanHuiZhenDan(scope.row)" title="查看"></el-button>
-            <el-button circle class="iconfont icon-dayin" @click="dianJiDaYingHuiZhen(scope.row)"
-                       title="打印"></el-button>
-          </template>
-        </el-table-column>
-      </xc-table>
+            </el-table-column>
+            <el-table-column label="接受意见" prop="hzComment" show-overflow-tooltip></el-table-column>
+            <el-table-column fixed="left" label="操作" width="50">
+              <template #default="scope">
+                <el-popconfirm
+                    cancel-button-text="取消"
+                    confirm-button-text="确定"
+                    icon="InfoFilled"
+                    icon-color="red"
+                    title="确定要删除吗?"
+                    @confirm="shanChuHuiZhenShenQingClick(scope.$index, scope.row)"
+                >
+                  <template #reference>
+                    <el-button :disabled="scope.row.statusFlag === '2'"
+                               title="删除"
+                               circle
+                               @click.stop.prevent
+                               icon="Delete"
+                               type="danger"/>
+                  </template>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </xc-table>
+        </div>
+        <div style="width: 900px;height: 500px;overflow: initial">
+          <da-ying-hui-zhen ref="daYingHuiZhenRef" :lai-yuan="2"></da-ying-hui-zhen>
+        </div>
+      </div>
     </el-main>
     <el-dialog v-model="huiZhenXiangQingDuiHua" title="会诊详情" width="920px">
       <da-ying-hui-zhen ref="daYingHuiZhenRef" :lai-yuan="2"></da-ying-hui-zhen>
@@ -103,7 +117,7 @@ const daYingHuiZhenRef = ref(null)
 
 const chaKanHuiZhenDan = (val) => {
   getHuanZheXinXi(val.admissTimes, val.reqTimes, val.inpatientNo).then((res) => {
-    huiZhenXiangQingDuiHua.value = true
+    // huiZhenXiangQingDuiHua.value = true
     setTimeout(() => {
       daYingHuiZhenRef.value.huiZhenXinXiXiangQing(res)
     }, 100)

+ 62 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.js

@@ -66,12 +66,62 @@ export const queryParam = ref({
     times: 0,
 });
 
+export const yiZhuData = ref({
+    id: '',
+    actOrderNo: null,
+    orderName: '',
+    orderCode: '',
+    // 频率
+    frequCode: '',
+    frequCodeName: '',
+    drugSpecification: '',
+    dose: 0,
+    // 领量
+    doseUnit: '',
+    doseUnitName: '',
+    supplyCode: '',
+    supplyCodeName: '',
+    startTime: '',
+    endTime: '',
+    orderTime: '',
+    doctorName: '',
+    drugFlag: '',
+    execUnit: '',
+    execUnitName: '',
+    parentNo: '',
+    parentNoName: '',
+    physicianName: '',
+    discription: '',
+    instruction: null,
+    kfFlag: null,
+    selfBuy: null,
+    ybSelfFlag: '0',
+    ybSelfFlagBoolean: false,
+    emergencyFlag: '0',
+    drugQuan: 0,
+    miniUnitName: '',
+    serial: '',
+    miniUnit: '',
+    psFlag: false,
+    kjywFlag: 0,
+    yyfs: null,
+    ssqk: null,
+    yysj: null,
+    zkObj: '',
+    zkWardCode: '',
+    zkDeptCode: '',
+    statusFlag: '1'
+});
 
 // 保存医嘱数据
 export const yzData = ref([])
 // 查询数据
 export const tempYzData = computed(() => {
-    return yzData.value.filter((item) => {
+    selectedData.value = []
+    return yzData.value.filter((item, index) => {
+        yzDataKeyAndIndex.value[item.actOrderNo] = index
+
+        item.tempCheckbox = false
         let flag = queryParam.value.displayRange === 0
         let frequFlag = queryParam.value.frequCode === 0
         let zhuangTai = queryParam.value.zhuangTai == 0
@@ -102,4 +152,15 @@ export const tempYzData = computed(() => {
     })
 })
 
+// 医嘱选中的数据
+export const selectedData = ref([])
+// 医嘱号和下标
+export const yzDataKeyAndIndex = ref({})
+export const errorMsg = ref({
+    dialog: false,
+    type: 1,
+    data: {}
+})
+
+