浏览代码

新增 历史消防安检列表

wzg 1 年之前
父节点
当前提交
913ffe7203

+ 9 - 0
src/router/index.js

@@ -189,6 +189,15 @@ const router = createRouter({
       component: () =>
         import("../views/fireSafetyManage/checkFireSafetyExamine.vue"),
     },
+    {
+      path: "/fireSafetyManage/fireSafetyHistoryCheckList",
+      name: "fireSafetyHistoryCheckList",
+      meta: {
+        title: "历史消防安检列表",
+      },
+      component: () =>
+        import("../views/fireSafetyManage/fireSafetyHistoryCheckList.vue"),
+    },
   ],
 });
 

+ 2 - 2
src/views/fireSafetyManage/checkFireSafetyExamineList.vue

@@ -2,7 +2,7 @@
   <div class="full-container-p24">
     <div class="df jcsb">
       <div class="df aic">
-        <el-button-group class="mr30">
+        <!-- <el-button-group class="mr30">
           <el-button
             @click="(type = 1), getFireSafetyCheckList(1)"
             :type="type == 1 ? 'primary' : ''"
@@ -15,7 +15,7 @@
           >
             未审核船舶
           </el-button>
-        </el-button-group>
+        </el-button-group> -->
         <el-input
           placeholder="请输入安检名称"
           prefix-icon="el-icon-search"

+ 262 - 0
src/views/fireSafetyManage/fireSafetyHistoryCheckList.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="full-container-p24">
+    <div class="df jcsb">
+      <div class="df aic">
+        <!-- <el-button-group class="mr30">
+            <el-button
+              @click="(type = 1), getFireSafetyCheckList(1)"
+              :type="type == 2 ? 'primary' : ''"
+            >
+              待审核船舶
+            </el-button>
+            <el-button
+              @click="(type = 2), getFireSafetyCheckList(1)"
+              :type="type == 3 ? 'primary' : ''"
+            >
+              未审核船舶
+            </el-button>
+          </el-button-group> -->
+        <el-input
+          placeholder="请输入安检名称"
+          prefix-icon="el-icon-search"
+          v-model="term"
+          clearable
+          class="mr10"
+          style="width: 200px"
+        ></el-input>
+        <el-button type="primary" @click="getFireSafetyCheckList(1)">
+          查询
+        </el-button>
+      </div>
+      <!-- <el-button type="primary" @click="goToAdd">发起船舶安检</el-button> -->
+    </div>
+    <div style="margin-top: 24px">
+      <el-table border :data="tableData" stripe style="width: 100%">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="80"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="shipname"
+          label="船舶名称"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="securityCheckName"
+          label="安检名称"
+          min-width="120"
+          align="center"
+          v-if="type == 2"
+        ></el-table-column>
+        <el-table-column
+          prop="createTime"
+          label="发起安检日期"
+          min-width="120"
+          align="center"
+          v-if="type == 2"
+        >
+          <template v-slot="scope">
+            {{ subTimeStr(scope.row.createTime) }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="shipOwnerName"
+          label="船东名称"
+          min-width="120"
+          align="center"
+          v-if="type == 2"
+        ></el-table-column>
+        <el-table-column
+          prop="shipOwnerPhone"
+          label="船东手机号"
+          min-width="120"
+          align="center"
+          v-if="type == 2"
+        ></el-table-column>
+        <el-table-column
+          prop="mmsi"
+          label="MMSI"
+          min-width="120"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="shipname"
+          label="IMO"
+          min-width="120"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="length"
+          label="船长"
+          min-width="80"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="breadth"
+          label="船宽"
+          min-width="80"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="tonnage"
+          label="船舶总吨"
+          min-width="100"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="loadTons"
+          label="载重吨位"
+          min-width="100"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="draught"
+          label="吃水"
+          min-width="80"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column
+          prop="age"
+          label="船龄"
+          min-width="80"
+          align="center"
+          v-if="type == 3"
+        ></el-table-column>
+        <el-table-column label="操作" min-width="120" align="center">
+          <template v-slot="scope">
+            <el-button type="primary" link @click="goTo(scope.row.id)">
+              详情
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="df aic jcfe mt40 mr20">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :current-page="currentPage"
+          :total="total"
+          @current-change="pageChange"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+<script setup>
+import { ref, h, reactive, toRefs, onMounted } from "vue";
+import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
+import store from "../../store";
+import router from "../../router";
+import md5 from "md5";
+import api from "../../apis/fetch";
+import { subTimeStr } from "../../utils/utils";
+
+function goToAdd() {
+  router.push("/shipSecurityManage/checkShip");
+}
+let currentPage = ref(1);
+let term = ref("");
+let tableData = ref([]);
+let total = ref(0);
+let type = ref(2);
+let choiceCompanyId = ref(0);
+async function getFireSafetyCheckList(page) {
+  currentPage.value = page || currentPage.value;
+  let res = await api.getFireSafetyCheckList({
+    choiceCompanyId: choiceCompanyId.value,
+    currentPage: currentPage.value,
+    size: 10,
+    term: term.value,
+    type: type.value,
+  });
+  if (res.data.status == 0) {
+    tableData.value = res.data.result;
+    total.value = res.data.total;
+  } else {
+    tableData.value = [];
+    total.value = 0;
+  }
+}
+
+async function getSecurityTemplateDetail(id) {
+  router.push({
+    path: "/fireSafetyManage/shipCheckTemplateDetail",
+    query: {
+      id,
+    },
+  });
+}
+
+function goTo(id) {
+  store.commit("addAlive", "checkFireSafetyExamineList");
+  router.push({
+    path: "/fireSafetyManage/checkFireSafetyExamine",
+    query: {
+      id,
+      isHistory: 1,
+    },
+  });
+}
+
+function pageChange(e) {
+  currentPage.value = e;
+  getFireSafetyCheckList();
+}
+onMounted(() => {
+  getFireSafetyCheckList();
+});
+</script>
+<style scoped>
+.seach-btn {
+  display: inline-block;
+  width: 60px;
+  height: 38px;
+  background: #0094fe;
+  border-radius: 2px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  text-align: center;
+  line-height: 38px;
+  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-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;
+}
+</style>