|
|
@@ -74,7 +74,7 @@
|
|
|
确定
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- v-if="shipOwnerDetail.shipInfo.length == 0"
|
|
|
+ v-if="shipOwnerDetail.code && shipOwnerDetail.shipInfo.length == 0"
|
|
|
type="primary"
|
|
|
@click="addShip()"
|
|
|
>
|
|
|
@@ -148,6 +148,52 @@ function checkShipOwner() {
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+let initShipInfo = {
|
|
|
+ shipId: 0,
|
|
|
+ disabled: false,
|
|
|
+ shipCerts: [
|
|
|
+ {
|
|
|
+ typeName: "船舶国籍证书",
|
|
|
+ type: 1,
|
|
|
+ date: "",
|
|
|
+ startValidTime: "",
|
|
|
+ endtValidTime: "",
|
|
|
+ certs: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ typeName: "内河船舶适航证书",
|
|
|
+ type: 2,
|
|
|
+ date: "",
|
|
|
+ startValidTime: "",
|
|
|
+ endtValidTime: "",
|
|
|
+ certs: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ typeName: "船舶年审合格证书",
|
|
|
+ type: 3,
|
|
|
+ date: "",
|
|
|
+ startValidTime: "",
|
|
|
+ endtValidTime: "",
|
|
|
+ certs: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ typeName: "内河船舶最低安全配员证书",
|
|
|
+ type: 4,
|
|
|
+ date: "",
|
|
|
+ startValidTime: "",
|
|
|
+ endtValidTime: "",
|
|
|
+ certs: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ typeName: "船舶保险",
|
|
|
+ type: 5,
|
|
|
+ date: "",
|
|
|
+ startValidTime: "",
|
|
|
+ endtValidTime: "",
|
|
|
+ certs: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+};
|
|
|
async function addShipOwner() {
|
|
|
if (!checkShipOwner()) return;
|
|
|
let postData = shipOwnerDetail.value;
|
|
|
@@ -186,6 +232,7 @@ async function addShipOwner() {
|
|
|
type: "success",
|
|
|
})
|
|
|
.then(() => {
|
|
|
+ data.result.shipInfo = [initShipInfo];
|
|
|
shipOwnerDetail.value = data.result;
|
|
|
unchangeableShipOwner.value = true;
|
|
|
})
|
|
|
@@ -199,16 +246,6 @@ let unchangeableShipOwner = ref(false);
|
|
|
let unchangeableShip = ref(false);
|
|
|
|
|
|
let shipCertsRef = ref(null);
|
|
|
-async function searchShip(e) {
|
|
|
- if (e.target.value.length != 9) return;
|
|
|
- let { data } = await api.searchShip({
|
|
|
- mmsi: e.target.value,
|
|
|
- });
|
|
|
- if (data.status == 0) {
|
|
|
- shipDetail.value = data.result;
|
|
|
- shipCertsRef.value.initCerts(shipDetail.value.shipCerts);
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
async function getShipOwnerDetail(shipOwnerId) {
|
|
|
let { data } = await api.getShipOwnerDetail({
|
|
|
@@ -227,7 +264,7 @@ async function getShipOwnerDetail(shipOwnerId) {
|
|
|
console.log(data);
|
|
|
}
|
|
|
function addShip() {
|
|
|
- shipOwnerDetail.value.shipInfo = [{}];
|
|
|
+ shipOwnerDetail.value.shipInfo = [initShipInfo];
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|