Bläddra i källkod

更新 数据重置逻辑

wangzhihui 4 år sedan
förälder
incheckning
f397ae897e

+ 3 - 2
src/views/cargoOwnerManage/cargoOwnerDetail.vue

@@ -154,8 +154,9 @@ export default {
     }
     getUserDetail();
     getVoyageList();
-    const tableData = ref();
+    const tableData = ref([]);
     async function getVoyageList() {
+      tableData.value = [];
       let res = await api.getVoyageList({
         cargoOwnerId: route.query.userId,
         shipId: 0,
@@ -164,6 +165,7 @@ export default {
         currentPage: currentPage.value,
         size: 10,
       });
+      term.value = "";
       if (res.data.status == 0) {
         tableData.value = res.data.result;
       } else {
@@ -172,7 +174,6 @@ export default {
     }
     function changeVoyageType(s) {
       currentPage.value = 1;
-      tableData.value = [];
       currentbtn.value = s == 1;
       status.value = s;
       getVoyageList();

+ 2 - 0
src/views/cargoOwnerManage/cargoOwnerList.vue

@@ -146,12 +146,14 @@ export default {
       },
     });
     async function getCargoOwnerList() {
+      tableData.value = [];
       let res = await api.getUserList({
         identity: 2,
         currentPage: currentPage.value,
         size: 10,
         term: term.value,
       });
+      term.value = "";
       if (res.data.status == 0) {
         tableData.value = res.data.result;
         total.value = res.data.total;

+ 2 - 0
src/views/shipInfo/shipList.vue

@@ -100,11 +100,13 @@ export default {
     let tableData = ref();
     let total = ref();
     async function getShipList() {
+      tableData.value = [];
       let res = await api.getShipList({
         currentPage: currentPage.value,
         size: 10,
         term: term.value,
       });
+      term.value = "";
       if (res.data.status == 0) {
         tableData.value = res.data.result;
         total.value = res.data.total;

+ 2 - 0
src/views/shipOwnerManage/shipOwnerList.vue

@@ -76,12 +76,14 @@ export default {
     let tableData = ref();
     let total = ref();
     async function getShipOwnerList() {
+      tableData.value = [];
       let res = await api.getUserList({
         identity: 1,
         currentPage: currentPage.value,
         size: 10,
         term: term.value,
       });
+      term.value = "";
       if (res.data.status == 0) {
         tableData.value = res.data.result;
         total.value = res.data.total;

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

@@ -195,6 +195,8 @@ export default {
     let total = ref();
     let status = ref(1);
     async function getVoyageList() {
+      tableData.value = [];
+
       let res = await api.getVoyageList({
         cargoOwnerId: 0,
         shipId: 0,
@@ -203,14 +205,13 @@ export default {
         currentPage: currentPage.value,
         size: 10,
       });
-
+      term.value = "";
       if (res.data.status == 0) {
         tableData.value = res.data.result;
       }
     }
     function changeVoyageType(s) {
       currentPage.value = 1;
-      tableData.value = [];
       currentbtn.value = s == 1;
       status.value = s;
       getVoyageList();