|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="line-container-p24">
|
|
|
- <div style="display: flex; justify-content: space-between">
|
|
|
+ <div class="df jcsb aic">
|
|
|
<div class="df aic">
|
|
|
<div
|
|
|
@click="changeVoyageType(0)"
|
|
|
@@ -58,14 +58,69 @@
|
|
|
prefix-icon="el-icon-search"
|
|
|
v-model="term"
|
|
|
clearable
|
|
|
- style="width: 330px"
|
|
|
+ style="width: 240px"
|
|
|
+ @keyup.enter.native="getVoyageList()"
|
|
|
></el-input>
|
|
|
<div class="search-btn" @click="getVoyageList()">查询</div>
|
|
|
</div>
|
|
|
<!-- <div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
|
|
|
添加航次
|
|
|
</div> -->
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-auth="'DOWNLOADVOYAGELIST'"
|
|
|
+ @click="showExportModal('航次列表')"
|
|
|
+ style="margin-left: 10px; margin-bottom: 10px"
|
|
|
+ >导出航次列表</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-auth="'MULTDOWNLOADSHIPTRACK'"
|
|
|
+ @click="showExportModal('航次跟踪')"
|
|
|
+ >导出航次跟踪</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="showExportModal('卸货记录')"
|
|
|
+ v-auth="'MULTDOWNLOADDISCHARGE'"
|
|
|
+ >导出卸货记录</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-auth="'DOWNLOADFYDI'"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="downloadFYDI"
|
|
|
+ >下载FYDI指数</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ v-model="exportModalVisable"
|
|
|
+ :title="exportModalTitle"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="200px"
|
|
|
+ >
|
|
|
+ <div class="df aic jcsb">
|
|
|
+ <div v-if="exportModalTitle != '航次列表'" class="df aic">
|
|
|
+ <div class="mr20">请选择月份:</div>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="currentMonth"
|
|
|
+ type="month"
|
|
|
+ placeholder="请选择年月"
|
|
|
+ value-format="YYYYMM"
|
|
|
+ :disabled="isLoadingZip"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div></div>
|
|
|
+ <el-button type="primary" @click="exportZip" :loading="isLoadingZip"
|
|
|
+ >导出{{ exportModalTitle }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog v-model="voyageAddDialogVisible" title="添加航次">
|
|
|
<el-form
|
|
|
:rules="rules"
|
|
|
@@ -149,63 +204,306 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-table :data="tableData" stripe style="width: 100%; margin-top: 24px">
|
|
|
- <el-table-column
|
|
|
+ <!-- <div class="mt20">
|
|
|
+ <p class="mr20 df aic" style="font-size: 14px; color: #333">
|
|
|
+ 列表筛选:
|
|
|
+ <el-checkbox
|
|
|
+ class="ml20"
|
|
|
+ v-model="selectAllVisable"
|
|
|
+ label="全选"
|
|
|
+ size="default"
|
|
|
+ @change="selectAll"
|
|
|
+ />
|
|
|
+ </p>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="voyageNameVisable"
|
|
|
+ label="航次名称"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="loadPortVisable"
|
|
|
+ label="装货港"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="dischargePortVisable"
|
|
|
+ label="卸货港"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="expectedArrivalTimeVisable"
|
|
|
+ label="预计到港时间"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="abnormalStatusVisable"
|
|
|
+ label="航次状态"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="daysInPortVisable"
|
|
|
+ label="在港天数"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="todayPhotoCountVisable"
|
|
|
+ label="今日照片"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="cargoVisable"
|
|
|
+ label="货种"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="actualLoadTonsVisable"
|
|
|
+ label="装载吨位"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="unloadedtonsVisable"
|
|
|
+ label="已卸货吨位"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="remainTonsVisable"
|
|
|
+ label="剩余吨位"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ <el-checkbox
|
|
|
+ v-model="hasInsuranceVisable"
|
|
|
+ label="保险状态"
|
|
|
+ size="default"
|
|
|
+ @change="selectSingle"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <div
|
|
|
+ class="df aic jcfs mt20"
|
|
|
+ style="
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ width: calc(100vw - 300px);
|
|
|
+ flex-wrap: wrap;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">装货港:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 120px"
|
|
|
+ v-model="voyageListPostData.loadPortId"
|
|
|
+ placeholder="装货港"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ @focus="getPortSelect"
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in portOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.key"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">卸货港:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 120px"
|
|
|
+ v-model="voyageListPostData.discPortId"
|
|
|
+ placeholder="卸货港"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ @focus="getPortSelect"
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in portOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.key"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">预计到港时间:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 120px"
|
|
|
+ v-model="voyageListPostData.isArrived"
|
|
|
+ placeholder="到港状态"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ >
|
|
|
+ <el-option label="已到港" :value="0" />
|
|
|
+ <el-option label="未到港" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">航次状态:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 120px"
|
|
|
+ v-model="voyageListPostData.abnormalStatus"
|
|
|
+ placeholder="航次状态"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ >
|
|
|
+ <el-option label="正常" :value="0" />
|
|
|
+ <el-option label="异常" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">货种:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 100px"
|
|
|
+ v-model="voyageListPostData.cargo"
|
|
|
+ placeholder="货种"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ @focus="getCargoSelect"
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in cargoOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item.key"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="df jcsb aic mb10 mr20">
|
|
|
+ <div class="mr10">保险状态:</div>
|
|
|
+ <el-select
|
|
|
+ style="width: 120px"
|
|
|
+ v-model="voyageListPostData.hasInsurance"
|
|
|
+ placeholder="保险状态"
|
|
|
+ size="small"
|
|
|
+ @change="getVoyageList"
|
|
|
+ >
|
|
|
+ <el-option label="未购买" :value="0" />
|
|
|
+ <el-option label="已购买" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <el-button @click="resetFilter" class="mb10" size="small" type="primary"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ stripe
|
|
|
+ style="width: 100%; margin-top: 12px"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ >
|
|
|
+ <!-- <el-table-column
|
|
|
type="index"
|
|
|
label="序号"
|
|
|
min-width="80"
|
|
|
align="center"
|
|
|
- ></el-table-column>
|
|
|
+ ></el-table-column> -->
|
|
|
<el-table-column
|
|
|
prop="voyageName"
|
|
|
label="航次名称"
|
|
|
+ v-if="voyageNameVisable"
|
|
|
min-width="140"
|
|
|
align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="loadDiscPort"
|
|
|
- label="装货港-卸货港"
|
|
|
- min-width="200"
|
|
|
+ prop="loadPort"
|
|
|
+ label="装货港"
|
|
|
+ v-if="loadPortVisable"
|
|
|
+ min-width="90"
|
|
|
align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="dischargePort"
|
|
|
+ label="卸货港"
|
|
|
+ v-if="dischargePortVisable"
|
|
|
+ min-width="80"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
prop="setSailTime"
|
|
|
label="开航时间"
|
|
|
- min-width="180"
|
|
|
+ min-width="100"
|
|
|
align="center"
|
|
|
- ></el-table-column>
|
|
|
+ ></el-table-column> -->
|
|
|
<el-table-column
|
|
|
prop="expectedArrivalTime"
|
|
|
label="预计到港时间"
|
|
|
- min-width="180"
|
|
|
+ v-if="expectedArrivalTimeVisable"
|
|
|
+ sortable
|
|
|
+ min-width="140"
|
|
|
align="center"
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ scope.row.arrived ? "已到港" : scope.row.expectedArrivalTime }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="daysInPort"
|
|
|
- label="在港天数"
|
|
|
+ prop="abnormalStatus"
|
|
|
+ label="航次状态"
|
|
|
+ v-if="abnormalStatusVisable"
|
|
|
min-width="80"
|
|
|
align="center"
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ scope.row.abnormalStatus == 0 ? "正常" : "异常" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="daysInPortStr"
|
|
|
+ label="在港天数"
|
|
|
+ v-if="daysInPortVisable"
|
|
|
+ sortable
|
|
|
+ min-width="100"
|
|
|
+ align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="todayPhotoCount"
|
|
|
label="今日照片"
|
|
|
- min-width="80"
|
|
|
+ v-if="todayPhotoCountVisable"
|
|
|
+ min-width="100"
|
|
|
align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="cargo"
|
|
|
+ v-if="cargoVisable"
|
|
|
label="货种"
|
|
|
- min-width="80"
|
|
|
+ min-width="70"
|
|
|
align="center"
|
|
|
></el-table-column>
|
|
|
-
|
|
|
<el-table-column
|
|
|
- prop="tons"
|
|
|
- label="吨位(吨)"
|
|
|
+ prop="actualLoadTons"
|
|
|
+ label="装载吨位"
|
|
|
+ v-if="actualLoadTonsVisable"
|
|
|
min-width="80"
|
|
|
align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="unloadedtons"
|
|
|
+ label="已卸货吨位"
|
|
|
+ v-if="unloadedtonsVisable"
|
|
|
+ min-width="100"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="remainTons"
|
|
|
+ label="剩余吨位"
|
|
|
+ v-if="remainTonsVisable"
|
|
|
+ min-width="80"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
prop="waybillStatus"
|
|
|
sortable
|
|
|
label="签单状态"
|
|
|
@@ -221,7 +519,7 @@
|
|
|
: "已签单"
|
|
|
}}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<!-- <el-table-column
|
|
|
prop="transStatus"
|
|
|
label="船舶状态"
|
|
|
@@ -230,7 +528,8 @@
|
|
|
></el-table-column> -->
|
|
|
<el-table-column
|
|
|
prop="hasInsurance"
|
|
|
- label="保险单状态"
|
|
|
+ label="保险状态"
|
|
|
+ v-if="hasInsuranceVisable"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
>
|
|
|
@@ -238,20 +537,30 @@
|
|
|
{{ scope.row.hasInsurance == 0 ? "未购买" : "已购买" }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
sortable
|
|
|
prop="createTime"
|
|
|
label="创建时间"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ subTimeStr(scope.row.createTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remark"
|
|
|
label="备注"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column label="操作" min-width="80" align="center">
|
|
|
+ ></el-table-column> -->
|
|
|
+ <el-table-column
|
|
|
+ v-auth="'VOYAGEDETAIL'"
|
|
|
+ label="操作"
|
|
|
+ min-width="80"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
<template v-slot="scope">
|
|
|
<el-button
|
|
|
@click="voyageDetail(scope.row.id, tableData)"
|
|
|
@@ -273,7 +582,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script>
|
|
|
+<script setup>
|
|
|
import { ref, h, reactive, toRefs, onMounted } from "vue";
|
|
|
import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
|
|
|
import store from "../../store";
|
|
|
@@ -281,363 +590,517 @@ import router from "../../router";
|
|
|
import md5 from "md5";
|
|
|
import api from "../../apis/fetch";
|
|
|
import _ from "lodash";
|
|
|
+import { subTimeStr } from "../../utils/utils";
|
|
|
+import downloadBlobFile from "../../utils/downloadBlobFile";
|
|
|
+import url from "../../apis/config";
|
|
|
|
|
|
-export default {
|
|
|
- setup() {
|
|
|
- let currentPage = ref(1);
|
|
|
- let term = ref("");
|
|
|
- let tableData = ref([]);
|
|
|
- let total = ref(0);
|
|
|
- let status = ref(0);
|
|
|
- async function getVoyageList() {
|
|
|
- tableData.value = [];
|
|
|
-
|
|
|
- let res = await api.getVoyageList({
|
|
|
- cargoOwnerId: localStorage.userId,
|
|
|
- shipId: 0,
|
|
|
- status: status.value,
|
|
|
- term: term.value,
|
|
|
- currentPage: currentPage.value,
|
|
|
- size: 10,
|
|
|
- });
|
|
|
- term.value = "";
|
|
|
- if (res.data.status == 0) {
|
|
|
- tableData.value = res.data.result;
|
|
|
- total.value = res.data.total;
|
|
|
- } else {
|
|
|
- ElNotification({
|
|
|
- type: "error",
|
|
|
- title: res.data.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- function changeVoyageType(s) {
|
|
|
- term.value = "";
|
|
|
- currentPage.value = 1;
|
|
|
- status.value = s;
|
|
|
- getVoyageList();
|
|
|
- }
|
|
|
- async function voyageDetail(id) {
|
|
|
- router.push({
|
|
|
- path: "/voyage/voyageDetail",
|
|
|
- query: {
|
|
|
- id,
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- function pageChange(e) {
|
|
|
- currentPage.value = e;
|
|
|
- getVoyageList();
|
|
|
- }
|
|
|
+let currentPage = ref(1);
|
|
|
+let term = ref("");
|
|
|
+let tableData = ref([]);
|
|
|
+let total = ref(0);
|
|
|
+let status = ref(0);
|
|
|
+let loginAccountId = ref("");
|
|
|
+let voyageListPostData = ref({});
|
|
|
+async function getVoyageList() {
|
|
|
+ tableData.value = [];
|
|
|
|
|
|
- function goToVoyageAdd() {
|
|
|
- router.push({
|
|
|
- path: "/voyage/voyageAdd",
|
|
|
- });
|
|
|
- }
|
|
|
- let voyageAddDialogVisible = ref(false);
|
|
|
- const rules = reactive({
|
|
|
- rules: {
|
|
|
- voyageName: [
|
|
|
- { required: false, message: "请填写航次名称", trigger: "blur" },
|
|
|
- ],
|
|
|
- shipName: [{ required: true, message: "请选择船舶", trigger: "blur" }],
|
|
|
- cargoOwnerName: [
|
|
|
- { required: true, message: "请选择货主", trigger: "blur" },
|
|
|
- ],
|
|
|
- startTime: [
|
|
|
- { required: true, message: "请填写开始时间", trigger: "blur" },
|
|
|
- ],
|
|
|
- loadPort: [
|
|
|
- { required: true, message: "请填写装货港", trigger: "blur" },
|
|
|
- ],
|
|
|
- dischargeProt: [
|
|
|
- { required: true, message: "请填写卸货港", trigger: "blur" },
|
|
|
- ],
|
|
|
- cargo: [{ required: true, message: "请填写货种", trigger: "blur" }],
|
|
|
- tons: [{ required: true, message: "请填写吨位", trigger: "blur" }],
|
|
|
- },
|
|
|
- });
|
|
|
- let voyageForm = reactive({
|
|
|
- voyageForm: {
|
|
|
- voyageName: "",
|
|
|
- cargoOwnerId: "",
|
|
|
- cargoOwnerName: "",
|
|
|
- startTime: "",
|
|
|
- endTime: "",
|
|
|
- loadPort: "",
|
|
|
- dischargeProt: "",
|
|
|
- cargo: "",
|
|
|
- tons: "",
|
|
|
- loadPortId: "",
|
|
|
- dischargeProtId: "",
|
|
|
- shipId: "",
|
|
|
- shipName: "",
|
|
|
- },
|
|
|
+ let res = await api.getVoyageList({
|
|
|
+ ...voyageListPostData.value,
|
|
|
+ loginAccountId: localStorage.loginAccountId,
|
|
|
+ cargoOwnerId: localStorage.userId,
|
|
|
+ shipId: 0,
|
|
|
+ status: status.value,
|
|
|
+ term: term.value,
|
|
|
+ currentPage: currentPage.value,
|
|
|
+ size: 10,
|
|
|
+ });
|
|
|
+ term.value = "";
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ tableData.value = res.data.result;
|
|
|
+ total.value = res.data.total;
|
|
|
+ } else {
|
|
|
+ ElNotification({
|
|
|
+ type: "error",
|
|
|
+ title: res.data.msg,
|
|
|
});
|
|
|
+ }
|
|
|
+}
|
|
|
+function changeVoyageType(s) {
|
|
|
+ term.value = "";
|
|
|
+ currentPage.value = 1;
|
|
|
+ status.value = s;
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
+async function voyageDetail(id) {
|
|
|
+ router.push({
|
|
|
+ path: "/voyage/voyageDetail",
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|
|
|
+function pageChange(e) {
|
|
|
+ currentPage.value = e;
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
|
|
|
- function clear(type) {
|
|
|
- setTimeout(() => {
|
|
|
- switch (type) {
|
|
|
- case "shipId": {
|
|
|
- let index = ref(-1);
|
|
|
- for (let i in shipsCache.value) {
|
|
|
- if (
|
|
|
- voyageForm.voyageForm.shipName == shipsCache.value[i].shipName
|
|
|
- ) {
|
|
|
- index.value = i;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (index.value != -1) {
|
|
|
- voyageForm.voyageForm.shipId =
|
|
|
- shipsCache.value[index.value].shipId;
|
|
|
- } else {
|
|
|
- let b = shipsCache.value.some((item) => {
|
|
|
- return (
|
|
|
- item.shipId == voyageForm.voyageForm.shipId &&
|
|
|
- item.shipName == voyageForm.voyageForm.shipName
|
|
|
- );
|
|
|
- });
|
|
|
- voyageForm.voyageForm["shipId"] = "";
|
|
|
- voyageForm.voyageForm["shipName"] = "";
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- case "cargoOwnerId": {
|
|
|
- let index = ref(-1);
|
|
|
- for (let i in cargoOwnersCache.value) {
|
|
|
- if (
|
|
|
- voyageForm.voyageForm.cargoOwnerName ==
|
|
|
- cargoOwnersCache.value[i].userName
|
|
|
- ) {
|
|
|
- index.value = i;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (index.value != -1) {
|
|
|
- voyageForm.voyageForm.cargoOwnerId =
|
|
|
- cargoOwnersCache.value[index.value].userId;
|
|
|
- } else {
|
|
|
- let b = cargoOwnersCache.value.some((item) => {
|
|
|
- return (
|
|
|
- item.userId == voyageForm.voyageForm.cargoOwnerId &&
|
|
|
- item.userName == voyageForm.voyageForm.cargoOwnerName
|
|
|
- );
|
|
|
- });
|
|
|
- if (!b) {
|
|
|
- voyageForm.voyageForm["cargoOwnerId"] = "";
|
|
|
- voyageForm.voyageForm["cargoOwnerName"] = "";
|
|
|
- }
|
|
|
- }
|
|
|
+function goToVoyageAdd() {
|
|
|
+ router.push({
|
|
|
+ path: "/voyage/voyageAdd",
|
|
|
+ });
|
|
|
+}
|
|
|
+let voyageAddDialogVisible = ref(false);
|
|
|
+const rules = reactive({
|
|
|
+ rules: {
|
|
|
+ voyageName: [
|
|
|
+ { required: false, message: "请填写航次名称", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ shipName: [{ required: true, message: "请选择船舶", trigger: "blur" }],
|
|
|
+ cargoOwnerName: [
|
|
|
+ { required: true, message: "请选择货主", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ startTime: [{ required: true, message: "请填写开始时间", trigger: "blur" }],
|
|
|
+ loadPort: [{ required: true, message: "请填写装货港", trigger: "blur" }],
|
|
|
+ dischargeProt: [
|
|
|
+ { required: true, message: "请填写卸货港", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ cargo: [{ required: true, message: "请填写货种", trigger: "blur" }],
|
|
|
+ tons: [{ required: true, message: "请填写吨位", trigger: "blur" }],
|
|
|
+ },
|
|
|
+});
|
|
|
+let voyageForm = reactive({
|
|
|
+ voyageForm: {
|
|
|
+ voyageName: "",
|
|
|
+ cargoOwnerId: "",
|
|
|
+ cargoOwnerName: "",
|
|
|
+ startTime: "",
|
|
|
+ endTime: "",
|
|
|
+ loadPort: "",
|
|
|
+ dischargeProt: "",
|
|
|
+ cargo: "",
|
|
|
+ tons: "",
|
|
|
+ loadPortId: "",
|
|
|
+ dischargeProtId: "",
|
|
|
+ shipId: "",
|
|
|
+ shipName: "",
|
|
|
+ },
|
|
|
+});
|
|
|
|
|
|
+function clear(type) {
|
|
|
+ setTimeout(() => {
|
|
|
+ switch (type) {
|
|
|
+ case "shipId": {
|
|
|
+ let index = ref(-1);
|
|
|
+ for (let i in shipsCache.value) {
|
|
|
+ if (voyageForm.voyageForm.shipName == shipsCache.value[i].shipName) {
|
|
|
+ index.value = i;
|
|
|
break;
|
|
|
}
|
|
|
- case "loadPort": {
|
|
|
- let index = ref(-1);
|
|
|
- for (let i in colCache.value) {
|
|
|
- if (voyageForm.voyageForm.loadPort == colCache.value[i].value) {
|
|
|
- index.value = i;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (index.value != -1) {
|
|
|
- voyageForm.voyageForm.loadPortId =
|
|
|
- colCache.value[index.value].key;
|
|
|
- } else {
|
|
|
- let b = colCache.value.some((item) => {
|
|
|
- return (
|
|
|
- item.value == voyageForm.voyageForm.loadPort &&
|
|
|
- item.key == voyageForm.voyageForm.loadPortId
|
|
|
- );
|
|
|
- });
|
|
|
- if (!b) {
|
|
|
- voyageForm.voyageForm["loadPort"] = "";
|
|
|
- voyageForm.voyageForm["loadPortId"] = "";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+ if (index.value != -1) {
|
|
|
+ voyageForm.voyageForm.shipId = shipsCache.value[index.value].shipId;
|
|
|
+ } else {
|
|
|
+ let b = shipsCache.value.some((item) => {
|
|
|
+ return (
|
|
|
+ item.shipId == voyageForm.voyageForm.shipId &&
|
|
|
+ item.shipName == voyageForm.voyageForm.shipName
|
|
|
+ );
|
|
|
+ });
|
|
|
+ voyageForm.voyageForm["shipId"] = "";
|
|
|
+ voyageForm.voyageForm["shipName"] = "";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "cargoOwnerId": {
|
|
|
+ let index = ref(-1);
|
|
|
+ for (let i in cargoOwnersCache.value) {
|
|
|
+ if (
|
|
|
+ voyageForm.voyageForm.cargoOwnerName ==
|
|
|
+ cargoOwnersCache.value[i].userName
|
|
|
+ ) {
|
|
|
+ index.value = i;
|
|
|
break;
|
|
|
}
|
|
|
+ }
|
|
|
+ if (index.value != -1) {
|
|
|
+ voyageForm.voyageForm.cargoOwnerId =
|
|
|
+ cargoOwnersCache.value[index.value].userId;
|
|
|
+ } else {
|
|
|
+ let b = cargoOwnersCache.value.some((item) => {
|
|
|
+ return (
|
|
|
+ item.userId == voyageForm.voyageForm.cargoOwnerId &&
|
|
|
+ item.userName == voyageForm.voyageForm.cargoOwnerName
|
|
|
+ );
|
|
|
+ });
|
|
|
+ if (!b) {
|
|
|
+ voyageForm.voyageForm["cargoOwnerId"] = "";
|
|
|
+ voyageForm.voyageForm["cargoOwnerName"] = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- case "dischargeProt": {
|
|
|
- let index = ref(-1);
|
|
|
- for (let i in colCache.value) {
|
|
|
- if (
|
|
|
- voyageForm.voyageForm.dischargeProt == colCache.value[i].value
|
|
|
- ) {
|
|
|
- index.value = i;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (index.value != -1) {
|
|
|
- voyageForm.voyageForm.dischargeProtId =
|
|
|
- colCache.value[index.value].key;
|
|
|
- } else {
|
|
|
- let b = colCache.value.some((item) => {
|
|
|
- return (
|
|
|
- item.value == voyageForm.voyageForm.dischargeProt &&
|
|
|
- item.key == voyageForm.voyageForm.dischargeProtId
|
|
|
- );
|
|
|
- });
|
|
|
- if (!b) {
|
|
|
- voyageForm.voyageForm["dischargeProt"] = "";
|
|
|
- voyageForm.voyageForm["dischargeProtId"] = "";
|
|
|
- }
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "loadPort": {
|
|
|
+ let index = ref(-1);
|
|
|
+ for (let i in colCache.value) {
|
|
|
+ if (voyageForm.voyageForm.loadPort == colCache.value[i].value) {
|
|
|
+ index.value = i;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- }, 200);
|
|
|
- }
|
|
|
- let addVoyageForm = ref(null);
|
|
|
-
|
|
|
- async function addVoyage() {
|
|
|
- addVoyageForm.value.validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- console.log("提交", voyageForm.voyageForm);
|
|
|
- let res = await api.addVoyage({
|
|
|
- ...voyageForm.voyageForm,
|
|
|
+ if (index.value != -1) {
|
|
|
+ voyageForm.voyageForm.loadPortId = colCache.value[index.value].key;
|
|
|
+ } else {
|
|
|
+ let b = colCache.value.some((item) => {
|
|
|
+ return (
|
|
|
+ item.value == voyageForm.voyageForm.loadPort &&
|
|
|
+ item.key == voyageForm.voyageForm.loadPortId
|
|
|
+ );
|
|
|
});
|
|
|
- if (res.data.status == 0) {
|
|
|
- ElNotification({
|
|
|
- title: res.data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- resetAddVoyageForm();
|
|
|
- getVoyageList();
|
|
|
- } else {
|
|
|
- console.log(res);
|
|
|
- ElNotification({
|
|
|
- title: res.data.msg,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
+ if (!b) {
|
|
|
+ voyageForm.voyageForm["loadPort"] = "";
|
|
|
+ voyageForm.voyageForm["loadPortId"] = "";
|
|
|
}
|
|
|
- } else {
|
|
|
- console.log("未提交", voyageForm.voyageForm);
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
- let shipsCache = ref([]);
|
|
|
- let colCache = ref([]);
|
|
|
- let cargoOwnersCache = ref([]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- const searchShip = _.debounce(
|
|
|
- async (queryString, cb) => {
|
|
|
- if (!queryString) return;
|
|
|
- let res = await api.searchShip({
|
|
|
- term: queryString,
|
|
|
- });
|
|
|
- let ships = [];
|
|
|
- if (res.data.status == 0) {
|
|
|
- ships = res.data.result;
|
|
|
- for (let i of ships) {
|
|
|
- i.value = `${i.shipName}`;
|
|
|
+ case "dischargeProt": {
|
|
|
+ let index = ref(-1);
|
|
|
+ for (let i in colCache.value) {
|
|
|
+ if (voyageForm.voyageForm.dischargeProt == colCache.value[i].value) {
|
|
|
+ index.value = i;
|
|
|
+ break;
|
|
|
}
|
|
|
- shipsCache.value = ships;
|
|
|
- cb(ships);
|
|
|
}
|
|
|
- },
|
|
|
- 1000,
|
|
|
- { leading: true }
|
|
|
- );
|
|
|
-
|
|
|
- const selectShip = (item) => {
|
|
|
- voyageForm.voyageForm.shipId = item.shipId;
|
|
|
- };
|
|
|
-
|
|
|
- const searchCargoOwner = _.debounce(
|
|
|
- async (queryString, cb) => {
|
|
|
- if (!queryString) return;
|
|
|
- let res = await api.searchUser({
|
|
|
- term: queryString,
|
|
|
- identity: 2,
|
|
|
- });
|
|
|
- let cargoOwners = [];
|
|
|
- if (res.data.status == 0) {
|
|
|
- cargoOwners = res.data.result;
|
|
|
- for (let i of cargoOwners) {
|
|
|
- i.value = `${i.userName}`;
|
|
|
+ if (index.value != -1) {
|
|
|
+ voyageForm.voyageForm.dischargeProtId =
|
|
|
+ colCache.value[index.value].key;
|
|
|
+ } else {
|
|
|
+ let b = colCache.value.some((item) => {
|
|
|
+ return (
|
|
|
+ item.value == voyageForm.voyageForm.dischargeProt &&
|
|
|
+ item.key == voyageForm.voyageForm.dischargeProtId
|
|
|
+ );
|
|
|
+ });
|
|
|
+ if (!b) {
|
|
|
+ voyageForm.voyageForm["dischargeProt"] = "";
|
|
|
+ voyageForm.voyageForm["dischargeProtId"] = "";
|
|
|
}
|
|
|
- cargoOwnersCache.value = cargoOwners;
|
|
|
- cb(cargoOwners);
|
|
|
}
|
|
|
- },
|
|
|
- 1000,
|
|
|
- { leading: true }
|
|
|
- );
|
|
|
-
|
|
|
- const selectCargoOwner = (item) => {
|
|
|
- voyageForm.voyageForm.cargoOwnerId = item.userId;
|
|
|
- };
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
+}
|
|
|
+let addVoyageForm = ref(null);
|
|
|
|
|
|
- const getCol = _.debounce(
|
|
|
- async (queryString, cb) => {
|
|
|
- if (!queryString) return;
|
|
|
- let res = await api.getCol({
|
|
|
- term: queryString,
|
|
|
+async function addVoyage() {
|
|
|
+ addVoyageForm.value.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ console.log("提交", voyageForm.voyageForm);
|
|
|
+ let res = await api.addVoyage({
|
|
|
+ ...voyageForm.voyageForm,
|
|
|
+ });
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ ElNotification({
|
|
|
+ title: res.data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ resetAddVoyageForm();
|
|
|
+ getVoyageList();
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ ElNotification({
|
|
|
+ title: res.data.msg,
|
|
|
+ type: "error",
|
|
|
});
|
|
|
- if (res.data.status == 0) {
|
|
|
- colCache.value = [...colCache.value, ...res.data.result];
|
|
|
- colCache.value = _.uniqBy(colCache.value, "key");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("未提交", voyageForm.voyageForm);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
|
|
|
- cb(res.data.result);
|
|
|
- }
|
|
|
- },
|
|
|
- 1000,
|
|
|
- { leading: true }
|
|
|
- );
|
|
|
+let shipsCache = ref([]);
|
|
|
+let colCache = ref([]);
|
|
|
+let cargoOwnersCache = ref([]);
|
|
|
|
|
|
- const selectLoadPort = (item) => {
|
|
|
- voyageForm.voyageForm.loadPortId = item.key;
|
|
|
- voyageForm.voyageForm.loadPort = item.value;
|
|
|
- };
|
|
|
+const searchShip = _.debounce(
|
|
|
+ async (queryString, cb) => {
|
|
|
+ if (!queryString) return;
|
|
|
+ let res = await api.searchShip({
|
|
|
+ term: queryString,
|
|
|
+ });
|
|
|
+ let ships = [];
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ ships = res.data.result;
|
|
|
+ for (let i of ships) {
|
|
|
+ i.value = `${i.shipName}`;
|
|
|
+ }
|
|
|
+ shipsCache.value = ships;
|
|
|
+ cb(ships);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 1000,
|
|
|
+ { leading: true }
|
|
|
+);
|
|
|
|
|
|
- const selectDischargeProt = (item) => {
|
|
|
- voyageForm.voyageForm.dischargeProtId = item.key;
|
|
|
- voyageForm.voyageForm.dischargeProt = item.value;
|
|
|
- };
|
|
|
+const selectShip = (item) => {
|
|
|
+ voyageForm.voyageForm.shipId = item.shipId;
|
|
|
+};
|
|
|
|
|
|
- function resetAddVoyageForm() {
|
|
|
- voyageAddDialogVisible.value = false;
|
|
|
- addVoyageForm.value.resetFields();
|
|
|
+const searchCargoOwner = _.debounce(
|
|
|
+ async (queryString, cb) => {
|
|
|
+ if (!queryString) return;
|
|
|
+ let res = await api.searchUser({
|
|
|
+ term: queryString,
|
|
|
+ identity: 2,
|
|
|
+ });
|
|
|
+ let cargoOwners = [];
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ cargoOwners = res.data.result;
|
|
|
+ for (let i of cargoOwners) {
|
|
|
+ i.value = `${i.userName}`;
|
|
|
+ }
|
|
|
+ cargoOwnersCache.value = cargoOwners;
|
|
|
+ cb(cargoOwners);
|
|
|
}
|
|
|
+ },
|
|
|
+ 1000,
|
|
|
+ { leading: true }
|
|
|
+);
|
|
|
+
|
|
|
+const selectCargoOwner = (item) => {
|
|
|
+ voyageForm.voyageForm.cargoOwnerId = item.userId;
|
|
|
+};
|
|
|
|
|
|
- let sortradio = ref(0);
|
|
|
-
|
|
|
- getVoyageList();
|
|
|
- onMounted(() => {});
|
|
|
-
|
|
|
- return {
|
|
|
- currentPage,
|
|
|
- term,
|
|
|
- tableData,
|
|
|
- total,
|
|
|
- status,
|
|
|
- changeVoyageType,
|
|
|
- getVoyageList,
|
|
|
- voyageDetail,
|
|
|
- pageChange,
|
|
|
- goToVoyageAdd,
|
|
|
- addVoyage,
|
|
|
- voyageAddDialogVisible,
|
|
|
- addVoyageForm,
|
|
|
- ...toRefs(rules),
|
|
|
- ...toRefs(voyageForm),
|
|
|
- searchShip,
|
|
|
- selectShip,
|
|
|
- searchCargoOwner,
|
|
|
- selectCargoOwner,
|
|
|
- resetAddVoyageForm,
|
|
|
- getCol,
|
|
|
- selectLoadPort,
|
|
|
- selectDischargeProt,
|
|
|
- clear,
|
|
|
- sortradio,
|
|
|
- };
|
|
|
+const getCol = _.debounce(
|
|
|
+ async (queryString, cb) => {
|
|
|
+ if (!queryString) return;
|
|
|
+ let res = await api.getCol({
|
|
|
+ term: queryString,
|
|
|
+ });
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ colCache.value = [...colCache.value, ...res.data.result];
|
|
|
+ colCache.value = _.uniqBy(colCache.value, "key");
|
|
|
+
|
|
|
+ cb(res.data.result);
|
|
|
+ }
|
|
|
},
|
|
|
+ 1000,
|
|
|
+ { 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;
|
|
|
+ addVoyageForm.value.resetFields();
|
|
|
+}
|
|
|
+
|
|
|
+let sortradio = ref(0);
|
|
|
+async function downloadFYDI() {
|
|
|
+ let res0 = await api.getFYFIDownloadUrl({
|
|
|
+ loginAccountId: localStorage.loginAccountId,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res0.data.result == 1) {
|
|
|
+ ElNotification({
|
|
|
+ type: "info",
|
|
|
+ title: "更新中",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let url = res0.data.result;
|
|
|
+ let a = document.createElement("a");
|
|
|
+ a.setAttribute("href", url);
|
|
|
+ a.click();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+let exportModalVisable = ref(false);
|
|
|
+let exportModalTitle = ref("");
|
|
|
+let currentMonth = ref("");
|
|
|
+
|
|
|
+function showExportModal(type) {
|
|
|
+ exportModalVisable.value = true;
|
|
|
+ exportModalTitle.value = type;
|
|
|
+}
|
|
|
+
|
|
|
+let isLoadingZip = ref(false);
|
|
|
+
|
|
|
+async function exportZip() {
|
|
|
+ if (!currentMonth.value && exportModalTitle.value != "航次列表") return;
|
|
|
+
|
|
|
+ isLoadingZip.value = true;
|
|
|
+ let path = "";
|
|
|
+ let type = "";
|
|
|
+ let postData = {
|
|
|
+ loginAccountId: localStorage.loginAccountId,
|
|
|
+ };
|
|
|
+ let title = "";
|
|
|
+ switch (exportModalTitle.value) {
|
|
|
+ case "航次列表": {
|
|
|
+ path = "/voyage/exportListExcel";
|
|
|
+ type =
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
+ title = `${exportModalTitle.value}`;
|
|
|
+ let arr = [];
|
|
|
+ for (let i of tableData.value) {
|
|
|
+ arr.push(i.id);
|
|
|
+ }
|
|
|
+ postData.voyageIds = arr.join(",");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "航次跟踪": {
|
|
|
+ path = "/voyage/exportMultExcel";
|
|
|
+ type = "application/zip";
|
|
|
+ postData.date = currentMonth.value;
|
|
|
+ title = `${exportModalTitle.value}${currentMonth.value}`;
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "卸货记录": {
|
|
|
+ path = "/voyage/exportMultDischargeExcel";
|
|
|
+ type = "application/zip";
|
|
|
+ postData.date = currentMonth.value;
|
|
|
+ title = `${exportModalTitle.value}${currentMonth.value}`;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ let res = await downloadBlobFile(
|
|
|
+ `${url.baseurl}${path}`,
|
|
|
+ postData,
|
|
|
+ title,
|
|
|
+ "post",
|
|
|
+ type
|
|
|
+ );
|
|
|
+ if (res.status == 0) {
|
|
|
+ ElNotification({
|
|
|
+ title: "导出成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElNotification({
|
|
|
+ title: "暂无数据",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ ElNotification({
|
|
|
+ title: "暂无数据",
|
|
|
+ });
|
|
|
+ } finally {
|
|
|
+ isLoadingZip.value = false;
|
|
|
+ currentMonth.value = "";
|
|
|
+ exportModalVisable.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function rowStyle({ row }) {
|
|
|
+ let rowStyle = {};
|
|
|
+
|
|
|
+ if (row.daysInPort >= 20 && row.daysInPort < 25) {
|
|
|
+ rowStyle.color = "#f9ca24";
|
|
|
+ } else if (row.daysInPort >= 25 && row.daysInPort < 30) {
|
|
|
+ rowStyle.color = "#f0932b";
|
|
|
+ } else if (row.daysInPort >= 30) {
|
|
|
+ rowStyle.color = "#eb4d4b";
|
|
|
+ }
|
|
|
+
|
|
|
+ return rowStyle;
|
|
|
+}
|
|
|
+
|
|
|
+let voyageNameVisable = ref(true);
|
|
|
+let loadPortVisable = ref(true);
|
|
|
+let dischargePortVisable = ref(true);
|
|
|
+let expectedArrivalTimeVisable = ref(true);
|
|
|
+let abnormalStatusVisable = ref(true);
|
|
|
+let daysInPortVisable = ref(true);
|
|
|
+let todayPhotoCountVisable = ref(true);
|
|
|
+let cargoVisable = ref(true);
|
|
|
+let actualLoadTonsVisable = ref(true);
|
|
|
+let unloadedtonsVisable = ref(true);
|
|
|
+let remainTonsVisable = ref(true);
|
|
|
+let hasInsuranceVisable = ref(true);
|
|
|
+
|
|
|
+let selectAllVisable = ref(true);
|
|
|
+function selectAll(e) {
|
|
|
+ loadPortVisable.value = e;
|
|
|
+ dischargePortVisable.value = e;
|
|
|
+ expectedArrivalTimeVisable.value = e;
|
|
|
+ abnormalStatusVisable.value = e;
|
|
|
+ daysInPortVisable.value = e;
|
|
|
+ todayPhotoCountVisable.value = e;
|
|
|
+ cargoVisable.value = e;
|
|
|
+ actualLoadTonsVisable.value = e;
|
|
|
+ unloadedtonsVisable.value = e;
|
|
|
+ remainTonsVisable.value = e;
|
|
|
+ hasInsuranceVisable.value = e;
|
|
|
+}
|
|
|
+
|
|
|
+function selectSingle(e) {
|
|
|
+ if (!e) {
|
|
|
+ selectAllVisable.value = e;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+let loadPortFilterStr = ref("");
|
|
|
+function selectLoadPortFilter(item) {
|
|
|
+ voyageListPostData.value.loadPortId = item.key;
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
+let discPortFilterStr = ref("");
|
|
|
+function selectDiscPortFilter(item) {
|
|
|
+ voyageListPostData.value.discPortId = item.key;
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
+let cargoFilterStr = ref("");
|
|
|
+function selectCargoFilter(item) {
|
|
|
+ voyageListPostData.value.cargo = item.key;
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
+
|
|
|
+function resetFilter() {
|
|
|
+ loadPortFilterStr.value = "";
|
|
|
+ discPortFilterStr.value = "";
|
|
|
+ cargoFilterStr.value = "";
|
|
|
+ voyageListPostData.value = {};
|
|
|
+ getVoyageList();
|
|
|
+}
|
|
|
+let cargoOptions = ref([]);
|
|
|
+async function getCargoSelect() {
|
|
|
+ if (cargoOptions.value.length) return;
|
|
|
+ let res = await api.getCargoSelect({
|
|
|
+ loginAccountId: loginAccountId.value,
|
|
|
+ status: 2,
|
|
|
+ term: "",
|
|
|
+ });
|
|
|
+ cargoOptions.value = res.data.result;
|
|
|
+}
|
|
|
+
|
|
|
+let portOptions = ref([]);
|
|
|
+async function getPortSelect() {
|
|
|
+ if (portOptions.value.length) return;
|
|
|
+ let res = await api.getCol({
|
|
|
+ term: "",
|
|
|
+ });
|
|
|
+ portOptions.value = res.data.result;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getVoyageList();
|
|
|
+ loginAccountId.value = localStorage.loginAccountId;
|
|
|
+});
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.search-btn {
|