|
@@ -18,7 +18,7 @@
|
|
|
title="添加船东"
|
|
title="添加船东"
|
|
|
v-model="dialogFormVisible"
|
|
v-model="dialogFormVisible"
|
|
|
@closed="resetForm"
|
|
@closed="resetForm"
|
|
|
- distory
|
|
|
|
|
|
|
+ destroy-on-close
|
|
|
>
|
|
>
|
|
|
<template v-slot:default>
|
|
<template v-slot:default>
|
|
|
<el-form
|
|
<el-form
|
|
@@ -32,12 +32,14 @@
|
|
|
<el-input
|
|
<el-input
|
|
|
style="width: 280px"
|
|
style="width: 280px"
|
|
|
v-model="ruleForm.userPhone"
|
|
v-model="ruleForm.userPhone"
|
|
|
|
|
+ :disabled="!!ruleForm.userId"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="userName" label="船东姓名">
|
|
<el-form-item prop="userName" label="船东姓名">
|
|
|
<el-input
|
|
<el-input
|
|
|
style="width: 280px"
|
|
style="width: 280px"
|
|
|
v-model="ruleForm.userName"
|
|
v-model="ruleForm.userName"
|
|
|
|
|
+ :disabled="!!ruleForm.userId"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="shipMmsi" label="MMSI">
|
|
<el-form-item prop="shipMmsi" label="MMSI">
|
|
@@ -144,7 +146,6 @@ let ruleForm = ref({
|
|
|
shipMmsi: "",
|
|
shipMmsi: "",
|
|
|
});
|
|
});
|
|
|
async function resetForm() {
|
|
async function resetForm() {
|
|
|
- dialogFormVisible.value = false;
|
|
|
|
|
form.value.resetFields();
|
|
form.value.resetFields();
|
|
|
ruleForm.value = {};
|
|
ruleForm.value = {};
|
|
|
}
|
|
}
|
|
@@ -157,7 +158,22 @@ const checkShipOwnerPhone = async (rule, value, callback) => {
|
|
|
userPhone: value,
|
|
userPhone: value,
|
|
|
});
|
|
});
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
- callback(new Error("此手机号已绑定船东!"));
|
|
|
|
|
|
|
+ ElMessageBox.confirm("已查询到船东信息,是否匹配?", "提示", {
|
|
|
|
|
+ confirmButtonText: "匹配",
|
|
|
|
|
+ cancelButtonText: "更换手机号",
|
|
|
|
|
+ type: "info",
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ruleForm.value = {
|
|
|
|
|
+ ...ruleForm.value,
|
|
|
|
|
+ ...res.data.result,
|
|
|
|
|
+ };
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ ruleForm.value.userPhone = "";
|
|
|
|
|
+ ruleForm.value.userId = "";
|
|
|
|
|
+ ruleForm.value.userName = "";
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
@@ -214,6 +230,7 @@ async function addShipOwner() {
|
|
|
type: "success",
|
|
type: "success",
|
|
|
});
|
|
});
|
|
|
resetForm();
|
|
resetForm();
|
|
|
|
|
+ dialogFormVisible.value = false;
|
|
|
getShipOwnerList();
|
|
getShipOwnerList();
|
|
|
} else {
|
|
} else {
|
|
|
ElNotification.error({
|
|
ElNotification.error({
|