shipCheckHistoryList.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="full-container-p24">
  3. <div class="df jcsb">
  4. <div class="df aic">
  5. <el-input
  6. placeholder="请输入安检名称"
  7. prefix-icon="el-icon-search"
  8. v-model="term"
  9. clearable
  10. class="mr10"
  11. style="width: 200px"
  12. ></el-input>
  13. <el-button type="primary" @click="getSecurityCheckShipList(1)">
  14. 查询
  15. </el-button>
  16. </div>
  17. </div>
  18. <div style="margin-top: 24px">
  19. <el-table border :data="tableData" stripe style="width: 100%">
  20. <el-table-column
  21. type="index"
  22. label="序号"
  23. width="80"
  24. align="center"
  25. ></el-table-column>
  26. <el-table-column
  27. prop="shipname"
  28. label="船舶名称"
  29. min-width="120"
  30. align="center"
  31. ></el-table-column>
  32. <el-table-column
  33. prop="securityCheckName"
  34. label="安检名称"
  35. min-width="120"
  36. align="center"
  37. ></el-table-column>
  38. <el-table-column
  39. prop="createTime"
  40. label="发起安检日期"
  41. min-width="120"
  42. align="center"
  43. >
  44. <template v-slot="scope">
  45. {{ subTimeStr(scope.row.createTime) }}
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. prop="shipOwnerName"
  50. label="船东名称"
  51. min-width="120"
  52. align="center"
  53. ></el-table-column>
  54. <el-table-column
  55. prop="shipOwnerPhone"
  56. label="船东手机号"
  57. min-width="120"
  58. align="center"
  59. ></el-table-column>
  60. <el-table-column
  61. prop="age"
  62. label="船龄"
  63. min-width="80"
  64. align="center"
  65. v-if="type == 2"
  66. ></el-table-column>
  67. <el-table-column label="操作" min-width="120" align="center">
  68. <template v-slot="scope">
  69. <el-button type="primary" link>详情</el-button>
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. <div class="df aic jcfe mt40 mr20">
  74. <el-pagination
  75. background
  76. layout="prev, pager, next"
  77. :current-page="currentPage"
  78. :total="total"
  79. @current-change="pageChange"
  80. ></el-pagination>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script setup>
  86. import { ref, h, reactive, toRefs, onMounted } from "vue";
  87. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  88. import store from "../../store";
  89. import router from "../../router";
  90. import md5 from "md5";
  91. import api from "../../apis/fetch";
  92. import { subTimeStr } from "../../utils/utils";
  93. function goToAdd() {
  94. router.push("/shipSecurityManage/checkShip");
  95. }
  96. let currentPage = ref(1);
  97. let term = ref("");
  98. let tableData = ref([]);
  99. let total = ref(0);
  100. let type = ref(3);
  101. async function getSecurityCheckShipList(page) {
  102. currentPage.value = page || currentPage.value;
  103. let res = await api.getSecurityCheckShipList({
  104. currentPage: currentPage.value,
  105. size: 10,
  106. term: term.value,
  107. type: type.value,
  108. });
  109. if (res.data.status == 0) {
  110. tableData.value = res.data.result;
  111. total.value = res.data.total;
  112. } else {
  113. tableData.value = [];
  114. total.value = 0;
  115. }
  116. }
  117. async function getSecurityTemplateDetail(id) {
  118. router.push({
  119. path: "/shipSecurityManage/shipCheckTemplateDetail",
  120. query: {
  121. id,
  122. },
  123. });
  124. }
  125. function pageChange(e) {
  126. currentPage.value = e;
  127. getSecurityCheckShipList();
  128. }
  129. onMounted(() => {
  130. getSecurityCheckShipList();
  131. });
  132. </script>
  133. <style scoped>
  134. .seach-btn {
  135. display: inline-block;
  136. width: 60px;
  137. height: 38px;
  138. background: #0094fe;
  139. border-radius: 2px;
  140. font-size: 14px;
  141. font-family: PingFangSC-Regular, PingFang SC;
  142. font-weight: 400;
  143. color: #ffffff;
  144. text-align: center;
  145. line-height: 38px;
  146. margin-left: 10px;
  147. cursor: pointer;
  148. }
  149. .cargo-owner-add {
  150. width: 80px;
  151. height: 32px;
  152. border-radius: 2px;
  153. border: 1px solid #0094fe;
  154. font-size: 14px;
  155. font-family: PingFangSC-Regular, PingFang SC;
  156. font-weight: 400;
  157. color: #0094fe;
  158. line-height: 32px;
  159. text-align: center;
  160. cursor: pointer;
  161. }
  162. :deep().el-dialog {
  163. width: 560px;
  164. padding: 20px 50px;
  165. border-radius: 6px;
  166. }
  167. :deep() .el-dialog__title {
  168. font-size: 18px;
  169. font-family: PingFangSC-Regular, PingFang SC;
  170. font-weight: 400;
  171. color: #0094fe;
  172. }
  173. </style>