|
|
@@ -3,10 +3,10 @@
|
|
|
<div class="container-title">船舶信息</div>
|
|
|
<div
|
|
|
class="pl50 pt30 bgf df jcsb pr20"
|
|
|
- v-if="route.name == 'shipOwnerDetail'"
|
|
|
+ v-if="route.name == 'shipOwnerDetail' || route.name == 'shipDetail'"
|
|
|
style="max-width: 1200px"
|
|
|
>
|
|
|
- <el-button-group class="mr20">
|
|
|
+ <el-button-group class="mr20" v-if="route.name == 'shipOwnerDetail'">
|
|
|
<el-button
|
|
|
v-for="(item, index) in shipInfos"
|
|
|
:key="item.code"
|
|
|
@@ -38,6 +38,7 @@
|
|
|
取消更新
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
+ v-if="route.name == 'shipOwnerDetail'"
|
|
|
@click="deleteShip(currentIndex)"
|
|
|
type="primary"
|
|
|
class="mr20"
|
|
|
@@ -45,16 +46,24 @@
|
|
|
删除当前船舶
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <el-button
|
|
|
- v-if="shipInfos.length == 0 || shipInfos[currentIndex].code"
|
|
|
- @click="addShip()"
|
|
|
- type="primary"
|
|
|
- >
|
|
|
- 新增船舶
|
|
|
- </el-button>
|
|
|
- <el-button v-else @click="cancelAdd()" type="primary">
|
|
|
- 取消新增船舶
|
|
|
- </el-button>
|
|
|
+ <div class="df" v-if="route.name == 'shipOwnerDetail'">
|
|
|
+ <el-button
|
|
|
+ v-if="shipInfos.length == 0 || shipInfos[currentIndex].code"
|
|
|
+ @click="addShip()"
|
|
|
+ type="primary"
|
|
|
+ >
|
|
|
+ 新增船舶
|
|
|
+ </el-button>
|
|
|
+ <div v-else>
|
|
|
+ <el-button
|
|
|
+ v-if="shipInfos.length > 1"
|
|
|
+ @click="cancelAdd()"
|
|
|
+ type="primary"
|
|
|
+ >
|
|
|
+ 取消新增船舶
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -402,7 +411,6 @@ async function submit() {
|
|
|
let shipInfoDisabled = ref(true);
|
|
|
let cacheInfo = ref({});
|
|
|
function showUpdate() {
|
|
|
- shipInfoDisabled.value = false;
|
|
|
cacheInfo.value = _.cloneDeep(props.shipInfos[currentIndex.value]);
|
|
|
}
|
|
|
async function confirmUpdate() {
|
|
|
@@ -426,9 +434,14 @@ function cancelUpdate() {
|
|
|
props.shipInfos[currentIndex.value] = _.cloneDeep(cacheInfo.value);
|
|
|
shipInfoDisabled.value = true;
|
|
|
}
|
|
|
+
|
|
|
+function changeDisable(b) {
|
|
|
+ shipInfoDisabled.value = b;
|
|
|
+}
|
|
|
defineExpose({
|
|
|
initCerts,
|
|
|
getShipCerts,
|
|
|
+ changeDisable,
|
|
|
});
|
|
|
onMounted(() => {});
|
|
|
</script>
|