فهرست منبع

医嘱模板的维护界面

xiaochan 3 ماه پیش
والد
کامیت
6c1fab58b0

+ 118 - 0
src/api/orderZdMaintain/index.ts

@@ -0,0 +1,118 @@
+import requestV2 from "@/utils/request-v2";
+
+export interface ZdChargeItemDto {
+  code: string;
+  execUnit: string;
+  name: string;
+  price: number | null; // Using number | null to accommodate potential null values (Double in Java)
+  billItemCode: string;
+  pyCode: string;
+  dCode: string;
+  suppressFlag: string;
+  billItemOut: string;
+  nCode: string;
+  selfFlag: string;
+  separateFlag: string;
+  eCode: string;
+  spec: string; // Map from charge_unit
+  execDeptName: string;
+  serial: string;
+  groupNo: string;
+}
+
+export interface YzOrderItemDTO {
+  orderClass: string;
+  orderClassName: string;
+  orderCode: string;
+  orderName: string;
+  pyCode: string;
+  dCode: string;
+  excluGroupType: string;
+  delFlag: string;
+  discription: string;
+  operation: string;
+  oweOcc: string;
+  dlCode: string;
+  xlCode: string;
+  ybComment: string;
+  hlClass: string;
+  comment1: string;
+  discription1: string;
+  nCode: string;
+  newFlag: string;
+  orderType: string;
+  ypFlag: string;
+  jyType: string;
+  orderTypeName: string;
+  jyTypeName: string;
+  ssType: string;
+  frequType: string;
+  execDept: string;
+  execDeptName: string;
+  qjFlag: string;
+}
+
+export function getChangeItemType() {
+  return requestV2({
+    url: "/orderZdMaintain/getChangeItemType",
+    method: "get",
+  });
+}
+
+export function getSsType() {
+  return requestV2({
+    url: "/orderZdMaintain/getSsType",
+    method: "get",
+  });
+}
+
+export function getOrderItem(flag: string) {
+  return requestV2<YzOrderItemDTO[]>({
+    url: "/orderZdMaintain/getOrderItem",
+    method: "get",
+    showLoading: false,
+    params: { flag },
+  });
+}
+
+export function getChangeItem(orderCode: string) {
+  return requestV2({
+    url: "/orderZdMaintain/getChangeItem",
+    method: "get",
+    showLoading: false,
+    params: { orderCode },
+  });
+}
+
+export function searchChangeItem(code: string) {
+  return requestV2({
+    url: "/orderZdMaintain/searchChangeItem",
+    method: "get",
+    showLoading: false,
+    params: { code },
+  });
+}
+
+export function saveItem(data: any) {
+  return requestV2({
+    url: "/orderZdMaintain/saveItem",
+    method: "post",
+    data: data,
+  });
+}
+
+export function setDelFlag(data: any) {
+  return requestV2({
+    url: "/orderZdMaintain/setDelFlag",
+    method: "post",
+    data: data,
+  });
+}
+
+export function saveOrderOccurence(data) {
+  return requestV2({
+    url: "/orderZdMaintain/saveOrderOccurence",
+    method: "post",
+    data: data,
+  });
+}

+ 20 - 16
src/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru.ts

@@ -313,29 +313,33 @@ export function copyTableOrder(data) {
   });
 }
 
-interface SiLimitRequest {
-  patNo: string; // 对应 Java 中的 String
-  times: number | null; // 对应 Java 中的 Integer,允许为 null
-  ledgerSn: number | null; // 对应 Java 中的 Integer,允许为 null
-  chargeList: string[]; // 对应 Java 中的 List<String>
-  currentCode: string; // 对应 Java 中的 String
-  sn: number | null; // 对应 Java 中的 Integer,允许为 null
-  oriSn: number | null; // 对应 Java 中的 Integer,允许为 null
+export function confirmYzCheck(patNo, times, ledgerSn) {
+  return requestV2({
+    url: url + "/confirmYzCheck",
+    method: "get",
+    showLoading: false,
+    params: { patNo, times, ledgerSn },
+  });
 }
 
-export function analyzeSiChargeLimit(data: SiLimitRequest) {
+export function getExceedingDischargeDays() {
   return requestV2({
-    url: url + "/analyzeSiChargeLimit",
-    method: "post",
-    data,
+    url: url + "/getExceedingDischargeDays",
+    method: "get",
   });
 }
 
-export function confirmYzCheck(patNo, times, ledgerSn) {
+export function getOrderCodeByName(name: string) {
   return requestV2({
-    url: url + "/confirmYzCheck",
+    url: url + "/getOrderCodeByName",
+    method: "get",
+    params: { name },
+  });
+}
+
+export function getYzZdOrderItemConfirm() {
+  return requestV2({
+    url: url + "/getYzZdOrderItemConfirm",
     method: "get",
-    showLoading: false,
-    params: { patNo, times, ledgerSn },
   });
 }

+ 2 - 2
src/components/cy/CyDialog/index.ts

@@ -17,9 +17,9 @@ export type CloseValue = "close" | "confirm" | "cancel";
 
 export interface DialogExpose {
   // 如果报错了会阻止关闭弹窗
-  confirm: () => any | Promise<any>;
+  confirm?: () => any | Promise<any>;
   // 如果报错了会阻止关闭弹窗
-  cancel: () => any | Promise<any>;
+  cancel?: () => any | Promise<any>;
 }
 
 export namespace UseDialogType {

+ 219 - 171
src/components/cy/combo-grid/src/CyComboGrid.vue

@@ -1,27 +1,27 @@
 <script setup lang="ts">
 import UesComboGrid from "./index";
-import '../style/index.scss'
-import {VxeTable} from "vxe-table";
-import {CaretBottom, CircleClose} from "@element-plus/icons-vue";
-import XEUtils, {isArray} from "xe-utils";
-import {ElTag} from "element-plus";
+import "../style/index.scss";
+import { VxeTable } from "vxe-table";
+import { CaretBottom, CircleClose } from "@element-plus/icons-vue";
+import XEUtils, { isArray } from "xe-utils";
+import { ElTag } from "element-plus";
 import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
-import {useResizeObserver} from "@vueuse/core";
+import { useResizeObserver } from "@vueuse/core";
 
-const props = defineProps({...CyComboGridProps})
+const props = defineProps({ ...CyComboGridProps });
 
 const emits = defineEmits<{
-  (e: "update:modelValue", value: any): void,
-  (e: 'focus', value: any): void,
-  (e: 'blur', value: any): void,
-  (e: 'update:data', value: any): void,
-  (e: 'visible-change', value: boolean): void,
-  (e: 'rowClick', value: any): void,
-  (e: 'clear'): void,
-  (e: 'focus'): void,
+  (e: "update:modelValue", value: any): void;
+  (e: "focus", value: any): void;
+  (e: "blur", value: any): void;
+  (e: "update:data", value: any): void;
+  (e: "visible-change", value: boolean): void;
+  (e: "rowClick", value: any): void;
+  (e: "clear"): void;
+  (e: "focus"): void;
 
-  (e: 'change', value: any): void;
-}>()
+  (e: "change", value: any): void;
+}>();
 
 const {
   nsSelect,
@@ -65,168 +65,171 @@ const {
   handleEsc,
   selectOption,
   deletePrevTag,
-  rowClass
+  rowClass,
 } = UesComboGrid(<any>props, emits);
 
 const prefabricationOptionsComp = computed(() => {
-  return XEUtils.clone(props.prefabricationOptions, true)
-})
+  return XEUtils.clone(props.prefabricationOptions, true);
+});
 
-const gridRefMain = ref<HTMLDivElement | null>(null)
+const gridRefMain = ref<HTMLDivElement | null>(null);
 
 // @ts-ignore
 useResizeObserver(gridRefMain, (entries, observer) => {
-  tooltipRef.value!.popperRef.contentRef.style.minWidth = 'max-content'
-  tooltipRef.value!.popperRef.contentRef.style.width = gridRefMain.value!.getBoundingClientRect().width + 'px'
-})
+  tooltipRef.value!.popperRef.contentRef.style.minWidth = "max-content";
+  tooltipRef.value!.popperRef.contentRef.style.width =
+    gridRefMain.value!.getBoundingClientRect().width + "px";
+});
 
 function modelValueIsArr(length: number = 0): boolean {
-  return isArray(props.modelValue) && props.modelValue.length > length
+  return isArray(props.modelValue) && props.modelValue.length > length;
 }
 
 defineExpose({
   focus: () => {
-    inputRef.value?.focus()
-  }
-})
+    inputRef.value?.focus();
+  },
+});
 </script>
 
 <template>
-  <div :class="[nsSelect.b()]"
-       ref="gridRefMain"
-       class="cy-combo-grid--small"
-       v-click-outside:[popperRef]="handleClickOutside"
-       @mouseenter="states.inputHovering = true"
-       @mouseleave="states.inputHovering = false"
-       @click.stop="toggleMenu"
+  <div
+    :class="[nsSelect.b()]"
+    ref="gridRefMain"
+    class="cy-combo-grid--small"
+    v-click-outside:[popperRef]="handleClickOutside"
+    @mouseenter="states.inputHovering = true"
+    @mouseleave="states.inputHovering = false"
+    @click.stop="toggleMenu"
   >
     <el-tooltip
-        ref="tooltipRef"
-        :placement="placement"
-        :teleported="teleported"
-        :fallback-placements="fallbackPlacements"
-        :effect="effect"
-        trigger="click"
-        transition="el-zoom-in-top"
-        :visible="dropdownMenuVisible"
-        :stop-popper-mouse-event="false"
-        :gpu-acceleration="false"
-        :persistent="true"
+      ref="tooltipRef"
+      :placement="placement"
+      :teleported="teleported"
+      :fallback-placements="fallbackPlacements"
+      :effect="effect"
+      trigger="click"
+      transition="el-zoom-in-top"
+      :visible="dropdownMenuVisible"
+      :stop-popper-mouse-event="false"
+      :gpu-acceleration="false"
+      :persistent="true"
     >
       <template #default>
         <div
-            ref="wrapperRef"
-            :class="[
-              nsSelect.e('wrapper'),
-              nsSelect.is('focused',isFocused),
-              nsSelect.is('filterable', true),
-              nsSelect.is('padding2' , wrapperHeightGoBeyond),
-              nsSelect.is('disabled', selectDisabled),
-        ]"
+          ref="wrapperRef"
+          :class="[
+            nsSelect.e('wrapper'),
+            nsSelect.is('focused', isFocused),
+            nsSelect.is('filterable', true),
+            nsSelect.is('padding2', wrapperHeightGoBeyond),
+            nsSelect.is('disabled', selectDisabled),
+          ]"
         >
           <div
-              ref="selectionRef"
-              :class="[
-                  nsSelect.e('selection') ,
-                  nsSelect.is(
-                      'near' ,
-                      multiple && modelValueIsArr()
-                  )
-              ]"
+            ref="selectionRef"
+            :class="[
+              nsSelect.e('selection'),
+              nsSelect.is('near', multiple && modelValueIsArr()),
+            ]"
           >
             <div
-                v-if="multiple"
-                v-for="(item,index) in showTagList"
-                :key="item.value"
-                :class="nsSelect.e('selected-item')"
+              v-if="multiple"
+              v-for="(item, index) in showTagList"
+              :key="item.value"
+              :class="nsSelect.e('selected-item')"
             >
               <el-tag
-                  closable
-                  size="small"
-                  type="info"
-                  disable-transitions
-                  @close.stop="deleteTag(item,index)"
+                closable
+                size="small"
+                type="info"
+                disable-transitions
+                @close.stop="deleteTag(item, index)"
               >
-                <span :class="nsSelect.e('tags-text')"
-                      :style="tagStyle"
-                >
+                <span :class="nsSelect.e('tags-text')" :style="tagStyle">
                   {{ item.label }}
                 </span>
               </el-tag>
             </div>
 
             <div
-                ref="collapseItemRef"
-                v-if="collapseTags && modelValueIsArr( 1)"
-                :class="nsSelect.e('selected-item')"
+              ref="collapseItemRef"
+              v-if="collapseTags && modelValueIsArr(1)"
+              :class="nsSelect.e('selected-item')"
             >
-              <el-tag size="small"
-                      type="info"
-                      :style="collapseTagStyle"
-                      disable-transitions>
+              <el-tag
+                size="small"
+                type="info"
+                :style="collapseTagStyle"
+                disable-transitions
+              >
                 <span :class="nsSelect.e('tags-text')">
                   + {{ (modelValue as []).length - 1 }}
                 </span>
               </el-tag>
             </div>
             <div
-                :class="[
+              :class="[
                 nsSelect.e('selected-item'),
                 nsSelect.e('input-wrapper'),
               ]"
             >
-              <input :class="nsSelect.e('input')"
-                     ref="inputRef"
-                     type="text"
-                     :disabled="selectDisabled"
-                     :id="inputId"
-                     autocomplete="off"
-                     :style="inputStyle"
-                     v-model="states.inputValue"
-                     @compositionstart="handleCompositionStart"
-                     @compositionupdate="handleCompositionUpdate"
-                     @compositionend="handleCompositionEnd"
-                     @blur="handleBlur"
-                     @focus="handleFocus"
-                     @input="onInput"
-                     @click.stop="toggleMenu"
-                     @keydown.down.stop.prevent="navigateOptions('next')"
-                     @keydown.up.stop.prevent="navigateOptions('prev')"
-                     @keydown.esc="handleEsc"
-                     @keydown.enter.stop.prevent="selectOption"
-                     @keydown.delete.stop="deletePrevTag"
+              <input
+                :class="nsSelect.e('input')"
+                ref="inputRef"
+                type="text"
+                :disabled="selectDisabled"
+                :id="inputId"
+                autocomplete="off"
+                :style="inputStyle"
+                v-model="states.inputValue"
+                @compositionstart="handleCompositionStart"
+                @compositionupdate="handleCompositionUpdate"
+                @compositionend="handleCompositionEnd"
+                @blur="handleBlur"
+                @focus="handleFocus"
+                @input="onInput"
+                @click.stop="toggleMenu"
+                @keydown.down.stop.prevent="navigateOptions('next')"
+                @keydown.up.stop.prevent="navigateOptions('prev')"
+                @keydown.esc="handleEsc"
+                @keydown.enter.stop.prevent="selectOption"
+                @keydown.delete.stop="deletePrevTag"
               />
               <span
-                  ref="calculatorRef"
-                  aria-hidden="true"
-                  :class="nsSelect.e('input-calculator')"
-                  v-text="states.inputValue"
+                ref="calculatorRef"
+                aria-hidden="true"
+                :class="nsSelect.e('input-calculator')"
+                v-text="states.inputValue"
               />
             </div>
             <div
-                v-if="shouldShowPlaceholder"
-                :class="[
-                  nsSelect.e('selected-item'),
-                  nsSelect.e('placeholder'),
-                  nsSelect.is('transparent',isTransparent)
-                ]"
+              v-if="shouldShowPlaceholder"
+              :class="[
+                nsSelect.e('selected-item'),
+                nsSelect.e('placeholder'),
+                nsSelect.is('transparent', isTransparent),
+              ]"
             >
               <span>{{ currentPlaceholder }}</span>
             </div>
           </div>
-          <div
-              :class="[nsSelect.e('suffix')]"
-          >
-            <el-icon v-if="showClear"
-                     style="cursor: pointer"
-                     @click.stop="handleClearClick">
-              <CircleClose/>
+          <div :class="[nsSelect.e('suffix')]">
+            <el-icon
+              v-if="showClear"
+              style="cursor: pointer"
+              @click.stop="handleClearClick"
+            >
+              <CircleClose />
             </el-icon>
             <el-icon
-                v-else
-                :class="[nsSelect.e('caret'),nsSelect.is('reverse' , iconReverse)]"
+              v-else
+              :class="[
+                nsSelect.e('caret'),
+                nsSelect.is('reverse', iconReverse),
+              ]"
             >
-              <CaretBottom/>
+              <CaretBottom />
             </el-icon>
           </div>
         </div>
@@ -235,64 +238,96 @@ defineExpose({
       <template #content>
         <div :class="nsSelect.e('table_content')">
           <div v-if="props.prefabricationOptions">
-            <vxe-table :data="prefabricationOptionsComp"
-                       show-overflow-tooltip
-                       show-overflow
-                       @cell-click="handleTableClick"
-                       :columnConfig="{ resizable: true}"
-                       :row-config="{ height: rowHeight, isCurrent: true,isHover:true, useKey: true,keyField: 'value' }"
-                       :scroll-y="{enabled: true}"
-                       max-height="250px">
-              <vxe-column field="value" title="编码" :width="rightTableValueWidth"/>
-              <vxe-column field="label" title="名称" :width="rightTableLabelWidth"/>
+            <vxe-table
+              :data="prefabricationOptionsComp"
+              show-overflow-tooltip
+              show-overflow
+              @cell-click="handleTableClick"
+              :columnConfig="{ resizable: true }"
+              :row-config="{
+                height: rowHeight,
+                isCurrent: true,
+                isHover: true,
+                useKey: true,
+                keyField: 'value',
+              }"
+              :scroll-y="{ enabled: true }"
+              max-height="250px"
+            >
+              <vxe-column
+                field="value"
+                title="编码"
+                :width="rightTableValueWidth"
+              />
+              <vxe-column
+                field="label"
+                title="名称"
+                :width="rightTableLabelWidth"
+              />
             </vxe-table>
           </div>
           <!--     主要的table     -->
-          <div :style="{width: XEUtils.addUnit(props.tableWidth) }">
-            <vxe-table :class="nsSelect.e('table')"
-                       ref="tableRef"
-                       :data="tableData"
-                       @cell-click="handleTableClick"
-                       show-overflow-tooltip
-                       show-overflow
-                       :row-class-name="rowClass"
-                       :showHeader="showTableHeader"
-                       max-height="250px"
-                       :columnConfig="{ resizable: true}"
-                       :row-config="{ height: rowHeight, isCurrent: true,isHover:true, useKey: true,keyField: keyField }"
-                       :scroll-y="{enabled: true}"
-                       :loading="props.loading"
+          <div :style="{ width: XEUtils.addUnit(props.tableWidth) }">
+            <vxe-table
+              :class="nsSelect.e('table')"
+              ref="tableRef"
+              :data="tableData"
+              @cell-click="handleTableClick"
+              show-overflow-tooltip
+              show-overflow
+              :row-class-name="rowClass"
+              :showHeader="showTableHeader"
+              max-height="250px"
+              :columnConfig="{ resizable: true }"
+              :row-config="{
+                height: rowHeight,
+                isCurrent: true,
+                isHover: true,
+                useKey: true,
+                keyField: keyField,
+              }"
+              :scroll-y="{ enabled: true }"
+              :loading="props.loading"
             >
-              <slot v-if="$slots.default"/>
+              <slot v-if="$slots.default" />
               <vxe-column
-                  v-for="item in tableHeader"
-                  :key="item"
-                  :title="item.name || item.title"
-                  :field="item.code || item.field"
-                  :min-width="item.width">
+                v-for="item in tableHeader"
+                :key="item"
+                :title="item.name || item.title"
+                :field="item.code || item.field"
+                :min-width="item.width"
+              >
                 <template #default="scope" v-if="item.render">
-                  <Component :is="item.render(scope)"/>
+                  <Component :is="item.render(scope)" />
                 </template>
               </vxe-column>
             </vxe-table>
           </div>
-          <div
-              v-if="props.multiple"
-          >
+          <div v-if="props.multiple">
             <vxe-table
-                ref="detailsTableRaf"
-                :row-class-name="nsSelect.is('row-move' , sortable)"
-                :class="nsSelect.e('table')"
-                :data="XEUtils.clone(states.selected , true)"
-                :columnConfig="{ resizable: true}"
-                max-height="250px"
-                show-overflow-tooltip
-                show-overflow
-                :row-config="{ height: 30 , isCurrent: true,isHover:true , useKey: true , keyField: 'value' }"
+              ref="detailsTableRaf"
+              :row-class-name="nsSelect.is('row-move', sortable)"
+              :class="nsSelect.e('table')"
+              :data="XEUtils.clone(states.selected, true)"
+              :columnConfig="{ resizable: true }"
+              max-height="250px"
+              show-overflow-tooltip
+              show-overflow
+              :row-config="{
+                height: 30,
+                isCurrent: true,
+                isHover: true,
+                useKey: true,
+                keyField: 'value',
+              }"
             >
               <vxe-column width="40" v-if="sortable">
-                <template #default="{row,$rowIndex}">
-                  <el-tag v-if="$rowIndex === 0" effect="dark" disable-transitions>
+                <template #default="{ row, $rowIndex }">
+                  <el-tag
+                    v-if="$rowIndex === 0"
+                    effect="dark"
+                    disable-transitions
+                  >
                   </el-tag>
                   <el-tag v-else effect="dark" type="info" disable-transitions>
@@ -300,11 +335,24 @@ defineExpose({
                   </el-tag>
                 </template>
               </vxe-column>
-              <vxe-column field="value" title="编码" :width="rightTableValueWidth"/>
-              <vxe-column field="label" title="名称" :width="rightTableLabelWidth"/>
+              <vxe-column
+                field="value"
+                title="编码"
+                :width="rightTableValueWidth"
+              />
+              <vxe-column
+                field="label"
+                title="名称"
+                :width="rightTableLabelWidth"
+              />
               <vxe-column title="操作" width="40">
-                <template #default="{row , $rowIndex}">
-                  <el-button type="danger" icon="Delete" circle @click="deleteTag(row , $rowIndex)"/>
+                <template #default="{ row, $rowIndex }">
+                  <el-button
+                    type="danger"
+                    icon="Delete"
+                    circle
+                    @click="deleteTag(row, $rowIndex)"
+                  />
                 </template>
               </vxe-column>
             </vxe-table>

+ 698 - 664
src/components/cy/combo-grid/src/index.ts

@@ -1,685 +1,719 @@
-import {ElTooltip, useFocusController, useFormItem, useFormItemInputId, useNamespace} from "element-plus";
-import {useCompRef} from "@/utils/useCompRef";
-import XEUtils, {filter, isArray, isEqual, isFunction, isNumber, isString} from "xe-utils";
-import {useResizeObserver} from "@vueuse/core";
-import {stringNotBlank} from "@/utils/blank-utils";
-import {listFilter} from "@/utils/list-utlis";
+import {
+  ElTooltip,
+  useFocusController,
+  useFormItem,
+  useFormItemInputId,
+  useNamespace,
+} from "element-plus";
+import { useCompRef } from "@/utils/useCompRef";
+import XEUtils, {
+  filter,
+  isArray,
+  isEqual,
+  isFunction,
+  isNumber,
+  isString,
+} from "xe-utils";
+import { useResizeObserver } from "@vueuse/core";
+import { stringNotBlank } from "@/utils/blank-utils";
+import { listFilter } from "@/utils/list-utlis";
 //@ts-ignore
-import Sortable from 'sortablejs'
+import Sortable from "sortablejs";
 import {
-    WritableComputedRef,
-    ref,
-    computed,
-    watch,
-    reactive,
-    nextTick,
-    ExtractPropTypes,
-    onMounted
+  WritableComputedRef,
+  ref,
+  computed,
+  watch,
+  reactive,
+  nextTick,
+  ExtractPropTypes,
+  onMounted,
 } from "vue";
-import {isPromise} from "@/utils/public";
+import { isPromise } from "@/utils/public";
 import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
 
 const isKorean = (text: string) =>
-    /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text)
+  /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
 
 export function useInputV2(handleInput: (event: InputEvent) => void) {
-    const isComposing = ref(false)
-    const handleCompositionStart = () => {
-        isComposing.value = true
-    }
-    const handleCompositionUpdate = (event: any) => {
-        const text = event.target.value
-        const lastCharacter = text[text.length - 1] || ''
-        isComposing.value = !isKorean(lastCharacter)
-    }
-
-    const handleCompositionEnd = (event: any) => {
-        if (isComposing.value) {
-            isComposing.value = false
-            if (isFunction(handleInput)) {
-                handleInput(event)
-            }
-        }
-    }
-
-    return {
-        handleCompositionStart,
-        handleCompositionUpdate,
-        handleCompositionEnd,
-        isComposing
-    }
+  const isComposing = ref(false);
+  const handleCompositionStart = () => {
+    isComposing.value = true;
+  };
+  const handleCompositionUpdate = (event: any) => {
+    const text = event.target.value;
+    const lastCharacter = text[text.length - 1] || "";
+    isComposing.value = !isKorean(lastCharacter);
+  };
+
+  const handleCompositionEnd = (event: any) => {
+    if (isComposing.value) {
+      isComposing.value = false;
+      if (isFunction(handleInput)) {
+        handleInput(event);
+      }
+    }
+  };
+
+  return {
+    handleCompositionStart,
+    handleCompositionUpdate,
+    handleCompositionEnd,
+    isComposing,
+  };
 }
 
-export declare type CyComboGridOptionsV2 = Readonly<Required<ExtractPropTypes<typeof CyComboGridProps>>>
+export declare type CyComboGridOptionsV2 = Readonly<
+  Required<ExtractPropTypes<typeof CyComboGridProps>>
+>;
 
-type ValueLabel = { value: string, label: string, [key: string]: any }
+type ValueLabel = { value: string; label: string; [key: string]: any };
 
-const prefix = ref('cy')
+const prefix = ref("cy");
 
 export default function UesComboGrid(props: CyComboGridOptionsV2, emits: any) {
-    const nsSelect = useNamespace('combo-grid', prefix)
-    const inputRef = ref<HTMLInputElement | null>(null)
-    const tooltipRef = useCompRef(ElTooltip)
-    const expanded = ref(false)
-    const tableRef = ref<null>(null)
-    const calculatorRef = ref<HTMLElement | null>(null)
-    const selectionRef = ref<HTMLElement | null>(null)
-    const collapseItemRef = ref<HTMLElement | null>(null)
-    const detailsTableRaf = ref(null)
-    const localSearchData = ref<any[]>([])
-    const internalData = isFunction(props.remoteMethod) && typeof props.data === 'undefined'
-    const wrapperHeightGoBeyond = ref(false)
-
-    const {form, formItem} = useFormItem()
-    const {inputId} = useFormItemInputId(props, {
-        formItemContext: formItem,
-    })
-
-    const selectDisabled = computed(() => props.disabled || form?.disabled)
-
-    const propsData: WritableComputedRef<any[] | ValueLabel[]> = computed({
-        get() {
-            return (internalData ? states.data : props.data) as any[] | ValueLabel[]
-        },
-        set(val: any[]) {
-            if (internalData) {
-                states.data = val
-            } else {
-                emits('update:data', val)
-            }
-        }
-    })
-
-    const dropdownMenuVisible = computed({
-        get() {
-            return expanded.value
-        },
-        set(val: boolean) {
-            expanded.value = val
-        },
-    })
-
-    const states = reactive({
-        menuVisibleOnFocus: false,
-        inputValue: '',
-        selectedLabel: '',
-        inputHovering: false,
-        selectionWidth: 0,
-        calculatorWidth: 0,
-        collapseItemWidth: 0,
-        previousQuery: '',
-        data: [] as ValueLabel[],
-        // 缓存点击的选项
-        selected: props.multiple ? ([] as ValueLabel[]) : ({} as any),
-        hoveringIndex: -1,
-        cacheRow: [] as any[]
-    })
-
-    const popperRef = computed(() => {
-        return tooltipRef.value?.popperRef?.contentRef
-    })
-
-    const {wrapperRef, isFocused, handleFocus, handleBlur} = useFocusController(
+  const nsSelect = useNamespace("combo-grid", prefix);
+  const inputRef = ref<HTMLInputElement | null>(null);
+  const tooltipRef = useCompRef(ElTooltip);
+  const expanded = ref(false);
+  const tableRef = ref<null>(null);
+  const calculatorRef = ref<HTMLElement | null>(null);
+  const selectionRef = ref<HTMLElement | null>(null);
+  const collapseItemRef = ref<HTMLElement | null>(null);
+  const detailsTableRaf = ref(null);
+  const localSearchData = ref<any[]>([]);
+  const internalData =
+    isFunction(props.remoteMethod) && typeof props.data === "undefined";
+  const wrapperHeightGoBeyond = ref(false);
+
+  const { form, formItem } = useFormItem();
+  const { inputId } = useFormItemInputId(props, {
+    formItemContext: formItem,
+  });
+
+  const selectDisabled = computed(() => props.disabled || form?.disabled);
+
+  const propsData: WritableComputedRef<any[] | ValueLabel[]> = computed({
+    get() {
+      return (internalData ? states.data : props.data) as any[] | ValueLabel[];
+    },
+    set(val: any[]) {
+      if (internalData) {
+        states.data = val;
+      } else {
+        emits("update:data", val);
+      }
+    },
+  });
+
+  const dropdownMenuVisible = computed({
+    get() {
+      return expanded.value;
+    },
+    set(val: boolean) {
+      expanded.value = val;
+    },
+  });
+
+  const states = reactive({
+    menuVisibleOnFocus: false,
+    inputValue: "",
+    selectedLabel: "",
+    inputHovering: false,
+    selectionWidth: 0,
+    calculatorWidth: 0,
+    collapseItemWidth: 0,
+    previousQuery: "",
+    data: [] as ValueLabel[],
+    // 缓存点击的选项
+    selected: props.multiple ? ([] as ValueLabel[]) : ({} as any),
+    hoveringIndex: -1,
+    cacheRow: [] as any[],
+  });
+
+  const popperRef = computed(() => {
+    return tooltipRef.value?.popperRef?.contentRef;
+  });
+
+  const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(
+    // @ts-ignore
+    inputRef,
+    {
+      afterFocus() {
+        expanded.value = true;
+        states.menuVisibleOnFocus = true;
+        emits("focus");
+      },
+      beforeBlur(event) {
+        return tooltipRef.value?.isFocusInsideContent(event);
+      },
+      afterBlur() {
+        expanded.value = false;
+        states.menuVisibleOnFocus = false;
+        localSearchData.value = [];
+        formItem?.validate("blur").catch(err => console.warn(err));
+      },
+    }
+  );
+
+  function handleClickOutside(event: Event) {
+    expanded.value = false;
+    if (isFocused.value) {
+      const _event = new FocusEvent("focus", event);
+      nextTick().then(r => {
+        handleBlur(_event);
+      });
+    }
+  }
+
+  const tableData = computed(() => {
+    return localSearchData.value.length > 0
+      ? localSearchData.value
+      : propsData.value;
+  });
+
+  function localSearch() {
+    localSearchData.value = listFilter(
+      propsData.value,
+      states.inputValue,
+      props.localSearchKey
+    );
+  }
+
+  function handleQueryChange(val: string) {
+    if (val === "") {
+      localSearchData.value = [];
+      return;
+    }
+    if (states.previousQuery === val) {
+      return;
+    }
+    if (isComposing.value) {
+      return;
+    }
+    states.previousQuery = val;
+    if (isFunction(props.remoteMethod)) {
+      const remoteMethod = props.remoteMethod(val);
+      if (remoteMethod != null && isPromise(remoteMethod)) {
+        remoteMethod.then((data: any) => {
+          propsData.value = data;
+        });
+      }
+      return;
+    }
+
+    // 本地搜索
+    localSearch();
+  }
+
+  const onInputChange = () => {
+    if (states.inputValue.length > 0 && !expanded.value) {
+      expanded.value = true;
+    }
+    handleQueryChange(states.inputValue);
+  };
+
+  const onInput = (event: any) => {
+    states.inputValue = event.target.value;
+    states.hoveringIndex = -1;
+    debouncedOnInputChange();
+  };
+
+  const debouncedOnInputChange = XEUtils.debounce(() => {
+    onInputChange();
+  }, props.debounce);
+
+  const {
+    handleCompositionStart,
+    handleCompositionUpdate,
+    handleCompositionEnd,
+    isComposing,
+  } = useInputV2(e => onInput(e));
+
+  const iconReverse = computed(() => {
+    return dropdownMenuVisible.value;
+  });
+
+  const showClear = computed(() => {
+    return props.clearable && hasModelValue.value && states.inputHovering;
+  });
+
+  const bindObj = computed(() => {
+    return (
+      (stringNotBlank(props.value) && stringNotBlank(props.label)) ||
+      stringNotBlank(props.valueLabel)
+    );
+  });
+
+  const updateModel = (val: any) => {
+    localSearchData.value = [];
+    states.inputValue = "";
+    const select = {
+      value: val.value,
+      label: val.label,
+    };
+
+    if (props.arrayAdditionallyFields != null) {
+      props.arrayAdditionallyFields.forEach(item => {
         // @ts-ignore
-        inputRef, {
-            afterFocus() {
-                expanded.value = true
-                states.menuVisibleOnFocus = true
-                emits('focus')
-            },
-            beforeBlur(event) {
-                return (tooltipRef.value?.isFocusInsideContent(event))
-            },
-            afterBlur() {
-                expanded.value = false
-                states.menuVisibleOnFocus = false
-                localSearchData.value = []
-                formItem?.validate('blur').catch((err) => console.warn(err))
-            }
-        })
-
-    function handleClickOutside(event: Event) {
-        expanded.value = false
-        if (isFocused.value) {
-            const _event = new FocusEvent('focus', event)
-            nextTick().then(r => {
-                handleBlur(_event)
-            })
-        }
-    }
-
-    const tableData = computed(() => {
-        return localSearchData.value.length > 0 ? localSearchData.value : propsData.value;
-    })
-
-    function localSearch() {
-        localSearchData.value = listFilter(propsData.value, states.inputValue, props.localSearchKey)
-    }
-
-    function handleQueryChange(val: string) {
-        if (val === '') {
-            localSearchData.value = []
-            return;
-        }
-        if (states.previousQuery === val) {
-            return
-        }
-        if (isComposing.value) {
-            return;
-        }
-        states.previousQuery = val
-        if (isFunction(props.remoteMethod)) {
-            const remoteMethod = props.remoteMethod(val)
-            if (remoteMethod != null && isPromise(remoteMethod)) {
-                remoteMethod.then((data: any) => {
-                    propsData.value = data
-                })
-            }
-            return;
-        }
-
-        // 本地搜索
-        localSearch()
-    }
-
-    const onInputChange = () => {
-        if (states.inputValue.length > 0 && !expanded.value) {
-            expanded.value = true
-        }
-        handleQueryChange(states.inputValue)
-    }
-
-    const onInput = (event: any) => {
-        states.inputValue = event.target.value
-        states.hoveringIndex = -1
-        debouncedOnInputChange()
-    }
-
-    const debouncedOnInputChange = XEUtils.debounce(() => {
-        onInputChange()
-    }, props.debounce)
-
-    const {
-        handleCompositionStart,
-        handleCompositionUpdate,
-        handleCompositionEnd,
-        isComposing
-    } = useInputV2((e) => onInput(e))
-
-    const iconReverse = computed(() => {
-        return dropdownMenuVisible.value
-    })
-
-    const showClear = computed(() => {
-        return props.clearable && hasModelValue.value && states.inputHovering
-    })
-
-    const bindObj = computed(() => {
-        return (stringNotBlank(props.value) && stringNotBlank(props.label)) || stringNotBlank(props.valueLabel)
-    })
-
-    const updateModel = (val: any) => {
-        localSearchData.value = []
-        states.inputValue = ''
-        const select = {
-            value: val.value,
-            label: val.label,
-        }
-
-        if (props.arrayAdditionallyFields != null) {
-            props.arrayAdditionallyFields.forEach(item => {
-                // @ts-ignore
-                select[item] = val[item]
-            })
-        }
-
-        if (props.multiple) {
-            let index = (props.modelValue as any[]).findIndex(item => {
-                return item.value === val.value
-            })
-            if (index > -1) {
-                (props.modelValue as any[]).splice(index, 1)
-                states.selected.splice(index, 1)
-            } else {
-                (props.modelValue as any[]).push(select)
-                states.selected.push(select)
-            }
-
-        } else {
-            states.selected = select
-        }
-
-        if (bindObj.value) {
-            // @ts-ignore
-            props.modelValue[props.value] = val.value
-            // @ts-ignore
-            props.modelValue[props.label] = val.label
-            states.selectedLabel = val.label
-            return
-        }
-
-        if (isString(props.modelValue)) {
-            emits('update:modelValue', val.value)
-            states.selectedLabel = val.label
-            return
-        }
-        if (isNumber(props.modelValue)) {
-            emits('update:modelValue', val.value)
-            states.selectedLabel = val.label
-            return
-        }
-    }
-
-    const handleClearClick = () => {
-
-        function clearFunc() {
-            states.selectedLabel = ''
-            states.selected = props.multiple ? [] : ({} as any)
-            if (props.multiple) {
-                emits('update:modelValue', [])
-                return;
-            }
-
-            if (bindObj.value) {
-                // @ts-ignore
-                props.modelValue[props.value] = ''
-                // @ts-ignore
-                props.modelValue[props.label] = ''
-                return;
-            }
-            if (isString(props.modelValue)) {
-                emits('update:modelValue', '')
-                return
-            }
-            if (isNumber(props.modelValue)) {
-                emits('update:modelValue', null)
-                return
-            }
-        }
-
-        clearFunc()
-        emits('clear')
-    }
-
-    const handleTableClick = (val: { row: any, rowIndex: number }) => {
-        states.cacheRow.push(val.row)
-        states.hoveringIndex = val.rowIndex
-        updateModel(val.row)
-        if (!props.multiple) {
-            toggleMenu()
-        }
-        emits('rowClick', val)
-    }
-
-    function toggleMenu() {
-        if (props.disabled) return
-        if (states.menuVisibleOnFocus) {
-            // controlled by automaticDropdown
-            states.menuVisibleOnFocus = false
-        } else {
-            expanded.value = !expanded.value
-        }
-    }
-
-    const getGapWidth = () => {
-        if (!selectionRef.value) return 0
-        const style = window.getComputedStyle(selectionRef.value)
-        return Number.parseFloat(style.gap || '6px')
-    }
-
-    const inputStyle = computed(() => ({
-        width: `${Math.max(states.calculatorWidth, 11)}px`
-    }))
-
-    const collapseTagStyle = computed(() => {
-        return {maxWidth: `${states.selectionWidth}px`}
-    })
-
-    // computed style
-    const tagStyle = computed(() => {
-        const gapWidth = getGapWidth()
-        const maxWidth =
-            collapseItemRef.value && props.maxCollapseTags === 1
-                ? states.selectionWidth - states.collapseItemWidth - gapWidth
-                : states.selectionWidth
-        return {maxWidth: `${maxWidth - 20}px`}
-    })
-
-    const hasModelValue = computed(() => {
-        if (isString(props.modelValue) && stringNotBlank(props.modelValue)) {
-            return true
-        }
-        if (isNumber(props.modelValue) && stringNotBlank(props.modelValue)) {
-            return true
-        }
-        // @ts-ignore
-        if (bindObj.value && stringNotBlank(props.modelValue[props!.value])) {
-            return true
-        }
-        return isArray(props.modelValue) && props.modelValue.length > 0;
-    })
-
-    const shouldShowPlaceholder = computed(() => {
-        return !states.inputValue
-    })
-
-    const currentPlaceholder = computed(() => {
-        if (props.multiple) {
-            return (props.modelValue as any[]).length > 0 ? '' : props.placeholder;
-        }
-        return states.selectedLabel || props.placeholder
-    })
-
-
-    const isTransparent = computed(() => {
-        return !hasModelValue.value || (expanded.value && !states.inputValue)
-    })
-
-    const showTagList = computed(() => {
-        if (props.multiple) {
-            const temp = states.selected.length > 0 ? [states.selected[0]] : []
-            return props.collapseTags ? temp : states.selected
-        }
-        return []
-    })
-
-    const deleteTag = (item: any, index: number) => {
-        (props.modelValue as ValueLabel[]).splice(index, 1)
-        states.selected.splice(index, 1)
-    }
-
-    function getObjValue(): string {
+        select[item] = val[item];
+      });
+    }
+
+    if (props.multiple) {
+      let index = (props.modelValue as any[]).findIndex(item => {
+        return item.value === val.value;
+      });
+      if (index > -1) {
+        (props.modelValue as any[]).splice(index, 1);
+        states.selected.splice(index, 1);
+      } else {
+        (props.modelValue as any[]).push(select);
+        states.selected.push(select);
+      }
+    } else {
+      states.selected = select;
+    }
+
+    if (bindObj.value) {
+      // @ts-ignore
+      props.modelValue[props.value] = val.value;
+      // @ts-ignore
+      props.modelValue[props.label] = val.label;
+      states.selectedLabel = val.label;
+      return;
+    }
+
+    if (isString(props.modelValue)) {
+      emits("update:modelValue", val.value);
+      states.selectedLabel = val.label;
+      return;
+    }
+    if (isNumber(props.modelValue)) {
+      emits("update:modelValue", val.value);
+      states.selectedLabel = val.label;
+      return;
+    }
+  };
+
+  const handleClearClick = () => {
+    function clearFunc() {
+      states.selectedLabel = "";
+      states.selected = props.multiple ? [] : ({} as any);
+      if (props.multiple) {
+        emits("update:modelValue", []);
+        return;
+      }
+
+      if (bindObj.value) {
         // @ts-ignore
-        return props.modelValue[props.value]
-    }
-
-    function getObjLabel(): string {
+        props.modelValue[props.value] = "";
         // @ts-ignore
-        return props.modelValue[props.label]
-    }
-
-    function getModelArr() {
-        return (props.modelValue as ValueLabel[])
-    }
-
-    function handleObj() {
-        states.selected = {
-            value: getObjValue(),
-            label: getObjLabel(),
-        }
-        states.selectedLabel = getObjLabel()
-    }
-
-    function handleSelect() {
-        if (props.modelValue === states.selected.value) {
-            states.selectedLabel = states.selected.label
-            return
-        }
-
-        let data: any[]
-
-        data = filter(states.cacheRow, (item) => {
-            return item.value === props.modelValue
-        })
-
-        if (data.length === 0) {
-            data = filter(propsData.value, (item) => {
-                return item.value === props.modelValue
-            })
-        }
-
-        if (data.length > 0) {
-            states.selected = {
-                value: data[0].value,
-                label: data[0].label,
-            }
-            states.selectedLabel = states.selected.label
-            return
-        }
-        states.selectedLabel = XEUtils.toString(props.modelValue)
-    }
-
-    function handleMultiple() {
-        states.selected = XEUtils.clone(getModelArr(), true)
-    }
-
-    function handleChangeModel() {
-        if (bindObj.value) {
-            handleObj()
-        } else if (props.multiple) {
-            handleMultiple()
+        props.modelValue[props.label] = "";
+        return;
+      }
+      if (isString(props.modelValue)) {
+        emits("update:modelValue", "");
+        return;
+      }
+      if (isNumber(props.modelValue)) {
+        emits("update:modelValue", null);
+        return;
+      }
+    }
+
+    clearFunc();
+    emits("clear");
+  };
+
+  const handleTableClick = (val: { row: any; rowIndex: number }) => {
+    states.cacheRow.push(val.row);
+    states.hoveringIndex = val.rowIndex;
+    updateModel(val.row);
+    if (!props.multiple) {
+      toggleMenu();
+    }
+    emits("rowClick", val);
+  };
+
+  function toggleMenu() {
+    if (props.disabled) return;
+    if (states.menuVisibleOnFocus) {
+      // controlled by automaticDropdown
+      states.menuVisibleOnFocus = false;
+    } else {
+      expanded.value = !expanded.value;
+    }
+  }
+
+  const getGapWidth = () => {
+    if (!selectionRef.value) return 0;
+    const style = window.getComputedStyle(selectionRef.value);
+    return Number.parseFloat(style.gap || "6px");
+  };
+
+  const inputStyle = computed(() => ({
+    width: `${Math.max(states.calculatorWidth, 11)}px`,
+  }));
+
+  const collapseTagStyle = computed(() => {
+    return { maxWidth: `${states.selectionWidth}px` };
+  });
+
+  // computed style
+  const tagStyle = computed(() => {
+    const gapWidth = getGapWidth();
+    const maxWidth =
+      collapseItemRef.value && props.maxCollapseTags === 1
+        ? states.selectionWidth - states.collapseItemWidth - gapWidth
+        : states.selectionWidth;
+    return { maxWidth: `${maxWidth - 20}px` };
+  });
+
+  const hasModelValue = computed(() => {
+    if (isString(props.modelValue) && stringNotBlank(props.modelValue)) {
+      return true;
+    }
+    if (isNumber(props.modelValue) && stringNotBlank(props.modelValue)) {
+      return true;
+    }
+    // @ts-ignore
+    if (bindObj.value && stringNotBlank(props.modelValue[props!.value])) {
+      return true;
+    }
+    return isArray(props.modelValue) && props.modelValue.length > 0;
+  });
+
+  const shouldShowPlaceholder = computed(() => {
+    return !states.inputValue;
+  });
+
+  const currentPlaceholder = computed(() => {
+    if (props.multiple) {
+      return (props.modelValue as any[]).length > 0 ? "" : props.placeholder;
+    }
+    return states.selectedLabel || props.placeholder;
+  });
+
+  const isTransparent = computed(() => {
+    return !hasModelValue.value || (expanded.value && !states.inputValue);
+  });
+
+  const showTagList = computed(() => {
+    if (props.multiple) {
+      const temp = states.selected.length > 0 ? [states.selected[0]] : [];
+      return props.collapseTags ? temp : states.selected;
+    }
+    return [];
+  });
+
+  const deleteTag = (item: any, index: number) => {
+    (props.modelValue as ValueLabel[]).splice(index, 1);
+    states.selected.splice(index, 1);
+  };
+
+  function getObjValue(): string {
+    // @ts-ignore
+    return props.modelValue[props.value];
+  }
+
+  function getObjLabel(): string {
+    // @ts-ignore
+    return props.modelValue[props.label];
+  }
+
+  function getModelArr() {
+    return props.modelValue as ValueLabel[];
+  }
+
+  function handleObj() {
+    states.selected = {
+      value: getObjValue(),
+      label: getObjLabel(),
+    };
+    states.selectedLabel = getObjLabel();
+  }
+
+  function handleSelect() {
+    if (props.modelValue === states.selected.value) {
+      states.selectedLabel = states.selected.label;
+      return;
+    }
+
+    let data: any[];
+
+    data = filter(states.cacheRow, item => {
+      return item.value === props.modelValue;
+    });
+
+    if (data.length === 0) {
+      data = filter(propsData.value, item => {
+        return item.value === props.modelValue;
+      });
+    }
+
+    if (data.length > 0) {
+      states.selected = {
+        value: data[0].value,
+        label: data[0].label,
+      };
+      states.selectedLabel = states.selected.label;
+      return;
+    }
+    states.selectedLabel = XEUtils.toString(props.modelValue);
+  }
+
+  function handleMultiple() {
+    states.selected = XEUtils.clone(getModelArr(), true);
+  }
+
+  function handleChangeModel() {
+    if (bindObj.value) {
+      handleObj();
+    } else if (props.multiple) {
+      handleMultiple();
+    } else {
+      handleSelect();
+    }
+    if (!expanded.value) {
+      states.inputValue = states.selectedLabel;
+    }
+  }
+
+  watch(
+    () => props.modelValue,
+    (val, oldVal) => {
+      handleChangeModel();
+      if (!isEqual(val, oldVal)) {
+        formItem?.validate("change").catch(err => console.error(err));
+      }
+      emits("change", props.modelValue);
+    },
+    {
+      flush: "post",
+      deep: true,
+      immediate: true,
+    }
+  );
+
+  watch(
+    () => expanded.value,
+    val => {
+      if (val) {
+        states.inputValue = "";
+        handleQueryChange(states.inputValue);
+      } else {
+        if (bindObj.value || props.multiple) {
+          states.inputValue = "";
         } else {
-            handleSelect()
-        }
-        if (!expanded.value) {
-            states.inputValue = states.selectedLabel
-        }
-    }
-
-
-    watch(
-        () => props.modelValue,
-        (val, oldVal) => {
-            handleChangeModel()
-            if (!isEqual(val, oldVal)) {
-                formItem?.validate('change').catch((err) => console.error(err))
-            }
-            emits('change', props.modelValue)
-        }, {
-            flush: 'post',
-            deep: true,
-            immediate: true
-        }
-    )
-
-    watch(
-        () => expanded.value,
-        (val) => {
-            if (val) {
-                states.inputValue = ''
-                handleQueryChange(states.inputValue)
-            } else {
-                if (bindObj.value || props.multiple) {
-                    states.inputValue = ''
-                } else {
-                    states.inputValue = states.selectedLabel
-                }
-                states.previousQuery = ''
-            }
-            emits('visible-change', val)
-        }
-    )
-
-    watch(
-        () => propsData.value,
-        () => {
-            states.hoveringIndex = -1
-            handleChangeModel()
-        }, {
-            flush: 'post',
-            deep: true,
-        }
-    )
-
-    const resetCalculatorWidth = () => {
-        states.calculatorWidth = calculatorRef.value!.getBoundingClientRect().width
-    }
-
-    const updateTooltip = () => {
-        tooltipRef.value?.updatePopper?.()
-    }
-
-    const resetSelectionWidth = () => {
-        states.selectionWidth = selectionRef.value!.getBoundingClientRect().width
-    }
-
-    const resetCollapseItemWidth = () => {
-        states.collapseItemWidth =
-            collapseItemRef.value!.getBoundingClientRect().width
-    }
-
-    function columnsTableSortable() {
-        const el = (detailsTableRaf.value!['$el'] as HTMLDivElement).querySelector('.vxe-table--body tbody')
-        const ops = {
-            handle: '.vxe-body--row',
-            onEnd: function ({newIndex, oldIndex}: { newIndex: number, oldIndex: number }) {
-                const currRow = getModelArr().splice(oldIndex, 1)[0];
-                getModelArr().splice(newIndex, 0, currRow);
-
-                const currRow2 = states.selected.splice(oldIndex, 1)[0];
-                states.selected.splice(newIndex, 0, currRow2);
-            }
-        }
-        Sortable.create(el, ops)
-    }
-
-    useResizeObserver(calculatorRef, resetCalculatorWidth)
-    useResizeObserver(wrapperRef, () => {
-        updateTooltip()
-        wrapperHeightGoBeyond.value = wrapperRef.value!.getBoundingClientRect().height > 28
-    })
-    useResizeObserver(selectionRef, resetSelectionWidth)
-    useResizeObserver(collapseItemRef, resetCollapseItemWidth)
-
+          states.inputValue = states.selectedLabel;
+        }
+        states.previousQuery = "";
+      }
+      emits("visible-change", val);
+    }
+  );
+
+  watch(
+    () => propsData.value,
+    () => {
+      states.hoveringIndex = -1;
+      handleChangeModel();
+    },
+    {
+      flush: "post",
+      deep: true,
+    }
+  );
+
+  const resetCalculatorWidth = () => {
+    states.calculatorWidth = calculatorRef.value!.getBoundingClientRect().width;
+  };
+
+  const updateTooltip = () => {
+    tooltipRef.value?.updatePopper?.();
+  };
+
+  const resetSelectionWidth = () => {
+    states.selectionWidth = selectionRef.value!.getBoundingClientRect().width;
+  };
+
+  const resetCollapseItemWidth = () => {
+    states.collapseItemWidth =
+      collapseItemRef.value!.getBoundingClientRect().width;
+  };
+
+  function columnsTableSortable() {
+    const el = (detailsTableRaf.value!["$el"] as HTMLDivElement).querySelector(
+      ".vxe-table--body tbody"
+    );
+    const ops = {
+      handle: ".vxe-body--row",
+      onEnd: function ({
+        newIndex,
+        oldIndex,
+      }: {
+        newIndex: number;
+        oldIndex: number;
+      }) {
+        const currRow = getModelArr().splice(oldIndex, 1)[0];
+        getModelArr().splice(newIndex, 0, currRow);
+
+        const currRow2 = states.selected.splice(oldIndex, 1)[0];
+        states.selected.splice(newIndex, 0, currRow2);
+      },
+    };
+    Sortable.create(el, ops);
+  }
+
+  useResizeObserver(calculatorRef, resetCalculatorWidth);
+  useResizeObserver(wrapperRef, () => {
+    updateTooltip();
+    wrapperHeightGoBeyond.value =
+      wrapperRef.value!.getBoundingClientRect().height > 28;
+  });
+  useResizeObserver(selectionRef, resetSelectionWidth);
+  useResizeObserver(collapseItemRef, resetCollapseItemWidth);
+
+  // 键盘事件
+  function navigateOptions(direction: "next" | "prev") {
+    if (!expanded.value) {
+      expanded.value = true;
+      return;
+    }
+    if (tableData.value.length === 0) return;
+    if (direction === "next") {
+      states.hoveringIndex++;
+      if (states.hoveringIndex === tableData.value.length) {
+        states.hoveringIndex = 0;
+      }
+    } else if (direction === "prev") {
+      states.hoveringIndex--;
+      if (states.hoveringIndex < 0) {
+        states.hoveringIndex = tableData.value.length - 1;
+      }
+    }
+
+    const selectData = tableData.value[states.hoveringIndex];
+    tableRef.value?.setCurrentRow(selectData);
+    tableRef.value?.scrollToRow(selectData);
+  }
+
+  function handleEsc(event: KeyboardEvent) {
+    function handleStop() {
+      event.stopPropagation();
+      event.preventDefault();
+    }
+
+    if (states.inputValue.length > 0) {
+      states.inputValue = "";
+      handleStop();
+    } else {
+      if (expanded.value) {
+        handleStop();
+      }
+      expanded.value = false;
+    }
+  }
+
+  function selectOption() {
+    if (!expanded.value) {
+      toggleMenu();
+    } else {
+      if (tableData.value[states.hoveringIndex]) {
+        handleTableClick({
+          row: tableData.value[states.hoveringIndex],
+          rowIndex: states.hoveringIndex,
+        });
+      }
+    }
+  }
+
+  function deletePrevTag(e: KeyboardEvent & InputEvent) {
+    if (!props.multiple) return;
+    if (e.code === "Delete") return;
+    // @ts-ignore
+    if (e.target.value.length <= 0) {
+      const length = showTagList.value.length;
+      if (length === 0) return;
+      deleteTag(showTagList.value[length], length - 1);
+    }
+  }
+
+  function rowClass({ row }: { row: any }) {
+    const value = row.value;
+    if (props.multiple) {
+      for (let i = 0; i < getModelArr().length; i++) {
+        const item = getModelArr()[i];
+        if (item.value === value) {
+          return "cy-combo-grid__table_key";
+        }
+      }
+    } else if (bindObj.value) {
+      if (getObjValue() === value) {
+        return "cy-combo-grid__table_key";
+      }
+    } else {
+      if (props.modelValue === value) {
+        return "cy-combo-grid__table_key";
+      }
+    }
+  }
+
+  onMounted(() => {
+    if (props.multiple) {
+      if (!isArray(props.modelValue)) {
+        emits("update:modelValue", []);
+      }
+      props.sortable && columnsTableSortable();
+    }
+  });
+
+  return {
+    inputId,
+    nsSelect,
+    handleFocus,
+    inputRef,
+    handleBlur,
+    isFocused,
+    handleClickOutside,
+    tooltipRef,
+    popperRef,
+    dropdownMenuVisible,
+    tableRef,
+    states,
+    onInput,
+    handleCompositionStart,
+    handleCompositionUpdate,
+    handleCompositionEnd,
+    toggleMenu,
+    iconReverse,
+    showClear,
+    handleClearClick,
+    handleTableClick,
+    wrapperRef,
+    currentPlaceholder,
+    calculatorRef,
+    shouldShowPlaceholder,
+    isTransparent,
+    selectionRef,
+    collapseItemRef,
+    deleteTag,
+    showTagList,
+    detailsTableRaf,
+    tableData,
+    wrapperHeightGoBeyond,
+    selectDisabled,
 
     // 键盘事件
-    function navigateOptions(direction: 'next' | 'prev') {
-        if (!expanded.value) {
-            expanded.value = true
-            return
-        }
-        if (tableData.value.length === 0) return;
-        if (direction === 'next') {
-            states.hoveringIndex++
-            if (states.hoveringIndex === tableData.value.length) {
-                states.hoveringIndex = 0
-            }
-        } else if (direction === 'prev') {
-            states.hoveringIndex--
-            if (states.hoveringIndex < 0) {
-                states.hoveringIndex = tableData.value.length - 1
-            }
-        }
-
-        const selectData = tableData.value[states.hoveringIndex]
-        tableRef.value?.setCurrentRow(selectData);
-        tableRef.value?.scrollToRow(selectData)
-    }
-
-    function handleEsc(event: KeyboardEvent) {
-
-        function handleStop() {
-            event.stopPropagation();
-            event.preventDefault();
-        }
-
-        if (states.inputValue.length > 0) {
-            states.inputValue = ''
-            handleStop()
-        } else {
-            if (expanded.value) {
-                handleStop()
-            }
-            expanded.value = false
-        }
-    }
-
-    function selectOption() {
-        if (!expanded.value) {
-            toggleMenu()
-        } else {
-            if (tableData.value[states.hoveringIndex]) {
-                handleTableClick({row: tableData.value[states.hoveringIndex], rowIndex: states.hoveringIndex})
-            }
-        }
-    }
-
-    function deletePrevTag(e: KeyboardEvent & InputEvent) {
-        if (!props.multiple) return
-        if (e.code === 'Delete') return
-        // @ts-ignore
-        if (e.target.value.length <= 0) {
-            const length = showTagList.value.length
-            if (length === 0) return
-            deleteTag(showTagList.value[length], length - 1)
-        }
-    }
-
-    function rowClass({row}: { row: any }) {
-        const value = row.value
-        if (props.multiple) {
-            for (let i = 0; i < getModelArr().length; i++) {
-                const item = getModelArr()[i]
-                if (item.value === value) {
-                    return 'cy-combo-grid__table_key'
-                }
-            }
-        } else if (bindObj.value) {
-            if (getObjValue() === value) {
-                return 'cy-combo-grid__table_key'
-            }
-        } else {
-            if (props.modelValue === value) {
-                return 'cy-combo-grid__table_key'
-            }
-        }
-    }
-
-    onMounted(() => {
-        if (props.multiple) {
-            if (!isArray(props.modelValue)) {
-                emits('update:modelValue', [])
-            }
-            props.sortable && columnsTableSortable()
-        }
-    })
-
-    return {
-        inputId,
-        nsSelect,
-        handleFocus,
-        inputRef,
-        handleBlur,
-        isFocused,
-        handleClickOutside,
-        tooltipRef,
-        popperRef,
-        dropdownMenuVisible,
-        tableRef,
-        states,
-        onInput,
-        handleCompositionStart,
-        handleCompositionUpdate,
-        handleCompositionEnd,
-        toggleMenu,
-        iconReverse,
-        showClear,
-        handleClearClick,
-        handleTableClick,
-        wrapperRef,
-        currentPlaceholder,
-        calculatorRef,
-        shouldShowPlaceholder,
-        isTransparent,
-        selectionRef,
-        collapseItemRef,
-        deleteTag,
-        showTagList,
-        detailsTableRaf,
-        tableData,
-        wrapperHeightGoBeyond,
-        selectDisabled,
-
-        // 键盘事件
-        navigateOptions,
-        handleEsc,
-        selectOption,
-        deletePrevTag,
-
-        inputStyle,
-        tagStyle,
-        collapseTagStyle,
-        rowClass,
-    }
+    navigateOptions,
+    handleEsc,
+    selectOption,
+    deletePrevTag,
+
+    inputStyle,
+    tagStyle,
+    collapseTagStyle,
+    rowClass,
+  };
 }
-

+ 93 - 68
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog.vue

@@ -1,31 +1,26 @@
 <template>
-  <el-dialog v-model="dialog"
-             title="特殊医嘱"
-             @closed="emits('closed')">
+  <el-dialog v-model="dialog" title="特殊医嘱" @closed="emits('closed')">
     <span style="color: red">
       请注意,填写完成后需要,录入医嘱才会保存这些信息,点击确认和关闭是不会保存信息的,复制粘贴医嘱是不会同步复制这些信息,需要再次填写。
     </span>
-    <div v-if="props.yzData.orderCode === czCode">
-       <span>
-          请输入处置医嘱名称:
-      </span>
+    <div v-if="czCode.includes(props.yzData.orderCode)">
+      <span> 请输入处置医嘱名称: </span>
       <el-input
-          v-model="props.yzData.orderName"
-          type="textarea"
-          :maxlength="50"
-          show-word-limit/>
+        v-model="props.yzData.orderName"
+        type="textarea"
+        :maxlength="50"
+        show-word-limit
+      />
     </div>
-    <div v-if="props.yzData.orderCode === zkCode">
-      <span>
-          请输入转科科室:
-      </span>
-      <el-select v-model="props.yzData.zkObj"
-                 filterable
-                 @change="zkChange">
-        <el-option v-for="(item, index) in zkList"
-                   :key="item.value"
-                   :label="item.wardName + '|' + item.smallName"
-                   :value="item.value">
+    <div v-if="zkCode.includes(props.yzData.orderCode)">
+      <span> 请输入转科科室: </span>
+      <el-select v-model="props.yzData.zkObj" filterable @change="zkChange">
+        <el-option
+          v-for="(item, index) in zkList"
+          :key="item.value"
+          :label="item.wardName + '|' + item.smallName"
+          :value="item.value"
+        >
           <span>{{ item.wardName }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.smallName }}</span>
@@ -34,11 +29,18 @@
     </div>
     <div v-if="props.yzData.kjywFlag === 1">
       用药方式:
-      <el-select v-model="props.yzData.yyfs"
-                 id="yz_yyfs"
-                 style="width: 120px" @change="kangJunYaoYongYaoFangShiGaiBian">
-        <el-option v-for="item in kangJunYaoWuYongYaoFangShi" :key="item.code" :label="item.name"
-                   :value="item.code">
+      <el-select
+        v-model="props.yzData.yyfs"
+        id="yz_yyfs"
+        style="width: 120px"
+        @change="kangJunYaoYongYaoFangShiGaiBian"
+      >
+        <el-option
+          v-for="item in kangJunYaoWuYongYaoFangShi"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
           <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.name }}</span>
@@ -46,14 +48,23 @@
       </el-select>
       手术切口:
       <el-select
-          v-model="props.yzData.ssqk"
-          id="yz_ssqk"
-          :disabled="props.yzData.yyfs !== 1 && props.yzData.yyfs !== 2 && props.yzData.yyfs !== null"
-          clearable
-          style="width: 120px"
-          @clear="props.yzData.ssqk = null"
+        v-model="props.yzData.ssqk"
+        id="yz_ssqk"
+        :disabled="
+          props.yzData.yyfs !== 1 &&
+          props.yzData.yyfs !== 2 &&
+          props.yzData.yyfs !== null
+        "
+        clearable
+        style="width: 120px"
+        @clear="props.yzData.ssqk = null"
       >
-        <el-option v-for="item in kangJunYaoWuQieKou" :key="item.code" :label="item.name" :value="item.code">
+        <el-option
+          v-for="item in kangJunYaoWuQieKou"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
           <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.name }}</span></el-option
@@ -61,17 +72,27 @@
       </el-select>
       术前用药时间:
       <el-select
-          id="yz_yysj"
-          v-model="props.yzData.yysj"
-          :disabled="props.yzData.yyfs !== 1 && props.yzData.yyfs !== 2 && props.yzData.yyfs !== null"
-          clearable
-          style="width: 120px"
-          @clear="props.yzData.yysj = null">
-        <el-option v-for="item in kangJunYaoWuYongYaoShiJian" :key="item.code" :label="item.name"
-                   :value="item.code">
+        id="yz_yysj"
+        v-model="props.yzData.yysj"
+        :disabled="
+          props.yzData.yyfs !== 1 &&
+          props.yzData.yyfs !== 2 &&
+          props.yzData.yyfs !== null
+        "
+        clearable
+        style="width: 120px"
+        @clear="props.yzData.yysj = null"
+      >
+        <el-option
+          v-for="item in kangJunYaoWuYongYaoShiJian"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
           <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
           <el-divider direction="vertical"></el-divider>
-          <span>{{ item.name }}</span></el-option>
+          <span>{{ item.name }}</span></el-option
+        >
       </el-select>
     </div>
     <template #footer>
@@ -82,47 +103,51 @@
 </template>
 
 <script setup>
-import {yiZhuData, zkList} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
-import {kangJunYaoWuQieKou, kangJunYaoWuYongYaoFangShi, kangJunYaoWuYongYaoShiJian} from '@/data'
+import {
+  yiZhuData,
+  yzZdOrderItemConfirm,
+  zkList,
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+import {
+  kangJunYaoWuQieKou,
+  kangJunYaoWuYongYaoFangShi,
+  kangJunYaoWuYongYaoShiJian,
+} from "@/data";
 
 const props = defineProps({
   yzData: {
     type: Object,
-  }
-})
+  },
+});
 
-const emits = defineEmits(['closed'])
+const emits = defineEmits(["closed"]);
 
 // 转科医嘱
-const zkCode = '06286'
+const zkCode = yzZdOrderItemConfirm.value["转科"];
 // 处置医嘱
-const czCode = '06054'
+const czCode = yzZdOrderItemConfirm.value["处置医嘱"];
 
-const dialog = ref(true)
+const dialog = ref(true);
 
 const zkChange = () => {
-  let zk = JSON.parse(props.yzData.zkObj)
-  props.yzData.zkWardCode = zk.wardCode
-  props.yzData.zkDeptCode = zk.smallCode
-  props.yzData.orderName = `转科医嘱转至${zk.wardName}(小科室:${zk.smallName})`
-}
+  let zk = JSON.parse(props.yzData.zkObj);
+  props.yzData.zkWardCode = zk.wardCode;
+  props.yzData.zkDeptCode = zk.smallCode;
+  props.yzData.orderName = `转科医嘱转至${zk.wardName}(小科室:${zk.smallName})`;
+};
 
 /*  这里是抗菌药物,选择了除了 1和 2 的其他都可以不用填写 */
-const kangJunYaoYongYaoFangShiGaiBian = (val) => {
+const kangJunYaoYongYaoFangShiGaiBian = val => {
   if (val !== 1 || val !== 2) {
-    props.yzData.ssqk = null
-    props.yzData.yysj = null
+    props.yzData.ssqk = null;
+    props.yzData.yysj = null;
   }
-}
+};
 
 const cancel = () => {
-  if (yiZhuData.value.orderCode === '06054') {
-    yiZhuData.value.orderName = '处置医嘱'
+  if (yiZhuData.value.orderCode === "06054") {
+    yiZhuData.value.orderName = "处置医嘱";
   }
-  dialog.value = false
-}
+  dialog.value = false;
+};
 </script>
-
-<style lang="scss" scoped>
-
-</style>

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

@@ -261,6 +261,8 @@ import {
   copyOrder,
   enterOrders,
   FeeInfo,
+  getExceedingDischargeDays,
+  getOrderCodeByName,
   getOrderNo,
   huoQuFeiYongXinXi,
   huoQuXiangMu,
@@ -298,6 +300,7 @@ import {
   errorMsg,
   yzInfoPrompt,
   jsQueryYzData,
+  yzZdOrderItemConfirm,
 } 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";
@@ -354,6 +357,9 @@ const parentOrder = [
 
 const userStore = useUserStore();
 
+let exceedingDischargeDays = -1;
+let 出院医嘱 = [];
+
 const searchOrders = val => {
   return huoQuXiangMu(val, queryParam.value.groupNo);
 };
@@ -568,7 +574,11 @@ const itemDefaultValue = (
     yiZhuData.value.statusFlag
   );
 
-  if (yiZhuData.value.orderCode === "06026") {
+  if (出院医嘱.includes(yiZhuData.value.orderCode)) {
+    if (exceedingDischargeDays == -1) {
+      return;
+    }
+
     if (isDev) {
       huanZheXinXi.value.admissDate = dayjs(new Date())
         .subtract(3, "day")
@@ -580,7 +590,7 @@ const itemDefaultValue = (
       .diff(dayjs(huanZheXinXi.value.admissDate).startOf("day"), "day");
 
     if (
-      diffDays <= 4 &&
+      diffDays <= exceedingDischargeDays &&
       yiZhuData.value.superiorDoctor !== huanZheXinXi.value.deptDirector
     ) {
       const prompt = `患者出院天数小于等于4需要【科主任】授权,此患者的科主任设置为:【${huanZheXinXi.value.deptDirectorName}】`;
@@ -943,11 +953,16 @@ const confirmOrdersClick = async () => {
 const yzDialogRef = ref(false);
 const openTheOrderPopUpWindow = () => {
   if (!isEdit.value) {
-    const specialOrders = ["06286", "06054"];
     if (yiZhuData.value.statusFlag !== "1") {
       return;
     }
-    if (specialOrders.includes(yiZhuData.value.orderCode)) {
+    const 处置医嘱 = yzZdOrderItemConfirm.value["处置医嘱1"] ?? [];
+    const 转科 = yzZdOrderItemConfirm.value["转科1"] ?? [];
+    const specialOrders = [...处置医嘱, ...转科];
+    if (
+      specialOrders.includes(yiZhuData.value.orderCode) &&
+      yiZhuData.value.serial == "00"
+    ) {
       yzDialogRef.value = true;
     } else if (yiZhuData.value.kjywFlag === 1) {
       yzDialogRef.value = true;
@@ -1089,6 +1104,14 @@ const supplyDisabled = computed(() => {
 });
 
 onMounted(() => {
+  getExceedingDischargeDays().then(res => {
+    exceedingDischargeDays = res;
+  });
+
+  getOrderCodeByName("出院").then(res => {
+    出院医嘱 = res;
+  });
+
   yzMitt.on("toAddAnOrder", toAddAnOrder);
   yzMitt.on("duplicateAndPaste", duplicateAndPaste);
   yzMitt.on("openTheOrderPopUpWindow", openTheOrderPopUpWindow);

+ 204 - 0
src/views/dictionary/orderZdMaintain/compoents/orderitem/EditorDialog.vue

@@ -0,0 +1,204 @@
+<script setup lang="ts">
+import { saveItem, YzOrderItemDTO } from "@/api/orderZdMaintain";
+import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
+import SystemDeptSelect from "@/components/system/dept-select/SystemDeptSelect.vue";
+import { UseDialogType } from "@/components/cy/CyDialog/index";
+import XEUtils from "xe-utils";
+
+const props = defineProps<{
+  data: YzOrderItemDTO;
+  changeType: [];
+  ssType: [];
+  operations: [];
+}>();
+
+const tmpData = ref(XEUtils.cloneDeep(props.data));
+
+defineExpose<UseDialogType.Expose>({
+  async confirm() {
+    return await saveItem(tmpData.value)
+      .then(res => {
+        return res;
+      })
+      .catch(e => {
+        return props.data;
+      });
+  },
+});
+</script>
+
+<template>
+  <el-form label-position="right" size="default" label-width="120">
+    <el-row style="width: 100%">
+      <el-col :span="12">
+        <el-form-item label="编码:">
+          {{ tmpData.orderCode }}
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="名称:">
+          <el-input
+            v-model="tmpData.orderName"
+            maxlength="20"
+            minlength="1"
+            show-word-limit
+            type="textarea"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="属性:">
+          <el-select v-model="tmpData.orderClass">
+            <xc-el-option :data="changeType" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="医嘱类型:">
+          <el-select v-model="tmpData.operation" clearable>
+            <xc-el-option :data="operations" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="停用:">
+          <el-switch
+            v-model="tmpData.delFlag"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="全排斥:">
+          <el-switch
+            v-model="tmpData.excluGroupType"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="抢救:">
+          <el-switch
+            v-model="tmpData.qjFlag"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="是否长期:">
+          <el-switch
+            v-model="tmpData.frequType"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="药品类:">
+          <el-switch
+            v-model="tmpData.ypFlag"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="检验:">
+          <el-switch
+            v-model="tmpData.jyType"
+            active-text="是"
+            inactive-text="否"
+            active-value="1"
+            inactive-value="0"
+          ></el-switch>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="执行科室:">
+          <SystemDeptSelect
+            style="width: 100%"
+            v-model="tmpData.execDept"
+            clearable
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="手术分类:">
+          <el-select v-model="tmpData.ssType" clearable>
+            <xc-el-option :data="ssType" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="描述:">
+          <el-input
+            v-model="tmpData.discription"
+            maxlength="100"
+            minlength="1"
+            show-word-limit
+            type="textarea"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="医保备注:">
+          <el-input
+            v-model="tmpData.ybComment"
+            maxlength="220"
+            minlength="1"
+            show-word-limit
+            type="textarea"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="院内码:">
+          <el-input
+            v-model="tmpData.nCode"
+            maxlength="8"
+            minlength="1"
+            show-word-limit
+            type="number"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="检查类别:">
+          {{ tmpData.orderTypeName }}
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="检验类别:">
+          {{ tmpData.jyTypeName }}
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<style lang="scss"></style>

+ 320 - 0
src/views/dictionary/orderZdMaintain/compoents/orderitem/OrderIten.vue

@@ -0,0 +1,320 @@
+<script setup lang="ts">
+import * as api from "@/api/orderZdMaintain";
+import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
+import { listFilter } from "@/utils/list-utlis";
+import { useDialog } from "@/components/cy/CyDialog/index";
+import { xcMessage } from "@/utils/xiaochan-element-plus";
+
+const EditorDialog = defineAsyncComponent(() => import("./EditorDialog.vue"));
+
+const operations = [
+  { code: "p", name: "手术" },
+  { code: "x", name: "材料" },
+  { code: "o", name: "其他" },
+  { code: "s", name: "输血" },
+];
+
+const store = reactive({
+  // 项目属性
+  changeItemType: [],
+  // 手术分类
+  ssType: [],
+  currentOrderChange: {
+    orderCode: null,
+  },
+  orderItem: [],
+  searchValue: "",
+  flag: "0",
+  mainTableLoading: false,
+
+  // 这个费用的子项
+  changeItem: [],
+
+  // 搜索到的数据
+  searchChangeData: [],
+});
+
+const tableRef = shallowRef();
+
+const dataTmp = computed(() => {
+  if (store.searchValue === "") {
+    return store.orderItem;
+  }
+
+  return listFilter(store.orderItem, store.searchValue, [
+    "orderName",
+    "orderCode",
+    "pyCode",
+    "wCode",
+  ]);
+});
+
+async function handleRadioChange() {
+  store.mainTableLoading = true;
+  store.orderItem = await api
+    .getOrderItem(store.flag)
+    .finally(() => (store.mainTableLoading = false));
+}
+
+function checkBoxValue(value) {
+  return value === "1";
+}
+
+function getChangeItem({ row }) {
+  api.getChangeItem(row.orderCode).then(data => {
+    store.changeItem = data;
+    store.currentOrderChange = row;
+  });
+}
+
+async function searchChangeItemMethod(value) {
+  store.searchChangeData = await api.searchChangeItem(value);
+}
+
+function openAddEditorDialog() {
+  openEditorDialog({
+    orderCode: null,
+    orderName: "",
+    orderClass: null,
+    operation: null,
+    delFlag: "0",
+    excluGroupType: "0",
+    qjFlag: "0",
+    frequType: "0",
+    ypFlag: "0",
+    jyType: "0",
+    execDept: "",
+    ssType: null,
+    discription: "",
+    ybComment: "",
+    nCode: "",
+  }).then(res => {
+    store.orderItem.push(res);
+  });
+}
+
+function openEditorDialog(data) {
+  return useDialog(EditorDialog, {
+    dialogProps: {
+      title: "医嘱编辑",
+    },
+    params: {
+      data: data,
+      changeType: store.changeItemType,
+      ssType: store.ssType,
+      operations,
+    },
+    confirmText: "保存",
+  })
+    .then(res => {
+      Object.assign(data, res);
+      return res;
+    })
+    .catch(() => {});
+}
+
+function findOperationName(value) {
+  const find = operations.find(v => v.code === value);
+  return find ? find.name : "";
+}
+
+async function handleDelFlag(data, value) {
+  const delFlag = value ? "1" : "0";
+  await api.setDelFlag({
+    orderCode: data.orderCode,
+    delFlag: delFlag,
+  });
+  data.delFlag = delFlag;
+}
+
+async function saveChangeItemDetails() {
+  if (store.currentOrderChange.orderCode == null) return 0;
+
+  const tmp = store.changeItem.filter(item => {
+    return item.occCode !== null;
+  });
+  await api.saveOrderOccurence({
+    orderCode: store.currentOrderChange.orderCode,
+    orderItem: tmp,
+  });
+}
+
+function addChangeItemDetails() {
+  if (store.currentOrderChange.orderCode == null) {
+    xcMessage.error("请先选着医嘱项目");
+    return 0;
+  }
+  store.changeItem.push({
+    occCode: null,
+    name: "",
+    amount: 1,
+    price: 0,
+    orderCode: "",
+    isAdd: true,
+  });
+}
+
+function handleChangeItemRowClick(row, data) {
+  data.isUpdate = true;
+  data.occCode = row.code;
+  data.name = row.name;
+  data.amount = 1;
+  data.price = row.price;
+  data.orderCode = store.currentOrderChange.orderCode;
+}
+
+onMounted(async () => {
+  store.changeItemType = await api.getChangeItemType();
+  store.ssType = await api.getSsType();
+  handleRadioChange();
+});
+</script>
+
+<template>
+  <div class="layout_container">
+    <header>
+      <el-input v-model="store.searchValue" style="width: 220px" clearable />
+      <el-radio-group v-model="store.flag" @change="handleRadioChange">
+        <el-radio value="0">在用</el-radio>
+        <el-radio value="1">停用</el-radio>
+        <el-radio value="all">全部</el-radio>
+      </el-radio-group>
+    </header>
+    <div class="layout_main">
+      <vxe-table
+        border
+        ref="tableRef"
+        :row-config="{
+          keyField: 'orderCode',
+          isCurrent: true,
+        }"
+        show-overflow
+        @cellClick="getChangeItem"
+        height="60%"
+        :edit-config="{ mode: 'row', trigger: 'manual', autoClear: false }"
+        :data="dataTmp"
+        :scroll-y="{ enabled: true, gt: 0 }"
+      >
+        <vxe-column field="delFlag" title="停用" width="60">
+          <template #default="{ row }">
+            <el-checkbox
+              :modelValue="checkBoxValue(row.delFlag)"
+              @update:modelValue="
+                value => {
+                  handleDelFlag(row, value);
+                }
+              "
+            />
+          </template>
+        </vxe-column>
+        <vxe-column field="orderClassName" title="属性" width="120">
+        </vxe-column>
+        <vxe-column field="orderCode" title="编码" width="120" />
+        <vxe-column field="orderName" title="名称" width="190" />
+        <vxe-column field="excluGroupType" title="排斥" width="60">
+          <template #default="{ row }">
+            {{ row.excluGroupType === "1" ? "是" : "否" }}
+          </template>
+        </vxe-column>
+        <vxe-column title="描述" width="220" field="discription"></vxe-column>
+        <vxe-column title="医嘱类型" width="90" field="operation">
+          <template #default="{ row }">
+            {{ findOperationName(row.operation) }}
+          </template>
+        </vxe-column>
+
+        <vxe-column field="qjFlag" title="抢救" width="60">
+          <template #default="{ row }">
+            {{ row.qjFlag === "1" ? "是" : "否" }}
+          </template>
+        </vxe-column>
+
+        <vxe-column field="frequType" title="长期" width="60">
+          <template #default="{ row }">
+            {{ row.frequType === "1" ? "是" : "否" }}
+          </template>
+        </vxe-column>
+
+        <vxe-column field="ypFlag" title="药品" width="60">
+          <template #default="{ row }">
+            {{ row.ypFlag === "1" ? "是" : "否" }}
+          </template>
+        </vxe-column>
+
+        <vxe-column field="jyType" title="检验" width="60">
+          <template #default="{ row }">
+            {{ row.jyType === "1" ? "是" : "否" }}
+          </template>
+        </vxe-column>
+        <vxe-column field="jyTypeName" title="检验" width="90" />
+        <vxe-column title="执行科室" width="150" field="execDeptName" />
+        <vxe-column title="医保备注" field="ybComment" width="220" />
+        <vxe-column title="操作" width="90" fixed="right">
+          <template #header>
+            <el-button @click="openAddEditorDialog"> 新增</el-button>
+          </template>
+          <template #default="{ row }">
+            <el-button @click.stop.prevent="openEditorDialog(row)"
+              >编辑
+            </el-button>
+          </template>
+        </vxe-column>
+      </vxe-table>
+
+      <vxe-table height="40%" :data="store.changeItem">
+        <vxe-column title="名称" field="occCode" width="120"></vxe-column>
+        <vxe-column title="项目编码" field="name" width="250">
+          <template #default="scope">
+            <CyComboGrid
+              style="width: 100%"
+              v-model="scope.row"
+              placement="top-start"
+              @rowClick="
+                ({ row }) => {
+                  handleChangeItemRowClick(row, scope.row);
+                }
+              "
+              label="name"
+              :data="store.searchChangeData"
+              value="occCode"
+              :remote-method="searchChangeItemMethod"
+              :table-header="[
+                { name: '项目编码', code: 'code', width: '90px' },
+                { name: '名字', code: 'name', width: '250px' },
+                { name: '单价', code: 'price', width: '120px' },
+                { name: '执行科室', code: 'execDeptName', width: '90px' },
+              ]"
+            />
+          </template>
+        </vxe-column>
+        <vxe-column title="数量" field="amount">
+          <template #default="{ row }">
+            <el-input-number
+              v-model="row.amount"
+              @change="
+                () => {
+                  row.isUpdate = true;
+                }
+              "
+            />
+          </template>
+        </vxe-column>
+        <vxe-column title="金额" field="price" />
+        <vxe-column title="医嘱码" field="orderCode" />
+        <vxe-column>
+          <template #header>
+            <el-button v-el-btn="saveChangeItemDetails">保存</el-button>
+            <el-button @click="addChangeItemDetails">新增子项</el-button>
+          </template>
+          <template #default="{ rowIndex }">
+            <el-button
+              @click="store.changeItem.splice(rowIndex, 1)"
+              type="danger"
+              >删除
+            </el-button>
+          </template>
+        </vxe-column>
+      </vxe-table>
+    </div>
+  </div>
+</template>

+ 42 - 0
src/views/dictionary/orderZdMaintain/index.ts

@@ -0,0 +1,42 @@
+import { reactive } from "vue";
+
+const OrderItem = defineAsyncComponent(
+  () => import("./compoents/orderitem/OrderIten.vue")
+);
+
+export const tabsList = [
+  {
+    name: "医嘱项目",
+    component: OrderItem,
+  },
+  // {
+  //   name: "执行频率",
+  //   component: "",
+  // },
+  // {
+  //   name: "给药方式",
+  //   component: "",
+  // },
+  // {
+  //   name: "检验分类",
+  //   component: "",
+  // },
+  // {
+  //   name: "手术分类",
+  //   component: "",
+  // },
+];
+
+export const useStore = () => {
+  const store = reactive({
+    changeItemType: [] as { code: string; name: string }[],
+    tagValue: tabsList[0].name,
+  });
+
+  return {
+    store,
+  };
+};
+
+export const storeKey = "orderZdMaintain";
+export type useStoreType = ReturnType<typeof useStore>;

+ 26 - 0
src/views/dictionary/orderZdMaintain/index.vue

@@ -0,0 +1,26 @@
+<script setup lang="ts">
+//医嘱的字典准备
+import * as order from "@/views/dictionary/orderZdMaintain/index";
+
+defineComponent({
+  name: "orderZdMaintain",
+});
+const root = order.useStore();
+provide(order.storeKey, root);
+</script>
+
+<template>
+  <el-tabs v-model="root.store.tagValue" class="el-tabs__fill">
+    <el-tab-pane
+      v-for="item in order.tabsList"
+      :key="item.name"
+      lazy
+      :label="item.name"
+      :name="item.name"
+    >
+      <Component :is="item.component" />
+    </el-tab-pane>
+  </el-tabs>
+</template>
+
+<style lang="scss"></style>

+ 2 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.ts

@@ -1181,3 +1181,5 @@ export const openPatientImage = (
 };
 
 export const yzInfoPrompt: Ref<string[]> = ref([]);
+
+export const yzZdOrderItemConfirm = ref({});

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 547 - 394
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TemplateMaintenance.vue


+ 5 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -39,6 +39,7 @@
 import {
   confirmYzCheck,
   deleteMultipleOrders,
+  getYzZdOrderItemConfirm,
   insertTemplateOrder,
 } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import {
@@ -54,6 +55,7 @@ import {
   yzData,
   yzMitt,
   YzType,
+  yzZdOrderItemConfirm,
   zkList,
 } from "../public-js/zhu-yuan-yi-sheng";
 import { stringIsBlank } from "@/utils/blank-utils";
@@ -326,6 +328,9 @@ const batchDeleteOrdersClick = () => {
 };
 
 onMounted(async () => {
+  getYzZdOrderItemConfirm().then(res => {
+    yzZdOrderItemConfirm.value = res;
+  });
   yzMitt.on("allergen", allergen.value.open);
   yzMitt.on("clickOnTheOrderTemplate", clickOnTheOrderTemplate);
   yzMitt.on("rowClick", rowClick);

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است