Browse Source

更新 loading

wzg 2 years ago
parent
commit
e1e2e56411
1 changed files with 17 additions and 4 deletions
  1. 17 4
      src/views/order/orderDetail.vue

+ 17 - 4
src/views/order/orderDetail.vue

@@ -94,7 +94,7 @@
     </div>
   </div>
   <div class="line-container-p24" v-auth="'VOYAGEINFO'">
-    <el-button-group>
+    <el-button-group class="mb30">
       <el-button
         v-for="(item, index) in orderDetail.voyages"
         size="small"
@@ -1923,7 +1923,12 @@ import { useRoute } from "vue-router";
 import _ from "lodash";
 import router from "../../router";
 import store from "../../store";
-import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
+import {
+  ElNotification,
+  ElMessageBox,
+  ElMessage,
+  ElLoading,
+} from "element-plus";
 import downloadBlobFile from "../../utils/downloadBlobFile";
 import url from "../../apis/config";
 import { subTimeStr } from "utils/utils";
@@ -1939,8 +1944,14 @@ let previewSrcList = ref([]);
 let shipAudits = ref([]);
 let shipownerUploadFiles = ref([]);
 let voyageId = ref("");
-
+let loading = ref({});
 async function getVoyageDetail(isInit) {
+  loading.value = ElLoading.service({
+    lock: true,
+    text: "加载中...",
+    spinner: "el-icon-loading",
+    background: "rgba(0, 0, 0, 0.7)",
+  });
   previewList.value = [];
   policyFileList.value = [];
   voyageBill.value = [];
@@ -1994,6 +2005,7 @@ async function getVoyageDetail(isInit) {
       } catch (error) {}
     }
   } else {
+    loading.value.close();
     console.log(res);
     ElNotification({
       type: "error",
@@ -2208,6 +2220,7 @@ function initMap() {
       map.value.add(overlayGroups);
       map.value.setFitView(markers, true, [200, 50, 0, 0], 18);
       clearTimeout(t);
+      loading.value.close();
     }, 2000);
   });
 }
@@ -3222,7 +3235,7 @@ let currentVoyageIndex = ref(0);
 function changeVoyage(index) {
   currentVoyageIndex.value = index;
   voyageId.value = orderDetail.value.voyages[index].id;
-  getVoyageDetail();
+  getVoyageDetail(true);
 }
 onMounted(() => {
   getOrderDetail();