浏览代码

更新 航次列表获取逻辑

wzh 3 年之前
父节点
当前提交
efe603038b
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/views/voyage/voyageList.vue

+ 6 - 4
src/views/voyage/voyageList.vue

@@ -59,9 +59,9 @@
           v-model="term"
           clearable
           style="width: 240px"
-          @keyup.enter.native="getVoyageList()"
+          @keyup.enter.native="getVoyageList(1)"
         ></el-input>
-        <div class="search-btn" @click="getVoyageList()">查询</div>
+        <div class="search-btn" @click="getVoyageList(1)">查询</div>
       </div>
       <!-- <div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
         添加航次
@@ -404,9 +404,9 @@ let term = ref("");
 let tableData = ref([]);
 let total = ref(0);
 let status = ref(0);
-async function getVoyageList() {
+async function getVoyageList(type) {
   tableData.value = [];
-
+  currentPage.value = type || currentPage.value;
   let res = await api.getVoyageList({
     loginAccountId: localStorage.loginAccountId,
     cargoOwnerId: localStorage.userId,
@@ -420,6 +420,8 @@ async function getVoyageList() {
     tableData.value = res.data.result;
     total.value = res.data.total;
   } else {
+    tableData.value = [];
+    total.value = 0;
     ElNotification({
       type: "error",
       title: res.data.msg,