xiaochan 1 year ago
parent
commit
63f2656912

+ 3 - 3
src/App.vue

@@ -175,7 +175,7 @@ function getWindowSize() {
 </script>
 
 <style lang="scss">
-::-webkit-scrollbar:not(.cy-dialog__dialog) {
+::-webkit-scrollbar {
   width: 10px;
   height: 10px;
 
@@ -185,7 +185,7 @@ function getWindowSize() {
 
 }
 
-::-webkit-scrollbar-thumb:not(.cy-dialog__dialog) {
+::-webkit-scrollbar-thumb {
   border-radius: 4px;
   background: rgba(144, 147, 153, .3);
 
@@ -194,7 +194,7 @@ function getWindowSize() {
   }
 }
 
-::-webkit-scrollbar-button:not(.cy-dialog__dialog) {
+::-webkit-scrollbar-button {
   width: 0;
   height: 0;
   display: none;

+ 3 - 1
src/components/cy/combo-grid/src/CyComboGrid.vue

@@ -40,7 +40,7 @@ export declare type CyComboGridOptions = {
 }
 
 const props = withDefaults(defineProps<CyComboGridOptions>(), {
-  placement: 'bottom',
+  placement: 'bottom-start',
   teleported: true,
   select: true,
   effect: 'light',
@@ -67,6 +67,8 @@ const emits = defineEmits<{
   (e: 'update:data', value: any): void,
   (e: 'visible-change', value: boolean): void,
   (e: 'rowClick', value: any): void,
+  (e: 'clear'): void,
+  (e: 'focus'): void,
 }>()
 
 const {

+ 30 - 22
src/components/cy/combo-grid/src/index.ts

@@ -115,6 +115,7 @@ export default function UesComboGrid(props: CyComboGridOptionsV2, emits: any) {
             afterFocus() {
                 expanded.value = true
                 states.menuVisibleOnFocus = true
+                emits('focus')
             },
             beforeBlur(event) {
                 return (tooltipRef.value?.isFocusInsideContent(event))
@@ -281,37 +282,44 @@ export default function UesComboGrid(props: CyComboGridOptionsV2, emits: any) {
     }
 
     const handleClearClick = () => {
-        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
+        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: any) => {
         states.hoveringIndex = val.rowIndex
-        emits('rowClick', val)
         updateModel(val.row)
-        if (!props.multiple)
+        if (!props.multiple) {
             toggleMenu()
+        }
+        emits('rowClick', val)
     }
 
     function toggleMenu() {

+ 0 - 6
src/components/cy/combo-grid/style/index.scss

@@ -165,12 +165,6 @@
   //--vxe-table-row-height-default: 20px;
   --vxe-table-cell-padding-left: 5px;
   --vxe-table-cell-padding-right: 5px;
-
-  .vxe-table--body-wrapper {
-    &::-webkit-scrollbar {
-      width: 15px !important;
-    }
-  }
 }
 
 

+ 0 - 2
src/components/cy/dialog/CyDialogTest.vue

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import {openDrugManual} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
-import {ElDialog} from 'element-plus'
 
 function open() {
   openDrugManual('01195', '01').then(res => {
@@ -15,7 +14,6 @@ function open() {
   <el-button @click="open">
     打开
   </el-button>
-  <el-input></el-input>
 
 </template>
 

+ 6 - 2
src/components/cy/dialog/src/CyDialog.vue

@@ -4,7 +4,11 @@ import {
   useZIndex,
   ElFocusTrap
 } from 'element-plus'
-import {CyDialogProps, IsCyDialog, UseCyDialog} from "@/components/cy/dialog/src/useCyDialog";
+import {
+  CyDialogProps,
+  IsCyDialog,
+  UseCyDialog
+} from "@/components/cy/dialog/src/useCyDialog";
 import './cy-dialog.scss'
 
 const COMPONENT_NAME = 'CyDialog'
@@ -56,7 +60,6 @@ export default defineComponent({
             ns.is('fullScreen' , fullScreen)
         ]"
         >
-
           <header
               ref="headerRef"
               :class="[
@@ -96,6 +99,7 @@ export default defineComponent({
                 style="margin-right: 15px"
                 @click="handleConfirm"
                 size="default"
+                :loading="state.confirmLoading"
                 type="primary"
             >
               {{ confirmText ?? '确认' }}

+ 35 - 20
src/components/cy/dialog/src/useCyDialog.ts

@@ -34,6 +34,10 @@ export const CyDialogProps = {
     bodyWidth: {
         type: [Number, String],
         default: '500px'
+    },
+    ignoreError: {
+        type: Boolean,
+        default: false
     }
 }
 
@@ -55,6 +59,8 @@ export function UseCyDialog(props: IsCyDialog) {
         },
         headerHeight: 0,
         footerHeight: 0,
+        confirmLoading: false,
+        cancelLoading: false
     })
 
     const draggable = computed(() => {
@@ -91,42 +97,51 @@ export function UseCyDialog(props: IsCyDialog) {
     useDraggable(boxRef, headerRef, draggable)
 
     function closed(closingMethod, ...val) {
-        compList.value[ctx?.attrs.id].onClosed(closingMethod, val)
-
+        compList.value[ctx?.attrs.id]?.onClosed(closingMethod, val)
     }
 
-    function handleConfirm() {
-        let value = null
-        let isDone = true
 
-        function next(val) {
-            isDone = false
+    async function handleConfirm() {
+        state.confirmLoading = true;
+
+        function next(...val) {
             closed(ClosingMethod.CONFIRM, val)
         }
 
         if (props.confirmClick) {
-            isDone = false
-            props.confirmClick(next)
+            try {
+                await props.confirmClick(next)
+            } catch (e) {
+                console.error(e)
+            } finally {
+                state.confirmLoading = false;
+            }
+            return
         }
-
-        isDone && next(value)
+        state.confirmLoading = false;
+        next(null)
     }
 
-    function handleCancel() {
-        let value = null
-        let isDone = true
+    async function handleCancel() {
+        state.cancelLoading = true;
 
-        function next(val) {
-            isDone = false
-            closed(ClosingMethod.CANCEL, val)
+        function next(...val) {
+            closed(props.ignoreError ? ClosingMethod.CONFIRM : ClosingMethod.CANCEL, val)
         }
 
         if (props.cancelClick) {
-            isDone = false
-            props.cancelClick(next)
+            try {
+                await props.cancelClick(next)
+            } catch (e) {
+                console.error(e)
+            } finally {
+                state.cancelLoading = false;
+            }
+            return
         }
 
-        isDone && next(value)
+        state.cancelLoading = false;
+        next(null)
     }
 
     function onFocusoutPrevented(event: CustomEvent) {

+ 1 - 0
src/components/zhu-yuan-yi-sheng/he-li-yong-yao/YaoPingXiangQing.vue

@@ -1,6 +1,7 @@
 <template>
   <cy-dialog title="药品说明书"
              body-height="500px"
+             ignore-error
   >
     <iframe v-if="showIframe"
             style="width: 100%;height: 100%;margin: 0;padding: 0;border: 0"

+ 2 - 1
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/DialogDiseases.vue

@@ -464,7 +464,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="抗-HBcIgM:" prop="vkhbcigm">
-                <el-input v-model="sheetData.vkhbcigm" maxlength="120" />
+                <el-input v-model="sheetData.vkhbcigm" maxlength="120"/>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -664,6 +664,7 @@ const confirm = async () => {
     await formRef.value.validate()
   } catch {
     xcMessage.error('有必填项不能为空。')
+    return Promise.reject('有必填项不能为空')
   }
   if (stringIsBlank(sheetData.value.cardNo)) {
     await confirmCrb(sheetData.value)

+ 9 - 25
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/ReportOfInfectiousDiseases.vue

@@ -1,49 +1,33 @@
 <template>
-  <el-dialog v-model="dialog"
-             title="传染病上报"
-             fullscreen
-             @closed="closed">
+  <CyDialog title="传染病上报"
+            fullScreen
+            ignore-error
+            :confirm-click="confirm"
+            confirm-text="保存"
+  >
     <div v-if="props.prompt">
       <el-alert :title="`诊断:${props.prompt}为传染病填写后才能保存病历`" type="error" effect="dark"/>
     </div>
     <dialog-diseases :pat-no="props.patNo"
                      :times="props.times"
                      ref="dialogRef"/>
-    <template #footer>
-      <el-button @click="dialog = false" type="danger">取消</el-button>
-      <el-button v-el-btn="confirm" type="primary">确认</el-button>
-    </template>
-  </el-dialog>
-
+  </CyDialog>
 </template>
 
 <script setup lang="ts">
 import DialogDiseases from "./DialogDiseases.vue";
 import {ref} from 'vue'
-import {ClosingMethod} from "@/components/js-dialog-comp/useDialogToJs";
-import sleep from "@/utils/sleep";
+import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
 
-export declare type  PropsType = {
+export declare type PropsType = {
   patNo: string,
   times: number,
   prompt?: string
 }
 
 const props = defineProps<PropsType>()
-
-const emits = defineEmits<{
-  (e: "closed", closingMethod: ClosingMethod, ...val: any[]): void,
-}>()
-
-
-const dialog = ref(true)
 const dialogRef = ref(null)
 
-
-function closed() {
-  emits('closed', ClosingMethod.CONFIRM)
-}
-
 const confirm = async () => {
   await dialogRef.value.confirm()
 }

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

@@ -12,8 +12,9 @@
         <div>
           医嘱名称:
           <CyComboGrid
+              table-width="1200px"
               ref="searchRef"
-              style="width: 240px"
+              style="width: 220px"
               v-model="yiZhuData"
               :disabled="isEdit"
               value="orderCode"
@@ -22,8 +23,7 @@
               @rowClick="({row}) => searchClickFunc(row)"
               :table-header="tableHeaderV2"
               :rowHeight="30"
-          >
-          </CyComboGrid>
+          />
         </div>
         <div class="input__style">
           {{ yiZhuData.drugSpecification }}
@@ -124,14 +124,15 @@
         </div>
         <div>
           执行科室:
-          <xc-select-v3
-              style="width: 120px"
+          <CyComboGrid
               v-model="yiZhuData"
+              style="width: 120px"
               :data="zhiXingKeShiData"
               id="yz_execUnit"
-              code="execUnit"
-              name="execUnitName"
-              :remote-method="metZhiXingKeShi"/>
+              value="execUnit"
+              label="execUnitName"
+              :remote-method="metZhiXingKeShi"
+          />
         </div>
       </div>
       <div class="yz_input__box">
@@ -141,16 +142,20 @@
         </div>
         <div>
           父医嘱:
-          <xc-combo-grid v-model="yiZhuData.parentNoName"
-                         style="width: 120px;"
-                         placeholder="父医嘱"
-                         clearable
-                         :disabled="supplyDisabled()"
-                         @clear="clearDoctorSOrder"
-                         @focus="fuYiZhuClick"
-                         @rowClick="modifyDosingMethod"
-                         :table-header="parentOrder"
-                         :data="fuYiZhuData"/>
+          <CyComboGrid
+              v-model="yiZhuData"
+              style="width: 120px;"
+              placeholder="父医嘱"
+              clearable
+              :disabled="supplyDisabled()"
+              @clear="clearDoctorSOrder"
+              @focus="fuYiZhuClick"
+              @rowClick="({row}) => modifyDosingMethod(row)"
+              :table-header="parentOrder"
+              :data="fuYiZhuData"
+              value="parentNo"
+              label="parentNoName"
+          />
         </div>
         <div :title="yiZhuData.discription" class="div_center__box">
           描述:
@@ -246,8 +251,6 @@ import {
   toDeleteAnOrder, YaoPingJiLiang
 } from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
 import {listNotBlank, listToStr, stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
-import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid";
-import XcSelectV3 from "@/components/xiao-chan/select-v3/XcSelectV3";
 import XcOption from "@/components/xiao-chan/select/XcOption";
 import XcSelect from "@/components/xiao-chan/select/XcSelect";
 import XcCheckbox from "@/components/xiao-chan/checkbox/XcCheckbox";
@@ -307,10 +310,10 @@ const props = withDefaults(defineProps<{
   patientInfo: null,
 })
 
-let parentOrder = [
-  {prop: 'actOrderNo', label: "医嘱号"},
-  {prop: 'orderName', label: "医嘱名称", width: 250},
-  {prop: 'orderTime', label: "时间"}
+const parentOrder = [
+  {code: 'actOrderNo', name: "医嘱号", width: 90},
+  {code: 'orderName', name: "医嘱名称", width: 160},
+  {code: 'orderTime', name: "时间", width: 150}
 ]
 
 const searchOrders = (val) => {
@@ -617,19 +620,21 @@ const metZhiXingKeShi = (val) => {
 /* 父医嘱 */
 const fuYiZhuData = ref([])
 const fuYiZhuClick = () => {
-  fuYiZhuData.value = []
+  fuYiZhuData.value = [];
 
   XEUtils.lastArrayEach(yzData.value, (item) => {
     let {statusFlag, serial, parentNo, drugFlag, actOrderNo} = item
     if (statusFlag === '1') {
       if (serial !== '00' && stringIsBlank(parentNo) && drugFlag !== 'd') {
         if (yiZhuData.value.actOrderNo !== actOrderNo) {
+          const tempData = XEUtils.clone(item, true)
+          tempData.value = actOrderNo
+          tempData.label = item.orderName
           fuYiZhuData.value.push(item)
         }
       }
     }
   })
-
 }
 
 const modifyDosingMethod = (val) => {

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

@@ -159,7 +159,7 @@
               传染病上报
             </el-dropdown-item>
             <el-dropdown-item
-                @click="router.push('/outpatient/chronicDisease/chronicDiseaseRegister')">
+                @click="router.push(`/outpatient/chronicDisease/chronicDiseaseRegister/${props.patientInfo.inpatientNo}`)">
               慢病登记
             </el-dropdown-item>
           </el-dropdown-menu>

+ 2 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -593,13 +593,13 @@ const emrEvent = {
   },
   "beforeCopy": (evt, data) => {
     if (!copy) {
-      xcMessage.warning('')
+      xcMessage.warning('无法复制粘贴')
     }
     return copy
   },
   "beforePaste": (evt, data) => {
     if (!copy) {
-      xcMessage.warning('')
+      xcMessage.warning('无法复制粘贴')
     }
     return copy
   }