浏览代码

更新 提示及跳转

王智慧 3 年之前
父节点
当前提交
d2fdb5e6ea
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 15 2
      src/components/ShipInfo.vue

+ 15 - 2
src/components/ShipInfo.vue

@@ -454,13 +454,26 @@ async function submit() {
     return;
   }
   isSubmitLoading.value = true;
-  let res = await api.addShip({
+  let { data } = await api.addShip({
     ...props.shipInfos[currentIndex.value],
     shipOwnerId: props.shipOwnerId,
   });
   isSubmitLoading.value = false;
   store.commit("removeAlive", "shipOwnerList");
-  router.replace("/shipOwnerManage/shipOwnerList");
+  if (data.status == 0) {
+    ElMessage({
+      type: "success",
+      message: data.msg,
+      duration: 1500,
+    });
+    router.replace("/shipOwnerManage/shipOwnerList");
+  } else {
+    ElMessage({
+      type: "warning",
+      message: data.msg,
+      duration: 2500,
+    });
+  }
 }
 
 let shipInfoDisabled = ref(true);