|
|
@@ -185,7 +185,7 @@
|
|
|
clearable
|
|
|
style="width: 330px"
|
|
|
></el-input>
|
|
|
- <div class="seach-btn" @click="getVoyageList()">查询</div>
|
|
|
+ <div class="search-btn" @click="getVoyageList()">查询</div>
|
|
|
</div>
|
|
|
<div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
|
|
|
添加航次
|
|
|
@@ -205,19 +205,19 @@
|
|
|
<el-input v-model="voyageForm.voyageName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label=""></el-form-item> -->
|
|
|
- <el-form-item prop="shipOwnerId" label="船东">
|
|
|
+ <el-form-item prop="shipName" label="船舶">
|
|
|
<!-- <el-input v-model="voyageForm.shipOwnerId"></el-input> -->
|
|
|
<el-autocomplete
|
|
|
- v-model="voyageForm.shipOwnerName"
|
|
|
- :fetch-suggestions="seachShipOwner"
|
|
|
- placeholder="选择船东"
|
|
|
- @select="selectShipOwner"
|
|
|
+ v-model="voyageForm.shipName"
|
|
|
+ :fetch-suggestions="searchShip"
|
|
|
+ placeholder="选择船舶"
|
|
|
+ @select="selectShip"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="cargoOwnerId" label="货主">
|
|
|
<el-autocomplete
|
|
|
v-model="voyageForm.cargoOwnerName"
|
|
|
- :fetch-suggestions="seachCargoOwner"
|
|
|
+ :fetch-suggestions="searchCargoOwner"
|
|
|
placeholder="选择货主"
|
|
|
@select="selectCargoOwner"
|
|
|
/>
|
|
|
@@ -518,13 +518,6 @@ export default {
|
|
|
],
|
|
|
cargo: [{ required: true, message: "请填写货种", trigger: "blur" }],
|
|
|
tons: [{ required: true, message: "请填写吨位", trigger: "blur" }],
|
|
|
- // -----------
|
|
|
- shipOwnerName: [
|
|
|
- { required: true, message: "请选择船东", trigger: "blur" },
|
|
|
- ],
|
|
|
- cargoOwnerName: [
|
|
|
- { required: true, message: "请选择货主", trigger: "blur" },
|
|
|
- ],
|
|
|
},
|
|
|
});
|
|
|
let voyageForm = reactive({
|
|
|
@@ -537,9 +530,6 @@ export default {
|
|
|
dischargeProt: "",
|
|
|
cargo: "",
|
|
|
tons: "",
|
|
|
- // -----
|
|
|
- shipOwnerName: "",
|
|
|
- cargoOwnerName: "",
|
|
|
},
|
|
|
});
|
|
|
let addVoyageForm = ref(null);
|
|
|
@@ -568,28 +558,27 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- async function seachShipOwner(queryString, cb) {
|
|
|
+ async function searchShip(queryString, cb) {
|
|
|
if (!queryString) return;
|
|
|
- let res = await api.getUserInfoAndShipInfo({
|
|
|
+ let res = await api.searchShip({
|
|
|
term: queryString,
|
|
|
});
|
|
|
- let shipOwners = [];
|
|
|
+ let ships = [];
|
|
|
if (res.data.status == 0) {
|
|
|
- shipOwners = res.data.result;
|
|
|
- for (let i of shipOwners) {
|
|
|
- i.value = `${i.shipOwnerName}-${i.shipName}`;
|
|
|
+ ships = res.data.result;
|
|
|
+ for (let i of ships) {
|
|
|
+ i.value = `${i.shipName}`;
|
|
|
}
|
|
|
- cb(shipOwners);
|
|
|
+ cb(ships);
|
|
|
}
|
|
|
}
|
|
|
- const selectShipOwner = (item) => {
|
|
|
- voyageForm.voyageForm.shipOwnerId = item.shipOwnerId;
|
|
|
+ const selectShip = (item) => {
|
|
|
voyageForm.voyageForm.shipId = item.shipId;
|
|
|
};
|
|
|
|
|
|
- async function seachCargoOwner(queryString, cb) {
|
|
|
+ async function searchCargoOwner(queryString, cb) {
|
|
|
if (!queryString) return;
|
|
|
- let res = await api.seachUser({
|
|
|
+ let res = await api.searchUser({
|
|
|
term: queryString,
|
|
|
identity: 2,
|
|
|
});
|
|
|
@@ -607,10 +596,32 @@ export default {
|
|
|
voyageForm.voyageForm.cargoOwnerId = item.userId;
|
|
|
};
|
|
|
|
|
|
+ const getCol = _.debounce(
|
|
|
+ async (queryString, cb) => {
|
|
|
+ if (!queryString) return;
|
|
|
+ let res = await api.getCol({
|
|
|
+ term: queryString,
|
|
|
+ });
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ cb(res.data.result);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 1500,
|
|
|
+ { leading: true }
|
|
|
+ );
|
|
|
+
|
|
|
+ const selectLoadPort = (item) => {
|
|
|
+ voyageForm.voyageForm.loadPortId = item.key;
|
|
|
+ voyageForm.voyageForm.loadPort = item.value;
|
|
|
+ };
|
|
|
+
|
|
|
+ const selectDischargeProt = (item) => {
|
|
|
+ voyageForm.voyageForm.dischargeProtId = item.key;
|
|
|
+ voyageForm.voyageForm.dischargeProt = item.value;
|
|
|
+ };
|
|
|
+
|
|
|
function resetAddVoyageForm() {
|
|
|
voyageAddDialogVisible.value = false;
|
|
|
- voyageForm.voyageForm.shipOwnerName = "";
|
|
|
- voyageForm.voyageForm.cargoOwnerName = "";
|
|
|
addVoyageForm.value.resetFields();
|
|
|
}
|
|
|
let shipCurrentPage = ref(1);
|
|
|
@@ -702,9 +713,7 @@ export default {
|
|
|
addVoyageForm,
|
|
|
...toRefs(rules),
|
|
|
...toRefs(voyageForm),
|
|
|
- seachShipOwner,
|
|
|
- selectShipOwner,
|
|
|
- seachCargoOwner,
|
|
|
+ searchCargoOwner,
|
|
|
selectCargoOwner,
|
|
|
resetAddVoyageForm,
|
|
|
shipCurrentPage,
|
|
|
@@ -717,13 +726,15 @@ export default {
|
|
|
getCol,
|
|
|
selectLoadPort,
|
|
|
selectDischargeProt,
|
|
|
+ searchShip,
|
|
|
+ selectShip,
|
|
|
// uploadUrl,
|
|
|
};
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-.seach-btn {
|
|
|
+.search-btn {
|
|
|
display: inline-block;
|
|
|
width: 60px;
|
|
|
height: 32px;
|
|
|
@@ -815,7 +826,7 @@ export default {
|
|
|
color: #fff;
|
|
|
}
|
|
|
|
|
|
-.seach-btn {
|
|
|
+.search-btn {
|
|
|
display: inline-block;
|
|
|
width: 60px;
|
|
|
height: 38px;
|