浏览代码

更新 字段验证

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

+ 14 - 0
src/components/ShipInfo.vue

@@ -439,6 +439,20 @@ async function submit() {
     });
     return;
   }
+  if (!props.shipInfos[currentIndex.value].contentShipOwnerName) {
+    ElMessage({
+      type: "warning",
+      message: "请填写联系人姓名",
+    });
+    return;
+  }
+  if (!props.shipInfos[currentIndex.value].contentShipOwnerPhone) {
+    ElMessage({
+      type: "warning",
+      message: "请填写联系人手机号",
+    });
+    return;
+  }
   isSubmitLoading.value = true;
   let res = await api.addShip({
     ...props.shipInfos[currentIndex.value],