Explorar el Código

refactor(certManage): 优化证书管理页面

- 移除有效期列的冗余代码
- 简化详情按钮的逻辑
- 添加 goToShipDetail 和 goToShipOwnerDetail 函数
- 删除冗余的 goToDetail 函数
wzg hace 7 meses
padre
commit
b1db946b36
Se han modificado 1 ficheros con 25 adiciones y 46 borrados
  1. 25 46
      src/views/workStation/certsManage.vue

+ 25 - 46
src/views/workStation/certsManage.vue

@@ -110,18 +110,6 @@
             min-width="140"
           />
           <el-table-column
-            v-if="certType == 6"
-            align="center"
-            prop="crewCertExpiryDate"
-            label="有效期"
-            min-width="120"
-          >
-            <template v-slot="scope">
-              {{ subTimeStr(scope.row.crewCertExpiryDate) }}
-            </template>
-          </el-table-column>
-          <el-table-column
-            v-if="certType != 6"
             align="center"
             prop="endValidTime"
             label="有效期"
@@ -133,28 +121,19 @@
           </el-table-column>
           <el-table-column align="center" label="详情" min-width="120">
             <template #default="scope">
-              <CrewInfo
+              <el-button
                 v-if="certType == 6"
-                class="mr10"
-                :shipCode="route.query.shipCode"
-                :shipname="scope.row.shipname"
-                :crewId="scope.row.id"
-                :crewInfo="scope.row"
-                btnText="查看"
-                :isText="true"
-                disabled
-              ></CrewInfo>
+                type="primary"
+                text
+                @click="goToShipOwnerDetail(scope.row.id)"
+              >
+                详情
+              </el-button>
               <el-button
                 v-else
                 type="primary"
                 text
-                @click="
-                  goToDetail(
-                    scope.row.shipCode,
-                    scope.row.crewName,
-                    scope.row.id
-                  )
-                "
+                @click="goToShipDetail(scope.row.shipCode)"
               >
                 详情
               </el-button>
@@ -235,24 +214,24 @@ function pageChange(e) {
   currentPage.value = e;
   getCertList();
 }
-function goToDetail(shipCode, crewName, shipCrewId) {
-  if (certType.value === 6 && crewName) {
-    router.push({
-      path: "/crewManage/crewDetail",
-      query: {
-        shipCode,
-        shipCrewId,
-      },
-    });
-  } else {
-    router.push({
-      path: "/shipManage/shipDetail",
-      query: {
-        shipCode,
-      },
-    });
-  }
+function goToShipDetail(shipCode) {
+  router.push({
+    path: "/shipManage/shipDetail",
+    query: {
+      shipCode,
+    },
+  });
 }
+
+function goToShipOwnerDetail(shipOwnerId) {
+  router.push({
+    path: "/shipOwnerManage/shipOwnerDetail",
+    query: {
+      shipOwnerId,
+    },
+  });
+}
+
 let certTypes = ref([
   {
     validTypes: [],