|
|
@@ -350,8 +350,27 @@ async function searchShip(e) {
|
|
|
props.shipInfos[currentIndex.value] = data.result;
|
|
|
}
|
|
|
}
|
|
|
-function deleteShip(item) {
|
|
|
- console.log(item);
|
|
|
+function deleteShip(index) {
|
|
|
+ ElMessageBox.confirm("确认删除船舶?", "提示", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ console.log(index);
|
|
|
+ let { data } = await api.deleteShip({
|
|
|
+ shipCode: props.shipInfos[index].code,
|
|
|
+ });
|
|
|
+ if (data.status == 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功",
|
|
|
+ });
|
|
|
+ props.shipInfos.splice(index, 1);
|
|
|
+ currentIndex.value = 0;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
|
let cacheIndex = -1;
|
|
|
function addShip(item) {
|