Quellcode durchsuchen

更新 船舶信息

wzh vor 3 Jahren
Ursprung
Commit
e57e49161d
4 geänderte Dateien mit 47 neuen und 39 gelöschten Zeilen
  1. 24 24
      src/apis/fetch.js
  2. 4 4
      src/router/index.js
  3. 4 4
      src/views/shipManage/shipDetail.vue
  4. 15 7
      src/views/shipManage/shipList.vue

+ 24 - 24
src/apis/fetch.js

@@ -7,27 +7,27 @@ export default {
 
   // 获取用户列表 货主/船东
   getUserList(data) {
-    return $http("user/backstage/list", data);
+    return $http("user/list", data);
   },
 
   // 添加用户
   addUser(data) {
-    return $http("user/backstage/add", data);
+    return $http("user/add", data);
   },
 
   // 添加船东
   addShipOwner(data) {
-    return $http("user/backstage/saveShipOwner", data);
+    return $http("user/saveShipOwner", data);
   },
 
   // 获取用户详情
   getUserDetail(data) {
-    return $http("user/backstage/details", data);
+    return $http("user/details", data);
   },
 
   // 更新用户详情
   updateUserDetail(data) {
-    return $http("/user/backstage/update", data);
+    return $http("/user/update", data);
   },
 
   // 获取航次列表
@@ -42,72 +42,72 @@ export default {
 
   // 更新航次
   updateVoyage(data) {
-    return $http("/voyage/backstage/update", data);
+    return $http("/voyage/update", data);
   },
 
   // 完成航次
   finishVoyage(data) {
-    return $http("/voyage/backstage/finish", data);
+    return $http("/voyage/finish", data);
   },
 
   // 根据船名/MMSI/船东手机号获取船舶用户信息(员工端添加航次选择船)
   getUserInfoAndShipInfo(data) {
-    return $http("ship/backstage/userShipInfo", data);
+    return $http("ship/userShipInfo", data);
   },
 
   // 添加航次
   addVoyage(data) {
-    return $http("voyage/backstage/add", data);
+    return $http("voyage/add", data);
   },
 
   // 获取媒体列表
   getMediaList(data) {
-    return $http("/media/backstage/list", data);
+    return $http("/media/list", data);
   },
 
   // 审核媒体文件
   auditMedia(data) {
-    return $http("/media/backstage/audit", data);
+    return $http("/media/audit", data);
   },
 
   // 标记媒体文件
   markMedia(data) {
-    return $http("/media/backstage/markMedia", data);
+    return $http("/media/markMedia", data);
   },
 
   // 模糊搜索用户
   searchUser(data) {
-    return $http("/user/backstage/search", data);
+    return $http("/user/search", data);
   },
 
   // 获取船舶列表
   getShipList(data) {
-    return $http("/ship/backstage/list", data);
+    return $http("/ship/list", data);
   },
 
   // 更新船舶信息
   updateShip(data) {
-    return $http("/ship/backstage/update", data);
+    return $http("/ship/update", data);
   },
 
   // 更新船东信息
   updateShipOwner(data) {
-    return $http("/user/backstage/update", data);
+    return $http("/user/update", data);
   },
 
   // 获取船舶详情
   getShipDetail(data) {
-    return $http("/ship/backstage/detail", data);
+    return $http("/ship/detail", data);
   },
 
   // 船舶查询
   searchShip(data) {
-    return $http("ship/backstage/search", data);
+    return $http("ship/search", data);
   },
 
   // 根据shipId获取船东列表
   getShipOwnerListByShipId(data) {
-    return $http("/user/backstage/shopOwnerlist", data);
+    return $http("/ship/detail/shopOwner/list", data);
   },
 
   // 添加卸货记录
@@ -137,7 +137,7 @@ export default {
 
   // 获取未拍照航次
   getUnphotographNotice() {
-    return $http("/voyage/backstage/notice");
+    return $http("/voyage/notice");
   },
 
   // 计算预计到港时间
@@ -157,12 +157,12 @@ export default {
 
   // 获取港口列表
   getCol(data) {
-    return $http("/port/backstage/getCol", data);
+    return $http("/port/getCol", data);
   },
 
   // 取消航次
   cancelVoyage(data) {
-    return $http("/voyage/backstage/cancel", data);
+    return $http("/voyage/cancel", data);
   },
 
   // 添加汽车装货记录
@@ -197,7 +197,7 @@ export default {
 
   // 用户选择
   getUserSelect(data) {
-    return $http("/user/backstage/select", data);
+    return $http("/user/select", data);
   },
 
   // 添加提货单
@@ -242,7 +242,7 @@ export default {
 
   // 插入卸货港
   addNewPort(data) {
-    return $http("/voyage/backstage/addNewPort", data);
+    return $http("/voyage/addNewPort", data);
   },
 
   // 代理列表

+ 4 - 4
src/router/index.js

@@ -40,20 +40,20 @@ const router = createRouter({
         import("../views/cargoOwnerManage/cargoOwnerCompanyList.vue"),
     },
     {
-      path: "/shipInfo/shipList",
+      path: "/shipManage/shipList",
       name: "shipList",
       meta: {
         title: "船舶列表",
       },
-      component: () => import("../views/shipInfo/shipList.vue"),
+      component: () => import("../views/shipManage/shipList.vue"),
     },
     {
-      path: "/shipInfo/shipDetail",
+      path: "/shipManage/shipDetail",
       name: "shipDetail",
       meta: {
         title: "船舶详情",
       },
-      component: () => import("../views/shipInfo/shipDetail.vue"),
+      component: () => import("../views/shipManage/shipDetail.vue"),
     },
     {
       path: "/shipOwnerManage/shipOwnerDetail",

+ 4 - 4
src/views/shipInfo/shipDetail.vue → src/views/shipManage/shipDetail.vue

@@ -3,7 +3,7 @@
     <i class="el-icon-arrow-left"></i>
     <div
       class="dib go-back ml8 pointer"
-      @click="router.replace('/shipInfo/shipList')"
+      @click="router.replace('/shipManage/shipList')"
     >
       返回船舶列表
     </div>
@@ -101,7 +101,7 @@
           align="center"
         ></el-table-column>
         <el-table-column
-          prop="userPhone"
+          prop="phone"
           label="手机号"
           min-width="160"
           align="center"
@@ -168,9 +168,9 @@
         ></el-input>
         <div class="search-btn" @click="getVoyageList()">查询</div>
       </div>
-      <div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
+      <!-- <div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
         添加航次
-      </div>
+      </div> -->
     </div>
     <el-dialog v-model="voyageAddDialogVisible" title="添加航次">
       <el-form

+ 15 - 7
src/views/shipInfo/shipList.vue → src/views/shipManage/shipList.vue

@@ -9,7 +9,7 @@
           clearable
           style="height: 32px; width: 330px; line-height: 32px"
         ></el-input>
-        <div class="seach-btn" @click="getShipList">查询</div>
+        <div class="seach-btn" @click="getShipList(1)">查询</div>
       </div>
     </div>
     <div style="margin-top: 24px">
@@ -79,6 +79,7 @@
           background
           layout="prev, pager, next"
           :total="total"
+          :current-page="currentPage"
           @current-change="pageChange"
         ></el-pagination>
       </div>
@@ -97,10 +98,13 @@ export default {
   setup() {
     let currentPage = ref(1);
     let term = ref("");
-    let tableData = ref();
-    let total = ref();
-    async function getShipList() {
+    let tableData = ref([]);
+    let total = ref(0);
+    async function getShipList(type) {
       tableData.value = [];
+      if (type == 1) {
+        currentPage.value = 1;
+      }
       let res = await api.getShipList({
         currentPage: currentPage.value,
         size: 10,
@@ -109,12 +113,15 @@ export default {
       if (res.data.status == 0) {
         tableData.value = res.data.result;
         total.value = res.data.total;
+      } else {
+        tableData.value = [];
+        total.value = 0;
       }
     }
 
     async function shipDetail(shipId) {
       router.push({
-        path: "/shipInfo/shipDetail",
+        path: "/shipManage/shipDetail",
         query: {
           shipId,
         },
@@ -124,8 +131,9 @@ export default {
       currentPage.value = e;
       getShipList();
     }
-    getShipList();
-    onMounted(() => {});
+    onMounted(() => {
+      getShipList();
+    });
     return {
       currentPage,
       term,