Parcourir la source

新增 航次列表

wangzhihui il y a 4 ans
Parent
commit
12b37c09c1
1 fichiers modifiés avec 279 ajouts et 3 suppressions
  1. 279 3
      src/views/voyage/voyageList.vue

+ 279 - 3
src/views/voyage/voyageList.vue

@@ -1,9 +1,285 @@
-<template>voyageList</template>
+<template>
+  <div class="full-container-p24">
+    <div class="df aic">
+      <div
+        @click="changeVoyageType(1)"
+        :class="
+          currentbtn
+            ? 'currentbtn radio-btns left-radius'
+            : 'radio-btns left-radius'
+        "
+      >
+        执行中航次
+      </div>
+      <div
+        @click="changeVoyageType(2)"
+        :class="
+          currentbtn
+            ? ' radio-btns right-radius'
+            : 'radio-btns right-radius currentbtn'
+        "
+        style="margin-right: 40px"
+      >
+        历史航次
+      </div>
+      <el-input
+        placeholder="请输入货主名称/联系人/联系人手机号"
+        prefix-icon="el-icon-search"
+        v-model="term"
+        style="height: 32px; width: 330px; line-height: 32px"
+      ></el-input>
+      <div class="seach-btn" @click="getVoyageList()">查询</div>
+    </div>
+
+    <el-table :data="tableData" stripe style="width: 100%; margin-top: 24px">
+      <el-table-column
+        type="index"
+        label="序号"
+        min-width="80"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="userName"
+        label="航次名称"
+        min-width="120"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="contactName"
+        label="装货港-卸货港"
+        min-width="120"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="开始时间-结束时间"
+        label="联系人手机号"
+        min-width="160"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="createTime"
+        label="货种"
+        min-width="200"
+        align="center"
+      ></el-table-column>
+
+      <el-table-column
+        prop="createTime"
+        label="吨位(吨)"
+        min-width="200"
+        align="center"
+      ></el-table-column>
+
+      <el-table-column
+        prop="createTime"
+        label="船舶状态"
+        min-width="200"
+        align="center"
+      ></el-table-column>
+
+      <el-table-column
+        prop="createTime"
+        label="备注"
+        min-width="200"
+        align="center"
+      ></el-table-column>
+      <el-table-column label="操作" min-width="80" align="center">
+        <template v-slot="scope">
+          <el-button
+            @click="voyageDetail(scope.row, tableData)"
+            type="text"
+            size="small"
+          >
+            查看详情
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="width: 100%; text-align: right; margin-top: 43px">
+      <el-pagination
+        background
+        layout="prev, pager, next"
+        :total="total"
+        @current-change="pageChange"
+      ></el-pagination>
+    </div>
+  </div>
+</template>
 <script>
+import { ref, h, reactive, toRefs, onMounted } from "vue";
+import { Notification, Msgbox, Message } from "element3";
+import store from "../../store";
+import router from "../../router";
+import md5 from "md5";
+import api from "../../apis/fetch";
+
 export default {
   setup() {
-    return {};
+    let currentbtn = ref(true);
+
+    let currentPage = ref(1);
+    let term = ref();
+    let tableData = ref();
+    let total = ref();
+    let status = ref(1);
+    async function getVoyageList() {
+      let res = await api.getVoyageList({
+        cargoOwnerId: 0,
+        shipId: 0,
+        status: status.value,
+        term: term.value,
+        currentPage: currentPage.value,
+        size: 10,
+      });
+
+      console.log(res);
+    }
+    function changeVoyageType(s) {
+      currentbtn.value = s == 1;
+      status.value = s;
+      getVoyageList();
+    }
+    async function voyageDetail(id) {
+      router.push({
+        path: "/voyageManage/voyageDetail",
+        query: {
+          id,
+        },
+      });
+    }
+    function pageChange(e) {
+      currentPage.value = e;
+      getVoyageList(status.value);
+    }
+    onMounted(() => {});
+    return {
+      currentPage,
+      term,
+      tableData,
+      total,
+      currentbtn,
+      changeVoyageType,
+      getVoyageList,
+      voyageDetail,
+      pageChange,
+    };
   },
 };
 </script>
-<style scoped></style>
+<style scoped>
+.seach-btn {
+  display: inline-block;
+  width: 60px;
+  height: 32px;
+  background: #0094fe;
+  border-radius: 2px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  text-align: center;
+  line-height: 32px;
+  margin-left: 10px;
+  cursor: pointer;
+}
+
+.cargo-owner-add {
+  width: 80px;
+  height: 32px;
+  border-radius: 2px;
+  border: 1px solid #0094fe;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+  line-height: 32px;
+  text-align: center;
+  cursor: pointer;
+}
+:deep().el-input__icon {
+  line-height: 100% !important;
+}
+
+:deep().el-dialog {
+  width: 560px;
+  padding: 20px 50px;
+  border-radius: 6px;
+}
+
+:deep() .el-dialog__title {
+  font-size: 18px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+}
+
+.normal-label {
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #353a42;
+  margin-right: 10px;
+}
+
+.show-input {
+  width: 280px;
+  height: 32px;
+  background: #ffffff;
+  border-radius: 2px;
+  border: 1px solid #dee0e3;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 32px;
+  padding-left: 12px;
+  margin-right: 40px;
+}
+
+.radio-btns {
+  height: 34px;
+  width: 103px;
+  border: 1px solid #1486f9;
+  line-height: 34px;
+  text-align: center;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+  cursor: pointer;
+}
+
+.left-radius {
+  border-top-left-radius: 17px;
+  border-bottom-left-radius: 17px;
+}
+
+.right-radius {
+  border-top-right-radius: 17px;
+  border-bottom-right-radius: 17px;
+}
+.currentbtn {
+  background: #1486f9;
+  color: #fff;
+}
+
+.seach-btn {
+  display: inline-block;
+  width: 60px;
+  height: 32px;
+  background: #0094fe;
+  border-radius: 2px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  text-align: center;
+  line-height: 32px;
+  margin-left: 10px;
+  cursor: pointer;
+}
+
+:deep().el-input__icon {
+  line-height: 100% !important;
+}
+</style>