Browse Source

添加查询 的加载状态

xiaochan 2 years ago
parent
commit
f0b93a6b14

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

@@ -42,6 +42,7 @@
         </el-button>
 
         <el-button type="success"
+                   :loading="confirmLoading"
                    @click="currentConfirmOrdersClick"
                    v-if="!isCydy()">
           确认
@@ -221,7 +222,7 @@ import {
   huoQuYiZhuShuJu, stopOrder
 } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import {
-  associateOrders, clearAssociate,
+  associateOrders, clearAssociate, confirmLoading,
   errorMsg, huanZheXinXi,
   isCydy,
   queryParam, yiZhuData, yiZhuDataInit, youWuXuanZheHuanZhe,
@@ -294,6 +295,8 @@ const confirmTheDoctorSOrderWithMedicineClick = () => {
   if (!props.patientInfo.inpatientNo) {
     BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
   }
+  confirmLoading.value = true
+
   confirmTheDoctorSOrderWithMedicine(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then((res) => {
     if (res?.error) {
       errorMsg.value.type = 3
@@ -301,6 +304,7 @@ const confirmTheDoctorSOrderWithMedicineClick = () => {
       errorMsg.value.data = res.data
     } else {
       queryYz()
+      confirmLoading.value = false
     }
   })
 }

+ 16 - 6
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.ts

@@ -3,7 +3,7 @@ import {stringIsBlank, stringNotBlank} from "../../../../utils/blank-utils";
 import {ElMessage} from "element-plus";
 import {getPatientInfo} from "../../../../api/inpatient/patient";
 import {BizException, ExceptionEnum} from "../../../../utils/BizException";
-import {nextTick, ref} from "vue";
+import {nextTick, Ref, ref} from "vue";
 import {getServerDateApi} from "../../../../api/public-api";
 import {getFormatDatetime} from "../../../../utils/date";
 import {isDev} from "../../../../utils/public";
@@ -516,8 +516,14 @@ export const getYzIndex = (key) => {
     }
 }
 
+interface yZErrorType {
+    dialog: boolean
+    type: number
+    data: any
+}
+
 // 错误信息
-export const errorMsg = ref({
+export const errorMsg: Ref<yZErrorType> = ref({
     dialog: false,
     type: 1,
     data: {}
@@ -525,7 +531,6 @@ export const errorMsg = ref({
 
 // 添加新地会诊申请
 export const consultationApplication = ref(false)
-
 // 添加手术申请
 export const operationApplication = ref([])
 // 添加检查申请
@@ -567,7 +572,7 @@ export const clickOnThePatient = async (patNo) => {
 }
 
 
-const switchPatients = () => {
+const switchPatients = (): boolean => {
     let str = ''
     if (stringNotBlank(yiZhuData.value.actOrderNo) && yiZhuData.value.statusFlag === '1') {
         if (yiZhuData.value.actOrderNo !== addTempOrderNo) {
@@ -601,11 +606,14 @@ const switchPatients = () => {
 }
 
 // 是出院带药
-export function isCydy() {
+export function isCydy(): boolean {
     return queryParam.value.frequCode === frequCodeEnum.takeMedicine;
 }
 
-export const associateOrders = ref({
+export const associateOrders = ref<{
+    actOrderNo: number | null,
+    associatedGroup: []
+}>({
     actOrderNo: null,
     associatedGroup: []
 })
@@ -668,3 +676,5 @@ export const yzSize = ref({
     w: 0,
     h: 0
 })
+
+export const confirmLoading = ref<boolean>(false)

+ 3 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -59,7 +59,7 @@ import {
   clickOnThePatient,
   drugManual,
   associateOrders,
-  youWuXuanZheHuanZhe, yzData, errorMsg, yzMitt, geiYaoFangShiData, yaoPinPingLvData
+  youWuXuanZheHuanZhe, yzData, errorMsg, yzMitt, geiYaoFangShiData, yaoPinPingLvData, confirmLoading
 } from '../public-js/zhu-yuan-yi-sheng'
 import store from '@/store'
 import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
@@ -123,10 +123,12 @@ const confirmOrdersClick = async () => {
 
 // 真正的向后台确认医嘱
 const confirmOrder = async () => {
+  confirmLoading.value = true
   // 确认医嘱
   await yzEditorRef.value.confirmOrdersClick()
   // 查询医嘱
   await yzMitt.emit('queryYz');
+  confirmLoading.value = false
 }
 
 const rowClick = (val) => {