|
@@ -484,18 +484,20 @@
|
|
|
绑定船舶
|
|
绑定船舶
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="df jcc mt30 mb30" v-if="!route.query.shipOwnerId">
|
|
|
|
|
- <el-button @click="router.replace('/shipOwnerManage/shipOwnerList')">
|
|
|
|
|
- 取消
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :loading="saveShipOwnerLoading"
|
|
|
|
|
- @click="saveShipOwner"
|
|
|
|
|
- >
|
|
|
|
|
- 保存
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="line-container-p24" v-if="!route.query.shipOwnerId">
|
|
|
|
|
+ <div class="df jcfe">
|
|
|
|
|
+ <el-button @click="router.replace('/shipOwnerManage/shipOwnerList')">
|
|
|
|
|
+ 取消
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="saveShipOwnerLoading"
|
|
|
|
|
+ @click="saveShipOwner"
|
|
|
|
|
+ >
|
|
|
|
|
+ 保存
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -774,6 +776,9 @@ const handleIdCardFrontSuccess = ({ response: data }) => {
|
|
|
shipOwnerForm.value.idcardFrontFileKey = data.result.key;
|
|
shipOwnerForm.value.idcardFrontFileKey = data.result.key;
|
|
|
shipOwnerForm.value.idcardFrontViewUrl = data.result.viewUrl;
|
|
shipOwnerForm.value.idcardFrontViewUrl = data.result.viewUrl;
|
|
|
shipOwnerForm.value.idcardFrontDownloadUrl = data.result.downloadUrl;
|
|
shipOwnerForm.value.idcardFrontDownloadUrl = data.result.downloadUrl;
|
|
|
|
|
+ ElMessage.success("上传成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(data.msg || "上传失败");
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
// 身份证国徽面上传处理
|
|
// 身份证国徽面上传处理
|
|
@@ -782,6 +787,7 @@ const handleIdCardBackSuccess = ({ response: data }) => {
|
|
|
shipOwnerForm.value.idcardBackFileKey = data.result.key;
|
|
shipOwnerForm.value.idcardBackFileKey = data.result.key;
|
|
|
shipOwnerForm.value.idcardBackViewUrl = data.result.viewUrl;
|
|
shipOwnerForm.value.idcardBackViewUrl = data.result.viewUrl;
|
|
|
shipOwnerForm.value.idcardBackDownloadUrl = data.result.downloadUrl;
|
|
shipOwnerForm.value.idcardBackDownloadUrl = data.result.downloadUrl;
|
|
|
|
|
+ ElMessage.success("上传成功");
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(data.msg || "上传失败");
|
|
ElMessage.error(data.msg || "上传失败");
|
|
|
}
|
|
}
|
|
@@ -806,6 +812,7 @@ const handleCertSuccess = ({ response: data }) => {
|
|
|
viewUrl: data.result.viewUrl,
|
|
viewUrl: data.result.viewUrl,
|
|
|
downloadUrl: data.result.downloadUrl,
|
|
downloadUrl: data.result.downloadUrl,
|
|
|
});
|
|
});
|
|
|
|
|
+ ElMessage.success("上传成功");
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(data.msg || "上传失败");
|
|
ElMessage.error(data.msg || "上传失败");
|
|
|
}
|
|
}
|
|
@@ -845,13 +852,25 @@ const handleHealthSuccess = ({ response: data }) => {
|
|
|
viewUrl: data.result.viewUrl,
|
|
viewUrl: data.result.viewUrl,
|
|
|
downloadUrl: data.result.downloadUrl,
|
|
downloadUrl: data.result.downloadUrl,
|
|
|
});
|
|
});
|
|
|
|
|
+ ElMessage.success("上传成功");
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(data.msg || "上传失败");
|
|
ElMessage.error(data.msg || "上传失败");
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 健康证明删除处理
|
|
// 健康证明删除处理
|
|
|
-const handleHealthRemove = ({ fileIndex }) => {
|
|
|
|
|
|
|
+const handleHealthRemove = async ({ file, fileIndex }) => {
|
|
|
|
|
+ if (file.id) {
|
|
|
|
|
+ let { data } = await api.deleteShipOwnerCert({
|
|
|
|
|
+ docId: file.id,
|
|
|
|
|
+ });
|
|
|
|
|
+ if (data.status === 0) {
|
|
|
|
|
+ ElMessage.success("删除成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(data.msg || "删除失败");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
const healthDocs = shipOwnerForm.value.documents.filter(
|
|
const healthDocs = shipOwnerForm.value.documents.filter(
|
|
|
(doc) => doc.docType === 2
|
|
(doc) => doc.docType === 2
|
|
|
);
|
|
);
|
|
@@ -862,7 +881,7 @@ const handleHealthRemove = ({ fileIndex }) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 服务簿上传处理
|
|
// 服务簿上传处理
|
|
|
-const handleServiceSuccess = ({ response: data }) => {
|
|
|
|
|
|
|
+const handleServiceSuccess = async ({ response: data }) => {
|
|
|
if (data.status === 0) {
|
|
if (data.status === 0) {
|
|
|
if (!shipOwnerForm.value.documents) {
|
|
if (!shipOwnerForm.value.documents) {
|
|
|
shipOwnerForm.value.documents = [];
|
|
shipOwnerForm.value.documents = [];
|
|
@@ -873,13 +892,25 @@ const handleServiceSuccess = ({ response: data }) => {
|
|
|
viewUrl: data.result.viewUrl,
|
|
viewUrl: data.result.viewUrl,
|
|
|
downloadUrl: data.result.downloadUrl,
|
|
downloadUrl: data.result.downloadUrl,
|
|
|
});
|
|
});
|
|
|
|
|
+ ElMessage.success("上传成功");
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(data.msg || "上传失败");
|
|
ElMessage.error(data.msg || "上传失败");
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 服务簿删除处理
|
|
// 服务簿删除处理
|
|
|
-const handleServiceRemove = ({ fileIndex }) => {
|
|
|
|
|
|
|
+const handleServiceRemove = async ({ file, fileIndex }) => {
|
|
|
|
|
+ if (file.id) {
|
|
|
|
|
+ let { data } = await api.deleteShipOwnerCert({
|
|
|
|
|
+ docId: file.id,
|
|
|
|
|
+ });
|
|
|
|
|
+ if (data.status === 0) {
|
|
|
|
|
+ ElMessage.success("删除成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(data.msg || "删除失败");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
const serviceDocs = shipOwnerForm.value.documents.filter(
|
|
const serviceDocs = shipOwnerForm.value.documents.filter(
|
|
|
(doc) => doc.docType === 3
|
|
(doc) => doc.docType === 3
|
|
|
);
|
|
);
|
|
@@ -1169,10 +1200,13 @@ async function addShip() {
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!shipOwnerForm.value.shipInfo.mmsi) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ shipOwnerForm.value.shipInfo?.mmsi?.length != 9 &&
|
|
|
|
|
+ shipOwnerForm.value.shipInfo.mmsi != ""
|
|
|
|
|
+ ) {
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
type: "warning",
|
|
type: "warning",
|
|
|
- message: "请填写船舶MMSI",
|
|
|
|
|
|
|
+ message: "请正确填写船舶MMSI",
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|