certsManage.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="full-container-p24">
  3. <div class="mb30" style="margin-left: 200px">
  4. <el-button-group class="mr30">
  5. <el-button
  6. size="large"
  7. :type="type == 1 ? 'primary' : ''"
  8. @click="(currentPage = 1), (type = 1), getCertList()"
  9. >
  10. 当月
  11. </el-button>
  12. <el-button
  13. size="large"
  14. :type="type == 2 ? 'primary' : ''"
  15. @click="(currentPage = 1), (type = 2), getCertList()"
  16. >
  17. 下月
  18. </el-button>
  19. </el-button-group>
  20. </div>
  21. <div class="df">
  22. <div class="btns mr20 mt50">
  23. <div>
  24. <el-button
  25. size="large"
  26. :type="certType == 0 ? 'primary' : ''"
  27. @click="(currentPage = 1), (certType = 0), getCertList()"
  28. class="btn"
  29. >
  30. 船舶主要项目页
  31. </el-button>
  32. </div>
  33. <div>
  34. <el-button
  35. size="large"
  36. :type="certType == 1 ? 'primary' : ''"
  37. @click="(currentPage = 1), (certType = 1), getCertList()"
  38. class="btn"
  39. >
  40. 船舶国籍证书
  41. </el-button>
  42. </div>
  43. <div>
  44. <el-button
  45. size="large"
  46. :type="certType == 2 ? 'primary' : ''"
  47. @click="(currentPage = 1), (certType = 2), getCertList()"
  48. class="btn"
  49. >
  50. 内河船舶适航证书
  51. </el-button>
  52. </div>
  53. <div>
  54. <el-button
  55. size="large"
  56. :type="certType == 3 ? 'primary' : ''"
  57. @click="(currentPage = 1), (certType = 3), getCertList()"
  58. class="btn"
  59. >
  60. 船舶年审合格证书
  61. </el-button>
  62. </div>
  63. <div>
  64. <el-button
  65. size="large"
  66. :type="certType == 4 ? 'primary' : ''"
  67. @click="(currentPage = 1), (certType = 4), getCertList()"
  68. class="btn"
  69. >
  70. 内河船舶最低安全配员证书
  71. </el-button>
  72. </div>
  73. </div>
  74. <div>
  75. <el-table border :data="tableData" stripe style="width: 1000px">
  76. <el-table-column
  77. align="center"
  78. type="index"
  79. label="序号"
  80. width="80"
  81. />
  82. <el-table-column
  83. align="center"
  84. prop="shipname"
  85. label="船名"
  86. min-width="120"
  87. />
  88. <el-table-column
  89. align="center"
  90. prop="shipOwnerName"
  91. label="船东姓名"
  92. min-width="120"
  93. />
  94. <el-table-column
  95. align="center"
  96. prop="shipOwnerPhone"
  97. label="手机号"
  98. min-width="140"
  99. />
  100. <el-table-column
  101. align="center"
  102. prop="endValidTime"
  103. label="有效期"
  104. min-width="120"
  105. >
  106. <template v-slot="scope">
  107. {{ subTimeStr(scope.row.endValidTime) }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="详情" min-width="120">
  111. <template #default="scope">
  112. <el-button
  113. type="primary"
  114. text
  115. @click="goToDetail(scope.row.shipCode)"
  116. >
  117. 详情
  118. </el-button>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <div class="df aic jcfe mt40 mr20">
  123. <el-pagination
  124. :current-page="currentPage"
  125. @current-change="pageChange"
  126. background
  127. layout="prev, pager, next"
  128. :total="total"
  129. />
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </template>
  135. <script setup>
  136. import { ref, h, reactive, toRefs, onMounted } from "vue";
  137. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  138. import store from "../../store";
  139. import router from "../../router";
  140. import md5 from "md5";
  141. import api from "../../apis/fetch";
  142. import { useRoute } from "vue-router";
  143. import _ from "lodash";
  144. import { subTimeStr } from "../../utils/utils";
  145. const route = useRoute();
  146. let type = ref(1);
  147. let certType = ref(0);
  148. let tableData = ref([]);
  149. let total = ref(0);
  150. let currentPage = ref(1);
  151. async function getCertList() {
  152. let { data } = await api.getCertList({
  153. type: type.value,
  154. certType: certType.value,
  155. currentPage: currentPage.value,
  156. size: 10,
  157. });
  158. if (data.status == 0) {
  159. total.value = data.total;
  160. tableData.value = data.result;
  161. } else {
  162. total.value = 0;
  163. tableData.value = [];
  164. }
  165. }
  166. function pageChange(e) {
  167. currentPage.value = e;
  168. getCertList();
  169. }
  170. function goToDetail(shipCode) {
  171. router.push({
  172. path: "/shipManage/shipDetail",
  173. query: {
  174. shipCode,
  175. },
  176. });
  177. }
  178. onMounted(() => {
  179. getCertList();
  180. });
  181. </script>
  182. <style scoped>
  183. .btn {
  184. height: 50px;
  185. width: 180px;
  186. border-radius: 0;
  187. }
  188. </style>