|
@@ -14,7 +14,11 @@
|
|
|
<div class="cargo-owner-add" @click="dialogFormVisible = true">
|
|
<div class="cargo-owner-add" @click="dialogFormVisible = true">
|
|
|
添加航期
|
|
添加航期
|
|
|
</div>
|
|
</div>
|
|
|
- <el-dialog title="添加航期" v-model="dialogFormVisible">
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="添加航期"
|
|
|
|
|
+ @closed="resetForm()"
|
|
|
|
|
+ v-model="dialogFormVisible"
|
|
|
|
|
+ >
|
|
|
<template v-slot:default>
|
|
<template v-slot:default>
|
|
|
<el-form
|
|
<el-form
|
|
|
:model="ruleForm"
|
|
:model="ruleForm"
|
|
@@ -23,27 +27,34 @@
|
|
|
label-width="110px"
|
|
label-width="110px"
|
|
|
label-position="left"
|
|
label-position="left"
|
|
|
>
|
|
>
|
|
|
- <el-form-item prop="portName" label="货主名称">
|
|
|
|
|
- <el-input
|
|
|
|
|
- style="width: 280px"
|
|
|
|
|
- v-model="ruleForm.portName"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <el-form-item prop="cargoOwnerIds" label="货主名称">
|
|
|
|
|
+ <RemoteSearch
|
|
|
|
|
+ api="getCargoOwnerCompanySelect"
|
|
|
|
|
+ v-model="cargoOwnerCompanyStr"
|
|
|
|
|
+ @selectItem="selectCargoOwnerCompany($event)"
|
|
|
|
|
+ class="mb10"
|
|
|
|
|
+ ></RemoteSearch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="departurePortId" label="始发港">
|
|
<el-form-item prop="departurePortId" label="始发港">
|
|
|
- <el-input
|
|
|
|
|
- style="width: 280px"
|
|
|
|
|
- v-model="ruleForm.departurePortId"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <RemoteSearch
|
|
|
|
|
+ api="getPortsSelect"
|
|
|
|
|
+ v-model="departurePortStr"
|
|
|
|
|
+ @selectItem="selectDeparturePort($event)"
|
|
|
|
|
+ class="mb10"
|
|
|
|
|
+ ></RemoteSearch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="destinationPortId" label="目的地港">
|
|
<el-form-item prop="destinationPortId" label="目的地港">
|
|
|
- <el-input
|
|
|
|
|
- style="width: 280px"
|
|
|
|
|
- v-model="ruleForm.destinationPortId"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <RemoteSearch
|
|
|
|
|
+ api="getPortsSelect"
|
|
|
|
|
+ v-model="destinationPortStr"
|
|
|
|
|
+ @selectItem="selectDdestinationPort($event)"
|
|
|
|
|
+ class="mb10"
|
|
|
|
|
+ ></RemoteSearch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="sailingPeriod" label="航期">
|
|
<el-form-item prop="sailingPeriod" label="航期">
|
|
|
<el-input
|
|
<el-input
|
|
|
- style="width: 280px"
|
|
|
|
|
|
|
+ style="width: 240px"
|
|
|
|
|
+ size="small"
|
|
|
v-model="ruleForm.sailingPeriod"
|
|
v-model="ruleForm.sailingPeriod"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -52,7 +63,7 @@
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="resetForm">取 消</el-button>
|
|
<el-button @click="resetForm">取 消</el-button>
|
|
|
- <el-button type="primary" @click="addtTransPort(ruleForm)">
|
|
|
|
|
|
|
+ <el-button type="primary" @click="addTransPort(ruleForm)">
|
|
|
确 定
|
|
确 定
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -136,18 +147,22 @@ let total = ref(0);
|
|
|
let dialogFormVisible = ref(false);
|
|
let dialogFormVisible = ref(false);
|
|
|
let form = ref(null);
|
|
let form = ref(null);
|
|
|
const ruleForm = ref({
|
|
const ruleForm = ref({
|
|
|
- portName: "",
|
|
|
|
|
|
|
+ cargoOwnerIds: "",
|
|
|
departurePortId: "",
|
|
departurePortId: "",
|
|
|
destinationPortId: "",
|
|
destinationPortId: "",
|
|
|
|
|
+ sailingPeriod: "",
|
|
|
});
|
|
});
|
|
|
const rules = ref({
|
|
const rules = ref({
|
|
|
- portName: [{ required: true, message: "请填写港口名称", trigger: "blur" }],
|
|
|
|
|
|
|
+ cargoOwnerIds: [
|
|
|
|
|
+ { required: true, message: "请填写港口名称", trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
departurePortId: [
|
|
departurePortId: [
|
|
|
- { required: true, message: "请填写港口经度", trigger: "blur" },
|
|
|
|
|
|
|
+ { required: true, message: "请填写始发港", trigger: "change" },
|
|
|
],
|
|
],
|
|
|
destinationPortId: [
|
|
destinationPortId: [
|
|
|
- { required: true, message: "请填写港口纬度", trigger: "blur" },
|
|
|
|
|
|
|
+ { required: true, message: "请填写目的地港", trigger: "change" },
|
|
|
],
|
|
],
|
|
|
|
|
+ sailingPeriod: [{ required: true, message: "请填写航期", trigger: "change" }],
|
|
|
});
|
|
});
|
|
|
async function getTransPortsList() {
|
|
async function getTransPortsList() {
|
|
|
tableData.value = [];
|
|
tableData.value = [];
|
|
@@ -163,24 +178,28 @@ async function getTransPortsList() {
|
|
|
}
|
|
}
|
|
|
function resetForm() {
|
|
function resetForm() {
|
|
|
dialogFormVisible.value = false;
|
|
dialogFormVisible.value = false;
|
|
|
-
|
|
|
|
|
|
|
+ cargoOwnerCompanyStr.value = "";
|
|
|
|
|
+ departurePortStr.value = "";
|
|
|
|
|
+ destinationPortStr.value = "";
|
|
|
form.value.resetFields();
|
|
form.value.resetFields();
|
|
|
}
|
|
}
|
|
|
-async function addtTransPort() {
|
|
|
|
|
|
|
+async function addTransPort() {
|
|
|
form.value.validate(async (valid) => {
|
|
form.value.validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- let { portName, departurePortId, destinationPortId } = ruleForm.value;
|
|
|
|
|
- let res = await api.addtTransPort({
|
|
|
|
|
- portName,
|
|
|
|
|
|
|
+ let { cargoOwnerIds, departurePortId, destinationPortId, sailingPeriod } =
|
|
|
|
|
+ ruleForm.value;
|
|
|
|
|
+ let res = await api.addTransPort({
|
|
|
|
|
+ cargoOwnerIds,
|
|
|
departurePortId,
|
|
departurePortId,
|
|
|
destinationPortId,
|
|
destinationPortId,
|
|
|
|
|
+ sailingPeriod,
|
|
|
});
|
|
});
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
ElNotification.success({
|
|
ElNotification.success({
|
|
|
title: "添加成功",
|
|
title: "添加成功",
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
|
- message: `${portName}:${res.data.msg}`,
|
|
|
|
|
|
|
+ message: `${cargoOwnerIds}:${res.data.msg}`,
|
|
|
type: "success",
|
|
type: "success",
|
|
|
});
|
|
});
|
|
|
resetForm();
|
|
resetForm();
|
|
@@ -224,6 +243,22 @@ function pageChange(e) {
|
|
|
currentPage.value = e;
|
|
currentPage.value = e;
|
|
|
getTransPortsList();
|
|
getTransPortsList();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+let cargoOwnerCompanyStr = ref("");
|
|
|
|
|
+function selectCargoOwnerCompany(e) {
|
|
|
|
|
+ ruleForm.value.cargoOwnerIds = e.key;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+let departurePortStr = ref("");
|
|
|
|
|
+function selectDeparturePort(e) {
|
|
|
|
|
+ ruleForm.value.departurePortId = e.key;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+let destinationPortStr = ref("");
|
|
|
|
|
+function selectDdestinationPort(e) {
|
|
|
|
|
+ ruleForm.value.destinationPortId = e.key;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getTransPortsList();
|
|
getTransPortsList();
|
|
|
});
|
|
});
|